Added filter for changing the languages selection for the spellchecker, fixed problems with valid_elements and added filter for extended_valid_elements, update to the latest version. Props azaozz. fixes #6111

git-svn-id: http://svn.automattic.com/wordpress/trunk@7173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-06 19:56:02 +00:00
parent c506a8173c
commit 1189e1fce8
13 changed files with 565 additions and 222 deletions

View File

@ -2,7 +2,7 @@ wpEditorInit = function() {
// Activate tinyMCE if it's the user's default editor // Activate tinyMCE if it's the user's default editor
if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor ) { if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor ) {
document.getElementById('editorcontainer').style.padding = '0px'; document.getElementById('editorcontainer').style.padding = '0px';
tinyMCE.execCommand("mceAddControl", true, "content"); tinyMCE.execCommand("mceAddControl", false, "content");
} else { } else {
var H; var H;
if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") ) if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") )
@ -13,22 +13,15 @@ wpEditorInit = function() {
switchEditors = { switchEditors = {
saveCallback : function(el, content, body) { saveCallback : function(el, content, body) {
document.getElementById(el).style.color = '#fff'; document.getElementById(el).style.color = '#fff';
if ( tinyMCE.activeEditor.isHidden() ) return this.pre_wpautop(content);
content = document.getElementById(el).value;
else
content = this.pre_wpautop(content);
return content;
}, },
pre_wpautop : function(content) { pre_wpautop : function(content) {
// We have a TON of cleanup to do. // We have a TON of cleanup to do.
// content = content.replace(/\n|\r/g, ' ');
// Remove anonymous, empty paragraphs. // Remove anonymous, empty paragraphs.
content = content.replace(new RegExp('<p>(\\s|&nbsp;|<br>)*</p>', 'mg'), ''); content = content.replace(new RegExp('<p>(\\s|&nbsp;|<br />)*</p>', 'mg'), '');
// Mark </p> if it has any attributes. // Mark </p> if it has any attributes.
content = content.replace(new RegExp('(<p[^>]+>.*?)</p>', 'mg'), '$1</p#>'); content = content.replace(new RegExp('(<p[^>]+>.*?)</p>', 'mg'), '$1</p#>');
@ -87,11 +80,9 @@ switchEditors = {
this.wpSetDefaultEditor('tinymce'); this.wpSetDefaultEditor('tinymce');
} else { } else {
this.edToggle(H, P); this.edToggle(H, P);
tinyMCE.triggerSave(); ta.style.height = ed.getContentAreaContainer().offsetHeight + 6 + 'px';
ta.style.height = tinyMCE.activeEditor.contentAreaContainer.offsetHeight + 6 + 'px';
ed.hide(); ed.hide();
ta.value = this.pre_wpautop(ta.value);
qt.style.display = 'block'; qt.style.display = 'block';
if ( tinymce.isIE6 ) { if ( tinymce.isIE6 ) {
@ -104,7 +95,6 @@ switchEditors = {
} }
ta.style.color = ''; ta.style.color = '';
this.wpSetDefaultEditor('html'); this.wpSetDefaultEditor('html');
} }
}, },

View File

@ -133,7 +133,7 @@ autosave:{
unload_msg:"' . mce_escape( __('The changes you made will be lost if you navigate away from this page.') ) . '" unload_msg:"' . mce_escape( __('The changes you made will be lost if you navigate away from this page.') ) . '"
}, },
fullscreen:{ fullscreen:{
desc:"' . mce_escape( __('Toggle fullscreen mode') ) . '" desc:"' . mce_escape( __('Toggle fullscreen mode') ) . ' (Alt+Shift+G)"
}, },
media:{ media:{
desc:"' . mce_escape( __('Insert / edit embedded media') ) . '", desc:"' . mce_escape( __('Insert / edit embedded media') ) . '",
@ -151,7 +151,7 @@ visualchars:{
desc:"' . mce_escape( __('Visual control characters on/off.') ) . '" desc:"' . mce_escape( __('Visual control characters on/off.') ) . '"
}, },
spellchecker:{ spellchecker:{
desc:"' . mce_escape( __('Toggle spellchecker') ) . '", desc:"' . mce_escape( __('Toggle spellchecker') ) . ' (Alt+Shift+N)",
menu:"' . mce_escape( __('Spellchecker settings') ) . '", menu:"' . mce_escape( __('Spellchecker settings') ) . '",
ignore_word:"' . mce_escape( __('Ignore word') ) . '", ignore_word:"' . mce_escape( __('Ignore word') ) . '",
ignore_words:"' . mce_escape( __('Ignore all') ) . '", ignore_words:"' . mce_escape( __('Ignore all') ) . '",
@ -185,25 +185,25 @@ code:"' . mce_escape( __('Code') ) . '",
samp:"' . mce_escape( __('Code sample') ) . '", samp:"' . mce_escape( __('Code sample') ) . '",
dt:"' . mce_escape( __('Definition term ') ) . '", dt:"' . mce_escape( __('Definition term ') ) . '",
dd:"' . mce_escape( __('Definition description') ) . '", dd:"' . mce_escape( __('Definition description') ) . '",
bold_desc:"' . mce_escape( __('Bold (Ctrl+B)') ) . '", bold_desc:"' . mce_escape( __('Bold') ) . ' (Ctrl / Alt+Shift + B)",
italic_desc:"' . mce_escape( __('Italic (Ctrl+I)') ) . '", italic_desc:"' . mce_escape( __('Italic') ) . ' (Ctrl / Alt+Shift + I)",
underline_desc:"' . mce_escape( __('Underline (Ctrl+U)') ) . '", underline_desc:"' . mce_escape( __('Underline') ) . '",
striketrough_desc:"' . mce_escape( __('Strikethrough') ) . '", striketrough_desc:"' . mce_escape( __('Strikethrough') ) . ' (Alt+Shift+D)",
justifyleft_desc:"' . mce_escape( __('Align left') ) . '", justifyleft_desc:"' . mce_escape( __('Align left') ) . ' (Alt+Shift+L)",
justifycenter_desc:"' . mce_escape( __('Align center') ) . '", justifycenter_desc:"' . mce_escape( __('Align center') ) . ' (Alt+Shift+C)",
justifyright_desc:"' . mce_escape( __('Align right') ) . '", justifyright_desc:"' . mce_escape( __('Align right') ) . ' (Alt+Shift+R)",
justifyfull_desc:"' . mce_escape( __('Align full') ) . '", justifyfull_desc:"' . mce_escape( __('Align full') ) . ' (Alt+Shift+J)",
bullist_desc:"' . mce_escape( __('Unordered list') ) . '", bullist_desc:"' . mce_escape( __('Unordered list') ) . ' (Alt+Shift+U)",
numlist_desc:"' . mce_escape( __('Ordered list') ) . '", numlist_desc:"' . mce_escape( __('Ordered list') ) . ' (Alt+Shift+O)",
outdent_desc:"' . mce_escape( __('Outdent') ) . '", outdent_desc:"' . mce_escape( __('Outdent') ) . '",
indent_desc:"' . mce_escape( __('Indent') ) . '", indent_desc:"' . mce_escape( __('Indent') ) . '",
undo_desc:"' . mce_escape( __('Undo (Ctrl+Z)') ) . '", undo_desc:"' . mce_escape( __('Undo') ) . ' (Ctrl+Z)",
redo_desc:"' . mce_escape( __('Redo (Ctrl+Y)') ) . '", redo_desc:"' . mce_escape( __('Redo') ) . ' (Ctrl+Y)",
link_desc:"' . mce_escape( __('Insert/edit link') ) . '", link_desc:"' . mce_escape( __('Insert/edit link') ) . ' (Alt+Shift+A)",
link_delta_width:"' . mce_escape( _c('0| Extra width for the link popup in pixels') ) . '", link_delta_width:"' . mce_escape( _c('0| Extra width for the link popup in pixels') ) . '",
link_delta_height:"' . mce_escape( _c('0| Extra height for the link popup in pixels') ) . '", link_delta_height:"' . mce_escape( _c('0| Extra height for the link popup in pixels') ) . '",
unlink_desc:"' . mce_escape( __('Unlink') ) . '", unlink_desc:"' . mce_escape( __('Unlink') ) . ' (Alt+Shift+S)",
image_desc:"' . mce_escape( __('Insert/edit image') ) . '", image_desc:"' . mce_escape( __('Insert/edit image') ) . ' (Alt+Shift+M)",
image_delta_width:"' . mce_escape( _c('0| Extra width for the image popup in pixels') ) . '", image_delta_width:"' . mce_escape( _c('0| Extra width for the image popup in pixels') ) . '",
image_delta_height:"' . mce_escape( _c('0| Extra height for the image popup in pixels') ) . '", image_delta_height:"' . mce_escape( _c('0| Extra height for the image popup in pixels') ) . '",
cleanup_desc:"' . mce_escape( __('Cleanup messy code') ) . '", cleanup_desc:"' . mce_escape( __('Cleanup messy code') ) . '",
@ -223,7 +223,7 @@ paste_desc:"' . mce_escape( __('Paste') ) . '",
image_props_desc:"' . mce_escape( __('Image properties') ) . '", image_props_desc:"' . mce_escape( __('Image properties') ) . '",
newdocument_desc:"' . mce_escape( __('New document') ) . '", newdocument_desc:"' . mce_escape( __('New document') ) . '",
help_desc:"' . mce_escape( __('Help') ) . '", help_desc:"' . mce_escape( __('Help') ) . '",
blockquote_desc:"' . mce_escape( __('Blockquote') ) . '", blockquote_desc:"' . mce_escape( __('Blockquote') ) . ' (Alt+Shift+Q)",
clipboard_msg:"' . mce_escape( __('Copy/Cut/Paste is not available in Mozilla and Firefox.') ) . '", clipboard_msg:"' . mce_escape( __('Copy/Cut/Paste is not available in Mozilla and Firefox.') ) . '",
path:"' . mce_escape( __('Path') ) . '", path:"' . mce_escape( __('Path') ) . '",
newdocument:"' . mce_escape( __('Are you sure you want to clear all contents?') ) . '", newdocument:"' . mce_escape( __('Are you sure you want to clear all contents?') ) . '",
@ -390,10 +390,10 @@ flv_jscallback:"' . mce_escape( __('JS Callback') ) . '"
}); });
tinyMCE.addI18n("' . $language . '.wordpress",{ tinyMCE.addI18n("' . $language . '.wordpress",{
wp_adv_desc:"' . mce_escape( __('Show/Hide Advanced Toolbar') ) . '", wp_adv_desc:"' . mce_escape( __('Show/Hide Advanced Toolbar') ) . ' (Alt+Shift+Z)",
wp_more_desc:"' . mce_escape( __('Insert More tag') ) . '", wp_more_desc:"' . mce_escape( __('Insert More tag') ) . ' (Alt+Shift+T)",
wp_page_desc:"' . mce_escape( __('Insert Page break') ) . '", wp_page_desc:"' . mce_escape( __('Insert Page break') ) . ' (Alt+Shift+P)",
wp_help_desc:"' . mce_escape( __('Help') ) . '", wp_help_desc:"' . mce_escape( __('Help') ) . ' (Alt+Shift+H)",
wp_more_alt:"' . mce_escape( __('More...') ) . '", wp_more_alt:"' . mce_escape( __('More...') ) . '",
wp_page_alt:"' . mce_escape( __('Next page...') ) . '" wp_page_alt:"' . mce_escape( __('Next page...') ) . '"
}); });

View File

@ -117,7 +117,7 @@ color:#FFF
.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px;} .clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px;}
.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal;} .clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal;}
.clearlooks2 a:hover {font-weight:bold;} .clearlooks2 a:hover {font-weight:bold;}
.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5;} .clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#eaf3fa;}
.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px;} .clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px;}
.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif);} .clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif);}
.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px;} .clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px;}

