MediaWiki:Gadget-twinkleconfig.js: Difference between revisions

Jump to navigation Jump to search
localise
m (1 revision imported)
 
(localise)
 
Line 9: Line 9:
  *** twinkleconfig.js: Preferences module
  *** twinkleconfig.js: Preferences module
  ****************************************
  ****************************************
  * Mode of invocation:    Adds configuration form to Wikipedia:Twinkle/Preferences and user
  * Mode of invocation:    Adds configuration form to Sarkarverse:Twinkle/Preferences and user
                           subpages named "/Twinkle preferences", and adds ad box to the top of 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'
                           subpages belonging to the currently logged-in user which end in '.js'
Line 16: Line 16:


  I, [[User:This, that and the other]], originally wrote this.  If the code is misbehaving, or you have any
  I, [[User:This, that and the other]], originally wrote this.  If the code is misbehaving, or you have any
  questions, don't hesitate to ask me.  (This doesn't at all imply [[WP:OWN]]ership - it's just meant to
  questions, don't hesitate to ask me.  (This doesn't at all imply [[SV:OWN]]ership - it's just meant to
  point you in the right direction.)  -- TTO
  point you in the right direction.)  -- TTO
  */
  */
Line 224: Line 224:
preferences: [
preferences: [
// TwinkleConfig.blankTalkpageOnIndefBlock (boolean)
// TwinkleConfig.blankTalkpageOnIndefBlock (boolean)
// if true, blank the talk page when issuing an indef block notice (per [[WP:UWUL#Indefinitely blocked users]])
// if true, blank the talk page when issuing an indef block notice (per [[SV:UWUL#Indefinitely blocked users]])
{
{
name: "blankTalkpageOnIndefBlock",
name: "blankTalkpageOnIndefBlock",
label: "Blank the talk page when indefinitely blocking users",
label: "Blank the talk page when indefinitely blocking users",
helptip: "See <a href=\"" + mw.util.getUrl("Wikipedia:WikiProject_User_warnings/Usage_and_layout#Indefinitely_blocked_users") + "\">WP:UWUL</a> for more information.",
helptip: "See <a href=\"" + mw.util.getUrl("Sarkarverse:WikiProject_User_warnings/Usage_and_layout#Indefinitely_blocked_users") + "\">SV:UWUL</a> for more information.",
type: "boolean"
type: "boolean"
}
}
Line 851: Line 851:
(mw.config.get("wgNamespaceNumber") === mw.config.get("wgNamespaceIds").user && mw.config.get("wgTitle").lastIndexOf("/Twinkle preferences") === (mw.config.get("wgTitle").length - 20))) &&
(mw.config.get("wgNamespaceNumber") === mw.config.get("wgNamespaceIds").user && mw.config.get("wgTitle").lastIndexOf("/Twinkle preferences") === (mw.config.get("wgTitle").length - 20))) &&
mw.config.get("wgAction") === "view") {
mw.config.get("wgAction") === "view") {
// create the config page at Wikipedia:Twinkle/Preferences, and at user subpages (for testing purposes)
// create the config page at Sarkarverse:Twinkle/Preferences, and at user subpages (for testing purposes)


if (!document.getElementById("twinkle-config")) {
if (!document.getElementById("twinkle-config")) {
Line 1,663: Line 1,663:


pageobj.setPageText(text);
pageobj.setPageText(text);
pageobj.setEditSummary("Saving Twinkle preferences: automatic edit from [[:" + Morebits.pageNameNorm + "]] ([[WP:TW|TW]])");
pageobj.setEditSummary("Saving Twinkle preferences: automatic edit from [[:" + Morebits.pageNameNorm + "]] ([[SV:TW|TW]])");
pageobj.setCreateOption("recreate");
pageobj.setCreateOption("recreate");
pageobj.save(Twinkle.config.saveSuccess);
pageobj.save(Twinkle.config.saveSuccess);
Line 1,675: Line 1,675:
noticebox.style.fontSize = "100%";
noticebox.style.fontSize = "100%";
noticebox.style.marginTop = "2em";
noticebox.style.marginTop = "2em";
noticebox.innerHTML = "<p><b>Your Twinkle preferences have been saved.</b></p><p>To see the changes, you will need to <b>clear your browser cache entirely</b> (see <a href=\"" + mw.util.getUrl("WP:BYPASS") + "\" title=\"WP:BYPASS\">WP:BYPASS</a> for instructions).</p>";
noticebox.innerHTML = "<p><b>Your Twinkle preferences have been saved.</b></p><p>To see the changes, you will need to <b>clear your browser cache entirely</b> (see <a href=\"" + mw.util.getUrl("SV:BYPASS") + "\" title=\"SV:BYPASS\">SV:BYPASS</a> for instructions).</p>";
Morebits.status.root.appendChild(noticebox);
Morebits.status.root.appendChild(noticebox);
var noticeclear = document.createElement("br");
var noticeclear = document.createElement("br");
14,061

edits

Navigation menu