polish welcome screen

This commit is contained in:
fyears 2024-03-17 21:05:30 +08:00
parent 7ec0102c7a
commit d51659d3d1
5 changed files with 40 additions and 9 deletions

View File

@ -9,4 +9,4 @@
- [x] migration: old data auto transfer to new db (hopefully)
- [ ] partial sync: force push
- [ ] partial sync: force pull
- [ ] sync protection: warning based on the threshold
- [x] sync protection: warning based on the threshold

View File

@ -293,9 +293,10 @@
"settings_resetcache_desc": "Reset local internal caches/databases (for debugging purposes). You would want to reload the plugin after resetting this. This option will not empty the {s3, password...} settings.",
"settings_resetcache_button": "Reset",
"settings_resetcache_notice": "Local internal cache/databases deleted. Please manually reload the plugin.",
"syncalgov3_title": "Remotely Save has HUGE update on sync algorithm",
"syncalgov3_texts": "Welcome to use Remotely Save!\nFrom this version, a new algorithm has been developed: More robust deletion sync, basic conflict handling, no more meta data uploaded... Stay tune for more! A full introduction is in the <a href='https://github.com/remotely-save/remotely-save/tree/master/docs/sync_algorithm/v3/intro.md'>doc website</a>.\nIf you agree to use thew new version and algorithm, plase check \"I WILL BACKUP MY VAULT MANUALLY FIRSTLY.\" then click the \"Agree\" button, and enjoy the plugin!\nIf you do not agree, please click the \"Do Not Agree\" button, the plugin will unload itself, and you need to manually disable it in Obsidian settings.",
"syncalgov3_checkbox_manual_backup": "I WILL BACKUP MY VAULT MANUALLY FIRSTLY.",
"syncalgov3_title": "Remotely Save has a HUGE update on the sync algorithm",
"syncalgov3_texts": "Welcome to use Remotely Save!\nFrom this version, a new algorithm has been developed: More robust deletion sync, minimal conflict handling, no meta data uploaded any more, deletion / modification protection... Stay tune for more! A full introduction is in the <a href='https://github.com/remotely-save/remotely-save/tree/master/docs/sync_algorithm/v3/intro.md'>doc website</a>.\nIf you agree to use this, please read and check two checkboxes then click the \"Agree\" button, and enjoy the plugin!\nIf you do not agree, please click the \"Do Not Agree\" button, the plugin will unload itself.\nAlso, please consider <a href='https://github.com/remotely-save/remotely-save'>visit the GitHub repo and star ⭐ it</a>! Or even <a href='https://github.com/remotely-save/donation'>buy me a coffee</a>. Your support is very important to me! Thanks!",
"syncalgov3_checkbox_manual_backup": "I will backup my vault manually firstly.",
"syncalgov3_checkbox_requiremultidevupdate": "I understand I need to update the plugin ACROSS ALL DEVICES to make them work properly.",
"syncalgov3_button_agree": "Agree",
"syncalgov3_button_disagree": "Do Not Agree"
}

View File

@ -294,8 +294,9 @@
"settings_resetcache_button": "重设",
"settings_resetcache_notice": "本地同步缓存和数据库已被删除。请手动重新载入此插件。",
"syncalgov3_title": "Remotely Save 的同步算法有重大更新",
"syncalgov3_texts": "欢迎使用 Remotely Save\n从这个版本开始插件更新了同步算法更稳健的删除同步、引入冲突处理、避免上传元数据…… 敬请期待更多更新!详细介绍请参阅 <a href='https://github.com/remotely-save/remotely-save/tree/master/docs/sync_algorithm/v3/intro.md'>文档网站</a>。\n如果您同意使用新版本和算法请勾选“我将会手动备份我的库Vault然后点击“同意”按钮开始使用插件吧\n如果您不同意请点击“不同意”按钮插件将自动停止运行unload然后您需要 Obsidian 设置里手动停用disable此插件。",
"syncalgov3_checkbox_manual_backup": "我将会手动备份我的库Vault",
"syncalgov3_texts": "欢迎使用 Remotely Save\n从这个版本开始插件更新了同步算法更稳健的删除同步、引入冲突处理、避免上传元数据、修改删除保护…… 敬请期待更多更新!详细介绍请参阅<a href='https://github.com/remotely-save/remotely-save/tree/master/docs/sync_algorithm/v3/intro.md'>文档网站</a>。\n如果您同意使用新版本请阅读和勾选两个勾选框然后点击“同意”按钮开始使用插件吧\n如果您不同意请点击“不同意”按钮插件将自动停止运行unload。\n此外请考虑<a href='https://github.com/remotely-save/remotely-save'>访问 GitHub 页面然后点赞 ⭐</a>!您的支持对我十分重要!谢谢!",
"syncalgov3_checkbox_manual_backup": "我将会首先手动备份我的库Vault。",
"syncalgov3_checkbox_requiremultidevupdate": "我理解,我需要在所有设备上都更新此插件使之正常运行。",
"syncalgov3_button_agree": "同意",
"syncalgov3_button_disagree": "不同意"
}

