r65572 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65571‎ | r65572 | r65573 >
Date:15:19, 27 April 2010
Author:dale
Status:deferred
Tags:
Comment:
* added wgScriptLoaderLocation for debug of mw.addMessegeKeys
* stubs for UsabilityInitiative support
Modified paths:
  • /trunk/extensions/JS2Support/JS2Support.php (modified) (history)
  • /trunk/extensions/JS2Support/ScriptLoaderOutputPage.php (modified) (history)
  • /trunk/extensions/JS2Support/UsabilityInitiative (added) (history)
  • /trunk/extensions/JS2Support/UsabilityInitiative/README (added) (history)
  • /trunk/extensions/JS2Support/UsabilityInitiative/ScriptLoaderUsabilityInitiative.php (added) (history)
  • /trunk/extensions/JS2Support/UsabilityInitiative/loader.js (added) (history)

Diff [purge]

Index: trunk/extensions/JS2Support/ScriptLoaderOutputPage.php
@@ -68,7 +68,8 @@
6969 // Add script without grouping
7070 $this->addScript( Html::linkedScript( wfAppendQuery( $path, $wgStyleVersion ) ) );
7171 }
72 - /*
 72+
 73+ /**
7374 * Gets the class name From an internal wiki title link
7475 * @param $path String: script include path
7576 */
@@ -160,6 +161,7 @@
161162 $scripts .= "\n" . $this->mScripts;
162163 return $scripts;
163164 }
 165+
164166 /**
165167 * Add a className to an output Bucket
166168 */
@@ -169,6 +171,7 @@
170172 }
171173 $this->mScriptLoaderClassList[ $type ][ $bucket ][] = $className;
172174 }
 175+
173176 /**
174177 * Set the embed options for a given bucketKey
175178 * @param $bucketKey String: the bucketkey to apply the options to.
@@ -176,6 +179,7 @@
177180 protected function setClassBucketOptions( $bucketKey, $options ){
178181 $this->mScriptLoaderBucketOptions[ $bucketKey ] = $options;
179182 }
 183+
180184 /**
181185 * Get class bucket options
182186 */
@@ -185,6 +189,7 @@
186190 }
187191 return array();
188192 }
 193+
189194 /**
190195 * Add a local or specified stylesheet, with the given media options.
191196 * Meant primarily for internal use...
@@ -250,6 +255,7 @@
251256 // Else use normal styles output:
252257 $this->styles[ $style ] = $options;
253258 }
 259+
254260 /**
255261 * Build a set of <link>s for the stylesheets specified in the $this->styles array.
256262 * These will be applied to various media & IE conditionals.
@@ -312,6 +318,7 @@
313319 //Now re-append any scripts that got added prior to the includeJQuery call
314320 $this->mScripts = $this->mScripts . $postScripts;
315321 }
 322+
316323 /**
317324 * Get style sheets grouped by "media", "condition" & "bucket" attributes
318325 * call getLinkedScriptLoaderCss for each group
@@ -330,6 +337,7 @@
331338 }
332339 return $s;
333340 }
 341+
334342 /**
335343 * Get the linked css script-loader calls
336344 * @param Array $stylesAry Array of style sheets to be added.
@@ -355,7 +363,8 @@
356364
357365 return $link;
358366 }
359 - /*
 367+
 368+ /**
360369 * Adds the script loader to mScripts
361370 */
362371 private function getScriptLoaderJs(){
@@ -372,6 +381,7 @@
373382 }
374383 return $s;
375384 }
 385+
376386 /**
377387 * Get the <script> tag which will invoke the script loader
378388 * @param $classAry A class array
Index: trunk/extensions/JS2Support/JS2Support.php
@@ -79,8 +79,19 @@
8080 $wgOut = new StubObject( 'wgOut', 'ScriptLoaderOutputPage' );
8181 }
8282
 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+}
8395
84 -
8596 /***************************
8697 * LocalSettings.php enabled js extensions
8798 ****************************/
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+

Status & tagging log