rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
statusFeedback = Components.classes["component:
statusFeedback = Components.classes["@mozilla.org/messenger/statusfeedback;1"].createInstance();
function AbPrintCard(){ dump("print card\n"); var selectedItems = resultsTree.selectedItems; var numSelected = selectedItems.length; if (numSelected == 0) { dump("AbPrintCard(): No card selected.\n"); return false; } var statusFeedback; statusFeedback = Components.classes["component://netscape/messenger/statusfeedback"].createInstance(); statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback); var selectionArray = new Array(numSelected); var totalCard = 0; for(var i = 0; i < numSelected; i++) { var uri = selectedItems[i].getAttribute("id"); var cardResource = top.rdf.GetResource(uri); var card = cardResource.QueryInterface(Components.interfaces.nsIAbCard); if (card.printCardUrl.length) { selectionArray[totalCard++] = card.printCardUrl; dump("printCardUrl = " + card.printCardUrl + "\n"); } } printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul", "", "chrome,dialog=no,all", totalCard, selectionArray, statusFeedback); return true;}
totalCard, selectionArray, statusFeedback);
totalCard, selectionArray, statusFeedback, gPrintSettings);
function AbPrintCard(){ var selectedItems = GetSelectedAbCards(); var numSelected = selectedItems.length; if (!numSelected) return; var addressbook = Components.classes["@mozilla.org/addressbook;1"].createInstance(Components.interfaces.nsIAddressBook); var uri = GetAbViewURI(); if (!uri) return; var statusFeedback; statusFeedback = Components.classes["@mozilla.org/messenger/statusfeedback;1"].createInstance(); statusFeedback = statusFeedback.QueryInterface(Components.interfaces.nsIMsgStatusFeedback); var selectionArray = new Array(numSelected); var totalCard = 0; for(var i = 0; i < numSelected; i++) { var card = selectedItems[i]; var printCardUrl = CreatePrintCardUrl(card); if (printCardUrl) { selectionArray[totalCard++] = printCardUrl; } } printEngineWindow = window.openDialog("chrome://messenger/content/msgPrintEngine.xul", "", "chrome,dialog=no,all", totalCard, selectionArray, statusFeedback); return;}
else if (t.localName == "outlinerbody") {
else if (t.localName == "outlinerchildren") {
function AbResultsPaneOnClick(event){ // we only care about button 0 (left click) events if (event.button != 0) return; // all we need to worry about here is double clicks // and column header clicks. // // we get in here for clicks on the "outlinercol" (headers) // and the "scrollbarbutton" (scrollbar buttons) // we don't want those events to cause a "double click" var t = event.originalTarget; if (t.localName == "outlinercol") { var sortDirection = kDefaultDescending; if (gAbView) { var node = document.getElementById(gAbView.URI); sortDirection = node.getAttribute("sortDirection"); if (sortDirection == kDefaultDescending) sortDirection = kDefaultAscending; else sortDirection = kDefaultDescending; } SortAndUpdateIndicators(t.id, sortDirection); } else if (t.localName == "outlinerbody") { var row = new Object; var colID = new Object; var childElt = new Object; var outliner = GetAbResultsOutliner(); // figure out what cell the click was in outliner.boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject).getCellAt(event.clientX, event.clientY, row, colID, childElt); if (row.value == -1) return; if (event.detail == 2) { AbResultsPaneDoubleClick(gAbView.getCardFromRow(row.value)); } else { UpdateCardView(); } }}
if (pickerRv.reason == PICK_CANCEL)
if (!pickerRv.ok)
function accept(c) { if (c.TYPE == "IRCDCCChat") { if (!c.accept()) return false; display(getMsg(MSG_DCCCHAT_ACCEPTED, c._getParams()), "DCC-CHAT"); return true; } // Accept the request passed in... var filename = c.filename; var ext = "*"; var m = filename.match(/...\.([a-z]+)$/i); if (m) ext = "*." + m[1]; var pickerRv = pickSaveAs(getMsg(MSG_DCCFILE_SAVE_TO, filename), ["$all", ext], filename); if (pickerRv.reason == PICK_CANCEL) return false; if (!c.accept(pickerRv.file)) return false; display(getMsg(MSG_DCCFILE_ACCEPTED, c._getParams()), "DCC-FILE"); return true; };
#ifndef MOZ_PHOENIX
function acceptDialog(){ var appName = gBrandBundle.getString("brandShortName"); var profilesElement = document.getElementById("profiles"); var selectedProfile = profilesElement.selectedItem; if (!selectedProfile) { var pleaseSelectTitle = gProfileManagerBundle.getString("pleaseSelectTitle"); var pleaseSelect = gProfileManagerBundle.getFormattedString("pleaseSelect", [appName]); gPromptService.alert(window, pleaseSelectTitle, pleaseSelect); return false; } var profileLock; try { profileLock = selectedProfile.profile.lock(); } catch (e) { var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle"); var locked = gProfileManagerBundle.getFormattedString("profileLocked", [appName, selectedProfile.profile.name]); gPromptService.alert(window, lockedTitle, locked); return false; } gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0, false); var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); gProfileService.startWithLastProfile = autoSelectLastProfile.checked; gProfileService.selectedProfile = selectedProfile.profile; /* Bug 257777 */#ifndef MOZ_PHOENIX gProfileService.startOffline = document.getElementById("offlineState").checked;#endif gDialogParams.SetInt(0, 1); return true;}
#endif
function acceptDialog(){ var appName = gBrandBundle.getString("brandShortName"); var profilesElement = document.getElementById("profiles"); var selectedProfile = profilesElement.selectedItem; if (!selectedProfile) { var pleaseSelectTitle = gProfileManagerBundle.getString("pleaseSelectTitle"); var pleaseSelect = gProfileManagerBundle.getFormattedString("pleaseSelect", [appName]); gPromptService.alert(window, pleaseSelectTitle, pleaseSelect); return false; } var profileLock; try { profileLock = selectedProfile.profile.lock(); } catch (e) { var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle"); var locked = gProfileManagerBundle.getFormattedString("profileLocked", [appName, selectedProfile.profile.name]); gPromptService.alert(window, lockedTitle, locked); return false; } gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0, false); var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); gProfileService.startWithLastProfile = autoSelectLastProfile.checked; gProfileService.selectedProfile = selectedProfile.profile; /* Bug 257777 */#ifndef MOZ_PHOENIX gProfileService.startOffline = document.getElementById("offlineState").checked;#endif gDialogParams.SetInt(0, 1); return true;}
#end if
function acceptDialog(){ var appName = gBrandBundle.getString("brandShortName"); var profilesElement = document.getElementById("profiles"); var selectedProfile = profilesElement.selectedItem; if (!selectedProfile) { var pleaseSelectTitle = gProfileManagerBundle.getString("pleaseSelectTitle"); var pleaseSelect = gProfileManagerBundle.getFormattedString("pleaseSelect", [appName]); gPromptService.alert(window, pleaseSelectTitle, pleaseSelect); return false; } var profileLock; try { profileLock = selectedProfile.profile.lock(); } catch (e) { var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle"); var locked = gProfileManagerBundle.getFormattedString("profileLocked", [appName, selectedProfile.profile.name]); gPromptService.alert(window, lockedTitle, locked); return false; } gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0, false); var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); gProfileService.startWithLastProfile = autoSelectLastProfile.checked; gProfileService.selectedProfile = selectedProfile.profile; gProfileService.startOffline = document.getElementById("offlineState").checked; gDialogParams.SetInt(0, 1); return true;}
profileLock = selectedProfile.profile.lock();
profileLock = selectedProfile.profile.lock({ value: null });
function acceptDialog(){ var appName = gBrandBundle.getString("brandShortName"); var profilesElement = document.getElementById("profiles"); var selectedProfile = profilesElement.selectedItem; if (!selectedProfile) { var pleaseSelectTitle = gProfileManagerBundle.getString("pleaseSelectTitle"); var pleaseSelect = gProfileManagerBundle.getFormattedString("pleaseSelect", [appName]); gPromptService.alert(window, pleaseSelectTitle, pleaseSelect); return false; } var profileLock; try { profileLock = selectedProfile.profile.lock(); } catch (e) { var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle"); var locked = gProfileManagerBundle.getFormattedString("profileLocked", [appName, selectedProfile.profile.name]); gPromptService.alert(window, lockedTitle, locked); return false; } gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0, false); var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); gProfileService.startWithLastProfile = autoSelectLastProfile.checked; gProfileService.selectedProfile = selectedProfile.profile; /* Bug 257777 */ gProfileService.startOffline = document.getElementById("offlineState").checked; gDialogParams.SetInt(0, 1); return true;}
gProfileManagerBundle.getFormattedString("profileLocked", [appName, selectedProfile.profile.name]);
gProfileManagerBundle.getFormattedString("profileLocked2", [appName, selectedProfile.profile.name, appName]);
function acceptDialog(){ var appName = gBrandBundle.getString("brandShortName"); var profilesElement = document.getElementById("profiles"); var selectedProfile = profilesElement.selectedItem; if (!selectedProfile) { var pleaseSelectTitle = gProfileManagerBundle.getString("pleaseSelectTitle"); var pleaseSelect = gProfileManagerBundle.getFormattedString("pleaseSelect", [appName]); gPromptService.alert(window, pleaseSelectTitle, pleaseSelect); return false; } var profileLock; try { profileLock = selectedProfile.profile.lock(); } catch (e) { var lockedTitle = gProfileManagerBundle.getString("profileLockedTitle"); var locked = gProfileManagerBundle.getFormattedString("profileLocked", [appName, selectedProfile.profile.name]); gPromptService.alert(window, lockedTitle, locked); return false; } gDialogParams.objects.insertElementAt(profileLock.nsIProfileLock, 0, false); var autoSelectLastProfile = document.getElementById("autoSelectLastProfile"); gProfileService.startWithLastProfile = autoSelectLastProfile.checked; gProfileService.selectedProfile = selectedProfile.profile; /* Bug 257777 */ gProfileService.startOffline = document.getElementById("offlineState").checked; gDialogParams.SetInt(0, 1); return true;}
var accountManager = Components.classes["component:
var accountManager = Components.classes["@mozilla.org/messenger/account-manager;1"].getService(Components.interfaces.nsIMsgAccountManager);
function AccountExists(userName,hostName,serverType){ dump("AccountExists("+userName+","+hostName+","+serverType+")\n"); var accountExists = false; var accountManager = Components.classes["component://netscape/messenger/account-manager"].getService(Components.interfaces.nsIMsgAccountManager); try { var server = accountManager.FindServer(userName,hostName,serverType); if (server) { dump("account exists\n"); accountExists = true; } } catch (ex) { dump("AccountExists() failed: "+ex+"\n"); accountExists = false; } return accountExists;}
$(element).focus(); $(element).select();
element = $(element); element.focus(); if (element.select) element.select();
activate: function(element) { $(element).focus(); $(element).select(); }
add: function(t) { return this.pushStack( jQuery.merge( this, t.constructor == String ? jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments ); },
add: function(element, type, handler) { if ( jQuery.browser.msie && element.setInterval != undefined ) element = window; if ( !handler.guid ) handler.guid = this.guid++; if (!element.events) element.events = {}; var handlers = element.events[type]; if (!handlers) { handlers = element.events[type] = {}; if (element["on" + type]) handlers[0] = element["on" + type]; } handlers[handler.guid] = handler; element["on" + type] = this.handle; if (!this.global[type]) this.global[type] = []; this.global[type].push( element ); },
add: function(t) { return this.pushStack( jQuery.merge( this, t.constructor == String ? jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments ); },
jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments );
jQuery.find(t) : t.constructor == Array ? t : [t] ) );
add: function(t) { return this.pushStack( jQuery.merge( this, typeof t == "string" ? jQuery.find(t) : t.constructor == Array ? t : [t] ), arguments ); },
$.event.add = function(element, type, handler) { if ( $.browser == "msie" && typeof element.setInterval != "undefined" ) { element = window; } if (!handler.$$guid) { handler.$$guid = $.event.add.guid++; } if (!element.events) { element.events = {}; } var handlers = element.events[type]; if (!handlers) { handlers = element.events[type] = {}; if (element["on" + type]) { handlers[0] = element["on" + type]; } } handlers[handler.$$guid] = handler; element["on" + type] = $.event.handle; };
add: function(t) { this.cur = $.merge( this.cur, t.constructor == String ? $.Select(t) : t.constructor == Array ? t : [t] ); return this; },
$.event.add = function(element, type, handler) { // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process if ( $.browser == "msie" && typeof element.setInterval != "undefined" ) { element = window; } if (!handler.$$guid) { handler.$$guid = $.event.add.guid++; } if (!element.events) { element.events = {}; } var handlers = element.events[type]; if (!handlers) { handlers = element.events[type] = {}; if (element["on" + type]) { handlers[0] = element["on" + type]; } } handlers[handler.$$guid] = handler; element["on" + type] = $.event.handle;};
function add (name, func, usage, help)
function add (name, func)
function add (name, func, usage, help) { var usage = getMsg (name + "Usage"); var help = getMsg(name + "Help"); commandObject.add (name, func, usage, help); }
uri = Components.classes['component:
uri = Components.classes['@mozilla.org/network/standard-url;1'].createInstance();
function add_datasource_to_other_panels(link) { // Convert the |link| attribute into a URL var url = document.location; debug("Current URL: " +url); debug("Current link: " +link); uri = Components.classes['component://netscape/network/standard-url'].createInstance(); uri = uri.QueryInterface(Components.interfaces.nsIURI); uri.spec = url; uri = uri.resolve(link); debug("New URL: " +uri); // Add the datasource to the tree var all_panels = document.getElementById('other-panels'); all_panels.database.AddDataSource(RDF.GetDataSource(uri)); // XXX This is a hack to force re-display //all_panels.setAttribute('ref', allPanelsObj.resource);}
var tree_root = tree.getElementsByTagName("treechildren")[1];
var tree_root = tree.lastChild;
function add_node_to_current_list(registry, service){ debug("Adding "+service.Value); // Copy out the attributes we want var option_title = get_attr(registry, service, 'title'); var option_customize = get_attr(registry, service, 'customize'); var option_content = get_attr(registry, service, 'content'); var tree = document.getElementById('current-panels'); var tree_root = tree.getElementsByTagName("treechildren")[1]; // Check to see if the panel already exists... var i = 0; for (var treeitem = tree_root.firstChild; treeitem; treeitem = treeitem.nextSibling) { if (treeitem.id == service.Value) { // The panel is already in the current panel list. // Avoid adding it twice. tree.treeBoxObject.selection.select(i); tree.treeBoxObject.ensureRowIsVisible(i); return; } ++i; } // Create a treerow for the new panel var item = document.createElement('treeitem'); var row = document.createElement('treerow'); var cell = document.createElement('treecell'); // Copy over the attributes item.setAttribute('id', service.Value); cell.setAttribute('label', option_title); // Add it to the current panels tree item.appendChild(row); row.appendChild(cell); tree_root.appendChild(item); // Select is only if the caller wants to. var newIndex = tree_root.getElementsByTagName("treeitem").length - 1; tree.treeBoxObject.selection.select(newIndex); tree.treeBoxObject.ensureRowIsVisible(newIndex);}
if (treeitem.id == service.Value) {
if (treeitem.id == service.Value)
function add_node_to_current_list(registry, service){ debug("Adding "+service.Value); // Copy out the attributes we want var option_title = get_attr(registry, service, 'title'); var option_customize = get_attr(registry, service, 'customize'); var option_content = get_attr(registry, service, 'content'); var tree = document.getElementById('current-panels'); var tree_root = tree.getElementsByTagName("treechildren")[1]; // Check to see if the panel already exists... var i = 0; for (var treeitem = tree_root.firstChild; treeitem; treeitem = treeitem.nextSibling) { if (treeitem.id == service.Value) { // The panel is already in the current panel list. // Avoid adding it twice. tree.treeBoxObject.selection.select(i); tree.treeBoxObject.ensureRowIsVisible(i); return; } ++i; } // Create a treerow for the new panel var item = document.createElement('treeitem'); var row = document.createElement('treerow'); var cell = document.createElement('treecell'); // Copy over the attributes item.setAttribute('id', service.Value); cell.setAttribute('label', option_title); // Add it to the current panels tree item.appendChild(row); row.appendChild(cell); tree_root.appendChild(item); // Select is only if the caller wants to. var newIndex = tree_root.getElementsByTagName("treeitem").length - 1; tree.treeBoxObject.selection.select(newIndex); tree.treeBoxObject.ensureRowIsVisible(newIndex);}
tree.treeBoxObject.selection.select(i); tree.treeBoxObject.ensureRowIsVisible(i); return; }
return i;
function add_node_to_current_list(registry, service){ debug("Adding "+service.Value); // Copy out the attributes we want var option_title = get_attr(registry, service, 'title'); var option_customize = get_attr(registry, service, 'customize'); var option_content = get_attr(registry, service, 'content'); var tree = document.getElementById('current-panels'); var tree_root = tree.getElementsByTagName("treechildren")[1]; // Check to see if the panel already exists... var i = 0; for (var treeitem = tree_root.firstChild; treeitem; treeitem = treeitem.nextSibling) { if (treeitem.id == service.Value) { // The panel is already in the current panel list. // Avoid adding it twice. tree.treeBoxObject.selection.select(i); tree.treeBoxObject.ensureRowIsVisible(i); return; } ++i; } // Create a treerow for the new panel var item = document.createElement('treeitem'); var row = document.createElement('treerow'); var cell = document.createElement('treecell'); // Copy over the attributes item.setAttribute('id', service.Value); cell.setAttribute('label', option_title); // Add it to the current panels tree item.appendChild(row); row.appendChild(cell); tree_root.appendChild(item); // Select is only if the caller wants to. var newIndex = tree_root.getElementsByTagName("treeitem").length - 1; tree.treeBoxObject.selection.select(newIndex); tree.treeBoxObject.ensureRowIsVisible(newIndex);}
var newIndex = tree_root.getElementsByTagName("treeitem").length - 1; tree.treeBoxObject.selection.select(newIndex); tree.treeBoxObject.ensureRowIsVisible(newIndex);
return i;
function add_node_to_current_list(registry, service){ debug("Adding "+service.Value); // Copy out the attributes we want var option_title = get_attr(registry, service, 'title'); var option_customize = get_attr(registry, service, 'customize'); var option_content = get_attr(registry, service, 'content'); var tree = document.getElementById('current-panels'); var tree_root = tree.getElementsByTagName("treechildren")[1]; // Check to see if the panel already exists... var i = 0; for (var treeitem = tree_root.firstChild; treeitem; treeitem = treeitem.nextSibling) { if (treeitem.id == service.Value) { // The panel is already in the current panel list. // Avoid adding it twice. tree.treeBoxObject.selection.select(i); tree.treeBoxObject.ensureRowIsVisible(i); return; } ++i; } // Create a treerow for the new panel var item = document.createElement('treeitem'); var row = document.createElement('treerow'); var cell = document.createElement('treecell'); // Copy over the attributes item.setAttribute('id', service.Value); cell.setAttribute('label', option_title); // Add it to the current panels tree item.appendChild(row); row.appendChild(cell); tree_root.appendChild(item); // Select is only if the caller wants to. var newIndex = tree_root.getElementsByTagName("treeitem").length - 1; tree.treeBoxObject.selection.select(newIndex); tree.treeBoxObject.ensureRowIsVisible(newIndex);}
SimileAjax.Debug.exception(e);
SimileAjax.Debug.exception("Error adding action {" + action.label + "} to history", e);
SimileAjax.History.addAction = function(action) { SimileAjax.History.initialize(); try { action.perform(); if (SimileAjax.History.enabled) { SimileAjax.History._actions = SimileAjax.History._actions.slice( 0, SimileAjax.History._currentIndex - SimileAjax.History._baseIndex); SimileAjax.History._actions.push(action); SimileAjax.History._currentIndex++; var diff = SimileAjax.History._actions.length - SimileAjax.History.maxHistoryLength; if (diff > 0) { SimileAjax.History._actions = SimileAjax.History._actions.slice(diff); SimileAjax.History._baseIndex += diff; } SimileAjax.History._iframe.contentWindow.location.search = "?" + SimileAjax.History._currentIndex; } } catch (e) { SimileAjax.Debug.exception(e); }};
if ((alarmTime.compare(now) >= 0 && alarmTime.compare(this.mRangeEnd) <= 0) || skipCheck) {
if ((alarmTime.compare(now) >= 0) || skipCheck) {
addAlarm: function(aItem, skipCheck, alarmTime) { // if aItem.alarmTime >= 'now' && aItem.alarmTime <= gAlarmEndTime if (!alarmTime) alarmTime = aItem.alarmTime.getInTimezone("UTC"); var now; // XXX When the item is floating, should use the default timezone // from the prefs, instead of the javascript timezone (which is what // jsDateToFloatingDateTime uses) if (aItem.alarmTime.timezone == "floating") now = jsDateToFloatingDateTime((new Date())); else now = jsDateToDateTime((new Date())).getInTimezone("UTC"); var callbackObj = { alarmService: this, item: aItem, notify: function(timer) { this.alarmService.alarmFired(this.item); delete this.alarmService.mEvents[this.item]; } }; if ((alarmTime.compare(now) >= 0 && alarmTime.compare(this.mRangeEnd) <= 0) || skipCheck) { // delay is in msec, so don't forget to multiply var timeout = alarmTime.subtractDate(now).inSeconds * 1000; this.mEvents[aItem.id] = newTimerWithCallback(callbackObj, timeout, false); dump("adding alarm timeout (" + timeout + ") for " + aItem + " at " + aItem.alarmTime + "\n"); } },
var timeUntilRefresh = this.mRangeEnd.subtractDate(now).inSeconds * 1000; if (timeUntilRefresh < timeout) { return; }
addAlarm: function(aItem, skipCheck, alarmTime) { // if aItem.alarmTime >= 'now' && aItem.alarmTime <= gAlarmEndTime if (!alarmTime) alarmTime = aItem.alarmTime.getInTimezone("UTC"); var now; // XXX When the item is floating, should use the default timezone // from the prefs, instead of the javascript timezone (which is what // jsDateToFloatingDateTime uses) if (aItem.alarmTime.timezone == "floating") now = jsDateToFloatingDateTime((new Date())); else now = jsDateToDateTime((new Date())).getInTimezone("UTC"); var callbackObj = { alarmService: this, item: aItem, notify: function(timer) { this.alarmService.alarmFired(this.item); delete this.alarmService.mEvents[this.item]; } }; if ((alarmTime.compare(now) >= 0 && alarmTime.compare(this.mRangeEnd) <= 0) || skipCheck) { // delay is in msec, so don't forget to multiply var timeout = alarmTime.subtractDate(now).inSeconds * 1000; this.mEvents[aItem.id] = newTimerWithCallback(callbackObj, timeout, false); dump("adding alarm timeout (" + timeout + ") for " + aItem + " at " + aItem.alarmTime + "\n"); } },
gAlarmWindow.addAlarm(event);
calAlarmWindow.addAlarm(event);
var addAlarm = function() { gAlarmWindow.addAlarm(event); }
alarmWidget.setAttribute("location", event.getProperty("LOCATION"));
function addAlarm(event){ var alarmList = document.getElementById("alarmlist"); var alarmWidget = document.createElement("calendar-alarm-widget"); alarmWidget.setAttribute("title", event.title); alarmWidget.setAttribute("time", event.alarmTime.toString()); alarmWidget.addEventListener("snooze", onSnoozeAlarm, false); alarmWidget.addEventListener("dismiss", onDismissAlarm, false); alarmWidget.item = event; alarmList.appendChild(alarmWidget); var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var calendarPrefs = prefService.getBranch("calendar."); var playSound = calendarPrefs.getBoolPref("alarms.playsound"); if (playSound) { try { var soundURL = makeURL(calendarPrefs.getCharPref("alarms.soundURL")); var sound = Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound); sound.init(); sound.play(soundURL); } catch (ex) { dump("unable to play sound...\n" + ex + "\n"); } }}
cell.setAttribute("value", attachment);
cell.setAttribute("value", unescape(attachment)); cell.setAttribute("attachment", attachment);
function AddAttachment(attachment){ if (attachment && (attachment != "")) { var bucketBody = document.getElementById("bucketBody"); var item = document.createElement("treeitem"); var row = document.createElement("treerow"); var cell = document.createElement("treecell"); cell.setAttribute("value", attachment); row.appendChild(cell); item.appendChild(row); bucketBody.appendChild(item); } }
var messagePrefix = /^mailbox-message:|^imap-message:|^news-message:/i; if (messagePrefix.test(attachment.name)) attachment.name = sComposeMsgsBundle.getString("messageAttachmentSafeName"); else { var mailProtocol = /^mailbox:|^imap:|^s?news:/i; if (mailProtocol.test(attachment.name)) attachment.name = sComposeMsgsBundle.getString("partAttachmentSafeName"); }
function AddAttachment(attachment){ if (attachment && attachment.url) { var bucket = document.getElementById("attachmentBucket"); var item = document.createElement("listitem"); if (!attachment.name) attachment.name = gMsgCompose.AttachmentPrettyName(attachment.url); item.setAttribute("label", attachment.name); //use for display only item.attachment = attachment; //full attachment object stored here try { item.setAttribute("tooltiptext", unescape(attachment.url)); } catch(e) { item.setAttribute("tooltiptext", attachment.url); } item.setAttribute("class", "listitem-iconic"); item.setAttribute("image", "moz-icon:" + attachment.url); bucket.appendChild(item); }}
item.setAttribute('value', name); item.setAttribute('oncommand', oncommand);
function AddAttachmentToMenu(name, oncommand) { var popup = document.getElementById("attachmentPopup"); if ( popup && (popup.childNodes.length >= 2) ) { var item = document.createElement('menuitem'); if ( item ) { // popup.removeAttribute('menugenerated'); item.setAttribute('value', name); item.setAttribute('oncommand', oncommand); var child = popup.childNodes[popup.childNodes.length - 2]; var bigMenu = document.getElementById('attachmentMenu'); popup.insertBefore(item, child); } var button = document.getElementById("attachmentButton"); if (button) button.setAttribute("value", popup.childNodes.length - 2); } var attachBox = document.getElementById("attachmentBox"); if (attachBox) attachBox.removeAttribute("hide");}
item.setAttribute('value', name); item.setAttribute('oncommand', oncommand);
function AddAttachmentToMenu(name, oncommand) { var popup = document.getElementById("attachmentPopup"); if ( popup && (popup.childNodes.length >= 2) ) { var item = document.createElement('menuitem'); if ( item ) { // popup.removeAttribute('menugenerated'); item.setAttribute('value', name); item.setAttribute('oncommand', oncommand); var child = popup.childNodes[popup.childNodes.length - 2]; var bigMenu = document.getElementById('attachmentMenu'); popup.insertBefore(item, child); } var button = document.getElementById("attachmentButton"); if (button) button.setAttribute("value", popup.childNodes.length - 2); } var attachBox = document.getElementById("attachmentBox"); if (attachBox) attachBox.removeAttribute("hide");}
attachBox.removeAttribute("hide");
attachBox.removeAttribute("collapsed");
function AddAttachmentToMenu(name, oncommand) { var popup = document.getElementById("attachmentPopup"); if (popup) { var item = document.createElement('menuitem'); if ( item ) { popup.appendChild(item); item.setAttribute('value', name); item.setAttribute('oncommand', oncommand); } var button = document.getElementById("attachmentButton"); if (button) button.setAttribute("value", popup.childNodes.length); } var attachBox = document.getElementById("attachmentBox"); if (attachBox) attachBox.removeAttribute("hide");}
(!(/imap-message/.test(attachment.uri)) || CheckOnline());
(!(/imap-message/.test(attachment.uri)) || MailOfflineMgr.isOnline());
function addAttachmentToPopup(popup, attachment, attachmentIndex) { if (popup) { var item = document.createElement('menu'); if ( item ) { if (!gMessengerBundle) gMessengerBundle = document.getElementById("bundle_messenger"); // insert the item just before the separator...the separator is the 2nd to last element in the popup. item.setAttribute('class', 'menu-iconic'); setApplicationIconForAttachment(attachment,item, false); var numItemsInPopup = popup.childNodes.length; // find the separator var indexOfSeparator = 0; while (popup.childNodes[indexOfSeparator].localName != 'menuseparator') indexOfSeparator++; var formattedDisplayNameString = gMessengerBundle.getFormattedString("attachmentDisplayNameFormat", [attachmentIndex, attachment.displayName]); item.setAttribute('label', formattedDisplayNameString); item.setAttribute('accesskey', attachmentIndex); // each attachment in the list gets its own menupopup with options for saving, deleting, detaching, etc. var openpopup = document.createElement('menupopup'); openpopup = item.appendChild(openpopup); // Due to Bug #314228, we must append our menupopup to the new attachment menu item // before we inserting the attachment menu into the popup. If we don't, our attachment // menu items will not show up. item = popup.insertBefore(item, popup.childNodes[indexOfSeparator]); var menuitementry = document.createElement('menuitem'); menuitementry.attachment = cloneAttachment(attachment); menuitementry.setAttribute('oncommand', 'openAttachment(this.attachment)'); if (!gSaveLabel) gSaveLabel = gMessengerBundle.getString("saveLabel"); if (!gSaveLabelAccesskey) gSaveLabelAccesskey = gMessengerBundle.getString("saveLabelAccesskey"); if (!gOpenLabel) gOpenLabel = gMessengerBundle.getString("openLabel"); if (!gOpenLabelAccesskey) gOpenLabelAccesskey = gMessengerBundle.getString("openLabelAccesskey"); if (!gDetachLabel) gDetachLabel = gMessengerBundle.getString("detachLabel"); if (!gDetachLabelAccesskey) gDetachLabelAccesskey = gMessengerBundle.getString("detachLabelAccesskey"); if (!gDeleteLabel) gDeleteLabel = gMessengerBundle.getString("deleteLabel"); if (!gDeleteLabelAccesskey) gDeleteLabelAccesskey = gMessengerBundle.getString("deleteLabelAccesskey"); // we should also check if an attachment has been detached... // but that uses X-Mozilla-External-Attachment-URL, which // we'd need to check for somehow. var signedOrEncrypted = false; if ("content-type" in currentHeaderData) { var contentType = currentHeaderData["content-type"].headerValue; signedOrEncrypted = contentType.indexOf("application/x-pkcs7-mime") >= 0 || contentType.indexOf("application/x-pkcs7-signature") >= 0; } var canDetach = !(/news-message:/.test(attachment.uri)) && !signedOrEncrypted && (!(/imap-message/.test(attachment.uri)) || CheckOnline()); menuitementry.setAttribute('label', gOpenLabel); menuitementry.setAttribute('accesskey', gOpenLabelAccesskey); menuitementry = openpopup.appendChild(menuitementry); if (attachment.contentType == 'text/x-moz-deleted') menuitementry.setAttribute('disabled', true); var menuseparator = document.createElement('menuseparator'); openpopup.appendChild(menuseparator); menuitementry = document.createElement('menuitem'); menuitementry.attachment = cloneAttachment(attachment); menuitementry.setAttribute('oncommand', 'saveAttachment(this.attachment)'); menuitementry.setAttribute('label', gSaveLabel); menuitementry.setAttribute('accesskey', gSaveLabelAccesskey); if (attachment.contentType == 'text/x-moz-deleted') menuitementry.setAttribute('disabled', true); menuitementry = openpopup.appendChild(menuitementry); var menuseparator = document.createElement('menuseparator'); openpopup.appendChild(menuseparator); menuitementry = document.createElement('menuitem'); menuitementry.attachment = cloneAttachment(attachment); menuitementry.setAttribute('oncommand', 'detachAttachment(this.attachment, true)'); menuitementry.setAttribute('label', gDetachLabel); menuitementry.setAttribute('accesskey', gDetachLabelAccesskey); if (attachment.contentType == 'text/x-moz-deleted' || !canDetach) menuitementry.setAttribute('disabled', true); menuitementry = openpopup.appendChild(menuitementry); menuitementry = document.createElement('menuitem'); menuitementry.attachment = cloneAttachment(attachment); menuitementry.setAttribute('oncommand', 'detachAttachment(this.attachment, false)'); menuitementry.setAttribute('label', gDeleteLabel); menuitementry.setAttribute('accesskey', gDeleteLabelAccesskey); if (attachment.contentType == 'text/x-moz-deleted' || !canDetach) menuitementry.setAttribute('disabled', true); menuitementry = openpopup.appendChild(menuitementry); } // if we created a menu item for this attachment... } // if we have a popup}
var canDetach = CanDetachAttachments(); var openpopup = document.createElement('menupopup'); openpopup = item.appendChild(openpopup); var menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.openAttachment()'); if (!gDeleteLabel) gDeleteLabel = gMessengerBundle.getString("deleteLabel"); if (!gDeleteLabelAccesskey) gDeleteLabelAccesskey = gMessengerBundle.getString("deleteLabelAccesskey"); if (!gDetachLabel) gDetachLabel = gMessengerBundle.getString("detachLabel"); if (!gDetachLabelAccesskey) gDetachLabelAccesskey = gMessengerBundle.getString("detachLabelAccesskey"); if (!gSaveLabel) gSaveLabel = gMessengerBundle.getString("saveLabel"); if (!gSaveLabelAccesskey) gSaveLabelAccesskey = gMessengerBundle.getString("saveLabelAccesskey"); if (!gOpenLabel) gOpenLabel = gMessengerBundle.getString("openLabel"); if (!gOpenLabelAccesskey) gOpenLabelAccesskey = gMessengerBundle.getString("openLabelAccesskey"); menuitementry.setAttribute('label', gOpenLabel); menuitementry.setAttribute('accesskey', gOpenLabelAccesskey); menuitementry = openpopup.appendChild(menuitementry); menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.saveAttachment()'); menuitementry.setAttribute('label', gSaveLabel); menuitementry.setAttribute('accesskey', gSaveLabelAccesskey); menuitementry = openpopup.appendChild(menuitementry); var menuseparator = document.createElement('menuseparator'); openpopup.appendChild(menuseparator); menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.detachAttachment()'); menuitementry.setAttribute('label', gDetachLabel); menuitementry.setAttribute('accesskey', gDetachLabelAccesskey); if (!canDetach) menuitementry.setAttribute('disabled', 'true'); menuitementry = openpopup.appendChild(menuitementry); menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.deleteAttachment()'); menuitementry.setAttribute('label', gDeleteLabel); menuitementry.setAttribute('accesskey', gDeleteLabelAccesskey); if (!canDetach) menuitementry.setAttribute('disabled', 'true'); menuitementry = openpopup.appendChild(menuitementry); } }
} }
function addAttachmentToPopup(popup, attachment, attachmentIndex) { if (popup) { var item = document.createElement('menu'); if ( item ) { if (!gMessengerBundle) gMessengerBundle = document.getElementById("bundle_messenger"); // insert the item just before the separator item = popup.insertBefore(item, popup.childNodes[attachmentIndex - 1]); item.setAttribute('class', 'menu-iconic attachment-item'); var formattedDisplayNameString = gMessengerBundle.getFormattedString("attachmentDisplayNameFormat", [attachmentIndex, attachment.displayName]); item.setAttribute('label', formattedDisplayNameString); item.setAttribute('accesskey', attachmentIndex); if (attachment.contentType == "text/x-moz-deleted") { item.setAttribute('disabled', 'true'); return; } setApplicationIconForAttachment(attachment, item); var canDetach = CanDetachAttachments(); var openpopup = document.createElement('menupopup'); openpopup = item.appendChild(openpopup); var menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.openAttachment()'); if (!gDeleteLabel) gDeleteLabel = gMessengerBundle.getString("deleteLabel"); if (!gDeleteLabelAccesskey) gDeleteLabelAccesskey = gMessengerBundle.getString("deleteLabelAccesskey"); if (!gDetachLabel) gDetachLabel = gMessengerBundle.getString("detachLabel"); if (!gDetachLabelAccesskey) gDetachLabelAccesskey = gMessengerBundle.getString("detachLabelAccesskey"); if (!gSaveLabel) gSaveLabel = gMessengerBundle.getString("saveLabel"); if (!gSaveLabelAccesskey) gSaveLabelAccesskey = gMessengerBundle.getString("saveLabelAccesskey"); if (!gOpenLabel) gOpenLabel = gMessengerBundle.getString("openLabel"); if (!gOpenLabelAccesskey) gOpenLabelAccesskey = gMessengerBundle.getString("openLabelAccesskey"); menuitementry.setAttribute('label', gOpenLabel); menuitementry.setAttribute('accesskey', gOpenLabelAccesskey); menuitementry = openpopup.appendChild(menuitementry); menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.saveAttachment()'); menuitementry.setAttribute('label', gSaveLabel); menuitementry.setAttribute('accesskey', gSaveLabelAccesskey); menuitementry = openpopup.appendChild(menuitementry); var menuseparator = document.createElement('menuseparator'); openpopup.appendChild(menuseparator); menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.detachAttachment()'); menuitementry.setAttribute('label', gDetachLabel); menuitementry.setAttribute('accesskey', gDetachLabelAccesskey); if (!canDetach) menuitementry.setAttribute('disabled', 'true'); menuitementry = openpopup.appendChild(menuitementry); menuitementry = document.createElement('menuitem'); menuitementry.attachment = attachment; menuitementry.setAttribute('oncommand', 'this.attachment.deleteAttachment()'); menuitementry.setAttribute('label', gDeleteLabel); menuitementry.setAttribute('accesskey', gDeleteLabelAccesskey); if (!canDetach) menuitementry.setAttribute('disabled', 'true'); menuitementry = openpopup.appendChild(menuitementry); } // if we created a menu item for this attachment... } // if we have a popup}
treeItem = document.createElement("treeitem"); treeRow = document.createElement("treerow"); treeCell = document.createElement("treecell");
var treeItem = document.createElement("treeitem"); var treeRow = document.createElement("treerow"); var treeCell = document.createElement("treecell");
function addAttendee(email){ treeItem = document.createElement("treeitem"); treeRow = document.createElement("treerow"); treeCell = document.createElement("treecell"); treeCell.setAttribute("label", email); treeItem.appendChild(treeRow); treeRow.appendChild(treeCell); document.getElementById("bucketBody").appendChild(treeItem);}
BookmarksUtils.addBookmarkForBrowser(contentArea.webNavigation);
BookmarksUtils.addBookmarkForBrowser(contentArea.webNavigation, true);
addBookmark: function () { // This is somewhat of a hack, and we'd like to parameterize this so that // eventually we can bookmark mail messages and editor documents. var contentArea = top.document.getElementById('content'); if (contentArea) BookmarksUtils.addBookmarkForBrowser(contentArea.webNavigation); },
var bookmarkService = Components.classes["component:
var bookmarkService = Components.classes["@mozilla.org/browser/bookmarks-service;1"].getService();
addBookmark: function(aURL, aTitle) { dump("addBookmark(" + aURL + "," + aTitle + ")\n"); var bookmarkService = Components.classes["component://netscape/browser/bookmarks-service"].getService(); bookmarkService = bookmarkService.QueryInterface(Components.interfaces.nsIBookmarksService); if ( !bookmarkService ) return(false); if ( !aURL ) return(false); if ( aTitle ) { bookmarkService.AddBookmark(aURL, aTitle, bookmarkService.BOOKMARK_DEFAULT_TYPE, null ); } else { bookmarkService.AddBookmark(aURL, null, bookmarkService.BOOKMARK_DEFAULT_TYPE); } return(true); }
addBookmark: function (aURL, aTitle, aCharset)
addBookmark: function (aURL, aTitle, aCharset, aShowDialog)
addBookmark: function (aURL, aTitle, aCharset) { if (aCharset === undefined) { var fw = document.commandDispatcher.focusedWindow; aCharset = fw.document.characterSet; } const kPrefContractID = "@mozilla.org/preferences;1"; const kPrefIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefContractID].getService(kPrefIID); var showDialog = true; try { showDialog = !kPrefSvc.GetBoolPref("browser.bookmarks.add_without_dialog"); } catch (e) { } if (showDialog) openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", aTitle, aURL, null, aCharset); else { // User has elected to override the file dialog and always file bookmarks // into the default bookmark folder. const kBMSvcContractID = "@mozilla.org/browser/bookmarks-service;1"; const kBMSvcIID = Components.interfaces.nsIBookmarksService; const kBMSvc = Components.classes[kBMSvcContractID].getService(kBMSvcIID); kBMSvc.AddBookmark(aURL, aTitle, kBMSvcIID.BOOKMARK_DEFAULT_TYPE, aCharset); } }
const kPrefContractID = "@mozilla.org/preferences;1"; const kPrefIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefContractID].getService(kPrefIID); var showDialog = true; try { showDialog = !kPrefSvc.GetBoolPref("browser.bookmarks.add_without_dialog"); } catch (e) { } if (showDialog)
if (aShowDialog)
addBookmark: function (aURL, aTitle, aCharset) { if (aCharset === undefined) { var fw = document.commandDispatcher.focusedWindow; aCharset = fw.document.characterSet; } const kPrefContractID = "@mozilla.org/preferences;1"; const kPrefIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefContractID].getService(kPrefIID); var showDialog = true; try { showDialog = !kPrefSvc.GetBoolPref("browser.bookmarks.add_without_dialog"); } catch (e) { } if (showDialog) openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", aTitle, aURL, null, aCharset); else { // User has elected to override the file dialog and always file bookmarks // into the default bookmark folder. const kBMSvcContractID = "@mozilla.org/browser/bookmarks-service;1"; const kBMSvcIID = Components.interfaces.nsIBookmarksService; const kBMSvc = Components.classes[kBMSvcContractID].getService(kBMSvcIID); kBMSvc.AddBookmark(aURL, aTitle, kBMSvcIID.BOOKMARK_DEFAULT_TYPE, aCharset); } }
"centerscreen,chrome,dialog=no,resizable=no", aTitle, aURL, null, aCharset);
"centerscreen,chrome,dialog=no,resizable=yes", aTitle, aURL, null, aCharset);
addBookmark: function (aURL, aTitle, aCharset) { if (aCharset === undefined) { var fw = document.commandDispatcher.focusedWindow; aCharset = fw.document.characterSet; } const kPrefContractID = "@mozilla.org/preferences;1"; const kPrefIID = Components.interfaces.nsIPref; const kPrefSvc = Components.classes[kPrefContractID].getService(kPrefIID); var showDialog = true; try { showDialog = !kPrefSvc.GetBoolPref("browser.bookmarks.add_without_dialog"); } catch (e) { } if (showDialog) openDialog("chrome://communicator/content/bookmarks/addBookmark.xul", "", "centerscreen,chrome,dialog=no,resizable=no", aTitle, aURL, null, aCharset); else { // User has elected to override the file dialog and always file bookmarks // into the default bookmark folder. const kBMSvcContractID = "@mozilla.org/browser/bookmarks-service;1"; const kBMSvcIID = Components.interfaces.nsIBookmarksService; const kBMSvc = Components.classes[kBMSvcContractID].getService(kBMSvcIID); kBMSvc.AddBookmark(aURL, aTitle, kBMSvcIID.BOOKMARK_DEFAULT_TYPE, aCharset); } }
addBookmarkForBrowser: function (aDocShell)
addBookmarkForBrowser: function (aDocShell, aShowDialog)
addBookmarkForBrowser: function (aDocShell) { // Bug 52536: We obtain the URL and title from the nsIWebNavigation // associated with a <browser/> rather than from a DOMWindow. // This is because when a full page plugin is loaded, there is // no DOMWindow (?) but information about the loaded document // may still be obtained from the webNavigation. var url = aDocShell.currentURI.spec; var title, docCharset = null; try { title = aDocShell.document.title || url; docCharset = aDocShell.document.characterSet; } catch (e) { title = url; } this.addBookmark(url, title, docCharset); },
this.addBookmark(url, title, docCharset);
this.addBookmark(url, title, docCharset, aShowDialog);
addBookmarkForBrowser: function (aDocShell) { // Bug 52536: We obtain the URL and title from the nsIWebNavigation // associated with a <browser/> rather than from a DOMWindow. // This is because when a full page plugin is loaded, there is // no DOMWindow (?) but information about the loaded document // may still be obtained from the webNavigation. var url = aDocShell.currentURI.spec; var title, docCharset = null; try { title = aDocShell.document.title || url; docCharset = aDocShell.document.characterSet; } catch (e) { title = url; } this.addBookmark(url, title, docCharset); },
#ifndef MOZ_PLACES
#ifndef MOZ_PLACES_BOOKMARKS
addBookmarkForFrame: function() { var doc = this.target.ownerDocument; var uri = doc.location.href;#ifndef MOZ_PLACES var title = doc.title; var description = BookmarksUtils.getDescriptionFromDocument(doc); if (!title) title = uri; BookmarksUtils.addBookmark(uri, title, doc.charset, description);#else var ioService = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); var linkURI = ioService.newURI(uri, null, null); PlacesController.showAddBookmarkUI(linkURI);#endif },
fp.appendFilter("Certificate Files", "*.crt; *.cert; *.cer; *.pem; *.der");
fp.appendFilter(bundle.GetStringFromName("file_browse_Certificate_spec"), "*.crt; *.cert; *.cer; *.pem; *.der");
function addCACerts(){ var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties"); var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker); fp.init(window, bundle.GetStringFromName("importCACertsPrompt"), nsIFilePicker.modeOpen); fp.appendFilter("Certificate Files", "*.crt; *.cert; *.cer; *.pem; *.der"); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { certdb.importCertsFromFile(null, fp.file, nsIX509Cert.CA_CERT); caTreeView.loadCerts(nsIX509Cert.CA_CERT); caTreeView.selection.clearSelection(); }}
this.observeCalendarAdded(aCalendar);
if (this.mPrefPrefix) { this.mCalMgr.setCalendarPref(aCalendar, this.mActivePref, "true"); } this.notifyObservers("onCalendarAdded", [aCalendar]);
addCalendar: function (aCalendar) { // check if the calendar already exists for each (cal in this.mCalendars) { if (aCalendar.uri.equals(cal.uri)) { // throw exception if calendar already exists? return; } } // add our observer helper aCalendar.addObserver(this.mObserverHelper); this.mCalendars.push(aCalendar); this.observeCalendarAdded(aCalendar); // if we have no default calendar, we need one here if (this.mDefaultCalendar == null) { this.mDefaultCalendar = aCalendar; this.observeDefaultCalendarChanged(aCalendar); } },
if (this.mDefaultCalendar == null) { this.mDefaultCalendar = aCalendar; this.observeDefaultCalendarChanged(aCalendar); }
if (this.mDefaultCalendar == null) this.setDefaultCalendar(aCalendar, false);
addCalendar: function (aCalendar) { // check if the calendar already exists for each (cal in this.mCalendars) { if (aCalendar.uri.equals(cal.uri)) { // throw exception if calendar already exists? return; } } // add our observer helper aCalendar.addObserver(this.mObserverHelper); this.mCalendars.push(aCalendar); this.observeCalendarAdded(aCalendar); // if we have no default calendar, we need one here if (this.mDefaultCalendar == null) { this.mDefaultCalendar = aCalendar; this.observeDefaultCalendarChanged(aCalendar); } },
alert("1"+gCachedStyleSheet);
function addCalendarToTree(aCalendar){ var boxobj = document.getElementById("calendarTree").treeBoxObject; // Special trick to compare interface pointers, since normal, == // comparison can fail due to javascript wrapping. var sip = Components.classes["@mozilla.org/supports-interface-pointer;1"] .createInstance(Components.interfaces.nsISupportsInterfacePointer); sip.data = aCalendar; sip.dataIID = Components.interfaces.calICalendar; boxobj.rowCountChanged(getCalendars().indexOf(sip.data), 1); if (!gCachedStyleSheet) { gCachedStyleSheet = getStyleSheet("chrome://calendar/content/calendar-view-bindings.css"); }alert("1"+gCachedStyleSheet); updateStyleSheetForObject(aCalendar, gCachedStyleSheet);}
updateStyleSheetForCalendar(aCalendar);
if (!gCachedStyleSheet) { gCachedStyleSheet = getStyleSheet("chrome: } alert("1"+gCachedStyleSheet); updateStyleSheetForObject(aCalendar, gCachedStyleSheet);
function addCalendarToTree(aCalendar){ var boxobj = document.getElementById("calendarTree").treeBoxObject; // Special trick to compare interface pointers, since normal, == // comparison can fail due to javascript wrapping. var sip = Components.classes["@mozilla.org/supports-interface-pointer;1"] .createInstance(Components.interfaces.nsISupportsInterfacePointer); sip.data = aCalendar; sip.dataIID = Components.interfaces.calICalendar; boxobj.rowCountChanged(getCalendars().indexOf(sip.data), 1); updateStyleSheetForCalendar(aCalendar);}
boxobj.rowCountChanged(getCalendars().indexOf(aCalendar), 1);
boxobj.invalidate();
function addCalendarToTree(aCalendar){ var boxobj = document.getElementById("calendarTree").treeBoxObject; boxobj.rowCountChanged(getCalendars().indexOf(aCalendar), 1); updateStyleSheetForCalendar(aCalendar);}
jQuery.class.add(this,c);
jQuery.className.add(this,c);
addClass: function(c) { return this.each(function(){ jQuery.class.add(this,c); }); },
return this.each(function(){ if ($.hasWord(this,c)) return; this.className += ( this.className.length > 0 ? " " : "" ) + c; }); },
return this.each(function(){ $.class.add(this,c); }); },
addClass: function(c) { return this.each(function(){ if ($.hasWord(this,c)) return; this.className += ( this.className.length > 0 ? " " : "" ) + c; }); },
add ("charset", "onInputCharset");
function addCommands(commandObject){ function add (name, func) { var usage = getMsg (name + "Usage"); var help = getMsg(name + "Help"); commandObject.add (name, func, usage, help); } add ("about", "onInputAbout"); add ("attach", "onInputAttach"); add ("away", "onInputAway"); add ("cancel", "onInputCancel"); add ("clear", "onInputClear"); add ("client", "onInputClient"); add ("commands", "onInputCommands"); add ("ctcp", "onInputCTCP"); add ("css", "onInputCSS"); add ("delete", "onInputDelete"); add ("deop", "onInputDeop"); add ("desc", "onInputDesc"); add ("devoice", "onInputDevoice"); add ("disconnect", "onInputQuit"); add ("echo", "onInputEcho"); add ("eval", "onInputEval"); add ("exit", "onInputExit"); add ("help", "onInputHelp"); add ("headers", "onInputHeaders"); add ("hide", "onInputHide"); add ("infobar", "onInputInfobar"); add ("invite", "onInputInvite"); add ("join", "onInputJoin"); add ("kick", "onInputKick"); add ("leave", "onInputLeave"); add ("list", "onInputSimpleCommand"); add ("me", "onInputMe"); add ("msg", "onInputMsg"); add ("name", "onInputName"); add ("names", "onInputNames"); add ("network", "onInputNetwork"); add ("networks", "onInputNetworks"); add ("nick", "onInputNick"); add ("notify", "onInputNotify"); add ("op", "onInputOp"); add ("part", "onInputLeave"); add ("ping", "onInputPing"); add ("query", "onInputQuery"); add ("quit", "onInputExit"); add ("quote", "onInputQuote"); add ("server", "onInputServer"); add ("stalk", "onInputStalk"); add ("status", "onInputStatus"); add ("statusbar", "onInputStatusbar"); add ("testdisplay", "onInputTestDisplay"); add ("topic", "onInputTopic"); add ("tabstrip", "onInputTabstrip"); add ("unstalk", "onInputUnstalk"); add ("version", "onInputVersion"); add ("voice", "onInputVoice"); add ("who", "onInputSimpleCommand"); add ("whois", "onInputWhoIs"); add ("whowas", "onInputSimpleCommand"); }
function add (name, func, usage, help)
function add (name, func)
function addCommands(commandObject){ function add (name, func, usage, help) { var usage = getMsg (name + "Usage"); var help = getMsg(name + "Help"); commandObject.add (name, func, usage, help); } add ("attach", "onInputAttach"); add ("away", "onInputAway"); add ("cancel", "onInputCancel"); add ("clear", "onInputClear"); add ("client", "onInputClient"); add ("commands", "onInputCommands"); add ("ctcp", "onInputCTCP"); add ("css", "onInputCSS"); add ("delete", "onInputDelete"); add ("deop", "onInputDeop"); add ("desc", "onInputDesc"); add ("devoice", "onInputDevoice"); add ("disconnect", "onInputQuit"); add ("echo", "onInputEcho"); add ("eval", "onInputEval"); add ("exit", "onInputExit"); add ("help", "onInputHelp"); add ("hide", "onInputHide"); add ("infobar", "onInputInfobar"); add ("invite", "onInputInvite"); add ("join", "onInputJoin"); add ("kick", "onInputKick"); add ("leave", "onInputLeave"); add ("list", "onInputSimpleCommand"); add ("me", "onInputMe"); add ("msg", "onInputMsg"); add ("name", "onInputName"); add ("names", "onInputNames"); add ("network", "onInputNetwork"); add ("networks", "onInputNetworks"); add ("nick", "onInputNick"); add ("notify", "onInputNotify"); add ("op", "onInputOp"); add ("part", "onInputLeave"); add ("ping", "onInputPing"); add ("query", "onInputQuery"); add ("quit", "onInputExit"); add ("quote", "onInputQuote"); add ("server", "onInputServer"); add ("stalk", "onInputStalk"); add ("status", "onInputStatus"); add ("statusbar", "onInputStatusbar"); add ("testdisplay", "onInputTestDisplay"); add ("topic", "onInputTopic"); add ("tabstrip", "onInputTabstrip"); add ("unstalk", "onInputUnstalk"); add ("version", "onInputVersion"); add ("voice", "onInputVoice"); add ("who", "onInputSimpleCommand"); add ("whois", "onInputWhoIs"); }
add ("whowas", "onInputSimpleCommand");
function addCommands(commandObject){ function add (name, func, usage, help) { var usage = getMsg (name + "Usage"); var help = getMsg(name + "Help"); commandObject.add (name, func, usage, help); } add ("attach", "onInputAttach"); add ("away", "onInputAway"); add ("cancel", "onInputCancel"); add ("clear", "onInputClear"); add ("client", "onInputClient"); add ("commands", "onInputCommands"); add ("ctcp", "onInputCTCP"); add ("css", "onInputCSS"); add ("delete", "onInputDelete"); add ("deop", "onInputDeop"); add ("desc", "onInputDesc"); add ("devoice", "onInputDevoice"); add ("disconnect", "onInputQuit"); add ("echo", "onInputEcho"); add ("eval", "onInputEval"); add ("exit", "onInputExit"); add ("help", "onInputHelp"); add ("hide", "onInputHide"); add ("infobar", "onInputInfobar"); add ("invite", "onInputInvite"); add ("join", "onInputJoin"); add ("kick", "onInputKick"); add ("leave", "onInputLeave"); add ("list", "onInputSimpleCommand"); add ("me", "onInputMe"); add ("msg", "onInputMsg"); add ("name", "onInputName"); add ("names", "onInputNames"); add ("network", "onInputNetwork"); add ("networks", "onInputNetworks"); add ("nick", "onInputNick"); add ("notify", "onInputNotify"); add ("op", "onInputOp"); add ("part", "onInputLeave"); add ("ping", "onInputPing"); add ("query", "onInputQuery"); add ("quit", "onInputExit"); add ("quote", "onInputQuote"); add ("server", "onInputServer"); add ("stalk", "onInputStalk"); add ("status", "onInputStatus"); add ("statusbar", "onInputStatusbar"); add ("testdisplay", "onInputTestDisplay"); add ("topic", "onInputTopic"); add ("tabstrip", "onInputTabstrip"); add ("unstalk", "onInputUnstalk"); add ("version", "onInputVersion"); add ("voice", "onInputVoice"); add ("who", "onInputSimpleCommand"); add ("whois", "onInputWhoIs"); }
function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); }
function addData(type) { data.addDataForFlavour(type, self._wrapString(self.wrapNode(node, type))); }
function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); }
function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); }
function addData(type) { data.addDataForFlavour(type, PlacesUtils._wrapString(PlacesUtils.wrapNode(node, type))); }
function addData(type, data) { xferable.addDataFlavor(type); xferable.setTransferData(type, self._wrapString(data), data.length * 2); }
SetupMoveCopyMenus("messagePaneContext-copyMenu", accountManagerDataSource, folderDataSource); SetupMoveCopyMenus("messagePaneContext-moveMenu", accountManagerDataSource, folderDataSource);
function AddDataSources(){ accountManagerDataSource = accountManagerDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource); folderDataSource = folderDataSource.QueryInterface(Components.interfaces.nsIRDFDataSource); //to move menu item SetupMoveCopyMenus('moveMenu', accountManagerDataSource, folderDataSource); //to copy menu item SetupMoveCopyMenus('copyMenu', accountManagerDataSource, folderDataSource); //To FileButton menu SetupMoveCopyMenus('FileButtonMenu', accountManagerDataSource, folderDataSource); //Add statusFeedback var msgDS = folderDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource); msgDS.window = msgWindow; msgDS = messageDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource); msgDS.window = msgWindow; msgDS = accountManagerDataSource.QueryInterface(Components.interfaces.nsIMsgRDFDataSource); msgDS.window = msgWindow;}
if (commonDialogsService)
if (promptService)
function AddDomain(obj){ var DomainName; if (commonDialogsService) { var result = {value:0}; if (commonDialogsService.Prompt( window, obj.DlgTitle, obj.DlgMsg, null, result )) DomainName = result.value.replace(/ /g,""); } if (DomainName) { var objPrime; if (obj.id == "html") objPrime = plainobj; else objPrime = htmlobj; if (!DomainAlreadyPresent(obj, DomainName, true)) if(!DomainAlreadyPresent(objPrime, DomainName, false)) { AddTreeItem(obj.treeroot_node, DomainName); } } UpdateSavePrefString(obj);}
if (commonDialogsService.Prompt(
if (promptService.Prompt(
function AddDomain(obj){ var DomainName; if (commonDialogsService) { var result = {value:0}; if (commonDialogsService.Prompt( window, obj.DlgTitle, obj.DlgMsg, null, result )) DomainName = result.value.replace(/ /g,""); } if (DomainName) { var objPrime; if (obj.id == "html") objPrime = plainobj; else objPrime = htmlobj; if (!DomainAlreadyPresent(obj, DomainName, true)) if(!DomainAlreadyPresent(objPrime, DomainName, false)) { AddTreeItem(obj.treeroot_node, DomainName); } } UpdateSavePrefString(obj);}
"", 0,
function AddDomain(obj){ var DomainName; if (commonDialogsService) { var result = {value:0}; if (commonDialogsService.Prompt( window, obj.DlgTitle, obj.DlgMsg, null, result )) DomainName = result.value.replace(/ /g,""); } if (DomainName) { var objPrime; if (obj.id == "html") objPrime = plainobj; else objPrime = htmlobj; if (!DomainAlreadyPresent(obj, DomainName, true)) if(!DomainAlreadyPresent(objPrime, DomainName, false)) { AddTreeItem(obj.treeroot_node, DomainName); } } UpdateSavePrefString(obj);}
fp.appendFilter("Certificate Files", "*.crt; *.cert; *.cer; *.pem; *.der");
fp.appendFilter(bundle.GetStringFromName("file_browse_Certificate_spec"), "*.crt; *.cert; *.cer; *.pem; *.der");
function addEmailCert(){ var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties"); var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker); fp.init(window, bundle.GetStringFromName("importEmailCertPrompt"), nsIFilePicker.modeOpen); fp.appendFilter("Certificate Files", "*.crt; *.cert; *.cer; *.pem; *.der"); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { certdb.importCertsFromFile(null, fp.file, nsIX509Cert.EMAIL_CERT); var certcache = Components.classes[nsNSSCertCache].createInstance(nsINSSCertCache); certcache.cacheAllCerts(); emailTreeView.loadCertsFromCache(certcache, nsIX509Cert.EMAIL_CERT); emailTreeView.selection.clearSelection(); caTreeView.loadCertsFromCache(certcache, nsIX509Cert.CA_CERT); caTreeView.selection.clearSelection(); }}
var text = prompt(bundle.GetStringFromName("EnterNewEntry"), "" );
var text = myPrompt (bundle.GetStringFromName("EnterNewEntry"), "", bundle.GetStringFromName("AddingTitle"));
function AddEntry0() { var i; var text = prompt(bundle.GetStringFromName("EnterNewEntry"), "" ); if (text == "") { return; } var crypt = Encrypt(text); if (crypt == "") { /* user failed to unlock the database */ return; } stringIndex = entries[schemas[FirstSelectedSchema()]+FirstSelectedEntry()]; if(strings[entries[schemas[FirstSelectedSchema()]+FirstSelectedEntry()]+1]=="") { addString(entries[schemas[FirstSelectedSchema()]+FirstSelectedEntry()]+1, crypt); return; } addString(stringIndex, strings[entries[schemas[FirstSelectedSchema()]]]); addString(stringIndex+1, crypt); addString(stringIndex+2, ""); entriesLength++; for (i=entriesLength; i>schemas[FirstSelectedSchema()]+FirstSelectedEntry(); i--) { entries[i] = entries[i-1]; } entries[schemas[FirstSelectedSchema()]+FirstSelectedEntry()] = stringIndex; for (i=FirstSelectedSchema()+1; i<=schemasLength; i++) { schemas[i]++; }}
calendarEvent = calendarEventArray[i]
if( isEvent( calendarEventArray[i] ) ) { var calendarEvent = calendarEventArray[i];
function addEventsToCalendar( calendarEventArray, silent ){ for(var i = 0; i < calendarEventArray.length; i++) { calendarEvent = calendarEventArray[i] // Check if event with same ID already in Calendar. If so, import event with new ID. if( gICalLib.fetchEvent( calendarEvent.id ) != null ) { calendarEvent.id = createUniqueID( ); } // the start time is in zulu time, need to convert to current time if(calendarEvent.allDay != true) convertZuluToLocal( calendarEvent ); // open the event dialog with the event to add if( silent ) gICalLib.addEvent( calendarEvent ); else editNewEvent( calendarEvent ); }}
if( gICalLib.fetchEvent( calendarEvent.id ) != null ) { calendarEvent.id = createUniqueID( );
if( gICalLib.fetchEvent( calendarEvent.id ) != null ) { calendarEvent.id = createUniqueID( ); } if(calendarEvent.allDay != true) convertZuluToLocal( calendarEvent ); if( silent ) gICalLib.addEvent( calendarEvent, defaultServer.path ); else editNewEvent( calendarEvent ); } else if( isToDo( calendarEventArray[i] ) ) { calendarTodo = calendarEventArray[i]; if( gICalLib.fetchTodo( calendarTodo.id ) != null ) { calendarTodo.id = createUniqueID( ); } if( silent ){alert(defaultServer.path); gICalLib.addTodo( calendarTodo, defaultServer.path );} else gICalLib.addTodo( calendarTodo, defaultServer.path );
function addEventsToCalendar( calendarEventArray, silent ){ for(var i = 0; i < calendarEventArray.length; i++) { calendarEvent = calendarEventArray[i] // Check if event with same ID already in Calendar. If so, import event with new ID. if( gICalLib.fetchEvent( calendarEvent.id ) != null ) { calendarEvent.id = createUniqueID( ); } // the start time is in zulu time, need to convert to current time if(calendarEvent.allDay != true) convertZuluToLocal( calendarEvent ); // open the event dialog with the event to add if( silent ) gICalLib.addEvent( calendarEvent ); else editNewEvent( calendarEvent ); }}
if(calendarEvent.allDay != true) convertZuluToLocal( calendarEvent ); if( silent ) gICalLib.addEvent( calendarEvent ); else editNewEvent( calendarEvent );
function addEventsToCalendar( calendarEventArray, silent ){ for(var i = 0; i < calendarEventArray.length; i++) { calendarEvent = calendarEventArray[i] // Check if event with same ID already in Calendar. If so, import event with new ID. if( gICalLib.fetchEvent( calendarEvent.id ) != null ) { calendarEvent.id = createUniqueID( ); } // the start time is in zulu time, need to convert to current time if(calendarEvent.allDay != true) convertZuluToLocal( calendarEvent ); // open the event dialog with the event to add if( silent ) gICalLib.addEvent( calendarEvent ); else editNewEvent( calendarEvent ); }}
var dateToAdd = getDateTimeFieldValue( "exception-dates-text" );
var dateToAdd = document.getElementById( "exceptions-date-picker" ).value;
function addException( dateToAdd ){ if( !dateToAdd ) { //get the date from the date and time box. //returns a date object var dateToAdd = getDateTimeFieldValue( "exception-dates-text" ); } if( isAlreadyException( dateToAdd ) ) return; var DateLabel = formatDate( dateToAdd ); //add a row to the listbox document.getElementById( "exception-dates-listbox" ).appendItem( DateLabel, dateToAdd.getTime() ); sizeToContent();}
var dateToAdd = document.getElementById( "exceptions-date-picker" ).value;
dateToAdd = document.getElementById( "exceptions-date-picker" ).value;
function addException( dateToAdd ){ if( !dateToAdd ) { //get the date from the date and time box. //returns a date object var dateToAdd = document.getElementById( "exceptions-date-picker" ).value; } if( isAlreadyException( dateToAdd ) ) return; var DateLabel = formatDate( dateToAdd ); //add a row to the listbox document.getElementById( "exception-dates-listbox" ).appendItem( DateLabel, dateToAdd.getTime() ); sizeToContent();}
var itemResource = rdf.GetResource(feedProperties.feedLocation); feed = new Feed(itemResource); if (feedProperties.folderURI) { var folderResource = rdf.GetResource(feedProperties.folderURI); if (folderResource) { var folder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder); if (folder && !folder.isServer) feed.folder = folder; } } feed.server = this.mRSSServer; feed.quickMode = feedProperties.quickMode;
addFeed: function(aFeedLocation, aRootFolderURI) { var userAddedFeed = false; var defaultQuickMode = this.mRSSServer.getBoolAttribute('quickMode'); var feedProperties = { feedName: "", feedLocation: aFeedLocation, serverURI: this.mRSSServer.serverURI, serverPrettyName: this.mRSSServer.prettyName, folderURI: aRootFolderURI, quickMode: this.mRSSServer.getBoolAttribute('quickMode'), newFeed: true, result: userAddedFeed}; feedProperties = openFeedEditor(feedProperties); // if the user hit cancel, exit without doing anything if (!feedProperties.result) return; if (!feedProperties.feedLocation) return; // before we go any further, make sure the user is not already subscribed to this feed. if (feedAlreadyExists(feedProperties.feedLocation, this.mRSSServer)) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(IPS); promptService.alert(window, null, this.mBundle.getString("subscribe-feedAlreadySubscribed")); return; } var itemResource = rdf.GetResource(feedProperties.feedLocation); feed = new Feed(itemResource); // if the user specified a specific folder to add the feed too, then set it here if (feedProperties.folderURI) { var folderResource = rdf.GetResource(feedProperties.folderURI); if (folderResource) { var folder = folderResource.QueryInterface(Components.interfaces.nsIMsgFolder); if (folder && !folder.isServer) feed.folder = folder; } } // set the server for the feed feed.server = this.mRSSServer; feed.quickMode = feedProperties.quickMode; // update status text updateStatusItem('statusText', document.getElementById("bundle_newsblog").getString('subscribe-validating')); updateStatusItem('progressMeter', 0); // validate the feed and download the articles // we used to pass false which caused us to skip parsing then we'd // turn around and download the feed again so we could actually parse the items... // But now that this operation is asynch, just kick it off once...if we change this back // modify feedDownloadCallback.downloaded to parse the feed... // Also, disable the Add button while we are subscribing. document.getElementById('addFeed').setAttribute('disabled', 'true'); feed.download(true, this.mFeedDownloadCallback); },
function addFeed(url, title, quickMode, destFolder) {
function addFeed(url, title, destFolder) {
function addFeed(url, title, quickMode, destFolder) { var ds = getSubscriptionsDS(destFolder.server); var feeds = getSubscriptionsList(destFolder.server); // Give quickMode a default value of "true"; otherwise convert value // to either "true" or "false" string. quickMode = quickMode == null ? "false" : quickMode ? "true" : "false"; // Generate a unique ID for the feed. var id = url; var i = 1; while (feeds.IndexOf(rdf.GetResource(id)) != -1 && ++i < 1000) id = url + i; if (id == 1000) throw("couldn't generate a unique ID for feed " + url); // Add the feed to the list. id = rdf.GetResource(id); feeds.AppendElement(id); ds.Assert(id, RDF_TYPE, FZ_FEED, true); ds.Assert(id, DC_IDENTIFIER, rdf.GetLiteral(url), true); if (title) ds.Assert(id, DC_TITLE, rdf.GetLiteral(title), true); ds.Assert(id, FZ_QUICKMODE, rdf.GetLiteral(quickMode), true); ds.Assert(id, FZ_DESTFOLDER, destFolder, true); ds = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); ds.Flush();}
quickMode = quickMode == null ? "false" : quickMode ? "true" : "false";
function addFeed(url, title, quickMode, destFolder) { var ds = getSubscriptionsDS(destFolder.server); var feeds = getSubscriptionsList(destFolder.server); // Give quickMode a default value of "true"; otherwise convert value // to either "true" or "false" string. quickMode = quickMode == null ? "false" : quickMode ? "true" : "false"; // Generate a unique ID for the feed. var id = url; var i = 1; while (feeds.IndexOf(rdf.GetResource(id)) != -1 && ++i < 1000) id = url + i; if (id == 1000) throw("couldn't generate a unique ID for feed " + url); // Add the feed to the list. id = rdf.GetResource(id); feeds.AppendElement(id); ds.Assert(id, RDF_TYPE, FZ_FEED, true); ds.Assert(id, DC_IDENTIFIER, rdf.GetLiteral(url), true); if (title) ds.Assert(id, DC_TITLE, rdf.GetLiteral(title), true); ds.Assert(id, FZ_QUICKMODE, rdf.GetLiteral(quickMode), true); ds.Assert(id, FZ_DESTFOLDER, destFolder, true); ds = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); ds.Flush();}
ds.Assert(id, FZ_QUICKMODE, rdf.GetLiteral(quickMode), true);
function addFeed(url, title, quickMode, destFolder) { var ds = getSubscriptionsDS(destFolder.server); var feeds = getSubscriptionsList(destFolder.server); // Give quickMode a default value of "true"; otherwise convert value // to either "true" or "false" string. quickMode = quickMode == null ? "false" : quickMode ? "true" : "false"; // Generate a unique ID for the feed. var id = url; var i = 1; while (feeds.IndexOf(rdf.GetResource(id)) != -1 && ++i < 1000) id = url + i; if (id == 1000) throw("couldn't generate a unique ID for feed " + url); // Add the feed to the list. id = rdf.GetResource(id); feeds.AppendElement(id); ds.Assert(id, RDF_TYPE, FZ_FEED, true); ds.Assert(id, DC_IDENTIFIER, rdf.GetLiteral(url), true); if (title) ds.Assert(id, DC_TITLE, rdf.GetLiteral(title), true); ds.Assert(id, FZ_QUICKMODE, rdf.GetLiteral(quickMode), true); ds.Assert(id, FZ_DESTFOLDER, destFolder, true); ds = ds.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); ds.Flush();}
function addHint(elems) { var elem; var i = 0;
addHint : function(elems) { var elem; var i = 0;
function addHint(elems){ var elem; var i = 0; processElements: while(elem = elems.item(i++)) { var accessKey = elem.getAttributeNode("accesskey"); if (!accessKey || !accessKey.value) continue processElements; var title = elem.getAttributeNode("title"); if (title && title.value) { var overrides = new Array('accesskey','alt+','ctrl+'); for (var j=0; j < overrides.length; j++) { if (title.value.toLowerCase().indexOf(overrides[j]) != -1) continue processElements; } elem.setAttribute("title", title.value + ' (' + getHintText(accessKey.value) + ')'); } else { elem.setAttribute("title", getHintText(accessKey.value)); } }}
var title = elem.getAttributeNode("title"); if (title && title.value) { var overrides = new Array('accesskey','alt+','ctrl+'); for (var j=0; j < overrides.length; j++) { if (title.value.toLowerCase().indexOf(overrides[j]) != -1) continue processElements; } elem.setAttribute("title", title.value + ' (' + getHintText(accessKey.value) + ')'); } else { elem.setAttribute("title", getHintText(accessKey.value)); } } }
var title = elem.getAttributeNode("title"); if (title && title.value) { var overrides = new Array('accesskey','alt+','ctrl+'); for (var j=0; j < overrides.length; j++) { if (title.value.toLowerCase().indexOf(overrides[j]) != -1) continue processElements; } elem.setAttribute("title", title.value + ' (' + this.getHintText(accessKey.value) + ')'); } else { elem.setAttribute("title", this.getHintText(accessKey.value)); } } },
function addHint(elems){ var elem; var i = 0; processElements: while(elem = elems.item(i++)) { var accessKey = elem.getAttributeNode("accesskey"); if (!accessKey || !accessKey.value) continue processElements; var title = elem.getAttributeNode("title"); if (title && title.value) { var overrides = new Array('accesskey','alt+','ctrl+'); for (var j=0; j < overrides.length; j++) { if (title.value.toLowerCase().indexOf(overrides[j]) != -1) continue processElements; } elem.setAttribute("title", title.value + ' (' + getHintText(accessKey.value) + ')'); } else { elem.setAttribute("title", getHintText(accessKey.value)); } }}
function addHistory (source, obj)
function addHistory (source, obj, mergeData, collapseRow)
function addHistory (source, obj){ var tbody; if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "msg-table"); source.messages.setAttribute ("view-type", source.TYPE); if (0) /*XXX*/ { tbody = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:tbody"); source.messages.appendChild (tbody); } else { tbody = source.messages; } } else if (0) /*XXX*/ { tbody = source.messages.firstChild; } else { tbody = source.messages; } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; tbody.appendChild (obj); } else tbody.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) tbody.removeChild (tbody.firstChild); else tbody.removeChild (tbody.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
if (!source.messages)
if (!("messages" in source) || source.messages == null)
function addHistory (source, obj){ var tbody; if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "msg-table"); source.messages.setAttribute ("view-type", source.TYPE); if (0) /*XXX*/ { tbody = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:tbody"); source.messages.appendChild (tbody); } else { tbody = source.messages; } } else if (0) /*XXX*/ { tbody = source.messages.firstChild; } else { tbody = source.messages; } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; tbody.appendChild (obj); } else tbody.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) tbody.removeChild (tbody.firstChild); else tbody.removeChild (tbody.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
if (0) { tbody = document.createElementNS ("http: "html:tbody"); source.messages.appendChild (tbody); } else { tbody = source.messages; }
tbody = document.createElementNS ("http: "html:tbody"); source.messages.appendChild (tbody);
function addHistory (source, obj){ var tbody; if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "msg-table"); source.messages.setAttribute ("view-type", source.TYPE); if (0) /*XXX*/ { tbody = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:tbody"); source.messages.appendChild (tbody); } else { tbody = source.messages; } } else if (0) /*XXX*/ { tbody = source.messages.firstChild; } else { tbody = source.messages; } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; tbody.appendChild (obj); } else tbody.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) tbody.removeChild (tbody.firstChild); else tbody.removeChild (tbody.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
if (0) { tbody = source.messages.firstChild; } else { tbody = source.messages; }
{ tbody = source.messages.firstChild; }
function addHistory (source, obj){ var tbody; if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "msg-table"); source.messages.setAttribute ("view-type", source.TYPE); if (0) /*XXX*/ { tbody = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:tbody"); source.messages.appendChild (tbody); } else { tbody = source.messages; } } else if (0) /*XXX*/ { tbody = source.messages.firstChild; } else { tbody = source.messages; } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; tbody.appendChild (obj); } else tbody.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) tbody.removeChild (tbody.firstChild); else tbody.removeChild (tbody.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
tbody.appendChild (obj);
if (obj) tbody.appendChild (obj);
function addHistory (source, obj){ var tbody; if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "msg-table"); source.messages.setAttribute ("view-type", source.TYPE); if (0) /*XXX*/ { tbody = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:tbody"); source.messages.appendChild (tbody); } else { tbody = source.messages; } } else if (0) /*XXX*/ { tbody = source.messages.firstChild; } else { tbody = source.messages; } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; tbody.appendChild (obj); } else tbody.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) tbody.removeChild (tbody.firstChild); else tbody.removeChild (tbody.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height);
if ("currentObject" in client && client.currentObject == source && needScroll) { scrollDown(); setTimeout ("scrollDown()", 500); setTimeout ("scrollDown()", 1000); setTimeout ("scrollDown()", 2000); }
function addHistory (source, obj){ var tbody; if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "msg-table"); source.messages.setAttribute ("view-type", source.TYPE); if (0) /*XXX*/ { tbody = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:tbody"); source.messages.appendChild (tbody); } else { tbody = source.messages; } } else if (0) /*XXX*/ { tbody = source.messages.firstChild; } else { tbody = source.messages; } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; tbody.appendChild (obj); } else tbody.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) tbody.removeChild (tbody.firstChild); else tbody.removeChild (tbody.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("type", source.TYPE); source.messages.setAttribute ("width", "100%"); switch (source.TYPE) { case "IRCChanUser": case "IRCUser": source.messages.setAttribute ("nick", source.nick); break;
function addHistory (source, obj){ if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("type", source.TYPE); source.messages.setAttribute ("width", "100%"); switch (source.TYPE) { case "IRCChanUser": case "IRCUser": source.messages.setAttribute ("nick", source.nick); break; case "IRCNetwork": case "IRCChannel": case "IRCClient": source.messages.setAttribute ("name", source.name); break; default: dd ("** 'source' has INVALID TYPE in addHistory **"); break; } } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; source.messages.appendChild (obj); } else source.messages.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) source.messages.removeChild (source.messages.firstChild); else source.messages.removeChild (source.messages.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
case "IRCNetwork": case "IRCChannel": case "IRCClient": source.messages.setAttribute ("name", source.name); break; default: dd ("** 'source' has INVALID TYPE in addHistory **"); break; }
source.messages.setAttribute ("class", "msg-table"); source.messages.setAttribute ("view-type", source.TYPE); tbody = document.createElementNS ("http: "html:tbody"); source.messages.appendChild (tbody);
function addHistory (source, obj){ if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("type", source.TYPE); source.messages.setAttribute ("width", "100%"); switch (source.TYPE) { case "IRCChanUser": case "IRCUser": source.messages.setAttribute ("nick", source.nick); break; case "IRCNetwork": case "IRCChannel": case "IRCClient": source.messages.setAttribute ("name", source.name); break; default: dd ("** 'source' has INVALID TYPE in addHistory **"); break; } } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; source.messages.appendChild (obj); } else source.messages.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) source.messages.removeChild (source.messages.firstChild); else source.messages.removeChild (source.messages.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
source.messages.appendChild (obj);
tbody.appendChild (obj);
function addHistory (source, obj){ if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("type", source.TYPE); source.messages.setAttribute ("width", "100%"); switch (source.TYPE) { case "IRCChanUser": case "IRCUser": source.messages.setAttribute ("nick", source.nick); break; case "IRCNetwork": case "IRCChannel": case "IRCClient": source.messages.setAttribute ("name", source.name); break; default: dd ("** 'source' has INVALID TYPE in addHistory **"); break; } } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; source.messages.appendChild (obj); } else source.messages.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) source.messages.removeChild (source.messages.firstChild); else source.messages.removeChild (source.messages.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
source.messages.insertBefore (obj, source.messages.firstChild);
tbody.insertBefore (obj, source.messages.firstChild);
function addHistory (source, obj){ if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("type", source.TYPE); source.messages.setAttribute ("width", "100%"); switch (source.TYPE) { case "IRCChanUser": case "IRCUser": source.messages.setAttribute ("nick", source.nick); break; case "IRCNetwork": case "IRCChannel": case "IRCClient": source.messages.setAttribute ("name", source.name); break; default: dd ("** 'source' has INVALID TYPE in addHistory **"); break; } } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; source.messages.appendChild (obj); } else source.messages.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) source.messages.removeChild (source.messages.firstChild); else source.messages.removeChild (source.messages.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
source.messages.removeChild (source.messages.firstChild);
tbody.removeChild (tbody.firstChild);
function addHistory (source, obj){ if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("type", source.TYPE); source.messages.setAttribute ("width", "100%"); switch (source.TYPE) { case "IRCChanUser": case "IRCUser": source.messages.setAttribute ("nick", source.nick); break; case "IRCNetwork": case "IRCChannel": case "IRCClient": source.messages.setAttribute ("name", source.name); break; default: dd ("** 'source' has INVALID TYPE in addHistory **"); break; } } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; source.messages.appendChild (obj); } else source.messages.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) source.messages.removeChild (source.messages.firstChild); else source.messages.removeChild (source.messages.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
source.messages.removeChild (source.messages.lastChild);
tbody.removeChild (tbody.lastChild);
function addHistory (source, obj){ if (!source.messages) { source.messages = document.createElementNS ("http://www.w3.org/1999/xhtml", "html:table"); source.messages.setAttribute ("class", "chat-view"); source.messages.setAttribute ("cellpadding", "0"); source.messages.setAttribute ("cellspacing", "0"); source.messages.setAttribute ("type", source.TYPE); source.messages.setAttribute ("width", "100%"); switch (source.TYPE) { case "IRCChanUser": case "IRCUser": source.messages.setAttribute ("nick", source.nick); break; case "IRCNetwork": case "IRCChannel": case "IRCClient": source.messages.setAttribute ("name", source.name); break; default: dd ("** 'source' has INVALID TYPE in addHistory **"); break; } } var needScroll = false; var w = window.frames[0]; if (client.PRINT_DIRECTION == 1) { if ((w.document.height - (w.innerHeight + w.pageYOffset)) < (w.innerHeight / 3)) needScroll = true; source.messages.appendChild (obj); } else source.messages.insertBefore (obj, source.messages.firstChild); if (source.MAX_MESSAGES) { if (typeof source.messageCount != "number") source.messageCount = 1; else source.messageCount++; if (source.messageCount > source.MAX_MESSAGES) if (client.PRINT_DIRECTION == 1) source.messages.removeChild (source.messages.firstChild); else source.messages.removeChild (source.messages.lastChild); } if (needScroll && client.currentObject == source) w.scrollTo (w.pageXOffset, w.document.height); }
aItem.id = "uuid:" + (new Date()).getTime();
addItem: function (aItem, aListener) { if (aItem.id == null) { // is this an error? Or should we generate an IID? } if (this.mItems[aItem.id] != null) { // is this an error? if (aListener) aListener.onOperationComplete (Components.results.NS_ERROR_FAILURE, aItem.id, aListener.ADD, "ID already eists for addItem"); return; } // is this item an event? var event = aItem.QueryInterface(kCalEventIID); if (event) { flushEvent (event); } else { aListener.onOperationComplete (Components.results.NS_ERROR_FAILURE, aItem.id, aListener.ADD, "Don't know how to add items of the given type"); return; } // notify observers observeAddItem(aItem); // notify the listener if (aListener) aListener.onOperationComplete (Components.results.NS_OK, aItem.id, aListener.ADD, aItem); },
aItem.id = "uuid:" + (new Date()).getTime();
addItem: function (aItem, aListener) { if (aItem.id == null) { // is this an error? Or should we generate an IID? } if (this.mItems[aItem.id] != null) { // is this an error? if (aListener) aListener.onOperationComplete (Components.results.NS_ERROR_FAILURE, aItem.id, aListener.ADD, "ID already eists for addItem"); return; } this.mItems[aItem.id] = aItem; // notify observers this.observeAddItem(aItem); // notify the listener if (aListener) aListener.onOperationComplete (Components.results.NS_OK, aItem.id, aListener.ADD, aItem); },
cell.setAttribute("align","left");
cell.setAttribute("rowMigrate", aProfileObject.mMigrated );
function AddItem( aChildren, aProfileObject ){ var kids = document.getElementById(aChildren); var item = document.createElement("treeitem"); var row = document.createElement("treerow"); var cell = document.createElement("treecell"); cell.setAttribute("value", aProfileObject.mName ); cell.setAttribute("align","left"); row.appendChild(cell); item.appendChild(row); item.setAttribute("profile_name", aProfileObject.mName ); item.setAttribute("rowName", aProfileObject.mName ); item.setAttribute("id", ( "profileName_" + aProfileObject.mName ) ); item.setAttribute("rowMigrate", aProfileObject.mMigrated ); item.setAttribute("directory", aProfileObject.mDir ); // 23/10/99 - no roaming access yet! // var roaming = document.getElementById("roamingitem"); // kids.insertBefore(item,roaming); kids.appendChild(item);}
item.setAttribute("rowMigrate", aProfileObject.mMigrated );
function AddItem( aChildren, aProfileObject ){ var kids = document.getElementById(aChildren); var item = document.createElement("treeitem"); var row = document.createElement("treerow"); var cell = document.createElement("treecell"); cell.setAttribute("value", aProfileObject.mName ); cell.setAttribute("align","left"); row.appendChild(cell); item.appendChild(row); item.setAttribute("profile_name", aProfileObject.mName ); item.setAttribute("rowName", aProfileObject.mName ); item.setAttribute("id", ( "profileName_" + aProfileObject.mName ) ); item.setAttribute("rowMigrate", aProfileObject.mMigrated ); item.setAttribute("directory", aProfileObject.mDir ); // 23/10/99 - no roaming access yet! // var roaming = document.getElementById("roamingitem"); // kids.insertBefore(item,roaming); kids.appendChild(item);}
#ifndef MOZ_PLACES
#ifndef MOZ_PLACES_BOOKMARKS
function AddKeywordForSearchField(){ var node = document.popupNode; var docURI = makeURI(node.ownerDocument.URL, node.ownerDocument.characterSet); var formURI = makeURI(node.form.getAttribute("action"), node.ownerDocument.characterSet, docURI); var spec = formURI.spec; var isURLEncoded = (node.form.method.toUpperCase() == "POST" && (node.form.enctype == "application/x-www-form-urlencoded" || node.form.enctype == "")); var el, type; var formData = []; for (var i=0; i < node.form.elements.length; i++) { el = node.form.elements[i]; if (!el.type) // happens with fieldsets continue; if (el == node) { formData.push((isURLEncoded) ? escapeNameValuePair(el.name, "%s", true) : // Don't escape "%s", just append escapeNameValuePair(el.name, "", false) + "%s"); continue; } type = el.type.toLowerCase(); if ((type == "text" || type == "hidden" || type == "textarea") || ((type == "checkbox" || type == "radio") && el.checked)) { formData.push(escapeNameValuePair(el.name, el.value, isURLEncoded)); } else if (el instanceof HTMLSelectElement && el.selectedIndex >= 0) { for (var j=0; j < el.options.length; j++) { if (el.options[j].selected) formData.push(escapeNameValuePair(el.name, el.options[j].value, isURLEncoded)); } } } var postData; if (isURLEncoded) postData = formData.join("&"); else spec += "?" + formData.join("&");#ifndef MOZ_PLACES var dialogArgs = { name: "", url: spec, charset: node.ownerDocument.characterSet, bWebPanel: false, keyword: "", bNeedKeyword: true, postData: postData, description: BookmarksUtils.getDescriptionFromDocument(node.ownerDocument) } openDialog("chrome://browser/content/bookmarks/addBookmark2.xul", "", BROWSER_ADD_BM_FEATURES, dialogArgs);#else dump("*** IMPLEMENT ME: Bug 329281\n");#endif}
this.findDocuments(aKids[i].contentDocument, aArray);
addKidsToArray: function(aKids, aArray) { for (var i = 0; i < aKids.length; ++i) { try { aArray.push(aKids[i].contentDocument); } catch (ex) { // if we can't access the content document, skip it } } },
if (preference.value.indexOf(selectedID) >= 0) return;
var arrayOfPrefs = preference.value.split(/\s*,\s*/); for (var i = 0; i < arrayOfPrefs.length; ++i ){ if (arrayOfPrefs[i] == selectedID) return; }
addLanguage: function () { var selectedID = this._availableLanguages.selectedItem.id; var preference = document.getElementById("intl.accept_languages"); if (preference.value.indexOf(selectedID) >= 0) return; this._selectedItemID = selectedID; if (preference.value == "") preference.value = selectedID; else preference.value += "," + selectedID; this._acceptLanguages[selectedID] = true; this._availableLanguages.selectedItem = null; // Reuild the available list with the added item removed... this._buildAvailableLanguageList(); this._availableLanguages.setAttribute("label", this._availableLanguages.getAttribute("label2")); this._availableLanguages.setAttribute("accesskey", this._availableLanguages.getAttribute("accesskey2")); },
SelectLanguage();
function AddLanguage() { //cludge: make pref string available from the popup document.getElementById('intlAcceptLanguages').value = pref_string; window.openDialog("chrome://communicator/content/pref/pref-languages-add.xul","","modal=yes,chrome,resizable=yes", "addlangwindow"); UpdateSavePrefString();}
SimileAjax.History._listeners.push(listener);
SimileAjax.History._listeners.add(listener);
SimileAjax.History.addListener = function(listener) { SimileAjax.History.initialize(); SimileAjax.History._listeners.push(listener);};
MessageComposeOfflineStateChanged(ioService.offline);
MessageComposeOfflineStateChanged(isOffline);
function AddMessageComposeOfflineObserver(){ var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); observerService.AddObserver(messageComposeOfflineObserver, "network:offline-status-changed"); // set the initial state of the send button MessageComposeOfflineStateChanged(ioService.offline);}
if (existingToolbar) {
if (existingToolbar || !name.value) {
function addNewToolbar(){ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var stringBundle = document.getElementById("stringBundle"); var message = stringBundle.getString("enterToolbarName"); var title = stringBundle.getString("enterToolbarTitle"); var name = {}; while (1) { if (!promptService.prompt(window, title, message, name, null, {})) { return; } else { // Check for an existing toolbar with the same name and prompt again // if a conflict is found var nameToId = "__customToolbar_" + name.value.replace(" ", ""); var existingToolbar = gToolboxDocument.getElementById(nameToId); if (existingToolbar) { message = stringBundle.getFormattedString("enterToolbarDup", [name.value]); } else { break; } } } gToolbox.appendCustomToolbar(name.value, ""); repositionDialog(); gToolboxChanged = true;}
toggleElem.onclick = function() {return false;};
addNextActionListingToggles: function() { this.contextCollapseCookieManager = new CookieManager(); var toggleElems = document.getElementsByClassName('container_toggle'); toggleElems.each(function(toggleElem){ Event.observe(toggleElem, 'click', todoItems.toggleNextActionListing); containerElem = todoItems.findNearestParentByClassName(toggleElem, "container"); collapsedCookie = contextCollapseCookieManager.getCookie(todoItems.buildCookieName(containerElem)); if (collapsedCookie) { itemsElem = todoItems.findItemsElem(toggleElem); todoItems.collapseNextActionListing(toggleElem, itemsElem); } }); },
"chrome,resizeable=no",
"chrome,titlebar,resizeable=no",
function AddNodeToAddressBook (emailAddressNode){ if (emailAddressNode) { var primaryEmail = emailAddressNode.getAttribute("emailAddress"); var displayName = emailAddressNode.getAttribute("displayName"); window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul", "", "chrome,resizeable=no", {primaryEmail:primaryEmail, displayName:displayName }); }}
select.add(new Option("---", "---", false, false), null);
if (select.className == 'select_product') { select.add(new Option("-Product-", "---", false, false), null); } else if (select.className == 'select_testgroup') { select.add(new Option("-Testgroup-", "---", false, false), null); } else if (select.className == 'select_subgroup') { select.add(new Option("-Subgroup-", "---", false, false), null); } else { select.add(new Option("---", "---", false, false), null); }
function addNullEntry(select) { // add a blank entry to the current select: select.add(new Option("---", "---", false, false), null);}
addObserver: function(aDomain, aFunction)
addObserver: function addObserver(aDomain, aFunction)
addObserver: function(aDomain, aFunction) { if (!this.mPrefs) this.init(); var pbi = XPCU.QI(this.mPrefs, "nsIPrefBranchInternal"); if (pbi) pbi.addObserver(aDomain, aFunction, false); },
var pbi = XPCU.QI(this.mPrefs, "nsIPrefBranchInternal");
var pbi = XPCU.QI(this.mPrefs, "nsIPrefBranch2");
addObserver: function(aDomain, aFunction) { if (!this.mPrefs) this.init(); var pbi = XPCU.QI(this.mPrefs, "nsIPrefBranchInternal"); if (pbi) pbi.addObserver(aDomain, aFunction, false); },
dump("Adding "+service.Value+"\n");
debug("Adding "+service.Value);
function addOption(registry, service, selectIt){ dump("Adding "+service.Value+"\n"); var option_title = getAttr(registry, service, 'title'); var option_customize = getAttr(registry, service, 'customize'); var option_content = getAttr(registry, service, 'content'); var tree = document.getElementById('selected-panels'); var treeroot = document.getElementById('selected-panels-root'); // Check to see if the panel already exists... for (var ii = treeroot.firstChild; ii != null; ii = ii.nextSibling) { if (ii.getAttribute('id') == service.Value) { // we already had the panel installed tree.selectItem(ii); return; } } var item = document.createElement('treeitem'); var row = document.createElement('treerow'); var cell = document.createElement('treecell'); item.setAttribute('id', service.Value); item.setAttribute('customize', option_customize); item.setAttribute('content', option_content); cell.setAttribute('value', option_title); item.appendChild(row); row.appendChild(cell); treeroot.appendChild(item); if (selectIt) { dump("Selecting new item\n"); tree.selectItem(item) }}