upgrading tinymce to 1.45

This commit is contained in:
JT Smith 2005-08-05 20:25:22 +00:00
parent c351096b73
commit 677558fe71
46 changed files with 664 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 935 B

View file

@ -0,0 +1 @@
Check the TinyMCE documentation for details on this plugin.

View file

@ -0,0 +1,2 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('directionality','en,sv,fr_ca,zh_cn');function TinyMCE_directionality_getControlHTML(control_name){var safariPatch='" onclick="';if(tinyMCE.isSafari)safariPatch="";switch(control_name){case "ltr":return '<img id="{$editor_id}_ltr" src="{$pluginurl}/images/ltr.gif" title="{$lang_directionality_ltr_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');'+safariPatch+'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');" />';case "rtl":return '<img id="{$editor_id}_rtl" src="{$pluginurl}/images/rtl.gif" title="{$lang_directionality_rtl_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');'+safariPatch+'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');" />';}return "";}function TinyMCE_directionality_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case "mceDirectionRTL":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true;}return false;}function TinyMCE_directionality_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}tinyMCE.switchClassSticky(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_rtl','mceButtonNormal');if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm)return;var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClassSticky(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClassSticky(editor_id+'_rtl','mceButtonSelected');return true;}

View file

@ -0,0 +1,71 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('directionality', 'en,sv,fr_ca,zh_cn');
function TinyMCE_directionality_getControlHTML(control_name) {
var safariPatch = '" onclick="';
if (tinyMCE.isSafari)
safariPatch = "";
switch (control_name) {
case "ltr":
return '<img id="{$editor_id}_ltr" src="{$pluginurl}/images/ltr.gif" title="{$lang_directionality_ltr_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');' + safariPatch + 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');" />';
case "rtl":
return '<img id="{$editor_id}_rtl" src="{$pluginurl}/images/rtl.gif" title="{$lang_directionality_rtl_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');' + safariPatch + 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');" />';
}
return "";
}
function TinyMCE_directionality_execCommand(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceDirectionLTR":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "ltr");
tinyMCE.triggerNodeChange(false);
return true;
case "mceDirectionRTL":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "rtl");
tinyMCE.triggerNodeChange(false);
return true;
}
// Pass to next handler in chain
return false;
}
function TinyMCE_directionality_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
function getAttrib(elm, name) {
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
}
tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonNormal');
tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonNormal');
if (node == null)
return;
var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (!elm)
return;
var dir = getAttrib(elm, "dir");
if (dir == "ltr" || dir == "")
tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonSelected');
else
tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonSelected');
return true;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

View file

@ -0,0 +1,4 @@
// UK lang variables
tinyMCELang['lang_directionality_ltr_desc'] = 'Direction left to right'
tinyMCELang['lang_directionality_rtl_desc'] = 'Direction right to left';

View file

@ -0,0 +1,4 @@
// fr_ca lang variables
tinyMCELang['lang_directionality_ltr_desc'] = 'Direction de la gauche vers la droite'
tinyMCELang['lang_directionality_rtl_desc'] = 'Direction de la droite vers la gauche';

View file

@ -0,0 +1,4 @@
// SV lang variables
tinyMCELang['lang_directionality_ltr_desc'] = 'Riktning fr&aring;n v&auml;nster till h&ouml;ger'
tinyMCELang['lang_directionality_rtl_desc'] = 'Riktning fr&aring;n h&ouml;ger till v&auml;nster';

View file

@ -0,0 +1,5 @@
// Simplified Chinese lang variables contributed by cube316 (cube316@gmail.com)
//请访问 http://www.cube316.net/ 以获取TinyMCE的中文支持
tinyMCELang['lang_directionality_ltr_desc'] = '从左往右的方向'
tinyMCELang['lang_directionality_rtl_desc'] = '从右往左的方向';

View file

@ -0,0 +1 @@
Check the TinyMCE documentation for details on this plugin.

View file

