Ejegg has submitted this change and it was merged.

Change subject: jQuery usage tweaks
......................................................................


jQuery usage tweaks

Use .text() instead of .html() where unneeded, break up node
creation and setting value instead of concatenating user input.

Change-Id: Ideeedbdb2eb17ee36d18f363496e46c818e48046
---
M resources/infrastructure/campaignManager.js
M resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
2 files changed, 11 insertions(+), 9 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/infrastructure/campaignManager.js 
b/resources/infrastructure/campaignManager.js
index 10d7ded..8372310 100644
--- a/resources/infrastructure/campaignManager.js
+++ b/resources/infrastructure/campaignManager.js
@@ -39,7 +39,7 @@
                slide: function ( event, element ) {
                        var val = Number( element.value ),
                                rounded = Math.round( val * 10 ) / 10;
-                       $( '#centralnotice-throttle-echo' ).html( String( 
rounded ) + '%' );
+                       $( '#centralnotice-throttle-echo' ).text( String( 
rounded ) + '%' );
                        $( '#centralnotice-throttle-cur' ).val( val );
                }
        } );
diff --git 
a/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js 
b/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
index 5a0c352..3e0afc9 100644
--- a/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
+++ b/resources/infrastructure/ext.centralNotice.adminUi.campaignPager.js
@@ -80,21 +80,23 @@
                var $form = $( '<form method="post"></form>' ),
 
                        $authtokenField = $(
-                               '<input type="hidden" name="authtoken" value="' 
+
-                               mw.user.tokens.get( 'editToken' ) +
-                               '"></input>'
+                               '<input type="hidden" name="authtoken" />'
                        ),
 
                        $summaryField = $(
-                               '<input type="hidden" name="changeSummary" 
value="' +
-                               $( '#cn-campaign-pager 
input.cn-change-summary-input' ).val() +
-                               '"></input>'
+                               '<input type="hidden" name="changeSummary" />'
                        ),
 
-                       $changesField =
-                               $( '<input type="hidden" name="changes" 
></input>' );
+                       $changesField = $(
+                               '<input type="hidden" name="changes" />'
+                       );
 
+               $authtokenField.val( mw.user.tokens.get( 'editToken' ) );
+               $summaryField.val(
+                       $( '#cn-campaign-pager input.cn-change-summary-input' 
).val()
+               );
                $changesField.val( JSON.stringify( changes ) );
+
                $form.append( $authtokenField, $summaryField, $changesField );
                $( document.body ).append( $form );
                $form.submit();

-- 
To view, visit https://gerrit.wikimedia.org/r/291917
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ideeedbdb2eb17ee36d18f363496e46c818e48046
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: AndyRussG <andrew.green...@gmail.com>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Cdentinger <cdentin...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: XenoRyet <dkozlow...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to