Index: branches/resourceloader/phase3/includes/ResourceLoader.php |
— | — | @@ -25,27 +25,34 @@ |
26 | 26 | * @example |
27 | 27 | * // Registers a module with the resource loading system |
28 | 28 | * ResourceLoader::register( 'foo', array( |
29 | | - * // At minimum you must have a script file |
| 29 | + * // Script or list of scripts to include when implementating the module (required) |
30 | 30 | * 'script' => 'resources/foo/foo.js', |
31 | | - * // Optionally you can have a style file as well |
| 31 | + * // List of scripts or lists of scripts to include based on the current language |
| 32 | + * 'locales' => array( |
| 33 | + * 'en-gb' => 'resources/foo/locales/en-gb.js', |
| 34 | + * ), |
| 35 | + * // Script or list of scripts to include only when in debug mode |
| 36 | + * 'debug' => 'resources/foo/debug.js', |
| 37 | + * // If this module is going to be loaded before the mediawiki module is ready such as jquery or the mediawiki |
| 38 | + * // module itself, it can be included without special loader wrapping - this will also limit the module to not be |
| 39 | + * // able to specify needs, custom loaders, styles, themes or messages (any of the options below) - raw scripts |
| 40 | + * // get registered as 'ready' after the mediawiki module is ready, so they can be named as dependencies |
| 41 | + * 'raw' => false, |
| 42 | + * // Modules or list of modules which are needed and should be used when generating loader code |
| 43 | + * 'needs' => 'resources/foo/foo.js', |
| 44 | + * // Script or list of scripts which will cause loader code to not be generated - if you are doing something fancy |
| 45 | + * // with your dependencies this gives you a way to use custom registration code |
| 46 | + * 'loader' => 'resources/foo/loader.js', |
| 47 | + * // Style-sheets or list of style-sheets to include |
32 | 48 | * 'style' => 'resources/foo/foo.css', |
33 | | - * // List of styles to include based on the skin |
| 49 | + * // List of style-sheets or lists of style-sheets to include based on the skin - if no match is found for current |
| 50 | + * // skin, 'default' is used - if default doesn't exist nothing is added |
34 | 51 | * 'themes' => array( |
35 | 52 | * 'default' => 'resources/foo/themes/default/foo.css', |
36 | 53 | * 'vector' => 'resources/foo/themes/vector.foo.css', |
37 | 54 | * ), |
38 | | - * // List of scripts to include based on the language |
39 | | - * 'locales' => array( |
40 | | - * 'en-gb' => 'resources/foo/locales/en-gb.js', |
41 | | - * ), |
42 | | - * // Only needed if you are doing something fancy with your loader, otherwise one will be generated for you |
43 | | - * 'loader' => 'resources/foo/loader.js', |
44 | | - * // If you need any localized messages brought into the JavaScript environment, list the keys here |
| 55 | + * // List of keys of messages to include |
45 | 56 | * 'messages' => array( 'foo-hello', 'foo-goodbye' ), |
46 | | - * // Raw scripts are are loaded without using the loader and can not bundle loaders, styles and messages |
47 | | - * 'raw' => false, |
48 | | - * // Debug-only scripts are special scripts that are only loaded when requested and while in debug mode |
49 | | - * 'debug' => false, |
50 | 57 | * ) ); |
51 | 58 | * @example |
52 | 59 | * // Responds to a resource loading request |
— | — | @@ -55,6 +62,7 @@ |
56 | 63 | |
57 | 64 | /* Protected Static Members */ |
58 | 65 | |
| 66 | + // List of modules and their options |
59 | 67 | protected static $modules = array(); |
60 | 68 | |
61 | 69 | /* Protected Static Methods */ |
— | — | @@ -62,10 +70,10 @@ |
63 | 71 | /** |
64 | 72 | * Runs text through a filter, caching the filtered result for future calls |
65 | 73 | * |
66 | | - * @param string $filter name of filter to run |
67 | | - * @param string $data text to filter, such as JavaScript or CSS text |
68 | | - * @param string $file path to file being filtered, (optional: only required for CSS to resolve paths) |
69 | | - * @return string filtered data |
| 74 | + * @param {string} $filter name of filter to run |
| 75 | + * @param {string} $data text to filter, such as JavaScript or CSS text |
| 76 | + * @param {string} $file path to file being filtered, (optional: only required for CSS to resolve paths) |
| 77 | + * @return {string} filtered data |
70 | 78 | */ |
71 | 79 | protected static function filter( $filter, $data, $file = null ) { |
72 | 80 | global $wgMemc; |
— | — | @@ -91,27 +99,99 @@ |
92 | 100 | $wgMemc->set( $key, $result ); |
93 | 101 | return $result; |
94 | 102 | } |
| 103 | + /** |
| 104 | + * Converts a multi-level array into a flat array containing the unique values of all leaf nodes |
| 105 | + * |
| 106 | + * @param {array} $deep mutli-level array to flatten |
| 107 | + * @param {array} $flat array to append flattened values to (used internally) |
| 108 | + * @return {array} flattened array of leaf nodes |
| 109 | + */ |
| 110 | + protected static function flatten( $deep, $flat = array() ) { |
| 111 | + foreach ( $deep as $value ) { |
| 112 | + if ( is_array( $value ) ) { |
| 113 | + $flat = self::flatten( $value, $flat ); |
| 114 | + } else { |
| 115 | + if ( $value ) { |
| 116 | + $flat[] = $value; |
| 117 | + } |
| 118 | + } |
| 119 | + } |
| 120 | + return array_unique( $flat ); |
| 121 | + } |
| 122 | + /** |
| 123 | + * Validates a file or list of files as existing |
| 124 | + * |
| 125 | + * @param {mixed} string file name or array of any depth containing string file names as leaf nodes |
| 126 | + * @throws {MWException} if one or more files do not exist |
| 127 | + */ |
| 128 | + protected static function validate( $files ) { |
| 129 | + if ( is_array( $files ) ) { |
| 130 | + $files = self::flatten( $files ); |
| 131 | + foreach ( $files as $file ) { |
| 132 | + self::validate( $file ); |
| 133 | + } |
| 134 | + } else { |
| 135 | + if ( !file_exists( $files ) ) { |
| 136 | + throw new MWException( 'File does not exist: ' . $files ); |
| 137 | + } |
| 138 | + } |
| 139 | + } |
| 140 | + /** |
| 141 | + * Reads a file or list of files and returns them as a string or outputs them into the current output buffer |
| 142 | + * |
| 143 | + * @param {mixed} $files string file name or array of any depth containing string file names as leaf nodes |
| 144 | + * @param {array} $read list of files which have already been read |
| 145 | + * @param |
| 146 | + * @return {mixed} string of read data or null if $passthrough is true |
| 147 | + */ |
| 148 | + protected static function read( $files, $passthrough = false ) { |
| 149 | + if ( is_array( $files ) ) { |
| 150 | + $files = self::flatten( $files ); |
| 151 | + $contents = ''; |
| 152 | + foreach ( $files as $file ) { |
| 153 | + $contents .= self::read( $file ); |
| 154 | + } |
| 155 | + return $contents; |
| 156 | + } else { |
| 157 | + if ( $passthrough ) { |
| 158 | + readfile( $files ); |
| 159 | + echo "\n"; |
| 160 | + return null; |
| 161 | + } else { |
| 162 | + return file_get_contents( $files ) . "\n"; |
| 163 | + } |
| 164 | + } |
| 165 | + } |
95 | 166 | |
96 | 167 | /* Static Methods */ |
97 | 168 | |
98 | 169 | /** |
99 | 170 | * Registers a module with the ResourceLoader system |
100 | 171 | * |
101 | | - * @param mixed $module string of name of module or array of name/options pairs |
102 | | - * @param array $options module options (optional when using multiple-registration calling style) |
103 | | - * @return boolean false if there were any errors, in which case one or more modules were not registered |
| 172 | + * @param {mixed} $module string of name of module or array of name/options pairs |
| 173 | + * @param {array} $options module options (optional when using multiple-registration calling style) |
| 174 | + * @return {boolean} false if there were any errors, in which case one or more modules were not registered |
104 | 175 | * |
105 | 176 | * $options format: |
106 | 177 | * array( |
107 | | - * 'script' => [string: path to file], |
108 | | - * 'style' => [string: path to file, optional], |
109 | | - * 'themes' => [array: paths to styles to include, keyed by skin name, optional], |
110 | | - * 'locales' => [array: paths to scripts to include, keyed by locale name, optional], |
111 | | - * 'messages' => [array: message keys, optional], |
112 | | - * 'loader' => [string: path to file, optional], |
113 | | - * 'needs' => [array: names of modules this module needs, optional - ignored if loader is present], |
114 | | - * 'raw' => [boolean: include directly without any loading support, optional], |
115 | | - * 'debug' => [boolean: include in debug mode only, optional], |
| 178 | + * // Required module options |
| 179 | + * 'script' => 'dir/script.js' | array( 'dir/script1.js', 'dir/script2.js' ... ), |
| 180 | + * // Optional module options |
| 181 | + * 'locales' => array( |
| 182 | + * '[locale name]' => 'dir/locale.js' | '[locale name]' => array( 'dir/locale1.js', 'dir/locale2.js' ... ) |
| 183 | + * ... |
| 184 | + * ), |
| 185 | + * 'debug' => 'dir/debug.js' | array( 'dir/debug1.js', 'dir/debug2.js' ... ), |
| 186 | + * 'raw' => true | false, |
| 187 | + * // Non-raw module options |
| 188 | + * 'needs' => 'module' | array( 'module1', 'module2' ... ) |
| 189 | + * 'loader' => 'dir/loader.js' | array( 'dir/loader1.js', 'dir/loader2.js' ... ), |
| 190 | + * 'style' => 'dir/file.css' | array( 'dir/file1.css', 'dir/file2.css' ... ), |
| 191 | + * 'themes' => array( |
| 192 | + * '[skin name]' => 'dir/theme.css' | '[skin name]' => array( 'dir/theme1.css', 'dir/theme2.css' ... ) |
| 193 | + * ... |
| 194 | + * ), |
| 195 | + * 'messages' => array( 'message1', 'message2' ... ), |
116 | 196 | * ) |
117 | 197 | * |
118 | 198 | * @todo We need much more clever error reporting, not just in detailing what happened, but in bringing errors to |
— | — | @@ -120,59 +200,57 @@ |
121 | 201 | public static function register( $module, $options = array() ) { |
122 | 202 | // Allow multiple modules to be registered in one call |
123 | 203 | if ( is_array( $module ) && empty( $options ) ) { |
124 | | - $success = true; |
125 | 204 | foreach ( $module as $name => $options ) { |
126 | | - if ( !self::register( $name, $options ) ) { |
127 | | - $success = false; |
128 | | - } |
| 205 | + self::register( $name, $options ); |
129 | 206 | } |
130 | | - return $success; |
| 207 | + return; |
131 | 208 | } |
132 | 209 | // Disallow duplicate registrations |
133 | 210 | if ( isset( self::$modules[$module] ) ) { |
134 | 211 | // A module has already been registered by this name |
135 | | - return false; |
| 212 | + throw new MWException( 'Another module has already been registered as ' . $module ); |
136 | 213 | } |
137 | | - // Always include a set of default options in each registration - more data, less isset() checks |
| 214 | + // Always include a set of default options in each registration so we need not exaustively mark all options for |
| 215 | + // all modules when registering and also don't need to worry if the options are set or not later on |
138 | 216 | $options = array_merge( array( |
139 | 217 | 'script' => null, |
140 | | - 'style' => null, |
141 | | - 'themes' => array(), |
142 | | - 'locales' => array(), |
143 | | - 'messages' => array(), |
| 218 | + 'locales' => null, |
| 219 | + 'raw' => false, |
| 220 | + // An empty array is used for needs to make json_encode output [] instead of null which is shorted and |
| 221 | + // results in easier to work with data on the client |
| 222 | + 'needs' => array(), |
144 | 223 | 'loader' => null, |
145 | | - 'needs' => array(), |
146 | | - 'raw' => false, |
147 | 224 | 'debug' => null, |
| 225 | + 'style' => null, |
| 226 | + 'themes' => null, |
| 227 | + 'messages' => null, |
148 | 228 | ), $options ); |
149 | | - // Validate script option |
| 229 | + // Validate script option - which is required and must reference files that exist |
150 | 230 | if ( !is_string( $options['script'] ) ) { |
151 | | - // Module does not include a script |
152 | | - return false; |
| 231 | + throw new MWException( 'Module does not include a script: ' . $module ); |
153 | 232 | } |
154 | | - if ( !file_exists( $options['script'] ) ) { |
155 | | - // Script file does not exist |
156 | | - return false; |
| 233 | + // Validate options that reference files |
| 234 | + foreach ( array( 'script', 'locales', 'loader', 'debug', 'style', 'themes' ) as $option ) { |
| 235 | + if ( $options[$option] !== null ) { |
| 236 | + self::validate( $options[$option] ); |
| 237 | + } |
157 | 238 | } |
158 | | - if ( $options['loader'] !== null && !file_exists( $options['loader'] ) ) { |
159 | | - // Loader file does not exist |
160 | | - return false; |
161 | | - } |
162 | | - if ( $options['style'] !== null && !file_exists( $options['style'] ) ) { |
163 | | - // Style file does not exist |
164 | | - return false; |
165 | | - } |
| 239 | + // Attach module |
166 | 240 | self::$modules[$module] = $options; |
167 | 241 | } |
168 | | - |
| 242 | + /** |
| 243 | + * Gets a map of all modules and their options |
| 244 | + * |
| 245 | + * @return {array} list of modules and their options |
| 246 | + */ |
169 | 247 | public static function getModules() { |
170 | 248 | return self::$modules; |
171 | 249 | } |
172 | | - |
173 | 250 | /* |
174 | 251 | * Outputs a response to a resource load-request, including a content-type header |
175 | 252 | * |
176 | | - * @param WebRequest $request web request object to respond to |
| 253 | + * @param {WebRequest} $request web request object to respond to |
| 254 | + * @param {string} $server web-accessible path to script server |
177 | 255 | * |
178 | 256 | * $options format: |
179 | 257 | * array( |
— | — | @@ -191,6 +269,7 @@ |
192 | 270 | 'lang' => $request->getVal( 'lang', $wgLang->getCode() ), |
193 | 271 | 'skin' => $request->getVal( 'skin', $wgDefaultSkin ), |
194 | 272 | 'debug' => $request->getVal( 'debug' ), |
| 273 | + 'server' => $server, |
195 | 274 | ); |
196 | 275 | // Mediawiki's WebRequest::getBool is a bit on the annoying side - we need to allow 'true' and 'false' values |
197 | 276 | // to be converted to boolean true and false |
— | — | @@ -201,24 +280,26 @@ |
202 | 281 | $lang = $wgLang->factory( $parameters['lang'] ); |
203 | 282 | $parameters['dir'] = $lang->getDir(); |
204 | 283 | } |
205 | | - // Get modules - filtering out any we don't know about |
| 284 | + // Build a list of requested modules excluding unrecognized ones which are collected into a list used to |
| 285 | + // register the unrecognized modules with error status later on |
206 | 286 | $modules = array(); |
| 287 | + $missing = array(); |
207 | 288 | foreach ( explode( '|', $request->getVal( 'modules' ) ) as $module ) { |
208 | 289 | if ( isset( self::$modules[$module] ) ) { |
209 | 290 | $modules[] = $module; |
| 291 | + } else { |
| 292 | + $missing[] = $module; |
210 | 293 | } |
211 | 294 | } |
212 | 295 | // Use output buffering |
213 | 296 | ob_start(); |
214 | | - // Output raw modules first |
| 297 | + // Output raw modules first and build a list of raw modules to be registered with ready status later on |
215 | 298 | $ready = array(); |
216 | 299 | foreach ( $modules as $module ) { |
217 | 300 | if ( self::$modules[$module]['raw'] ) { |
218 | | - readfile( self::$modules[$module]['script'] ); |
219 | | - echo "\n"; |
| 301 | + self::read( self::$modules[$module]['script'], true ); |
220 | 302 | if ( $parameters['debug'] && self::$modules[$module]['debug'] ) { |
221 | | - readfile( self::$modules[$module]['debug'] ); |
222 | | - echo "\n"; |
| 303 | + self::read( self::$modules[$module]['debug'], true ); |
223 | 304 | } |
224 | 305 | $ready[] = $module; |
225 | 306 | } |
— | — | @@ -226,38 +307,36 @@ |
227 | 308 | // Special meta-information for the 'mediawiki' module |
228 | 309 | if ( in_array( 'mediawiki', $modules ) ) { |
229 | 310 | /* |
230 | | - * Skin::makeGlobalVariablesScript needs to be modified so that we still output the globals for now, but also |
231 | | - * put them into the initial payload like this: |
| 311 | + * Skin::makeGlobalVariablesScript needs to be modified so that we still output the globals for now, but |
| 312 | + * also put them into the initial payload like this: |
232 | 313 | * |
233 | | - * // Sets the inital configuration |
234 | | - * mw.config.set( { 'name': 'value', ... } ); |
| 314 | + * // Sets the inital configuration |
| 315 | + * mw.config.set( { 'name': 'value', ... } ); |
235 | 316 | * |
236 | 317 | * Also, the naming of these variables is horrible and sad, hopefully this can be worked on |
237 | 318 | */ |
238 | | - $parameters['server'] = $server; |
239 | 319 | echo "mw.config.set( " . json_encode( $parameters ) . " );\n"; |
240 | | - // Collect all loaders |
| 320 | + // Generate list of registrations and collect all loader scripts |
241 | 321 | $loaders = array(); |
242 | 322 | $registrations = array(); |
243 | 323 | foreach ( self::$modules as $name => $options ) { |
244 | | - if ( $options['loader'] !== null ) { |
| 324 | + if ( $options['loader'] ) { |
245 | 325 | $loaders[] = $options['loader']; |
246 | 326 | } else { |
247 | | - if ( empty( $options['needs'] ) && !in_array( $name, $ready ) ) { |
| 327 | + if ( empty( $options['needs'] ) && !in_array( $name, $ready ) && !in_array( $name, $missing ) ) { |
248 | 328 | $registrations[$name] = $name; |
249 | 329 | } else { |
250 | 330 | $registrations[$name] = array( $name, $options['needs'] ); |
251 | 331 | if ( in_array( $name, $ready ) ) { |
252 | 332 | $registrations[$name][] = 'ready'; |
| 333 | + } else if ( in_array( $name, $missing ) ) { |
| 334 | + $registrations[$name][] = 'missing'; |
253 | 335 | } |
254 | 336 | } |
255 | 337 | } |
256 | 338 | } |
257 | 339 | // Include loaders |
258 | | - foreach ( array_unique( $loaders ) as $loader ) { |
259 | | - readfile( $loader ); |
260 | | - echo "\n"; |
261 | | - } |
| 340 | + self::read( $loaders, true ); |
262 | 341 | // Register modules without loaders |
263 | 342 | echo "mw.loader.register( " . json_encode( array_values( $registrations ) ) . " );\n"; |
264 | 343 | } |
— | — | @@ -266,22 +345,22 @@ |
267 | 346 | foreach ( $modules as $module ) { |
268 | 347 | if ( !self::$modules[$module]['raw'] ) { |
269 | 348 | // Script |
270 | | - $script = file_get_contents( self::$modules[$module]['script'] ); |
| 349 | + $script = self::read( self::$modules[$module]['script'] ); |
271 | 350 | // Debug |
272 | 351 | if ( $parameters['debug'] && self::$modules[$module]['debug'] ) { |
273 | | - $script .= file_get_contents( self::$modules[$module]['debug'] ); |
| 352 | + $script .= self::read( self::$modules[$module]['debug'] ); |
274 | 353 | } |
275 | 354 | // Locale |
276 | 355 | if ( isset( self::$modules[$module]['locales'][$parameters['lang']] ) ) { |
277 | | - $script .= file_get_contents( self::$modules[$module]['locales'][$parameters['lang']] ); |
| 356 | + $script .= self::read( self::$modules[$module]['locales'][$parameters['lang']] ); |
278 | 357 | } |
279 | 358 | // Style |
280 | | - $style = self::$modules[$module]['style'] ? file_get_contents( self::$modules[$module]['style'] ) : ''; |
| 359 | + $style = self::$modules[$module]['style'] ? self::read( self::$modules[$module]['style'] ) : ''; |
281 | 360 | // Theme |
282 | 361 | if ( isset( self::$modules[$module]['themes'][$parameters['skin']] ) ) { |
283 | | - $style .= file_get_contents( self::$modules[$module]['themes'][$parameters['skin']] ); |
| 362 | + $style .= self::read( self::$modules[$module]['themes'][$parameters['skin']] ); |
284 | 363 | } else if ( isset( self::$modules[$module]['themes']['default'] ) ) { |
285 | | - $style .= file_get_contents( self::$modules[$module]['themes']['default'] ); |
| 364 | + $style .= self::read( self::$modules[$module]['themes']['default'] ); |
286 | 365 | } |
287 | 366 | if ( $style !== '' ) { |
288 | 367 | if ( $parameters['dir'] == 'rtl' ) { |
Index: branches/resourceloader/phase3/resources/Resources.php |
— | — | @@ -17,27 +17,33 @@ |
18 | 18 | 'jquery.ui.core' => array( |
19 | 19 | 'script' => 'resources/jquery/ui/jquery.ui.core.js', |
20 | 20 | 'themes' => array( |
21 | | - 'default' => 'resources/jquery/ui/themes/default/jquery.ui.theme.css', |
22 | | - 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.theme.css', |
| 21 | + 'default' => array( |
| 22 | + 'resources/jquery/ui/themes/default/jquery.ui.core.css', |
| 23 | + 'resources/jquery/ui/themes/default/jquery.ui.theme.css', |
| 24 | + ), |
| 25 | + 'vector' => array( |
| 26 | + 'resources/jquery/ui/themes/vector/jquery.ui.core.css', |
| 27 | + 'resources/jquery/ui/themes/vector/jquery.ui.theme.css', |
| 28 | + ), |
23 | 29 | ), |
24 | | - 'needs' => array( 'jquery' ), |
| 30 | + 'needs' => 'jquery', |
25 | 31 | ), |
26 | 32 | 'jquery.ui.widget' => array( |
27 | 33 | 'script' => 'resources/jquery/ui/jquery.ui.widget.js', |
28 | | - 'needs' => array( 'jquery.ui.core' ), |
| 34 | + 'needs' => 'jquery.ui.core', |
29 | 35 | ), |
30 | 36 | 'jquery.ui.mouse' => array( |
31 | 37 | 'script' => 'resources/jquery/ui/jquery.ui.mouse.js', |
32 | | - 'needs' => array( 'jquery' ), |
| 38 | + 'needs' => 'jquery', |
33 | 39 | ), |
34 | 40 | 'jquery.ui.position' => array( |
35 | 41 | 'script' => 'resources/jquery/ui/jquery.ui.position.js', |
36 | | - 'needs' => array( 'jquery' ), |
| 42 | + 'needs' => 'jquery', |
37 | 43 | ), |
38 | 44 | // Interactions |
39 | 45 | 'jquery.ui.draggable' => array( |
40 | 46 | 'script' => 'resources/jquery/ui/jquery.ui.draggable.js', |
41 | | - 'needs' => array( 'jquery.ui.core' ), |
| 47 | + 'needs' => 'jquery.ui.core', |
42 | 48 | ), |
43 | 49 | 'jquery.ui.droppable' => array( |
44 | 50 | 'script' => 'resources/jquery/ui/jquery.ui.droppable.js', |
— | — | @@ -49,7 +55,7 @@ |
50 | 56 | 'default' => 'resources/jquery/ui/themes/default/jquery.ui.resizable.css', |
51 | 57 | 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.resizable.css', |
52 | 58 | ), |
53 | | - 'needs' => array( 'jquery.ui.core' ), |
| 59 | + 'needs' => 'jquery.ui.core', |
54 | 60 | ), |
55 | 61 | 'jquery.ui.selectable' => array( |
56 | 62 | 'script' => 'resources/jquery/ui/jquery.ui.selectable.js', |
— | — | @@ -57,16 +63,16 @@ |
58 | 64 | 'default' => 'resources/jquery/ui/themes/default/jquery.ui.selectable.css', |
59 | 65 | 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.selectable.css', |
60 | 66 | ), |
61 | | - 'needs' => array( 'jquery.ui.core' ), |
| 67 | + 'needs' => 'jquery.ui.core', |
62 | 68 | ), |
63 | 69 | 'jquery.ui.sortable' => array( |
64 | 70 | 'script' => 'resources/jquery/ui/jquery.ui.sortable.js', |
65 | | - 'needs' => array( 'jquery.ui.core' ), |
| 71 | + 'needs' => 'jquery.ui.core', |
66 | 72 | ), |
67 | 73 | // Widgets |
68 | 74 | 'jquery.ui.accordion' => array( |
69 | 75 | 'script' => 'resources/jquery/ui/jquery.ui.accordion.js', |
70 | | - 'needs' => array( 'jquery.ui.core' ), |
| 76 | + 'needs' => 'jquery.ui.core', |
71 | 77 | 'themes' => array( |
72 | 78 | 'default' => 'resources/jquery/ui/themes/default/jquery.ui.accordion.css', |
73 | 79 | 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.accordion.css', |
— | — | @@ -90,7 +96,7 @@ |
91 | 97 | ), |
92 | 98 | 'jquery.ui.datepicker' => array( |
93 | 99 | 'script' => 'resources/jquery/ui/jquery.ui.datepicker.js', |
94 | | - 'needs' => array( 'jquery.ui.core' ), |
| 100 | + 'needs' => 'jquery.ui.core', |
95 | 101 | 'themes' => array( |
96 | 102 | 'default' => 'resources/jquery/ui/themes/default/jquery.ui.datepicker.css', |
97 | 103 | 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.datepicker.css', |
— | — | @@ -152,7 +158,7 @@ |
153 | 159 | ), |
154 | 160 | 'jquery.ui.dialog' => array( |
155 | 161 | 'script' => 'resources/jquery/ui/jquery.ui.dialog.js', |
156 | | - 'needs' => array( 'jquery.ui.core' ), |
| 162 | + 'needs' => 'jquery.ui.core', |
157 | 163 | 'themes' => array( |
158 | 164 | 'default' => 'resources/jquery/ui/themes/default/jquery.ui.dialog.css', |
159 | 165 | 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.dialog.css', |
— | — | @@ -160,7 +166,7 @@ |
161 | 167 | ), |
162 | 168 | 'jquery.ui.progressbar' => array( |
163 | 169 | 'script' => 'resources/jquery/ui/jquery.ui.progressbar.js', |
164 | | - 'needs' => array( 'jquery.ui.core' ), |
| 170 | + 'needs' => 'jquery.ui.core', |
165 | 171 | 'themes' => array( |
166 | 172 | 'default' => 'resources/jquery/ui/themes/default/jquery.ui.progressbar.css', |
167 | 173 | 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.progressbar.css', |
— | — | @@ -176,7 +182,7 @@ |
177 | 183 | ), |
178 | 184 | 'jquery.ui.tabs' => array( |
179 | 185 | 'script' => 'resources/jquery/ui/jquery.ui.tabs.js', |
180 | | - 'needs' => array( 'jquery.ui.core' ), |
| 186 | + 'needs' => 'jquery.ui.core', |
181 | 187 | 'themes' => array( |
182 | 188 | 'default' => 'resources/jquery/ui/themes/default/jquery.ui.tabs.css', |
183 | 189 | 'vector' => 'resources/jquery/ui/themes/vector/jquery.ui.tabs.css', |
— | — | @@ -185,55 +191,55 @@ |
186 | 192 | // Effects |
187 | 193 | 'jquery.effects.core' => array( |
188 | 194 | 'script' => 'resources/jquery/effects/jquery.effects.core.js', |
189 | | - 'needs' => array( 'jquery' ), |
| 195 | + 'needs' => 'jquery', |
190 | 196 | ), |
191 | 197 | 'jquery.effects.blind' => array( |
192 | 198 | 'script' => 'resources/jquery/effects/jquery.effects.blind.js', |
193 | | - 'needs' => array( 'jquery.effects.core' ), |
| 199 | + 'needs' => 'jquery.effects.core', |
194 | 200 | ), |
195 | 201 | 'jquery.effects.bounce' => array( |
196 | 202 | 'script' => 'resources/jquery/effects/jquery.effects.bounce.js', |
197 | | - 'needs' => array( 'jquery.effects.core' ), |
| 203 | + 'needs' => 'jquery.effects.core', |
198 | 204 | ), |
199 | 205 | 'jquery.effects.clip' => array( |
200 | 206 | 'script' => 'resources/jquery/effects/jquery.effects.clip.js', |
201 | | - 'needs' => array( 'jquery.effects.core' ), |
| 207 | + 'needs' => 'jquery.effects.core', |
202 | 208 | ), |
203 | 209 | 'jquery.effects.drop' => array( |
204 | 210 | 'script' => 'resources/jquery/effects/jquery.effects.drop.js', |
205 | | - 'needs' => array( 'jquery.effects.core' ), |
| 211 | + 'needs' => 'jquery.effects.core', |
206 | 212 | ), |
207 | 213 | 'jquery.effects.explode' => array( |
208 | 214 | 'script' => 'resources/jquery/effects/jquery.effects.explode.js', |
209 | | - 'needs' => array( 'jquery.effects.core' ), |
| 215 | + 'needs' => 'jquery.effects.core', |
210 | 216 | ), |
211 | 217 | 'jquery.effects.fold' => array( |
212 | 218 | 'script' => 'resources/jquery/effects/jquery.effects.fold.js', |
213 | | - 'needs' => array( 'jquery.effects.core' ), |
| 219 | + 'needs' => 'jquery.effects.core', |
214 | 220 | ), |
215 | 221 | 'jquery.effects.highlight' => array( |
216 | 222 | 'script' => 'resources/jquery/effects/jquery.effects.highlight.js', |
217 | | - 'needs' => array( 'jquery.effects.core' ), |
| 223 | + 'needs' => 'jquery.effects.core', |
218 | 224 | ), |
219 | 225 | 'jquery.effects.pulsate' => array( |
220 | 226 | 'script' => 'resources/jquery/effects/jquery.effects.pulsate.js', |
221 | | - 'needs' => array( 'jquery.effects.core' ), |
| 227 | + 'needs' => 'jquery.effects.core', |
222 | 228 | ), |
223 | 229 | 'jquery.effects.scale' => array( |
224 | 230 | 'script' => 'resources/jquery/effects/jquery.effects.scale.js', |
225 | | - 'needs' => array( 'jquery.effects.core' ), |
| 231 | + 'needs' => 'jquery.effects.core', |
226 | 232 | ), |
227 | 233 | 'jquery.effects.shake' => array( |
228 | 234 | 'script' => 'resources/jquery/effects/jquery.effects.shake.js', |
229 | | - 'needs' => array( 'jquery.effects.core' ), |
| 235 | + 'needs' => 'jquery.effects.core', |
230 | 236 | ), |
231 | 237 | 'jquery.effects.slide' => array( |
232 | 238 | 'script' => 'resources/jquery/effects/jquery.effects.slide.js', |
233 | | - 'needs' => array( 'jquery.effects.core' ), |
| 239 | + 'needs' => 'jquery.effects.core', |
234 | 240 | ), |
235 | 241 | 'jquery.effects.transfer' => array( |
236 | 242 | 'script' => 'resources/jquery/effects/jquery.effects.transfer.js', |
237 | | - 'needs' => array( 'jquery.effects.core' ), |
| 243 | + 'needs' => 'jquery.effects.core', |
238 | 244 | ), |
239 | 245 | |
240 | 246 | /* MediaWiki */ |
— | — | @@ -248,75 +254,75 @@ |
249 | 255 | |
250 | 256 | 'mediawiki.legacy.ajax' => array( |
251 | 257 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.ajax.js', |
252 | | - 'needs' => array( 'mediawiki' ), |
| 258 | + 'needs' => 'mediawiki', |
253 | 259 | ), |
254 | 260 | 'mediawiki.legacy.ajaxwatch' => array( |
255 | 261 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.ajaxwatch.js', |
256 | | - 'needs' => array( 'mediawiki' ), |
| 262 | + 'needs' => 'mediawiki', |
257 | 263 | ), |
258 | 264 | 'mediawiki.legacy.block' => array( |
259 | 265 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.block.js', |
260 | | - 'needs' => array( 'mediawiki' ), |
| 266 | + 'needs' => 'mediawiki', |
261 | 267 | ), |
262 | 268 | 'mediawiki.legacy.changepassword' => array( |
263 | 269 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.changepassword.js', |
264 | | - 'needs' => array( 'mediawiki' ), |
| 270 | + 'needs' => 'mediawiki', |
265 | 271 | ), |
266 | 272 | 'mediawiki.legacy.edit' => array( |
267 | 273 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.edit.js', |
268 | | - 'needs' => array( 'mediawiki' ), |
| 274 | + 'needs' => 'mediawiki', |
269 | 275 | ), |
270 | 276 | 'mediawiki.legacy.enhancedchanges' => array( |
271 | 277 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.enhancedchanges.js', |
272 | | - 'needs' => array( 'mediawiki' ), |
| 278 | + 'needs' => 'mediawiki', |
273 | 279 | ), |
274 | 280 | 'mediawiki.legacy.history' => array( |
275 | 281 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.history.js', |
276 | | - 'needs' => array( 'mediawiki' ), |
| 282 | + 'needs' => 'mediawiki', |
277 | 283 | ), |
278 | 284 | 'mediawiki.legacy.htmlform' => array( |
279 | 285 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.htmlform.js', |
280 | | - 'needs' => array( 'mediawiki' ), |
| 286 | + 'needs' => 'mediawiki', |
281 | 287 | ), |
282 | 288 | 'mediawiki.legacy.IEFixes' => array( |
283 | 289 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.IEFixes.js', |
284 | | - 'needs' => array( 'mediawiki' ), |
| 290 | + 'needs' => 'mediawiki', |
285 | 291 | ), |
286 | 292 | 'mediawiki.legacy.metadata' => array( |
287 | 293 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.metadata.js', |
288 | | - 'needs' => array( 'mediawiki' ), |
| 294 | + 'needs' => 'mediawiki', |
289 | 295 | ), |
290 | 296 | 'mediawiki.legacy.mwsuggest' => array( |
291 | 297 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.mwsuggest.js', |
292 | | - 'needs' => array( 'mediawiki' ), |
| 298 | + 'needs' => 'mediawiki', |
293 | 299 | ), |
294 | 300 | 'mediawiki.legacy.prefs' => array( |
295 | 301 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.prefs.js', |
296 | | - 'needs' => array( 'mediawiki' ), |
| 302 | + 'needs' => 'mediawiki', |
297 | 303 | ), |
298 | 304 | 'mediawiki.legacy.preview' => array( |
299 | 305 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.preview.js', |
300 | | - 'needs' => array( 'mediawiki' ), |
| 306 | + 'needs' => 'mediawiki', |
301 | 307 | ), |
302 | 308 | 'mediawiki.legacy.protect' => array( |
303 | 309 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.protect.js', |
304 | | - 'needs' => array( 'mediawiki' ), |
| 310 | + 'needs' => 'mediawiki', |
305 | 311 | ), |
306 | 312 | 'mediawiki.legacy.rightclickedit' => array( |
307 | 313 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.rightclickedit.js', |
308 | | - 'needs' => array( 'mediawiki' ), |
| 314 | + 'needs' => 'mediawiki', |
309 | 315 | ), |
310 | 316 | 'mediawiki.legacy.search' => array( |
311 | 317 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.search.js', |
312 | | - 'needs' => array( 'mediawiki' ), |
| 318 | + 'needs' => 'mediawiki', |
313 | 319 | ), |
314 | 320 | 'mediawiki.legacy.upload' => array( |
315 | 321 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.upload.js', |
316 | | - 'needs' => array( 'mediawiki' ), |
| 322 | + 'needs' => 'mediawiki', |
317 | 323 | ), |
318 | 324 | 'mediawiki.legacy.wikibits' => array( |
319 | 325 | 'script' => 'resources/mediawiki/legacy/mediawiki.legacy.wikibits.js', |
320 | | - 'needs' => array( 'mediawiki' ), |
| 326 | + 'needs' => 'mediawiki', |
321 | 327 | ), |
322 | 328 | |
323 | 329 | /* MediaWiki Utilities */ |
— | — | @@ -338,24 +344,24 @@ |
339 | 345 | |
340 | 346 | 'test' => array( |
341 | 347 | 'script' => 'resources/test/test.js', |
342 | | - 'needs' => array( 'foo' ), |
| 348 | + 'needs' => 'foo', |
343 | 349 | 'style' => 'resources/test/test.css', |
344 | 350 | ), |
345 | 351 | 'foo' => array( |
346 | 352 | 'script' => 'resources/test/foo.js', |
347 | | - 'needs' => array( 'bar' ), |
| 353 | + 'needs' => 'bar', |
348 | 354 | 'style' => 'resources/test/foo.css', |
349 | 355 | 'messages' => array( 'january', 'february', 'march', 'april', 'may', 'june' ), |
350 | 356 | ), |
351 | 357 | 'bar' => array( |
352 | 358 | 'script' => 'resources/test/bar.js', |
353 | | - 'needs' => array( 'buz' ), |
| 359 | + 'needs' => 'buz', |
354 | 360 | 'style' => 'resources/test/bar.css', |
355 | 361 | 'messages' => array( 'july', 'august', 'september', 'october', 'november', 'december' ), |
356 | 362 | ), |
357 | 363 | 'buz' => array( |
358 | 364 | 'script' => 'resources/test/buz.js', |
359 | | - 'needs' => array( 'baz' ), |
| 365 | + 'needs' => 'baz', |
360 | 366 | 'style' => 'resources/test/buz.css', |
361 | 367 | ), |
362 | 368 | 'baz' => array( |