bgneal@45: /** bgneal@183: * editor_plugin_src.js bgneal@45: * bgneal@183: * Copyright 2009, Moxiecode Systems AB bgneal@183: * Released under LGPL License. bgneal@183: * bgneal@183: * License: http://tinymce.moxiecode.com/license bgneal@183: * Contributing: http://tinymce.moxiecode.com/contributing 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: })();