r54607 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54606‎ | r54607 | r54608 >
Date:21:21, 7 August 2009
Author:tparscal
Status:resolved
Tags:
Comment:
Moved the "only use this for vector" logic out to the PHP level so we aren't sending jquery to people without any need for it.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditWarning/EditWarning.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/EditWarning/EditWarning.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/EditWarning/EditWarning.hooks.php
@@ -15,19 +15,22 @@
1616 * Initializes the component
1717 */
1818 public static function initialize( $out ) {
19 - global $wgEditWarningStyleVersion, $wgRequest;
 19+ global $wgEditWarningStyleVersion, $wgRequest, $wgUser;
2020
21 - UsabilityInitiativeHooks::initialize();
22 - // Adds script to document
23 - UsabilityInitiativeHooks::addScript(
24 - 'EditWarning/EditWarning.js', $wgEditWarningStyleVersion
25 - );
26 - // Internationalization
27 - wfLoadExtensionMessages( 'EditWarning' );
28 - // Adds messages to page
29 - UsabilityInitiativeHooks::addMessages(
30 - array( 'editwarning-warning' )
31 - );
 21+ $skin = $wgUser->getSkin();
 22+ if ( $skin->skinname == 'vector' ) {
 23+ UsabilityInitiativeHooks::initialize();
 24+ // Adds script to document
 25+ UsabilityInitiativeHooks::addScript(
 26+ 'EditWarning/EditWarning.js', $wgEditWarningStyleVersion
 27+ );
 28+ // Internationalization
 29+ wfLoadExtensionMessages( 'EditWarning' );
 30+ // Adds messages to page
 31+ UsabilityInitiativeHooks::addMessages(
 32+ array( 'editwarning-warning' )
 33+ );
 34+ }
3235 // Continue
3336 return true;
3437 }
Index: trunk/extensions/UsabilityInitiative/EditWarning/EditWarning.js
@@ -1,9 +1,6 @@
22 /* JavaScript for EditWarning extension */
33
44 js2AddOnloadHook( function() {
5 - // Only use this function in conjuction with the Vector skin
6 - if( skin != 'vector' )
7 - return;
85 // Get the original values of some form elements
96 $j( '#wpTextbox1, #wpSummary' ).each( function() {
107 $j(this).data( 'origtext', $j(this).val() );

Follow-up revisions

RevisionCommit summaryAuthorDate
r54752Merge a bunch of UsabilityInitiative fixes. This commit may mess up svn:merge...catrope22:12, 10 August 2009

Status & tagging log