无编辑摘要
imported>=海豚= 无编辑摘要 |
imported>=海豚= 无编辑摘要 |
||
第11行: | 第11行: | ||
const wpSave = $("#wpSave"); | const wpSave = $("#wpSave"); | ||
const editform = $("#editform"); | const editform = $("#editform"); | ||
const conflictAlert = " | const conflictAlert = "请备份您的编辑后刷新页面再进行相关操作!"; | ||
const SYMBOL_UNDEFINED = Symbol("SYMBOL_UNDEFINED"); | const SYMBOL_UNDEFINED = Symbol("SYMBOL_UNDEFINED"); | ||
wpSave.val = (value = SYMBOL_UNDEFINED) => { | wpSave.val = (value = SYMBOL_UNDEFINED) => { | ||
第36行: | 第36行: | ||
const pageid = Object.keys(result.query.pages)[0]; | const pageid = Object.keys(result.query.pages)[0]; | ||
if (pageid > 0 && result.query.pages[pageid].revisions[0].revid > wgCurRevisionId) { | if (pageid > 0 && result.query.pages[pageid].revisions[0].revid > wgCurRevisionId) { | ||
wpSave.val("存在编辑冲突!"); | wpSave.val(" 提交失败, 存在编辑冲突!"); | ||
$("body").append(`<div style="background: #3366CC; color: white; text-align: center; padding: .5rem; position: fixed; top: 0; left: 0; right: 0; z-index: 9999;"><p>本页面已被他人更改。请复制您的编辑到剪贴板,然后刷新页面,重新开始编辑,以避免编辑冲突。</p><p><span id="copyCurrentRawCode" class="mw-ui-button">复制当前编辑内容</span> <span id="showNewestRevisionDiff" class="mw-ui-button">查看最新版本差异</span> <span id="refreshPage" class="mw-ui-button mw-ui-destructive">刷新页面 | $("body").append(`<div style="background: #3366CC; color: white; text-align: center; padding: .5rem; position: fixed; top: 0; left: 0; right: 0; z-index: 9999;"><p>本页面已被他人更改。请复制您的编辑到剪贴板,然后刷新页面,重新开始编辑,以避免编辑冲突。</p><p><span id="copyCurrentRawCode" class="mw-ui-button">复制当前编辑内容</span> <span id="showNewestRevisionDiff" class="mw-ui-button">查看最新版本差异</span> <span id="refreshPage" class="mw-ui-button mw-ui-destructive">刷新页面</span></p></div>`); | ||
const pre = $("<pre/>", { | const pre = $("<pre/>", { | ||
css: { | css: { |