rem: range.execCommand('Delete'); range = editor._createRange(sel); }  link_to = image['link_to']; if (link_to.length > 1) { idstr = "556e697175657e537472696e67"; range.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]; link_element.href = '/root?node_id=' + image['node_id'] + '&' + link_to; link_element.target = '_blank'; img_element = editor._doc.createElement("IMG"); img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type']; link_element.appendChild(img_element); } } } else { idstr = "\" id=\"556e697175657e537472696e67"; range.execCommand("InsertImage", null, idstr); img_element = editor._doc.all['556e697175657e537472696e67']; img_element.removeAttribute("id"); img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type']; }  img_element.id = image['node_id'] + ':' + image['type'] + ':' + image['link_to']; img_element.border = image['border']; img_element.alt = image['alt']; img_element.align = image['align']; img_element.hspace = image['hspace']; img_element.vspace = image['vspace']; new_width = parseInt(image['width']); new_height = parseInt(image['height']); if (new_width != 0 && !isNaN(new_width)) img_element.width = image['width']; if (new_height != 0 && !isNaN(new_height)) img_element.height = image['height'];  range.collapse(false); range.select(); 
add: parent = editor.getParentElement();   if (parent.tagName == 'IMG') editor.execCommand('Delete');  selection = editor._getSelection(); range = editor._createRange(selection);  var img_element = editor._doc.createElement("IMG");  img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type']; img_element.setAttribute('limb_attributes', image['node_id'] + ':' + image['type'] + ':' + image['link_to']); img_element.border = image['border']; img_element.alt = image['alt']; img_element.align = image['align']; img_element.hspace = image['hspace']; img_element.vspace = image['vspace']; new_width = parseInt(image['width']); new_height = parseInt(image['height']); if (new_width != 0 && !isNaN(new_width)) img_element.width = image['width']; if (new_height != 0 && !isNaN(new_height)) img_element.height = image['height'];  if (image['link_to']) { var a = editor._doc.createElement("A");  a.href = '/root?node_id=' + image['node_id'] + '&' + image['link_to']; a.target = '_blank'; a.appendChild(img_element); node = a; } else node = img_element;  editor.insertNodeAtSelection(node); } else { var range = editor._doc.selection.createRange();   if (editor._doc.selection.type == "Control") { range.execCommand('Delete'); range = editor._doc.selection.createRange(); } if (image['link_to']) { idstr = "556e697175657e537472696e67"; range.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]; link_element.href = '/root?node_id=' + image['node_id'] + '&' + image['link_to']; link_element.target = '_blank'; img_element = editor._doc.createElement("IMG"); img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type']; link_element.appendChild(img_element); } } } else { idstr = "\" id=\"556e697175657e537472696e67"; range.execCommand("InsertImage", null, idstr); img_element = editor._doc.all['556e697175657e537472696e67']; img_element.removeAttribute("id"); img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type']; }  img_element.setAttribute('limb_attributes', image['node_id'] + ':' + image['type'] + ':' + image['link_to']); img_element.border = image['border']; img_element.alt = image['alt']; img_element.align = image['align']; img_element.hspace = image['hspace']; img_element.vspace = image['vspace']; new_width = parseInt(image['width']); new_height = parseInt(image['height']); if (new_width != 0 && !isNaN(new_width)) img_element.width = image['width']; if (new_height != 0 && !isNaN(new_height)) img_element.height = image['height'];  range.collapse(false); } 
context:     function(image)     {    	if (!image)    		return false;    					var sel = editor._getSelection();			var range = editor._createRange(sel);    		    	            // delete selected content and replace with image      if (sel.type == "Control")      {        range.execCommand('Delete');        range = editor._createRange(sel);      }            link_to = image['link_to'];      if (link_to.length > 1)      {      	idstr = "556e697175657e537472696e67";    	  range.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];    			  link_element.href = '/root?node_id=' + image['node_id'] + '&' + link_to;    			  link_element.target = '_blank';    			  img_element = editor._doc.createElement("IMG");    			  img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type'];    			  link_element.appendChild(img_element);    			}    		}    	}      else    	{    		idstr = "\" id=\"556e697175657e537472696e67";    	  range.execCommand("InsertImage", null, idstr);    	  img_element = editor._doc.all['556e697175657e537472696e67'];    	  img_element.removeAttribute("id");    	  img_element.src = '/root?node_id=' + image['node_id'] + '&' + image['type'];    	}    	      img_element.id = image['node_id'] + ':' + image['type'] + ':' + image['link_to'];      img_element.border = image['border'];      img_element.alt = image['alt'];      img_element.align = image['align'];      img_element.hspace = image['hspace'];      img_element.vspace = image['vspace'];      new_width = parseInt(image['width']);      new_height = parseInt(image['height']);      if (new_width != 0 && !isNaN(new_width))      	img_element.width = image['width'];      if (new_height != 0 && !isNaN(new_height))      	img_element.height = image['height'];            range.collapse(false);      range.select();    }	  
meta: 8196	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8196/08d8c853a1bc77288d0a5547db1d47be1c33b65e/htmlarea_extension.js/clean/trunk/shared/js/htmlarea_extension.js