r64354 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64353‎ | r64354 | r64355 >
Date:19:05, 29 March 2010
Author:nimishg
Status:ok
Tags:
Comment:
fixes the 'templates exploding on paste in FF/win' issue
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.highlight.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -72,8 +72,8 @@
7373 array( 'src' => 'js/plugins/jquery.delayedBind.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' => 178 ),
77 - array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 51 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 179 ),
 77+ array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 52 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 54 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 23 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 366 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 367 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 366 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 367 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -365,7 +365,7 @@
366366 }
367367 break;
368368 case 86: //v
369 - if ( event.ctrlKey ){
 369+ if ( event.ctrlKey && $.browser.msie){
370370 //paste, intercepted for IE
371371 context.evt.paste( event );
372372 }
@@ -419,7 +419,6 @@
420420 // Save the cursor position to restore it after all this voodoo
421421 var cursorPos = context.fn.getCaretPosition();
422422 var oldLength = context.fn.getContents().length;
423 -
424423 context.$content.find( ':not(.wikiEditor)' ).addClass( 'wikiEditor' );
425424 if ( $.layout.name !== 'webkit' ) {
426425 context.$content.addClass( 'pasting' );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.highlight.js
@@ -414,7 +414,7 @@
415415
416416 // Remove this marker
417417 var marker = $(this).data( 'marker' );
418 - if ( typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) {
 418+ if ( marker && typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) {
419419 // Don't remove these either
420420 return true;
421421 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6908,7 +6908,7 @@
69096909 }
69106910 break;
69116911 case 86: //v
6912 - if ( event.ctrlKey ){
 6912+ if ( event.ctrlKey && $.browser.msie){
69136913 //paste, intercepted for IE
69146914 context.evt.paste( event );
69156915 }
@@ -6962,7 +6962,6 @@
69636963 // Save the cursor position to restore it after all this voodoo
69646964 var cursorPos = context.fn.getCaretPosition();
69656965 var oldLength = context.fn.getContents().length;
6966 -
69676966 context.$content.find( ':not(.wikiEditor)' ).addClass( 'wikiEditor' );
69686967 if ( $.layout.name !== 'webkit' ) {
69696968 context.$content.addClass( 'pasting' );
@@ -8976,7 +8975,7 @@
89778976
89788977 // Remove this marker
89798978 var marker = $(this).data( 'marker' );
8980 - if ( typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) {
 8979+ if ( marker && typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) {
89818980 // Don't remove these either
89828981 return true;
89838982 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -458,7 +458,7 @@
459459 return false;}
460460 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;}}
461461 return false;}
462 -break;case 86:if(event.ctrlKey){context.evt.paste(event);}
 462+break;case 86:if(event.ctrlKey&&$.browser.msie){context.evt.paste(event);}
463463 break;}
464464 return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';}
465465 if(context.$content.children().length==0){context.$content.append('<p></p>');}
@@ -613,7 +613,7 @@
614614 $(anchor).data('marker',markers[i]).addClass('wikiEditor-highlight');markers[i].afterWrap(anchor,markers[i]);}else{$(anchor).data('marker',markers[i]);markers[i].onSkip(anchor);}
615615 visited[v++]=anchor;}}
616616 var j=0;context.$content.find('.wikiEditor-highlight').each(function(){if(visited[j]==this){j++;return true;}
617 -var marker=$(this).data('marker');if(typeof marker.skipDivision!='undefined'&&(division==marker.skipDivision)){return true;}
 617+var marker=$(this).data('marker');if(marker&&typeof marker.skipDivision!='undefined'&&(division==marker.skipDivision)){return true;}
618618 if(marker&&typeof marker.beforeUnwrap=='function')
619619 marker.beforeUnwrap(this);if((marker&&marker.anchor=='tag')||$(this).is('p')){$(this).removeAttr('class');}else{$(this).replaceWith(this.childNodes);}
620620 context.fn.purgeOffsets();});}}};})(jQuery);(function($){$.wikiEditor.modules.preview={'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]}},fn:{create:function(context,config){if('initialized'in context.modules.preview){return;}

Follow-up revisions

RevisionCommit summaryAuthorDate
r64360Style fix for r64354catrope20:04, 29 March 2010
r64455merged changes from r64404. r64167, r64354 into deployment for UX testnimishg20:23, 31 March 2010

Status & tagging log