6 if (typeof foldersync ==
'undefined') {
13 foldersync.options = {
27 document.getElementById(
id).value =
value;
31 document.getElementById(
id).checked =
value;
35 var dtags = foldersync.preferences.getDefaultTags();
36 for (var tagname in dtags)
37 tx(
"foldersync-options-tags-" + tagname, dtags[tagname]);
39 var fallbacks = foldersync.preferences.getFallbacks();
40 for (var tagname in fallbacks)
41 ck(
"foldersync-options-tags-" + tagname +
"-fallback",
44 var
ui = foldersync.preferences.getUIPrefs();
45 ck(
"foldersync-options-ui-notification", ui.notifications.isEnabled);
46 ck(
"foldersync-options-ui-notification-exclusive", ui.notifications.
48 ck(
"foldersync-options-ui-show-favorite", ui.show.favorites);
49 ck(
"foldersync-options-ui-show-help", ui.show.help);
51 foldersync.central.logEvent(
"options",
52 "Getting preferences failed:\n\n" + e, 1,
53 "chrome://foldersync/content/dialogs/" +
54 "options.js", e.lineNumber);
62 var tx =
function(
id){
63 return document.getElementById(
id).value;
66 var ck =
function(
id){
67 return document.getElementById(
id).checked;
71 var dtags = foldersync.preferences.getDefaultTags();
72 for (var tagname in dtags)
73 dtags[tagname] = tx(
"foldersync-options-tags-" + tagname);
75 var fallbacks = foldersync.preferences.getFallbacks();
76 for (var tagname in fallbacks)
77 fallbacks[tagname] = ck(
"foldersync-options-tags-" + tagname +
80 var
ui = foldersync.preferences.getUIPrefs();
81 ui.notifications.isEnabled = ck(
"foldersync-options-ui-notification");
82 ui.notifications.onlyExclusive = ck(
"foldersync-options-ui-" +
83 "notification-exclusive");
84 ui.show.favorites = ck(
"foldersync-options-ui-show-favorite");
85 ui.show.help = ck(
"foldersync-options-ui-show-help");
87 foldersync.central.logEvent(
"options",
88 "Setting preferences failed:\n\n" + e, 1,
89 "chrome://foldersync/content/dialogs/" +
90 "options.js", e.lineNumber);
96 document.getElementById(
"foldersync-options-ui-notification-exclusive").
97 disabled = !document.getElementById(
"foldersync-options-ui-" +
98 "notification").checked;
99 document.getElementById(
"foldersync-options-tags-albumartist").
100 disabled = document.getElementById(
"foldersync-options-tags-" +
101 "albumartist-fallback").
106 onAccept:
function(){
115 if (
window.navigator.platform.slice(0,3) !=
"Win")
120 window.addEventListener(
"load",
122 foldersync.options.onLoad(e);
125 window.addEventListener(
"unload",
127 foldersync.options.onUnload(e);
function onUnload()
onUnload - called when the cover preview window unloads.