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' => 143 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 144 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 34 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 49 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 17 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 270 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 271 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 270 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 271 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -308,11 +308,15 @@ |
309 | 309 | 'keydown': function( event ) { |
310 | 310 | switch ( event.which ) { |
311 | 311 | case 90: // z |
312 | | - if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { |
| 312 | + case 89: // y |
| 313 | + if ( event.which == 89 && !$.browser.msie ) { |
| 314 | + // only handle y events for IE |
| 315 | + return true; |
| 316 | + } else if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { |
313 | 317 | // HistoryPosition is a negative number between -1 and -context.history.length, in other words |
314 | 318 | // it's the number of steps backwards from the latest state. |
315 | 319 | var newPosition; |
316 | | - if ( event.shiftKey ) { |
| 320 | + if ( event.shiftKey || event.which == 89 ) { |
317 | 321 | // Redo |
318 | 322 | newPosition = context.historyPosition + 1; |
319 | 323 | } else { |
— | — | @@ -342,32 +346,6 @@ |
343 | 347 | return false; |
344 | 348 | } |
345 | 349 | break; |
346 | | - case 89: //y |
347 | | - // ctrl + y handler for IE |
348 | | - if ( ( event.ctrlKey || event.metaKey ) && context.history.length && $.browser.msie ) { |
349 | | - newPosition = context.historyPosition + 1; |
350 | | - // Only act if we are switching to a valid state |
351 | | - if ( newPosition >= ( context.history.length * -1 ) && newPosition < 0 ) { |
352 | | - // Make sure we run the history storing code before we make this change |
353 | | - context.fn.updateHistory( context.oldDelayedHTML != context.$content.html() ); |
354 | | - context.oldDelayedHistoryPosition = context.historyPosition; |
355 | | - context.historyPosition = newPosition; |
356 | | - // Change state |
357 | | - // FIXME: Destroys event handlers, will be a problem with template folding |
358 | | - context.$content.html( |
359 | | - context.history[context.history.length + context.historyPosition].html |
360 | | - ); |
361 | | - context.fn.purgeOffsets(); |
362 | | - if( context.history[context.history.length + context.historyPosition].sel ) { |
363 | | - context.fn.setSelection( { |
364 | | - start: context.history[context.history.length + context.historyPosition].sel[0], |
365 | | - end: context.history[context.history.length + context.historyPosition].sel[1] |
366 | | - } ); |
367 | | - } |
368 | | - } |
369 | | - } |
370 | | - return false; |
371 | | - break; |
372 | 350 | // Intercept all tab events to provide consisten behavior across browsers |
373 | 351 | // Webkit browsers insert tab characters by default into the iframe rather than changing input focus |
374 | 352 | case 9: //tab |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6741,11 +6741,15 @@ |
6742 | 6742 | 'keydown': function( event ) { |
6743 | 6743 | switch ( event.which ) { |
6744 | 6744 | case 90: // z |
6745 | | - if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { |
| 6745 | + case 89: // y |
| 6746 | + if ( event.which == 89 && !$.browser.msie ) { |
| 6747 | + // only handle y events for IE |
| 6748 | + return true; |
| 6749 | + } else if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { |
6746 | 6750 | // HistoryPosition is a negative number between -1 and -context.history.length, in other words |
6747 | 6751 | // it's the number of steps backwards from the latest state. |
6748 | 6752 | var newPosition; |
6749 | | - if ( event.shiftKey ) { |
| 6753 | + if ( event.shiftKey || event.which == 89 ) { |
6750 | 6754 | // Redo |
6751 | 6755 | newPosition = context.historyPosition + 1; |
6752 | 6756 | } else { |
— | — | @@ -6775,32 +6779,6 @@ |
6776 | 6780 | return false; |
6777 | 6781 | } |
6778 | 6782 | break; |
6779 | | - case 89: //y |
6780 | | - // ctrl + y handler for IE |
6781 | | - if ( ( event.ctrlKey || event.metaKey ) && context.history.length && $.browser.msie ) { |
6782 | | - newPosition = context.historyPosition + 1; |
6783 | | - // Only act if we are switching to a valid state |
6784 | | - if ( newPosition >= ( context.history.length * -1 ) && newPosition < 0 ) { |
6785 | | - // Make sure we run the history storing code before we make this change |
6786 | | - context.fn.updateHistory( context.oldDelayedHTML != context.$content.html() ); |
6787 | | - context.oldDelayedHistoryPosition = context.historyPosition; |
6788 | | - context.historyPosition = newPosition; |
6789 | | - // Change state |
6790 | | - // FIXME: Destroys event handlers, will be a problem with template folding |
6791 | | - context.$content.html( |
6792 | | - context.history[context.history.length + context.historyPosition].html |
6793 | | - ); |
6794 | | - context.fn.purgeOffsets(); |
6795 | | - if( context.history[context.history.length + context.historyPosition].sel ) { |
6796 | | - context.fn.setSelection( { |
6797 | | - start: context.history[context.history.length + context.historyPosition].sel[0], |
6798 | | - end: context.history[context.history.length + context.historyPosition].sel[1] |
6799 | | - } ); |
6800 | | - } |
6801 | | - } |
6802 | | - } |
6803 | | - return false; |
6804 | | - break; |
6805 | 6783 | // Intercept all tab events to provide consisten behavior across browsers |
6806 | 6784 | // Webkit browsers insert tab characters by default into the iframe rather than changing input focus |
6807 | 6785 | case 9: //tab |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -446,11 +446,10 @@ |
447 | 447 | return src+'?'+wgWikiEditorIconVersion;}};$.fn.wikiEditor=function(){if(!$j.wikiEditor.isSupported()){return $(this);} |
448 | 448 | 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,'oldDelayedSel':null,'savedSelection':null,'history':[],'historyPosition':-1,'oldDelayedHistoryPosition':-1};context.api={'addModule':function(context,data){var modules={};if(typeof data=='string'){modules[data]={};}else if(typeof data=='object'){modules=data;} |
449 | 449 | for(var module in modules){if(typeof module=='string'&&$.wikiEditor.isSupported(module)){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];}}} |
450 | | -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){var newPosition;if(event.shiftKey){newPosition=context.historyPosition+1;}else{newPosition=context.historyPosition-1;} |
| 450 | +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:case 89:if(event.which==89&&!$.browser.msie){return true;}else if((event.ctrlKey||event.metaKey)&&context.history.length){var newPosition;if(event.shiftKey||event.which==89){newPosition=context.historyPosition+1;}else{newPosition=context.historyPosition-1;} |
451 | 451 | if(newPosition>=(context.history.length*-1)&&newPosition<0){context.fn.updateHistory(context.oldDelayedHTML!=context.$content.html());context.oldDelayedHistoryPosition=context.historyPosition;context.historyPosition=newPosition;context.$content.html(context.history[context.history.length+context.historyPosition].html);context.fn.purgeOffsets();if(context.history[context.history.length+context.historyPosition].sel){context.fn.setSelection({start:context.history[context.history.length+context.historyPosition].sel[0],end:context.history[context.history.length+context.historyPosition].sel[1]});}} |
452 | 452 | return false;} |
453 | | -break;case 89:if((event.ctrlKey||event.metaKey)&&context.history.length&&$.browser.msie){newPosition=context.historyPosition+1;if(newPosition>=(context.history.length*-1)&&newPosition<0){context.fn.updateHistory(context.oldDelayedHTML!=context.$content.html());context.oldDelayedHistoryPosition=context.historyPosition;context.historyPosition=newPosition;context.$content.html(context.history[context.history.length+context.historyPosition].html);context.fn.purgeOffsets();if(context.history[context.history.length+context.historyPosition].sel){context.fn.setSelection({start:context.history[context.history.length+context.historyPosition].sel[0],end:context.history[context.history.length+context.historyPosition].sel[1]});}}} |
454 | | -return false;break;case 9:if(event.ctrlKey||event.altKey||event.shiftKey){return true;}else{var $tabindexList=$j('[tabindex]:visible').sort(function(a,b){return a.tabIndex-b.tabIndex;});for(var i=0;i<$tabindexList.length;i++){if($tabindexList.eq(i).attr('id')==context.$iframe.attr('id')){$tabindexList.get(i+1).focus();break;}} |
| 453 | +break;case 9:if(event.ctrlKey||event.altKey||event.shiftKey){return true;}else{var $tabindexList=$j('[tabindex]:visible').sort(function(a,b){return a.tabIndex-b.tabIndex;});for(var i=0;i<$tabindexList.length;i++){if($tabindexList.eq(i).attr('id')==context.$iframe.attr('id')){$tabindexList.get(i+1).focus();break;}} |
455 | 454 | return false;} |
456 | 455 | break;case 86:if(event.ctrlKey){context.evt.paste(event);} |
457 | 456 | break;} |