History page with HTML diff enabled now also works when JavaScript is disabled.
authorGuy Van den Broeck <guyvdb@users.mediawiki.org>
Fri, 22 Aug 2008 16:53:56 +0000 (16:53 +0000)
committerGuy Van den Broeck <guyvdb@users.mediawiki.org>
Fri, 22 Aug 2008 16:53:56 +0000 (16:53 +0000)
includes/Article.php
includes/DefaultSettings.php
includes/PageHistory.php
skins/common/history.js

index 135ad8b..19ede2c 100644 (file)
@@ -731,7 +731,7 @@ class Article {
                        $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
 
                        $diff = $wgRequest->getVal( 'diff' );
-                       $htmldiff = $wgRequest->getVal( 'htmldiff' );
+                       $htmldiff = $wgRequest->getVal( 'htmldiff' , false);
                        $de = new DifferenceEngine( $this->mTitle, $oldid, $diff, $rcid, $purge, $htmldiff);
                        // DifferenceEngine directly fetched the revision:
                        $this->mRevIdFetched = $de->mNewid;
index 944f735..9fc302d 100644 (file)
@@ -1382,7 +1382,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches don't keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '168';
+$wgStyleVersion = '169';
 
 
 # Server-side caching:
index 5ea8461..35f08f3 100644 (file)
@@ -201,10 +201,9 @@ class PageHistory {
                $s .= Xml::openElement( 'form', array( 'action' => $wgScript ) );
                $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
                if($wgEnableHtmlDiff){
-                       $s .= Xml::hidden( 'htmldiff', 0 , array('id' => 'htmldiff'));
                        $s .= $this->submitButton( wfMsg( 'visualcomparison'),
                        array(
-                                       'id' => 'submithtmldiff1',
+                                       'name' => 'htmldiff',
                                        'class'     => 'historysubmit',
                                        'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
                                        'title'     => wfMsg( 'tooltip-compareselectedversions' ),
@@ -212,7 +211,6 @@ class PageHistory {
                        );
                        $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
                        array(
-                                       'id' => 'submitsourcediff1',
                                        'class'     => 'historysubmit',
                                        'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
                                        'title'     => wfMsg( 'tooltip-compareselectedversions' ),
@@ -242,7 +240,7 @@ class PageHistory {
                if($wgEnableHtmlDiff){
                        $s .= $this->submitButton( wfMsg( 'visualcomparison'),
                        array(
-                                       'id' => 'submithtmldiff2',
+                                       'name' => 'htmldiff',
                                        'class'     => 'historysubmit',
                                        'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
                                        'title'     => wfMsg( 'tooltip-compareselectedversions' ),
@@ -250,7 +248,6 @@ class PageHistory {
                        );
                        $s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
                        array(
-                                       'id' => 'submitsourcediff2',
                                        'class'     => 'historysubmit',
                                        'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
                                        'title'     => wfMsg( 'tooltip-compareselectedversions' ),
index 0611a0a..57e6184 100644 (file)
@@ -80,52 +80,4 @@ function histrowinit() {
        diffcheck();
 }
 
-// attach htmldiff event handler
-function htmldiffsubmit() {
-       var hf = document.getElementById('submithtmldiff1');
-       if (!hf) {
-               return;
-       }
-       hf.onclick = enablehtmldiff;
-       hf = document.getElementById('submithtmldiff2');
-       if (!hf) {
-               return;
-       }
-       hf.onclick = enablehtmldiff;
-}
-
-// change hidden field when choosing html compare
-function enablehtmldiff() {
-       var hf = document.getElementById('htmldiff');
-       if (!hf) {
-               return;
-       }
-       hf.value = 1;
-}
-
-// attach source diff event handler
-function sourcediffsubmit() {
-       var hf = document.getElementById('submitsourcediff1');
-       if (!hf) {
-               return;
-       }
-       hf.onclick = disablehtmldiff;
-       hf = document.getElementById('submitsourcediff2');
-       if (!hf) {
-               return;
-       }
-       hf.onclick = disablehtmldiff;
-}
-
-// change hidden field when choosing source diff
-function disablehtmldiff() {
-       var hf = document.getElementById('htmldiff');
-       if (!hf) {
-               return;
-       }
-       hf.value = 0;
-}
-
 hookEvent("load", histrowinit);
-hookEvent("load", htmldiffsubmit);
-hookEvent("load", sourcediffsubmit);