* (bug 19287) Workaround for lag on history page in Firefox 3.5
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jul 2009 19:59:12 +0000 (19:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 19 Jul 2009 19:59:12 +0000 (19:59 +0000)
Added id attributes to diff radios and show/hide check boxes; this is to work around a bug in Firefox 3.5 where form session saving hangs for a while after each change when a page contains hundreds of anonymous radio and checkboxes.

RELEASE-NOTES
includes/PageHistory.php

index ddccf5e..a78eaa6 100644 (file)
@@ -294,6 +294,7 @@ this. Was used when mwEmbed was going to be an extension.
   Keyword set was not useful, and is ignored by modern search engines anway.
 * (bug 19827) Special:SpecialPages title is "Upload file
 * (bug 19355) Added .xhtml, .xht to upload file extension blacklist
+* (bug 19287) Workaround for lag on history page in Firefox 3.5
 
 == API changes in 1.16 ==
 
index 279f97b..ed84e18 100644 (file)
@@ -301,9 +301,12 @@ class PageHistory {
                                        '(' . $this->message['rev-delundel'] . ')' );
                        // Otherwise, show the link...
                        } else {
-                               $jsCall = 'updateShowHideForm('.$rev->getId().',this.checked)';
+                               $id = $rev->getId();
+                               $jsCall = "updateShowHideForm($id,this.checked)";
                                $del = Xml::check( 'showhiderevisions', false,
-                                       $hidden + array('onchange' => $jsCall) );
+                                       $hidden + array(
+                                               'onchange' => $jsCall,
+                                               'id' => "mw-revdel-$id" ) );
                                $query = array(
                                        'type' => 'revision',
                                        'target' => $this->mTitle->getPrefixedDbkey(),
@@ -473,11 +476,15 @@ class PageHistory {
         */
        function diffButtons( $rev, $firstInList, $counter ) {
                if( $this->linesonpage > 1 ) {
-                       $radio = array( 'type'  => 'radio', 'value' => $rev->getId() );
+                       $id = $rev->getId();
+                       $radio = array( 'type'  => 'radio', 'value' => $id );
                        /** @todo: move title texts to javascript */
                        if( $firstInList ) {
                                $first = Xml::element( 'input', 
-                                       array_merge( $radio, array( 'style' => 'visibility:hidden', 'name'  => 'oldid' ) )
+                                       array_merge( $radio, array(
+                                               'style' => 'visibility:hidden',
+                                               'name'  => 'oldid',
+                                               'id' => 'mw-oldid-null' ) )
                                );
                                $checkmark = array( 'checked' => 'checked' );
                        } else {
@@ -487,14 +494,20 @@ class PageHistory {
                                        $checkmark = array(); // We will check the next possible one
                                } else if( $counter == 2 || !$this->mOldIdChecked ) {
                                        $checkmark = array( 'checked' => 'checked' );
-                                       $this->mOldIdChecked = $rev->getId();
+                                       $this->mOldIdChecked = $id;
                                } else {
                                        $checkmark = array();
                                }
-                               $first = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name'  => 'oldid' ) ) );
+                               $first = Xml::element( 'input',
+                                       array_merge( $radio, $checkmark, array(
+                                               'name'  => 'oldid',
+                                               'id' => "mw-oldid-$id" ) ) );
                                $checkmark = array();
                        }
-                       $second = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name'  => 'diff' ) ) );
+                       $second = Xml::element( 'input',
+                               array_merge( $radio, $checkmark, array(
+                                       'name'  => 'diff',
+                                       'id' => "mw-diff-$id" ) ) );
                        return $first . $second;
                } else {
                        return '';