"मिडियाविकि:Gadget-twinkleconfig.js" को बिचमी भिन्नता
Content deleted Content added
ना ne:मीडियाविकि:Gadget-twinkleconfig.js देखि १६ पुनरावलोकनहरू आयात भयो |
ना updating as per enwiki |
||
पंक्ति ९:
*** twinkleconfig.js: Preferences module
****************************************
* Mode of invocation: Adds configuration form to Wikipedia:Twinkle/Preferences and user
subpages named "/Twinkle preferences", and adds ad box to the top of user
subpages belonging to the currently logged-in user which end in '.js'
* Active on: What I just said. Yeah.
पंक्ति १९:
point you in the right direction.) -- TTO
*/
Line २५ ⟶ २४:
Twinkle.config.commonEnums = {
watchlist: { yes: "
talkPageMode: { window: "In a window, replacing other user talks", tab: "In a new tab", blank: "In a totally new window" }
};
Twinkle.config.commonSets = {
csdCriteria: {
db: "Custom rationale ({{db}})",
a1: "
f1: "F1", f2: "F2", f3: "F3", f7: "F7", f8: "F8", f9: "F9", f10: "F10",
c1: "C1",
t2: "T2", t3: "T3",
r2: "R2", r3: "R3",
p1: "P1", p2: "P2"
},
csdCriteriaDisplayOrder: [
"
"
"
"
"f1", "f2", "f3", "f7", "f8", "f9", "f10",
"c1",
"t2", "t3",
"r2", "r3",
"p1", "p2"
],
csdCriteriaNotification: {
db: "Custom rationale ({{db}})",
g1: "G1", g2: "G2", g3: "G3", g4: "G4", g6: 'G6 ("unnecessary disambig." and "copy-paste move" only)',
g10: "G10", g11: "G11", g12: "G12", g13: "G13",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a7: "A7", a9: "A9", a10: "A10", a11: "A11",
u3: "U3", u5: "U5",
f1: "F1", f2: "F2", f3: "F3", f7: "F7", f8: "F8", f9: "F9", f10: "F10",
c1: "C1",
t2: "T2", t3: "T3",
r2: "R2", r3: "R3",
p1: "P1", p2: "P2"
},
csdCriteriaNotificationDisplayOrder: [
"
"
"
"u3", "u5",
"f1", "f2", "f3", "f7", "f9", "f10",
"c1",
"t2", "t3",
"r2", "r3",
"p1", "p2"
],
csdAndDICriteria: {
db: "Custom rationale ({{db}})",
g1: "G1", g2: "G2", g3: "G3", g4: "G4", g5: "G5", g6: "G6", g7: "G7", g8: "G8", g10: "G10", g11: "G11", g12: "G12", g13: "G13",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a7: "A7", a9: "A9", a10: "A10", a11: "A11",
u1: "U1", u2: "U2", u3: "U3", u5: "U5",
f1: "F1", f2: "F2", f3: "F3", f4: "F4", f5: "F5", f6: "F6", f7: "F7", f8: "F8", f9: "F9", f10: "F10", f11: "F11",
c1: "C1",
t2: "T2", t3: "T3",
r2: "R2", r3: "R3",
p1: "P1", p2: "P2"
},
csdAndDICriteriaDisplayOrder: [
"db",
"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g10", "g11", "g12", "g13",
"a1", "a2", "a3", "a5", "a7", "a9", "a10", "a11",
"u1", "u2", "u3", "u5",
"f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "f10", "f11",
"c1",
"t2", "t3",
"r2", "r3",
"p1", "p2"
],
namespacesNoSpecial: {
"0": "
"1": "
"2": "
"3": "User talk",
"4": "
"5": "Wikipedia talk",
"6": "
"7": "
"8": "
"9": "MediaWiki talk",
"10": "
"11": "
"12": "
"13": "
"14": "
"15": "
"100": "
"101": "
"108": "Book",
"109": "Book talk",
"118": "Draft",
"119": "Draft talk",
"710": "TimedText",
"711": "TimedText talk",
"828": "Module",
"829": "Module
}
};
/**
Line १०९ ⟶ १५६:
Twinkle.config.sections = [
{
title: "
preferences: [
// TwinkleConfig.summaryAd (string)
Line ११५ ⟶ १६२:
{
name: "summaryAd",
label: "\"Ad\" to be appended to Twinkle's edit summaries",
helptip: "The summary ad should start with a space, and be kept short.",
type: "string"
},
Line १२४ ⟶ १७१:
{
name: "deletionSummaryAd",
label: "Summary ad to use for deletion summaries",
helptip: "Normally the same as the edit summary ad above.",
adminOnly: true,
type: "string"
Line १३४ ⟶ १८१:
{
name: "protectionSummaryAd",
label: "Summary ad to use for page protections",
helptip: "Normally the same as the edit summary ad above.",
adminOnly: true,
type: "string"
Line १४६ ⟶ १९३:
{
name: "userTalkPageMode",
label: "When opening a user talk page, open it",
type: "enum",
enumValues: Twinkle.config.commonEnums.talkPageMode
Line १५४ ⟶ २०१:
{
name: "dialogLargeFont",
label: "Use larger text in Twinkle dialogs",
type: "boolean"
}
Line १६८ ⟶ २१५:
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
}
]
},
{
title: "Block user",
adminOnly: true,
preferences: [
// TwinkleConfig.blankTalkpageOnIndefBlock (boolean)
// if true, blank the talk page when issuing an indef block notice (per [[WP:UW#Indefinitely blocked users]])
{
name: "blankTalkpageOnIndefBlock",
label: "Blank the talk page when indefinitely blocking users",
helptip: "See <a href=\"" + mw.util.getUrl("WP:UW#Indefinitely blocked users") + "\">WP:UW</a> for more information.",
type: "boolean"
}
]
},
{
title: "Image deletion (DI)",
preferences: [
// TwinkleConfig.notifyUserOnDeli (boolean)
// If the user should be notified after placing a file deletion tag
{
name: "notifyUserOnDeli",
label: "Check the \"notify initial uploader\" box by default",
type: "boolean"
},
// TwinkleConfig.deliWatchPage (string)
// The watchlist setting of the page tagged for deletion. Either "yes", "no", or "default". Default is "default" (Duh).
{
name: "deliWatchPage",
label: "Add image page to watchlist when tagging",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
},
// TwinkleConfig.deliWatchUser (string)
// The watchlist setting of the user talk page if a notification is placed. Either "yes", "no", or "default". Default is "default" (Duh).
{
name: "deliWatchUser",
label: "Add user talk page of initial uploader to watchlist when notifying",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
}
]
},
{
title: "Proposed deletion (PROD)",
preferences: [
// TwinkleConfig.watchProdPages (boolean)
// If, when applying prod template to page, to watch the page
{
name: "watchProdPages",
label: "Add article to watchlist when tagging",
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:<i>username</i>/<i>subpage name</i>. Only works if you turn on the PROD userspace log.",
type: "string"
}
]
Line २४० ⟶ ३६७:
{
title: "Shared IP tagging",
inFriendlyConfig: true,
preferences: [
{
name: "markSharedIPAsMinor",
label: "Mark shared IP tagging as a minor edit",
type: "boolean"
}
Line २५२ ⟶ ३७९:
{
title: "
preferences: [
{
Line २६० ⟶ ३८७:
enumValues: { "buttonClick": 'When I click "Submit"', "radioClick": "As soon as I click an option" }
},
// TwinkleConfig.watchSpeedyPages (array)
// Whether to add speedy tagged pages to watchlist
{
name: "watchSpeedyPages",
label: "Add page to watchlist when tagging with these criteria",
type: "set",
setValues: Twinkle.config.commonSets.csdCriteria,
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaDisplayOrder
},
Line २८२ ⟶ ४०२:
{
name: "markSpeedyPagesAsPatrolled",
label: "Mark page as patrolled when tagging (if possible)",
type: "boolean"
},
Line २९१ ⟶ ४१०:
{
name: "notifyUserOnSpeedyDeletionNomination",
label: "Notify page creator only when tagging with these criteria",
helptip: "Even if you choose to notify from the CSD screen, the notification will only take place for those criteria selected here.",
type: "set",
setValues: Twinkle.config.commonSets.
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder
},
Line ३०१ ⟶ ४२०:
// On what types of speedy deletion notifications shall the user be welcomed
// with a "firstarticle" notice if his talk page has not yet been created.
name: "welcomeUserOnSpeedyDeletionNotification",
label: "Welcome page creator alongside notification when tagging with these criteria",
helptip: "The welcome is issued only if the user is notified about the deletion, and only if their talk page does not already exist. The template used is {{firstarticle}}.",
type: "set",
setValues: Twinkle.config.commonSets.
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder
},
// TwinkleConfig.promptForSpeedyDeletionSummary (array of strings)
{
name: "promptForSpeedyDeletionSummary",
label: "Allow editing of deletion summary when deleting under these criteria",
adminOnly: true,
type: "set",
setValues: Twinkle.config.commonSets.csdAndDICriteria,
setDisplayOrder: Twinkle.config.commonSets.csdAndDICriteriaDisplayOrder
},
// TwinkleConfig.openUserTalkPageOnSpeedyDelete (array of strings)
// What types of actions that should result user talk page to be opened when speedily deleting (admin only)
{
name: "openUserTalkPageOnSpeedyDelete",
label: "Open user talk page when deleting under these criteria",
adminOnly: true,
type: "set",
setValues: Twinkle.config.commonSets.
setDisplayOrder: Twinkle.config.commonSets.
},
Line ३२५ ⟶ ४५४:
{
name: "deleteTalkPageOnDelete",
label: "Check the \"also delete talk page\" box by default",
adminOnly: true,
type: "boolean"
Line ३४१ ⟶ ४७०:
{
name: "deleteSysopDefaultToTag",
label: "Default to speedy tagging instead of outright deletion",
adminOnly: true,
type: "boolean"
Line ३५० ⟶ ४७९:
{
name: "speedyWindowWidth",
label: "Width of speedy deletion window (pixels)",
type: "integer"
},
Line ३५८ ⟶ ४८७:
{
name: "speedyWindowHeight",
label: "Height of speedy deletion window (pixels)",
helptip: "If you have a big monitor, you might like to increase this.",
type: "integer"
},
Line ३६५ ⟶ ४९४:
{
name: "logSpeedyNominations",
label: "Keep a log in userspace of all CSD nominations",
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 nominate for CSD using Twinkle. Files tagged using DI are also added to this log.",
type: "boolean"
},
{
name: "speedyLogPageName",
label: "Keep the CSD userspace log at this user subpage",
helptip: "Enter a subpage name in this box. You will find your CSD log at User:<i>username</i>/<i>subpage name</i>. Only works if you turn on the CSD userspace log.",
type: "string"
},
{
name: "noLogOnSpeedyNomination",
label: "Do not create a userspace log entry when tagging with these criteria",
type: "set",
setValues: Twinkle.config.commonSets.
setDisplayOrder: Twinkle.config.commonSets.
}
]
Line ३८६ ⟶ ५१५:
{
title: "
inFriendlyConfig: true,
preferences: [
{
name: "watchTaggedPages",
label: "Add page to watchlist when tagging",
type: "boolean"
},
{
name: "watchMergeDiscussions",
label: "Add talk pages to watchlist when starting merge discussions",
type: "boolean"
},
{
name: "markTaggedPagesAsMinor",
label: "Mark addition of tags as a minor edit",
type: "boolean"
},
{
name: "markTaggedPagesAsPatrolled",
label: "Check the \"mark page as patrolled\" 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": "
},
{
name: "customTagList",
label: "Custom article 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: "
customListLabelTitle: "
}
]
Line ४३२ ⟶ ५६१:
{
title: "
inFriendlyConfig: true,
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 talkbacks",
type: "string"
},
{
name: "adminNoticeHeading",
label: "Section heading to use for administrators' noticeboard notices",
helptip: "Only relevant for AN and ANI.",
type: "string"
},
{
name: "mailHeading",
label: "Section heading to use for \"you've got mail\" notices",
type: "string"
}
Line ४५५ ⟶ ५९४:
{
title: "
preferences: [
// TwinkleConfig.unlinkNamespaces (array)
Line ४६१ ⟶ ६००:
{
name: "unlinkNamespaces",
label: "Remove links from pages in these namespaces",
helptip: "Avoid selecting any talk namespaces, as Twinkle might end up unlinking on talk archives (a big no-no).",
type: "set",
setValues: Twinkle.config.commonSets.namespacesNoSpecial
Line ४८६ ⟶ ६२५:
"6": "Single-issue notices",
"7": "Single-issue warnings",
"9": "Custom warnings"
}
},
Line ४९७ ⟶ ६३५:
name: "showSharedIPNotice",
label: "Add extra notice on shared IP talk pages",
helptip: "Notice used is {{
type: "boolean"
},
Line ५०९ ⟶ ६४७:
},
{
name: "customWarningList",
Line ५२५ ⟶ ६५४:
customListValueTitle: "Template name (no curly brackets)",
customListLabelTitle: "Text to show in warning list (also used as edit summary)"
},
{
name: "markXfdPagesAsPatrolled",
label: "Mark page as patrolled when nominating for AFD (if possible)",
type: "boolean"
}
]
Line ५३० ⟶ ६६५:
{
title: "
inFriendlyConfig: true,
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: "boolean"
},
{
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: "
},
{
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: "
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: "
customListLabelTitle: "
},
{
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"
}
]
Line ५९८ ⟶ ७१६:
{
title: "XFD (deletion discussions)",
preferences: [
// TwinkleConfig.xfdWatchPage (string)
Line ६०५ ⟶ ७२३:
{
name: "xfdWatchPage",
label: "Add the nominated page to watchlist",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
Line ६१६ ⟶ ७३४:
{
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.commonEnums.watchlist
Line ६२६ ⟶ ७४४:
// add to watchlist), or "default" (use setting from preferences). Default is "no" (Hehe. Seriously though, who wants to watch it?
// Sorry in advance for any false positives.).
name: "xfdWatchList",
label: "Add the daily log/list page to the watchlist (where applicable)",
Line ६३३ ⟶ ७५१:
enumValues: Twinkle.config.commonEnums.watchlist
},
// TwinkleConfig.xfdWatchUser (string)
// The watchlist setting of the user if he receives a notification. Either "yes" (add to watchlist), "no" (don't
Line ६३९ ⟶ ७५७:
{
name: "xfdWatchUser",
label: "Add the user talk page to watchlist (when notifying)",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
Line ७११ ⟶ ८२९:
type: "integer"
},
//
{
name: "
type: "integer"
}
Line ७३१ ⟶ ८४४:
// type: ""
// },
Twinkle.config.init = function twinkleconfigInit() {
Line ७६८ ⟶ ८८२:
var toctitle = document.createElement("div");
toctitle.id = "toctitle";
toctitle.className = "toctitle";
var toch2 = document.createElement("h2");
toch2.textContent = "
toctitle.appendChild(toch2);
// add TOC show/hide link
Line ७७८ ⟶ ८९३:
toctogglelink.className = "internal";
toctogglelink.setAttribute("href", "#tw-tocshowhide");
toctogglelink.textContent = "
toctoggle.appendChild(toctogglelink);
toctoggle.appendChild(document.createTextNode("]"));
Line ७८९ ⟶ ९०४:
$tocul.toggle();
if ($tocul.find(":visible").length) {
toctogglelink.textContent = "
} else {
toctogglelink.textContent = "
}
}, false);
Line १,०३२ ⟶ १,१४७:
}
resetlink.style.margin = "0 0.6em";
resetlink.appendChild(document.createTextNode("
cell.appendChild(resetlink);
}
Line १,०५० ⟶ १,१६५:
button.setAttribute("id", "twinkle-config-submit");
button.setAttribute("type", "submit");
button.appendChild(document.createTextNode("
footerbox.appendChild(button);
var footerspan = document.createElement("span");
Line १,०९३ ⟶ १,२०८:
if (mw.config.get("wgArticleId") > 0) { // page exists
box.appendChild(document.createTextNode("This page contains your Twinkle preferences. You can change them using the "));
} else { // page does not exist
box.appendChild(document.createTextNode("
}
link = document.createElement("a");
Line १,१०१ ⟶ १,२१६:
link.appendChild(document.createTextNode("Twinkle preferences panel"));
box.appendChild(link);
box.appendChild(document.createTextNode(", or by editing this page."));
$(box).insertAfter($("#contentSub"));
Line १,१०८ ⟶ १,२२३:
box.style.width = "60%";
box.appendChild(document.createTextNode("If you want to set Twinkle preferences, you can use the "));
link = document.createElement("a");
link.setAttribute("href", mw.util.getUrl(mw.config.get("wgFormattedNamespaces")[mw.config.get("wgNamespaceIds").project] + ":Twinkle/Preferences") );
Line १,३९५ ⟶ १,५१०:
var userjs = mw.config.get("wgFormattedNamespaces")[mw.config.get("wgNamespaceIds").user] + ":" + mw.config.get("wgUserName") + "/twinkleoptions.js";
var wikipedia_page = new Morebits.wiki.page(userjs, "
wikipedia_page.setCallbackParameters(e.target);
wikipedia_page.load(Twinkle.config.writePrefs);
Line १,६१७ ⟶ १,७३२:
var text =
"// twinkleoptions.js:
"//\n" +
"// NOTE: The easiest way to change your Twinkle preferences is by using the\n" +
"// Twinkle preferences panel, at [[" + Morebits.pageNameNorm + "]].\n" +
"//\n" +
"// This file is AUTOMATICALLY GENERATED. Any changes you make (aside from\n" +
"// changing the configuration parameters in a valid-JavaScript way) will be\n" +
"// overwritten the next time you click \"save\" in the Twinkle preferences\n" +
"// panel. If modifying this file, make sure to use correct JavaScript.\n" +
"\n" +
"window.Twinkle.prefs = ";
Line १,६३६ ⟶ १,७५०:
pageobj.setPageText(text);
pageobj.setEditSummary("
pageobj.setCreateOption("recreate");
pageobj.save(Twinkle.config.saveSuccess);
Line १,६४८ ⟶ १,७६२:
noticebox.style.fontSize = "100%";
noticebox.style.marginTop = "2em";
noticebox.innerHTML = "<p><b>
Morebits.status.root.appendChild(noticebox);
var noticeclear = document.createElement("br");
|