File diff suppressed because one or more lines are too long

View File

@ -50,8 +50,8 @@ var LinkDialog = {
ed.execCommand('mceInsertLink', false, { ed.execCommand('mceInsertLink', false, {
href : f.href.value, href : f.href.value,
title : f.linktitle.value, title : f.linktitle.value,
target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : '', target : f.target_list ? f.target_list.options[f.target_list.selectedIndex].value : null,
'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : '' 'class' : f.class_list ? f.class_list.options[f.class_list.selectedIndex].value : null
}); });
tinyMCEPopup.close(); tinyMCEPopup.close();

View File

@ -1,6 +1,7 @@
body, td, pre {background:#FFF; color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px; } body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
body {background:#FFF;}
body.mceForceColors {background:#FFF; color:#000;} body.mceForceColors {background:#FFF; color:#000;}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {border: 1px dashed #BBB;} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;} a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(img/items.gif) no-repeat bottom left;}
img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;} img.mceItemAnchor {width:12px; height:12px; background:url(img/items.gif) no-repeat;}
img {border:0;} img {border:0;}

View File

@ -76,6 +76,7 @@
.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} .defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} .defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}
.defaultSkin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden} .defaultSkin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden}
.defaultSkin .mce_forecolor, .defaultSkin .mce_backcolor {position:relative}
/* Menu */ /* Menu */
.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} .defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}

