rem:  if (editor._doc.selection.type == htmlSelectionControl) { grngMaster.execCommand('Delete'); grngMaster = editor._doc.selection.createRange(); }  idstr = "556e697175657e537472696e67"; grngMaster.execCommand("CreateLink", null, idstr); coll = editor._doc.getElementsByTagName("A"); for(i=0; i<coll.length; i++) { if (coll[i].href == idstr) { link_element = coll[i]; if (link_element.firstChild == null) { txt = editor._doc.createTextNode(file.name); link_element.appendChild(txt); } link_element.href = '/root?node_id=' + file.node_id; link_element.title = file.name; } }  grngMaster.collapse(false); grngMaster.select(); 
context: function insert_limb_repository_file(e, id){  var editor = e;  	popup("/root/file_select", null, null, false, 	  	function (file)    {      var htmlSelectionControl = "Control";      var grngMaster = editor._doc.selection.createRange();            // delete selected content and replace with image      if (editor._doc.selection.type == htmlSelectionControl)      {        grngMaster.execCommand('Delete');        grngMaster = editor._doc.selection.createRange();      }            	idstr = "556e697175657e537472696e67";      grngMaster.execCommand("CreateLink", null, idstr);      coll = editor._doc.getElementsByTagName("A");      for(i=0; i<coll.length; i++)      {      	if (coll[i].href == idstr)      	{    		  link_element = coll[i];      		if (link_element.firstChild == null)      		{      			txt = editor._doc.createTextNode(file.name);      			link_element.appendChild(txt);      		}    		  link_element.href = '/root?node_id=' + file.node_id;    		  link_element.title = file.name;    		}    	}          grngMaster.collapse(false);      grngMaster.select();    }, 	  function (obj){});}
meta: 8196	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8196/2a95aee0924e41cc8be71e53596a918d46619318/htmlarea_extension.js/buggy/trunk/shared/js/htmlarea_extension.js