bgneal@312: /** bgneal@312: * editor_plugin_src.js bgneal@312: * bgneal@312: * Copyright 2009, Moxiecode Systems AB bgneal@312: * Released under LGPL License. bgneal@312: * bgneal@312: * License: http://tinymce.moxiecode.com/license bgneal@312: * Contributing: http://tinymce.moxiecode.com/contributing bgneal@312: */ bgneal@312: bgneal@312: (function() { bgneal@312: tinymce.create('tinymce.plugins.Preview', { bgneal@312: init : function(ed, url) { bgneal@312: var t = this, css = tinymce.explode(ed.settings.content_css); bgneal@312: bgneal@312: t.editor = ed; bgneal@312: bgneal@312: // Force absolute CSS urls bgneal@312: tinymce.each(css, function(u, k) { bgneal@312: css[k] = ed.documentBaseURI.toAbsolute(u); bgneal@312: }); bgneal@312: bgneal@312: ed.addCommand('mcePreview', function() { bgneal@312: ed.windowManager.open({ bgneal@312: file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), bgneal@312: width : parseInt(ed.getParam("plugin_preview_width", "550")), bgneal@312: height : parseInt(ed.getParam("plugin_preview_height", "600")), bgneal@312: resizable : "yes", bgneal@312: scrollbars : "yes", bgneal@312: popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), bgneal@312: inline : ed.getParam("plugin_preview_inline", 1) bgneal@312: }, { bgneal@312: base : ed.documentBaseURI.getURI() bgneal@312: }); bgneal@312: }); bgneal@312: bgneal@312: ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); bgneal@312: }, bgneal@312: bgneal@312: getInfo : function() { bgneal@312: return { bgneal@312: longname : 'Preview', bgneal@312: author : 'Moxiecode Systems AB', bgneal@312: authorurl : 'http://tinymce.moxiecode.com', bgneal@312: infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', bgneal@312: version : tinymce.majorVersion + "." + tinymce.minorVersion bgneal@312: }; bgneal@312: } bgneal@312: }); bgneal@312: bgneal@312: // Register plugin bgneal@312: tinymce.PluginManager.add('preview', tinymce.plugins.Preview); bgneal@312: })();