r61952 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61951‎ | r61952 | r61953 >
Date:20:11, 3 February 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: Fix r61951: rm trailing comma, add FIXME, polish IT Crowd reference
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' => 98 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 99 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 29 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 47 ),
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' => 215 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 216 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 215 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 216 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -211,7 +211,7 @@
212212 // Stack of states in { html: [string] } form
213213 'history': [],
214214 // Current history state position - this is number of steps backwards, so it's always -1 or less
215 - 'historyPosition': -1,
 215+ 'historyPosition': -1
216216 };
217217
218218 /*
@@ -276,7 +276,7 @@
277277 switch ( event.which ) {
278278 case 90: // z
279279 if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) {
280 - // HistoryPosition is a negetive number between -1 and -context.history.length, in other words
 280+ // HistoryPosition is a negative number between -1 and -context.history.length, in other words
281281 // it's the number of steps backwards from the latest state.
282282 if ( event.shiftKey ) {
283283 // Redo
@@ -288,6 +288,7 @@
289289 // Only act if we are switching to a valid state
290290 if ( context.history.length + context.historyPosition >= 0 && context.historyPosition < 0 ) {
291291 // Change state
 292+ // FIXME: Destroys event handlers, will be a problem with template folding
292293 context.$content.html(
293294 context.history[context.history.length + context.historyPosition].html
294295 );
@@ -296,7 +297,7 @@
297298 context.historyPosition =
298299 Math.max( -context.history.length, Math.min( context.historyPosition, -1 ) );
299300 }
300 - // Prevent the browser from getting in there and doing it's stuff
 301+ // Prevent the browser from jumping in and doing its stuff
301302 return false;
302303 }
303304 break;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6644,7 +6644,7 @@
66456645 // Stack of states in { html: [string] } form
66466646 'history': [],
66476647 // Current history state position - this is number of steps backwards, so it's always -1 or less
6648 - 'historyPosition': -1,
 6648+ 'historyPosition': -1
66496649 };
66506650
66516651 /*
@@ -6709,7 +6709,7 @@
67106710 switch ( event.which ) {
67116711 case 90: // z
67126712 if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) {
6713 - // HistoryPosition is a negetive number between -1 and -context.history.length, in other words
 6713+ // HistoryPosition is a negative number between -1 and -context.history.length, in other words
67146714 // it's the number of steps backwards from the latest state.
67156715 if ( event.shiftKey ) {
67166716 // Redo
@@ -6721,6 +6721,7 @@
67226722 // Only act if we are switching to a valid state
67236723 if ( context.history.length + context.historyPosition >= 0 && context.historyPosition < 0 ) {
67246724 // Change state
 6725+ // FIXME: Destroys event handlers, will be a problem with template folding
67256726 context.$content.html(
67266727 context.history[context.history.length + context.historyPosition].html
67276728 );
@@ -6729,7 +6730,7 @@
67306731 context.historyPosition =
67316732 Math.max( -context.history.length, Math.min( context.historyPosition, -1 ) );
67326733 }
6733 - // Prevent the browser from getting in there and doing it's stuff
 6734+ // Prevent the browser from jumping in and doing its stuff
67346735 return false;
67356736 }
67366737 break;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -442,7 +442,7 @@
443443 return $.wikiEditor.supported=true;},'autoMsg':function(object,property){if(typeof property=='object'){for(var i in property){if(property[i]in object||property[i]+'Msg'in object){property=property[i];break;}}}
444444 if(property in object){return object[property];}else if(property+'Msg'in object){if(typeof object[property+'Msg']=='object'){return mw.usability.getMsg.apply(mw.usability,object[property+'Msg']);}else{return mw.usability.getMsg(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;}
445445 return src+'?'+wgWikiEditorIconVersion;}};$.fn.wikiEditor=function(){if(!$j.wikiEditor.isSupported()){return $(this);}
446 -var context=$(this).data('wikiEditor-context');if(typeof context=='undefined'){context={'$textarea':$(this),'views':{},'modules':{},'data':{},'instance':$.wikiEditor.instances.push($(this))-1,'offsets':null,'htmlToTextMap':{},'oldHTML':null,'oldDelayedHTML':null,'savedSelection':null,'history':[],'historyPosition':-1,};context.api={'addModule':function(context,data){var modules={};if(typeof data=='string'){modules[data]={};}else if(typeof data=='object'){modules=data;}
 446+var context=$(this).data('wikiEditor-context');if(typeof context=='undefined'){context={'$textarea':$(this),'views':{},'modules':{},'data':{},'instance':$.wikiEditor.instances.push($(this))-1,'offsets':null,'htmlToTextMap':{},'oldHTML':null,'oldDelayedHTML':null,'savedSelection':null,'history':[],'historyPosition':-1};context.api={'addModule':function(context,data){var modules={};if(typeof data=='string'){modules[data]={};}else if(typeof data=='object'){modules=data;}
447447 for(var module in modules){if(typeof module=='string'&&module in $.wikiEditor.modules){if('api'in $.wikiEditor.modules[module]){for(var call in $.wikiEditor.modules[module].api){if(!(call in context.api)){context.api[call]=$.wikiEditor.modules[module].api[call];}}}
448448 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={'keydown':function(event){switch(event.which){case 90:if((event.ctrlKey||event.metaKey)&&context.history.length){if(event.shiftKey){context.historyPosition++;}else{context.historyPosition--;}
449449 if(context.history.length+context.historyPosition>=0&&context.historyPosition<0){context.$content.html(context.history[context.history.length+context.historyPosition].html);}else{context.historyPosition=Math.max(-context.history.length,Math.min(context.historyPosition,-1));}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61951Added redo, made use of ctrlKey, metaKey and shiftKey rather than doing detec...tparscal20:01, 3 February 2010

Status & tagging log