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