app/tiny_mce/plugins/preview/editor_plugin_src.js
changeset 154 d2377425d3f2
parent 126 6186c115a210
equal deleted inserted replaced
153:79d52c2d50a2 154:d2377425d3f2
       
     1 /**
       
     2  * $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z 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.join(','),
       
    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 })();