summaryrefslogtreecommitdiffstats
path: root/extensions/tinymce/jscripts/tiny_mce/plugins/preview
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/tinymce/jscripts/tiny_mce/plugins/preview')
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js1
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js50
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/plugins/preview/example.html28
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js73
-rw-r--r--extensions/tinymce/jscripts/tiny_mce/plugins/preview/preview.html19
5 files changed, 171 insertions, 0 deletions
diff --git a/extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js
new file mode 100644
index 0000000..deb4bce
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin.js
@@ -0,0 +1 @@
+(function(){tinymce.create('tinymce.plugins.Preview',{init:function(ed,url){var t=this,css=tinymce.explode(ed.settings.content_css);t.editor=ed;tinymce.each(css,function(u,k){css[k]=ed.documentBaseURI.toAbsolute(u);});ed.addCommand('mcePreview',function(){ed.windowManager.open({file:ed.getParam("plugin_preview_pageurl",url+"/preview.html"),width:parseInt(ed.getParam("plugin_preview_width","550")),height:parseInt(ed.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:css.join(','),inline:ed.getParam("plugin_preview_inline",1)},{base:ed.documentBaseURI.getURI()});});ed.addButton('preview',{title:'preview.preview_desc',cmd:'mcePreview'});},getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('preview',tinymce.plugins.Preview);})(); \ No newline at end of file
diff --git a/extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js
new file mode 100644
index 0000000..b2d27f7
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js
@@ -0,0 +1,50 @@
+/**
+ * $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z spocke $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
+ */
+
+(function() {
+ tinymce.create('tinymce.plugins.Preview', {
+ init : function(ed, url) {
+ var t = this, css = tinymce.explode(ed.settings.content_css);
+
+ t.editor = ed;
+
+ // Force absolute CSS urls
+ tinymce.each(css, function(u, k) {
+ css[k] = ed.documentBaseURI.toAbsolute(u);
+ });
+
+ ed.addCommand('mcePreview', function() {
+ ed.windowManager.open({
+ file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"),
+ width : parseInt(ed.getParam("plugin_preview_width", "550")),
+ height : parseInt(ed.getParam("plugin_preview_height", "600")),
+ resizable : "yes",
+ scrollbars : "yes",
+ popup_css : css.join(','),
+ inline : ed.getParam("plugin_preview_inline", 1)
+ }, {
+ base : ed.documentBaseURI.getURI()
+ });
+ });
+
+ ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'Preview',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
+})(); \ No newline at end of file
diff --git a/extensions/tinymce/jscripts/tiny_mce/plugins/preview/example.html b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/example.html
new file mode 100644
index 0000000..b2c3d90
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/example.html
@@ -0,0 +1,28 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script language="javascript" src="../../tiny_mce_popup.js"></script>
+<script type="text/javascript" src="jscripts/embed.js"></script>
+<script type="text/javascript">
+tinyMCEPopup.onInit.add(function(ed) {
+ var dom = tinyMCEPopup.dom;
+
+ // Load editor content_css
+ tinymce.each(ed.settings.content_css.split(','), function(u) {
+ dom.loadCSS(ed.documentBaseURI.toAbsolute(u));
+ });
+
+ // Place contents inside div container
+ dom.setHTML('content', ed.getContent());
+});
+</script>
+<title>Example of a custom preview page</title>
+</head>
+<body>
+
+Editor contents: <br />
+<div id="content">
+<!-- Gets filled with editor contents -->
+</div>
+
+</body>
+</html>
diff --git a/extensions/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js
new file mode 100644
index 0000000..f8dc810
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/jscripts/embed.js
@@ -0,0 +1,73 @@
+/**
+ * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose.
+ */
+
+function writeFlash(p) {
+ writeEmbed(
+ 'D27CDB6E-AE6D-11cf-96B8-444553540000',
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+ 'application/x-shockwave-flash',
+ p
+ );
+}
+
+function writeShockWave(p) {
+ writeEmbed(
+ '166B1BCA-3F9C-11CF-8075-444553540000',
+ 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0',
+ 'application/x-director',
+ p
+ );
+}
+
+function writeQuickTime(p) {
+ writeEmbed(
+ '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+ 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0',
+ 'video/quicktime',
+ p
+ );
+}
+
+function writeRealMedia(p) {
+ writeEmbed(
+ 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA',
+ 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0',
+ 'audio/x-pn-realaudio-plugin',
+ p
+ );
+}
+
+function writeWindowsMedia(p) {
+ p.url = p.src;
+ writeEmbed(
+ '6BF52A52-394A-11D3-B153-00C04F79FAA6',
+ 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',
+ 'application/x-mplayer2',
+ p
+ );
+}
+
+function writeEmbed(cls, cb, mt, p) {
+ var h = '', n;
+
+ h += '<object classid="clsid:' + cls + '" codebase="' + cb + '"';
+ h += typeof(p.id) != "undefined" ? 'id="' + p.id + '"' : '';
+ h += typeof(p.name) != "undefined" ? 'name="' + p.name + '"' : '';
+ h += typeof(p.width) != "undefined" ? 'width="' + p.width + '"' : '';
+ h += typeof(p.height) != "undefined" ? 'height="' + p.height + '"' : '';
+ h += typeof(p.align) != "undefined" ? 'align="' + p.align + '"' : '';
+ h += '>';
+
+ for (n in p)
+ h += '<param name="' + n + '" value="' + p[n] + '">';
+
+ h += '<embed type="' + mt + '"';
+
+ for (n in p)
+ h += n + '="' + p[n] + '" ';
+
+ h += '></embed></object>';
+
+ document.write(h);
+}
diff --git a/extensions/tinymce/jscripts/tiny_mce/plugins/preview/preview.html b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/preview.html
new file mode 100644
index 0000000..7960f78
--- /dev/null
+++ b/extensions/tinymce/jscripts/tiny_mce/plugins/preview/preview.html
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script language="javascript" src="../../tiny_mce_popup.js"></script>
+<script type="text/javascript" src="jscripts/embed.js"></script>
+<script type="text/javascript">
+tinyMCEPopup.onInit.add(function(ed) {
+ var dom = tinyMCEPopup.dom;
+
+ dom.setHTML('content', ed.getContent());
+});
+
+document.write('<base href="' + tinyMCEPopup.getWindowArg("base") + '">');
+</script>
+<title>{#preview.preview_desc}</title>
+</head>
+<body id="content">
+<!-- Gets filled with editor contents -->
+</body>
+</html>