From e81cc5dc102cca09a284ef0187c4d28e1f5302d9 Mon Sep 17 00:00:00 2001 From: Edward Chernenko Date: Sat, 7 Dec 2024 17:38:04 +0300 Subject: [PATCH] (eslint) Fix eslint warnings --- extension.json | 10 +++++----- modules/ext.moderation.notify.js | 4 ++-- tests/selenium/pageobjects/postedit.page.js | 4 ++-- tests/selenium/specs/mobilefrontend-preload.js | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/extension.json b/extension.json index 657da7d1b..de8499e84 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "Moderation", - "version": "1.8.21", + "version": "1.8.22", "author": "Edward Chernenko", "url": "https://www.mediawiki.org/wiki/Extension:Moderation", "descriptionmsg": "moderation-desc", @@ -422,19 +422,19 @@ "value": "", "description": "Email address to send notifications to." }, - "ModerationUseAjax": { + "ModerationUseAjax": { "value": false, "description": "Experimental: if true, enable Ajax handling of links on Special:Moderation." }, - "ModerationOnlyInNamespaces": { + "ModerationOnlyInNamespaces": { "value": [], "description": "If set to an array of namespace numbers (e.g. NS_MAIN, NS_FILE), moderation is only enabled in these namespaces (edits in other namespaces will bypass moderation). Default (empty array): moderation is enabled everywhere." }, - "ModerationIgnoredInNamespaces": { + "ModerationIgnoredInNamespaces": { "value": [], "description": "If set to an array of namespace numbers (e.g. NS_MAIN, NS_FILE), non-automoderated users can bypass moderation in these namespaces. Default (empty array): moderation can't be bypassed anywhere." }, - "ModerationEnableEditChange": { + "ModerationEnableEditChange": { "value": false, "description": "If true, moderators are allowed to edit pending changes before approving. DANGEROUS: moderator can accidentally delete the text of pending change. Enable this only when you use Moderation for pre-publish review." } diff --git a/modules/ext.moderation.notify.js b/modules/ext.moderation.notify.js index 85af758f7..5ded8ded4 100644 --- a/modules/ext.moderation.notify.js +++ b/modules/ext.moderation.notify.js @@ -95,9 +95,9 @@ } ).done( function ( ret ) { var parsed = ret.query.moderationpreload.parsed; if ( parsed ) { - var $div = $( '
' ).html( parsed.text ); + var $div2 = $( '
' ).html( parsed.text ); mw.hook( 'wikipage.content' ).fire( - $( '#mw-content-text' ).empty().append( $div ) + $( '#mw-content-text' ).empty().append( $div2 ) ); $( '#catlinks' ).html( parsed.categorieshtml ); diff --git a/tests/selenium/pageobjects/postedit.page.js b/tests/selenium/pageobjects/postedit.page.js index d2cba2a17..339272066 100644 --- a/tests/selenium/pageobjects/postedit.page.js +++ b/tests/selenium/pageobjects/postedit.page.js @@ -38,14 +38,14 @@ class PostEdit extends Page { $( '.mw-notification-visible' ).waitForExist(); } - this.inittime = new Date().getTime(); /* Used in waitUsualFadeTime() */ + this.inittime = Date.now(); /* Used in waitUsualFadeTime() */ } /** @brief Pause until the time when MediaWiki should have removed this notification. */ waitUsualFadeTime() { - browser.pause( this.usualFadeTime - ( new Date().getTime() - this.inittime ) ); + browser.pause( this.usualFadeTime - ( Date.now() - this.inittime ) ); } } diff --git a/tests/selenium/specs/mobilefrontend-preload.js b/tests/selenium/specs/mobilefrontend-preload.js index 5417a2b49..467f89de6 100644 --- a/tests/selenium/specs/mobilefrontend-preload.js +++ b/tests/selenium/specs/mobilefrontend-preload.js @@ -38,8 +38,8 @@ describe( 'When user opens MobileFrontend editor and has a pending edit', functi } ); /* Test preloading of a single section into MobileFrontend */ - for ( var idx in Sections ) { - it( 'section #' + idx + ' should be shown', function ( idx ) { + for ( var sectionNumber in Sections ) { + it( 'section #' + sectionNumber + ' should be shown', function ( idx ) { MobileFrontend.open( PageName, idx ); browser.waitUntil( function () { @@ -50,7 +50,7 @@ describe( 'When user opens MobileFrontend editor and has a pending edit', functi MobileFrontend.content.getValue(), 'MobileFrontend.content[' + idx + ']' ) .to.equal( Sections[ idx ] ); - }.bind( null, idx ) ); + }.bind( null, sectionNumber ) ); } it( 'edit summary should be shown', function () {