Index: trunk/extensions/JS2Support/ScriptLoaderOutputPage.php |
— | — | @@ -68,7 +68,8 @@ |
69 | 69 | // Add script without grouping |
70 | 70 | $this->addScript( Html::linkedScript( wfAppendQuery( $path, $wgStyleVersion ) ) ); |
71 | 71 | } |
72 | | - /* |
| 72 | + |
| 73 | + /** |
73 | 74 | * Gets the class name From an internal wiki title link |
74 | 75 | * @param $path String: script include path |
75 | 76 | */ |
— | — | @@ -160,6 +161,7 @@ |
161 | 162 | $scripts .= "\n" . $this->mScripts; |
162 | 163 | return $scripts; |
163 | 164 | } |
| 165 | + |
164 | 166 | /** |
165 | 167 | * Add a className to an output Bucket |
166 | 168 | */ |
— | — | @@ -169,6 +171,7 @@ |
170 | 172 | } |
171 | 173 | $this->mScriptLoaderClassList[ $type ][ $bucket ][] = $className; |
172 | 174 | } |
| 175 | + |
173 | 176 | /** |
174 | 177 | * Set the embed options for a given bucketKey |
175 | 178 | * @param $bucketKey String: the bucketkey to apply the options to. |
— | — | @@ -176,6 +179,7 @@ |
177 | 180 | protected function setClassBucketOptions( $bucketKey, $options ){ |
178 | 181 | $this->mScriptLoaderBucketOptions[ $bucketKey ] = $options; |
179 | 182 | } |
| 183 | + |
180 | 184 | /** |
181 | 185 | * Get class bucket options |
182 | 186 | */ |
— | — | @@ -185,6 +189,7 @@ |
186 | 190 | } |
187 | 191 | return array(); |
188 | 192 | } |
| 193 | + |
189 | 194 | /** |
190 | 195 | * Add a local or specified stylesheet, with the given media options. |
191 | 196 | * Meant primarily for internal use... |
— | — | @@ -250,6 +255,7 @@ |
251 | 256 | // Else use normal styles output: |
252 | 257 | $this->styles[ $style ] = $options; |
253 | 258 | } |
| 259 | + |
254 | 260 | /** |
255 | 261 | * Build a set of <link>s for the stylesheets specified in the $this->styles array. |
256 | 262 | * These will be applied to various media & IE conditionals. |
— | — | @@ -312,6 +318,7 @@ |
313 | 319 | //Now re-append any scripts that got added prior to the includeJQuery call |
314 | 320 | $this->mScripts = $this->mScripts . $postScripts; |
315 | 321 | } |
| 322 | + |
316 | 323 | /** |
317 | 324 | * Get style sheets grouped by "media", "condition" & "bucket" attributes |
318 | 325 | * call getLinkedScriptLoaderCss for each group |
— | — | @@ -330,6 +337,7 @@ |
331 | 338 | } |
332 | 339 | return $s; |
333 | 340 | } |
| 341 | + |
334 | 342 | /** |
335 | 343 | * Get the linked css script-loader calls |
336 | 344 | * @param Array $stylesAry Array of style sheets to be added. |
— | — | @@ -355,7 +363,8 @@ |
356 | 364 | |
357 | 365 | return $link; |
358 | 366 | } |
359 | | - /* |
| 367 | + |
| 368 | + /** |
360 | 369 | * Adds the script loader to mScripts |
361 | 370 | */ |
362 | 371 | private function getScriptLoaderJs(){ |
— | — | @@ -372,6 +381,7 @@ |
373 | 382 | } |
374 | 383 | return $s; |
375 | 384 | } |
| 385 | + |
376 | 386 | /** |
377 | 387 | * Get the <script> tag which will invoke the script loader |
378 | 388 | * @param $classAry A class array |
Index: trunk/extensions/JS2Support/JS2Support.php |
— | — | @@ -79,8 +79,19 @@ |
80 | 80 | $wgOut = new StubObject( 'wgOut', 'ScriptLoaderOutputPage' ); |
81 | 81 | } |
82 | 82 | |
| 83 | +/** |
| 84 | + * MakeGlobalVariablesScript hook ( add the wgScriptLoaderPath var ) |
| 85 | + */ |
| 86 | +$wgHooks['MakeGlobalVariablesScript'][] = 'js2SupportAddJSVars'; |
| 87 | +function js2SupportAddJSVars( &$vars ) { |
| 88 | + $vars = array_merge( $vars, |
| 89 | + array( |
| 90 | + 'wgScriptLoaderLocation' => $wgExtensionAssetsPath . 'JS2Support/mwScriptLoader.php' |
| 91 | + ) |
| 92 | + ); |
| 93 | + return true; |
| 94 | +} |
83 | 95 | |
84 | | - |
85 | 96 | /*************************** |
86 | 97 | * LocalSettings.php enabled js extensions |
87 | 98 | ****************************/ |
Index: trunk/extensions/JS2Support/UsabilityInitiative/loader.js |
— | — | @@ -0,0 +1,35 @@ |
| 2 | +/** |
| 3 | + * Name all the css and script used in UsabilityInitiative |
| 4 | + */ |
| 5 | + |
| 6 | +mw.addClassFilePaths( { |
| 7 | + "mw.style.usabilitySugest" : "css/suggestions.css", |
| 8 | + "mw.style.vectorCollapsibleNav" : "css/vector.collapsibleNav.css", |
| 9 | + "mw.style.vectorFooterCleanup" : "css/vector.footerCleanup.css", |
| 10 | + "mw.style.wikiEditor" : "css/wikiEditor.css", |
| 11 | + "mw.style.wikiEditorDialogs" : "css/wikiEditor.dialogs.css", |
| 12 | + "mw.style.wikiEditorPreview" : "css/wikiEditor.preview.css", |
| 13 | + "mw.style.wikiEditorToc" : "css/wikiEditor.toc.css", |
| 14 | + "mw.style.wikiEditorToolbar" : "css/wikiEditor.toolbar.css", |
| 15 | + "mw.style.vectorJquery-ui" : "css/vector/jquery-ui-1.7.2.css", |
| 16 | + |
| 17 | + "$j.whileAsync" : "js/plugins/jquery.async.js", |
| 18 | + "$j.fn.autoEllipsis" : "js/plugins/jquery.autoEllipsis.js", |
| 19 | + "$j.browserTest" : "js/plugins/jquery.browser.js", |
| 20 | + "$j.fn.collapsibleTabs" : "js/plugins/jquery.collapsibleTabs.js", |
| 21 | + "$j.fn.color" : "js/plugins/jquery.color.js", |
| 22 | + |
| 23 | + "$j.fn.delayedBind" : "plugins/jquery.delayedBind.js", |
| 24 | + |
| 25 | + "$j.fn.suggestions" : "js/plugins/jquery.suggestions.js", |
| 26 | + |
| 27 | + "$j.wikiEditor" : "js/plugins/jquery.wikiEditor.js", |
| 28 | + |
| 29 | + "$j.wikiEditor.modules.highlight" : "js/plugins/jquery.wikiEditor.highlight.js", |
| 30 | + "$j.wikiEditor.modules.toolbar" : "js/plugins/jquery.wikiEditor.toolbar.js", |
| 31 | + "$j.wikiEditor.modules.dialogs" : "js/plugins/jquery.wikiEditor.dialogs.js", |
| 32 | + "$j.wikiEditor.modules.toc" : "js/plugins/jquery.wikiEditor.toc.js", |
| 33 | + "$j.wikiEditor.modules.preview" : "js/plugins/jquery.wikiEditor.preview.js", |
| 34 | + "$j.wikiEditor.modules.templateEditor" : "js/plugins/jquery.wikiEditor.templateEditor.js", |
| 35 | + "$j.wikiEditor.modules.publish" : "js/plugins/jquery.wikiEditor.publish.js" |
| 36 | +} ); |
\ No newline at end of file |
Index: trunk/extensions/JS2Support/UsabilityInitiative/README |
— | — | @@ -0,0 +1,7 @@ |
| 2 | +This is just a quick hack that re-maps the UsabilityInitiative javascript handling to JS2 style. |
| 3 | +( obviusly it would be better to do this natively in the extension but this is "just a demo" ) |
| 4 | + |
| 5 | +to use simply include the following in your localsettings.php |
| 6 | + |
| 7 | +require_once( "$IP/extensions/JS2Support/UsabilityInitiative/ScriptLoaderUsabilityInitiative.php" ); |
| 8 | + |
Index: trunk/extensions/JS2Support/UsabilityInitiative/ScriptLoaderUsabilityInitiative.php |
— | — | @@ -0,0 +1,20 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * ScriptLoader verison of Usability Initiative extension |
| 6 | + * (just a demo) |
| 7 | + */ |
| 8 | + |
| 9 | +/* Configuration */ |
| 10 | + |
| 11 | +// Set this to false to include all plugins individually |
| 12 | +$wgUsabilityInitiativeResourceMode = 'minified'; |
| 13 | + |
| 14 | +/* Setup */ |
| 15 | + |
| 16 | +// Adds Autoload Classes |
| 17 | +$wgAutoloadClasses['UsabilityInitiativeHooks'] = |
| 18 | + dirname( __FILE__ ) . "/UsabilityInitiative.hooks.php"; |
| 19 | + |
| 20 | + |
| 21 | + |