TinyMCE 3.2.3 final, includes new Paste plugin with auto-cleanup (better paste from MS Word)
git-svn-id: http://svn.automattic.com/wordpress/trunk@11078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1c8fad6d46
commit
fc0c1a2e1b
|
@ -1301,9 +1301,6 @@ function wp_tiny_mce( $teeny = false ) {
|
|||
'convert_urls' => false,
|
||||
'apply_source_formatting' => false,
|
||||
'remove_linebreaks' => true,
|
||||
'paste_convert_middot_lists' => true,
|
||||
'paste_remove_spans' => true,
|
||||
'paste_remove_styles' => true,
|
||||
'gecko_spellcheck' => true,
|
||||
'entities' => '38,amp,60,lt,62,gt',
|
||||
'accessibility_focus' => true,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<script type="text/javascript" src="../../tiny_mce.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce.js?ver=323"></script>
|
||||
<script type="text/javascript">
|
||||
function patchCallback(settings, key) {
|
||||
if (settings[key])
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Template for dialogs</title>
|
||||
<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?ver=3223_1087" />
|
||||
<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css?ver=323" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#media_dlg.title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/media.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/validate.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/editable_selects.js?ver=3223_1087"></script>
|
||||
<link href="css/media.css?ver=3223_1087" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/media.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/validate.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/editable_selects.js?ver=323"></script>
|
||||
<link href="css/media.css?ver=323" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body style="display: none">
|
||||
<form onsubmit="insertMedia();return false;" action="#">
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
html, body {height:98%}
|
||||
body {
|
||||
background-color: #FFFFFF;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
scrollbar-3dlight-color: #F0F0EE;
|
||||
scrollbar-arrow-color: #676662;
|
||||
scrollbar-base-color: #F0F0EE;
|
||||
scrollbar-darkshadow-color: #DDDDDD;
|
||||
scrollbar-face-color: #E0E0DD;
|
||||
scrollbar-highlight-color: #F0F0EE;
|
||||
scrollbar-shadow-color: #F0F0EE;
|
||||
scrollbar-track-color: #F5F5F5;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
.sourceIframe {
|
||||
border: 1px solid #808080;
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -1,42 +1,36 @@
|
|||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function saveContent() {
|
||||
if (document.forms[0].htmlSource.value == '') {
|
||||
var PasteTextDialog = {
|
||||
init : function() {
|
||||
this.resize();
|
||||
},
|
||||
|
||||
insert : function() {
|
||||
var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;
|
||||
|
||||
// Convert linebreaks into paragraphs
|
||||
if (document.getElementById('linebreaks').checked) {
|
||||
lines = h.split(/\r?\n/);
|
||||
if (lines.length > 1) {
|
||||
h = '';
|
||||
tinymce.each(lines, function(row) {
|
||||
h += '<p>' + row + '</p>';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, h);
|
||||
tinyMCEPopup.close();
|
||||
return false;
|
||||
},
|
||||
|
||||
resize : function() {
|
||||
var vp = tinyMCEPopup.dom.getViewPort(window), el;
|
||||
|
||||
el = document.getElementById('content');
|
||||
|
||||
el.style.width = (vp.w - 20) + 'px';
|
||||
el.style.height = (vp.h - 90) + 'px';
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.execCommand('mcePasteText', false, {
|
||||
html : document.forms[0].htmlSource.value,
|
||||
linebreaks : document.forms[0].linebreaks.checked
|
||||
});
|
||||
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function onLoadInit() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
// Remove Gecko spellchecking
|
||||
if (tinymce.isGecko)
|
||||
document.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
|
||||
|
||||
resizeInputs();
|
||||
}
|
||||
|
||||
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
|
||||
|
||||
function resizeInputs() {
|
||||
if (!tinymce.isIE) {
|
||||
wHeight = self.innerHeight-80;
|
||||
wWidth = self.innerWidth-17;
|
||||
} else {
|
||||
wHeight = document.body.clientHeight-80;
|
||||
wWidth = document.body.clientWidth-17;
|
||||
}
|
||||
|
||||
document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
|
||||
document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(onLoadInit);
|
||||
tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);
|
||||
|
|
|
@ -1,56 +1,51 @@
|
|||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
function saveContent() {
|
||||
var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
|
||||
var PasteWordDialog = {
|
||||
init : function() {
|
||||
var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';
|
||||
|
||||
if (html == ''){
|
||||
// Create iframe
|
||||
el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';
|
||||
ifr = document.getElementById('iframe');
|
||||
doc = ifr.contentWindow.document;
|
||||
|
||||
// Force absolute CSS urls
|
||||
css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];
|
||||
css = css.concat(tinymce.explode(ed.settings.content_css) || []);
|
||||
tinymce.each(css, function(u) {
|
||||
cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />';
|
||||
});
|
||||
|
||||
// Write content into iframe
|
||||
doc.open();
|
||||
doc.write('<html><head>' + cssHTML + '</head><body spellcheck="false"></body></html>');
|
||||
doc.close();
|
||||
|
||||
doc.designMode = 'on';
|
||||
this.resize();
|
||||
|
||||
window.setTimeout(function() {
|
||||
ifr.contentWindow.focus();
|
||||
}, 10);
|
||||
},
|
||||
|
||||
insert : function() {
|
||||
var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;
|
||||
|
||||
tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, h);
|
||||
tinyMCEPopup.close();
|
||||
return false;
|
||||
},
|
||||
|
||||
resize : function() {
|
||||
var vp = tinyMCEPopup.dom.getViewPort(window), el;
|
||||
|
||||
el = document.getElementById('iframe');
|
||||
|
||||
if (el) {
|
||||
el.style.width = (vp.w - 20) + 'px';
|
||||
el.style.height = (vp.h - 90) + 'px';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCEPopup.execCommand('mcePasteWord', false, html);
|
||||
tinyMCEPopup.close();
|
||||
}
|
||||
|
||||
function onLoadInit() {
|
||||
tinyMCEPopup.resizeToInnerSize();
|
||||
|
||||
// Fix for endless reloading in FF
|
||||
window.setTimeout(createIFrame, 10);
|
||||
}
|
||||
|
||||
function createIFrame() {
|
||||
document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
|
||||
}
|
||||
|
||||
var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
|
||||
|
||||
function initIframe(doc) {
|
||||
var dir = tinyMCEPopup.editor.settings.directionality;
|
||||
|
||||
doc.body.dir = dir;
|
||||
|
||||
// Remove Gecko spellchecking
|
||||
if (tinymce.isGecko)
|
||||
doc.body.spellcheck = tinyMCEPopup.getParam("gecko_spellcheck");
|
||||
|
||||
resizeInputs();
|
||||
}
|
||||
|
||||
function resizeInputs() {
|
||||
if (!tinymce.isIE) {
|
||||
wHeight = self.innerHeight - 80;
|
||||
wWidth = self.innerWidth - 18;
|
||||
} else {
|
||||
wHeight = document.body.clientHeight - 80;
|
||||
wWidth = document.body.clientWidth - 18;
|
||||
}
|
||||
|
||||
var elm = document.getElementById('frmData');
|
||||
if (elm) {
|
||||
elm.style.height = Math.abs(wHeight) + 'px';
|
||||
elm.style.width = Math.abs(wWidth) + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
tinyMCEPopup.onInit.add(onLoadInit);
|
||||
tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);
|
||||
|
|
|
@ -2,32 +2,32 @@
|
|||
<head>
|
||||
<title>{#paste.paste_text_desc}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/pastetext.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/pastetext.js?ver=323"></script>
|
||||
</head>
|
||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
|
||||
<form name="source" onsubmit="saveContent();return false;" action="#">
|
||||
<div style="float: left" class="title">{#paste.paste_text_desc}</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
|
||||
</div>
|
||||
|
||||
<br style="clear: both" />
|
||||
|
||||
<div>{#paste_dlg.text_title}</div>
|
||||
|
||||
<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" class="mceFocus"></textarea>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
|
||||
</div>
|
||||
<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">
|
||||
<form name="source" onsubmit="return PasteTextDialog.insert();" action="#">
|
||||
<div style="float: left" class="title">{#paste.paste_text_desc}</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="submit" name="insert" value="{#insert}" id="insert" />
|
||||
<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br style="clear: both" />
|
||||
|
||||
<div>{#paste_dlg.text_title}</div>
|
||||
|
||||
<textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<div style="float: left">
|
||||
<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
|
||||
</div>
|
||||
|
||||
<div style="float: right">
|
||||
<input type="submit" name="insert" value="{#insert}" id="insert" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
|
@ -2,12 +2,11 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>{#paste.paste_word_desc}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/pasteword.js?ver=3223_1087"></script>
|
||||
<link href="css/pasteword.css?ver=3223_1087" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/pasteword.js?ver=323"></script>
|
||||
</head>
|
||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
|
||||
<form name="source" onsubmit="saveContent();" action="#">
|
||||
<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">
|
||||
<form name="source" onsubmit="return PasteWordDialog.insert();" action="#">
|
||||
<div class="title">{#paste.paste_word_desc}</div>
|
||||
|
||||
<div>{#paste_dlg.word_title}</div>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2,9 +2,9 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.about_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/about.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/about.js?ver=323"></script>
|
||||
</head>
|
||||
<body id="about" style="display: none">
|
||||
<div class="tabs">
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.anchor_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/anchor.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/anchor.js?ver=323"></script>
|
||||
</head>
|
||||
<body style="display: none">
|
||||
<form onsubmit="AnchorDialog.update();return false;" action="#">
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<head>
|
||||
<title>{#advanced_dlg.charmap_title}</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/charmap.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/charmap.js?ver=323"></script>
|
||||
</head>
|
||||
<body id="charmap" style="display:none">
|
||||
<table align="center" border="0" cellspacing="0" cellpadding="2">
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.colorpicker_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/color_picker.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/color_picker.js?ver=323"></script>
|
||||
</head>
|
||||
<body id="colorpicker" style="display: none">
|
||||
<form onsubmit="insertAction();return false" action="#">
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.image_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/image.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/image.js?ver=323"></script>
|
||||
</head>
|
||||
<body id="image" style="display: none">
|
||||
<form onsubmit="ImageDialog.update();return false;" action="#">
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#advanced_dlg.link_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../utils/validate.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/link.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/mctabs.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/form_utils.js?ver=323"></script>
|
||||
<script type="text/javascript" src="../../utils/validate.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/link.js?ver=323"></script>
|
||||
</head>
|
||||
<body id="link" style="display: none">
|
||||
<form onsubmit="LinkDialog.update();return false;" action="#">
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>{#advanced_dlg.code_title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="js/source_editor.js?ver=3223_1087"></script>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js?ver=323"></script>
|
||||
<script type="text/javascript" src="js/source_editor.js?ver=323"></script>
|
||||
</head>
|
||||
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
|
||||
<form name="source" onsubmit="saveContent();return false;" action="#">
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -88,7 +88,7 @@ function wp_default_scripts( &$scripts ) {
|
|||
|
||||
// Modify this version when tinyMCE plugins are changed.
|
||||
function mce_version() {
|
||||
return '20090417';
|
||||
return '20090424';
|
||||
}
|
||||
add_filter( 'tiny_mce_version', 'mce_version' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue