r91547 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91546‎ | r91547 | r91548 >
Date:12:29, 6 July 2011
Author:diebuche
Status:ok
Tags:
Comment:
Revert r86047 for now per CR.
Modified paths:
  • /trunk/phase3/resources/mediawiki.action/mediawiki.action.history.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.history.js
@@ -48,45 +48,6 @@
4949 return true;
5050 };
5151
52 - var fixCompare = function () {
53 - var $diffList = $( '#pagehistory' ),
54 - $histForm = $( '#mw-history-compare' ),
55 - $buttons = $histForm.find( 'input.historysubmit' );
56 -
57 - // There's only one rev, nothing to do here
58 - if ( !$buttons.length ) {
59 - return false;
60 - }
61 - var copyAttrs = ['title', 'accesskey'];
62 - $buttons.each(function() {
63 - var $button = $(this),
64 - $compareLink= $( '<a></a>', {
65 - 'class': 'compare-link',
66 - 'text': $button.val()
67 - }).button();
68 - $.each( copyAttrs, function( i, name ) {
69 - var val = $button.attr( name );
70 - if (val) {
71 - $compareLink.attr( name, val );
72 - }
73 - });
74 - $button.replaceWith( $compareLink );
75 - });
76 - var updateCompare = function() {
77 - var $radio = $histForm.find( 'input[type="radio"]:checked' );
78 - var genLink = mw.config.get( 'wgScript' )
79 - + '?title=' + mw.util.wikiUrlencode( mw.config.get( 'wgPageName' ) )
80 - + '&diff=' + $radio.eq(0).val()
81 - + '&oldid=' + $radio.eq(1).val();
82 - $( '.compare-link' ).each( function() {
83 - $(this).attr('href', genLink);
84 - });
85 - }
86 - updateCompare();
87 - $diffList.change( updateCompare );
88 - };
89 -
9052 $( '#pagehistory li input[name="diff"], #pagehistory li input[name="oldid"]' ).click( updateDiffRadios );
91 - fixCompare();
9253 updateDiffRadios();
9354 });
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86047History: Adding JS that converts buttons to links for better UX. Patch based...diebuche13:18, 14 April 2011

Status & tagging log