tinymce bug fixes and a new function in Utility.pm
This commit is contained in:
parent
7578859801
commit
873ce1c62e
42 changed files with 449 additions and 194 deletions
|
|
@ -5,7 +5,7 @@ tinyMCE.importPluginLanguagePack('emotions', 'uk,se');
|
|||
* Returns the HTML contents of the emotions control.
|
||||
*/
|
||||
function TinyMCE_emotions_getControlHTML(control_name) {
|
||||
switch (control_name) {
|
||||
switch (control_name) {
|
||||
case "emotions":
|
||||
return '<img id="{$editor_id}_emotions" src="{$pluginurl}/images/emotions.gif" title="{$lang_emotions_desc}" 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}\',\'mceEmotion\');">';
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ function TinyMCE_emotions_getControlHTML(control_name) {
|
|||
*/
|
||||
function TinyMCE_emotions_execCommand(editor_id, element, command, user_interface, value) {
|
||||
// Handle commands
|
||||
switch (command) {
|
||||
switch (command) {
|
||||
case "mceEmotion":
|
||||
var template = new Array();
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@ function TinyMCE_iespell_execCommand(editor_id, element, command, user_interface
|
|||
ieSpell.CheckDocumentNode(tinyMCE._getInstanceById(editor_id).contentDocument.documentElement);
|
||||
} catch (e) {
|
||||
if (e.number == -2146827859) {
|
||||
if (confirm("ieSpell not detected. Click OK to go to download page."))
|
||||
window.open('http://www.iespell.com/download.php','Download','');
|
||||
else
|
||||
alert("Error Loading ieSpell: Exception " + exception.number);
|
||||
}
|
||||
if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))
|
||||
window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
|
||||
} else
|
||||
alert("Error Loading ieSpell: Exception " + e.number);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// SE lang variables
|
||||
|
||||
tinyMCELang['lang_iespell_desc'] = 'Kör rättstavningskontroll';
|
||||
tinyMCELang['lang_iespell_download'] = "ieSpell verkar inte vara installerad. Klicka OK för att ladda hem."
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// UK lang variables
|
||||
|
||||
tinyMCELang['lang_iespell_desc'] = 'Run spell checking';
|
||||
tinyMCELang['lang_iespell_download'] = "ieSpell not detected. Click OK to go to download page."
|
||||
|
|
|
|||
|
|
@ -21,7 +21,11 @@ function TinyMCE_pagetree_execCommand(editor_id, element, command, user_interfac
|
|||
case "wgPageTree":
|
||||
var template = new Array();
|
||||
|
||||
template['file'] = getWebguiProperty ("pageURL") + '?op=richEditPageTree'; // Relative to theme
|
||||
alert(getWebguiProperty("pageURL"));
|
||||
|
||||
template['file'] = "../../../../../.." + getWebguiProperty ("pageURL") + '?op=richEditPageTree'; // Relative to theme
|
||||
|
||||
alert(template['file']);
|
||||
template['width'] = 500;
|
||||
template['height'] = 500;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,23 +20,38 @@ function TinyMCE_preview_execCommand(editor_id, element, command, user_interface
|
|||
// Handle commands
|
||||
switch (command) {
|
||||
case "mcePreview":
|
||||
var win = window.open("", "mcePreview", "menubar=yes,toolbar=yes,scrollbars=yes,left=20,top=20,width=" + tinyMCE.getParam("plugin_preview_width", "550") + ",height=" + tinyMCE.getParam("plugin_preview_height", "600"));
|
||||
var html = "";
|
||||
var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null);
|
||||
var previewWidth = tinyMCE.getParam("plugin_preview_width", "550");
|
||||
var previewHeight = tinyMCE.getParam("plugin_preview_height", "600");
|
||||
|
||||
html += '<!doctype html public "-//w3c//dtd html 4.0 transitional//en">';
|
||||
html += '<html>';
|
||||
html += '<head>';
|
||||
html += '<title>' + tinyMCE.getLang('lang_preview_desc') + '</title>';
|
||||
html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
|
||||
html += '<link href="' + tinyMCE.getParam("content_css") + '" rel="stylesheet" type="text/css">';
|
||||
html += '</head>';
|
||||
html += '<body>';
|
||||
html += tinyMCE.getContent();
|
||||
html += '</body>';
|
||||
html += '</html>';
|
||||
// Use a custom preview page
|
||||
if (previewPage) {
|
||||
var template = new Array();
|
||||
|
||||
win.document.write(html);
|
||||
win.document.close();
|
||||
template['file'] = previewPage;
|
||||
template['width'] = previewWidth;
|
||||
template['height'] = previewHeight;
|
||||
|
||||
tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")});
|
||||
} else {
|
||||
var win = window.open("", "mcePreview", "menubar=yes,toolbar=yes,scrollbars=yes,left=20,top=20,width=" + previewWidth + ",height=" + previewHeight);
|
||||
var html = "";
|
||||
|
||||
html += '<!doctype html public "-//w3c//dtd html 4.0 transitional//en">';
|
||||
html += '<html>';
|
||||
html += '<head>';
|
||||
html += '<title>' + tinyMCE.getLang('lang_preview_desc') + '</title>';
|
||||
html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
|
||||
html += '<link href="' + tinyMCE.getParam("content_css") + '" rel="stylesheet" type="text/css">';
|
||||
html += '</head>';
|
||||
html += '<body>';
|
||||
html += tinyMCE.getContent();
|
||||
html += '</body>';
|
||||
html += '</html>';
|
||||
|
||||
win.document.write(html);
|
||||
win.document.close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,3 +19,5 @@ Initialization example:
|
|||
Configuration:
|
||||
plugin_preview_width - Preview window width. Defaults to 550.
|
||||
plugin_preview_height - Preview window height. Defaults to 600.
|
||||
plugin_preview_pageurl - Custom preview page URL relative from theme
|
||||
use "../../plugins/preview/example.html" for a example.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue