Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

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