@ -0,0 +1,2 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('fullscreen','en,sv,cs,fr_ca,zh_cn');function TinyMCE_fullscreen_getControlHTML(control_name){switch(control_name){case "fullscreen":return '<img id="{$editor_id}_fullscreen" src="{$pluginurl}/images/fullscreen.gif" title="{$lang_fullscreen_desc}" width="20" height="20" class="mceButton'+(tinyMCE.getParam('fullscreen_is_enabled')?'Selected':'Normal')+'" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFullScreen\');" />';}return "";}function TinyMCE_fullscreen_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceFullScreen":if(tinyMCE.getParam('fullscreen_is_enabled')){window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'),'mceSetContent',false,tinyMCE.getContent(editor_id));top.close();}else{tinyMCE.setWindowArg('editor_id',editor_id);var win=window.open(tinyMCE.baseURL+"/plugins/fullscreen/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);}return true;}return false;}

View file

@ -0,0 +1,34 @@
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('fullscreen', 'en,sv,cs,fr_ca,zh_cn');
function TinyMCE_fullscreen_getControlHTML(control_name) {
switch (control_name) {
case "fullscreen":
return '<img id="{$editor_id}_fullscreen" src="{$pluginurl}/images/fullscreen.gif" title="{$lang_fullscreen_desc}" width="20" height="20" class="mceButton' + (tinyMCE.getParam('fullscreen_is_enabled') ? 'Selected' : 'Normal') + '" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFullScreen\');" />';
}
return "";
}
function TinyMCE_fullscreen_execCommand(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceFullScreen":
if (tinyMCE.getParam('fullscreen_is_enabled')) {
// In fullscreen mode
window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(editor_id));
top.close();
} else {
tinyMCE.setWindowArg('editor_id', editor_id);
var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
}
return true;
}
// Pass to next handler in chain
return false;
}

View file

@ -0,0 +1,72 @@
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript" type="text/javascript" src="../../tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
function patchCallback(settings, key) {
if (settings[key])
settings[key] = "window.opener." + settings[key];
}
var settings = new Array();
// Clone array
for (var name in window.opener.tinyMCE.settings)
settings[name] = window.opener.tinyMCE.settings[name];
// Override options for fullscreen
for (var name in window.opener.tinyMCE.settings.fullscreen_settings)
settings[name] = window.opener.tinyMCE.settings.fullscreen_settings[name];
// Patch callbacks, make them point to window.opener
patchCallback(settings, 'urlconverter_callback');
patchCallback(settings, 'insertlink_callback');
patchCallback(settings, 'insertimage_callback');
patchCallback(settings, 'setupcontent_callback');
patchCallback(settings, 'save_callback');
patchCallback(settings, 'onchange_callback');
patchCallback(settings, 'init_instance_callback');
patchCallback(settings, 'file_browser_callback');
patchCallback(settings, 'cleanup_callback');
patchCallback(settings, 'oninit');
// Set options
settings['mode'] = 'exact';
settings['elements'] = 'fullscreenarea';
settings['ask'] = false;
settings['setupcontent_callback'] = 'setupContent';
settings['fullscreen_is_enabled'] = true;
settings['fullscreen_editor_id'] = window.opener.tinyMCE.getWindowArg("editor_id");
// Init
tinyMCE.init(settings);
tinyMCE.documentBasePath = window.opener.tinyMCE.documentBasePath;
function setupContent(editor_id, body, doc) {
var inst = tinyMCE.getInstanceById(editor_id);
var backInst = window.opener.tinyMCE.getInstanceById(tinyMCE.getParam('fullscreen_editor_id'));
// Setup title
var divElm = document.createElement("div");
divElm.innerHTML = tinyMCELang['lang_fullscreen_title'];
document.title = divElm.innerHTML;
// Get content
inst.getBody().innerHTML = backInst.getBody().innerHTML;
}
function unloadHandler(e) {
window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent("mce_editor_0"));
}
// Add onunload
tinyMCE.addEvent(window, "beforeunload", unloadHandler);
</script>
</head>
<body style="margin: 0px; overflow: hidden;" scrolling="no" scroll="no" onload="">
<textarea id="fullscreenarea" style="width: 100%; height: 100%"></textarea>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

