4 * Copyright 2009, Moxiecode Systems AB
5 * Released under LGPL License.
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
12 tinymce.create('tinymce.plugins.Preview', {
13 init : function(ed, url) {
14 var t = this, css = tinymce.explode(ed.settings.content_css);
18 // Force absolute CSS urls
19 tinymce.each(css, function(u, k) {
20 css[k] = ed.documentBaseURI.toAbsolute(u);
23 ed.addCommand('mcePreview', function() {
24 ed.windowManager.open({
25 file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
26 width : parseInt(ed.getParam("plugin_preview_width", "550")),
27 height : parseInt(ed.getParam("plugin_preview_height", "600")),
30 popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
31 inline : ed.getParam("plugin_preview_inline", 1)
33 base : ed.documentBaseURI.getURI()
37 ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
40 getInfo : function() {
43 author : 'Moxiecode Systems AB',
44 authorurl : 'http://tinymce.moxiecode.com',
45 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
46 version : tinymce.majorVersion + "." + tinymce.minorVersion
52 tinymce.PluginManager.add('preview', tinymce.plugins.Preview);