|
|
| (未显示同一用户的43个中间版本) |
| 第1行: |
第1行: |
| /* Wikiplus */ | | /* 我写的,初期开发,不建议用 */ |
| mw.loader.load('https://wikiplus-app.com/Main.js') | | mw.loader.load('https://cdn.jsdelivr.net/gh/FreeLieAlgebra/MCBBS-Wiki-Helper/MBWH0.8.0.js'); |
| /* lib | |
| ----------------------------------------------------------------------
| |
| */
| |
| function getTitle() {
| |
| return mw.config.get("wgPageName")
| |
| }
| |
| function getPatrolToken() {
| |
| $.ajax({url: "https://mcbbs-wiki.cn/api.php?action=query&meta=tokens&format=json&type=patrol", type: "GET", success: function(data){alert(data.query.tokens.patroltoken);}})}
| |
|
| |
|
| function getCsrfToken() {
| | /* 暂时取自 https://minecraft-zh.gamepedia.com/User:Ff98sha/common.js,仅供学习研究用 */ |
| $.ajax({url: "https://mcbbs-wiki.cn/api.php?action=query&meta=tokens&format=json&type=csrf", type: "GET", success: function(data){alert(data.query.tokens.csrftoken);}})}
| | mw.loader.using(['oojs-ui-windows', 'oojs-ui-core'], |
| | | function() { |
| function getRollbackToken() {
| | $('.mw-rollback-link a').each(function() { |
| $.ajax({url: "https://mcbbs-wiki.cn/api.php?action=query&meta=tokens&format=json&type=rollback", type: "GET", success: function(data){alert(data.query.tokens.rollbacktoken);}})}
| | var href = $(this).attr('href'); |
| | | $(this).click(function(e) { |
| function getRevIds() {
| | e.preventDefault(); |
| $.ajax({url: "https://mcbbs-wiki.cn/api.php?action=query&prop=revisions&titles="+ title + "&rvlimit=20&rvprop=ids&format=json", type: "GET", success: function(data){alert(data.query.pages.pageid.revisions);}})}
| | OO.ui.confirm('你确定要回退此页面吗?').done(function(confirmed) { |
| | | if (confirmed) { |
| | | location.href = href; |
| /* 一些变量
| | } |
| ----------------------------------------------------------------------
| | }); |
| */
| | }); |
| var title, res1, pageid
| | }); |
| title = getTitle()
| | }); |
| res1 = "https://mcbbs-wiki.cn/wiki/Special:WhatLinksHere/" + title
| |
| pageid = mw.config.get("wgArticleId")
| |
| /* 电脑版
| |
| ----------------------------------------------------------------------
| |
| */
| |
| /* 右上角添加 */
| |
| $('#p-personal ul').append('<li><a href="?action=purge">强制刷新</a></li>')
| |
| $('#p-personal ul').append('<li><a href="?action=info">info</a></li>') | |
| $('#p-personal ul').append('<li><a href="' + res1 + '">WhatLinksHere</a></li>')
| |
| | |
| /* 手机版
| |
| ----------------------------------------------------------------------
| |
| */
| |
| | |
| /* 手机版编辑栏添加 */
| |
| $('#page-actions').append('<li class=""><a href="?action=purge" >purge</a></li>') | |
| | |
| //$('#page-actions').append('<li><a href="?action=info">info</a></li>')
| |
| | |
| //$('#page-actions').append('<li><a href="' + res1 + '">WLH</a></li>')
| |
| | |
| /* 手机版左端导航添加 */
| |
| | |
| $('#mw-mf-page-left').append('<li class=""><a href="' + res1 + '">WhatLinksHere</a></li>')
| |
| | |
| | |
| $('#mw-mf-page-left').append('<li class=""><a href="?action=info">info</a></li>')
| |
| | |
| $('#mw-mf-page-left').append('<li class=""><button onclick="getPatrolToken();">PatrolToken</button></li>')
| |
| | |
| $('#mw-mf-page-left').append('<li class=""><button onclick="getCsrfToken();">CsrfToken</button></li>')
| |
| | |
| | |
| $('#mw-mf-page-left').append('<li class=""><button onclick="getRollbackToken();">RollbackToken</button></li>')
| |
| | |
| | |
| $('#mw-mf-page-left').append('<li class=""><button onclick="getRevIds();">getRevIds</button></li>')
| |