rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
var EndDate;
function getAndSetEventTable( ){ 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 ); switch( document.getElementById( "event-filter-menulist" ).selectedItem.value ) { case "all": return( gEventSource.getAllEvents() ); case "today": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "week": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "2weeks": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "month": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "future": return( gEventSource.getAllFutureEvents() ); case "current": var SelectedDate = gCalendarWindow.getSelectedDate(); MidnightSelectedDate = new Date( SelectedDate.getFullYear(), SelectedDate.getMonth(), SelectedDate.getDate(), 0, 0, 0 ); var EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 ); return( gEventSource.getEventsForRange( MidnightSelectedDate, EndDate ) ); default: dump( "there's no case for "+document.getElementById( "event-filter-menulist" ).selectedItem.value ); return( eventTable = new Array() ); }}
var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 );
EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 );
function getAndSetEventTable( ){ 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 ); switch( document.getElementById( "event-filter-menulist" ).selectedItem.value ) { case "all": return( gEventSource.getAllEvents() ); case "today": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "week": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "2weeks": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "month": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "future": return( gEventSource.getAllFutureEvents() ); case "current": var SelectedDate = gCalendarWindow.getSelectedDate(); MidnightSelectedDate = new Date( SelectedDate.getFullYear(), SelectedDate.getMonth(), SelectedDate.getDate(), 0, 0, 0 ); var EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 ); return( gEventSource.getEventsForRange( MidnightSelectedDate, EndDate ) ); default: dump( "there's no case for "+document.getElementById( "event-filter-menulist" ).selectedItem.value ); return( eventTable = new Array() ); }}
var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) );
EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) );
function getAndSetEventTable( ){ 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 ); switch( document.getElementById( "event-filter-menulist" ).selectedItem.value ) { case "all": return( gEventSource.getAllEvents() ); case "today": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "week": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "2weeks": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "month": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "future": return( gEventSource.getAllFutureEvents() ); case "current": var SelectedDate = gCalendarWindow.getSelectedDate(); MidnightSelectedDate = new Date( SelectedDate.getFullYear(), SelectedDate.getMonth(), SelectedDate.getDate(), 0, 0, 0 ); var EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 ); return( gEventSource.getEventsForRange( MidnightSelectedDate, EndDate ) ); default: dump( "there's no case for "+document.getElementById( "event-filter-menulist" ).selectedItem.value ); return( eventTable = new Array() ); }}
var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) );
EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) );
function getAndSetEventTable( ){ 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 ); switch( document.getElementById( "event-filter-menulist" ).selectedItem.value ) { case "all": return( gEventSource.getAllEvents() ); case "today": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "week": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "2weeks": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "month": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "future": return( gEventSource.getAllFutureEvents() ); case "current": var SelectedDate = gCalendarWindow.getSelectedDate(); MidnightSelectedDate = new Date( SelectedDate.getFullYear(), SelectedDate.getMonth(), SelectedDate.getDate(), 0, 0, 0 ); var EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 ); return( gEventSource.getEventsForRange( MidnightSelectedDate, EndDate ) ); default: dump( "there's no case for "+document.getElementById( "event-filter-menulist" ).selectedItem.value ); return( eventTable = new Array() ); }}
var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) );
EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) );
function getAndSetEventTable( ){ 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 ); switch( document.getElementById( "event-filter-menulist" ).selectedItem.value ) { case "all": return( gEventSource.getAllEvents() ); case "today": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "week": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "2weeks": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "month": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "future": return( gEventSource.getAllFutureEvents() ); case "current": var SelectedDate = gCalendarWindow.getSelectedDate(); MidnightSelectedDate = new Date( SelectedDate.getFullYear(), SelectedDate.getMonth(), SelectedDate.getDate(), 0, 0, 0 ); var EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 ); return( gEventSource.getEventsForRange( MidnightSelectedDate, EndDate ) ); default: dump( "there's no case for "+document.getElementById( "event-filter-menulist" ).selectedItem.value ); return( eventTable = new Array() ); }}
var EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 );
EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 );
function getAndSetEventTable( ){ 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 ); switch( document.getElementById( "event-filter-menulist" ).selectedItem.value ) { case "all": return( gEventSource.getAllEvents() ); case "today": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1 ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "week": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 8 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "2weeks": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 15 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "month": var EndDate = new Date( StartDate.getTime() + ( 1000 * 60 * 60 * 24 * 32 ) ); return( gEventSource.getEventsForRange( StartDate, EndDate ) ); case "future": return( gEventSource.getAllFutureEvents() ); case "current": var SelectedDate = gCalendarWindow.getSelectedDate(); MidnightSelectedDate = new Date( SelectedDate.getFullYear(), SelectedDate.getMonth(), SelectedDate.getDate(), 0, 0, 0 ); var EndDate = new Date( MidnightSelectedDate.getTime() + ( 1000 * 60 * 60 * 24 ) - 1000 ); return( gEventSource.getEventsForRange( MidnightSelectedDate, EndDate ) ); default: dump( "there's no case for "+document.getElementById( "event-filter-menulist" ).selectedItem.value ); return( eventTable = new Array() ); }}
for (var i = 0; i < originalData.length; i ++)
var prevChar = ""; var nextChar = ""; for (var i = 0; i < originalData.length; i ++, prevChar = aChar)
function GetArgs(){ var args = new Object(); var originalData = document.getElementById("args").getAttribute("value"); var data = ""; var separator = String.fromCharCode(1); var quoteChar = ""; for (var i = 0; i < originalData.length; i ++) { var aChar = originalData.charAt(i) var aCharCode = originalData.charCodeAt(i) if (aChar == quoteChar) { quoteChar = ""; data += aChar; } else if (aCharCode == 39 || aCharCode == 34) //quote or double quote { if (quoteChar == "") quoteChar = aChar; data += aChar; } else if (aChar == ",") { if (quoteChar == "") data += separator; else data += aChar } else data += aChar } var pairs = data.split(separator);// dump("Compose: argument: {" + data + "}\n"); for (var i = pairs.length - 1; i >= 0; i--) { var pos = pairs[i].indexOf('='); if (pos == -1) continue; var argname = pairs[i].substring(0, pos); var argvalue = pairs[i].substring(pos + 1); if (argvalue.charAt(0) == "'" && argvalue.charAt(argvalue.length - 1) == "'") args[argname] = argvalue.substring(1, argvalue.length - 1); else args[argname] = unescape(argvalue); dump("[" + argname + "=" + args[argname] + "]\n"); } return args;}
if (aChar == quoteChar)
if ( i < originalData.length - 1) nextChar = originalData.charAt(i + 1); else nextChar = ""; if (aChar == quoteChar && (nextChar == "," || nextChar == ""))
function GetArgs(){ var args = new Object(); var originalData = document.getElementById("args").getAttribute("value"); var data = ""; var separator = String.fromCharCode(1); var quoteChar = ""; for (var i = 0; i < originalData.length; i ++) { var aChar = originalData.charAt(i) var aCharCode = originalData.charCodeAt(i) if (aChar == quoteChar) { quoteChar = ""; data += aChar; } else if (aCharCode == 39 || aCharCode == 34) //quote or double quote { if (quoteChar == "") quoteChar = aChar; data += aChar; } else if (aChar == ",") { if (quoteChar == "") data += separator; else data += aChar } else data += aChar } var pairs = data.split(separator);// dump("Compose: argument: {" + data + "}\n"); for (var i = pairs.length - 1; i >= 0; i--) { var pos = pairs[i].indexOf('='); if (pos == -1) continue; var argname = pairs[i].substring(0, pos); var argvalue = pairs[i].substring(pos + 1); if (argvalue.charAt(0) == "'" && argvalue.charAt(argvalue.length - 1) == "'") args[argname] = argvalue.substring(1, argvalue.length - 1); else args[argname] = unescape(argvalue); dump("[" + argname + "=" + args[argname] + "]\n"); } return args;}
else if (aCharCode == 39 || aCharCode == 34)
else if ((aCharCode == 39 || aCharCode == 34) && prevChar == "=")
function GetArgs(){ var args = new Object(); var originalData = document.getElementById("args").getAttribute("value"); var data = ""; var separator = String.fromCharCode(1); var quoteChar = ""; for (var i = 0; i < originalData.length; i ++) { var aChar = originalData.charAt(i) var aCharCode = originalData.charCodeAt(i) if (aChar == quoteChar) { quoteChar = ""; data += aChar; } else if (aCharCode == 39 || aCharCode == 34) //quote or double quote { if (quoteChar == "") quoteChar = aChar; data += aChar; } else if (aChar == ",") { if (quoteChar == "") data += separator; else data += aChar } else data += aChar } var pairs = data.split(separator);// dump("Compose: argument: {" + data + "}\n"); for (var i = pairs.length - 1; i >= 0; i--) { var pos = pairs[i].indexOf('='); if (pos == -1) continue; var argname = pairs[i].substring(0, pos); var argvalue = pairs[i].substring(pos + 1); if (argvalue.charAt(0) == "'" && argvalue.charAt(argvalue.length - 1) == "'") args[argname] = argvalue.substring(1, argvalue.length - 1); else args[argname] = unescape(argvalue); dump("[" + argname + "=" + args[argname] + "]\n"); } return args;}
if (this.attendees[i].id == id)
if (attendees[i].id == id)
getAttendeeById: function (id) { var attendees = this.getAttendees({}); for (var i = 0; i < attendees.length; i++) if (this.attendees[i].id == id) return attendees[i]; return null; },
if (optionalHint.search(tempID.email) >= 0) {
if (optionalHint.search(tempID.email.toLowerCase()) >= 0) {
function getBestIdentity(identities, optionalHint){ var identity = null; try { // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // normalize case on the optional hint to improve our chances of finding a match optionalHint = optionalHint.toLowerCase(); // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } } catch (ex) {dump (ex + "\n");} // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) {
if (optionalHint.search(tempID.email.slice(start, tempID.email.length).toLowerCase()) >= 0) {
function getBestIdentity(identities, optionalHint){ var identity = null; try { // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // normalize case on the optional hint to improve our chances of finding a match optionalHint = optionalHint.toLowerCase(); // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } } catch (ex) {dump (ex + "\n");} // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
if (optionalHint.search(tempID.email) >= 0) {
if (optionalHint.search(tempID.email.toLowerCase()) >= 0) {
function getBestIdentity(identities, optionalHint){ var identity = null; try { // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } } catch (ex) {dump (ex + "\n");} // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) {
if (optionalHint.search(tempID.email.slice(start, tempID.email.length).toLowerCase()) >= 0) {
function getBestIdentity(identities, optionalHint){ var identity = null; try { // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } } catch (ex) {dump (ex + "\n");} // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
if (identities.Count() > 1 && optionalHint) { var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } if (!identity) {
try { if (identities.Count() > 1 && optionalHint) { var tempID;
function getBestIdentity(identities, optionalHint){ var identity = null; // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
var start = tempID.email.lastIndexOf("@"); if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) {
if (optionalHint.search(tempID.email) >= 0) {
function getBestIdentity(identities, optionalHint){ var identity = null; // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
catch (ex) {dump (ex + "\n");}
function getBestIdentity(identities, optionalHint){ var identity = null; // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
} catch (ex) {dump (ex + "\n");}
function getBestIdentity(identities, optionalHint){ var identity = null; // if we have more than one identity and a hint to help us pick one if (identities.Count() > 1 && optionalHint) { // normalize case on the optional hint to improve our chances of finding a match optionalHint = optionalHint.toLowerCase(); // iterate over all of the identities var tempID; for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); if (optionalHint.search(tempID.email) >= 0) { identity = tempID; break; } } // if we could not find an exact email address match within the hint fields then maybe the message // was to a mailing list. In this scenario, we won't have a match based on email address. // Before we just give up, try and search for just a shared domain between the the hint and // the email addresses for our identities. Hey, it is better than nothing and in the case // of multiple matches here, we'll end up picking the first one anyway which is what we would have done // if we didn't do this second search. This helps the case for corporate users where mailing lists will have the same domain // as one of your multiple identities. if (!identity) { for (id = 0; id < identities.Count(); id++) { tempID = identities.GetElementAt(id).QueryInterface(Components.interfaces.nsIMsgIdentity); // extract out the partial domain var start = tempID.email.lastIndexOf("@"); // be sure to include the @ sign in our search to reduce the risk of false positives if (optionalHint.search(tempID.email.slice(start, tempID.email.length)) >= 0) { identity = tempID; break; } } } } // still no matches? Give up and pick the first one like we used to. if (!identity) identity = identities.GetElementAt(0).QueryInterface(Components.interfaces.nsIMsgIdentity); return identity;}
return null;
getBoolPref: function (aPrefName, aDefVal) { try { return this.mPrefService.GetBoolPref(aPrefName); } catch(e) { return aDefVal != undefined ? aDefVal : null; } },
function getBoolPref (prefObj, prefName, defaultValue)
function getBoolPref (prefName, defaultValue)
function getBoolPref (prefObj, prefName, defaultValue){ var e; try { return prefObj.getBoolPref (prefName); } catch (e) { return defaultValue; } }
return prefObj.getBoolPref (prefName);
return client.prefBranch.getBoolPref (prefName);
function getBoolPref (prefObj, prefName, defaultValue){ var e; try { return prefObj.getBoolPref (prefName); } catch (e) { return defaultValue; } }
dump("no browserElement found\n");
debug("no browserElement found\n");
function GetBrowserDocShell() { var docShell = null; var browserElement = document.getElementById("content"); if (browserElement) { docShell = browserElement.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).docShell; } else { dump("no browserElement found\n"); } return docShell; }
var x = theVersion.indexOf( "." );
var x = version.indexOf( "." );
function getBrowserMajorVersionNumber(){ var version = getBrowserVersionNumber(); if ( version != "unknown" ) { var x = theVersion.indexOf( "." ); if ( x > 0 ) version = version.substring( 0, x ); } return version;}
gLoadInBackground = this.shouldLoadTabInBackground(aEvent);
getBrowserTargetFromEvent: function (aEvent) { if (!aEvent) return null; gLoadInBackground = this.shouldLoadTabInBackground(aEvent); switch (aEvent.type) { case "click": case "dblclick": if (aEvent.button > 1) return null; // Prevent default click handling (e.g. middlemouse.contentLoadURL==true) aEvent.preventDefault(); if (aEvent.button != 1 && !aEvent.metaKey && !aEvent.ctrlKey) return "current"; break; case "keypress": case "command": if (!aEvent.metaKey && !aEvent.ctrlKey) return "current"; break; default: return null; } if (PREF && PREF.getBoolPref("browser.tabs.opentabfor.middleclick")) return "tab"; if (PREF && PREF.getBoolPref("middlemouse.openNewWindow")) return "window"; return null; },
var prefs = Components.classes["component:
var prefs = Components.classes["@mozilla.org/preferences;1"];
function getBrowserURL() { try { var prefs = Components.classes["component://netscape/preferences"]; if (prefs) { prefs = prefs.getService(); if (prefs) prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { var url = prefs.CopyCharPref("browser.chromeURL"); if (url) return url; } } catch(e) { } return "chrome://navigator/content/navigator.xul";}
try { var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var url = prefs.getCharPref("browser.chromeURL"); if (url) return url; } catch(e) { } return "chrome:
return "chrome:
function getBrowserURL() { try { var prefs = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); var url = prefs.getCharPref("browser.chromeURL"); if (url) return url; } catch(e) { } return "chrome://browser/content/navigator.xul";}
var theAgent = navigator.userAgent; var x = theAgent.indexOf( "/" ); var theVersion = "unknown";
var agent = navigator.userAgent; var x = agent.indexOf( "/" ); var version = "unknown";
function getBrowserVersionNumber(){ var theAgent = navigator.userAgent; var x = theAgent.indexOf( "/" ); var theVersion = "unknown"; if ( x >= 0 ) var theVersion = theAgent.substring( x + 1, theAgent.length ); return theVersion;}
var theVersion = theAgent.substring( x + 1, theAgent.length ); return theVersion;
version = agent.substring( x + 1, agent.length ); return version;
function getBrowserVersionNumber(){ var theAgent = navigator.userAgent; var x = theAgent.indexOf( "/" ); var theVersion = "unknown"; if ( x >= 0 ) var theVersion = theAgent.substring( x + 1, theAgent.length ); return theVersion;}
case "bookmarks-button": return "NC:BookmarksRoot";
getBTContainer: function (aNode) { var parent; var item = aNode.id; if (!this.isBTBookmark(item)) return "NC:BookmarksRoot" parent = aNode.parentNode.parentNode; parent = parent.id; switch (parent) { case "BookmarksMenu": return "NC:BookmarksRoot"; case "PersonalToolbar": case "bookmarks-chevron": return "NC:PersonalToolbarFolder"; case "bookmarks-button": return "NC:BookmarksRoot"; default: return parent; } },
var dropLocation;
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup" || target.id == "bookmarks-chevron") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf") { return target.hasChildNodes()? BookmarksUtils.DROP_AFTER:BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.y-overParentBoxObject.y; clientCoordValue = aEvent.clientY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; var dropLocation; // in the first region? if (clientCoordValue-coordValue < border) dropLocation = BookmarksUtils.DROP_BEFORE; // in the last region? else if (clientCoordValue-coordValue >= size-border) dropLocation = BookmarksUtils.DROP_AFTER; else // must be in the middle somewhere return BookmarksUtils.DROP_ON // If the direction of PersonalToolbar is RTL, we invert dropLocation before returning if (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'rtl') dropLocation = -dropLocation; return dropLocation; },
dropLocation = BookmarksUtils.DROP_BEFORE;
return BookmarksUtils.DROP_BEFORE;
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup" || target.id == "bookmarks-chevron") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf") { return target.hasChildNodes()? BookmarksUtils.DROP_AFTER:BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.y-overParentBoxObject.y; clientCoordValue = aEvent.clientY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; var dropLocation; // in the first region? if (clientCoordValue-coordValue < border) dropLocation = BookmarksUtils.DROP_BEFORE; // in the last region? else if (clientCoordValue-coordValue >= size-border) dropLocation = BookmarksUtils.DROP_AFTER; else // must be in the middle somewhere return BookmarksUtils.DROP_ON // If the direction of PersonalToolbar is RTL, we invert dropLocation before returning if (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'rtl') dropLocation = -dropLocation; return dropLocation; },
dropLocation = BookmarksUtils.DROP_AFTER;
return BookmarksUtils.DROP_AFTER;
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup" || target.id == "bookmarks-chevron") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf") { return target.hasChildNodes()? BookmarksUtils.DROP_AFTER:BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.y-overParentBoxObject.y; clientCoordValue = aEvent.clientY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; var dropLocation; // in the first region? if (clientCoordValue-coordValue < border) dropLocation = BookmarksUtils.DROP_BEFORE; // in the last region? else if (clientCoordValue-coordValue >= size-border) dropLocation = BookmarksUtils.DROP_AFTER; else // must be in the middle somewhere return BookmarksUtils.DROP_ON // If the direction of PersonalToolbar is RTL, we invert dropLocation before returning if (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'rtl') dropLocation = -dropLocation; return dropLocation; },
return BookmarksUtils.DROP_ON if (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'rtl') dropLocation = -dropLocation; return dropLocation;
return BookmarksUtils.DROP_ON;
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup" || target.id == "bookmarks-chevron") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf") { return target.hasChildNodes()? BookmarksUtils.DROP_AFTER:BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.y-overParentBoxObject.y; clientCoordValue = aEvent.clientY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; var dropLocation; // in the first region? if (clientCoordValue-coordValue < border) dropLocation = BookmarksUtils.DROP_BEFORE; // in the last region? else if (clientCoordValue-coordValue >= size-border) dropLocation = BookmarksUtils.DROP_AFTER; else // must be in the middle somewhere return BookmarksUtils.DROP_ON // If the direction of PersonalToolbar is RTL, we invert dropLocation before returning if (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'rtl') dropLocation = -dropLocation; return dropLocation; },
return BookmarksUtils.DROP_BEFORE;
return (isLtrPB? BookmarksUtils.DROP_BEFORE : BookmarksUtils.DROP_AFTER);
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") { return BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.screenY; clientCoordValue = aEvent.screenY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; // in the first region? if (clientCoordValue-coordValue < border) return BookmarksUtils.DROP_BEFORE; // in the last region? if (clientCoordValue-coordValue >= size-border) return BookmarksUtils.DROP_AFTER; // must be in the middle somewhere return BookmarksUtils.DROP_ON; },
return BookmarksUtils.DROP_AFTER;
return (isLtrPB? BookmarksUtils.DROP_AFTER : BookmarksUtils.DROP_BEFORE);
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") { return BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.screenY; clientCoordValue = aEvent.screenY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; // in the first region? if (clientCoordValue-coordValue < border) return BookmarksUtils.DROP_BEFORE; // in the last region? if (clientCoordValue-coordValue >= size-border) return BookmarksUtils.DROP_AFTER; // must be in the middle somewhere return BookmarksUtils.DROP_ON; },
isLtrPB = (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'ltr');
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") { return BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.screenY; clientCoordValue = aEvent.screenY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; // We are going to invert the drop-location for RTL PersonalBar isLtrPB = (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'ltr'); // in the first region? if (clientCoordValue-coordValue < border) return (isLtrPB? BookmarksUtils.DROP_BEFORE : BookmarksUtils.DROP_AFTER); // in the last region? if (clientCoordValue-coordValue >= size-border) return (isLtrPB? BookmarksUtils.DROP_AFTER : BookmarksUtils.DROP_BEFORE); // must be in the middle somewhere return BookmarksUtils.DROP_ON; },
return (isLtrPB? BookmarksUtils.DROP_BEFORE : BookmarksUtils.DROP_AFTER);
return BookmarksUtils.DROP_BEFORE;
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") { return BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.screenY; clientCoordValue = aEvent.screenY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; // We are going to invert the drop-location for RTL PersonalBar isLtrPB = (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'ltr'); // in the first region? if (clientCoordValue-coordValue < border) return (isLtrPB? BookmarksUtils.DROP_BEFORE : BookmarksUtils.DROP_AFTER); // in the last region? if (clientCoordValue-coordValue >= size-border) return (isLtrPB? BookmarksUtils.DROP_AFTER : BookmarksUtils.DROP_BEFORE); // must be in the middle somewhere return BookmarksUtils.DROP_ON; },
return (isLtrPB? BookmarksUtils.DROP_AFTER : BookmarksUtils.DROP_BEFORE);
return BookmarksUtils.DROP_AFTER;
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") { return BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.screenY; clientCoordValue = aEvent.screenY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; // We are going to invert the drop-location for RTL PersonalBar isLtrPB = (window.getComputedStyle(document.getElementById("PersonalToolbar"),'').direction == 'ltr'); // in the first region? if (clientCoordValue-coordValue < border) return (isLtrPB? BookmarksUtils.DROP_BEFORE : BookmarksUtils.DROP_AFTER); // in the last region? if (clientCoordValue-coordValue >= size-border) return (isLtrPB? BookmarksUtils.DROP_AFTER : BookmarksUtils.DROP_BEFORE); // must be in the middle somewhere return BookmarksUtils.DROP_ON; },
if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") {
if (target.id == "bookmarks-ptf") { return target.hasChildNodes() ? BookmarksUtils.DROP_AFTER : BookmarksUtils.DROP_ON; } if (target.id == "bookmarks-chevron")
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") { return BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.screenY; clientCoordValue = aEvent.screenY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; // in the first region? if (clientCoordValue-coordValue < border) return BookmarksUtils.DROP_BEFORE; // in the last region? if (clientCoordValue-coordValue >= size-border) return BookmarksUtils.DROP_AFTER; // must be in the middle somewhere return BookmarksUtils.DROP_ON; },
}
getBTOrientation: function (aEvent, aTarget) { var target if (!aTarget) target = aEvent.target; else target = aTarget; if (target.localName == "menu" && target.parentNode.localName != "menupopup") return BookmarksUtils.DROP_ON; if (target.id == "bookmarks-ptf" || target.id == "bookmarks-chevron") { return BookmarksUtils.DROP_ON; } var overButtonBoxObject = target.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var overParentBoxObject = target.parentNode.boxObject.QueryInterface(Components.interfaces.nsIBoxObject); var size, border; var coordValue, clientCoordValue; switch (target.localName) { case "toolbarseparator": case "toolbarbutton": size = overButtonBoxObject.width; coordValue = overButtonBoxObject.x; clientCoordValue = aEvent.clientX; break; case "menuseparator": case "menu": case "menuitem": size = overButtonBoxObject.height; coordValue = overButtonBoxObject.screenY; clientCoordValue = aEvent.screenY; break; default: return BookmarksUtils.DROP_ON; } if (this.isBTContainer(target)) if (target.localName == "toolbarbutton") { // the DROP_BEFORE area excludes the label var iconNode = document.getAnonymousElementByAttribute(target, "class", "toolbarbutton-icon"); border = parseInt(document.defaultView.getComputedStyle(target,"").getPropertyValue("padding-left")) + parseInt(document.defaultView.getComputedStyle(iconNode ,"").getPropertyValue("width")); border = Math.min(size/5,Math.max(border,4)); } else border = size/5; else border = size/2; // in the first region? if (clientCoordValue-coordValue < border) return BookmarksUtils.DROP_BEFORE; // in the last region? if (clientCoordValue-coordValue >= size-border) return BookmarksUtils.DROP_AFTER; // must be in the middle somewhere return BookmarksUtils.DROP_ON; },
dump("aNode.id:"+aNode.id+", localName:"+aNode.localName+"\n");
getBTTarget: function (aNode, aOrientation) { dump("aNode.id:"+aNode.id+", localName:"+aNode.localName+"\n"); var item, parent, index; switch (aNode.id) { case "bookmarks-ptf": parent = "NC:PersonalToolbarFolder"; item = this.getLastVisibleBookmark(); break; case "bookmarks-menu": parent = "NC:BookmarksRoot"; break; default: if (aNode.id == "bookmarks-chevron") { parent = "NC:PersonalToolbarFolder"; break; } if (aOrientation == BookmarksUtils.DROP_ON) parent = aNode.id else { parent = this.getBTContainer(aNode); item = aNode; } } parent = RDF.GetResource(parent); if (aOrientation == BookmarksUtils.DROP_ON) return BookmarksUtils.getTargetFromFolder(parent); item = RDF.GetResource(item.id); RDFC.Init(BMDS, parent); index = RDFC.IndexOf(item); if (aOrientation == BookmarksUtils.DROP_AFTER) ++index; return { parent: parent, index: index }; },
item = this.getLastVisibleBookmark();
item = BookmarksToolbar.getLastVisibleBookmark();
getBTTarget: function (aNode, aOrientation) { dump("aNode.id:"+aNode.id+", localName:"+aNode.localName+"\n"); var item, parent, index; switch (aNode.id) { case "bookmarks-ptf": parent = "NC:PersonalToolbarFolder"; item = this.getLastVisibleBookmark(); break; case "bookmarks-menu": parent = "NC:BookmarksRoot"; break; default: if (aNode.id == "bookmarks-chevron") { parent = "NC:PersonalToolbarFolder"; break; } if (aOrientation == BookmarksUtils.DROP_ON) parent = aNode.id else { parent = this.getBTContainer(aNode); item = aNode; } } parent = RDF.GetResource(parent); if (aOrientation == BookmarksUtils.DROP_ON) return BookmarksUtils.getTargetFromFolder(parent); item = RDF.GetResource(item.id); RDFC.Init(BMDS, parent); index = RDFC.IndexOf(item); if (aOrientation == BookmarksUtils.DROP_AFTER) ++index; return { parent: parent, index: index }; },
case "bookmarks-ptf": parent = "NC:PersonalToolbarFolder"; item = BookmarksToolbar.getLastVisibleBookmark(); break;
getBTTarget: function (aNode, aOrientation) { var item, parent, index; switch (aNode.id) { case "bookmarks-ptf": parent = "NC:PersonalToolbarFolder"; item = BookmarksToolbar.getLastVisibleBookmark(); break; case "BookmarksMenu": parent = "NC:BookmarksRoot"; break; case "bookmarks-button": parent = "NC:BookmarksRoot"; break; case "bookmarks-chevron": parent = "NC:PersonalToolbarFolder"; item = document.getElementById("bookmarks-ptf").lastChild; aOrientation == BookmarksUtils.DROP_AFTER; break; default: if (aOrientation == BookmarksUtils.DROP_ON) parent = aNode.id else { parent = this.getBTContainer(aNode); item = aNode; } } parent = RDF.GetResource(parent); if (aOrientation == BookmarksUtils.DROP_ON) return BookmarksUtils.getTargetFromFolder(parent); item = RDF.GetResource(item.id); RDFC.Init(BMDS, parent); index = RDFC.IndexOf(item); if (aOrientation == BookmarksUtils.DROP_AFTER) ++index; return { parent: parent, index: index }; },
parent = "NC:BookmarksRoot"; break;
getBTTarget: function (aNode, aOrientation) { var item, parent, index; switch (aNode.id) { case "bookmarks-ptf": parent = "NC:PersonalToolbarFolder"; item = BookmarksToolbar.getLastVisibleBookmark(); break; case "BookmarksMenu": parent = "NC:BookmarksRoot"; break; case "bookmarks-button": parent = "NC:BookmarksRoot"; break; case "bookmarks-chevron": parent = "NC:PersonalToolbarFolder"; item = document.getElementById("bookmarks-ptf").lastChild; aOrientation == BookmarksUtils.DROP_AFTER; break; default: if (aOrientation == BookmarksUtils.DROP_ON) parent = aNode.id else { parent = this.getBTContainer(aNode); item = aNode; } } parent = RDF.GetResource(parent); if (aOrientation == BookmarksUtils.DROP_ON) return BookmarksUtils.getTargetFromFolder(parent); item = RDF.GetResource(item.id); RDFC.Init(BMDS, parent); index = RDFC.IndexOf(item); if (aOrientation == BookmarksUtils.DROP_AFTER) ++index; return { parent: parent, index: index }; },
item = document.getElementById("bookmarks-ptf").lastChild; aOrientation == BookmarksUtils.DROP_AFTER;
getBTTarget: function (aNode, aOrientation) { var item, parent, index; switch (aNode.id) { case "bookmarks-ptf": parent = "NC:PersonalToolbarFolder"; item = BookmarksToolbar.getLastVisibleBookmark(); break; case "BookmarksMenu": parent = "NC:BookmarksRoot"; break; case "bookmarks-button": parent = "NC:BookmarksRoot"; break; case "bookmarks-chevron": parent = "NC:PersonalToolbarFolder"; item = document.getElementById("bookmarks-ptf").lastChild; aOrientation == BookmarksUtils.DROP_AFTER; break; default: if (aOrientation == BookmarksUtils.DROP_ON) parent = aNode.id else { parent = this.getBTContainer(aNode); item = aNode; } } parent = RDF.GetResource(parent); if (aOrientation == BookmarksUtils.DROP_ON) return BookmarksUtils.getTargetFromFolder(parent); item = RDF.GetResource(item.id); RDFC.Init(BMDS, parent); index = RDFC.IndexOf(item); if (aOrientation == BookmarksUtils.DROP_AFTER) ++index; return { parent: parent, index: index }; },
try { doc.getElementById('PhoneticFirstName').value = cardproperty.phoneticFirstName; doc.getElementById('PhoneticLastName').value = cardproperty.phoneticLastName; } catch (ex) {}
function GetCardValues(cardproperty, doc){ if ( cardproperty ) { doc.getElementById('FirstName').value = cardproperty.firstName; doc.getElementById('LastName').value = cardproperty.lastName; doc.getElementById('DisplayName').value = cardproperty.displayName; doc.getElementById('NickName').value = cardproperty.nickName; doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail; doc.getElementById('SecondEmail').value = cardproperty.secondEmail; doc.getElementById('ScreenName').value = cardproperty.aimScreenName; var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) popup.value = cardproperty.preferMailFormat; doc.getElementById('WorkPhone').value = cardproperty.workPhone; doc.getElementById('HomePhone').value = cardproperty.homePhone; doc.getElementById('FaxNumber').value = cardproperty.faxNumber; doc.getElementById('PagerNumber').value = cardproperty.pagerNumber; doc.getElementById('CellularNumber').value = cardproperty.cellularNumber; doc.getElementById('HomeAddress').value = cardproperty.homeAddress; doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2; doc.getElementById('HomeCity').value = cardproperty.homeCity; doc.getElementById('HomeState').value = cardproperty.homeState; doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode; doc.getElementById('HomeCountry').value = cardproperty.homeCountry; doc.getElementById('WebPage2').value = cardproperty.webPage2; doc.getElementById('JobTitle').value = cardproperty.jobTitle; doc.getElementById('Department').value = cardproperty.department; doc.getElementById('Company').value = cardproperty.company; doc.getElementById('WorkAddress').value = cardproperty.workAddress; doc.getElementById('WorkAddress2').value = cardproperty.workAddress2; doc.getElementById('WorkCity').value = cardproperty.workCity; doc.getElementById('WorkState').value = cardproperty.workState; doc.getElementById('WorkZipCode').value = cardproperty.workZipCode; doc.getElementById('WorkCountry').value = cardproperty.workCountry; doc.getElementById('WebPage1').value = cardproperty.webPage1; doc.getElementById('Custom1').value = cardproperty.custom1; doc.getElementById('Custom2').value = cardproperty.custom2; doc.getElementById('Custom3').value = cardproperty.custom3; doc.getElementById('Custom4').value = cardproperty.custom4; doc.getElementById('Notes').value = cardproperty.notes; }}
if ( cardproperty ) { doc.getElementById('FirstName').value = cardproperty.firstName; doc.getElementById('LastName').value = cardproperty.lastName; doc.getElementById('DisplayName').value = cardproperty.displayName; doc.getElementById('NickName').value = cardproperty.nickName;
if (!cardproperty) return;
function GetCardValues(cardproperty, doc){ if ( cardproperty ) { doc.getElementById('FirstName').value = cardproperty.firstName; doc.getElementById('LastName').value = cardproperty.lastName; doc.getElementById('DisplayName').value = cardproperty.displayName; doc.getElementById('NickName').value = cardproperty.nickName; doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail; doc.getElementById('SecondEmail').value = cardproperty.secondEmail; doc.getElementById('ScreenName').value = cardproperty.aimScreenName; var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) popup.value = cardproperty.preferMailFormat; doc.getElementById('WorkPhone').value = cardproperty.workPhone; doc.getElementById('HomePhone').value = cardproperty.homePhone; doc.getElementById('FaxNumber').value = cardproperty.faxNumber; doc.getElementById('PagerNumber').value = cardproperty.pagerNumber; doc.getElementById('CellularNumber').value = cardproperty.cellularNumber; doc.getElementById('HomeAddress').value = cardproperty.homeAddress; doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2; doc.getElementById('HomeCity').value = cardproperty.homeCity; doc.getElementById('HomeState').value = cardproperty.homeState; doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode; doc.getElementById('HomeCountry').value = cardproperty.homeCountry; doc.getElementById('WebPage2').value = cardproperty.webPage2; doc.getElementById('JobTitle').value = cardproperty.jobTitle; doc.getElementById('Department').value = cardproperty.department; doc.getElementById('Company').value = cardproperty.company; doc.getElementById('WorkAddress').value = cardproperty.workAddress; doc.getElementById('WorkAddress2').value = cardproperty.workAddress2; doc.getElementById('WorkCity').value = cardproperty.workCity; doc.getElementById('WorkState').value = cardproperty.workState; doc.getElementById('WorkZipCode').value = cardproperty.workZipCode; doc.getElementById('WorkCountry').value = cardproperty.workCountry; doc.getElementById('WebPage1').value = cardproperty.webPage1; doc.getElementById('Custom1').value = cardproperty.custom1; doc.getElementById('Custom2').value = cardproperty.custom2; doc.getElementById('Custom3').value = cardproperty.custom3; doc.getElementById('Custom4').value = cardproperty.custom4; doc.getElementById('Notes').value = cardproperty.notes; // get phonetic fields if exist try { doc.getElementById('PhoneticFirstName').value = cardproperty.phoneticFirstName; doc.getElementById('PhoneticLastName').value = cardproperty.phoneticLastName; } catch (ex) {} }}
doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail; doc.getElementById('SecondEmail').value = cardproperty.secondEmail; doc.getElementById('ScreenName').value = cardproperty.aimScreenName;
for (var i = kVcardFields.length; i-- > 0; ) doc.getElementById(kVcardFields[i][0]).value = cardproperty[kVcardFields[i][1]];
function GetCardValues(cardproperty, doc){ if ( cardproperty ) { doc.getElementById('FirstName').value = cardproperty.firstName; doc.getElementById('LastName').value = cardproperty.lastName; doc.getElementById('DisplayName').value = cardproperty.displayName; doc.getElementById('NickName').value = cardproperty.nickName; doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail; doc.getElementById('SecondEmail').value = cardproperty.secondEmail; doc.getElementById('ScreenName').value = cardproperty.aimScreenName; var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) popup.value = cardproperty.preferMailFormat; doc.getElementById('WorkPhone').value = cardproperty.workPhone; doc.getElementById('HomePhone').value = cardproperty.homePhone; doc.getElementById('FaxNumber').value = cardproperty.faxNumber; doc.getElementById('PagerNumber').value = cardproperty.pagerNumber; doc.getElementById('CellularNumber').value = cardproperty.cellularNumber; doc.getElementById('HomeAddress').value = cardproperty.homeAddress; doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2; doc.getElementById('HomeCity').value = cardproperty.homeCity; doc.getElementById('HomeState').value = cardproperty.homeState; doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode; doc.getElementById('HomeCountry').value = cardproperty.homeCountry; doc.getElementById('WebPage2').value = cardproperty.webPage2; doc.getElementById('JobTitle').value = cardproperty.jobTitle; doc.getElementById('Department').value = cardproperty.department; doc.getElementById('Company').value = cardproperty.company; doc.getElementById('WorkAddress').value = cardproperty.workAddress; doc.getElementById('WorkAddress2').value = cardproperty.workAddress2; doc.getElementById('WorkCity').value = cardproperty.workCity; doc.getElementById('WorkState').value = cardproperty.workState; doc.getElementById('WorkZipCode').value = cardproperty.workZipCode; doc.getElementById('WorkCountry').value = cardproperty.workCountry; doc.getElementById('WebPage1').value = cardproperty.webPage1; doc.getElementById('Custom1').value = cardproperty.custom1; doc.getElementById('Custom2').value = cardproperty.custom2; doc.getElementById('Custom3').value = cardproperty.custom3; doc.getElementById('Custom4').value = cardproperty.custom4; doc.getElementById('Notes').value = cardproperty.notes; // get phonetic fields if exist try { doc.getElementById('PhoneticFirstName').value = cardproperty.phoneticFirstName; doc.getElementById('PhoneticLastName').value = cardproperty.phoneticLastName; } catch (ex) {} }}
var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) popup.value = cardproperty.preferMailFormat;
var popup = document.getElementById("PreferMailFormatPopup"); if (popup) popup.value = cardproperty.preferMailFormat;
function GetCardValues(cardproperty, doc){ if ( cardproperty ) { doc.getElementById('FirstName').value = cardproperty.firstName; doc.getElementById('LastName').value = cardproperty.lastName; doc.getElementById('DisplayName').value = cardproperty.displayName; doc.getElementById('NickName').value = cardproperty.nickName; doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail; doc.getElementById('SecondEmail').value = cardproperty.secondEmail; doc.getElementById('ScreenName').value = cardproperty.aimScreenName; var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) popup.value = cardproperty.preferMailFormat; doc.getElementById('WorkPhone').value = cardproperty.workPhone; doc.getElementById('HomePhone').value = cardproperty.homePhone; doc.getElementById('FaxNumber').value = cardproperty.faxNumber; doc.getElementById('PagerNumber').value = cardproperty.pagerNumber; doc.getElementById('CellularNumber').value = cardproperty.cellularNumber; doc.getElementById('HomeAddress').value = cardproperty.homeAddress; doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2; doc.getElementById('HomeCity').value = cardproperty.homeCity; doc.getElementById('HomeState').value = cardproperty.homeState; doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode; doc.getElementById('HomeCountry').value = cardproperty.homeCountry; doc.getElementById('WebPage2').value = cardproperty.webPage2; doc.getElementById('JobTitle').value = cardproperty.jobTitle; doc.getElementById('Department').value = cardproperty.department; doc.getElementById('Company').value = cardproperty.company; doc.getElementById('WorkAddress').value = cardproperty.workAddress; doc.getElementById('WorkAddress2').value = cardproperty.workAddress2; doc.getElementById('WorkCity').value = cardproperty.workCity; doc.getElementById('WorkState').value = cardproperty.workState; doc.getElementById('WorkZipCode').value = cardproperty.workZipCode; doc.getElementById('WorkCountry').value = cardproperty.workCountry; doc.getElementById('WebPage1').value = cardproperty.webPage1; doc.getElementById('Custom1').value = cardproperty.custom1; doc.getElementById('Custom2').value = cardproperty.custom2; doc.getElementById('Custom3').value = cardproperty.custom3; doc.getElementById('Custom4').value = cardproperty.custom4; doc.getElementById('Notes').value = cardproperty.notes; // get phonetic fields if exist try { doc.getElementById('PhoneticFirstName').value = cardproperty.phoneticFirstName; doc.getElementById('PhoneticLastName').value = cardproperty.phoneticLastName; } catch (ex) {} }}
doc.getElementById('WorkPhone').value = cardproperty.workPhone; doc.getElementById('HomePhone').value = cardproperty.homePhone; doc.getElementById('FaxNumber').value = cardproperty.faxNumber; doc.getElementById('PagerNumber').value = cardproperty.pagerNumber; doc.getElementById('CellularNumber').value = cardproperty.cellularNumber; doc.getElementById('HomeAddress').value = cardproperty.homeAddress; doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2; doc.getElementById('HomeCity').value = cardproperty.homeCity; doc.getElementById('HomeState').value = cardproperty.homeState; doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode; doc.getElementById('HomeCountry').value = cardproperty.homeCountry; doc.getElementById('WebPage2').value = cardproperty.webPage2; doc.getElementById('JobTitle').value = cardproperty.jobTitle; doc.getElementById('Department').value = cardproperty.department; doc.getElementById('Company').value = cardproperty.company; doc.getElementById('WorkAddress').value = cardproperty.workAddress; doc.getElementById('WorkAddress2').value = cardproperty.workAddress2; doc.getElementById('WorkCity').value = cardproperty.workCity; doc.getElementById('WorkState').value = cardproperty.workState; doc.getElementById('WorkZipCode').value = cardproperty.workZipCode; doc.getElementById('WorkCountry').value = cardproperty.workCountry; doc.getElementById('WebPage1').value = cardproperty.webPage1; doc.getElementById('Custom1').value = cardproperty.custom1; doc.getElementById('Custom2').value = cardproperty.custom2; doc.getElementById('Custom3').value = cardproperty.custom3; doc.getElementById('Custom4').value = cardproperty.custom4; doc.getElementById('Notes').value = cardproperty.notes; try { doc.getElementById('PhoneticFirstName').value = cardproperty.phoneticFirstName; doc.getElementById('PhoneticLastName').value = cardproperty.phoneticLastName; } catch (ex) {}
try { doc.getElementById("PhoneticFirstName").value = cardproperty.phoneticFirstName; doc.getElementById("PhoneticLastName").value = cardproperty.phoneticLastName;
function GetCardValues(cardproperty, doc){ if ( cardproperty ) { doc.getElementById('FirstName').value = cardproperty.firstName; doc.getElementById('LastName').value = cardproperty.lastName; doc.getElementById('DisplayName').value = cardproperty.displayName; doc.getElementById('NickName').value = cardproperty.nickName; doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail; doc.getElementById('SecondEmail').value = cardproperty.secondEmail; doc.getElementById('ScreenName').value = cardproperty.aimScreenName; var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) popup.value = cardproperty.preferMailFormat; doc.getElementById('WorkPhone').value = cardproperty.workPhone; doc.getElementById('HomePhone').value = cardproperty.homePhone; doc.getElementById('FaxNumber').value = cardproperty.faxNumber; doc.getElementById('PagerNumber').value = cardproperty.pagerNumber; doc.getElementById('CellularNumber').value = cardproperty.cellularNumber; doc.getElementById('HomeAddress').value = cardproperty.homeAddress; doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2; doc.getElementById('HomeCity').value = cardproperty.homeCity; doc.getElementById('HomeState').value = cardproperty.homeState; doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode; doc.getElementById('HomeCountry').value = cardproperty.homeCountry; doc.getElementById('WebPage2').value = cardproperty.webPage2; doc.getElementById('JobTitle').value = cardproperty.jobTitle; doc.getElementById('Department').value = cardproperty.department; doc.getElementById('Company').value = cardproperty.company; doc.getElementById('WorkAddress').value = cardproperty.workAddress; doc.getElementById('WorkAddress2').value = cardproperty.workAddress2; doc.getElementById('WorkCity').value = cardproperty.workCity; doc.getElementById('WorkState').value = cardproperty.workState; doc.getElementById('WorkZipCode').value = cardproperty.workZipCode; doc.getElementById('WorkCountry').value = cardproperty.workCountry; doc.getElementById('WebPage1').value = cardproperty.webPage1; doc.getElementById('Custom1').value = cardproperty.custom1; doc.getElementById('Custom2').value = cardproperty.custom2; doc.getElementById('Custom3').value = cardproperty.custom3; doc.getElementById('Custom4').value = cardproperty.custom4; doc.getElementById('Notes').value = cardproperty.notes; // get phonetic fields if exist try { doc.getElementById('PhoneticFirstName').value = cardproperty.phoneticFirstName; doc.getElementById('PhoneticLastName').value = cardproperty.phoneticLastName; } catch (ex) {} }}
catch (ex) {}
function GetCardValues(cardproperty, doc){ if ( cardproperty ) { doc.getElementById('FirstName').value = cardproperty.firstName; doc.getElementById('LastName').value = cardproperty.lastName; doc.getElementById('DisplayName').value = cardproperty.displayName; doc.getElementById('NickName').value = cardproperty.nickName; doc.getElementById('PrimaryEmail').value = cardproperty.primaryEmail; doc.getElementById('SecondEmail').value = cardproperty.secondEmail; doc.getElementById('ScreenName').value = cardproperty.aimScreenName; var popup = document.getElementById('PreferMailFormatPopup'); if ( popup ) popup.value = cardproperty.preferMailFormat; doc.getElementById('WorkPhone').value = cardproperty.workPhone; doc.getElementById('HomePhone').value = cardproperty.homePhone; doc.getElementById('FaxNumber').value = cardproperty.faxNumber; doc.getElementById('PagerNumber').value = cardproperty.pagerNumber; doc.getElementById('CellularNumber').value = cardproperty.cellularNumber; doc.getElementById('HomeAddress').value = cardproperty.homeAddress; doc.getElementById('HomeAddress2').value = cardproperty.homeAddress2; doc.getElementById('HomeCity').value = cardproperty.homeCity; doc.getElementById('HomeState').value = cardproperty.homeState; doc.getElementById('HomeZipCode').value = cardproperty.homeZipCode; doc.getElementById('HomeCountry').value = cardproperty.homeCountry; doc.getElementById('WebPage2').value = cardproperty.webPage2; doc.getElementById('JobTitle').value = cardproperty.jobTitle; doc.getElementById('Department').value = cardproperty.department; doc.getElementById('Company').value = cardproperty.company; doc.getElementById('WorkAddress').value = cardproperty.workAddress; doc.getElementById('WorkAddress2').value = cardproperty.workAddress2; doc.getElementById('WorkCity').value = cardproperty.workCity; doc.getElementById('WorkState').value = cardproperty.workState; doc.getElementById('WorkZipCode').value = cardproperty.workZipCode; doc.getElementById('WorkCountry').value = cardproperty.workCountry; doc.getElementById('WebPage1').value = cardproperty.webPage1; doc.getElementById('Custom1').value = cardproperty.custom1; doc.getElementById('Custom2').value = cardproperty.custom2; doc.getElementById('Custom3').value = cardproperty.custom3; doc.getElementById('Custom4').value = cardproperty.custom4; doc.getElementById('Notes').value = cardproperty.notes; // get phonetic fields if exist try { doc.getElementById('PhoneticFirstName').value = cardproperty.phoneticFirstName; doc.getElementById('PhoneticLastName').value = cardproperty.phoneticLastName; } catch (ex) {} }}
prop.AppendElement(gLockAtoms[baseArray[index]["lockCol"]]); },
prop.AppendElement(gLockAtoms[gPrefArray[index].lockCol]); },
getCellProperties : function(index, col, prop) { prop.AppendElement(gLockAtoms[baseArray[index]["lockCol"]]); },
if( (column.id || column) == "unifinder-todo-tree-col-priority" )
if( (typeof(column)=="object" ? column.id : column) == "unifinder-todo-tree-col-priority" )
getCellProperties : function( row,column, props ) { calendarToDo = gTaskArray[row]; var aserv=Components.classes["@mozilla.org/atom-service;1"].createInstance(Components.interfaces.nsIAtomService); // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. if( (column.id || column) == "unifinder-todo-tree-col-priority" ) { if(calendarToDo.priority > 0 && calendarToDo.priority < 5) props.AppendElement(aserv.getAtom("highpriority")); if(calendarToDo.priority > 5 && calendarToDo.priority < 10) props.AppendElement(aserv.getAtom("lowpriority")); } props.AppendElement(aserv.getAtom(ToDoProgressAtom(calendarToDo))); },
startText = "All day " + startDate;
startText = unifinderAlldayLabel + " " + startDate;
getCellText : function(row,column) { calendarEvent = gEventArray[row]; var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties"); switch( column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); var startTime = formatUnifinderEventTime( eventStartDate ); var startDate = formatUnifinderEventDate( eventStartDate ); if( calendarEvent.allDay ) { startText = "All day " + startDate; } else { startText = startDate + " " + startTime; } return( startText ); case "unifinder-search-results-tree-col-enddate": var eventEndDate = getNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; var eventEndDate = new Date( actualEndDate ); var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); if( calendarEvent.allDay ) { endText = "All day " + endDate; } else { endText = endDate + " " + endTime; } return( endText ); case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( calendarStringBundle.GetStringFromName( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( calendarStringBundle.GetStringFromName( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( calendarStringBundle.GetStringFromName( "Cancelled" ) ); default: return false; } return false; case "unifinder-search-results-tree-col-filename": var thisCalendar = gCalendarWindow.calendarManager.getCalendarByName( calendarEvent.parent.server ); if( thisCalendar ) return( thisCalendar.getAttribute( "http://home.netscape.com/NC-rdf#name" ) ); else return( "" ); default: return false; } }
endText = "All day " + endDate;
endText = unifinderAlldayLabel + " " + endDate;
getCellText : function(row,column) { calendarEvent = gEventArray[row]; var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties"); switch( column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); var startTime = formatUnifinderEventTime( eventStartDate ); var startDate = formatUnifinderEventDate( eventStartDate ); if( calendarEvent.allDay ) { startText = "All day " + startDate; } else { startText = startDate + " " + startTime; } return( startText ); case "unifinder-search-results-tree-col-enddate": var eventEndDate = getNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; var eventEndDate = new Date( actualEndDate ); var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); if( calendarEvent.allDay ) { endText = "All day " + endDate; } else { endText = endDate + " " + endTime; } return( endText ); case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( calendarStringBundle.GetStringFromName( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( calendarStringBundle.GetStringFromName( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( calendarStringBundle.GetStringFromName( "Cancelled" ) ); default: return false; } return false; case "unifinder-search-results-tree-col-filename": var thisCalendar = gCalendarWindow.calendarManager.getCalendarByName( calendarEvent.parent.server ); if( thisCalendar ) return( thisCalendar.getAttribute( "http://home.netscape.com/NC-rdf#name" ) ); else return( "" ); default: return false; } }
return( calendarEvent.categories );
return( calendarEvent.getProperty("CATEGORIES") );
getCellText : function(row,column) { calendarEvent = gEventArray[row]; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( typeof(column)=="object" ? column.id : column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": return formatUnifinderEventDateTime(calendarEvent.startDate); case "unifinder-search-results-tree-col-enddate": var eventEndDate = calendarEvent.endDate.clone(); // XXX reimplement //var eventEndDate = getCurrentNextOrPreviousRecurrence( calendarEvent ); if (calendarEvent.startDate.isDate) // display enddate is ical enddate - 1 eventEndDate.day = eventEndDate.day - 1; return formatUnifinderEventDateTime(eventEndDate); case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.getProperty("LOCATION") ); case "unifinder-search-results-tree-col-status": return getEventStatusString(calendarEvent); case "unifinder-search-results-tree-col-calendarname": return calendarEvent.calendar.name; default: return false; } }
return;
return false;
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return; switch( column ) { case "unifinder-todo-tree-col-completed": return( " " ); case "unifinder-todo-tree-col-priority": return( " " ); case "unifinder-todo-tree-col-title": if( calendarToDo.title == "" ) var titleText = "Untitled"; else var titleText = calendarToDo.title; return( titleText ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderEventDate( new Date( calendarToDo.start.getTime() ) ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderEventDate( new Date( calendarToDo.due.getTime() ) ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderEventDate( new Date( calendarToDo.completed.getTime() ) ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percentcomplete ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); } }
var titleText = "Untitled";
titleText = "Untitled";
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return; switch( column ) { case "unifinder-todo-tree-col-completed": return( " " ); case "unifinder-todo-tree-col-priority": return( " " ); case "unifinder-todo-tree-col-title": if( calendarToDo.title == "" ) var titleText = "Untitled"; else var titleText = calendarToDo.title; return( titleText ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderEventDate( new Date( calendarToDo.start.getTime() ) ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderEventDate( new Date( calendarToDo.due.getTime() ) ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderEventDate( new Date( calendarToDo.completed.getTime() ) ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percentcomplete ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); } }
var titleText = calendarToDo.title;
titleText = calendarToDo.title;
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return; switch( column ) { case "unifinder-todo-tree-col-completed": return( " " ); case "unifinder-todo-tree-col-priority": return( " " ); case "unifinder-todo-tree-col-title": if( calendarToDo.title == "" ) var titleText = "Untitled"; else var titleText = calendarToDo.title; return( titleText ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderEventDate( new Date( calendarToDo.start.getTime() ) ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderEventDate( new Date( calendarToDo.due.getTime() ) ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderEventDate( new Date( calendarToDo.completed.getTime() ) ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percentcomplete ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); } }
default: return false;
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return; switch( column ) { case "unifinder-todo-tree-col-completed": return( " " ); case "unifinder-todo-tree-col-priority": return( " " ); case "unifinder-todo-tree-col-title": if( calendarToDo.title == "" ) var titleText = "Untitled"; else var titleText = calendarToDo.title; return( titleText ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderEventDate( new Date( calendarToDo.start.getTime() ) ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderEventDate( new Date( calendarToDo.due.getTime() ) ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderEventDate( new Date( calendarToDo.completed.getTime() ) ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percentcomplete ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); } }
var eventEndDate = new Date( actualEndDate );
eventEndDate = new Date( actualEndDate );
getCellText : function(row,column) { calendarEvent = gEventArray[row]; switch( column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); var startTime = formatUnifinderEventTime( eventStartDate ); var startDate = formatUnifinderEventDate( eventStartDate ); if( calendarEvent.allDay ) { return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [startDate])); } else { return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [startDate, startTime])); } case "unifinder-search-results-tree-col-enddate": var eventEndDate = getNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; var eventEndDate = new Date( actualEndDate ); var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); if( calendarEvent.allDay ) { return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [endDate])); } else { return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [endDate, endTime])); } case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( gCalendarBundle.getString( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( gCalendarBundle.getString( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( gCalendarBundle.getString( "Cancelled" ) ); default: return false; } return false; case "unifinder-search-results-tree-col-filename": var thisCalendar = gCalendarWindow.calendarManager.getCalendarByName( calendarEvent.parent.server ); if( thisCalendar ) return( thisCalendar.getAttribute( "http://home.netscape.com/NC-rdf#name" ) ); else return( "" ); default: return false; } }
var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); if( calendarEvent.allDay ) { return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [endDate])); } else { return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [endDate, endTime]));
if( calendarEvent.allDay ) { eventEndDate.setDate( eventEndDate.getDate() - 1 ); var endDate = formatUnifinderEventDate( eventEndDate ); return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [endDate])); } else { var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [endDate, endTime]));
getCellText : function(row,column) { calendarEvent = gEventArray[row]; switch( column.id ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); var startTime = formatUnifinderEventTime( eventStartDate ); var startDate = formatUnifinderEventDate( eventStartDate ); if( calendarEvent.allDay ) { return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [startDate])); } else { return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [startDate, startTime])); } case "unifinder-search-results-tree-col-enddate": var eventEndDate = getNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; eventEndDate = new Date( actualEndDate ); var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); if( calendarEvent.allDay ) { return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [endDate])); } else { return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [endDate, endTime])); } case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( gCalendarBundle.getString( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( gCalendarBundle.getString( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( gCalendarBundle.getString( "Cancelled" ) ); default: return false; } return false; case "unifinder-search-results-tree-col-filename": var thisCalendar = gCalendarWindow.calendarManager.getCalendarByName( calendarEvent.parent.server ); if( thisCalendar ) return( thisCalendar.getAttribute( "http://home.netscape.com/NC-rdf#name" ) ); else return( "" ); default: return false; } }
switch( column.id || column )
switch( typeof(column)=="object" ? column.id : column )
getCellText : function(row,column) { calendarEvent = gEventArray[row]; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( column.id || column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); return formatUnifinderEventDateTime(eventStartDate, calendarEvent.allDay); case "unifinder-search-results-tree-col-enddate": var eventEndDate = getNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; eventEndDate = new Date( actualEndDate ); if (calendarEvent.allDay) // display enddate is ical enddate - 1 //user-enddate is ical-enddate - 1 eventEndDate.setDate( eventEndDate.getDate() - 1 ); return formatUnifinderEventDateTime(eventEndDate, calendarEvent.allDay); case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( gCalendarBundle.getString( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( gCalendarBundle.getString( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( gCalendarBundle.getString( "Cancelled" ) ); default: return false; } return false; case "unifinder-search-results-tree-col-filename": var thisCalendar = gCalendarWindow.calendarManager.getCalendarByName( calendarEvent.parent.server ); if( thisCalendar ) return( thisCalendar.getAttribute( "http://home.netscape.com/NC-rdf#name" ) ); else return( "" ); default: return false; } }
return( calendarToDo.percent );
return( calendarToDo.percent+"%" );
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return false; switch( column ) { case "unifinder-todo-tree-col-completed": return( " " ); case "unifinder-todo-tree-col-priority": return( " " ); case "unifinder-todo-tree-col-title": var titleText; if( calendarToDo.title == "" ) titleText = "Untitled"; else titleText = calendarToDo.title; return( titleText ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderEventDate( new Date( calendarToDo.start.getTime() ) ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderEventDate( new Date( calendarToDo.due.getTime() ) ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderEventDate( new Date( calendarToDo.completed.getTime() ) ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percent ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); default: return false; } }
getCellText : function(k, col) { if (!baseArray[k]) return ""; var value = baseArray[k][col]; var strvalue;
getCellText : function(k, col) { if (!(k in gPrefArray)) return ""; var value = gPrefArray[k][col];
getCellText : function(k, col) { if (!baseArray[k]) return ""; var value = baseArray[k][col]; var strvalue; switch (col) { case "lockCol": strvalue = gLockStrs[value]; break; case "typeCol": strvalue = gTypeStrs[value]; break; default: // already a str. strvalue = value; break; } return strvalue; },
switch (col) { case "lockCol": strvalue = gLockStrs[value]; break; case "typeCol": strvalue = gTypeStrs[value]; break; default: strvalue = value; break; } return strvalue; },
switch (col) { case "lockCol": return gLockStrs[value]; case "typeCol": return gTypeStrs[value]; default: return value; } },
getCellText : function(k, col) { if (!baseArray[k]) return ""; var value = baseArray[k][col]; var strvalue; switch (col) { case "lockCol": strvalue = gLockStrs[value]; break; case "typeCol": strvalue = gTypeStrs[value]; break; default: // already a str. strvalue = value; break; } return strvalue; },
return false; default: return false;
getCellText : function(row,column) { calendarEvent = gEventArray[row]; var calendarStringBundle = srGetStrBundle("chrome://calendar/locale/calendar.properties"); switch( column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); var startTime = formatUnifinderEventTime( eventStartDate ); var startDate = formatUnifinderEventDate( eventStartDate ); if( calendarEvent.allDay ) { startText = "All day " + startDate; } else { startText = startDate + " " + startTime; } return( startText ); case "unifinder-search-results-tree-col-enddate": var eventEndDate = new Date( calendarEvent.end.getTime() ); var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); if( calendarEvent.allDay ) { endText = "All day " + endDate; } else { endText = endDate + " " + endTime; } return( endText ); case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( calendarStringBundle.GetStringFromName( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( calendarStringBundle.GetStringFromName( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( calendarStringBundle.GetStringFromName( "Cancelled" ) ); } } }
var endDate = formatUnifinderEventDate( eventEndDate );
endDate = formatUnifinderEventDate( eventEndDate );
getCellText : function(row,column) { calendarEvent = gEventArray[row]; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( column.id || column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); var startTime = formatUnifinderEventTime( eventStartDate ); var startDate = formatUnifinderEventDate( eventStartDate ); if( calendarEvent.allDay ) { return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [startDate])); } else { return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [startDate, startTime])); } case "unifinder-search-results-tree-col-enddate": var eventEndDate = getNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; eventEndDate = new Date( actualEndDate ); if( calendarEvent.allDay ) { //user-enddate is ical-enddate - 1 eventEndDate.setDate( eventEndDate.getDate() - 1 ); var endDate = formatUnifinderEventDate( eventEndDate ); return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [endDate])); } else { var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [endDate, endTime])); } case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( gCalendarBundle.getString( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( gCalendarBundle.getString( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( gCalendarBundle.getString( "Cancelled" ) ); default: return false; } return false; case "unifinder-search-results-tree-col-filename": var thisCalendar = gCalendarWindow.calendarManager.getCalendarByName( calendarEvent.parent.server ); if( thisCalendar ) return( thisCalendar.getAttribute( "http://home.netscape.com/NC-rdf#name" ) ); else return( "" ); default: return false; } }
var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate );
endTime = formatUnifinderEventTime( eventEndDate ); endDate = formatUnifinderEventDate( eventEndDate );
getCellText : function(row,column) { calendarEvent = gEventArray[row]; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( column.id || column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = getNextOrPreviousRecurrence( calendarEvent ); var startTime = formatUnifinderEventTime( eventStartDate ); var startDate = formatUnifinderEventDate( eventStartDate ); if( calendarEvent.allDay ) { return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [startDate])); } else { return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [startDate, startTime])); } case "unifinder-search-results-tree-col-enddate": var eventEndDate = getNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.end.getTime() - calendarEvent.start.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; eventEndDate = new Date( actualEndDate ); if( calendarEvent.allDay ) { //user-enddate is ical-enddate - 1 eventEndDate.setDate( eventEndDate.getDate() - 1 ); var endDate = formatUnifinderEventDate( eventEndDate ); return(gCalendarBundle.getFormattedString("unifinderAlldayEventDate", [endDate])); } else { var endTime = formatUnifinderEventTime( eventEndDate ); var endDate = formatUnifinderEventDate( eventEndDate ); return(gCalendarBundle.getFormattedString("unifinderNormalEventDate", [endDate, endTime])); } case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": switch( calendarEvent.status ) { case calendarEvent.ICAL_STATUS_TENTATIVE: return( gCalendarBundle.getString( "Tentative" ) ); case calendarEvent.ICAL_STATUS_CONFIRMED: return( gCalendarBundle.getString( "Confirmed" ) ); case calendarEvent.ICAL_STATUS_CANCELLED: return( gCalendarBundle.getString( "Cancelled" ) ); default: return false; } return false; case "unifinder-search-results-tree-col-filename": var thisCalendar = gCalendarWindow.calendarManager.getCalendarByName( calendarEvent.parent.server ); if( thisCalendar ) return( thisCalendar.getAttribute( "http://home.netscape.com/NC-rdf#name" ) ); else return( "" ); default: return false; } }
switch( column.id || column )
switch( typeof(column)=="object" ? column.id : column )
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return false; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( column.id || column ) { case "unifinder-todo-tree-col-completed": return( "" ); case "unifinder-todo-tree-col-priority": return( "" ); case "unifinder-todo-tree-col-title": var titleText; if( calendarToDo.title == "" ) titleText = gCalendarBundle.getString( "eventUntitled" ); else titleText = calendarToDo.title; return( titleText ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderToDoDateTime( new Date( calendarToDo.start.getTime() ) ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderToDoDateTime( new Date( calendarToDo.due.getTime() ) ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderToDoDateTime( new Date( calendarToDo.completed.getTime() ) ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percent+"%" ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); default: return false; } }
} else if (column=="passwordCol") { rv = signons[row].password;
getCellText : function(row,column){ var rv=""; if (column=="siteCol") { rv = signons[row].host; } else if (column=="userCol") { rv = signons[row].user; } return rv; },
return( formatUnifinderToDoDateTime( calendarToDo.start ) );
return( formatUnifinderToDoDateTime( calendarToDo.entryDate ) );
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return false; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( typeof(column)=="object" ? column.id : column ) { case "unifinder-todo-tree-col-completed": return( "" ); case "unifinder-todo-tree-col-priority": return( "" ); case "unifinder-todo-tree-col-title": // return title, or "Untitled" if empty/null return calendarToDo.title || gCalendarBundle.getString( "eventUntitled" ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderToDoDateTime( calendarToDo.start ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderToDoDateTime( calendarToDo.due ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderToDoDateTime( calendarToDo.completedDate ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percent+"%" ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); case "unifinder-todo-tree-col-location": return( calendarToDo.getProperty("LOCATION") ); case "unifinder-todo-tree-col-status": return getToDoStatusString(calendarToDo); case "unifinder-todo-tree-col-calendarname": return( calendarToDo.calendar.name ); default: return false; } }
return( formatUnifinderToDoDateTime( calendarToDo.due ) );
return( formatUnifinderToDoDateTime( calendarToDo.dueDate ) );
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return false; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( typeof(column)=="object" ? column.id : column ) { case "unifinder-todo-tree-col-completed": return( "" ); case "unifinder-todo-tree-col-priority": return( "" ); case "unifinder-todo-tree-col-title": // return title, or "Untitled" if empty/null return calendarToDo.title || gCalendarBundle.getString( "eventUntitled" ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderToDoDateTime( calendarToDo.start ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderToDoDateTime( calendarToDo.due ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderToDoDateTime( calendarToDo.completedDate ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percent+"%" ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); case "unifinder-todo-tree-col-location": return( calendarToDo.getProperty("LOCATION") ); case "unifinder-todo-tree-col-status": return getToDoStatusString(calendarToDo); case "unifinder-todo-tree-col-calendarname": return( calendarToDo.calendar.name ); default: return false; } }
return( calendarToDo.percent+"%" );
return( calendarToDo.percentComplete+"%" );
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return false; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( typeof(column)=="object" ? column.id : column ) { case "unifinder-todo-tree-col-completed": return( "" ); case "unifinder-todo-tree-col-priority": return( "" ); case "unifinder-todo-tree-col-title": // return title, or "Untitled" if empty/null return calendarToDo.title || gCalendarBundle.getString( "eventUntitled" ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderToDoDateTime( calendarToDo.start ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderToDoDateTime( calendarToDo.due ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderToDoDateTime( calendarToDo.completedDate ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percent+"%" ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); case "unifinder-todo-tree-col-location": return( calendarToDo.getProperty("LOCATION") ); case "unifinder-todo-tree-col-status": return getToDoStatusString(calendarToDo); case "unifinder-todo-tree-col-calendarname": return( calendarToDo.calendar.name ); default: return false; } }
return( calendarToDo.categories );
return( calendarToDo.getProperty("CATEGORIES") );
getCellText : function(row,column) { calendarToDo = gTaskArray[row]; if( !calendarToDo ) return false; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( typeof(column)=="object" ? column.id : column ) { case "unifinder-todo-tree-col-completed": return( "" ); case "unifinder-todo-tree-col-priority": return( "" ); case "unifinder-todo-tree-col-title": // return title, or "Untitled" if empty/null return calendarToDo.title || gCalendarBundle.getString( "eventUntitled" ); case "unifinder-todo-tree-col-startdate": return( formatUnifinderToDoDateTime( calendarToDo.start ) ); case "unifinder-todo-tree-col-duedate": return( formatUnifinderToDoDateTime( calendarToDo.due ) ); case "unifinder-todo-tree-col-completeddate": return( formatUnifinderToDoDateTime( calendarToDo.completedDate ) ); case "unifinder-todo-tree-col-percentcomplete": return( calendarToDo.percent+"%" ); case "unifinder-todo-tree-col-categories": return( calendarToDo.categories ); case "unifinder-todo-tree-col-location": return( calendarToDo.getProperty("LOCATION") ); case "unifinder-todo-tree-col-status": return getToDoStatusString(calendarToDo); case "unifinder-todo-tree-col-calendarname": return( calendarToDo.calendar.name ); default: return false; } }
return calendarEvent.parent.name;
return calendarEvent.calendar.name;
getCellText : function(row,column) { calendarEvent = gEventArray[row]; // Moz1.8 trees require column.id, moz1.7 and earlier trees use column. switch( typeof(column)=="object" ? column.id : column ) { case "unifinder-search-results-tree-col-title": return( calendarEvent.title ); case "unifinder-search-results-tree-col-startdate": var eventStartDate = calendarEvent.startDate.jsDate; // XXX reimplement //var eventStartDate = getCurrentNextOrPreviousRecurrence( calendarEvent ); return formatUnifinderEventDateTime(eventStartDate, calendarEvent.allDay); case "unifinder-search-results-tree-col-enddate": var eventEndDate = calendarEvent.endDate.jsDate; // XXX reimplement //var eventEndDate = getCurrentNextOrPreviousRecurrence( calendarEvent ); var eventLength = calendarEvent.endDate.jsDate.getTime() - calendarEvent.startDate.jsDate.getTime(); var actualEndDate = eventEndDate.getTime() + eventLength; eventEndDate = new Date( actualEndDate ); if (calendarEvent.allDay) // display enddate is ical enddate - 1 //user-enddate is ical-enddate - 1 eventEndDate.setDate( eventEndDate.getDate() - 1 ); return formatUnifinderEventDateTime(eventEndDate, calendarEvent.allDay); case "unifinder-search-results-tree-col-categories": return( calendarEvent.categories ); case "unifinder-search-results-tree-col-location": return( calendarEvent.location ); case "unifinder-search-results-tree-col-status": return getEventStatusString(calendarEvent); case "unifinder-search-results-tree-col-calendarname": return calendarEvent.parent.name; default: return false; } }
optgroupObject.prototype.getCellText = function getCellText(column) { return column.id == "SelectTextCol" ? this.element.label : ""; }
getCellText: function getCellText(index, column) { return itemArray[index].getCellText(column); },
optgroupObject.prototype.getCellText = function getCellText(column){ return column.id == "SelectTextCol" ? this.element.label : "";}
function getCharPref (prefObj, prefName, defaultValue)
function getCharPref (prefName, defaultValue)
function getCharPref (prefObj, prefName, defaultValue){ var e, rv; try { rv = prefObj.getCharPref (prefName); } catch (e) { rv = defaultValue; } //dd ("getCharPref: returning '" + rv + "' for " + prefName); return rv; }
rv = prefObj.getCharPref (prefName);
rv = client.prefBranch.getCharPref (prefName);
function getCharPref (prefObj, prefName, defaultValue){ var e, rv; try { rv = prefObj.getCharPref (prefName); } catch (e) { rv = defaultValue; } //dd ("getCharPref: returning '" + rv + "' for " + prefName); return rv; }
prefs = Components.classes['component:
prefs = Components.classes['@mozilla.org/preferences;1'];
function GetCharsetUIString(){ var charset = msgCompose.compFields.GetCharacterSet(); if (g_send_default_charset == null) { try { prefs = Components.classes['component://netscape/preferences']; prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); g_send_default_charset = prefs.getLocalizedUnicharPref("mailnews.send_default_charset"); } catch (ex) { dump("failed to get prefs service!\n"); prefs = null; g_send_default_charset = charset; // set to the current charset } } charset = charset.toUpperCase(); if (charset == "US-ASCII") charset = "ISO-8859-1"; if (charset != g_send_default_charset) { if (g_charsetTitle == null) { try { var ccm = Components.classes['component://netscape/charset-converter-manager']; ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); // get a localized string var charsetAtom = ccm.GetCharsetAtom(charset); g_charsetTitle = ccm.GetCharsetTitle(charsetAtom); } catch (ex) { dump("failed to get a charset title of " + charset + "!\n"); g_charsetTitle = charset; // just show the charset itself } } return " - " + g_charsetTitle; } return "";}
var ccm = Components.classes['component:
var ccm = Components.classes['@mozilla.org/charset-converter-manager;1'];
function GetCharsetUIString(){ var charset = msgCompose.compFields.GetCharacterSet(); if (g_send_default_charset == null) { try { prefs = Components.classes['component://netscape/preferences']; prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); g_send_default_charset = prefs.getLocalizedUnicharPref("mailnews.send_default_charset"); } catch (ex) { dump("failed to get prefs service!\n"); prefs = null; g_send_default_charset = charset; // set to the current charset } } charset = charset.toUpperCase(); if (charset == "US-ASCII") charset = "ISO-8859-1"; if (charset != g_send_default_charset) { if (g_charsetTitle == null) { try { var ccm = Components.classes['component://netscape/charset-converter-manager']; ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); // get a localized string var charsetAtom = ccm.GetCharsetAtom(charset); g_charsetTitle = ccm.GetCharsetTitle(charsetAtom); } catch (ex) { dump("failed to get a charset title of " + charset + "!\n"); g_charsetTitle = charset; // just show the charset itself } } return " - " + g_charsetTitle; } return "";}
g_send_default_charset = prefs.CopyCharPref("mailnews.send_default_charset");
g_send_default_charset = prefs.getLocalizedUnicharPref("mailnews.send_default_charset");
function GetCharsetUIString(){ var charset = msgCompose.compFields.GetCharacterSet(); if (g_send_default_charset == null) { try { prefs = Components.classes['component://netscape/preferences']; prefs = prefs.getService(); prefs = prefs.QueryInterface(Components.interfaces.nsIPref); g_send_default_charset = prefs.CopyCharPref("mailnews.send_default_charset"); } catch (ex) { dump("failed to get prefs service!\n"); prefs = null; g_send_default_charset = charset; // set to the current charset } } charset = charset.toUpperCase(); if (charset == "US-ASCII") charset = "ISO-8859-1"; if (charset != g_send_default_charset) { if (g_charsetTitle == null) { try { var ccm = Components.classes['component://netscape/charset-converter-manager']; ccm = ccm.getService(); ccm = ccm.QueryInterface(Components.interfaces.nsICharsetConverterManager2); // get a localized string var charsetAtom = ccm.GetCharsetAtom(charset); g_charsetTitle = ccm.GetCharsetTitle(charsetAtom); } catch (ex) { dump("failed to get a charset title of " + charset + "!\n"); g_charsetTitle = charset; // just show the charset itself } } return " - " + g_charsetTitle; } return "";}
var charsetAlias = gCharsetConvertManager.GetCharsetAlias(charset); var encoderList = gCharsetConvertManager.GetEncoderList();
var charsetAlias = gCharsetConvertManager.getCharsetAlias(charset); var encoderList = gCharsetConvertManager.getEncoderList();
function GetCharsetUIString(){ var charset = gMsgCompose.compFields.characterSet; if (gSendDefaultCharset == null) { gSendDefaultCharset = gMsgCompose.compFields.defaultCharacterSet; } charset = charset.toUpperCase(); if (charset == "US-ASCII") charset = "ISO-8859-1"; if (charset != gSendDefaultCharset) { if (gCharsetTitle == null) { try { // check if we have a converter for this charset var charsetAlias = gCharsetConvertManager.GetCharsetAlias(charset); var encoderList = gCharsetConvertManager.GetEncoderList(); var found = false; while (encoderList.hasMore()) { if (charsetAlias == encoderList.getNext()) { found = true; break; } } if (!found) { dump("no charset converter available for " + charset + " default charset is used instead\n"); // set to default charset, no need to show it in the window title gMsgCompose.compFields.characterSet = gSendDefaultCharset; return ""; } // get a localized string gCharsetTitle = gCharsetConvertManager.getCharsetTitle(charsetAlias); } catch (ex) { dump("failed to get a charset title of " + charset + "!\n"); gCharsetTitle = charset; // just show the charset itself } } return " - " + gCharsetTitle; } return "";}
if (cid.equals(this.mEventCID)) return this.mEventFactory; if (cid.equals(this.mTodoCID)) return this.mTodoFactory; if (cid.equals(this.mItemOccurrenceCID)) return this.mItemOccurrenceFactory;
for (var i = 0; i < componentData.length; i++) { if (cid.equals(componentData[i].cid)) return this.makeFactoryFor(eval(componentData[i].constructor)); }
getClassObject: function (compMgr, cid, iid) { if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; if (!this.mScriptsLoaded) this.loadScripts(); if (cid.equals(this.mEventCID)) return this.mEventFactory; if (cid.equals(this.mTodoCID)) return this.mTodoFactory; if (cid.equals(this.mItemOccurrenceCID)) return this.mItemOccurrenceFactory; throw Components.results.NS_ERROR_NO_INTERFACE; },
if (!cid.equals(this.cid)) throw Components.results.NS_ERROR_NO_INTERFACE; if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; return this.factory; },
if (!cid.equals(CID)) throw Components.results.NS_ERROR_NO_INTERFACE; return this.QueryInterface(iid); },
getClassObject: function (compMgr, cid, iid) { if (!cid.equals(this.cid)) throw Components.results.NS_ERROR_NO_INTERFACE; if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; return this.factory; },
return CLineFactory.QueryInterface(iid);
return CLineFactory;
CalendarModule.getClassObject =function (compMgr, cid, iid) { if (cid.equals(CLINE_SERVICE_CID)) return CLineFactory.QueryInterface(iid); if (cid.equals(ICALCNT_HANDLER_CID)) return ICALContentHandlerFactory; if (cid.equals(ICALPROT_HANDLER_CID)) return ICALProtocolHandlerFactory; throw Components.results.NS_ERROR_NO_INTERFACE;}
return CLineFactory;
return CLineFactory.QueryInterface(iid);
CalendarModule.getClassObject =function (compMgr, cid, iid) { if (cid.equals(CLINE_SERVICE_CID)) return CLineFactory; if (cid.equals(ICALCNT_HANDLER_CID)) return ICALContentHandlerFactory; if (cid.equals(ICALPROT_HANDLER_CID)) return ICALProtocolHandlerFactory; if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NO_INTERFACE;}
if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
CalendarModule.getClassObject =function (compMgr, cid, iid) { if (cid.equals(CLINE_SERVICE_CID)) return CLineFactory; if (cid.equals(ICALCNT_HANDLER_CID)) return ICALContentHandlerFactory; if (cid.equals(ICALPROT_HANDLER_CID)) return ICALProtocolHandlerFactory; if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NO_INTERFACE;}
if (cid.equals(IRCCNT_HANDLER_CID)) return IRCContentHandlerFactory;
if (cid.equals(ICALCNT_HANDLER_CID)) return ICALContentHandlerFactory;
ChatzillaModule.getClassObject =function (compMgr, cid, iid) { if (cid.equals(CLINE_SERVICE_CID)) return CLineFactory; if (cid.equals(IRCCNT_HANDLER_CID)) return IRCContentHandlerFactory; if (cid.equals(IRCPROT_HANDLER_CID)) return IRCProtocolHandlerFactory; if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NO_INTERFACE; }
if (cid.equals(IRCPROT_HANDLER_CID)) return IRCProtocolHandlerFactory;
if (cid.equals(ICALPROT_HANDLER_CID)) return ICALProtocolHandlerFactory;
ChatzillaModule.getClassObject =function (compMgr, cid, iid) { if (cid.equals(CLINE_SERVICE_CID)) return CLineFactory; if (cid.equals(IRCCNT_HANDLER_CID)) return IRCContentHandlerFactory; if (cid.equals(IRCPROT_HANDLER_CID)) return IRCProtocolHandlerFactory; if (!iid.equals(Components.interfaces.nsIFactory)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; throw Components.results.NS_ERROR_NO_INTERFACE; }
var txf = aColBox.getElementsByTagName("textfield")[0];
var txf = aColBox.getElementsByTagName("textbox")[0];
getColumnValue: function(aColBox) { if (aColBox._isAttrCol) { var txf = aColBox.getElementsByTagName("textfield")[0]; return "@" + txf.value; } else { return aColBox._ColValue; } }
case "cmdEditNodeValue": return new cmdEditNodeValue();
getCommand: function(aCommand) { switch (aCommand) { case "cmdEditCut": return new cmdEditCut(); case "cmdEditCopy": return new cmdEditCopy(); case "cmdEditPaste": return new cmdEditPaste(); case "cmdEditInsert": return new cmdEditInsert(); case "cmdEditEdit": return new cmdEditEdit(); case "cmdEditDelete": return new cmdEditDelete(); } return null; },
case "popup:console":
function getCommandContext (id, cx){ switch (id) { case "popup:project": cx = console.projectView.getContext(cx); break; case "popup:source": cx = console.sourceView.getContext(cx); break; case "popup:script": cx = console.scriptsView.getContext(cx); break; case "popup:stack": cx = console.stackView.getContext(cx); break; default: dd ("getCommandContext: unknown id '" + id + "'"); case "mainmenu:debug-popup": case "mainmenu:view-popup": cx = { commandManager: console.commandManager, contextSource: "default" }; break; } if (typeof cx == "object") { cx.commandManager = console.commandManager; if (!("contextSource" in cx)) cx.contextSource = id; //dd ("context '" + id + "'\n" + dumpObjectTree(cx)); } return cx;}
if (console.dbgContexts) dd ("context '" + id + "'\n" + dumpObjectTree(cx));
function getCommandContext (id, cx){ switch (id) { case "popup:project": cx = console.projectView.getContext(cx); break; case "popup:source": cx = console.sourceView.getContext(cx); break; case "popup:script": cx = console.scriptsView.getContext(cx); break; case "popup:stack": cx = console.stackView.getContext(cx); break; default: dd ("getCommandContext: unknown id '" + id + "'"); case "mainmenu:debug-popup": case "mainmenu:view-popup": case "popup:console": cx = { commandManager: console.commandManager, contextSource: "default" }; break; } if (typeof cx == "object") { cx.commandManager = console.commandManager; if (!("contextSource" in cx)) cx.contextSource = id; //dd ("context '" + id + "'\n" + dumpObjectTree(cx)); } return cx;}
}
} dump("*** BAD! EVIL! WICKED! NO! ACK! ARGH! ORGH!\n");
getCommandName: function (aCommand) { var cmdName = aCommand.substring(NC_NS_CMD.length); try { // Note: this will succeed only if there's a string in the bookmarks // string bundle for this command name. Otherwise, <xul:stringbundle/> // will throw, we'll catch & stifle the error, and look up the command // name in the datasource. return this.getLocaleString ("cmd_" + cmdName); } catch (e) { } const rName = this.RDF.GetResource(NC_NS + "Name"); const rSource = this.RDF.GetResource(aNodeID); return this.db.GetTarget(rSource, rName, true).Value; },
for (var i = 1; i < l; i++)
for (var i = 0; i < l; i++)
function getCommonPfx (list){ var pfx = list[0]; var l = list.length; for (var i = 1; i < l; i++) { for (var c = 0; c < pfx.length; c++) if (pfx[c] != list[i][c]) pfx = pfx.substr (0, c); } return pfx;}
for (var c = 0; c < pfx.length; c++) if (pfx[c] != list[i][c])
for (var c = 0; c < pfx.length; ++c) { if (c >= list[i].length) {
function getCommonPfx (list){ var pfx = list[0]; var l = list.length; for (var i = 1; i < l; i++) { for (var c = 0; c < pfx.length; c++) if (pfx[c] != list[i][c]) pfx = pfx.substr (0, c); } return pfx;}
break; } else { if (pfx[c] != list[i][c]) pfx = pfx.substr (0, c); } }
function getCommonPfx (list){ var pfx = list[0]; var l = list.length; for (var i = 1; i < l; i++) { for (var c = 0; c < pfx.length; c++) if (pfx[c] != list[i][c]) pfx = pfx.substr (0, c); } return pfx;}
var numControllers = window.content.controllers.getControllerCount();
var numControllers = window._content.controllers.getControllerCount();
function GetComposerController(){ var numControllers = window.content.controllers.getControllerCount(); // count down to find a controller that supplies a nsIControllerCommandManager interface for (var i = numControllers; i >= 0 ; i --) { var commandManager = null; try { var controller = window.content.controllers.getControllerAt(i); var interfaceRequestor = controller.QueryInterface(Components.interfaces.nsIInterfaceRequestor); if (!interfaceRequestor) continue; commandManager = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandManager); } catch(ex) { dump("failed to get command manager number "+i+"\n"); } if (commandManager) return commandManager; } dump("Failed to find a controller to register commands with\n"); return null;}
var controller = window.content.controllers.getControllerAt(i);
var controller = window._content.controllers.getControllerAt(i);
function GetComposerController(){ var numControllers = window.content.controllers.getControllerCount(); // count down to find a controller that supplies a nsIControllerCommandManager interface for (var i = numControllers; i >= 0 ; i --) { var commandManager = null; try { var controller = window.content.controllers.getControllerAt(i); var interfaceRequestor = controller.QueryInterface(Components.interfaces.nsIInterfaceRequestor); if (!interfaceRequestor) continue; commandManager = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandManager); } catch(ex) { dump("failed to get command manager number "+i+"\n"); } if (commandManager) return commandManager; } dump("Failed to find a controller to register commands with\n"); return null;}