fixing tinymce bugs

This commit is contained in:
JT Smith 2006-04-18 17:07:41 +00:00
parent 179e4a89ef
commit 4625a26bc3
3 changed files with 41 additions and 2 deletions

View file

@ -1,4 +1,5 @@
/* Import theme specific language pack */
tinyMCE.importPluginLanguagePack('insertImage', 'en');
/**
* Returns the HTML contents of the emotions control.
@ -6,7 +7,8 @@
function TinyMCE_insertImage_getControlHTML(control_name) {
switch (control_name) {
case "insertImage":
return '<img id="{$editor_id}_insertImage" src="{$pluginurl}/images/insertImage.gif" title="Insert a WebGUI collateral image" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'insertImage\');">';
case "insertdate":
return tinyMCE.getButtonHTML(control_name, 'lang_insert_webgui_image', '{$pluginurl}/images/insertImage.gif', 'insertImage');
}
return "";

View file

@ -113,7 +113,39 @@ function OKClick() {
width="";
height="";
tinyMCE.insertImage(src, alt, border, hspace, vspace, width, height, align);
var imageTag = '<img src="' + src + '" alt="' + alt + '" style="';
var preImageTag = '';
var postImageTag = '';
if (border > 0) {
imageTag = 'border: ' + border + 'px;';
}
if (hspace > 0) {
imageTag += 'margin-left: ' + hspace + 'px; margin-right: ' + hspace + 'px;';
}
if (vspace > 0) {
imageTag += 'margin-top: ' + vspace + 'px; margin-bottom: ' + vspace + 'px;';
}
if (height > 0) {
imageTag += 'height: ' + height + 'px;';
}
if (width > 0) {
imageTag += 'height: ' + height + 'px;';
}
if (align == "left") {
imageTag += 'text-align: left;';
}
if (align == "right") {
imageTag += 'text-align: right;';
}
if (align == "middle") {
imageTag += 'vertical-align: middle;';
preImageTag = '<p style="display:inline;vertical-align:middle;">';
postImageTag = '</p>';
}
imageTag += '" />';
imageTag = preImageTag + imageTag + postImageTag;
tinyMCE.execCommand('mceInsertContent', false, imageTag);
window.close();
}

View file

@ -0,0 +1,5 @@
// UK lang variables
tinyMCE.addToLang('',{
insert_webgui_image : 'Insert WebGUI Image'
});