diff options
Diffstat (limited to 'wp-includes/js/tinymce/themes/advanced/jscripts')
-rw-r--r-- | wp-includes/js/tinymce/themes/advanced/jscripts/color_picker.js | 15 | ||||
-rw-r--r-- | wp-includes/js/tinymce/themes/advanced/jscripts/link.js | 14 |
2 files changed, 15 insertions, 14 deletions
diff --git a/wp-includes/js/tinymce/themes/advanced/jscripts/color_picker.js b/wp-includes/js/tinymce/themes/advanced/jscripts/color_picker.js index 78425e4..9236fd0 100644 --- a/wp-includes/js/tinymce/themes/advanced/jscripts/color_picker.js +++ b/wp-includes/js/tinymce/themes/advanced/jscripts/color_picker.js @@ -153,7 +153,7 @@ function generateWebColors() { for (i=0; i<colors.length; i++) { h += '<td bgcolor="' + colors[i] + '">' - + '<a href="javascript:selectColor();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');">' + + '<a href="javascript:insertAction();" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');">' + '<img border="0" src="images/spacer.gif" width="10" height="10" title="' + colors[i] + '" alt="' + colors[i] + '" /></a></td>'; if ((i+1) % 18 == 0) h += '</tr><tr>'; @@ -173,22 +173,13 @@ function generateNamedColors() { for (n in named) { v = named[n]; - h += '<a href="javascript:selectColor();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>' + h += '<a href="javascript:insertAction();" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '"><!-- IE --></a>' } el.innerHTML = h; el.className = 'generated'; } -function selectColor() { - var color = document.getElementById("color").value; - - if(window.opener) - window.opener.tinyMCE.execInstanceCommand(tinyMCE.getWindowArg('editor_id'),tinyMCE.getWindowArg('command'),false,color); - - window.close(); -} - function dechex(n) { return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); } @@ -246,4 +237,4 @@ function changeFinalColor(color) { document.getElementById('color').value = color; } -window.focus();
\ No newline at end of file +window.focus(); diff --git a/wp-includes/js/tinymce/themes/advanced/jscripts/link.js b/wp-includes/js/tinymce/themes/advanced/jscripts/link.js index 9adac22..36df14e 100644 --- a/wp-includes/js/tinymce/themes/advanced/jscripts/link.js +++ b/wp-includes/js/tinymce/themes/advanced/jscripts/link.js @@ -24,10 +24,12 @@ function init() { if (option.value == tinyMCE.getWindowArg('target')) option.selected = true; } - + + // WordPress -- next 3 lines document.forms[0].href.value = tinyMCE.getWindowArg('href') || 'http://'; document.forms[0].href.select(); document.forms[0].href.focus(); + document.forms[0].linktitle.value = tinyMCE.getWindowArg('title'); document.forms[0].insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); @@ -52,6 +54,14 @@ function init() { } } +function checkPrefix(n) { + if (Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCE.getLang('lang_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www./i.test(n.value) && confirm(tinyMCE.getLang('lang_is_external'))) + n.value = 'http://' + n.value; +} + function insertLink() { var href = document.forms[0].href.value; var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value; @@ -61,7 +71,7 @@ function insertLink() { // WordPress: Make anchors absolute; if (href.charAt(0) == '#') - href = tinyMCE.settings['document_base_url'] + href; + href = tinyMCE.settings.document_base_url + href; if (target == '_self') target = ''; |