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' => 142 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 143 ), |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 33 ), |
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' => 268 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 269 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 268 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 269 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -306,7 +306,6 @@ |
307 | 307 | * processing of events which did not actually change the content of the iframe. |
308 | 308 | */ |
309 | 309 | 'keydown': function( event ) { |
310 | | - |
311 | 310 | switch ( event.which ) { |
312 | 311 | case 90: // z |
313 | 312 | if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { |
— | — | @@ -343,6 +342,32 @@ |
344 | 343 | return false; |
345 | 344 | } |
346 | 345 | 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; |
347 | 372 | // Intercept all tab events to provide consisten behavior across browsers |
348 | 373 | // Webkit browsers insert tab characters by default into the iframe rather than changing input focus |
349 | 374 | case 9: //tab |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -6739,7 +6739,6 @@ |
6740 | 6740 | * processing of events which did not actually change the content of the iframe. |
6741 | 6741 | */ |
6742 | 6742 | 'keydown': function( event ) { |
6743 | | - |
6744 | 6743 | switch ( event.which ) { |
6745 | 6744 | case 90: // z |
6746 | 6745 | if ( ( event.ctrlKey || event.metaKey ) && context.history.length ) { |
— | — | @@ -6776,6 +6775,32 @@ |
6777 | 6776 | return false; |
6778 | 6777 | } |
6779 | 6778 | 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; |
6780 | 6805 | // Intercept all tab events to provide consisten behavior across browsers |
6781 | 6806 | // Webkit browsers insert tab characters by default into the iframe rather than changing input focus |
6782 | 6807 | case 9: //tab |
— | — | @@ -6838,6 +6863,11 @@ |
6839 | 6864 | setTimeout( function() { |
6840 | 6865 | // Unwrap the span found in webkit copies |
6841 | 6866 | context.$content.find( 'link, style, meta' ).remove(); //MS Word |
| 6867 | + context.$content.find('p:not(.wikiEditor) p:not(.wikiEditor)') //MS Word+webkit |
| 6868 | + .each( function(){ |
| 6869 | + var outerParent = $(this).parent(); |
| 6870 | + outerParent.replaceWith( outerParent.childNodes() ); |
| 6871 | + }); |
6842 | 6872 | context.$content.find( 'span.Apple-style-span' ).each( function() { |
6843 | 6873 | $( this.childNodes ).insertBefore( this ); |
6844 | 6874 | } ).remove(); //Apple Richtext |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -449,7 +449,8 @@ |
450 | 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;} |
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 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 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;}} |
454 | 455 | return false;} |
455 | 456 | break;case 86:if(event.ctrlKey){context.evt.paste(event);} |
456 | 457 | break;} |
— | — | @@ -457,7 +458,7 @@ |
458 | 459 | switch(event.which){case 8:break;} |
459 | 460 | return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.oldDelayedHTML=newHTML;event.data.scope='realchange';} |
460 | 461 | context.fn.updateHistory(event.data.scope=='realchange');return true;},'paste':function(event){context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.addClass('pasting');} |
461 | | -setTimeout(function(){context.$content.find('link, style, meta').remove();context.$content.find('span.Apple-style-span').each(function(){$(this.childNodes).insertBefore(this);}).remove();var $selection=context.$content.find(':not(.wikiEditor)');while($selection.length&&$selection.length>0){var $currentElement=$selection.eq(0);while(!$currentElement.parent().is('body')&&!$currentElement.parent().is('.wikiEditor')){$currentElement=$currentElement.parent();} |
| 462 | +setTimeout(function(){context.$content.find('link, style, meta').remove();context.$content.find('p:not(.wikiEditor) p:not(.wikiEditor)').each(function(){var outerParent=$(this).parent();outerParent.replaceWith(outerParent.childNodes());});context.$content.find('span.Apple-style-span').each(function(){$(this.childNodes).insertBefore(this);}).remove();var $selection=context.$content.find(':not(.wikiEditor)');while($selection.length&&$selection.length>0){var $currentElement=$selection.eq(0);while(!$currentElement.parent().is('body')&&!$currentElement.parent().is('.wikiEditor')){$currentElement=$currentElement.parent();} |
462 | 463 | var text=$currentElement.text();if($currentElement.is('br')){$currentElement.addClass('wikiEditor');}else if($currentElement.is('span')&&text.length==0){$currentElement.remove();}else{$newElement=$('<p></p>').addClass('wikiEditor').insertAfter($currentElement);if(text.length){$newElement.text(text);}else{$newElement.append($('<br>').addClass('wikiEditor'));} |
463 | 464 | $currentElement.remove();} |
464 | 465 | $selection=context.$content.find(':not(.wikiEditor)');} |