User:逆襲的天邪鬼/Twinkle-lzh/twinkleconfig.js: Difference between revisions

no edit summary
(Created page with "//<nowiki> // vim: set noet sts=0 sw=8: (function($){ /* **************************************** *** twinkleconfig.js: Preferences module *****************************...")
 
No edit summary
 
Line 25:
 
Twinkle.config.commonEnums = {
watchlist: { yes: "监视列表監視清單", no: "不监视列表監視清單", "default": "遵守站点设置點設定" },
talkPageMode: { window: "在中,替换取代户对话页戶對話頁", tab: "在新标签页分頁中", blank: "在全新的中" }
};
 
Twinkle.config.commonSets = {
csdCriteria: {
db: "自定理由",
g1: "G1作者請求", g2g3: "G2毀我大典", g3g4: "G3廣告宣傳", g5: "G5", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14試筆", g15g7: "G15孤頁", g16g8: "G16技術",
a1: "A1非文言", a2: "A2極短且不知所云", a3: "A3文白相雜", a5a4: "A5", a6: "A6生不立傳",
o1r1: "O1斷渡", o3r2: "O3筆誤", o4r3: "O4條目渡至非條目", r4: "簡化字文題",
c1: "空類"
f1: "F1", f3: "F3", f4: "F4", f5: "F5", f6: "F6", f7: "F7",
r2: "R2", r3: "R3", r5: "R5"
},
csdCriteriaDisplayOrder: [
"db",
"g1", "g2g3", "g3g4", "g5", "g10", "g11", "g12", "g13", "g14", "g15g7", "g16g8",
"a1", "a2", "a3", "a5", "a6a4",
"o1r1", "o3r2", "o4r3", "r4",
"c1"
"f1", "f3", "f4", "f5", "f6", "f7",
"r2", "r3", "r5"
],
csdCriteriaNotification: {
db: "自定理由",
g1: "G1作者請求", g2g3: "G2毀我大典", g3g4: "G3廣告宣傳", g5: "G5", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14試筆", g15g7: "G15孤頁", g16g8: "G16技術",
a1: "A1非文言", a2: "A2極短且不知所云", a3: "A3文白相雜", a5a4: "A5", a6: "A6生不立傳",
o1r1: "O1斷渡", o3r2: "O3筆誤", o4r3: "O4條目渡至非條目", r4: "簡化字文題",
c1: "空類"
f1: "F1", f3: "F3", f4: "F4", f5: "F5", f6: "F6", f7: "F7",
r2: "R2", r3: "R3", r5: "R5"
},
csdCriteriaNotificationDisplayOrder: [
"db",
"g1", "g2g3", "g3g4", "g5", "g10", "g11", "g12", "g13", "g14", "g15g7", "g16g8",
"a1", "a2", "a3", "a5", "a6a4",
"o1r1", "o3r2", "o4r3", "r4",
"c1"
"f1", "f3", "f4", "f5", "f6", "f7",
"r2", "r3", "r5"
],
csdAndDICriteria: {
db: "自定理由",
g1: "G1作者請求", g2g3: "G2毀我大典", g3g4: "G3廣告宣傳", g5: "G5", g10: "G10", g11: "G11", g12: "G12", g13: "G13", g14: "G14試筆", g15g7: "G15孤頁", g16g8: "G16技術",
a1: "A1非文言", a2: "A2極短且不知所云", a3: "A3文白相雜", a5a4: "A5", a6: "A6生不立傳",
o1r1: "O1斷渡", o3r2: "O3筆誤", o4r3: "O4條目渡至非條目", r4: "簡化字文題",
c1: "空類"
f1: "F1", f3: "F3", f4: "F4", f5: "F5", f6: "F6", f7: "F7",
r2: "R2", r3: "R3", r5: "R5"
},
csdAndDICriteriaDisplayOrder: [
"db",
"g1", "g2g3", "g3g4", "g5", "g10", "g11", "g12", "g13", "g14", "g15g7", "g16g8",
"a1", "a2", "a3", "a5", "a6a4",
"o1r1", "o3r2", "o4r3", "r4",
"c1"
"f1", "f3", "f4", "f5", "f6", "f7",
"r2", "r3", "r5"
],
namespacesNoSpecial: {
"0": "(目)",
"1": "Talk",
"2": "User",
Line 95 ⟶ 89:
"14": "Category",
"15": "Category talk",
"100": "Portal",
"101": "Portal talk",
"118106": "Draft稿",
"119107": "Draft talk酌稿",
"828": "Module",
"829": "Module talk"
Line 134 ⟶ 128:
Twinkle.config.sections = [
{
title: "常",
preferences: [
// TwinkleConfig.summaryAd (string)
Line 140 ⟶ 134:
{
name: "summaryAd",
label: "编辑編輯摘要后缀後綴",
helptip: "应当由建議以空格开头開頭并尽並盡可能短。",
type: "string"
},
Line 149 ⟶ 143:
{
name: "deletionSummaryAd",
label: "除摘要后缀後綴",
helptip: "通常和编辑編輯摘要后缀後綴。",
adminOnly: true,
type: "string"
Line 157 ⟶ 151:
// TwinkleConfig.protectionSummaryAd (string)
// Text to be appended to the edit summary of page protections made using Twinkle
// {
// name: "protectionSummaryAd",
// label: "保摘要后缀後綴",
// helptip: "通常和编辑編輯摘要后缀後綴。",
// adminOnly: true,
// type: "string"
// },
 
// TwinkleConfig.userTalkPageMode may take arguments:
Line 171 ⟶ 165:
{
name: "userTalkPageMode",
label: "要打户对话页时戶對話頁時,",
type: "enum",
enumValues: Twinkle.config.commonEnums.talkPageMode
Line 179 ⟶ 173:
{
name: "dialogLargeFont",
label: "在Twinkle对话對話框中使用大",
type: "boolean"
}
]
},
 
{
title: "图片删除",
preferences: [
// TwinkleConfig.notifyUserOnDeli (boolean)
// If the user should be notified after placing a file deletion tag
{
name: "notifyUserOnDeli",
label: "默认勾选“通知创建者”",
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: "标记图片时添加到监视列表",
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: "标记图片时添加创建者对话页到监视列表",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
}
]
Line 223 ⟶ 186:
{
name: "openTalkPage",
label: "在型的回退户对话页戶對話頁",
type: "set",
setValues: { agf: "善意回退", norm: "常回退", vand: "破回退", torev: "此版本" }
},
 
Line 232 ⟶ 195:
{
name: "openTalkPageOnAutoRevert",
label: "在从用户贡献戶貢獻起回退户对话页戶對話頁",
helptip: "您经常在破者的用户贡献戶貢獻起许多回退,总是打户对话页戶對話頁可能不太适,所以这个选项默认這個選項預設关闭。它被打开时開時,依赖上一个设個設定。",
type: "boolean"
},
Line 241 ⟶ 204:
{
name: "markRevertedPagesAsMinor",
label: "将这將這型的回退标记为標記為小修改",
type: "set",
setValues: { agf: "善意回退", norm: "常回退", vand: "破回退", torev: "此版本" }
},
 
Line 250 ⟶ 213:
{
name: "watchRevertedPages",
label: "把型的回退加入监视列表監視清單",
type: "set",
setValues: { agf: "善意回退", norm: "常回退", vand: "破回退", torev: "此版本" }
},
 
Line 259 ⟶ 222:
{
name: "offerReasonOnNormalRevert",
label: "常回退时询问時詢問理由",
helptip: "规”規」回退是中的那[回退]链接連結。",
type: "boolean"
},
Line 266 ⟶ 229:
{
name: "confirmOnFluff",
label: "回退前要求确认確認",
helptip: "那些手持手持设备設備的用,或者意志不定的。",
type: "boolean"
},
Line 276 ⟶ 239:
{
name: "showRollbackLinks",
label: "在面上示回退链接連結",
type: "set",
setValues: { diff: "差", others: "其贡献貢獻", mine: "我的贡献貢獻" }
}
]
Line 284 ⟶ 247:
 
{
title: "共享IP标记標記",
inFriendlyConfig: true,
preferences: [
{
name: "markSharedIPAsMinor",
label: "共享IP标记标记为標記標記為小修改",
type: "boolean"
}
Line 296 ⟶ 259:
 
{
title: "快速除",
preferences: [
{
name: "speedySelectionStyle",
label: "什么时麼時标记標記除",
type: "enum",
enumValues: { "buttonClick": '点“點「提交”时」時', "radioClick": "个选项时個選項時" }
},
 
Line 309 ⟶ 272:
{
name: "watchSpeedyPages",
label: "以下理由监视列表監視清單",
type: "set",
setValues: Twinkle.config.commonSets.csdCriteria,
Line 319 ⟶ 282:
{
name: "markSpeedyPagesAsPatrolled",
label: "标记时标记页標記時標記頁已巡查(如可能)",
type: "boolean"
},
Line 327 ⟶ 290:
{
name: "notifyUserOnSpeedyDeletionNomination",
label: "在使用以下理由通知者",
helptip: "管您在对话對話框中择通知,通知仍只在使用些理由时发時發出。",
type: "set",
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder
},
 
// TwinkleConfig.welcomeUserOnSpeedyDeletionNotification (array of strings)
// 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: "在使用以下理由时欢迎页面创建者",
helptip: "欢迎模板仅在用户被通知时加入,使用的模板是{{firstarticle}}。",
type: "set",
setValues: Twinkle.config.commonSets.csdCriteriaNotification,
setDisplayOrder: Twinkle.config.commonSets.csdCriteriaNotificationDisplayOrder
},
 
// TwinkleConfig.promptForSpeedyDeletionSummary (array of strings)
{
name: "promptForSpeedyDeletionSummary",
label: "使用以下理由删除时允许编辑删除理由",
adminOnly: true,
type: "set",
setValues: Twinkle.config.commonSets.csdAndDICriteria,
setDisplayOrder: Twinkle.config.commonSets.csdAndDICriteriaDisplayOrder
},
 
Line 360 ⟶ 301:
{
name: "openUserTalkPageOnSpeedyDelete",
label: "使用以下理由户对话页戶對話頁",
adminOnly: true,
type: "set",
Line 371 ⟶ 312:
{
name: "deleteTalkPageOnDelete",
label: "默认預設选“删選「刪讨论页”討論頁」",
adminOnly: true,
type: "boolean"
Line 378 ⟶ 319:
{
name: "deleteRedirectsOnDelete",
label: "默认預設选“删選「刪除重定向",
adminOnly: true,
type: "boolean"
Line 387 ⟶ 328:
{
name: "deleteSysopDefaultToTag",
label: "默认为标记預設為標記而不是直接除",
adminOnly: true,
type: "boolean"
Line 396 ⟶ 337:
{
name: "speedyWindowWidth",
label: "快速对话對話度(像素)",
type: "integer"
},
Line 404 ⟶ 345:
{
name: "speedyWindowHeight",
label: "快速对话對話框高度(像素)",
helptip: "如果您有一只很大的监视監視器,您可以此调高。",
type: "integer"
},
Line 411 ⟶ 352:
{
name: "logSpeedyNominations",
label: "在用记录記錄所有快速除提名",
helptip: "非管理员无員無法访到已除的贡献貢獻,用提供了一很好的方法来记录这來記錄這史。",
type: "boolean"
},
{
name: "speedyLogPageName",
label: "在此保留日",
helptip: "在此框中入子面名,您在User:<i>用名</i>/<i>子面</i>找到CSD日在打志时誌時工作。",
type: "string"
},
{
name: "noLogOnSpeedyNomination",
label: "在使用以下理由不做记录記錄",
type: "set",
setValues: Twinkle.config.commonSets.csdAndDICriteria,
setDisplayOrder: Twinkle.config.commonSets.csdAndDICriteriaDisplayOrder
},
 
{
name: "enlargeG11Input",
label: "扩大CSD G11的按钮",
helptip: "扩为默认的两倍大。",
type: "boolean"
}
]
Line 439 ⟶ 373:
 
{
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: "默认預設选“選「到{{multiple issues}}”复选」複選框",
type: "boolean"
},
{
name: "tagArticleSortOrder",
label: "条目标记的默认察看方式",
type: "enum",
enumValues: { "cat": "按类别", "alpha": "按字母" }
},
{
name: "customTagList",
label: "自定义条義條目维护标记護標記",
helptip: "列表清單的末尾。",
type: "customList",
customListValueTitle: "模板名(不含大括)",
customListLabelTitle: "示的文字"
}
]
},
 
{
title: "回复",
inFriendlyConfig: true,
preferences: [
{
name: "markTalkbackAsMinor",
label: "将回复标记为小修改",
type: "boolean"
},
{
name: "insertTalkbackSignature",
label: "回复时添加签名",
helptip: "Flow页除外。",
type: "boolean"
},
{
name: "talkbackHeading",
label: "回复所用的小节标题",
type: "string"
},
{
name: "mailHeading",
label: "“有新邮件”所用的小节标题",
type: "string"
}
]
Line 513 ⟶ 413:
 
{
title: "反",
preferences: [
// TwinkleConfig.unlinkNamespaces (array)
Line 519 ⟶ 419:
{
name: "unlinkNamespaces",
label: "取消以下名字空中的反",
helptip: "避免讨论页討論頁,因这样会导這樣會導致Twinkle试图試圖修改讨论討論。",
type: "set",
setValues: Twinkle.config.commonSets.namespacesNoSpecial
Line 528 ⟶ 428:
 
{
title: "警告用",
preferences: [
// TwinkleConfig.defaultWarningGroup (int)
// if true, watch the page which has been dispatched an warning or notice, if false, default applies
{
name: "defaultWarningGroup",
label: "默认警告级别",
type: "enum",
enumValues: {
"1": "层级1",
"2": "层级2",
"3": "层级3",
"4": "层级4",
"5": "层级4im",
"6": "单层级通知",
"7": "单层级警告",
"9": "自定义警告"
}
},
 
// TwinkleConfig.showSharedIPNotice may take arguments:
// true: to show shared ip notice if an IP address
Line 553 ⟶ 435:
{
name: "showSharedIPNotice",
label: "在IP对话页對話頁示附加信息",
helptip: "使用的模板是{{SharedIPAdvice}}。",
type: "boolean"
Line 562 ⟶ 444:
{
name: "watchWarnings",
label: "警告时添户对话页戶對話頁监视列表監視清單",
helptip: "注意:如果对方使用Flow,对应讨论串总会被加到监视列表中。",
type: "boolean"
},
Line 569 ⟶ 450:
{
name: "customWarningList",
label: "自定警告模板",
helptip: "您可以加入模板或用面。自定警告在警告对话對話框中自定警告。",
type: "customList",
customListValueTitle: "模板名(不含大括)",
customListLabelTitle: "示的文字(和编辑編輯摘要)"
},
 
{
name: "markXfdPagesAsPatrolled",
label: "在提交存废讨论时将页廢討論時將頁标记为標記為已巡查(如可能)",
type: "boolean"
}
Line 585 ⟶ 466:
 
{
title: "存废讨论廢討論",
preferences: [
// TwinkleConfig.xfdWatchPage (string)
Line 592 ⟶ 473:
{
name: "xfdWatchPage",
label: "提名的面到监视列表監視清單",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
Line 603 ⟶ 484:
{
name: "xfdWatchDiscussion",
label: "废讨论页廢討論頁监视列表監視清單",
helptip: "当日的页面。",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
Line 614 ⟶ 494:
{
name: "xfdWatchUser",
label: "对话页對話頁监视列表監視清單(在通知)",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
Line 623 ⟶ 503:
{
name: "markXfdPagesAsPatrolled",
label: "标记时标记页標記時標記頁已巡查(如可能)",
helptip: "基原因,仅会僅會在由Special:NewPages到达时達時标记为標記為已巡查。",
type: "boolean"
}
Line 632 ⟶ 512:
 
{
title: "侵犯版权隱藏",
preferences: [
// TwinkleConfig.copyvioWatchPage (string)
// The watchlist setting of the page being nominated for XfD. Either "yes" (add to watchlist), "no" (don't
// add to watchlist), or "default" (use setting from preferences). Default is "default" (duh).
{
name: "copyvioWatchPage",
label: "添加提报的页面到监视列表",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
},
 
// TwinkleConfig.copyvioWatchUser (string)
// The watchlist setting of the user if he receives a notification. Either "yes" (add to watchlist), "no" (don't
// add to watchlist), or "default" (use setting from preferences). Default is "default" (duh).
{
name: "copyvioWatchUser",
label: "添加创建者对话页到监视列表(在通知时)",
type: "enum",
enumValues: Twinkle.config.commonEnums.watchlist
},
 
// TwinkleConfig.markCopyvioPagesAsPatrolled (boolean)
// If, when applying copyvio template to page, to mark the page as patrolled (if the page was reached from NewPages)
{
name: "markCopyvioPagesAsPatrolled",
label: "标记时标记页面为已巡查(如可能)",
helptip: "基于技术原因,页面仅会在由Special:NewPages到达时被标记为已巡查。",
type: "boolean"
},
 
]
},
 
{
title: "隐藏",
hidden: true,
preferences: [
Line 750 ⟶ 595:
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("wgTitle").length - 9))) &&
mw.config.get("wgAction") === "view") {
// create the config page at Wikipedia:Twinkle/参数设置參數設定, and at user subpages (for testing purposes)
 
if (!document.getElementById("twinkle-config")) {
Line 769 ⟶ 614:
var contentnotice = document.createElement("p");
// I hate innerHTML, but this is one thing it *is* good for...
contentnotice.innerHTML = "<b>在里修改您的参数设置參數設定之前,</b>确认確認您已移除了<a href=\"" + mw.util.getUrl("Special:MyPage/skin.js") + "\" title=\"Special:MyPage/skin.js\">用JavaScript文件</a>中任何旧的<code>FriendlyConfig</code>设置設定。";
contentdiv.appendChild(contentnotice);
 
Line 785 ⟶ 630:
toctitle.id = "toctitle";
var toch2 = document.createElement("h2");
toch2.textContent = "目 ";
toctitle.appendChild(toch2);
// add TOC show/hide link
Line 794 ⟶ 639:
toctogglelink.className = "internal";
toctogglelink.setAttribute("href", "#tw-tocshowhide");
toctogglelink.textContent = "藏";
toctoggle.appendChild(toctogglelink);
toctoggle.appendChild(document.createTextNode("]"));
Line 805 ⟶ 650:
$tocul.toggle();
if ($tocul.find(":visible").length) {
toctogglelink.textContent = "藏";
} else {
toctogglelink.textContent = "示";
}
}, false);
Line 1,016 ⟶ 861:
inFriendlyConfig: section.inFriendlyConfig
});
button.appendChild(document.createTextNode("编辑项編輯項目"));
cell.appendChild(button);
break;
 
default:
alert("twinkleconfig: 未知型的性 " + pref.name);
break;
}
Line 1,048 ⟶ 893:
}
resetlink.style.margin = "0 0.6em";
resetlink.appendChild(document.createTextNode("位"));
cell.appendChild(resetlink);
}
Line 1,066 ⟶ 911:
button.setAttribute("id", "twinkle-config-submit");
button.setAttribute("type", "submit");
button.appendChild(document.createTextNode("存修改"));
footerbox.appendChild(button);
var footerspan = document.createElement("span");
Line 1,076 ⟶ 921:
footera.setAttribute("id", "twinkle-config-resetall");
footera.addEventListener("click", Twinkle.config.resetAllPrefs, false);
footera.appendChild(document.createTextNode("恢复默认復預設"));
footerspan.appendChild(footera);
footerbox.appendChild(footerspan);
Line 1,109 ⟶ 954:
 
if (mw.config.get("wgArticleId") > 0) { // page exists
box.appendChild(document.createTextNode("这页這頁包含您的Twinkle参数设置參數設定,您可使用"));
} 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"));
 
Line 1,124 ⟶ 969:
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("。"));
Line 1,142 ⟶ 987:
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>在里修改您的参数设置參數設定之前,</b>您必须移除在用JavaScript文件中任何旧的Friendly设置設定。</big></p>' +
'<p>要这样這樣做,您可以<a href="' + mw.config.get("wgScript") + '?title=User:' + encodeURIComponent(mw.config.get("wgUserName")) + '/' + mw.config.get("skin") + '.js&action=edit" target="_blank"><b>编辑編輯您的人JavaScript</b></a>。除提到<code>FriendlyConfig</code>的代码。</p>' +
'</td></tr></table>';
} else {
Line 1,199 ⟶ 1,044:
var dialog = new Morebits.simpleWindow(720, 400);
dialog.setTitle(curpref.label);
dialog.setScriptName("Twinkle参数设置參數設定");
 
var dialogcontent = document.createElement("div");
Line 1,223 ⟶ 1,068:
dlgth = document.createElement("th");
dlgth.style.width = "60%";
dlgth.textContent = (curpref.customListLabelTitle ? curpref.customListLabelTitle : "签");
dlgtr.appendChild(dlgth);
dlgtbody.appendChild(dlgtr);
Line 1,249 ⟶ 1,094:
Twinkle.config.listDialog.addRow(dlgtbody);
}, false);
addButton.textContent = "";
dlgtd.appendChild(addButton);
dlgtr.appendChild(dlgtd);
Line 1,265 ⟶ 1,110:
dialog.close();
}, false);
button.textContent = "存修改";
dialogcontent.appendChild(button);
button = document.createElement("button");
Line 1,408 ⟶ 1,253:
Morebits.status.init( document.getElementById("twinkle-config-content") );
 
Morebits.wiki.actionCompleted.notice = "存";
 
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, "参数设置參數設定到 " + userjs);
wikipedia_page.setCallbackParameters(e.target);
wikipedia_page.load(Twinkle.config.writePrefs);
Line 1,570 ⟶ 1,415:
userValue = parseInt(form[pref.name].value, 10);
if (isNaN(userValue)) {
Morebits.status.warn("存", "您 " + pref.name + " 指定的值(" + pref.value + ")不合法,继续存操作,但此值将会將會跳过。");
userValue = null;
}
Line 1,599 ⟶ 1,444:
 
default:
alert("twinkleconfig: 未知数据型,性 " + pref.name);
break;
}
Line 1,633 ⟶ 1,478:
 
var text =
"// twinkleoptions.js:用Twinkle参数设置文件參數設定\n" +
"//\n" +
"// :修改您的参数设置參數設定简单簡單法是使用\n" +
"// Twinkle参数设置參數設定面板,在[[" + Morebits.pageNameNorm + "]]。\n" +
"//\n" +
"// 这个文件這個頁面是自動產的,您所做的任何修改(除了\n" +
"// 以一合法的JavaScript的方式修改性值)\n" +
"// 在下一次您“保「儲”时」時被覆。\n" +
"// 修改此文件时頁面時请记請記得使用合法的JavaScript。\n" +
"\n" +
"window.Twinkle.prefs = ";
Line 1,648 ⟶ 1,493:
";\n" +
"\n" +
"// twinkleoptions.js到此止\n";
 
pageobj.setPageText(text);
pageobj.setEditSummary("存Twinkle参数设置參數設定自[[" + Morebits.pageNameNorm + "]]的自动编辑動編輯。 ([[WP:TW|TW]])");
pageobj.setCreateOption("recreate");
pageobj.save(Twinkle.config.saveSuccess);
Line 1,663 ⟶ 1,508:
noticebox.style.fontSize = "100%";
noticebox.style.marginTop = "2em";
noticebox.innerHTML = "<p><b>您的Twinkle参数设置參數設定被保存。</b></p><p>要看到些更改,您可能需要<a href=\"" + mw.util.getUrl("WP:BYPASS") + "\" title=\"WP:BYPASS\"><b>绕过浏览繞過瀏覽缓存快取</b></a>。</p>";
Morebits.status.root.appendChild(noticebox);
var noticeclear = document.createElement("br");