rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
{ if (appCore != null) { appCore.SetDocumentCharset(aCharset); window.content.location.reload(); } else { dump("BrowserAppCore has not been created!\n"); } | { if (appCore != null) { appCore.SetDocumentCharset(aCharset); window.content.location.reload(); | function BrowserSetDefaultCharacterSet(aCharset) { if (appCore != null) { appCore.SetDocumentCharset(aCharset); window.content.location.reload(); } else { dump("BrowserAppCore has not been created!\n"); } } |
} | function BrowserSetDefaultCharacterSet(aCharset) { if (appCore != null) { appCore.SetDocumentCharset(aCharset); window.content.location.reload(); } else { dump("BrowserAppCore has not been created!\n"); } } |
|
dump("Setting forward menu item enabled\n"); | function BrowserSetForward() { var forwardBElem = document.getElementById("canGoForward"); if (!forwardBElem) { dump("Couldn't obtain handle to forward Broarcast element\n"); return; } var canForward = forwardBElem.getAttribute("disabled"); var fb = document.getElementById("forward-button"); if (!fb) { dump("Could not obtain handle to forward button\n"); return; } // Enable/Disable the Forward button if (canForward == "true") { fb.setAttribute("disabled", "true"); } else { fb.setAttribute("disabled", ""); } // Enable/Disable the Forward menu var fm = document.getElementById("menuitem-forward"); if (!fm) { dump("Couldn't obtain menu item Forward\n"); return; } // Enable/Disable the Forward Menuitem if (canForward == "true") { fm.setAttribute("disabled", "true"); } else { dump("Setting forward menu item enabled\n"); fm.setAttribute("disabled", ""); } } |
|
try { if (makeURL(uriToLoad).schemeIs("chrome")) { dump("*** Preventing external load of chrome: URI into browser window\n"); dump(" Use -chrome <uri> instead\n"); window.close(); return; } } catch(e) {} | function BrowserStartup(){ gBrowser = document.getElementById("content"); window.tryToClose = WindowIsClosing; var uriToLoad = null; // Check for window.arguments[0]. If present, use that for uriToLoad. if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) uriToLoad = window.arguments[0]; gIsLoadingBlank = uriToLoad == "about:blank"; if (!gIsLoadingBlank) prepareForStartup();#ifdef ENABLE_PAGE_CYCLER appCore.startPageCycler();#else // only load url passed in when we're not page cycling if (uriToLoad && !gIsLoadingBlank) { if ("arguments" in window && window.arguments.length >= 3) loadURI(uriToLoad, window.arguments[2], null); else loadOneOrMoreURIs(uriToLoad); }#endif var sidebarSplitter; if (window.opener && !window.opener.closed) { if (window.opener.gFindMode == FIND_NORMAL) { var openerFindBar = window.opener.document.getElementById("FindToolbar"); if (openerFindBar && !openerFindBar.hidden) openFindBar(); } var openerSidebarBox = window.opener.document.getElementById("sidebar-box"); // The opener can be the hidden window too, if we're coming from the state // where no windows are open, and the hidden window has no sidebar box. if (openerSidebarBox && !openerSidebarBox.hidden) { var sidebarBox = document.getElementById("sidebar-box"); var sidebarTitle = document.getElementById("sidebar-title"); sidebarTitle.setAttribute("value", window.opener.document.getElementById("sidebar-title").getAttribute("value")); sidebarBox.setAttribute("width", openerSidebarBox.boxObject.width); var sidebarCmd = openerSidebarBox.getAttribute("sidebarcommand"); sidebarBox.setAttribute("sidebarcommand", sidebarCmd); sidebarBox.setAttribute("src", window.opener.document.getElementById("sidebar").getAttribute("src")); gMustLoadSidebar = true; sidebarBox.hidden = false; sidebarSplitter = document.getElementById("sidebar-splitter"); sidebarSplitter.hidden = false; document.getElementById(sidebarCmd).setAttribute("checked", "true"); } } else { var box = document.getElementById("sidebar-box"); if (box.hasAttribute("sidebarcommand")) { var cmd = box.getAttribute("sidebarcommand"); if (cmd) { gMustLoadSidebar = true; box.hidden = false; sidebarSplitter = document.getElementById("sidebar-splitter"); sidebarSplitter.hidden = false; document.getElementById(cmd).setAttribute("checked", "true"); } } } // Certain kinds of automigration rely on this notification to complete their // tasks BEFORE the browser window is shown. var obs = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); obs.notifyObservers(null, "browser-window-before-show", ""); // Set a sane starting width/height for all resolutions on new profiles. if (!document.documentElement.hasAttribute("width")) { var defaultWidth = 994, defaultHeight; if (screen.availHeight <= 600) { document.documentElement.setAttribute("sizemode", "maximized"); defaultWidth = 610; defaultHeight = 450; } else { // Create a narrower window for large or wide-aspect displays, to suggest // side-by-side page view. if ((screen.availWidth / 2) >= 800) defaultWidth = (screen.availWidth / 2) - 20; defaultHeight = screen.availHeight - 10;#ifdef MOZ_WIDGET_GTK#define USE_HEIGHT_ADJUST#endif#ifdef MOZ_WIDGET_GTK2#define USE_HEIGHT_ADJUST#endif#ifdef USE_HEIGHT_ADJUST // On X, we're not currently able to account for the size of the window // border. Use 28px as a guess (titlebar + bottom window border) defaultHeight -= 28;#endif } document.documentElement.setAttribute("width", defaultWidth); document.documentElement.setAttribute("height", defaultHeight); } setTimeout(delayedStartup, 0);} |
|
getWebNavigation().stop(); | getWebNavigation().stop(nsIWebNavigation.STOP_ALL); | function BrowserStop(){ getWebNavigation().stop();} |
getWebNavigation().stop(); | const stopFlags = nsIWebNavigation.STOP_ALL; getWebNavigation().stop(stopFlags); | function BrowserStop(){ try { getWebNavigation().stop(); } catch(ex) { }} |
var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } | if(!stopButton) stopButton = document.getElementById("stop-button"); | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
if ((sb.getAttribute("disabled")) == "true") { return; } | if ((stopButton.getAttribute("disabled")) == "true") return; | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
sb.setAttribute("disabled", "true"); var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { sm.setAttribute("disabled", "true"); } | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
|
if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } | appCore.stop(); | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
function BrowserStop() { var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } | function BrowserStop() { var stopBElem = document.getElementById("canStop"); if (!stopBElem) return; var canStop = stopBElem.getAttribute("disabled"); | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } | var sb = document.getElementById("stop-button"); if (!sb) return; if ( sb.getAttribute("disabled") == "true") return; sb.setAttribute("disabled", "true"); | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
if ((sb.getAttribute("disabled")) == "true") { return; } sb.setAttribute("disabled", "true"); | var sm = document.getElementById("menuitem-stop"); if( sm ) sm.setAttribute("disabled", "true"); | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { sm.setAttribute("disabled", "true"); } if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } | if (appCore != null) appCore.stop(); } | function BrowserStop() { // Get a handle to the "canStop" broadcast id var stopBElem = document.getElementById("canStop"); if (!stopBElem) { dump("Couldn't obtain handle to stop Broadcast element\n"); return; } var canStop = stopBElem.getAttribute("disabled"); var sb = document.getElementById("stop-button"); if (!sb) { dump("Could not obtain handle to stop button\n"); return; } // If the stop button is currently disabled, just return if ((sb.getAttribute("disabled")) == "true") { return; } //Stop button has just been pressed. Disable it. sb.setAttribute("disabled", "true"); // Get a handle to the stop menu item. var sm = document.getElementById("menuitem-stop"); if (!sm) { dump("Couldn't obtain menu item Stop\n"); } else { // Disable the stop menu-item. sm.setAttribute("disabled", "true"); } //Call in to BrowserAppcore to stop the current loading if (appCore != null) { dump("Going to Stop\n"); appCore.stop(); } else { dump("BrowserAppCore has not been created!\n"); } } |
#ifdef XP_MACOSX if (!getBoolPref("ui.click_hold_context_menus", false)) SetClickAndHoldHandlers(); #endif | function BrowserToolboxCustomizeDone(aToolboxChanged){ // Update global UI elements that may have been added or removed if (aToolboxChanged) { gURLBar = document.getElementById("urlbar"); if (gURLBar) gURLBar.clickSelectsAll = gClickSelectsAll; gProxyButton = document.getElementById("page-proxy-button"); gProxyFavIcon = document.getElementById("page-proxy-favicon"); gProxyDeck = document.getElementById("page-proxy-deck"); gHomeButton.updateTooltip(); window.XULBrowserWindow.init(); } // Update the urlbar var url = getWebNavigation().currentURI.spec; if (gURLBar) { gURLBar.value = url; SetPageProxyState("valid"); XULBrowserWindow.asyncUpdateUI(); } // Re-enable parts of the UI we disabled during the dialog var menubar = document.getElementById("main-menubar"); for (var i = 0; i < menubar.childNodes.length; ++i) menubar.childNodes[i].setAttribute("disabled", false); var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.removeAttribute("disabled"); // XXXmano bug 287105: wallpaper to bug 309953, // the reload button isn't in sync with the reload command. var reloadButton = document.getElementById("reload-button"); if (reloadButton) { reloadButton.disabled = document.getElementById("Browser:Reload").getAttribute("disabled") == "true"; }#ifndef MOZ_PLACES // fix up the personal toolbar folder var bt = document.getElementById("bookmarks-ptf"); if (bt) { var btf = BMSVC.getBookmarksToolbarFolder().Value; var btchevron = document.getElementById("bookmarks-chevron"); bt.ref = btf; btchevron.ref = btf; // no uniqueness is guaranteed, so we have to remove first try { bt.database.RemoveObserver(BookmarksToolbarRDFObserver); } catch (ex) { // ignore } bt.database.AddObserver(BookmarksToolbarRDFObserver); bt.builder.rebuild(); btchevron.builder.rebuild(); // fake a resize; this function takes care of flowing bookmarks // from the bar to the overflow item BookmarksToolbar.resizeFunc(null); }#else var bookmarksBar = document.getElementById("bookmarksBarContent"); bookmarksBar._init();#endif // XXX Shouldn't have to do this, but I do window.focus();} |
|
#endif | function BrowserToolboxCustomizeDone(aToolboxChanged){ // Update global UI elements that may have been added or removed if (aToolboxChanged) { gURLBar = document.getElementById("urlbar"); gURLBarContainer = document.getElementById("urlbar-container"); if (gURLBar) gURLBar.clickSelectsAll = gClickSelectsAll; gProxyButton = document.getElementById("page-proxy-button"); gProxyFavIcon = document.getElementById("page-proxy-favicon"); gProxyDeck = document.getElementById("page-proxy-deck"); gHomeButton.updateTooltip(); window.XULBrowserWindow.init(); } // Update the urlbar var url = getWebNavigation().currentURI.spec; if (gURLBar) { gURLBar.value = url; SetPageProxyState("valid"); XULBrowserWindow.asyncUpdateUI(); } // Re-enable parts of the UI we disabled during the dialog var menubar = document.getElementById("main-menubar"); for (var i = 0; i < menubar.childNodes.length; ++i) menubar.childNodes[i].setAttribute("disabled", false); var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.removeAttribute("disabled"); // XXXmano bug 287105: wallpaper to bug 309953, // the reload button isn't in sync with the reload command. var reloadButton = document.getElementById("reload-button"); if (reloadButton) { reloadButton.disabled = document.getElementById("Browser:Reload").getAttribute("disabled") == "true"; }#ifdef XP_MACOSX // make sure to re-enable click-and-hold if (!getBoolPref("ui.click_hold_context_menus", false)) SetClickAndHoldHandlers();#endif#ifndef MOZ_PLACES // fix up the personal toolbar folder var bt = document.getElementById("bookmarks-ptf"); if (bt) { var btf = BMSVC.getBookmarksToolbarFolder().Value; var btchevron = document.getElementById("bookmarks-chevron"); bt.ref = btf; btchevron.ref = btf; // no uniqueness is guaranteed, so we have to remove first try { bt.database.RemoveObserver(BookmarksToolbarRDFObserver); } catch (ex) { // ignore } bt.database.AddObserver(BookmarksToolbarRDFObserver); bt.builder.rebuild(); btchevron.builder.rebuild(); // fake a resize; this function takes care of flowing bookmarks // from the bar to the overflow item BookmarksToolbar.resizeFunc(null); }#else var bookmarksBar = document.getElementById("bookmarksBarContent"); bookmarksBar._init();#endif // XXX Shouldn't have to do this, but I do window.focus();} |
|
gURLBarContainer = document.getElementById("urlbar-container"); | function BrowserToolboxCustomizeDone(aToolboxChanged){ // Update global UI elements that may have been added or removed if (aToolboxChanged) { gURLBar = document.getElementById("urlbar"); if (gURLBar) gURLBar.clickSelectsAll = gClickSelectsAll; gProxyButton = document.getElementById("page-proxy-button"); gProxyFavIcon = document.getElementById("page-proxy-favicon"); gProxyDeck = document.getElementById("page-proxy-deck"); gHomeButton.updateTooltip(); window.XULBrowserWindow.init(); } // Update the urlbar var url = getWebNavigation().currentURI.spec; if (gURLBar) { gURLBar.value = url; SetPageProxyState("valid"); XULBrowserWindow.asyncUpdateUI(); } // Re-enable parts of the UI we disabled during the dialog var menubar = document.getElementById("main-menubar"); for (var i = 0; i < menubar.childNodes.length; ++i) menubar.childNodes[i].setAttribute("disabled", false); var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.removeAttribute("disabled"); // XXXmano bug 287105: wallpaper to bug 309953, // the reload button isn't in sync with the reload command. var reloadButton = document.getElementById("reload-button"); if (reloadButton) { reloadButton.disabled = document.getElementById("Browser:Reload").getAttribute("disabled") == "true"; }#ifdef XP_MACOSX // make sure to re-enable click-and-hold if (!getBoolPref("ui.click_hold_context_menus", false)) SetClickAndHoldHandlers();#endif#ifndef MOZ_PLACES // fix up the personal toolbar folder var bt = document.getElementById("bookmarks-ptf"); if (bt) { var btf = BMSVC.getBookmarksToolbarFolder().Value; var btchevron = document.getElementById("bookmarks-chevron"); bt.ref = btf; btchevron.ref = btf; // no uniqueness is guaranteed, so we have to remove first try { bt.database.RemoveObserver(BookmarksToolbarRDFObserver); } catch (ex) { // ignore } bt.database.AddObserver(BookmarksToolbarRDFObserver); bt.builder.rebuild(); btchevron.builder.rebuild(); // fake a resize; this function takes care of flowing bookmarks // from the bar to the overflow item BookmarksToolbar.resizeFunc(null); }#else var bookmarksBar = document.getElementById("bookmarksBarContent"); bookmarksBar._init();#endif // XXX Shouldn't have to do this, but I do window.focus();} |
|
document.getElementById("cmd_newNavigatorTab").removeAttribute("disabled"); getBrowser()._blockDblClick = false; | function BrowserToolboxCustomizeDone(aToolboxChanged){#ifdef TOOLBAR_CUSTOMIZATION_SHEET document.getElementById("customizeToolbarSheetBox").hidden = true; document.getElementById("cmd_newNavigatorTab").removeAttribute("disabled"); getBrowser()._blockDblClick = false;#endif // Update global UI elements that may have been added or removed if (aToolboxChanged) { gURLBar = document.getElementById("urlbar"); gURLBarContainer = document.getElementById("urlbar-container"); if (gURLBar) gURLBar.clickSelectsAll = gClickSelectsAll; gProxyButton = document.getElementById("page-proxy-button"); gProxyFavIcon = document.getElementById("page-proxy-favicon"); gProxyDeck = document.getElementById("page-proxy-deck"); gHomeButton.updateTooltip(); window.XULBrowserWindow.init(); } // Update the urlbar var url = getWebNavigation().currentURI.spec; if (gURLBar) { gURLBar.value = url; SetPageProxyState("valid"); XULBrowserWindow.asyncUpdateUI(); } // Re-enable parts of the UI we disabled during the dialog var menubar = document.getElementById("main-menubar"); for (var i = 0; i < menubar.childNodes.length; ++i) menubar.childNodes[i].setAttribute("disabled", false); var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.removeAttribute("disabled"); // XXXmano bug 287105: wallpaper to bug 309953, // the reload button isn't in sync with the reload command. var reloadButton = document.getElementById("reload-button"); if (reloadButton) { reloadButton.disabled = document.getElementById("Browser:Reload").getAttribute("disabled") == "true"; }#ifdef XP_MACOSX // make sure to re-enable click-and-hold if (!getBoolPref("ui.click_hold_context_menus", false)) SetClickAndHoldHandlers();#endif#ifndef MOZ_PLACES // fix up the personal toolbar folder var bt = document.getElementById("bookmarks-ptf"); if (bt) { var btf = BMSVC.getBookmarksToolbarFolder().Value; var btchevron = document.getElementById("bookmarks-chevron"); bt.ref = btf; btchevron.ref = btf; // no uniqueness is guaranteed, so we have to remove first try { bt.database.RemoveObserver(BookmarksToolbarRDFObserver); } catch (ex) { // ignore } bt.database.AddObserver(BookmarksToolbarRDFObserver); bt.builder.rebuild(); btchevron.builder.rebuild(); // fake a resize; this function takes care of flowing bookmarks // from the bar to the overflow item BookmarksToolbar.resizeFunc(null); }#else var bookmarksBar = document.getElementById("bookmarksBarContent"); bookmarksBar._init();#endif#ifndef TOOLBAR_CUSTOMIZATION_SHEET // XXX Shouldn't have to do this, but I do window.focus();#endif} |
|
if (gURLBar) gURLBar.clickSelectsAll = gClickSelectsAll; | function BrowserToolboxCustomizeDone(aToolboxChanged){ // Update global UI elements that may have been added or removed if (aToolboxChanged) { gURLBar = document.getElementById("urlbar"); gProxyButton = document.getElementById("page-proxy-button"); gProxyFavIcon = document.getElementById("page-proxy-favicon"); gProxyDeck = document.getElementById("page-proxy-deck"); gHomeButton.updateTooltip(); window.XULBrowserWindow.init(); } // Update the urlbar var url = getWebNavigation().currentURI.spec; if (gURLBar) { gURLBar.value = url; SetPageProxyState("valid"); FeedHandler.updateFeeds(); } // Re-enable parts of the UI we disabled during the dialog var menubar = document.getElementById("main-menubar"); for (var i = 0; i < menubar.childNodes.length; ++i) menubar.childNodes[i].setAttribute("disabled", false); var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.removeAttribute("disabled"); // XXXmano bug 287105: wallpaper to bug 309953, // the reload button isn't in sync with the reload command. var reloadButton = document.getElementById("reload-button"); if (reloadButton) { reloadButton.disabled = document.getElementById("Browser:Reload").getAttribute("disabled") == "true"; } // fix up the personal toolbar folder var bt = document.getElementById("bookmarks-ptf"); if (bt) {#ifndef MOZ_PLACES var btf = BMSVC.getBookmarksToolbarFolder().Value; var btchevron = document.getElementById("bookmarks-chevron"); bt.ref = btf; btchevron.ref = btf; // no uniqueness is guaranteed, so we have to remove first try { bt.database.RemoveObserver(BookmarksToolbarRDFObserver); } catch (ex) { // ignore } bt.database.AddObserver(BookmarksToolbarRDFObserver); bt.builder.rebuild(); btchevron.builder.rebuild();#endif // fake a resize; this function takes care of flowing bookmarks // from the bar to the overflow item BookmarksToolbar.resizeFunc(null); } // XXX Shouldn't have to do this, but I do window.focus();} |
|
function BrowserViewDownload() { document.getElementById("toolbar-download").collapsed=!document.getElementById("toolbar-download").collapsed; if(document.getElementById("toolbar-download").collapsed && document.getElementById("command_ViewDownload").getAttribute("checked")=="true") { document.getElementById("command_ViewDownload").setAttribute("checked","false"); } | function BrowserViewDownload(cMode) { document.getElementById("toolbar-download").collapsed=!cMode; | function BrowserViewDownload() { document.getElementById("toolbar-download").collapsed=!document.getElementById("toolbar-download").collapsed; if(document.getElementById("toolbar-download").collapsed && document.getElementById("command_ViewDownload").getAttribute("checked")=="true") { document.getElementById("command_ViewDownload").setAttribute("checked","false"); }} |
document.getElementById("browserleftbar").collapsed=!document.getElementById("browserleftbar").collapsed; | var wholeHomebarState = document.getElementById("browserleftbar").collapsed; document.getElementById("browserleftbar").collapsed = !wholeHomebarState; if(!wholeHomebarState) { document.getElementById("homebarcontainer").style.display="block"; } | function BrowserViewHomebar() { document.getElementById("browserleftbar").collapsed=!document.getElementById("browserleftbar").collapsed;} |
{ dump("BrowserViewSource(); \n "); window.openDialog( "chrome: "_blank", "chrome,menubar,status,dialog=no,resizable", window.content.location, "view-source" ); } | { window.openDialog( "chrome: "_blank", "chrome,menubar,status,dialog=no,resizable", window.content.location, "view-source" ); } | function BrowserViewSource() { dump("BrowserViewSource(); \n "); // Use a browser window to view source window.openDialog( "chrome://navigator/content/", "_blank", "chrome,menubar,status,dialog=no,resizable", window.content.location, "view-source" ); } |
win = _content; | win = content; | function BrowserViewSourceOfDocument(aDocument){ var docCharset; var pageCookie; var webNav; // Get the document charset docCharset = "charset=" + aDocument.characterSet; // Get the nsIWebNavigation associated with the document try { var win; var ifRequestor; // Get the DOMWindow for the requested document. If the DOMWindow // cannot be found, then just use the _content window... // // XXX: This is a bit of a hack... win = aDocument.defaultView; if (win == window) { win = _content; } ifRequestor = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor); webNav = ifRequestor.getInterface(Components.interfaces.nsIWebNavigation); } catch(err) { // If nsIWebNavigation cannot be found, just get the one for the whole // window... webNav = getWebNavigation(); } // // Get the 'PageDescriptor' for the current document. This allows the // view-source to access the cached copy of the content rather than // refetching it from the network... // try{ var PageLoader = webNav.QueryInterface(Components.interfaces.nsIWebPageDescriptor); pageCookie = PageLoader.currentDescriptor; } catch(err) { // If no page descriptor is available, just use the view-source URL... } BrowserViewSourceOfURL(webNav.currentURI.spec, docCharset, pageCookie);} |
this.webNavigation.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE); | this.webNavigation.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null); | browseToURL: function(aURL) { this.webNavigation.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE); }, |
{ BulletStyleLabel.value = label; if (BulletStyleLabel.hasChildNodes()) { BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); } var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); } | BulletStyleLabel.setAttribute("value",label); | function BuildBulletStyleList(){ ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; //dump("List Type: "+ListType+" globalElement: "+globalElement+"\n"); if (ListType == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"SolidSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListTypeList.selectedIndex = 1; } else if (ListType == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListTypeList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListType == "dl") ListTypeList.selectedIndex = 3; else ListTypeList.selectedIndex = 0; } // Disable advanced edit button if changing to "normal" if (ListType == "") AdvancedEditButton.setAttribute("disabled","true"); else AdvancedEditButton.removeAttribute("disabled"); if (label) { BulletStyleLabel.value = label; if (BulletStyleLabel.hasChildNodes()) { //dump("BulletStyleLabel.firstChild: "+BulletStyleLabel.firstChild+"\n"); BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); } var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
if (ListStyle == "ul") | dump("List Type: "+ListType+" globalElement: "+globalElement+"\n"); if (ListType == "ul") | function BuildBulletStyleList(){ // Put methods on the object if I can figure out its name! // (SELECT and HTMLSelect don't work!) //BulletStyleList.clear(); ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; if (ListStyle == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"OpenSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListStyleList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListStyle == "dl") ListStyleList.selectedIndex = 3; else ListStyleList.selectedIndex = 0; } if (label) { if (BulletStyleLabel.hasChildNodes()) BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
AppendStringToListByID(BulletStyleList,"OpenSquare"); | AppendStringToListByID(BulletStyleList,"SolidSquare"); | function BuildBulletStyleList(){ // Put methods on the object if I can figure out its name! // (SELECT and HTMLSelect don't work!) //BulletStyleList.clear(); ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; if (ListStyle == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"OpenSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListStyleList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListStyle == "dl") ListStyleList.selectedIndex = 3; else ListStyleList.selectedIndex = 0; } if (label) { if (BulletStyleLabel.hasChildNodes()) BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") | ListTypeList.selectedIndex = 1; } else if (ListType == "ol") | function BuildBulletStyleList(){ // Put methods on the object if I can figure out its name! // (SELECT and HTMLSelect don't work!) //BulletStyleList.clear(); ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; if (ListStyle == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"OpenSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListStyleList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListStyle == "dl") ListStyleList.selectedIndex = 3; else ListStyleList.selectedIndex = 0; } if (label) { if (BulletStyleLabel.hasChildNodes()) BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
ListStyleList.selectedIndex = 2; } else { | ListTypeList.selectedIndex = 2; } else { | function BuildBulletStyleList(){ // Put methods on the object if I can figure out its name! // (SELECT and HTMLSelect don't work!) //BulletStyleList.clear(); ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; if (ListStyle == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"OpenSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListStyleList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListStyle == "dl") ListStyleList.selectedIndex = 3; else ListStyleList.selectedIndex = 0; } if (label) { if (BulletStyleLabel.hasChildNodes()) BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
if (ListStyle == "dl") ListStyleList.selectedIndex = 3; | if (ListType == "dl") ListTypeList.selectedIndex = 3; | function BuildBulletStyleList(){ // Put methods on the object if I can figure out its name! // (SELECT and HTMLSelect don't work!) //BulletStyleList.clear(); ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; if (ListStyle == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"OpenSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListStyleList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListStyle == "dl") ListStyleList.selectedIndex = 3; else ListStyleList.selectedIndex = 0; } if (label) { if (BulletStyleLabel.hasChildNodes()) BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
ListStyleList.selectedIndex = 0; | ListTypeList.selectedIndex = 0; | function BuildBulletStyleList(){ // Put methods on the object if I can figure out its name! // (SELECT and HTMLSelect don't work!) //BulletStyleList.clear(); ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; if (ListStyle == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"OpenSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListStyleList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListStyle == "dl") ListStyleList.selectedIndex = 3; else ListStyleList.selectedIndex = 0; } if (label) { if (BulletStyleLabel.hasChildNodes()) BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
} | function BuildBulletStyleList(){ // Put methods on the object if I can figure out its name! // (SELECT and HTMLSelect don't work!) //BulletStyleList.clear(); ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; if (ListStyle == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"OpenSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListStyleList.selectedIndex = 1; } else if (ListStyle == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListStyleList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListStyle == "dl") ListStyleList.selectedIndex = 3; else ListStyleList.selectedIndex = 0; } if (label) { if (BulletStyleLabel.hasChildNodes()) BulletStyleLabel.removeChild(BulletStyleLabel.firstChild); var textNode = document.createTextNode(label); BulletStyleLabel.appendChild(textNode); }} |
|
ClearList(BulletStyleList); | ClearMenulist(BulletStyleList); | function BuildBulletStyleList(){ ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; //dump("List Type: "+ListType+" globalElement: "+globalElement+"\n"); if (ListType == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"SolidSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListTypeList.selectedIndex = 1; } else if (ListType == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListTypeList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListType == "dl") ListTypeList.selectedIndex = 3; else ListTypeList.selectedIndex = 0; } // Disable advanced edit button if changing to "normal" if (ListType == "") AdvancedEditButton.setAttribute("disabled","true"); else AdvancedEditButton.removeAttribute("disabled"); if (label) BulletStyleLabel.setAttribute("value",label);} |
dump("List Type: "+ListType+" globalElement: "+globalElement+"\n"); | function BuildBulletStyleList(){ ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; //dump("List Type: "+ListType+" globalElement: "+globalElement+"\n"); if (ListType == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"SolidSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListTypeList.selectedIndex = 1; } else if (ListType == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListTypeList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListType == "dl") ListTypeList.selectedIndex = 3; else ListTypeList.selectedIndex = 0; } // Disable advanced edit button if changing to "normal" if (ListType == "") AdvancedEditButton.setAttribute("disabled","true"); else AdvancedEditButton.removeAttribute("disabled"); if (label) BulletStyleLabel.setAttribute("value",label);} |
|
AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"SolidSquare"); | AppendStringToMenulistById(BulletStyleList,"SolidCircle"); AppendStringToMenulistById(BulletStyleList,"OpenCircle"); AppendStringToMenulistById(BulletStyleList,"SolidSquare"); | function BuildBulletStyleList(){ ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; //dump("List Type: "+ListType+" globalElement: "+globalElement+"\n"); if (ListType == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"SolidSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListTypeList.selectedIndex = 1; } else if (ListType == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListTypeList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListType == "dl") ListTypeList.selectedIndex = 3; else ListTypeList.selectedIndex = 0; } // Disable advanced edit button if changing to "normal" if (ListType == "") AdvancedEditButton.setAttribute("disabled","true"); else AdvancedEditButton.removeAttribute("disabled"); if (label) BulletStyleLabel.setAttribute("value",label);} |
AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); | AppendStringToMenulistById(BulletStyleList,"Style_1"); AppendStringToMenulistById(BulletStyleList,"Style_I"); AppendStringToMenulistById(BulletStyleList,"Style_i"); AppendStringToMenulistById(BulletStyleList,"Style_A"); AppendStringToMenulistById(BulletStyleList,"Style_a"); | function BuildBulletStyleList(){ ClearList(BulletStyleList); var label = ""; var selectedIndex = -1; //dump("List Type: "+ListType+" globalElement: "+globalElement+"\n"); if (ListType == "ul") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); label = GetString("BulletStyle"); AppendStringToListByID(BulletStyleList,"SolidCircle"); AppendStringToListByID(BulletStyleList,"OpenCircle"); AppendStringToListByID(BulletStyleList,"SolidSquare"); BulletStyleList.selectedIndex = BulletStyleIndex; ListTypeList.selectedIndex = 1; } else if (ListType == "ol") { BulletStyleList.removeAttribute("disabled"); BulletStyleLabel.removeAttribute("disabled"); StartingNumberInput.removeAttribute("disabled"); StartingNumberLabel.removeAttribute("disabled"); label = GetString("NumberStyle"); AppendStringToListByID(BulletStyleList,"Style_1"); AppendStringToListByID(BulletStyleList,"Style_I"); AppendStringToListByID(BulletStyleList,"Style_i"); AppendStringToListByID(BulletStyleList,"Style_A"); AppendStringToListByID(BulletStyleList,"Style_a"); BulletStyleList.selectedIndex = NumberStyleIndex; ListTypeList.selectedIndex = 2; } else { BulletStyleList.setAttribute("disabled", "true"); BulletStyleLabel.setAttribute("disabled", "true"); StartingNumberInput.setAttribute("disabled", "true"); StartingNumberLabel.setAttribute("disabled", "true"); if (ListType == "dl") ListTypeList.selectedIndex = 3; else ListTypeList.selectedIndex = 0; } // Disable advanced edit button if changing to "normal" if (ListType == "") AdvancedEditButton.setAttribute("disabled","true"); else AdvancedEditButton.removeAttribute("disabled"); if (label) BulletStyleLabel.setAttribute("value",label);} |
var bx = this.mTree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject); setTimeout(function(a) { a.invalidate() }, 1, bx); | buildContent: function() { this.mTreeBody.builder.rebuild(); }, |
|
var bx = this.mTree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject); setTimeout(function(a) { a.invalidate() }, 1, bx); | buildContent: function() { this.mTreeBody.builder.rebuild(); var bx = this.mTree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject); setTimeout(function(a) { a.invalidate() }, 1, bx); }, |
|
var name = document.popupNode.getAttribute("name"); | var selectedItem = gExtensionsView.selected; var name = selectedItem ? selectedItem.getAttribute("name") : ""; | function buildContextMenu(aEvent){ if (aEvent.target.id != "extensionContextMenu") return false; var popup = document.getElementById("extensionContextMenu"); while (popup.hasChildNodes()) popup.removeChild(popup.firstChild); var isExtensions = gWindowState == "extensions"; var menus = isExtensions ? gExtensionContextMenus : gThemeContextMenus; for (var i = 0; i < menus.length; ++i) { var clonedMenu = document.getElementById(menus[i]).cloneNode(true); clonedMenu.id = clonedMenu.id + "_clone"; popup.appendChild(clonedMenu); } var extensionsStrings = document.getElementById("extensionsStrings"); var menuitem_about = document.getElementById("menuitem_about_clone"); var name = document.popupNode.getAttribute("name"); menuitem_about.setAttribute("label", extensionsStrings.getFormattedString("aboutExtension", [name])); if (isExtensions) { var canEnable = gExtensionsViewController.isCommandEnabled("cmd_enable"); var menuitemToShow, menuitemToHide; if (canEnable) { menuitemToShow = document.getElementById("menuitem_enable_clone"); menuitemToHide = document.getElementById("menuitem_disable_clone"); } else { menuitemToShow = document.getElementById("menuitem_disable_clone"); menuitemToHide = document.getElementById("menuitem_enable_clone"); } menuitemToShow.hidden = false; menuitemToHide.hidden = true; } return true;} |
if (useSmallIcons) | if (useSmallIcons.checked) | function buildDialog(){ var toolbar = window.opener.document.getElementById("nav-bar"); var useSmallIcons = document.getElementById("smallicons"); var iconSize = toolbar.getAttribute("iconsize"); useSmallIcons.checked = (iconSize == "small"); var modeList = document.getElementById("modelist"); var modeValue = toolbar.getAttribute("mode"); if (!modeValue) modeValue = "full"; modeList.value = modeValue; var cloneToolbarBox = document.getElementById("cloned-bar-container"); var paletteBox = document.getElementById("palette-box"); var currentSet = toolbar.getAttribute("currentset"); if (!currentSet) currentSet = toolbar.getAttribute("defaultset"); currentSet = currentSet.split(","); // Create a new toolbar that will model the one the user is trying to customize. // We won't just cloneNode() because we want to wrap each element on the toolbar in a // <toolbarpaletteitem/>, to prevent them from getting events (so they aren't styled on // hover, etc.) and to allow us to style them in the new nsITheme world. var newToolbar = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "toolbar"); newToolbar.id = "cloneToolbar"; if (useSmallIcons) newToolbar.setAttribute("iconsize", "small"); // Walk through and manually clone the children of the to-be-customized toolbar. // Make sure all buttons look enabled (and that textboxes are disabled). var toolbarItem = toolbar.firstChild; while (toolbarItem) { var newItem = toolbarItem.cloneNode(true); addItemToToolbar(newItem, newToolbar); toolbarItem = toolbarItem.nextSibling; } cloneToolbarBox.appendChild(newToolbar); // Now build up a palette of items. buildPalette(paletteBox, toolbar, currentSet); // Set a min height on the new toolbar so it doesn't shrink if all the buttons are removed. newToolbar.setAttribute("minheight", newToolbar.boxObject.height);} |
AddTreeItem ( name, value, "HTMLAList", HTMLAttrs ); | if (name.indexOf("_moz") != 0) AddTreeItem ( name, value, "HTMLAList", HTMLAttrs ); | function BuildHTMLAttributeTable(){ var nodeMap = element.attributes; if(nodeMap.length > 0) { for(i = 0; i < nodeMap.length; i++) { if ( !CheckAttributeNameSimilarity( nodeMap[i].nodeName, JSEAttrs ) || IsEventHandler( nodeMap[i].nodeName ) || TrimString( nodeMap[i].nodeName.toLowerCase() ) == "style" ) { continue; // repeated or non-HTML attribute, ignore this one and go to next } var name = nodeMap[i].nodeName.toLowerCase(); var value = element.getAttribute ( nodeMap[i].nodeName ); AddTreeItem ( name, value, "HTMLAList", HTMLAttrs ); } }} |
}, | } | buildLinks: function() { // assert the handler resource var mimeSource = gRDF.GetResource(MIME_URI(this.mimeType)); var handlerProperty = gRDF.GetResource(NC_RDF("handlerProp")); var handlerResource = gRDF.GetResource(HANDLER_URI(this.mimeType)); gDS.Assert(mimeSource, handlerProperty, handlerResource, true); // assert the helper app resource var helperAppProperty = gRDF.GetResource(NC_RDF("externalApplication")); var helperAppResource = gRDF.GetResource(APP_URI(this.mimeType)); gDS.Assert(handlerResource, helperAppProperty, helperAppResource, true); // add the mime type to the MIME types seq var container = Components.classes["@mozilla.org/rdf/container;1"].createInstance(); if (container) { container = container.QueryInterface(Components.interfaces.nsIRDFContainer); if (container) { var containerRes = gRDF.GetResource("urn:mimetypes:root"); container.Init(gDS, containerRes); var element = gRDF.GetResource(MIME_URI(this.mimeType)); if (container.IndexOf(element) == -1) container.AppendElement(element); } } }, |
var prettyPrintBox = document.getElementById("prettyPrintTree"); var tree = document.createElement("tree"); prettyPrintBox.appendChild(tree); var treeChildren = addChildrenToTree(tree,"Top Level"); var childOfFirstChild = addChildrenToTree(treeChildren, "Second Level:1"); var levelone2 = addChildrenToTree(treeChildren,"Second Level:2"); var levelthree1 = addChildrenToTree(childOfFirstChild,"Third Level:1"); | var certDumpOutliner = Components.classes[nsASN1Outliner]. createInstance(nsIASN1Outliner); certDumpOutliner.loadASN1Structure(cert.ASN1Structure); document.getElementById('prettyDumpOutliner'). outlinerBoxObject.view = certDumpOutliner; | function BuildPrettyPrint(cert){ // For now, I'm just gonna build some dummy stuff // just to get the helper functions I need up and // running. var prettyPrintBox = document.getElementById("prettyPrintTree"); var tree = document.createElement("tree"); prettyPrintBox.appendChild(tree); var treeChildren = addChildrenToTree(tree,"Top Level"); var childOfFirstChild = addChildrenToTree(treeChildren, "Second Level:1"); var levelone2 = addChildrenToTree(treeChildren,"Second Level:2"); var levelthree1 = addChildrenToTree(childOfFirstChild,"Third Level:1");} |
try { historyCount = gPrefs.GetIntPref("editor.history.url_maximum"); } catch(e) {} | try { historyCount = gPrefs.getIntPref("editor.history.url_maximum"); } catch(e) {} | function BuildRecentMenu(savePrefs){ // Can't do anything if no prefs if (!gPrefs) return; var popup = document.getElementById("menupopup_RecentFiles"); if (!popup || !window.editorShell || !window.editorShell.editorDocument) return; // Delete existing menu while (popup.firstChild) popup.removeChild(popup.firstChild); // Current page is the "0" item in the list we save in prefs, // but we don't include it in the menu. var curTitle = window.editorShell.editorDocument.title; var curUrl = window.editorShell.editorDocument.location; var newDoc = (curUrl == "about:blank"); var historyCount = 10; try { historyCount = gPrefs.GetIntPref("editor.history.url_maximum"); } catch(e) {} var titleArray = new Array(historyCount); var urlArray = new Array(historyCount); var menuIndex = 1; var arrayIndex = 0; var i; var disableMenu = true; if(!newDoc) { // Always put latest-opened URL at start of array titleArray[0] = curTitle; urlArray[0] = curUrl; arrayIndex = 1; } for (i = 0; i < historyCount; i++) { var title = getUnicharPref("editor.history_title_"+i); var url = getUnicharPref("editor.history_url_"+i); // Continue if URL pref is missing because // a URL not found during loading may have been removed if (!url) continue; // Skip over current URL if (url != curUrl) { // Build the menu AppendRecentMenuitem(popup, title, url, menuIndex); menuIndex++; disableMenu = false; // Save in array for prefs if (savePrefs && arrayIndex < historyCount) { titleArray[arrayIndex] = title; urlArray[arrayIndex] = url; arrayIndex++; } } } // Now resave the list back to prefs in the new order if (savePrefs) { savePrefs = false; for (i = 0; i < historyCount; i++) { if (!urlArray[i]) break; setUnicharPref("editor.history_title_"+i, titleArray[i]); setUnicharPref("editor.history_url_"+i, urlArray[i]); savePrefs = true; } } // Force saving to file so next file opened finds these values if (savePrefs) gPrefs.savePrefFile(null); // Disable menu item if no entries DisableItem("menu_RecentFiles", disableMenu);} |
if (savePrefs) gPrefs.savePrefFile(null); | if (savePrefs) { var prefsService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); prefsService.savePrefFile(null); } | function BuildRecentMenu(savePrefs){ // Can't do anything if no prefs if (!gPrefs) return; var popup = document.getElementById("menupopup_RecentFiles"); if (!popup || !window.editorShell || !window.editorShell.editorDocument) return; // Delete existing menu while (popup.firstChild) popup.removeChild(popup.firstChild); // Current page is the "0" item in the list we save in prefs, // but we don't include it in the menu. var curTitle = window.editorShell.editorDocument.title; var curUrl = window.editorShell.editorDocument.location; var newDoc = (curUrl == "about:blank"); var historyCount = 10; try { historyCount = gPrefs.GetIntPref("editor.history.url_maximum"); } catch(e) {} var titleArray = new Array(historyCount); var urlArray = new Array(historyCount); var menuIndex = 1; var arrayIndex = 0; var i; var disableMenu = true; if(!newDoc) { // Always put latest-opened URL at start of array titleArray[0] = curTitle; urlArray[0] = curUrl; arrayIndex = 1; } for (i = 0; i < historyCount; i++) { var title = getUnicharPref("editor.history_title_"+i); var url = getUnicharPref("editor.history_url_"+i); // Continue if URL pref is missing because // a URL not found during loading may have been removed if (!url) continue; // Skip over current URL if (url != curUrl) { // Build the menu AppendRecentMenuitem(popup, title, url, menuIndex); menuIndex++; disableMenu = false; // Save in array for prefs if (savePrefs && arrayIndex < historyCount) { titleArray[arrayIndex] = title; urlArray[arrayIndex] = url; arrayIndex++; } } } // Now resave the list back to prefs in the new order if (savePrefs) { savePrefs = false; for (i = 0; i < historyCount; i++) { if (!urlArray[i]) break; setUnicharPref("editor.history_title_"+i, titleArray[i]); setUnicharPref("editor.history_url_"+i, urlArray[i]); savePrefs = true; } } // Force saving to file so next file opened finds these values if (savePrefs) gPrefs.savePrefFile(null); // Disable menu item if no entries DisableItem("menu_RecentFiles", disableMenu);} |
if (found) continue; var listitem = document.createElementNS("http: "listitem"); listitem.setAttribute("label", gPageReport[i]); gSiteBox.appendChild(listitem); | if (!found) gSiteBox.appendItem(gPageReport[i]); | function buildSiteBox(){ for (var i = 0; i < gPageReport.length; i++) { var found = false; for (var j = 0; j < gSiteBox.childNodes.length; j++) { if (gSiteBox.childNodes[j].label == gPageReport[i]) { found = true; break; } } if (found) continue; var listitem = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "listitem"); listitem.setAttribute("label", gPageReport[i]); gSiteBox.appendChild(listitem); }} |
cell.setAttribute("value", "?" + val); | cell.setAttribute("label", "?" + val); | buildTemplate: function() { var cols = this.mColumns; var bindings = this.mBindings; var row = this.mTreeRow; var cell, binding, val, extras, attrs, key, className; if (this.mIsIconic) { binding = this.createBinding("_icon"); bindings.appendChild(binding); } for (var i = 0; i < cols.length; ++i) { val = cols[i].name; if (!val) throw "Column data is incomplete - missing name at index " + i + "."; cell = this.createTemplatePart("treecell"); className = ""; // build the icon data field if (i == 0 && this.mIsIconic) { className += "treecell-iconic "; cell.setAttribute("src", "?_icon"); } // mark first node as a container, if necessary if (i == 0 && this.mIsContainer) className += "treecell-indent"; // build the default value data field binding = this.createBinding(val); bindings.appendChild(binding); cell.setAttribute("value", "?" + val); cell.setAttribute("class", className); row.appendChild(cell); } }, |
cell.setAttribute("value", val); | cell.setAttribute("label", val); | buildTreeHead: function() { var cols = this.mColumns; var row = this.mTreeHeadRow; var cell, val; for (var i = 0; i < cols.length; i++) { cell = document.createElementNS(kXULNSURI, "treecell"); cell.setAttribute("class", "treecell-header"); val = cols[i].title; if (val) cell.setAttribute("value", val); row.appendChild(cell); } }, |
var columnName = currTreeCol.getAttribute("value"); | var columnName = currTreeCol.getAttribute("label"); | function BuildTreePopup( treeColGroup, treeHeadRow, popup, skipCell ){ var popupChild = popup.firstChild; var firstTime = !popupChild ? true : false; var currTreeCol = treeHeadRow.firstChild; var currColNode = treeColGroup.firstChild; var count = 0; while (currTreeCol) { if (currColNode.localName == "splitter") currColNode = currColNode.nextSibling; if (skipCell != currTreeCol) { // Construct an entry for each cell in the row. var columnName = currTreeCol.getAttribute("value"); if (firstTime) { if (currTreeCol.getAttribute("collapsed") != "true") { popupChild = document.createElement("menuitem"); popupChild.setAttribute("type", "checkbox"); popupChild.setAttribute("value", columnName); if (!count++) popupChild.setAttribute("disabled", "true"); if (columnName == "") { var display = currTreeCol.getAttribute("display"); popupChild.setAttribute("value", display); } popupChild.setAttribute("colid", currColNode.id); popupChild.setAttribute("oncommand", "ToggleColumnState(this, document)"); if ("true" != currColNode.getAttribute("hidden")) { popupChild.setAttribute("checked", "true"); } popup.appendChild(popupChild); } } else { if ("true" == currColNode.getAttribute("hidden")) { if (popupChild.getAttribute("checked")) popupChild.removeAttribute("checked"); } else { if (!popupChild.getAttribute("checked")) popupChild.setAttribute("checked", "true"); } if (currColNode.getAttribute("collapsed") == "true") popupChild.setAttribute("hidden", "true"); else popupChild.removeAttribute("hidden"); popupChild = popupChild.nextSibling; } } currTreeCol = currTreeCol.nextSibling; currColNode = currColNode.nextSibling; }} |
popupChild.setAttribute("value", columnName); | popupChild.setAttribute("label", columnName); | function BuildTreePopup( treeColGroup, treeHeadRow, popup, skipCell ){ var popupChild = popup.firstChild; var firstTime = !popupChild ? true : false; var currTreeCol = treeHeadRow.firstChild; var currColNode = treeColGroup.firstChild; var count = 0; while (currTreeCol) { if (currColNode.localName == "splitter") currColNode = currColNode.nextSibling; if (skipCell != currTreeCol) { // Construct an entry for each cell in the row. var columnName = currTreeCol.getAttribute("value"); if (firstTime) { if (currTreeCol.getAttribute("collapsed") != "true") { popupChild = document.createElement("menuitem"); popupChild.setAttribute("type", "checkbox"); popupChild.setAttribute("value", columnName); if (!count++) popupChild.setAttribute("disabled", "true"); if (columnName == "") { var display = currTreeCol.getAttribute("display"); popupChild.setAttribute("value", display); } popupChild.setAttribute("colid", currColNode.id); popupChild.setAttribute("oncommand", "ToggleColumnState(this, document)"); if ("true" != currColNode.getAttribute("hidden")) { popupChild.setAttribute("checked", "true"); } popup.appendChild(popupChild); } } else { if ("true" == currColNode.getAttribute("hidden")) { if (popupChild.getAttribute("checked")) popupChild.removeAttribute("checked"); } else { if (!popupChild.getAttribute("checked")) popupChild.setAttribute("checked", "true"); } if (currColNode.getAttribute("collapsed") == "true") popupChild.setAttribute("hidden", "true"); else popupChild.removeAttribute("hidden"); popupChild = popupChild.nextSibling; } } currTreeCol = currTreeCol.nextSibling; currColNode = currColNode.nextSibling; }} |
popupChild.setAttribute("value", display); | popupChild.setAttribute("label", display); | function BuildTreePopup( treeColGroup, treeHeadRow, popup, skipCell ){ var popupChild = popup.firstChild; var firstTime = !popupChild ? true : false; var currTreeCol = treeHeadRow.firstChild; var currColNode = treeColGroup.firstChild; var count = 0; while (currTreeCol) { if (currColNode.localName == "splitter") currColNode = currColNode.nextSibling; if (skipCell != currTreeCol) { // Construct an entry for each cell in the row. var columnName = currTreeCol.getAttribute("value"); if (firstTime) { if (currTreeCol.getAttribute("collapsed") != "true") { popupChild = document.createElement("menuitem"); popupChild.setAttribute("type", "checkbox"); popupChild.setAttribute("value", columnName); if (!count++) popupChild.setAttribute("disabled", "true"); if (columnName == "") { var display = currTreeCol.getAttribute("display"); popupChild.setAttribute("value", display); } popupChild.setAttribute("colid", currColNode.id); popupChild.setAttribute("oncommand", "ToggleColumnState(this, document)"); if ("true" != currColNode.getAttribute("hidden")) { popupChild.setAttribute("checked", "true"); } popup.appendChild(popupChild); } } else { if ("true" == currColNode.getAttribute("hidden")) { if (popupChild.getAttribute("checked")) popupChild.removeAttribute("checked"); } else { if (!popupChild.getAttribute("checked")) popupChild.setAttribute("checked", "true"); } if (currColNode.getAttribute("collapsed") == "true") popupChild.setAttribute("hidden", "true"); else popupChild.removeAttribute("hidden"); popupChild = popupChild.nextSibling; } } currTreeCol = currTreeCol.nextSibling; currColNode = currColNode.nextSibling; }} |
this.caption = MSG_VIEW_BREAKS; | function bv_init (){ console.menuSpecs["context:breaks"] = { getContext: this.getContext, items: [ ["find-url"], ["-"], ["clear-break", { enabledif: "has('hasBreak')" }], ["clear-fbreak", { enabledif: "has('hasFBreak')" }], ["-"], ["clear-all"], ["fclear-all"], ["-"], ["break-props"] ] }; this.atomBreak = console.atomService.getAtom("item-breakpoint"); this.atomFBreak = console.atomService.getAtom("future-breakpoint");} |
|
edit_toggle=toggle; | var edit_toggle=toggle; | function ca_enableButtons(){ var items = caOutlinerView.selection; var nr = items.getRangeCount(); var toggle="false"; if (nr == 0) { toggle="true"; } edit_toggle=toggle;/* var edit_toggle="true"; if (nr > 0) { for (var i=0; i<nr; i++) { var o1 = {}; var o2 = {}; items.getRangeAt(i, o1, o2); var min = o1.value; var max = o2.value; var stop = false; for (var j=min; j<=max; j++) { var tokenName = items.outliner.view.getCellText(j, "tokencol"); if (tokenName == "Builtin Object Token") { stop = true; } break; } if (stop) break; } if (i == nr) { edit_toggle="false"; } }*/ var enableViewButton=document.getElementById('ca_viewButton'); enableViewButton.setAttribute("disabled",toggle); var enableEditButton=document.getElementById('ca_editButton'); enableEditButton.setAttribute("disabled",edit_toggle); var enableDeleteButton=document.getElementById('ca_deleteButton'); enableDeleteButton.setAttribute("disabled",toggle);} |
this.mObserverHelper = new calCompositeCalendarObserverHelper(); | function calCompositeCalendar () { this.wrappedJSObject = this;} |
|
this.mObservers = [ ]; | this.mObservers = Array(); | function calDavCalendar() { this.wrappedJSObject = this; this.mObservers = [ ];} |
containerName = ThisCalendarObject.Id.split(':')[2]; | var containerName = ThisCalendarObject.Id.split(':')[2]; | function calendarColorStyleRuleUpdate( ThisCalendarObject ){ var j = -1; var i; // obtain calendar name from the Id containerName = ThisCalendarObject.Id.split(':')[2]; var tempStyleSheets = document.styleSheets; for (i=0; i<tempStyleSheets.length; i++) { if (tempStyleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/)) { j = i; break; } } // check that the calendar.css stylesheet was found if( j != -1 ) { var ruleList = tempStyleSheets[j].cssRules; var ruleName; for (i=0; i < ruleList.length; i++) { ruleName = ruleList[i].cssText.split(' '); // find the existing rule so that it can be deleted if (ruleName[0] == "." + containerName) { tempStyleSheets[j].deleteRule(i); break; } } // insert the new calendar color rule tempStyleSheets[j].insertRule("." + containerName + " { background-color:" +ThisCalendarObject.color + " !important;}",1); }} |
#ifdef MOZILLA_1_8_BRANCH | function CalendarCustomizeToolbar(){ // Disable the toolbar context menu items var menubar = document.getElementById("main-menubar"); for (var i = 0; i < menubar.childNodes.length; ++i) menubar.childNodes[i].setAttribute("disabled", true); var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.setAttribute("disabled", "true"); window.openDialog("chrome://calendar/content/customizeToolbar.xul", "CustomizeToolbar", "chrome,all,dependent", document.getElementById("calendar-toolbox"));} |
|
#else window.openDialog("chrome: "chrome,all,dependent", document.getElementById("calendar-toolbox")); #endif | function CalendarCustomizeToolbar(){ // Disable the toolbar context menu items var menubar = document.getElementById("main-menubar"); for (var i = 0; i < menubar.childNodes.length; ++i) menubar.childNodes[i].setAttribute("disabled", true); var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.setAttribute("disabled", "true"); window.openDialog("chrome://calendar/content/customizeToolbar.xul", "CustomizeToolbar", "chrome,all,dependent", document.getElementById("calendar-toolbox"));} |
|
calListItems[i+1].childNodes[0].setAttribute("class", "calendar-list-item-class " + containerName); | var calListItem = calListItems[i+1]; if (calListItem && calListItem.childNodes[0]) { calListItem.childNodes[0].setAttribute("class", "calendar-list-item-class " + containerName); } | function calendarInit() { // get the calendar event data source gEventSource = new CalendarEventDataSource(); // get the Ical Library gICalLib = gEventSource.getICalLib(); // this suspends feedbacks to observers until all is settled gICalLib.batchMode = true; // set up the CalendarWindow instance gCalendarWindow = new CalendarWindow(); //when you switch to a view, it takes care of refreshing the events, so that call is not needed. gCalendarWindow.currentView.switchTo( gCalendarWindow.currentView ); // set up the checkboxes variables gOnlyWorkdayChecked = document.getElementById( "only-workday-checkbox-1" ).getAttribute("checked") ; gDisplayToDoInViewChecked = document.getElementById( "display-todo-inview-checkbox-1" ).getAttribute("checked") ; // set up the unifinder prepareCalendarUnifinder(); prepareCalendarToDoUnifinder(); update_date(); checkForMailNews(); // Change made by CofC for Calendar Coloring // initialize calendar color style rules in the calendar's styleSheet // find calendar's style sheet index var i; for (i=0; i<document.styleSheets.length; i++) { if (document.styleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/)) { gCalendarStyleSheet = document.styleSheets[i]; break; } } var calendarNode; var containerName; var calendarColor; // loop through the calendars via the rootSequence of the RDF datasource var seq = gCalendarWindow.calendarManager.rdf.getRootSeq("urn:calendarcontainer"); var list = seq.getSubNodes(); var calListItems = document.getElementById( "list-calendars-listbox" ).getElementsByTagName("listitem"); for(i=0; i<list.length;i++) { calendarNode = gCalendarWindow.calendarManager.rdf.getNode( list[i].subject ); // grab the container name and use it for the name of the style rule containerName = list[i].subject.split(":")[2]; // obtain calendar color from the rdf datasource calendarColor = calendarNode.getAttribute("http://home.netscape.com/NC-rdf#color"); // if the calendar had a color attribute create a style sheet for it if (calendarColor != null) { gCalendarStyleSheet.insertRule("." + containerName + " { background-color:" + calendarColor + "!important;}", 1); calListItems[i+1].childNodes[0].setAttribute("class", "calendar-list-item-class " + containerName); } } // CofC Calendar Coloring Change if( ("arguments" in window) && (window.arguments.length) && (typeof(window.arguments[0]) == "object") && ("channel" in window.arguments[0]) ) { gCalendarWindow.calendarManager.checkCalendarURL( window.arguments[0].channel ); } //a bit of a hack since the menulist doesn't remember the selected value var value = document.getElementById( 'event-filter-menulist' ).value; document.getElementById( 'event-filter-menulist' ).selectedItem = document.getElementById( 'event-filter-'+value ); gEventSource.alarmObserver.firePendingAlarms(); //All is settled, enable feedbacks to observers gICalLib.batchMode = false;} |
if (lightness < 120) | if (lightness < 120) { | function calendarInit() { // get the calendar event data source gEventSource = new CalendarEventDataSource(); // get the Ical Library gICalLib = gEventSource.getICalLib(); // this suspends feedbacks to observers until all is settled gICalLib.batchMode = true; // set up the CalendarWindow instance gCalendarWindow = new CalendarWindow(); //when you switch to a view, it takes care of refreshing the events, so that call is not needed. gCalendarWindow.currentView.switchTo( gCalendarWindow.currentView ); // set up the checkboxes variables gOnlyWorkdayChecked = document.getElementById( "only-workday-checkbox-1" ).getAttribute("checked") ; gDisplayToDoInViewChecked = document.getElementById( "display-todo-inview-checkbox-1" ).getAttribute("checked") ; // set up the unifinder prepareCalendarUnifinder(); prepareCalendarToDoUnifinder(); update_date(); checkForMailNews(); // Change made by CofC for Calendar Coloring // initialize calendar color style rules in the calendar's styleSheet // find calendar's style sheet index var i; for (i=0; i<document.styleSheets.length; i++) { if (document.styleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/)) { gCalendarStyleSheet = document.styleSheets[i]; break; } } var calendarNode; var containerName; var calendarColor; // loop through the calendars via the rootSequence of the RDF datasource var seq = gCalendarWindow.calendarManager.rdf.getRootSeq("urn:calendarcontainer"); var list = seq.getSubNodes(); var calListItems = document.getElementById( "list-calendars-listbox" ).getElementsByTagName("listitem"); for(i=0; i<list.length;i++) { calendarNode = gCalendarWindow.calendarManager.rdf.getNode( list[i].subject ); // grab the container name and use it for the name of the style rule containerName = list[i].subject.split(":")[2]; // obtain calendar color from the rdf datasource calendarColor = calendarNode.getAttribute("http://home.netscape.com/NC-rdf#color"); // if the calendar had a color attribute create a style sheet for it if (calendarColor != null) { gCalendarStyleSheet.insertRule("." + containerName + " { background-color:" + calendarColor + "!important;}", 1); var calcColor = calendarColor.replace(/#/g, ""); var red = parseInt(calcColor.substring(0, 2), 16); var green = parseInt(calcColor.substring(2, 4), 16); var blue = parseInt(calcColor.substring(4, 6), 16); // Calculate the L(ightness) value of the HSL color system. // L = (max(R, G, B) + min(R, G, B)) / 2 var max = Math.max(Math.max(red, green), blue); var min = Math.min(Math.min(red, green), blue); var lightness = (max + min) / 2; // Consider all colors with less than 50% Lightness as dark colors // and use white as the foreground color. // Actually we use a treshold a bit below 50%, so colors like // #FF0000, #00FF00 and #0000FF still get black text which looked // better when we tested this. if (lightness < 120) gCalendarStyleSheet.insertRule("." + containerName + " { color:" + " white" + "!important;}", 1); var calListItem = calListItems[i+1]; if (calListItem && calListItem.childNodes[0]) { calListItem.childNodes[0].setAttribute("class", "calendar-list-item-class " + containerName); } } } // CofC Calendar Coloring Change if( ("arguments" in window) && (window.arguments.length) && (typeof(window.arguments[0]) == "object") && ("channel" in window.arguments[0]) ) { gCalendarWindow.calendarManager.checkCalendarURL( window.arguments[0].channel ); } //a bit of a hack since the menulist doesn't remember the selected value var value = document.getElementById( 'event-filter-menulist' ).value; document.getElementById( 'event-filter-menulist' ).selectedItem = document.getElementById( 'event-filter-'+value ); gEventSource.alarmObserver.firePendingAlarms(); //All is settled, enable feedbacks to observers gICalLib.batchMode = false; var toolbox = document.getElementById("calendar-toolbox"); toolbox.customizeDone = CalendarToolboxCustomizeDone;} |
} else { gCalendarStyleSheet.insertRule("." + containerName + " { color:" + " black" + "!important;}", 1); } | function calendarInit() { // get the calendar event data source gEventSource = new CalendarEventDataSource(); // get the Ical Library gICalLib = gEventSource.getICalLib(); // this suspends feedbacks to observers until all is settled gICalLib.batchMode = true; // set up the CalendarWindow instance gCalendarWindow = new CalendarWindow(); //when you switch to a view, it takes care of refreshing the events, so that call is not needed. gCalendarWindow.currentView.switchTo( gCalendarWindow.currentView ); // set up the checkboxes variables gOnlyWorkdayChecked = document.getElementById( "only-workday-checkbox-1" ).getAttribute("checked") ; gDisplayToDoInViewChecked = document.getElementById( "display-todo-inview-checkbox-1" ).getAttribute("checked") ; // set up the unifinder prepareCalendarUnifinder(); prepareCalendarToDoUnifinder(); update_date(); checkForMailNews(); // Change made by CofC for Calendar Coloring // initialize calendar color style rules in the calendar's styleSheet // find calendar's style sheet index var i; for (i=0; i<document.styleSheets.length; i++) { if (document.styleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/)) { gCalendarStyleSheet = document.styleSheets[i]; break; } } var calendarNode; var containerName; var calendarColor; // loop through the calendars via the rootSequence of the RDF datasource var seq = gCalendarWindow.calendarManager.rdf.getRootSeq("urn:calendarcontainer"); var list = seq.getSubNodes(); var calListItems = document.getElementById( "list-calendars-listbox" ).getElementsByTagName("listitem"); for(i=0; i<list.length;i++) { calendarNode = gCalendarWindow.calendarManager.rdf.getNode( list[i].subject ); // grab the container name and use it for the name of the style rule containerName = list[i].subject.split(":")[2]; // obtain calendar color from the rdf datasource calendarColor = calendarNode.getAttribute("http://home.netscape.com/NC-rdf#color"); // if the calendar had a color attribute create a style sheet for it if (calendarColor != null) { gCalendarStyleSheet.insertRule("." + containerName + " { background-color:" + calendarColor + "!important;}", 1); var calcColor = calendarColor.replace(/#/g, ""); var red = parseInt(calcColor.substring(0, 2), 16); var green = parseInt(calcColor.substring(2, 4), 16); var blue = parseInt(calcColor.substring(4, 6), 16); // Calculate the L(ightness) value of the HSL color system. // L = (max(R, G, B) + min(R, G, B)) / 2 var max = Math.max(Math.max(red, green), blue); var min = Math.min(Math.min(red, green), blue); var lightness = (max + min) / 2; // Consider all colors with less than 50% Lightness as dark colors // and use white as the foreground color. // Actually we use a treshold a bit below 50%, so colors like // #FF0000, #00FF00 and #0000FF still get black text which looked // better when we tested this. if (lightness < 120) gCalendarStyleSheet.insertRule("." + containerName + " { color:" + " white" + "!important;}", 1); var calListItem = calListItems[i+1]; if (calListItem && calListItem.childNodes[0]) { calListItem.childNodes[0].setAttribute("class", "calendar-list-item-class " + containerName); } } } // CofC Calendar Coloring Change if( ("arguments" in window) && (window.arguments.length) && (typeof(window.arguments[0]) == "object") && ("channel" in window.arguments[0]) ) { gCalendarWindow.calendarManager.checkCalendarURL( window.arguments[0].channel ); } //a bit of a hack since the menulist doesn't remember the selected value var value = document.getElementById( 'event-filter-menulist' ).value; document.getElementById( 'event-filter-menulist' ).selectedItem = document.getElementById( 'event-filter-'+value ); gEventSource.alarmObserver.firePendingAlarms(); //All is settled, enable feedbacks to observers gICalLib.batchMode = false; var toolbox = document.getElementById("calendar-toolbox"); toolbox.customizeDone = CalendarToolboxCustomizeDone;} |
|
calListItems[i+1].childNodes[0].setAttribute("class", "calendar-list-item-class " + containerName); } | function calendarInit() { // get the calendar event data source gEventSource = new CalendarEventDataSource(); // get the Ical Library gICalLib = gEventSource.getICalLib(); // this suspends feedbacks to observers until all is settled gICalLib.batchMode = true; // set up the CalendarWindow instance gCalendarWindow = new CalendarWindow(); //when you switch to a view, it takes care of refreshing the events, so that call is not needed. gCalendarWindow.currentView.switchTo( gCalendarWindow.currentView ); // set up the checkboxes variables gOnlyWorkdayChecked = document.getElementById( "only-workday-checkbox-1" ).getAttribute("checked") ; gDisplayToDoInViewChecked = document.getElementById( "display-todo-inview-checkbox-1" ).getAttribute("checked") ; // set up the unifinder prepareCalendarUnifinder(); prepareCalendarToDoUnifinder(); update_date(); checkForMailNews(); // Change made by CofC for Calendar Coloring // initialize calendar color style rules in the calendar's styleSheet // find calendar's style sheet index var i; for (i=0; i<document.styleSheets.length; i++) { if (document.styleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/)) { gCalendarStyleSheet = document.styleSheets[i]; break; } } var calendarNode; var containerName; var calendarColor; // loop through the calendars via the rootSequence of the RDF datasource var seq = gCalendarWindow.calendarManager.rdf.getRootSeq("urn:calendarcontainer"); var list = seq.getSubNodes(); for(i=0; i<list.length;i++) { calendarNode = gCalendarWindow.calendarManager.rdf.getNode( list[i].subject ); // grab the container name and use it for the name of the style rule containerName = list[i].subject.split(":")[2]; // obtain calendar color from the rdf datasource calendarColor = calendarNode.getAttribute("http://home.netscape.com/NC-rdf#color"); // if the calendar had a color attribute create a style sheet for it if (calendarColor != null) gCalendarStyleSheet.insertRule("." + containerName + " { background-color:" + calendarColor + "!important;}", 1); } // CofC Calendar Coloring Change if( ("arguments" in window) && (window.arguments.length) && (typeof(window.arguments[0]) == "object") && ("channel" in window.arguments[0]) ) { gCalendarWindow.calendarManager.checkCalendarURL( window.arguments[0].channel ); } //a bit of a hack since the menulist doesn't remember the selected value var value = document.getElementById( 'event-filter-menulist' ).value; document.getElementById( 'event-filter-menulist' ).selectedItem = document.getElementById( 'event-filter-'+value ); gEventSource.alarmObserver.firePendingAlarms(); //All is settled, enable feedbacks to observers gICalLib.batchMode = false;} |
|
if (("arguments" in window) && (window.arguments.length) && (typeof(window.arguments[0]) == "object") && ("channel" in window.arguments[0]) ) { gCalendarWindow.calendarManager.checkCalendarURL( window.arguments[0].channel ); } | function calendarInit() { // set up the CalendarWindow instance gCalendarWindow = new CalendarWindow(); // Set up the checkbox variables. Do not use the typical change*() functions // because those will actually toggle the current value. if (document.getElementById("toggle_workdays_only").getAttribute("checked") == 'true') { var deck = document.getElementById("view-deck") for each (view in deck.childNodes) { view.workdaysOnly = true; } deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay); } // tasksInView is false by default if (document.getElementById("toggle_tasks_in_view").getAttribute("checked") == 'true') { var deck = document.getElementById("view-deck") for each (view in deck.childNodes) { view.tasksInView = true; } deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay); } // set up the unifinder prepareCalendarUnifinder(); prepareCalendarToDoUnifinder(); scheduleMidnightUpdate(refreshUIBits); checkForMailNews(); initCalendarManager(); // fire up the alarm service var alarmSvc = Components.classes["@mozilla.org/calendar/alarm-service;1"] .getService(Components.interfaces.calIAlarmService); alarmSvc.timezone = calendarDefaultTimezone(); alarmSvc.startup(); if (("arguments" in window) && (window.arguments.length) && (typeof(window.arguments[0]) == "object") && ("channel" in window.arguments[0]) ) { gCalendarWindow.calendarManager.checkCalendarURL( window.arguments[0].channel ); } // a bit of a hack since the menulist doesn't remember the selected value var value = document.getElementById( 'event-filter-menulist' ).value; document.getElementById( 'event-filter-menulist' ).selectedItem = document.getElementById( 'event-filter-'+value ); var toolbox = document.getElementById("calendar-toolbox"); toolbox.customizeDone = CalendarToolboxCustomizeDone; getViewDeck().addEventListener("dayselect", observeViewDaySelect, false); getViewDeck().addEventListener("itemselect", onSelectionChanged, true); // Handle commandline args for (var i=0; i < window.arguments.length; i++) { try { var cl = window.arguments[i].QueryInterface(Components.interfaces.nsICommandLine); } catch(ex) { dump("unknown argument passed to main window\n"); continue; } handleCommandLine(cl); }} |
|
this.username = ""; | function CalendarObject(){ this.path = ""; this.serverNumber = 0; this.name = ""; this.remote = false; this.remotePath = ""; this.active = false; this.username = ""; this.color = ""; this.password = ""; this.publishAutomatically = false;} |
|
this.password = ""; | function CalendarObject(){ this.path = ""; this.serverNumber = 0; this.name = ""; this.remote = false; this.remotePath = ""; this.active = false; this.username = ""; this.color = ""; this.password = ""; this.publishAutomatically = false;} |
|
function getDefaultCategories() { try { var categoriesStringBundle = srGetStrBundle("chrome: return categoriesStringBundle.GetStringFromName("categories" ); } catch(e) { return "" } } | function calendarPreferences( CalendarWindow ){ function getDefaultCategories() { try { var categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties"); return categoriesStringBundle.GetStringFromName("categories" ); } catch(e) { return "" } } window.calendarPrefObserver = new calendarPrefObserver( this ); this.calendarWindow = CalendarWindow; this.arrayOfPrefs = new Object(); this.calendarPref = prefService.getBranch("calendar."); // preferences calendar node // read prefs or set Defaults on the first run try { this.loadPreferences(); } catch(e) { this.calendarPref.setBoolPref( "alarms.show", true ); this.calendarPref.setBoolPref( "alarms.playsound", false ); this.calendarPref.setIntPref( "date.format", 0 ); this.calendarPref.setIntPref( "week.start", 0 ); this.calendarPref.setIntPref( "event.defaultlength", 60 ); this.calendarPref.setIntPref( "alarms.defaultsnoozelength", 10 ); this.calendarPref.setCharPref( "categories.names", getDefaultCategories() ); this.calendarPref.setIntPref( "servers.count", 1 ); //this counts the default server as well, so its 1. this.calendarPref.setBoolPref( "servers.reloadonlaunch", false ); //do we reload the remote servers on launch? this.loadPreferences(); } } |
|
try { this.loadPreferences(); } catch(e) { this.calendarPref.setBoolPref( "alarms.show", true ); this.calendarPref.setBoolPref( "alarms.playsound", false ); this.calendarPref.setIntPref( "date.format", 0 ); this.calendarPref.setIntPref( "week.start", 0 ); this.calendarPref.setIntPref( "event.defaultlength", 60 ); this.calendarPref.setIntPref( "alarms.defaultsnoozelength", 10 ); this.calendarPref.setCharPref( "categories.names", getDefaultCategories() ); this.calendarPref.setIntPref( "servers.count", 1 ); this.calendarPref.setBoolPref( "servers.reloadonlaunch", false ); this.loadPreferences(); } | this.loadPreferences(); | function calendarPreferences( CalendarWindow ){ function getDefaultCategories() { try { var categoriesStringBundle = srGetStrBundle("chrome://calendar/locale/categories.properties"); return categoriesStringBundle.GetStringFromName("categories" ); } catch(e) { return "" } } window.calendarPrefObserver = new calendarPrefObserver( this ); this.calendarWindow = CalendarWindow; this.arrayOfPrefs = new Object(); this.calendarPref = prefService.getBranch("calendar."); // preferences calendar node // read prefs or set Defaults on the first run try { this.loadPreferences(); } catch(e) { this.calendarPref.setBoolPref( "alarms.show", true ); this.calendarPref.setBoolPref( "alarms.playsound", false ); this.calendarPref.setIntPref( "date.format", 0 ); this.calendarPref.setIntPref( "week.start", 0 ); this.calendarPref.setIntPref( "event.defaultlength", 60 ); this.calendarPref.setIntPref( "alarms.defaultsnoozelength", 10 ); this.calendarPref.setCharPref( "categories.names", getDefaultCategories() ); this.calendarPref.setIntPref( "servers.count", 1 ); //this counts the default server as well, so its 1. this.calendarPref.setBoolPref( "servers.reloadonlaunch", false ); //do we reload the remote servers on launch? this.loadPreferences(); } } |
function calendarPublish(aDataString, newLocation, login, password, contentType) | function calendarPublish(aDataString, newLocation, contentType) | function calendarPublish(aDataString, newLocation, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_string_to_channel(protocolChannel, aDataString, contentType); protocolChannel.asyncOpen(gPublishingListener, null); } catch (e) { alert("an error occurred in calendarPublish: " + e + "\n"); }} |
var protocolChannel = get_destination_channel(newLocation, login, password); | var protocolChannel = get_destination_channel(newLocation); | function calendarPublish(aDataString, newLocation, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_string_to_channel(protocolChannel, aDataString, contentType); protocolChannel.asyncOpen(gPublishingListener, null); } catch (e) { alert("an error occurred in calendarPublish: " + e + "\n"); }} |
function calendarPublish(aDataString, newLocation, fileName, login, password, contentType) | function calendarPublish(aDataString, newLocation, login, password, contentType) | function calendarPublish(aDataString, newLocation, fileName, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, fileName, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_string_to_channel(protocolChannel, aDataString, contentType); protocolChannel.asyncOpen(gPublishingListener, null); } catch (e) { alert("an error occurred in calendarPublish: " + e + "\n"); }} |
var protocolChannel = get_destination_channel(newLocation, fileName, login, password); | var protocolChannel = get_destination_channel(newLocation, login, password); | function calendarPublish(aDataString, newLocation, fileName, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, fileName, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_string_to_channel(protocolChannel, aDataString, contentType); protocolChannel.asyncOpen(gPublishingListener, null); } catch (e) { alert("an error occurred in calendarPublish: " + e + "\n"); }} |
var SearchTree = document.getElementById( UnifinderTreeName ); SearchTree.treeBoxObject.selection.selectEventsSuppressed = true; SearchTree.onselect = null; SearchTree.removeEventListener( "select", unifinderOnSelect, true ); if( EventSelectionArray.length > 1 ) { if( gSelectAll === true ) { SearchTree.treeBoxObject.selection.selectAll( ); gSelectAll = false; } } else if( EventSelectionArray.length == 1 ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); if( RowToScrollTo != "null" ) { SearchTree.treeBoxObject.selection.clearSelection( ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } else SearchTree.treeBoxObject.selection.clearSelection( ); setTimeout( "resetAllowSelection()", 1 ); | selectSelectedEventsInTree( EventSelectionArray ); | function calendarUnifinderInit( ){ var unifinderEventSelectionObserver = { onSelectionChanged : function( EventSelectionArray ) { //dump( "\nCALENDAR unifinder.js->on selection changed" ); var SearchTree = document.getElementById( UnifinderTreeName ); /* The following is a brutal hack, caused by http://lxr.mozilla.org/mozilla1.0/source/layout/xul/base/src/tree/src/nsTreeSelection.cpp#555 and described in bug 168211 http://bugzilla.mozilla.org/show_bug.cgi?id=168211 Do NOT remove anything in the next 3 lines, or the selection in the tree will not work. */ SearchTree.treeBoxObject.selection.selectEventsSuppressed = true; SearchTree.onselect = null; SearchTree.removeEventListener( "select", unifinderOnSelect, true ); if( EventSelectionArray.length > 1 ) { /* selecting all events is taken care of in the selectAllEvents in calendar.js ** Other than that, there's no other way to get in here. */ if( gSelectAll === true ) { SearchTree.treeBoxObject.selection.selectAll( ); gSelectAll = false; } } else if( EventSelectionArray.length == 1 ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); if( RowToScrollTo != "null" ) { SearchTree.treeBoxObject.selection.clearSelection( ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } else SearchTree.treeBoxObject.selection.clearSelection( ); /* This needs to be in a setTimeout */ setTimeout( "resetAllowSelection()", 1 ); } } gCalendarWindow.EventSelection.addObserver( unifinderEventSelectionObserver );} |
if( gSelectAll === true ) { SearchTree.treeBoxObject.selection.selectAll( ); gSelectAll = false; } | function calendarUnifinderInit( ){ var unifinderEventSelectionObserver = { onSelectionChanged : function( EventSelectionArray ) { //dump( "\nCALENDAR unifinder.js->on selection changed" ); var SearchTree = document.getElementById( UnifinderTreeName ); /* The following is a brutal hack, caused by http://lxr.mozilla.org/mozilla1.0/source/layout/xul/base/src/tree/src/nsTreeSelection.cpp#555 and described in bug 168211 http://bugzilla.mozilla.org/show_bug.cgi?id=168211 Do NOT remove anything in the next 3 lines, or the selection in the tree will not work. */ SearchTree.treeBoxObject.selection.selectEventsSuppressed = true; SearchTree.onselect = null; SearchTree.removeEventListener( "select", unifinderOnSelect, true ); if( EventSelectionArray.length > 1 ) { //SearchTree.treeBoxObject.selection.selectAll( ); } else if( EventSelectionArray.length == 1 ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); if( RowToScrollTo != "null" ) { SearchTree.treeBoxObject.selection.clearSelection( ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } /* This needs to be in a setTimeout */ setTimeout( "resetSelection()", 1 ); } } gCalendarWindow.EventSelection.addObserver( unifinderEventSelectionObserver );} |
|
setTimeout( "resetSelection()", 1 ); | setTimeout( "resetAllowSelection()", 1 ); | function calendarUnifinderInit( ){ var unifinderEventSelectionObserver = { onSelectionChanged : function( EventSelectionArray ) { //dump( "\nCALENDAR unifinder.js->on selection changed" ); var SearchTree = document.getElementById( UnifinderTreeName ); /* The following is a brutal hack, caused by http://lxr.mozilla.org/mozilla1.0/source/layout/xul/base/src/tree/src/nsTreeSelection.cpp#555 and described in bug 168211 http://bugzilla.mozilla.org/show_bug.cgi?id=168211 Do NOT remove anything in the next 3 lines, or the selection in the tree will not work. */ SearchTree.treeBoxObject.selection.selectEventsSuppressed = true; SearchTree.onselect = null; SearchTree.removeEventListener( "select", unifinderOnSelect, true ); if( EventSelectionArray.length > 1 ) { //SearchTree.treeBoxObject.selection.selectAll( ); } else if( EventSelectionArray.length == 1 ) { var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventSelectionArray[0] ); if( RowToScrollTo != "null" ) { SearchTree.treeBoxObject.selection.clearSelection( ); SearchTree.treeBoxObject.ensureRowIsVisible( RowToScrollTo ); SearchTree.treeBoxObject.selection.timedSelect( RowToScrollTo, 1 ); } } /* This needs to be in a setTimeout */ setTimeout( "resetSelection()", 1 ); } } gCalendarWindow.EventSelection.addObserver( unifinderEventSelectionObserver );} |
function calendarUploadFile(aSourceFilename, newLocation, login, password, contentType) | function calendarUploadFile(aSourceFilename, newLocation, contentType) | function calendarUploadFile(aSourceFilename, newLocation, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_file_to_channel(protocolChannel, aSourceFilename, contentType); protocolChannel.asyncOpen(gPublishingListener, protocolChannel); return; } catch (e) { alert("an error occurred in calendarUploadFile: " + e + "\n"); }} |
var protocolChannel = get_destination_channel(newLocation, login, password); | var protocolChannel = get_destination_channel(newLocation); | function calendarUploadFile(aSourceFilename, newLocation, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_file_to_channel(protocolChannel, aSourceFilename, contentType); protocolChannel.asyncOpen(gPublishingListener, protocolChannel); return; } catch (e) { alert("an error occurred in calendarUploadFile: " + e + "\n"); }} |
function calendarUploadFile(aSourceFilename, newLocation, fileName, login, password, contentType) | function calendarUploadFile(aSourceFilename, newLocation, login, password, contentType) | function calendarUploadFile(aSourceFilename, newLocation, fileName, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, fileName, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_file_to_channel(protocolChannel, aSourceFilename, contentType); protocolChannel.asyncOpen(gPublishingListener, protocolChannel); dump("done\n"); } catch (e) { alert("an error occurred in calendarUploadFile: " + e + "\n"); }} |
var protocolChannel = get_destination_channel(newLocation, fileName, login, password); | var protocolChannel = get_destination_channel(newLocation, login, password); | function calendarUploadFile(aSourceFilename, newLocation, fileName, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, fileName, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_file_to_channel(protocolChannel, aSourceFilename, contentType); protocolChannel.asyncOpen(gPublishingListener, protocolChannel); dump("done\n"); } catch (e) { alert("an error occurred in calendarUploadFile: " + e + "\n"); }} |
dump("done\n"); | return( true ); | function calendarUploadFile(aSourceFilename, newLocation, fileName, login, password, contentType){ try { var protocolChannel = get_destination_channel(newLocation, fileName, login, password); if (!protocolChannel) { dump("failed to get a destination channel\n"); return; } output_file_to_channel(protocolChannel, aSourceFilename, contentType); protocolChannel.asyncOpen(gPublishingListener, protocolChannel); dump("done\n"); } catch (e) { alert("an error occurred in calendarUploadFile: " + e + "\n"); }} |
var viewIDarray = ["day-view", "week-view", "multiweek-view", "month-view"]; for each (id in viewIDarray) { var element = document.getElementById(id); element.controller = gViewController; element.timezone = calendarDefaultTimezone(); element.displayCalendar = getDisplayComposite(); this.EventSelection.addObserver(element.selectionObserver); } | function CalendarWindow( ){ //setup the preferences this.calendarPreferences = new calendarPreferences( this ); // miniMonth used by preferences this.miniMonth = document.getElementById( "lefthandcalendar" ); //setup the calendar event selection this.EventSelection = new CalendarEventSelection( this ); gViewController.selectionManager = this.EventSelection; //global date formater this.dateFormater = new DateFormater( this ); var viewIDarray = ["day-view", "week-view", "multiweek-view", "month-view"]; for each (id in viewIDarray) { var element = document.getElementById(id); element.controller = gViewController; element.timezone = calendarDefaultTimezone(); element.displayCalendar = getDisplayComposite(); this.EventSelection.addObserver(element.selectionObserver); } /** This object only exists to keep too many things from breaking during the * switch to the new views **/ this.currentView = { hiliteTodaysDate: function() { document.getElementById("view-deck").selectedPanel.goToDay(now()); }, // This will get converted again to a calDateTime, which is silly, but let's // not change too much right now. getNewEventDate: function() { var d = document.getElementById("view-deck").selectedPanel.selectedDay; if (!d) d = now(); d = d.getInTimezone("floating"); d.hour = now().hour; return d.jsDate; }, get eventList() { return new Array(); }, goToNext: function() { document.getElementById("view-deck").selectedPanel.moveView(1); }, goToPrevious: function() { document.getElementById("view-deck").selectedPanel.moveView(-1); }, changeNumberOfWeeks: function(menuitem) { var mwView = document.getElementById("view-deck").selectedPanel; mwView.weeksInView = menuitem.value; }, get selectedDate() { return this.getNewEventDate(); }, get displayStartDate() { return document.getElementById("view-deck").selectedPanel.startDay; }, get displayEndDate() { return document.getElementById("view-deck").selectedPanel.endDay; }, getVisibleEvent: function(event) { var view = document.getElementById("view-deck").selectedPanel if ((event.startDate.compare(view.endDay) != 1) && (event.endDate.compare(view.startDay) != -1)) { return true; } return false; }, goToDay: function(newDate) { document.getElementById("view-deck").selectedPanel.goToDay(jsDateToDateTime(newDate)); }, refresh: function() { this.goToDay(this.getNewEventDate()); } }; // Get the last view that was shown before shutdown, and switch to it var SelectedIndex = document.getElementById("view-deck").selectedIndex; switch( SelectedIndex ) { case "1": this.switchToWeekView(); break; case "2": this.switchToMultiweekView(); break; case "3": this.switchToMonthView(); break; case "0": default: this.switchToDayView(); break; }} |
|
EventObject.displayEndDate = new Date( tmpevent.displayDateEnd ); | EventObject.displayEndDate = new Date( tmpevent.displayEndDate ); | CalendarEventDataSource.prototype.getEventsForDay = function calEvent_getEventsForDay( date ){ var eventDisplays = new Array(); var displayDates = new Object(); var eventList = this.gICalLib.getEventsForDay( date, displayDates ); while( eventList.hasMoreElements() ) { var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay); var EventObject = new Object; EventObject.event = tmpevent.event; EventObject.displayDate = new Date( tmpevent.displayDate ); EventObject.displayEndDate = new Date( tmpevent.displayDateEnd ); eventDisplays[ eventDisplays.length ] = EventObject; } eventDisplays.sort( this.orderEventsByDisplayDate ); return eventDisplays;} |
EventObject.displayEndDate = new Date( tmpevent.displayDateEnd ); | EventObject.displayEndDate = new Date( tmpevent.displayEndDate ); | CalendarEventDataSource.prototype.getEventsForMonth = function calEvent_getEventsForMonth( date ){ var eventDisplays = new Array(); var displayDates = new Object(); var eventList = this.gICalLib.getEventsForMonth( date, displayDates ); while( eventList.hasMoreElements() ) { var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay); var EventObject = new Object; EventObject.event = tmpevent.event; EventObject.displayDate = new Date( tmpevent.displayDate ); EventObject.displayEndDate = new Date( tmpevent.displayDateEnd ); eventDisplays[ eventDisplays.length ] = EventObject; } eventDisplays.sort( this.orderEventsByDisplayDate ); return eventDisplays;} |
EventObject.displayEndDate = new Date( tmpevent.displayDateEnd ); | EventObject.displayEndDate = new Date( tmpevent.displayEndDate ); | CalendarEventDataSource.prototype.getEventsForWeek = function calEvent_getEventsForWeek( date ){ var eventDisplays = new Array(); var displayDates = new Object(); var eventList = this.gICalLib.getEventsForWeek( date, displayDates ); while( eventList.hasMoreElements() ) { var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay); var displayDate = new Date( displayDates.value.getNext().QueryInterface(Components.interfaces.nsISupportsPRTime).data ); var EventObject = new Object; EventObject.event = tmpevent; EventObject.displayDate = displayDate; EventObject.displayEndDate = new Date( tmpevent.displayDateEnd ); eventDisplays[ eventDisplays.length ] = EventObject; } eventDisplays.sort( this.orderEventsByDisplayDate ); return eventDisplays;} |
EventObject.displayEndDate = displayDateEnd; | EventObject.displayEndDate = displayEndDate; | CalendarEventDataSource.prototype.getNextEvents = function calEvent_getNextEvents( EventsToGet ){ var eventDisplays = new Array(); var today = new Date(); var displayDates = new Object(); var eventList = this.gICalLib.getNextNEvents( today, EventsToGet, displayDates ); while( eventList.hasMoreElements() ) { var tmpevent = eventList.getNext().QueryInterface(Components.interfaces.oeIICalEventDisplay); var EventObject = new Object; EventObject.event = tmpevent; EventObject.displayDate = displayDate; EventObject.displayEndDate = displayDateEnd; eventDisplays[ eventDisplays.length ] = EventObject; } eventDisplays.sort( this.orderRawEventsByDate ); return eventDisplays;} |
display (getMsg(MSN_ERR_INTERNAL_HOOK, h), MT_ERROR); display (formatException(ex), MT_ERROR); dd (formatException(ex), MT_ERROR); | if (e.command.name != "hook-session-display") { display (getMsg(MSN_ERR_INTERNAL_HOOK, h), MT_ERROR); display (formatException(ex), MT_ERROR); } else { dd (getMsg(MSN_ERR_INTERNAL_HOOK, h)); } dd (formatException(ex)); | function callHooks (command, isBefore) { var names, hooks; if (isBefore) hooks = command.beforeHooks; else hooks = command.afterHooks; for (var h in hooks) { if ("dbgDispatch" in console && console.dbgDispatch) { dd ("calling " + (isBefore ? "before" : "after") + " hook " + h); } try { hooks[h](e); } catch (ex) { display (getMsg(MSN_ERR_INTERNAL_HOOK, h), MT_ERROR); display (formatException(ex), MT_ERROR); dd (formatException(ex), MT_ERROR); if (typeof ex == "object" && "stack" in ex) dd (ex.stack); } } }; |
else dd (getStackTrace()); | function callHooks (command, isBefore) { var names, hooks; if (isBefore) hooks = command.beforeHooks; else hooks = command.afterHooks; for (var h in hooks) { if ("dbgDispatch" in console && console.dbgDispatch) { dd ("calling " + (isBefore ? "before" : "after") + " hook " + h); } try { hooks[h](e); } catch (ex) { display (getMsg(MSN_ERR_INTERNAL_HOOK, h), MT_ERROR); display (formatException(ex), MT_ERROR); dd (formatException(ex), MT_ERROR); if (typeof ex == "object" && "stack" in ex) dd (ex.stack); } } }; |
|
dump( "\n calendarManager-> add calendar "+ThisCalendarObject.path ); | calendarManager.prototype.addCalendar = function calMan_addCalendar( ThisCalendarObject ){ this.CalendarWindow.eventSource.gICalLib.addCalendar( ThisCalendarObject.path ); this.CalendarWindow.calendarPreferences.calendarPref.setBoolPref( "server"+this.getCalendarIndex( ThisCalendarObject )+".active", true );} |
|
calendarListItem.setAttribute( "id", "calendar-list-item-"+ThisCalendarObject.serverNumber ); | calendarManager.prototype.addCalendarToListBox = function calMan_addCalendarToListBox( ThisCalendarObject ){ var calendarListItem = document.createElement( "listitem" ); calendarListItem.setAttribute( "id", "calendar-list-item-"+ThisCalendarObject.serverNumber ); calendarListItem.setAttribute( "onclick", "switchCalendar( event );" ); calendarListItem.calendarObject = ThisCalendarObject; calendarListItem.setAttribute( "label", ThisCalendarObject.name ); calendarListItem.setAttribute( "flex", "1" ); calendarListItem.setAttribute( "calendarPath", ThisCalendarObject.path ); calendarListItem.setAttribute( "type", "checkbox" ); calendarListItem.setAttribute( "checked", ThisCalendarObject.active ); document.getElementById( "list-calendars-listbox" ).appendChild( calendarListItem );} |
|
calendarListItem.setAttribute( "label", ThisCalendarObject.name ); calendarListItem.setAttribute( "flex", "1" ); | var calendarListCell = document.createElement( "listcell" ); calendarListCell.setAttribute( "id", "calendar-list-item-"+ThisCalendarObject.serverNumber ); calendarListCell.setAttribute( "class", "calendar-list-item-class" ); calendarListCell.setAttribute( "src", "chrome: calendarListCell.setAttribute( "label", ThisCalendarObject.name ); calendarListCell.setAttribute( "flex", "1" ); calendarListCell.setAttribute( "calendarPath", ThisCalendarObject.path ); calendarListCell.setAttribute( "type", "checkbox" ); calendarListCell.setAttribute( "checked", ThisCalendarObject.active ); | calendarManager.prototype.addCalendarToListBox = function calMan_addCalendarToListBox( ThisCalendarObject ){ var calendarListItem = document.createElement( "listitem" ); calendarListItem.setAttribute( "id", "calendar-list-item-"+ThisCalendarObject.serverNumber ); calendarListItem.setAttribute( "onclick", "switchCalendar( event );" ); calendarListItem.calendarObject = ThisCalendarObject; calendarListItem.setAttribute( "label", ThisCalendarObject.name ); calendarListItem.setAttribute( "flex", "1" ); calendarListItem.setAttribute( "calendarPath", ThisCalendarObject.path ); calendarListItem.setAttribute( "type", "checkbox" ); calendarListItem.setAttribute( "checked", ThisCalendarObject.active ); document.getElementById( "list-calendars-listbox" ).appendChild( calendarListItem );} |
calendarListItem.setAttribute( "calendarPath", ThisCalendarObject.path ); | calendarListItem.appendChild( calendarListCell ); | calendarManager.prototype.addCalendarToListBox = function calMan_addCalendarToListBox( ThisCalendarObject ){ var calendarListItem = document.createElement( "listitem" ); calendarListItem.setAttribute( "id", "calendar-list-item-"+ThisCalendarObject.serverNumber ); calendarListItem.setAttribute( "onclick", "switchCalendar( event );" ); calendarListItem.calendarObject = ThisCalendarObject; calendarListItem.setAttribute( "label", ThisCalendarObject.name ); calendarListItem.setAttribute( "flex", "1" ); calendarListItem.setAttribute( "calendarPath", ThisCalendarObject.path ); calendarListItem.setAttribute( "type", "checkbox" ); calendarListItem.setAttribute( "checked", ThisCalendarObject.active ); document.getElementById( "list-calendars-listbox" ).appendChild( calendarListItem );} |
calendarListItem.setAttribute( "type", "checkbox" ); calendarListItem.setAttribute( "checked", ThisCalendarObject.active ); | var calendarRightListCell = document.createElement( "listcell" ); var calendarImage = document.createElement( "image" ); calendarImage.setAttribute( "id", "calendar-list-image-"+ThisCalendarObject.serverNumber ); calendarImage.setAttribute( "class", "calendar-list-item-class" ); calendarRightListCell.appendChild( calendarImage ); calendarListItem.appendChild( calendarRightListCell ); | calendarManager.prototype.addCalendarToListBox = function calMan_addCalendarToListBox( ThisCalendarObject ){ var calendarListItem = document.createElement( "listitem" ); calendarListItem.setAttribute( "id", "calendar-list-item-"+ThisCalendarObject.serverNumber ); calendarListItem.setAttribute( "onclick", "switchCalendar( event );" ); calendarListItem.calendarObject = ThisCalendarObject; calendarListItem.setAttribute( "label", ThisCalendarObject.name ); calendarListItem.setAttribute( "flex", "1" ); calendarListItem.setAttribute( "calendarPath", ThisCalendarObject.path ); calendarListItem.setAttribute( "type", "checkbox" ); calendarListItem.setAttribute( "checked", ThisCalendarObject.active ); document.getElementById( "list-calendars-listbox" ).appendChild( calendarListItem );} |
node.setAttribute("http: node.setAttribute("http: | calendarManager.prototype.addServerDialogResponse = function calMan_addServerDialogResponse( CalendarObject ){ var next = this.nextCalendar(); var name = "calendar"+next; CalendarObject.active = true; CalendarObject.remotePath = CalendarObject.remotePath.replace( "webcal:", "http:" ); var node = this.rootContainer.addNode(name); node.setAttribute("http://home.netscape.com/NC-rdf#active", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#serverNumber", next); node.setAttribute("http://home.netscape.com/NC-rdf#name", CalendarObject.name); var profileFile; if( CalendarObject.path == "" ) { //they didn't set a path in the box, that's OK, its not required. profileFile = this.getProfileDirectory(); profileFile.append("Calendar"); profileFile.append("CalendarDataFile"+ next+ ".ics"); CalendarObject.path = profileFile.path; } node.setAttribute("http://home.netscape.com/NC-rdf#path", CalendarObject.path); // CofC save off the color of the new calendar // Add the default color for when a user does not select a calendar color. if( CalendarObject.color == '' ) { node.setAttribute("http://home.netscape.com/NC-rdf#color", "#F9F4FF"); } else { node.setAttribute("http://home.netscape.com/NC-rdf#color", CalendarObject.color); } if( CalendarObject.remotePath.indexOf( "http://" ) != -1 || CalendarObject.remotePath.indexOf( "https://" ) != -1 || CalendarObject.remotePath.indexOf( "ftp://" ) != -1 ) { profileFile = this.getProfileDirectory(); profileFile.append( "Calendar" ); profileFile.append("RemoteCalendar"+ next+ ".ics"); node.setAttribute("http://home.netscape.com/NC-rdf#remote", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#remotePath", CalendarObject.remotePath); node.setAttribute("http://home.netscape.com/NC-rdf#publishAutomatically", CalendarObject.publishAutomatically); node.setAttribute("http://home.netscape.com/NC-rdf#username", CalendarObject.username); node.setAttribute("http://home.netscape.com/NC-rdf#password", CalendarObject.password); this.retrieveAndSaveRemoteCalendar( node ); dump( "Remote Calendar Number "+ next+ " Added\n" ); } else { node.setAttribute("http://home.netscape.com/NC-rdf#remote", "false"); dump( "Calendar Number "+CalendarObject.serverNumber+" Added\n" ); } this.rdf.flush(); // change made by PAB... new calendars don't have their Id field set because // it does not exist until after the node is created. This causes trouble downstream // because the calendar coloring code forms the name of the color style from the Id. // So... set the CalendarObjects Id here CalendarObject.Id = node.resource.Value; // call the calendar color update function with the calendar object // NOTE: this call was moved calendarColorStyleRuleUpdate( CalendarObject );} |
|
node.setAttribute("http: node.setAttribute("http: | calendarManager.prototype.addServerDialogResponse = function calMan_addServerDialogResponse( CalendarObject ){ var name = "calendar"+this.rootContainer.getSubNodes().length; CalendarObject.active = true; CalendarObject.path = CalendarObject.path.replace( "webcal:", "http:" ); var node = this.rootContainer.addNode(name); node.setAttribute("http://home.netscape.com/NC-rdf#active", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#username", CalendarObject.username); node.setAttribute("http://home.netscape.com/NC-rdf#password", CalendarObject.password); node.setAttribute("http://home.netscape.com/NC-rdf#serverNumber", this.rootContainer.getSubNodes().length); node.setAttribute("http://home.netscape.com/NC-rdf#name", CalendarObject.name); var profileFile; if( CalendarObject.path == "" ) { //they didn't set a path in the box, that's OK, its not required. profileFile = this.getProfileDirectory(); profileFile.append("Calendar"); profileFile.append("CalendarDataFile"+this.rootContainer.getSubNodes().length+".ics"); CalendarObject.path = profileFile.path; } node.setAttribute("http://home.netscape.com/NC-rdf#path", CalendarObject.remotePath) if( CalendarObject.remotePath.indexOf( "http://" ) != -1 || CalendarObject.remotePath.indexOf( "https://" ) != -1 || CalendarObject.remotePath.indexOf( "ftp://" ) != -1 ) { profileFile = this.getProfileDirectory(); profileFile.append( "Calendar" ); profileFile.append("RemoteCalendar"+this.rootContainer.getSubNodes().length+".ics"); node.setAttribute("http://home.netscape.com/NC-rdf#remote", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#remotePath", CalendarObject.remotePath); node.setAttribute("http://home.netscape.com/NC-rdf#path", profileFile.path); node.setAttribute("http://home.netscape.com/NC-rdf#publishAutomatically", CalendarObject.publishAutomatically); this.retrieveAndSaveRemoteCalendar( node ); dump( "Remote Calendar Number "+this.rootContainer.getSubNodes().length+" Added" ); } else { node.setAttribute("http://home.netscape.com/NC-rdf#remote", "false"); dump( "Calendar Number "+CalendarObject.serverNumber+" Added" ); } this.rdf.flush();} |
|
node.setAttribute("http: | calendarManager.prototype.addServerDialogResponse = function calMan_addServerDialogResponse( CalendarObject ){ var name = "calendar"+this.rootContainer.getSubNodes().length; CalendarObject.active = true; CalendarObject.path = CalendarObject.path.replace( "webcal:", "http:" ); var node = this.rootContainer.addNode(name); node.setAttribute("http://home.netscape.com/NC-rdf#active", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#username", CalendarObject.username); node.setAttribute("http://home.netscape.com/NC-rdf#password", CalendarObject.password); node.setAttribute("http://home.netscape.com/NC-rdf#serverNumber", this.rootContainer.getSubNodes().length); node.setAttribute("http://home.netscape.com/NC-rdf#name", CalendarObject.name); var profileFile; if( CalendarObject.path == "" ) { //they didn't set a path in the box, that's OK, its not required. profileFile = this.getProfileDirectory(); profileFile.append("Calendar"); profileFile.append("CalendarDataFile"+this.rootContainer.getSubNodes().length+".ics"); CalendarObject.path = profileFile.path; } node.setAttribute("http://home.netscape.com/NC-rdf#path", CalendarObject.remotePath) if( CalendarObject.remotePath.indexOf( "http://" ) != -1 || CalendarObject.remotePath.indexOf( "https://" ) != -1 || CalendarObject.remotePath.indexOf( "ftp://" ) != -1 ) { profileFile = this.getProfileDirectory(); profileFile.append( "Calendar" ); profileFile.append("RemoteCalendar"+this.rootContainer.getSubNodes().length+".ics"); node.setAttribute("http://home.netscape.com/NC-rdf#remote", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#remotePath", CalendarObject.remotePath); node.setAttribute("http://home.netscape.com/NC-rdf#path", profileFile.path); node.setAttribute("http://home.netscape.com/NC-rdf#publishAutomatically", CalendarObject.publishAutomatically); this.retrieveAndSaveRemoteCalendar( node ); dump( "Remote Calendar Number "+this.rootContainer.getSubNodes().length+" Added" ); } else { node.setAttribute("http://home.netscape.com/NC-rdf#remote", "false"); dump( "Calendar Number "+CalendarObject.serverNumber+" Added" ); } this.rdf.flush();} |
|
node.setAttribute("http: node.setAttribute("http: | calendarManager.prototype.addServerDialogResponse = function calMan_addServerDialogResponse( CalendarObject ){ var name = "calendar"+this.rootContainer.getSubNodes().length; CalendarObject.active = true; CalendarObject.path = CalendarObject.path.replace( "webcal:", "http:" ); var node = this.rootContainer.addNode(name); node.setAttribute("http://home.netscape.com/NC-rdf#active", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#username", CalendarObject.username); node.setAttribute("http://home.netscape.com/NC-rdf#password", CalendarObject.password); node.setAttribute("http://home.netscape.com/NC-rdf#serverNumber", this.rootContainer.getSubNodes().length); node.setAttribute("http://home.netscape.com/NC-rdf#name", CalendarObject.name); var profileFile; if( CalendarObject.path == "" ) { //they didn't set a path in the box, that's OK, its not required. profileFile = this.getProfileDirectory(); profileFile.append("Calendar"); profileFile.append("CalendarDataFile"+this.rootContainer.getSubNodes().length+".ics"); CalendarObject.path = profileFile.path; } node.setAttribute("http://home.netscape.com/NC-rdf#path", CalendarObject.remotePath) if( CalendarObject.remotePath.indexOf( "http://" ) != -1 || CalendarObject.remotePath.indexOf( "https://" ) != -1 || CalendarObject.remotePath.indexOf( "ftp://" ) != -1 ) { profileFile = this.getProfileDirectory(); profileFile.append( "Calendar" ); profileFile.append("RemoteCalendar"+this.rootContainer.getSubNodes().length+".ics"); node.setAttribute("http://home.netscape.com/NC-rdf#remote", "true"); node.setAttribute("http://home.netscape.com/NC-rdf#remotePath", CalendarObject.remotePath); node.setAttribute("http://home.netscape.com/NC-rdf#path", profileFile.path); node.setAttribute("http://home.netscape.com/NC-rdf#publishAutomatically", CalendarObject.publishAutomatically); this.retrieveAndSaveRemoteCalendar( node ); dump( "Remote Calendar Number "+this.rootContainer.getSubNodes().length+" Added" ); } else { node.setAttribute("http://home.netscape.com/NC-rdf#remote", "false"); dump( "Calendar Number "+CalendarObject.serverNumber+" Added" ); } this.rdf.flush();} |
|
this.CalendarWindow.calendarPreferences.calendarPref.setBoolPref( "server"+CalendarObject.serverNumber+".remote", true ); | this.CalendarWindow.calendarPreferences.calendarPref.setBoolPref( "server"+CalendarObject.serverNumber+".remote", CalendarObject.remote ); | calendarManager.prototype.addServerDialogResponse = function calMan_addServerDialogResponse( CalendarObject ){ CalendarObject.active = true; CalendarObject.serverNumber = this.nextCalendarNumber; this.nextCalendarNumber++; CalendarObject.path = CalendarObject.path.replace( "webcal:", "http:" ); if( CalendarObject.path.indexOf( "http://" ) != -1 ) { var profileComponent = Components.classes["@mozilla.org/profile/manager;1"].createInstance(); var profileInternal = profileComponent.QueryInterface(Components.interfaces.nsIProfileInternal); var profileFile = profileInternal.getProfileDir(profileInternal.currentProfile); profileFile.append("RemoteCalendar"+CalendarObject.serverNumber+".ics"); CalendarObject.remotePath = CalendarObject.path; CalendarObject.path = profileFile.path; this.retrieveAndSaveRemoteCalendar( CalendarObject, onResponseAndRefresh ); dump( "Remote Calendar Number "+CalendarObject.serverNumber+" Added" ); } else { dump( "Calendar Number "+CalendarObject.serverNumber+" Added" ); } //add the information to the preferences. this.CalendarWindow.calendarPreferences.calendarPref.setCharPref( "server"+CalendarObject.serverNumber+".name", CalendarObject.name ); this.CalendarWindow.calendarPreferences.calendarPref.setBoolPref( "server"+CalendarObject.serverNumber+".remote", true ); this.CalendarWindow.calendarPreferences.calendarPref.setCharPref( "server"+CalendarObject.serverNumber+".remotePath", CalendarObject.remotePath ); this.CalendarWindow.calendarPreferences.calendarPref.setCharPref( "server"+CalendarObject.serverNumber+".path", CalendarObject.path ); this.CalendarWindow.calendarPreferences.calendarPref.setBoolPref( "server"+CalendarObject.serverNumber+".active", true ); this.CalendarWindow.calendarPreferences.calendarPref.setIntPref( "servers.count", (parseInt( CalendarObject.serverNumber )+1) ); //add this to the global calendars array this.calendars[ this.calendars.length ] = CalendarObject; this.updateServerArrayText(); this.addCalendarToListBox( CalendarObject );} |
this.retrieveAndSaveRemoteCalendar( CalendarObject, onResponseAndRefresh ); | if( CalendarObject.remote === true ) this.retrieveAndSaveRemoteCalendar( CalendarObject, onResponseAndRefresh ); | calendarManager.prototype.addServerDialogResponse = function calMan_addServerDialogResponse( CalendarObject ){ CalendarObject.active = true; CalendarObject.serverNumber = this.nextCalendarNumber; this.nextCalendarNumber++; CalendarObject.path = CalendarObject.path.replace( "webcal:", "http:" ); if( CalendarObject.path.indexOf( "http://" ) != -1 ) { var profileComponent = Components.classes["@mozilla.org/profile/manager;1"].createInstance(); var profileInternal = profileComponent.QueryInterface(Components.interfaces.nsIProfileInternal); var profileFile = profileInternal.getProfileDir(profileInternal.currentProfile); profileFile.append("RemoteCalendar"+CalendarObject.serverNumber+".ics"); CalendarObject.remote = true; CalendarObject.remotePath = CalendarObject.path; CalendarObject.path = profileFile.path; dump( "Remote Calendar Number "+CalendarObject.serverNumber+" Added" ); } else { CalendarObject.remote = false; dump( "Calendar Number "+CalendarObject.serverNumber+" Added" ); } //add the information to the preferences. this.CalendarWindow.calendarPreferences.calendarPref.setCharPref( "server"+CalendarObject.serverNumber+".name", CalendarObject.name ); this.CalendarWindow.calendarPreferences.calendarPref.setBoolPref( "server"+CalendarObject.serverNumber+".remote", CalendarObject.remote ); this.CalendarWindow.calendarPreferences.calendarPref.setCharPref( "server"+CalendarObject.serverNumber+".remotePath", CalendarObject.remotePath ); this.CalendarWindow.calendarPreferences.calendarPref.setCharPref( "server"+CalendarObject.serverNumber+".path", CalendarObject.path ); this.CalendarWindow.calendarPreferences.calendarPref.setBoolPref( "server"+CalendarObject.serverNumber+".active", true ); this.CalendarWindow.calendarPreferences.calendarPref.setIntPref( "servers.count", (parseInt( CalendarObject.serverNumber )+1) ); //add this to the global calendars array this.calendars[ this.calendars.length ] = CalendarObject; this.updateServerArrayText(); this.addCalendarToListBox( CalendarObject ); this.retrieveAndSaveRemoteCalendar( CalendarObject, onResponseAndRefresh );} |
document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ).parentNode.removeChild( document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ) ); | document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ).parentNode.parentNode.removeChild( document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ).parentNode ); | calendarManager.prototype.deleteCalendar = function calMan_deleteCalendar( ThisCalendarObject ){ this.removeCalendar( ThisCalendarObject ); //remove it from the array var index = 0; for( var i = 0; i < this.calendars.length; i++ ) { if( this.calendars[i] == ThisCalendarObject ) { index = i; break; } } this.calendars.splice( index, 1 ); //remove it from the prefs this.updateServerArrayText(); //http://lxr.mozilla.org/seamonkey/source/modules/libpref/public/nsIPrefBranch.idl#205 this.CalendarWindow.calendarPreferences.calendarPref.clearUserPref( "server"+ThisCalendarObject.serverNumber+".name" ); this.CalendarWindow.calendarPreferences.calendarPref.clearUserPref( "server"+ThisCalendarObject.serverNumber+".path" ); this.CalendarWindow.calendarPreferences.calendarPref.clearUserPref( "server"+ThisCalendarObject.serverNumber+".remote" ); this.CalendarWindow.calendarPreferences.calendarPref.clearUserPref( "server"+ThisCalendarObject.serverNumber+".remotePath" ); this.CalendarWindow.calendarPreferences.calendarPref.clearUserPref( "server"+ThisCalendarObject.serverNumber+".active" ); //remove the listitem document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ).parentNode.removeChild( document.getElementById( "calendar-list-item-"+ThisCalendarObject.serverNumber ) ); //TODO: remove the file completely} |
node.setAttribute("http: node.setAttribute("http: | calendarManager.prototype.editServerDialogResponse = function calMan_editServerDialogResponse( CalendarObject ){ var name = CalendarObject.Id; //get the node var node = this.rdf.getNode( name ); node.setAttribute("http://home.netscape.com/NC-rdf#username", CalendarObject.username); node.setAttribute("http://home.netscape.com/NC-rdf#password", CalendarObject.password); node.setAttribute( "http://home.netscape.com/NC-rdf#name", CalendarObject.name ); node.setAttribute("http://home.netscape.com/NC-rdf#publishAutomatically", CalendarObject.publishAutomatically); node.setAttribute("http://home.netscape.com/NC-rdf#color", CalendarObject.color); this.rdf.flush(); // CofC // call the calendar color update function with the calendar object calendarColorStyleRuleUpdate( CalendarObject );} |
|
if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) | else if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) | calendarManager.prototype.getRemoteCalendarText = function calMan_getRemoteCalendarText( Channel, onResponse, onError ){ var Listener = { onStreamComplete: function(loader, ctxt, status, resultLength, result) { window.setCursor( "default" ); var retval = false; result = String.fromCharCode.apply(this, result); //check to make sure its actually a calendar file, if not return. if( result.indexOf( "BEGIN:VCALENDAR" ) == -1 ) { alert( "This doesn't appear to be a valid file. Here's what I got back from\n"+Channel.URI.spec+":\nResult:"+result ); } else { onResponse( result ); retval = true; } if( gNextSubNodeToRefresh ) gCalendarWindow.calendarManager.refreshAllRemoteCalendars(); return retval; } } var myInstance = Components.classes["@mozilla.org/network/stream-loader;1"].createInstance(Components.interfaces.nsIStreamLoader); dump( "init channel, \nChannel is "+Channel+"\nURL is "+Channel.URI.spec+"\n" ); window.setCursor( "wait" ); myInstance.init( Channel, Listener, null );} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.