rem: var nameNode = document.getElementById("name"); 
add: var nameNode = document.getElementById("name"); 
context: function Init(){  bookmark_url = window.arguments[0];  // set up action buttons  doSetOKCancel(Commit);  // Initialize the properties panel by copying the values from the  // RDF graph into the fields on screen.  for (var i = 0; i < Fields.length; ++i) {    var field = document.getElementById(Fields[i]);    var value = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),                                    RDF.GetResource(Properties[i]),                                    true);    if (value) value = value.QueryInterface(Components.interfaces.nsIRDFLiteral);    if (value) value = value.Value;    dump("field '" + Fields[i] + "' <== '" + value + "'\n");    if (value) field.value = value;  }  var propsWindow = document.getElementById("bmPropsWindow");	var nameNode = document.getElementById("name");  var title = propsWindow.getAttribute("title");  title = title.replace(/\*\*bm_title\*\*/gi, nameNode.value);  propsWindow.setAttribute("title", title);  // check bookmark schedule    var value = Bookmarks.GetTarget(RDF.GetResource(bookmark_url),                                    RDF.GetResource("http://home.netscape.com/WEB-rdf#Schedule"),                                    true);    if (value) value = value.QueryInterface(Components.interfaces.nsIRDFLiteral);    if (value) value = value.Value;    if ((value) && (value != ""))    {	var sep;		// get day range	if ((sep = value.indexOf("|")) > 0)	{		var days = value.substr(0, sep);		value = value.substr(sep+1, value.length-1);		var dayNode = document.getElementById("dayRange");		for (var x=0; x < dayNode.childNodes[0].childNodes.length; x++)		{			if (dayNode.childNodes[0].childNodes[x].getAttribute("data") == days)			{				dayNode.selectedItem = dayNode.childNodes[0].childNodes[x];				break;			}		}	}	// get hour range	if ((sep = value.indexOf("|")) > 0)	{		var hours = value.substr(0, sep);		value = value.substr(sep+1, value.length-1);		var startHour = "";		var endHour = "";		var dashSep = hours.indexOf("-");		if (dashSep > 0)		{			startHour = hours.substr(0, dashSep);			endHour = hours.substr(dashSep + 1, hours.length-1);		}		// set start hour		var startHourNode = document.getElementById("startHourRange");		for (var x=0; x < startHourNode.childNodes[0].childNodes.length; x++)		{			if (startHourNode.childNodes[0].childNodes[x].getAttribute("data") == startHour)			{				startHourNode.selectedItem = startHourNode.childNodes[0].childNodes[x];				break;			}		}		// set end hour		var endHourNode = document.getElementById("endHourRange");		for (var x=0; x < endHourNode.childNodes[0].childNodes.length; x++)		{			if (endHourNode.childNodes[0].childNodes[x].getAttribute("data") == endHour)			{				endHourNode.selectedItem = endHourNode.childNodes[0].childNodes[x];				break;			}		}	}	// get duration	if ((sep = value.indexOf("|")) > 0)	{		var duration = value.substr(0, sep);		value = value.substr(sep+1, value.length-1);		var durationNode = document.getElementById("duration");		durationNode.value = duration;	}	// get notification method    	if (value.indexOf("icon") >= 0)    	{    		document.getElementById("bookmarkIcon").checked = true;    	}    	if (value.indexOf("sound") >= 0)    	{    		document.getElementById("playSound").checked = true;    	}    	if (value.indexOf("alert") >= 0)    	{    		document.getElementById("showAlert").checked = true;    	}    	if (value.indexOf("open") >= 0)    	{    		document.getElementById("openWindow").checked = true;    	}    }  // if its a container, disable some things  var isContainerFlag = RDFC.IsContainer(Bookmarks, RDF.GetResource(bookmark_url));  if (!isContainerFlag)  {  	// XXX To do: the "RDFC.IsContainer" call above only works for RDF sequences;  	//            if its not a RDF sequence, we should to more checking to see if  	//            the item in question is really a container of not.  A good example  	//            of this is the "File System" container.  }	if (isContainerFlag)	{		// If it is a folder, it has no URL or Keyword		document.getElementById("locationrow").setAttribute("hidden", "true");		document.getElementById("shortcutrow").setAttribute("hidden", "true");	}  if (bookmark_url.indexOf("http://") != 0 &&       bookmark_url.indexOf("https://") != 0) {    // only allow scheduling of http/https URLs    document.getElementById("ScheduleTab").setAttribute("hidden", "true");    document.getElementById("NotifyTab").setAttribute("hidden", "true");  }	sizeToContent();	// set initial focus	document.getElementById("name").focus();}
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