View file

@ -0,0 +1,4 @@
// CS lang variables
tinyMCELang['lang_fullscreen_title'] = 'Fullscreen';
tinyMCELang['lang_fullscreen_desc'] = 'Pr(epnout na fullscreen';

View file

@ -0,0 +1,4 @@
// UK lang variables
tinyMCELang['lang_fullscreen_title'] = 'Fullscreen mode'
tinyMCELang['lang_fullscreen_desc'] = 'Toggle fullscreen mode'

View file

@ -0,0 +1,5 @@
// Canadian French lang variables by Virtuelcom last modification: 2005-06-15
tinyMCELang['lang_fullscreen_title'] = 'Mode plein écran'
tinyMCELang['lang_fullscreen_desc'] = 'Basculer le mode plein écrans'

View file

@ -0,0 +1,4 @@
// SV lang variables
tinyMCELang['lang_fullscreen_title'] = 'Fullsk&auml;rmsl&auml;ge'
tinyMCELang['lang_fullscreen_desc'] = 'Hoppa fr&aring;n/till fullsk&auml;rmsl&auml;ge'

View file

@ -0,0 +1,5 @@
// Simplified Chinese lang variables contributed by cube316 (cube316@gmail.com)
//请访问 http://www.cube316.net/ 以获取TinyMCE的中文支持
tinyMCELang['lang_fullscreen_title'] = '全屏模式'
tinyMCELang['lang_fullscreen_desc'] = '切换全屏模式'

View file

@ -0,0 +1 @@
Check the TinyMCE documentation for details on this plugin.

View file

@ -0,0 +1,15 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>blank_page</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="javascript">
function init() {
document.designMode = 'on';
}
</script>
</head>
<body onload="init();">
</body>
</html>

View file

