diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 08:00:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 08:00:07 +0000 |
commit | 71b1940231738aac70ede9ecb211614eae8873aa (patch) | |
tree | d42a8e658862d9e2c3d2ec144394170bc321f5a0 /content/manager/editAccountOverlay.js | |
parent | Initial commit. (diff) | |
download | eas4tbsync-190d2a3046e87d064a41dfdd9fb82853bcce99e0.tar.xz eas4tbsync-190d2a3046e87d064a41dfdd9fb82853bcce99e0.zip |
Adding upstream version 4.7.upstream/4.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | content/manager/editAccountOverlay.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/content/manager/editAccountOverlay.js b/content/manager/editAccountOverlay.js new file mode 100644 index 0000000..7fdc18f --- /dev/null +++ b/content/manager/editAccountOverlay.js @@ -0,0 +1,56 @@ +/* + * This file is part of EAS-4-TbSync. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +"use strict"; + +const eas = TbSync.providers.eas; + +var tbSyncEditAccountOverlay = { + + onload: function (window, accountData) { + this.accountData = accountData; + + // special treatment for configuration label, which is a permanent setting and will not change by switching modes + let configlabel = window.document.getElementById("tbsync.accountsettings.label.config"); + if (configlabel) { + configlabel.setAttribute("value", TbSync.getString("config.custom", "eas")); + } + }, + + stripHost: function (document) { + let host = document.getElementById('tbsync.AccountPropertys.pref.host').value; + if (host.indexOf("https://") == 0) { + host = host.replace("https://",""); + document.getElementById('tbsync.AccountPropertys.pref.https').checked = true; + this.accountData.setAccountProperty("https", true); + } else if (host.indexOf("http://") == 0) { + host = host.replace("http://",""); + document.getElementById('tbsync.AccountPropertys.pref.https').checked = false; + this.accountData.setAccountProperty("https", false); + } + + while (host.endsWith("/")) { host = host.slice(0,-1); } + document.getElementById('tbsync.AccountPropertys.pref.host').value = host + this.accountData.setAccountProperty("host", host); + }, + + deleteFolder: function() { + let folderList = document.getElementById("tbsync.accountsettings.folderlist"); + if (folderList.selectedItem !== null && !folderList.disabled) { + let folderData = folderList.selectedItem.folderData; + + //only trashed folders can be purged (for example O365 does not show deleted folders but also does not allow to purge them) + if (!eas.tools.parentIsTrash(folderData)) return; + + if (folderData.getFolderProperty("selected")) window.alert(TbSync.getString("deletefolder.notallowed::" + folderData.getFolderProperty("foldername"), "eas")); + else if (window.confirm(TbSync.getString("deletefolder.confirm::" + folderData.getFolderProperty("foldername"), "eas"))) { + folderData.sync({syncList: false, syncJob: "deletefolder"}); + } + } + } +}; |