r112714 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112713‎ | r112714 | r112715 >
Date:20:12, 29 February 2012
Author:foxtrott
Status:deferred
Tags:
Comment:
using resource loader (MW1.16 compatibility dropped); some refactoring
Modified paths:
  • /trunk/extensions/SemanticFormsInputs/SemanticFormsInputs.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/includes/SFI_DateTimePicker.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/includes/SFI_MenuSelect.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/includes/SFI_RegExp.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/includes/SFI_TimePicker.php (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/datepicker.js (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/datetimepicker.js (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/menuselect.js (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/regexp.js (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/timepicker.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticFormsInputs/SemanticFormsInputs.php
@@ -9,7 +9,7 @@
1010 * @author Jeroen de Dauw
1111 * @author Sanyam Goyal
1212 *
13 - * @version 0.5
 13+ * @version 0.6 alpha
1414 */
1515
1616 /**
@@ -23,15 +23,19 @@
2424 die( 'This file is part of a MediaWiki extension, it is not a valid entry point.' );
2525 }
2626
 27+if ( version_compare( $wgVersion, '1.17', 'lt' ) ) {
 28+ die( '<b>Error:</b> This version of <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs">Semantic Forms Inputs</a> is only compatible with MediaWiki 1.17 or above. You need to upgrade MediaWiki first.' );
 29+}
 30+
2731 if ( !defined( 'SF_VERSION' ) ) {
2832 die( '<b>Error:</b> <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs">Semantic Forms Inputs</a> is a Semantic Forms extension. You need to install <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
2933 }
3034
31 -if ( version_compare( SF_VERSION, '2.3.1', 'lt' ) ) {
32 - die( '<b>Error:</b> This version of <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs">Semantic Forms Inputs</a> is only compatible with Semantic Forms 2.3.1 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
 35+if ( version_compare( SF_VERSION, '2.4.1-alpha', 'lt' ) ) {
 36+ die( '<b>Error:</b> This version of <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs">Semantic Forms Inputs</a> is only compatible with Semantic Forms 2.4.1 or above. You need to upgrade <a href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms">Semantic Forms</a> first.' );
3337 }
3438
35 -define( 'SFI_VERSION', '0.5' );
 39+define( 'SFI_VERSION', '0.6 alpha' );
3640
3741 // create and initialize settings
3842 $sfigSettings = new SFISettings();
@@ -61,6 +65,55 @@
6266 $wgAutoloadClasses['SFIMenuSelect'] = $dir . '/includes/SFI_MenuSelect.php';
6367 $wgAutoloadClasses['SFIRegExp'] = $dir . '/includes/SFI_RegExp.php';
6468
 69+$wgResourceModules['ext.semanticformsinputs.datepicker'] = array(
 70+ 'localBasePath' => $dir,
 71+ 'remoteExtPath' => 'SemanticFormsInputs',
 72+ 'scripts' => 'libs/datepicker.js',
 73+ 'dependencies' => array(
 74+ 'jquery.ui.datepicker',
 75+ 'ext.semanticforms.main'
 76+ ),
 77+);
 78+
 79+$wgResourceModules['ext.semanticformsinputs.timepicker'] = array(
 80+ 'localBasePath' => $dir,
 81+ 'remoteExtPath' => 'SemanticFormsInputs',
 82+ 'scripts' => 'libs/timepicker.js',
 83+ 'styles' => 'skins/SFI_Timepicker.css',
 84+ 'dependencies' => array(
 85+ 'ext.semanticforms.main'
 86+ ),
 87+);
 88+
 89+$wgResourceModules['ext.semanticformsinputs.datetimepicker'] = array(
 90+ 'localBasePath' => $dir,
 91+ 'remoteExtPath' => 'SemanticFormsInputs',
 92+ 'scripts' => 'libs/datetimepicker.js',
 93+ 'dependencies' => array(
 94+ 'ext.semanticformsinputs.timepicker',
 95+ 'ext.semanticformsinputs.datepicker'
 96+ ),
 97+);
 98+
 99+$wgResourceModules['ext.semanticformsinputs.menuselect'] = array(
 100+ 'localBasePath' => $dir,
 101+ 'remoteExtPath' => 'SemanticFormsInputs',
 102+ 'scripts' => 'libs/menuselect.js',
 103+ 'styles' => 'skins/SFI_Menuselect.css',
 104+ 'dependencies' => array(
 105+ 'ext.semanticforms.main'
 106+ ),
 107+);
 108+
 109+$wgResourceModules['ext.semanticformsinputs.regexp'] = array(
 110+ 'localBasePath' => $dir,
 111+ 'remoteExtPath' => 'SemanticFormsInputs',
 112+ 'scripts' => 'libs/regexp.js',
 113+ 'dependencies' => array(
 114+ 'ext.semanticforms.main'
 115+ ),
 116+);
 117+
65118 /**
66119 * Class to encapsulate all settings
67120 */
Index: trunk/extensions/SemanticFormsInputs/includes/SFI_DateTimePicker.php
@@ -40,8 +40,6 @@
4141
4242 parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args );
4343
44 - self::setup();
45 -
4644 // prepare sub-inputs
4745
4846 $this->mOtherArgs["part of dtp"] = true;
@@ -97,26 +95,6 @@
9896 return 'datetimepicker';
9997 }
10098
101 - /**
102 - * Static setup method for input type "menuselect".
103 - * Adds the Javascript code and css used by all menuselects.
104 - */
105 - static private function setup() {
106 -
107 - global $wgOut;
108 - global $sfigSettings;
109 -
110 - static $hasRun = false;
111 -
112 - if ( !$hasRun ) {
113 - $hasRun = true;
114 -
115 - $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/datetimepicker.js"></script> ' );
116 -
117 - }
118 -
119 - }
120 -
12199 protected function setupJsInitAttribs() {
122100
123101 global $sfigSettings;
@@ -194,24 +172,13 @@
195173
196174 /**
197175 * Returns the set of parameters for this form input.
198 - *
199 - * TODO: Specify parameters specific for menuselect.
200176 */
201177 public static function getParameters() {
202 - $params = parent::getParameters();
203 -
204 - $params[] = array(
205 - 'name' => 'structure',
206 - 'type' => 'text',
207 - 'description' => wfMsg( 'semanticformsinputs-menuselect-structure' ),
208 - 'default' => "* item 1\n** item 11\n** item 12\n* item 2\n** item 21\n** item 22"
 178+ return array_merge(
 179+ parent::getParameters(),
 180+ SFIDatePicker::getParameters(),
 181+ SFITimePicker::getParameters()
209182 );
210 - $params[] = array(
211 - 'name' => $sfigSettings->menuSelectDisableInputField?'enable input field':'disable input field',
212 - 'type' => 'boolean',
213 - 'description' => wfMsg( 'semanticformsinputs-menuselect-enableinputfield' ),
214 - );
215 - return $params;
216183 }
217184
218185 /**
@@ -227,4 +194,16 @@
228195
229196 }
230197
 198+ /**
 199+ * Returns the names of the resource modules this input type uses.
 200+ *
 201+ * Returns the names of the modules as an array or - if there is only one
 202+ * module - as a string.
 203+ *
 204+ * @return null|string|array
 205+ */
 206+ public function getResourceModuleNames() {
 207+ return 'ext.semanticformsinputs.datetimepicker';
 208+ }
 209+
231210 }
Index: trunk/extensions/SemanticFormsInputs/includes/SFI_RegExp.php
@@ -42,9 +42,6 @@
4343
4444 parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args );
4545
46 - // call static setup
47 - self::setup();
48 -
4946 // set OR character
5047 if ( array_key_exists( 'or char', $this->mOtherArgs ) ) {
5148 $orChar = trim( $this->mOtherArgs['or char'] );
@@ -53,7 +50,6 @@
5451 $orChar = '!';
5552 }
5653
57 -
5854 // set regexp string
5955 if ( array_key_exists( 'regexp', $this->mOtherArgs ) ) {
6056
@@ -151,20 +147,23 @@
152148 }
153149
154150 /**
155 - * Static setup method for input type "menuselect".
156 - * Adds the Javascript code and css used by all menuselects.
 151+ * Returns the names of the resource modules this input type uses.
 152+ *
 153+ * Returns the names of the modules as an array or - if there is only one
 154+ * module - as a string.
 155+ *
 156+ * @return null|string|array
157157 */
158 - static private function setup() {
159 -
160 - global $wgOut;
161 - global $sfigSettings;
162 -
163 - static $hasRun = false;
164 -
165 - if ( !$hasRun ) {
166 - $hasRun = true;
167 - $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/regexp.js"></script> ' );
 158+ public function getResourceModuleNames() {
 159+ $modules = $this->mBaseInput->getResourceModuleNames();
 160+ if ( is_array( $modules ) ) {
 161+ return array_merge( $modules, array( 'ext.semanticformsinputs.regexp' ));
 162+ } elseif ( is_string( $modules ) ) {
 163+ return array( $modules, 'ext.semanticformsinputs.regexp' );
 164+ } else {
 165+ return 'ext.semanticformsinputs.regexp';
168166 }
 167+
169168 }
170169
171170 /**
@@ -172,38 +171,37 @@
173172 */
174173 public static function getParameters() {
175174 $params = parent::getParameters();
176 - $params[] = array(
 175+ $params['regexp'] = array(
177176 'name' => 'regexp',
178177 'type' => 'string',
179178 'description' => wfMsg( 'semanticformsinputs-regexp-regexp' )
180179 );
181 - $params[] = array(
 180+ $params['base type'] = array(
182181 'name' => 'base type',
183182 'type' => 'string',
184183 'description' => wfMsg( 'semanticformsinputs-regexp-basetype' )
185184 );
186 - $params[] = array(
 185+ $params['base prefix'] = array(
187186 'name' => 'base prefix',
188187 'type' => 'string',
189188 'description' => wfMsg( 'semanticformsinputs-regexp-baseprefix' )
190189 );
191 - $params[] = array(
 190+ $params['or char'] = array(
192191 'name' => 'or char',
193192 'type' => 'string',
194193 'description' => wfMsg( 'semanticformsinputs-regexp-orchar' )
195194 );
196 - $params[] = array(
 195+ $params['inverse'] = array(
197196 'name' => 'inverse',
198197 'type' => 'string',
199198 'description' => wfMsg( 'semanticformsinputs-regexp-inverse' )
200199 );
201 - $params[] = array(
 200+ $params['message'] = array(
202201 'name' => 'message',
203202 'type' => 'string',
204203 'description' => wfMsg( 'semanticformsinputs-regexp-message' )
205204 );
206205
207 -
208206 return $params;
209207 }
210208
Index: trunk/extensions/SemanticFormsInputs/includes/SFI_DatePicker.php
@@ -56,28 +56,40 @@
5757 }
5858
5959 /**
 60+ * Returns the names of the resource modules this input type uses.
 61+ *
 62+ * Returns the names of the modules as an array or - if there is only one
 63+ * module - as a string.
 64+ *
 65+ * @return null|string|array
 66+ */
 67+ public function getResourceModuleNames() {
 68+ return 'ext.semanticformsinputs.datepicker';
 69+ }
 70+
 71+ /**
6072 * Static setup method for input type "menuselect".
6173 * Adds the Javascript code and css used by all menuselects.
6274 */
6375 static private function setup() {
6476
6577 global $wgOut, $wgLang;
66 - global $sfgScriptPath, $sfigSettings;
 78+// global $sfgScriptPath, $sfigSettings;
6779
6880 static $hasRun = false;
6981
7082 if ( !$hasRun ) {
7183 $hasRun = true;
7284
73 - $wgOut->addExtensionStyle( $sfgScriptPath . '/skins/jquery-ui/base/jquery.ui.datepicker.css' );
74 - $wgOut->addExtensionStyle( $sfgScriptPath . '/skins/jquery-ui/base/jquery.ui.theme.css' );
75 - $wgOut->addScript( '<script type="text/javascript" src="' . $sfgScriptPath . '/libs/jquery-ui/jquery.ui.datepicker.min.js"></script> ' );
76 - $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/datepicker.js"></script> ' );
 85+// $wgOut->addExtensionStyle( $sfgScriptPath . '/skins/jquery-ui/base/jquery.ui.datepicker.css' );
 86+// $wgOut->addExtensionStyle( $sfgScriptPath . '/skins/jquery-ui/base/jquery.ui.theme.css' );
 87+// $wgOut->addScript( '<script type="text/javascript" src="' . $sfgScriptPath . '/libs/jquery-ui/jquery.ui.datepicker.min.js"></script> ' );
 88+// $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/datepicker.js"></script> ' );
7789
7890 // set localized messages (use MW i18n, not jQuery i18n)
7991 $jstext =
80 - "jQuery(function(){\n"
81 - . " jQuery.datepicker.regional['wiki'] = {\n"
 92+// "mw.loader.using('ext.semanticformsinputs.datepicker', function(){\n" .
 93+ " jQuery.datepicker.regional['wiki'] = {\n"
8294 . " closeText: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-close' ) ) . "',\n"
8395 . " prevText: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-prev' ) ) . "',\n"
8496 . " nextText: '" . Xml::escapeJsString( wfMsg( 'semanticformsinputs-next' ) ) . "',\n"
@@ -138,8 +150,8 @@
139151 . " isRTL: " . ( $wgLang->isRTL() ? "true" : "false" ) . ",\n"
140152 . " showMonthAfterYear: false,\n"
141153 . " yearSuffix: ''};\n"
142 - . " jQuery.datepicker.setDefaults(jQuery.datepicker.regional['wiki']);\n"
143 - . "});\n";
 154+ . " jQuery.datepicker.setDefaults(jQuery.datepicker.regional['wiki']);\n";
 155+// . "});\n";
144156
145157 $wgOut->addScript( Html::inlineScript( $jstext ) );
146158
@@ -607,57 +619,57 @@
608620 global $sfigSettings;
609621
610622 $params = parent::getParameters();
611 - $params[] = array(
 623+ $params['date format'] = array(
612624 'name' => 'date format',
613625 'type' => 'string',
614626 'description' => wfMsg( 'semanticformsinputs-datepicker-dateformat' )
615627 );
616 - $params[] = array(
 628+ $params['week start'] = array(
617629 'name' => 'week start',
618630 'type' => 'int',
619631 'description' => wfMsg( 'semanticformsinputs-datepicker-weekstart' )
620632 );
621 - $params[] = array(
 633+ $params['first date'] = array(
622634 'name' => 'first date',
623635 'type' => 'string',
624636 'description' => wfMsg( 'semanticformsinputs-datepicker-firstdate' )
625637 );
626 - $params[] = array(
 638+ $params['last date'] = array(
627639 'name' => 'last date',
628640 'type' => 'string',
629641 'description' => wfMsg( 'semanticformsinputs-datepicker-lastdate' )
630642 );
631 - $params[] = array(
 643+ $params['disable days of week'] = array(
632644 'name' => 'disable days of week',
633645 'type' => 'string',
634646 'description' => wfMsg( 'semanticformsinputs-datepicker-disabledaysofweek' )
635647 );
636 - $params[] = array(
 648+ $params['highlight days of week'] = array(
637649 'name' => 'highlight days of week',
638650 'type' => 'string',
639651 'description' => wfMsg( 'semanticformsinputs-datepicker-highlightdaysofweek' )
640652 );
641 - $params[] = array(
 653+ $params['disable dates'] = array(
642654 'name' => 'disable dates',
643655 'type' => 'string',
644656 'description' => wfMsg( 'semanticformsinputs-datepicker-disabledates' )
645657 );
646 - $params[] = array(
 658+ $params['highlight days of week'] = array(
647659 'name' => 'highlight days of week',
648660 'type' => 'string',
649661 'description' => wfMsg( 'semanticformsinputs-datepicker-highlightdates' )
650662 );
651 - $params[] = array(
 663+ $params[$sfigSettings->datePickerShowWeekNumbers?'hide week numbers':'show week numbers'] = array(
652664 'name' => $sfigSettings->datePickerShowWeekNumbers?'hide week numbers':'show week numbers',
653665 'type' => 'boolean',
654666 'description' => wfMsg( 'semanticformsinputs-datepicker-showweeknumbers' )
655667 );
656 - $params[] = array(
 668+ $params[$sfigSettings->datePickerDisableInputField?'enable input field':'disable input field'] = array(
657669 'name' => $sfigSettings->datePickerDisableInputField?'enable input field':'disable input field',
658670 'type' => 'boolean',
659671 'description' => wfMsg( 'semanticformsinputs-datepicker-enableinputfield' )
660672 );
661 - $params[] = array(
 673+ $params[$sfigSettings->datePickerShowResetButton?'hide reset button':'show reset button'] = array(
662674 'name' => $sfigSettings->datePickerShowResetButton?'hide reset button':'show reset button',
663675 'type' => 'boolean',
664676 'description' => wfMsg( 'semanticformsinputs-datepicker-showresetbutton' )
Index: trunk/extensions/SemanticFormsInputs/includes/SFI_TimePicker.php
@@ -37,12 +37,6 @@
3838
3939 parent::__construct( $input_number, $cur_value, $input_name, $disabled, $other_args );
4040
41 - // third: if the timepicker is not disabled set up JS attributes ans assemble JS call
42 - if ( !$this->mIsDisabled ) {
43 -
44 - self::setup();
45 - }
46 -
4741 $this->addJsInitFunctionData( 'SFI_TP_init', $this->setupJsInitAttribs() );
4842
4943 }
@@ -60,27 +54,6 @@
6155 }
6256
6357 /**
64 - * Static setup method for input type "menuselect".
65 - * Adds the Javascript code and css used by all menuselects.
66 - */
67 - static private function setup() {
68 -
69 - global $wgOut;
70 - global $sfigSettings;
71 -
72 - static $hasRun = false;
73 -
74 - if ( !$hasRun ) {
75 - $hasRun = true;
76 -
77 - $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/timepicker.js"></script> ' );
78 - $wgOut->addExtensionStyle( $sfigSettings->scriptPath . '/skins/SFI_Timepicker.css' );
79 -
80 - }
81 -
82 - }
83 -
84 - /**
8558 * Set up JS attributes
8659 *
8760 * @return String
@@ -174,12 +147,7 @@
175148
176149 global $sfigSettings;
177150
178 - // The timepicker is created in four steps:
179151 // first: set up HTML attributes
180 - // second: assemble HTML
181 -
182 -
183 - // first: set up HTML attributes
184152 $inputFieldDisabled =
185153 array_key_exists( 'disable input field', $this->mOtherArgs )
186154 || ( !array_key_exists( 'enable input field', $this->mOtherArgs ) && $sfigSettings->timePickerDisableInputField )
@@ -215,27 +183,27 @@
216184 global $sfigSettings;
217185
218186 $params = parent::getParameters();
219 - $params[] = array(
 187+ $params['mintime'] = array(
220188 'name' => 'mintime',
221189 'type' => 'string',
222190 'description' => wfMsg( 'semanticformsinputs-timepicker-mintime' ),
223191 );
224 - $params[] = array(
 192+ $params['maxtime'] = array(
225193 'name' => 'maxtime',
226194 'type' => 'string',
227195 'description' => wfMsg( 'semanticformsinputs-timepicker-maxtime' ),
228196 );
229 - $params[] = array(
 197+ $params['interval'] = array(
230198 'name' => 'interval',
231199 'type' => 'int',
232200 'description' => wfMsg( 'semanticformsinputs-timepicker-interval' ),
233201 );
234 - $params[] = array(
 202+ $params[$sfigSettings->timePickerDisableInputField?'enable input field':'disable input field'] = array(
235203 'name' => $sfigSettings->timePickerDisableInputField?'enable input field':'disable input field',
236204 'type' => 'boolean',
237205 'description' => wfMsg( 'semanticformsinputs-timepicker-enableinputfield' ),
238206 );
239 - $params[] = array(
 207+ $params[$sfigSettings->timePickerShowResetButton?'hide reset button':'show reset button'] = array(
240208 'name' => $sfigSettings->timePickerShowResetButton?'hide reset button':'show reset button',
241209 'type' => 'boolean',
242210 'description' => wfMsg( 'semanticformsinputs-timepicker-showresetbutton' ),
@@ -243,4 +211,16 @@
244212
245213 return $params;
246214 }
 215+
 216+ /**
 217+ * Returns the names of the resource modules this input type uses.
 218+ *
 219+ * Returns the names of the modules as an array or - if there is only one
 220+ * module - as a string.
 221+ *
 222+ * @return null|string|array
 223+ */
 224+ public function getResourceModuleNames() {
 225+ return 'ext.semanticformsinputs.timepicker';
 226+ }
247227 }
Index: trunk/extensions/SemanticFormsInputs/includes/SFI_MenuSelect.php
@@ -64,20 +64,25 @@
6565 */
6666 static private function setup() {
6767
68 - global $wgOut;
69 - global $sfigSettings;
 68+ global $wgHooks;
7069
7170 static $hasRun = false;
7271
7372 if ( !$hasRun ) {
7473 $hasRun = true;
75 - $wgOut->addScript( '<script type="text/javascript">sfigScriptPath="' . $sfigSettings->scriptPath . '";</script> ' );
76 - $wgOut->addScript( '<script type="text/javascript" src="' . $sfigSettings->scriptPath . '/libs/menuselect.js"></script> ' );
77 - $wgOut->addExtensionStyle( $sfigSettings->scriptPath . '/skins/SFI_Menuselect.css' );
 74+
 75+ $wgHooks['MakeGlobalVariablesScript'][] = 'SFIMenuSelect::setGlobalVariables';
 76+
7877 }
7978
8079 }
8180
 81+ static public function setGlobalVariables( &$vars ) {
 82+ global $sfigSettings;
 83+ $vars['sfigScriptPath'] = $sfigSettings->scriptPath;
 84+ return true;
 85+ }
 86+
8287 /**
8388 * Returns the HTML code to be included in the output page for this input.
8489 *
@@ -142,22 +147,33 @@
143148
144149 /**
145150 * Returns the set of parameters for this form input.
146 - *
147 - * TODO: Specify parameters specific for menuselect.
148151 */
149152 public static function getParameters() {
150153 $params = parent::getParameters();
151 - $params[] = array(
 154+ $params['structure'] = array(
152155 'name' => 'structure',
153156 'type' => 'text',
154157 'description' => wfMsg( 'semanticformsinputs-menuselect-structure' ),
155158 'default' => "* item 1\n** item 11\n** item 12\n* item 2\n** item 21\n** item 22"
156159 );
157 - $params[] = array(
 160+ $params[$sfigSettings->menuSelectDisableInputField?'enable input field':'disable input field'] = array(
158161 'name' => $sfigSettings->menuSelectDisableInputField?'enable input field':'disable input field',
159162 'type' => 'boolean',
160163 'description' => wfMsg( 'semanticformsinputs-menuselect-enableinputfield' ),
161164 );
162165 return $params;
163166 }
 167+
 168+ /**
 169+ * Returns the names of the resource modules this input type uses.
 170+ *
 171+ * Returns the names of the modules as an array or - if there is only one
 172+ * module - as a string.
 173+ *
 174+ * @return null|string|array
 175+ */
 176+ public function getResourceModuleNames() {
 177+ return 'ext.semanticformsinputs.menuselect';
 178+ }
 179+
164180 }
Index: trunk/extensions/SemanticFormsInputs/libs/menuselect.js
@@ -10,7 +10,7 @@
1111 *
1212 * @param inputID ( String ) the id of the input to initialize
1313 */
14 -function SFI_MS_init( inputID, params ) {
 14+window.SFI_MS_init = function( inputID, params ) {
1515
1616 var inputShow = jQuery('#' + inputID + "_show");
1717
Index: trunk/extensions/SemanticFormsInputs/libs/datetimepicker.js
@@ -6,7 +6,7 @@
77 */
88
99
10 -function SFI_DTP_init ( inputId, params ) {
 10+window.SFI_DTP_init = function( inputId, params ) {
1111
1212 var input = jQuery( '#' + inputId );
1313
Index: trunk/extensions/SemanticFormsInputs/libs/regexp.js
@@ -16,7 +16,7 @@
1717 * @return (Boolean) true, if the input's value matches the regular expression in
1818 * retext, false otherwise; the value is inverted if inverse is true
1919 */
20 -function SFI_RE_validate ( input_id, params ) { //input_number, retext, inverse, message, multiple
 20+window.SFI_RE_validate = function( input_id, params ) { //input_number, retext, inverse, message, multiple
2121
2222 var match;
2323 var message;
Index: trunk/extensions/SemanticFormsInputs/libs/datepicker.js
@@ -5,7 +5,7 @@
66 *
77 */
88
9 -function SFI_DP_init ( input_id, params ) {
 9+window.SFI_DP_init = function ( input_id, params ) {
1010
1111 var inputShow = jQuery( '#' + input_id );
1212 inputShow.attr( 'id', input_id + '_show' );
Index: trunk/extensions/SemanticFormsInputs/libs/timepicker.js
@@ -16,7 +16,7 @@
1717 * format: (String) a format string (unused) (do we even need it?)
1818 *
1919 */
20 -function SFI_TP_init( inputID, params ) { // minTime, maxTime, interval, format
 20+window.SFI_TP_init = function( inputID, params ) { // minTime, maxTime, interval, format
2121
2222 var inputIDshow = inputID + '_show';
2323