r24565 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24564‎ | r24565 | r24566 >
Date:17:40, 3 August 2007
Author:robchurch
Status:old
Tags:
Comment:
(bug 9437) Don't overwrite edit form submission handler when setting up edit box scroll position preserve/restore behaviour
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES
@@ -348,8 +348,9 @@
349349 cases.
350350 * Fix RTL display of the upload form.
351351 * Fixed regression in blocking of username '0'
 352+* (bug 9437) Don't overwrite edit form submission handler when setting up
 353+ edit box scroll position preserve/restore behaviour
352354
353 -
354355 == API changes since 1.10 ==
355356
356357 Full API documentation is available at http://www.mediawiki.org/wiki/API
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1195,7 +1195,7 @@
11961196 * to ensure that client-side caches don't keep obsolete copies of global
11971197 * styles.
11981198 */
1199 -$wgStyleVersion = '95';
 1199+$wgStyleVersion = '96';
12001200
12011201
12021202 # Server-side caching:
Index: trunk/phase3/skins/common/wikibits.js
@@ -778,21 +778,24 @@
779779 document.getElementById(idb).checked=false;
780780 }
781781
 782+/**
 783+ * Restore the edit box scroll state following a preview operation,
 784+ * and set up a form submission handler to remember this state
 785+ */
782786 function scrollEditBox() {
783 - var editBoxEl = document.getElementById("wpTextbox1");
784 - var scrollTopEl = document.getElementById("wpScrolltop");
785 - var editFormEl = document.getElementById("editform");
786 -
787 - if (editBoxEl && scrollTopEl) {
788 - if (scrollTopEl.value) { editBoxEl.scrollTop = scrollTopEl.value; }
789 - editFormEl.onsubmit = function() {
790 - document.getElementById("wpScrolltop").value = document.getElementById("wpTextbox1").scrollTop;
791 - };
 787+ var editBox = document.getElementById( 'wpTextbox1' );
 788+ var scrollTop = document.getElementById( 'wpScrolltop' );
 789+ var editForm = document.getElementById( 'editform' );
 790+ if( editBox && scrollTop ) {
 791+ if( scrollTop.value )
 792+ editBox.scrollTop = scrollTop.value;
 793+ addHandler( editForm, 'submit', function() {
 794+ document.getElementById( 'wpScrolltop' ).value = document.getElementById( 'wpTextbox1' ).scrollTop;
 795+ } );
792796 }
793797 }
 798+hookEvent( 'load', scrollEditBox );
794799
795 -hookEvent("load", scrollEditBox);
796 -
797800 var allmessages_nodelist = false;
798801 var allmessages_modified = false;
799802 var allmessages_timeout = false;

Follow-up revisions

RevisionCommit summaryAuthorDate
r24631Merged revisions 24480-24600 via svnmerge from...david18:39, 6 August 2007

Status & tagging log