User:Irukaza/js/editConflict.js:修订间差异

[InPageEdit] 没有编辑摘要
imported>=海豚=
([InPageEdit] 没有编辑摘要)
imported>=海豚=
([InPageEdit] 没有编辑摘要)
第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">不保存内容,直接刷新页面(慎重!)</span></div>`);
                $("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></div>`);
                const pre = $("<pre/>", {
                const pre = $("<pre/>", {
第89行: 第89行:
            } catch (e) {
            } catch (e) {
              console.error("editConflict", e);
              console.error("editConflict", e);
              wpSave.val(i <= 3 ? `可能存在编辑冲突,正在检测(第${i}次)……` : "提交失败,请刷新界面后重试……");
              wpSave.val(i <= 3 ? ` 提交失败! 可能存在编辑冲突,正在检测(第${i}次)……` : "提交失败,请刷新界面后重试……");
            }
            }
          }
          }
匿名用户