Began removing $Id$ tags. This will be an ongoing process.
[citadel.git] / webcit / tiny_mce / plugins / preview / editor_plugin_src.js
1 /*
2  * Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
3  */
4
5 (function() {
6         tinymce.create('tinymce.plugins.Preview', {
7                 init : function(ed, url) {
8                         var t = this, css = tinymce.explode(ed.settings.content_css);
9
10                         t.editor = ed;
11
12                         // Force absolute CSS urls      
13                         tinymce.each(css, function(u, k) {
14                                 css[k] = ed.documentBaseURI.toAbsolute(u);
15                         });
16
17                         ed.addCommand('mcePreview', function() {
18                                 ed.windowManager.open({
19                                         file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
20                                         width : parseInt(ed.getParam("plugin_preview_width", "550")),
21                                         height : parseInt(ed.getParam("plugin_preview_height", "600")),
22                                         resizable : "yes",
23                                         scrollbars : "yes",
24                                         popup_css : css.join(','),
25                                         inline : ed.getParam("plugin_preview_inline", 1)
26                                 }, {
27                                         base : ed.documentBaseURI.getURI()
28                                 });
29                         });
30
31                         ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
32                 },
33
34                 getInfo : function() {
35                         return {
36                                 longname : 'Preview',
37                                 author : 'Moxiecode Systems AB',
38                                 authorurl : 'http://tinymce.moxiecode.com',
39                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
40                                 version : tinymce.majorVersion + "." + tinymce.minorVersion
41                         };
42                 }
43         });
44
45         // Register plugin
46         tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
47 })();