@ -0,0 +1,24 @@
// Tiny MCE Paste Plugin
tinyMCE.importPluginLanguagePack('paste','en,sv,cs,zh_cn,fr_ca');function TinyMCE_paste_getControlHTML(control_name){switch(control_name){case "pastetext":return '<img id="{$editor_id}pastetext" src="{$pluginurl}/images/pastetext.gif" title="{$lang_paste_text_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}\',\'mcePasteText\');" />';case "pasteword":return '<img id="{$editor_id}pasteword" src="{$pluginurl}/images/pasteword.gif" title="{$lang_paste_word_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}\',\'mcePasteWord\');" />';case "selectall":return '<img id="{$editor_id}selectall" src="{$pluginurl}/images/selectall.gif" title="{$lang_selectall_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}\',\'mceSelectAll\');" />';}return '';}function TinyMCE_paste_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePasteText":if(tinyMCE.isMSIE&&!tinyMCE.getParam('paste_use_dialog',false))TinyMCE_paste__insertText(clipboardData.getData("Text"),true);else{var template=new Array();template['file']='../../plugins/paste/pastetext.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",mceDo:'insert'});}return true;case "mcePasteWord":if(tinyMCE.isMSIE&&!tinyMCE.getParam('paste_use_dialog',false)){var html=TinyMCE_paste__clipboardHTML();if(html&&html.length>0)TinyMCE_paste__insertWordContent(html);}else{var template=new Array();template['file']='../../plugins/paste/pasteword.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",mceDo:'insert'});}return true;case "mceSelectAll":tinyMCE.execInstanceCommand(editor_id,'selectall');return true;}return false;}function TinyMCE_paste__insertText(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(tinyMCE.getParam("plaintext_create_paragraphs",true)){content=tinyMCE.regexpReplace(content,"\r\n\r\n","</p><p>","gi");content=tinyMCE.regexpReplace(content,"\r\r","</p><p>","gi");content=tinyMCE.regexpReplace(content,"\n\n","</p><p>","gi");if((pos=content.indexOf('</p><p>'))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="</p>";before+=content.substring(0,pos);for(var i=0;i<breakElms.length;i++){before+="</"+breakElms[i].nodeName+">";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="<p>";content=before+content.substring(pos+7)+after;}}content=tinyMCE.regexpReplace(content,"\r\n","<br />","gi");content=tinyMCE.regexpReplace(content,"\r","<br />","gi");content=tinyMCE.regexpReplace(content,"\n","<br />","gi");}tinyMCE.execCommand("mceInsertRawHTML",false,content);}}function TinyMCE_paste__insertWordContent(content){if(content&&content.length>0){content=content.replace(new RegExp('<(!--)([^>]*)(--)>','g'),"");content=content.replace(/<\/?span[^>]*>/gi,"");content=content.replace(/<(\w[^>]*)style="([^"]*)"([^>]*)/gi, "<$1$3");
content = content.replace(/<\/?font[^>]*>/gi, "");
content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
content = content.replace(/<\\?\?xml[^>]*>/gi, "");
content = content.replace(/<\/?\w+:[^>]*>/gi, "");
content = content.replace(/\/?&nbsp;*/gi, "");
content = content.replace('<p>&nbsp;</p>', '' ,'g');
if (!tinyMCE.settings['force_p_newlines']) {
content = content.replace('', '' ,'gi');
content = content.replace('</p>', '<br /><br />' ,'gi');
}
if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) {
content = content.replace(/<\/?p[^>]*>/gi, "");
}
content = content.replace(/<\/?div[^>]*>/gi, "");
// Insert cleaned content
tinyMCE.execCommand("mceAddUndoLevel");
tinyMCE.execCommand("mceInsertContent",false,content);}}function TinyMCE_paste__clipboardHTML(){var div=document.getElementById('_TinyMCE_clipboardHTML');if(!div){var div=document.createElement('DIV');div.id='_TinyMCE_clipboardHTML';with(div.style){visibility='hidden';overflow='hidden';position='absolute';width=1;height=1;}document.body.appendChild(div);}div.innerHTML='';var rng=document.body.createTextRange();rng.moveToElementText(div);rng.execCommand('Paste');var html=div.innerHTML;div.innerHTML='';return html;}

View file

