这是测试站点!!!!
不要保存重要内容!不要保存重要内容!不要保存重要内容!不要保存重要内容!不要保存重要内容!
MediaWiki:Common.js:修订间差异
来自Limbo Wiki
小 现在应该能改变标题了? |
无编辑摘要 标签:(旧)WikiEditor |
||
| (未显示4个用户的43个中间版本) | |||
| 第1行: | 第1行: | ||
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ | /* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ | ||
$().ready(function(){ | |||
/* ========================= | |||
* Project Divide 开场加载器 | |||
* ========================= */ | |||
(function () { | |||
'use strict'; | |||
var targetPage = '像素塔卡片战争"Project_Divide"'; | |||
if ( | |||
mw.config.get('wgPageName') !== targetPage || | |||
mw.config.get('wgAction') !== 'view' | |||
) { | |||
return; | |||
} | |||
mw.loader.using('mediawiki.util').then(function () { | |||
jQuery(function () { | |||
var marker = document.querySelector('.pd-intro-marker'); | |||
if (!marker || marker.dataset.pdIntroLoading) { | |||
return; | |||
} | |||
marker.dataset.pdIntroLoading = '1'; | |||
function sourceUrl(title, contentType) { | |||
return mw.util.getUrl(title, { | |||
action: 'raw', | |||
ctype: contentType | |||
}); | |||
} | |||
var stylesheet = document.createElement('link'); | |||
stylesheet.rel = 'stylesheet'; | |||
stylesheet.href = sourceUrl( | |||
'MediaWiki:PD-intro.css', | |||
'text/css' | |||
); | |||
stylesheet.onload = function () { | |||
mw.loader.getScript( | |||
sourceUrl( | |||
'MediaWiki:PD-intro-engine.js', | |||
'text/javascript' | |||
) | |||
).then(function () { | |||
return mw.loader.getScript( | |||
sourceUrl( | |||
'MediaWiki:PD-intro.js', | |||
'text/javascript' | |||
) | |||
); | |||
}).catch(function (error) { | |||
console.error( | |||
'Project Divide开场加载失败:', | |||
error | |||
); | |||
}); | |||
}; | |||
document.head.appendChild(stylesheet); | |||
}); | |||
}); | |||
}()); | |||
/* ========================= | |||
* 原有功能 | |||
* ========================= */ | |||
$(document).ready(function () { | |||
$("span.mw-summary-preset span.mw-summary-preset-item").click(function () { | |||
a = $(this) | |||
.parents("div.oo-ui-fieldLayout-body") | |||
.first() | |||
.find("input#wpSummary") | |||
.get(0); | |||
a.value += $(this).children().text(); | |||
}); | |||
$(".lw-treebut").click(function () { | |||
p = $(this) | |||
.parents(".mw-parser-output") | |||
.first(); | |||
p.find(".lw-treediv").css("display", "none"); | |||
p.find(".lw-treediv." + $(this).attr("id")) | |||
.css("display", "block"); | |||
}); | |||
}); | }); | ||
/* ========================= | |||
* 密码盘 | |||
* ========================= */ | |||
mw.loader.load( | |||
mw.util.getUrl('MediaWiki:密码盘.js', { | |||
action: 'raw', | |||
ctype: 'text/javascript' | |||
}) | |||
); | |||
2026年10月8日 (四) 23:06的最新版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
/* =========================
* Project Divide 开场加载器
* ========================= */
(function () {
'use strict';
var targetPage = '像素塔卡片战争"Project_Divide"';
if (
mw.config.get('wgPageName') !== targetPage ||
mw.config.get('wgAction') !== 'view'
) {
return;
}
mw.loader.using('mediawiki.util').then(function () {
jQuery(function () {
var marker = document.querySelector('.pd-intro-marker');
if (!marker || marker.dataset.pdIntroLoading) {
return;
}
marker.dataset.pdIntroLoading = '1';
function sourceUrl(title, contentType) {
return mw.util.getUrl(title, {
action: 'raw',
ctype: contentType
});
}
var stylesheet = document.createElement('link');
stylesheet.rel = 'stylesheet';
stylesheet.href = sourceUrl(
'MediaWiki:PD-intro.css',
'text/css'
);
stylesheet.onload = function () {
mw.loader.getScript(
sourceUrl(
'MediaWiki:PD-intro-engine.js',
'text/javascript'
)
).then(function () {
return mw.loader.getScript(
sourceUrl(
'MediaWiki:PD-intro.js',
'text/javascript'
)
);
}).catch(function (error) {
console.error(
'Project Divide开场加载失败:',
error
);
});
};
document.head.appendChild(stylesheet);
});
});
}());
/* =========================
* 原有功能
* ========================= */
$(document).ready(function () {
$("span.mw-summary-preset span.mw-summary-preset-item").click(function () {
a = $(this)
.parents("div.oo-ui-fieldLayout-body")
.first()
.find("input#wpSummary")
.get(0);
a.value += $(this).children().text();
});
$(".lw-treebut").click(function () {
p = $(this)
.parents(".mw-parser-output")
.first();
p.find(".lw-treediv").css("display", "none");
p.find(".lw-treediv." + $(this).attr("id"))
.css("display", "block");
});
});
/* =========================
* 密码盘
* ========================= */
mw.loader.load(
mw.util.getUrl('MediaWiki:密码盘.js', {
action: 'raw',
ctype: 'text/javascript'
})
);
