r78983 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78982‎ | r78983 | r78984 >
Date:22:47, 24 December 2010
Author:krinkle
Status:deferred
Tags:
Comment:
* Fixing 'variable "dialog" already defined' error.
* Some whitespace, indention and constancy in single/double quotes
* $ -> jQuery (Follow-up r78982) like the rest of the script.
Modified paths:
  • /trunk/extensions/Translate/js/quickedit.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/js/quickedit.js
@@ -50,38 +50,38 @@
5151 url = url.replace( "$1", encodeURIComponent( page ) ).replace( "$2", encodeURIComponent( group ) );
5252 var id = "jsedit" + page.replace( /[^a-zA-Z0-9_]/g, '_' );
5353
54 - var dialog = jQuery("#"+id);
 54+ var dialog = jQuery('#' + id);
5555 if ( dialog.size() > 0 ) {
56 - dialog.dialog("option", "position", "top" );
57 - dialog.dialog("open");
 56+ dialog.dialog('option', 'position', 'top' );
 57+ dialog.dialog('open');
5858 return false;
5959 }
6060
61 - jQuery('<div/>').attr('id', id).appendTo(jQuery('body'));
62 - var dialog = jQuery("#"+id);
 61+ jQuery('<div/>').attr('id', id).appendTo( jQuery('body') );
 62+ dialog = jQuery('#' + id);
6363
64 - var spinner = jQuery("<div/>").attr("class", "mw-ajax-loader" );
65 - dialog.html( jQuery("<div/>").attr("class", "mw-ajax-dialog").html( spinner ) );
 64+ var spinner = jQuery('<div/>').attr('class', 'mw-ajax-loader' );
 65+ dialog.html( jQuery('<div/>').attr('class', 'mw-ajax-dialog').html( spinner ) );
6666
6767 dialog.load(url, false, function() {
68 - var form = jQuery("#" + id + " form");
 68+ var form = jQuery('#' + id + 'form');
6969
7070 form.hide().slideDown();
7171
7272 // Enable the collapsible element
73 - $( '.mw-identical-title' ).makeCollapsible();
 73+ jQuery( '.mw-identical-title' ).makeCollapsible();
7474
75 - form.find( ".mw-translate-next" ).click( function() {
 75+ form.find( '.mw-translate-next' ).click( function() {
7676 trlLoadNext( page );
7777 });
7878
79 - form.find( ".mw-translate-skip" ).click( function() {
 79+ form.find( '.mw-translate-skip' ).click( function() {
8080 trlLoadNext( page );
81 - dialog.dialog("close");
 81+ dialog.dialog('close');
8282 return false;
8383 });
8484
85 - form.find( ".mw-translate-history" ).click( function() {
 85+ form.find( '.mw-translate-history' ).click( function() {
8686 window.open( wgServer + wgScript + "?action=history&title=" + form.find( "input[name=title]" ).val() );
8787 return false;
8888 });
@@ -102,10 +102,14 @@
103103 }
104104
105105 addAccessKeys( form );
106 - var b = form.find(".mw-translate-save"); b.val( b.val() + " (a)" );
107 - var b = form.find(".mw-translate-next"); b.val( b.val() + " (s)" );
108 - var b = form.find(".mw-translate-skip"); b.val( b.val() + " (d)" );
109 - var b = form.find(".mw-translate-history"); b.val( b.val() + " (h)" );
 106+ var b = form.find(".mw-translate-save");
 107+ b.val( b.val() + " (a)" );
 108+ var b = form.find(".mw-translate-next");
 109+ b.val( b.val() + " (s)" );
 110+ var b = form.find(".mw-translate-skip");
 111+ b.val( b.val() + " (d)" );
 112+ var b = form.find(".mw-translate-history");
 113+ b.val( b.val() + " (h)" );
110114
111115 form.ajaxForm({
112116 dataType: "json",

Follow-up revisions

RevisionCommit summaryAuthorDate
r78984Re-add space in form-id. (r78983)krinkle22:58, 24 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78982Bringing the slide out effect back, in a slightly different way (Follow-up r7...krinkle22:39, 24 December 2010

Status & tagging log