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