View File

@ -294,8 +294,9 @@
"settings_resetcache_button": "重設",
"settings_resetcache_notice": "本地同步快取和資料庫已被刪除。請手動重新載入此外掛。",
"syncalgov3_title": "Remotely Save 的同步演算法有重大更新",
"syncalgov3_texts": "歡迎使用 Remotely Save\n從這個版本開始外掛更新了同步演算法更穩健的刪除同步、引入衝突處理、避免上傳元資料…… 敬請期待更多更新!詳細介紹請參閱 <a href='https://github.com/remotely-save/remotely-save/tree/master/docs/sync_algorithm/v3/intro.md'>文件網站</a>。\n如果您同意使用新版本和演算法請勾選“我將會手動備份我的庫Vault然後點選“同意”按鈕開始使用外掛吧\n如果您不同意請點選“不同意”按鈕外掛將自動停止執行unload然後您需要 Obsidian 設定裡手動停用disable此外掛。",
"syncalgov3_checkbox_manual_backup": "我將會手動備份我的庫Vault",
"syncalgov3_texts": "歡迎使用 Remotely Save\n從這個版本開始外掛更新了同步演算法更穩健的刪除同步、引入衝突處理、避免上傳元資料、修改刪除保護…… 敬請期待更多更新!詳細介紹請參閱<a href='https://github.com/remotely-save/remotely-save/tree/master/docs/sync_algorithm/v3/intro.md'>文件網站</a>。\n如果您同意使用新版本請閱讀和勾選兩個勾選框然後點選“同意”按鈕開始使用外掛吧\n如果您不同意請點選“不同意”按鈕外掛將自動停止執行unload。\n此外請考慮<a href='https://github.com/remotely-save/remotely-save'>訪問 GitHub 頁面然後點贊 ⭐</a>!您的支援對我十分重要!謝謝!",
"syncalgov3_checkbox_manual_backup": "我將會首先手動備份我的庫Vault。",
"syncalgov3_checkbox_requiremultidevupdate": "我理解,我需要在所有裝置上都更新此外掛使之正常執行。",
"syncalgov3_button_agree": "同意",
"syncalgov3_button_disagree": "不同意"
}

View File

@ -7,12 +7,14 @@ import { stringToFragment } from "./misc";
export class SyncAlgoV3Modal extends Modal {
agree: boolean;
manualBackup: boolean;
requireUpdateAllDev: boolean;
readonly plugin: RemotelySavePlugin;
constructor(app: App, plugin: RemotelySavePlugin) {
super(app);
this.plugin = plugin;
this.agree = false;
this.manualBackup = false;
this.requireUpdateAllDev = false;
}
onOpen() {
let { contentEl } = this;
@ -36,6 +38,7 @@ export class SyncAlgoV3Modal extends Modal {
// code modified partially from BART released under MIT License
contentEl.createDiv("modal-button-container", (buttonContainerEl) => {
let agreeBtn: HTMLButtonElement | undefined = undefined;
buttonContainerEl.createEl(
"label",
{
@ -50,7 +53,7 @@ export class SyncAlgoV3Modal extends Modal {
checkboxEl.addEventListener("click", () => {
this.manualBackup = checkboxEl.checked;
if (agreeBtn !== undefined) {
if (checkboxEl.checked) {
if (this.manualBackup && this.requireUpdateAllDev) {
agreeBtn.removeAttribute("disabled");
} else {
agreeBtn.setAttr("disabled", true);
@ -61,6 +64,31 @@ export class SyncAlgoV3Modal extends Modal {
}
);
buttonContainerEl.createEl(
"label",
{
cls: "mod-checkbox",
},
(labelEl) => {
const checkboxEl = labelEl.createEl("input", {
attr: { tabindex: -1 },
type: "checkbox",
});
checkboxEl.checked = this.requireUpdateAllDev;
checkboxEl.addEventListener("click", () => {
this.requireUpdateAllDev = checkboxEl.checked;
if (agreeBtn !== undefined) {
if (this.manualBackup && this.requireUpdateAllDev) {
agreeBtn.removeAttribute("disabled");
} else {
agreeBtn.setAttr("disabled", true);
}
}
});
labelEl.appendText(t("syncalgov3_checkbox_requiremultidevupdate"));
}
);
agreeBtn = buttonContainerEl.createEl("button", {
attr: { type: "button" },
cls: "mod-cta",