MediaWiki:Gadget-Edittools-refToolbar.js
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
- Opera:按 Ctrl-F5。
/**
* 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
*/
/**
* A magnifying glass icon
*
* @base {@link https://www.qiuwenbaike.cn/wiki/File:System-search.svg}
* @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images}
* @author The people from the Tango! project {@link http://tango.freedesktop.org/The_People}
* @license Public Domain
*/
/**
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* Nuvola-style icon for a clipboard (with lined paper)
*
* @base {@link https://www.qiuwenbaike.cn/wiki/File:Nuvola_clipboard_lined.svg}
* @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images}
* @author David Vignoni, Stannered
* @license LGPL-2.1-or-later {@link https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html}
*/
/**
* Copyright (C) 2008 David Vignoni, Stannered
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* Nuvola action icon
*
* @base {@link https://www.qiuwenbaike.cn/wiki/File:Nuvola_action_edit_add.svg}
* @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images}
* @author David Vignoni, Stannered
* @license LGPL-2.1-or-later {@link https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html}
*/
/**
* Copyright (C) 2008 David Vignoni, Stannered
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* Vector version of Nuvola KDE icon
*
* @base {@link https://www.qiuwenbaike.cn/wiki/File:Nuvola_apps_date.svg}
* @author David Vignoni, Stannered
* @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images}
* @license LGPL-2.1-or-later {@link https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html}
*/
/**
* Copyright (C) 2008 David Vignoni, Stannered
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* SPDX-License-Identifier: LGPL-2.1-or-later
*
* Icon from Nuvola icon theme for KDE 3.x / GNOME 2 (Gtk-stop)
*
* @base {@link https://www.qiuwenbaike.cn/wiki/File:Gtk-stop.svg}
* @source {@link https://git.qiuwen.net.cn/InterfaceAdmin/QiuwenGadgets/src/branch/master/src/Edittools-refToolbar/images}
* @author David Vignoni / ICON KING
* @license LGPL-2.1-or-later {@link https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html}
*/
/**
* Copyright (C) 2008 David Vignoni / ICON KING
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* +------------------------------------------------------------+
* | === 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
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;
}
//! src/Edittools-refToolbar/Edittools-refToolbar.ts
var import_ext_gadget2 = require("ext.gadget.Util");
//! src/Edittools-refToolbar/images/Ajax-loader.gif
var Ajax_loader_default = "data:image/gif;base64,R0lGODlhIAAgAPMAAP///wAAAMbGxoSEhLa2tpqamjY2NlZWVtjY2OTk5Ly8vB4eHgQEBAAAAAAAAAAAACH/C05FVFNDQVB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CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY+Yip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd+MFCN6HAAIKgNggY0KtEBAAh+QQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1+vsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d+jYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg+ygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0+bm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h+Kr0SJ8MFihpNbx+4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX+BP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA==";
//! 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/images/Nuvola-clipboard-lined.png
var Nuvola_clipboard_lined_default = "data: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nv9WalX4gMUVMyxpnaNlxLzOiShqLBrGQQDOsEwjoW29wFhgBpCbHEmyQCoSA7ywazPkmh4jYYoKlJOhrx/kSc044cDmCoClqCCUtUw+YQ0QBJg2BYxx/WQRTIy0ygfWCc5nYPBQ8lszzbcmgBPGXicNflcR0jyoZlo/xy+RpKqg1fd4RAWEcQBRwOEVeMQJxdob65jfePnefo6Z+JeM9gcSZSVJ1/L2C+7Xc7NIW/4Er0+uqXxgpr1go8eayNNWVuLFlWElzQ3d3D91daaB8MgRKgLP0GuwtNFD2aRLw9HUFaj7fx8BQs8m02N0SOBL2XjiTetQdjapBvT5yisSPAdGSW5cmTVK2UeKPMQl7CDKZwJwRaUZpmCQ2pjLdLHL8Q/QJQhfnwK+Co3ps8+cDLFZaukRJOXxxmXUE/96QPYJGnCfVITPTKTHplfANKZGhQ8fWPaX1hA0+/Tt2ZKF8BkQUwwL6lls+ffj21xmyBUJfEeE90tr9LDngHZG9YxxOClm6Dpg6VHsAHSPONRWFAvB82myB9ADr6wAP4FwP+9/oLRAAfKvANvgUAAAAASUVORK5CYII=";
//! 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/Gtk-stop.png
var Gtk_stop_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAADDklEQVQ4jdWUW2hUVxiFl8d0xKZiKRTJRGwn+ip98aWvEXrmzEzTlz4lTXxL4piLBq2Kt+ANb4ihtPFSQ4wiaIRKEjFCDIKKrZdpQ+yADSZTJRdjztzOzHjO7DN7+aAzmVyqr/Z/+tk/+2Otf2028L+ry0BlT0nJ8FWn83EHUDp73gqUtjudj9tdruEWoPKdsEtAQ6C+XlJKCtPkTY9HtAG+PJivW9PSyXicyUSCfRs2yGNA47ywTqAqUFcnmbZobypj+lgT06bJXk0TpwFfK+Dr0jSRNAw+21XPfyo9jOlT7PX75QGgag6wp6RkmFLS3lRG8yvQWA0aBxtpplLs0TQxDavjwHLwoRMcLPcwFo3yJ5fraZZTkG1sy0ralgUWr4KQgMgAoqMFC22J0s7OAklCP7wNkfafc/PFy7+EtG1Yr14lspyF2cZjGE/CgUDFF8fPKJmEAeuvPyAkYP55H8KII3mnbwZs6To/nFv3obuiwn4xMPDDLWBkju02wHddVYWZSlE/tJmhleCQCwyuQM7mvWXg35trGQmHecHrFc15oc1bJwF3t9ttpRIJju1reh+sbPZ9ZfaBBBYQgJQSGeKNxbc2bQlkMgSlBAEIYME71f0CaF1ut5U0DD7f2zRD2e3Pwf7PwBufgg8aqvlycpJtXq/YCnyXz8iFchJYW6yq19ZeufKRfmQ7ImdbpgOoWg/H6jWIBR5CSCD66BHMWAxfH29RXgSD368aGrr7++xQzhUXDybjcT7bVT9DWXDLekZ0neGpKT5orOFvhWDnYvCiA+yvreb46Ch3FBUNZjm5d0iHoxCKAjP0dIayom370V1ebhOA9/z5grRN/HvmNIQEEiMhQFGgLFr08Zz9nQCq+vx+GQ/rHCz3MPijnxFdZ4eqit3AtzsB36+qKiYnJthfW80u9Rs+HxnhxZoaWftfn8RRoKbX75exaJTRaVhu6VsA9ym325oYHeXE+HgW1pDPmBP7QaByicvVbFlWMjE2trEZ6M+fbwRKP3E6TygOR+HLUGhPK3BhXnUfbL0GMMLjczbUzjcAAAAASUVORK5CYII=";
//! 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,
// eslint-disable-next-line mediawiki/msg-doc
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 {
}
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: Nuvola_clipboard_lined_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 {
}
$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 {
}
};
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",
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].content;
callback(pagetext);
});
}
};
CiteTB.safeDecodeURIComponent = (s) => {
try {
s = decodeURIComponent(s);
} catch {
}
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 {
}
} 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];
};
CiteTB.displayErrors = (errors) => {
$body.find("#cite-err-report").remove();
const table = $("<table>").attr("id", "cite-err-report").css({
width: "100%",
border: "1px solid #A9A9A9",
"background-color": "#FFEFD5",
padding: "0.25em",
"margin-top": "0.5em"
});
$body.find("#editpage-copywarn").before(table);
let tr;
const tr1 = $("<tr>").css("width", "100%");
const th1 = $("<th>").css("width", "60%").css("font-size", "110%").html(getMessage("cite-err-report-heading"));
const th2 = $("<th>").css("width", "40%").css("text-align", "right;");
const im = $("<img>").attr("src", Gtk_stop_default);
im.attr("alt", getMessage("cite-err-report-close")).attr("title", getMessage("cite-err-report-close"));
const ad = $("<a>").attr({
id: "cite-err-check-close",
href: "#"
});
ad.append(im);
th2.append(ad);
tr1.append(th1).append(th2);
table.append(tr1);
$body.find("#cite-err-check-close").on("click", () => {
$body.find("#cite-err-report").remove();
});
if (errors.length === 0) {
tr = $("<tr>").css("width", "100%");
const td = $("<td>").css("text-align", "center").css("margin", "1.5px").html(getMessage("cite-err-report-empty"));
tr.append(td);
table.append(tr);
return;
}
for (const error in errors) {
if (Object.hasOwn(errors, error)) {
const err = errors[error];
tr = $("<tr>").css("width", "100%");
const td1 = $("<td>").css({
border: "1px solid #000",
margin: "1.5px",
width: "60%"
}).html(err.err);
const td2 = $("<td>").css({
border: "1px solid #000",
margin: "1.5px",
width: "40%"
}).html(getMessage(err.msg));
tr.append(td1).append(td2);
table.append(tr);
}
}
};
refToolbarConfig();
};
//! src/Edittools-refToolbar/images/Nuvola-action-edit-add.png
var Nuvola_action_edit_add_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAACnklEQVQ4jc2UW0gUURzGf2dmdh3XdS9sQmWkhYTVVthSlpRW4EM9pEjSHXoKInoIAqEiKOo5KAgifOihCLywhSQURPUgSgRdVhKUoCAKt721o267zpweJk1xlCAf+mAezpnzfefP73/OgUWWcJxtxV2ml9/WVFeDQBFYAqQKJkgTWRibHPg+9PEEI/z8q118h5ZcOdN+Nj+aicukkZLJ7J9vNB2Xp2+eK3gblt9y8ipOkyW6p7ZlW7Mr4PUTS7wnlnrPYCrGYDpGoNTPgfomzVPiqXHyavMUKQAyuQx77+9FqAJFVRCqYOTkiL1AcaZlB7bi9nl8F0r1wA4shJGf2LgQEoCcyFeXt6x/hlTkj1TmVTb++RKD5DWAskDZnYM7Dx1u2tzkAkAKNlVswMR0DNu0Okzn5bsBJLtBEH3xuP7Bo67qBCPNGoDqVusv7D/vCnlDpHNpBAJTmCQmEnPCUrkUQT1IzdowAD63j3Bltdb5tGfrTIaKIhT6PvXR2N5o89LENLuZqr1Xi1AFQrP/RfdFqSpaA8JusGOX/0X/f+AUQ2lJi7qKOr6c/4JAgIDERILIncgsw8DRAYJ6ECHsc+hz+0ikUyCxpgMnxyb7rz68Vt4csbuOFERW1RAqDs2pIKgHUU2N18NvQQIIup/3FApG7p09AtiF7vV7r5cGAxEsxDi5qmhbVyBcuY7KG5VzbkpseIjmi8cyHoqHMRWZGU3Gxoe+tWEQtyt6Ts7AOGVgALDsxMonQONCrHTp/vC1Z2j7fAxnyZJSAvh1P71HerGR2lz9Rf4p6I4bOQaOj42/6ezr3rN+xTotHNrwm5WtdDZDx8towUhmPzh5531gQ3Jph6u4aMv0A2spYIE0hcynf75L9n8+jkHc0b+Y+gVRRPMJvWc+QAAAAABJRU5ErkJggg==";
//! src/Edittools-refToolbar/images/Nuvola-apps-date.png
var Nuvola_apps_date_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAADy0lEQVQ4jZWUW2xUVRSGv33m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/TV9f383nlfLJAf+32502wdWoZDQgmZ83WFo2iEQhH0+y4fafudLw8Uk9PHXmos/3YyqVGi8IBNATgS8Hh7PHhq9ZCYQgFpWQiPOo2p8pi3w3srI8d3rk6tVTwDT3/YmiELCzs9M2Z38lNm/aZ3erp1VH7MTFlfDib36//9c7EKNQ30PD6/Xur6qqegNwP+jgQvE3ihHKd6myxpsAAAAASUVORK5CYII=";
//! src/Edittools-refToolbar/Edittools-refToolbar.module.less
var citeFormTd = "Edittools-refToolbar-module__citeFormTd_tYurZa";
//! src/Edittools-refToolbar/images/System-search.png
var System_search_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAD4klEQVQ4jaWTTUhjVxTHz30vLx8mcYzRyZg4PpMW1DIj1XYMMlpbhlKK0whC7arQjaULYUCUrto+umpRUqhScDML6bTpQm0HoYsipLUkftAp6UwkSmLqRzRRYzTm5b28j3u7iWDTaAv9w9lczv3d3z2XC3BFxsfHa7xer+GqntKg0oWxsTF3Z2fnt1artZGmaUQIAZ7nxXA4/DAWi33IcVzuPwNnZmamOzo63g3FM7AUOTrjZTWnpSjaed1g7bv7HLUZiwrBYPDOyMjI2r8CfT7fFz09rz748ocwf63aGnv9JbbCoKOYdFbiVzcOs8/Wt2886Gty5tJ7YiAQYEdHRw/KAWkAAK/X6+jp6fnukf/PQn2Dfe3tLhdrNetMCABpGYqyW406mdZuff9zVB24d+t6KpW6PTc396gckAIAsFgsI5jSot1TEu9sstXICi6IspojADkEwCNEeKIiXn+tMvY4GC80Nze/wXFcxaVAm83m+W3jCBoc1acqgYIo4xNJwWlZUY8JQFpSSCpxnNuq0FccrO9mU2azGen1+vZyQA0AAELInM3LgImeFyWFBkKLmBARISRKEhaWo+lnCkY0AkIVZCwhhICmaeulQFVVTxptptqnoazmKFt9YDFpFZXA6Zkgbf6+eRLZTos6AmADQGazgTGKogg8z+9fCtzZ2fnG09b+yUxwz7Hw9OAxjUhKRWgPYZIiiGBCkA0QwYcHGfa9V27YtrdjEgA8uXSGmUxmIpVK4r4OhytzdPyigokWVNWIgVgBUzUIwJjLCnanBTqb6ivR6urqBMdxSjkgDQCwsLAgtLa2HnXduXW/ppJh/9jYt/GSSkBF6Cyfbzg7ydxrrdO8+f7927ZkMgn5fP5lvV7/Szgc3ioF/u2nTE1Njbrd7s8djnq0vpOBzf1Ttdqsp9qer0UFkYdoNAqCIEA8Hgej0YgXFxcHp6enH/7D8Dzz8/MBl8v19e7ujgsp+ZvWCsyIp0m8FAzEfT7fB4eHh6na2toOk8kEPM8jp9PpYVnWurKy8mNZwzLzRSV9ZGho6KPu7u6PZVlGgiCAJEmQSCR+DQQCr/n9fkVzYYOmaKwBAJrjOEtvb+8LVVVVdYIgCJFIJD4wMBCdnJycSCaT+/39/V9ptVrKYDBAS0vLXYZh5vx+/1t00YQBAO3FGh4ebm1sbOwymUxtDMPcxBjrVFU9CYVCytraWiSRSCy43e537HY7xbIsEkWxbnZ29jMNAOBiqUVTBADg8XieAECo5Oqk2KcuLS2tyLLcPjg4+BPP81XLy8ufAgApnSEqAs7NqYuHFIHkgsC5DLniLf5f/gJPbNbo45liuAAAAABJRU5ErkJggg==";
//! 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", Nuvola_apps_date_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", System_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", Nuvola_action_edit_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": "自動填充",
// 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": "自动填充",
// 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);
})();
})();