1
|
1 |
/**
|
778
|
2 |
* $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z spocke $
|
1
|
3 |
*
|
|
4 |
* @author Moxiecode
|
395
fa4c5ecb7c9a
Fixed splitting bug (really the same issue from stable) in get_pageid_from_url(); upgraded TinyMCE to version 3.0-stable
Dan
diff
changeset
|
5 |
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
1
|
6 |
*/
|
|
7 |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
8 |
(function() {
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
9 |
tinymce.create('tinymce.plugins.Preview', {
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
10 |
init : function(ed, url) {
|
778
|
11 |
var t = this, css = tinymce.explode(ed.settings.content_css);
|
1
|
12 |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
13 |
t.editor = ed;
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
14 |
|
778
|
15 |
// Force absolute CSS urls
|
|
16 |
tinymce.each(css, function(u, k) {
|
|
17 |
css[k] = ed.documentBaseURI.toAbsolute(u);
|
|
18 |
});
|
|
19 |
|
|
20 |
ed.addCommand('mcePreview', function() {
|
|
21 |
ed.windowManager.open({
|
|
22 |
file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
|
|
23 |
width : parseInt(ed.getParam("plugin_preview_width", "550")),
|
|
24 |
height : parseInt(ed.getParam("plugin_preview_height", "600")),
|
|
25 |
resizable : "yes",
|
|
26 |
scrollbars : "yes",
|
|
27 |
popup_css : css.join(','),
|
|
28 |
inline : ed.getParam("plugin_preview_inline", 1)
|
|
29 |
}, {
|
|
30 |
base : ed.documentBaseURI.getURI()
|
|
31 |
});
|
|
32 |
});
|
|
33 |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
34 |
ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
35 |
},
|
1
|
36 |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
37 |
getInfo : function() {
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
38 |
return {
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
39 |
longname : 'Preview',
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
40 |
author : 'Moxiecode Systems AB',
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
41 |
authorurl : 'http://tinymce.moxiecode.com',
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
42 |
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
43 |
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
44 |
};
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
45 |
}
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
46 |
});
|
1
|
47 |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
48 |
// Register plugin
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
49 |
tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
diff
changeset
|
50 |
})(); |