summaryrefslogtreecommitdiffstats
path: root/mailnews/extensions/newsblog/content/am-newsblog.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
commit302bf1b523012e11b60425d6eee1221ebc2724eb (patch)
treeb191a895f8716efcbe42f454f37597a545a6f421 /mailnews/extensions/newsblog/content/am-newsblog.js
parent21b3f6247403c06f85e1f45d219f87549862198f (diff)
downloadUXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.gz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.lz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.xz
UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.zip
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
Diffstat (limited to 'mailnews/extensions/newsblog/content/am-newsblog.js')
-rw-r--r--mailnews/extensions/newsblog/content/am-newsblog.js63
1 files changed, 63 insertions, 0 deletions
diff --git a/mailnews/extensions/newsblog/content/am-newsblog.js b/mailnews/extensions/newsblog/content/am-newsblog.js
new file mode 100644
index 000000000..674280f81
--- /dev/null
+++ b/mailnews/extensions/newsblog/content/am-newsblog.js
@@ -0,0 +1,63 @@
+/* -*- Mode: JavaScript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * 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/. */
+
+Components.utils.import("resource:///modules/FeedUtils.jsm");
+
+var gServer, autotagEnable, autotagUsePrefix, autotagPrefix;
+
+function onInit(aPageId, aServerId)
+{
+ var accountName = document.getElementById("server.prettyName");
+ var title = document.getElementById("am-newsblog-title");
+ var defaultTitle = title.getAttribute("defaultTitle");
+
+ var titleValue;
+ if (accountName.value)
+ titleValue = defaultTitle + " - <" + accountName.value + ">";
+ else
+ titleValue = defaultTitle;
+
+ title.setAttribute("title", titleValue);
+ document.title = titleValue;
+
+ onCheckItem("server.biffMinutes", ["server.doBiff"]);
+
+ autotagEnable = document.getElementById("autotagEnable");
+ autotagUsePrefix = document.getElementById("autotagUsePrefix");
+ autotagPrefix = document.getElementById("autotagPrefix");
+
+ let categoryPrefsAcct = FeedUtils.getOptionsAcct(gServer).category;
+ autotagEnable.checked = categoryPrefsAcct.enabled;
+ autotagUsePrefix.disabled = !autotagEnable.checked;
+ autotagUsePrefix.checked = categoryPrefsAcct.prefixEnabled;
+ autotagPrefix.disabled = autotagUsePrefix.disabled || !autotagUsePrefix.checked;
+ autotagPrefix.value = categoryPrefsAcct.prefix;
+}
+
+function onPreInit(account, accountValues)
+{
+ gServer = account.incomingServer;
+}
+
+function setCategoryPrefs(aNode)
+{
+ let options = FeedUtils.getOptionsAcct(gServer);
+ switch (aNode.id) {
+ case "autotagEnable":
+ options.category.enabled = aNode.checked;
+ autotagUsePrefix.disabled = !aNode.checked;
+ autotagPrefix.disabled = !aNode.checked || !autotagUsePrefix.checked;
+ break;
+ case "autotagUsePrefix":
+ options.category.prefixEnabled = aNode.checked;
+ autotagPrefix.disabled = aNode.disabled || !aNode.checked;
+ break;
+ case "autotagPrefix":
+ options.category.prefix = aNode.value;
+ break;
+ }
+
+ FeedUtils.setOptionsAcct(gServer, options)
+}