Zeroclanzhang(讨论 | 贡献) 无编辑摘要 |
Zeroclanzhang(讨论 | 贡献) 无编辑摘要 |
||
第1行: | 第1行: | ||
mw.loader.using(['mediawiki.util']).done(function () { | mw.loader.using(['mediawiki.util']).done(function () { | ||
/* Begin of mw.loader.using callback */ | /* Begin of mw.loader.using callback */ | ||
// | // Magic editintros | ||
function | function addEditIntro(name) { | ||
var editLinks = $('.mw-editsection, #ca-edit, #ca-ve-edit').find('a'); | |||
editLinks.each(function (i, el) { | |||
el.href = $(this).attr('href') + '&editintro=' + name; | |||
}); | |||
} | |||
$(function () { | |||
if (mw.config.get('wgNamespaceNumber') === 0) { | |||
// Optimizing DOM access by caching | |||
var disambigBox = document.getElementById('disambigbox'); | |||
var cats = mw.config.get('wgCategories'); | |||
if (disambigBox) { | |||
addEditIntro('Template:Disambig_editintro'); | |||
} | |||
if (cats) { | |||
if ($.inArray('Living people', cats) !== -1 || $.inArray('Possibly living people', cats) !== -1) { | |||
addEditIntro('Template:BLP_editintro'); | |||
} | } | ||
} | } | ||
} | |||
}); | |||
} | |||
/* End of mw.loader.using callback */ | /* End of mw.loader.using callback */ | ||
}); | }); | ||
/* DO NOT ADD CODE BELOW THIS LINE */ | /* DO NOT ADD CODE BELOW THIS LINE */ |
2024年1月26日 (五) 14:06的最新版本
mw.loader.using(['mediawiki.util']).done(function () {
/* Begin of mw.loader.using callback */
// Magic editintros
function addEditIntro(name) {
var editLinks = $('.mw-editsection, #ca-edit, #ca-ve-edit').find('a');
editLinks.each(function (i, el) {
el.href = $(this).attr('href') + '&editintro=' + name;
});
}
$(function () {
if (mw.config.get('wgNamespaceNumber') === 0) {
// Optimizing DOM access by caching
var disambigBox = document.getElementById('disambigbox');
var cats = mw.config.get('wgCategories');
if (disambigBox) {
addEditIntro('Template:Disambig_editintro');
}
if (cats) {
if ($.inArray('Living people', cats) !== -1 || $.inArray('Possibly living people', cats) !== -1) {
addEditIntro('Template:BLP_editintro');
}
}
}
});
/* End of mw.loader.using callback */
});
/* DO NOT ADD CODE BELOW THIS LINE */