rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
if (term.matchAll) { condition = "ALL"; break; }
|
function getSearchTermString(searchTerms){ var searchIndex; var condition = ""; var count = searchTerms.Count(); for (searchIndex = 0; searchIndex < count; ) { var term = searchTerms.QueryElementAt(searchIndex++, Components.interfaces.nsIMsgSearchTerm); if (condition.length > 1) condition += ' '; condition += (term.booleanAnd) ? "AND (" : "OR ("; condition += term.termAsString + ')'; } return condition;}
|
|
smimeComposefields.alwaysEncryptMessage = gCurrentIdentity.getBoolAttribute("encrypt_mail_always");
|
var encryptionPolicy = gCurrentIdentity.getIntAttribute("encryptionpolicy"); smimeComposefields.alwaysEncryptMessage = encryptionPolicy == 2;
|
function GetSecurityInfo(){ var smimeComposefields; var msgCompFields = gMsgCompose.compFields; if (msgCompFields) { if (!msgCompFields.securityInfo) { smimeComposefields = Components.classes[smimeCompFieldsContractID].createInstance(ismimeCompFields); if (smimeComposefields) { msgCompFields.securityInfo = smimeComposefields; // set up the intial security state.... smimeComposefields.alwaysEncryptMessage = gCurrentIdentity.getBoolAttribute("encrypt_mail_always"); smimeComposefields.signMessage = gCurrentIdentity.getBoolAttribute("sign_mail"); } } else { smimeComposefields = msgCompFields.securityInfo; } } // if we have message compose fields... return smimeComposefields}
|
return smimeComposefields
|
return smimeComposefields;
|
function GetSecurityInfo(){ var smimeComposefields; var msgCompFields = gMsgCompose.compFields; if (msgCompFields) { if (!msgCompFields.securityInfo) { smimeComposefields = Components.classes[smimeCompFieldsContractID].createInstance(ismimeCompFields); if (smimeComposefields) { msgCompFields.securityInfo = smimeComposefields; // set up the intial security state.... smimeComposefields.alwaysEncryptMessage = gCurrentIdentity.getBoolAttribute("encrypt_mail_always"); smimeComposefields.signMessage = gCurrentIdentity.getBoolAttribute("sign_mail"); } } else { smimeComposefields = msgCompFields.securityInfo; } } // if we have message compose fields... return smimeComposefields}
|
var msgCompFields = msgCompose.compFields;
|
var msgCompFields = gMsgCompose.compFields;
|
function GetSecurityInfo(){ var smimeComposefields; var msgCompFields = msgCompose.compFields; if (msgCompFields) { if (!msgCompFields.securityInfo) { smimeComposefields = Components.classes[smimeCompFieldsContractID].createInstance(ismimeCompFields); if (smimeComposefields) { msgCompFields.securityInfo = smimeComposefields; // set up the intial security state.... smimeComposefields.alwaysEncryptMessage = gCurrentIdentity.getBoolAttribute("encrypt_mail_always"); smimeComposefields.signMessage = gCurrentIdentity.getBoolAttribute("sign_mail"); } } else { smimeComposefields = msgCompFields.securityInfo; } } // if we have message compose fields... return smimeComposefields}
|
var selectedAB = 0; var abDirEntries = document.getElementById(abListItem);
|
var selectedAB; try { var abDirEntries = document.getElementById(abListItem);
|
function GetSelectedAddressBookDirID(abListItem){ var selectedAB = 0; var abDirEntries = document.getElementById(abListItem); if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) { var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex); selectedAB = selected.id; } // request could be coming from the context menu of addressbook panel in sidebar // addressbook dirs are listed as menu item. So, get the selected item id. if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem) selectedAB = abDirEntries.selectedItem.getAttribute("id"); // if we do not have a selected ab still, use personal addressbook if (!selectedAB) selectedAB = kPersonalAddressbookURI; return selectedAB;}
|
if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) { var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex); selectedAB = selected.id;
|
if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) { var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex); selectedAB = selected.id; } if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem) selectedAB = abDirEntries.selectedItem.getAttribute("id"); if (!selectedAB) selectedAB = kPersonalAddressbookURI;
|
function GetSelectedAddressBookDirID(abListItem){ var selectedAB = 0; var abDirEntries = document.getElementById(abListItem); if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) { var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex); selectedAB = selected.id; } // request could be coming from the context menu of addressbook panel in sidebar // addressbook dirs are listed as menu item. So, get the selected item id. if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem) selectedAB = abDirEntries.selectedItem.getAttribute("id"); // if we do not have a selected ab still, use personal addressbook if (!selectedAB) selectedAB = kPersonalAddressbookURI; return selectedAB;}
|
if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem) selectedAB = abDirEntries.selectedItem.getAttribute("id"); if (!selectedAB)
|
catch (ex) {
|
function GetSelectedAddressBookDirID(abListItem){ var selectedAB = 0; var abDirEntries = document.getElementById(abListItem); if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) { var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex); selectedAB = selected.id; } // request could be coming from the context menu of addressbook panel in sidebar // addressbook dirs are listed as menu item. So, get the selected item id. if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem) selectedAB = abDirEntries.selectedItem.getAttribute("id"); // if we do not have a selected ab still, use personal addressbook if (!selectedAB) selectedAB = kPersonalAddressbookURI; return selectedAB;}
|
}
|
function GetSelectedAddressBookDirID(abListItem){ var selectedAB = 0; var abDirEntries = document.getElementById(abListItem); if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) { var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex); selectedAB = selected.id; } // request could be coming from the context menu of addressbook panel in sidebar // addressbook dirs are listed as menu item. So, get the selected item id. if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem) selectedAB = abDirEntries.selectedItem.getAttribute("id"); // if we do not have a selected ab still, use personal addressbook if (!selectedAB) selectedAB = kPersonalAddressbookURI; return selectedAB;}
|
|
if (!selectedAB) selectedAB = kPersonalAddressbookURI;
|
function GetSelectedAddressBookDirID(abListItem){ var selectedAB = 0; var abDirEntries = document.getElementById(abListItem); if (abDirEntries && abDirEntries.localName == "tree" && abDirEntries.currentIndex >= 0) { var selected = abDirEntries.contentView.getItemAtIndex(abDirEntries.currentIndex); selectedAB = selected.id; } // request could be coming from the context menu of addressbook panel in sidebar // addressbook dirs are listed as menu item. So, get the selected item id. if (!selectedAB && abDirEntries && abDirEntries.localName == "menulist" && abDirEntries.selectedItem) selectedAB = abDirEntries.selectedItem.getAttribute("id"); return selectedAB;}
|
|
var others_tab = document.getElementById("others_tab");
|
function getSelectedCerts(){ var ca_tab = document.getElementById("ca_tab"); var mine_tab = document.getElementById("mine_tab"); //var others_tab = document.getElementById("others_tab"); var websites_tab = document.getElementById("websites_tab"); var items = null; if (ca_tab.selected) { items = caOutlinerView.selection; } else if (mine_tab.selected) { items = userOutlinerView.selection;/* } else if (others_tab.selected) { items = emailOutlinerView.selection;*/ } else if (websites_tab.selected) { items = serverOutlinerView.selection; } selected_certs = []; var cert = null; var nr = 0; if (items != null) nr = items.getRangeCount(); if (nr > 0) { for (var i=0; i<nr; i++) { var o1 = {}; var o2 = {}; items.getRangeAt(i, o1, o2); var min = o1.value; var max = o2.value; for (var j=min; j<=max; j++) { if (ca_tab.selected) { cert = caOutlinerView.getCert(j); } else if (mine_tab.selected) { cert = userOutlinerView.getCert(j);/* } else if (others_tab.selected) { cert = emailOutlinerView.getCert(j);*/ } else if (websites_tab.selected) { cert = serverOutlinerView.getCert(j); } if (cert) selected_certs[selected_certs.length] = cert; } } }}
|
|
/*
|
function getSelectedCerts(){ var ca_tab = document.getElementById("ca_tab"); var mine_tab = document.getElementById("mine_tab"); //var others_tab = document.getElementById("others_tab"); var websites_tab = document.getElementById("websites_tab"); var items = null; if (ca_tab.selected) { items = caOutlinerView.selection; } else if (mine_tab.selected) { items = userOutlinerView.selection;/* } else if (others_tab.selected) { items = emailOutlinerView.selection;*/ } else if (websites_tab.selected) { items = serverOutlinerView.selection; } selected_certs = []; var cert = null; var nr = 0; if (items != null) nr = items.getRangeCount(); if (nr > 0) { for (var i=0; i<nr; i++) { var o1 = {}; var o2 = {}; items.getRangeAt(i, o1, o2); var min = o1.value; var max = o2.value; for (var j=min; j<=max; j++) { if (ca_tab.selected) { cert = caOutlinerView.getCert(j); } else if (mine_tab.selected) { cert = userOutlinerView.getCert(j);/* } else if (others_tab.selected) { cert = emailOutlinerView.getCert(j);*/ } else if (websites_tab.selected) { cert = serverOutlinerView.getCert(j); } if (cert) selected_certs[selected_certs.length] = cert; } } }}
|
|
*/
|
function getSelectedCerts(){ var ca_tab = document.getElementById("ca_tab"); var mine_tab = document.getElementById("mine_tab"); //var others_tab = document.getElementById("others_tab"); var websites_tab = document.getElementById("websites_tab"); var items = null; if (ca_tab.selected) { items = caOutlinerView.selection; } else if (mine_tab.selected) { items = userOutlinerView.selection;/* } else if (others_tab.selected) { items = emailOutlinerView.selection;*/ } else if (websites_tab.selected) { items = serverOutlinerView.selection; } selected_certs = []; var cert = null; var nr = 0; if (items != null) nr = items.getRangeCount(); if (nr > 0) { for (var i=0; i<nr; i++) { var o1 = {}; var o2 = {}; items.getRangeAt(i, o1, o2); var min = o1.value; var max = o2.value; for (var j=min; j<=max; j++) { if (ca_tab.selected) { cert = caOutlinerView.getCert(j); } else if (mine_tab.selected) { cert = userOutlinerView.getCert(j);/* } else if (others_tab.selected) { cert = emailOutlinerView.getCert(j);*/ } else if (websites_tab.selected) { cert = serverOutlinerView.getCert(j); } if (cert) selected_certs[selected_certs.length] = cert; } } }}
|
|
if (dirTree.currentIndex < 0) return null;
|
try { if (dirTree.currentIndex < 0) return null;
|
function GetSelectedDirectory(){ if (dirTree.currentIndex < 0) return null; var selected = dirTree.contentView.getItemAtIndex(dirTree.currentIndex); return selected.id;}
|
var selected = dirTree.contentView.getItemAtIndex(dirTree.currentIndex); return selected.id;
|
var selected = dirTree.contentView.getItemAtIndex(dirTree.currentIndex); return selected.id; } catch (ex) { return kPersonalAddressbookURI; }
|
function GetSelectedDirectory(){ if (dirTree.currentIndex < 0) return null; var selected = dirTree.contentView.getItemAtIndex(dirTree.currentIndex); return selected.id;}
|
while (selectedItem.localName == "treeitem") { if (selectedItem.getAttribute("container") == "true")
|
while (selectedItem && selectedItem.nodeType == Node.ELEMENT_NODE) { if (selectedItem.getAttribute("container") == "true" && selectedItem.getAttribute("open") == "true")
|
getSelectedFolder: function () { var selectedItem = this.getBestItem(); if (!selectedItem) return "NC:BookmarksRoot"; // If we don't check for localName we walk the DOM tree up to the window node, // which is Bad. while (selectedItem.localName == "treeitem") { if (selectedItem.getAttribute("container") == "true") return NODE_ID(selectedItem); selectedItem = selectedItem.parentNode.parentNode; } return "NC:BookmarksRoot"; },
|
var module_name = cell.getAttribute("label");
|
module_name = cell.getAttribute("label");
|
function getSelectedItem(){ var tree = document.getElementById('device_tree'); var items = tree.selectedItems; selected_slot = null; selected_module = null; if (items.length > 0) { var kind = items[0].getAttribute("pk11kind"); if (kind == "slot") { // get the module cell for this slot cell var cell = items[0].parentNode.parentNode.firstChild.firstChild; var module_name = cell.getAttribute("label"); var module = secmoddb.findModuleByName(module_name); // get the cell for the selected row (the slot to display) cell = items[0].firstChild.firstChild; var slot_name = cell.getAttribute("label"); selected_slot = module.findSlotByName(slot_name); } else { // (kind == "module") // get the cell for the selected row (the module to display) cell = items[0].firstChild.firstChild; var module_name = cell.getAttribute("label"); selected_module = secmoddb.findModuleByName(module_name); } }}
|
return messageArray.value;
|
if (length.value) return messageArray.value; else return null;
|
function GetSelectedMessages(){ try { var messageArray = {}; var length = {}; var view = GetDBView(); view.getURIsForSelection(messageArray,length); return messageArray.value; } catch (ex) { dump("ex = " + ex + "\n"); return null; }}
|
var msgFolder = window.parent.GetMsgFolderFromURI(folderURI);
|
var msgFolder = window.parent.GetMsgFolderFromUri(folderURI, true);
|
function GetSelectedMsgFolder(){ var folderURI = window.parent.GetSelectedFolderURI(); var msgFolder = window.parent.GetMsgFolderFromURI(folderURI); return msgFolder;}
|
} else if (selTabID == "others_tab") { key = "?others_certs";
|
function getSelectedTab(){ var selTab = document.getElementById('certMgrTabbox').selectedItem; var selTabID = selTab.getAttribute('id'); if (selTabID == 'mine_tab') { key = "?my_certs"; } else if (selTabID == "websites_tab") { key = "?web_certs"; } else if (selTabID == "ca_tab") { key = "?ca_certs"; } var context = helpURL + key; return context;}
|
|
if (tree && tree.selectedItems && tree.selectedItems[0] && tree.selectedItems[0].firstChild && tree.selectedItems[0].firstChild.firstChild)
|
if (tree)
|
function GetSelectedTreelistAttribute(tree, attr){ if (tree && tree.selectedItems && tree.selectedItems[0] && tree.selectedItems[0].firstChild && tree.selectedItems[0].firstChild.firstChild) { return tree.selectedItems[0].firstChild.firstChild.getAttribute(attr); } return "";}
|
return tree.selectedItems[0].firstChild.firstChild.getAttribute(attr);
|
if (tree.selectedIndex >= 0 && tree.selectedItems.length > 0 && tree.selectedItems[0] && tree.selectedItems[0].firstChild && tree.selectedItems[0].firstChild.firstChild) { return tree.selectedItems[0].firstChild.firstChild.getAttribute(attr); }
|
function GetSelectedTreelistAttribute(tree, attr){ if (tree && tree.selectedItems && tree.selectedItems[0] && tree.selectedItems[0].firstChild && tree.selectedItems[0].firstChild.firstChild) { return tree.selectedItems[0].firstChild.firstChild.getAttribute(attr); } return "";}
|
return GetSelectedTreelistAttribute(tree,"value")
|
return GetSelectedTreelistAttribute(tree,"label")
|
function GetSelectedTreelistValue(tree){ return GetSelectedTreelistAttribute(tree,"value")}
|
var folder = GetMsgFolderFromUri(uri);
|
var folder = GetMsgFolderFromUri(uri, true);
|
function GetServer(uri){ if (!uri) return null; try { var folder = GetMsgFolderFromUri(uri); return folder.server; } catch (ex) { dump("GetServer("+uri+") failed, ex="+ex+"\n"); } return null;}
|
return "safebrowsing.remoteLookups";
|
return "browser.safebrowsing.remoteLookups";
|
PROT_GlobalStore.getServerCheckEnabledPrefName = function() { return "safebrowsing.remoteLookups";}
|
if (servernode.tagName != "treeitem") {
|
if (servernode.localName != "treeitem") {
|
function getServerIdAndPageIdFromTree(tree){ var serverId = null; if (tree.selectedItems.length < 1) return null; var node = tree.selectedItems[0]; // get the page to load // (stored in the PageTag attribute of this node) var pageId = node.getAttribute('PageTag'); // get the server's Id // (stored in the Id attribute of the server node) var servernode = node.parentNode.parentNode; // for toplevel treeitems, we just use the current treeitem // dump("servernode is " + servernode + "\n"); if (servernode.tagName != "treeitem") { servernode = node; } serverId = servernode.getAttribute('id'); return {"serverId": serverId, "pageId": pageId }}
|
getBundle("insufficientWcapVersionError.text", loginTextVars) );
|
getWcapBundle("insufficientWcapVersionError.text", loginTextVars) );
|
getServerInfo: function( uri ) { loginTextVars = [uri.hostPort]; var loginText; var wcapVersion; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Error("invalid data, expected ical!"); var prop = icalRootComp.getFirstProperty( "PRODID" ); if (prop == null) throw new Error("missing PRODID!"); loginTextVars.push( prop.value ); var prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); if (prop == null) throw new Error("missing X-NSCP-SERVERVERSION!"); loginTextVars.push( prop.value ); var prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Error("missing X-NSCP-WCAPVERSION!"); wcapVersion = prop.value; loginTextVars.push( wcapVersion ); // var xml = issueSyncXMLRequest(// uri.spec + "version.wcap?fmt-out=text%2Fxml" );// wcapVersion = xml.getElementsByTagName(// "X-NSCP-WCAPVERSION" ).item(0).textContent;// if (wcapVersion == undefined || wcapVersion == "")// throw new Error("invalid response!");// serverInfo =// ("Server-Info: " +// xml.getElementsByTagName(// "iCal" ).item(0).attributes.getNamedItem(// "prodid" ).value +// ", v" + xml.getElementsByTagName(// "X-NSCP-SERVERVERSION" ).item(0).textContent +// ", WCAP v" + wcapVersion); } catch (exc) { this.log( "error: " + exc ); return null; } if (parseInt(wcapVersion) < 2.0) { this.log( "parsed server WCAP major: " + parseInt(wcapVersion) ); throw new Error( getBundle("insufficientWcapVersionError.text", loginTextVars) ); } return getBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
return getBundle().formatStringFromName(
|
return getWcapBundle().formatStringFromName(
|
getServerInfo: function( uri ) { loginTextVars = [uri.hostPort]; var loginText; var wcapVersion; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Error("invalid data, expected ical!"); var prop = icalRootComp.getFirstProperty( "PRODID" ); if (prop == null) throw new Error("missing PRODID!"); loginTextVars.push( prop.value ); var prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); if (prop == null) throw new Error("missing X-NSCP-SERVERVERSION!"); loginTextVars.push( prop.value ); var prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Error("missing X-NSCP-WCAPVERSION!"); wcapVersion = prop.value; loginTextVars.push( wcapVersion ); // var xml = issueSyncXMLRequest(// uri.spec + "version.wcap?fmt-out=text%2Fxml" );// wcapVersion = xml.getElementsByTagName(// "X-NSCP-WCAPVERSION" ).item(0).textContent;// if (wcapVersion == undefined || wcapVersion == "")// throw new Error("invalid response!");// serverInfo =// ("Server-Info: " +// xml.getElementsByTagName(// "iCal" ).item(0).attributes.getNamedItem(// "prodid" ).value +// ", v" + xml.getElementsByTagName(// "X-NSCP-SERVERVERSION" ).item(0).textContent +// ", WCAP v" + wcapVersion); } catch (exc) { this.log( "error: " + exc ); return null; } if (parseInt(wcapVersion) < 2.0) { this.log( "parsed server WCAP major: " + parseInt(wcapVersion) ); throw new Error( getBundle("insufficientWcapVersionError.text", loginTextVars) ); } return getBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
var icalRootComp;
|
var str; var icalRootComp = null;
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
var str = issueSyncRequest(
|
str = issueSyncRequest(
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
return null;
|
throw new Components.Exception("no ical data returned!");
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
if (icalRootComp == null) throw new Components.Exception("invalid ical data!");
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
|
catch (exc) { this.log( "server version request failed: " + errorToString(exc) ); return null;
|
catch (exc) { this.log( exc ); throw new Components.Exception( getWcapBundle().formatStringFromName( "accessingServerFailedError.text", [uri.hostPort], 1 ), isNaN(exc) ? Components.results.NS_ERROR_FAILURE : exc );
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value );
|
var prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (!prop) { throw new Components.Exception( "missing X-NSCP-WCAPVERSION in\n" + str ); }
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
loginTextVars, loginTextVars.length ) )) {
|
vars, vars.length ) )) {
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length );
|
return getWcapBundle().formatStringFromName( "loginDialog.text", [uri.hostPort], 1 );
|
getServerInfo: function( uri ) { var icalRootComp; try { // currently, xml parsing at an early stage during process startup // does not work reliably, so use libical parsing for now: var str = issueSyncRequest( uri.spec + "version.wcap?fmt-out=text%2Fcalendar" ); if (str.indexOf("BEGIN:VCALENDAR") < 0) return null; // no ical data returned icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid ical data!"); } catch (exc) { // soft error; request denied etc. this.log( "server version request failed: " + errorToString(exc) ); return null; } loginTextVars = [uri.hostPort]; var prop = icalRootComp.getFirstProperty( "PRODID" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-SERVERVERSION" ); loginTextVars.push( prop ? prop.value : "<unknown>" ); prop = icalRootComp.getFirstProperty( "X-NSCP-WCAPVERSION" ); if (prop == null) throw new Components.Exception("missing X-NSCP-WCAPVERSION!"); loginTextVars.push( prop.value ); var wcapVersion = parseInt(prop.value); if (wcapVersion < 3) { var prompt = getWindowWatcher().getNewPrompter(null); var bundle = getWcapBundle(); var labelText = bundle.GetStringFromName( "insufficientWcapVersionConfirmation.label"); if (!prompt.confirm( labelText, bundle.formatStringFromName( "insufficientWcapVersionConfirmation.text", loginTextVars, loginTextVars.length ) )) { throw new Components.Exception(labelText); } } return getWcapBundle().formatStringFromName( "loginDialog.text", loginTextVars, loginTextVars.length ); },
|
if ((bRefresh || !g_serverTimeDiffs[key]) && this.m_sessionId != null) { var url = (this.sessionUri.spec + "gettime.wcap?appid=mozilla-calendar" + "&fmt-out=text%2Fcalendar&id=" + encodeURIComponent(this.m_sessionId));
|
if (bRefresh || !g_serverTimeDiffs[key]) { url += "&fmt-out=text%2Fcalendar";
|
getServerTimeDiff: function( bRefresh ) { var key = this.sessionUri.hostPort; if ((bRefresh || !g_serverTimeDiffs[key]) && this.m_sessionId != null) { var url = (this.sessionUri.spec + // xxx todo: assuming same diff for all calids: "gettime.wcap?appid=mozilla-calendar" + "&fmt-out=text%2Fcalendar&id=" + encodeURIComponent(this.m_sessionId)); // xxx todo: think about // assure that locally calculated server time is smaller than the // current (real) server time: var str = issueSyncRequest( url ); var localTime = getTime(); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid data, expected ical!"); checkWcapIcalErrno( icalRootComp ); var serverTime = getDatetimeFromIcalProp( icalRootComp.getFirstProperty( "X-NSCP-WCAPTIME" ) ); var diff = serverTime.subtractDate( localTime ); this.log( "server time diff is: " + diff ); g_serverTimeDiffs[key] = diff; } return g_serverTimeDiffs[key]; },
|
var str = issueSyncRequest( url );
|
var icalRootComp = this.issueSyncRequest( url, stringToIcal );
|
getServerTimeDiff: function( bRefresh ) { var key = this.sessionUri.hostPort; if ((bRefresh || !g_serverTimeDiffs[key]) && this.m_sessionId != null) { var url = (this.sessionUri.spec + // xxx todo: assuming same diff for all calids: "gettime.wcap?appid=mozilla-calendar" + "&fmt-out=text%2Fcalendar&id=" + encodeURIComponent(this.m_sessionId)); // xxx todo: think about // assure that locally calculated server time is smaller than the // current (real) server time: var str = issueSyncRequest( url ); var localTime = getTime(); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid data, expected ical!"); checkWcapIcalErrno( icalRootComp ); var serverTime = getDatetimeFromIcalProp( icalRootComp.getFirstProperty( "X-NSCP-WCAPTIME" ) ); var diff = serverTime.subtractDate( localTime ); this.log( "server time diff is: " + diff ); g_serverTimeDiffs[key] = diff; } return g_serverTimeDiffs[key]; },
|
var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid data, expected ical!"); checkWcapIcalErrno( icalRootComp );
|
getServerTimeDiff: function( bRefresh ) { var key = this.sessionUri.hostPort; if ((bRefresh || !g_serverTimeDiffs[key]) && this.m_sessionId != null) { var url = (this.sessionUri.spec + // xxx todo: assuming same diff for all calids: "gettime.wcap?appid=mozilla-calendar" + "&fmt-out=text%2Fcalendar&id=" + encodeURIComponent(this.m_sessionId)); // xxx todo: think about // assure that locally calculated server time is smaller than the // current (real) server time: var str = issueSyncRequest( url ); var localTime = getTime(); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid data, expected ical!"); checkWcapIcalErrno( icalRootComp ); var serverTime = getDatetimeFromIcalProp( icalRootComp.getFirstProperty( "X-NSCP-WCAPTIME" ) ); var diff = serverTime.subtractDate( localTime ); this.log( "server time diff is: " + diff ); g_serverTimeDiffs[key] = diff; } return g_serverTimeDiffs[key]; },
|
|
var name = frame.functionName ? frame.functionName : "[anonymous]";
|
var name = frame.name ? frame.name : "[anonymous]";
|
function getStackTrace (){ if (!jsenv.HAS_XPCOM) return "No stack trace available."; var frame = Components.stack.caller; var str = "<top>"; while (frame) { var name = frame.functionName ? frame.functionName : "[anonymous]"; str += "\n" + name + "@" + frame.lineNumber; frame = frame.caller; } return str; }
|
function getState(captureOrPrefill, threshhold) { stateFound(window.content, captureOrPrefill, threshhold);
|
function getState(threshhold) { stateFound(window.content, threshhold);
|
function getState(captureOrPrefill, threshhold) { stateFound(window.content, captureOrPrefill, threshhold); return bestState; }
|
return PROT_GlobalStore.getPref_("safebrowsing.provider.0.reportPhishURL");
|
return PROT_GlobalStore.getPref_("browser.safebrowsing.provider.0.reportPhishURL");
|
PROT_GlobalStore.getSubmitUrl = function() { return PROT_GlobalStore.getPref_("safebrowsing.provider.0.reportPhishURL");}
|
flavourList["text/x-moz-url"] = { width: 2, iid: "nsISupportsWString" };
|
getSupportedFlavours: function () { var flavourList = { }; flavourList["application/x-moz-file"] = { width: 2, iid: "nsIFile" }; return flavourList; }
|
|
flavourSet.appendFlavour("text/nsmessageOrFolder");
|
flavourSet.appendFlavour("text/nsmessageOrfolder");
|
getSupportedFlavours: function () { var flavourSet = new FlavourSet(); flavourSet.appendFlavour("text/x-moz-url"); flavourSet.appendFlavour("text/nsmessageOrFolder"); flavourSet.appendFlavour("application/x-moz-file", "nsIFile"); return flavourSet; }
|
if (!isPToolbarDNDEnabled()) return false; var flavourList = { }; flavourList["moz/toolbaritem"] = { width: 2, iid: "nsISupportsWString" }; flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" }; return flavourList;
|
var flavourSet = new FlavourSet(); flavourSet.appendFlavour("moz/rdfitem"); flavourSet.appendFlavour("text/unicode"); return flavourSet;
|
getSupportedFlavours: function () { // temporary if (!isPToolbarDNDEnabled()) return false; var flavourList = { }; flavourList["moz/toolbaritem"] = { width: 2, iid: "nsISupportsWString" }; flavourList["text/unicode"] = { width: 2, iid: "nsISupportsWString" }; return flavourList; },
|
flavourList["text/nsmessage"] = { width: 2, iid: "nsISupportsWString" };
|
getSupportedFlavours: function () { var flavourList = { }; flavourList["text/x-moz-url"] = { width: 2, iid: "nsISupportsWString" }; flavourList["application/x-moz-file"] = { width: 2, iid: "nsIFile" }; return flavourList; }
|
|
var flavours = new FlavourSet(); flavours.appendFlavour("text/unicode"); return flavours;
|
var weekflavours = new FlavourSet(); weekflavours.appendFlavour("text/unicode"); return weekflavours;
|
getSupportedFlavours : function () { var flavours = new FlavourSet(); flavours.appendFlavour("text/unicode"); return flavours; },
|
if ((bRefresh || !g_allSupportedTimezones[key]) && this.m_sessionId != null) { var url = (this.sessionUri.spec + "get_all_timezones.wcap?appid=mozilla-calendar" + "&fmt-out=text%2Fcalendar&id=" + encodeURIComponent(this.m_sessionId)); var str = issueSyncRequest( url ); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid data, expected ical!"); checkWcapIcalErrno( icalRootComp );
|
if (bRefresh || !g_allSupportedTimezones[key]) { url += "&fmt-out=text%2Fcalendar"; var icalRootComp = this.issueSyncRequest( url, stringToIcal );
|
getSupportedTimezones: function( bRefresh ) { var key = this.sessionUri.hostPort; if ((bRefresh || !g_allSupportedTimezones[key]) && this.m_sessionId != null) { var url = (this.sessionUri.spec + "get_all_timezones.wcap?appid=mozilla-calendar" + "&fmt-out=text%2Fcalendar&id=" + encodeURIComponent(this.m_sessionId)); var str = issueSyncRequest( url ); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid data, expected ical!"); checkWcapIcalErrno( icalRootComp ); var tzids = []; var this_ = this; forEachIcalComponent( icalRootComp, "VTIMEZONE", function( subComp ) { try { var tzCal = getIcsService().createIcalComponent( "VCALENDAR" ); subComp = subComp.clone(); tzCal.addSubcomponent( subComp ); getIcsService().addTimezone( tzCal, "", "" ); tzids.push( subComp.getFirstProperty("TZID").value ); } catch (exc) { // ignore errors: this_.log( "error: " + exc ); } } ); g_allSupportedTimezones[key] = tzids; } return g_allSupportedTimezones[key]; },
|
this_.log( "error: " + exc );
|
this_.logError( exc );
|
getSupportedTimezones: function( bRefresh ) { var key = this.sessionUri.hostPort; if ((bRefresh || !g_allSupportedTimezones[key]) && this.m_sessionId != null) { var url = (this.sessionUri.spec + "get_all_timezones.wcap?appid=mozilla-calendar" + "&fmt-out=text%2Fcalendar&id=" + encodeURIComponent(this.m_sessionId)); var str = issueSyncRequest( url ); var icalRootComp = getIcsService().parseICS( str ); if (icalRootComp == null) throw new Components.Exception("invalid data, expected ical!"); checkWcapIcalErrno( icalRootComp ); var tzids = []; var this_ = this; forEachIcalComponent( icalRootComp, "VTIMEZONE", function( subComp ) { try { var tzCal = getIcsService().createIcalComponent( "VCALENDAR" ); subComp = subComp.clone(); tzCal.addSubcomponent( subComp ); getIcsService().addTimezone( tzCal, "", "" ); tzids.push( subComp.getFirstProperty("TZID").value ); } catch (exc) { // ignore errors: this_.log( "error: " + exc ); } } ); g_allSupportedTimezones[key] = tzids; } return g_allSupportedTimezones[key]; },
|
browser.setAttribute("type", "content");
|
if (client.hostCompat.typeChromeBrowser) browser.setAttribute("type", "chrome"); else browser.setAttribute("type", "content");
|
function getTabForObject (source, create){ var name; if (!ASSERT(source, "UNDEFINED passed to getTabForObject")) return null; if ("viewName" in source) { name = source.viewName; } else { ASSERT(0, "INVALID OBJECT passed to getTabForObject"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { if (!("messages" in source) || source.messages == null) createMessages(source); var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute("href", source.getURL()); tb.setAttribute("name", source.unicodeName); tb.setAttribute("onclick", "onTabClick(event, " + id.quote() + ");"); // This wouldn't be here if there was a supported CSS property for it. tb.setAttribute("crop", "center"); tb.setAttribute("context", "context:tab"); tb.setAttribute("tooltip", "xul-tooltip-node"); tb.setAttribute("class", "tab-bottom view-button"); tb.setAttribute("id", id); tb.setAttribute("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); tb.view = source; if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild(tb); var browser = document.createElement ("browser"); browser.setAttribute("class", "output-container"); browser.setAttribute("type", "content"); browser.setAttribute("flex", "1"); browser.setAttribute("tooltip", "html-tooltip-node"); browser.setAttribute("context", "context:messages"); //browser.setAttribute ("onload", "scrollDown(true);"); browser.setAttribute("onclick", "return onMessageViewClick(event)"); browser.setAttribute("ondragover", "nsDragAndDrop.dragOver(event, " + "contentDropObserver);"); browser.setAttribute("ondragdrop", "nsDragAndDrop.drop(event, contentDropObserver);"); browser.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, " + "contentAreaDNDObserver);"); browser.source = source; source.frame = browser; ASSERT(client.deck, "no deck?"); client.deck.appendChild (browser); syncOutputFrame (source); } return tb;}
|
create = (typeof create != "undefined") ? Boolean(create) : false;
|
function getTabForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTabForObject **"); dd (getStackTrace()); return null; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTabForObject **"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute ("href", source.getURL()); tb.setAttribute ("name", source.name); tb.setAttribute ("onclick", "onTabClick(" + id.quote() + ");"); tb.setAttribute ("crop", "right"); tb.setAttribute ("class", "tab-bottom view-button"); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild (tb); } return tb; }
|
|
case "IRCChannel":
|
function getTabForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTabForObject **"); dd (getStackTrace()); return null; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTabForObject **"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute ("href", source.getURL()); tb.setAttribute ("name", source.name); tb.setAttribute ("onclick", "onTabClick(" + id.quote() + ");"); tb.setAttribute ("crop", "right"); tb.setAttribute ("class", "tab-bottom view-button"); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild (tb); } return tb; }
|
|
var browser = document.createElement ("browser"); browser.setAttribute ("class", "output-container"); browser.setAttribute ("type", "content"); browser.setAttribute ("flex", "1"); browser.setAttribute ("tooltip", "aHTMLTooltip"); browser.setAttribute ("context", "outputContext"); browser.setAttribute ("onclick", "focusInput()"); browser.setAttribute ("ondragover", "nsDragAndDrop.dragOver(event, contentDropObserver);"); browser.setAttribute ("ondragdrop", "nsDragAndDrop.drop(event, contentDropObserver);"); browser.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, contentAreaDNDObserver);"); browser.source = source; source.frame = browser; client.deck.appendChild (browser); syncOutputFrame (browser);
|
function getTabForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTabForObject **"); dd (getStackTrace()); return null; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTabForObject **"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute ("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute ("href", source.getURL()); tb.setAttribute ("name", source.name); tb.setAttribute ("onclick", "onTabClick(" + id.quote() + ");"); tb.setAttribute ("crop", "right"); tb.setAttribute ("class", "tab-bottom view-button"); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild (tb); } return tb; }
|
|
if (typeof startScrolling == "function") browser.setAttribute("onmousedown", "startScrolling(event);");
|
function getTabForObject (source, create){ var name; if (!ASSERT(source, "UNDEFINED passed to getTabForObject")) return null; if ("viewName" in source) { name = source.viewName; } else { ASSERT(0, "INVALID OBJECT passed to getTabForObject"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { if (!("messages" in source) || source.messages == null) createMessages(source); var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute("href", source.getURL()); tb.setAttribute("name", source.unicodeName); tb.setAttribute("onclick", "onTabClick(event, " + id.quote() + ");"); // This wouldn't be here if there was a supported CSS property for it. tb.setAttribute("crop", "center"); tb.setAttribute("context", "context:tab"); tb.setAttribute("tooltip", "xul-tooltip-node"); tb.setAttribute("class", "tab-bottom view-button"); tb.setAttribute("id", id); tb.setAttribute("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); tb.view = source; if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild(tb); var browser = document.createElement ("browser"); browser.setAttribute("class", "output-container"); // Only use type="chrome" if the host app supports it properly: if (client.hostCompat.typeChromeBrowser) browser.setAttribute("type", "chrome"); else browser.setAttribute("type", "content"); browser.setAttribute("flex", "1"); browser.setAttribute("tooltip", "html-tooltip-node"); browser.setAttribute("context", "context:messages"); //browser.setAttribute ("onload", "scrollDown(true);"); browser.setAttribute("onclick", "return onMessageViewClick(event)"); browser.setAttribute("ondragover", "nsDragAndDrop.dragOver(event, " + "contentDropObserver);"); browser.setAttribute("ondragdrop", "nsDragAndDrop.drop(event, contentDropObserver);"); browser.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, " + "contentAreaDNDObserver);"); if (typeof startScrolling == "function") browser.setAttribute("onmousedown", "startScrolling(event);"); browser.source = source; source.frame = browser; ASSERT(client.deck, "no deck?"); client.deck.appendChild (browser); syncOutputFrame (source); } return tb;}
|
|
tb.setAttribute("maxwidth", "250"); tb.setAttribute("flex", "1");
|
function getTabForObject (source, create){ var name; if (!ASSERT(source, "UNDEFINED passed to getTabForObject")) return null; if ("viewName" in source) { name = source.viewName; } else { ASSERT(0, "INVALID OBJECT passed to getTabForObject"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { if (!("messages" in source) || source.messages == null) createMessages(source); var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute("href", source.getURL()); tb.setAttribute("name", source.unicodeName); tb.setAttribute("onclick", "onTabClick(event, " + id.quote() + ");"); tb.setAttribute("maxwidth", "250"); tb.setAttribute("flex", "1"); tb.setAttribute("crop", "center"); tb.setAttribute("context", "context:tab"); tb.setAttribute("tooltip", "xul-tooltip-mode"); tb.setAttribute("class", "tab-bottom view-button"); tb.setAttribute("id", id); tb.setAttribute("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); tb.view = source; if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild(tb); var browser = document.createElement ("browser"); browser.setAttribute("class", "output-container"); browser.setAttribute("type", "content"); browser.setAttribute("flex", "1"); browser.setAttribute("tooltip", "html-tooltip-node"); browser.setAttribute("context", "context:messages"); //browser.setAttribute ("onload", "scrollDown(true);"); browser.setAttribute("onclick", "return onMessageViewClick(event)"); browser.setAttribute("ondragover", "nsDragAndDrop.dragOver(event, " + "contentDropObserver);"); browser.setAttribute("ondragdrop", "nsDragAndDrop.drop(event, contentDropObserver);"); browser.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, " + "contentAreaDNDObserver);"); browser.source = source; source.frame = browser; ASSERT(client.deck, "no deck?"); client.deck.appendChild (browser); syncOutputFrame (source); } return tb;}
|
|
tb.setAttribute("tooltip", "xul-tooltip-mode");
|
tb.setAttribute("tooltip", "xul-tooltip-node");
|
function getTabForObject (source, create){ var name; if (!ASSERT(source, "UNDEFINED passed to getTabForObject")) return null; if ("viewName" in source) { name = source.viewName; } else { ASSERT(0, "INVALID OBJECT passed to getTabForObject"); return null; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { if (!("messages" in source) || source.messages == null) createMessages(source); var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("tab"); tb.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, tabDNDObserver);"); tb.setAttribute("href", source.getURL()); tb.setAttribute("name", source.unicodeName); tb.setAttribute("onclick", "onTabClick(event, " + id.quote() + ");"); tb.setAttribute("maxwidth", "250"); tb.setAttribute("flex", "1"); tb.setAttribute("crop", "center"); tb.setAttribute("context", "context:tab"); tb.setAttribute("tooltip", "xul-tooltip-mode"); tb.setAttribute("class", "tab-bottom view-button"); tb.setAttribute("id", id); tb.setAttribute("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); tb.view = source; if (matches > 1) tb.setAttribute("label", name + "<" + matches + ">"); else tb.setAttribute("label", name); views.appendChild(tb); var browser = document.createElement ("browser"); browser.setAttribute("class", "output-container"); browser.setAttribute("type", "content"); browser.setAttribute("flex", "1"); browser.setAttribute("tooltip", "html-tooltip-node"); browser.setAttribute("context", "context:messages"); //browser.setAttribute ("onload", "scrollDown(true);"); browser.setAttribute("onclick", "return onMessageViewClick(event)"); browser.setAttribute("ondragover", "nsDragAndDrop.dragOver(event, " + "contentDropObserver);"); browser.setAttribute("ondragdrop", "nsDragAndDrop.drop(event, contentDropObserver);"); browser.setAttribute("ondraggesture", "nsDragAndDrop.startDrag(event, " + "contentAreaDNDObserver);"); browser.source = source; source.frame = browser; ASSERT(client.deck, "no deck?"); client.deck.appendChild (browser); syncOutputFrame (source); } return tb;}
|
if (aProperty.EqualsNode(this.kNC_child)) {
|
if (aProperty.EqualsNode(this.kNC_child) || aProperty.EqualsNode(this.kNC_recursiveChild)) { var listType = (aProperty.EqualsNode(this.kNC_child) ? "flat.messagelist.ldap" : "recursive.messagelist.ldap");
|
GetTarget: function(aSource, aProperty, aTruthValue) { if (DEBUG) { dump("GetTarget() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var delegate; var enumerator; if (aProperty.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { if (delegate.Count() == 1) { return delegate.QueryElementAt(0, Components.interfaces.nsIRDFNode); } } } else { var refStart = aProperty.Value.indexOf("#"); if ( aProperty.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aProperty.Value.slice(refStart + 1); enumerator = new ArrayEnumerator(this.getAttributeArray( delegate, attributeName)); if (enumerator.hasMoreElements()) { return enumerator.getNext(); } } } } Components.returnCode = NS_RDF_NO_VALUE; return null; },
|
delegate = aSource.GetDelegate("messagelist.ldap",
|
delegate = aSource.GetDelegate(listType,
|
GetTarget: function(aSource, aProperty, aTruthValue) { if (DEBUG) { dump("GetTarget() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var delegate; var enumerator; if (aProperty.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { if (delegate.Count() == 1) { return delegate.QueryElementAt(0, Components.interfaces.nsIRDFNode); } } } else { var refStart = aProperty.Value.indexOf("#"); if ( aProperty.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aProperty.Value.slice(refStart + 1); enumerator = new ArrayEnumerator(this.getAttributeArray( delegate, attributeName)); if (enumerator.hasMoreElements()) { return enumerator.getNext(); } } } } Components.returnCode = NS_RDF_NO_VALUE; return null; },
|
if (delegate.Count() == 1) { return delegate.QueryElementAt(0, Components.interfaces.nsIRDFNode);
|
try { var target = delegate.QueryElementAt(0, Components.interfaces.nsIRDFNode); return target; } catch (e) {
|
GetTarget: function(aSource, aProperty, aTruthValue) { if (DEBUG) { dump("GetTarget() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var delegate; var enumerator; if (aProperty.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { if (delegate.Count() == 1) { return delegate.QueryElementAt(0, Components.interfaces.nsIRDFNode); } } } else { var refStart = aProperty.Value.indexOf("#"); if ( aProperty.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aProperty.Value.slice(refStart + 1); enumerator = new ArrayEnumerator(this.getAttributeArray( delegate, attributeName)); if (enumerator.hasMoreElements()) { return enumerator.getNext(); } } } } Components.returnCode = NS_RDF_NO_VALUE; return null; },
|
return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase() + " file");
|
try { return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase() + " file"); } catch (e) { return gRDF.GetLiteral(typeInfo.MIMEType); }
|
GetTarget: function (aSource, aProperty, aTruthValue) { if (this._isRootTypeResource(aSource)) { var typeInfo = this.getMIMEInfo(aSource); if (typeInfo) { if (aProperty.EqualsNode(this._handleAutoArc)) { var handler = this.GetTarget(aSource, this._handlerPropArc, true); if (handler) { handler = handler.QueryInterface(Components.interfaces.nsIRDFResource); return gRDF.GetLiteral(!(this.getLiteralValue(handler.Value, "alwaysAsk") == "true")); } } else if (aProperty.EqualsNode(this._fileTypeArc)) { if (typeInfo.Description == "") { // XXXben LOCALIZE! return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase() + " file"); } return gRDF.GetLiteral(typeInfo.Description); } else if (aProperty.EqualsNode(this._fileHandlerArc)) { var handler = this.GetTarget(aSource, this._handlerPropArc, true); if (handler) { handler = handler.QueryInterface(Components.interfaces.nsIRDFResource); if (this.getLiteralValue(handler.Value, "saveToDisk") == "true") { // XXXben LOCALIZE! return gRDF.GetLiteral("Save to Disk"); } else if (this.getLiteralValue(handler.Value, "useSystemDefault") == "false") { var extApp = this.GetTarget(handler, this._externalAppArc, true); if (extApp) { extApp = extApp.QueryInterface(Components.interfaces.nsIRDFResource); // XXXben LOCALIZE! var name = "Open with " + this.getLiteralValue(extApp.Value, "prettyName"); return gRDF.GetLiteral(name); } } } // XXXben LOCALIZE! return gRDF.GetLiteral("Open with " + typeInfo.defaultDescription); } else if (aProperty.EqualsNode(this._fileIconArc)) return gRDF.GetLiteral("moz-icon://goat." + typeInfo.primaryExtension + "?size=16"); else if (aProperty.EqualsNode(this._fileExtensionArc)) return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase()); else if (aProperty.EqualsNode(this._fileExtensionsArc)) { var extns = typeInfo.getFileExtensions(); // Prevent duplicates. var hash = { }; while (extns.hasMore()) hash[extns.getNext().toUpperCase()] = 0; var str = ""; for (var extn in hash) str += extn + ","; str = str.substring(0, str.length - 1); return gRDF.GetLiteral(str); } } } return this._inner.GetTarget(aSource, aProperty, aTruthValue); },
|
else if (aProperty.EqualsNode(this._fileIconArc)) return gRDF.GetLiteral("moz-icon: else if (aProperty.EqualsNode(this._fileExtensionArc)) return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase());
|
else if (aProperty.EqualsNode(this._fileIconArc)) { try { return gRDF.GetLiteral("moz-icon: } catch (e) { return gRDF.GetLiteral("moz-icon: } } else if (aProperty.EqualsNode(this._fileExtensionArc)) { try { return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase()); } catch (e) { } return gRDF.GetLiteral(""); }
|
GetTarget: function (aSource, aProperty, aTruthValue) { if (this._isRootTypeResource(aSource)) { var typeInfo = this.getMIMEInfo(aSource); if (typeInfo) { if (aProperty.EqualsNode(this._handleAutoArc)) { var handler = this.GetTarget(aSource, this._handlerPropArc, true); if (handler) { handler = handler.QueryInterface(Components.interfaces.nsIRDFResource); return gRDF.GetLiteral(!(this.getLiteralValue(handler.Value, "alwaysAsk") == "true")); } } else if (aProperty.EqualsNode(this._fileTypeArc)) { if (typeInfo.Description == "") { // XXXben LOCALIZE! return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase() + " file"); } return gRDF.GetLiteral(typeInfo.Description); } else if (aProperty.EqualsNode(this._fileHandlerArc)) { var handler = this.GetTarget(aSource, this._handlerPropArc, true); if (handler) { handler = handler.QueryInterface(Components.interfaces.nsIRDFResource); if (this.getLiteralValue(handler.Value, "saveToDisk") == "true") { // XXXben LOCALIZE! return gRDF.GetLiteral("Save to Disk"); } else if (this.getLiteralValue(handler.Value, "useSystemDefault") == "false") { var extApp = this.GetTarget(handler, this._externalAppArc, true); if (extApp) { extApp = extApp.QueryInterface(Components.interfaces.nsIRDFResource); // XXXben LOCALIZE! var name = "Open with " + this.getLiteralValue(extApp.Value, "prettyName"); return gRDF.GetLiteral(name); } } } // XXXben LOCALIZE! return gRDF.GetLiteral("Open with " + typeInfo.defaultDescription); } else if (aProperty.EqualsNode(this._fileIconArc)) return gRDF.GetLiteral("moz-icon://goat." + typeInfo.primaryExtension + "?size=16"); else if (aProperty.EqualsNode(this._fileExtensionArc)) return gRDF.GetLiteral(typeInfo.primaryExtension.toUpperCase()); else if (aProperty.EqualsNode(this._fileExtensionsArc)) { var extns = typeInfo.getFileExtensions(); // Prevent duplicates. var hash = { }; while (extns.hasMore()) hash[extns.getNext().toUpperCase()] = 0; var str = ""; for (var extn in hash) str += extn + ","; str = str.substring(0, str.length - 1); return gRDF.GetLiteral(str); } } } return this._inner.GetTarget(aSource, aProperty, aTruthValue); },
|
function generateBoundCallback() {
|
function generateGetTargetsBoundCallback() {
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
boundCallback.prototype.onLDAPMessage = function() {
|
function getTargetsBoundCallback() {}
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
getTargetsBoundCallback.prototype.onLDAPMessage =
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
|
if (DEBUG) { dump("in the closure\n");
|
function(aMessage, aRetVal) {
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n");
|
if (DEBUG) { dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n"); dump("\taRetVal = " + aRetVal + "\n\n"); } if (aRetVal != LDAP_RES_BIND) { dump("bind failed\n"); } var searchOp = Components.classes[ "mozilla.network.ldapoperation"]. createInstance(Components.interfaces. nsILDAPOperation); searchOp.init(connection, generateGetTargetsSearchCallback()); searchOp.searchExt(url.dn, url.scope, url.filter, 0, -1);
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
}
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
|
cb = new boundCallback();
|
return new getTargetsBoundCallback(); }
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
return cb;
|
function generateGetTargetsSearchCallback() { function getTargetsSearchCallback() {} getTargetsSearchCallback.prototype.onLDAPMessage = function(aMessage, aRetVal ) { dump("getTargetsSearchCallback() called with aRetVal=" + aRetVal + "\n\n"); } return new getTargetsSearchCallback();
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
this.getConnection(url.host, url.port, generateBoundCallback());
|
var operation = Components.classes["mozilla.network.ldapoperation"]. createInstance(Components.interfaces. nsILDAPOperation); operation.init(connection, generateGetTargetsBoundCallback()); operation.simpleBind(null);
|
GetTargets: function(aSource, aProperty, aTruthValue) { function generateBoundCallback() { boundCallback.prototype.onLDAPMessage = function() { // netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (DEBUG) { dump("in the closure\n"); dump("boundCallback() called with scope: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } } cb = new boundCallback(); return cb; } if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var url = Components.classes["mozilla.network.ldapurl"] .getService(Components.interfaces.nsILDAPURL); url.spec = aSource.Value; this.getConnection(url.host, url.port, generateBoundCallback()); return new ArrayEnumerator(new Array()); },
|
if (aProperty.EqualsNode(this.kNC_child)) {
|
if (aProperty.EqualsNode(this.kNC_child) || aProperty.EqualsNode(this.kNC_recursiveChild)) { var listType = (aProperty.EqualsNode(this.kNC_child) ? "flat.messagelist.ldap" : "recursive.messagelist.ldap");
|
GetTargets: function(aSource, aProperty, aTruthValue) { if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var delegate; if (aProperty.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return new nsISupportsArrayEnumerator(delegate); } } else { var refStart = aProperty.Value.indexOf("#"); if ( aProperty.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aProperty.Value.slice(refStart + 1); return new ArrayEnumerator( this.getAttributeArray(delegate, attributeName)); } } } return new ArrayEnumerator(new Array()); },
|
delegate = aSource.GetDelegate("messagelist.ldap",
|
delegate = aSource.GetDelegate(listType,
|
GetTargets: function(aSource, aProperty, aTruthValue) { if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var delegate; if (aProperty.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return new nsISupportsArrayEnumerator(delegate); } } else { var refStart = aProperty.Value.indexOf("#"); if ( aProperty.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aProperty.Value.slice(refStart + 1); return new ArrayEnumerator( this.getAttributeArray(delegate, attributeName)); } } } return new ArrayEnumerator(new Array()); },
|
} else {
|
} else if (aProperty.EqualsNode(this.kNC_DN)) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { return this.mRdfSvc.GetResource(delegate.dn); } } else {
|
GetTargets: function(aSource, aProperty, aTruthValue) { if (DEBUG) { dump("GetTargets() called with args: \n\t" + aSource.Value + "\n\t" + aProperty.Value + "\n\t" + aTruthValue + "\n\n"); } var delegate; if (aProperty.EqualsNode(this.kNC_child)) { try { delegate = aSource.GetDelegate("messagelist.ldap", Components.interfaces.nsISupportsArray); } catch (e) { } if (delegate != null) { return new nsISupportsArrayEnumerator(delegate); } } else { var refStart = aProperty.Value.indexOf("#"); if ( aProperty.Value.slice(0, refStart + 1) == LDAPATTR_NAMESPACE_URI) { try { delegate = aSource.GetDelegate("message.ldap", Components.interfaces.nsILDAPMessage); } catch (e) { } if (delegate != null) { var attributeName = aProperty.Value.slice(refStart + 1); return new ArrayEnumerator( this.getAttributeArray(delegate, attributeName)); } } } return new ArrayEnumerator(new Array()); },
|
tb.addEventListener("click", onTBIClickTempHandler, false);
|
tb.setAttribute ("onclick", "onTBIClick('" + id + "');");
|
function getTBForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTBForObject **"); dd (getStackTrace()); return; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTBForObject **"); return; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("menubutton"); tb.addEventListener("click", onTBIClickTempHandler, false); var aclass = (client.ICONS_IN_TOOLBAR) ? "activity-button-image" : "activity-button-text"; tb.setAttribute ("class", "menubutton " + aclass); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute ("value", name + "<" + matches + ">"); else tb.setAttribute ("value", name); views.appendChild (tb); } return tb; }
|
tb.setAttribute ("class", "menubutton-dual"); tb.setAttribute ("id", id);
|
function getTBForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTBForObject **"); dd (getStackTrace()); return; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTBForObject **"); return; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) tb = client.viewsArray[i].tb; else if (client.viewsArray[i].tb.id == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); //var tbi = document.createElement ("toolbaritem"); //tbi.setAttribute ("onclick", "onTBIClick('" + id + "')"); tb = document.createElement ("menubutton"); tb.addEventListener("click", onTBIClickTempHandler, false); tb.setAttribute ("class", "menubutton-dual"); tb.setAttribute ("id", id); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute ("value", name + "<" + matches + ">"); else tb.setAttribute ("value", name); //tbi.appendChild (tb); views.appendChild (tb); } return tb; }
|
|
return;
|
return null;
|
function getTBForObject (source, create){ var name; if (!source) { dd ("** UNDEFINED passed to getTBForObject **"); dd (getStackTrace()); return; } create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTBForObject **"); return; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) { if (client.viewsArray[i].source == source) { tb = client.viewsArray[i].tb; break; } else if (client.viewsArray[i].tb.getAttribute("id") == id) id = "tb[" + name + "<" + (++matches) + ">]"; } if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar-inner"); tb = document.createElement ("menubutton"); tb.setAttribute ("onclick", "onTBIClick('" + id + "');"); //tb.addEventListener("command", onTBIClickTempHandler, false); var aclass = (client.ICONS_IN_TOOLBAR) ? "activity-button-image" : "activity-button-text"; tb.setAttribute ("class", "menubutton " + aclass); tb.setAttribute ("id", id); tb.setAttribute ("state", "normal"); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute ("value", name + "<" + matches + ">"); else tb.setAttribute ("value", name); views.appendChild (tb); } return tb; }
|
if (!source) { dd ("** UNDEFINED passed to getTBForObject **"); dd (getStackTrace()); return; }
|
function getTBForObject (source, create){ var name; create = (typeof create != "undefined") ? Boolean(create) : false; switch (source.TYPE) { case "IRCChanUser": case "IRCUser": name = source.nick; break; case "IRCNetwork": case "IRCChannel": case "IRCClient": name = source.name; break; default: dd ("** INVALID OBJECT passed to getTBForObject **"); return; } var tb, id = "tb[" + name + "]"; var matches = 1; for (var i in client.viewsArray) if (client.viewsArray[i].source == source) tb = client.viewsArray[i].tb; else if (client.viewsArray[i].tb.id == id) id = "tb[" + name + "<" + (++matches) + ">]"; if (!tb && create) /* not found, create one */ { var views = document.getElementById ("views-tbar"); var tbi = document.createElement ("toolbaritem"); tbi.setAttribute ("onclick", "onTBIClick('" + id + "')"); tb = document.createElement ("titledbutton"); tb.setAttribute ("class", "activity-button"); tb.setAttribute ("id", id); client.viewsArray.push ({source: source, tb: tb}); tb.setAttribute ("viewKey", client.viewsArray.length - 1); if (matches > 1) tb.setAttribute ("value", name + "<" + matches + ">"); else tb.setAttribute ("value", name); tbi.appendChild (tb); views.appendChild (tbi); } return tb; }
|
|
return [PROT_GlobalStore.getPref_("safebrowsing.provider.0.testURL")];
|
return [PROT_GlobalStore.getPref_("browser.safebrowsing.provider.0.testURL")];
|
PROT_GlobalStore.getTestURLs = function() { // TODO: return all test urls return [PROT_GlobalStore.getPref_("safebrowsing.provider.0.testURL")];}
|
return item.firstChild.firstChild.getAttribute("value");
|
return item.firstChild.firstChild.getAttribute("label");
|
function GetTreelistValueAt(tree, index){ if (tree) { var item = tree.getItemAtIndex(index); if (item && item.firstChild && item.firstChild.firstChild) return item.firstChild.firstChild.getAttribute("value"); } return "";}
|
return gPrefs.CopyUnicharPref(aPrefName);
|
return gPrefs.getComplexValue(aPrefName, Components.interfaces.nsISupportsWString);
|
function getUnicharPref(aPrefName, aDefVal){ if (!gPrefs) return ""; try { return gPrefs.CopyUnicharPref(aPrefName); } catch(e) { } return "";}
|
return PROT_GlobalStore.getPref_("safebrowsing.provider.0.updateURL");
|
return PROT_GlobalStore.getPref_("browser.safebrowsing.provider.0.updateURL");
|
PROT_GlobalStore.getUpdateserverURL = function() { return PROT_GlobalStore.getPref_("safebrowsing.provider.0.updateURL");}
|
cx.nicknameList = new Array();
|
function getUserlistContext(cx){ if (!cx) cx = new Object(); cx.__proto__ = getObjectDetails(client.currentObject); if (!cx.channel) return cx; cx.userList = new Array(); cx.nicknameList = new Array(); cx.canonNickList = new Array(); var tree = document.getElementById("user-list"); var rangeCount = tree.view.selection.getRangeCount(); for (var i = 0; i < rangeCount; ++i) { var start = {}, end = {}; tree.view.selection.getRangeAt(i, start, end); // If they == -1, we've got no selection, so bail. if ((start.value == -1) && (end.value == -1)) return cx; for (var k = start.value; k <= end.value; ++k) { var item = tree.contentView.getItemAtIndex(k); var cell = item.firstChild.firstChild; var user = cx.channel.getUser(cell.getAttribute("unicodeName")); if (user) { cx.userList.push(user); cx.nicknameList.push(user.unicodeName); cx.canonNickList.push(user.canonicalName); if (i == 0 && k == start.value) { cx.user = user; cx.nickname = user.unicodeName; cx.canonNick = user.canonicalName; } } } } return cx;}
|
|
var tree = document.getElementById("user-list"); var rangeCount = tree.view.selection.getRangeCount(); for (var i = 0; i < rangeCount; ++i)
|
for (var i = 0; i < cx.nicknameList.length; ++i)
|
function getUserlistContext(cx){ if (!cx) cx = new Object(); cx.__proto__ = getObjectDetails(client.currentObject); if (!cx.channel) return cx; cx.userList = new Array(); cx.nicknameList = new Array(); cx.canonNickList = new Array(); var tree = document.getElementById("user-list"); var rangeCount = tree.view.selection.getRangeCount(); for (var i = 0; i < rangeCount; ++i) { var start = {}, end = {}; tree.view.selection.getRangeAt(i, start, end); // If they == -1, we've got no selection, so bail. if ((start.value == -1) && (end.value == -1)) return cx; for (var k = start.value; k <= end.value; ++k) { var item = tree.contentView.getItemAtIndex(k); var cell = item.firstChild.firstChild; var user = cx.channel.getUser(cell.getAttribute("unicodeName")); if (user) { cx.userList.push(user); cx.nicknameList.push(user.unicodeName); cx.canonNickList.push(user.canonicalName); if (i == 0 && k == start.value) { cx.user = user; cx.nickname = user.unicodeName; cx.canonNick = user.canonicalName; } } } } return cx;}
|
var start = {}, end = {}; tree.view.selection.getRangeAt(i, start, end); if ((start.value == -1) && (end.value == -1)) return cx; for (var k = start.value; k <= end.value; ++k)
|
user = cx.channel.getUser(cx.nicknameList[i]) cx.userList.push(user); cx.canonNickList.push(user.canonicalName); if (i == 0)
|
function getUserlistContext(cx){ if (!cx) cx = new Object(); cx.__proto__ = getObjectDetails(client.currentObject); if (!cx.channel) return cx; cx.userList = new Array(); cx.nicknameList = new Array(); cx.canonNickList = new Array(); var tree = document.getElementById("user-list"); var rangeCount = tree.view.selection.getRangeCount(); for (var i = 0; i < rangeCount; ++i) { var start = {}, end = {}; tree.view.selection.getRangeAt(i, start, end); // If they == -1, we've got no selection, so bail. if ((start.value == -1) && (end.value == -1)) return cx; for (var k = start.value; k <= end.value; ++k) { var item = tree.contentView.getItemAtIndex(k); var cell = item.firstChild.firstChild; var user = cx.channel.getUser(cell.getAttribute("unicodeName")); if (user) { cx.userList.push(user); cx.nicknameList.push(user.unicodeName); cx.canonNickList.push(user.canonicalName); if (i == 0 && k == start.value) { cx.user = user; cx.nickname = user.unicodeName; cx.canonNick = user.canonicalName; } } } } return cx;}
|
var item = tree.contentView.getItemAtIndex(k); var cell = item.firstChild.firstChild; var user = cx.channel.getUser(cell.getAttribute("unicodeName")); if (user) { cx.userList.push(user); cx.nicknameList.push(user.unicodeName); cx.canonNickList.push(user.canonicalName); if (i == 0 && k == start.value) { cx.user = user; cx.nickname = user.unicodeName; cx.canonNick = user.canonicalName; } }
|
cx.user = user; cx.nickname = user.unicodeName; cx.canonNick = user.canonicalName;
|
function getUserlistContext(cx){ if (!cx) cx = new Object(); cx.__proto__ = getObjectDetails(client.currentObject); if (!cx.channel) return cx; cx.userList = new Array(); cx.nicknameList = new Array(); cx.canonNickList = new Array(); var tree = document.getElementById("user-list"); var rangeCount = tree.view.selection.getRangeCount(); for (var i = 0; i < rangeCount; ++i) { var start = {}, end = {}; tree.view.selection.getRangeAt(i, start, end); // If they == -1, we've got no selection, so bail. if ((start.value == -1) && (end.value == -1)) return cx; for (var k = start.value; k <= end.value; ++k) { var item = tree.contentView.getItemAtIndex(k); var cell = item.firstChild.firstChild; var user = cx.channel.getUser(cell.getAttribute("unicodeName")); if (user) { cx.userList.push(user); cx.nicknameList.push(user.unicodeName); cx.canonNickList.push(user.canonicalName); if (i == 0 && k == start.value) { cx.user = user; cx.nickname = user.unicodeName; cx.canonNick = user.canonicalName; } } } } return cx;}
|
function GetUsername(url)
|
function GetUsername(urlspec)
|
function GetUsername(url){ if (!url) return ""; var IOService = GetIOService(); if (!IOService) return ""; var username = ""; try { username = IOService.extractUrlPart(url, IOService.url_Username); } catch (e) {} return username;}
|
username = IOService.extractUrlPart(url, IOService.url_Username);
|
username = IOService.newURI(urlspec, null, null).username;
|
function GetUsername(url){ if (!url) return ""; var IOService = GetIOService(); if (!IOService) return ""; var username = ""; try { username = IOService.extractUrlPart(url, IOService.url_Username); } catch (e) {} return username;}
|
username = IOService.extractUrlPart(url, IOService.url_Username, {start:0}, {end:0});
|
username = IOService.extractUrlPart(url, IOService.url_Username);
|
function GetUsername(url){ if (!url) return ""; var IOService = GetIOService(); if (!IOService) return ""; var username = ""; try { username = IOService.extractUrlPart(url, IOService.url_Username, {start:0}, {end:0}); } catch (e) {} return username;}
|
["collapseActions", defer, "appearance.misc"],
|
function getUserPrefManager(user){ var network = user.parent.parent; function defer(prefName) { return network.prefs[prefName]; }; function makeLogNameUser() { return makeLogName(user, "user"); }; function onPrefChanged(prefName, newValue, oldValue) { onUserPrefChanged (user, prefName, newValue, oldValue); }; var logDefault = client.prefManager.logPath.clone(); var filename = pref_mungeName(network.encodedName); filename += "," + pref_mungeName(user.encodedName); logDefault.append(escapeFileName(filename) + ".log"); var prefs = [ ["charset", defer, ".connect"], ["collapseMsgs", defer, "appearance.misc"], ["displayHeader", client.prefs["userHeader"], "appearance.misc"], ["font.family", defer, "appearance.misc"], ["font.size", defer, "appearance.misc"], ["hasPrefs", false, "hidden"], ["motif.current", defer, "appearance.motif"], ["outputWindowURL", defer, "appearance.misc"], ["log", client.prefs["userLog"], ".log"], ["logFileName", makeLogNameUser, ".log"], ["timestamps", defer, "appearance.timestamps"], ["timestampFormat", defer, "appearance.timestamps"] ]; var branch = "extensions.irc.networks." + pref_mungeName(network.encodedName) + ".users." + pref_mungeName(user.encodedName) + "."; var prefManager = new PrefManager(branch, client.defaultBundle); prefManager.addPrefs(prefs); prefManager.addObserver({ onPrefChanged: onPrefChanged }); network.prefManager.addObserver(prefManager); client.prefManagers.push(prefManager); return prefManager;}
|
|
["charset", defer], ["collapseMsgs", defer], ["displayHeader", client.prefs["userHeader"]], ["font.family", defer], ["font.size", defer], ["motif.current", defer], ["outputWindowURL", defer], ["log", client.prefs["userLog"]], ["logFileName", logDefault.path], ["timestamps", defer], ["timestampFormat", defer]
|
["charset", defer, ".connect"], ["collapseMsgs", defer, "appearance.misc"], ["displayHeader", client.prefs["userHeader"], "appearance.misc"], ["font.family", defer, "appearance.misc"], ["font.size", defer, "appearance.misc"], ["hasPrefs", false, "hidden"], ["motif.current", defer, "appearance.motif"], ["outputWindowURL", defer, "appearance.misc"], ["log", client.prefs["userLog"], ".log"], ["logFileName", logDefault.path, ".log"], ["timestamps", defer, "appearance.timestamps"], ["timestampFormat", defer, "appearance.timestamps"]
|
function getUserPrefManager(user){ var network = user.parent.parent; function defer(prefName) { return network.prefs[prefName]; }; function onPrefChanged(prefName, newValue, oldValue) { onUserPrefChanged (user, prefName, newValue, oldValue); }; var logDefault = client.prefManager.logPath.clone(); var filename = pref_mungeName(network.name); filename += "," + pref_mungeName(user.nick); logDefault.append(escapeFileName(filename) + ".log"); var prefs = [ ["charset", defer], ["collapseMsgs", defer], ["displayHeader", client.prefs["userHeader"]], ["font.family", defer], ["font.size", defer], ["motif.current", defer], ["outputWindowURL", defer], ["log", client.prefs["userLog"]], ["logFileName", logDefault.path], ["timestamps", defer], ["timestampFormat", defer] ]; var branch = "extensions.irc.networks." + pref_mungeName(network.name) + ".users." + pref_mungeName(user.nick) + "."; var prefManager = new PrefManager(branch, client.defaultBundle); prefManager.addPrefs(prefs); prefManager.onPrefChanged = onPrefChanged; client.prefManagers.push(prefManager); return prefManager;}
|
var account = getAccountFromServerId(serverId); accountArray[serverId] = createAccountValues(account);
|
accountArray[serverId] = new Array;
|
function getValueArrayFor(serverId) { if (accountArray[serverId] == null) { var account = getAccountFromServerId(serverId); accountArray[serverId] = createAccountValues(account); } return accountArray[serverId];}
|
return aResource ? target.Value : null;
|
return aResource ? aResource.Value : null;
|
getValueFromResource: function(aResource) { aResource = aResource.QueryInterface(Components.interfaces.nsIRDFResource); return aResource ? target.Value : null; }
|
return( "First" );
|
return( firstLabel );
|
function getWeekNumberText( weekNumber ){ switch( weekNumber ) { case 1: return( "First" ); case 2: return( "Second" ); case 3: return( "Third" ); case 4: return( "Fourth" ); case 5: return( "Last" ); default: return( false ); }}
|
return( "Second" );
|
return( secondLabel );
|
function getWeekNumberText( weekNumber ){ switch( weekNumber ) { case 1: return( "First" ); case 2: return( "Second" ); case 3: return( "Third" ); case 4: return( "Fourth" ); case 5: return( "Last" ); default: return( false ); }}
|
return( "Third" );
|
return( thirdLabel );
|
function getWeekNumberText( weekNumber ){ switch( weekNumber ) { case 1: return( "First" ); case 2: return( "Second" ); case 3: return( "Third" ); case 4: return( "Fourth" ); case 5: return( "Last" ); default: return( false ); }}
|
return( "Fourth" );
|
return( fourthLabel );
|
function getWeekNumberText( weekNumber ){ switch( weekNumber ) { case 1: return( "First" ); case 2: return( "Second" ); case 3: return( "Third" ); case 4: return( "Fourth" ); case 5: return( "Last" ); default: return( false ); }}
|
return( "Last" );
|
return( lastLabel );
|
function getWeekNumberText( weekNumber ){ switch( weekNumber ) { case 1: return( "First" ); case 2: return( "Second" ); case 3: return( "Third" ); case 4: return( "Fourth" ); case 5: return( "Last" ); default: return( false ); }}
|
startWeekDay = prefBranch.getIntPref("calendar.week.start");
|
startWeekday = prefBranch.getIntPref("calendar.week.start");
|
function getWeekTitle(aDateTime) { /** * This implementation is based on the ISO 8601 standard. * ISO 8601 defines week one as the first week with at least 4 * days, and defines Monday as the first day of the week. * Equivalently, the week one is the week with the first Thursday. * * This implementation uses the second definition, because it * enables the user to set a different start-day of the week * (Sunday instead of Monday is a common setting). If the first * definition was used, all week-numbers could be off by one * depending on the week start day. (For example, if weeks start * on Sunday, a year that starts on Thursday has only 3 days * [Thu-Sat] in that week, so it would be part of the last week of * the previous year, but if weeks start on Monday, the year would * have four days [Thu-Sun] in that week, so it would be counted * as week 1.) */ // The week number is the number of days since the start of week // one, divided by 7, plus 1 (so the first week is W1, not W0). // Week one is the week containing the first Thursday. // Thus, the week number of any day is the same as the number of days // between the thursday of that week and the thursday of week one, // divided by 7, plus 1. (This takes care of days at end/start of // year which may be part of last/first week in other year.) // The Thursday of a week is the Thursday that follows the first day // of the week. // // The week number of a day is the same as the week number of // the first day of the week. (This takes care of days near the // start of the year, which may be part of the week counted in // the previous year.) So we need the start weekDay. const SUNDAY = 0; var startWeekday = SUNDAY; // default to monday per ISO8601 standard. try { var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); startWeekDay = prefBranch.getIntPref("calendar.week.start"); } catch (e) {} // The number of days since the start of the week. // Notice that the result of the substraction might be negative. // We correct for that by adding 7, and then using the remainder operator. var sinceStartOfWeek = (aDateTime.weekday - startWeekday + 7) % 7; // The number of days to thursday is the difference between Thursday // and the start day of the week (again corrected for negative values) const THURSDAY = 4; var startToThursday = (THURSDAY - startWeekday + 7) % 7; // The yearday number of the thursday this week var thisWeeksThursday = aDateTime.yearday - sinceStartOfWeek + startToThursday; // For the first few days of the year, we might still be in week 52. if (thisWeeksThursday < 0) thisWeeksThursday += 52*7; var weekNumber = Math.floor(thisWeeksThursday/7)+1; return weekNumber;};
|
if (thisWeeksThursday < 0) thisWeeksThursday += 52*7;
|
if (thisWeeksThursday < 1) { var lastYearDate = aDateTime.clone(); lastYearDate.year -= 1; thisWeeksThursday += lastYearDate.endOfYear.yearday; }
|
function getWeekTitle(aDateTime) { /** * This implementation is based on the ISO 8601 standard. * ISO 8601 defines week one as the first week with at least 4 * days, and defines Monday as the first day of the week. * Equivalently, the week one is the week with the first Thursday. * * This implementation uses the second definition, because it * enables the user to set a different start-day of the week * (Sunday instead of Monday is a common setting). If the first * definition was used, all week-numbers could be off by one * depending on the week start day. (For example, if weeks start * on Sunday, a year that starts on Thursday has only 3 days * [Thu-Sat] in that week, so it would be part of the last week of * the previous year, but if weeks start on Monday, the year would * have four days [Thu-Sun] in that week, so it would be counted * as week 1.) */ // The week number is the number of days since the start of week // one, divided by 7, plus 1 (so the first week is W1, not W0). // Week one is the week containing the first Thursday. // Thus, the week number of any day is the same as the number of days // between the thursday of that week and the thursday of week one, // divided by 7, plus 1. (This takes care of days at end/start of // year which may be part of last/first week in other year.) // The Thursday of a week is the Thursday that follows the first day // of the week. // // The week number of a day is the same as the week number of // the first day of the week. (This takes care of days near the // start of the year, which may be part of the week counted in // the previous year.) So we need the start weekDay. const SUNDAY = 0; var startWeekday = SUNDAY; // default to monday per ISO8601 standard. try { var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); startWeekDay = prefBranch.getIntPref("calendar.week.start"); } catch (e) {} // The number of days since the start of the week. // Notice that the result of the substraction might be negative. // We correct for that by adding 7, and then using the remainder operator. var sinceStartOfWeek = (aDateTime.weekday - startWeekday + 7) % 7; // The number of days to thursday is the difference between Thursday // and the start day of the week (again corrected for negative values) const THURSDAY = 4; var startToThursday = (THURSDAY - startWeekday + 7) % 7; // The yearday number of the thursday this week var thisWeeksThursday = aDateTime.yearday - sinceStartOfWeek + startToThursday; // For the first few days of the year, we might still be in week 52. if (thisWeeksThursday < 0) thisWeeksThursday += 52*7; var weekNumber = Math.floor(thisWeeksThursday/7)+1; return weekNumber;};
|
var weekNumber = Math.floor(thisWeeksThursday/7)+1;
|
if (thisWeeksThursday > aDateTime.endOfYear.yearday) thisWeeksThursday -= aDateTime.endOfYear.yearday; var weekNumber = Math.ceil(thisWeeksThursday/7);
|
function getWeekTitle(aDateTime) { /** * This implementation is based on the ISO 8601 standard. * ISO 8601 defines week one as the first week with at least 4 * days, and defines Monday as the first day of the week. * Equivalently, the week one is the week with the first Thursday. * * This implementation uses the second definition, because it * enables the user to set a different start-day of the week * (Sunday instead of Monday is a common setting). If the first * definition was used, all week-numbers could be off by one * depending on the week start day. (For example, if weeks start * on Sunday, a year that starts on Thursday has only 3 days * [Thu-Sat] in that week, so it would be part of the last week of * the previous year, but if weeks start on Monday, the year would * have four days [Thu-Sun] in that week, so it would be counted * as week 1.) */ // The week number is the number of days since the start of week // one, divided by 7, plus 1 (so the first week is W1, not W0). // Week one is the week containing the first Thursday. // Thus, the week number of any day is the same as the number of days // between the thursday of that week and the thursday of week one, // divided by 7, plus 1. (This takes care of days at end/start of // year which may be part of last/first week in other year.) // The Thursday of a week is the Thursday that follows the first day // of the week. // // The week number of a day is the same as the week number of // the first day of the week. (This takes care of days near the // start of the year, which may be part of the week counted in // the previous year.) So we need the start weekDay. const SUNDAY = 0; var startWeekday = SUNDAY; // default to monday per ISO8601 standard. try { var prefBranch = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); startWeekDay = prefBranch.getIntPref("calendar.week.start"); } catch (e) {} // The number of days since the start of the week. // Notice that the result of the substraction might be negative. // We correct for that by adding 7, and then using the remainder operator. var sinceStartOfWeek = (aDateTime.weekday - startWeekday + 7) % 7; // The number of days to thursday is the difference between Thursday // and the start day of the week (again corrected for negative values) const THURSDAY = 4; var startToThursday = (THURSDAY - startWeekday + 7) % 7; // The yearday number of the thursday this week var thisWeeksThursday = aDateTime.yearday - sinceStartOfWeek + startToThursday; // For the first few days of the year, we might still be in week 52. if (thisWeeksThursday < 0) thisWeeksThursday += 52*7; var weekNumber = Math.floor(thisWeeksThursday/7)+1; return weekNumber;};
|
"@mozilla.org/rdf/datasource;1?name=window-mediator";
|
"@mozilla.org/appshell/window-mediator;1";
|
function getWindowByType (windowType){ const MEDIATOR_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const nsIWindowMediator = Components.interfaces.nsIWindowMediator; var windowManager = Components.classes[MEDIATOR_CONTRACTID].getService(nsIWindowMediator); return windowManager.getMostRecentWindow(windowType);}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.