diff --git a/modules/twinkleconfig.js b/modules/twinkleconfig.js index bb055a121..d428ff0b3 100644 --- a/modules/twinkleconfig.js +++ b/modules/twinkleconfig.js @@ -195,52 +195,6 @@ Twinkle.config.sections = [ ] }, - // { - // title: 'ARV', - // module: 'arv', - // preferences: [ - // { - // name: 'spiWatchReport', - // label: 'Add sockpuppet report pages to watchlist', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // } - // ] - // }, - - // { - // title: 'Block user', - // module: 'block', - // adminOnly: true, - // preferences: [ - // // TwinkleConfig.defaultToBlock64 (boolean) - // // Whether to default to just blocking the /64 on or off - // { - // name: 'defaultToBlock64', - // label: 'For IPv6 addresses, select the option to block the /64 range by default', - // type: 'boolean' - // }, - - // // TwinkleConfig.defaultToPartialBlocks (boolean) - // // Whether to default partial blocks on or off - // { - // name: 'defaultToPartialBlocks', - // label: 'Select partial blocks by default when opening the block menu', - // helptip: 'If the user is already blocked, this will be overridden by in favor of defaulting to the current block type', - // type: 'boolean' - // }, - - // // TwinkleConfig.blankTalkpageOnIndefBlock (boolean) - // // if true, blank the talk page when issuing an indef block notice (per [[WP:UWUL#Indefinitely blocked users]]) - // { - // name: 'blankTalkpageOnIndefBlock', - // label: 'Blank the talk page when indefinitely blocking users', - // helptip: 'See WP:UWUL for more information.', - // type: 'boolean' - // } - // ] - // }, - { title: 'Image deletion (DI)', module: 'image', @@ -273,78 +227,6 @@ Twinkle.config.sections = [ ] }, - // { - // title: 'Page protection ' + (Morebits.userIsSysop ? '(PP)' : '(RPP)'), - // module: 'protect', - // preferences: [ - // { - // name: 'watchRequestedPages', - // label: 'Add page to watchlist when requesting protection', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - // { - // name: 'watchPPTaggedPages', - // label: 'Add page to watchlist when tagging with protection template', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - // { - // name: 'watchProtectedPages', - // label: 'Add page to watchlist when protecting', - // helptip: 'If also tagging the page after protection, that preference will be favored.', - // adminOnly: true, - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // } - // ] - // }, - - // { - // title: 'Proposed deletion (PROD)', - // module: 'prod', - // preferences: [ - // // TwinkleConfig.watchProdPages (string) - // // Watchlist setting when applying prod template to page - // { - // name: 'watchProdPages', - // label: 'Add article to watchlist when tagging', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - - // // TwinkleConfig.markProdPagesAsPatrolled (boolean) - // // If, when applying prod template to page, to mark the page as curated/patrolled (if the page was reached from NewPages) - // { - // name: 'markProdPagesAsPatrolled', - // label: 'Mark page as patrolled/reviewed when tagging (if possible)', - // helptip: 'This should probably not be checked as doing so is against best practice consensus', - // type: 'boolean' - // }, - - // // TwinkleConfig.prodReasonDefault (string) - // // The prefilled PROD reason. - // { - // name: 'prodReasonDefault', - // label: 'Prefilled PROD reason', - // type: 'string' - // }, - - // { - // name: 'logProdPages', - // label: 'Keep a log in userspace of all pages you tag for PROD', - // helptip: 'Since non-admins do not have access to their deleted contributions, the userspace log offers a good way to keep track of all pages you tag for PROD using Twinkle.', - // type: 'boolean' - // }, - // { - // name: 'prodLogPageName', - // label: 'Keep the PROD userspace log at this user subpage', - // helptip: 'Enter a subpage name in this box. You will find your PROD log at User:username/subpage name. Only works if you turn on the PROD userspace log.', - // type: 'string' - // } - // ] - // }, - { title: 'Revert and rollback', module: 'rollback', @@ -447,18 +329,6 @@ Twinkle.config.sections = [ ] }, - // { - // title: 'Shared IP tagging', - // module: 'shared', - // preferences: [ - // { - // name: 'markSharedIPAsMinor', - // label: 'Mark shared IP tagging as a minor edit', - // type: 'boolean' - // } - // ] - // }, - { title: 'Speedy deletion (CSD)', module: 'speedy', @@ -616,105 +486,6 @@ Twinkle.config.sections = [ ] }, - // { - // title: 'Tag', - // module: 'tag', - // preferences: [ - // { - // name: 'watchTaggedVenues', - // label: 'Add page to watchlist when tagging these type of pages', - // type: 'set', - // setValues: { articles: 'Articles', drafts: 'Drafts', redirects: 'Redirects', files: 'Files' } - // }, - // { - // name: 'watchTaggedPages', - // label: 'When tagging a page, how long to watch it for', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - // { - // name: 'watchMergeDiscussions', - // label: 'Add talk pages to watchlist when starting merge discussions', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - // { - // name: 'markTaggedPagesAsMinor', - // label: 'Mark addition of tags as a minor edit', - // type: 'boolean' - // }, - // { - // name: 'markTaggedPagesAsPatrolled', - // label: 'Check the "mark page as patrolled/reviewed" box by default', - // type: 'boolean' - // }, - // { - // name: 'groupByDefault', - // label: 'Check the "group into {{multiple issues}}" box by default', - // type: 'boolean' - // }, - // { - // name: 'tagArticleSortOrder', - // label: 'Default view order for article tags', - // type: 'enum', - // enumValues: { cat: 'By categories', alpha: 'In alphabetical order' } - // }, - // { - // name: 'customTagList', - // label: 'Custom article/draft maintenance tags to display', - // helptip: "These appear as additional options at the bottom of the list of tags. For example, you could add new maintenance tags which have not yet been added to Twinkle's defaults.", - // type: 'customList', - // customListValueTitle: 'Template name (no curly brackets)', - // customListLabelTitle: 'Text to show in Tag dialog' - // }, - // { - // name: 'customFileTagList', - // label: 'Custom file maintenance tags to display', - // helptip: 'Additional tags that you wish to add for files.', - // type: 'customList', - // customListValueTitle: 'Template name (no curly brackets)', - // customListLabelTitle: 'Text to show in Tag dialog' - // }, - // { - // name: 'customRedirectTagList', - // label: 'Custom redirect category tags to display', - // helptip: 'Additional tags that you wish to add for redirects.', - // type: 'customList', - // customListValueTitle: 'Template name (no curly brackets)', - // customListLabelTitle: 'Text to show in Tag dialog' - // } - // ] - // }, - - // { - // title: 'Talkback', - // module: 'talkback', - // preferences: [ - // { - // name: 'markTalkbackAsMinor', - // label: 'Mark talkbacks as minor edits', - // type: 'boolean' - // }, - // { - // name: 'insertTalkbackSignature', - // label: 'Insert signature within talkbacks', - // type: 'boolean' - // }, - // { - // name: 'talkbackHeading', - // label: 'Section heading to use for talkback and please see', - // tooltip: 'Should NOT include the equals signs ("==") used for wikitext formatting', - // type: 'string' - // }, - // { - // name: 'mailHeading', - // label: "Section heading to use for \"you've got mail\" notices", - // tooltip: 'Should NOT include the equals signs ("==") used for wikitext formatting', - // type: 'string' - // } - // ] - // }, - { title: 'Unlink', module: 'unlink', @@ -731,210 +502,6 @@ Twinkle.config.sections = [ ] }, - // { - // title: 'Warn user', - // module: 'warn', - // preferences: [ - // // TwinkleConfig.defaultWarningGroup (int) - // // Which level warning should be the default selected group, default is 1 - // { - // name: 'defaultWarningGroup', - // label: 'Default warning level', - // type: 'enum', - // enumValues: { - // 1: 'Level 1', - // 2: 'Level 2', - // 3: 'Level 3', - // 4: 'Level 4', - // 5: 'Level 4im', - // 6: 'Single-issue notices', - // 7: 'Single-issue warnings', - // // 8 was used for block templates before #260 - // 9: 'Custom warnings', - // 10: 'All warning templates', - // 11: 'Auto-select level (1-4)' - // } - // }, - - // // TwinkleConfig.combinedSingletMenus (boolean) - // // if true, show one menu with both single-issue notices and warnings instead of two separately - // { - // name: 'combinedSingletMenus', - // label: 'Replace the two separate single-issue menus into one combined menu', - // helptip: 'Selecting either single-issue notices or single-issue warnings as your default will make this your default if enabled.', - // type: 'boolean' - // }, - - // // TwinkleConfig.showSharedIPNotice may take arguments: - // // true: to show shared ip notice if an IP address - // // false: to not print the notice - // { - // name: 'showSharedIPNotice', - // label: 'Add extra notice on shared IP talk pages', - // helptip: 'Notice used is {{Shared IP advice}}', - // type: 'boolean' - // }, - - // // TwinkleConfig.watchWarnings (string) - // // Watchlist setting for the page which has been dispatched an warning or notice - // { - // name: 'watchWarnings', - // label: 'Add user talk page to watchlist when notifying', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - - // // TwinkleConfig.oldSelect (boolean) - // // if true, use the native select menu rather the select2-based one - // { - // name: 'oldSelect', - // label: 'Use the non-searchable classic select menu', - // type: 'boolean' - // }, - - // { - // name: 'customWarningList', - // label: 'Custom warning templates to display', - // helptip: 'You can add individual templates or user subpages. Custom warnings appear in the "Custom warnings" category within the warning dialog box.', - // type: 'customList', - // customListValueTitle: 'Template name (no curly brackets)', - // customListLabelTitle: 'Text to show in warning list (also used as edit summary)' - // } - // ] - // }, - - // { - // title: 'Welcome user', - // module: 'welcome', - // preferences: [ - // { - // name: 'topWelcomes', - // label: 'Place welcomes above existing content on user talk pages', - // type: 'boolean' - // }, - // { - // name: 'watchWelcomes', - // label: 'Add user talk pages to watchlist when welcoming', - // helptip: 'Doing so adds to the personal element of welcoming a user - you will be able to see how they are coping as a newbie, and possibly help them.', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - // { - // name: 'insertUsername', - // label: 'Add your username to the template (where applicable)', - // helptip: "Some welcome templates have an opening sentence like \"Hi, I'm <username>. Welcome\" etc. If you turn off this option, these templates will not display your username in that way.", - // type: 'boolean' - // }, - // { - // name: 'quickWelcomeMode', - // label: 'Clicking the "welcome" link on a diff page will', - // helptip: 'If you choose to welcome automatically, the template you specify below will be used.', - // type: 'enum', - // enumValues: { auto: 'welcome automatically', norm: 'prompt you to select a template' } - // }, - // { - // name: 'quickWelcomeTemplate', - // label: 'Template to use when welcoming automatically', - // helptip: 'Enter the name of a welcome template, without the curly brackets. A link to the given article will be added.', - // type: 'string' - // }, - // { - // name: 'customWelcomeList', - // label: 'Custom welcome templates to display', - // helptip: "You can add other welcome templates, or user subpages that are welcome templates (prefixed with \"User:\"). Don't forget that these templates are substituted onto user talk pages.", - // type: 'customList', - // customListValueTitle: 'Template name (no curly brackets)', - // customListLabelTitle: 'Text to show in Welcome dialog' - // }, - // { - // name: 'customWelcomeSignature', - // label: 'Automatically sign custom welcome templates', - // helptip: 'If your custom welcome templates contain a built-in signature within the template, turn off this option.', - // type: 'boolean' - // } - // ] - // }, - - // { - // title: 'XFD (deletion discussions)', - // module: 'xfd', - // preferences: [ - // { - // name: 'logXfdNominations', - // label: 'Keep a log in userspace of all pages you nominate for a deletion discussion (XfD)', - // helptip: 'The userspace log offers a good way to keep track of all pages you nominate for XfD using Twinkle.', - // type: 'boolean' - // }, - // { - // name: 'xfdLogPageName', - // label: 'Keep the deletion discussion userspace log at this user subpage', - // helptip: 'Enter a subpage name in this box. You will find your XfD log at User:username/subpage name. Only works if you turn on the XfD userspace log.', - // type: 'string' - // }, - // { - // name: 'noLogOnXfdNomination', - // label: 'Do not create a userspace log entry when nominating at this venue', - // type: 'set', - // setValues: { afd: 'AfD', tfd: 'TfD', ffd: 'FfD', cfd: 'CfD', cfds: 'CfD/S', mfd: 'MfD', rfd: 'RfD', rm: 'RM' } - // }, - - // // TwinkleConfig.xfdWatchPage (string) - // // The watchlist setting of the page being nominated for XfD. - // { - // name: 'xfdWatchPage', - // label: 'Add the nominated page to watchlist', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - - // // TwinkleConfig.xfdWatchDiscussion (string) - // // The watchlist setting of the newly created XfD page (for those processes that create discussion pages for each nomination), - // // or the list page for the other processes. - // { - // name: 'xfdWatchDiscussion', - // label: 'Add the deletion discussion page to watchlist', - // helptip: 'This refers to the discussion subpage (for AfD and MfD) or the daily log page (for TfD, CfD, RfD and FfD)', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - - // // TwinkleConfig.xfdWatchList (string) - // // The watchlist setting of the XfD list page, *if* the discussion is on a separate page. - // { - // name: 'xfdWatchList', - // label: 'Add the daily log/list page to the watchlist (AfD and MfD)', - // helptip: 'This only applies for AfD and MfD, where the discussions are transcluded onto a daily log page (for AfD) or the main MfD page (for MfD).', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - - // // TwinkleConfig.xfdWatchUser (string) - // // The watchlist setting of the user talk page if they receive a notification. - // { - // name: 'xfdWatchUser', - // label: 'Add user talk page of initial contributor to watchlist (when notifying)', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - - // // TwinkleConfig.xfdWatchRelated (string) - // // The watchlist setting of the target of a redirect being nominated for RfD. - // { - // name: 'xfdWatchRelated', - // label: "Add the redirect's target page to watchlist (when notifying)", - // helptip: 'This only applies for RfD, when leaving a notification on the talk page of the target of the redirect', - // type: 'enum', - // enumValues: Twinkle.config.watchlistEnums - // }, - - // { - // name: 'markXfdPagesAsPatrolled', - // label: 'Mark page as patrolled/reviewed when nominating for AFD (if possible)', - // type: 'boolean' - // } - // ] - // }, - { title: 'Hidden', hidden: true, diff --git a/modules/twinkleimage.js b/modules/twinkleimage.js index 6fec30ae8..546faf533 100644 --- a/modules/twinkleimage.js +++ b/modules/twinkleimage.js @@ -171,7 +171,7 @@ Twinkle.image.callback.evaluate = function twinkleimageCallbackEvaluate(event) { Twinkle.image.callbacks = { taggingImage: function(pageobj) { - let text = pageobj.getPageText(); + const text = pageobj.getPageText(); const params = pageobj.getCallbackParameters(); var tag = ''; diff --git a/modules/twinklespeedy.js b/modules/twinklespeedy.js index aa63bc6f3..dcdd2d9f5 100644 --- a/modules/twinklespeedy.js +++ b/modules/twinklespeedy.js @@ -176,15 +176,6 @@ Twinkle.speedy.initDialog = function twinklespeedyInitDialog(callbackfunc) { event.stopPropagation(); } }, - // { - // label: 'Tag for creation protection (salting) as well', - // value: 'salting', - // name: 'salting', - // tooltip: 'When selected, the speedy deletion tag will be accompanied by a {{salt}} tag requesting that the deleting administrator apply creation protection. Only select if this page has been repeatedly recreated.', - // event: function(event) { - // event.stopPropagation(); - // } - // }, { label: 'Tag with multiple criteria', value: 'multiple', @@ -283,8 +274,8 @@ Twinkle.speedy.callback.modeChanged = function twinklespeedyCallbackModeChanged( if (!Morebits.isPageRedirect()) { switch (namespace) { - case 0: // gallery - case 1: // talk + case 0: // gallery + case 1: // talk appendList('Galleries', Twinkle.speedy.galleryList); break; @@ -293,26 +284,26 @@ Twinkle.speedy.callback.modeChanged = function twinklespeedyCallbackModeChanged( appendList('User pages', Twinkle.speedy.userList); break; - case 4: // Commons - case 5: // Commons talk + case 4: // Commons + case 5: // Commons talk appendList('Commons', Twinkle.speedy.commonsList); break; - case 6: // file - case 7: // file talk + case 6: // file + case 7: // file talk appendList('Files', Twinkle.speedy.fileList); if (!mode.isSysop) { work_area.append({ type: 'div', label: 'Tagging for CSD F5 (no license/source/permission) can be done using Twinkle\'s "DI" tab.' }); } break; - case 10: // file - case 11: // file talk + case 10: // file + case 11: // file talk appendList('Template', Twinkle.speedy.templateList); break; - case 14: // category - case 15: // category talk + case 14: // category + case 15: // category talk appendList('Categories', Twinkle.speedy.categoryList); break; @@ -737,8 +728,7 @@ Twinkle.speedy.userList = [ tooltip: 'User requested deletion of their own user page or user-subpage. User pages that are blanked by the user may also be deleted under this criterion.', subgroup: - mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgTitle').indexOf('/') === -1 - ? { + mw.config.get('wgNamespaceNumber') === 3 && mw.config.get('wgTitle').indexOf('/') === -1 ? { name: 'userreq_rationale', parameter: '2', type: 'input', @@ -747,8 +737,7 @@ Twinkle.speedy.userList = [ tooltip: 'User talk pages are deleted only in highly exceptional circumstances. See WP:DELTALK.', size: 60 - } - : null, + } : null, hideSubgroupWhenMultiple: true }, { @@ -941,15 +930,7 @@ Twinkle.speedy.generalList = [ } ]; -Twinkle.speedy.redirectList = [ - // { - // label: 'G2: Unused and implausible, or broken redirect', - // value: 'redir', - // code: 'g2', - // tooltip: - // 'Page is an unused AND implausible redirect, or a redirect that is dependent on deleted or non-existent content. Unused talk page redirects created as a result of a page move and cross-namespace redirects may also be deleted under this criterion.', - // } -]; +Twinkle.speedy.redirectList = []; Twinkle.speedy.normalizeHash = { reason: 'db', @@ -961,7 +942,6 @@ Twinkle.speedy.normalizeHash = { author: 'g7', g8: 'g8', talk: 'g8', - g8: 'g8', redirnone: 'g8', advert: 'g10', textcopyvio: 'g11', @@ -1106,11 +1086,6 @@ Twinkle.speedy.callbacks = { editsummary = 'Notification: speedy deletion' + (params.warnUser ? '' : ' nomination'); editsummary += ' of [[:' + Morebits.pageNameNorm + ']].'; - // if (params.normalizeds.indexOf('g10') === -1) { // no article name in summary for G10 taggings - // editsummary += ' of [[:' + Morebits.pageNameNorm + ']].'; - // } else { - // editsummary += ' of an attack page.'; - // } usertalkpage.setAppendText(notifytext); usertalkpage.setEditSummary(editsummary); @@ -1147,8 +1122,6 @@ Twinkle.speedy.callbacks = { if (params.promptForSummary) { reason = prompt('Enter the deletion summary to use, or press OK to accept the automatically generated one.', reason); } - console.log('Reason: %s', reason); - console.log('Code: %s', code); Twinkle.speedy.callbacks.sysop.deletePage(reason, params); }); } @@ -1350,15 +1323,6 @@ Twinkle.speedy.callbacks = { text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, ''); } - // if (params.requestsalt) { - // code += '\n{{salt}}'; - // // if (params.normalizeds.indexOf('g10') === -1) { - // // code += '\n{{salt}}'; - // // } else { - // // code = '{{salt}}\n' + code; - // // } - // } - if (mw.config.get('wgPageContentModel') === 'Scribunto') { // Scribunto isn't parsed like wikitext, so CSD templates on modules need special handling to work let equals = ''; @@ -1402,10 +1366,6 @@ Twinkle.speedy.callbacks = { } else { // Attempt to place on talk page const talkName = new mw.Title(pageobj.getPageName()).getTalkPage().toText(); if (talkName !== pageobj.getPageName()) { - // if (params.requestsalt) { - // code += '\n{{salt}}'; - // } - pageobj.getStatusElement().warn('Unable to edit page, placing tag on talk page'); const talk_page = new Morebits.wiki.Page(talkName, 'Automatically placing tag on talk page'); @@ -1452,10 +1412,7 @@ Twinkle.speedy.callbacks = { let extraInfo = ''; - // If a logged file is deleted but exists on commons, the wikilink will be blue, so provide a link to the log - const fileLogLink = mw.config.get('wgNamespaceNumber') === 6 ? ' ([{{fullurl:Special:Log|page=' + mw.util.wikiUrlencode(mw.config.get('wgPageName')) + '}} log])' : ''; - - let editsummary = 'Logging speedy deletion nomination'; + const editsummary = 'Logging speedy deletion nomination'; let appendText = '# [[:' + Morebits.pageNameNorm + ']]. '; if (params.normalizeds.length > 1) { @@ -1492,9 +1449,6 @@ Twinkle.speedy.callbacks = { } } - // if (params.requestsalt) { - // appendText += '; requested creation protection ([[WP:SALT|salting]])'; - // } if (extraInfo) { appendText += '; additional information:' + extraInfo; } @@ -1536,9 +1490,9 @@ Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) } } if (form['csd.imgcopyvio_rationale']) { - var rationale = form['csd.imgcopyvio_rationale'].value; - if (rationale) { - currentParams['1'] = rationale; + var imageCopyvioRationale = form['csd.imgcopyvio_rationale'].value; + if (imageCopyvioRationale) { + currentParams['1'] = imageCopyvioRationale; } } break; @@ -1548,81 +1502,81 @@ Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) case 'fairuse': if (form['csd.fairuse_rationale']) { - var rationale = form['csd.fairuse_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var fairUseRationale = form['csd.fairuse_rationale'].value; + if (fairUseRationale) { + currentParams['2'] = fairUseRationale; } } break; case 'deriv': if (form['csd.deriv_rationale']) { - var rationale = form['csd.deriv_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var derivRationale = form['csd.deriv_rationale'].value; + if (derivRationale) { + currentParams['2'] = derivRationale; } } break; case 'lrfailed': if (form['csd.lrfailed_rationale']) { - var rationale = form['csd.lrfailed_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var lrFailedRationale = form['csd.lrfailed_rationale'].value; + if (lrFailedRationale) { + currentParams['2'] = lrFailedRationale; } } break; case 'vrt': if (form['csd.vrt_rationale']) { - var rationale = form['csd.vrt_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var vrtRationale = form['csd.vrt_rationale'].value; + if (vrtRationale) { + currentParams['2'] = vrtRationale; } } break; case 'll': if (form['csd.ll_rationale']) { - var rationale = form['csd.ll_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var llRationale = form['csd.ll_rationale'].value; + if (llRationale) { + currentParams['2'] = llRationale; } } break; case 'noimage': if (form['csd.noimage_rationale']) { - var rationale = form['csd.noimage_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var noImageRationale = form['csd.noimage_rationale'].value; + if (noImageRationale) { + currentParams['2'] = noImageRationale; } } break; case 'duplicate': if (form['csd.duplicate_filename']) { - var rationale = form['csd.duplicate_filename'].value; - if (rationale) { - currentParams['1'] = rationale; + var dupeRationale = form['csd.duplicate_filename'].value; + if (dupeRationale) { + currentParams['1'] = dupeRationale; } } break; case 'embeddeddata': if (form['csd.embeddeddata_rationale']) { - var rationale = form['csd.embeddeddata_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var embedRationale = form['csd.embeddeddata_rationale'].value; + if (embedRationale) { + currentParams['2'] = embedRationale; } } break; case 'selfie': if (form['csd.selfie_rationale']) { - var rationale = form['csd.selfie_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var selfieRationale = form['csd.selfie_rationale'].value; + if (selfieRationale) { + currentParams['2'] = selfieRationale; } } break; @@ -1638,14 +1592,14 @@ Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) case 'catempty': if (form['csd.catempty_rationale']) { - var rationale = form['csd.catempty_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var catEmptyRationale = form['csd.catempty_rationale'].value; + if (catEmptyRationale) { + currentParams['2'] = catEmptyRationale; } } break; - case 'userreq': // U1 + case 'userreq': // U1 if (form['csd.userreq_rationale']) { var u1rationale = form['csd.userreq_rationale'].value; if (mw.config.get('wgNamespaceNumber') === 3 && !(/\//).test(mw.config.get('wgTitle')) && @@ -1660,9 +1614,9 @@ Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) case 'inappuserspace': if (form['csd.inappuserspace_rationale']) { - var rationale = form['csd.inappuserspace_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var u3rationale = form['csd.inappuserspace_rationale'].value; + if (u3rationale) { + currentParams['2'] = u3rationale; } } break; @@ -1681,23 +1635,23 @@ Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) case 't2': if (form['csd.t2_rationale']) { - var rationale = form['csd.t2_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var t2rationale = form['csd.t2_rationale'].value; + if (t2rationale) { + currentParams['2'] = t2rationale; } } break; case 'vandalism': if (form['csd.vandalism_rationale']) { - var rationale = form['csd.vandalism_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var g3rationale = form['csd.vandalism_rationale'].value; + if (g3rationale) { + currentParams['2'] = g3rationale; } } break; - case 'repost': // G4 + case 'repost': // G4 if (form['csd.repost_xfd']) { var deldisc = form['csd.repost_xfd'].value; if (deldisc) { @@ -1708,49 +1662,48 @@ Twinkle.speedy.getParameters = function twinklespeedyGetParameters(form, values) case 'g6': if (form['csd.g6_rationale']) { - var rationale = form['csd.g6_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var g6rationale = form['csd.g6_rationale'].value; + if (g6rationale) { + currentParams['2'] = g6rationale; } } break; case 'author': if (form['csd.author_rationale']) { - var rationale = form['csd.author_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var g7rationale = form['csd.author_rationale'].value; + if (g7rationale) { + currentParams['2'] = g7rationale; } } break; case 'g8': if (form['csd.g8_rationale']) { - var rationale = form['csd.g8_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var g8rationale = form['csd.g8_rationale'].value; + if (g8rationale) { + currentParams['2'] = g8rationale; } } break; case 'advert': if (form['csd.advert_rationale']) { - var rationale = form['csd.advert_rationale'].value; - if (rationale) { - currentParams['2'] = rationale; + var g10rationale = form['csd.advert_rationale'].value; + if (g10rationale) { + currentParams['2'] = g10rationale; } } break; case 'textcopyvio': if (form['csd.textcopyvio_rationale']) { - var rationale = form['csd.textcopyvio_rationale'].value; - if (!rationale || !rationale.trim()) { + var g11rationale = form['csd.textcopyvio_rationale'].value; + if (!g11rationale || !g11rationale.trim()) { alert('CSD G11: Include the URL or source of the copyvio'); parameters = null; return false; } - currentParams.article = duptitle; } break;