annotate WebContent/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js @ 10:0bdfe01e30b5

checking auth token works now.
author casties
date Tue, 20 Mar 2012 15:55:51 +0100
parents 0be9d53a6967
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
1 /**
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
2 * editor_plugin_src.js
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
3 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
4 * Copyright 2009, Moxiecode Systems AB
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
5 * Released under LGPL License.
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
6 *
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
7 * License: http://tinymce.moxiecode.com/license
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
8 * Contributing: http://tinymce.moxiecode.com/contributing
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
9 */
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
10
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
11 (function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
12 tinymce.create('tinymce.plugins.Preview', {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
13 init : function(ed, url) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
14 var t = this, css = tinymce.explode(ed.settings.content_css);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
15
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
16 t.editor = ed;
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
17
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
18 // Force absolute CSS urls
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
19 tinymce.each(css, function(u, k) {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
20 css[k] = ed.documentBaseURI.toAbsolute(u);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
21 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
22
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
23 ed.addCommand('mcePreview', function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
24 ed.windowManager.open({
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
25 file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
26 width : parseInt(ed.getParam("plugin_preview_width", "550")),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
27 height : parseInt(ed.getParam("plugin_preview_height", "600")),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
28 resizable : "yes",
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
29 scrollbars : "yes",
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
30 popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"),
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
31 inline : ed.getParam("plugin_preview_inline", 1)
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
32 }, {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
33 base : ed.documentBaseURI.getURI()
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
34 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
35 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
36
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
37 ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
38 },
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
39
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
40 getInfo : function() {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
41 return {
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
42 longname : 'Preview',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
43 author : 'Moxiecode Systems AB',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
44 authorurl : 'http://tinymce.moxiecode.com',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
45 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
46 version : tinymce.majorVersion + "." + tinymce.minorVersion
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
47 };
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
48 }
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
49 });
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
50
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
51 // Register plugin
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
52 tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
0be9d53a6967 editor for annotations
dwinter
parents:
diff changeset
53 })();