r112520 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112519‎ | r112520 | r112521 >
Date:21:33, 27 February 2012
Author:catrope
Status:ok
Tags:
Comment:
Fix bug in proofread.js that was causing a JS error if textarea#wpTextbox1 and div#copywarn are not adjacent siblings. Instead of assuming that copywarn is the next sibling of wpTextbox1, use .nextSibling to insert the table in the right place.
Modified paths:
  • /trunk/extensions/ProofreadPage/proofread.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ProofreadPage/proofread.js
@@ -749,18 +749,18 @@
750750 return;
751751 }
752752 var f = text.parentNode;
753 - var new_text = f.removeChild( text );
754753
755754 if( proofreadPageIsEdit ) {
756755 pr_make_edit_area( self.text_container, new_text.value );
757 - var copywarn = document.getElementById( 'editpage-copywarn' );
758 - f.insertBefore( table, copywarn );
 756+ f.insertBefore( table, text.nextSibling ); // Inserts table after text
 757+ f.removeChild( text );
759758 if ( !self.proofreadpage_show_headers ) {
760759 hookEvent( 'load', pr_toggle_visibility );
761760 } else {
762761 hookEvent( 'load', pr_reset_size );
763762 }
764763 } else {
 764+ var new_text = f.removeChild( text );
765765 self.text_container.appendChild( new_text );
766766 f.appendChild( self.table );
767767 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r1125221.19wmf1: r112520catrope21:48, 27 February 2012
r112524Fix stupid typo in r112520catrope21:51, 27 February 2012
r113037MFT r110703, r110933, r111011, r111218, r112520, r112524, r112660, r112687, r...reedy14:59, 5 March 2012

Status & tagging log