1 /* Import plugin specific language pack */
\r
2 tinyMCE.importPluginLanguagePack('preview', 'cs,de,el,en,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');
\r
4 function TinyMCE_preview_getInfo() {
\r
6 longname : 'Preview',
\r
7 author : 'Moxiecode Systems',
\r
8 authorurl : 'http://tinymce.moxiecode.com',
\r
9 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html',
\r
10 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
\r
15 * Returns the HTML contents of the preview control.
\r
17 function TinyMCE_preview_getControlHTML(control_name) {
\r
18 switch (control_name) {
\r
20 var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePreview\');return false;';
\r
21 return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><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\');" /></a>';
\r
28 * Executes the mcePreview command.
\r
30 function TinyMCE_preview_execCommand(editor_id, element, command, user_interface, value) {
\r
34 var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null);
\r
35 var previewWidth = tinyMCE.getParam("plugin_preview_width", "550");
\r
36 var previewHeight = tinyMCE.getParam("plugin_preview_height", "600");
\r
38 // Use a custom preview page
\r
40 var template = new Array();
\r
42 template['file'] = previewPage;
\r
43 template['width'] = previewWidth;
\r
44 template['height'] = previewHeight;
\r
46 tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", inline : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")});
\r
48 var win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + previewWidth + ",height=" + previewHeight);
\r
51 html += tinyMCE.getParam('doctype');
\r
52 html += '<html xmlns="http://www.w3.org/1999/xhtml">';
\r
54 html += '<title>' + tinyMCE.getLang('lang_preview_desc') + '</title>';
\r
55 html += '<base href="' + tinyMCE.getParam("document_base_url") + '">';
\r
56 html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
\r
57 html += '<link href="' + tinyMCE.getParam("content_css") + '" rel="stylesheet" type="text/css">';
\r
60 html += tinyMCE.getContent();
\r
64 win.document.write(html);
\r
65 win.document.close();
\r