View File

@ -1,6 +1,7 @@
body, td, pre {background:#FFF; color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px; } body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
body {background:#FFF;}
body.mceForceColors {background:#FFF; color:#000;} body.mceForceColors {background:#FFF; color:#000;}
.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {border: 1px dashed #BBB;} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;} a.mceItemAnchor {width:12px; line-height:6px; overflow:hidden; padding-left:12px; background:url(../default/img/items.gif) no-repeat bottom left;}
img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;}
img {border:0;} img {border:0;}

View File

@ -24,9 +24,10 @@
.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} .o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize}
.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} .o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
.o2k7Skin table.mceToolbar {margin-left:3px} .o2k7Skin table.mceToolbar {margin-left:3px}
.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
.o2k7Skin .mceToolbar td.mceFirst span {margin:0}
.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} .o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
.o2k7Skin .mceToolbar .mceToolbarEndListBox span {display:none} .o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none}
.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} .o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px}
.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} .o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
.o2k7Skin td.mceCenter {text-align:center;} .o2k7Skin td.mceCenter {text-align:center;}
@ -45,9 +46,10 @@
.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} .o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
/* ListBox */ /* ListBox */
.o2k7Skin .mceListBox {margin-left:3px}
.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} .o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}
.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} .o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0; margin-right:2px} .o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}
.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} .o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}
.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} .o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}
.o2k7Skin .mceListBoxDisabled .mceText {color:gray} .o2k7Skin .mceListBoxDisabled .mceText {color:gray}
@ -76,6 +78,7 @@
.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} .o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} .o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A}
.o2k7Skin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden} .o2k7Skin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden}
.o2k7Skin .mce_forecolor, .o2k7Skin .mce_backcolor {position:relative}
/* Menu */ /* Menu */
.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} .o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}

