6 if (typeof foldersync ==
'undefined') {
13 foldersync.saveprofile = {
21 this.reloadProfiles();
25 onRChange:
function(e){
26 var rGroup = document.getElementById(
"foldersync-saveprofile-radio");
27 var nName = document.getElementById(
"foldersync-saveprofile-new-name");
28 var uList = document.getElementById(
"foldersync-savedprofile-" +
30 if (rGroup.selectedIndex == 0){
31 nName.disabled =
false;
32 uList.disabled =
true;
34 nName.disabled =
true;
35 uList.disabled =
false;
41 var rGroup = document.getElementById(
"foldersync-saveprofile-radio");
42 var nName = document.getElementById(
"foldersync-saveprofile-new-name");
43 var uList = document.getElementById(
"foldersync-savedprofile-" +
45 window.arguments[0].action = rGroup.selectedIndex == 0 ?
"new" :
"update";
46 window.arguments[0].profile = uList.selectedItem.value;
47 window.arguments[0].name = nName.value;
52 onNameFocus:
function(){
53 if (!this._clearedName){
54 document.getElementById(
"foldersync-saveprofile-new-name").value =
"";
55 this._clearedName =
true;
60 reloadProfiles:
function(){
62 var uList = document.getElementById(
"foldersync-savedprofile-" +
64 var popup = document.getElementById(
"foldersync-savedprofile-" +
65 "update-profile-popup");
67 var cSelection =
null;
68 var cIndex = uList.selectedIndex;
70 cSelection = popup.childNodes[cIndex].value;
72 while (popup.childNodes.length > 0)
73 popup.removeChild(popup.childNodes[0]);
76 var profiles = foldersync.preferences.getProfiles();
77 for each (var profile
in profiles){
80 var
node = document.createElement(
"menuitem");
81 node.value = profile.GUID;
82 node.setAttribute(
"label", profile.name);
83 popup.appendChild(node);
85 if (cSelection == node.value){
86 uList.selectedItem =
node;
92 uList.selectedIndex = 0;
94 foldersync.central.logEvent(
"saveprofile",
95 "Loading Profiles failed:\n\n" + e, 1,
96 "chrome://foldersync/content/" +
97 "dialogs/saveprofile.js", e.lineNumber);
107 window.addEventListener(
"load",
109 foldersync.saveprofile.onLoad(e);
112 window.addEventListener(
"unload",
114 foldersync.saveprofile.onUnload(e);
function onUnload()
onUnload - called when the cover preview window unloads.