Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
75 | 75 | 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 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 29 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 47 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 12 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 215 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 216 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 215 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 216 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | // Stack of states in { html: [string] } form |
213 | 213 | 'history': [], |
214 | 214 | // Current history state position - this is number of steps backwards, so it's always -1 or less |
215 | | - 'historyPosition': -1, |
| 215 | + 'historyPosition': -1 |
216 | 216 | }; |
217 | 217 | |
218 | 218 | /* |
— | — | @@ -276,7 +276,7 @@ |
277 | 277 | switch ( event.which ) { |
278 | 278 | case 90: // z |
279 | 279 | 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 |
281 | 281 | // it's the number of steps backwards from the latest state. |
282 | 282 | if ( event.shiftKey ) { |
283 | 283 | // Redo |
— | — | @@ -288,6 +288,7 @@ |
289 | 289 | // Only act if we are switching to a valid state |
290 | 290 | if ( context.history.length + context.historyPosition >= 0 && context.historyPosition < 0 ) { |
291 | 291 | // Change state |
| 292 | + // FIXME: Destroys event handlers, will be a problem with template folding |
292 | 293 | context.$content.html( |
293 | 294 | context.history[context.history.length + context.historyPosition].html |
294 | 295 | ); |
— | — | @@ -296,7 +297,7 @@ |
297 | 298 | context.historyPosition = |
298 | 299 | Math.max( -context.history.length, Math.min( context.historyPosition, -1 ) ); |
299 | 300 | } |
300 | | - // Prevent the browser from getting in there and doing it's stuff |
| 301 | + // Prevent the browser from jumping in and doing its stuff |
301 | 302 | return false; |
302 | 303 | } |
303 | 304 | break; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6644,7 +6644,7 @@ |
6645 | 6645 | // Stack of states in { html: [string] } form |
6646 | 6646 | 'history': [], |
6647 | 6647 | // Current history state position - this is number of steps backwards, so it's always -1 or less |
6648 | | - 'historyPosition': -1, |
| 6648 | + 'historyPosition': -1 |
6649 | 6649 | }; |
6650 | 6650 | |
6651 | 6651 | /* |
— | — | @@ -6709,7 +6709,7 @@ |
6710 | 6710 | switch ( event.which ) { |
6711 | 6711 | case 90: // z |
6712 | 6712 | 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 |
6714 | 6714 | // it's the number of steps backwards from the latest state. |
6715 | 6715 | if ( event.shiftKey ) { |
6716 | 6716 | // Redo |
— | — | @@ -6721,6 +6721,7 @@ |
6722 | 6722 | // Only act if we are switching to a valid state |
6723 | 6723 | if ( context.history.length + context.historyPosition >= 0 && context.historyPosition < 0 ) { |
6724 | 6724 | // Change state |
| 6725 | + // FIXME: Destroys event handlers, will be a problem with template folding |
6725 | 6726 | context.$content.html( |
6726 | 6727 | context.history[context.history.length + context.historyPosition].html |
6727 | 6728 | ); |
— | — | @@ -6729,7 +6730,7 @@ |
6730 | 6731 | context.historyPosition = |
6731 | 6732 | Math.max( -context.history.length, Math.min( context.historyPosition, -1 ) ); |
6732 | 6733 | } |
6733 | | - // Prevent the browser from getting in there and doing it's stuff |
| 6734 | + // Prevent the browser from jumping in and doing its stuff |
6734 | 6735 | return false; |
6735 | 6736 | } |
6736 | 6737 | break; |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -442,7 +442,7 @@ |
443 | 443 | 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;}}} |
444 | 444 | 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;} |
445 | 445 | 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;} |
447 | 447 | 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];}}} |
448 | 448 | 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--;} |
449 | 449 | 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));} |