fixing tinymce bugs
This commit is contained in:
parent
179e4a89ef
commit
4625a26bc3
3 changed files with 41 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
/* Import theme specific language pack */
|
/* Import theme specific language pack */
|
||||||
|
tinyMCE.importPluginLanguagePack('insertImage', 'en');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the HTML contents of the emotions control.
|
* Returns the HTML contents of the emotions control.
|
||||||
|
|
@ -6,7 +7,8 @@
|
||||||
function TinyMCE_insertImage_getControlHTML(control_name) {
|
function TinyMCE_insertImage_getControlHTML(control_name) {
|
||||||
switch (control_name) {
|
switch (control_name) {
|
||||||
case "insertImage":
|
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 "";
|
return "";
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,39 @@ function OKClick() {
|
||||||
width="";
|
width="";
|
||||||
height="";
|
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();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
www/extras/tinymce2/jscripts/tiny_mce/plugins/insertImage/langs/en.js
vendored
Normal file
5
www/extras/tinymce2/jscripts/tiny_mce/plugins/insertImage/langs/en.js
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
// UK lang variables
|
||||||
|
|
||||||
|
tinyMCE.addToLang('',{
|
||||||
|
insert_webgui_image : 'Insert WebGUI Image'
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue