rem: if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral); 
add: if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "ShortcutURL")) {  newvalue = newvalue.toLowerCase(); } else if (newvalue && gProperties[i] == (NC_NAMESPACE_URI + "URL")) {   if (newvalue.indexOf(":") < 0) newvalue = "http: } 
context: function Commit(){  var changed = false;  // Grovel through the fields to see if any of the values have  // changed. If so, update the RDF graph and force them to be saved  // to disk.  for (var i = 0; i < Fields.length; ++i)  {    var field = document.getElementById(Fields[i]);    // if the field was removed, just skip it    if (!field)	continue;    // Get the new value as a literal, using 'null' if the value is    // empty.    var newvalue = field.value;    dump("field value = " + newvalue + "\n");    // if the field was removed, just skip it    if (!Properties[i])	continue;    var oldvalue = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),                                       RDF.GetResource(Properties[i]),                                       true);    if (oldvalue) oldvalue = oldvalue.QueryInterface(Components.interfaces.nsIRDFLiteral);    if ((newvalue) && (Properties[i] == (NC_NAMESPACE_URI + "ShortcutURL")))    {    	// shortcuts are always lowercased internally    	newvalue = newvalue.toLowerCase();    }    else if ((newvalue) && (Properties[i] == (NC_NAMESPACE_URI + "URL")))    {    	// we're dealing with the URL attribute;    	// if a scheme isn't specified, use "http://"    	if (newvalue.indexOf(":") < 0)    	{    		dump("Setting default URL scheme to HTTP.\n");    		newvalue = "http://" + newvalue;    	}    }        if (updateAttribute(Properties[i], oldvalue, newvalue) == true)    {    	changed = true;    }  }  	// Update bookmark schedule if necessary;	// if the tab was removed, just skip it	var scheduleTab = document.getElementById("ScheduleTab");	if (scheduleTab)	{	  	var scheduleRes = "http://home.netscape.com/WEB-rdf#Schedule";		var oldvalue = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),	                               RDF.GetResource(scheduleRes), true);	        var newvalue = "";		var dayRange = "";		var dayRangeNode = document.getElementById("dayRange");		if (dayRangeNode)		{			dayRange = dayRangeNode.selectedItem.getAttribute("data");		}		if (dayRange != "")		{			var startHourRange = "";			var startHourRangeNode = document.getElementById("startHourRange");			if (startHourRangeNode)			{				startHourRange = startHourRangeNode.selectedItem.getAttribute("data");			}			var endHourRange = "";			var endHourRangeNode = document.getElementById("endHourRange");			if (endHourRangeNode)			{				endHourRange = endHourRangeNode.selectedItem.getAttribute("data");			}			if (parseInt(startHourRange) > parseInt(endHourRange))			{				var temp = startHourRange;				startHourRange = endHourRange;				endHourRange = temp;			}			var duration = document.getElementById("duration").value;			if (duration == "")			{				var bundle = srGetStrBundle("chrome://communicator/locale/bookmarks/bookmark.properties");				alert( bundle.GetStringFromName("pleaseEnterADuration") );				return(false);			}			var method = "";			if (document.getElementById("bookmarkIcon").checked)	method += ",icon";			if (document.getElementById("playSound").checked)	method += ",sound";			if (document.getElementById("showAlert").checked)	method += ",alert";			if (document.getElementById("openWindow").checked)	method += ",open";			if (method.length < 1)			{				var bundle = srGetStrBundle("chrome://communicator/locale/bookmarks/bookmark.properties");				alert( bundle.GetStringFromName("pleaseSelectANotification") );				return(false);			}			method = method.substr(1, method.length - 1);	// trim off the initial comma			dump("dayRange: " + dayRange + "\n");			dump("startHourRange: " + startHourRange + "\n");			dump("endHourRange: " + endHourRange + "\n");			dump("duration: " + duration + "\n");			dump("method: " + method + "\n");						newvalue = dayRange + "|" + startHourRange + "-" + endHourRange + "|" + duration + "|" + method;		}	}	if (updateAttribute(scheduleRes, oldvalue, newvalue) == true)	{		changed = true;	}	if (changed == true)	{		dump("re-writing bookmarks.html\n");		var remote = Bookmarks.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);		if (remote)		{			remote.Flush();		}	}	window.close();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/06cc39f20bee4beae6f95a4f38bb8f56e05a4f5f/bm-props.js/clean/xpfe/components/bookmarks/resources/bm-props.js