diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 1ded0af52..c40ad1730 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -178,3 +178,155 @@ addLoadEvent( function() { } ); jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change(); }); + +wpEditorInit = function() { + // Activate tinyMCE if it's the user's default editor + if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor ) { + document.getElementById('editorcontainer').style.padding = '0px'; + tinyMCE.execCommand("mceAddControl", true, "content"); + } else { + var H; + if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") ) + document.getElementById('content').style.height = H.ch - 30 + 'px'; + } +}; + +switchEditors = { + + saveCallback : function(el, content, body) { + + document.getElementById(el).style.color = '#fff'; + if ( tinyMCE.activeEditor.isHidden() ) + content = document.getElementById(el).value; + else + content = this.pre_wpautop(content); + + return content; + }, + + pre_wpautop : function(content) { + // We have a TON of cleanup to do. + + // content = content.replace(/\n|\r/g, ' '); + // Remove anonymous, empty paragraphs. + content = content.replace(new RegExp('

(\\s| |
)*

', 'mg'), ''); + + // Mark

if it has any attributes. + content = content.replace(new RegExp('(]+>.*?)

', 'mg'), '$1'); + + // Get it ready for wpautop. + content = content.replace(new RegExp('\\s*

', 'mgi'), ''); + content = content.replace(new RegExp('\\s*

\\s*', 'mgi'), '\n\n'); + content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n'); + content = content.replace(new RegExp('\\s*
\\s*', 'gi'), '\n'); + + // Fix some block element newline issues + var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre'; + content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>'); + content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); + content = content.replace(new RegExp('
  • ', 'g'), '\t
  • '); + + if ( content.indexOf(']*)>\\s*', 'g'), ""); // no pee inside object/embed + content = content.replace(new RegExp('\\s*\\s*', 'g'), ''); + } + + // Unmark special paragraph closing tags + content = content.replace(new RegExp('', 'g'), '

    \n'); + content = content.replace(new RegExp('\\s*(]+>.*

    )', 'mg'), '\n$1'); + + // Trim trailing whitespace + content = content.replace(new RegExp('\\s*$', ''), ''); + + // Hope. + return content; + }, + + go : function(id) { + var ed = tinyMCE.get(id); + var qt = document.getElementById('quicktags'); + var H = document.getElementById('edButtonHTML'); + var P = document.getElementById('edButtonPreview'); + var ta = document.getElementById(id); + var ec = document.getElementById('editorcontainer'); + + if ( ! ed || ed.isHidden() ) { + ta.style.color = '#fff'; + + this.edToggle(P, H); + edCloseAllTags(); // :-( + + qt.style.display = 'none'; + ec.style.padding = '0px'; + + ta.value = this.wpautop(ta.value); + + if ( ed ) ed.show(); + else tinyMCE.execCommand("mceAddControl", false, id); + + this.wpSetDefaultEditor( 'tinymce' ); + } else { + this.edToggle(H, P); + tinyMCE.triggerSave(); + ta.style.height = tinyMCE.activeEditor.contentAreaContainer.offsetHeight + 6 + 'px'; + + if ( tinymce.isIE6 ) + ta.style.width = tinyMCE.activeEditor.contentAreaContainer.offsetWidth - 12 + 'px'; + + ed.hide(); + ta.value = this.pre_wpautop(ta.value); + + qt.style.display = 'block'; + ec.style.padding = '6px'; + ta.style.color = ''; + + this.wpSetDefaultEditor( 'html' ); + } + }, + + edToggle : function(A, B) { + A.className = 'active'; + B.className = ''; + + B.onclick = A.onclick; + A.onclick = null; + }, + + wpSetDefaultEditor : function( editor ) { + try { + editor = escape( editor.toString() ); + } catch(err) { + editor = 'tinymce'; + } + + var userID = document.getElementById('user-id'); + var date = new Date(); + date.setTime(date.getTime()+(10*365*24*60*60*1000)); + document.cookie = "wordpress_editor_" + userID.value + "=" + editor + "; expires=" + date.toGMTString(); + }, + + wpautop : function(pee) { + var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]'; + + pee = pee + "\n\n"; + pee = pee.replace(new RegExp('
    \\s*
    ', 'gi'), "\n\n"); + pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1"); + pee = pee.replace(new RegExp('()', 'gi'), "$1\n\n"); + pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n"); + pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n"); + pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "

    $1

    \n"); + pee = pee.replace(new RegExp('

    \\s*?

    ', 'gi'), ''); + pee = pee.replace(new RegExp('

    \\s*(]*>)\\s*

    ', 'gi'), "$1"); + pee = pee.replace(new RegExp("

    (", 'gi'), "$1"); + pee = pee.replace(new RegExp('

    ]*)>', 'gi'), "

    "); + pee = pee.replace(new RegExp('

    ', 'gi'), '

    '); + pee = pee.replace(new RegExp('

    \\s*(]*>)', 'gi'), "$1"); + pee = pee.replace(new RegExp('(]*>)\\s*

    ', 'gi'), "$1"); + pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "
    \n"); + pee = pee.replace(new RegExp('(]*>)\\s*
    ', 'gi'), "$1"); + pee = pee.replace(new RegExp('
    (\\s*)', 'gi'), '$1'); + pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 '); + //pee = pee.replace(new RegExp('()(.*?)!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '' "); // Hmm... + return pee; + } +} diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index daa79a48b..7b63a3bb3 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -370,9 +370,14 @@ input.disabled, textarea.disabled { width: 100%; } -#postdivrich #content { - padding: 5px; - line-height: 140%; +#editorcontainer #content { + padding: 0; + line-height: 150%; + border: 0 none; +} + +#editorcontainer { + padding: 6px; } #currenttheme img { @@ -394,10 +399,9 @@ input.delete:hover { } #postdivrich #quicktags { - background: #f0f0ee; + background: #cee1ef; padding: 0; - border: 1px solid #ccc; - border-bottom: none; + border: 0 none; } #postdiv #quicktags { @@ -1178,7 +1182,7 @@ html, body { padding: 2px; } -#poststuff .postbox, #titlediv { +#poststuff .postbox, #titlediv, #poststuff .postarea { margin-left: 20px; border: 1px solid #ebebeb; border-right: 1px solid #ccc; @@ -1188,7 +1192,6 @@ html, body { } #poststuff .postarea { - margin-left: 20px; margin-right: 8px; } @@ -1223,7 +1226,7 @@ html, body { #poststuff #edButtonPreview, #poststuff #edButtonHTML { display: block; - height: 18px; + height: 20px; padding: 5px; margin-right: 8px; float: right; @@ -1235,7 +1238,8 @@ html, body { background: #cee1ef; color: #333; font-weight: bold; - -moz-border-radius: 2px; + -moz-border-radius-topright: 2px; + -moz-border-radius-topleft: 2px; } #poststuff #media-buttons { diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index c06c27dbd..d5a4e10ff 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -928,19 +928,20 @@ function the_editor($content, $id = 'content', $prev_id = 'title') { if ( user_can_richedit() ) : $wp_default_editor = wp_default_editor(); $active = " class='active'"; - $inactive = " onclick='switchEditors(\"$id\");'"; + $inactive = " onclick='switchEditors.go(\"$id\");'"; if ( 'tinymce' == $wp_default_editor ) add_filter('the_editor_content', 'wp_richedit_pre'); - // The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it. - ?> - + \n"); + $the_editor = apply_filters('the_editor', "
    \n"); $the_editor_content = apply_filters('the_editor_content', $content); printf($the_editor, $the_editor_content); @@ -986,39 +987,18 @@ function the_editor($content, $id = 'content', $prev_id = 'title') { // If tinyMCE is defined. if ( typeof tinyMCE != 'undefined' ) { // This code is meant to allow tabbing from Title to Post (TinyMCE). - if ( tinyMCE.isMSIE ) { - document.getElementById('').onkeydown = function (e) { - if ( tinyMCE.idCounter == 0 ) - return true; - e = e ? e : window.event; - if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) { - var i = tinyMCE.getInstanceById(''); - if(typeof i == 'undefined') - return true; - tinyMCE.execCommand("mceStartTyping"); - this.blur(); - i.contentWindow.focus(); - e.returnValue = false; - return false; - } - } - } else { - document.getElementById('').onkeypress = function (e) { - if ( tinyMCE.idCounter == 0 ) - return true; - e = e ? e : window.event; - if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) { - var i = tinyMCE.getInstanceById(''); - if(typeof i == 'undefined') - return true; - tinyMCE.execCommand("mceStartTyping"); - this.blur(); - i.contentWindow.focus(); - e.returnValue = false; - return false; - } - } - } + document.getElementById('').onkeydown = function (e) { + e = e || window.event; + if (e.keyCode == 9 && !e.shiftKey && !e.controlKey && !e.altKey) { + if ( tinyMCE.activeEditor ) { + e = null; + if ( tinyMCE.activeEditor.isHidden() ) return true; + tinyMCE.activeEditor.focus(); + return false; + } + return true; + } + } } //--> diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index d10cb3c07..3e18b6c9a 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -82,7 +82,7 @@ function autosave_enable_buttons() { } function autosave() { - var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false; + var rich = ( (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && ! tinyMCE.activeEditor.isHidden() ) ? true : false; var post_data = { action: "autosave", post_ID: jQuery("#post_ID").val() || 0, @@ -93,14 +93,13 @@ function autosave() { }; /* Gotta do this up here so we can check the length when tinyMCE is in use */ - if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) { - post_data["content"] = jQuery("#content").val(); - } else { + if ( rich ) { // Don't run while the TinyMCE spellcheck is on. - if(tinyMCE.selectedInstance.spellcheckerOn) return; - tinyMCE.wpTriggerSave(); - post_data["content"] = jQuery("#content").val(); - } + if ( tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) return; + tinyMCE.triggerSave(); + } + + post_data["content"] = jQuery("#content").val(); if(post_data["post_title"].length==0 || post_data["content"].length==0 || post_data["post_title"] + post_data["content"] == autosaveLast) { return; @@ -122,12 +121,10 @@ function autosave() { if( jQuery("#excerpt")) post_data["excerpt"] = jQuery("#excerpt").val(); - if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) { - post_data["content"] = jQuery("#content").val(); - } else { - tinyMCE.wpTriggerSave(); - post_data["content"] = jQuery("#content").val(); - } + if ( rich ) + tinyMCE.triggerSave(); + + post_data["content"] = jQuery("#content").val(); if(parseInt(post_data["post_ID"]) < 1) { post_data["temp_ID"] = post_data["post_ID"]; diff --git a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js index 50c6b4b32..01a994ee5 100644 --- a/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/autosave/editor_plugin.js @@ -1,51 +1 @@ -/** - * $Id$ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.AutoSavePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler; - }, - - getInfo : function() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private plugin internal methods - - 'static' : { - _beforeUnloadHandler : function() { - var msg; - - tinymce.each(tinyMCE.editors, function(ed) { - if (ed.getParam("fullscreen_is_enabled")) - return; - - if (ed.isDirty()) { - msg = ed.getLang("autosave.unload_msg"); - return false; - } - }); - - return msg; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin); -})(); \ No newline at end of file +(function(){tinymce.create('tinymce.plugins.AutoSavePlugin',{init:function(ed,url){var t=this;t.editor=ed;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;},getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',version:tinymce.majorVersion+"."+tinymce.minorVersion};},'static':{_beforeUnloadHandler:function(){var msg;tinymce.each(tinyMCE.editors,function(ed){if(ed.getParam("fullscreen_is_enabled"))return;if(ed.isDirty()){msg=ed.getLang("autosave.unload_msg");return false;}});return msg;}}});tinymce.PluginManager.add('autosave',tinymce.plugins.AutoSavePlugin);})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js index 7572bed21..6966d80af 100644 --- a/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js @@ -1,79 +1 @@ -/** - * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - tinymce.create('tinymce.plugins.Directionality', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - ed.addCommand('mceDirectionLTR', function() { - var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); - - if (e) { - if (ed.dom.getAttrib(e, "dir") != "ltr") - ed.dom.setAttrib(e, "dir", "ltr"); - else - ed.dom.setAttrib(e, "dir", ""); - } - - ed.nodeChanged(); - }); - - ed.addCommand('mceDirectionRTL', function() { - var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); - - if (e) { - if (ed.dom.getAttrib(e, "dir") != "rtl") - ed.dom.setAttrib(e, "dir", "rtl"); - else - ed.dom.setAttrib(e, "dir", ""); - } - - ed.nodeChanged(); - }); - - ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); - ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); - - ed.onNodeChange.add(t._nodeChange, t); - }, - - getInfo : function() { - return { - longname : 'Directionality', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var dom = ed.dom, dir; - - n = dom.getParent(n, dom.isBlock); - if (!n) { - cm.setDisabled('ltr', 1); - cm.setDisabled('rtl', 1); - return; - } - - dir = dom.getAttrib(n, 'dir'); - cm.setActive('ltr', dir == "ltr"); - cm.setDisabled('ltr', 0); - cm.setActive('rtl', dir == "rtl"); - cm.setDisabled('rtl', 0); - } - }); - - // Register plugin - tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); -})(); \ No newline at end of file +(function(){tinymce.create('tinymce.plugins.Directionality',{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand('mceDirectionLTR',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="ltr")ed.dom.setAttrib(e,"dir","ltr");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addCommand('mceDirectionRTL',function(){var e=ed.dom.getParent(ed.selection.getNode(),ed.dom.isBlock);if(e){if(ed.dom.getAttrib(e,"dir")!="rtl")ed.dom.setAttrib(e,"dir","rtl");else ed.dom.setAttrib(e,"dir","");}ed.nodeChanged();});ed.addButton('ltr',{title:'directionality.ltr_desc',cmd:'mceDirectionLTR'});ed.addButton('rtl',{title:'directionality.rtl_desc',cmd:'mceDirectionRTL'});ed.onNodeChange.add(t._nodeChange,t);},getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_nodeChange:function(ed,cm,n){var dom=ed.dom,dir;n=dom.getParent(n,dom.isBlock);if(!n){cm.setDisabled('ltr',1);cm.setDisabled('rtl',1);return;}dir=dom.getAttrib(n,'dir');cm.setActive('ltr',dir=="ltr");cm.setDisabled('ltr',0);cm.setActive('rtl',dir=="rtl");cm.setDisabled('rtl',0);}});tinymce.PluginManager.add('directionality',tinymce.plugins.Directionality);})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js b/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js index 7526c62a7..b49d21e54 100644 --- a/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js @@ -1,127 +1 @@ -/** - * $Id: editor_plugin_src.js 544 2008-01-17 13:07:00Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.FullScreenPlugin', { - init : function(ed, url) { - var t = this, s = {}, vp; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullScreen', function() { - var win, de = document.documentElement; - - if (ed.getParam('fullscreen_is_enabled')) { - if (ed.getParam('fullscreen_new_window')) - closeFullscreen(); // Call to close in new window - else { - window.setTimeout(function() { - tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); - tinyMCE.remove(ed); - DOM.remove('mce_fullscreen_container'); - de.style.overflow = ed.getParam('fullscreen_html_overflow'); - DOM.setStyle(document.body, 'overflow', ed.getParam('fullscreen_overflow')); - window.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); - }, 10); - } - - return; - } - - if (ed.getParam('fullscreen_new_window')) { - win = window.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); - try { - win.resizeTo(screen.availWidth, screen.availHeight); - } catch (e) { - // Ignore - } - } else { - s.fullscreen_overflow = DOM.getStyle(document.body, 'overflow', 1) || 'auto'; - s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); - vp = DOM.getViewPort(); - s.fullscreen_scrollx = vp.x; - s.fullscreen_scrolly = vp.y; - - // Fixes an Opera bug where the scrollbars doesn't reappear - if (tinymce.isOpera && s.fullscreen_overflow == 'visible') - s.fullscreen_overflow = 'auto'; - - // Fixes an IE bug where horizontal scrollbars would appear - if (tinymce.isIE && s.fullscreen_overflow == 'scroll') - s.fullscreen_overflow = 'auto'; - - if (s.fullscreen_overflow == '0px') - s.fullscreen_overflow = ''; - - DOM.setStyle(document.body, 'overflow', 'hidden'); - de.style.overflow = 'hidden'; //Fix for IE6/7 - vp = DOM.getViewPort(); - window.scrollTo(0, 0); - - if (tinymce.isIE) - vp.h -= 1; - - n = DOM.add(document.body, 'div', {id : 'mce_fullscreen_container', style : 'position:absolute;top:0;left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:150;'}); - DOM.add(n, 'div', {id : 'mce_fullscreen'}); - - tinymce.each(ed.settings, function(v, n) { - s[n] = v; - }); - - s.id = 'mce_fullscreen'; - s.width = n.clientWidth; - s.height = n.clientHeight - 15; - s.fullscreen_is_enabled = true; - s.fullscreen_editor_id = ed.id; - s.theme_advanced_resizing = false; - - tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { - s[k] = v; - }); - - if (s.theme_advanced_toolbar_location === 'external') - s.theme_advanced_toolbar_location = 'top'; - - t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); - t.fullscreenEditor.onInit.add(function() { - t.fullscreenEditor.setContent(ed.getContent({format : 'raw', no_events : 1}), {format : 'raw', no_events : 1}); - }); - - t.fullscreenEditor.render(); - tinyMCE.add(t.fullscreenEditor); - - t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); - t.fullscreenElement.update(); - //document.body.overflow = 'hidden'; - } - }); - - // Register buttons - ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); - }); - }, - - getInfo : function() { - return { - longname : 'Fullscreen', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); -})(); \ No newline at end of file +(function(){var DOM=tinymce.DOM;tinymce.create('tinymce.plugins.FullScreenPlugin',{init:function(ed,url){var t=this,s={},vp;t.editor=ed;ed.addCommand('mceFullScreen',function(){var win,de=document.documentElement;if(ed.getParam('fullscreen_is_enabled')){if(ed.getParam('fullscreen_new_window'))closeFullscreen();else{window.setTimeout(function(){tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format:'raw'}),{format:'raw'});tinyMCE.remove(ed);DOM.remove('mce_fullscreen_container');de.style.overflow=ed.getParam('fullscreen_html_overflow');DOM.setStyle(document.body,'overflow',ed.getParam('fullscreen_overflow'));window.scrollTo(ed.getParam('fullscreen_scrollx'),ed.getParam('fullscreen_scrolly'));},10);}return;}if(ed.getParam('fullscreen_new_window')){win=window.open(url+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=no,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}else{s.fullscreen_overflow=DOM.getStyle(document.body,'overflow',1)||'auto';s.fullscreen_html_overflow=DOM.getStyle(de,'overflow',1);vp=DOM.getViewPort();s.fullscreen_scrollx=vp.x;s.fullscreen_scrolly=vp.y;if(tinymce.isOpera&&s.fullscreen_overflow=='visible')s.fullscreen_overflow='auto';if(tinymce.isIE&&s.fullscreen_overflow=='scroll')s.fullscreen_overflow='auto';if(s.fullscreen_overflow=='0px')s.fullscreen_overflow='';DOM.setStyle(document.body,'overflow','hidden');de.style.overflow='hidden';vp=DOM.getViewPort();window.scrollTo(0,0);if(tinymce.isIE)vp.h-=1;n=DOM.add(document.body,'div',{id:'mce_fullscreen_container',style:'position:absolute;top:0;left:0;width:'+vp.w+'px;height:'+vp.h+'px;z-index:150;'});DOM.add(n,'div',{id:'mce_fullscreen'});tinymce.each(ed.settings,function(v,n){s[n]=v;});s.id='mce_fullscreen';s.width=n.clientWidth;s.height=n.clientHeight-15;s.fullscreen_is_enabled=true;s.fullscreen_editor_id=ed.id;s.theme_advanced_resizing=false;tinymce.each(ed.getParam('fullscreen_settings'),function(v,k){s[k]=v;});if(s.theme_advanced_toolbar_location==='external')s.theme_advanced_toolbar_location='top';t.fullscreenEditor=new tinymce.Editor('mce_fullscreen',s);t.fullscreenEditor.onInit.add(function(){t.fullscreenEditor.setContent(ed.getContent({format:'raw',no_events:1}),{format:'raw',no_events:1});});t.fullscreenEditor.render();tinyMCE.add(t.fullscreenEditor);t.fullscreenElement=new tinymce.dom.Element('mce_fullscreen_container');t.fullscreenElement.update();}});ed.addButton('fullscreen',{title:'fullscreen.desc',cmd:'mceFullScreen'});ed.onNodeChange.add(function(ed,cm){cm.setActive('fullscreen',ed.getParam('fullscreen_is_enabled'));});},getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.PluginManager.add('fullscreen',tinymce.plugins.FullScreenPlugin);})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm b/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm index 5c89a8398..afb5e618a 100644 --- a/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm +++ b/wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm @@ -1,6 +1,7 @@ + - {$lang_fullscreen_title} + - -
    + +
    + + + diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js index 2151ce4d6..3d7216418 100644 --- a/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js @@ -1,559 +1 @@ -/** - * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; - - tinymce.create('tinymce.plugins.InlinePopups', { - init : function(ed, url) { - // Replace window manager - ed.onBeforeRenderUI.add(function() { - ed.windowManager = new tinymce.InlineWindowManager(ed); - DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); - }); - }, - - getInfo : function() { - return { - longname : 'InlinePopups', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { - InlineWindowManager : function(ed) { - var t = this; - - t.parent(ed); - t.zIndex = 1000; - }, - - open : function(f, p) { - var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w; - - f = f || {}; - p = p || {}; - - // Run native windows - if (!f.inline) - return t.parent(f, p); - - t.bookmark = ed.selection.getBookmark('simple'); - id = DOM.uniqueId(); - vp = DOM.getViewPort(); - f.width = parseInt(f.width || 320); - f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); - f.min_width = parseInt(f.min_width || 150); - f.min_height = parseInt(f.min_height || 100); - f.max_width = parseInt(f.max_width || 2000); - f.max_height = parseInt(f.max_height || 2000); - f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); - f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); - f.movable = f.resizable = true; - p.mce_width = f.width; - p.mce_height = f.height; - p.mce_inline = true; - p.mce_window_id = id; - - // Transpose -// po = DOM.getPos(ed.getContainer()); -// f.left -= po.x; -// f.top -= po.y; - - t.features = f; - t.params = p; - t.onOpen.dispatch(t, f, p); - - if (f.type) { - opt += ' modal ' + f.type; - f.resizable = false; - } - - if (f.statusbar) - opt += ' statusbar'; - - if (f.resizable) - opt += ' resizable'; - - if (f.minimizable) - opt += ' minimizable'; - - if (f.maximizable) - opt += ' maximizable'; - - if (f.movable) - opt += ' movable'; - - // Create DOM objects - t._addAll(document.body, - ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'}, - ['div', {id : id + '_wrapper', 'class' : 'wrapper' + opt}, - ['div', {id : id + '_top', 'class' : 'top'}, - ['div', {'class' : 'left'}], - ['div', {'class' : 'center'}], - ['div', {'class' : 'right'}], - ['span', {id : id + '_title'}, f.title || ''] - ], - - ['div', {id : id + '_middle', 'class' : 'middle'}, - ['div', {id : id + '_left', 'class' : 'left'}], - ['span', {id : id + '_content'}], - ['div', {id : id + '_right', 'class' : 'right'}] - ], - - ['div', {id : id + '_bottom', 'class' : 'bottom'}, - ['div', {'class' : 'left'}], - ['div', {'class' : 'center'}], - ['div', {'class' : 'right'}], - ['span', {id : id + '_status'}, 'Content'] - ], - - ['a', {'class' : 'move', href : 'javascript:;'}], - ['a', {'class' : 'min', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'max', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'med', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'close', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {id : id + '_resize_n', 'class' : 'resize resize-n', href : 'javascript:;'}], - ['a', {id : id + '_resize_s', 'class' : 'resize resize-s', href : 'javascript:;'}], - ['a', {id : id + '_resize_w', 'class' : 'resize resize-w', href : 'javascript:;'}], - ['a', {id : id + '_resize_e', 'class' : 'resize resize-e', href : 'javascript:;'}], - ['a', {id : id + '_resize_nw', 'class' : 'resize resize-nw', href : 'javascript:;'}], - ['a', {id : id + '_resize_ne', 'class' : 'resize resize-ne', href : 'javascript:;'}], - ['a', {id : id + '_resize_sw', 'class' : 'resize resize-sw', href : 'javascript:;'}], - ['a', {id : id + '_resize_se', 'class' : 'resize resize-se', href : 'javascript:;'}] - ] - ] - ); - - DOM.setStyles(id, {top : -10000, left : -10000}); - - // Fix gecko rendering bug, where the editors iframe messed with window contents - if (tinymce.isGecko) - DOM.setStyle(id, 'overflow', 'auto'); - - // Measure borders - if (!f.type) { - dw += DOM.get(id + '_left').clientWidth; - dw += DOM.get(id + '_right').clientWidth; - dh += DOM.get(id + '_top').clientHeight; - dh += DOM.get(id + '_bottom').clientHeight; - } - - // Resize window - DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); - - if (!f.type) { - DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); - DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); - DOM.setAttrib(id + '_ifr', 'src', f.url || f.file); - } else { - DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'button ok', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); - - if (f.type == 'confirm') - DOM.add(id + '_wrapper', 'a', {'class' : 'button cancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); - - DOM.add(id + '_middle', 'div', {'class' : 'icon'}); - DOM.setHTML(id + '_content', f.content.replace('\n', '
    ')); - } - - // Register events - mdf = Event.add(id, 'mousedown', function(e) { - var n = e.target, w, vp; - - w = t.windows[id]; - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - if (n.className == 'max') { - w.oldPos = w.element.getXY(); - w.oldSize = w.element.getSize(); - - vp = DOM.getViewPort(); - - // Reduce viewport size to avoid scrollbars - vp.w -= 2; - vp.h -= 2; - - w.element.moveTo(vp.x, vp.y); - w.element.resizeTo(vp.w, vp.h); - DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); - DOM.addClass(id + '_wrapper', 'maximized'); - } else if (n.className == 'med') { - // Reset to old size - w.element.moveTo(w.oldPos.x, w.oldPos.y); - w.element.resizeTo(w.oldSize.w, w.oldSize.h); - w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); - - DOM.removeClass(id + '_wrapper', 'maximized'); - } else if (n.className == 'move') - return t._startDrag(id, e, n.className); - else if (DOM.hasClass(n, 'resize')) - return t._startDrag(id, e, n.className.substring(7)); - } - }); - - clf = Event.add(id, 'click', function(e) { - var n = e.target; - - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - switch (n.className) { - case 'close': - t.close(null, id); - return Event.cancel(e); - - case 'button ok': - case 'button cancel': - f.button_func(n.className == 'button ok'); - return Event.cancel(e); - } - } - }); - - // Add window - t.windows = t.windows || {}; - w = t.windows[id] = { - id : id, - mousedown_func : mdf, - click_func : clf, - element : new Element(id, {blocker : 1, container : ed.getContainer()}), - iframeElement : new Element(id + '_ifr'), - features : f, - deltaWidth : dw, - deltaHeight : dh - }; - - w.iframeElement.on('focus', function() { - t.focus(id); - }); - - t.focus(id); - t._fixIELayout(id, 1); - -// if (DOM.get(id + '_ok')) -// DOM.get(id + '_ok').focus(); - - return w; - }, - - focus : function(id) { - var t = this, w = t.windows[id]; - - w.zIndex = this.zIndex++; - w.element.setStyle('zIndex', w.zIndex); - w.element.update(); - - id = id + '_wrapper'; - DOM.removeClass(t.lastId, 'focus'); - DOM.addClass(id, 'focus'); - t.lastId = id; - }, - - _addAll : function(te, ne) { - var i, n, t = this, dom = tinymce.DOM; - - if (is(ne, 'string')) - te.appendChild(dom.doc.createTextNode(ne)); - else if (ne.length) { - te = te.appendChild(dom.create(ne[0], ne[1])); - - for (i=2; i ix) { - fw = w; - ix = w.zIndex; - } - }); - - if (fw) - t.focus(fw.id); - } - }, - - setTitle : function(ti, id) { - DOM.get(id + '_title').innerHTML = DOM.encode(ti); - }, - - alert : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'alert', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - confirm : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'confirm', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - // Internal functions - - _fixIELayout : function(id, s) { - var w, img; - - if (!tinymce.isIE6) - return; - - // Fixes the bug where hover flickers and does odd things in IE6 - each(['n','s','w','e','nw','ne','sw','se'], function(v) { - var e = DOM.get(id + '_resize_' + v); - - DOM.setStyles(e, { - width : s ? e.clientWidth : '', - height : s ? e.clientHeight : '', - cursor : DOM.getStyle(e, 'cursor', 1) - }); - - DOM.setStyle(id + "_bottom", 'bottom', '-1px'); - - e = 0; - }); - - // Fixes graphics glitch - if (w = this.windows[id]) { - // Fixes rendering bug after resize - w.element.hide(); - w.element.show(); - - // Forced a repaint of the window - //DOM.get(id).style.filter = ''; - - // IE has a bug where images used in CSS won't get loaded - // sometimes when the cache in the browser is disabled - // This fix tries to solve it by loading the images using the image object - each(DOM.select('div,a', id), function(e, i) { - if (e.currentStyle.backgroundImage != 'none') { - img = new Image(); - img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); - } - }); - - DOM.get(id).style.filter = ''; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); -})(); - +(function(){var DOM=tinymce.DOM,Element=tinymce.dom.Element,Event=tinymce.dom.Event,each=tinymce.each,is=tinymce.is;tinymce.create('tinymce.plugins.InlinePopups',{init:function(ed,url){ed.onBeforeRenderUI.add(function(){ed.windowManager=new tinymce.InlineWindowManager(ed);DOM.loadCSS(url+'/skins/'+(ed.settings.inlinepopups_skin||'clearlooks2')+"/window.css");});},getInfo:function(){return{longname:'InlinePopups',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',version:tinymce.majorVersion+"."+tinymce.minorVersion};}});tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager',{InlineWindowManager:function(ed){var t=this;t.parent(ed);t.zIndex=1000;},open:function(f,p){var t=this,id,opt='',ed=t.editor,dw=0,dh=0,vp,po,mdf,clf,we,w;f=f||{};p=p||{};if(!f.inline)return t.parent(f,p);t.bookmark=ed.selection.getBookmark('simple');id=DOM.uniqueId();vp=DOM.getViewPort();f.width=parseInt(f.width||320);f.height=parseInt(f.height||240)+(tinymce.isIE?8:0);f.min_width=parseInt(f.min_width||150);f.min_height=parseInt(f.min_height||100);f.max_width=parseInt(f.max_width||2000);f.max_height=parseInt(f.max_height||2000);f.left=f.left||Math.round(Math.max(vp.x,vp.x+(vp.w/ 2.0) - (f.width /2.0)));f.top=f.top||Math.round(Math.max(vp.y,vp.y+(vp.h/ 2.0) - (f.height /2.0)));f.movable=f.resizable=true;p.mce_width=f.width;p.mce_height=f.height;p.mce_inline=true;p.mce_window_id=id;t.features=f;t.params=p;t.onOpen.dispatch(t,f,p);if(f.type){opt+=' modal '+f.type;f.resizable=false;}if(f.statusbar)opt+=' statusbar';if(f.resizable)opt+=' resizable';if(f.minimizable)opt+=' minimizable';if(f.maximizable)opt+=' maximizable';if(f.movable)opt+=' movable';t._addAll(document.body,['div',{id:id,'class':ed.settings.inlinepopups_skin||'clearlooks2',style:'width:100px;height:100px'},['div',{id:id+'_wrapper','class':'wrapper'+opt},['div',{id:id+'_top','class':'top'},['div',{'class':'left'}],['div',{'class':'center'}],['div',{'class':'right'}],['span',{id:id+'_title'},f.title||'']],['div',{id:id+'_middle','class':'middle'},['div',{id:id+'_left','class':'left'}],['span',{id:id+'_content'}],['div',{id:id+'_right','class':'right'}]],['div',{id:id+'_bottom','class':'bottom'},['div',{'class':'left'}],['div',{'class':'center'}],['div',{'class':'right'}],['span',{id:id+'_status'},'Content']],['a',{'class':'move',href:'javascript:;'}],['a',{'class':'min',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'max',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'med',href:'javascript:;',onmousedown:'return false;'}],['a',{'class':'close',href:'javascript:;',onmousedown:'return false;'}],['a',{id:id+'_resize_n','class':'resize resize-n',href:'javascript:;'}],['a',{id:id+'_resize_s','class':'resize resize-s',href:'javascript:;'}],['a',{id:id+'_resize_w','class':'resize resize-w',href:'javascript:;'}],['a',{id:id+'_resize_e','class':'resize resize-e',href:'javascript:;'}],['a',{id:id+'_resize_nw','class':'resize resize-nw',href:'javascript:;'}],['a',{id:id+'_resize_ne','class':'resize resize-ne',href:'javascript:;'}],['a',{id:id+'_resize_sw','class':'resize resize-sw',href:'javascript:;'}],['a',{id:id+'_resize_se','class':'resize resize-se',href:'javascript:;'}]]]);DOM.setStyles(id,{top:-10000,left:-10000});if(tinymce.isGecko)DOM.setStyle(id,'overflow','auto');if(!f.type){dw+=DOM.get(id+'_left').clientWidth;dw+=DOM.get(id+'_right').clientWidth;dh+=DOM.get(id+'_top').clientHeight;dh+=DOM.get(id+'_bottom').clientHeight;}DOM.setStyles(id,{top:f.top,left:f.left,width:f.width+dw,height:f.height+dh});if(!f.type){DOM.add(id+'_content','iframe',{id:id+'_ifr',src:'javascript:""',frameBorder:0,style:'border:0;width:10px;height:10px'});DOM.setStyles(id+'_ifr',{width:f.width,height:f.height});DOM.setAttrib(id+'_ifr','src',f.url||f.file);}else{DOM.add(id+'_wrapper','a',{id:id+'_ok','class':'button ok',href:'javascript:;',onmousedown:'return false;'},'Ok');if(f.type=='confirm')DOM.add(id+'_wrapper','a',{'class':'button cancel',href:'javascript:;',onmousedown:'return false;'},'Cancel');DOM.add(id+'_middle','div',{'class':'icon'});DOM.setHTML(id+'_content',f.content.replace('\n','
    '));}mdf=Event.add(id,'mousedown',function(e){var n=e.target,w,vp;w=t.windows[id];t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){if(n.className=='max'){w.oldPos=w.element.getXY();w.oldSize=w.element.getSize();vp=DOM.getViewPort();vp.w-=2;vp.h-=2;w.element.moveTo(vp.x,vp.y);w.element.resizeTo(vp.w,vp.h);DOM.setStyles(id+'_ifr',{width:vp.w-w.deltaWidth,height:vp.h-w.deltaHeight});DOM.addClass(id+'_wrapper','maximized');}else if(n.className=='med'){w.element.moveTo(w.oldPos.x,w.oldPos.y);w.element.resizeTo(w.oldSize.w,w.oldSize.h);w.iframeElement.resizeTo(w.oldSize.w-w.deltaWidth,w.oldSize.h-w.deltaHeight);DOM.removeClass(id+'_wrapper','maximized');}else if(n.className=='move')return t._startDrag(id,e,n.className);else if(DOM.hasClass(n,'resize'))return t._startDrag(id,e,n.className.substring(7));}});clf=Event.add(id,'click',function(e){var n=e.target;t.focus(id);if(n.nodeName=='A'||n.nodeName=='a'){switch(n.className){case'close':t.close(null,id);return Event.cancel(e);case'button ok':case'button cancel':f.button_func(n.className=='button ok');return Event.cancel(e);}}});t.windows=t.windows||{};w=t.windows[id]={id:id,mousedown_func:mdf,click_func:clf,element:new Element(id,{blocker:1,container:ed.getContainer()}),iframeElement:new Element(id+'_ifr'),features:f,deltaWidth:dw,deltaHeight:dh};w.iframeElement.on('focus',function(){t.focus(id);});t.focus(id);t._fixIELayout(id,1);return w;},focus:function(id){var t=this,w=t.windows[id];w.zIndex=this.zIndex++;w.element.setStyle('zIndex',w.zIndex);w.element.update();id=id+'_wrapper';DOM.removeClass(t.lastId,'focus');DOM.addClass(id,'focus');t.lastId=id;},_addAll:function(te,ne){var i,n,t=this,dom=tinymce.DOM;if(is(ne,'string'))te.appendChild(dom.doc.createTextNode(ne));else if(ne.length){te=te.appendChild(dom.create(ne[0],ne[1]));for(i=2;iix){fw=w;ix=w.zIndex;}});if(fw)t.focus(fw.id);}},setTitle:function(ti,id){DOM.get(id+'_title').innerHTML=DOM.encode(ti);},alert:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'alert',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},confirm:function(txt,cb,s){var t=this,w;w=t.open({title:t,type:'confirm',button_func:function(s){if(cb)cb.call(s||t,s);t.close(null,w.id);},content:DOM.encode(t.editor.getLang(txt,txt)),inline:1,width:400,height:130});},_fixIELayout:function(id,s){var w,img;if(!tinymce.isIE6)return;each(['n','s','w','e','nw','ne','sw','se'],function(v){var e=DOM.get(id+'_resize_'+v);DOM.setStyles(e,{width:s?e.clientWidth:'',height:s?e.clientHeight:'',cursor:DOM.getStyle(e,'cursor',1)});DOM.setStyle(id+"_bottom",'bottom','-1px');e=0;});if(w=this.windows[id]){w.element.hide();w.element.show();each(DOM.select('div,a',id),function(e,i){if(e.currentStyle.backgroundImage!='none'){img=new Image();img.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,'$1');}});DOM.get(id).style.filter='';}}});tinymce.PluginManager.add('inlinepopups',tinymce.plugins.InlinePopups);})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif index 6baf64ad3..b408ae1fe 100644 Binary files a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif and b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif differ diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif new file mode 100644 index 000000000..bf0a03ee4 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif differ diff --git a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css index e68d8975a..0ce29bd3d 100644 --- a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +++ b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -8,30 +8,73 @@ .clearlooks2 .placeholder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; filter:alpha(opacity=50)} /* Top */ -.clearlooks2 .top, .clearlooks2 .top div {top:0; width:100%; height:23px} -.clearlooks2 .top .left {width:6px; background:url(img/corners.gif)} -.clearlooks2 .top .center {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)} -.clearlooks2 .top .right {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0} -.clearlooks2 .top span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold} -.clearlooks2 .focus .top .left {background:url(img/corners.gif) -6px 0} -.clearlooks2 .focus .top .center {background:url(img/horizontal.gif) 0 -23px} -.clearlooks2 .focus .top .right {background:url(img/corners.gif) -18px 0} -.clearlooks2 .focus .top span {color:#FFF} +.clearlooks2 .top, +.clearlooks2 .top div { +top:0; +width:100%; +height:23px +} +.clearlooks2 .top .left { +width:55%; +background: #cee1ef; +border-left: 1px solid #c6d9e9; +border-top: 1px solid #c6d9e9; +} +.clearlooks2 .top .center { +/*right:6px; +width:100%; +height:23px; +background: #dedede; +border-top: 1px solid #ccc;*/ +} +.clearlooks2 .top .right { +right:0; +width:55%; +height:23px; +background: #cee1ef; +border-right: 1px solid #c6d9e9; +border-top: 1px solid #c6d9e9; +} +.clearlooks2 .top span { +width:100%; +font: 12px/20px bold "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana,sans-serif; +text-align:center; +vertical-align:middle; +line-height:23px; +font-weight:bold +} +.clearlooks2 .focus .top .left { +background: #2683ae; +border-left: 1px solid #464646; +border-top: 1px solid #464646; +} +.clearlooks2 .focus .top .center { +/*background: #2683ae; +border-top: 1px solid #454545;*/ +} +.clearlooks2 .focus .top .right { +background: #2683ae; +border-right: 1px solid #464646; +border-top: 1px solid #464646; +} +.clearlooks2 .focus .top span { +color:#FFF +} /* Middle */ .clearlooks2 .middle, .clearlooks2 .middle div {top:0} .clearlooks2 .middle {width:100%; height:100%; clip:rect(23px auto auto auto)} -.clearlooks2 .middle .left {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0} +.clearlooks2 .middle .left {left:0; width:5px; height:100%; background:#eaf3ea;border-left:1px solid #c6d9e9;} .clearlooks2 .middle span {top:23px; left:5px; width:100%; height:100%; background:#FFF} -.clearlooks2 .middle .right {right:0; width:5px; height:100%; background:url(img/vertical.gif)} +.clearlooks2 .middle .right {right:0; width:5px; height:100%; background:#eaf3ea;border-right:1px solid #c6d9e9;} /* Bottom */ .clearlooks2 .bottom, .clearlooks2 .bottom div {height:6px} -.clearlooks2 .bottom {left:0; bottom:0; width:100%} -.clearlooks2 .bottom div {top:0} -.clearlooks2 .bottom .left {left:0; width:5px; background:url(img/corners.gif) -34px -6px} -.clearlooks2 .bottom .center {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px} -.clearlooks2 .bottom .right {right:0; width:5px; background: url(img/corners.gif) -34px 0} +.clearlooks2 .bottom {left:0; bottom:0; width:100%;background:#eaf3ea;border-bottom:1px solid #c6d9e9;} +.clearlooks2 .bottom div {top:0;} +.clearlooks2 .bottom .left {left:0; width:5px; background:#eaf3ea;border-left:1px solid #c6d9e9;} +.clearlooks2 .bottom .center {left:5px; width:100%; } +.clearlooks2 .bottom .right {right:0; width:6px; background:#eaf3ea url(img/drag.gif) no-repeat;border-right:1px solid #c6d9e9;} .clearlooks2 .bottom span {display:none} .clearlooks2 .statusbar .bottom, .clearlooks2 .statusbar .bottom div {height:23px} .clearlooks2 .statusbar .bottom .left {background:url(img/corners.gif) -29px 0} diff --git a/wp-includes/js/tinymce/plugins/media/editor_plugin.js b/wp-includes/js/tinymce/plugins/media/editor_plugin.js index e58f93325..04cbb04d2 100644 --- a/wp-includes/js/tinymce/plugins/media/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/media/editor_plugin.js @@ -1,323 +1 @@ -/** - * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var each = tinymce.each; - - tinymce.create('tinymce.plugins.MediaPlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - t.url = url; - - function isMediaElm(n) { - return /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className); - }; - - // Register commands - ed.addCommand('mceMedia', function() { - ed.windowManager.open({ - file : url + '/media.htm', - width : 430 + parseInt(ed.getLang('media.delta_width', 0)), - height : 470 + parseInt(ed.getLang('media.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('media', {title : 'media.desc', cmd : 'mceMedia'}); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('media', n.nodeName == 'IMG' && isMediaElm(n)); - }); - - ed.onInit.add(function() { - var lo = { - mceItemFlash : 'flash', - mceItemShockWave : 'shockwave', - mceItemWindowsMedia : 'windowsmedia', - mceItemQuickTime : 'quicktime', - mceItemRealMedia : 'realmedia' - }; - - ed.dom.loadCSS(url + "/css/content.css"); - - if (ed.theme.onResolveName) { - ed.theme.onResolveName.add(function(th, o) { - if (o.name == 'img') { - each(lo, function(v, k) { - if (ed.dom.hasClass(o.node, k)) { - o.name = v; - o.title = ed.dom.getAttrib(o.node, 'title'); - return false; - } - }); - } - }); - } - - if (ed && ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { - if (e.nodeName == 'IMG' && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)) { - m.add({title : 'media.edit', icon : 'media', cmd : 'mceMedia'}); - } - }); - } - }); - - ed.onBeforeSetContent.add(function(ed, o) { - var h = o.content; - - h = h.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi, function(a, b, c) { - var o = eval("({" + c + "})"); - - return '' - }); - - h = h.replace(/]*)>/gi, '
    '); - h = h.replace(/]*)>/gi, '
    '); - h = h.replace(/<\/(object|embed)([^>]*)>/gi, '
    '); - h = h.replace(/]*)>/gi, function(a, b) {return '
    '}); - h = h.replace(/\/ class=\"mceItemParam\"><\/div>/gi, 'class="mceItemParam">
    '); - - o.content = h; - }); - - ed.onSetContent.add(function() { - t._divsToImgs(ed.getBody()); - }); - - ed.onPreProcess.add(function(ed, o) { - var dom = ed.dom; - - if (o.set) { - t._divsToImgs(o.node); - - each(dom.select('IMG', o.node), function(n) { - var p; - - if (isMediaElm(n)) { - p = t._parse(n.title); - dom.setAttrib(n, 'width', dom.getAttrib(n, 'width', p.width || 100)); - dom.setAttrib(n, 'height', dom.getAttrib(n, 'height', p.height || 100)); - } - }); - } - - if (o.get) { - each(dom.select('IMG', o.node), function(n) { - var ci, cb, mt; - - if (ed.getParam('media_use_script')) { - if (isMediaElm(n)) - n.className = n.className.replace(/mceItem/g, 'mceTemp'); - - return; - } - - switch (n.className) { - case 'mceItemFlash': - ci = 'd27cdb6e-ae6d-11cf-96b8-444553540000'; - cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - mt = 'application/x-shockwave-flash'; - break; - - case 'mceItemShockWave': - ci = '166b1bca-3f9c-11cf-8075-444553540000'; - cb = 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0'; - mt = 'application/x-director'; - break; - - case 'mceItemWindowsMedia': - ci = ed.getParam('media_wmp6_compatible') ? '05589fa1-c356-11ce-bf01-00aa0055595a' : '6bf52a52-394a-11d3-b153-00c04f79faa6'; - cb = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'; - mt = 'application/x-mplayer2'; - break; - - case 'mceItemQuickTime': - ci = '02bf25d5-8c17-4b23-bc80-d3488abddc6b'; - cb = 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0'; - mt = 'video/quicktime'; - break; - - case 'mceItemRealMedia': - ci = 'cfcdaa03-8be4-11cf-b84b-0020afbbccfa'; - cb = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0'; - mt = 'audio/x-pn-realaudio-plugin'; - break; - } - - if (ci) { - dom.replace(t._buildObj({ - classid : ci, - codebase : cb, - type : mt - }, n), n); - } - }); - } - }); - - ed.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/_value=/g, 'value='); - }); - - if (ed.getParam('media_use_script')) { - function getAttr(s, n) { - n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s); - - return n ? ed.dom.decode(n[1]) : ''; - }; - - ed.onPostProcess.add(function(ed, o) { - o.content = o.content.replace(/]+>/g, function(im) { - var cl = getAttr(im, 'class'); - - if (/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)) { - at = t._parse(getAttr(im, 'title')); - at.width = getAttr(im, 'width'); - at.height = getAttr(im, 'height'); - im = ''; - } - - return im; - }); - }); - } - }, - - getInfo : function() { - return { - longname : 'Media', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _buildObj : function(o, n) { - var ob, ed = this.editor, dom = ed.dom, p = this._parse(n.title); - - p.width = o.width = dom.getAttrib(n, 'width') || 100; - p.height = o.height = dom.getAttrib(n, 'height') || 100; - - ob = dom.create('div', { - mce_name : 'object', - classid : "clsid:" + o.classid, - codebase : o.codebase, - width : o.width, - height : o.height - }); - - if (p.src) - p.src = ed.convertURL(p.src, 'src', n); - - each (p, function(v, k) { - if (v && !/^(width|height|codebase|classid)$/.test(k)) - dom.add(ob, 'div', {mce_name : 'param', name : k, '_value' : v}); - }); - - dom.add(ob, 'div', tinymce.extend({mce_name : 'embed', type : o.type}, p)); - - return ob; - }, - - _divsToImgs : function(p) { - var t = this, dom = t.editor.dom, im, ci; - - each(dom.select('div', p), function(n) { - // Convert object into image - if (dom.getAttrib(n, 'class') == 'mceItemObject') { - ci = dom.getAttrib(n, "classid").toLowerCase().replace(/\s+/g, ''); - - switch (ci) { - case 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000': - dom.replace(t._createImg('mceItemFlash', n), n); - break; - - case 'clsid:166b1bca-3f9c-11cf-8075-444553540000': - dom.replace(t._createImg('mceItemShockWave', n), n); - break; - - case 'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6': - case 'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95': - case 'clsid:05589fa1-c356-11ce-bf01-00aa0055595a': - dom.replace(t._createImg('mceItemWindowsMedia', n), n); - break; - - case 'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b': - dom.replace(t._createImg('mceItemQuickTime', n), n); - break; - - case 'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa': - dom.replace(t._createImg('mceItemRealMedia', n), n); - break; - - default: - dom.replace(t._createImg('mceItemFlash', n), n); - } - } - }); - }, - - _createImg : function(cl, n) { - var im, dom = this.editor.dom, pa = {}, ti = ''; - - // Create image - im = dom.create('img', { - src : this.url + '/img/trans.gif', - width : dom.getAttrib(n, 'width') || 100, - height : dom.getAttrib(n, 'height') || 100, - 'class' : cl - }); - - // Setup base parameters - each(['id', 'name', 'width', 'height', 'bgcolor', 'align'], function(n) { - var v = dom.getAttrib(n, 'align'); - - if (v) - pa[v] = v; - }); - - // Add optional parameters - each(dom.select('div', n), function(n) { - if (dom.hasClass(n, 'mceItemParam')) - pa[dom.getAttrib(n, 'name')] = dom.getAttrib(n, '_value'); - }); - - // Use src not movie - if (pa.movie) { - pa.src = pa.movie; - delete pa.movie; - } - - delete pa.width; - delete pa.height; - - im.title = this._serialize(pa); - - return im; - }, - - _parse : function(s) { - return tinymce.util.JSON.parse('{' + s + '}'); - }, - - _serialize : function(o) { - return tinymce.util.JSON.serialize(o).replace(/[{}]/g, ''); - } - }); - - // Register plugin - tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); -})(); \ No newline at end of file +(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.MediaPlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;function isMediaElm(n){return/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className);};ed.addCommand('mceMedia',function(){ed.windowManager.open({file:url+'/media.htm',width:430+parseInt(ed.getLang('media.delta_width',0)),height:470+parseInt(ed.getLang('media.delta_height',0)),inline:1},{plugin_url:url});});ed.addButton('media',{title:'media.desc',cmd:'mceMedia'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('media',n.nodeName=='IMG'&&isMediaElm(n));});ed.onInit.add(function(){var lo={mceItemFlash:'flash',mceItemShockWave:'shockwave',mceItemWindowsMedia:'windowsmedia',mceItemQuickTime:'quicktime',mceItemRealMedia:'realmedia'};ed.dom.loadCSS(url+"/css/content.css");if(ed.theme.onResolveName){ed.theme.onResolveName.add(function(th,o){if(o.name=='img'){each(lo,function(v,k){if(ed.dom.hasClass(o.node,k)){o.name=v;o.title=ed.dom.getAttrib(o.node,'title');return false;}});}});}if(ed&&ed.plugins.contextmenu){ed.plugins.contextmenu.onContextMenu.add(function(th,m,e){if(e.nodeName=='IMG'&&/mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(e.className)){m.add({title:'media.edit',icon:'media',cmd:'mceMedia'});}});}});ed.onBeforeSetContent.add(function(ed,o){var h=o.content;h=h.replace(/]*>\s*write(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)\(\{([^\)]*)\}\);\s*<\/script>/gi,function(a,b,c){var o=eval("({"+c+"})");return''});h=h.replace(/]*)>/gi,'');h=h.replace(/]*)>/gi,'');h=h.replace(/<\/(object|embed)([^>]*)>/gi,'');h=h.replace(/]*)>/gi,function(a,b){return''});h=h.replace(/\/ class=\"mceItemParam\"><\/span>/gi,'class="mceItemParam">');o.content=h;});ed.onSetContent.add(function(){t._spansToImgs(ed.getBody());});ed.onPreProcess.add(function(ed,o){var dom=ed.dom;if(o.set){t._spansToImgs(o.node);each(dom.select('IMG',o.node),function(n){var p;if(isMediaElm(n)){p=t._parse(n.title);dom.setAttrib(n,'width',dom.getAttrib(n,'width',p.width||100));dom.setAttrib(n,'height',dom.getAttrib(n,'height',p.height||100));}});}if(o.get){each(dom.select('IMG',o.node),function(n){var ci,cb,mt;if(ed.getParam('media_use_script')){if(isMediaElm(n))n.className=n.className.replace(/mceItem/g,'mceTemp');return;}switch(n.className){case'mceItemFlash':ci='d27cdb6e-ae6d-11cf-96b8-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='application/x-shockwave-flash';break;case'mceItemShockWave':ci='166b1bca-3f9c-11cf-8075-444553540000';cb='http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0';mt='application/x-director';break;case'mceItemWindowsMedia':ci=ed.getParam('media_wmp6_compatible')?'05589fa1-c356-11ce-bf01-00aa0055595a':'6bf52a52-394a-11d3-b153-00c04f79faa6';cb='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701';mt='application/x-mplayer2';break;case'mceItemQuickTime':ci='02bf25d5-8c17-4b23-bc80-d3488abddc6b';cb='http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0';mt='video/quicktime';break;case'mceItemRealMedia':ci='cfcdaa03-8be4-11cf-b84b-0020afbbccfa';cb='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0';mt='audio/x-pn-realaudio-plugin';break;}if(ci){dom.replace(t._buildObj({classid:ci,codebase:cb,type:mt},n),n);}});}});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/_value=/g,'value=');});if(ed.getParam('media_use_script')){function getAttr(s,n){n=new RegExp(n+'=\"([^\"]+)\"','g').exec(s);return n?ed.dom.decode(n[1]):'';};ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/]+>/g,function(im){var cl=getAttr(im,'class');if(/^(mceTempFlash|mceTempShockWave|mceTempWindowsMedia|mceTempQuickTime|mceTempRealMedia)$/.test(cl)){at=t._parse(getAttr(im,'title'));at.width=getAttr(im,'width');at.height=getAttr(im,'height');im='';}return im;});});}},getInfo:function(){return{longname:'Media',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/media',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_buildObj:function(o,n){var ob,ed=this.editor,dom=ed.dom,p=this._parse(n.title);p.width=o.width=dom.getAttrib(n,'width')||100;p.height=o.height=dom.getAttrib(n,'height')||100;ob=dom.create('span',{mce_name:'object',classid:"clsid:"+o.classid,codebase:o.codebase,width:o.width,height:o.height});if(p.src)p.src=ed.convertURL(p.src,'src',n);each(p,function(v,k){if(v&&!/^(width|height|codebase|classid)$/.test(k))dom.add(ob,'span',{mce_name:'param',name:k,'_value':v});});dom.add(ob,'span',tinymce.extend({mce_name:'embed',type:o.type},p));return ob;},_spansToImgs:function(p){var t=this,dom=t.editor.dom,im,ci;each(dom.select('span',p),function(n){if(dom.getAttrib(n,'class')=='mceItemObject'){ci=dom.getAttrib(n,"classid").toLowerCase().replace(/\s+/g,'');switch(ci){case'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000':dom.replace(t._createImg('mceItemFlash',n),n);break;case'clsid:166b1bca-3f9c-11cf-8075-444553540000':dom.replace(t._createImg('mceItemShockWave',n),n);break;case'clsid:6bf52a52-394a-11d3-b153-00c04f79faa6':case'clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95':case'clsid:05589fa1-c356-11ce-bf01-00aa0055595a':dom.replace(t._createImg('mceItemWindowsMedia',n),n);break;case'clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b':dom.replace(t._createImg('mceItemQuickTime',n),n);break;case'clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa':dom.replace(t._createImg('mceItemRealMedia',n),n);break;default:dom.replace(t._createImg('mceItemFlash',n),n);}}});},_createImg:function(cl,n){var im,dom=this.editor.dom,pa={},ti='';im=dom.create('img',{src:this.url+'/img/trans.gif',width:dom.getAttrib(n,'width')||100,height:dom.getAttrib(n,'height')||100,'class':cl});each(['id','name','width','height','bgcolor','align'],function(n){var v=dom.getAttrib(n,'align');if(v)pa[v]=v;});each(dom.select('span',n),function(n){if(dom.hasClass(n,'mceItemParam'))pa[dom.getAttrib(n,'name')]=dom.getAttrib(n,'_value');});if(pa.movie){pa.src=pa.movie;delete pa.movie;}delete pa.width;delete pa.height;im.title=this._serialize(pa);return im;},_parse:function(s){return tinymce.util.JSON.parse('{'+s+'}');},_serialize:function(o){return tinymce.util.JSON.serialize(o).replace(/[{}]/g,'');}});tinymce.PluginManager.add('media',tinymce.plugins.MediaPlugin);})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/media/media.htm b/wp-includes/js/tinymce/plugins/media/media.htm index 077ccddd5..9299429f8 100644 --- a/wp-includes/js/tinymce/plugins/media/media.htm +++ b/wp-includes/js/tinymce/plugins/media/media.htm @@ -2,14 +2,15 @@ {#media_dlg.title} - + - + +
    @@ -811,11 +812,11 @@
    - +
    - +
    diff --git a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js index 42210882d..d6fa2b69f 100644 --- a/wp-includes/js/tinymce/plugins/paste/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/paste/editor_plugin.js @@ -1,383 +1 @@ -/** - * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var Event = tinymce.dom.Event; - - tinymce.create('tinymce.plugins.PastePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mcePasteText', function(ui, v) { - if (ui) { - ed.windowManager.open({ - file : url + '/pastetext.htm', - width : 450, - height : 400, - inline : 1 - }, { - plugin_url : url - }); - } else - t._insertText(v.html, v.linebreaks); - }); - - ed.addCommand('mcePasteWord', function(ui, v) { - if (ui) { - ed.windowManager.open({ - file : url + '/pasteword.htm', - width : 450, - height : 400, - inline : 1 - }, { - plugin_url : url - }); - } else - t._insertWordContent(v); - }); - - ed.addCommand('mceSelectAll', function() { - ed.execCommand('selectall'); - }); - - // Register buttons - ed.addButton('pastetext', {title : 'paste.paste_text_desc', cmd : 'mcePasteText', ui : true}); - ed.addButton('pasteword', {title : 'paste.paste_word_desc', cmd : 'mcePasteWord', ui : true}); - ed.addButton('selectall', {title : 'paste.selectall_desc', cmd : 'mceSelectAll'}); - - if (ed.getParam("paste_auto_cleanup_on_paste", false)) { - ed.onPaste.add(function(ed, e) { - return t._handlePasteEvent(e) - }); - } - - if (!tinymce.isIE && ed.getParam("paste_auto_cleanup_on_paste", false)) { - // Force paste dialog if non IE browser - ed.onKeyDown.add(function(ed, e) { - if (e.ctrlKey && e.keyCode == 86) { - window.setTimeout(function() { - ed.execCommand("mcePasteText", true); - }, 1); - - Event.cancel(e); - } - }); - } - }, - - getInfo : function() { - return { - longname : 'Paste text/word', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _handlePasteEvent : function(e) { - var html = this._clipboardHTML(), ed = this.editor, sel = ed.selection, r; - - // Removes italic, strong etc, the if was needed due to bug #1437114 - if (ed && (r = sel.getRng()) && r.text.length > 0) - ed.execCommand('delete'); - - if (html && html.length > 0) - ed.execCommand('mcePasteWord', false, html); - - return Event.cancel(e); - }, - - _insertText : function(content, bLinebreaks) { - if (content && content.length > 0) { - if (bLinebreaks) { - // Special paragraph treatment - if (this.editor.getParam("paste_create_paragraphs", true)) { - var rl = this.editor.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); - for (var i=0; i

    '); - content = content.replace(/\r\r/g, '

    '); - content = content.replace(/\n\n/g, '

    '); - - // Has paragraphs - if ((pos = content.indexOf('

    ')) != -1) { - this.editor.execCommand("Delete"); - - var node = this.editor.selection.getNode(); - - // Get list of elements to break - var breakElms = []; - - 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 = "

    "; - before += content.substring(0, pos); - - for (var i=0; i"; - after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; - } - - before += "

    "; - content = before + content.substring(pos+7) + after; - } - } - - if (this.editor.getParam("paste_create_linebreaks", true)) { - content = content.replace(/\r\n/g, '
    '); - content = content.replace(/\r/g, '
    '); - content = content.replace(/\n/g, '
    '); - } - } - - this.editor.execCommand("mceInsertRawHTML", false, content); - } - }, - - _insertWordContent : function(content) { - var t = this, ed = t.editor; - - if (content && content.length > 0) { - // Cleanup Word content - var bull = String.fromCharCode(8226); - var middot = String.fromCharCode(183); - var cb; - - if ((cb = this.editor.getParam("paste_insert_word_content_callback", "")) != "") - content = eval(cb + "('before', content)"); - - var rl = this.editor.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); - for (var i=0; i(.*?)<\/p>', 'gi'), '

    $1

    '); - } - - content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--"); - content = content.replace(new RegExp(bull + "(.*?)
    ", "gi"), "

    " + middot + "$1

    "); - content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list - content = content.replace(/<\/o:p>/gi, ""); - content = content.replace(new RegExp('
    ]*>/gi, ""); - - if (this.editor.getParam("paste_remove_styles", true)) - content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3"); - - content = content.replace(/<\/?font[^>]*>/gi, ""); - - // Strips class attributes. - switch (this.editor.getParam("paste_strip_class_attributes", "all")) { - case "all": - content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); - break; - - case "mso": - content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3"); - break; - } - - content = content.replace(new RegExp('href="?' + this._reEscape("" + document.location) + '', 'gi'), 'href="' + this.editor.documentBaseURI.getURI()); - content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); - content = content.replace(/<\\?\?xml[^>]*>/gi, ""); - content = content.replace(/<\/?\w+:[^>]*>/gi, ""); - content = content.replace(/-- page break --\s*

     <\/p>/gi, ""); // Remove pagebreaks - content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks - - // content = content.replace(/\/? */gi, "");   - // content = content.replace(/

     <\/p>/gi, ''); - - if (!this.editor.getParam('force_p_newlines')) { - content = content.replace('', '' ,'gi'); - content = content.replace('

    ', '

    ' ,'gi'); - } - - if (!tinymce.isIE && !this.editor.getParam('force_p_newlines')) { - content = content.replace(/<\/?p[^>]*>/gi, ""); - } - - content = content.replace(/<\/?div[^>]*>/gi, ""); - - // Convert all middlot lists to UL lists - if (this.editor.getParam("paste_convert_middot_lists", true)) { - var div = ed.dom.create("div", null, content); - - // Convert all middot paragraphs to li elements - var className = this.editor.getParam("paste_unindented_list_class", "unIndentedList"); - - while (this._convertMiddots(div, "--list--")) ; // bull - while (this._convertMiddots(div, middot, className)) ; // Middot - while (this._convertMiddots(div, bull)) ; // bull - - content = div.innerHTML; - } - - // Replace all headers with strong and fix some other issues - if (this.editor.getParam("paste_convert_headers_to_strong", false)) { - content = content.replace(/ <\/h[1-6]>/gi, '

      

    '); - content = content.replace(//gi, '

    '); - content = content.replace(/<\/h[1-6]>/gi, '

    '); - content = content.replace(/ <\/b>/gi, '  '); - content = content.replace(/^( )*/gi, ''); - } - - content = content.replace(/--list--/gi, ""); // Remove --list-- - - if ((cb = this.editor.getParam("paste_insert_word_content_callback", "")) != "") - content = eval(cb + "('after', content)"); - - // Insert cleaned content - this.editor.execCommand("mceInsertContent", false, content); - - if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) { - var ed = this.editor; - - window.setTimeout(function() { - ed.execCommand("mceCleanup"); - }, 1); // Do normal cleanup detached from this thread - } - } - }, - - _reEscape : function(s) { - var l = "?.\\*[](){}+^$:"; - var o = ""; - - for (var i=0; i0)ed.execCommand('delete');if(html&&html.length>0)ed.execCommand('mcePasteWord',false,html);return Event.cancel(e);},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i

    ');content=content.replace(/\r\r/g,'

    ');content=content.replace(/\n\n/g,'

    ');if((pos=content.indexOf('

    '))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="

    ";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="

    ";content=before+content.substring(pos+7)+after;}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,'
    ');content=content.replace(/\r/g,'
    ');content=content.replace(/\n/g,'
    ');}}this.editor.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var cb;if((cb=this.editor.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('before', content)");var rl=this.editor.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i(.*?)<\/p>','gi'),'

    $1

    ');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)
    ","gi"),"

    "+middot+"$1

    ");content=content.replace(new RegExp('','gi'),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp('
    ]*>/gi,"");if(this.editor.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(this.editor.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+this._reEscape(""+document.location)+'','gi'),'href="'+this.editor.documentBaseURI.getURI());content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*

     <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!this.editor.getParam('force_p_newlines')){content=content.replace('','','gi');content=content.replace('

    ','

    ','gi');}if(!tinymce.isIE&&!this.editor.getParam('force_p_newlines')){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(this.editor.getParam("paste_convert_middot_lists",true)){var div=ed.dom.create("div",null,content);var className=this.editor.getParam("paste_unindented_list_class","unIndentedList");while(this._convertMiddots(div,"--list--"));while(this._convertMiddots(div,middot,className));while(this._convertMiddots(div,bull));content=div.innerHTML;}if(this.editor.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/ <\/h[1-6]>/gi,'

      

    ');content=content.replace(//gi,'

    ');content=content.replace(/<\/h[1-6]>/gi,'

    ');content=content.replace(/ <\/b>/gi,'  ');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if((cb=this.editor.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('after', content)");this.editor.execCommand("mceInsertContent",false,content);if(this.editor.getParam('paste_force_cleanup_wordpaste',true)){var ed=this.editor;window.setTimeout(function(){ed.execCommand("mceCleanup");},1);}}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i {#paste.paste_text_desc} - + - + +
    @@ -22,11 +23,11 @@
    - +
    - +
    diff --git a/wp-includes/js/tinymce/plugins/paste/pasteword.htm b/wp-includes/js/tinymce/plugins/paste/pasteword.htm index f96d47846..473f8c01a 100644 --- a/wp-includes/js/tinymce/plugins/paste/pasteword.htm +++ b/wp-includes/js/tinymce/plugins/paste/pasteword.htm @@ -17,11 +17,11 @@
    - +
    - +
    diff --git a/wp-includes/js/tinymce/plugins/safari/editor_plugin.js b/wp-includes/js/tinymce/plugins/safari/editor_plugin.js index dc8f95882..55c9adc24 100644 --- a/wp-includes/js/tinymce/plugins/safari/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/safari/editor_plugin.js @@ -1,401 +1 @@ -/** - * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray, isOldWebKit = tinymce.isOldWebKit; - - tinymce.create('tinymce.plugins.Safari', { - init : function(ed) { - var t = this, dom; - - // Ignore on non webkit - if (!tinymce.isWebKit) - return; - - t.editor = ed; - t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; - t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; - - // Safari will crash if the build in createlink command is used -/* ed.addCommand('CreateLink', function(u, v) { - ed.execCommand("mceInsertContent", false, '' + ed.selection.getContent() + ''); - });*/ - - // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004 - ed.addCommand('FormatBlock', function(u, v) { - var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock); - - if (e) - dom.replace(dom.create(v), e, 1); - else - ed.getDoc().execCommand("FormatBlock", false, v); - }); - - // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382 - ed.addCommand('mceInsertContent', function(u, v) { - ed.getDoc().execCommand("InsertText", false, 'mce_marker'); - ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, v + 'XX'); - ed.selection.select(ed.dom.get('_mce_tmp')); - ed.getDoc().execCommand("Delete", false, ' '); - }); - - // Workaround for List ID bug, http://bugs.webkit.org/show_bug.cgi?id=16004 -/* function addList(c) { - var cb = Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) { - e = e.target; - - if (e.nodeName == 'OL' || e.nodeName == 'UL') - e.id = ''; - }); - - ed.getDoc().execCommand(c, false, false); - Event.remove(ed.getDoc(), 'DOMNodeInserted', cb); - }; - - ed.addCommand('InsertUnorderedList', function() {addList('InsertUnorderedList');}); - ed.addCommand('InsertOrderedList', function() {addList('InsertOrderedList');});*/ - - // Safari returns incorrect values - ed.addQueryValueHandler('FontSize', function(u, v) { - var e, v; - - // Check for the real font size at the start of selection - if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontSize)) - return tinymce.inArray(t.namedFontSizes, v) + 1; - - // Check for the real font size at the end of selection - if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontSize)) - return tinymce.inArray(t.namedFontSizes, v) + 1; - - // Return default value it's better than nothing right! - return ed.getDoc().queryCommandValue('FontSize'); - }); - - // Safari returns incorrect values - ed.addQueryValueHandler('FontName', function(u, v) { - var e, v; - - // Check for the real font name at the start of selection - if ((e = ed.dom.getParent(ed.selection.getStart(), 'span')) && (v = e.style.fontFamily)) - return v.replace(/, /g, ','); - - // Check for the real font name at the end of selection - if ((e = ed.dom.getParent(ed.selection.getEnd(), 'span')) && (v = e.style.fontFamily)) - return v.replace(/, /g, ','); - - // Return default value it's better than nothing right! - return ed.getDoc().queryCommandValue('FontName'); - }); - - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName == 'IMG') { - t.selElm = e; - ed.selection.select(e); - } else - t.selElm = null; - }); - - ed.onBeforeExecCommand.add(function(ed, c, b) { - var r = t.bookmarkRng; - - // Restore selection - if (r) { - ed.selection.setRng(r); - t.bookmarkRng = null; - //console.debug('restore', r.startContainer, r.startOffset, r.endContainer, r.endOffset); - } - }); - - ed.onInit.add(function() { - t._fixWebKitSpans(); - - ed.windowManager.onOpen.add(function() { - var r = ed.selection.getRng(); - - // Store selection if valid - if (r.startContainer != ed.getDoc()) { - t.bookmarkRng = r.cloneRange(); - //console.debug('store', r.startContainer, r.startOffset, r.endContainer, r.endOffset); - } - }); - - ed.windowManager.onClose.add(function() { - t.bookmarkRng = null; - }); - - if (isOldWebKit) - t._patchSafari2x(ed); - }); - - ed.onSetContent.add(function() { - dom = ed.dom; - - // Convert strong,b,em,u,strike to spans - each(['strong','b','em','u','strike','sub','sup','a'], function(v) { - each(grep(dom.select(v)).reverse(), function(n) { - var nn = n.nodeName.toLowerCase(), st; - - // Convert anchors into images - if (nn == 'a') { - if (n.name) - dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n); - - return; - } - - switch (nn) { - case 'b': - case 'strong': - if (nn == 'b') - nn = 'strong'; - - st = 'font-weight: bold;'; - break; - - case 'em': - st = 'font-style: italic;'; - break; - - case 'u': - st = 'text-decoration: underline;'; - break; - - case 'sub': - st = 'vertical-align: sub;'; - break; - - case 'sup': - st = 'vertical-align: super;'; - break; - - case 'strike': - st = 'text-decoration: line-through;'; - break; - } - - dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1); - }); - }); - }); - - ed.onPreProcess.add(function(ed, o) { - dom = ed.dom; - - each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) { - var v, bg; - - if (o.get) { - if (dom.hasClass(n, 'Apple-style-span')) { - bg = n.style.backgroundColor; - - switch (dom.getAttrib(n, 'mce_name')) { - case 'font': - if (!ed.settings.convert_fonts_to_spans) - dom.setAttrib(n, 'style', ''); - break; - - case 'strong': - case 'em': - case 'sub': - case 'sup': - dom.setAttrib(n, 'style', ''); - break; - - case 'strike': - case 'u': - if (!ed.settings.inline_styles) - dom.setAttrib(n, 'style', ''); - else - dom.setAttrib(n, 'mce_name', ''); - - break; - - default: - if (!ed.settings.inline_styles) - dom.setAttrib(n, 'style', ''); - } - - - if (bg) - n.style.backgroundColor = bg; - } - } - - if (dom.hasClass(n, 'mceItemRemoved')) - dom.remove(n, 1); - }); - }); - - ed.onPostProcess.add(function(ed, o) { - // Safari adds BR at end of all block elements - o.content = o.content.replace(/
    <\/(h[1-6]|div|p|address|pre)>/g, ''); - - // Safari adds id="undefined" to HR elements - o.content = o.content.replace(/ id=\"undefined\"/g, ''); - }); - }, - - _fixWebKitSpans : function() { - var t = this, ed = t.editor; - - if (!isOldWebKit) { - // Use mutator events on new WebKit - Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) { - e = e.target; - - if (e && e.nodeType == 1) - t._fixAppleSpan(e); - }); - } else { - // Do post command processing in old WebKit since the browser crashes on Mutator events :( - ed.onExecCommand.add(function() { - each(ed.dom.select('span'), function(n) { - t._fixAppleSpan(n); - }); - - ed.nodeChanged(); - }); - } - }, - - _fixAppleSpan : function(e) { - var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p; - - if (dom.getAttrib(e, 'mce_fixed')) - return; - - // Handle Apple style spans - if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') { - st = e.style; - - if (!s.convert_fonts_to_spans) { - if (st.fontSize) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1); - } - - if (st.fontFamily) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setAttrib(e, 'face', st.fontFamily); - } - - if (st.color) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setAttrib(e, 'color', dom.toHex(st.color)); - } - - if (st.backgroundColor) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setStyle(e, 'background-color', st.backgroundColor); - } - } else { - if (st.fontSize) - dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]); - } - - if (st.fontWeight == 'bold') - dom.setAttrib(e, 'mce_name', 'strong'); - - if (st.fontStyle == 'italic') - dom.setAttrib(e, 'mce_name', 'em'); - - if (st.textDecoration == 'underline') - dom.setAttrib(e, 'mce_name', 'u'); - - if (st.textDecoration == 'line-through') - dom.setAttrib(e, 'mce_name', 'strike'); - - if (st.verticalAlign == 'super') - dom.setAttrib(e, 'mce_name', 'sup'); - - if (st.verticalAlign == 'sub') - dom.setAttrib(e, 'mce_name', 'sub'); - - dom.setAttrib(e, 'mce_fixed', '1'); - } - }, - - _patchSafari2x : function(ed) { - var t = this, setContent, getNode, dom = ed.dom, lr; - - // Inline dialogs - if (ed.windowManager.onBeforeOpen) { - ed.windowManager.onBeforeOpen.add(function() { - r = ed.selection.getRng(); - }); - } - - // Fake select on 2.x - ed.selection.select = function(n) { - this.getSel().setBaseAndExtent(n, 0, n, 1); - }; - - getNode = ed.selection.getNode; - ed.selection.getNode = function() { - return t.selElm || getNode.call(this); - }; - - // Fake range on Safari 2.x - ed.selection.getRng = function() { - var t = this, s = t.getSel(), d = ed.getDoc(), r, rb, ra, di; - - // Fake range on Safari 2.x - if (s.anchorNode) { - r = d.createRange(); - - try { - // Setup before range - rb = d.createRange(); - rb.setStart(s.anchorNode, s.anchorOffset); - rb.collapse(1); - - // Setup after range - ra = d.createRange(); - ra.setStart(s.focusNode, s.focusOffset); - ra.collapse(1); - - // Setup start/end points by comparing locations - di = rb.compareBoundaryPoints(rb.START_TO_END, ra) < 0; - r.setStart(di ? s.anchorNode : s.focusNode, di ? s.anchorOffset : s.focusOffset); - r.setEnd(di ? s.focusNode : s.anchorNode, di ? s.focusOffset : s.anchorOffset); - - lr = r; - } catch (ex) { - // Sometimes fails, at least we tried to do it by the book. I hope Safari 2.x will go disappear soooon!!! - } - } - - return r || lr; - }; - - // Fix setContent so it works - setContent = ed.selection.setContent; - ed.selection.setContent = function(h, s) { - var r = this.getRng(), b; - - try { - setContent.call(this, h, s); - } catch (ex) { - // Workaround for Safari 2.x - b = dom.create('body'); - b.innerHTML = h; - - each(b.childNodes, function(n) { - r.insertNode(n.cloneNode(true)); - }); - } - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('safari', tinymce.plugins.Safari); -})(); - +(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'XX');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){if(e.keyCode==13&&e.shiftKey){t._insertBR(ed);Event.cancel(e);}});ed.addQueryValueHandler('FontSize',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontSize))return tinymce.inArray(t.namedFontSizes,v)+1;return ed.getDoc().queryCommandValue('FontSize');});ed.addQueryValueHandler('FontName',function(u,v){var e,v;if((e=ed.dom.getParent(ed.selection.getStart(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');if((e=ed.dom.getParent(ed.selection.getEnd(),'span'))&&(v=e.style.fontFamily))return v.replace(/, /g,',');return ed.getDoc().queryCommandValue('FontName');});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onBeforeExecCommand.add(function(ed,c,b){var r=t.bookmarkRng;if(r){ed.selection.setRng(r);t.bookmarkRng=null;}});ed.onInit.add(function(){t._fixWebKitSpans();ed.windowManager.onOpen.add(function(){var r=ed.selection.getRng();if(r.startContainer!=ed.getDoc()){t.bookmarkRng=r.cloneRange();}});ed.windowManager.onClose.add(function(){t.bookmarkRng=null;});if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/
    <\/(h[1-6]|div|p|address|pre)>/g,'');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wordpress/css/content.css b/wp-includes/js/tinymce/plugins/wordpress/css/content.css new file mode 100644 index 000000000..a542e6e05 --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wordpress/css/content.css @@ -0,0 +1,15 @@ + +.mceWPnextpage, .mceWPmore { + border: 0px; + border-top: 1px dotted #cccccc; + display: block; + width: 100%; + height: 12px; + margin-top: 15px; +} +.mceWPmore { + background: #ffffff url(../img/more_bug.gif) no-repeat right top; +} +.mceWPnextpage { + background: #ffffff url(../img/page_bug.gif) no-repeat right top; +} \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index 6708faae3..6851c54fe 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -1,616 +1,153 @@ -/* Import plugin specific language pack */ -//tinyMCE.importPluginLanguagePack('wordpress', 'en'); +/** + * Wordpress plugin. + */ -var TinyMCE_wordpressPlugin = { - getInfo : function() { - return { - longname : 'WordPress Plugin', - author : 'WordPress', - authorurl : 'http://wordpress.org', - infourl : 'http://wordpress.org', - version : '1' - }; - }, +(function() { + var DOM = tinymce.DOM; - getControlHTML : function(control_name) { - switch (control_name) { - case "wp_more": - return tinyMCE.getButtonHTML(control_name, 'lang_wordpress_more_button', '{$pluginurl}/images/more.gif', 'wpMore'); - case "wp_page": - return tinyMCE.getButtonHTML(control_name, 'lang_wordpress_page_button', '{$pluginurl}/images/page.gif', 'wpPage'); - case "wp_help": - var buttons = tinyMCE.getButtonHTML(control_name, 'lang_help_button_title', '{$pluginurl}/images/help.gif', 'wpHelp'); - var hiddenControls = '
    ' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '' - + '
    '; - return buttons+hiddenControls; - case "wp_adv": - return tinyMCE.getButtonHTML(control_name, 'lang_wordpress_adv_button', '{$pluginurl}/images/toolbars.gif', 'wpAdv'); - case "wp_adv_start": - return ''; - } - return ''; - }, + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('wordpress'); - execCommand : function(editor_id, element, command, user_interface, value) { - var inst = tinyMCE.getInstanceById(editor_id); - var focusElm = inst.getFocusElement(); - var doc = inst.getDoc(); + tinymce.create('tinymce.plugins.WordPress', { + init : function(ed, url) { + var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'); + var moreHTML = ''; + var nextpageHTML = ''; - function getAttrib(elm, name) { - return elm.getAttribute(name) ? elm.getAttribute(name) : ""; - } + // Hides the specified toolbar and resizes the iframe + ed.onPostRender.add(function() { + DOM.hide(ed.controlManager.get(tbId).id); + t._resizeIframe(ed, tbId, 28); + }); - // Handle commands - switch (command) { - case "wpMore": - var flag = ""; - var template = new Array(); - var altMore = tinyMCE.getLang('lang_wordpress_more_alt'); - - // Is selection a image - if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") { - flag = getAttrib(focusElm, 'class'); - - if (flag != 'mce_plugin_wordpress_more') // Not a wordpress - return true; - - action = "update"; + // Register buttons + ed.addButton('wp_more', { + title : 'wordpress.wp_more_desc', + image : url + '/img/more.gif', + onclick : function() { + ed.execCommand('mceInsertContent', 0, moreHTML); } + }); - html = '' - + ''; - tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, html); - tinyMCE.selectedInstance.repaint(); - return true; - - case "wpPage": - var flag = ""; - var template = new Array(); - var altPage = tinyMCE.getLang('lang_wordpress_more_alt'); - - // Is selection a image - if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") { - flag = getAttrib(focusElm, 'name'); - - if (flag != 'mce_plugin_wordpress_page') // Not a wordpress - return true; - - action = "update"; + ed.addButton('wp_page', { + title : 'wordpress.wp_page_desc', + image : url + '/img/page.gif', + onclick : function() { + // ed.execCommand('mcePageBreak'); + ed.execCommand('mceInsertContent', 0, nextpageHTML); } + }); - html = '' - + ''; - tinyMCE.execCommand("mceInsertContent",true,html); - tinyMCE.selectedInstance.repaint(); - return true; - - case "wpHelp": - var template = new Array(); - - template['file'] = tinyMCE.baseURL + '/wp-mce-help.php'; - template['width'] = 480; - template['height'] = 380; - - args = { - resizable : 'yes', - scrollbars : 'yes' - }; - - tinyMCE.openWindow(template, args); - return true; - case "wpAdv": - var adv = document.getElementById('wpadvbar'); - if ( adv.style.display == 'none' ) { - adv.style.display = 'block'; - tinyMCE.switchClass(editor_id + '_wp_adv', 'mceButtonSelected'); - } else { - adv.style.display = 'none'; - tinyMCE.switchClass(editor_id + '_wp_adv', 'mceButtonNormal'); + ed.addButton('wp_help', { + title : 'wordpress.wp_help_desc', + image : url + '/img/help.gif', + onclick : function() { + ed.windowManager.open({ + url : tinymce.baseURL + '/wp-mce-help.php', + width : 450, + height : 420, + inline : 1 + }); } - return true; - } + }); - // Pass to next handler in chain - return false; - }, + ed.addButton('wp_adv', { + title : 'wordpress.wp_adv_desc', + image : url + '/img/toolbars.gif', + onclick : function() { + var id = ed.controlManager.get(tbId).id, cm = ed.controlManager; - cleanup : function(type, content) { - switch (type) { - - case "insert_to_editor": - var startPos = 0; - var altMore = tinyMCE.getLang('lang_wordpress_more_alt'); - var altPage = tinyMCE.getLang('lang_wordpress_page_alt'); - - // Parse all tags and replace them with images - while ((startPos = content.indexOf('', startPos) + 3; - // Insert image - var moreText = content.substring(startPos + 8, endPos - 3); - var contentAfter = content.substring(endPos); - content = content.substring(0, startPos); - content += ''; - content += contentAfter; - - startPos++; - } - var startPos = 0; - - // Parse all tags and replace them with images - while ((startPos = content.indexOf('', startPos)) != -1) { - // Insert image - var contentAfter = content.substring(startPos + 15); - content = content.substring(0, startPos); - content += ''; - content += contentAfter; - - startPos++; - } - - // Look for \n in
    , replace with 
    - var startPos = -1; - while ((startPos = content.indexOf('', startPos+1); - var innerPos = content.indexOf('>', startPos+1); - var chunkBefore = content.substring(0, innerPos); - var chunkAfter = content.substring(endPos); - - var innards = content.substring(innerPos, endPos); - innards = innards.replace(/\n/g, '
    '); - content = chunkBefore + innards + chunkAfter; - } - - break; - - case "get_from_editor": - // Parse all img tags and replace them with - var startPos = -1; - while ((startPos = content.indexOf('', startPos); - var attribs = this._parseAttributes(content.substring(startPos + 4, endPos)); - - if (attribs['class'] == "mce_plugin_wordpress_more" || attribs['name'] == "mce_plugin_wordpress_more") { - endPos += 2; - - var moreText = attribs['moretext'] ? attribs['moretext'] : ''; - var embedHTML = ''; - - // Insert embed/object chunk - chunkBefore = content.substring(0, startPos); - chunkAfter = content.substring(endPos); - content = chunkBefore + embedHTML + chunkAfter; - } - if (attribs['class'] == "mce_plugin_wordpress_page" || attribs['name'] == "mce_plugin_wordpress_page") { - endPos += 2; - - var embedHTML = ''; - - // Insert embed/object chunk - chunkBefore = content.substring(0, startPos); - chunkAfter = content.substring(endPos); - content = chunkBefore + embedHTML + chunkAfter; + if (DOM.isHidden(id)) { + cm.setActive('wp_adv', 1); + DOM.show(id); + t._resizeIframe(ed, tbId, -28); + } else { + cm.setActive('wp_adv', 0); + DOM.hide(id); + t._resizeIframe(ed, tbId, 28); } } + }); - // Remove normal line breaks - content = content.replace(/\n|\r/g, ' '); + // Add listeners to handle more break + t._handleMoreBreak(ed, url); + }, - // Look for
    in
    , replace with \n
    -				var startPos = -1;
    -				while ((startPos = content.indexOf('', startPos+1);
    -					var innerPos = content.indexOf('>', startPos+1);
    -					var chunkBefore = content.substring(0, innerPos);
    -					var chunkAfter = content.substring(endPos);
    -					
    -					var innards = content.substring(innerPos, endPos);
    -					innards = innards.replace(new RegExp('', 'g'), '\n');
    -					innards = innards.replace(new RegExp('\\s$', ''), '');
    -					content = chunkBefore + innards + chunkAfter;
    +		getInfo : function() {
    +			return {
    +				longname : 'WordPress Plugin',
    +				author : 'WordPress', // add Moxiecode?
    +				authorurl : 'http://wordpress.org',
    +				infourl : 'http://wordpress.org',
    +				version : '1.0a1'
    +			};
    +		},
    +
    +		// Internal functions
    +
    +		// Resizes the iframe by a relative height value
    +		_resizeIframe : function(ed, tb_id, dy) {
    +			var ifr = ed.getContentAreaContainer().firstChild;
    +
    +			DOM.setStyle(ifr, 'height', ifr.clientHeight + dy); // Resize iframe
    +			ed.theme.deltaHeight += dy; // For resize cookie
    +		},
    +
    +		_handleMoreBreak : function(ed, url) {
    +			var moreHTML = '$1';
    +            var nextpageHTML = '';
    +
    +			// Load plugin specific CSS into editor
    +			ed.onInit.add(function() {
    +				ed.dom.loadCSS(url + '/css/content.css');
    +			});
    +
    +			// Display morebreak instead if img in element path
    +			ed.onPostRender.add(function() {
    +				if (ed.theme.onResolveName) {
    +					ed.theme.onResolveName.add(function(th, o) {
    +						if (o.node.nodeName == 'IMG') {
    +                            if ( ed.dom.hasClass(o.node, 'mceWPmore') )
    +                                o.name = 'wpmore';
    +                            if ( ed.dom.hasClass(o.node, 'mceWPnextpage') )
    +                                o.name = 'wppage';
    +                        }
    +							
    +					});
     				}
    +			});
     
    -				// Remove anonymous, empty paragraphs.
    -				content = content.replace(new RegExp('

    (\\s| )*

    ', 'mg'), ''); + // Replace morebreak with images + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(//g, moreHTML); + o.content = o.content.replace(//g, nextpageHTML); + }); - // Handle table badness. - content = content.replace(new RegExp('<(table( [^>]*)?)>.*?<((tr|thead)( [^>]*)?)>', 'mg'), '<$1><$3>'); - content = content.replace(new RegExp('<((?:tr|thead|tfoot)(?: [^>]*)?)>.*?<((td|th)( [^>]*)?)>', 'mg'), '<$1><$2>'); - content = content.replace(new RegExp('.*?<(td( [^>]*)?|th( [^>]*)?|/tr|/thead|/tfoot)>', 'mg'), '<$2>'); - content = content.replace(new RegExp('.*?<(tr( [^>]*)?|/table)>', 'mg'), '<$1>'); - content = content.replace(new RegExp('<(/?(table|tbody|tr|th|td)[^>]*)>(\\s*|(
    )*)*', 'g'), '<$1>'); + // Replace images with morebreak + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = o.content.replace(/]+>/g, function(im) { + if (im.indexOf('class="mceWPmore') !== -1) { + var m; + var moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : ''; - // Pretty it up for the source editor. - var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre|p'; - content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); - content = content.replace(new RegExp('\\s*<(('+blocklist+')[^>]*)>', 'mg'), '\n<$1>'); - content = content.replace(new RegExp('<((li|/?tr|/?thead|/?tfoot)( [^>]*)?)>', 'g'), '\t<$1>'); - content = content.replace(new RegExp('<((td|th)( [^>]*)?)>', 'g'), '\t\t<$1>'); - content = content.replace(new RegExp('\\s*
    \\s*', 'mg'), '
    \n'); - content = content.replace(new RegExp('^\\s*', ''), ''); - content = content.replace(new RegExp('\\s*$', ''), ''); + im = ''; + } + if (im.indexOf('class="mceWPnextpage') !== -1) + im = ''; + + return im; + }); + }); - break; + // Set active buttons if user selected pagebreak or more break + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPnextpage')); + cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPmore')); + }); } + }); - // Pass through to next handler in chain - return content; - }, - - handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - - tinyMCE.switchClass(editor_id + '_wp_more', 'mceButtonNormal'); - tinyMCE.switchClass(editor_id + '_wp_page', 'mceButtonNormal'); - - if (node == null) - return; - - do { - if (node.nodeName.toLowerCase() == "img" && tinyMCE.getAttrib(node, 'class').indexOf('mce_plugin_wordpress_more') == 0) - tinyMCE.switchClass(editor_id + '_wp_more', 'mceButtonSelected'); - if (node.nodeName.toLowerCase() == "img" && tinyMCE.getAttrib(node, 'class').indexOf('mce_plugin_wordpress_page') == 0) - tinyMCE.switchClass(editor_id + '_wp_page', 'mceButtonSelected'); - } while ((node = node.parentNode)); - - return true; - }, - - saveCallback : function(el, content, body) { - // We have a TON of cleanup to do. - - if ( tinyMCE.activeEditor.isHidden() ) { - // return content; - } - - // Mark

    if it has any attributes. - content = content.replace(new RegExp('(]+>.*?)

    ', 'mg'), '$1'); - - // Decode the ampersands of time. - // content = content.replace(new RegExp('&', 'g'), '&'); - - // Get it ready for wpautop. - content = content.replace(new RegExp('\\s*

    ', 'mgi'), ''); - content = content.replace(new RegExp('\\s*

    \\s*', 'mgi'), '\n\n'); - content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n'); - content = content.replace(new RegExp('\\s*
    \\s*', 'gi'), '\n'); - - // Fix some block element newline issues - var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre'; - content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>'); - content = content.replace(new RegExp('\\s*\\s*', 'mg'), '\n'); - content = content.replace(new RegExp('
  • ', 'g'), '\t
  • '); - - if ( content.indexOf(']*)>\\s*', 'g'), ""); // no pee inside object/embed - content = content.replace(new RegExp('\\s*\\s*', 'g'), ''); - } - - // Unmark special paragraph closing tags - content = content.replace(new RegExp('', 'g'), '

    \n'); - content = content.replace(new RegExp('\\s*(]+>.*

    )', 'mg'), '\n$1'); - - // Trim trailing whitespace - content = content.replace(new RegExp('\\s*$', ''), ''); - - // Hope. - return content; - - }, - - _parseAttributes : function(attribute_string) { - var attributeName = ""; - var attributeValue = ""; - var withInName; - var withInValue; - var attributes = new Array(); - var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g'); - var titleText = tinyMCE.getLang('lang_wordpress_more'); - var titleTextPage = tinyMCE.getLang('lang_wordpress_page'); - - if (attribute_string == null || attribute_string.length < 2) - return null; - - withInName = withInValue = false; - - for (var i=0; i
  • !ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '
    ' "); // Hmm... - return pee; -} + // Register plugin + tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress); +})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/help.gif b/wp-includes/js/tinymce/plugins/wordpress/img/help.gif new file mode 100644 index 000000000..51a1ee420 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wordpress/img/help.gif differ diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/more.gif b/wp-includes/js/tinymce/plugins/wordpress/img/more.gif new file mode 100644 index 000000000..4ff564d58 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wordpress/img/more.gif differ diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif b/wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif new file mode 100644 index 000000000..4589cb4dc Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif differ diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/page.gif b/wp-includes/js/tinymce/plugins/wordpress/img/page.gif new file mode 100644 index 000000000..1cea78ac2 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wordpress/img/page.gif differ diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif b/wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif new file mode 100644 index 000000000..9ea356569 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif differ diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif b/wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif new file mode 100644 index 000000000..dcb70665f Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif differ diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif b/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif new file mode 100644 index 000000000..388486517 Binary files /dev/null and b/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif differ diff --git a/wp-includes/js/tinymce/plugins/wordpress/langs/en.js b/wp-includes/js/tinymce/plugins/wordpress/langs/en.js index 8002252a6..b7acfb573 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/langs/en.js +++ b/wp-includes/js/tinymce/plugins/wordpress/langs/en.js @@ -1,37 +1,8 @@ -// EN lang variables - -if (navigator.userAgent.indexOf('Mac OS') != -1) { -// Mac OS browsers use Ctrl to hit accesskeys - var metaKey = 'Ctrl'; -} -else if (navigator.userAgent.indexOf('Firefox/2') != -1) { -// Firefox 2.x uses Alt+Shift to hit accesskeys - var metaKey = 'Alt+Shift'; -} -else { - var metaKey = 'Alt'; -} - -tinyMCE.addI18n('',{ -wordpress_more_button : 'Split post with More tag (' + metaKey + '+t)', -wordpress_page_button : 'Split post with Page tag', -wordpress_adv_button : 'Show/Hide Advanced Toolbar (' + metaKey + '+v)', -wordpress_more_alt : 'More...', -wordpress_page_alt : '...page...', -help_button_title : 'Help (' + metaKey + '+h)', -bold_desc : 'Bold (Ctrl+B)', -italic_desc : 'Italic (Ctrl+I)', -underline_desc : 'Underline (Ctrl+U)', -link_desc : 'Insert/edit link (' + metaKey + '+a)', -unlink_desc : 'Unlink (' + metaKey + '+s)', -image_desc : 'Insert/edit image (' + metaKey + '+m)', -striketrough_desc : 'Strikethrough (' + metaKey + '+k)', -justifyleft_desc : 'Align left (' + metaKey + '+f)', -justifycenter_desc : 'Align center (' + metaKey + '+c)', -justifyright_desc : 'Align right (' + metaKey + '+r)', -justifyfull_desc : 'Align full (' + metaKey + '+j)', -bullist_desc : 'Unordered list (' + metaKey + '+l)', -numlist_desc : 'Ordered list (' + metaKey + '+o)', -outdent_desc : 'Outdent (' + metaKey + '+w)', -indent_desc : 'Indent list/blockquote (' + metaKey + '+q)' -}); +tinyMCE.addI18n('en.wordpress',{ +wp_adv_desc : 'Show/Hide Advanced Toolbar', +wp_more_desc : 'Split post with More tag', +wp_page_desc : 'Split post with Page tag', +wp_help_desc : 'Help', +wp_more_alt : 'More...', +wp_page_alt : 'Next page...' +}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/themes/advanced/anchor.htm b/wp-includes/js/tinymce/themes/advanced/anchor.htm index c1c37b043..eccdbe784 100644 --- a/wp-includes/js/tinymce/themes/advanced/anchor.htm +++ b/wp-includes/js/tinymce/themes/advanced/anchor.htm @@ -2,9 +2,10 @@ {#advanced_dlg.anchor_title} - + - + +
    @@ -20,11 +21,11 @@
    - +
    - +
    diff --git a/wp-includes/js/tinymce/themes/advanced/charmap.htm b/wp-includes/js/tinymce/themes/advanced/charmap.htm index 933383693..e8ee183ca 100644 --- a/wp-includes/js/tinymce/themes/advanced/charmap.htm +++ b/wp-includes/js/tinymce/themes/advanced/charmap.htm @@ -7,7 +7,7 @@ - +
    diff --git a/wp-includes/js/tinymce/themes/advanced/editor_template.js b/wp-includes/js/tinymce/themes/advanced/editor_template.js index a3e5730c9..4a62ae7bd 100644 --- a/wp-includes/js/tinymce/themes/advanced/editor_template.js +++ b/wp-includes/js/tinymce/themes/advanced/editor_template.js @@ -1,992 +1 @@ -/** - * $Id: editor_template_src.js 520 2008-01-07 16:30:32Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('advanced'); - - tinymce.create('tinymce.themes.AdvancedTheme', { - // Control name lookup, format: title, command - controls : { - bold : ['bold_desc', 'Bold'], - italic : ['italic_desc', 'Italic'], - underline : ['underline_desc', 'Underline'], - strikethrough : ['striketrough_desc', 'Strikethrough'], - justifyleft : ['justifyleft_desc', 'JustifyLeft'], - justifycenter : ['justifycenter_desc', 'JustifyCenter'], - justifyright : ['justifyright_desc', 'JustifyRight'], - justifyfull : ['justifyfull_desc', 'JustifyFull'], - bullist : ['bullist_desc', 'InsertUnorderedList'], - numlist : ['numlist_desc', 'InsertOrderedList'], - outdent : ['outdent_desc', 'Outdent'], - indent : ['indent_desc', 'Indent'], - cut : ['cut_desc', 'Cut'], - copy : ['copy_desc', 'Copy'], - paste : ['paste_desc', 'Paste'], - undo : ['undo_desc', 'Undo'], - redo : ['redo_desc', 'Redo'], - link : ['link_desc', 'mceLink'], - unlink : ['unlink_desc', 'unlink'], - image : ['image_desc', 'mceImage'], - cleanup : ['cleanup_desc', 'mceCleanup'], - help : ['help_desc', 'mceHelp'], - code : ['code_desc', 'mceCodeEditor'], - hr : ['hr_desc', 'InsertHorizontalRule'], - removeformat : ['removeformat_desc', 'RemoveFormat'], - sub : ['sub_desc', 'subscript'], - sup : ['sup_desc', 'superscript'], - forecolor : ['forecolor_desc', 'ForeColor'], - forecolorpicker : ['forecolor_desc', 'mceForeColor'], - backcolor : ['backcolor_desc', 'HiliteColor'], - backcolorpicker : ['backcolor_desc', 'mceBackColor'], - charmap : ['charmap_desc', 'mceCharMap'], - visualaid : ['visualaid_desc', 'mceToggleVisualAid'], - anchor : ['anchor_desc', 'mceInsertAnchor'], - newdocument : ['newdocument_desc', 'mceNewDocument'], - blockquote : ['blockquote_desc', 'mceBlockQuote'] - }, - - stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], - - init : function(ed, url) { - var t = this, s; - - t.editor = ed; - t.url = url; - t.onResolveName = new tinymce.util.Dispatcher(this); - - // Default settings - t.settings = s = extend({ - theme_advanced_path : true, - theme_advanced_toolbar_location : 'bottom', - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", - theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", - theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", - theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", - theme_advanced_toolbar_align : "center", - theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", - theme_advanced_font_sizes : "1,2,3,4,5,6,7", - theme_advanced_more_colors : 1, - theme_advanced_row_height : 23, - theme_advanced_resize_horizontal : 1, - theme_advanced_resizing_use_cookie : 1 - }, ed.settings); - - if (s.theme_advanced_statusbar_location == 'none') - s.theme_advanced_statusbar_location = 0; - - // Init editor - ed.onInit.add(function() { - ed.onNodeChange.add(t._nodeChanged, t); - ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css")); - }); - - ed.onSetProgressState.add(function(ed, b, ti) { - var co, id = ed.id, tb; - - if (b) { - t.progressTimer = setTimeout(function() { - co = ed.getContainer(); - co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); - tb = DOM.get(ed.id + '_tbl'); - - DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); - DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); - }, ti || 0); - } else { - DOM.remove(id + '_blocker'); - DOM.remove(id + '_progress'); - clearTimeout(t.progressTimer); - } - }); - - DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css || "themes/advanced/skins/" + ed.settings.skin + "/ui.css")); - }, - - createControl : function(n, cf) { - var cd, c; - - if (c = cf.createControl(n)) - return c; - - switch (n) { - case "styleselect": - return this._createStyleSelect(); - - case "formatselect": - return this._createBlockFormats(); - - case "fontselect": - return this._createFontSelect(); - - case "fontsizeselect": - return this._createFontSizeSelect(); - - case "forecolor": - return this._createForeColorMenu(); - - case "backcolor": - return this._createBackColorMenu(); - } - - if ((cd = this.controls[n])) - return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); - }, - - execCommand : function(cmd, ui, val) { - var f = this['_' + cmd]; - - if (f) { - f.call(this, ui, val); - return true; - } - - return false; - }, - - _importClasses : function() { - var ed = this.editor, c = ed.controlManager.get('styleselect'); - - if (c.getLength() == 0) { - each(ed.dom.getClasses(), function(o) { - c.add(o['class'], o['class']); - }); - } - }, - - _createStyleSelect : function(n) { - var t = this, ed = t.editor, cf = ed.controlManager, c = cf.createListBox('styleselect', { - title : 'advanced.style_select', - onselect : function(v) { - if (c.selectedValue === v) { - ed.execCommand('mceSetStyleInfo', 0, {command : 'removeformat'}); - c.select(); - return false; - } else - ed.execCommand('mceSetCSSClass', 0, v); - } - }); - - each((t.settings.theme_advanced_styles || '').split(';'), function(v) { - var p = v.split('='); - - if (v) - c.add(t.editor.translate(p[0]), p[1]); - }); - - c.onPostRender.add(function(ed, n) { - Event.add(n, 'focus', t._importClasses, t); - Event.add(n, 'mousedown', t._importClasses, t); - }); - - return c; - }, - - _createFontSelect : function() { - var c, t = this; - - c = t.editor.controlManager.createListBox('fontselect', {title : 'advanced.fontdefault', cmd : 'FontName'}); - - each(t.settings.theme_advanced_fonts.split(';'), function(v) { - var p = v.split('='), st; - - if (p[1].indexOf('dings') == -1) - st = 'font-family:' + p[1]; - - c.add(t.editor.translate(p[0]), p[1], {style : st}); - }); - - return c; - }, - - _createFontSizeSelect : function() { - var c, t = this, lo = [ - "1 (8 pt)", - "2 (10 pt)", - "3 (12 pt)", - "4 (14 pt)", - "5 (18 pt)", - "6 (24 pt)", - "7 (36 pt)" - ], fz = [8, 10, 12, 14, 18, 24, 36]; - - c = t.editor.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', cmd : 'FontSize'}); - - each(t.settings.theme_advanced_font_sizes.split(','), function(v) { - c.add(lo[parseInt(v) - 1], v, {'style' : 'font-size:' + fz[v - 1] + 'pt', 'class' : 'fontSize' + v}); - }); - - return c; - }, - - _createBlockFormats : function() { - var c, fmts = { - p : 'advanced.paragraph', - address : 'advanced.address', - pre : 'advanced.pre', - h1 : 'advanced.h1', - h2 : 'advanced.h2', - h3 : 'advanced.h3', - h4 : 'advanced.h4', - h5 : 'advanced.h5', - h6 : 'advanced.h6', - div : 'advanced.div', - blockquote : 'advanced.blockquote', - code : 'advanced.code', - dt : 'advanced.dt', - dd : 'advanced.dd', - samp : 'advanced.samp' - }, t = this; - - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'}); - - each(t.settings.theme_advanced_blockformats.split(','), function(v) { - c.add(t.editor.translate(fmts[v]), v, {element : v, 'class' : v.indexOf('h') == 0 ? '' : 'preview'}); - }); - - return c; - }, - - _createForeColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_text_colors) - o.colors = v; - - o.title = 'advanced.forecolor_desc'; - o.cmd = 'ForeColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('forecolor', o); - - return c; - }, - - _createBackColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_background_colors) - o.colors = v; - - o.title = 'advanced.backcolor_desc'; - o.cmd = 'HiliteColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('backcolor', o); - - return c; - }, - - renderUI : function(o) { - var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - - n = p = DOM.create('div', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin'}); - - if (!DOM.boxModel) - n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - - n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); - n = tb = DOM.add(n, 'tbody'); - - switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { - case "rowlayout": - ic = t._rowLayout(s, tb, o); - break; - - case "customlayout": - ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); - break; - - default: - ic = t._simpleLayout(s, tb, o, p); - } - - n = o.targetNode; - - // Add classes to first and last TRs - nl = sc.rows; - DOM.addClass(nl[0], 'first'); - DOM.addClass(nl[nl.length - 1], 'last'); - - // Add classes to first and last TDs - each(DOM.select('tr', tb), function(n) { - DOM.addClass(n.firstChild, 'first'); - DOM.addClass(n.childNodes[n.childNodes.length - 1], 'last'); - }); - - if (DOM.get(s.theme_advanced_toolbar_container)) - DOM.get(s.theme_advanced_toolbar_container).appendChild(p); - else - DOM.insertAfter(p, n); - - Event.add(ed.id + '_path_row', 'click', function(e) { - e = e.target; - - if (e.nodeName == 'A') { - t._sel(e.href.replace(/^[^#]*#/, '')); - - return Event.cancel(e); - } - }); -/* - if (DOM.get(ed.id + '_path_row')) { - Event.add(ed.id + '_tbl', 'mouseover', function(e) { - var re; - - e = e.target; - - if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { - re = DOM.get(ed.id + '_path_row'); - t.lastPath = re.innerHTML; - DOM.setHTML(re, e.parentNode.title); - } - }); - - Event.add(ed.id + '_tbl', 'mouseout', function(e) { - if (t.lastPath) { - DOM.setHTML(ed.id + '_path_row', t.lastPath); - t.lastPath = 0; - } - }); - } -*/ - if (s.theme_advanced_toolbar_location == 'external') - o.deltaHeight = 0; - - t.deltaHeight = o.deltaHeight; - o.targetNode = null; - - return { - iframeContainer : ic, - editorContainer : ed.id + '_parent', - sizeContainer : sc, - deltaHeight : o.deltaHeight - }; - }, - - getInfo : function() { - return { - longname : 'Simple theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - }, - - _simpleLayout : function(s, tb, o, p) { - var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; - - // Create toolbar container at top - if (lo == 'top') - t._addToolbars(tb, o); - - // Create external toolbar - if (lo == 'external') { - n = c = DOM.create('div', {style : 'position:relative'}); - n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); - DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); - n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); - etb = DOM.add(n, 'tbody'); - - if (p.firstChild.className == 'mceOldBoxModel') - p.firstChild.appendChild(c); - else - p.insertBefore(c, p.firstChild); - - t._addToolbars(etb, o); - - ed.onMouseUp.add(function() { - var e = DOM.get(ed.id + '_external'); - DOM.show(e); - - DOM.hide(lastExtID); - - var f = Event.add(ed.id + '_external_close', 'click', function() { - DOM.hide(ed.id + '_external'); - Event.remove(ed.id + '_external_close', 'click', f); - }); - - DOM.show(e); - DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); - - // Fixes IE rendering bug - DOM.hide(e); - DOM.show(e); - e.style.filter = ''; - - lastExtID = ed.id + '_external'; - - e = null; - }); - } - - if (sl == 'top') - t._addStatusBar(tb, o); - - // Create iframe container - if (!s.theme_advanced_toolbar_container) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - } - - // Create toolbar container at bottom - if (lo == 'bottom') - t._addToolbars(tb, o); - - if (sl == 'bottom') - t._addStatusBar(tb, o); - - return ic; - }, - - _rowLayout : function(s, tb, o) { - var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to; - - dc = s.theme_advanced_containers_default_class || ''; - da = s.theme_advanced_containers_default_align || 'center'; - - each((s.theme_advanced_containers || '').split(','), function(c, i) { - var v = s['theme_advanced_container_' + c].toLowerCase(); - - switch (v) { - case 'mceeditor': - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - break; - - case 'mceelementpath': - t._addStatusBar(tb, o); - break; - - default: - n = DOM.add(DOM.add(tb, 'tr'), 'td', { - 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc), - align : s['theme_advanced_container_' + c + '_align'] || da - }); - - to = cf.createToolbar("toolbar" + i); - t._addControls(v, to); - DOM.setHTML(n, to.renderHTML()); - o.deltaHeight -= s.theme_advanced_row_height; - } - }); - - return ic; - }, - - _addControls : function(v, tb) { - var t = this, s = t.settings, di, cf = t.editor.controlManager; - - if (s.theme_advanced_disable && !t._disabled) { - di = {}; - - each(s.theme_advanced_disable.split(','), function(v) { - di[v] = 1; - }); - - t._disabled = di; - } else - di = t._disabled; - - each(v.split(','), function(n) { - var c; - - if (di && di[n]) - return; - - // Compatiblity with 2.x - if (n == 'tablecontrols') { - each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { - n = t.createControl(n, cf); - - if (n) - tb.add(n); - }); - - return; - } - - c = t.createControl(n, cf); - - if (c) - tb.add(c); - }); - }, - - _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = []; - - n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar', align : s.theme_advanced_toolbar_align}); - - if (!ed.getParam('accessibility_focus') || ed.getParam('tab_focus')) - h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '')); - - h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '')); - - // Create toolbar and add the controls - for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { - tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); - - if (s['theme_advanced_buttons' + i + '_add']) - v += ',' + s['theme_advanced_buttons' + i + '_add']; - - if (s['theme_advanced_buttons' + i + '_add_before']) - v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; - - t._addControls(v, tb, di); - - //n.appendChild(n = tb.render()); - h.push(tb.renderHTML()); - - o.deltaHeight -= s.theme_advanced_row_height; - } - - h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); - DOM.setHTML(n, h.join('')); - }, - - _addStatusBar : function(tb, o) { - var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; - - n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : ' '); - DOM.add(n, 'a', {href : '#', accesskey : 'x'}); - - if (s.theme_advanced_resizing && !tinymce.isOldWebKit) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'resize'}); - - if (s.theme_advanced_resizing_use_cookie) { - ed.onPostRender.add(function() { - var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); - - if (!o) - return; - - if (s.theme_advanced_resize_horizontal) - c.style.width = o.cw + 'px'; - - c.style.height = o.ch + 'px'; - DOM.get(ed.id + '_ifr').style.height = (parseInt(o.ch) + t.deltaHeight) + 'px'; - }); - } - - ed.onPostRender.add(function() { - Event.add(ed.id + '_resize', 'mousedown', function(e) { - var c, p, w, h, n, pa; - - // Measure container - c = DOM.get(ed.id + '_tbl'); - w = c.clientWidth; - h = c.clientHeight; - - miw = s.theme_advanced_resizing_min_width || 100; - mih = s.theme_advanced_resizing_min_height || 100; - maw = s.theme_advanced_resizing_max_width || 0xFFFF; - mah = s.theme_advanced_resizing_max_height || 0xFFFF; - - // Setup placeholder - p = DOM.add(DOM.get(ed.id + '_parent'), 'div', {'class' : 'mcePlaceHolder'}); - DOM.setStyles(p, {width : w, height : h}); - - // Replace with placeholder - DOM.hide(c); - DOM.show(p); - - // Create internal resize obj - r = { - x : e.screenX, - y : e.screenY, - w : w, - h : h, - dx : null, - dy : null - }; - - // Start listening - mf = Event.add(document, 'mousemove', function(e) { - var w, h; - - // Calc delta values - r.dx = e.screenX - r.x; - r.dy = e.screenY - r.y; - - // Boundery fix box - w = Math.max(miw, r.w + r.dx); - h = Math.max(mih, r.h + r.dy); - w = Math.min(maw, w); - h = Math.min(mah, h); - - // Resize placeholder - if (s.theme_advanced_resize_horizontal) - p.style.width = w + 'px'; - - p.style.height = h + 'px'; - - return Event.cancel(e); - }); - - me = Event.add(document, 'mouseup', function(e) { - var ifr; - - // Stop listening - Event.remove(document, 'mousemove', mf); - Event.remove(document, 'mouseup', me); - - c.style.display = ''; - DOM.remove(p); - - if (r.dx === null) - return; - - ifr = DOM.get(ed.id + '_ifr'); - - if (s.theme_advanced_resize_horizontal) - c.style.width = (r.w + r.dx) + 'px'; - - c.style.height = (r.h + r.dy) + 'px'; - ifr.style.height = (ifr.clientHeight + r.dy) + 'px'; - - if (s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : r.w + r.dx, - ch : r.h + r.dy - }); - } - }); - - return Event.cancel(e); - }); - }); - } - - o.deltaHeight -= 21; - n = tb = null; - }, - - _nodeChanged : function(ed, cm, n, co) { - var t = this, p, de = 0, v, c, s = t.settings; - - tinymce.each(t.stateControls, function(c) { - cm.setActive(c, ed.queryCommandState(t.controls[c][1])); - }); - - cm.setActive('visualaid', ed.hasVisual); - cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing); - cm.setDisabled('redo', !ed.undoManager.hasRedo()); - cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); - - p = DOM.getParent(n, 'A'); - if (c = cm.get('link')) { - if (!p || !p.name) { - c.setDisabled(!p && co); - c.setActive(!!p); - } - } - - if (c = cm.get('unlink')) { - c.setDisabled(!p && co); - c.setActive(!!p && !p.name); - } - - if (c = cm.get('anchor')) { - c.setActive(!!p && p.name); - - if (tinymce.isWebKit) { - p = DOM.getParent(n, 'IMG'); - c.setActive(!!p && DOM.getAttrib(p, 'mce_name') == 'a'); - } - } - - p = DOM.getParent(n, 'IMG'); - if (c = cm.get('image')) - c.setActive(!!p && n.className.indexOf('mceItem') == -1); - - if (c = cm.get('styleselect')) { - if (n.className) { - t._importClasses(); - c.select(n.className); - } else - c.select(); - } - - if (c = cm.get('formatselect')) { - p = DOM.getParent(n, DOM.isBlock); - - if (p) - c.select(p.nodeName.toLowerCase()); - } - - if (c = cm.get('fontselect')) - c.select(ed.queryCommandValue('FontName')); - - if (c = cm.get('fontsizeselect')) - c.select(ed.queryCommandValue('FontSize')); - - if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { - p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); - DOM.setHTML(p, ''); - - ed.dom.getParent(n, function(n) { - var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - - // Ignore non element and hidden elements - if (n.nodeType != 1 || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved'))) - return; - - // Fake name - if (v = DOM.getAttrib(n, 'mce_name')) - na = v; - - // Handle prefix - if (tinymce.isIE && n.scopeName !== 'HTML') - na = n.scopeName + ':' + na; - - // Remove internal prefix - na = na.replace(/mce\:/g, ''); - - // Handle node name - switch (na) { - case 'b': - na = 'strong'; - break; - - case 'i': - na = 'em'; - break; - - case 'img': - if (v = DOM.getAttrib(n, 'src')) - ti += 'src: ' + v + ' '; - - break; - - case 'a': - if (v = DOM.getAttrib(n, 'name')) { - ti += 'name: ' + v + ' '; - na += '#' + v; - } - - if (v = DOM.getAttrib(n, 'href')) - ti += 'href: ' + v + ' '; - - break; - - case 'font': - if (s.convert_fonts_to_spans) - na = 'span'; - - if (v = DOM.getAttrib(n, 'face')) - ti += 'font: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'size')) - ti += 'size: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'color')) - ti += 'color: ' + v + ' '; - - break; - - case 'span': - if (v = DOM.getAttrib(n, 'style')) - ti += 'style: ' + v + ' '; - - break; - } - - if (v = DOM.getAttrib(n, 'id')) - ti += 'id: ' + v + ' '; - - if (v = n.className) { - v = v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g, ''); - - if (v && v.indexOf('mceItem') == -1) { - ti += 'class: ' + v + ' '; - - if (DOM.isBlock(n) || na == 'img' || na == 'span') - na += '.' + v; - } - } - - na = na.replace(/(html:)/g, ''); - na = {name : na, node : n, title : ti}; - t.onResolveName.dispatch(t, na); - ti = na.title; - na = na.name; - - //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "#" + (de++) + "", onmousedown : "return false;", title : ti}, na); - - if (p.hasChildNodes()) { - p.insertBefore(document.createTextNode(' \u00bb '), p.firstChild); - p.insertBefore(pi, p.firstChild); - } else - p.appendChild(pi); - }, ed.getBody()); - } - }, - - // Commands gets called by execCommand - - _sel : function(v) { - this.editor.execCommand('mceSelectNodeDepth', false, v); - }, - - _mceInsertAnchor : function(ui, v) { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/anchor.htm', - width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), - height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceCharMap : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/charmap.htm', - width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceHelp : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/about.htm', - width : 480, - height : 380, - inline : true - }, { - theme_url : this.url - }); - }, - - _mceColorPicker : function(u, v) { - var ed = this.editor; - - v = v || {}; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/color_picker.htm', - width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), - close_previous : false, - inline : true - }, { - input_color : v.color, - func : v.func, - theme_url : this.url - }); - }, - - _mceCodeEditor : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/source_editor.htm', - width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), - height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), - inline : true, - resizable : true, - maximizable : true - }, { - theme_url : this.url - }); - }, - - _mceImage : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/image.htm', - width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), - height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceLink : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : tinymce.baseURL + '/themes/advanced/link.htm', - width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), - height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceNewDocument : function() { - var ed = this.editor; - - ed.windowManager.confirm('advanced.newdocument', function(s) { - if (s) - ed.execCommand('mceSetContent', false, ''); - }); - }, - - _mceForeColor : function() { - var t = this; - - this._mceColorPicker(0, { - func : function(co) { - t.editor.execCommand('ForeColor', false, co); - } - }); - }, - - _mceBackColor : function() { - var t = this; - - this._mceColorPicker(0, { - func : function(co) { - t.editor.execCommand('HiliteColor', false, co); - } - }); - } - }); - - tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); -}()); \ No newline at end of file +(function(){var DOM=tinymce.DOM,Event=tinymce.dom.Event,extend=tinymce.extend,each=tinymce.each,Cookie=tinymce.util.Cookie,lastExtID;tinymce.ThemeManager.requireLangPack('advanced');tinymce.create('tinymce.themes.AdvancedTheme',{controls:{bold:['bold_desc','Bold'],italic:['italic_desc','Italic'],underline:['underline_desc','Underline'],strikethrough:['striketrough_desc','Strikethrough'],justifyleft:['justifyleft_desc','JustifyLeft'],justifycenter:['justifycenter_desc','JustifyCenter'],justifyright:['justifyright_desc','JustifyRight'],justifyfull:['justifyfull_desc','JustifyFull'],bullist:['bullist_desc','InsertUnorderedList'],numlist:['numlist_desc','InsertOrderedList'],outdent:['outdent_desc','Outdent'],indent:['indent_desc','Indent'],cut:['cut_desc','Cut'],copy:['copy_desc','Copy'],paste:['paste_desc','Paste'],undo:['undo_desc','Undo'],redo:['redo_desc','Redo'],link:['link_desc','mceLink'],unlink:['unlink_desc','unlink'],image:['image_desc','mceImage'],cleanup:['cleanup_desc','mceCleanup'],help:['help_desc','mceHelp'],code:['code_desc','mceCodeEditor'],hr:['hr_desc','InsertHorizontalRule'],removeformat:['removeformat_desc','RemoveFormat'],sub:['sub_desc','subscript'],sup:['sup_desc','superscript'],forecolor:['forecolor_desc','ForeColor'],forecolorpicker:['forecolor_desc','mceForeColor'],backcolor:['backcolor_desc','HiliteColor'],backcolorpicker:['backcolor_desc','mceBackColor'],charmap:['charmap_desc','mceCharMap'],visualaid:['visualaid_desc','mceToggleVisualAid'],anchor:['anchor_desc','mceInsertAnchor'],newdocument:['newdocument_desc','mceNewDocument'],blockquote:['blockquote_desc','mceBlockQuote']},stateControls:['bold','italic','underline','strikethrough','bullist','numlist','justifyleft','justifycenter','justifyright','justifyfull','sub','sup','blockquote'],init:function(ed,url){var t=this,s;t.editor=ed;t.url=url;t.onResolveName=new tinymce.util.Dispatcher(this);t.settings=s=extend({theme_advanced_path:true,theme_advanced_toolbar_location:'bottom',theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1},ed.settings);if(s.theme_advanced_path_location)s.theme_advanced_statusbar_location=s.theme_advanced_path_location;if(s.theme_advanced_statusbar_location=='none')s.theme_advanced_statusbar_location=0;ed.onInit.add(function(){ed.onNodeChange.add(t._nodeChanged,t);ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/"+ed.settings.skin+"/content.css"));});ed.onSetProgressState.add(function(ed,b,ti){var co,id=ed.id,tb;if(b){t.progressTimer=setTimeout(function(){co=ed.getContainer();co=co.insertBefore(DOM.create('DIV',{style:'position:relative'}),co.firstChild);tb=DOM.get(ed.id+'_tbl');DOM.add(co,'div',{id:id+'_blocker','class':'mceBlocker',style:{width:tb.clientWidth+2,height:tb.clientHeight+2}});DOM.add(co,'div',{id:id+'_progress','class':'mceProgress',style:{left:tb.clientWidth/ 2, top : tb.clientHeight /2}});},ti||0);}else{DOM.remove(id+'_blocker');DOM.remove(id+'_progress');clearTimeout(t.progressTimer);}});DOM.loadCSS(ed.baseURI.toAbsolute(s.editor_css||"themes/advanced/skins/"+ed.settings.skin+"/ui.css"));},createControl:function(n,cf){var cd,c;if(c=cf.createControl(n))return c;switch(n){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu();}if((cd=this.controls[n]))return cf.createButton(n,{title:"advanced."+cd[0],cmd:cd[1],ui:cd[2],value:cd[3]});},execCommand:function(cmd,ui,val){var f=this['_'+cmd];if(f){f.call(this,ui,val);return true;}return false;},_importClasses:function(){var ed=this.editor,c=ed.controlManager.get('styleselect');if(c.getLength()==0){each(ed.dom.getClasses(),function(o){c.add(o['class'],o['class']);});}},_createStyleSelect:function(n){var t=this,ed=t.editor,cf=ed.controlManager,c=cf.createListBox('styleselect',{title:'advanced.style_select',onselect:function(v){if(c.selectedValue===v){ed.execCommand('mceSetStyleInfo',0,{command:'removeformat'});c.select();return false;}else ed.execCommand('mceSetCSSClass',0,v);}});each((t.settings.theme_advanced_styles||'').split(';'),function(v){var p=v.split('=');if(v)c.add(t.editor.translate(p[0]),p[1]);});c.onPostRender.add(function(ed,n){Event.add(n,'focus',t._importClasses,t);Event.add(n,'mousedown',t._importClasses,t);});return c;},_createFontSelect:function(){var c,t=this;c=t.editor.controlManager.createListBox('fontselect',{title:'advanced.fontdefault',cmd:'FontName'});each(t.settings.theme_advanced_fonts.split(';'),function(v){var p=v.split('='),st;if(p[1].indexOf('dings')==-1)st='font-family:'+p[1];c.add(t.editor.translate(p[0]),p[1],{style:st});});return c;},_createFontSizeSelect:function(){var c,t=this,lo=["1 (8 pt)","2 (10 pt)","3 (12 pt)","4 (14 pt)","5 (18 pt)","6 (24 pt)","7 (36 pt)"],fz=[8,10,12,14,18,24,36];c=t.editor.controlManager.createListBox('fontsizeselect',{title:'advanced.font_size',cmd:'FontSize'});each(t.settings.theme_advanced_font_sizes.split(','),function(v){c.add(lo[parseInt(v)-1],v,{'style':'font-size:'+fz[v-1]+'pt','class':'fontSize'+v});});return c;},_createBlockFormats:function(){var c,fmts={p:'advanced.paragraph',address:'advanced.address',pre:'advanced.pre',h1:'advanced.h1',h2:'advanced.h2',h3:'advanced.h3',h4:'advanced.h4',h5:'advanced.h5',h6:'advanced.h6',div:'advanced.div',blockquote:'advanced.blockquote',code:'advanced.code',dt:'advanced.dt',dd:'advanced.dd',samp:'advanced.samp'},t=this;c=t.editor.controlManager.createListBox('formatselect',{title:'advanced.block',cmd:'FormatBlock'});each(t.settings.theme_advanced_blockformats.split(','),function(v){c.add(t.editor.translate(fmts[v]),v,{element:v,'class':v.indexOf('h')==0?'':'preview'});});return c;},_createForeColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_text_colors)o.colors=v;o.title='advanced.forecolor_desc';o.cmd='ForeColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('forecolor',o);return c;},_createBackColorMenu:function(){var c,t=this,s=t.settings,o={},v;if(s.theme_advanced_more_colors){o.more_colors_func=function(){t._mceColorPicker(0,{color:c.value,func:function(co){c.setColor(co);}});};}if(v=s.theme_advanced_background_colors)o.colors=v;o.title='advanced.backcolor_desc';o.cmd='HiliteColor';o.scope=this;c=t.editor.controlManager.createColorSplitButton('backcolor',o);return c;},renderUI:function(o){var n,ic,tb,t=this,ed=t.editor,s=t.settings,sc,p,nl;n=p=DOM.create('div',{id:ed.id+'_parent','class':'mceEditor '+ed.settings.skin+'Skin'});if(!DOM.boxModel)n=DOM.add(n,'div',{'class':'mceOldBoxModel'});n=sc=DOM.add(n,'table',{id:ed.id+'_tbl','class':'mceLayout',cellSpacing:0,cellPadding:0});n=tb=DOM.add(n,'tbody');switch((s.theme_advanced_layout_manager||'').toLowerCase()){case"rowlayout":ic=t._rowLayout(s,tb,o);break;case"customlayout":ic=ed.execCallback("theme_advanced_custom_layout",s,tb,o,p);break;default:ic=t._simpleLayout(s,tb,o,p);}n=o.targetNode;nl=sc.rows;DOM.addClass(nl[0],'first');DOM.addClass(nl[nl.length-1],'last');each(DOM.select('tr',tb),function(n){DOM.addClass(n.firstChild,'first');DOM.addClass(n.childNodes[n.childNodes.length-1],'last');});if(DOM.get(s.theme_advanced_toolbar_container))DOM.get(s.theme_advanced_toolbar_container).appendChild(p);else DOM.insertAfter(p,n);Event.add(ed.id+'_path_row','click',function(e){e=e.target;if(e.nodeName=='A'){t._sel(e.href.replace(/^[^#]*#/,''));return Event.cancel(e);}});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))Event.add(DOM.add(p,'a',{href:'#'},''),'focus',function(){tinyMCE.get(ed.id).focus();});if(s.theme_advanced_toolbar_location=='external')o.deltaHeight=0;t.deltaHeight=o.deltaHeight;o.targetNode=null;return{iframeContainer:ic,editorContainer:ed.id+'_parent',sizeContainer:sc,deltaHeight:o.deltaHeight};},getInfo:function(){return{longname:'Simple theme',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',version:tinymce.majorVersion+"."+tinymce.minorVersion}},_simpleLayout:function(s,tb,o,p){var t=this,ed=t.editor,lo=s.theme_advanced_toolbar_location,sl=s.theme_advanced_statusbar_location,n,ic,etb,c;if(lo=='top')t._addToolbars(tb,o);if(lo=='external'){n=c=DOM.create('div',{style:'position:relative'});n=DOM.add(n,'div',{id:ed.id+'_external','class':'mceExternalToolbar'});DOM.add(n,'a',{id:ed.id+'_external_close',href:'javascript:;','class':'mceExternalClose'});n=DOM.add(n,'table',{id:ed.id+'_tblext',cellSpacing:0,cellPadding:0});etb=DOM.add(n,'tbody');if(p.firstChild.className=='mceOldBoxModel')p.firstChild.appendChild(c);else p.insertBefore(c,p.firstChild);t._addToolbars(etb,o);ed.onMouseUp.add(function(){var e=DOM.get(ed.id+'_external');DOM.show(e);DOM.hide(lastExtID);var f=Event.add(ed.id+'_external_close','click',function(){DOM.hide(ed.id+'_external');Event.remove(ed.id+'_external_close','click',f);});DOM.show(e);DOM.setStyle(e,'top',0-DOM.getRect(ed.id+'_tblext').h-1);DOM.hide(e);DOM.show(e);e.style.filter='';lastExtID=ed.id+'_external';e=null;});}if(sl=='top')t._addStatusBar(tb,o);if(!s.theme_advanced_toolbar_container){n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});}if(lo=='bottom')t._addToolbars(tb,o);if(sl=='bottom')t._addStatusBar(tb,o);return ic;},_rowLayout:function(s,tb,o){var t=this,ed=t.editor,dc,da,cf=ed.controlManager,n,ic,to;dc=s.theme_advanced_containers_default_class||'';da=s.theme_advanced_containers_default_align||'center';each((s.theme_advanced_containers||'').split(','),function(c,i){var v=s['theme_advanced_container_'+c]||'';switch(c.toLowerCase()){case'mceeditor':n=DOM.add(tb,'tr');n=ic=DOM.add(n,'td',{'class':'mceIframeContainer'});break;case'mceelementpath':t._addStatusBar(tb,o);break;default:n=DOM.add(DOM.add(tb,'tr'),'td',{'class':'mceToolbar '+(s['theme_advanced_container_'+c+'_class']||dc),align:s['theme_advanced_container_'+c+'_align']||da});to=cf.createToolbar("toolbar"+i);t._addControls(v,to);DOM.setHTML(n,to.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}});return ic;},_addControls:function(v,tb){var t=this,s=t.settings,di,cf=t.editor.controlManager;if(s.theme_advanced_disable&&!t._disabled){di={};each(s.theme_advanced_disable.split(','),function(v){di[v]=1;});t._disabled=di;}else di=t._disabled;each(v.split(','),function(n){var c;if(di&&di[n])return;if(n=='tablecontrols'){each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(n){n=t.createControl(n,cf);if(n)tb.add(n);});return;}c=t.createControl(n,cf);if(c)tb.add(c);});},_addToolbars:function(c,o){var t=this,i,tb,ed=t.editor,s=t.settings,v,cf=ed.controlManager,di,n,h=[];n=DOM.add(DOM.add(c,'tr'),'td',{'class':'mceToolbar',align:s.theme_advanced_toolbar_align});if(!ed.getParam('accessibility_focus')||ed.getParam('tab_focus'))h.push(DOM.createHTML('a',{href:'#',onfocus:'tinyMCE.get(\''+ed.id+'\').focus();'},''));h.push(DOM.createHTML('a',{href:'#',accesskey:'q',title:ed.getLang("advanced.toolbar_focus")},''));for(i=1;(v=s['theme_advanced_buttons'+i]);i++){tb=cf.createToolbar("toolbar"+i,{'class':'mceToolbarRow'+i});if(s['theme_advanced_buttons'+i+'_add'])v+=','+s['theme_advanced_buttons'+i+'_add'];if(s['theme_advanced_buttons'+i+'_add_before'])v=s['theme_advanced_buttons'+i+'_add_before']+','+v;t._addControls(v,tb);h.push(tb.renderHTML());o.deltaHeight-=s.theme_advanced_row_height;}h.push(DOM.createHTML('a',{href:'#',accesskey:'z',title:ed.getLang("advanced.toolbar_focus"),onfocus:'tinyMCE.getInstanceById(\''+ed.id+'\').focus();'},''));DOM.setHTML(n,h.join(''));},_addStatusBar:function(tb,o){var n,t=this,ed=t.editor,s=t.settings,r,mf,me,td;n=DOM.add(tb,'tr');n=td=DOM.add(n,'td',{'class':'mceStatusbar'});n=DOM.add(n,'div',{id:ed.id+'_path_row'},s.theme_advanced_path?ed.translate('advanced.path')+': ':' ');DOM.add(n,'a',{href:'#',accesskey:'x'});if(s.theme_advanced_resizing&&!tinymce.isOldWebKit){DOM.add(td,'a',{id:ed.id+'_resize',href:'javascript:;',onclick:"return false;",'class':'resize'});if(s.theme_advanced_resizing_use_cookie){ed.onPostRender.add(function(){var o=Cookie.getHash("TinyMCE_"+ed.id+"_size"),c=DOM.get(ed.id+'_tbl');if(!o)return;if(s.theme_advanced_resize_horizontal)c.style.width=o.cw+'px';c.style.height=o.ch+'px';DOM.get(ed.id+'_ifr').style.height=(parseInt(o.ch)+t.deltaHeight)+'px';});}ed.onPostRender.add(function(){Event.add(ed.id+'_resize','mousedown',function(e){var c,p,w,h,n,pa;c=DOM.get(ed.id+'_tbl');w=c.clientWidth;h=c.clientHeight;miw=s.theme_advanced_resizing_min_width||100;mih=s.theme_advanced_resizing_min_height||100;maw=s.theme_advanced_resizing_max_width||0xFFFF;mah=s.theme_advanced_resizing_max_height||0xFFFF;p=DOM.add(DOM.get(ed.id+'_parent'),'div',{'class':'mcePlaceHolder'});DOM.setStyles(p,{width:w,height:h});DOM.hide(c);DOM.show(p);r={x:e.screenX,y:e.screenY,w:w,h:h,dx:null,dy:null};mf=Event.add(document,'mousemove',function(e){var w,h;r.dx=e.screenX-r.x;r.dy=e.screenY-r.y;w=Math.max(miw,r.w+r.dx);h=Math.max(mih,r.h+r.dy);w=Math.min(maw,w);h=Math.min(mah,h);if(s.theme_advanced_resize_horizontal)p.style.width=w+'px';p.style.height=h+'px';return Event.cancel(e);});me=Event.add(document,'mouseup',function(e){var ifr;Event.remove(document,'mousemove',mf);Event.remove(document,'mouseup',me);c.style.display='';DOM.remove(p);if(r.dx===null)return;ifr=DOM.get(ed.id+'_ifr');if(s.theme_advanced_resize_horizontal)c.style.width=(r.w+r.dx)+'px';c.style.height=(r.h+r.dy)+'px';ifr.style.height=(ifr.clientHeight+r.dy)+'px';if(s.theme_advanced_resizing_use_cookie){Cookie.setHash("TinyMCE_"+ed.id+"_size",{cw:r.w+r.dx,ch:r.h+r.dy});}});return Event.cancel(e);});});}o.deltaHeight-=21;n=tb=null;},_nodeChanged:function(ed,cm,n,co){var t=this,p,de=0,v,c,s=t.settings;tinymce.each(t.stateControls,function(c){cm.setActive(c,ed.queryCommandState(t.controls[c][1]));});cm.setActive('visualaid',ed.hasVisual);cm.setDisabled('undo',!ed.undoManager.hasUndo()&&!ed.typing);cm.setDisabled('redo',!ed.undoManager.hasRedo());cm.setDisabled('outdent',!ed.queryCommandState('Outdent'));p=DOM.getParent(n,'A');if(c=cm.get('link')){if(!p||!p.name){c.setDisabled(!p&&co);c.setActive(!!p);}}if(c=cm.get('unlink')){c.setDisabled(!p&&co);c.setActive(!!p&&!p.name);}if(c=cm.get('anchor')){c.setActive(!!p&&p.name);if(tinymce.isWebKit){p=DOM.getParent(n,'IMG');c.setActive(!!p&&DOM.getAttrib(p,'mce_name')=='a');}}p=DOM.getParent(n,'IMG');if(c=cm.get('image'))c.setActive(!!p&&n.className.indexOf('mceItem')==-1);if(c=cm.get('styleselect')){if(n.className){t._importClasses();c.select(n.className);}else c.select();}if(c=cm.get('formatselect')){p=DOM.getParent(n,DOM.isBlock);if(p)c.select(p.nodeName.toLowerCase());}if(c=cm.get('fontselect'))c.select(ed.queryCommandValue('FontName'));if(c=cm.get('fontsizeselect'))c.select(ed.queryCommandValue('FontSize'));if(s.theme_advanced_path&&s.theme_advanced_statusbar_location){p=DOM.get(ed.id+'_path')||DOM.add(ed.id+'_path_row','span',{id:ed.id+'_path'});DOM.setHTML(p,'');ed.dom.getParent(n,function(n){var na=n.nodeName.toLowerCase(),u,pi,ti='';if(n.nodeType!=1||(DOM.hasClass(n,'mceItemHidden')||DOM.hasClass(n,'mceItemRemoved')))return;if(v=DOM.getAttrib(n,'mce_name'))na=v;if(tinymce.isIE&&n.scopeName!=='HTML')na=n.scopeName+':'+na;na=na.replace(/mce\:/g,'');switch(na){case'b':na='strong';break;case'i':na='em';break;case'img':if(v=DOM.getAttrib(n,'src'))ti+='src: '+v+' ';break;case'a':if(v=DOM.getAttrib(n,'name')){ti+='name: '+v+' ';na+='#'+v;}if(v=DOM.getAttrib(n,'href'))ti+='href: '+v+' ';break;case'font':if(s.convert_fonts_to_spans)na='span';if(v=DOM.getAttrib(n,'face'))ti+='font: '+v+' ';if(v=DOM.getAttrib(n,'size'))ti+='size: '+v+' ';if(v=DOM.getAttrib(n,'color'))ti+='color: '+v+' ';break;case'span':if(v=DOM.getAttrib(n,'style'))ti+='style: '+v+' ';break;}if(v=DOM.getAttrib(n,'id'))ti+='id: '+v+' ';if(v=n.className){v=v.replace(/(webkit-[\w\-]+|Apple-[\w\-]+|mceItem\w+|mceVisualAid)/g,'');if(v&&v.indexOf('mceItem')==-1){ti+='class: '+v+' ';if(DOM.isBlock(n)||na=='img'||na=='span')na+='.'+v;}}na=na.replace(/(html:)/g,'');na={name:na,node:n,title:ti};t.onResolveName.dispatch(t,na);ti=na.title;na=na.name;pi=DOM.create('a',{'href':"#"+(de++)+"",onmousedown:"return false;",title:ti},na);if(p.hasChildNodes()){p.insertBefore(document.createTextNode(' \u00bb '),p.firstChild);p.insertBefore(pi,p.firstChild);}else p.appendChild(pi);},ed.getBody());}},_sel:function(v){this.editor.execCommand('mceSelectNodeDepth',false,v);},_mceInsertAnchor:function(ui,v){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm',width:320+parseInt(ed.getLang('advanced.anchor_delta_width',0)),height:90+parseInt(ed.getLang('advanced.anchor_delta_height',0)),inline:true},{theme_url:this.url});},_mceCharMap:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/charmap.htm',width:550+parseInt(ed.getLang('advanced.charmap_delta_width',0)),height:250+parseInt(ed.getLang('advanced.charmap_delta_height',0)),inline:true},{theme_url:this.url});},_mceHelp:function(){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/about.htm',width:480,height:380,inline:true},{theme_url:this.url});},_mceColorPicker:function(u,v){var ed=this.editor;v=v||{};ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/color_picker.htm',width:375+parseInt(ed.getLang('advanced.colorpicker_delta_width',0)),height:250+parseInt(ed.getLang('advanced.colorpicker_delta_height',0)),close_previous:false,inline:true},{input_color:v.color,func:v.func,theme_url:this.url});},_mceCodeEditor:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/source_editor.htm',width:parseInt(ed.getParam("theme_advanced_source_editor_width",720)),height:parseInt(ed.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url});},_mceImage:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/image.htm',width:355+parseInt(ed.getLang('advanced.image_delta_width',0)),height:275+parseInt(ed.getLang('advanced.image_delta_height',0)),inline:true},{theme_url:this.url});},_mceLink:function(ui,val){var ed=this.editor;ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/link.htm',width:310+parseInt(ed.getLang('advanced.link_delta_width',0)),height:200+parseInt(ed.getLang('advanced.link_delta_height',0)),inline:true},{theme_url:this.url});},_mceNewDocument:function(){var ed=this.editor;ed.windowManager.confirm('advanced.newdocument',function(s){if(s)ed.execCommand('mceSetContent',false,'');});},_mceForeColor:function(){var t=this;this._mceColorPicker(0,{func:function(co){t.editor.execCommand('ForeColor',false,co);}});},_mceBackColor:function(){var t=this;this._mceColorPicker(0,{func:function(co){t.editor.execCommand('HiliteColor',false,co);}});}});tinymce.ThemeManager.add('advanced',tinymce.themes.AdvancedTheme);}()); \ No newline at end of file diff --git a/wp-includes/js/tinymce/themes/advanced/image.htm b/wp-includes/js/tinymce/themes/advanced/image.htm index a3cce52f2..ba047cc68 100644 --- a/wp-includes/js/tinymce/themes/advanced/image.htm +++ b/wp-includes/js/tinymce/themes/advanced/image.htm @@ -2,11 +2,12 @@ {#advanced_dlg.image_title} - + - + + @@ -74,12 +75,12 @@
    - -
    - -
    + +
    + +
    diff --git a/wp-includes/js/tinymce/themes/advanced/img/fm.gif b/wp-includes/js/tinymce/themes/advanced/img/fm.gif new file mode 100644 index 000000000..b5f022b51 Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/img/fm.gif differ diff --git a/wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png b/wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png new file mode 100644 index 000000000..8a396e03f Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png differ diff --git a/wp-includes/js/tinymce/themes/advanced/img/sflogo.png b/wp-includes/js/tinymce/themes/advanced/img/sflogo.png new file mode 100644 index 000000000..142a6f99a Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/img/sflogo.png differ diff --git a/wp-includes/js/tinymce/themes/advanced/js/charmap.js b/wp-includes/js/tinymce/themes/advanced/js/charmap.js index 12c0084cf..a51d63b35 100644 --- a/wp-includes/js/tinymce/themes/advanced/js/charmap.js +++ b/wp-includes/js/tinymce/themes/advanced/js/charmap.js @@ -306,6 +306,7 @@ function insertChar(chr) { if (tinyMCEPopup.isWindow) window.focus(); + tinyMCEPopup.editor.focus(); tinyMCEPopup.close(); } diff --git a/wp-includes/js/tinymce/themes/advanced/link.htm b/wp-includes/js/tinymce/themes/advanced/link.htm index 308c3ba1d..8c25c3b34 100644 --- a/wp-includes/js/tinymce/themes/advanced/link.htm +++ b/wp-includes/js/tinymce/themes/advanced/link.htm @@ -2,12 +2,13 @@ {#advanced_dlg.link_title} - + - + + @@ -52,11 +53,11 @@
    - +
    - +
    diff --git a/wp-includes/js/tinymce/themes/advanced/skins/default/content.css b/wp-includes/js/tinymce/themes/advanced/skins/default/content.css index ae4385438..42cb32c50 100644 --- a/wp-includes/js/tinymce/themes/advanced/skins/default/content.css +++ b/wp-includes/js/tinymce/themes/advanced/skins/default/content.css @@ -1,4 +1,4 @@ -body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px; } body {background:#FFF;} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {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;} diff --git a/wp-includes/js/tinymce/themes/advanced/skins/default/ui.css b/wp-includes/js/tinymce/themes/advanced/skins/default/ui.css index 9af795458..43cce9ce3 100644 --- a/wp-includes/js/tinymce/themes/advanced/skins/default/ui.css +++ b/wp-includes/js/tinymce/themes/advanced/skins/default/ui.css @@ -1,5 +1,5 @@ /* Reset */ -.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline} +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .text {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate} .defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} .defaultSkin table td {vertical-align:middle} @@ -23,7 +23,7 @@ .defaultSkin td.mceToolbar {padding-top:1px; vertical-align:top} .defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} .defaultSkin .mceStatusbar {position:relative; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; padding:2px; color:#000; display:block} -.defaultSkin .mceStatusbar a.resize {display:block; position:absolute; top:0; right:0; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px} +.defaultSkin .mceStatusbar a.resize {display:block; position:absolute; top:0; right:0; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} .defaultSkin .mceStatusbar a:hover {text-decoration:underline} .defaultSkin table.mceToolbar {margin-left:3px} .defaultSkin span.icon, .defaultSkin img.icon {display:block; width:20px; height:20px} diff --git a/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css b/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css index 0704ea1e4..4ed0deb4c 100644 --- a/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css +++ b/wp-includes/js/tinymce/themes/advanced/skins/o2k7/content.css @@ -1,4 +1,4 @@ -body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} body {background:#FFF;} .mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {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;} diff --git a/wp-includes/js/tinymce/themes/advanced/skins/o2k7/ui.css b/wp-includes/js/tinymce/themes/advanced/skins/o2k7/ui.css index 27efc2598..0fdea2a12 100644 --- a/wp-includes/js/tinymce/themes/advanced/skins/o2k7/ui.css +++ b/wp-includes/js/tinymce/themes/advanced/skins/o2k7/ui.css @@ -1,5 +1,5 @@ /* Reset */ -.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline} +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .text {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate} .o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} .o2k7Skin table td {vertical-align:middle} @@ -21,7 +21,7 @@ .o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} .o2k7Skin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px;} .o2k7Skin .mceStatusbar div {float:left; padding:2px;} -.o2k7Skin .mceStatusbar a.resize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px} +.o2k7Skin .mceStatusbar a.resize {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 table.mceToolbar {margin-left:3px} .o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css new file mode 100644 index 000000000..8831d0ea5 --- /dev/null +++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css @@ -0,0 +1,19 @@ +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceVisualAid {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;} +img.mceItemAnchor {width:12px; height:12px; background:url(../default/img/items.gif) no-repeat;} +img {border:0;} + +/* IE +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} +*/ \ No newline at end of file diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css new file mode 100644 index 000000000..ae7e4c188 --- /dev/null +++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css @@ -0,0 +1,117 @@ +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +/*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;*/ +background:#eaf3ea; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#eaf3ea;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border: 1px solid #bbb; +margin:0; +padding:0 0 1px; +font-weight:bold; +font-size: 11px; +width:94px; +height:24px; +background:url(img/fade-butt.png) 0 0; +cursor:pointer; +} +#insert:hover, #cancel:hover, input.button:hover, .updateButton:hover, +#insert:focus, #cancel:focus, input.button:focus, .updateButton:focus { +border: 1px solid #555; +} +/*#insert {background:url(img/fade-butt.png) 0 0;} +#cancel {background:url(img/fade-butt.png) 0 0;}*/ + +/* Browse */ +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; -moz-opacity:0.3; opacity:0.3; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border-style:solid; border-width:1px; border-color:#AAA;} +td.charmap, td.charmapOver {color:#000; border-color:#AAA; border-style:solid; border-width:1px; text-align:center; font-size:12px;} +td.charmapOver {background:#CCC; cursor:default;} +a.charmap {color:#000; text-decoration:none} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;background:transparent;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background: #eaf3ea url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:18px;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png new file mode 100644 index 000000000..df9043959 Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png differ diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/button_bg.png b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/button_bg.png new file mode 100644 index 000000000..12cfb419b Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/button_bg.png differ diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif new file mode 100644 index 000000000..687b241ee Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif differ diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png new file mode 100644 index 000000000..42f08b799 Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png differ diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif new file mode 100644 index 000000000..4f39b809e Binary files /dev/null and b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/separator.gif differ diff --git a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css new file mode 100644 index 000000000..e20bf8d7d --- /dev/null +++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css @@ -0,0 +1,322 @@ +/* Reset */ +.wp_themeSkin table, .wp_themeSkin tbody, .wp_themeSkin a, .wp_themeSkin img, .wp_themeSkin tr, .wp_themeSkin div, .wp_themeSkin td, .wp_themeSkin iframe, .wp_themeSkin span, .wp_themeSkin *, .wp_themeSkin .text { +border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; +} +.wp_themeSkin a:hover, .wp_themeSkin a:link, .wp_themeSkin a:visited, .wp_themeSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.wp_themeSkin table td {vertical-align:middle} + +/* Containers */ +.wp_themeSkin table {background:#cee1ef} +.wp_themeSkin iframe {display:block; background:#FFF} +.wp_themeSkin .mceToolbar {} + +/* External */ +.wp_themeSkin .mceExternalToolbar {position:absolute; border:1px solid #ddd; border-bottom:0; display:none} +.wp_themeSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.wp_themeSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.wp_themeSkin table.mceToolbar, .wp_themeSkin tr.first .mceToolbar tr td, .wp_themeSkin tr.last .mceToolbar tr td {border:0; margin:0; padding:0} +.wp_themeSkin table.mceLayout {border:0;} +.wp_themeSkin .mceIframeContainer {} +.wp_themeSkin .mceStatusbar {display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px;background-color: #eaf3fa;} +.wp_themeSkin .mceStatusbar div {float:left; padding:2px;} +.wp_themeSkin .mceStatusbar a.resize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize} +.wp_themeSkin .mceStatusbar a:hover {text-decoration:underline} +.wp_themeSkin table.mceToolbar {margin: 0 3px 3px;} +.wp_themeSkin #content_toolbar1 {margin-top: 3px;} +/* +.wp_themeSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } +.wp_themeSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +*/ +.wp_themeSkin .mceToolbar .mceToolbarEndListBox span {display:none} +.wp_themeSkin span.icon, .wp_themeSkin img.icon {display:block; width:20px; height:20px} +.wp_themeSkin .icon {background:url(../../img/icons.gif) no-repeat 20px 20px} + +/* Button */ +.wp_themeSkin .mceButton { +display:block; +width: 20px; +height: 20px; +cursor: default; +padding: 1px 2px; +margin: 1px; +background: #e9e8e8 url(img/butt2.png) 1px 1px no-repeat scroll; +-moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; border: 1px solid #ccc; +} +.wp_themeSkin a.mceButton span, .wp_themeSkin a.mceButton img {} +.wp_themeSkin .mceOldBoxModel a.mceButton span, .wp_themeSkin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.wp_themeSkin a.mceButtonEnabled:hover {background-color:#D1D2D4; background-position:0 -20px;border: 1px solid #6779AA !important;} +.wp_themeSkin a.mceButtonActive, .wp_themeSkin a.mceButtonSelected {background-position:0 -20px;border: 1px solid #6779AA !important; background: #D1D2D4;} +.wp_themeSkin .mceButtonDisabled .icon {opacity:0.3; filter:alpha(opacity=30);} + +/* Separator */ +.wp_themeSkin .mceSeparator { +height: 24px; +width: 1px; +display: block; +background: transparent; +overflow: hidden; +margin: 0 2px; +} + +/* ListBox */ +.wp_themeSkin .mceListBox, .wp_themeSkin .mceListBox a {display:block} +.wp_themeSkin .mceListBox .text { +padding: 1px 2px 1px 5px; +-moz-border-radius-bottomleft: 4px; -webkit-border-radius-bottomleft: 4px; border-radius-bottomleft: 4px; +-moz-border-radius-topleft: 4px; -webkit-border-radius-topleft: 4px; border-radius-topleft: 4px; +border: 1px solid #ccc; +text-align:left; +width:70px; +border-right:0; +background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll; +font-family:Tahoma,Verdana,Arial,Helvetica; +font-size:11px; +height:20px; +line-height:20px; +overflow:hidden; +} +.wp_themeSkin .mceListBox { +margin: 1px; +} +.wp_themeSkin .mceListBox .open { +width:14px; +height:20px; +border-collapse:separate; +background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll; +padding: 1px; +-moz-border-radius-bottomright: 4px; -webkit-border-radius-bottomright: 4px; border-radius-bottomright: 4px; +-moz-border-radius-topright: 4px; -webkit-border-radius-topright: 4px; border-radius-topright: 4px; +border: 1px solid #ccc; +} +.wp_themeSkin .mceListBox .open span { +display: block; +width:14px; +height:20px; +background:url(img/down_arrow.gif) 2px 1px no-repeat; +} +.wp_themeSkin table.mceListBoxEnabled:hover .text, +.wp_themeSkin .mceListBoxHover .text, +.wp_themeSkin .mceListBoxSelected .text { +background:#eae8ea; +border-collapse:separate; +border: 1px solid #6779AA !important; +border-right: 0 none !important; +} +.wp_themeSkin table.mceListBoxEnabled:hover .open, +.wp_themeSkin .mceListBoxHover .open, +.wp_themeSkin .mceListBoxSelected .open { +background: #ccc; +border: 1px solid #6779AA !important; +} +.wp_themeSkin .mceListBoxDisabled .text {color:gray} +.wp_themeSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.wp_themeSkin .mceOldBoxModel .mceListBox .text {height:22px} +.wp_themeSkin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.wp_themeSkin .mceSplitButton a, .wp_themeSkin .mceSplitButton span {display:block; height:20px} +.wp_themeSkin .mceSplitButton { +display:block; +margin: 1px; +} +.wp_themeSkin table.mceSplitButton td { +padding: 2px; +} +.wp_themeSkin .mceSplitButton a.action { +height:20px; +width:20px; +background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll; +padding: 1px 2px; +-moz-border-radius-bottomleft: 4px; -webkit-border-radius-bottomleft: 4px; border-radius-bottomleft: 4px; +-moz-border-radius-topleft: 4px; -webkit-border-radius-topleft: 4px; border-radius-topleft: 4px; +border: 1px solid #ccc; +} +.wp_themeSkin .mceSplitButton span.action { +background: url(../../img/icons.gif) 20px 20px; +width:20px; +} +.wp_themeSkin .mceSplitButton a.open { +width:10px; +height:20px; +border-collapse:separate; +background: #e9e8e8 url(img/butt2.png) 1px 1px repeat-x scroll; +padding: 1px; +-moz-border-radius-bottomright: 4px; -webkit-border-radius-bottomright: 4px; border-radius-bottomright: 4px; +-moz-border-radius-topright: 4px; -webkit-border-radius-topright: 4px; border-radius-topright: 4px; +border: 1px solid #ccc; +border-left: 0 none; +} +.wp_themeSkin .mceSplitButton span.open { +width:10px; +background:url(img/down_arrow.gif) 0px 1px; +} +.wp_themeSkin .mceSplitButton a.open:hover, +.wp_themeSkin .mceSplitButtonSelected a.open { +background: #ccc; +border-collapse:separate; +border: 1px solid #6779AA !important; +border-left: 0 none !important; +} +.wp_themeSkin table.mceSplitButtonEnabled:hover a.action { +background: #ccc; +border: 1px solid #6779AA !important; +} +.wp_themeSkin .mceSplitButtonHover a.action, +.wp_themeSkin .mceSplitButtonSelected { +} +.wp_themeSkin table.mceSplitButtonEnabled:hover span.open, +.wp_themeSkin .mceSplitButtonHover span.open, +.wp_themeSkin .mceSplitButtonSelected span.open { +} +.wp_themeSkin .mceSplitButtonDisabled .action { +opacity:0.3; filter:alpha(opacity=30) +} +.wp_themeSkin .mceSplitButtonActive { +background: #D1D2D4; +} + +/* ColorSplitButton */ +.wp_themeSkin div.mceColorSplitMenu table {background:#ebeaeb; border:1px solid gray} +.wp_themeSkin .mceColorSplitMenu td {padding:2px} +.wp_themeSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.wp_themeSkin .mceColorSplitMenu td.morecolors {padding:1px 3px 1px 1px} +.wp_themeSkin .mceColorSplitMenu a.morecolors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.wp_themeSkin .mceColorSplitMenu a.morecolors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.wp_themeSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.wp_themeSkin .mceColorPreview {position:absolute; top:15px; left:2px; width:16px; height:4px; overflow:hidden} + +/* Menu */ +.wp_themeSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ddd} +.wp_themeSkin .noIcons span.icon {width:0;} +.wp_themeSkin .noIcons a .text {padding-left:10px} +.wp_themeSkin .mceMenu table {background:#ebeaeb} +.wp_themeSkin .mceMenu a, .wp_themeSkin .mceMenu span, .wp_themeSkin .mceMenu {display:block} +.wp_themeSkin .mceMenu td {height:20px} +.wp_themeSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.wp_themeSkin .mceMenu .text { +position:relative; +display:block; +font-family:Tahoma,Verdana,Arial,Helvetica; +color:#000; +cursor:default; +margin:0; +padding:0 25px 0 25px; +display:block +} +.wp_themeSkin .mceMenu span.text, .wp_themeSkin .mceMenu .preview {font-size:11px} +.wp_themeSkin .mceMenu pre.text {font-family:Monospace} +.wp_themeSkin .mceMenu .icon {position:absolute; top:0; left:0; width:22px;} +.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover, +.wp_themeSkin .mceMenu .mceMenuItemActive { +background-color: #CEE1EF; +} +.wp_themeSkin td.mceMenuItemSeparator {background:#aaa; height:1px} +.wp_themeSkin .mceMenuItemTitle a { +border:0; +background:#ccc; +border-bottom:1px solid #aaa; +} +.wp_themeSkin .mceMenuItemTitle span.text {color:#000; font-weight:bold; padding-left:4px} +.wp_themeSkin .mceMenuItemDisabled .text {color:#888} +.wp_themeSkin .mceMenuItemSelected .icon {background:url(../default/img/menu_check.gif)} +.wp_themeSkin .noIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.wp_themeSkin .mceMenu span.mceMenuLine {display:none} +.wp_themeSkin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.wp_themeSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; filter:alpha(opacity=50); background:#FFF} +.wp_themeSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} +.wp_themeSkin .mcePlaceHolder {border:1px dotted gray} + +/* Theme */ +.wp_themeSkin span.bold {background-position:0 0} +.wp_themeSkin span.italic {background-position:-60px 0} +.wp_themeSkin span.underline {background-position:-140px 0} +.wp_themeSkin span.strikethrough {background-position:-120px 0} +.wp_themeSkin span.undo {background-position:-160px 0} +.wp_themeSkin span.redo {background-position:-100px 0} +.wp_themeSkin span.cleanup {background-position:-40px 0} +.wp_themeSkin span.bullist {background-position:-20px 0} +.wp_themeSkin span.numlist {background-position:-80px 0} +.wp_themeSkin span.justifyleft {background-position:-460px 0} +.wp_themeSkin span.justifyright {background-position:-480px 0} +.wp_themeSkin span.justifycenter {background-position:-420px 0} +.wp_themeSkin span.justifyfull {background-position:-440px 0} +.wp_themeSkin span.anchor {background-position:-200px 0} +.wp_themeSkin span.indent {background-position:-400px 0} +.wp_themeSkin span.outdent {background-position:-540px 0} +.wp_themeSkin span.link {background-position:-500px 0} +.wp_themeSkin span.unlink {background-position:-640px 0} +.wp_themeSkin span.sub {background-position:-600px 0} +.wp_themeSkin span.sup {background-position:-620px 0} +.wp_themeSkin span.removeformat {background-position:-580px 0} +.wp_themeSkin span.newdocument {background-position:-520px 0} +.wp_themeSkin span.image {background-position:-380px 0} +.wp_themeSkin span.help {background-position:-340px 0} +.wp_themeSkin span.code {background-position:-260px 0} +.wp_themeSkin span.hr {background-position:-360px 0} +.wp_themeSkin span.visualaid {background-position:-660px 0} +.wp_themeSkin span.charmap {background-position:-240px 0} +.wp_themeSkin span.paste {background-position:-560px 0} +.wp_themeSkin span.copy {background-position:-700px 0} +.wp_themeSkin span.cut {background-position:-680px 0} +.wp_themeSkin span.blockquote {background-position:-220px 0} +.wp_themeSkin .forecolor span.action {background-position:-720px 0} +.wp_themeSkin .backcolor span.action {background-position:-760px 0} +.wp_themeSkin .forecolorpicker {background-position:-720px 0} +.wp_themeSkin .backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.wp_themeSkin span.advhr {background-position:-0px -20px} +.wp_themeSkin span.ltr {background-position:-20px -20px} +.wp_themeSkin span.rtl {background-position:-40px -20px} +.wp_themeSkin span.emotions {background-position:-60px -20px} +.wp_themeSkin span.fullpage {background-position:-80px -20px} +.wp_themeSkin span.fullscreen {background-position:-100px -20px} +.wp_themeSkin span.iespell {background-position:-120px -20px} +.wp_themeSkin span.insertdate {background-position:-140px -20px} +.wp_themeSkin span.inserttime {background-position:-160px -20px} +.wp_themeSkin span.absolute {background-position:-180px -20px} +.wp_themeSkin span.backward {background-position:-200px -20px} +.wp_themeSkin span.forward {background-position:-220px -20px} +.wp_themeSkin span.insert_layer {background-position:-240px -20px} +.wp_themeSkin span.insertlayer {background-position:-260px -20px} +.wp_themeSkin span.movebackward {background-position:-280px -20px} +.wp_themeSkin span.moveforward {background-position:-300px -20px} +.wp_themeSkin span.media {background-position:-320px -20px} +.wp_themeSkin span.nonbreaking {background-position:-340px -20px} +.wp_themeSkin span.pastetext {background-position:-360px -20px} +.wp_themeSkin span.pasteword {background-position:-380px -20px} +.wp_themeSkin span.selectall {background-position:-400px -20px} +.wp_themeSkin span.preview {background-position:-420px -20px} +.wp_themeSkin span.print {background-position:-440px -20px} +.wp_themeSkin span.cancel {background-position:-460px -20px} +.wp_themeSkin span.save {background-position:-480px -20px} +.wp_themeSkin span.replace {background-position:-500px -20px} +.wp_themeSkin span.search {background-position:-520px -20px} +.wp_themeSkin span.styleprops {background-position:-560px -20px} +.wp_themeSkin span.table {background-position:-580px -20px} +.wp_themeSkin span.cell_props {background-position:-600px -20px} +.wp_themeSkin span.delete_table {background-position:-620px -20px} +.wp_themeSkin span.delete_col {background-position:-640px -20px} +.wp_themeSkin span.delete_row {background-position:-660px -20px} +.wp_themeSkin span.col_after {background-position:-680px -20px} +.wp_themeSkin span.col_before {background-position:-700px -20px} +.wp_themeSkin span.row_after {background-position:-720px -20px} +.wp_themeSkin span.row_before {background-position:-740px -20px} +.wp_themeSkin span.merge_cells {background-position:-760px -20px} +.wp_themeSkin span.table_props {background-position:-980px -20px} +.wp_themeSkin span.row_props {background-position:-780px -20px} +.wp_themeSkin span.split_cells {background-position:-800px -20px} +.wp_themeSkin span.template {background-position:-820px -20px} +.wp_themeSkin span.visualchars {background-position:-840px -20px} +.wp_themeSkin span.abbr {background-position:-860px -20px} +.wp_themeSkin span.acronym {background-position:-880px -20px} +.wp_themeSkin span.attribs {background-position:-900px -20px} +.wp_themeSkin span.cite {background-position:-920px -20px} +.wp_themeSkin span.del {background-position:-940px -20px} +.wp_themeSkin span.ins {background-position:-960px -20px} +.wp_themeSkin span.pagebreak {background-position:0 -40px} +.wp_themeSkin .spellchecker span.action {background-position:-540px -20px} diff --git a/wp-includes/js/tinymce/themes/advanced/source_editor.htm b/wp-includes/js/tinymce/themes/advanced/source_editor.htm index b86cea27e..9e8005c4a 100644 --- a/wp-includes/js/tinymce/themes/advanced/source_editor.htm +++ b/wp-includes/js/tinymce/themes/advanced/source_editor.htm @@ -2,9 +2,10 @@ {#advanced_dlg.code_title} - + - + + @@ -20,11 +21,11 @@
    - +
    - +
    diff --git a/wp-includes/js/tinymce/tiny_mce.js b/wp-includes/js/tinymce/tiny_mce.js index cb2f5fd17..05a4b99e4 100644 --- a/wp-includes/js/tinymce/tiny_mce.js +++ b/wp-includes/js/tinymce/tiny_mce.js @@ -1,9089 +1 @@ - -/* file:jscripts/tiny_mce/classes/tinymce.js */ - -var tinymce = { - majorVersion : '3', - minorVersion : '0rc2', - releaseDate : '2008-01-xx', - - _init : function() { - var t = this, ua = navigator.userAgent, i, nl, n, base; - - // Browser checks - t.isOpera = window.opera && opera.buildNumber; - t.isWebKit = /WebKit/.test(ua); - t.isOldWebKit = t.isWebKit && !window.getSelection().getRangeAt; - t.isIE = !t.isWebKit && !t.isOpera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(navigator.appName); - t.isIE6 = t.isIE && /MSIE [56]/.test(ua); - t.isGecko = !t.isWebKit && /Gecko/.test(ua); -// t.isGecko3 = t.isGecko && /(Firefox|Minefield)\/[3-9]/.test(ua); - t.isMac = ua.indexOf('Mac') != -1; - - // TinyMCE .NET webcontrol might be setting the values for TinyMCE - if (window.tinyMCEPreInit) { - t.suffix = tinyMCEPreInit.suffix; - t.baseURL = tinyMCEPreInit.base; - return; - } - - // Get suffix and base - t.suffix = ''; - - // If base element found, add that infront of baseURL - nl = document.getElementsByTagName('base'); - for (i=0; i : - s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); - cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name - - // Create namespace for new class - ns = t.createNS(s[3].replace(/\.\w+$/, '')); - - // Class already exists - if (ns[cn]) - return; - - // Make pure static class - if (s[2] == 'static') { - ns[cn] = p; - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn]); - - return; - } - - // Create default constructor - if (!p[cn]) { - p[cn] = function() {}; - de = 1; - } - - // Add constructor and methods - ns[cn] = p[cn]; - t.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = t.resolve(s[5]).prototype; - scn = s[5].match(/\.(\w+)$/i)[1]; // Class name - - // Extend constructor - c = ns[cn]; - if (de) { - // Add passthrough constructor - ns[cn] = function() { - return sp[scn].apply(this, arguments); - }; - } else { - // Add inherit constructor - ns[cn] = function() { - this.parent = sp[scn]; - return c.apply(this, arguments); - }; - } - ns[cn].prototype[cn] = ns[cn]; - - // Add super methods - t.each(sp, function(f, n) { - if (n != scn) - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - t.each(p, function(f, n) { - // Extend methods if needed - if (sp[n]) { - ns[cn].prototype[n] = function() { - this.parent = sp[n]; - return f.apply(this, arguments); - }; - } else { - if (n != cn) - ns[cn].prototype[n] = f; - } - }); - } - - // Add static methods - t.each(p['static'], function(f, n) { - ns[cn][n] = f; - }); - - if (this.onCreate) - this.onCreate(s[2], s[3], ns[cn].prototype); - }, - - walk : function(o, f, n, s) { - s = s || this; - - if (o) { - if (n) - o = o[n]; - - tinymce.each(o, function(o, i) { - if (f.call(s, o, i, n) === false) - return false; - - tinymce.walk(o, f, n, s); - }); - } - }, - - createNS : function(n, o) { - var i, v; - - o = o || window; - - n = n.split('.'); - for (i=0; i= items.length) { - for (i = 0; i < base.length; i++) { - if (i >= items.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (base.length < items.length) { - for (i = 0; i < items.length; i++) { - if (i >= base.length || base[i] != items[i]) { - bp = i + 1; - break; - } - } - } - - if (bp == 1) - return path; - - for (i = 0; i < base.length - (bp - 1); i++) - out += "../"; - - for (i = bp - 1; i < items.length; i++) { - if (i != bp - 1) - out += "/" + items[i]; - else - out += items[i]; - } - - return out; - }, - - toAbsPath : function(base, path) { - var i, nb = 0, o = []; - - // Split paths - base = base.split('/'); - path = path.split('/'); - - // Remove empty chunks - each(base, function(k) { - if (k) - o.push(k); - }); - - base = o; - - // Merge relURLParts chunks - for (i = path.length - 1, o = []; i >= 0; i--) { - // Ignore empty or . - if (path[i].length == 0 || path[i] == ".") - continue; - - // Is parent - if (path[i] == '..') { - nb++; - continue; - } - - // Move up - if (nb > 0) { - nb--; - continue; - } - - o.push(path[i]); - } - - i = base.length - nb; - - // If /a/b/c or / - if (i <= 0) - return '/' + o.reverse().join('/'); - - return '/' + base.slice(0, i).join('/') + '/' + o.reverse().join('/'); - }, - - getURI : function(nh) { - var s, t = this; - - // Rebuild source - if (!t.source || nh) { - s = ''; - - if (!nh) { - if (t.protocol) - s += t.protocol + '://'; - - if (t.userInfo) - s += t.userInfo + '@'; - - if (t.host) - s += t.host; - - if (t.port) - s += ':' + t.port; - } - - if (t.path) - s += t.path; - - if (t.query) - s += '?' + t.query; - - if (t.anchor) - s += '#' + t.anchor; - - t.source = s; - } - - return t.source; - } - - }); -})(); - -/* file:jscripts/tiny_mce/classes/util/Cookie.js */ - -(function() { - var each = tinymce.each; - - tinymce.create('static tinymce.util.Cookie', { - getHash : function(n) { - var v = this.get(n), h; - - if (v) { - each(v.split('&'), function(v) { - v = v.split('='); - h = h || {}; - h[unescape(v[0])] = unescape(v[1]); - }); - } - - return h; - }, - - setHash : function(n, v, e, p, d, s) { - var o = ''; - - each(v, function(v, k) { - o += (!o ? '' : '&') + escape(k) + '=' + escape(v); - }); - - this.set(n, o, e, p, d, s); - }, - - get : function(n) { - var c = document.cookie, e, p = n + "=", b; - - // Strict mode - if (!c) - return; - - b = c.indexOf("; " + p); - - if (b == -1) { - b = c.indexOf(p); - - if (b != 0) - return null; - } else - b += 2; - - e = c.indexOf(";", b); - - if (e == -1) - e = c.length; - - return unescape(c.substring(b + p.length, e)); - }, - - set : function(n, v, e, p, d, s) { - document.cookie = n + "=" + escape(v) + - ((e) ? "; expires=" + e.toGMTString() : "") + - ((p) ? "; path=" + escape(p) : "") + - ((d) ? "; domain=" + d : "") + - ((s) ? "; secure" : ""); - }, - - remove : function(n, p) { - var d = new Date(); - - d.setTime(d.getTime() - 1000); - - this.set(n, '', d, p, d); - } - - }); -})(); - -/* file:jscripts/tiny_mce/classes/util/JSON.js */ - -tinymce.create('static tinymce.util.JSON', { - serialize : function(o) { - var i, v, s = tinymce.util.JSON.serialize, t; - - if (o == null) - return 'null'; - - t = typeof o; - - if (t == 'string') { - v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - - return '"' + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'])/g, function(a, b) { - i = v.indexOf(b); - - if (i + 1) - return '\\' + v.charAt(i + 1); - - a = b.charCodeAt().toString(16); - - return '\\u' + '0000'.substring(a.length) + a; - }) + '"'; - } - - if (t == 'object') { - if (o instanceof Array) { - for (i=0, v = '['; i 0 ? ',' : '') + s(o[i]); - - return v + ']'; - } - - v = '{'; - - for (i in o) - v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : ''; - - return v + '}'; - } - - return '' + o; - }, - - parse : function(s) { - try { - return eval('(' + s + ')'); - } catch (ex) { - // Ignore - } - } - - }); - -/* file:jscripts/tiny_mce/classes/util/XHR.js */ - -tinymce.create('static tinymce.util.XHR', { - send : function(o) { - var x, t, w = window, c = 0; - - // Default settings - o.scope = o.scope || this; - o.success_scope = o.success_scope || o.scope; - o.error_scope = o.error_scope || o.scope; - o.async = o.async === false ? false : true; - o.data = o.data || ''; - - function get(s) { - x = 0; - - try { - x = new ActiveXObject(s); - } catch (ex) { - } - - return x; - }; - - x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Microsoft.XMLHTTP') || get('Msxml2.XMLHTTP'); - - if (x) { - if (x.overrideMimeType) - x.overrideMimeType(o.content_type); - - x.open(o.type || (o.data ? 'POST' : 'GET'), o.url, o.async); - - if (o.content_type) - x.setRequestHeader('Content-Type', o.content_type); - - x.send(o.data); - - // Wait for response, onReadyStateChange can not be used since it leaks memory in IE - t = w.setInterval(function() { - if (x.readyState == 4 || c++ > 10000) { - w.clearInterval(t); - - if (o.success && c < 10000 && x.status == 200) - o.success.call(o.success_scope, '' + x.responseText, x, o); - else if (o.error) - o.error.call(o.error_scope, c > 10000 ? 'TIMED_OUT' : 'GENERAL', x, o); - - x = null; - } - }, 10); - } - - } -}); - -/* file:jscripts/tiny_mce/classes/util/JSONRequest.js */ - -(function() { - var extend = tinymce.extend, JSON = tinymce.util.JSON, XHR = tinymce.util.XHR; - - tinymce.create('tinymce.util.JSONRequest', { - JSONRequest : function(s) { - this.settings = extend({ - }, s); - this.count = 0; - }, - - send : function(o) { - var ecb = o.error, scb = o.success; - - o = extend(this.settings, o); - - o.success = function(c, x) { - c = JSON.parse(c); - - if (typeof(c) == 'undefined') { - c = { - error : 'JSON Parse error.' - }; - } - - if (c.error) - ecb.call(o.error_scope || o.scope, c.error, x); - else - scb.call(o.success_scope || o.scope, c.result); - }; - - o.error = function(ty, x) { - ecb.call(o.error_scope || o.scope, ty, x); - }; - - o.data = JSON.serialize({ - id : o.id || 'c' + (this.count++), - method : o.method, - params : o.params - }); - - XHR.send(o); - }, - - 'static' : { - sendRPC : function(o) { - return new tinymce.util.JSONRequest().send(o); - } - } - - }); -}()); -/* file:jscripts/tiny_mce/classes/dom/DOMUtils.js */ - -(function() { - // Shorten names - var each = tinymce.each, is = tinymce.is; - var isWebKit = tinymce.isWebKit, isIE = tinymce.isIE; - - tinymce.create('tinymce.dom.DOMUtils', { - doc : null, - root : null, - files : null, - listeners : {}, - pixelStyles : /^(top|left|bottom|right|width|height|borderWidth)$/, - cache : {}, - idPattern : /^#[\w]+$/, - elmPattern : /^[\w_*]+$/, - elmClassPattern : /^([\w_]*)\.([\w_]+)$/, - - DOMUtils : function(d, s) { - var t = this; - - t.doc = d; - t.files = {}; - t.cssFlicker = false; - t.counter = 0; - t.boxModel = !tinymce.isIE || d.compatMode == "CSS1Compat"; - - this.settings = s = tinymce.extend({ - keep_values : false, - hex_colors : 1 - }, s); - - // Fix IE6SP2 flicker and check it failed for pre SP2 - if (tinymce.isIE6) { - try { - d.execCommand('BackgroundImageCache', false, true); - } catch (e) { - t.cssFlicker = true; - } - } - - tinymce.addUnload(function() { - t.doc = t.root = null; - }); - }, - - getRoot : function() { - var t = this, s = t.settings; - - return (s && t.get(s.root_element)) || t.doc.body; - }, - - getViewPort : function(w) { - var d, b; - - w = !w ? window : w; - d = w.document; - b = this.boxModel ? d.documentElement : d.body; - - // Returns viewport size excluding scrollbars - return { - x : w.pageXOffset || b.scrollLeft, - y : w.pageYOffset || b.scrollTop, - w : w.innerWidth || b.clientWidth, - h : w.innerHeight || b.clientHeight - }; - }, - - getRect : function(e) { - var p, t = this, w, h; - - e = t.get(e); - p = t.getPos(e); - w = t.getStyle(e, 'width'); - h = t.getStyle(e, 'height'); - - // Non pixel value, then force offset/clientWidth - if (w.indexOf('px') === -1) - w = 0; - - // Non pixel value, then force offset/clientWidth - if (h.indexOf('px') === -1) - h = 0; - - return { - x : p.x, - y : p.y, - w : parseInt(w) || e.offsetWidth || e.clientWidth, - h : parseInt(h) || e.offsetHeight || e.clientHeight - }; - }, - - getParent : function(n, f, r) { - var na, se = this.settings; - - n = this.get(n); - - if (se.strict_root) - r = r || this.getRoot(); - - // Wrap node name as func - if (is(f, 'string')) { - na = f.toUpperCase(); - - f = function(n) { - var s = false; - - // Any element - if (n.nodeType == 1 && na === '*') { - s = true; - return false; - } - - each(na.split(','), function(v) { - if (n.nodeType == 1 && ((se.strict && n.nodeName.toUpperCase() == v) || n.nodeName == v)) { - s = true; - return false; // Break loop - } - }); - - return s; - }; - } - - while (n) { - if (n == r) - return null; - - if (f(n)) - return n; - - n = n.parentNode; - } - - return null; - }, - - get : function(e) { - if (typeof(e) == 'string') - return this.doc.getElementById(e); - - return e; - }, - - // #if !jquery - - select : function(pa, s) { - var t = this, cs, c, pl, o = [], x, i, l, n; - - s = t.get(s) || t.doc; - - if (t.settings.strict) { - function get(s, n) { - return s.getElementsByTagName(n.toLowerCase()); - }; - } else { - function get(s, n) { - return s.getElementsByTagName(n); - }; - } - - // Simple element pattern. For example: "p" or "*" - if (t.elmPattern.test(pa)) { - x = get(s, pa); - - for (i = 0, l = x.length; i= 0; i--) - cs += '}, ' + (i ? 'n' : 's') + ');'; - - cs += '})'; - - // Compile CSS pattern function - t.cache[pa] = cs = eval(cs); - } - - // Run selector function - cs(isIE ? collectIE : collect, s); - }); - - // Cleanup - each(o, function(n) { - if (isIE) - n.removeAttribute('mce_save'); - else - delete n.mce_save; - }); - - return o; - }, - - // #endif - - add : function(p, n, a, h, c) { - var t = this; - - return this.run(p, function(p) { - var e, k; - - e = is(n, 'string') ? t.doc.createElement(n) : n; - - if (a) { - for (k in a) { - if (a.hasOwnProperty(k) && !is(a[k], 'object')) - t.setAttrib(e, k, '' + a[k]); - } - - if (a.style && !is(a.style, 'string')) { - each(a.style, function(v, n) { - t.setStyle(e, n, v); - }); - } - } - - if (h) { - if (h.nodeType) - e.appendChild(h); - else - e.innerHTML = h; - } - - return !c ? p.appendChild(e) : e; - }); - }, - - create : function(n, a, h) { - return this.add(this.doc.createElement(n), n, a, h, 1); - }, - - createHTML : function(n, a, h) { - var o = '', t = this, k; - - o += '<' + n; - - for (k in a) { - if (a.hasOwnProperty(k)) - o += ' ' + k + '="' + t.encode(a[k]) + '"'; - } - - if (tinymce.is(h)) - return o + '>' + h + ''; - - return o + ' />'; - }, - - remove : function(n, k) { - return this.run(n, function(n) { - var p; - - p = n.parentNode; - - if (!p) - return null; - - if (k) { - each (n.childNodes, function(c) { - p.insertBefore(c.cloneNode(true), n); - }); - } - - return p.removeChild(n); - }); - }, - - // #if !jquery - - setStyle : function(n, na, v) { - var t = this; - - return t.run(n, function(e) { - var s, i; - - s = e.style; - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - // Default px suffix on these - if (t.pixelStyles.test(na) && (tinymce.is(v, 'number') || /^[\-0-9\.]+$/.test(v))) - v += 'px'; - - switch (na) { - case 'opacity': - // IE specific opacity - if (isIE) { - s.filter = v === '' ? '' : "alpha(opacity=" + (v * 100) + ")"; - - if (!n.currentStyle || !n.currentStyle.hasLayout) - s.display = 'inline-block'; - } - - // Fix for older browsers - s['-moz-opacity'] = s['-khtml-opacity'] = v; - break; - - case 'float': - isIE ? s.styleFloat = v : s.cssFloat = v; - break; - } - - s[na] = v || ''; - - // Force update of the style data - if (t.settings.update_styles) - t.setAttrib(e, 'mce_style'); - }); - }, - - getStyle : function(n, na, c) { - n = this.get(n); - - if (!n) - return false; - - // Gecko - if (this.doc.defaultView && c) { - // Remove camelcase - na = na.replace(/[A-Z]/g, function(a){ - return '-' + a; - }); - - try { - return this.doc.defaultView.getComputedStyle(n, null).getPropertyValue(na); - } catch (ex) { - // Old safari might fail - return null; - } - } - - // Camelcase it, if needed - na = na.replace(/-(\D)/g, function(a, b){ - return b.toUpperCase(); - }); - - if (na == 'float') - na = isIE ? 'styleFloat' : 'cssFloat'; - - // IE & Opera - if (n.currentStyle && c) - return n.currentStyle[na]; - - return n.style[na]; - }, - - setStyles : function(e, o) { - var t = this, s = t.settings, ol; - - ol = s.update_styles; - s.update_styles = 0; - - each(o, function(v, n) { - t.setStyle(e, n, v); - }); - - // Update style info - s.update_styles = ol; - if (s.update_styles) - t.setAttrib(e, s.cssText); - }, - - setAttrib : function(e, n, v) { - var t = this; - - // Strict XML mode - if (t.settings.strict) - n = n.toLowerCase(); - - return this.run(e, function(e) { - var s = t.settings; - - switch (n) { - case "style": - if (s.keep_values) { - if (v) - e.setAttribute('mce_style', v, 2); - else - e.removeAttribute('mce_style', 2); - } - - e.style.cssText = v; - break; - - case "class": - e.className = v; - break; - - case "src": - case "href": - if (s.keep_values) { - if (s.url_converter) - v = s.url_converter.call(s.url_converter_scope || t, v, n, e); - - t.setAttrib(e, 'mce_' + n, v, 2); - } - - break; - } - - if (is(v) && v !== null && v.length !== 0) - e.setAttribute(n, '' + v, 2); - else - e.removeAttribute(n, 2); - }); - }, - - setAttribs : function(e, o) { - var t = this; - - return this.run(e, function(e) { - each(o, function(v, n) { - t.setAttrib(e, n, v); - }); - }); - }, - - // #endif - - getAttrib : function(e, n, dv) { - var v, t = this; - - e = t.get(e); - - if (!e) - return false; - - if (!is(dv)) - dv = ""; - - // Try the mce variant for these - if (/^(src|href|style)$/.test(n)) { - v = e.getAttribute("mce_" + n); - - if (v) - return v; - } - - v = e.getAttribute(n, 2); - - if (!v) { - switch (n) { - case 'class': - v = e.className; - break; - - default: - v = e.attributes[n]; - v = v && is(v.nodeValue) ? v.nodeValue : v; - } - } - - switch (n) { - case 'style': - v = v || e.style.cssText; - - if (v) { - v = t.serializeStyle(t.parseStyle(v)); - - if (t.settings.keep_values) - e.setAttribute('mce_style', v); - } - - break; - } - - // Remove Apple and WebKit stuff - if (isWebKit && n === "class" && v) - v = v.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); - - // Handle IE issues - if (isIE) { - switch (n) { - case 'rowspan': - case 'colspan': - // IE returns 1 as default value - if (v === 1) - v = ''; - - break; - - case 'size': - // IE returns +0 as default value for size - if (v === '+0') - v = ''; - - break; - - case 'hspace': - // IE returns -1 as default value - if (v === -1) - v = ''; - - break; - - case 'tabindex': - // IE returns 32768 as default value - if (v === 32768) - v = ''; - - break; - - default: - // IE has odd anonymous function for event attributes - if (n.indexOf('on') === 0 && v) - v = ('' + v).replace(/^function\s+anonymous\(\)\s+\{\s+(.*)\s+\}$/, '$1'); - } - } - - return (v && v != '') ? '' + v : dv; - }, - - getPos : function(n) { - var t = this, x = 0, y = 0, e, d = t.doc; - - n = t.get(n); - - // Use getBoundingClientRect on IE, Opera has it but it's not perfect - if (n && isIE) { - n = n.getBoundingClientRect(); - e = t.boxModel ? d.documentElement : d.body; - x = t.getStyle(t.select('html')[0], 'borderWidth'); // Remove border - x = (x == 'medium' || t.boxModel && !t.isIE6) && 2 || x; - n.top += window.self != window.top ? 2 : 0; // IE adds some strange extra cord if used in a frameset - - return {x : n.left + e.scrollLeft - x, y : n.top + e.scrollTop - x}; - } - - while (n) { - x += n.offsetLeft || 0; - y += n.offsetTop || 0; - x -= n.scrollLeft || 0; - y -= n.scrollTop || 0; - n = n.offsetParent; - } - - return {x : x, y : y}; - }, - - parseStyle : function(st) { - var t = this, s = t.settings, o = {}; - - if (!st) - return o; - - function compress(p, s, ot) { - var t, r, b, l; - - // Get values and check it it needs compressing - t = o[p + '-top' + s]; - if (!t) - return; - - r = o[p + '-right' + s]; - if (t != r) - return; - - b = o[p + '-bottom' + s]; - if (r != b) - return; - - l = o[p + '-left' + s]; - if (b != l) - return; - - // Compress - o[ot] = l; - delete o[p + '-top' + s]; - delete o[p + '-right' + s]; - delete o[p + '-bottom' + s]; - delete o[p + '-left' + s]; - }; - - function compress2(ta, a, b, c) { - var t; - - t = o[a]; - if (!t) - return; - - t = o[b]; - if (!t) - return; - - t = o[c]; - if (!t) - return; - - // Compress - o[ta] = o[a] + ' ' + o[b] + ' ' + o[c]; - delete o[a]; - delete o[b]; - delete o[c]; - }; - - each(st.split(';'), function(v) { - var sv, ur = []; - - if (v) { - v = v.replace(/url\([^\)]+\)/g, function(v) {ur.push(v);return 'url(' + ur.length + ')';}); - v = v.split(':'); - sv = tinymce.trim(v[1]); - sv = sv.replace(/url\(([^\)]+)\)/g, function(a, b) {return ur[parseInt(b) - 1];}); - - sv = sv.replace(/rgb\([^\)]+\)/g, function(v) { - return t.toHex(v); - }); - - if (s.url_converter) { - sv = sv.replace(/url\([\'\"]?([^\)\'\"]+)[\'\"]?\)/g, function(x, c) { - return 'url(' + t.encode(s.url_converter.call(s.url_converter_scope || t, t.decode(c), 'style', null)) + ')'; - }); - } - - o[tinymce.trim(v[0]).toLowerCase()] = sv; - } - }); - - compress("border", "", "border"); - compress("border", "-width", "border-width"); - compress("border", "-color", "border-color"); - compress("border", "-style", "border-style"); - compress("padding", "", "padding"); - compress("margin", "", "margin"); - compress2('border', 'border-width', 'border-style', 'border-color'); - - return o; - }, - - serializeStyle : function(o) { - var s = ''; - - each(o, function(v, k) { - if (k && v) { - switch (k) { - case 'color': - case 'background-color': - v = v.toLowerCase(); - break; - } - - s += (s ? ' ' : '') + k + ': ' + v + ';'; - } - }); - - return s; - }, - - loadCSS : function(u) { - var t = this, d = this.doc; - - if (!u) - u = ''; - - each(u.split(','), function(u) { - if (t.files[u]) - return; - - t.files[u] = true; - - if (!d.createStyleSheet) - t.add(t.select('head')[0], 'link', {rel : 'stylesheet', href : u}); - else - d.createStyleSheet(u); - }); - }, - - // #if !jquery - - addClass : function(e, c) { - return this.run(e, function(e) { - var o; - - if (!c) - return 0; - - if (this.hasClass(e, c)) - return e.className; - - o = this.removeClass(e, c); - - return e.className = (o != '' ? (o + ' ') : '') + c; - }); - }, - - removeClass : function(e, c) { - var t = this, re; - - return t.run(e, function(e) { - var v; - - if (t.hasClass(e, c)) { - if (!re) - re = new RegExp("(^|\\s+)" + c + "(\\s+|$)", "g"); - - v = e.className.replace(re, ' '); - - return e.className = tinymce.trim(v != ' ' ? v : ''); - } - - return e.className; - }); - }, - - hasClass : function(n, c) { - n = this.get(n); - - if (!n || !c) - return false; - - return (' ' + n.className + ' ').indexOf(' ' + c + ' ') !== -1; - }, - - show : function(e) { - return this.setStyle(e, 'display', 'block'); - }, - - hide : function(e) { - return this.setStyle(e, 'display', 'none'); - }, - - isHidden : function(e) { - e = this.get(e); - - return e.style.display == 'none' || this.getStyle(e, 'display') == 'none'; - }, - - // #endif - - uniqueId : function(p) { - return (!p ? 'mce_' : p) + (this.counter++); - }, - - setHTML : function(e, h) { - var t = this; - - return this.run(e, function(e) { - var r; - - h = t.processHTML(h); - - if (isIE) { - e.innerHTML = '
    ' + h; - e.removeChild(e.firstChild); - } else - e.innerHTML = h; - - return h; - }); - }, - - processHTML : function(h) { - var t = this, s = t.settings; - - // Convert strong and em to b and i in FF since it can't handle them - if (tinymce.isGecko) { - h = h.replace(/<(\/?)strong>|]+)>/gi, '<$1b$2>'); - h = h.replace(/<(\/?)em>|]+)>/gi, '<$1i$2>'); - } - - // Fix some issues - h = h.replace(/<(a)([^>]*)\/>/gi, '<$1$2>'); // Force open - - // Store away src and href in mce_src and mce_href since browsers mess them up - if (s.keep_values) { - // Wrap scripts in comments for serialization purposes - if (h.indexOf('/g, ''); - -1) { - // Write main script and patch some things - if ( $index == 0 ) { - // Add core - $content .= wp_compact_tinymce_js(getFileContents("tiny_mce" . $suffix . ".js")); - $content .= 'TinyMCE.prototype.orgLoadScript = TinyMCE.prototype.loadScript;'; - $content .= 'TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;'; - } else - $content .= 'tinyMCE = realTinyMCE;'; + // Add core + if ( $core == 'true' ) { + $content .= getFileContents('tiny_mce' . $suffix . '.js'); - // Patch loading functions - //$content .= "tinyMCE_GZ.start();"; - - // Do init based on index - $content .= "tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"; - - // Load external plugins - if ( $index == 0 ) - $content .= "tinyMCECompressed.loadPlugins();"; + // Patch loading functions + $content .= 'tinyMCE_GZ.start();'; + } // Add core languages $lang_content = ''; - foreach ($languages as $lang) - $lang_content .= getFileContents("langs/" . $lang . ".js"); - if ( empty($lang_content) ) - $lang_content .= getFileContents("langs/en.js"); - $content .= $lang_content; + foreach ( $languages as $lang ) + $lang_content .= getFileContents('langs/' . $lang . '.js'); + + if ( empty($lang_content) && file_exists('langs/en.js') ) + $lang_content .= getFileContents('langs/en.js'); + + $content .= $lang_content; // Add themes - foreach ($themes as $theme) { - $content .= wp_compact_tinymce_js(getFileContents( "themes/" . $theme . "/editor_template" . $suffix . ".js")); + foreach ( $themes as $theme ) { + $content .= getFileContents( 'themes/' . $theme . '/editor_template' . $suffix . '.js'); $lang_content = ''; - foreach ($languages as $lang) - $lang_content .= getFileContents("themes/" . $theme . "/langs/" . $lang . ".js"); - if ( empty($lang_content) ) - $lang_content .= getFileContents("themes/" . $theme . "/langs/en.js"); - $content .= $lang_content; + foreach ( $languages as $lang ) + $lang_content .= getFileContents( 'themes/' . $theme . '/langs/' . $lang . '.js' ); + + if ( empty($lang_content) && file_exists( 'themes/' . $theme . '/langs/en.js' ) ) + $lang_content .= getFileContents( 'themes/' . $theme . '/langs/en.js' ); + + $content .= $lang_content; } // Add plugins - foreach ($plugins as $plugin) { - $content .= getFileContents("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js"); + foreach ( $plugins as $plugin ) { + $content .= getFileContents('plugins/' . $plugin . '/editor_plugin' . $suffix . '.js'); $lang_content = ''; - foreach ($languages as $lang) - $lang_content .= getFileContents("plugins/" . $plugin . "/langs/" . $lang . ".js"); - if ( empty($lang_content) ) - $lang_content .= getFileContents("plugins/" . $plugin . "/langs/en.js"); - $content .= $lang_content; + foreach ( $languages as $lang ) + $lang_content .= getFileContents( 'plugins/' . $plugin . '/langs/' . $lang . '.js' ); + + if ( empty($lang_content) && file_exists( 'plugins/' . $plugin . '/langs/en.js' ) ) + $lang_content .= getFileContents( 'plugins/' . $plugin . '/langs/en.js' ); + + $content .= $lang_content; } // Add custom files - foreach ($custom as $file) + foreach ( $custom as $file ) $content .= getFileContents($file); - // Reset tinyMCE compressor engine - $content .= "tinyMCE = tinyMCECompressed;"; - // Restore loading functions - //$content .= "tinyMCE_GZ.end();"; + if ( $core == 'true' ) + $content .= 'tinyMCE_GZ.end();'; // Generate GZIP'd content - if ($supportsGzip) { - if ($compress) { - header("Content-Encoding: " . $enc); - $cacheData = gzencode($content, 9, FORCE_GZIP); + if ( $supportsGzip ) { + if ( $compress ) { + header('Content-Encoding: ' . $enc); + $cacheData = gzencode( $content, 9, FORCE_GZIP ); } else $cacheData = $content; // Write gz file - if ($diskCache && $cacheKey != "") - putFileContents($cacheFile, $cacheData); + if ( $diskCache && $cacheKey != '' ) + putFileContents( $cacheFile, $cacheData ); // Stream to client echo $cacheData; @@ -184,183 +219,205 @@ if ($index > -1) { echo $content; } - die; + exit; } - - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - - function getParam($name, $def = false) { - if (!isset($_GET[$name])) - return $def; - - return preg_replace("/[^0-9a-z\-_,]+/i", "", $_GET[$name]); // Remove anything but 0-9,a-z,-_ - } - - function getFileContents($path) { - $path = realpath($path); - - if (!$path || !@is_file($path)) - return ""; - - if (function_exists("file_get_contents")) - return @file_get_contents($path); - - $content = ""; - $fp = @fopen($path, "r"); - if (!$fp) - return ""; - - while (!feof($fp)) - $content .= fgets($fp); - - fclose($fp); - - return $content; - } - - function putFileContents($path, $content) { - if (function_exists("file_put_contents")) - return @file_put_contents($path, $content); - - $fp = @fopen($path, "wb"); - if ($fp) { - fwrite($fp, $content); - fclose($fp); - } - } - - // WP specific - function wp_compact_tinymce_js($text) { - // This function was custom-made for TinyMCE 2.0, not expected to work with any other JS. - - // Strip comments - $text = preg_replace("!(^|\s+)//.*$!m", '', $text); - $text = preg_replace("!/\*.*?\*/!s", '', $text); - - // Strip leading tabs, carriage returns and unnecessary line breaks. - $text = preg_replace("!^\t+!m", '', $text); - $text = str_replace("\r", '', $text); - $text = preg_replace("!(^|{|}|;|:|\))\n!m", '\\1', $text); - - return "$text\n"; - } ?> -function TinyMCECompressed() { - this.configs = new Array(); - this.loadedFiles = new Array(); - this.externalPlugins = new Array(); - this.loadAdded = false; - this.isLoaded = false; -} +var tinyMCEPreInit = {suffix : ''}; -TinyMCECompressed.prototype.init = function(settings) { - var elements = document.getElementsByTagName('script'); - var scriptURL = ""; +var tinyMCE_GZ = { + settings : { + themes : '', + plugins : '', + languages : '', + disk_cache : false, + page_name : 'tiny_mce_gzip.php', + debug : false, + suffix : '' + }, + + opt : {}, + + init : function(arr, cb) { + var t = this, n, s, nl = document.getElementsByTagName('script'); + + t.opt = arr; - for (var i=0; i'); + + // Send request + x = w.XMLHttpRequest ? new XMLHttpRequest() : get('Msxml2.XMLHTTP') || get('Microsoft.XMLHTTP'); + x.overrideMimeType && x.overrideMimeType('text/javascript'); + x.open('GET', t.baseURL + '/' + s.page_name + '?' + q, !!cb); +// x.setRequestHeader('Content-Type', 'text/javascript'); + x.send(''); + + // Handle asyncronous loading + if (cb) { + // Wait for response + ti = w.setInterval(function() { + if (x.readyState == 4 || c++ > 10000) { + w.clearInterval(ti); + + if (c < 10000 && x.status == 200) { + t.loaded = 1; + t.eval(x.responseText); + tinymce.dom.Event.domLoaded = true; + // cb.call(sc || t, x); + } + + ti = x = null; + } + }, 10); + } else + t.eval(x.responseText); + }, + + start : function() { + var t = this, each = tinymce.each, s = t.settings, sl, ln = s.languages.split(','); + + tinymce.suffix = s.suffix; + + // Extend script loader + tinymce.create('tinymce.compressor.ScriptLoader:tinymce.dom.ScriptLoader', { + loadScripts : function(sc, cb, s) { + var ti = this, th = [], pl = [], la = []; + + each(sc, function(o) { + var u = o.url; + + if ((!ti.lookup[u] || ti.lookup[u].state != 2) && u.indexOf(t.baseURL) === 0) { + // Collect theme + if (u.indexOf('editor_template') != -1) { + th.push(/\/themes\/([^\/]+)/.exec(u)[1]); + load(u, 1); + } + + // Collect plugin + if (u.indexOf('editor_plugin') != -1) { + pl.push(/\/plugins\/([^\/]+)/.exec(u)[1]); + load(u, 1); + } + + // Collect language + if (u.indexOf('/langs/') != -1) { + la.push(/\/langs\/([^.]+)/.exec(u)[1]); + load(u, 1); + } + } + }); + + if (th.length + pl.length + la.length > 0) { + if (sl.settings.strict_mode) { + // Async + t.loadScripts(0, th.join(','), pl.join(','), la.join(','), cb, s); + return; + } else + t.loadScripts(0, th.join(','), pl.join(','), la.join(','), cb, s); + } + + return ti.parent(sc, cb, s); + } + }); + + sl = tinymce.ScriptLoader = new tinymce.compressor.ScriptLoader(); + + function load(u, sp) { + var o; + + if (!sp) + u = t.baseURL + u; + + o = {url : u, state : 2}; + sl.queue.push(o); + sl.lookup[o.url] = o; + }; + + // Add core languages + each (ln, function(c) { + if (c) + load('/langs/' + c + '.js'); + }); + + // Add themes with languages + each(s.themes.split(','), function(n) { + if (n) { + load('/themes/' + n + '/editor_template' + s.suffix + '.js'); + + each (ln, function(c) { + if (c) + load('/themes/' + n + '/langs/' + c + '.js'); + }); + } + }); + + // Add plugins with languages + each(s.plugins.split(','), function(n) { + if (n) { + load('/plugins/' + n + '/editor_plugin' + s.suffix + '.js'); + + each (ln, function(c) { + if (c) + load('/plugins/' + n + '/langs/' + c + '.js'); + }); + } + }); + }, + + end : function() { + tinyMCE.init(this.opt); + }, + + eval : function(co) { + var w = window; + + // Evaluate script + if (!w.execScript) { + try { + eval.call(w, co); + } catch (ex) { + eval(co, w); // Firefox 3.0a8 + } + } else + w.execScript(co); // IE } - - settings["theme"] = typeof(settings["theme"]) != "undefined" ? settings["theme"] : "default"; - settings["plugins"] = typeof(settings["plugins"]) != "undefined" ? settings["plugins"] : ""; - settings["language"] = typeof(settings["language"]) != "undefined" ? settings["language"] : "en"; - settings["button_tile_map"] = typeof(settings["button_tile_map"]) != "undefined" ? settings["button_tile_map"] : true; - this.configs[this.configs.length] = settings; - this.settings = settings; - - scriptURL += (scriptURL.indexOf('?') == -1) ? '?' : '&'; - scriptURL += "theme=" + escape(this.getOnce(settings["theme"])) + "&language=" + escape(this.getOnce(settings["language"])) + "&plugins=" + escape(this.getOnce(settings["plugins"])) + "&lang=" + settings["language"] + "&index=" + escape(this.configs.length-1); - document.write(''); - - if (!this.loadAdded) { - tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCECompressed.prototype.onLoad); - tinyMCE.addEvent(window, "load", TinyMCECompressed.prototype.onLoad); - this.loadAdded = true; - } -} - -TinyMCECompressed.prototype.onLoad = function() { - if (tinyMCE.isLoaded) - return true; - - tinyMCE = realTinyMCE; - TinyMCE_Engine.prototype.onLoad(); - tinyMCE._addUnloadEvents(); - - tinyMCE.isLoaded = true; -} - -TinyMCECompressed.prototype.addEvent = function(o, n, h) { - if (o.attachEvent) - o.attachEvent("on" + n, h); - else - o.addEventListener(n, h, false); -} - -TinyMCECompressed.prototype.getOnce = function(str) { - var ar = str.replace(/\s+/g, '').split(','); - - for (var i=0; i
    {#advanced_dlg.charmap_title}