$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;
$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' ),
);
$s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
array(
- 'id' => 'submitsourcediff1',
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
if($wgEnableHtmlDiff){
$s .= $this->submitButton( wfMsg( 'visualcomparison'),
array(
- 'id' => 'submithtmldiff2',
+ 'name' => 'htmldiff',
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-visualcomparison' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
);
$s .= $this->submitButton( wfMsg( 'wikicodecomparison'),
array(
- 'id' => 'submitsourcediff2',
'class' => 'historysubmit',
'accesskey' => wfMsg( 'accesskey-compareselectedversions' ),
'title' => wfMsg( 'tooltip-compareselectedversions' ),
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);