rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
if (!iid.equals(Components.interfaces.nsIXPIDialogService) && !iid.equals(Components.interfaces.nsIXPIProgressDialog) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this;
if (iid.equals(Components.interfaces.nsIXPIDialogService) || iid.equals(Components.interfaces.nsIXPIProgressDialog) || iid.equals(Components.interfaces.nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function( iid ) { if (!iid.equals(Components.interfaces.nsIXPIDialogService) && !iid.equals(Components.interfaces.nsIXPIProgressDialog) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; },
throw Components.results.NS_NOINTERFACE;
QueryInterface: function(iid) { if (iid.equals(Components.interfaces.nsIURIContentListener) || iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; },
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function(iid) { if (iid.equals(Components.interfaces.nsIURIContentListener) || iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; },
if (!iid.equals(nsIFilePicker) && !iid.equals(nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this;
if (iid.equals(nsIFilePicker) || iid.equals(nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function(iid) { if (!iid.equals(nsIFilePicker) && !iid.equals(nsISupports)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; },
if (!iid.equals(Components.interfaces.nsIHelperAppLauncherDialog) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this;
if (iid.equals(Components.interfaces.nsIHelperAppLauncherDialog) || iid.equals(Components.interfaces.nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsIHelperAppLauncherDialog) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; },
if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIRDFDelegateFactory)) throw Components.results.NS_ERROR_NO_INTERFACE;
if (iid.equals(Components.interfaces.nsISupports) || iid.equals(Components.interfaces.nsIRDFDelegateFactory)) return this;
QueryInterface: function(iid) { if (DEBUG) { dump("QueryInterface called\n\n"); } if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIRDFDelegateFactory)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; },
return this;
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function(iid) { if (DEBUG) { dump("QueryInterface called\n\n"); } if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsIRDFDelegateFactory)) throw Components.results.NS_ERROR_NO_INTERFACE; return this; },
&& !aIID.equals(Ci.nsISupportsWeakReference)
QueryInterface: function(aIID) { if (!aIID.equals(Ci.nsISupports) && !aIID.equals(Ci.nsIObserver) && !aIID.equals(Ci.nsISessionStore)) { Components.returnCode = Cr.NS_ERROR_NO_INTERFACE; return null; } return this; }
if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsISupportsWeakReference) && !iid.equals(Components.interfaces.nsIDOMEventListener)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this;
if (iid.equals(Components.interfaces.nsISupports) || iid.equals(Components.interfaces.nsISupportsWeakReference) || iid.equals(Components.interfaces.nsIDOMEventListener)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsISupports) && !iid.equals(Components.interfaces.nsISupportsWeakReference) && !iid.equals(Components.interfaces.nsIDOMEventListener)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; },
if (!iid.equals(Components.interfaces.nsISample) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this;
if (iid.equals(Components.interfaces.nsISample) || iid.equals(Components.interfaces.nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsISample) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; },
throw Components.results.NS_NOINTERFACE;
Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function(aIID) { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); if (aIID.equals(Components.interfaces.nsISHistoryListener) || aIID.equals(Components.interfaces.nsISupportsWeakReference) || aIID.equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_NOINTERFACE; },
if (iid.Equals(Components.interfaces.nsIProtocolProxyFilter) || iid.Equals(Components.interfaces.nsISupports))
if (iid.equals(Components.interfaces.nsIProtocolProxyFilter) || iid.equals(Components.interfaces.nsISupports))
QueryInterface: function(iid) { if (iid.Equals(Components.interfaces.nsIProtocolProxyFilter) || iid.Equals(Components.interfaces.nsISupports)) return this; throw Components.results.NS_ERROR_NO_INTERFACE; },
if (!iid.equals(Components.interfaces.nsIProgressDialog) && !iid.equals(Components.interfaces.nsIDownload) && !iid.equals(Components.interfaces.nsITransfer) && !iid.equals(Components.interfaces.nsIWebProgressListener) && !iid.equals(Components.interfaces.nsIObserver) && !iid.equals(Components.interfaces.nsIInterfaceRequestor) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this;
if (iid.equals(Components.interfaces.nsIProgressDialog) || iid.equals(Components.interfaces.nsIDownload) || iid.equals(Components.interfaces.nsITransfer) || iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsIObserver) || iid.equals(Components.interfaces.nsIInterfaceRequestor) || iid.equals(Components.interfaces.nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsIProgressDialog) && !iid.equals(Components.interfaces.nsIDownload) && !iid.equals(Components.interfaces.nsITransfer) && !iid.equals(Components.interfaces.nsIWebProgressListener) && !iid.equals(Components.interfaces.nsIObserver) && !iid.equals(Components.interfaces.nsIInterfaceRequestor) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; },
if (!aIID.equals(Components.interfaces.nsISupports) && !aIID.equals(Components.interfaces.calIItemBase) && !aIID.equals(Components.interfaces.calIEvent)) { throw Components.results.NS_ERROR_NO_INTERFACE; }
if (aIID.equals(Components.interfaces.calIEvent)) return this;
QueryInterface: function (aIID) { if (!aIID.equals(Components.interfaces.nsISupports) && !aIID.equals(Components.interfaces.calIItemBase) && !aIID.equals(Components.interfaces.calIEvent)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; },
return this;
return this.__proto__.QueryInterface(aIID);
QueryInterface: function (aIID) { if (!aIID.equals(Components.interfaces.nsISupports) && !aIID.equals(Components.interfaces.calIItemBase) && !aIID.equals(Components.interfaces.calIEvent)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; },
if (!iid.equals(Components.interfaces.nsIInterfaceInfoToIDL) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this;
if (iid.equals(Components.interfaces.nsIInterfaceInfoToIDL) || iid.equals(Components.interfaces.nsISupports)) return this; Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; return null;
QueryInterface: function (iid) { if (!iid.equals(Components.interfaces.nsIInterfaceInfoToIDL) && !iid.equals(Components.interfaces.nsISupports)) { throw Components.results.NS_ERROR_NO_INTERFACE; } return this; }
result[i] = supportsArray.GetElementAt(i).QueryInterface(iid);
result[i] = supportsArray.QueryElementAt(i, iid);
function queryISupportsArray(supportsArray, iid) { var result = new Array; for (var i=0; i<supportsArray.Count(); i++) { // dump(i + "," + result[i] + "\n"); result[i] = supportsArray.GetElementAt(i).QueryInterface(iid); } return result;}
jQuery.prototype.queue = function(type,fn){ if ( !fn ) { fn = type; type = "fx";
queue: function(type,fn){ if ( !fn ) { fn = type; type = "fx"; } return this.each(function(){ if ( !this.queue ) this.queue = {}; if ( !this.queue[type] ) this.queue[type] = []; this.queue[type].push( fn ); if ( this.queue[type].length == 1 ) fn.apply(this); });
jQuery.prototype.queue = function(type,fn){ if ( !fn ) { fn = type; type = "fx"; } return this.each(function(){ if ( !this.queue ) this.queue = {}; if ( !this.queue[type] ) this.queue[type] = []; this.queue[type].push( fn ); if ( this.queue[type].length == 1 ) fn.apply(this); });};
return this.each(function(){ if ( !this.queue ) this.queue = {}; if ( !this.queue[type] ) this.queue[type] = []; this.queue[type].push( fn ); if ( this.queue[type].length == 1 ) fn.apply(this); }); };
jQuery.prototype.queue = function(type,fn){ if ( !fn ) { fn = type; type = "fx"; } return this.each(function(){ if ( !this.queue ) this.queue = {}; if ( !this.queue[type] ) this.queue[type] = []; this.queue[type].push( fn ); if ( this.queue[type].length == 1 ) fn.apply(this); });};
type = 'fx';
type = "fx";
$.fn.queue = function(type,fn){ if ( !fn ) { fn = type; type = 'fx'; } return this.each(function(){ if ( !this.$$queue ) { this.$$queue = {}; } if ( !this.$$queue[type] ) { this.$$queue[type] = []; } this.$$queue[type].push( fn ); if ( this.$$queue[type].length == 1 ) { $.apply(this,fn); } });};
if ( !this.$$queue ) { this.$$queue = {}; }
if ( !this.queue ) this.queue = {};
$.fn.queue = function(type,fn){ if ( !fn ) { fn = type; type = 'fx'; } return this.each(function(){ if ( !this.$$queue ) { this.$$queue = {}; } if ( !this.$$queue[type] ) { this.$$queue[type] = []; } this.$$queue[type].push( fn ); if ( this.$$queue[type].length == 1 ) { $.apply(this,fn); } });};
if ( !this.$$queue[type] ) { this.$$queue[type] = []; }
if ( !this.queue[type] ) this.queue[type] = [];
$.fn.queue = function(type,fn){ if ( !fn ) { fn = type; type = 'fx'; } return this.each(function(){ if ( !this.$$queue ) { this.$$queue = {}; } if ( !this.$$queue[type] ) { this.$$queue[type] = []; } this.$$queue[type].push( fn ); if ( this.$$queue[type].length == 1 ) { $.apply(this,fn); } });};
this.$$queue[type].push( fn );
this.queue[type].push( fn );
$.fn.queue = function(type,fn){ if ( !fn ) { fn = type; type = 'fx'; } return this.each(function(){ if ( !this.$$queue ) { this.$$queue = {}; } if ( !this.$$queue[type] ) { this.$$queue[type] = []; } this.$$queue[type].push( fn ); if ( this.$$queue[type].length == 1 ) { $.apply(this,fn); } });};
if ( this.$$queue[type].length == 1 ) { $.apply(this,fn); }
if ( this.queue[type].length == 1 ) fn.apply(this);
$.fn.queue = function(type,fn){ if ( !fn ) { fn = type; type = 'fx'; } return this.each(function(){ if ( !this.$$queue ) { this.$$queue = {}; } if ( !this.$$queue[type] ) { this.$$queue[type] = []; } this.$$queue[type].push( fn ); if ( this.$$queue[type].length == 1 ) { $.apply(this,fn); } });};
arc = arcs.getNext().QueryInterface(nsIRDFNode);
var arc = arcs.getNext().QueryInterface(nsIRDFNode);
function rdf_cleart (n1, a, recurse){ if (typeof recurse == "undefined") recurse = false; var targets = this.ds.GetTargets(n1, a, true); while (targets.hasMoreElements()) { var n2 = targets.getNext().QueryInterface(nsIRDFNode); if (recurse) { try { var resN2 = n2.QueryInterface(nsIRDFResource); var arcs = this.ds.ArcLabelsOut(resN2); while (arcs.hasMoreElements()) { arc = arcs.getNext().QueryInterface(nsIRDFNode); this.clearTargets (resN2, arc, true); } } catch (e) { /* dd ("** Caught " + e + " while recursivley clearing " + n2.Value + " **"); */ } } this.Unassert (n1, a, n2); }}
function RDFFile(aPath, aFlags) {
function RDFFile(aPath, aFlags, aNameSpace, aID) {
function RDFFile(aPath, aFlags) { this.created = false; if(aPath) { this._file_init(aPath, aFlags); }}
if(aPath) { this._file_init(aPath, aFlags); }
if(aPath) this._file_init(aPath, aFlags, aNameSpace, aID);
function RDFFile(aPath, aFlags) { this.created = false; if(aPath) { this._file_init(aPath, aFlags); }}
const RDF_MEMORYDS_PROGID = "component:
const RDF_MEMORYDS_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=in-memory-datasource";
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:cview-data"); this.resEmptyRoot = this.svc.GetResource ("NC:cview-data-empty"); /* predefined arcs */ this.resCmp = this.svc.GetResource (RES_PFX + "component"); this.resProgID = this.svc.GetResource (RES_PFX + "progid"); this.resCLSID = this.svc.GetResource (RES_PFX + "clsid"); this.resIfc = this.svc.GetResource (RES_PFX + "interface"); this.resIName = this.svc.GetResource (RES_PFX + "iname"); this.resIID = this.svc.GetResource (RES_PFX + "iid"); this.resShow = this.svc.GetResource (RES_PFX + "show"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false");}
const RDF_DS_PROGID = "component:
const RDF_DS_CONTRACTID = "@mozilla.org/rdf/rdf-service;1";
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:cview-data"); this.resEmptyRoot = this.svc.GetResource ("NC:cview-data-empty"); /* predefined arcs */ this.resCmp = this.svc.GetResource (RES_PFX + "component"); this.resProgID = this.svc.GetResource (RES_PFX + "progid"); this.resCLSID = this.svc.GetResource (RES_PFX + "clsid"); this.resIfc = this.svc.GetResource (RES_PFX + "interface"); this.resIName = this.svc.GetResource (RES_PFX + "iname"); this.resIID = this.svc.GetResource (RES_PFX + "iid"); this.resShow = this.svc.GetResource (RES_PFX + "show"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false");}
Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID);
Components.classes[RDF_MEMORYDS_CONTRACTID].createInstance(RDF_DS_IID);
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:cview-data"); this.resEmptyRoot = this.svc.GetResource ("NC:cview-data-empty"); /* predefined arcs */ this.resCmp = this.svc.GetResource (RES_PFX + "component"); this.resProgID = this.svc.GetResource (RES_PFX + "progid"); this.resCLSID = this.svc.GetResource (RES_PFX + "clsid"); this.resIfc = this.svc.GetResource (RES_PFX + "interface"); this.resIName = this.svc.GetResource (RES_PFX + "iname"); this.resIID = this.svc.GetResource (RES_PFX + "iid"); this.resShow = this.svc.GetResource (RES_PFX + "show"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false");}
Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID);
Components.classes[RDF_DS_CONTRACTID].getService(RDF_SVC_IID);
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:cview-data"); this.resEmptyRoot = this.svc.GetResource ("NC:cview-data-empty"); /* predefined arcs */ this.resCmp = this.svc.GetResource (RES_PFX + "component"); this.resProgID = this.svc.GetResource (RES_PFX + "progid"); this.resCLSID = this.svc.GetResource (RES_PFX + "clsid"); this.resIfc = this.svc.GetResource (RES_PFX + "interface"); this.resIName = this.svc.GetResource (RES_PFX + "iname"); this.resIID = this.svc.GetResource (RES_PFX + "iid"); this.resShow = this.svc.GetResource (RES_PFX + "show"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false");}
this.resProgID = this.svc.GetResource (RES_PFX + "progid");
this.resContractID = this.svc.GetResource (RES_PFX + "contractid");
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:cview-data"); this.resEmptyRoot = this.svc.GetResource ("NC:cview-data-empty"); /* predefined arcs */ this.resCmp = this.svc.GetResource (RES_PFX + "component"); this.resProgID = this.svc.GetResource (RES_PFX + "progid"); this.resCLSID = this.svc.GetResource (RES_PFX + "clsid"); this.resIfc = this.svc.GetResource (RES_PFX + "interface"); this.resIName = this.svc.GetResource (RES_PFX + "iname"); this.resIID = this.svc.GetResource (RES_PFX + "iid"); this.resShow = this.svc.GetResource (RES_PFX + "show"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false");}
const RDF_MEMORYDS_PROGID = "component:
const RDF_MEMORYDS_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=in-memory-datasource";
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:chatzilla-data"); this.resNullUser = this.svc.GetResource (RES_PFX + "NUSER"); this.resNullChan = this.svc.GetResource (RES_PFX + "NCHAN"); /* predefined arcs */ this.resNetwork = this.svc.GetResource (RES_PFX + "network"); this.resServer = this.svc.GetResource (RES_PFX + "server"); this.resChannel = this.svc.GetResource (RES_PFX + "channel"); this.resChanUser = this.svc.GetResource (RES_PFX + "chanuser"); this.resOp = this.svc.GetResource (RES_PFX + "op"); this.resVoice = this.svc.GetResource (RES_PFX + "voice"); this.resNick = this.svc.GetResource (RES_PFX + "nick"); this.resUser = this.svc.GetResource (RES_PFX + "user"); this.resHost = this.svc.GetResource (RES_PFX + "host"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false"); this.litUnk = this.svc.GetLiteral ("----"); this.ds.Assert (this.resNullUser, this.resOp, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resVoice, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resNick, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resUser, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resHost, this.litUnk, true); /* this.ds.Assert (this.resNullChan, this.resChanUser, this.resNullUser, true); */ this.ds.Assert (this.resRoot, this.resChannel, this.resNullChan, true); }
const RDF_DS_PROGID = "component:
const RDF_DS_CONTRACTID = "@mozilla.org/rdf/rdf-service;1";
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:chatzilla-data"); this.resNullUser = this.svc.GetResource (RES_PFX + "NUSER"); this.resNullChan = this.svc.GetResource (RES_PFX + "NCHAN"); /* predefined arcs */ this.resNetwork = this.svc.GetResource (RES_PFX + "network"); this.resServer = this.svc.GetResource (RES_PFX + "server"); this.resChannel = this.svc.GetResource (RES_PFX + "channel"); this.resChanUser = this.svc.GetResource (RES_PFX + "chanuser"); this.resOp = this.svc.GetResource (RES_PFX + "op"); this.resVoice = this.svc.GetResource (RES_PFX + "voice"); this.resNick = this.svc.GetResource (RES_PFX + "nick"); this.resUser = this.svc.GetResource (RES_PFX + "user"); this.resHost = this.svc.GetResource (RES_PFX + "host"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false"); this.litUnk = this.svc.GetLiteral ("----"); this.ds.Assert (this.resNullUser, this.resOp, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resVoice, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resNick, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resUser, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resHost, this.litUnk, true); /* this.ds.Assert (this.resNullChan, this.resChanUser, this.resNullUser, true); */ this.ds.Assert (this.resRoot, this.resChannel, this.resNullChan, true); }
Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID);
Components.classes[RDF_MEMORYDS_CONTRACTID].createInstance(RDF_DS_IID);
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:chatzilla-data"); this.resNullUser = this.svc.GetResource (RES_PFX + "NUSER"); this.resNullChan = this.svc.GetResource (RES_PFX + "NCHAN"); /* predefined arcs */ this.resNetwork = this.svc.GetResource (RES_PFX + "network"); this.resServer = this.svc.GetResource (RES_PFX + "server"); this.resChannel = this.svc.GetResource (RES_PFX + "channel"); this.resChanUser = this.svc.GetResource (RES_PFX + "chanuser"); this.resOp = this.svc.GetResource (RES_PFX + "op"); this.resVoice = this.svc.GetResource (RES_PFX + "voice"); this.resNick = this.svc.GetResource (RES_PFX + "nick"); this.resUser = this.svc.GetResource (RES_PFX + "user"); this.resHost = this.svc.GetResource (RES_PFX + "host"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false"); this.litUnk = this.svc.GetLiteral ("----"); this.ds.Assert (this.resNullUser, this.resOp, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resVoice, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resNick, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resUser, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resHost, this.litUnk, true); /* this.ds.Assert (this.resNullChan, this.resChanUser, this.resNullUser, true); */ this.ds.Assert (this.resRoot, this.resChannel, this.resNullChan, true); }
Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID);
Components.classes[RDF_DS_CONTRACTID].getService(RDF_SVC_IID);
function RDFHelper(){ const RDF_MEMORYDS_PROGID = "component://netscape/rdf/datasource?name=in-memory-datasource"; const RDF_DS_IID = Components.interfaces.nsIRDFDataSource; const RDF_DS_PROGID = "component://netscape/rdf/rdf-service"; const RDF_SVC_IID = Components.interfaces.nsIRDFService; this.ds = Components.classes[RDF_MEMORYDS_PROGID].createInstance(RDF_DS_IID); this.svc = Components.classes[RDF_DS_PROGID].getService(RDF_SVC_IID); /* predefined nodes */ this.resRoot = this.svc.GetResource ("NC:chatzilla-data"); this.resNullUser = this.svc.GetResource (RES_PFX + "NUSER"); this.resNullChan = this.svc.GetResource (RES_PFX + "NCHAN"); /* predefined arcs */ this.resNetwork = this.svc.GetResource (RES_PFX + "network"); this.resServer = this.svc.GetResource (RES_PFX + "server"); this.resChannel = this.svc.GetResource (RES_PFX + "channel"); this.resChanUser = this.svc.GetResource (RES_PFX + "chanuser"); this.resOp = this.svc.GetResource (RES_PFX + "op"); this.resVoice = this.svc.GetResource (RES_PFX + "voice"); this.resNick = this.svc.GetResource (RES_PFX + "nick"); this.resUser = this.svc.GetResource (RES_PFX + "user"); this.resHost = this.svc.GetResource (RES_PFX + "host"); /* predefined literals */ this.litTrue = this.svc.GetLiteral ("true"); this.litFalse = this.svc.GetLiteral ("false"); this.litUnk = this.svc.GetLiteral ("----"); this.ds.Assert (this.resNullUser, this.resOp, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resVoice, this.litFalse, true); this.ds.Assert (this.resNullUser, this.resNick, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resUser, this.litUnk, true); this.ds.Assert (this.resNullUser, this.resHost, this.litUnk, true); /* this.ds.Assert (this.resNullChan, this.resChanUser, this.resNullUser, true); */ this.ds.Assert (this.resRoot, this.resChannel, this.resNullChan, true); }
var bytes = wrapper.readByteArray(count); if (bytes.length != count) do_throw("Partial read from input stream!"); return eval("String.fromCharCode(" + bytes.toString() + ")");
var data = []; while (count > 0) { var bytes = wrapper.readByteArray(Math.min(65535, count)); data.push(String.fromCharCode.apply(null, bytes)); count -= bytes.length; if (bytes.length == 0) do_throw("Nothing read from input stream!"); } return data.join('');
function read_stream(stream, count) { /* assume stream has non-ASCII data */ var wrapper = Cc["@mozilla.org/binaryinputstream;1"]. createInstance(Ci.nsIBinaryInputStream); wrapper.setInputStream(stream); var bytes = wrapper.readByteArray(count); /* assume that the stream is going to give us all of the data. not all streams conform to this. */ if (bytes.length != count) do_throw("Partial read from input stream!"); /* convert array of bytes to a String object (by no means efficient) */ return eval("String.fromCharCode(" + bytes.toString() + ")");}
availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0;
var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration();
function ReadAvailableLanguages(){ availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0; var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem; var stringName; var stringNameProperty; while (acceptedBundleEnum.hasMoreElements()) { //progress through the bundle curItem = acceptedBundleEnum.getNext(); //"unpack" the item, nsIPropertyElement is now partially scriptable curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement); //dump string name (key) stringName = curItem.key; stringNameProperty = stringName.split('.'); if (stringNameProperty[1] == 'accept') { //dump the UI string (value) visible = curItem.value; //if (visible == 'true') { str = stringNameProperty[0]; var stringLangRegion = stringNameProperty[0].split('-'); if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { tit = ""; } if (stringLangRegion.length > 1) { try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); } catch (ex) { tit += "["+str+"]"; } } //if region tit = tit + " [" + str + "]"; } //if language if (str && tit) { availLanguageDict[i] = new Array(3); availLanguageDict[i][0] = tit; availLanguageDict[i][1] = str; availLanguageDict[i][2] = visible; i++; } // if str&tit //} //if visible } //if accepted } //while availLanguageDict.sort( // sort on first element function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return 1; return 0; });}
var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem;
var curItem;
function ReadAvailableLanguages(){ availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0; var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem; var stringName; var stringNameProperty; while (acceptedBundleEnum.hasMoreElements()) { //progress through the bundle curItem = acceptedBundleEnum.getNext(); //"unpack" the item, nsIPropertyElement is now partially scriptable curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement); //dump string name (key) stringName = curItem.key; stringNameProperty = stringName.split('.'); if (stringNameProperty[1] == 'accept') { //dump the UI string (value) visible = curItem.value; //if (visible == 'true') { str = stringNameProperty[0]; var stringLangRegion = stringNameProperty[0].split('-'); if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { tit = ""; } if (stringLangRegion.length > 1) { try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); } catch (ex) { tit += "["+str+"]"; } } //if region tit = tit + " [" + str + "]"; } //if language if (str && tit) { availLanguageDict[i] = new Array(3); availLanguageDict[i][0] = tit; availLanguageDict[i][1] = str; availLanguageDict[i][2] = visible; i++; } // if str&tit //} //if visible } //if accepted } //while availLanguageDict.sort( // sort on first element function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return 1; return 0; });}
if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); }
if (stringLangRegion[0]) { var tit; var language; var region; var use_region_format = false;
function ReadAvailableLanguages(){ availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0; var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem; var stringName; var stringNameProperty; while (acceptedBundleEnum.hasMoreElements()) { //progress through the bundle curItem = acceptedBundleEnum.getNext(); //"unpack" the item, nsIPropertyElement is now partially scriptable curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement); //dump string name (key) stringName = curItem.key; stringNameProperty = stringName.split('.'); if (stringNameProperty[1] == 'accept') { //dump the UI string (value) visible = curItem.value; //if (visible == 'true') { str = stringNameProperty[0]; var stringLangRegion = stringNameProperty[0].split('-'); if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { tit = ""; } if (stringLangRegion.length > 1) { try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); } catch (ex) { tit += "["+str+"]"; } } //if region tit = tit + " [" + str + "]"; } //if language if (str && tit) { availLanguageDict[i] = new Array(3); availLanguageDict[i][0] = tit; availLanguageDict[i][1] = str; availLanguageDict[i][2] = visible; i++; } // if str&tit //} //if visible } //if accepted } //while availLanguageDict.sort( // sort on first element function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return 1; return 0; });}
catch (ex) { tit = ""; }
try { language = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { language = ""; }
function ReadAvailableLanguages(){ availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0; var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem; var stringName; var stringNameProperty; while (acceptedBundleEnum.hasMoreElements()) { //progress through the bundle curItem = acceptedBundleEnum.getNext(); //"unpack" the item, nsIPropertyElement is now partially scriptable curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement); //dump string name (key) stringName = curItem.key; stringNameProperty = stringName.split('.'); if (stringNameProperty[1] == 'accept') { //dump the UI string (value) visible = curItem.value; //if (visible == 'true') { str = stringNameProperty[0]; var stringLangRegion = stringNameProperty[0].split('-'); if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { tit = ""; } if (stringLangRegion.length > 1) { try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); } catch (ex) { tit += "["+str+"]"; } } //if region tit = tit + " [" + str + "]"; } //if language if (str && tit) { availLanguageDict[i] = new Array(3); availLanguageDict[i][0] = tit; availLanguageDict[i][1] = str; availLanguageDict[i][2] = visible; i++; } // if str&tit //} //if visible } //if accepted } //while availLanguageDict.sort( // sort on first element function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return 1; return 0; });}
if (stringLangRegion.length > 1) {
try { region = regionsBundle.GetStringFromName(stringLangRegion[1]); use_region_format = true; } catch (ex) { } } if (use_region_format) { tit = prefLangBundle.formatStringFromName("languageRegionCodeFormat", [language, region, str], 3); } else { tit = prefLangBundle.formatStringFromName("languageCodeFormat", [language, str], 2); }
function ReadAvailableLanguages(){ availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0; var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem; var stringName; var stringNameProperty; while (acceptedBundleEnum.hasMoreElements()) { //progress through the bundle curItem = acceptedBundleEnum.getNext(); //"unpack" the item, nsIPropertyElement is now partially scriptable curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement); //dump string name (key) stringName = curItem.key; stringNameProperty = stringName.split('.'); if (stringNameProperty[1] == 'accept') { //dump the UI string (value) visible = curItem.value; //if (visible == 'true') { str = stringNameProperty[0]; var stringLangRegion = stringNameProperty[0].split('-'); if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { tit = ""; } if (stringLangRegion.length > 1) { try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); } catch (ex) { tit += "["+str+"]"; } } //if region tit = tit + " [" + str + "]"; } //if language if (str && tit) { availLanguageDict[i] = new Array(3); availLanguageDict[i][0] = tit; availLanguageDict[i][1] = str; availLanguageDict[i][2] = visible; i++; } // if str&tit //} //if visible } //if accepted } //while availLanguageDict.sort( // sort on first element function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return 1; return 0; });}
try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); }
}
function ReadAvailableLanguages(){ availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0; var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem; var stringName; var stringNameProperty; while (acceptedBundleEnum.hasMoreElements()) { //progress through the bundle curItem = acceptedBundleEnum.getNext(); //"unpack" the item, nsIPropertyElement is now partially scriptable curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement); //dump string name (key) stringName = curItem.key; stringNameProperty = stringName.split('.'); if (stringNameProperty[1] == 'accept') { //dump the UI string (value) visible = curItem.value; //if (visible == 'true') { str = stringNameProperty[0]; var stringLangRegion = stringNameProperty[0].split('-'); if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { tit = ""; } if (stringLangRegion.length > 1) { try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); } catch (ex) { tit += "["+str+"]"; } } //if region tit = tit + " [" + str + "]"; } //if language if (str && tit) { availLanguageDict[i] = new Array(3); availLanguageDict[i][0] = tit; availLanguageDict[i][1] = str; availLanguageDict[i][2] = visible; i++; } // if str&tit //} //if visible } //if accepted } //while availLanguageDict.sort( // sort on first element function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return 1; return 0; });}
catch (ex) { tit += "["+str+"]"; } } tit = tit + " [" + str + "]"; } if (str && tit) {
if (str && tit) {
function ReadAvailableLanguages(){ availLanguageDict = new Array(); var visible = new String(); var str = new String(); var i =0; var acceptedBundleEnum = acceptedBundle.getSimpleEnumeration(); var curItem; var stringName; var stringNameProperty; while (acceptedBundleEnum.hasMoreElements()) { //progress through the bundle curItem = acceptedBundleEnum.getNext(); //"unpack" the item, nsIPropertyElement is now partially scriptable curItem = curItem.QueryInterface(Components.interfaces.nsIPropertyElement); //dump string name (key) stringName = curItem.key; stringNameProperty = stringName.split('.'); if (stringNameProperty[1] == 'accept') { //dump the UI string (value) visible = curItem.value; //if (visible == 'true') { str = stringNameProperty[0]; var stringLangRegion = stringNameProperty[0].split('-'); if (stringLangRegion[0]) { var tit; try { tit = languagesBundle.GetStringFromName(stringLangRegion[0]); } catch (ex) { tit = ""; } if (stringLangRegion.length > 1) { try { tit += "/" + regionsBundle.GetStringFromName(stringLangRegion[1]); } catch (ex) { tit += "["+str+"]"; } } //if region tit = tit + " [" + str + "]"; } //if language if (str && tit) { availLanguageDict[i] = new Array(3); availLanguageDict[i][0] = tit; availLanguageDict[i][1] = str; availLanguageDict[i][2] = visible; i++; } // if str&tit //} //if visible } //if accepted } //while availLanguageDict.sort( // sort on first element function (a, b) { if (a[0] < b[0]) return -1; if (a[0] > b[0]) return 1; return 0; });}
var cacheList = document.getElementById("cacheProvider");
readCheckPhish: function () { var phishEnabled = document.getElementById("browser.safebrowsing.enabled").value; var remoteLookup = document.getElementById("browser.safebrowsing.remoteLookups").value; var checkPhish = document.getElementById("checkPhishChoice"); var cacheList = document.getElementById("cacheProvider"); var loadList = document.getElementById("onloadProvider"); var onloadAfter = document.getElementById("onloadAfter"); checkPhish.disabled = onloadAfter.disabled = !phishEnabled; loadList.disabled = !phishEnabled || !remoteLookup; cacheList.disabled = !phishEnabled || remoteLookup; // don't override pref value return undefined; },
cacheList.disabled = !phishEnabled || remoteLookup;
readCheckPhish: function () { var phishEnabled = document.getElementById("browser.safebrowsing.enabled").value; var remoteLookup = document.getElementById("browser.safebrowsing.remoteLookups").value; var checkPhish = document.getElementById("checkPhishChoice"); var cacheList = document.getElementById("cacheProvider"); var loadList = document.getElementById("onloadProvider"); var onloadAfter = document.getElementById("onloadAfter"); checkPhish.disabled = onloadAfter.disabled = !phishEnabled; loadList.disabled = !phishEnabled || !remoteLookup; cacheList.disabled = !phishEnabled || remoteLookup; // don't override pref value return undefined; },
LocalFileInstance = Components.classes[LOCALFILE_CTRID].createInstance( nsILocalFile ); LocalFileInstance.initWithPath( aFilePath );
localFileInstance = Components.classes[LOCALFILE_CTRID].createInstance( nsILocalFile ); localFileInstance.initWithPath( aFilePath );
function readDataFromFile( aFilePath, charset ){ const LOCALFILE_CTRID = "@mozilla.org/file/local;1"; const FILEIN_CTRID = "@mozilla.org/network/file-input-stream;1"; const SCRIPTSTREAM_CTRID = "@mozilla.org/scriptableinputstream;1"; const nsILocalFile = Components.interfaces.nsILocalFile; const nsIFileInputStream = Components.interfaces.nsIFileInputStream; const nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream; var localFileInstance; var inputStream; var scriptableInputStream; var tmp; // not sure what the use is for this LocalFileInstance = Components.classes[LOCALFILE_CTRID].createInstance( nsILocalFile ); LocalFileInstance.initWithPath( aFilePath ); inputStream = Components.classes[FILEIN_CTRID].createInstance( nsIFileInputStream ); try { inputStream.init( LocalFileInstance, MODE_RDONLY, 0444, tmp ); scriptableInputStream = Components.classes[SCRIPTSTREAM_CTRID].createInstance( nsIScriptableInputStream); scriptableInputStream.init( inputStream ); aDataStream = scriptableInputStream.read( -1 ); scriptableInputStream.close(); inputStream.close(); if( charset) aDataStream = convertToUnicode( charset, aDataStream ); } catch(ex) { alert("Unable to read from file: " + aFilePath ); } return aDataStream;}
inputStream.init( LocalFileInstance, MODE_RDONLY, 0444, tmp );
inputStream.init( localFileInstance, MODE_RDONLY, 0444, tmp );
function readDataFromFile( aFilePath, charset ){ const LOCALFILE_CTRID = "@mozilla.org/file/local;1"; const FILEIN_CTRID = "@mozilla.org/network/file-input-stream;1"; const SCRIPTSTREAM_CTRID = "@mozilla.org/scriptableinputstream;1"; const nsILocalFile = Components.interfaces.nsILocalFile; const nsIFileInputStream = Components.interfaces.nsIFileInputStream; const nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream; var localFileInstance; var inputStream; var scriptableInputStream; var tmp; // not sure what the use is for this LocalFileInstance = Components.classes[LOCALFILE_CTRID].createInstance( nsILocalFile ); LocalFileInstance.initWithPath( aFilePath ); inputStream = Components.classes[FILEIN_CTRID].createInstance( nsIFileInputStream ); try { inputStream.init( LocalFileInstance, MODE_RDONLY, 0444, tmp ); scriptableInputStream = Components.classes[SCRIPTSTREAM_CTRID].createInstance( nsIScriptableInputStream); scriptableInputStream.init( inputStream ); aDataStream = scriptableInputStream.read( -1 ); scriptableInputStream.close(); inputStream.close(); if( charset) aDataStream = convertToUnicode( charset, aDataStream ); } catch(ex) { alert("Unable to read from file: " + aFilePath ); } return aDataStream;}
aDataStream = scriptableInputStream.read( -1 );
var aDataStream = scriptableInputStream.read( -1 );
function readDataFromFile( aFilePath, charset ){ const LOCALFILE_CTRID = "@mozilla.org/file/local;1"; const FILEIN_CTRID = "@mozilla.org/network/file-input-stream;1"; const SCRIPTSTREAM_CTRID = "@mozilla.org/scriptableinputstream;1"; const nsILocalFile = Components.interfaces.nsILocalFile; const nsIFileInputStream = Components.interfaces.nsIFileInputStream; const nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream; var localFileInstance; var inputStream; var scriptableInputStream; var tmp; // not sure what the use is for this LocalFileInstance = Components.classes[LOCALFILE_CTRID].createInstance( nsILocalFile ); LocalFileInstance.initWithPath( aFilePath ); inputStream = Components.classes[FILEIN_CTRID].createInstance( nsIFileInputStream ); try { inputStream.init( LocalFileInstance, MODE_RDONLY, 0444, tmp ); scriptableInputStream = Components.classes[SCRIPTSTREAM_CTRID].createInstance( nsIScriptableInputStream); scriptableInputStream.init( inputStream ); aDataStream = scriptableInputStream.read( -1 ); scriptableInputStream.close(); inputStream.close(); if( charset) aDataStream = convertToUnicode( charset, aDataStream ); } catch(ex) { alert("Unable to read from file: " + aFilePath ); } return aDataStream;}
var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.notifyObservers(null, "charsetmenu-selected", "mailedit");
Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService) .notifyObservers(null, "charsetmenu-selected", "mailedit");
readDefaultCharset: function() { if (!this.mCharsetMenuInitialized) { var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.notifyObservers(null, "charsetmenu-selected", "mailedit"); this.mCharsetMenuInitialized = true; } return undefined; },
},
}
readDefaultCharset: function() { if (!this.mCharsetMenuInitialized) { var os = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); os.notifyObservers(null, "charsetmenu-selected", "mailedit"); this.mCharsetMenuInitialized = true; } return undefined; },
.classes["component:
.classes["@mozilla.org/widget/clipboard;1"]
function readFromClipboard() { try { // Get clipboard. var clipboard = Components .classes["component://netscape/widget/clipboard"] .getService ( Components.interfaces.nsIClipboard ); // Create tranferable that will transfer the text. var trans = Components .classes["component://netscape/widget/transferable"] .createInstance( Components.interfaces.nsITransferable ); if ( !clipboard || !trans ) return null; trans.addDataFlavor( "text/unicode" ); clipboard.getData(trans, clipboard.kSelectionClipboard); var data = new Object(); var dataLen = new Object(); trans.getTransferData("text/unicode", data, dataLen); var url = null; if (data) { data = data.value.QueryInterface(Components.interfaces .nsISupportsWString); url = data.data.substring(0, dataLen.value / 2); } return url; } catch(ex) { return null; } }
.classes["component:
.classes["@mozilla.org/widget/transferable;1"]
function readFromClipboard() { try { // Get clipboard. var clipboard = Components .classes["component://netscape/widget/clipboard"] .getService ( Components.interfaces.nsIClipboard ); // Create tranferable that will transfer the text. var trans = Components .classes["component://netscape/widget/transferable"] .createInstance( Components.interfaces.nsITransferable ); if ( !clipboard || !trans ) return null; trans.addDataFlavor( "text/unicode" ); clipboard.getData(trans, clipboard.kSelectionClipboard); var data = new Object(); var dataLen = new Object(); trans.getTransferData("text/unicode", data, dataLen); var url = null; if (data) { data = data.value.QueryInterface(Components.interfaces .nsISupportsWString); url = data.data.substring(0, dataLen.value / 2); } return url; } catch(ex) { return null; } }
bookmarkTitle = PlacesController.bookmarks.getItemTitle(uri);
var bmSvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getService(Ci.nsINavBookmarksService); bookmarkTitle = bmSvc.getItemTitle(uri);
readHomePage: function () { var useCurrent = document.getElementById("useCurrent"); var chooseBookmark = document.getElementById("chooseBookmark"); var bookmarkName = document.getElementById("bookmarkName"); var otherURL = document.getElementById("otherURL"); // handle selection of "bookmark" radio when there's nothing there: in this // case, the value in preferences is the most recent value stored in the // preference (to be applied now or later as needed), and the uri attribute // on bookmarkName == "(none)" -- if prefs are written with "bookmark" // selected but with no set uri attribute or the attribute is equal to // "(none)", then the previous value is stored to preferences if (bookmarkName.getAttribute("uri") == "(none)") { useCurrent.disabled = otherURL.disabled = true; bookmarkName.disabled = chooseBookmark.disabled = false; return "bookmark"; } var homePage = document.getElementById("browser.startup.homepage"); if (homePage.value == homePage.defaultValue) { useCurrent.disabled = otherURL.disabled = true; bookmarkName.disabled = chooseBookmark.disabled = true; return "default"; } else { var bookmarkTitle = null; if (homePage.value.indexOf("|") >= 0) { // multiple tabs -- XXX dangerous "|" character! // don't bother treating this as a bookmark, because the level of // discernment needed to determine that these actually represent a // folder is probably more trouble than it's worth } else {#ifdef MOZ_PLACES // XXX this also retrieves titles of pages that are only in history and // not only in bookmarks, but there's nothing that can be done about // that without more fine-grained APIs const Cc = Components.classes, Ci = Components.interfaces; try { var ios = Cc["@mozilla.org/network/io-service;1"] .getService(Ci.nsIIOService); var uri = ios.newURI(homePage.value, "UTF-8", null); bookmarkTitle = PlacesController.bookmarks.getItemTitle(uri); } catch (e) { bookmarkTitle = null; }#else // determining this without Places == great pain and suffering in the // general case, so check if the bookmark field has a uri attribute // and see if it's equal to the current home page -- this means that if // you choose a bookmark and set it as home page on any instant-apply // platform (i.e., not Windows), you can do that and switch back and // forth between the three radio options and things will work correctly, // but once the window's closed and reopened it'll just appear as a // normal "other URL" if (bookmarkName.getAttribute("uri") == homePage.value) bookmarkTitle = bookmarkName.value;#endif } if (bookmarkTitle) { useCurrent.disabled = otherURL.disabled = true; bookmarkName.disabled = chooseBookmark.disabled = false; bookmarkName.value = bookmarkTitle; // in case this isn't the result of the user choosing a bookmark bookmarkName.setAttribute("uri", homePage.value); return "bookmark"; } else { useCurrent.disabled = otherURL.disabled = false; bookmarkName.disabled = chooseBookmark.disabled = true; if (homePage.value == "about:blank") { otherURL.value = document.getElementById("bundlePreferences") .getString("blankpage"); } else { otherURL.value = homePage.value; } return "other"; } } },
client.ICONS_IN_TOOLBAR = getBoolPref (pref, rootNode + "toolbar.icons", false);
function readIRCPrefs (rootNode){ var pref = Components.classes["@mozilla.org/preferences;1"].createInstance(); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; pref = pref.QueryInterface(Components.interfaces.nsIPref); CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); client.ICONS_IN_TOOLBAR = getBoolPref (pref, rootNode + "toolbar.icons", false); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "output-default.css"); client.USER_CSS_PRE = getCharPref (pref, rootNode + "style.user.pre", ""); client.USER_CSS_POST = getCharPref (pref, rootNode + "style.user.post", ""); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
h.enabled =
h.enabled = client.debugMode =
function readIRCPrefs (rootNode){ var pref = Components.classes["@mozilla.org/preferences;1"].createInstance(); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; pref = pref.QueryInterface(Components.interfaces.nsIPref); CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); client.ICONS_IN_TOOLBAR = getBoolPref (pref, rootNode + "toolbar.icons", false); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "output-default.css"); client.USER_CSS_PRE = getCharPref (pref, rootNode + "style.user.pre", ""); client.USER_CSS_POST = getCharPref (pref, rootNode + "style.user.post", ""); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
Components.classes["component:
Components.classes["@mozilla.org/preferences;1"].createInstance();
function readIRCPrefs (rootNode){ var pref = Components.classes["component://netscape/preferences"].createInstance(); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; pref = pref.QueryInterface(Components.interfaces.nsIPref); CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); CIRCNetwork.prototype.INITIAL_CHANNEL = getCharPref (pref, rootNode + "channel", CIRCNetwork.prototype.INITIAL_CHANNEL); client.STARTUP_NETWORK = getCharPref (pref, rootNode + "network", ""); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.ICONS_IN_TOOLBAR = getBoolPref (pref, rootNode + "toolbar.icons", true); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "output-default.css"); client.USER_CSS_PRE = getCharPref (pref, rootNode + "style.user.pre", ""); client.USER_CSS_POST = getCharPref (pref, rootNode + "style.user.post", ""); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch);
const PREF_CTRID = "@mozilla.org/preferences-service;1"; const nsIPrefBranch = Components.interfaces.nsIPrefBranch var pref = Components.classes[PREF_CTRID].getService(nsIPrefBranch);
function readIRCPrefs (rootNode){ pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.INITIAL_SCRIPTS = getCharPref (pref, rootNode + "initialScripts", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); for (var entry in client.munger.entries) client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "chrome://chatzilla/skin/output-default.css"); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = client.debugMode = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
getCharPref (pref, rootNode + "defaultNet", "moznet");
getCharPref (pref, rootNode + "defaultNet", "moznet"); client.CHARSET = getCharPref (pref, rootNode + "charset", "");
function readIRCPrefs (rootNode){ pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.INITIAL_SCRIPTS = getCharPref (pref, rootNode + "initialScripts", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); for (var entry in client.munger.entries) client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "chrome://chatzilla/skin/output-default.css"); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = client.debugMode = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
getCharPref (pref, rootNode + "initialURLs", "");
getCharPref (pref, rootNode + "initialURLs", "irc: if (!client.INITIAL_URLS) client.INITIAL_URLS = "irc:
function readIRCPrefs (rootNode){ pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.INITIAL_SCRIPTS = getCharPref (pref, rootNode + "initialScripts", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); for (var entry in client.munger.entries) client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "chrome://chatzilla/skin/output-default.css"); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = client.debugMode = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
client.ADDRESSED_NICK_SEP);
client.ADDRESSED_NICK_SEP).replace(/\s*$/, "");
function readIRCPrefs (rootNode){ pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.INITIAL_SCRIPTS = getCharPref (pref, rootNode + "initialScripts", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); for (var entry in client.munger.entries) client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "chrome://chatzilla/skin/output-default.css"); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = client.debugMode = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled);
{ if (entry[0] != ".") { client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled); } }
function readIRCPrefs (rootNode){ pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.INITIAL_SCRIPTS = getCharPref (pref, rootNode + "initialScripts", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); for (var entry in client.munger.entries) client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "chrome://chatzilla/skin/output-default.css"); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = client.debugMode = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
CIRCChanUser.prototype.MAX_MESSAGES =
CIRCUser.prototype.MAX_MESSAGES =
function readIRCPrefs (rootNode){ pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); client.DEFAULT_NETWORK = getCharPref (pref, rootNode + "defaultNet", "moznet"); client.INITIAL_URLS = getCharPref (pref, rootNode + "initialURLs", ""); client.INITIAL_SCRIPTS = getCharPref (pref, rootNode + "initialScripts", ""); client.ADDRESSED_NICK_SEP = getCharPref (pref, rootNode + "nickCompleteStr", client.ADDRESSED_NICK_SEP); client.INITIAL_VICTIMS = getCharPref (pref, rootNode + "stalkWords", ""); client.DELETE_ON_PART = getCharPref (pref, rootNode + "deleteOnPart", true); client.munger.enabled = getBoolPref (pref, rootNode + "munger", client.munger.enabled); client.smileyText = getBoolPref (pref, rootNode + "munger.smileyText", false); for (var entry in client.munger.entries) client.munger.entries[entry].enabled = getBoolPref (pref, rootNode + "munger." + entry, client.munger.entries[entry].enabled); client.FLASH_WINDOW = getBoolPref (pref, rootNode + "notify.aggressive", true); client.SAVE_SETTINGS = getBoolPref (pref, rootNode + "settings.autoSave", true); client.DEFAULT_STYLE = getCharPref (pref, rootNode + "style.default", "chrome://chatzilla/skin/output-default.css"); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = client.debugMode = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
Components.classes["component:
Components.classes["@mozilla.org/preferences;1"].createInstance();
function readIRCPrefs (rootNode){ if (!getPriv("UniversalXPConnect")) return false; var pref = Components.classes["component://netscape/preferences"].createInstance(); if(!pref) throw ("Can't find pref component."); if (!rootNode) rootNode = "extensions.irc."; if (!rootNode.match(/\.$/)) rootNode += "."; pref = pref.QueryInterface(Components.interfaces.nsIPref); CIRCNetwork.prototype.INITIAL_NICK = getCharPref (pref, rootNode + "nickname", CIRCNetwork.prototype.INITIAL_NICK); CIRCNetwork.prototype.INITIAL_NAME = getCharPref (pref, rootNode + "username", CIRCNetwork.prototype.INITIAL_NAME); CIRCNetwork.prototype.INITIAL_DESC = getCharPref (pref, rootNode + "desc", CIRCNetwork.prototype.INITIAL_DESC); CIRCNetwork.prototype.INITIAL_CHANNEL = getCharPref (pref, rootNode + "channel", CIRCNetwork.prototype.INITIAL_CHANNEL); client.MAX_MESSAGES = getIntPref (pref, rootNode + "views.client.maxlines", client.MAX_MESSAGES); CIRCChannel.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.channel.maxlines", CIRCChannel.prototype.MAX_MESSAGES); CIRCChanUser.prototype.MAX_MESSAGES = getIntPref (pref, rootNode + "views.chanuser.maxlines", CIRCChanUser.prototype.MAX_MESSAGES); var h = client.eventPump.getHook ("event-tracer"); h.enabled = getBoolPref (pref, rootNode + "debug.tracer", h.enabled); }
shell.openPreferredApplication(Components.interfaces.nsIShellService.APPLICATION_MAIL);
shell.openApplication(Components.interfaces.nsIShellService.APPLICATION_MAIL);
readMail: function () { var shell = getShellService(); if (shell) shell.openPreferredApplication(Components.interfaces.nsIShellService.APPLICATION_MAIL); },
shell.openPreferredApplication(Components.interfaces.nsIShellService.APPLICATION_NEWS);
shell.openApplication(Components.interfaces.nsIShellService.APPLICATION_NEWS);
readNews: function () { var shell = getShellService(); if (shell) shell.openPreferredApplication(Components.interfaces.nsIShellService.APPLICATION_NEWS); },
var cachedList = document.getElementById("cacheProvider");
readPhishChoice: function () { var phishPref = document.getElementById("browser.safebrowsing.enabled"); var phishChoice = document.getElementById("browser.safebrowsing.remoteLookups"); var cachedList = document.getElementById("cacheProvider"); var onloadList = document.getElementById("onloadProvider"); if (phishPref.value) { cachedList.disabled = phishChoice.value; onloadList.disabled = !phishChoice.value; } // don't override pref value return undefined; },
if (phishPref.value) { cachedList.disabled = phishChoice.value;
if (phishPref.value)
readPhishChoice: function () { var phishPref = document.getElementById("browser.safebrowsing.enabled"); var phishChoice = document.getElementById("browser.safebrowsing.remoteLookups"); var cachedList = document.getElementById("cacheProvider"); var onloadList = document.getElementById("onloadProvider"); if (phishPref.value) { cachedList.disabled = phishChoice.value; onloadList.disabled = !phishChoice.value; } // don't override pref value return undefined; },
}
readPhishChoice: function () { var phishPref = document.getElementById("browser.safebrowsing.enabled"); var phishChoice = document.getElementById("browser.safebrowsing.remoteLookups"); var cachedList = document.getElementById("cacheProvider"); var onloadList = document.getElementById("onloadProvider"); if (phishPref.value) { cachedList.disabled = phishChoice.value; onloadList.disabled = !phishChoice.value; } // don't override pref value return undefined; },
if ( jQuery.browser.mozilla || jQuery.browser.opera ) document.removeEventListener( "DOMContentLoaded", jQuery.ready, false );
ready: function() { // Make sure that the DOM is not already loaded if ( !jQuery.isReady ) { // Remember that the DOM is ready jQuery.isReady = true; // If there are functions bound, to execute if ( jQuery.readyList ) { // Execute all of them for ( var i = 0; i < jQuery.readyList.length; i++ ) jQuery.readyList[i].apply( document ); // Reset the list of functions jQuery.readyList = null; } } }
jQuery.prototype.ready = function(f) { if ( jQuery.isReady ) f.apply( document ); else { jQuery.readyList.push( f );
ready: function() { if ( !jQuery.isReady ) { jQuery.isReady = true; if ( jQuery.readyList ) { for ( var i = 0; i < jQuery.readyList.length; i++ ) jQuery.readyList[i].apply( document ); jQuery.readyList = null; } }
jQuery.prototype.ready = function(f) { // If the DOM is already ready if ( jQuery.isReady ) // Execute the function immediately f.apply( document ); // Otherwise, remember the function for later else { // Add the function to the wait list jQuery.readyList.push( f ); } return this;};
return this; };
jQuery.prototype.ready = function(f) { // If the DOM is already ready if ( jQuery.isReady ) // Execute the function immediately f.apply( document ); // Otherwise, remember the function for later else { // Add the function to the wait list jQuery.readyList.push( f ); } return this;};
child = aParent.lastChild;
var child = aParent.lastChild;
realHideOpenInTabsMenuItem: function (aParent) { if (!aParent.hasChildNodes()) return; child = aParent.lastChild; var removed = 0; while (child) { var cclass = child.getAttribute("class"); if (cclass == "openintabs-menuitem" || cclass == "openintabs-menuseparator") { var prevchild = child.previousSibling; aParent.removeChild(child); child = prevchild; removed++; if (removed == 2) break; } else { child = child.previousSibling; } } },
var container
var container;
function realizeScript(script){ var container if (script.fileName in console.scripts) { container = console.scripts[script.fileName]; if (!("parentRecord" in container)) { /* source record exists but is not inserted in the source tree, * either we are reloading it, or the user added it manually */ console.scriptsView.childData.appendChild(container); } } else { container = console.scripts[script.fileName] = new ScriptContainerRecord (script.fileName); container.reserveChildren(); console.scriptsView.childData.appendChild(container); } var scriptRec = new ScriptRecord (script); container.appendScriptRecord (scriptRec); /* check to see if this script contains a breakpoint */ for (var i = 0; i < console.breakpoints.childData.length; ++i) { var bpr = console.breakpoints.childData[i]; if (bpr.matchesScriptRecord(scriptRec)) { if (bpr.fileName == scriptRec.script.fileName) { /* if the names match exactly, piggyback the new script record * on the existing breakpoint record. */ bpr.addScriptRecord(scriptRec); } else { /* otherwise, we only matched a pattern, create a new breakpoint * record. */ setBreakpoint (scriptRec.script.fileName, bpr.line); } } } }
/* source record exists but is not inserted in the source tree,
/* container record exists but is not inserted in the scripts view,
function realizeScript(script){ var container if (script.fileName in console.scripts) { container = console.scripts[script.fileName]; if (!("parentRecord" in container)) { /* source record exists but is not inserted in the source tree, * either we are reloading it, or the user added it manually */ console.scriptsView.childData.appendChild(container); } } else { container = console.scripts[script.fileName] = new ScriptContainerRecord (script.fileName); container.reserveChildren(); console.scriptsView.childData.appendChild(container); } var scriptRec = new ScriptRecord (script); container.appendScriptRecord (scriptRec); /* check to see if this script contains a breakpoint */ for (var i = 0; i < console.breakpoints.childData.length; ++i) { var bpr = console.breakpoints.childData[i]; if (bpr.matchesScriptRecord(scriptRec)) { if (bpr.fileName == scriptRec.script.fileName) { /* if the names match exactly, piggyback the new script record * on the existing breakpoint record. */ bpr.addScriptRecord(scriptRec); } else { /* otherwise, we only matched a pattern, create a new breakpoint * record. */ setBreakpoint (scriptRec.script.fileName, bpr.line); } } } }
console.scriptsView.childData.appendChild(container);
if (!console.enableChromeFilter || script.fileName.indexOf ("chrome:") != 0) console.scriptsView.childData.appendChild(container);
function realizeScript(script){ var container if (script.fileName in console.scripts) { container = console.scripts[script.fileName]; if (!("parentRecord" in container)) { /* source record exists but is not inserted in the source tree, * either we are reloading it, or the user added it manually */ console.scriptsView.childData.appendChild(container); } } else { container = console.scripts[script.fileName] = new ScriptContainerRecord (script.fileName); container.reserveChildren(); console.scriptsView.childData.appendChild(container); } var scriptRec = new ScriptRecord (script); container.appendScriptRecord (scriptRec); /* check to see if this script contains a breakpoint */ for (var i = 0; i < console.breakpoints.childData.length; ++i) { var bpr = console.breakpoints.childData[i]; if (bpr.matchesScriptRecord(scriptRec)) { if (bpr.fileName == scriptRec.script.fileName) { /* if the names match exactly, piggyback the new script record * on the existing breakpoint record. */ bpr.addScriptRecord(scriptRec); } else { /* otherwise, we only matched a pattern, create a new breakpoint * record. */ setBreakpoint (scriptRec.script.fileName, bpr.line); } } } }
if ("dbgRealize" in console) { dd ("new scriptrecord: " + formatScript(script) + "\n" + script.functionSource); }
function realizeScript(script){ var container; if (script.fileName in console.scripts) { container = console.scripts[script.fileName]; if (!("parentRecord" in container)) { /* container record exists but is not inserted in the scripts view, * either we are reloading it, or the user added it manually */ if (!console.enableChromeFilter || script.fileName.indexOf ("chrome:") != 0) console.scriptsView.childData.appendChild(container); } } else { container = console.scripts[script.fileName] = new ScriptContainerRecord (script.fileName); container.reserveChildren(); if (!console.enableChromeFilter || script.fileName.indexOf ("chrome:") != 0) console.scriptsView.childData.appendChild(container); } var scriptRec = new ScriptRecord (script); container.appendScriptRecord (scriptRec); /* check to see if this script contains a breakpoint */ for (var i = 0; i < console.breakpoints.childData.length; ++i) { var bpr = console.breakpoints.childData[i]; if (bpr.matchesScriptRecord(scriptRec)) { if (bpr.fileName == scriptRec.script.fileName) { /* if the names match exactly, piggyback the new script record * on the existing breakpoint record. */ bpr.addScriptRecord(scriptRec); } else { /* otherwise, we only matched a pattern, create a new breakpoint * record. */ setBreakpoint (scriptRec.script.fileName, bpr.line); } } }}
MisspelledWord = spellChecker.GetNextMisspelledWord();
gMisspelledWord = spellChecker.GetNextMisspelledWord();
function Recheck(){ //TODO: Should we bother to add a "Recheck" method to interface? try { var curLang = spellChecker.GetCurrentDictionary(); spellChecker.UninitSpellChecker(); spellChecker.InitSpellChecker(); spellChecker.SetCurrentDictionary(curLang); MisspelledWord = spellChecker.GetNextMisspelledWord(); SetWidgetsForMisspelledWord(); } catch(ex) { dump(ex); }}
var fieldValue = inputField.value;
var fieldValue = inputField.input.value;
function Recipients2CompFields(msgCompFields){ if (msgCompFields) { var i = 1; var addrTo = ""; var addrCc = ""; var addrBcc = ""; var addrReply = ""; var addrNg = ""; var addrFollow = ""; var addrOther = ""; var to_Sep = ""; var cc_Sep = ""; var bcc_Sep = ""; var reply_Sep = ""; var ng_Sep = ""; var follow_Sep = ""; var inputField; while ((inputField = awGetInputElement(i))) { var fieldValue = inputField.value; if (fieldValue == null) fieldValue = inputField.getAttribute("value"); if (fieldValue != "") { switch (awGetPopupElement(i).selectedItem.getAttribute("data")) { case "addr_to" : addrTo += to_Sep + fieldValue; to_Sep = ","; break; case "addr_cc" : addrCc += cc_Sep + fieldValue; cc_Sep = ","; break; case "addr_bcc" : addrBcc += bcc_Sep + fieldValue; bcc_Sep = ","; break; case "addr_reply" : addrReply += reply_Sep + fieldValue; reply_Sep = ","; break; case "addr_newsgroups" : addrNg += ng_Sep + fieldValue; ng_Sep = ","; break; case "addr_followup" : addrFollow += follow_Sep + fieldValue; follow_Sep = ","; break; case "addr_other" : addrOther += other_header + ": " + fieldValue + "\n"; break; } } i ++; } msgCompFields.SetTo(addrTo); msgCompFields.SetCc(addrCc); msgCompFields.SetBcc(addrBcc); msgCompFields.SetReplyTo(addrReply); msgCompFields.SetNewsgroups(addrNg); msgCompFields.SetFollowupTo(addrFollow); msgCompFields.SetOtherRandomHeaders(addrOther); } else dump("Message Compose Error: msgCompFields is null (ExtractRecipients)");}
areaCollection = imageMap.childNodes; areaColLen = areaCollection.length; for(j=0; j<areaColLen; j++){
var areaCollection = imageMap.childNodes; var areaColLen = areaCollection.length; for(var j=0; j<areaColLen; j++){
function recreateMap(){ areaCollection = imageMap.childNodes; areaColLen = areaCollection.length; for(j=0; j<areaColLen; j++){ area = areaCollection[j]; shape = area.getAttribute("shape"); shape = shape.toLowerCase(); coords = area.getAttribute("coords"); href = area.getAttribute("href"); target = area.getAttribute("target"); alt = area.getAttribute("alt"); if (shape == "rect") Rect(coords, href, target, alt, true); else if (shape == "circle") Circle(coords, href, target, alt, true); else Poly(coords, href, target, alt, true); }}
window.location = window.redirectURL;
window.location.href = window.redirectURL;
function Redirect() { window.location = window.redirectURL;}
redoTransaction : function () {},
redoTransaction: function () { for (var i=0; i<this.item.length; ++i) { if (this.isValid[i]) { this.RDFC.Init(this.BMDS, this.parent[i]); this.RDFC.InsertElementAt(this.item[i], this.index[i], true); } } },
redoTransaction : function () {},
if (this.isValid[i]) { this.RDFC.Init(this.BMDS, this.parent[i]); this.RDFC.InsertElementAt(this.item[i], this.index[i], true); }
this.RDFC.Init(this.BMDS, this.parent[i]); this.RDFC.InsertElementAt(this.item[i], this.index[i], true);
redoTransaction: function () { this.beginUpdateBatch(); for (var i=0; i<this.item.length; ++i) { if (this.isValid[i]) { this.RDFC.Init(this.BMDS, this.parent[i]); this.RDFC.InsertElementAt(this.item[i], this.index[i], true); } } this.endUpdateBatch(); }
SetUpTree(true);
gNameField.value = ""; SetUpTree(true);
function Refresh(){ // force it to talk to the server SetUpTree(true);}
document.getElementById("item-bookmark").hidden=false;
document.getElementById("command_BrowserBookmark").hidden=false;
function refreshBookmarks() { if(gBookmarksDoc.getElementsByTagName("li").length>0) { document.getElementById("item-bookmark").hidden=false; } }
cview.rdf.Assert (res, cview.rdf.resProgID,
cview.rdf.Assert (res, cview.rdf.resContractID,
function refreshComponentsStep(){ var i; for (i = 0; i < cview.REFRESH_ITEMS_PER_CYCLE; i++) { var cls = cview.pendingComponents.pop(); if (!cls) break; var res = cview.rdf.GetResource ("component:" + (++cview.componentID)); cview.rdf.Assert (res, cview.rdf.resProgID, cview.rdf.GetLiteral(cls.name)); cview.rdf.Assert (res, cview.rdf.resCLSID, cview.rdf.GetLiteral(cls.id)); cview.rdf.Assert (res, cview.rdf.resShow, cview.rdf.litTrue); cview.rdf.Assert (cview.rdf.resRoot, cview.rdf.resCmp, res); } if (cls) cview.componentRefreshTimeout = window.setTimeout ("refreshComponentsStep();", cview.REFRESH_CYCLE_DELAY); else { cview.rdf.setTreeRoot ("component-list", cview.rdf.resRoot); cview.componentMode = "all"; delete cview.componentRefreshTimeout; delete cview.pendingComponents; delete cview.componentID; } cview.visibleComponents += i; refreshLabels(); }
var ccalendar = getDisplayComposite();
var ccalendar = getCompositeCalendar();
function refreshEventTree( eventArray ){ var savedThis = this; var refreshListener = { mEventArray: new Array(), onOperationComplete: function (aCalendar, aStatus, aOperationType, aId, aDateTime) { setTimeout(function () { refreshEventTreeInternal(refreshListener.mEventArray); }, 0); }, onGetResult: function (aCalendar, aStatus, aItemType, aDetail, aCount, aItems) { for (var i = 0; i < aCount; i++) { refreshListener.mEventArray.push(aItems[i]); } } }; var Today = new Date(); //do this to allow all day events to show up all day long var StartDate = new Date( Today.getFullYear(), Today.getMonth(), Today.getDate(), 0, 0, 0 ); var EndDate; var ccalendar = getDisplayComposite(); var filter = 0; filter |= ccalendar.ITEM_FILTER_TYPE_EVENT; switch( document.getElementById( "event-filter-menulist" ).selectedItem.value ) { case "all": StartDate = null; EndDate = null; break; case "today": EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); break; case "next7Days": EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); break; case "next14Days": EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); break; case "next31Days": EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); break; case "thisCalendarMonth": // midnight on first day of this month var startOfMonth = new Date( Today.getFullYear(), Today.getMonth(), 1, 0, 0, 0 ); // midnight on first day of next month var startOfNextMonth = new Date( Today.getFullYear(), (Today.getMonth() + 1), 1, 0, 0, 0 ); // 23:59:59 on last day of this month EndDate = new Date( startOfNextMonth.getTime() - 1000 ); StartDate = startOfMonth; break; case "future": EndDate = null; break; case "current": var SelectedDate = gCalendarWindow.getSelectedDate(); StartDate = new Date( SelectedDate.getFullYear(), SelectedDate.getMonth(), SelectedDate.getDate(), 0, 0, 0 ); EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 ); break; default: dump( "there's no case for "+document.getElementById( "event-filter-menulist" ).selectedItem.value+"\n" ); EndDate = StartDate; break; } gStartDate = StartDate ? jsDateToDateTime(StartDate).getInTimezone(calendarDefaultTimezone()) : null; gEndDate = EndDate ? jsDateToDateTime(EndDate).getInTimezone(calendarDefaultTimezone()) : null; if (StartDate && EndDate) { filter |= ccalendar.ITEM_FILTER_CLASS_OCCURRENCES; } ccalendar.getItems (filter, 0, gStartDate, gEndDate, refreshListener);}
searchText = searchText.toLowerCase();
function refreshEventTreeInternal(eventArray){ var searchText = document.getElementById( "unifinder-search-field" ).value; // XXX match for strings with only whitespace. Skip those too if (searchText.length) { gEventArray = new Array(); var fieldsToSearch = ["DESCRIPTION", "LOCATION", "CATEGORIES", "URL"]; for (var j in eventArray) { var event = eventArray[j]; if (event.title && event.title.toLowerCase().indexOf(searchText) != -1 ) { gEventArray.push(event); } else { for (var k in fieldsToSearch) { var val = event.getProperty(fieldsToSearch[k]); if (val && val.toLowerCase().indexOf(searchText) != -1 ) { gEventArray.push(event); break; } } } } } else { gEventArray = eventArray; } treeView.rowCount = gEventArray.length; var ArrayOfTreeCols = document.getElementById( UnifinderTreeName ).getElementsByTagName( "treecol" ); for( var i = 0; i < ArrayOfTreeCols.length; i++ ) { if( ArrayOfTreeCols[i].getAttribute( "sortActive" ) == "true" ) { treeView.selectedColumn = ArrayOfTreeCols[i].getAttribute( "id" ); treeView.sortDirection = ArrayOfTreeCols[i].getAttribute("sortDirection"); treeView.sortStartedTime = new Date().getTime(); //for null/0 dates gEventArray.sort(compareEvents); break; } } document.getElementById( UnifinderTreeName ).view = treeView; document.getElementById( UnifinderTreeName ).eventView = new calendarEventView( gEventArray ); //select selected events in the tree. selectSelectedEventsInTree( false );}
var settings = getDialogSettings();
getEventsAndDialogSettings( function getEventsAndDialogSettings_response(settings) { var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome: document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1);
function refreshHtml(){ var settings = getDialogSettings(); // I'd like to use calGetString, but it can't do "formatStringFromName". var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome://calendar/locale/calendar.properties"); document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1); var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter); // Fail-safe check to not init twice, to prevent leaking files if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); // 0600 = -rw------- var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile); var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); try { // 0x2A = PR_TRUNCATE, PR_CREATE_FILE, PR_WRONLY // 0600 = -rw------- stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:"+e+"\n"); } document.getElementById("content").contentWindow.location = tempUri.spec;}
var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService);
var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter);
function refreshHtml(){ var settings = getDialogSettings(); // I'd like to use calGetString, but it can't do "formatStringFromName". var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome://calendar/locale/calendar.properties"); document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1); var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter); // Fail-safe check to not init twice, to prevent leaking files if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); // 0600 = -rw------- var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile); var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); try { // 0x2A = PR_TRUNCATE, PR_CREATE_FILE, PR_WRONLY // 0600 = -rw------- stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:"+e+"\n"); } document.getElementById("content").contentWindow.location = tempUri.spec;}
var props = sbs.createBundle("chrome: document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1);
if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile);
function refreshHtml(){ var settings = getDialogSettings(); // I'd like to use calGetString, but it can't do "formatStringFromName". var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome://calendar/locale/calendar.properties"); document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1); var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter); // Fail-safe check to not init twice, to prevent leaking files if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); // 0600 = -rw------- var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile); var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); try { // 0x2A = PR_TRUNCATE, PR_CREATE_FILE, PR_WRONLY // 0600 = -rw------- stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:"+e+"\n"); } document.getElementById("content").contentWindow.location = tempUri.spec;}
var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter);
var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream);
function refreshHtml(){ var settings = getDialogSettings(); // I'd like to use calGetString, but it can't do "formatStringFromName". var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome://calendar/locale/calendar.properties"); document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1); var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter); // Fail-safe check to not init twice, to prevent leaking files if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); // 0600 = -rw------- var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile); var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); try { // 0x2A = PR_TRUNCATE, PR_CREATE_FILE, PR_WRONLY // 0600 = -rw------- stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:"+e+"\n"); } document.getElementById("content").contentWindow.location = tempUri.spec;}
if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile);
try { stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:" + e + "\n"); }
function refreshHtml(){ var settings = getDialogSettings(); // I'd like to use calGetString, but it can't do "formatStringFromName". var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome://calendar/locale/calendar.properties"); document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1); var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter); // Fail-safe check to not init twice, to prevent leaking files if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); // 0600 = -rw------- var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile); var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); try { // 0x2A = PR_TRUNCATE, PR_CREATE_FILE, PR_WRONLY // 0600 = -rw------- stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:"+e+"\n"); } document.getElementById("content").contentWindow.location = tempUri.spec;}
var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); try { stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:"+e+"\n"); } document.getElementById("content").contentWindow.location = tempUri.spec;
document.getElementById("content").contentWindow.location = tempUri.spec; } );
function refreshHtml(){ var settings = getDialogSettings(); // I'd like to use calGetString, but it can't do "formatStringFromName". var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfaces.nsIStringBundleService); var props = sbs.createBundle("chrome://calendar/locale/calendar.properties"); document.title = props.formatStringFromName("PrintPreviewWindowTitle", [settings.title], 1); var printformatter = Components.classes[settings.layoutCId] .createInstance(Components.interfaces.calIPrintFormatter); // Fail-safe check to not init twice, to prevent leaking files if (gTempFile) { gTempFile.remove(false); } const nsIFile = Components.interfaces.nsIFile; var dirService = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties); gTempFile = dirService.get("TmpD", nsIFile); gTempFile.append("calendarPrint.html"); gTempFile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0600); // 0600 = -rw------- var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var tempUri = ioService.newFileURI(gTempFile); var stream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); try { // 0x2A = PR_TRUNCATE, PR_CREATE_FILE, PR_WRONLY // 0600 = -rw------- stream.init(gTempFile, 0x2A, 0600, 0); printformatter.formatToHtml(stream, settings.start, settings.end, settings.eventList.length, settings.eventList, settings.title); stream.close(); } catch (e) { dump("printDialog::refreshHtml:"+e+"\n"); } document.getElementById("content").contentWindow.location = tempUri.spec;}
lastTreeChildrenValue = null; lastTreeChildren = null;
function RefreshList(){ // force it to talk to the server SetUpTree(true);}
d = d.getInTimezone("/mozilla.org/20050126_1/America/Los_Angeles");
d = d.getInTimezone(calendarDefaultTimezone());
function refreshPeriodDates(){ var now = new Date(); var d = new CalDateTime(); d.jsDate = now; //XXX use default timezone d = d.getInTimezone("/mozilla.org/20050126_1/America/Los_Angeles"); // Today: now until midnight of tonight this.today.start = d.clone(); d.hour = d.minute = d.second = 0; d.day++; d.normalize(); this.today.end = d.clone(); // Tomorrow: midnight of next day to +24 hrs this.tomorrow.start = d.clone(); d.day++; d.normalize(); this.tomorrow.end = d.clone(); // Soon: end of tomorrow to 6 six days later (remainder of the week period) this.soon.start = d.clone(); d.day += 6; d.normalize(); this.soon.end = d.clone(); this.periods.forEach(function (when) { void(when.title + ": " + when.start + " -> " + when.end + "\n"); }); this.refreshCalendarQuery();};
SetBusyCursor(window, false);
function RefreshThreadTreeView(){ var selection = SaveThreadPaneSelection(); var currentFolder = GetThreadTreeFolder(); var currentFolderID = currentFolder.getAttribute('ref'); ClearThreadTreeSelection(); currentFolder.setAttribute('ref', currentFolderID); RestoreThreadPaneSelection(selection);}
treeView.selectedColumn = ArrayOfTreeCols[i].getAttribute( "id" ); treeView.sortDirection = ArrayOfTreeCols[i].getAttribute("sortDirection");
toDoTreeView.selectedColumn = ArrayOfTreeCols[i].getAttribute( "id" ); toDoTreeView.sortDirection = ArrayOfTreeCols[i].getAttribute("sortDirection");
function refreshToDoTree( taskArray ){ if( taskArray === false ) taskArray = getTaskTable(); gTaskArray = taskArray; toDoTreeView.rowCount = gTaskArray.length; var ArrayOfTreeCols = document.getElementById( UnifinderTreeName ).getElementsByTagName( "treecol" ); for( var i = 0; i < ArrayOfTreeCols.length; i++ ) { if( ArrayOfTreeCols[i].getAttribute( "sortActive" ) == "true" ) { treeView.selectedColumn = ArrayOfTreeCols[i].getAttribute( "id" ); treeView.sortDirection = ArrayOfTreeCols[i].getAttribute("sortDirection"); gTaskArray.sort(sortTasks); break; } } document.getElementById( ToDoUnifinderTreeName ).view = toDoTreeView; document.getElementById( ToDoUnifinderTreeName ).taskView = new calendarTaskView( gTaskArray );}
document.getElementById('urlbar').value = window.content.location.href;
document.getElementById('urlbar').value = window._content.location.href;
function RefreshUrlbar() { //Refresh the urlbar bar document.getElementById('urlbar').value = window.content.location.href; }
var newObserver = new readOnlyAnnouncer(calendar);
var newObserver = new errorAnnouncer(calendar);
registerCalendar: function(calendar) { // bail if this calendar (or one that looks identical to it) is already registered if (this.findCalendarID(calendar) > 0) { dump ("registerCalendar: calendar already registered\n"); throw Components.results.NS_ERROR_FAILURE; } // Add an observer to track readonly-mode triggers var newObserver = new readOnlyAnnouncer(calendar); calendar.addObserver(newObserver.observer); var pp = this.mRegisterCalendar.params; pp.type = calendar.type; pp.uri = calendar.uri.spec; this.mRegisterCalendar.step(); this.mRegisterCalendar.reset(); //dump("adding [" + this.mDB.lastInsertRowID + "]\n"); //this.mCache[this.mDB.lastInsertRowID] = calendar; this.mCache[this.findCalendarID(calendar)] = calendar; this.notifyObservers("onCalendarRegistered", [calendar]); },