summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/tinymce/themes/advanced/editor_template.js
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/js/tinymce/themes/advanced/editor_template.js')
-rw-r--r--wp-includes/js/tinymce/themes/advanced/editor_template.js102
1 files changed, 22 insertions, 80 deletions
diff --git a/wp-includes/js/tinymce/themes/advanced/editor_template.js b/wp-includes/js/tinymce/themes/advanced/editor_template.js
index b8e3685..be0e234 100644
--- a/wp-includes/js/tinymce/themes/advanced/editor_template.js
+++ b/wp-includes/js/tinymce/themes/advanced/editor_template.js
@@ -1,5 +1,5 @@
/**
- * $Id: editor_template_src.js 218 2007-02-13 11:08:01Z spocke $
+ * $Id: editor_template_src.js 256 2007-04-24 09:03:20Z spocke $
*
* @author Moxiecode
* @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
@@ -140,10 +140,10 @@ var TinyMCE_AdvancedTheme = {
case "|":
case "separator":
- return '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
+ return '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" alt="" />';
case "spacer":
- return '<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';
+ return '<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" alt="" />';
case "rowseparator":
return '<br />';
@@ -1242,7 +1242,7 @@ var TinyMCE_AdvancedTheme = {
if (set_w)
tableElm.style.width = w + "px";
-
+
if ( !tinyMCE.isMSIE || tinyMCE.isMSIE7 || tinyMCE.isOpera ) // WordPress: do this later to avoid creeping toolbar bug in MSIE6
tableElm.style.height = h + "px";
@@ -1251,8 +1251,8 @@ var TinyMCE_AdvancedTheme = {
iw = iw < 1 ? 30 : iw;
ih = ih < 1 ? 30 : ih;
-
-/* WordPress found that this led to a shrinking editor with every resize. (Gray background creeps in 1px at a time.)
+/* WordPress: found that this led to a shrinking editor with every resize.
+ (Gray background creeps in 1px at a time.)
if (tinyMCE.isGecko) {
iw -= 2;
ih -= 2;
@@ -1274,7 +1274,7 @@ var TinyMCE_AdvancedTheme = {
inst.iframeElement.style.width = (iw + dx) + "px";
}
}
-
+
tableElm.style.height = h + "px"; // WordPress: see above
// Remove pesky table controls
@@ -1404,7 +1404,7 @@ var TinyMCE_AdvancedTheme = {
h += '</tr></table>';
if (tinyMCE.getParam("theme_advanced_more_colors", true))
- h += '<a href="#" onclick="TinyMCE_AdvancedTheme._pickColor(\'' + id + '\',\'' + cm + '\');" class="mceMoreColors">' + tinyMCE.getLang('lang_more_colors') + '</a>';
+ h += '<a href="javascript:void(0);" onclick="TinyMCE_AdvancedTheme._pickColor(\'' + id + '\',\'' + cm + '\');" class="mceMoreColors">' + tinyMCE.getLang('lang_more_colors') + '</a>';
return h;
},
@@ -1424,78 +1424,20 @@ var TinyMCE_AdvancedTheme = {
},
_insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) {
- tinyMCE.execCommand('mceBeginUndoLevel');
-
- if (src == "")
- return;
-
- if (!tinyMCE.imgElement && tinyMCE.isSafari) {
- var html = "";
-
- html += '<img src="' + src + '" alt="' + alt + '"';
- html += ' border="' + border + '" hspace="' + hspace + '"';
- html += ' vspace="' + vspace + '" width="' + width + '"';
- html += ' height="' + height + '" align="' + align + '" title="' + title + '" onmouseover="' + onmouseover + '" onmouseout="' + onmouseout + '" />';
-
- tinyMCE.execCommand("mceInsertContent", false, html);
- } else {
- if (!tinyMCE.imgElement && tinyMCE.selectedInstance) {
- if (tinyMCE.isSafari)
- tinyMCE.execCommand("mceInsertContent", false, '<img src="' + tinyMCE.uniqueURL + '" />');
- else
- tinyMCE.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL);
-
- tinyMCE.imgElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL);
- }
- }
-
- if (tinyMCE.imgElement) {
- var needsRepaint = false;
- var msrc = src;
-
- src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);");
-
- if (tinyMCE.getParam('convert_urls'))
- msrc = src;
-
- if (onmouseover && onmouseover != "")
- onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';";
-
- if (onmouseout && onmouseout != "")
- onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';";
-
- // Use alt as title if it's undefined
- if (typeof(title) == "undefined")
- title = alt;
-
- if (width != tinyMCE.imgElement.getAttribute("width") || height != tinyMCE.imgElement.getAttribute("height") || align != tinyMCE.imgElement.getAttribute("align"))
- needsRepaint = true;
-
- tinyMCE.setAttrib(tinyMCE.imgElement, 'src', src);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'mce_src', msrc);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'alt', alt);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'title', title);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'align', align);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'border', border, true);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'hspace', hspace, true);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'vspace', vspace, true);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'width', width, true);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'height', height, true);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseover', onmouseover);
- tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseout', onmouseout);
-
- // Fix for bug #989846 - Image resize bug
- if (width && width != "")
- tinyMCE.imgElement.style.pixelWidth = width;
-
- if (height && height != "")
- tinyMCE.imgElement.style.pixelHeight = height;
-
- if (needsRepaint)
- tinyMCE.selectedInstance.repaint();
- }
-
- tinyMCE.execCommand('mceEndUndoLevel');
+ tinyMCE.execCommand("mceInsertContent", false, tinyMCE.createTagHTML('img', {
+ src : tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src), // Force absolute
+ mce_src : src,
+ alt : alt,
+ border : border,
+ hspace : hspace,
+ vspace : vspace,
+ width : width,
+ height : height,
+ align : align,
+ title : title,
+ onmouseover : onmouseover,
+ onmouseout : onmouseout
+ }));
},
_insertLink : function(href, target, title, onclick, style_class) {