MediaWiki:Mobile.js:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 标签:移动版编辑 移动版网页编辑 |
无编辑摘要 标签:移动版编辑 移动版网页编辑 |
||
第27行: | 第27行: | ||
$(function () { | $(function () { | ||
mfSidebar(); | mfSidebar(); | ||
}); | |||
mw.loader.load('/index.php?title=MediaWiki:Gadget-Filterable.js&action=raw&ctype=text/javascript'); | |||
$('.heimu a').on("click", function () { | |||
if (!$(this).closest('.heimu').is(':active, :focus')) return false; | |||
}); | |||
//Template:hide | |||
if ($('.mw-collapsible')[0]) mw.loader.using('jquery.makeCollapsible').then(function () { | |||
//console.debug('jquery.makeCollapsible is loaded.'); | |||
$('.mw-collapsible').makeCollapsible(); | |||
}); | |||
clip_board = new ClipboardJS('h1#firstHeading'); | |||
$("h1#firstHeading").click(function () { | |||
var copyText = "https://prts.wiki/id/" + mw.config.get('wgArticleId'); | |||
this.setAttribute("data-clipboard-text", copyText); | |||
alert("链接已复制: " + copyText); | |||
}); | }); |
2024年2月17日 (六) 18:13的版本
/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
function menuadjust() {
var a = $("body").height() + "px";
document.getElementById("mw-mf-page-left").style.height = a;
};
$(function () {
menuadjust();
});
$(window).resize(function () {
menuadjust();
});
var navbar = function (data, textStatus, jqxhr) {
var navlist = data.parse.text["*"];
$(navlist).insertBefore(".menu > .hlist")
};
var mfSidebar = function () {
var purl = "/api.php?action=parse&page=MediaWiki:MFSidebar&format=json";
$.ajax({
url: purl,
success: navbar,
error: function () {
console.error("can\'t load customized navmenu")
},
dataType: "json"
});
};
$(function () {
mfSidebar();
});
mw.loader.load('/index.php?title=MediaWiki:Gadget-Filterable.js&action=raw&ctype=text/javascript');
$('.heimu a').on("click", function () {
if (!$(this).closest('.heimu').is(':active, :focus')) return false;
});
//Template:hide
if ($('.mw-collapsible')[0]) mw.loader.using('jquery.makeCollapsible').then(function () {
//console.debug('jquery.makeCollapsible is loaded.');
$('.mw-collapsible').makeCollapsible();
});
clip_board = new ClipboardJS('h1#firstHeading');
$("h1#firstHeading").click(function () {
var copyText = "https://prts.wiki/id/" + mw.config.get('wgArticleId');
this.setAttribute("data-clipboard-text", copyText);
alert("链接已复制: " + copyText);
});