r67526 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67525‎ | r67526 | r67527 >
Date:12:54, 7 June 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: (bug 23570) Inserting characters into edit summary field using charinsert-like tools was broken
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Modules/EditWarning/EditWarning.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js (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.textSelection.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/Vector/Modules/EditWarning/EditWarning.js
@@ -13,7 +13,7 @@
1414 fallbackWindowOnBeforeUnload = window.onbeforeunload;
1515 window.onbeforeunload = function() {
1616 var fallbackResult = undefined;
17 - // Check if someone already set on onbeforunload hook
 17+ // Check if someone already set on onbeforeunload hook
1818 if ( fallbackWindowOnBeforeUnload ) {
1919 // Get the result of their onbeforeunload hook
2020 fallbackResult = fallbackWindowOnBeforeUnload();
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js
@@ -188,7 +188,7 @@
189189 fallbackWindowOnBeforeUnload = window.onbeforeunload;
190190 window.onbeforeunload = function() {
191191 var fallbackResult = undefined;
192 - // Check if someone already set on onbeforunload hook
 192+ // Check if someone already set on onbeforeunload hook
193193 if ( fallbackWindowOnBeforeUnload ) {
194194 // Get the result of their onbeforeunload hook
195195 fallbackResult = fallbackWindowOnBeforeUnload();
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -74,7 +74,7 @@
7575 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 18 ),
7676 array( 'src' => 'js/plugins/jquery.expandableField.js', 'version' => 15 ),
7777 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 21 ),
78 - array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 33 ),
 78+ array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 34 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 191 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 64 ),
@@ -89,10 +89,10 @@
9090 array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 1 ),
9191 ),
9292 'combined' => array(
93 - array( 'src' => 'js/plugins.combined.js', 'version' => 413 ),
 93+ array( 'src' => 'js/plugins.combined.js', 'version' => 414 ),
9494 ),
9595 'minified' => array(
96 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 413 ),
 96+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 414 ),
9797 ),
9898 ),
9999 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js
@@ -91,7 +91,9 @@
9292 } else if ( document.selection && document.selection.createRange ) {
9393 // IE
9494 $(this).focus();
95 - context.fn.restoreStuffForIE();
 95+ if ( context ) {
 96+ context.fn.restoreStuffForIE();
 97+ }
9698 var selText = $(this).textSelection( 'getSelection' );
9799 var scrollTop = this.scrollTop;
98100 var range = document.selection.createRange();
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6500,7 +6500,9 @@
65016501 } else if ( document.selection && document.selection.createRange ) {
65026502 // IE
65036503 $(this).focus();
6504 - context.fn.restoreStuffForIE();
 6504+ if ( context ) {
 6505+ context.fn.restoreStuffForIE();
 6506+ }
65056507 var selText = $(this).textSelection( 'getSelection' );
65066508 var scrollTop = this.scrollTop;
65076509 var range = document.selection.createRange();
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -430,7 +430,8 @@
431431 this.value=this.value.substring(0,startPos)+options.pre+selText+options.post+
432432 this.value.substring(endPos,this.value.length);this.scrollTop=scrollTop;if(window.opera){options.pre=options.pre.replace(/\r?\n/g,"\r\n");selText=selText.replace(/\r?\n/g,"\r\n");options.post=options.post.replace(/\r?\n/g,"\r\n");}
433433 if(isSample){this.selectionStart=startPos+options.pre.length;this.selectionEnd=startPos+options.pre.length+selText.length;}else{this.selectionStart=startPos+options.pre.length+selText.length+
434 -options.post.length;this.selectionEnd=this.selectionStart;}}else if(document.selection&&document.selection.createRange){$(this).focus();context.fn.restoreStuffForIE();var selText=$(this).textSelection('getSelection');var scrollTop=this.scrollTop;var range=document.selection.createRange();if(options.ownline&&range.moveStart){var range2=document.selection.createRange();range2.collapse();range2.moveStart('character',-1);if(range2.text!="\r"&&range2.text!="\n"&&range2.text!=""){options.pre="\n"+options.pre;}
 434+options.post.length;this.selectionEnd=this.selectionStart;}}else if(document.selection&&document.selection.createRange){$(this).focus();if(context){context.fn.restoreStuffForIE();}
 435+var selText=$(this).textSelection('getSelection');var scrollTop=this.scrollTop;var range=document.selection.createRange();if(options.ownline&&range.moveStart){var range2=document.selection.createRange();range2.collapse();range2.moveStart('character',-1);if(range2.text!="\r"&&range2.text!="\n"&&range2.text!=""){options.pre="\n"+options.pre;}
435436 var range3=document.selection.createRange();range3.collapse(false);range3.moveEnd('character',1);if(range3.text!="\r"&&range3.text!="\n"&&range3.text!=""){options.post+="\n";}}
436437 checkSelectedText();range.text=options.pre+selText+options.post;if(isSample&&range.moveStart){range.moveStart('character',-options.post.length-selText.length);range.moveEnd('character',-options.post.length);}
437438 range.select();this.scrollTop=scrollTop;}

Follow-up revisions

RevisionCommit summaryAuthorDate
r67544(bug 23570) Fix an instance of a javascript: link in corecatrope16:19, 7 June 2010

Status & tagging log