r59989 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59988‎ | r59989 | r59990 >
Date:00:09, 12 December 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Solved array index being 1 too high. Oops!
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.html (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -71,7 +71,7 @@
7272 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
7373 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 6 ),
7474 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 21 ),
75 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 33 ),
 75+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 34 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 1 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 38 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 9 ),
@@ -81,10 +81,10 @@
8282 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 0 ),
8383 ),
8484 'combined' => array(
85 - array( 'src' => 'js/plugins.combined.js', 'version' => 106 ),
 85+ array( 'src' => 'js/plugins.combined.js', 'version' => 107 ),
8686 ),
8787 'minified' => array(
88 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 106 ),
 88+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 107 ),
8989 ),
9090 ),
9191 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html
@@ -4,7 +4,6 @@
55 <title>WikiEditor</title>
66 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
77 <script type="text/javascript">
8 - /*
98 parent.inherit( window )( function() {
109 function get( name ) {
1110 // Extracts the value of a given URL parameter from the current window location
@@ -17,7 +16,6 @@
1817 context.fn.trigger( "change", event )
1918 } );
2019 } );
21 - */
2220 </script>
2321 </head>
2422 <body style="margin:0;padding:0;width:100%;height:100%;white-space:pre-wrap;font-family:monospace;font-size:9.5pt;"></body>
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -36,7 +36,7 @@
3737 'browsers': {
3838 // Left-to-right languages
3939 'ltr': {
40 - // The toolbar layout is IE6
 40+ // The toolbar layout is broken in IE6
4141 'msie': [['>=', 7]],
4242 // jQuery UI appears to be broken in FF 2.0 - 2.0.0.4
4343 'firefox': [
@@ -79,7 +79,7 @@
8080 */
8181 'isSupported': function() {
8282 // Check for and make use of a cached return value
83 - if ( $.wikiEditor.supported != undefined ) {
 83+ if ( typeof $.wikiEditor.supported != 'undefined' ) {
8484 return $.wikiEditor.supported;
8585 }
8686 // Check if we have any compatiblity information on-hand for the current browser
@@ -194,7 +194,7 @@
195195 // General place to shouve bits of data into
196196 'data': {},
197197 // Unique numeric ID of this instance used both for looking up and differentiating instances of wikiEditor
198 - 'instance': $.wikiEditor.instances.push( $(this) )
 198+ 'instance': $.wikiEditor.instances.push( $(this) ) - 1
199199 };
200200
201201 /*
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1346,7 +1346,7 @@
13471347 'browsers': {
13481348 // Left-to-right languages
13491349 'ltr': {
1350 - // The toolbar layout is IE6
 1350+ // The toolbar layout is broken in IE6
13511351 'msie': [['>=', 7]],
13521352 // jQuery UI appears to be broken in FF 2.0 - 2.0.0.4
13531353 'firefox': [
@@ -1389,7 +1389,7 @@
13901390 */
13911391 'isSupported': function() {
13921392 // Check for and make use of a cached return value
1393 - if ( $.wikiEditor.supported != undefined ) {
 1393+ if ( typeof $.wikiEditor.supported != 'undefined' ) {
13941394 return $.wikiEditor.supported;
13951395 }
13961396 // Check if we have any compatiblity information on-hand for the current browser
@@ -1504,7 +1504,7 @@
15051505 // General place to shouve bits of data into
15061506 'data': {},
15071507 // Unique numeric ID of this instance used both for looking up and differentiating instances of wikiEditor
1508 - 'instance': $.wikiEditor.instances.push( $(this) )
 1508+ 'instance': $.wikiEditor.instances.push( $(this) ) - 1
15091509 };
15101510
15111511 /*
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -82,13 +82,13 @@
8383 $(this).trigger('scrollToPosition');});}};switch(command){case'encapsulateSelection':options=$.extend({'pre':'','peri':'','post':'','ownline':false,'replace':false},options);break;case'getCaretPosition':options=$.extend({'startAndEnd':false,},options);break;case'setSelection':options=$.extend({'start':undefined,'end':undefined,'startContainer':undefined,'endContainer':undefined,},options);if(options.end===undefined)
8484 options.end=options.start;if(options.endContainer==undefined)
8585 options.endContainer=options.startContainer;break;case'scrollToCaretPosition':options=$.extend({'force':false},options);break;}
86 -var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;return(hasIframe?context.fn:fn)[command].call(this,options);};})(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':[['>=',3.1]]},'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':[['>=',3.1]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupported':function(){if($.wikiEditor.supported!=undefined){return $.wikiEditor.supported;}
 86+var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;return(hasIframe?context.fn:fn)[command].call(this,options);};})(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':[['>=',3.1]]},'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':[['>=',3.1]]}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupported':function(){if(typeof $.wikiEditor.supported!='undefined'){return $.wikiEditor.supported;}
8787 if(!($.browser.name in $.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'])){return $.wikiEditor.supported=true;}
8888 var browser=$.wikiEditor.browsers[$('body').is('.rtl')?'rtl':'ltr'][$.browser.name];for(condition in browser){var op=browser[condition][0];var val=browser[condition][1];if(typeof val=='string'){if(!(eval('$.browser.version'+op+'"'+val+'"'))){return $.wikiEditor.supported=false;}}else if(typeof val=='number'){if(!(eval('$.browser.versionNumber'+op+val))){return $.wikiEditor.supported=false;}}}
8989 return $.wikiEditor.supported=true;},'autoMsg':function(object,property){if(typeof property=='object'){for(i in property){if(property[i]in object||property[i]+'Msg'in object){property=property[i];break;}}}
9090 if(property in object){return object[property];}else if(property+'Msg'in object){return gM(object[property+'Msg']);}else{return'';}},'autoLang':function(object,lang){return object[lang||wgUserLanguage]||object['default']||object;},'autoIcon':function(icon,path,lang){var src=$.wikiEditor.autoLang(icon,lang);path=path||$.wikiEditor.imgPath;if(src.substr(0,7)!='http://'&&src.substr(0,8)!='https://'&&src[0]!='/'){src=path+src;}
9191 return src+'?'+wgWikiEditorIconVersion;}};$.fn.wikiEditor=function(){if(!$j.wikiEditor.isSupported()){return $(this);}
92 -var context=$(this).data('wikiEditor-context');if(typeof context=='undefined'){context={'$textarea':$(this),'views':{},'modules':{},'data':{},'instance':$.wikiEditor.instances.push($(this))};context.api={'addModule':function(context,data){var modules={};if(typeof data=='string'){modules[data]={};}else if(typeof data=='object'){modules=data;}
 92+var context=$(this).data('wikiEditor-context');if(typeof context=='undefined'){context={'$textarea':$(this),'views':{},'modules':{},'data':{},'instance':$.wikiEditor.instances.push($(this))-1};context.api={'addModule':function(context,data){var modules={};if(typeof data=='string'){modules[data]={};}else if(typeof data=='object'){modules=data;}
9393 for(module in modules){if(typeof module=='string'&&module in $.wikiEditor.modules){if('api'in $.wikiEditor.modules[module]){for(call in $.wikiEditor.modules[module].api){if(!(call in context.api)){context.api[call]=$.wikiEditor.modules[module].api[call];}}}
9494 if('fn'in $.wikiEditor.modules[module]&&'create'in $.wikiEditor.modules[module].fn){context.modules[module]={};$.wikiEditor.modules[module].fn.create(context,modules[module]);}}}}};context.evt={'change':function(event){switch(event.type){case'keypress':if(true){event.data.scope='division';}else{event.data.scope='character';}
9595 break;case'mousedown':if(true){event.data.scope='division';}else{return false;}

Status & tagging log