diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /resources/mediawiki.action/mediawiki.action.history.js | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'resources/mediawiki.action/mediawiki.action.history.js')
-rw-r--r-- | resources/mediawiki.action/mediawiki.action.history.js | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/resources/mediawiki.action/mediawiki.action.history.js b/resources/mediawiki.action/mediawiki.action.history.js index 66f90b07..1b5b3a00 100644 --- a/resources/mediawiki.action/mediawiki.action.history.js +++ b/resources/mediawiki.action/mediawiki.action.history.js @@ -1,7 +1,53 @@ /* * JavaScript for History action */ +jQuery( function( $ ) { + var $lis = $( 'ul#pagehistory li' ); + var updateDiffRadios = function() { + var diffLi = false, // the li where the diff radio is checked + oldLi = false; // the li where the oldid radio is checked -// Replaces histrowinit -$( '#pagehistory li input[name=diff], #pagehistory li input[name=oldid]' ).click( diffcheck ); -diffcheck();
\ No newline at end of file + if ( !$lis.length ) { + return true; + } + $lis.removeClass( 'selected' ); + $lis.each( function() { + var $this = $(this); + var $inputs = $this.find( 'input[type="radio"]' ); + if ( $inputs.length !== 2 ) { + return true; + } + + // this row has a checked radio button + if ( $inputs.get(0).checked ) { + oldLi = true; + $this.addClass( 'selected' ); + $inputs.eq(0).css( 'visibility', 'visible' ); + $inputs.eq(1).css( 'visibility', 'hidden' ); + } else if ( $inputs.get(1).checked ) { + diffLi = true; + $this.addClass( 'selected' ); + $inputs.eq(0).css( 'visibility', 'hidden' ); + $inputs.eq(1).css( 'visibility', 'visible' ); + } else { + // no radio is checked in this row + if ( diffLi && oldLi ) { + // We're below the selected radios + $inputs.eq(0).css( 'visibility', 'visible' ); + $inputs.eq(1).css( 'visibility', 'hidden' ); + } else if ( diffLi ) { + // We're between the selected radios + $inputs.css( 'visibility', 'visible' ); + } else { + // We're above the selected radios + $inputs.eq(1).css( 'visibility', 'visible' ); + $inputs.eq(0).css( 'visibility', 'hidden' ); + } + } + }); + return true; + }; + + $( '#pagehistory li input[name="diff"], #pagehistory li input[name="oldid"]' ).click( updateDiffRadios ); + updateDiffRadios(); +});
\ No newline at end of file |