用户:自由李代数/common.js:修订间差异

无编辑摘要
标签移动版编辑 移动版网页编辑
(屮)
标签移动版编辑 移动版网页编辑
第111行: 第111行:


function deepMove(from, to, reason, noredirect){
function deepMove(from, to, reason, noredirect){
$.ajax({url: "https://mcbbs-wiki.cn/api.php?action=query&meta=tokens&format=json&type=csrf", type: "GET", success: function(data){var csrftoken = data.query.tokens.csrftoken;
$.ajax({url: "/api.php?action=query&meta=tokens&format=json&type=csrf", type: "GET", success: function(data){var csrftoken = data.query.tokens.csrftoken;
$.ajax({url:"api.php?action=move", data: {from:from, to: to, reason: reason, movetalk: 1, movesubpages: 1, noredirect: 1, token:csrftoken}, type: "POST", success: function(){
$.ajax({url:"/api.php?action=move", data: {from:from, to: to, reason: reason, movetalk: 1, movesubpages: 1, noredirect: 1, token:csrftoken}, type: "POST", success: function(){
massReplace("[[" + from + "]]", "[[" + to + "]]"); // Key part
massReplace("[[" + from + "]]", "[[" + to + "]]"); // Key part
alert("Finished!");
alert("Finished!");