「MediaWiki:Gadget-twinkleconfig.js」:修訂間差異
跳至導覽
跳至搜尋
小 (已匯入 1 筆修訂:Twinkle) |
Xiplus-bot(留言 | 貢獻) 小 (繁簡轉換) |
||
Twinkle.config.commonEnums = {
watchlist: { yes: "添加到
talkPageMode: { window: "在窗口中,替
};
Twinkle.config.commonSets = {
csdCriteria: {
db: "自定
g1: "G1", g2: "G2", g3: "G3", g5: "G5", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14", g15: "G15", g16: "G16",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a6: "A6",
],
csdCriteriaNotification: {
db: "自定
g1: "G1", g2: "G2", g3: "G3", g5: "G5", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14", g15: "G15", g16: "G16",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a6: "A6",
],
csdAndDICriteria: {
db: "自定
g1: "G1", g2: "G2", g3: "G3", g5: "G5", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14", g15: "G15", g16: "G16",
a1: "A1", a2: "A2", a3: "A3", a5: "A5", a6: "A6",
],
namespacesNoSpecial: {
"0": "(
"1": "Talk",
"2": "User",
Twinkle.config.sections = [
{
title: "常
preferences: [
// TwinkleConfig.summaryAd (string)
{
name: "summaryAd",
label: "
helptip: "
type: "string"
},
{
name: "deletionSummaryAd",
label: "
helptip: "通常和
adminOnly: true,
type: "string"
{
name: "protectionSummaryAd",
label: "保
helptip: "通常和
adminOnly: true,
type: "string"
{
name: "userTalkPageMode",
label: "
type: "enum",
enumValues: Twinkle.config.commonEnums.talkPageMode
{
name: "dialogLargeFont",
label: "在Twinkle
type: "boolean"
}
{
title: "
preferences: [
// TwinkleConfig.notifyUserOnDeli (boolean)
{
name: "notifyUserOnDeli",
label: "默
type: "boolean"
},
{
name: "deliWatchPage",
label: "
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
{
name: "deliWatchUser",
label: "
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
{
name: "openTalkPage",
label: "在
type: "set",
setValues: { agf: "善意回退", norm: "常
},
{
name: "openTalkPageOnAutoRevert",
label: "在
helptip: "您
type: "boolean"
},
{
name: "markRevertedPagesAsMinor",
label: "
type: "set",
setValues: { agf: "善意回退", norm: "常
},
{
name: "watchRevertedPages",
label: "把
type: "set",
setValues: { agf: "善意回退", norm: "常
},
{
name: "offerReasonOnNormalRevert",
label: "常
helptip: "
type: "boolean"
},
{
name: "confirmOnFluff",
label: "回退前要求
helptip: "
type: "boolean"
},
{
name: "showRollbackLinks",
label: "在
type: "set",
setValues: { diff: "差
}
]
{
title: "共享IP
inFriendlyConfig: true,
preferences: [
{
name: "markSharedIPAsMinor",
label: "
type: "boolean"
}
{
title: "快速
preferences: [
{
name: "speedySelectionStyle",
label: "什
type: "enum",
enumValues: { "buttonClick": '
},
{
name: "watchSpeedyPages",
label: "
type: "set",
setValues: Twinkle.config.commonSets.csdCriteria,
{
name: "markSpeedyPagesAsPatrolled",
label: "
type: "boolean"
},
{
name: "notifyUserOnSpeedyDeletionNomination",
label: "
helptip: "
type: "set",
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
{
name: "welcomeUserOnSpeedyDeletionNotification",
label: "在使用以下理由
helptip: "
type: "set",
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
{
name: "promptForSpeedyDeletionSummary",
label: "使用以下理由
adminOnly: true,
type: "set",
{
name: "openUserTalkPageOnSpeedyDelete",
label: "使用以下理由
adminOnly: true,
type: "set",
{
name: "deleteTalkPageOnDelete",
label: "默
adminOnly: true,
type: "boolean"
{
name: "deleteRedirectsOnDelete",
label: "默
adminOnly: true,
type: "boolean"
{
name: "deleteSysopDefaultToTag",
label: "默
adminOnly: true,
type: "boolean"
{
name: "speedyWindowWidth",
label: "快速
type: "integer"
},
{
name: "speedyWindowHeight",
label: "快速
helptip: "如果您有一
type: "integer"
},
{
name: "logSpeedyNominations",
label: "在用
helptip: "非管理
type: "boolean"
},
{
name: "speedyLogPageName",
label: "在此
helptip: "在此框中
type: "string"
},
{
name: "noLogOnSpeedyNomination",
label: "在使用以下理由
type: "set",
setValues: Twinkle.config.commonSets.csdAndDICriteria,
{
name: "enlargeG11Input",
label: "
helptip: "
type: "boolean"
}
{
title: "
inFriendlyConfig: true,
preferences: [
{
name: "watchTaggedPages",
label: "
type: "boolean"
},
{
name: "watchMergeDiscussions",
label: "添加合
type: "boolean"
},
{
name: "markTaggedPagesAsMinor",
label: "
type: "boolean"
},
{
name: "markTaggedPagesAsPatrolled",
label: "默
type: "boolean"
},
{
name: "groupByDefault",
label: "默
type: "boolean"
},
{
name: "tagArticleSortOrder",
label: "
type: "enum",
enumValues: { "cat": "按
},
{
name: "customTagList",
label: "自定
helptip: "
type: "customList",
customListValueTitle: "模板名(不含大括
customListLabelTitle: "
}
]
{
title: "回
inFriendlyConfig: true,
preferences: [
{
name: "markTalkbackAsMinor",
label: "
type: "boolean"
},
{
name: "insertTalkbackSignature",
label: "回
type: "boolean"
},
{
name: "talkbackHeading",
label: "回
type: "string"
},
{
name: "mailHeading",
label: "
type: "string"
}
{
title: "反
preferences: [
// TwinkleConfig.unlinkNamespaces (array)
{
name: "unlinkNamespaces",
label: "取消以下名字空
helptip: "
type: "set",
setValues: Twinkle.config.commonSets.namespacesNoSpecial
{
title: "警告用
preferences: [
// TwinkleConfig.defaultWarningGroup (int)
{
name: "defaultWarningGroup",
label: "默
type: "enum",
enumValues: {
"1": "
"2": "
"3": "
"4": "
"5": "
"6": "
"7": "
"9": "自定
}
},
{
name: "showSharedIPNotice",
label: "在IP
helptip: "使用的模板是{{SharedIPAdvice}}。",
type: "boolean"
{
name: "watchWarnings",
label: "警告
type: "boolean"
},
{
name: "customWarningList",
label: "自定
helptip: "您可以加入模板或用
type: "customList",
customListValueTitle: "模板名(不含大括
customListLabelTitle: "
},
{
name: "markXfdPagesAsPatrolled",
label: "在提交存
type: "boolean"
}
{
title: "存
preferences: [
// TwinkleConfig.xfdWatchPage (string)
{
name: "xfdWatchPage",
label: "添加提名的
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
{
name: "xfdWatchDiscussion",
label: "添加存
helptip: "
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
{
name: "xfdWatchUser",
label: "添加
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
{
name: "markXfdPagesAsPatrolled",
label: "
helptip: "基
type: "boolean"
}
{
title: "侵犯版
preferences: [
// TwinkleConfig.copyvioWatchPage (string)
{
name: "copyvioWatchPage",
label: "添加提
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
{
name: "copyvioWatchUser",
label: "添加
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
{
name: "markCopyvioPagesAsPatrolled",
label: "
helptip: "基
type: "boolean"
},
{
title: "
hidden: true,
preferences: [
Twinkle.config.init = function twinkleconfigInit() {
if ((mw.config.get("wgNamespaceNumber") === mw.config.get("wgNamespaceIds").project && mw.config.get("wgTitle") === "Twinkle/
(mw.config.get("wgNamespaceNumber") === mw.config.get("wgNamespaceIds").user && mw.config.get("wgTitle").lastIndexOf("/Twinkle
mw.config.get("wgAction") === "view") {
// create the config page at Wikipedia:Twinkle/
if (!document.getElementById("twinkle-config")) {
var contentnotice = document.createElement("p");
// I hate innerHTML, but this is one thing it *is* good for...
contentnotice.innerHTML = "<b>在
contentdiv.appendChild(contentnotice);
toctitle.id = "toctitle";
var toch2 = document.createElement("h2");
toch2.textContent = "目
toctitle.appendChild(toch2);
// add TOC show/hide link
toctogglelink.className = "internal";
toctogglelink.setAttribute("href", "#tw-tocshowhide");
toctogglelink.textContent = "
toctoggle.appendChild(toctogglelink);
toctoggle.appendChild(document.createTextNode("]"));
$tocul.toggle();
if ($tocul.find(":visible").length) {
toctogglelink.textContent = "
} else {
toctogglelink.textContent = "
}
}, false);
inFriendlyConfig: section.inFriendlyConfig
});
button.appendChild(document.createTextNode("
cell.appendChild(button);
break;
default:
alert("twinkleconfig: 未知
break;
}
}
resetlink.style.margin = "0 0.6em";
resetlink.appendChild(document.createTextNode("
cell.appendChild(resetlink);
}
footera.setAttribute("id", "twinkle-config-resetall");
footera.addEventListener("click", Twinkle.config.resetAllPrefs, false);
footera.appendChild(document.createTextNode("恢
footerspan.appendChild(footera);
footerbox.appendChild(footerspan);
if (mw.config.get("wgArticleId") > 0) { // page exists
box.appendChild(document.createTextNode("
} else { // page does not exist
box.appendChild(document.createTextNode("您可配置您的Twinkle,通
}
link = document.createElement("a");
link.setAttribute("href", mw.util.getUrl(mw.config.get("wgFormattedNamespaces")[mw.config.get("wgNamespaceIds").project] + ":Twinkle/
link.appendChild(document.createTextNode("Twinkle
box.appendChild(link);
box.appendChild(document.createTextNode(",或直接
$(box).insertAfter($("#contentSub"));
box.style.width = "60%";
box.appendChild(document.createTextNode("如果您想配置您的Twinkle,
link = document.createElement("a");
link.setAttribute("href", mw.util.getUrl(mw.config.get("wgFormattedNamespaces")[mw.config.get("wgNamespaceIds").project] + ":Twinkle/
link.appendChild(document.createTextNode("Twinkle
box.appendChild(link);
box.appendChild(document.createTextNode("。"));
contentnotice.innerHTML = '<table class="plainlinks ombox ombox-content"><tr><td class="mbox-image">' +
'<img alt="" src="http://upload.wikimedia.org/wikipedia/en/3/38/Imbox_content.png" /></td>' +
'<td class="mbox-text"><p><big><b>在
'<p>要
'</td></tr></table>';
} else {
var dialog = new Morebits.simpleWindow(720, 400);
dialog.setTitle(curpref.label);
dialog.setScriptName("Twinkle
var dialogcontent = document.createElement("div");
dlgth = document.createElement("th");
dlgth.style.width = "35%";
dlgth.textContent = (curpref.customListValueTitle ? curpref.customListValueTitle : "
dlgtr.appendChild(dlgth);
// label column header
dlgth = document.createElement("th");
dlgth.style.width = "60%";
dlgth.textContent = (curpref.customListLabelTitle ? curpref.customListLabelTitle : "
dlgtr.appendChild(dlgth);
dlgtbody.appendChild(dlgtr);
Twinkle.config.listDialog.reset($prefbutton, dlgtbody);
}, false);
button.textContent = "
dialogcontent.appendChild(button);
button = document.createElement("button");
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);
userValue = parseInt(form[pref.name].value, 10);
if (isNaN(userValue)) {
Morebits.status.warn("保存", "您
userValue = null;
}
default:
alert("twinkleconfig: 未知
break;
}
var text =
"// twinkleoptions.js:用
"//\n" +
"//
"// Twinkle
"//\n" +
"//
"// 以一
"// 在下一次您
"// 修改此文件
"\n" +
"window.Twinkle.prefs = ";
";\n" +
"\n" +
"// twinkleoptions.js到此
pageobj.setPageText(text);
pageobj.setEditSummary("保存Twinkle
pageobj.setCreateOption("recreate");
pageobj.save(Twinkle.config.saveSuccess);
noticebox.style.fontSize = "100%";
noticebox.style.marginTop = "2em";
noticebox.innerHTML = "<p><b>您的Twinkle
Morebits.status.root.appendChild(noticebox);
var noticeclear = document.createElement("br");
|