跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
分类索引
最近更改
随机页面
灵兰秘典
帮助
帮助
联系我们
捐助本站
关于本站
MediaWiki帮助
中医百科
搜索
搜索
外观
登录
个人工具
登录
查看“︁MediaWiki:Gadget-Edittools-refToolbar.js”︁的源代码
系统消息
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
Cargo数据
外观
移至侧栏
隐藏
←
MediaWiki:Gadget-Edittools-refToolbar.js
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
/** * SPDX-License-Identifier: CC-BY-SA-4.0 * _addText: '{{Gadget Header|title1=RefToolbar.js|license1=CC-BY-SA-4.0}}' * * @base {@link https://zh.wikipedia.org/wiki/MediaWiki:Gadget-refToolbar.js} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/modules/RefToolbar.ts} * @license CC-BY-SA-4.0 {@link https://www.qiuwenbaike.cn/wiki/H:CC-BY-SA-4.0} */ /** * SPDX-License-Identifier: CC-BY-SA-4.0 * _addText: '{{Gadget Header|title2=RefToolbarBase.js|license2=CC-BY-SA-4.0}}' * * @base {@link https://zh.wikipedia.org/wiki/MediaWiki:Gadget-refToolbarBase.js} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/modules/RefToolbarBase.js} * @license CC-BY-SA-4.0 {@link https://www.qiuwenbaike.cn/wiki/H:CC-BY-SA-4.0} */ /** * SPDX-License-Identifier: CC-BY-SA-4.0 * _addText: '{{Gadget Header|title3=RefToolbar.js (RefToolbar 2.0)|license3=CC-BY-SA-4.0}}' * * @base {@link https://zh.wikipedia.org/wiki/MediaWiki:RefToolbar.js} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/modules/RefToolbar2.0.js} * @license CC-BY-SA-4.0 {@link https://www.qiuwenbaike.cn/wiki/H:CC-BY-SA-4.0} */ /** * SPDX-License-Identifier: CC-BY-SA-4.0 * _addText: '{{Gadget Header|title3=RefToolBar messages|license3=CC-BY-SA-4.0}}' * * @base {@link https://zh.wikipedia.org/wiki/MediaWiki:RefToolbarMessages-zh-hans.js} * @base {@link https://zh.wikipedia.org/wiki/MediaWiki:RefToolbarMessages-zh-hant.js} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/modules/RefToolbarMessages.js} * @license CC-BY-SA-4.0 {@link https://www.qiuwenbaike.cn/wiki/H:CC-BY-SA-4.0} */ /** * SPDX-License-Identifier: CC-BY-SA-4.0 * _addText: '{{Gadget Header|title3=RefToolBar Config|license3=CC-BY-SA-4.0}}' * * @base {@link https://zh.wikipedia.org/wiki/MediaWiki:RefToolbarConfig.js} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/modules/RefToolbarConfig.js} * @license CC-BY-SA-4.0 {@link https://www.qiuwenbaike.cn/wiki/H:CC-BY-SA-4.0} */ /** * Ajax-loader * * @base {@link https://www.qiuwenbaike.cn/wiki/File:Ajax-loader.gif} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images} * @license Public Domain */ /** * SPDX-License-Identifier: MIT * * search-ltr-progressive Icon from OOjs UI * * @base {@link https://www.qiuwenbaike.cn/wiki/File:OOjs_UI_icon_search-ltr-progressive.svg} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images/search.svg} * @license MIT {@link https://github.com/wikimedia/oojs-ui/blob/master/LICENSE-MIT} */ /** * Copyright 2011-2022 OOUI Team and other contributors. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * SPDX-License-Identifier: MIT * * add-constructive Icon from OOjs UI * Modified from add-progressive Icon from OOjs UI by WaitSpring * * @base {@link https://www.qiuwenbaike.cn/wiki/File:OOjs_UI_icon_add-progressive.svg} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images/add.svg} * @license MIT {@link https://github.com/wikimedia/oojs-ui/blob/master/LICENSE-MIT} */ /** * Copyright 2011-2022 OOUI Team and other contributors. * Copyright 2024 WaitSpring. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * SPDX-License-Identifier: MIT * * calendar-ltr-progressive Icon from OOjs UI * * @base {@link https://www.qiuwenbaike.cn/wiki/File:OOjs_UI_icon_calendar-ltr-progressive.svg} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images/calendar.svg} * @license MIT {@link https://github.com/wikimedia/oojs-ui/blob/master/LICENSE-MIT} */ /** * Copyright 2011-2022 OOUI Team and other contributors. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * SPDX-License-Identifier: MIT * * citeArticle-ltr-progressive Icon from OOjs UI * * @base {@link https://www.qiuwenbaike.cn/wiki/File:OOjs_UI_icon_citeArticle-ltr-progressive.svg} * @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images/citeArticle.svg} * @license MIT {@link https://github.com/wikimedia/oojs-ui/blob/master/LICENSE-MIT} */ /** * Copyright 2011-2022 OOUI Team and other contributors. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * +------------------------------------------------------------+ * | === WARNING: GLOBAL GADGET FILE === | * +------------------------------------------------------------+ * | All changes should be made in the repository, | * | otherwise they will be lost. | * +------------------------------------------------------------+ * | Changes to this page may affect many users. | * | Please discuss changes by opening an issue before editing. | * +------------------------------------------------------------+ */ /* <nowiki> */ (() => { "use strict"; // dist/Edittools-refToolbar/Edittools-refToolbar.js //! src/Edittools-refToolbar/Edittools-refToolbar.ts var _templateObject; var _templateObject2; function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var n = 0, F = function() { }; return { s: F, n: function() { return n >= r.length ? { done: true } : { done: false, value: r[n++] }; }, e: function(r2) { throw r2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function() { t = t.call(r); }, n: function() { var r2 = t.next(); return a = r2.done, r2; }, e: function(r2) { u = true, o = r2; }, f: function() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } var import_ext_gadget2 = require("ext.gadget.Util"); //! src/Edittools-refToolbar/images/Ajax-loader.gif var Ajax_loader_default = "data:image/gif;base64,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"; //! src/Edittools-refToolbar/modules/util/api.ts var import_ext_gadget = require("ext.gadget.Util"); var api = (0, import_ext_gadget.initMwApi)("RefToolbar/2.0"); //! src/Edittools-refToolbar/modules/util/getMessage.ts var getMessage = (key, ...args) => { return args.length ? mw.message(key, ...args).parse() : mw.message(key).plain(); }; //! src/Edittools-refToolbar/images/citeArticle.svg var citeArticle_default = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M7 12h9v-1H7zm0 2h9v-1H7zm0 2h9v-1H7zm4-9H7v1h4zm0 2H7v1h4zm0-4H7v1h4zm5-2h2v16H8c-1.7 0-3-1.3-3-3V3h8v7l1.5-2 1.5 2z"/></svg>'; //! src/Edittools-refToolbar/modules/RefToolbarConfig.js var refToolbarConfig = () => { const { CiteTemplate } = window; CiteTB.Options = { "date format": "<year>-<zmonth>-<zdate>", "autodate fields": ["accessdate"], months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], modal: true, autoparse: true, expandtemplates: false }; new CiteTemplate("cite web", "web", [ // Basic fields { field: "author<N>", increment_group: "author_alt", increment_button: true }, { field: "title", autofillprop: "title" }, { field: "url", autofillid: "url" }, { field: "website", autofillprop: "journal" }, { field: "publisher", autofillprop: "publisher" }, { field: "accessdate" }, { field: "ref", tooltip: "cite-ref-tooltip" } ], [ // Expanded fields { field: "authorlink<N>", tooltip: "cite-authorlink-tooltip", increment_group: "authorlink", increment_button: true }, { field: "last<N>", autofillprop: "last-incr", increment_group: "author" }, { field: "first<N>", autofillprop: "first-incr", increment_group: "author", increment_button: true }, { field: "location" }, { field: "page", tooltip: "cite-page-tooltip" }, { field: "pages", autofillprop: "pages", tooltip: "cite-pages-tooltip" }, { field: "language", autofillprop: "language" }, { field: "format" }, { field: "doi", autofillid: "doi", autofillprop: "doi" }, { field: "date", autofillprop: "date" }, { field: "quote" } ]); new CiteTemplate("cite news", "news", [ // Basic fields { field: "author<N>", increment_group: "author_alt", increment_button: true }, { field: "title", autofillprop: "title" }, { field: "url", autofillid: "url" }, { field: "accessdate" }, { field: "work", tooltip: "cite-work-tooltip", autofillprop: "journal" }, { field: "agency" }, { field: "issue" }, { field: "publisher", autofillprop: "publisher" }, { field: "date", autofillprop: "date" }, { field: "ref", tooltip: "cite-ref-tooltip" } ], [ // Expanded fields { field: "authorlink<N>", tooltip: "cite-authorlink-tooltip", increment_group: "authorlink", increment_button: true }, { field: "last<N>", autofillprop: "last-incr", increment_group: "author" }, { field: "first<N>", autofillprop: "first-incr", increment_group: "author", increment_button: true }, { field: "location" }, { field: "page", tooltip: "cite-page-tooltip" }, { field: "pages", autofillprop: "pages", tooltip: "cite-pages-tooltip" }, { field: "language", autofillprop: "language" }, { field: "format" }, { field: "doi", autofillid: "doi", autofillprop: "doi" }, { field: "quote" } ]); new CiteTemplate("cite book", "book", [ // Basic fields { field: "author<N>", increment_group: "author_alt", increment_button: true }, { field: "coauthors", autofillprop: "coauthors" }, { field: "editor" }, { field: "title", autofillprop: "title" }, { field: "date", autofillprop: "year" }, { field: "publisher", autofillprop: "publisher" }, { field: "location", autofillprop: "location" }, { field: "isbn", /* "autofillid":"isbn", */ autofillprop: "isbn" }, { field: "page", tooltip: "cite-page-tooltip" }, { field: "pages", autofillprop: "pages", tooltip: "cite-pages-tooltip" }, { field: "edition", autofillprop: "edition" }, { field: "url", autofillid: "url" }, { field: "accessdate" }, { field: "ref", tooltip: "cite-ref-tooltip" } ], [ // Expanded fields { field: "last<N>", autofillprop: "last-incr", increment_group: "author" }, { field: "first<N>", autofillprop: "first-incr", increment_group: "author", increment_button: true }, { field: "authorlink<N>", tooltip: "cite-authorlink-tooltip", increment_group: "authorlink", increment_button: true }, { field: "editor<N>-last", increment_group: "editor" }, { field: "editor<N>-first", increment_group: "editor", increment_button: true }, { field: "editor<N>-link", increment_group: "editorlink", increment_button: true }, { field: "language", autofillprop: "language" }, { field: "format" }, { field: "chapter", autofillprop: "chapter" }, { field: "quote" } ]); new CiteTemplate("cite journal", "journal", [ // Basic fields { field: "author<N>", increment_group: "author_alt", increment_button: true }, { field: "coauthors", autofillprop: "coauthors" }, { field: "title", autofillprop: "title" }, { field: "journal", autofillprop: "journal" }, { field: "date", autofillprop: "date" }, { field: "volume", autofillprop: "volume" }, { field: "issue", autofillprop: "issue" }, { field: "page", tooltip: "cite-page-tooltip" }, { field: "pages", autofillprop: "pages", tooltip: "cite-pages-tooltip" }, { field: "doi", autofillid: "doi", autofillprop: "doi" }, { field: "pmid", autofillid: "pmid" }, { field: "url", autofillid: "url" }, { field: "accessdate" }, { field: "ref", tooltip: "cite-ref-tooltip" } ], [ // Expanded fields { field: "authorlink<N>", tooltip: "cite-authorlink-tooltip", increment_group: "authorlink", increment_button: true }, { field: "last<N>", autofillprop: "last-incr", increment_group: "author" }, { field: "first<N>", autofillprop: "first-incr", increment_group: "author", increment_button: true }, { field: "editor<N>-last", increment_group: "editor" }, { field: "editor<N>-first", increment_group: "editor", increment_button: true }, { field: "editor<N>-link", increment_group: "editorlink", increment_button: true }, { field: "series" }, { field: "at", tooltip: "cite-at-tooltip" }, { field: "trans-title" }, { field: "publisher", autofillprop: "publisher" }, { field: "location" }, { field: "language", autofillprop: "language" }, { field: "format" }, { field: "issn", autofillprop: "issn" }, { field: "pmc" }, { field: "oclc" }, { field: "bibcode" }, { field: "id" }, { field: "quote" }, { field: "postscript", tooltip: "cite-postscript-tooltip" } ]); new CiteTemplate("cite conference", "conference", [ // Basic fields { field: "author", autofillprop: "author1" }, { field: "coauthors", autofillprop: "coauthors" }, { field: "title", autofillprop: "title" }, { field: "conference" }, { field: "conferenceurl" }, { field: "booktitle", autofillprop: "journal" }, { field: "date", autofillprop: "date" }, { field: "year" }, { field: "month" }, { field: "volume", autofillprop: "volume" }, { field: "publisher", autofillprop: "publisher" }, { field: "location", autofillprop: "location" }, { field: "isbn" }, { field: "pages" }, { field: "doi", autofillid: "doi", autofillprop: "doi" }, { field: "pmid", autofillid: "pmid" }, { field: "url", autofillid: "url" }, { field: "accessdate", tooltip: "cite-accessdate-tooltip" } ], [ // Expanded fields { field: "last", autofillprop: "last1" }, { field: "first", autofillprop: "first1" }, { field: "authorlink", tooltip: "cite-authorlink-tooltip" }, { field: "editor" }, { field: "others" }, { field: "edition", autofillprop: "edition" }, { field: "language", autofillprop: "language" }, { field: "format" }, { field: "issn" }, { field: "oclc" }, { field: "id", tooltip: "cite-id-tooltip" }, { field: "quote" } ]); new CiteTemplate("cite encyclopedia", "encyclopedia", [ // Basic fields { field: "author", autofillprop: "author1" }, { field: "title" }, { field: "editor" }, { field: "encyclopedia", autofillprop: "title" }, { field: "volume" }, { field: "year", autofillprop: "year" }, { field: "publisher", autofillprop: "publisher" }, { field: "location", autofillprop: "location" }, { field: "isbn" }, { field: "pages" }, { field: "url" } ], [ // Expanded fields { field: "last", autofillprop: "last1" }, { field: "first", autofillprop: "first1" }, { field: "authorlink", tooltip: "cite-authorlink-tooltip" }, { field: "coauthors", autofillprop: "coauthors" }, { field: "others" }, { field: "edition", autofillprop: "edition" }, { field: "oclc" }, { field: "id", tooltip: "cite-id-tooltip" }, { field: "accessdate", tooltip: "cite-accessdate-tooltip" }, { field: "language", autofillprop: "language" }, { field: "format" }, { field: "date" }, { field: "month" }, { field: "quote" } ]); CiteTB.init(); }; //! src/Edittools-refToolbar/modules/RefToolbar2.0.js var refToolbar2 = ($body) => { CiteTB.DefaultOptions = { "date format": "<year>-<zmonth>-<zdate>", "autodate fields": [], months: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], modal: true, autoparse: false, expandtemplates: false }; CiteTB.getOption = (opt) => { if (CiteTB.UserOptions[opt] !== void 0) { return CiteTB.UserOptions[opt]; } else if (CiteTB.Options[opt] !== void 0) { return CiteTB.Options[opt]; } return CiteTB.DefaultOptions[opt]; }; CiteTB.init = () => { var _$$width2; $(document).find("head").trigger("reftoolbarbase"); const $target = $body.find("textarea[name=wpTextbox1]"); const temlist = {}; for (const t in CiteTB.Templates) { if (Object.hasOwn(CiteTB.Templates, t)) { var _$$width; const tem = CiteTB.Templates[t]; const sform = CiteTB.escStr(tem.shortform); const actionobj = { type: "dialog", module: "cite-dialog-".concat(sform) }; const dialogobj = {}; dialogobj["cite-dialog-".concat(sform)] = { resizeme: false, title: mw.message("cite-dialog-".concat(sform)).parse(), id: "citetoolbar-".concat(sform), init: () => { }, html: tem.getInitial(), dialog: { width: Math.round((_$$width = $(window).width()) !== null && _$$width !== void 0 ? _$$width : 0 * 0.8), open() { $(this).html(CiteTB.getOpenTemplate().getForm()); $body.find(".cite-prev-parse").on("click", (e) => { e.preventDefault(); CiteTB.prevParseClick(); }); }, buttons: { "cite-form-submit"() { const ref = CiteTB.getRef(false, true); $(this).dialog("close"); $.wikiEditor.modules.toolbar.fn.doAction($(this).data("context"), { type: "encapsulate", options: { post: ref } }, $(this)); }, "cite-form-showhide": CiteTB.showHideExtra, "cite-refpreview"() { const ref = CiteTB.getRef(false, false); const template = CiteTB.getOpenTemplate(); const div = $("#citetoolbar-".concat(CiteTB.escStr(template.shortform))); div.find(".cite-preview-label").show(); div.find(".cite-ref-preview").text(ref).show(); if (CiteTB.getOption("autoparse")) { CiteTB.prevParseClick(); } else { div.find(".cite-prev-parse").show(); div.find(".cite-prev-parsed-label").hide(); div.find(".cite-preview-parsed").html(""); } }, "wikieditor-toolbar-tool-link-cancel"() { $(this).dialog("close"); }, "cite-form-reset"() { CiteTB.resetForm(); } } } }; try { $target.wikiEditor("addDialog", dialogobj); } catch (e) { } temlist[sform] = { label: tem.templatename, action: actionobj }; } } const refsection = { sections: { cites: { type: "toolbar", label: getMessage("cite-section-label"), groups: { template: { tools: { template: { type: "select", label: getMessage("cite-template-list"), list: temlist } } }, namedrefs: { label: getMessage("cite-named-refs-label"), tools: { nrefs: { type: "button", action: { type: "dialog", module: "cite-toolbar-namedrefs" }, icon: "data:image/svg+xml,".concat(encodeURIComponent(citeArticle_default)), section: "cites", group: "namedrefs", label: getMessage("cite-named-refs-button") } } } } } } }; const defaultdialogs = { "cite-toolbar-namedrefs": { title: mw.message("cite-named-refs-title").parse(), resizeme: false, id: "citetoolbar-namedrefs", html: '<div id="cite-namedref-loading"> <img src="'.concat(Ajax_loader_default, '" /> ').concat(getMessage("cite-loading"), "</div>"), init: () => { }, dialog: { width: Math.round((_$$width2 = $(window).width()) !== null && _$$width2 !== void 0 ? _$$width2 : 0 * 0.8), open() { CiteTB.loadRefs(); }, buttons: { "cite-form-submit"() { const refname = $body.find("#cite-namedref-select").val(); if (refname === "") { return; } $(this).dialog("close"); $.wikiEditor.modules.toolbar.fn.doAction($(this).data("context"), { type: "encapsulate", options: { post: CiteTB.getNamedRef(refname, true) } }, $(this)); }, "wikieditor-toolbar-tool-link-cancel"() { $(this).dialog("close"); } } } } }; try { $target.wikiEditor("addDialog", defaultdialogs); } catch (e) { } $body.find("#citetoolbar-namedrefs").off("dialogopen"); if (!CiteTB.getOption("modal")) { mw.util.addCSS(".ui-widget-overlay{display:none !important}"); } try { $target.wikiEditor("addToToolbar", refsection); } catch (e) { } }; CiteTB.mainRefList = []; CiteTB.refsLoaded = false; CiteTB.getRef = (inneronly, forinsert) => { let i, j, g, group; const template = CiteTB.getOpenTemplate(); const { templatename } = template; let res = ""; const refobj = { shorttag: false }; if (!inneronly) { group = $("#cite-".concat(CiteTB.escStr(template.shortform), "-group")).val(); let refname = $("#cite-".concat(CiteTB.escStr(template.shortform), "-name")).val(); res += "<ref"; if (refname) { refname = String(refname).trim(); res += " name=".concat(CiteTB.getQuotedString(refname)); refobj.refname = refname; } if (group) { group = String(group).trim(); res += " group=".concat(CiteTB.getQuotedString(group)); refobj.refgroup = group; } res += ">"; } let content = "{{".concat(templatename); for (g in template.incrementables) { if (Object.hasOwn(template.incrementables, g)) { group = template.incrementables[g]; for (i = 1; i <= group.val; i++) { for (j = 0; j < group.fields.length; j++) { const fieldname = group.fields[j].field; const fieldid = fieldname.replace("<N>", i.toString()); const field = $("#cite-".concat(CiteTB.escStr(template.shortform), "-").concat(fieldid)).val(); if (field) { content += " |".concat(fieldid, "="); content += String(field).trim(); } } } } } for (i = 0; i < template.basic.length; i++) { if (template.basic[i].increment_group) { continue; } const fieldname = template.basic[i].field; const field = $("#cite-".concat(CiteTB.escStr(template.shortform), "-").concat(fieldname)).val(); if (field) { content += " |".concat(fieldname, "="); content += String(field).trim(); } } if ($body.find("#cite-form-status").val() !== "closed") { for (i = 0; i < template.extra.length; i++) { if (template.extra[i].increment_group) { continue; } const fieldname = template.extra[i].field; const field = $("#cite-".concat(CiteTB.escStr(template.shortform), "-").concat(fieldname)).val(); if (field) { content += " |".concat(fieldname, "="); content += String(field).trim(); } } } content += "}}"; res += content; refobj.content = content; if (!inneronly) { res += "</ref>"; } if (forinsert) { CiteTB.mainRefList.push(refobj); } return res; }; CiteTB.getNamedRef = (refname, forinsert) => { if (forinsert) { CiteTB.mainRefList.push({ shorttag: true, refname }); } return "<ref name=".concat(CiteTB.getQuotedString(refname), " />"); }; CiteTB.loadRefs = () => { if (CiteTB.refsLoaded) { return; } CiteTB.getPageText(CiteTB.loadRefsInternal); }; CiteTB.loadRefsInternal = (text) => { const refsregex = /< *ref(?: +(name|group) *= *(?:"([^"]*?)"|'([^']*?)'|([^ '"/>]*?)) *)? *(?: +(name|group) *= *(?:"([^"]*?)"|'([^']*?)'|([^ '"/>]*?)) *)? *(?:\/ *>|>((?:.|\n)*?)< *\/ *ref *>)/gim; while (true) { const ref = refsregex.exec(text); if (ref === null) { break; } const refobj = {}; if (ref[9]) { [, , , , , , , , , refobj.content] = ref; refobj.shorttag = false; } else { refobj.shorttag = true; } if (ref[1] !== "") { if (ref[2]) { [, , refobj["ref".concat(ref[1])]] = ref; } else if (ref[3]) { [, , , refobj["ref".concat(ref[1])]] = ref; } else { [, , , , refobj["ref".concat(ref[1])]] = ref; } } if (ref[5] !== "") { if (ref[6]) { [, , , , , , refobj["ref".concat(ref[5])]] = ref; } else if (ref[7]) { [, , , , , , , refobj["ref".concat(ref[5])]] = ref; } else { [, , , , , , , , refobj["ref".concat(ref[5])]] = ref; } } CiteTB.mainRefList.push(refobj); } CiteTB.refsLoaded = true; CiteTB.setupNamedRefs(); }; CiteTB.parse = (text, callback) => { const postdata = { action: "parse", title: mw.config.get("wgPageName"), text, prop: "text", format: "json", formatversion: "2" }; api.get(postdata).then(({ parse }) => { const html = parse.text; callback(html); }); }; CiteTB.expandtemplates = (text, callback) => { const postdata = { action: "expandtemplates", title: mw.config.get("wgPageName"), text, format: "json", formatversion: "2" }; api.get(postdata).then(({ expandtemplates }) => { const restext = expandtemplates.wikitext; callback(restext); }); }; CiteTB.getPageText = (callback) => { const section = $body.find("input[name=wpSection]").val(); if (section === "") { if (CiteTB.getOption("expandtemplates")) { CiteTB.expandtemplates($body.find("textarea[name=wpTextbox1]").wikiEditor("getContents").text(), callback); } else { callback($body.find("textarea[name=wpTextbox1]").wikiEditor("getContents").text()); } } else { const { wgArticleId } = mw.config.get(); const postdata = { action: "query", prop: "revisions", rvprop: "content", rvslots: "main", pageids: wgArticleId, format: "json", formatversion: "2" }; if (CiteTB.getOption("expandtemplates")) { postdata.rvexpandtemplates = "1"; } api.get(postdata).then(({ query }) => { const pagetext = query.pages[0].revisions[0].slots.main.content; callback(pagetext); }); } }; CiteTB.safeDecodeURIComponent = (s) => { try { s = decodeURIComponent(s); } catch (e) { } return s; }; CiteTB.initAutofill = function() { var _$$attr; const elemid = (_$$attr = $(this).attr("id")) !== null && _$$attr !== void 0 ? _$$attr : ""; const res = /^cite-auto-(.*?)-(.*)-(.*)$/.exec(elemid); if (!res) { return false; } const [, tem, field, autotype] = res; let id = $("#cite-".concat(tem, "-").concat(field)).val(); if (!id) { return false; } let url = "https://citoid.qiuwen.net.cn/lookup.php?"; id = CiteTB.safeDecodeURIComponent(id); url += "".concat(autotype, "=").concat(encodeURIComponent(id)); url += "&template=".concat(encodeURIComponent(tem)); const s = document.createElement("script"); s.setAttribute("src", url); s.setAttribute("type", "text/javascript"); document.head.append(s); return false; }; CiteTB.autoFill = (data, template, type) => { const cl = "cite-".concat(template, "-"); let i, j; let coauthors; $(".".concat(cl, "title")).val(data.title); if (data.authors && data.authors.length > 0) { if ($(".".concat(cl, "last-incr-1")).length > 0) { var _$$eq$attr; const classes = (_$$eq$attr = $(".".concat(cl, "last-incr-1")).eq(0).attr("class")) === null || _$$eq$attr === void 0 ? void 0 : _$$eq$attr.split(/\s+/); if (!classes) { return; } let group = false; const patt = /cite-[^-]*?-incr-(.*)/; var _iterator = _createForOfIteratorHelper(classes), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done; ) { const class_ = _step.value; if (patt.exec(class_)) { [, group] = patt.exec(class_); break; } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } $(".".concat(cl, "last-incr-1")).val(data.authors[0][0]); $(".".concat(cl, "first-incr-1")).val(data.authors[0][1]); const elemid = "#cite-incr-".concat(template, "-").concat(group); for (i = 2; i < data.authors.length + 1; i++) { $(elemid).trigger("click"); $(".".concat(cl, "last-incr-").concat(i.toString())).val(data.authors[i - 1][0]); $(".".concat(cl, "first-incr-").concat(i.toString())).val(data.authors[i - 1][1]); } } else if ($(".".concat(cl, "author-incr-1")).length > 0) { var _$$eq$attr2; const classes = (_$$eq$attr2 = $(".".concat(cl, "author-incr-1")).eq(0).attr("class")) === null || _$$eq$attr2 === void 0 ? void 0 : _$$eq$attr2.split(/\s+/); if (!classes) { return; } let group = false; const patt = /cite-[^-]*?-incr-(.*)/; var _iterator2 = _createForOfIteratorHelper(classes), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) { const class_ = _step2.value; if (patt.exec(class_)) { [, group] = patt.exec(class_); break; } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } $(".".concat(cl, "author-incr-1")).val(data.authors[0].join(", ")); const elemid = "#cite-incr-".concat(template, "-").concat(group); for (i = 2; i < data.authors.length + 1; i++) { $(elemid).trigger("click"); $(".".concat(cl, "author-incr-").concat(i.toString())).val(data.authors[i - 1].join(", ")); } } else if ($(".".concat(cl, "last1")).length > 0) { for (i = 0; data.authors && i < data.authors.length; i++) { if ($(".".concat(cl, "last").concat(i + 1)).length) { $(".".concat(cl, "last").concat(i + 1)).val(data.authors[i][0]); $(".".concat(cl, "first").concat(i + 1)).val(data.authors[i][1]); } else { coauthors = []; for (j = i; j < data.authors.length; j++) { coauthors.push(data.authors[j].join(", ")); } $(".".concat(cl, "coauthors")).val(coauthors.join("; ")); break; } } } else if ($(".".concat(cl, "author1")).length === 0) { const authors = []; for (i = 0; data.authors && i < data.authors.length; i++) { authors.push(data.authors[i].join(", ")); } $(".".concat(cl, "authors")).val(authors.join("; ")); } else { for (i = 0; data.authors && i < data.authors.length; i++) { if ($(".".concat(cl, "author").concat(i + 1)).length) { $(".".concat(cl, "author").concat(i + 1)).val(data.authors[i].join(", ")); } else { coauthors = []; for (j = i; j < data.authors.length; j++) { coauthors.push(data.authors[j].join(", ")); } $(".".concat(cl, "coauthors")).val(coauthors.join("; ")); break; } } } } if (data.date) { try { const DT = new Date(data.date); if (/^\d{4}-\d{2}(-XX)?$/i.test(data.date)) { data.date = data.date.replace("-XX", ""); $(".".concat(cl, "date")).val(CiteTB.formatDate(DT, false, true)); } else if (/^\d{4}-\d{2}-\d{2}?/i.test(data.date)) { $(".".concat(cl, "date")).val(CiteTB.formatDate(DT, true, true)); } else { $(".".concat(cl, "date")).val(data.date); } } catch (e) { } } else { $(".".concat(cl, "date")).val(data.date); } switch (type) { case "pmid": case "doi": $(".".concat(cl, "journal")).val(data.journal); $(".".concat(cl, "volume")).val(data.volume); $(".".concat(cl, "issue")).val(data.issue); $(".".concat(cl, "pages")).val(data.pages); if (type === "pmid" && data.doi) { $(".".concat(cl, "doi")).val(data.doi); } break; case "isbn": $(".".concat(cl, "publisher")).val(data.publisher); $(".".concat(cl, "location")).val(data.location); $(".".concat(cl, "edition")).val(data.edition); break; case "url": $(".".concat(cl, "journal")).val(data.journal); $(".".concat(cl, "volume")).val(data.volume); $(".".concat(cl, "issue")).val(data.issue); $(".".concat(cl, "pages")).val(data.pages); $(".".concat(cl, "publisher")).val(data.publisher); $(".".concat(cl, "edition")).val(data.edition); $(".".concat(cl, "isbn")).val(data.isbn); $(".".concat(cl, "issn")).val(data.issn); $(".".concat(cl, "doi")).val(data.doi); if (data.language && data.language !== "en-US" && data.language !== "en-GB") { $(".".concat(cl, "language")).val(data.language); } $(".".concat(cl, "chapter")).val(data.chapter); break; } }; CiteTB.incrementFields = function() { var _$$attr2; const template = CiteTB.getOpenTemplate(); const [currentrow] = $(this).parents("tr"); $(this).prev().css("width", "100%"); $(this).detach(); const elemid = (_$$attr2 = $(this).attr("id")) !== null && _$$attr2 !== void 0 ? _$$attr2 : ""; const res = /^cite-incr-(.*?)-(.*)$/.exec(elemid); if (!res) { return; } const [, , group] = res; const increments = template.incrementables[group]; const { fields } = increments; template.incrementables[group].val += 1; const trs = template.makeFormInner(fields, false); trs.reverse(); var _iterator3 = _createForOfIteratorHelper(trs), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) { const tr = _step3.value; $(currentrow).after(tr); } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } }; CiteTB.fillAccessdate = function() { var _$$attr3; const elemid = (_$$attr3 = $(this).attr("id")) !== null && _$$attr3 !== void 0 ? _$$attr3 : ""; const res = /^cite-date-(.*?)-(.*)$/.exec(elemid); const [, id] = res; if (!res) { return; } const [, , field] = res; const DT = /* @__PURE__ */ new Date(); const datestr = CiteTB.formatDate(DT); $("#cite-".concat(id, "-").concat(field)).val(datestr); return false; }; CiteTB.formatDate = (DT, useday, usemonth) => { if (useday === void 0) { useday = true; } if (usemonth === void 0) { usemonth = true; } let datestr = CiteTB.getOption("date format"); let zmonth = ""; let month = DT.getUTCMonth() + 1; if (month < 10) { zmonth = "0".concat(month.toString()); } else { zmonth = month.toString(); } month = month.toString(); let zdate = ""; let date = DT.getUTCDate(); if (date < 10) { zdate = "0".concat(date.toString()); } else { zdate = date.toString(); } date = date.toString(); if (useday) { datestr = datestr.replace("<date>", date); datestr = datestr.replace("<zdate>", zdate); } else { datestr = datestr.replace("<date>", ""); datestr = datestr.replace("<zdate>", ""); } if (usemonth) { datestr = datestr.replace("<month>", month); datestr = datestr.replace("<zmonth>", zmonth); datestr = datestr.replace("<monthname>", CiteTB.getOption("months")[DT.getUTCMonth()]); } else { datestr = datestr.replace("<month>", ""); datestr = datestr.replace("<zmonth>", ""); datestr = datestr.replace("<monthname>", ""); } datestr = datestr.replace("<year>", DT.getUTCFullYear().toString()); return datestr.replace(/^[ /\-,.]*(.*?)[ /\-,.]*$/g, "$1"); }; CiteTB.setupNamedRefs = () => { const names = []; let i; for (i = 0; i < CiteTB.mainRefList.length; i++) { if (!CiteTB.mainRefList[i].shorttag && CiteTB.mainRefList[i].refname) { names.push(CiteTB.mainRefList[i]); } } const stuff = $("<div>"); $body.find("#citetoolbar-namedrefs").html(stuff); if (names.length === 0) { stuff.html(getMessage("cite-no-namedrefs")); } else { stuff.html(getMessage("cite-namedrefs-intro")); const select = $("<select>").attr("id", "cite-namedref-select"); select.append($("<option>").attr("value", "").text(getMessage("cite-named-refs-dropdown"))); for (i = 0; i < names.length; i++) { select.append($("<option>").text(names[i].refname)); } stuff.after(select); select.before("<br>"); const prevlabel = $("<div>").attr("id", "cite-nref-preview-label").css("display", "none").html(getMessage("cite-raw-preview")); select.after(prevlabel); prevlabel.before("<br><br>"); prevlabel.after('<div id="cite-namedref-preview" style="padding:0.5em; font-size:110%" />'); const parselabel = $("<span>").attr("id", "cite-parsed-label").css("display", "none").html(getMessage("cite-parsed-label")); $body.find("#cite-namedref-preview").after(parselabel); parselabel.after('<div id="cite-namedref-parsed" style="padding-bottom:0.5em; font-size:110%" />'); const link = $("<a>").attr({ href: "#", id: "cite-nref-parse" }).css({ margin: "0 1em 0 1em", display: "none", color: "#00008b" }); link.html(getMessage("cite-form-parse")); $body.find("#cite-namedref-parsed").after(link); $body.find("#cite-namedref-select").on("change", CiteTB.namedRefSelectClick); $body.find("#cite-nref-parse").on("click", CiteTB.nrefParseClick); } }; CiteTB.fillNrefPreview = (parsed) => { $body.find("#cite-parsed-label").show(); $body.find("#cite-namedref-parsed").html(parsed); }; CiteTB.nrefParseClick = () => { const choice = $body.find("#cite-namedref-select").val(); if (choice === "") { $body.find("#cite-parsed-label").hide(); $body.find("#cite-namedref-parsed").text(""); return false; } $body.find("#cite-nref-parse").hide(); var _iterator4 = _createForOfIteratorHelper(CiteTB.mainRefList), _step4; try { for (_iterator4.s(); !(_step4 = _iterator4.n()).done; ) { const ref = _step4.value; if (!ref.shorttag && ref.refname === choice) { CiteTB.parse(ref.content, CiteTB.fillNrefPreview); return false; } } } catch (err) { _iterator4.e(err); } finally { _iterator4.f(); } }; CiteTB.lastnamedrefchoice = ""; CiteTB.namedRefSelectClick = () => { const choice = $body.find("#cite-namedref-select").val(); if (CiteTB.lastnamedrefchoice === choice) { return; } CiteTB.lastnamedrefchoice = choice; $body.find("#cite-parsed-label").hide(); $body.find("#cite-namedref-parsed").text(""); if (choice === "") { $body.find("#cite-nref-preview-label").hide(); $body.find("#cite-namedref-preview").text(""); $body.find("#cite-nref-parse").hide(); return; } var _iterator5 = _createForOfIteratorHelper(CiteTB.mainRefList), _step5; try { for (_iterator5.s(); !(_step5 = _iterator5.n()).done; ) { const ref = _step5.value; if (!ref.shorttag && ref.refname === choice) { $body.find("#cite-nref-preview-label").show(); $body.find("#cite-namedref-preview").text(ref.content); if (CiteTB.getOption("autoparse")) { CiteTB.nrefParseClick(); } else { $body.find("#cite-nref-parse").show(); } } } } catch (err) { _iterator5.e(err); } finally { _iterator5.f(); } }; CiteTB.fillTemplatePreview = (text) => { const template = CiteTB.getOpenTemplate(); const div = $("#citetoolbar-".concat(CiteTB.escStr(template.shortform))); div.find(".cite-prev-parsed-label").show(); div.find(".cite-preview-parsed").html(text); }; CiteTB.prevParseClick = () => { const ref = CiteTB.getRef(true, false); const template = CiteTB.getOpenTemplate(); const div = $("#citetoolbar-".concat(CiteTB.escStr(template.shortform))); div.find(".cite-prev-parse").hide(); CiteTB.parse(ref, CiteTB.fillTemplatePreview); }; CiteTB.showHideExtra = () => { const template = CiteTB.getOpenTemplate(); const div = $("#citetoolbar-".concat(CiteTB.escStr(template.shortform))); const setting = div.find(".cite-form-status").val(); if (setting === "closed") { div.find(".cite-form-status").val("open"); div.find(".cite-extra-fields").show(1, () => { div.find(".cite-extra-fields").css({ width: "100%", "background-color": "transparent" }); }); } else { div.find(".cite-form-status").val("closed"); div.find(".cite-extra-fields").hide(); } }; CiteTB.resetForm = () => { const template = CiteTB.getOpenTemplate(); const div = $("#citetoolbar-".concat(CiteTB.escStr(template.shortform))); div.html(template.getForm()); }; CiteTB.getQuotedString = (s) => { const sq = /'/.test(s); const dq = /"/.test(s); if (!sq && !dq) { return '"'.concat(s, '"'); } else if (!dq) { return '"'.concat(s, '"'); } else if (!sq) { return "'".concat(s, "'"); } s = s.replace(/"/g, "'"); return '"'.concat(s, '"'); }; CiteTB.fixStr = (s) => { s = s.slice(0, 1).toUpperCase() + s.slice(1); s = s.replace("_", " "); return s; }; CiteTB.escStr = (s) => { return s.replace(/\s/g, "-").replace(/'/g, String.raw(_templateObject || (_templateObject = _taggedTemplateLiteral(["'"], ["\\'"])))).replace(/"/g, String.raw(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(['"'], ['\\"'])))); }; CiteTB.getOpenTemplate = () => { const dialogs = $body.find(".ui-dialog-content.ui-widget-content:visible"); const templatename = $(dialogs[0]).find(".cite-template").val(); return CiteTB.Templates[templatename]; }; refToolbarConfig(); }; //! src/Edittools-refToolbar/Edittools-refToolbar.module.less var citeFormTd = "Edittools-refToolbar-module__citeFormTd_tYurZa__4100"; //! src/Edittools-refToolbar/images/add.svg var add_default = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="#00af89" d="M16 9h-5V4H9v5H4v2h5v5h2v-5h5z"/></svg>'; //! src/Edittools-refToolbar/images/calendar.svg var calendar_default = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="#36c" d="M16.4 4.4H14V2.8h-1.6v1.6H7.6V2.8H6v1.6H3.6A1.6 1.6 0 0 0 2 6v9.6a1.6 1.6 0 0 0 1.6 1.6h12.8a1.6 1.6 0 0 0 1.6-1.6V6a1.6 1.6 0 0 0-1.6-1.6m0 11.2H3.6V8.4h12.8Zm-1.6-4.8h-3.2V14h3.2z"/></svg>'; //! src/Edittools-refToolbar/images/search.svg var search_default = '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><path fill="#36c" d="m18.5 16.61-4.865-4.863a6.612 6.612 0 1 0-1.888 1.888L16.61 18.5ZM3.858 8.11a4.25 4.25 0 1 1 4.25 4.25 4.25 4.25 0 0 1-4.25-4.25"/></svg>'; //! src/Edittools-refToolbar/modules/RefToolbarBase.js var refToolbarBase = () => { var _window; (_window = window).CiteTB || (_window.CiteTB = { Templates: {}, // All templates Options: {}, // Global options UserOptions: {}, // User options DefaultOptions: {} // Script defaults }); window.CiteTemplate = class CiteTemplate { constructor(templatename, shortform, basicfields, expandedfields) { this.templatename = templatename; this.shortform = shortform; this.basic = basicfields; this.extra = expandedfields; this.incrementables = {}; CiteTB.Templates[this.templatename] = this; } makeFormInner(fields, incrsetup) { const trs = []; const autofills = []; let tr; var _iterator6 = _createForOfIteratorHelper(fields.entries()), _step6; try { for (_iterator6.s(); !(_step6 = _iterator6.n()).done; ) { const [i, fieldobj] = _step6.value; let { field } = fieldobj; let labelfield = fieldobj.field; let ad = false; let im; if (incrsetup && fieldobj.increment_group) { field = fieldobj.field.replace("<N>", "1"); labelfield = fieldobj.field.replace("<N>", ""); if (this.incrementables[fieldobj.increment_group] && !this.incrementables[fieldobj.increment_group].setup) { this.incrementables[fieldobj.increment_group].fields.push(fieldobj); } else if (!this.incrementables[fieldobj.increment_group]) { this.incrementables[fieldobj.increment_group] = { fields: [fieldobj], val: 1, setup: false }; } else if (this.incrementables[fieldobj.increment_group] && this.incrementables[fieldobj.increment_group].setup) { this.incrementables[fieldobj.increment_group].val = 1; } } else if (fieldobj.increment_group) { const incrval = this.incrementables[fieldobj.increment_group].val; field = fieldobj.field.replace("<N>", incrval.toString()); labelfield = fieldobj.field.replace("<N>", ""); } const autodateFields = CiteTB.getOption("autodate fields"); if (autodateFields.includes(field)) { im = $("<img>").attr("src", "data:image/svg+xml,".concat(encodeURIComponent(calendar_default))); im.attr("alt", getMessage("cite-insert-date")).attr("title", getMessage("cite-insert-date")); ad = $("<a>").attr("href", "#"); ad.append(im); ad.attr("id", "cite-date-".concat(CiteTB.escStr(this.shortform), "-").concat(field)); $(document).on("click", "#cite-date-".concat(CiteTB.escStr(this.shortform), "-").concat(field), CiteTB.fillAccessdate); } if (fieldobj.autofillid) { const autotype = fieldobj.autofillid; im = $("<img>").attr("src", "data:image/svg+xml,".concat(encodeURIComponent(search_default))); im.attr("alt", getMessage("cite-autofill-alt")).attr("title", getMessage("cite-autofill-alt")); ad = $("<a>").attr("href", "#"); ad.append(im); ad.attr("id", "cite-auto-".concat(CiteTB.escStr(this.shortform), "-").concat(field, "-").concat(autotype)); autofills.push("#cite-auto-".concat(CiteTB.escStr(this.shortform), "-").concat(field, "-").concat(autotype)); } if (fieldobj.increment_button) { const incrtype = fieldobj.increment_group; im = $("<img>").attr("src", "data:image/svg+xml,".concat(encodeURIComponent(add_default))); im.attr("alt", getMessage("cite-increment-alt")).attr("title", getMessage("cite-increment-alt")); ad = $("<a>").attr("href", "#"); ad.append(im); ad.attr("id", "cite-incr-".concat(CiteTB.escStr(this.shortform), "-").concat(incrtype)); } let display = getMessage("cite-".concat(labelfield, "-label")); if (typeof display !== "string") { display = fieldobj.label ? CiteTB.fixStr(fieldobj.label) : CiteTB.fixStr(labelfield); } const tooltip = fieldobj.tooltip ? $("<abbr>").attr("title", getMessage(fieldobj.tooltip)).html($("<sup>").text("?")) : false; let input = ""; input = $("<input>").attr({ tabindex: "1", style: ad ? "width: 85%" : "width: 100%", type: "text" }); input.attr("id", "cite-".concat(CiteTB.escStr(this.shortform), "-").concat(field)); if (fieldobj.autofillprop) { let classname = "cite-".concat(CiteTB.escStr(this.shortform), "-").concat(fieldobj.autofillprop); if (fieldobj.increment_group) { input.addClass("cite-".concat(CiteTB.escStr(this.shortform), "-incr-").concat(fieldobj.increment_group)); classname += "-".concat(this.incrementables[fieldobj.increment_group].val.toString()); } input.addClass(classname); } const label = $("<label>"); label.attr("for", "cite-".concat(CiteTB.escStr(this.shortform), "-").concat(field)).text(display); if (tooltip) { label.append(tooltip); } let style = "text-align: right; width: 20%;"; if (i % 2 === 1) { style += " padding-left: 1em;"; } else { tr = $("<tr>"); } const td1 = $("<td>").addClass(citeFormTd).attr({ style }); td1.append(label); tr.append(td1); const td2 = $("<td>").addClass(citeFormTd).css("width", "30%"); td2.append(input); if (ad) { td2.append(ad); } tr.append(td2); if (i % 2 === 0) { trs.push(tr); } } } catch (err) { _iterator6.e(err); } finally { _iterator6.f(); } let needsetup = false; for (const g in this.incrementables) { if (!this.incrementables[g].setup) { needsetup = true; $(document).on("click", "#cite-incr-".concat(CiteTB.escStr(this.shortform), "-").concat(g), CiteTB.incrementFields); this.incrementables[g].setup = true; } } if (needsetup || Object.keys(this.incrementables).length === 0) { var _iterator7 = _createForOfIteratorHelper(autofills), _step7; try { for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) { const autofill = _step7.value; $(document).on("click", autofill, CiteTB.initAutofill); } } catch (err) { _iterator7.e(err); } finally { _iterator7.f(); } } return trs; } // gives a little bit of HTML so the open form can be identified getInitial() { const hidden = $("<input>").addClass("cite-template").attr({ type: "hidden", value: this.templatename }); return hidden; } // makes the form used in the dialog boxes getForm() { const main = $("<div>").addClass("cite-form-container"); const form1 = $("<table>").addClass("cite-basic-fields").css({ width: "100%", "background-color": "transparent" }); let trs = this.makeFormInner(this.basic, true); var _iterator8 = _createForOfIteratorHelper(trs), _step8; try { for (_iterator8.s(); !(_step8 = _iterator8.n()).done; ) { const tr = _step8.value; form1.append(tr); } } catch (err) { _iterator8.e(err); } finally { _iterator8.f(); } const form2 = $("<table>").addClass("cite-extra-fields").css({ width: "100%", "background-color": "transparent", display: "none" }); trs = this.makeFormInner(this.extra, true); var _iterator9 = _createForOfIteratorHelper(trs), _step9; try { for (_iterator9.s(); !(_step9 = _iterator9.n()).done; ) { const tr = _step9.value; form2.append(tr); } } catch (err) { _iterator9.e(err); } finally { _iterator9.f(); } main.append(form1).append(form2); const form3 = $("<table>").addClass("cite-other-fields").css({ width: "100%", "background-color": "transparent", "padding-top": "1em" }); const $tr = $("<tr>"); const $td1 = $("<td>").addClass(citeFormTd).css({ "text-align": "right", width: "20%" }); const $label1 = $("<label>"); $label1.attr("for", "cite-".concat(CiteTB.escStr(this.shortform), "-name")).text(getMessage("cite-name-label")); $td1.append($label1); const td2 = $("<td>").addClass(citeFormTd).css("width", "30%"); const input1 = $("<input>").attr({ tabindex: "1", style: "width: 100%", type: "text" }); input1.attr("id", "cite-".concat(CiteTB.escStr(this.shortform), "-name")); td2.append(input1); const td3 = $("<td>").addClass(citeFormTd).css({ "text-align": "right", "padding-left": "1em", width: "20%" }); const label2 = $("<label>"); label2.attr("for", "cite-".concat(CiteTB.escStr(this.shortform), "-group")).text(getMessage("cite-group-label")); td3.append(label2); const td4 = $("<td>").addClass(citeFormTd).css("width", "30%"); const input2 = $("<input>").attr({ tabindex: "1", style: "width: 100%", type: "text" }); input2.attr("id", "cite-".concat(CiteTB.escStr(this.shortform), "-group")); td4.append(input2); $tr.append($td1).append(td2).append(td3).append(td4); form3.append($tr); main.append(form3); const extras = $("<div>"); extras.append($("<input>").addClass("cite-form-status").attr({ type: "hidden", value: "closed" })); const hidden = $("<input>").addClass("cite-template").attr("type", "hidden"); hidden.val(this.templatename); extras.append(hidden); const span1 = $("<span>").addClass("cite-preview-label").css("display", "none"); span1.text(getMessage("cite-raw-preview")); extras.append(span1).append($("<div>").addClass("cite-ref-preview").css({ padding: "0.5em", "font-size": "110%" })); const span2 = $("<span>").addClass("cite-prev-parsed-label").css("display", "none"); span2.text(getMessage("cite-parsed-label")); extras.append(span2).append($("<div>").addClass("cite-preview-parsed").css({ "padding-bottom": "0.5em", "font-size": "110%" })); const link = $("<a>").addClass("cite-prev-parse").attr("href", "#").css({ margin: "0 1em", display: "none", color: "#00008b" }); link.text(getMessage("cite-form-parse")); extras.append(link); main.append(extras); return main; } }; $(document).find("head").trigger("reftoolbarbase"); }; //! src/Edittools-refToolbar/modules/messages.ts var refToolbarMesages = () => { const { wgUserLanguage } = mw.config.get(); if (wgUserLanguage === "en") { return; } if (["zh-hant", "zh-hk", "zh-mo", "zh-tw"].includes(wgUserLanguage)) { mw.messages.set({ "cite-section-label": "引用", "cite-template-list": "模板", "cite-named-refs-label": "同名文獻", "cite-named-refs-title": "插入同名文獻", "cite-named-refs-button": "已命名參考文獻", "cite-named-refs-dropdown": "同名文獻", // Used on the top of the named refs list dropsown "cite-dialog-base": "引用", "cite-form-submit": "插入", "cite-form-showhide": "顯示/隱藏額外區域", "cite-no-namedrefs": "在本頁找不到任何同名文獻", "cite-namedrefs-intro": "從列出的參考文獻目錄中選擇一個名字。點擊「插入」插入一個參考文獻到文本中。", "cite-raw-preview": "原始碼:", "cite-parsed-label": "解析後的原始碼:", "cite-form-parse": "顯示解析後的預覽", "cite-refpreview": "預覽", "cite-name-label": "ref名", "cite-group-label": "ref組", "cite-form-reset": "重設表單", "cite-loading": "載入數據", // Shown while pagetext is being downloaded from the API "cite-insert-date": "插入當前日期", // Alt/title text for "insert date" icon "cite-err-report-heading": "引用錯誤報告", // Heading for error report table "cite-err-report-close": "關閉", // Alt/title text for "close" icon on error report "cite-err-report-empty": "未找到錯誤", // Message displayed in the error report list if there are no errors "cite-autofill-alt": "自動填充", "cite-increment-alt": "添加作者", // Alt text for autofill button image "cite-ref-tooltip": "錨點的標識符(使該引用可以成為內部連結的目標)", "cite-postscript-tooltip": "如果設定這一參數,則覆蓋使用句點終止引文的默認行爲", "cite-dialog-web": "網頁引用", "cite-dialog-news": "新聞引用", "cite-dialog-book": "書籍引用", "cite-dialog-journal": "期刊引用", "cite-dialog-conference": "會議引用", "cite-dialog-encyclopedia": "百科全書引用", "cite-author-label": "作者", "cite-title-label": "標題", "cite-url-label": "網址", "cite-website-label": "網站名稱", "cite-work-label": "報紙或雜誌", "cite-agency-label": "通訊社", "cite-publisher-label": "出版者", "cite-accessdate-label": "存取日期", "cite-last-label": "姓", "cite-first-label": "名", "cite-authorlink-label": "作者條目", "cite-coauthors-label": "其他作者", "cite-location-label": "出版地", "cite-page-label": "所在頁", "cite-pages-label": "頁範圍", "cite-at-label": "書內部分", "cite-language-label": "語言", "cite-format-label": "文件格式", "cite-doi-label": "DOI", "cite-date-label": "日期", "cite-month-label": "月份", "cite-year-label": "年份", "cite-quote-label": "摘錄", "cite-newspaper-label": "新聞媒體", "cite-author2-label": "第2作者", "cite-author3-label": "第3作者", "cite-author4-label": "第4作者", "cite-author5-label": "第5作者", "cite-agency": "通訊社", "cite-issn-label": "ISSN", "cite-oclc-label": "OCLC", "cite-bibcode-label": "Bibcode", "cite-isbn-label": "ISBN", "cite-others-label": "譯者", "cite-edition-label": "版本", "cite-trans-title-label": "翻譯後標題", "cite-ref-label": "錨點標識符", "cite-postscript-label": "结尾符", "cite-series-label": "系列", "cite-volume-label": "卷", "cite-unified-label": "統一書號", "cite-chapter-label": "章節", "cite-journal-label": "雜誌/期刊", "cite-issue-label": "期", "cite-pmid-label": "PMID", "cite-editor-label": "編輯", "cite-editor1-first-label": "編輯名", "cite-editor1-last-label": "編輯姓", "cite-editor1-link-label": "編輯條目", "cite-editor-first-label": "編輯名", "cite-editor-last-label": "編輯姓", "cite-editor-link-label": "編輯條目", "cite-pmc-label": "PMC", "cite-id-label": "ID", "cite-laysummary-label": "簡明摘要", "cite-laysource-label": "簡明摘要來源", "cite-laydate-label": "簡明摘要日期", "cite-conference-label": "會議名稱", "cite-conferenceurl-label": "會議網址", "cite-booktitle-label": "論文集", "cite-encyclopedia-label": "百科全書名", "cite-authorlink-tooltip": "若該作者有條目,填寫條目名稱", "cite-at-tooltip": "內容在來源中的位置(當按頁碼引用不適當時)", "cite-accessdate-tooltip": "訪問這個引用來源時的日期", "cite-id-tooltip": "其他的文章編號", "cite-samecontent-desc": "檢查含有相同內容的多個參考文獻", "cite-samecontent-error": "多個參考文獻包含有相同內容", "cite-repeated-desc": "使用相同名字的多個參考文獻", "cite-repeated-error": "多個參考文獻使用了相同名字", "cite-undefined-desc": "未定義的參考文獻", "cite-undefined-error": "一個已命名的參考文獻已經使用但是沒有定義", "cite-work-tooltip": "刊登該作品的出版物的名稱。請不要使用斜體", "cite-newspaper-tooltip": "刊登該新聞的出版物名稱", "cite-series-tooltip": "當書籍是一系列出版品中的其中一部份時使用", "cite-unified-tooltip": "1980年代之前中國所使用的書籍編號", "cite-laysummary-tooltip": "該文獻相關的新聞報道的URL", "cite-laysource-tooltip": "該文獻相關的新聞報道的出處" }); } else { mw.messages.set({ "cite-section-label": "引用", "cite-template-list": "模板", "cite-named-refs-label": "同名文献", "cite-named-refs-title": "插入同名文献", "cite-named-refs-button": "已命名参考文献", "cite-named-refs-dropdown": "同名文献", // Used on the top of the named refs list dropsown "cite-dialog-base": "引用", "cite-form-submit": "插入", "cite-form-showhide": "显示/隐藏额外区域", "cite-no-namedrefs": "在本页找不到任何同名文献", "cite-namedrefs-intro": "从列出的参考文献目录中选择一个名字。点击“插入”插入一个参考文献到文本中。", "cite-raw-preview": "源代码:", "cite-parsed-label": "解析后的源代码:", "cite-form-parse": "显示解析后的预览", "cite-refpreview": "预览", "cite-name-label": "ref名", "cite-group-label": "ref组", "cite-form-reset": "重设表单", "cite-loading": "载入数据", // Shown while pagetext is being downloaded from the API "cite-insert-date": "插入当前日期", // Alt/title text for "insert date" icon "cite-err-report-heading": "引用错误报告", // Heading for error report table "cite-err-report-close": "关闭", // Alt/title text for "close" icon on error report "cite-err-report-empty": "未找到错误", // Message displayed in the error report list if there are no errors "cite-autofill-alt": "自动填充", "cite-increment-alt": "添加作者", // Alt text for autofill button image "cite-ref-tooltip": "锚点的标识符(使该引用可以成为内部链接的目标)", "cite-postscript-tooltip": "如果设定这一参数,则覆盖使用句点终止引文的默认行为", "cite-dialog-web": "网页引用", "cite-dialog-news": "新闻引用", "cite-dialog-book": "书籍引用", "cite-dialog-journal": "期刊引用", "cite-dialog-conference": "会议引用", "cite-dialog-encyclopedia": "百科全书引用", "cite-author-label": "作者", "cite-title-label": "标题", "cite-url-label": "网址", "cite-website-label": "网站名称", "cite-work-label": "报纸或杂志", "cite-agency-label": "通讯社", "cite-publisher-label": "出版者", "cite-accessdate-label": "访问日期", "cite-last-label": "姓", "cite-first-label": "名", "cite-authorlink-label": "作者条目", "cite-coauthors-label": "其他作者", "cite-location-label": "出版地", "cite-page-label": "所在页", "cite-pages-label": "页范围", "cite-at-label": "书内部分", "cite-language-label": "语言", "cite-format-label": "文档格式", "cite-doi-label": "DOI", "cite-date-label": "日期", "cite-month-label": "月份", "cite-year-label": "年份", "cite-quote-label": "摘录", "cite-newspaper-label": "新闻媒体", "cite-author2-label": "第2作者", "cite-author3-label": "第3作者", "cite-author4-label": "第4作者", "cite-author5-label": "第5作者", "cite-agency": "通讯社", "cite-issn-label": "ISSN", "cite-oclc-label": "OCLC", "cite-bibcode-label": "Bibcode", "cite-isbn-label": "ISBN", "cite-others-label": "译者", "cite-edition-label": "版本", "cite-trans-title-label": "翻译后标题", "cite-ref-label": "锚点标识符", "cite-postscript-label": "结尾符", "cite-series-label": "系列", "cite-volume-label": "卷", "cite-unified-label": "统一书号", "cite-chapter-label": "章节", "cite-journal-label": "杂志/期刊", "cite-issue-label": "期", "cite-pmid-label": "PMID", "cite-editor-label": "编辑", "cite-editor1-first-label": "编辑名", "cite-editor1-last-label": "编辑姓", "cite-editor1-link-label": "编辑条目", "cite-editor-first-label": "编辑名", "cite-editor-last-label": "编辑姓", "cite-editor-link-label": "编辑条目", "cite-pmc-label": "PMC", "cite-id-label": "ID", "cite-laysummary-label": "简明摘要", "cite-laysource-label": "简明摘要来源", "cite-laydate-label": "简明摘要日期", "cite-conference-label": "会议名称", "cite-conferenceurl-label": "会议网址", "cite-booktitle-label": "论文集", "cite-encyclopedia-label": "百科全书名", "cite-authorlink-tooltip": "若该作者有条目,填写条目名称", "cite-at-tooltip": "内容在来源中的位置(当按页码引用不适当时)", "cite-accessdate-tooltip": "访问这个引用来源时的日期", "cite-id-tooltip": "其他的文章编号", "cite-samecontent-desc": "检查含有相同内容的多个参考文献", "cite-samecontent-error": "多个参考文献包含有相同内容", "cite-repeated-desc": "使用相同名字的多个参考文献", "cite-repeated-error": "多个参考文献使用了相同名字", "cite-undefined-desc": "未定义的参考文献", "cite-undefined-error": "一个已命名的参考文献已经使用但是没有定义", "cite-work-tooltip": "刊登该作品的出版物的名称。请不要使用斜体", "cite-newspaper-tooltip": "刊登該新聞的出版物名称", "cite-series-tooltip": "当书籍是一系列出版品中的其中一部份时使用", "cite-unified-tooltip": "1980年代之前中国所使用的书籍编号", "cite-laysummary-tooltip": "该文献相关的新闻报道的URL", "cite-laysource-tooltip": "该文献相关的新闻报道的出处" }); } }; //! src/Edittools-refToolbar/Edittools-refToolbar.ts (() => { const { wgAction, wgPageContentModel } = mw.config.get(); if (!["edit", "submit"].includes(wgAction) || wgPageContentModel !== "wikitext") { return; } if (!mw.user.options.get("usebetatoolbar")) { return; } if (document.querySelector("textarea[name=wpTextbox1][readonly]")) { return; } refToolbarMesages(); refToolbarBase(); void (0, import_ext_gadget2.getBody)().then(refToolbar2); })(); })(); /* </nowiki> */
该页面使用的模板:
Template:Gadget Header
(
查看源代码
)
返回
MediaWiki:Gadget-Edittools-refToolbar.js
。