r62371 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62370‎ | r62371 | r62372 >
Date:17:47, 12 February 2010
Author:tparscal
Status:ok
Tags:
Comment:
Cleaned up some messy code from r62341.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -72,7 +72,7 @@
7373 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 124 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 125 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 29 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 48 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 12 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 244 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 245 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 244 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 245 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -81,13 +81,13 @@
8282 // Check for and make use of cached value and early opportunities to bail
8383 if ( module ) {
8484 // If the module doesn't exist, it's clearly not supported
85 - if ( !( module in $.wikiEditor.modules ) ) {
 85+ if ( typeof $.wikiEditor.modules[module] == 'undefined' ) {
8686 return false;
8787 } else if ( typeof $.wikiEditor.modules[module].supported !== 'undefined' ) {
8888 // Cache hit
8989 return $.wikiEditor.modules[module].supported;
9090 }
91 - } else if ( typeof $.wikiEditor.modules[module] !== 'undefined' ) {
 91+ } else {
9292 if ( typeof $.wikiEditor.supported !== 'undefined' ) {
9393 // Cache hit
9494 return $.wikiEditor.supported;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6514,13 +6514,13 @@
65156515 // Check for and make use of cached value and early opportunities to bail
65166516 if ( module ) {
65176517 // If the module doesn't exist, it's clearly not supported
6518 - if ( !( module in $.wikiEditor.modules ) ) {
 6518+ if ( typeof $.wikiEditor.modules[module] == 'undefined' ) {
65196519 return false;
65206520 } else if ( typeof $.wikiEditor.modules[module].supported !== 'undefined' ) {
65216521 // Cache hit
65226522 return $.wikiEditor.modules[module].supported;
65236523 }
6524 - } else if ( typeof $.wikiEditor.modules[module] !== 'undefined' ) {
 6524+ } else {
65256525 if ( typeof $.wikiEditor.supported !== 'undefined' ) {
65266526 // Cache hit
65276527 return $.wikiEditor.supported;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -436,7 +436,7 @@
437437 options.endContainer=options.startContainer;break;case'scrollToCaretPosition':options=$.extend({'force':false},options);break;}
438438 var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;var needSave=false;if(hasIframe&&context.savedSelection!==null){context.fn.restoreSelection();needSave=true;}
439439 retval=(hasIframe?context.fn:fn)[command].call(this,options);if(hasIframe&&needSave){context.fn.saveSelection();}
440 -return retval;};})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',4]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupported':function(module){if(module){if(!(module in $.wikiEditor.modules)){return false;}else if(typeof $.wikiEditor.modules[module].supported!=='undefined'){return $.wikiEditor.modules[module].supported;}}else if(typeof $.wikiEditor.modules[module]!=='undefined'){if(typeof $.wikiEditor.supported!=='undefined'){return $.wikiEditor.supported;}}
 440+return retval;};})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',4]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupported':function(module){if(module){if(typeof $.wikiEditor.modules[module]=='undefined'){return false;}else if(typeof $.wikiEditor.modules[module].supported!=='undefined'){return $.wikiEditor.modules[module].supported;}}else{if(typeof $.wikiEditor.supported!=='undefined'){return $.wikiEditor.supported;}}
441441 function cacheSupport(value){return module?$.wikiEditor.modules[module].supported=value:$.wikiEditor.supported=value;}
442442 var map=module&&'browsers'in $.wikiEditor.modules[module]?$.wikiEditor.modules[module].browsers:$.wikiEditor.browsers;if(!($.browser.name in map[$('body').is('.rtl')?'rtl':'ltr'])){return cacheSupport(true);}
443443 var browser=map[$('body').is('.rtl')?'rtl':'ltr'][$.browser.name];for(var condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(typeof val=='string'){if(!(eval('$.browser.version'+op+'"'+val+'"'))){return cacheSupport(false);}}else if(typeof val=='number'){if(!(eval('$.browser.versionNumber'+op+val))){return cacheSupport(false);}}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r62400wmf-deployment: Merge r62341, r62371 from trunkcatrope00:00, 13 February 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62341Finished the per-module isSupported system.tparscal23:16, 11 February 2010

Status & tagging log