Widget:GadgetsToc:修订间差异
imported>Irukaza 无编辑摘要 |
小 文本替换 - 替换“window.RLQ = window.RLQ || [];↵”为“” |
||
| (未显示2个用户的4个中间版本) | |||
| 第1行: | 第1行: | ||
<noinclude>Only for [[Special:小工具]]</noinclude><includeonly><!--{if !isset($wgGadgetsToc) || !$wgGadgetsToc}--><!--{assign var="wgGadgetsToc" value=true scope="global"}--><script> | <noinclude>Only for [[Special:小工具]]</noinclude><includeonly><!--{if !isset($wgGadgetsToc) || !$wgGadgetsToc}--><!--{assign var="wgGadgetsToc" value=true scope="global"}--><script> | ||
"use strict"; | "use strict"; | ||
window. | window.addEventListener('jquery-ready', async () => { | ||
await Promise.all([mw.loader.using("ext.gadget.site-lib"), $.ready]); | await Promise.all([mw.loader.using("ext.gadget.site-lib"), $.ready]); | ||
const root = $("#mw-content-text"); | const root = $("#mw-content-text"); | ||
| 第9行: | 第8行: | ||
"class": "toc", | "class": "toc", | ||
}); | }); | ||
const container = $("<div>").addClass("gadgetsTocContainer").appendTo(tocRoot); | const container = $("<div>").addClass("gadgetsTocContainer").appendTo(tocRoot); | ||
root.find(" | root.find("h2").each((_, ele) => { | ||
const $ele = $(ele); | const $ele = $(ele); | ||
const next = $ele.next(); | const next = $ele.next(); | ||