打开/关闭搜索
搜索
打开/关闭菜单
4
8
17
239
导航
首页
人物
网站
后室社区编年史
最近更改
随机页面
特殊页面
上传文件
指导
常见问题
基本Mediawiki语法
社区
Mediawiki聊天
聊天中的在线用户
分享页面
通过电子邮件分享
分享到Facebook
分享到Twitter
分享到新浪微博
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
讨论
贡献
创建账号
登录
查看“︁MediaWiki:Common.js”︁的源代码
MediaWiki界面页面
查看
阅读
查看源代码
查看历史
associated-pages
系统消息
讨论
更多操作
←
MediaWiki:Common.js
因为以下原因,您没有权限编辑该页面:
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。 如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ /* * Script Name: InputUsername * Author: Ihojose * * Adds the username of the user viewing the page. * Only works for logged in users. * * Added by Spottra 5-Apr-2015: * Individual users can define "window.disableUsernameReplace = true;" in their * global.js or local common.js file to disable the replacement for themselves if * they so desire. */ ;(function ($, mw) { 'use strict'; var username = mw.config.get('wgUserName'); if ( window.disableUsernameReplace || !username ) { return; } window.disableUsernameReplace = true; var $rail = $('#WikiaRail'), customSelector = window.UsernameReplaceSelector ? ', ' + window.UsernameReplaceSelector : ''; function inputUsername($content) { $content.find('.InputUsername, .insertusername' + customSelector).text(username); } mw.hook('wikipage.content').add(inputUsername); if ($rail.hasClass('loaded')) { inputUsername($rail); } else if ($rail.length) { $rail.on('afterLoad.rail', inputUsername.bind(null, $rail) ); } })(window.jQuery, window.mediaWiki); /* * Script Name: Template CSS * Author: Fandom Backrooms */ (function () { const eles = document.querySelectorAll('.js-action-play'); eles.forEach(function (e) { const targetId = e.getAttribute('data-media-id'); if (!targetId) { console.error('No data-media-id present on element', e); return; } const target = document.getElementsByClassName('media-id-' + targetId)[0]; if (!target) { console.error('No element found with .media-id-' + targetId, e); return; } e.addEventListener('click', function () { console.log(target); if (target.paused || target.ended) { target.play(); } else { target.pause(); } }); }); })(); mw.loader.load(["mediawiki.util", "mediawiki.Title"]); mw.hook("wikipage.content").add(function () { $("span.import-css").each(function () { mw.util.addCSS($(this).attr("data-css")); }); $(".sitenotice-tab-container").each(function() { var container = $(this); function switchTab(offset) { return function() { var tabs = container.children(".sitenotice-tab").toArray(); var no = Number(container.find(".sitenotice-tab-no")[0].innerText) + offset; var count = tabs.length; if (no < 1) no = count; else if (no > count) no = 1; for (var i = 0; i < count; i++) tabs[i].style.display = (i + 1 == no ? null : "none"); container.find(".sitenotice-tab-no")[0].innerText = no; }; } container.find(".sitenotice-tab-arrow.prev").click(switchTab(-1)); container.find(".sitenotice-tab-arrow.next").click(switchTab(1)); }); }); $.getJSON(mw.util.wikiScript("index"), { title: "MediaWiki:Custom-import-scripts.json", action: "raw" }).done(function (result, status) { if (status != "success" || typeof (result) != "object") return; var scripts = result[mw.config.get("wgPageName")]; if (scripts) { if (typeof (scripts) == "string") scripts = [scripts]; importArticles({ type: "script", articles: scripts }); } }); mw.loader.load('/Script:' + wgPageName + '?action=raw&ctype=text/javascript'); // Import page scripts // mw.loader.load('/MediaWiki:Audio.js'); //Import audio script
返回
MediaWiki:Common.js
。
我们为您提供服务需要使用Cookie。使用我们的服务即表示您同意我们使用Cookie。
更多信息
确定
查看“︁MediaWiki:Common.js”︁的源代码
MediaWiki界面页面