6 if (typeof foldersync ==
'undefined') {
13 foldersync.accesspane = {
26 _updateCrt:
function(text,progress,
sync,
fail){
28 document.getElementById(
"foldersync-current-box").setAttribute(
"style",
"");
30 document.getElementById(
"foldersync-current-cancel").
33 document.getElementById(
"foldersync-current-details").
36 document.getElementById(
"foldersync-current-state").value = text;
37 document.getElementById(
"foldersync-current-progress").
40 document.getElementById(
"foldersync-current-progress").
41 value = progress ? progress : 0;
45 _updateQueue:
function(){
46 var numQueued = foldersync.sync.getQueue().length;
49 document.getElementById(
"foldersync-queue-box").
52 var
msg = foldersync.central.getLocaleString(
"status.queued");
53 msg = msg.replace(
"%d", numQueued);
54 document.getElementById(
"foldersync-queue-state").value =
msg;
57 document.getElementById(
"foldersync-queue-box").
63 _listener:
function(state,
object) {
65 if ((state.event ==
"added") || (state.event ==
"removed") ||
66 (state.event ==
"started"))
67 foldersync.accesspane._updateQueue();
70 if ((state.event ==
"started") ||
71 (state.event ==
"initing")){
72 msg = foldersync.central.getLocaleString(
"status.init");
73 msg +=
": " +
object.sync.targetFolder;
74 foldersync.accesspane._updateCrt(msg,
null,
true,
false);
76 if ((state.event ==
"started-sync")||
77 (state.event ==
"status-update")){
78 msg = foldersync.central.getLocaleString(
"status.sync");
79 msg +=
": " +
object.sync.targetFolder;
80 foldersync.accesspane._updateCrt(msg, state.value,
true,
false);
82 if (state.event ==
"completed"){
83 msg = foldersync.central.getLocaleString(
"status.completed");
84 msg +=
": " +
object.sync.targetFolder;
85 foldersync.accesspane._updateCrt(msg, state.value,
false,
false);
87 if (state.event ==
"cancelled"){
88 msg = foldersync.central.getLocaleString(
"status.cancelled");
89 msg +=
": " +
object.sync.targetFolder;
90 foldersync.accesspane._updateCrt(msg, state.value,
false,
false);
92 document.getElementById(
"foldersync-current-cancel").
95 document.getElementById(
"foldersync-current-progress").
98 var error = foldersync.sync.generateErrorMessage(state);
100 msg = error.error +
": " +
object.sync.targetFolder;
101 foldersync.accesspane._updateCrt(msg, 100,
false,
true);
103 foldersync.accesspane._details = error;
107 if (foldersync.accesspane._cancel)
108 if ((state.event ==
"started-sync") ||
109 (state.event ==
"status-update")){
110 object.cancel =
true;
111 foldersync.accesspane._cancel =
false;
115 if (!(error || (state.event ==
"completed")))
117 var fNotify = document.getElementById(
"foldersync-current-notification");
120 var level = error ? (error.fatal ? 8 : 5) : 2;
121 fNotify.appendNotification(msg,
123 "chrome://foldersync/skin/node.png",
128 foldersync.accesspane.
131 label: foldersync.central.
133 "notification.details"),
140 foldersync.central.logEvent(
"accesspane",
"Accesspane controller " +
141 "initialisation started.", 5);
143 foldersync.sync.addListener(this._listener);
145 foldersync.central.registerUI();
147 var
ui = foldersync.preferences.getUIPrefs();
149 var hide =
function(
id){
150 document.getElementById(
id).setAttribute(
"style",
"display:none");
152 if (ui.show.favorites)
154 this.favorite._init();
157 hide(
"foldersync-favorite-box");
158 hide(
"foldersync-direct-add");
159 hide(
"foldersync-direct-update");
163 hide(
"foldersync-help-box");
165 this.profile._init();
167 this.playlists._init();
170 this.
target.setFolder(ui.lastUI.target);
171 this.playlists.setGUIDs(ui.lastUI.playlists);
172 var profile = foldersync.preferences.getProfileByGUID(ui.lastUI.profile);
174 this.profile.setProfile(profile);
176 foldersync.central.logEvent(
"accesspane",
177 "There is no valid Profile avaiable " +
178 "for last UI. Skip Profile restore. ", 2,
179 "chrome://foldersync/content/" +
183 if (foldersync.sync.isSyncing()){
185 this._updateCrt(
"",
null,
true,
false);
189 foldersync.central.logEvent(
"accesspane",
190 "Accesspane controller started.", 4);
195 foldersync.central.logEvent(
"accesspane",
"Accesspane controller " +
196 "shutdown started.", 5);
198 foldersync.sync.removeListener(this._listener);
201 var
ui = foldersync.preferences.getUIPrefs();
205 var oProfile = foldersync.preferences.getProfileByGUID(ui.lastUI.profile);
206 if (oProfile && !oProfile.visible)
207 foldersync.preferences.removeProfile(oProfile);
209 ui.lastUI.target = this.
target.getFolder();
210 ui.lastUI.playlists = this.playlists.getGUIDs();
211 ui.lastUI.profile = this.profile.getGUID();
212 foldersync.preferences.
213 getProfileByGUID(ui.lastUI.profile).temporary =
false;
216 foldersync.central.unregisterUI();
217 foldersync.central.logEvent(
"accesspane",
218 "Accesspane controller stopped.", 4);
222 cancelSync:
function(){
224 document.getElementById(
"foldersync-current-cancel").
229 cancelQueue:
function(){
231 var queue = foldersync.sync.getQueue();
232 for each (var e
in queue)
233 foldersync.sync.removeFromQueue(e);
235 foldersync.central.logEvent(
"accesspane",
236 "Cancelling queue failed:\n\n" + e, 1,
237 "chrome://foldersync/content/accesspane.js",
245 showDetails:
function(error){
248 aError = this._details;
250 foldersync.central.showDialog(aError.error,
253 foldersync.central.logEvent(
"accesspane",
254 "showDetails has no details to show", 2,
255 "chrome://foldersync/content/accesspane.js");
259 startSync:
function(){
261 var sync = this.getSync();
262 foldersync.sync.performSync(sync);
264 foldersync.central.logEvent(
"accesspane",
265 "Starting Sync failed:\n\n" + e, 1,
266 "chrome://foldersync/content/accesspane.js",
274 return foldersync.sync.generateSync(this.
target.getFolder(),
275 this.profile.getGUID(),
276 this.playlists.getGUIDs());
278 foldersync.central.logEvent(
"accesspane",
279 "Generating Sync failed:\n\n" + e, 1,
280 "chrome://foldersync/content/accesspane.js",
289 document.getElementById(
"foldersync-profile-box").
291 document.getElementById(
"foldersync-profile-collapse").
297 document.getElementById(
"foldersync-profile-box").
299 document.getElementById(
"foldersync-profile-collapse").
304 onChange:
function(){
305 document.getElementById(
"foldersync-profile").selectedIndex = 0;
306 this.changeProfile();
309 foldersync.accesspane.favorite.onChange();
313 openAvailableTags:
function(){
315 window.openDialog(
"chrome://foldersync/content/dialogs/" +
317 "foldersync-availabletags-dialog",
318 "dialog=yes,modal=no,alwaysLowered=no," +
319 "centerscreen=yes,resizable=yes,dependent=yes");
321 foldersync.central.logEvent(
"accesspane-profile",
322 "Open Available Tag Dialog failed:\n\n" +
323 e, 1,
"chrome://foldersync/content/" +
324 "accesspane.js", e.lineNumber);
332 _enableArea:
function(area, enabled){
334 if (area.nodeName !=
"caption")
335 area.disabled = !enabled;
336 for each (var child
in area.childNodes)
337 this._enableArea(child, enabled);
341 updateArea:
function(){
343 var ea =
function(
id, cid){
344 var
self = foldersync.accesspane.profile;
345 self._enableArea(document.getElementById(
id),
346 document.getElementById(cid).checked);
348 ea(
"foldersync-structure",
"foldersync-basic-struct");
349 ea(
"foldersync-tab-structure",
"foldersync-basic-struct");
350 ea(
"foldersync-playlists",
"foldersync-basic-plists");
351 ea(
"foldersync-tab-playlists",
"foldersync-basic-plists");
352 ea(
"foldersync-structure-cover-box",
"foldersync-structure-covers");
353 ea(
"foldersync-playlists-sort-box",
"foldersync-playlists-sort");
359 reloadProfiles:
function(selection){
362 var cSelection = selection;
363 var cIndex = document.getElementById(
"foldersync-profile").
365 var popup = document.getElementById(
"foldersync-profile-popup");
366 if ((!selection) && (cIndex > 0))
367 cSelection = popup.childNodes[cIndex].value;
369 while (popup.childNodes.length > 1)
370 popup.removeChild(popup.childNodes[1]);
372 var selected =
false;
373 var profiles = foldersync.preferences.getProfiles();
374 for each (var profile
in profiles){
375 if (!profile.visible)
377 var
node = document.createElement(
"menuitem");
378 node.value = profile.GUID;
379 node.setAttribute(
"label", profile.name);
380 popup.appendChild(node);
382 if (cSelection == node.value){
383 document.getElementById(
"foldersync-profile").selectedItem =
node;
389 document.getElementById(
"foldersync-profile").selectedIndex = 0;
391 this.changeProfile();
393 foldersync.central.logEvent(
"accesspane-profile",
394 "Loading Profiles failed:\n\n" + e, 1,
395 "chrome://foldersync/content/" +
396 "accesspane.js", e.lineNumber);
404 var pflist = document.
406 var pfs = foldersync.sync.getPFormats();
407 for each (var pf
in pfs){
408 var
node = pflist.appendChild(document.createElement(
"menuitem"));
409 node.value = pf.internalName;
410 node.setAttribute(
"label", foldersync.central.
411 getLocaleString(pf.name));
414 this.reloadProfiles();
416 document.getElementById(
"foldersync-profile").selectedIndex = 1;
417 if (document.getElementById(
"foldersync-profile").selectedIndex == -1){
419 foldersync.preferences.createProfile(foldersync.central.
420 getLocaleString(
"profile.defaultname"));
422 this.reloadProfiles();
423 document.getElementById(
"foldersync-profile").selectedIndex = 1;
425 this.changeProfile();
429 foldersync.central.logEvent(
"accesspane-profile",
430 "Init Profiles failed:\n\n" + e, 1,
431 "chrome://foldersync/content/" +
432 "accesspane.js", e.lineNumber);
439 _readProfile:
function(profile){
443 document.getElementById(
id).checked =
value;
447 document.getElementById(
id).value =
value;
451 for each (var
node in document.getElementById(
id).childNodes[0].
453 if (node.value ==
value)
454 document.getElementById(
id).selectedItem =
node;
458 ck(
"foldersync-basic-update", profile.flags.doUpdate);
459 ck(
"foldersync-basic-delete", profile.flags.doDelete);
460 ck(
"foldersync-basic-rockbox", profile.flags.doRockbox);
461 ck(
"foldersync-basic-struct", profile.structure.isEnabled);
462 ck(
"foldersync-basic-plists", profile.playlists.isEnabled);
465 tx(
"foldersync-structure-schema", profile.structure.schema);
466 tx(
"foldersync-structure-tndigits", profile.structure.tnDigits);
467 ck(
"foldersync-structure-covers", profile.structure.doCovers);
468 tx(
"foldersync-structure-cover-schema", profile.structure.
470 tx(
"foldersync-structure-cover-file", profile.structure.coverFile);
473 ml(
"foldersync-playlists-format", profile.playlists.format);
474 ml(
"foldersync-playlists-encoding", profile.playlists.encoding);
475 tx(
"foldersync-playlists-target", profile.playlists.toFolder);
476 ck(
"foldersync-playlists-relpoint", profile.playlists.
478 tx(
"foldersync-playlists-split", profile.playlists.splitChar);
479 ck(
"foldersync-playlists-sort", profile.playlists.isSorted);
480 tx(
"foldersync-playlists-sortingscheme", profile.playlists.
484 ck(
"foldersync-advanced-case", profile.advanced.compareCase);
485 tx(
"foldersync-advanced-blocked", profile.advanced.blockedChars);
486 tx(
"foldersync-advanced-replace", profile.advanced.replaceChar);
487 ck(
"foldersync-advanced-cutReplace", profile.advanced.cutReplaced);
488 ck(
"foldersync-advanced-cutSpaces", profile.advanced.cutSpaces);
489 tx(
"foldersync-advanced-length", profile.advanced.fMaxLength);
491 foldersync.central.logEvent(
"accesspane-profile",
492 "Reading data from Profile failed:" +
493 "\n\n" + e, 1,
"chrome://foldersync/" +
494 "content/accesspane.js", e.lineNumber);
499 changeProfile:
function(){
501 var profileNode = document.getElementById(
"foldersync-profile");
502 var popup = document.getElementById(
"foldersync-profile-popup");
504 var customized = profileNode.selectedIndex > 0 ?
false :
true;
505 document.getElementById(
"foldersync-profile-savedelete").
506 selectedIndex = customized ? 0 : 1;
507 var dProf = profileNode.selectedIndex == 1;
508 document.getElementById(
"foldersync-profile-delete").disabled = dProf;
511 var guid = profileNode.selectedItem.value;
512 var profile = foldersync.preferences.getProfileByGUID(guid);
515 this._readProfile(profile);
523 foldersync.central.logEvent(
"accesspane-profile",
524 "Changing Profile failed:\n\n" + e, 1,
525 "chrome://foldersync/content/" +
526 "accesspane.js", e.lineNumber);
533 var profileNode = document.getElementById(
"foldersync-profile");
534 var popup = document.getElementById(
"foldersync-profile-popup");
535 var customized = !(profileNode.selectedIndex > 0);
537 throw Components.Exception(
"Custom Profile can't get deleted");
538 var defaultProfile = profileNode.selectedIndex == 1;
540 throw Components.Exception(
"Default Profile can't get deleted");
541 var guid = profileNode.selectedItem.value;
542 var profile = foldersync.preferences.getProfileByGUID(guid);
544 var
msg = foldersync.central.getLocaleString(
"delete.sure");
545 msg = msg.replace(
"%s", profile.name);
550 profile.temporary =
true;
551 profile.visible =
false;
553 this.reloadProfiles();
555 foldersync.central.logEvent(
"accesspane-profile",
556 "Marking Profile for deletion failed:" +
557 "\n\n" + e, 1,
"chrome://foldersync/" +
558 "content/accesspane.js", e.lineNumber);
565 _writeProfile:
function(profile){
568 var ck =
function (
id){
569 return document.getElementById(
id).checked;
572 var tx =
function (
id){
573 return document.getElementById(
id).value;
576 var ti =
function(
id){
577 return document.getElementById(
id).value*1;
580 var ml =
function(
id){
581 return document.getElementById(
id).selectedItem.value;
585 profile.flags.doUpdate = ck(
"foldersync-basic-update");
586 profile.flags.doDelete = ck(
"foldersync-basic-delete");
587 profile.flags.doRockbox = ck(
"foldersync-basic-rockbox");
588 profile.structure.isEnabled = ck(
"foldersync-basic-struct");
589 profile.playlists.isEnabled = ck(
"foldersync-basic-plists");
592 profile.structure.schema = tx(
"foldersync-structure-schema");
593 profile.structure.tnDigits = ti(
"foldersync-structure-tndigits");
594 profile.structure.doCovers = ck(
"foldersync-structure-covers");
595 profile.structure.coverSchema = tx(
"foldersync-structure-cover-" +
597 profile.structure.coverFile = tx(
"foldersync-structure-cover-file");
600 profile.playlists.format = ml(
"foldersync-playlists-format");
601 profile.playlists.encoding = ml(
"foldersync-playlists-encoding");
602 profile.playlists.toFolder = tx(
"foldersync-playlists-target");
603 profile.playlists.doRelativePoint = ck(
"foldersync-playlists-" +
605 profile.playlists.splitChar = tx(
"foldersync-playlists-split");
606 profile.playlists.isSorted = ck(
"foldersync-playlists-sort");
607 profile.playlists.sortingScheme = tx(
"foldersync-playlists-" +
611 profile.advanced.compareCase = ck(
"foldersync-advanced-case");
612 profile.advanced.blockedChars = tx(
"foldersync-advanced-blocked");
613 profile.advanced.replaceChar = tx(
"foldersync-advanced-replace");
614 profile.advanced.cutReplaced = ck(
"foldersync-advanced-cutReplace");
615 profile.advanced.cutSpaces = ck(
"foldersync-advanced-cutSpaces");
616 profile.advanced.fMaxLength = ti(
"foldersync-advanced-length");
618 foldersync.central.logEvent(
"accesspane-profile",
619 "Writing data to Profile failed:" +
620 "\n\n" + e, 1,
"chrome://foldersync/" +
621 "content/accesspane.js", e.lineNumber);
628 window.openDialog(
'chrome://foldersync/content/dialogs/saveprofile.xul',
629 'foldersync-saveprofile-dialog',
630 'dialog=yes,modal=yes,centerscreen=yes,resizable=no,' +
631 'dependent=yes', result);
634 if (result.action ==
"new"){
635 profile = foldersync.preferences.createProfile(result.name);
637 profile = foldersync.preferences.getProfileByGUID(result.profile);
640 this._writeProfile(profile);
642 this.reloadProfiles(profile.GUID);
649 setProfile:
function(profile){
651 var list = document.getElementById(
"foldersync-profile");
652 var popup = document.getElementById(
"foldersync-profile-popup");
653 for each (var
node in popup.childNodes)
654 if (profile.GUID == node.value){
655 list.selectedItem =
node;
656 this.changeProfile();
660 this._readProfile(profile);
661 list.selectedIndex = 0;
662 this.changeProfile();
667 var cIndex = document.getElementById(
"foldersync-profile").selectedIndex;
669 return document.getElementById(
"foldersync-profile").
673 foldersync.central.logEvent(
"accesspane-profile",
674 "Create temporary Profile", 4);
676 var profile = foldersync.preferences.createProfile(
"Internal");
677 profile.temporary =
true;
678 profile.visible =
false;
679 this._writeProfile(profile);
682 foldersync.central.logEvent(
"accesspane-profile",
683 "Creating temporary Profile failed:" +
684 "\n\n" + e, 1,
"chrome://foldersync/" +
685 "content/accesspane.js", e.lineNumber);
694 getFolder:
function(){
695 return document.getElementById(
"foldersync-target").value;
699 onChange:
function(){
701 foldersync.accesspane.favorite.onChange();
707 setFolder:
function(folder){
708 document.getElementById(
"foldersync-target").value = folder;
715 var fp = Components.classes[
"@mozilla.org/filepicker;1"].
717 fp.init(
window, foldersync.central.getLocaleString(
"browse.info"),
718 Components.interfaces.nsIFilePicker.modeGetFolder);
722 if ((ret == Components.interfaces.nsIFilePicker.returnOK) ||
723 (ret == Components.interfaces.nsIFilePicker.returnReplace)) {
726 this.setFolder(file.path);
735 var list = document.getElementById(
"foldersync-playlists-list");
738 for (var
i = 0;
i < list.childNodes.length;
i++){
739 var
node = list.childNodes[
i];
740 if (node.getAttribute(
"checked") ==
"true")
741 result.push(node.value);
749 setGUIDs:
function(guids){
750 var list = document.getElementById(
"foldersync-playlists-list");
751 for (var
i = 0;
i < list.childNodes.length;
i++){
752 var
node = list.childNodes[
i];
753 node.setAttribute(
"checked",
"false");
754 for each (var guid
in guids)
755 if (guid ==
node.value)
756 node.setAttribute(
"checked",
"true");
767 var list = document.getElementById(
"foldersync-playlists-list");
768 while (list.childNodes.length > 0)
769 list.removeChild(list.childNodes[0]);
771 var plists = foldersync.central.getPlaylists(
true,
true);
772 for each (var plist
in plists){
773 var
node = list.appendChild(document.createElement(
"listitem"));
774 node.setAttribute(
"label", plist.name);
775 node.value = plist.guid;
776 node.setAttribute(
"type",
"checkbox");
779 for each (var
node in list.childNodes)
780 for each (var guid
in oldSelection)
781 if (node.value == guid)
782 node.setAttribute(
"checked",
"true");
788 onChange:
function(){
790 foldersync.accesspane.favorite.onChange();
796 calcSize:
function(){
800 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
802 var playlistGUIDs = foldersync.accesspane.playlists.getGUIDs();
804 var useAll = (document.getElementById(
"foldersync-basic-struct").
806 (document.getElementById(
"foldersync-structure-schema").
807 value.split(
"%playlist%").length > 1);
811 for each (var guid
in playlistGUIDs){
812 var playlist = foldersync.central.getPlaylistByGUID(guid);
815 for (var
i = 0;
i < playlist.length;
i++){
816 var track = playlist.getItemByIndex(
i);
818 var trackURL = track.getProperty(SBProperties.contentURL);
820 for each (var had
in hadFiles)
826 hadFiles.push(trackURL);
827 size += track.getProperty(SBProperties.contentLength)*1;
833 size = size / 1024 / 1024;
835 var text = foldersync.central.getLocaleString(
"playlists.size");
837 text = text.replace(
"%s", size.toFixed(2)+
" MB");
839 text = text.replace(
"%s", (size/1024).toFixed(2)+
" GB");
843 var
label = document.getElementById(
"foldersync-space");
844 while (label.childNodes.length > 0)
845 label.removeChild(label.childNodes[0]);
846 label.appendChild(document.createTextNode(text));
848 foldersync.central.logEvent(
"accesspane-playlists",
849 "Calculating Size failed:\n\n" + e,
850 1,
"chrome://foldersync/content/" +
851 "accesspane.js", e.lineNumber);
866 reloadFavorites:
function(selection){
869 var cSelection = selection;
870 var cIndex = document.getElementById(
"foldersync-favorites").
872 var popup = document.getElementById(
"foldersync-favorites-popup");
873 if ((!selection) && (cIndex > 0))
874 cSelection = popup.childNodes[cIndex].value;
876 while (popup.childNodes.length > 1)
877 popup.removeChild(popup.childNodes[1]);
879 var selected =
false;
880 var favorites = foldersync.preferences.getFavorites();
881 for each (var fav
in favorites){
882 var
node = document.createElement(
"menuitem");
883 node.value = fav.GUID;
884 node.setAttribute(
"label", fav.name);
885 popup.appendChild(node);
887 if (cSelection == node.value){
888 document.getElementById(
"foldersync-favorites").
895 document.getElementById(
"foldersync-favorites").selectedIndex = 0;
897 this.changeFavorite(!document.getElementById(
"foldersync-favorites").
898 selectedIndex,
true);
900 foldersync.central.logEvent(
"accesspane-favorite",
901 "Loading Favorites failed:\n\n" + e, 1,
902 "chrome://foldersync/content/" +
903 "accesspane.js", e.lineNumber);
909 this.reloadFavorites();
913 onChange:
function(){
916 document.getElementById(
"foldersync-favorite-load").
924 changeFavorite:
function(
empty, dontload){
925 document.getElementById(
"foldersync-favorite-start").
927 document.getElementById(
"foldersync-favorite-delete").
929 document.getElementById(
"foldersync-direct-update").
933 document.getElementById(
"foldersync-favorite-load").
937 document.getElementById(
"foldersync-favorite-load").
946 var guid = this.getGUID()
948 throw Components.Exception(
"There is not favorite selected");
949 var fav = foldersync.preferences.getFavoriteByGUID(guid);
952 var
msg = foldersync.central.getLocaleString(
"delete.sure");
953 msg = msg.replace(
"%s", fav.name);
958 var profile = foldersync.preferences.getProfileByGUID(fav.sync.profileGUID);
959 if (!profile.visible)
960 foldersync.preferences.removeProfile(profile);
962 foldersync.preferences.removeFavorite(fav);
964 this.reloadFavorites();
966 foldersync.central.logEvent(
"accesspane-favorite",
967 "Deleting Favorite failed:\n\n" + e, 1,
968 "chrome://foldersync/" +
969 "content/accesspane.js", e.lineNumber);
977 var guid = this.getGUID();
979 throw Components.Exception(
"There is not favorite selected");
980 var fav = foldersync.preferences.getFavoriteByGUID(guid);
982 foldersync.sync.performSync(fav.sync);
984 foldersync.central.logEvent(
"accesspane-favorite",
985 "Starting Favorite Sync failed:\n\n" + e,
986 1,
"chrome://foldersync/" +
987 "content/accesspane.js", e.lineNumber);
995 window.openDialog(
'chrome://foldersync/content/dialogs/addfav.xul',
996 'foldersync-addfav-dialog',
997 'dialog=yes,modal=yes,centerscreen=yes,' +
998 'resizable=no,dependent=yes', res);
1001 var sync = foldersync.accesspane.getSync();
1003 foldersync.preferences.getProfileByGUID(sync.profileGUID).
1005 var favorite = foldersync.preferences.createFavorite(res.name, sync);
1006 this.reloadFavorites();
1008 foldersync.central.logEvent(
"accesspane-favorite",
1009 "Adding Favorite failed:\n\n" + e, 1,
1010 "chrome://foldersync/" +
1011 "content/accesspane.js", e.lineNumber);
1019 var guid = this.getGUID()
1021 throw Components.Exception(
"There is not favorite selected");
1022 var fav = foldersync.preferences.getFavoriteByGUID(guid);
1025 var
msg = foldersync.central.getLocaleString(
"update.sure");
1026 msg = msg.replace(
"%s", fav.name);
1032 var profile = foldersync.preferences.
1033 getProfileByGUID(fav.sync.profileGUID);
1035 foldersync.central.logEvent(
"accesspane-favorite",
1036 "There is no valid Profile avaiable " +
1037 "for Favorite " + guid +
". Skip old " +
1038 "Profile deletion.", 3,
1039 "chrome://foldersync/content/" +
1042 if (!profile.visible)
1043 foldersync.preferences.removeProfile(profile);
1046 fav.sync = foldersync.accesspane.getSync();
1048 foldersync.preferences.getProfileByGUID(fav.sync.profileGUID).
1051 foldersync.central.logEvent(
"accesspane-favorite",
1052 "Updating Favorite failed:\n\n" + e, 1,
1053 "chrome://foldersync/" +
1054 "content/accesspane.js", e.lineNumber);
1062 var guid = this.getGUID();
1064 throw Components.Exception(
"There is not favorite selected");
1065 var fav = foldersync.preferences.getFavoriteByGUID(guid);
1067 foldersync.accesspane.target.setFolder(fav.sync.targetFolder);
1068 foldersync.accesspane.playlists.setGUIDs(fav.sync.playlists);
1069 var profile = foldersync.preferences.
1070 getProfileByGUID(fav.sync.profileGUID);
1072 foldersync.accesspane.profile.setProfile(profile);
1074 foldersync.central.logEvent(
"accesspane-favorite",
1075 "There is no valid Profile avaiable " +
1076 "for Favorite " + guid +
". Skip " +
1077 "Profile loading.", 2,
1078 "chrome://foldersync/content/" +
1081 document.getElementById(
"foldersync-favorite-load").
1084 foldersync.central.logEvent(
"accesspane-favorite",
1085 "Loading Favorite failed:\n\n" + e, 1,
1086 "chrome://foldersync/" +
1087 "content/accesspane.js", e.lineNumber);
1092 getGUID:
function(){
1093 var favNode = document.getElementById(
"foldersync-favorites");
1094 var hasOne = favNode.selectedIndex > 0;
1097 return favNode.selectedItem.value;
1105 window.openDialog(
"chrome://foldersync/content/dialogs/options.xul",
1106 "foldersync-options",
1107 "chrome,titlebar,toolbar,centerscreen,modal=no");
1116 var mainWindow =
window.QueryInterface(Components.interfaces.
1118 getInterface(Components.interfaces.
1125 getInterface(Components.interfaces.
1127 mainWindow.gBrowser.selectedTab = mainWindow.gBrowser.
1130 foldersync.central.logEvent(
"accesspane",
1131 "Opening of '" +
url +
"' failed:\n\n" + e,
1132 1,
"chrome://foldersync/content/" +
1133 "accesspane.js", e.lineNumber);
1140 window.addEventListener(
"load",
1142 foldersync.accesspane.onLoad(e);
1145 window.addEventListener(
"unload",
1147 foldersync.accesspane.onUnload(e);
const nsIDocShellTreeItem
playlistfolders preferences
document getElementById("theimagecontainer").collapsed
sbOSDControlService prototype QueryInterface
ui plugin add("draggable","cursor",{start:function(e, ui){var t=$('body');if(t.css("cursor")) ui.options._cursor=t.css("cursor");t.css("cursor", ui.options.cursor);}, stop:function(e, ui){if(ui.options._cursor)$('body').css("cursor", ui.options._cursor);}})
this _contentSandbox label
menuItem setAttribute("handlerType","client")
inst dpDiv empty().append(this._generateHTML(inst)).find('iframe.ui-datepicker-cover').css(
function onUnload()
onUnload - called when the cover preview window unloads.
const nsIInterfaceRequestor
_getSelectedPageStyle s i