無編輯摘要
imported>=海豚= 無編輯摘要 |
imported>=海豚= 無編輯摘要 |
||
| 行 20: | 行 20: | ||
needCheckFlag = false; | needCheckFlag = false; | ||
setTimeout(async () => { | setTimeout(async () => { | ||
disable(wpSave.attr("disabled", "disabled").val("正在保存...")); | disable(wpSave.attr("disabled", "disabled").val("正在保存......")); | ||
for (let i = 1; i <= 4; i++) { | for (let i = 1; i <= 4; i++) { | ||
try { | try { | ||
| 行 32: | 行 32: | ||
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(" 保 存 失败 !"); | ||
const pre = $("<pre/>", { | const pre = $("<pre/>", { | ||
css: { | css: { | ||
| 行 48: | 行 47: | ||
top: 0, | top: 0, | ||
}).appendTo("body"); | }).appendTo("body"); | ||
const selection = window.getSelection(); | const selection = window.getSelection(); | ||
const rangeCount = selection.rangeCount; | const rangeCount = selection.rangeCount; | ||
| 行 85: | 行 80: | ||
}).attr("title", conflictAlert)); | }).attr("title", conflictAlert)); | ||
} else { | } else { | ||
wpSave.val(" | wpSave.val("正在保存......"); | ||
editform.submit(); | editform.submit(); | ||
} | } | ||
| 行 92: | 行 87: | ||
} catch (e) { | } catch (e) { | ||
console.error("editConflict", e); | console.error("editConflict", e); | ||
wpSave.val(i <= 3 ? ` | wpSave.val(i <= 3 ? ` 保存 失败,正在重试(第${i}次)...` : " 保存 失败,请 检查您的网络!"); | ||
} | } | ||
} | } | ||