\r
// Create new anchor elements\r
if (e == null) {\r
+ ed.getDoc().execCommand("unlink", false, null);\r
tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});\r
\r
tinymce.each(ed.dom.select("a"), function(n) {\r
ed.dom.setAttribs(e, {\r
href : f.href.value,\r
title : f.linktitle.value,\r
- target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,\r
- 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null\r
+ target : f.target_list ? getSelectValue(f, "target_list") : null,\r
+ 'class' : f.class_list ? getSelectValue(f, "class_list") : null\r
});\r
}\r
});\r
ed.dom.setAttribs(e, {\r
href : f.href.value,\r
title : f.linktitle.value,\r
- target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,\r
- 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null\r
+ target : f.target_list ? getSelectValue(f, "target_list") : null,\r
+ 'class' : f.class_list ? getSelectValue(f, "class_list") : null\r
});\r
}\r
\r
if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))\r
n.value = 'mailto:' + n.value;\r
\r
- if (/^\s*www./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))\r
+ if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))\r
n.value = 'http://' + n.value;\r
},\r
\r