View File

@ -232,7 +232,6 @@ color:#000;
cursor:default; cursor:default;
margin:0; margin:0;
padding:0 25px 0 25px; padding:0 25px 0 25px;
display:block
} }
.wp_themeSkin .mceMenu span.mceText, .wp_themeSkin .mceMenu .mcePreview {font-size:11px} .wp_themeSkin .mceMenu span.mceText, .wp_themeSkin .mceMenu .mcePreview {font-size:11px}
.wp_themeSkin .mceMenu pre.mceText {font-family:Monospace} .wp_themeSkin .mceMenu pre.mceText {font-family:Monospace}

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@ function putFileContents( $path, $content ) {
} }
// Set up init variables // Set up init variables
$https = ( isset($_SERVER['HTTPS']) && 'on' == $_SERVER['HTTPS'] ) ? true : false; $https = ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;
$baseurl = get_option('siteurl') . '/wp-includes/js/tinymce'; $baseurl = get_option('siteurl') . '/wp-includes/js/tinymce';
if ( $https ) str_replace('http://', 'https://', $baseurl); if ( $https ) str_replace('http://', 'https://', $baseurl);
@ -53,11 +53,28 @@ $mce_css = $baseurl . '/wordpress.css';
$mce_css = apply_filters('mce_css', $mce_css); $mce_css = apply_filters('mce_css', $mce_css);
if ( $https ) str_replace('http://', 'https://', $mce_css); if ( $https ) str_replace('http://', 'https://', $mce_css);
$valid_elements = '*[*]'; /*
$valid_elements = apply_filters('mce_valid_elements', $valid_elements); Setting mce_valid_elements to *[*] skips all of the internal cleanup and can cause problems.
The minimal setting would be -strong/-b[*],-em/-i[*],*[*].
Best is to use the default cleanup by not specifying mce_valid_elements,
and then use extended_valid_elements to add to it.
*/
$valid_elements = apply_filters('mce_valid_elements', '');
$invalid_elements = apply_filters('mce_invalid_elements', ''); $invalid_elements = apply_filters('mce_invalid_elements', '');
$extended_valid_elements = '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],bdo,code,col[*],colgroup[*],dfn,fieldset,form[*],input[*],kbd,label[*],legend[*],noscript,optgroup[*],option[*],q[cite|class],samp,textarea[*],title,var';
$extended_valid_elements = apply_filters('mce_extended_valid_elements', $extended_valid_elements);
/*
The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
The + sign marks the default language.
More information:
http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
*/
$mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
$plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' ); $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen' );
/* /*
@ -70,13 +87,13 @@ If the plugin uses a button, it should be added with one of the "$mce_buttons" f
$mce_external_plugins = apply_filters('mce_external_plugins', array()); $mce_external_plugins = apply_filters('mce_external_plugins', array());
$ext_plugins = "\n"; $ext_plugins = "\n";
if ( ! empty($mce_external_plugins) ) {
foreach ( $mce_external_plugins as $name => $url ) { foreach ( $mce_external_plugins as $name => $url ) {
$plugins[] = '-' . $name;
if ( $https ) str_replace('http://', 'https://', $url); if ( $https ) str_replace('http://', 'https://', $url);
$plugins[] = '-' . $name;
$ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n"; $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n";
} }
}
$plugins = implode($plugins, ','); $plugins = implode($plugins, ',');
$mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' )); $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'image', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
@ -105,6 +122,7 @@ $initArray = array (
'theme_advanced_buttons3' => "$mce_buttons_3", 'theme_advanced_buttons3' => "$mce_buttons_3",
'theme_advanced_buttons4' => "$mce_buttons_4", 'theme_advanced_buttons4' => "$mce_buttons_4",
'language' => "$mce_locale", 'language' => "$mce_locale",
'spellchecker_languages' => "$mce_spellchecker_languages",
'theme_advanced_toolbar_location' => 'top', 'theme_advanced_toolbar_location' => 'top',
'theme_advanced_toolbar_align' => 'left', 'theme_advanced_toolbar_align' => 'left',
'theme_advanced_statusbar_location' => 'bottom', 'theme_advanced_statusbar_location' => 'bottom',
@ -113,8 +131,6 @@ $initArray = array (
'dialog_type' => 'modal', 'dialog_type' => 'modal',
'relative_urls' => false, 'relative_urls' => false,
'remove_script_host' => false, 'remove_script_host' => false,
'fix_list_elements' => true,
'fix_table_elements' => true,
'gecko_spellcheck' => true, 'gecko_spellcheck' => true,
'entities' => '38,amp,60,lt,62,gt', 'entities' => '38,amp,60,lt,62,gt',
'accessibility_focus' => false, 'accessibility_focus' => false,
@ -129,6 +145,7 @@ $initArray = array (
); );
if ( $valid_elements ) $initArray['valid_elements'] = $valid_elements; if ( $valid_elements ) $initArray['valid_elements'] = $valid_elements;
if ( $extended_valid_elements ) $initArray['extended_valid_elements'] = $extended_valid_elements;
if ( $invalid_elements ) $initArray['invalid_elements'] = $invalid_elements; if ( $invalid_elements ) $initArray['invalid_elements'] = $invalid_elements;
// For people who really REALLY know what they're doing with TinyMCE // For people who really REALLY know what they're doing with TinyMCE
@ -240,28 +257,23 @@ echo $content;
// Write file // Write file
if ( '' != $cacheKey ) { if ( '' != $cacheKey ) {
if ( $old_cache_max ) { if ( (int) $old_cache_max && is_dir($cache_path) ) {
$keys_file = $cache_path . '/tinymce_compressed' . $cache_ext . '_key';
$old_keys = getFileContents($keys_file);
if ( '' != $old_keys ) { $old_cache = array();
$keys_ar = explode( "\n", $old_keys ); $handle = opendir($cache_path);
if ( 1 >= $old_cache_max ) $old_keys_rem = $keys_ar; while ( false !== ( $file = readdir($handle) ) ) {
else $old_keys_rem = array_slice( $keys_ar, ($old_cache_max - 1) ); if ( $file == '.' || $file == '..' ) continue;
$saved = filectime("$cache_path/$file");
foreach ( $old_keys_rem as $key ) { if ( strpos($file, 'tinymce_') !== false && substr($file, -3) == $cache_ext ) $old_cache["$saved"] = $file;
$key = trim($key);
if ( 32 != strlen($key) ) continue;
$old_cache = $cache_path . '/tinymce_' . $key . $cache_ext;
@unlink($old_cache);
} }
closedir($handle);
array_unshift( $keys_ar, $cacheKey ); krsort($old_cache);
$keys_ar = array_slice( $keys_ar, 0, $old_cache_max ); if ( 1 >= $old_cache_max ) $del_cache = $old_cache;
$cacheKey = trim( implode( "\n", $keys_ar ) ); else $del_cache = array_slice( $old_cache, ($old_cache_max - 1) );
}
putFileContents( $keys_file, $cacheKey ); foreach ( $del_cache as $key )
@unlink("$cache_path/$key");
} }
putFileContents( $cache_file, $content ); putFileContents( $cache_file, $content );

View File

@ -36,7 +36,7 @@ class WP_Scripts {
$this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080221' ); $this->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080221' );
// Modify this version when tinyMCE plugins are changed. // Modify this version when tinyMCE plugins are changed.
$mce_version = apply_filters('tiny_mce_version', '20080226'); $mce_version = apply_filters('tiny_mce_version', '20080306');
$this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
$this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6'); $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');