跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
根类
所有页面
统计信息
分类树
特殊页面
FC
搜索
搜索
外观
登录
个人工具
登录
查看“︁MediaWiki:Common.js”︁的源代码
系统消息
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
外观
移至侧栏
隐藏
←
MediaWiki:Common.js
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。 如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ /* Decode percent-encoded UTF-8 in wiki link hrefs so copied links show 中文 instead of %E9%A6%96... in WeChat/QQ/text editors. Browser auto-re-encodes when the link is clicked, so navigation is unaffected. */ (function () { function decodeHref(href) { try { var m = href.match(/^([^?#]*)(\?[^#]*)?(#.*)?$/); if (!m) return href; var path = decodeURIComponent(m[1]); var query = ''; if (m[2]) { query = '?' + m[2].slice(1).split('&').map(function (p) { var eq = p.indexOf('='); if (eq === -1) { try { return decodeURIComponent(p); } catch (e) { return p; } } var k = p.slice(0, eq), v = p.slice(eq + 1); try { k = decodeURIComponent(k); } catch (e) {} try { v = decodeURIComponent(v); } catch (e) {} return k + '=' + v; }).join('&'); } var hash = m[3] || ''; if (hash.length > 1) { try { hash = '#' + decodeURIComponent(hash.slice(1)); } catch (e) {} } return path + query + hash; } catch (e) { return href; } } function isInternal(a) { var raw = a.getAttribute('href'); if (!raw) return false; if (raw.charAt(0) === '/' && raw.charAt(1) !== '/') return true; try { return new URL(a.href, window.location.href).host === window.location.host; } catch (e) { return false; } } function decodeAll(root) { var nodes = (root || document).querySelectorAll('a[href*="%"]'); for (var i = 0; i < nodes.length; i++) { var a = nodes[i]; if (!isInternal(a)) continue; var orig = a.getAttribute('href'); var dec = decodeHref(orig); if (dec !== orig) a.setAttribute('href', dec); } } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { decodeAll(); }); } else { decodeAll(); } if (window.mw && mw.hook) { mw.hook('wikipage.content').add(function ($content) { decodeAll($content[0] || $content); }); } })();
返回
MediaWiki:Common.js
。
搜索
搜索
查看“︁MediaWiki:Common.js”︁的源代码
添加话题