includes/clientside/tinymce/plugins/advlink/js/advlink.js
changeset 1193 e3b94bd055dc
parent 778 57ce13805b6f
equal deleted inserted replaced
1192:5882f0eebb34 1193:e3b94bd055dc
   114 
   114 
   115 function checkPrefix(n) {
   115 function checkPrefix(n) {
   116 	if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
   116 	if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
   117 		n.value = 'mailto:' + n.value;
   117 		n.value = 'mailto:' + n.value;
   118 
   118 
   119 	if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
   119 	if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
   120 		n.value = 'http://' + n.value;
   120 		n.value = 'http://' + n.value;
   121 }
   121 }
   122 
   122 
   123 function setFormValue(name, value) {
   123 function setFormValue(name, value) {
   124 	document.forms[0].elements[name].value = value;
   124 	document.forms[0].elements[name].value = value;
   400 
   400 
   401 	tinyMCEPopup.execCommand("mceBeginUndoLevel");
   401 	tinyMCEPopup.execCommand("mceBeginUndoLevel");
   402 
   402 
   403 	// Create new anchor elements
   403 	// Create new anchor elements
   404 	if (elm == null) {
   404 	if (elm == null) {
       
   405 		inst.getDoc().execCommand("unlink", false, null);
   405 		tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
   406 		tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
   406 
   407 
   407 		elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
   408 		elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
   408 		for (i=0; i<elementArray.length; i++)
   409 		for (i=0; i<elementArray.length; i++)
   409 			setAllAttribs(elm = elementArray[i]);
   410 			setAllAttribs(elm = elementArray[i]);