@ -0,0 +1,173 @@
// Tiny MCE Paste Plugin
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('paste', 'en,sv,cs,zh_cn,fr_ca');
function TinyMCE_paste_getControlHTML(control_name) {
switch (control_name) {
case "pastetext":
return '<img id="{$editor_id}pastetext" src="{$pluginurl}/images/pastetext.gif" title="{$lang_paste_text_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}\',\'mcePasteText\');" />';
case "pasteword":
return '<img id="{$editor_id}pasteword" src="{$pluginurl}/images/pasteword.gif" title="{$lang_paste_word_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}\',\'mcePasteWord\');" />';
case "selectall":
return '<img id="{$editor_id}selectall" src="{$pluginurl}/images/selectall.gif" title="{$lang_selectall_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}\',\'mceSelectAll\');" />';
}
return '';
}
function TinyMCE_paste_execCommand(editor_id, element, command, user_interface, value) {
switch (command) {
case "mcePasteText":
if (tinyMCE.isMSIE && !tinyMCE.getParam('paste_use_dialog', false))
TinyMCE_paste__insertText(clipboardData.getData("Text"), true);
else {
var template = new Array();
template['file'] = '../../plugins/paste/pastetext.htm'; // Relative to theme
template['width'] = 450;
template['height'] = 400;
var plain_text = "";
tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", mceDo : 'insert'});
}
return true;
case "mcePasteWord":
if (tinyMCE.isMSIE && !tinyMCE.getParam('paste_use_dialog', false)) {
var html = TinyMCE_paste__clipboardHTML();
if (html && html.length > 0)
TinyMCE_paste__insertWordContent(html);
} else {
var template = new Array();
template['file'] = '../../plugins/paste/pasteword.htm'; // Relative to theme
template['width'] = 450;
template['height'] = 400;
var plain_text = "";
tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", mceDo : 'insert'});
}
return true;
case "mceSelectAll":
tinyMCE.execInstanceCommand(editor_id, 'selectall');
return true;
}
// Pass to next handler in chain
return false;
}
function TinyMCE_paste__insertText(content, bLinebreaks) {
if (content && content.length > 0) {
if (bLinebreaks) {
// Special paragraph treatment
if (tinyMCE.getParam("plaintext_create_paragraphs", true)) {
content = tinyMCE.regexpReplace(content, "\r\n\r\n", "</p><p>", "gi");
content = tinyMCE.regexpReplace(content, "\r\r", "</p><p>", "gi");
content = tinyMCE.regexpReplace(content, "\n\n", "</p><p>", "gi");
// Has paragraphs
if ((pos = content.indexOf('</p><p>')) != -1) {
tinyMCE.execCommand("Delete");
var node = tinyMCE.selectedInstance.getFocusElement();
// Get list of elements to break
var breakElms = new Array();
do {
if (node.nodeType == 1) {
// Don't break tables and break at body
if (node.nodeName == "TD" || node.nodeName == "BODY")
break;
breakElms[breakElms.length] = node;
}
} while(node = node.parentNode);
var before = "", after = "</p>";
before += content.substring(0, pos);
for (var i=0; i<breakElms.length; i++) {
before += "</" + breakElms[i].nodeName + ">";
after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">";
}
before += "<p>";
content = before + content.substring(pos+7) + after;
}
}
content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi");
content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi");
content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi");
}
tinyMCE.execCommand("mceInsertRawHTML", false, content);
}
}
function TinyMCE_paste__insertWordContent(content) {
if (content && content.length > 0) {
// Cleanup Word content
content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); // Word comments
content = content.replace(/<\/?span[^>]*>/gi, "");
content = content.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3");
content = content.replace(/<\/?font[^>]*>/gi, "");
content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
content = content.replace(/<\\?\?xml[^>]*>/gi, "");
content = content.replace(/<\/?\w+:[^>]*>/gi, "");
content = content.replace(/\/?&nbsp;*/gi, "");
content = content.replace('<p>&nbsp;</p>', '' ,'g');
if (!tinyMCE.settings['force_p_newlines']) {
content = content.replace('', '' ,'gi');
content = content.replace('</p>', '<br /><br />' ,'gi');
}
if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) {
content = content.replace(/<\/?p[^>]*>/gi, "");
}
content = content.replace(/<\/?div[^>]*>/gi, "");
// Insert cleaned content
tinyMCE.execCommand("mceAddUndoLevel");
tinyMCE.execCommand("mceInsertContent", false, content);
}
}
function TinyMCE_paste__clipboardHTML() {
var div = document.getElementById('_TinyMCE_clipboardHTML');
if (!div) {
var div = document.createElement('DIV');
div.id = '_TinyMCE_clipboardHTML';
with (div.style) {
visibility = 'hidden';
overflow = 'hidden';
position = 'absolute';
width = 1;
height = 1;
}
document.body.appendChild(div);
}
div.innerHTML = '';
var rng = document.body.createTextRange();
rng.moveToElementText(div);
rng.execCommand('Paste');
var html = div.innerHTML;
div.innerHTML = '';
return html;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 998 B

View file

@ -0,0 +1,8 @@
// CS lang variables
tinyMCELang['lang_paste_text_desc'] = 'Vložit neformátovaný text';
tinyMCELang['lang_paste_text_title'] = 'Použi CTRL+V na klávesnici pro vložení textu do okna.';
tinyMCELang['lang_paste_text_linebreaks'] = 'Nechej pr(erušení r(ádku*';
tinyMCELang['lang_paste_word_desc'] = 'Vložit text z aplikace Word';
tinyMCELang['lang_paste_word_title'] = 'Použi CTRL+V na klávesnici pro vložení textu do okna.';
tinyMCELang['lang_selectall_desc'] = 'Oznac(it vše';

View file

@ -0,0 +1,8 @@
// UK lang variables
tinyMCELang['lang_paste_text_desc'] = 'Paste as Plain Text';
tinyMCELang['lang_paste_text_title'] = 'Use CTRL+V on your keyboard to paste the text into the window.';
tinyMCELang['lang_paste_text_linebreaks'] = 'Keep linebreaks';
tinyMCELang['lang_paste_word_desc'] = 'Paste from Word';
tinyMCELang['lang_paste_word_title'] = 'Use CTRL+V on your keyboard to paste the text into the window.';
tinyMCELang['lang_selectall_desc'] = 'Select All';

View file

@ -0,0 +1,8 @@
// Canadian French lang variables by Virtuelcom last modification: 2005-06-15
tinyMCELang['lang_paste_text_desc'] = 'Coller texte seulement';
tinyMCELang['lang_paste_text_title'] = 'Utilisez CTRL+V sur votre clavier pour coller le texte dans la fenêtre.';
tinyMCELang['lang_paste_text_linebreaks'] = 'Garder les sauts de ligne';
tinyMCELang['lang_paste_word_desc'] = 'Coller à partir de Word';
tinyMCELang['lang_paste_word_title'] = 'Utilisez CTRL+V sur votre clavier pour coller le texte dans la fenêtre.';
tinyMCELang['lang_selectall_desc'] = 'Selectionner tout';

View file

@ -0,0 +1,8 @@
// SV lang variables
tinyMCELang['lang_paste_text_desc'] = 'Klistra in som vanlig text'
tinyMCELang['lang_paste_text_title'] = 'Anv&auml;nd CTRL+V p&aring; ditt tangentbord f&ouml;r att klistra in i detta f&ouml;nster.';
tinyMCELang['lang_paste_text_linebreaks'] = 'Spara radbrytningar';
tinyMCELang['lang_paste_word_desc'] = 'Klistra in fr&aring;n Word'
tinyMCELang['lang_paste_word_title'] = 'Anv&auml;nd CTRL+V p&aring; ditt tangentbord f&ouml;r att klistra in i detta f&ouml;nster.';
tinyMCELang['lang_selectall_desc'] = 'Select All';

View file

@ -0,0 +1,9 @@
// Simplified Chinese lang variables contributed by cube316 (cube316@gmail.com)
//请访问 http://www.cube316.net/ 以获取TinyMCE的中文支持
tinyMCELang['lang_paste_text_desc'] = '作为纯文本粘贴';
tinyMCELang['lang_paste_text_title'] = '使用快捷键 CTRL+V 将文本粘贴到以下窗口中.';
tinyMCELang['lang_paste_text_linebreaks'] = '保留换行符';
tinyMCELang['lang_paste_word_desc'] = '从Word粘贴';
tinyMCELang['lang_paste_word_title'] = '使用快捷键 CTRL+V 将文本粘贴到以下窗口中.';
tinyMCELang['lang_selectall_desc'] = '全选';

View file

@ -0,0 +1,76 @@
<html>
<head>
<title>{$lang_paste_text_desc}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate" />
<meta http-equiv="Expires" content="Fri, Oct 24 1976 00:00:00 GMT" />
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script type="text/javascript">
<!--
// Ryan Demmer 12/05/2005 (ryandemmer@gmail.com)
// Pretty much a hack of the HTML Source Editor
// Updated by speednet 24 May 2005
tinyMCE.setWindowArg('mce_windowresize', false);
function saveContent() {
if (window.opener) {
if (document.forms[0].htmlSource.value == ''){
window.close();
return false;
} else
window.opener.TinyMCE_paste__insertText(document.forms[0].htmlSource.value, document.forms[0].linebreaks.checked);
window.close();
}
}
function onLoadInit() {
resizeInputs();
}
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function resizeInputs() {
if (!tinyMCE.isMSIE) {
wHeight = self.innerHeight-80;
wWidth = self.innerWidth-25;
}
else {
wHeight = document.body.clientHeight-80;
wWidth = document.body.clientWidth-25;
}
document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
}
//--></script>
</head>
<body scroll="no" onload="onLoadInit();" onresize="resizeInputs();">
<form name="source" onsubmit="saveContent();">
<table border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<td class="title">{$lang_paste_text_desc}</td>
<td align="right" nowrap="nowrap">
<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{$lang_paste_text_linebreaks}</label>
</td>
</tr>
<tr>
<td colspan="2">{$lang_paste_text_title}</td>
</tr>
<tr>
<td colspan="2" align="center">
<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft"></textarea>
</td>
</tr>
<tr>
<td width="50%" align="left"><input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="saveContent();" /></td>
<td width="50%" align="right"><input type="button" value="{$lang_cancel}" onclick="window.close();" /></td>
</tr>
</table>
</form>
</body>
</html>

View file

@ -0,0 +1,111 @@
<html>
<head>
<title>{$lang_paste_word_desc}</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate" />
<meta http-equiv="Expires" content="Fri, Oct 24 1976 00:00:00 GMT" />
<script type="text/javascript" src="../../tiny_mce.js"></script>
<script type="text/javascript">
<!--
// Updated by speednet 25 May 2005
// Because we can't load tiny_mce_popup.js.
// Get tinyMCE window
var win = window.opener ? window.opener : window.dialogArguments;
var tinyMCE = null;
var tinyMCELang = null;
// Use top window if not defined
if (!win)
win = top;
// Setup window opener
window.opener = win;
var tinyMCE = win.tinyMCE;
var tinyMCELang = win.tinyMCELang;
if (!tinyMCE)
alert("tinyMCE object reference not found from popup.");
// Setup dir
if (tinyMCELang['lang_dir'])
document.dir = tinyMCELang['lang_dir'];
// Setup title
var re = new RegExp('{|\\\$|}', 'g');
var title = document.title.replace(re, "");
if (typeof tinyMCELang[title] != "undefined") {
var divElm = document.createElement("div");
divElm.innerHTML = tinyMCELang[title];
document.title = divElm.innerHTML;
}
function saveContent() {
if (win) {
var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
if (html == ''){
window.close();
return false;
}
win.TinyMCE_paste__insertWordContent(html);
window.close();
}
}
function onLoadInit() {
document.body.innerHTML = tinyMCE.applyTemplate(document.body.innerHTML, tinyMCE.windowArgs);
document.getElementById("frmData").contentWindow.document.designMode='on';
document.getElementById("frmData").src = "blank.htm";
resizeInputs();
}
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
function resizeInputs() {
if (!tinyMCE.isMSIE) {
wHeight = self.innerHeight - 80;
wWidth = self.innerWidth - 25;
}
else {
wHeight = document.body.clientHeight - 80;
wWidth = document.body.clientWidth - 25;
}
document.getElementById('frmData').style.height = Math.abs(wHeight) + 'px';
document.getElementById('frmData').style.width = Math.abs(wWidth) + 'px';
}
// Output Popup CSS class
document.write('<link href="' + tinyMCE.getParam("popups_css") + '" rel="stylesheet" type="text/css">');
//--></script>
</head>
<body scroll="no" onload="onLoadInit();" onresize="resizeInputs();">
<form name="source" onsubmit="saveContent();">
<table border="0" cellpadding="0" cellspacing="2" align="center">
<tr>
<td colspan="2" class="title">{$lang_paste_word_desc}</td>
</tr>
<tr>
<td colspan="2">{$lang_paste_word_title}</td>
</tr>
<tr>
<td colspan="2" align="center">
<iframe id="frmData" name="frmData" src="blank.htm" height="280" width="400" style="font-family:'Courier New',Courier,mono; font-size:10px; background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>
</td>
</tr>
<tr>
<td width="50%" align="left"><input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="saveContent();" /></td>
<td width="50%" align="right"><input type="button" value="{$lang_cancel}" onclick="window.close();" /></td>
</tr>
</table>
</form>
</body>
</html>

View file

@ -0,0 +1 @@
Check the TinyMCE documentation for details on this plugin.