includes/clientside/tinymce/plugins/preview/editor_plugin_src.js
changeset 1344 dc96d6c5cd1e
parent 1343 2a31905a567d
child 1345 1de01205143b
equal deleted inserted replaced
1343:2a31905a567d 1344:dc96d6c5cd1e
     1 /**
       
     2  * $Id: editor_plugin_src.js 1056 2009-03-13 12:47:03Z spocke $
       
     3  *
       
     4  * @author Moxiecode
       
     5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
       
     6  */
       
     7 
       
     8 (function() {
       
     9 	tinymce.create('tinymce.plugins.Preview', {
       
    10 		init : function(ed, url) {
       
    11 			var t = this, css = tinymce.explode(ed.settings.content_css);
       
    12 
       
    13 			t.editor = ed;
       
    14 
       
    15 			// Force absolute CSS urls	
       
    16 			tinymce.each(css, function(u, k) {
       
    17 				css[k] = ed.documentBaseURI.toAbsolute(u);
       
    18 			});
       
    19 
       
    20 			ed.addCommand('mcePreview', function() {
       
    21 				ed.windowManager.open({
       
    22 					file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
       
    23 					width : parseInt(ed.getParam("plugin_preview_width", "550")),
       
    24 					height : parseInt(ed.getParam("plugin_preview_height", "600")),
       
    25 					resizable : "yes",
       
    26 					scrollbars : "yes",
       
    27 					popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
       
    28 					inline : ed.getParam("plugin_preview_inline", 1)
       
    29 				}, {
       
    30 					base : ed.documentBaseURI.getURI()
       
    31 				});
       
    32 			});
       
    33 
       
    34 			ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
       
    35 		},
       
    36 
       
    37 		getInfo : function() {
       
    38 			return {
       
    39 				longname : 'Preview',
       
    40 				author : 'Moxiecode Systems AB',
       
    41 				authorurl : 'http://tinymce.moxiecode.com',
       
    42 				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
       
    43 				version : tinymce.majorVersion + "." + tinymce.minorVersion
       
    44 			};
       
    45 		}
       
    46 	});
       
    47 
       
    48 	// Register plugin
       
    49 	tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
       
    50 })();