tinymce editor

This commit is contained in:
JT Smith 2004-10-30 16:36:18 +00:00
parent 6ddb7c49e6
commit 9cffe191ac
655 changed files with 16255 additions and 22045 deletions

View file

@ -0,0 +1,46 @@
/* Import theme specific language pack */
tinyMCE.importPluginLanguagePack('preview', 'uk,se');
/**
* Returns the HTML contents of the preview control.
*/
function TinyMCE_preview_getControlHTML(control_name) {
switch (control_name) {
case "preview":
return '<img id="{$editor_id}_preview" src="{$pluginurl}/images/preview.gif" title="{$lang_preview_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}\',\'mcePreview\');">';
}
return "";
}
/**
* Executes the mcePreview command.
*/
function TinyMCE_preview_execCommand(editor_id, element, command, user_interface, value) {
// 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 = "";
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;
}
// Pass to next handler in chain
return false;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

View file

@ -0,0 +1,3 @@
// SE lang variables
tinyMCELang['lang_preview_desc'] = 'Förhandsgranska';

View file

@ -0,0 +1,3 @@
// UK lang variables
tinyMCELang['lang_preview_desc'] = 'Preview';

View file

@ -0,0 +1,21 @@
Preview plugin for TinyMCE
-----------------------------------
Installation instructions:
* Copy the preview directory to the plugins directory of TinyMCE (/jscripts/tiny_mce/plugins).
* Add plugin to TinyMCE plugin option list example: plugins : "preview".
* Add the preview button name to button list, example: theme_advanced_buttons3_add : "preview".
Initialization example:
tinyMCE.init({
theme : "advanced",
mode : "textareas",
plugins : "preview",
theme_advanced_buttons3_add : "preview",
plugin_preview_width : "500",
plugin_preview_height : "600"
});
Configuration:
plugin_preview_width - Preview window width. Defaults to 550.
plugin_preview_height - Preview window height. Defaults to 600.