查看“︁MediaWiki:Gadget-shortlink.js”︁的源代码
←
MediaWiki:Gadget-shortlink.js
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
此页面为本wiki上的软件提供界面文本,并受到保护以防止滥用。 如欲修改所有wiki的翻译,请访问
translatewiki.net
上的MediaWiki本地化项目。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
/** * ------------------------------------------------------------------------- * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!! * ------------------------------------------------------------------------- */ var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/shortlink/Gadget-shortlink.js|user=[[U:BearBin]]|co-authors=|longId=48ac3eed0d3ed8944a9fb6a1aceb858c61247d89|shortId=48ac3eed|summary=fix: #698}}'; /* <pre> */ "use strict"; $(() => { const { wgArticleId = -1, wgCurRevisionId = -1, wgRevisionId = -1, wgDiffOldId = -1, wgDiffNewId = -1, wgServer, wgScriptPath, } = mw.config.get([ "wgArticleId", "wgCurRevisionId", "wgRevisionId", "wgDiffOldId", "wgDiffNewId", "wgServer", "wgScriptPath", ]); if (wgArticleId <= 0) { return; } // 链接信息 const links = [{ id: "page", href: `curid=${wgArticleId}`, title: wgULS("本页面的短链接(页面ID)", "本頁面的短網址(頁面ID)"), text: wgULS("本页短链", "本頁短網址"), wikitext: `[[Special:重定向/page/${wgArticleId}]]`, }, { id: "newrev", href: `oldid=${wgCurRevisionId}`, title: wgULS("本页面最新版本的短链接(版本ID)", "本頁面最新修訂的短網址(版本ID)"), text: wgULS("最新版本", "最新修訂"), wikitext: `[[Special:固定链接/${wgCurRevisionId}]]`, }]; if (wgRevisionId > 0) { if (wgCurRevisionId !== wgRevisionId) { links.push({ id: "rev", href: `oldid=${wgRevisionId}`, title: wgULS("本页面当前版本的短链接(版本ID)", "本頁面當前修訂的短網址(版本ID)"), text: wgULS("当前版本", "當前修訂"), wikitext: `[[Special:固定链接/${wgRevisionId}]]`, }, { id: "currev", href: `diff=${wgRevisionId}`, title: wgULS("本页面当前版本与前一版本的差异的链接(版本ID)", "本頁面當前修訂與前一修訂的短網址(版本ID)"), text: wgULS("当前版本差异", "當前修訂差異"), wikitext: `[[Special:差异/${wgRevisionId}]]`, }, { id: "curdiff", href: `diff=${wgCurRevisionId}&oldid=${wgRevisionId}`, title: wgULS("与本页面最新版本的差异的短链接(版本ID)", "與本頁面最新修訂差異的短網址(版本ID)"), text: wgULS("与最新版本差异", "與最新修訂差異"), wikitext: `[[Special:差异/${wgRevisionId}/${wgCurRevisionId}]]`, }); } else if (wgDiffNewId !== wgCurRevisionId) { links.push({ id: "currev", href: `diff=${wgCurRevisionId}`, title: wgULS("本页面最新版本与前一版本的差异的链接(版本ID)", "本頁面最新修訂與前一修訂差異的短網址(版本ID)"), text: wgULS("最新版本差异", "與最新修訂差異"), wikitext: `[[Special:差异/${wgCurRevisionId}]]`, }); } } if (wgDiffNewId > 0 && wgDiffOldId > 0) { links.push({ id: "diff", href: `diff=${wgDiffNewId}&oldid=${wgDiffOldId}`, title: wgULS("当前比较的差异的短链接(版本ID)", "當前比較的差異的短網址(版本ID)"), text: wgULS("当前比较的差异", "當前比較的差異"), wikitext: `[[Special:差异/${wgDiffOldId}/${wgDiffNewId}]]`, }); } const portletLink = mw.util.addPortletLink( "p-tb", "javascript:void(0)", wgULS("短链接", "短網址"), "ca-shortlink", wgULS("复制本页面的短链接", "複製本頁面的短網址") ); if (portletLink) { portletLink.querySelector("a").addEventListener("click", (e) => { e.preventDefault(); const $element = $("<div>"); links.forEach((shortlink) => { $element.append( $("<div>") .css({ "font-weight": "bold", margin: "0.6em 0 0.2em" }) .text(shortlink.title), ); [shortlink.wikitext, `${wgServer}${wgScriptPath}/_?${shortlink.href}`].forEach((value) => { $element.append( new mw.widgets.CopyTextLayout({ align: "top", copyText: value }).$element, ); }); }); OO.ui.alert($element, { size: "medium" }); }); } }); /* </pre> */
该页面使用的模板:
Template:GHIACode
(
查看源代码
)
Template:Info
(
查看源代码
)
Template:TemplateCate
(
查看源代码
)
Module:SafeCate
(
查看源代码
)
返回
MediaWiki:Gadget-shortlink.js
。
导航菜单
个人工具
创建账号
登录
命名空间
系统消息
讨论
English
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
特殊页面
工具
链入页面
相关更改
页面信息
批量上传文件
友情链接
VCPedia
其他相关站点
vocaloid中文歌詞wiki
UTAU中华组wiki
初音ミク Wiki
VOCALOID Wiki
Vocaloid Lyrics Wiki
Vocaloid Database