Updated TinyMCE to 3.2.1.1

This commit is contained in:
abacab
2009-01-01 11:44:00 -05:00
parent a7a76e9aee
commit 5c0ed5db40
1344 changed files with 74627 additions and 12975 deletions

View File

@@ -1,2 +1 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('preview','cs,de,el,en,fr_ca,it,ko,pt,sv,zh_cn,fa,fr');function TinyMCE_preview_getControlHTML(control_name){switch(control_name){case "preview":return '<img id="{$editor_id}_preview" src="{$pluginurl}/images/preview.gif" title="{$lang_preview_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePreview\');" />';}return "";}function TinyMCE_preview_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePreview":var previewPage=tinyMCE.getParam("plugin_preview_pageurl",null);var previewWidth=tinyMCE.getParam("plugin_preview_width","550");var previewHeight=tinyMCE.getParam("plugin_preview_height","600");if(previewPage){var template=new Array();template['file']=previewPage;template['width']=previewWidth;template['height']=previewHeight;tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"yes",content:tinyMCE.getContent(),content_css:tinyMCE.getParam("content_css")});}else{var win=window.open("","mcePreview","menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width="+previewWidth+",height="+previewHeight);var html="";html+='<!doctype html public "-//w3c//dtd html 4.0 transitional//en">';html+='<html>';html+='<head>';html+='<title>'+tinyMCE.getLang('lang_preview_desc')+'</title>';html+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';html+='<link href="'+tinyMCE.getParam("content_css")+'" rel="stylesheet" type="text/css">';html+='</head>';html+='<body>';html+=tinyMCE.getContent();html+='</body>';html+='</html>';win.document.write(html);win.document.close();}return true;}return false;}
(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);})();

View File

@@ -1,61 +1,50 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('preview', 'cs,de,el,en,fr_ca,it,ko,pt,sv,zh_cn,fa,fr');
/**
* Returns the HTML contents of the preview control.
* $Id: editor_plugin_src.js 895 2008-07-10 14:34:23Z spocke $
*
* @author Moxiecode
* @copyright Copyright <20> 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function TinyMCE_preview_getControlHTML(control_name) {
switch (control_name) {
case "preview":
return '<img id="{$editor_id}_preview" src="{$pluginurl}/images/preview.gif" title="{$lang_preview_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePreview\');" />';
}
return "";
}
(function() {
tinymce.create('tinymce.plugins.Preview', {
init : function(ed, url) {
var t = this, css = tinymce.explode(ed.settings.content_css);
/**
* Executes the mcePreview command.
*/
function TinyMCE_preview_execCommand(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mcePreview":
var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null);
var previewWidth = tinyMCE.getParam("plugin_preview_width", "550");
var previewHeight = tinyMCE.getParam("plugin_preview_height", "600");
t.editor = ed;
// Use a custom preview page
if (previewPage) {
var template = new Array();
// Force absolute CSS urls
tinymce.each(css, function(u, k) {
css[k] = ed.documentBaseURI.toAbsolute(u);
});
template['file'] = previewPage;
template['width'] = previewWidth;
template['height'] = previewHeight;
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()
});
});
tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")});
} else {
var win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + previewWidth + ",height=" + previewHeight);
var html = "";
ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'});
},
html += '<!doctype html public "-//w3c//dtd html 4.0 transitional//en">';
html += '<html>';
html += '<head>';
html += '<title>' + tinyMCE.getLang('lang_preview_desc') + '</title>';
html += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';
html += '<link href="' + tinyMCE.getParam("content_css") + '" rel="stylesheet" type="text/css">';
html += '</head>';
html += '<body>';
html += tinyMCE.getContent();
html += '</body>';
html += '</html>';
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
};
}
});
win.document.write(html);
win.document.close();
}
return true;
}
// Pass to next handler in chain
return false;
}
// Register plugin
tinymce.PluginManager.add('preview', tinymce.plugins.Preview);
})();

View File

@@ -1,14 +1,28 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<script language="javascript" src="../../tiny_mce_popup.js"></script>
<title>Example of a custom preview page</title>
<link href="{$content_css}" rel="stylesheet" type="text/css">
</head>
<body>
Editor contents: <br />
{$content}
</body>
</html>
<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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -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);
}

View File

@@ -1,3 +0,0 @@
// UK lang variables
tinyMCELang['lang_preview_desc'] = 'N<>hled';

View File

@@ -1,3 +0,0 @@
// DE lang variables by Tobias Heer
tinyMCELang['lang_preview_desc'] = 'Vorschau';

View File

@@ -1,3 +0,0 @@
// Greek lang variables by Jacaranda Bill
tinyMCELang['lang_preview_desc'] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';

View File

@@ -1,3 +0,0 @@
// UK lang variables
tinyMCELang['lang_preview_desc'] = 'Preview';

View File

@@ -1,8 +0,0 @@
// IR lang variables
// Persian (Farsi) language pack (for IRAN)
// By: Morteza Zafari
// Lost@LostLord.com
// http://www.LostLord.com
tinyMCELang['lang_dir'] = 'rtl';
tinyMCELang['lang_preview_desc'] = 'پیش نمایش';

View File

@@ -1,3 +0,0 @@
// French lang variables by Laurent Dran
tinyMCELang['lang_preview_desc'] = 'Pr&eacute;visualisation';

View File

@@ -1,3 +0,0 @@
// CAN_FR lang variables
tinyMCELang['lang_preview_desc'] = 'Pr<50>visualisation';

View File

@@ -1,3 +0,0 @@
// IT lang variables
tinyMCELang['lang_preview_desc'] = 'Anteprima';

View File

@@ -1,3 +0,0 @@
// KO lang variables
tinyMCELang['lang_preview_desc'] = '<27≯<EFBFBD><CCB8><EFBFBD><EFBFBD><EFBFBD>';

View File

@@ -1,3 +0,0 @@
// UK lang variables
tinyMCELang['lang_preview_desc'] = 'Pr<50>-visualiza<7A><61>o';

View File

@@ -1,3 +0,0 @@
// SE lang variables
tinyMCELang['lang_preview_desc'] = 'F<>rhandsgranska';

View File

@@ -1,3 +0,0 @@
// Simplified Chinese lang variables contributed by cube316 (cube316@etang.com)
tinyMCELang['lang_preview_desc'] = <><D4A4>';

View File

@@ -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>

View File

@@ -1,23 +0,0 @@
Preview plugin for TinyMCE
-----------------------------------
Installation instructions:
* Copy the preview directory to the plugins directory of TinyMCE (/jscripts/tiny_mce/plugins).
* Add plugin to TinyMCE plugin option list example: plugins : "preview".
* Add the preview button name to button list, example: theme_advanced_buttons3_add : "preview".
Initialization example:
tinyMCE.init({
theme : "advanced",
mode : "textareas",
plugins : "preview",
theme_advanced_buttons3_add : "preview",
plugin_preview_width : "500",
plugin_preview_height : "600"
});
Configuration:
plugin_preview_width - Preview window width. Defaults to 550.
plugin_preview_height - Preview window height. Defaults to 600.
plugin_preview_pageurl - Custom preview page URL relative from theme
use "../../plugins/preview/example.html" for a example.