Index: trunk/phase3/skins/common/config.js |
— | — | @@ -1,19 +1,9 @@ |
2 | 2 | (function( $ ) { |
3 | 3 | $( document ).ready( function() { |
4 | | - // Show/hide code for help text |
5 | | - $( '.config-show-help a' ).click( function() { |
6 | | - $(this).parent().siblings( '.config-help-message' ).show( 'slow' ); |
7 | | - $(this).parent().siblings( '.config-hide-help' ).show(); |
8 | | - $(this).parent().hide(); |
9 | | - return false; |
10 | | - } ); |
11 | | - $( '.config-hide-help a' ).click( function() { |
12 | | - $(this).parent().siblings( '.config-help-message' ).hide( 'slow' ); |
13 | | - $(this).parent().siblings( '.config-show-help' ).show(); |
14 | | - $(this).parent().hide(); |
15 | | - return false; |
16 | | - } ); |
17 | | - |
| 4 | + |
| 5 | + // Generate the tool tips |
| 6 | + $( '.mw-help-field-hint' ).tipsy( { gravity : 'se', opacity: '0.9' } ); |
| 7 | + |
18 | 8 | // Show/hide code for DB-specific options |
19 | 9 | // FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here? |
20 | 10 | $( '.dbRadio' ).each( function() { $( '#' + $(this).attr( 'rel' ) ).hide(); } ); |
Index: trunk/phase3/skins/common/config.css |
— | — | @@ -6,17 +6,23 @@ |
7 | 7 | .config-section { |
8 | 8 | margin-top: 2em; |
9 | 9 | } |
10 | | - |
11 | | -.config-label { |
12 | | - clear: left; |
| 10 | +.config-block { |
| 11 | + margin-top: 2em; |
| 12 | + display: block; |
| 13 | + |
| 14 | +} |
| 15 | +.config-block-label { |
| 16 | + display: block; |
| 17 | + margin-bottom: .2em; |
| 18 | +} |
| 19 | +.config-block-label label, .config-label { |
13 | 20 | font-weight: bold; |
14 | | - width: 10em; |
15 | | - float: left; |
16 | | - text-align: right; |
17 | | - padding-right: 1em; |
| 21 | + padding-right: .5em; |
18 | 22 | padding-top: .2em; |
19 | 23 | } |
20 | | - |
| 24 | +.config-block-elements { |
| 25 | + margin-left: 2em; |
| 26 | +} |
21 | 27 | .config-input { |
22 | 28 | clear: left; |
23 | 29 | zoom: 100%; /* IE hack */ |
— | — | @@ -38,7 +44,7 @@ |
39 | 45 | padding: 0.5em 2em 0.5em 2em; |
40 | 46 | /* 15em right margin to leave space for 12em page list */ |
41 | 47 | margin: 0.5em 15em 0.5em 0.5em; |
42 | | - border: 1px solid #aaa; |
| 48 | + background: #EEEEEE; |
43 | 49 | } |
44 | 50 | |
45 | 51 | .config-submit { |
Index: trunk/phase3/skins/common/images/help-question.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/skins/common/images/help-question.gif |
___________________________________________________________________ |
Added: svn:mime-type |
46 | 52 | + application/octet-stream |
Index: trunk/phase3/skins/common/images/help-question-hover.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/skins/common/images/help-question-hover.gif |
___________________________________________________________________ |
Added: svn:mime-type |
47 | 53 | + application/octet-stream |
Index: trunk/phase3/skins/common/images/tipsy-arrow.gif |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes on: trunk/phase3/skins/common/images/tipsy-arrow.gif |
___________________________________________________________________ |
Added: svn:mime-type |
48 | 54 | + application/octet-stream |
Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -913,3 +913,23 @@ |
914 | 914 | list-style-type: -moz-bengali; |
915 | 915 | list-style-type: bengali; |
916 | 916 | } |
| 917 | + |
| 918 | +/* tooltip styles */ |
| 919 | +.mw-help-field-hint { |
| 920 | + width: 11px; |
| 921 | + height: 24px; |
| 922 | + display: inline-block; |
| 923 | + padding: 0px; |
| 924 | + margin-left: 2px; |
| 925 | + margin-bottom: -8px; |
| 926 | + background: url('images/help-question.gif') 0 50% no-repeat; |
| 927 | +} |
| 928 | +.mw-help-field-hint:hover { |
| 929 | + background: url('images/help-question-hover.gif') 0 50% no-repeat; |
| 930 | +} |
| 931 | +.tipsy { padding: 5px 5px 10px; font-size: 12px; position: absolute; z-index: 100000; overflow: visible; } |
| 932 | +.tipsy-inner { padding: 5px 8px 4px 8px; background-color: #d6f3ff; color: black; border: 1px solid #5dc9f4; max-width: 300px; text-align: left; } |
| 933 | +.tipsy-arrow { position: absolute; background: url( 'images/tipsy-arrow.gif' ) no-repeat top left; width: 13px; height: 13px; } |
| 934 | +.tipsy-se .tipsy-arrow { bottom: -2px; right: 10px; background-position: 0% 100%; } |
| 935 | + |
| 936 | + |
Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -605,23 +605,14 @@ |
606 | 606 | array_shift( $args ); |
607 | 607 | $args = array_map( 'htmlspecialchars', $args ); |
608 | 608 | $text = wfMsgReal( $msg, $args, false, false, false ); |
609 | | - $html = $this->parse( $text, true ); |
610 | | - |
| 609 | + //$html = $this->parse( $text, true ); |
| 610 | + $html = $text; |
611 | 611 | return |
612 | | - "<div class=\"config-help-wrapper\">\n" . |
613 | | - "<div class=\"config-help-message\">\n" . |
614 | | - $html . |
615 | | - "</div>\n" . |
616 | | - "<div class=\"config-show-help\">\n" . |
617 | | - "<a href=\"#\">" . |
618 | | - wfMsgHtml( 'config-show-help' ) . |
619 | | - "</a></div>\n" . |
620 | | - "<div class=\"config-hide-help\">\n" . |
621 | | - "<a href=\"#\">" . |
622 | | - wfMsgHtml( 'config-hide-help' ) . |
623 | | - "</a></div>\n</div>\n"; |
| 612 | + "<span class=\"mw-help-field-hint\"\n" . |
| 613 | + " title=\"" . $html . "\"\n" . |
| 614 | + " original-title=\"" . $html . "\"></span>\n"; |
624 | 615 | } |
625 | | - |
| 616 | + |
626 | 617 | /** |
627 | 618 | * Output a help box. |
628 | 619 | */ |
— | — | @@ -662,7 +653,7 @@ |
663 | 654 | * Label a control by wrapping a config-input div around it and putting a |
664 | 655 | * label before it. |
665 | 656 | */ |
666 | | - public function label( $msg, $forId, $contents ) { |
| 657 | + public function label( $msg, $forId, $contents, $helpData = "" ) { |
667 | 658 | if ( strval( $msg ) == '' ) { |
668 | 659 | $labelText = ' '; |
669 | 660 | } else { |
— | — | @@ -676,14 +667,19 @@ |
677 | 668 | } |
678 | 669 | |
679 | 670 | return |
680 | | - "<div class=\"config-input\">\n" . |
| 671 | + "<div class=\"config-block\">\n" . |
| 672 | + " <div class=\"config-block-label\">\n" . |
681 | 673 | Xml::tags( 'label', |
682 | 674 | $attributes, |
683 | 675 | $labelText ) . "\n" . |
684 | | - $contents . |
| 676 | + $helpData . |
| 677 | + " </div>\n" . |
| 678 | + " <div class=\"config-block-elements\">\n" . |
| 679 | + $contents . |
| 680 | + " </div>\n" . |
685 | 681 | "</div>\n"; |
686 | 682 | } |
687 | | - |
| 683 | + |
688 | 684 | /** |
689 | 685 | * Get a labelled text box to configure a variable. |
690 | 686 | * |
— | — | @@ -694,6 +690,7 @@ |
695 | 691 | * attribs: Additional attributes for the input element (optional) |
696 | 692 | * controlName: The name for the input element (optional) |
697 | 693 | * value: The current value of the variable (optional) |
| 694 | + * help: The html for the help text (optional) |
698 | 695 | */ |
699 | 696 | public function getTextBox( $params ) { |
700 | 697 | if ( !isset( $params['controlName'] ) ) { |
— | — | @@ -707,7 +704,9 @@ |
708 | 705 | if ( !isset( $params['attribs'] ) ) { |
709 | 706 | $params['attribs'] = array(); |
710 | 707 | } |
711 | | - |
| 708 | + if ( !isset( $params['help'] ) ) { |
| 709 | + $params['help'] = ""; |
| 710 | + } |
712 | 711 | return |
713 | 712 | $this->label( |
714 | 713 | $params['label'], |
— | — | @@ -721,10 +720,11 @@ |
722 | 721 | 'class' => 'config-input-text', |
723 | 722 | 'tabindex' => $this->nextTabIndex() |
724 | 723 | ) |
725 | | - ) |
| 724 | + ), |
| 725 | + $params['help'] |
726 | 726 | ); |
727 | 727 | } |
728 | | - |
| 728 | + |
729 | 729 | /** |
730 | 730 | * Get a labelled password box to configure a variable. |
731 | 731 | * |
— | — | @@ -736,6 +736,7 @@ |
737 | 737 | * attribs: Additional attributes for the input element (optional) |
738 | 738 | * controlName: The name for the input element (optional) |
739 | 739 | * value: The current value of the variable (optional) |
| 740 | + * help: The html for the help text (optional) |
740 | 741 | */ |
741 | 742 | public function getPasswordBox( $params ) { |
742 | 743 | if ( !isset( $params['value'] ) ) { |
— | — | @@ -762,6 +763,7 @@ |
763 | 764 | * attribs: Additional attributes for the input element (optional) |
764 | 765 | * controlName: The name for the input element (optional) |
765 | 766 | * value: The current value of the variable (optional) |
| 767 | + * help: The html for the help text (optional) |
766 | 768 | */ |
767 | 769 | public function getCheckBox( $params ) { |
768 | 770 | if ( !isset( $params['controlName'] ) ) { |
— | — | @@ -775,7 +777,9 @@ |
776 | 778 | if ( !isset( $params['attribs'] ) ) { |
777 | 779 | $params['attribs'] = array(); |
778 | 780 | } |
779 | | - |
| 781 | + if ( !isset( $params['help'] ) ) { |
| 782 | + $params['help'] = ""; |
| 783 | + } |
780 | 784 | if( isset( $params['rawtext'] ) ) { |
781 | 785 | $labelText = $params['rawtext']; |
782 | 786 | } else { |
— | — | @@ -796,6 +800,7 @@ |
797 | 801 | ) . |
798 | 802 | $labelText . "\n" . |
799 | 803 | "</label>\n" . |
| 804 | + $params['help'] . |
800 | 805 | "</div>\n"; |
801 | 806 | } |
802 | 807 | |
— | — | @@ -812,6 +817,7 @@ |
813 | 818 | * commonAttribs Attribute array applied to all items |
814 | 819 | * controlName: The name for the input element (optional) |
815 | 820 | * value: The current value of the variable (optional) |
| 821 | + * help: The html for the help text (optional) |
816 | 822 | */ |
817 | 823 | public function getRadioSet( $params ) { |
818 | 824 | if ( !isset( $params['controlName'] ) ) { |
— | — | @@ -825,13 +831,12 @@ |
826 | 832 | if ( !isset( $params['label'] ) ) { |
827 | 833 | $label = ''; |
828 | 834 | } else { |
829 | | - $label = $this->parse( wfMsgNoTrans( $params['label'] ) ); |
| 835 | + $label = $params['label']; |
830 | 836 | } |
831 | | - |
832 | | - $s = "<label class=\"config-label\">\n" . |
833 | | - $label . |
834 | | - "</label>\n" . |
835 | | - "<ul class=\"config-settings-block\">\n"; |
| 837 | + if ( !isset( $params['help'] ) ) { |
| 838 | + $params['help'] = ""; |
| 839 | + } |
| 840 | + $s = "<ul>\n"; |
836 | 841 | foreach ( $params['values'] as $value ) { |
837 | 842 | $itemAttribs = array(); |
838 | 843 | |
— | — | @@ -859,7 +864,8 @@ |
860 | 865 | } |
861 | 866 | |
862 | 867 | $s .= "</ul>\n"; |
863 | | - return $s; |
| 868 | + |
| 869 | + return $this->label( $label, $params['controlName'], $s, $params['help'] ); |
864 | 870 | } |
865 | 871 | |
866 | 872 | /** |
Index: trunk/phase3/includes/installer/WebInstallerOutput.php |
— | — | @@ -9,11 +9,11 @@ |
10 | 10 | /** |
11 | 11 | * Output class modelled on OutputPage. |
12 | 12 | * |
13 | | - * I've opted to use a distinct class rather than derive from OutputPage here in |
14 | | - * the interests of separation of concerns: if we used a subclass, there would be |
15 | | - * quite a lot of things you could do in OutputPage that would break the installer, |
16 | | - * that wouldn't be immediately obvious. |
17 | | - * |
| 13 | + * I've opted to use a distinct class rather than derive from OutputPage here in |
| 14 | + * the interests of separation of concerns: if we used a subclass, there would be |
| 15 | + * quite a lot of things you could do in OutputPage that would break the installer, |
| 16 | + * that wouldn't be immediately obvious. |
| 17 | + * |
18 | 18 | * @ingroup Deployment |
19 | 19 | * @since 1.17 |
20 | 20 | */ |
— | — | @@ -21,9 +21,9 @@ |
22 | 22 | |
23 | 23 | /** |
24 | 24 | * The WebInstaller object this WebInstallerOutput is used by. |
25 | | - * |
| 25 | + * |
26 | 26 | * @var WebInstaller |
27 | | - */ |
| 27 | + */ |
28 | 28 | public $parent; |
29 | 29 | |
30 | 30 | public $contents = ''; |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Constructor. |
39 | | - * |
| 39 | + * |
40 | 40 | * @param $parent WebInstaller |
41 | 41 | */ |
42 | 42 | public function __construct( WebInstaller $parent ) { |
— | — | @@ -145,6 +145,7 @@ |
146 | 146 | <?php echo Html::linkedStyle( '../skins/common/config.css' ) . "\n"; ?> |
147 | 147 | <?php echo Html::inlineScript( "var dbTypes = " . Xml::encodeJsVar( $dbTypes ) ) . "\n"; ?> |
148 | 148 | <?php echo $this->getJQuery() . "\n"; ?> |
| 149 | + <?php echo $this->getJQueryTipsy() . "\n"; ?> |
149 | 150 | <?php echo Html::linkedScript( '../skins/common/config.js' ) . "\n"; ?> |
150 | 151 | </head> |
151 | 152 | |
— | — | @@ -209,6 +210,7 @@ |
210 | 211 | <?php echo Html::linkedStyle( '../skins/monobook/main.css' ) . "\n"; ?> |
211 | 212 | <?php echo Html::linkedStyle( '../skins/common/config.css' ) . "\n"; ?> |
212 | 213 | <?php echo $this->getJQuery(); ?> |
| 214 | + <?php echo $this->getJQueryTipsy() . "\n"; ?> |
213 | 215 | <?php echo Html::linkedScript( '../skins/common/config.js' ); ?> |
214 | 216 | </head> |
215 | 217 | |
— | — | @@ -224,7 +226,10 @@ |
225 | 227 | public function getJQuery() { |
226 | 228 | return Html::linkedScript( "../resources/jquery/jquery.js" ); |
227 | 229 | } |
228 | | - |
| 230 | + public function getJQueryTipsy() { |
| 231 | + return Html::linkedScript( "../resources/jquery/jquery.tipsy.js" ); |
| 232 | + } |
| 233 | + |
229 | 234 | public function outputWarnings() { |
230 | 235 | $this->addHTML( $this->warnings ); |
231 | 236 | $this->warnings = ''; |
Index: trunk/phase3/includes/installer/SqliteInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using SQLLite. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -41,10 +41,8 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | public function getConnectForm() { |
45 | | - return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir' ) . |
46 | | - $this->parent->getHelpBox( 'config-sqlite-dir-help' ) . |
47 | | - $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
48 | | - $this->parent->getHelpBox( 'config-sqlite-name-help' ); |
| 45 | + return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir', array(), $this->parent->getHelpBox( 'config-sqlite-dir-help' ) ) . |
| 46 | + $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-sqlite-name-help' ) ); |
49 | 47 | } |
50 | 48 | |
51 | 49 | public function submitConnectForm() { |
Index: trunk/phase3/includes/installer/DatabaseInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Base class for DBMS-specific installation helper classes. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -16,30 +16,30 @@ |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * The Installer object. |
20 | | - * |
| 20 | + * |
21 | 21 | * TODO: naming this parent is confusing, 'installer' would be clearer. |
22 | | - * |
| 22 | + * |
23 | 23 | * @var Installer |
24 | 24 | */ |
25 | 25 | public $parent; |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * The database connection. |
29 | | - * |
| 29 | + * |
30 | 30 | * @var DatabaseBase |
31 | 31 | */ |
32 | 32 | public $db; |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Internal variables for installation. |
36 | | - * |
| 36 | + * |
37 | 37 | * @var array |
38 | 38 | */ |
39 | 39 | protected $internalDefaults = array(); |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Array of MW configuration globals this class uses. |
43 | | - * |
| 43 | + * |
44 | 44 | * @var array |
45 | 45 | */ |
46 | 46 | protected $globalNames = array(); |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Get HTML for a web form that configures this database. Configuration |
60 | | - * at this time should be the minimum needed to connect and test |
| 60 | + * at this time should be the minimum needed to connect and test |
61 | 61 | * whether install or upgrade is required. |
62 | 62 | * |
63 | 63 | * If this is called, $this->parent can be assumed to be a WebInstaller. |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Set variables based on the request array, assuming it was submitted |
69 | | - * via the form returned by getConnectForm(). Validate the connection |
| 69 | + * via the form returned by getConnectForm(). Validate the connection |
70 | 70 | * settings by attempting to connect with them. |
71 | 71 | * |
72 | 72 | * If this is called, $this->parent can be assumed to be a WebInstaller. |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | /** |
79 | 79 | * Get HTML for a web form that retrieves settings used for installation. |
80 | 80 | * $this->parent can be assumed to be a WebInstaller. |
81 | | - * If the DB type has no settings beyond those already configured with |
| 81 | + * If the DB type has no settings beyond those already configured with |
82 | 82 | * getConnectForm(), this should return false. |
83 | 83 | */ |
84 | 84 | public function getSettingsForm() { |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | /** |
89 | 89 | * Set variables based on the request array, assuming it was submitted via |
90 | 90 | * the form return by getSettingsForm(). |
91 | | - * |
| 91 | + * |
92 | 92 | * @return Status |
93 | 93 | */ |
94 | 94 | public function submitSettingsForm() { |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Connect to the database using the administrative user/password currently |
100 | | - * defined in the session. On success, return the connection, on failure, |
| 100 | + * defined in the session. On success, return the connection, on failure, |
101 | 101 | * return a Status object. |
102 | 102 | * |
103 | 103 | * This may be called multiple times, so the result should be cached. |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | |
115 | 115 | /** |
116 | 116 | * Create database tables from scratch. |
117 | | - * |
| 117 | + * |
118 | 118 | * @return Status |
119 | 119 | */ |
120 | 120 | public function createTables() { |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | |
140 | 140 | /** |
141 | 141 | * Get the DBMS-specific options for LocalSettings.php generation. |
142 | | - * |
| 142 | + * |
143 | 143 | * @return String |
144 | 144 | */ |
145 | 145 | public abstract function getLocalSettings(); |
— | — | @@ -187,19 +187,19 @@ |
188 | 188 | */ |
189 | 189 | public function getGlobalNames() { |
190 | 190 | return $this->globalNames; |
191 | | - } |
| 191 | + } |
192 | 192 | |
193 | 193 | /** |
194 | 194 | * Return any table options to be applied to all tables that don't |
195 | 195 | * override them. |
196 | | - * |
| 196 | + * |
197 | 197 | * @return Array |
198 | 198 | */ |
199 | 199 | public function getTableOptions() { |
200 | 200 | return array(); |
201 | 201 | } |
202 | 202 | |
203 | | - /** |
| 203 | + /** |
204 | 204 | * Construct and initialise parent. |
205 | 205 | * This is typically only called from Installer::getDBInstaller() |
206 | 206 | */ |
— | — | @@ -210,7 +210,7 @@ |
211 | 211 | /** |
212 | 212 | * Convenience function. |
213 | 213 | * Check if a named extension is present. |
214 | | - * |
| 214 | + * |
215 | 215 | * @see wfDl |
216 | 216 | */ |
217 | 217 | protected static function checkExtension( $name ) { |
— | — | @@ -266,15 +266,19 @@ |
267 | 267 | /** |
268 | 268 | * Get a labelled text box to configure a local variable. |
269 | 269 | */ |
270 | | - public function getTextBox( $var, $label, $attribs = array() ) { |
| 270 | + public function getTextBox( $var, $label, $attribs = array(), $helpData = "" ) { |
271 | 271 | $name = $this->getName() . '_' . $var; |
272 | 272 | $value = $this->getVar( $var ); |
| 273 | + if ( !isset( $attribs ) ) { |
| 274 | + $attribs = array(); |
| 275 | + } |
273 | 276 | return $this->parent->getTextBox( array( |
274 | 277 | 'var' => $var, |
275 | 278 | 'label' => $label, |
276 | 279 | 'attribs' => $attribs, |
277 | 280 | 'controlName' => $name, |
278 | | - 'value' => $value |
| 281 | + 'value' => $value, |
| 282 | + 'help' => $helpData |
279 | 283 | ) ); |
280 | 284 | } |
281 | 285 | |
— | — | @@ -282,22 +286,26 @@ |
283 | 287 | * Get a labelled password box to configure a local variable. |
284 | 288 | * Implements password hiding. |
285 | 289 | */ |
286 | | - public function getPasswordBox( $var, $label, $attribs = array() ) { |
| 290 | + public function getPasswordBox( $var, $label, $attribs = array(), $helpData = "" ) { |
287 | 291 | $name = $this->getName() . '_' . $var; |
288 | 292 | $value = $this->getVar( $var ); |
| 293 | + if ( !isset( $attribs ) ) { |
| 294 | + $attribs = array(); |
| 295 | + } |
289 | 296 | return $this->parent->getPasswordBox( array( |
290 | 297 | 'var' => $var, |
291 | 298 | 'label' => $label, |
292 | 299 | 'attribs' => $attribs, |
293 | 300 | 'controlName' => $name, |
294 | | - 'value' => $value |
| 301 | + 'value' => $value, |
| 302 | + 'help' => $helpData |
295 | 303 | ) ); |
296 | 304 | } |
297 | 305 | |
298 | 306 | /** |
299 | 307 | * Get a labelled checkbox to configure a local boolean variable. |
300 | 308 | */ |
301 | | - public function getCheckBox( $var, $label, $attribs = array() ) { |
| 309 | + public function getCheckBox( $var, $label, $attribs = array(), $helpData = "" ) { |
302 | 310 | $name = $this->getName() . '_' . $var; |
303 | 311 | $value = $this->getVar( $var ); |
304 | 312 | return $this->parent->getCheckBox( array( |
— | — | @@ -306,6 +314,7 @@ |
307 | 315 | 'attribs' => $attribs, |
308 | 316 | 'controlName' => $name, |
309 | 317 | 'value' => $value, |
| 318 | + 'help' => $helpData |
310 | 319 | )); |
311 | 320 | } |
312 | 321 | |
— | — | @@ -338,11 +347,11 @@ |
339 | 348 | } |
340 | 349 | |
341 | 350 | /** |
342 | | - * Determine whether an existing installation of MediaWiki is present in |
343 | | - * the configured administrative connection. Returns true if there is |
| 351 | + * Determine whether an existing installation of MediaWiki is present in |
| 352 | + * the configured administrative connection. Returns true if there is |
344 | 353 | * such a wiki, false if the database doesn't exist. |
345 | 354 | * |
346 | | - * Traditionally, this is done by testing for the existence of either |
| 355 | + * Traditionally, this is done by testing for the existence of either |
347 | 356 | * the revision table or the cur table. |
348 | 357 | * |
349 | 358 | * @return Boolean |
— | — | @@ -366,9 +375,8 @@ |
367 | 376 | return |
368 | 377 | Xml::openElement( 'fieldset' ) . |
369 | 378 | Xml::element( 'legend', array(), wfMsg( 'config-db-install-account' ) ) . |
370 | | - $this->getTextBox( '_InstallUser', 'config-db-username' ) . |
371 | | - $this->getPasswordBox( '_InstallPassword', 'config-db-password' ) . |
372 | | - $this->parent->getHelpBox( 'config-db-install-help' ) . |
| 379 | + $this->getTextBox( '_InstallUser', 'config-db-username', array(), $this->parent->getHelpBox( 'config-db-install-username' ) ) . |
| 380 | + $this->getPasswordBox( '_InstallPassword', 'config-db-password', array(), $this->parent->getHelpBox( 'config-db-install-password' ) ) . |
373 | 381 | Xml::closeElement( 'fieldset' ); |
374 | 382 | } |
375 | 383 | |
— | — | @@ -389,7 +397,7 @@ |
390 | 398 | $name = $this->getName(); |
391 | 399 | $s = Xml::openElement( 'fieldset' ) . |
392 | 400 | Xml::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . |
393 | | - $this->getCheckBox( |
| 401 | + $this->getCheckBox( |
394 | 402 | '_SameAccount', 'config-db-web-account-same', |
395 | 403 | array( 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' ) |
396 | 404 | ) . |
— | — | @@ -408,7 +416,7 @@ |
409 | 417 | |
410 | 418 | /** |
411 | 419 | * Submit the form from getWebUserBox(). |
412 | | - * |
| 420 | + * |
413 | 421 | * @return Status |
414 | 422 | */ |
415 | 423 | public function submitWebUserBox() { |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using MySQL. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -59,14 +59,11 @@ |
60 | 60 | |
61 | 61 | public function getConnectForm() { |
62 | 62 | return |
63 | | - $this->getTextBox( 'wgDBserver', 'config-db-host' ) . |
64 | | - $this->parent->getHelpBox( 'config-db-host-help' ) . |
| 63 | + $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . |
65 | 64 | Xml::openElement( 'fieldset' ) . |
66 | 65 | Xml::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . |
67 | | - $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
68 | | - $this->parent->getHelpBox( 'config-db-name-help' ) . |
69 | | - $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) . |
70 | | - $this->parent->getHelpBox( 'config-db-prefix-help' ) . |
| 66 | + $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) . |
| 67 | + $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array(), $this->parent->getHelpBox( 'config-db-prefix-help' ) ) . |
71 | 68 | Xml::closeElement( 'fieldset' ) . |
72 | 69 | $this->getInstallUserBox(); |
73 | 70 | } |
— | — | @@ -120,7 +117,7 @@ |
121 | 118 | $this->getVar( '_InstallPassword' ), |
122 | 119 | false, |
123 | 120 | false, |
124 | | - 0, |
| 121 | + 0, |
125 | 122 | $this->getVar( 'wgDBprefix' ) |
126 | 123 | ); |
127 | 124 | $status->value = $this->db; |
— | — | @@ -252,12 +249,12 @@ |
253 | 250 | if ( count( $parts ) != 2 ) { |
254 | 251 | return false; |
255 | 252 | } |
256 | | - $quotedUser = $conn->addQuotes( $parts[0] ) . |
| 253 | + $quotedUser = $conn->addQuotes( $parts[0] ) . |
257 | 254 | '@' . $conn->addQuotes( $parts[1] ); |
258 | 255 | |
259 | 256 | // The user needs to have INSERT on mysql.* to be able to CREATE USER |
260 | 257 | // The grantee will be double-quoted in this query, as required |
261 | | - $res = $conn->select( 'INFORMATION_SCHEMA.USER_PRIVILEGES', '*', |
| 258 | + $res = $conn->select( 'INFORMATION_SCHEMA.USER_PRIVILEGES', '*', |
262 | 259 | array( 'GRANTEE' => $quotedUser ), __METHOD__ ); |
263 | 260 | $insertMysql = false; |
264 | 261 | $grantOptions = array_flip( $this->webUserPrivs ); |
— | — | @@ -273,7 +270,7 @@ |
274 | 271 | // Check for DB-specific privs for mysql.* |
275 | 272 | if ( !$insertMysql ) { |
276 | 273 | $row = $conn->selectRow( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', |
277 | | - array( |
| 274 | + array( |
278 | 275 | 'GRANTEE' => $quotedUser, |
279 | 276 | 'TABLE_SCHEMA' => 'mysql', |
280 | 277 | 'PRIVILEGE_TYPE' => 'INSERT', |
— | — | @@ -288,7 +285,7 @@ |
289 | 286 | } |
290 | 287 | |
291 | 288 | // Check for DB-level grant options |
292 | | - $res = $conn->select( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', |
| 289 | + $res = $conn->select( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', |
293 | 290 | array( |
294 | 291 | 'GRANTEE' => $quotedUser, |
295 | 292 | 'IS_GRANTABLE' => 1, |
— | — | @@ -322,9 +319,9 @@ |
323 | 320 | } |
324 | 321 | if ( count( $engines ) >= 2 ) { |
325 | 322 | $s .= $this->getRadioSet( array( |
326 | | - 'var' => '_MysqlEngine', |
327 | | - 'label' => 'config-mysql-engine', |
328 | | - 'itemLabelPrefix' => 'config-mysql-', |
| 323 | + 'var' => '_MysqlEngine', |
| 324 | + 'label' => 'config-mysql-engine', |
| 325 | + 'itemLabelPrefix' => 'config-mysql-', |
329 | 326 | 'values' => $engines |
330 | 327 | )); |
331 | 328 | $s .= $this->parent->getHelpBox( 'config-mysql-engine-help' ); |
— | — | @@ -369,13 +366,13 @@ |
370 | 367 | if ( !$create ) { |
371 | 368 | // Test the web account |
372 | 369 | try { |
373 | | - $webConn = new Database( |
| 370 | + $webConn = new Database( |
374 | 371 | $this->getVar( 'wgDBserver' ), |
375 | 372 | $this->getVar( 'wgDBuser' ), |
376 | 373 | $this->getVar( 'wgDBpassword' ), |
377 | 374 | false, |
378 | 375 | false, |
379 | | - 0, |
| 376 | + 0, |
380 | 377 | $this->getVar( 'wgDBprefix' ) |
381 | 378 | ); |
382 | 379 | } catch ( DBConnectionError $e ) { |
Index: trunk/phase3/includes/installer/OracleInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using Oracle. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -47,8 +47,7 @@ |
48 | 48 | Xml::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . |
49 | 49 | Xml::openElement( 'div', array( 'id' => 'dbOtherAccount' ) ) . |
50 | 50 | $this->getTextBox( 'wgDBuser', 'config-db-username' ) . |
51 | | - $this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) . |
52 | | - $this->parent->getHelpBox( 'config-db-web-help' ). |
| 51 | + $this->getPasswordBox( 'wgDBpassword', 'config-db-password', array(), $this->parent->getHelpBox( 'config-db-web-help' ) ) . |
53 | 52 | $this->getCheckBox( '_CreateDBAccount', 'config-db-web-create', array( 'disabled' => true ) ). |
54 | 53 | Xml::closeElement( 'div' ) . Xml::closeElement( 'fieldset' ); |
55 | 54 | } |
— | — | @@ -57,14 +56,12 @@ |
58 | 57 | $this->parent->setVar( '_InstallUser', 'sys' ); |
59 | 58 | $this->parent->setVar( 'wgDBserver', '' ); |
60 | 59 | return |
61 | | - $this->getTextBox( 'wgDBserver', 'config-db-host-oracle' ) . |
62 | | - $this->parent->getHelpBox( 'config-db-host-oracle-help' ) . |
| 60 | + $this->getTextBox( 'wgDBserver', 'config-db-host-oracle', array(), $this->parent->getHelpBox( 'config-db-host-oracle-help' ) ) . |
63 | 61 | Xml::openElement( 'fieldset' ) . |
64 | 62 | Xml::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . |
65 | 63 | $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) . |
66 | 64 | $this->getTextBox( '_OracleDefTS', 'config-oracle-def-ts' ) . |
67 | | - $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts' ) . |
68 | | - $this->parent->getHelpBox( 'config-db-oracle-help' ) . |
| 65 | + $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts', array(), $this->parent->getHelpBox( 'config-db-oracle-help' ) ) . |
69 | 66 | Xml::closeElement( 'fieldset' ) . |
70 | 67 | $this->getInstallUserBox(). |
71 | 68 | $this->getWebUserBox(); |
Index: trunk/phase3/includes/installer/PostgresInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using Postgres. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -36,23 +36,20 @@ |
37 | 37 | |
38 | 38 | function getConnectForm() { |
39 | 39 | return |
40 | | - $this->getTextBox( 'wgDBserver', 'config-db-host' ) . |
41 | | - $this->parent->getHelpBox( 'config-db-host-help' ) . |
| 40 | + $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . |
42 | 41 | $this->getTextBox( 'wgDBport', 'config-db-port' ) . |
43 | 42 | Xml::openElement( 'fieldset' ) . |
44 | 43 | Xml::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . |
45 | | - $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
46 | | - $this->parent->getHelpBox( 'config-db-name-help' ) . |
47 | | - $this->getTextBox( 'wgDBmwschema', 'config-db-schema' ) . |
| 44 | + $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) . |
| 45 | + $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array(), $this->parent->getHelpBox( 'config-db-schema-help' ) ) . |
48 | 46 | $this->getTextBox( 'wgDBts2schema', 'config-db-ts2-schema' ) . |
49 | | - $this->parent->getHelpBox( 'config-db-schema-help' ) . |
50 | 47 | Xml::closeElement( 'fieldset' ) . |
51 | 48 | $this->getInstallUserBox(); |
52 | 49 | } |
53 | 50 | |
54 | 51 | function submitConnectForm() { |
55 | 52 | // Get variables from the request |
56 | | - $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', |
| 53 | + $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', |
57 | 54 | 'wgDBname', 'wgDBmwschema', 'wgDBts2schema' ) ); |
58 | 55 | |
59 | 56 | // Validate them |
Index: trunk/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Abstract class to define pages for the web installer. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * The WebInstaller object this WebInstallerPage belongs to. |
20 | | - * |
| 20 | + * |
21 | 21 | * @var WebInstaller |
22 | 22 | */ |
23 | 23 | public $parent; |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Constructor. |
29 | | - * |
| 29 | + * |
30 | 30 | * @param $parent WebInstaller |
31 | 31 | */ |
32 | 32 | public function __construct( WebInstaller $parent ) { |
— | — | @@ -216,13 +216,15 @@ |
217 | 217 | } |
218 | 218 | $this->startForm(); |
219 | 219 | $s = Html::hidden( 'LanguageRequestTime', time() ) . |
220 | | - $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang ) . |
221 | | - $this->parent->getHelpBox( 'config-your-language-help' ) . |
222 | | - $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang ) . |
223 | | - $this->parent->getHelpBox( 'config-wiki-language-help' ) . |
224 | | - $this->parent->getCheckBox( |
225 | | - array( 'var' => '_ExternalHTTP', 'label' => 'config-allow-requests' ) |
226 | | - ) . $this->parent->getHelpBox( 'config-allow-requests-help' ); |
| 220 | + $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang, $this->parent->getHelpBox( 'config-your-language-help' ) ) . |
| 221 | + $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang, $this->parent->getHelpBox( 'config-wiki-language-help' ) ) . |
| 222 | + $this->parent->getCheckBox( |
| 223 | + array( |
| 224 | + 'var' => '_ExternalHTTP', |
| 225 | + 'label' => 'config-allow-requests', |
| 226 | + 'help' => $this->parent->getHelpBox( 'config-allow-requests-help' ) |
| 227 | + ) |
| 228 | + ); |
227 | 229 | |
228 | 230 | $this->addHTML( $s ); |
229 | 231 | $this->endForm(); |
— | — | @@ -259,7 +261,7 @@ |
260 | 262 | $this->parent->output->addWikiText( wfMsgNoTrans( 'config-welcome' ) ); |
261 | 263 | $status = $this->parent->doEnvironmentChecks(); |
262 | 264 | if ( $status ) { |
263 | | - $this->parent->output->addWikiText( wfMsgNoTrans( 'config-copyright', |
| 265 | + $this->parent->output->addWikiText( wfMsgNoTrans( 'config-copyright', |
264 | 266 | SpecialVersion::getCopyrightAndAuthorList() ) ); |
265 | 267 | $this->startForm(); |
266 | 268 | $this->endForm(); |
— | — | @@ -291,7 +293,7 @@ |
292 | 294 | $dbSupport = ''; |
293 | 295 | foreach( $this->parent->getDBTypes() as $type ) { |
294 | 296 | $db = 'Database' . ucfirst( $type ); |
295 | | - $dbSupport .= wfMsgNoTrans( "config-support-$type", |
| 297 | + $dbSupport .= wfMsgNoTrans( "config-support-$type", |
296 | 298 | call_user_func( array( $db, 'getSoftwareLink' ) ) ) . "\n"; |
297 | 299 | } |
298 | 300 | $this->addHTML( $this->parent->getInfoBox( |
— | — | @@ -460,21 +462,22 @@ |
461 | 463 | $this->parent->getTextBox( array( |
462 | 464 | 'var' => 'wgSitename', |
463 | 465 | 'label' => 'config-site-name', |
| 466 | + 'help' => $this->parent->getHelpBox( 'config-site-name-help' ) |
464 | 467 | ) ) . |
465 | | - $this->parent->getHelpBox( 'config-site-name-help' ) . |
466 | 468 | $this->parent->getRadioSet( array( |
467 | 469 | 'var' => '_NamespaceType', |
468 | 470 | 'label' => 'config-project-namespace', |
469 | 471 | 'itemLabelPrefix' => 'config-ns-', |
470 | 472 | 'values' => array( 'site-name', 'generic', 'other' ), |
471 | 473 | 'commonAttribs' => array( 'class' => 'enableForOther', 'rel' => 'config_wgMetaNamespace' ), |
| 474 | + 'help' => $this->parent->getHelpBox( 'config-project-namespace-help' ) |
472 | 475 | ) ) . |
473 | 476 | $this->parent->getTextBox( array( |
474 | 477 | 'var' => 'wgMetaNamespace', |
475 | 478 | 'label' => '', |
476 | 479 | 'attribs' => array( 'disabled' => '' ), |
| 480 | + |
477 | 481 | ) ) . |
478 | | - $this->parent->getHelpBox( 'config-project-namespace-help' ) . |
479 | 482 | $this->getFieldSetStart( 'config-admin-box' ) . |
480 | 483 | $this->parent->getTextBox( array( |
481 | 484 | 'var' => '_AdminName', |
— | — | @@ -483,22 +486,22 @@ |
484 | 487 | $this->parent->getPasswordBox( array( |
485 | 488 | 'var' => '_AdminPassword', |
486 | 489 | 'label' => 'config-admin-password', |
| 490 | + 'help' => $this->parent->getHelpBox( 'config-admin-help' ) |
487 | 491 | ) ) . |
488 | 492 | $this->parent->getPasswordBox( array( |
489 | 493 | 'var' => '_AdminPassword2', |
490 | 494 | 'label' => 'config-admin-password-confirm' |
491 | 495 | ) ) . |
492 | | - $this->parent->getHelpBox( 'config-admin-help' ) . |
493 | 496 | $this->parent->getTextBox( array( |
494 | 497 | 'var' => '_AdminEmail', |
495 | | - 'label' => 'config-admin-email' |
| 498 | + 'label' => 'config-admin-email', |
| 499 | + 'help' => $this->parent->getHelpBox( 'config-admin-email-help' ) |
496 | 500 | ) ) . |
497 | | - $this->parent->getHelpBox( 'config-admin-email-help' ) . |
498 | 501 | $this->parent->getCheckBox( array( |
499 | 502 | 'var' => '_Subscribe', |
500 | | - 'label' => 'config-subscribe' |
| 503 | + 'label' => 'config-subscribe', |
| 504 | + 'help' => $this->parent->getHelpBox( 'config-subscribe-help' ) |
501 | 505 | ) ) . |
502 | | - $this->parent->getHelpBox( 'config-subscribe-help' ) . |
503 | 506 | $this->getFieldSetEnd() . |
504 | 507 | $this->parent->getInfoBox( wfMsg( 'config-almost-done' ) ) . |
505 | 508 | $this->parent->getRadioSet( array( |
— | — | @@ -580,9 +583,12 @@ |
581 | 584 | |
582 | 585 | // Validate password |
583 | 586 | $msg = false; |
| 587 | + $valid = false; |
584 | 588 | $pwd = $this->getVar( '_AdminPassword' ); |
585 | 589 | $user = User::newFromName( $cname ); |
586 | | - $valid = $user->getPasswordValidity( $pwd ); |
| 590 | + if ( ( isset ( $pwd ) ) && ( $user != null ) ) { |
| 591 | + $valid = $user->getPasswordValidity( $pwd ); |
| 592 | + } |
587 | 593 | if ( strval( $pwd ) === '' ) { |
588 | 594 | # $user->getPasswordValidity just checks for $wgMinimalPasswordLength. |
589 | 595 | # This message is more specific and helpful. |
— | — | @@ -690,31 +696,31 @@ |
691 | 697 | } |
692 | 698 | |
693 | 699 | $extHtml .= $this->parent->getHelpBox( 'config-extensions-help' ) . |
694 | | - $this->getFieldSetEnd(); |
| 700 | + $this->getFieldSetEnd(); |
695 | 701 | $this->addHTML( $extHtml ); |
696 | 702 | } |
697 | 703 | |
698 | 704 | $this->addHTML( |
699 | 705 | # Uploading |
700 | 706 | $this->getFieldSetStart( 'config-upload-settings' ) . |
701 | | - $this->parent->getCheckBox( array( |
| 707 | + $this->parent->getCheckBox( array( |
702 | 708 | 'var' => 'wgEnableUploads', |
703 | 709 | 'label' => 'config-upload-enable', |
704 | 710 | 'attribs' => array( 'class' => 'showHideRadio', 'rel' => 'uploadwrapper' ), |
| 711 | + 'help' => $this->parent->getHelpBox( 'config-upload-help' ) |
705 | 712 | ) ) . |
706 | | - $this->parent->getHelpBox( 'config-upload-help' ) . |
707 | 713 | '<div id="uploadwrapper" style="display: none;">' . |
708 | | - $this->parent->getTextBox( array( |
| 714 | + $this->parent->getTextBox( array( |
709 | 715 | 'var' => 'wgDeletedDirectory', |
710 | 716 | 'label' => 'config-upload-deleted', |
| 717 | + 'help' => $this->parent->getHelpBox( 'config-upload-deleted-help' ) |
711 | 718 | ) ) . |
712 | | - $this->parent->getHelpBox( 'config-upload-deleted-help' ) . |
713 | 719 | '</div>' . |
714 | 720 | $this->parent->getTextBox( array( |
715 | 721 | 'var' => 'wgLogo', |
716 | | - 'label' => 'config-logo' |
717 | | - ) ) . |
718 | | - $this->parent->getHelpBox( 'config-logo-help' ) |
| 722 | + 'label' => 'config-logo', |
| 723 | + 'help' => $this->parent->getHelpBox( 'config-logo-help' ) |
| 724 | + ) ) |
719 | 725 | ); |
720 | 726 | $canUse = $this->getVar( '_ExternalHTTP' ) ? |
721 | 727 | 'config-instantcommons-good' : 'config-instantcommons-bad'; |
— | — | @@ -722,8 +728,8 @@ |
723 | 729 | $this->parent->getCheckBox( array( |
724 | 730 | 'var' => 'wgUseInstantCommons', |
725 | 731 | 'label' => 'config-instantcommons', |
| 732 | + 'help' => $this->parent->getHelpBox( 'config-instantcommons-help', wfMsgNoTrans( $canUse ) ) |
726 | 733 | ) ) . |
727 | | - $this->parent->getHelpBox( 'config-instantcommons-help', wfMsgNoTrans( $canUse ) ) . |
728 | 734 | $this->getFieldSetEnd() |
729 | 735 | ); |
730 | 736 | |
— | — | @@ -749,8 +755,9 @@ |
750 | 756 | $this->parent->getTextBox( array( |
751 | 757 | 'var' => '_MemCachedServers', |
752 | 758 | 'label' => 'config-memcached-servers', |
| 759 | + 'help' => $this->parent->getHelpBox( 'config-memcached-help' ) |
753 | 760 | ) ) . |
754 | | - $this->parent->getHelpBox( 'config-memcached-help' ) . '</div>' . |
| 761 | + '</div>' . |
755 | 762 | $this->getFieldSetEnd() |
756 | 763 | ); |
757 | 764 | $this->endForm(); |
Index: trunk/phase3/resources/jquery/jquery.tipsy.js |
— | — | @@ -0,0 +1,202 @@ |
| 2 | +// tipsy, facebook style tooltips for jquery |
| 3 | +// version 1.0.0a |
| 4 | +// (c) 2008-2010 jason frame [jason@onehackoranother.com] |
| 5 | +// released under the MIT license |
| 6 | + |
| 7 | +(function($) { |
| 8 | + |
| 9 | + function Tipsy(element, options) { |
| 10 | + this.$element = $(element); |
| 11 | + this.options = options; |
| 12 | + this.enabled = true; |
| 13 | + this.fixTitle(); |
| 14 | + } |
| 15 | + |
| 16 | + Tipsy.prototype = { |
| 17 | + show: function() { |
| 18 | + var title = this.getTitle(); |
| 19 | + if (title && this.enabled) { |
| 20 | + var $tip = this.tip(); |
| 21 | + |
| 22 | + $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); |
| 23 | + $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity |
| 24 | + $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body); |
| 25 | + |
| 26 | + var pos = $.extend({}, this.$element.offset(), { |
| 27 | + width: this.$element[0].offsetWidth, |
| 28 | + height: this.$element[0].offsetHeight |
| 29 | + }); |
| 30 | + |
| 31 | + var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight; |
| 32 | + var gravity = (typeof this.options.gravity == 'function') |
| 33 | + ? this.options.gravity.call(this.$element[0]) |
| 34 | + : this.options.gravity; |
| 35 | + |
| 36 | + var tp; |
| 37 | + switch (gravity.charAt(0)) { |
| 38 | + case 'n': |
| 39 | + tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; |
| 40 | + break; |
| 41 | + case 's': |
| 42 | + tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; |
| 43 | + break; |
| 44 | + case 'e': |
| 45 | + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; |
| 46 | + break; |
| 47 | + case 'w': |
| 48 | + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; |
| 49 | + break; |
| 50 | + } |
| 51 | + |
| 52 | + if (gravity.length == 2) { |
| 53 | + if (gravity.charAt(1) == 'w') { |
| 54 | + tp.left = pos.left + pos.width / 2 - 15; |
| 55 | + } else { |
| 56 | + tp.left = pos.left + pos.width / 2 - actualWidth + 15; |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + $tip.css(tp).addClass('tipsy-' + gravity); |
| 61 | + |
| 62 | + if (this.options.fade) { |
| 63 | + $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); |
| 64 | + } else { |
| 65 | + $tip.css({visibility: 'visible', opacity: this.options.opacity}); |
| 66 | + } |
| 67 | + } |
| 68 | + }, |
| 69 | + |
| 70 | + hide: function() { |
| 71 | + if (this.options.fade) { |
| 72 | + this.tip().stop().fadeOut(function() { $(this).remove(); }); |
| 73 | + } else { |
| 74 | + this.tip().remove(); |
| 75 | + } |
| 76 | + }, |
| 77 | + |
| 78 | + fixTitle: function() { |
| 79 | + var $e = this.$element; |
| 80 | + if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { |
| 81 | + $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); |
| 82 | + } |
| 83 | + }, |
| 84 | + |
| 85 | + getTitle: function() { |
| 86 | + var title, $e = this.$element, o = this.options; |
| 87 | + this.fixTitle(); |
| 88 | + var title, o = this.options; |
| 89 | + if (typeof o.title == 'string') { |
| 90 | + title = $e.attr(o.title == 'title' ? 'original-title' : o.title); |
| 91 | + } else if (typeof o.title == 'function') { |
| 92 | + title = o.title.call($e[0]); |
| 93 | + } |
| 94 | + title = ('' + title).replace(/(^\s*|\s*$)/, ""); |
| 95 | + return title || o.fallback; |
| 96 | + }, |
| 97 | + |
| 98 | + tip: function() { |
| 99 | + if (!this.$tip) { |
| 100 | + this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'); |
| 101 | + } |
| 102 | + return this.$tip; |
| 103 | + }, |
| 104 | + |
| 105 | + validate: function() { |
| 106 | + if (!this.$element[0].parentNode) { |
| 107 | + this.hide(); |
| 108 | + this.$element = null; |
| 109 | + this.options = null; |
| 110 | + } |
| 111 | + }, |
| 112 | + |
| 113 | + enable: function() { this.enabled = true; }, |
| 114 | + disable: function() { this.enabled = false; }, |
| 115 | + toggleEnabled: function() { this.enabled = !this.enabled; } |
| 116 | + }; |
| 117 | + |
| 118 | + $.fn.tipsy = function(options) { |
| 119 | + |
| 120 | + if (options === true) { |
| 121 | + return this.data('tipsy'); |
| 122 | + } else if (typeof options == 'string') { |
| 123 | + var tipsy = this.data('tipsy'); |
| 124 | + if (tipsy) tipsy[options](); |
| 125 | + return this; |
| 126 | + } |
| 127 | + |
| 128 | + options = $.extend({}, $.fn.tipsy.defaults, options); |
| 129 | + |
| 130 | + function get(ele) { |
| 131 | + var tipsy = $.data(ele, 'tipsy'); |
| 132 | + if (!tipsy) { |
| 133 | + tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); |
| 134 | + $.data(ele, 'tipsy', tipsy); |
| 135 | + } |
| 136 | + return tipsy; |
| 137 | + } |
| 138 | + |
| 139 | + function enter() { |
| 140 | + var tipsy = get(this); |
| 141 | + tipsy.hoverState = 'in'; |
| 142 | + if (options.delayIn == 0) { |
| 143 | + tipsy.show(); |
| 144 | + } else { |
| 145 | + tipsy.fixTitle(); |
| 146 | + setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); |
| 147 | + } |
| 148 | + }; |
| 149 | + |
| 150 | + function leave() { |
| 151 | + var tipsy = get(this); |
| 152 | + tipsy.hoverState = 'out'; |
| 153 | + if (options.delayOut == 0) { |
| 154 | + tipsy.hide(); |
| 155 | + } else { |
| 156 | + setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); |
| 157 | + } |
| 158 | + }; |
| 159 | + |
| 160 | + if (!options.live) this.each(function() { get(this); }); |
| 161 | + |
| 162 | + if (options.trigger != 'manual') { |
| 163 | + var binder = options.live ? 'live' : 'bind', |
| 164 | + eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', |
| 165 | + eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; |
| 166 | + this[binder](eventIn, enter)[binder](eventOut, leave); |
| 167 | + } |
| 168 | + |
| 169 | + return this; |
| 170 | + |
| 171 | + }; |
| 172 | + |
| 173 | + $.fn.tipsy.defaults = { |
| 174 | + delayIn: 0, |
| 175 | + delayOut: 0, |
| 176 | + fade: false, |
| 177 | + fallback: '', |
| 178 | + gravity: 'n', |
| 179 | + html: false, |
| 180 | + live: false, |
| 181 | + offset: 0, |
| 182 | + opacity: 0.8, |
| 183 | + title: 'title', |
| 184 | + trigger: 'hover' |
| 185 | + }; |
| 186 | + |
| 187 | + // Overwrite this method to provide options on a per-element basis. |
| 188 | + // For example, you could store the gravity in a 'tipsy-gravity' attribute: |
| 189 | + // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); |
| 190 | + // (remember - do not modify 'options' in place!) |
| 191 | + $.fn.tipsy.elementOptions = function(ele, options) { |
| 192 | + return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; |
| 193 | + }; |
| 194 | + |
| 195 | + $.fn.tipsy.autoNS = function() { |
| 196 | + return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; |
| 197 | + }; |
| 198 | + |
| 199 | + $.fn.tipsy.autoWE = function() { |
| 200 | + return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; |
| 201 | + }; |
| 202 | + |
| 203 | +})(jQuery); |