diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index ff9d0928a..07d9fc3be 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -54,7 +54,7 @@ function convertEntities(o) { + { "url" : "../wp-includes/js/tinymce/tiny_mce.js", "src" : "../wp-includes/js/tinymce/tiny_mce.js?ver=", "ignoreQuery" : true }, { "url" : "../wp-includes/js/tinymce/langs/wp-langs-en.js", "src" : "../wp-includes/js/tinymce/langs/wp-langs-en.js?ver=", "ignoreQuery" : true }, -{ "url" : "../wp-includes/js/tinymce/wordpress.css", "src" : "../wp-includes/js/tinymce/wordpress.css?ver=", "ignoreQuery" : true }, { "url" : "../wp-includes/js/tinymce/utils/mctabs.js", "src" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=", "ignoreQuery" : true }, { "url" : "../wp-includes/js/tinymce/utils/validate.js", "src" : "../wp-includes/js/tinymce/utils/validate.js?ver=", "ignoreQuery" : true }, { "url" : "../wp-includes/js/tinymce/utils/form_utils.js", "src" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=", "ignoreQuery" : true }, 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 113d7e426..cfee3cf07 100644 --- a/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css +++ b/wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css @@ -3,12 +3,11 @@ .clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block;} /* General */ -.clearlooks2 div, .clearlooks2 span, .clearlooks2 a {position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block;} -.clearlooks2 {position:absolute;} +.clearlooks2 {position:absolute; direction:ltr} .clearlooks2 .mceWrapper {position:static} -.mceEventBlocker {position:absolute; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%;} -.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; filter:alpha(opacity=50);} -.clearlooks2_modalBlocker {position:absolute; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; filter:alpha(opacity=60); display:none} +.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%} +.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)} +.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none} /* Top */ .clearlooks2 .mceTop, diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js new file mode 100644 index 000000000..0951dcec6 --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.dev.js @@ -0,0 +1,296 @@ +/** + * WordPress plugin. + */ + +(function() { + var DOM = tinymce.DOM; + + tinymce.create('tinymce.plugins.WordPress', { + init : function(ed, url) { + var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML; + moreHTML = ''; + nextpageHTML = ''; + + if ( getUserSetting('hidetb', '0') == '1' ) + ed.settings.wordpress_adv_hidden = 0; + + // Hides the specified toolbar and resizes the iframe + ed.onPostRender.add(function() { + if ( ed.getParam('wordpress_adv_hidden', 1) ) { + DOM.hide(ed.controlManager.get(tbId).id); + t._resizeIframe(ed, tbId, 28); + } + }); + + // Register commands + ed.addCommand('WP_More', function() { + ed.execCommand('mceInsertContent', 0, moreHTML); + }); + + ed.addCommand('WP_Page', function() { + ed.execCommand('mceInsertContent', 0, nextpageHTML); + }); + + ed.addCommand('WP_Help', function() { + ed.windowManager.open({ + url : tinymce.baseURL + '/wp-mce-help.php', + width : 450, + height : 420, + inline : 1 + }); + }); + + ed.addCommand('WP_Adv', function() { + var id = ed.controlManager.get(tbId).id, cm = ed.controlManager; + + if (DOM.isHidden(id)) { + cm.setActive('wp_adv', 1); + DOM.show(id); + t._resizeIframe(ed, tbId, -28); + ed.settings.wordpress_adv_hidden = 0; + setUserSetting('hidetb', '1'); + } else { + cm.setActive('wp_adv', 0); + DOM.hide(id); + t._resizeIframe(ed, tbId, 28); + ed.settings.wordpress_adv_hidden = 1; + setUserSetting('hidetb', '0'); + } + }); + + // Register buttons + ed.addButton('wp_more', { + title : 'wordpress.wp_more_desc', + image : url + '/img/more.gif', + cmd : 'WP_More' + }); + + ed.addButton('wp_page', { + title : 'wordpress.wp_page_desc', + image : url + '/img/page.gif', + cmd : 'WP_Page' + }); + + ed.addButton('wp_help', { + title : 'wordpress.wp_help_desc', + image : url + '/img/help.gif', + cmd : 'WP_Help' + }); + + ed.addButton('wp_adv', { + title : 'wordpress.wp_adv_desc', + image : url + '/img/toolbars.gif', + cmd : 'WP_Adv' + }); + + // Add Media buttons + ed.addButton('add_media', { + title : 'wordpress.add_media', + image : url + '/img/media.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_media').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + } + }); + + ed.addButton('add_image', { + title : 'wordpress.add_image', + image : url + '/img/image.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_image').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + } + }); + + ed.addButton('add_video', { + title : 'wordpress.add_video', + image : url + '/img/video.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_video').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + } + }); + + ed.addButton('add_audio', { + title : 'wordpress.add_audio', + image : url + '/img/audio.gif', + onclick : function() { + tb_show('', tinymce.DOM.get('add_audio').href); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + } + }); + + // Add Media buttons to fullscreen + ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + if ( 'mceFullScreen' != cmd ) return; + if ( 'mce_fullscreen' != ed.id ) + ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media'; + }); + + // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images. + ed.addCommand('JustifyLeft', function() { + var n = ed.selection.getNode(); + + if ( n.nodeName != 'IMG' ) + ed.editorCommands.mceJustify('JustifyLeft', 'left'); + else ed.plugins.wordpress.do_align(n, 'alignleft'); + }); + + ed.addCommand('JustifyRight', function() { + var n = ed.selection.getNode(); + + if ( n.nodeName != 'IMG' ) + ed.editorCommands.mceJustify('JustifyRight', 'right'); + else ed.plugins.wordpress.do_align(n, 'alignright'); + }); + + ed.addCommand('JustifyCenter', function() { + var n = ed.selection.getNode(), P = ed.dom.getParent(n, 'p'), DL = ed.dom.getParent(n, 'dl'); + + if ( n.nodeName == 'IMG' && ( P || DL ) ) + ed.plugins.wordpress.do_align(n, 'aligncenter'); + else ed.editorCommands.mceJustify('JustifyCenter', 'center'); + }); + + // Word count if script is loaded + if ( 'undefined' != typeof wpWordCount ) { + ed.onKeyUp.add(function(ed, e) { + if ( e.keyCode == last ) return; + if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); + last = e.keyCode; + }); + }; + + // Add listeners to handle more break + t._handleMoreBreak(ed, url); + + // Add custom shortcuts + ed.addShortcut('alt+shift+c', ed.getLang('justifycenter_desc'), 'JustifyCenter'); + ed.addShortcut('alt+shift+r', ed.getLang('justifyright_desc'), 'JustifyRight'); + ed.addShortcut('alt+shift+l', ed.getLang('justifyleft_desc'), 'JustifyLeft'); + ed.addShortcut('alt+shift+j', ed.getLang('justifyfull_desc'), 'JustifyFull'); + ed.addShortcut('alt+shift+q', ed.getLang('blockquote_desc'), 'mceBlockQuote'); + ed.addShortcut('alt+shift+u', ed.getLang('bullist_desc'), 'InsertUnorderedList'); + ed.addShortcut('alt+shift+o', ed.getLang('numlist_desc'), 'InsertOrderedList'); + ed.addShortcut('alt+shift+d', ed.getLang('striketrough_desc'), 'Strikethrough'); + ed.addShortcut('alt+shift+n', ed.getLang('spellchecker.desc'), 'mceSpellCheck'); + ed.addShortcut('alt+shift+a', ed.getLang('link_desc'), 'mceLink'); + ed.addShortcut('alt+shift+s', ed.getLang('unlink_desc'), 'unlink'); + ed.addShortcut('alt+shift+m', ed.getLang('image_desc'), 'mceImage'); + ed.addShortcut('alt+shift+g', ed.getLang('fullscreen.desc'), 'mceFullScreen'); + ed.addShortcut('alt+shift+z', ed.getLang('wp_adv_desc'), 'WP_Adv'); + ed.addShortcut('alt+shift+h', ed.getLang('help_desc'), 'WP_Help'); + ed.addShortcut('alt+shift+t', ed.getLang('wp_more_desc'), 'WP_More'); + ed.addShortcut('alt+shift+p', ed.getLang('wp_page_desc'), 'WP_Page'); + + if ( tinymce.isWebKit ) { + ed.addShortcut('alt+shift+b', ed.getLang('bold_desc'), 'Bold'); + ed.addShortcut('alt+shift+i', ed.getLang('italic_desc'), 'Italic'); + } + }, + + getInfo : function() { + return { + longname : 'WordPress Plugin', + author : 'WordPress', // add Moxiecode? + authorurl : 'http://wordpress.org', + infourl : 'http://wordpress.org', + version : '3.0' + }; + }, + + // Internal functions + do_align : function(n, a) { + var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor; + + if ( /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className) ) + return; + + P = ed.dom.getParent(n, 'p'); + DL = ed.dom.getParent(n, 'dl'); + DIV = ed.dom.getParent(n, 'div'); + + if ( DL && DIV ) { + cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a; + DL.className = DL.className.replace(/align[^ '"]+\s?/g, ''); + ed.dom.addClass(DL, cls); + c = (cls == 'aligncenter') ? ed.dom.addClass(DIV, 'mceIEcenter') : ed.dom.removeClass(DIV, 'mceIEcenter'); + } else if ( P ) { + cls = ed.dom.hasClass(n, a) ? 'alignnone' : a; + n.className = n.className.replace(/align[^ '"]+\s?/g, ''); + ed.dom.addClass(n, cls); + if ( cls == 'aligncenter' ) + ed.dom.setStyle(P, 'textAlign', 'center'); + else if (P.style && P.style.textAlign == 'center') + ed.dom.setStyle(P, 'textAlign', ''); + } + + ed.execCommand('mceRepaint'); + }, + + // 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, nextpageHTML; + + moreHTML = '$1'; + 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'; + } + + }); + } + }); + + // Replace morebreak with images + ed.onBeforeSetContent.add(function(ed, o) { + o.content = o.content.replace(//g, moreHTML); + o.content = o.content.replace(//g, nextpageHTML); + }); + + // 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, moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : ''; + im = ''; + } + if (im.indexOf('class="mceWPnextpage') !== -1) + im = ''; + + return im; + }); + }); + + // 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')); + }); + } + }); + + // Register plugin + tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress); +})(); diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index f5ce86158..dad386dcf 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -1,298 +1 @@ -/** - * WordPress plugin. - */ - -(function() { - var DOM = tinymce.DOM; - - // Load plugin specific language pack - tinymce.PluginManager.requireLangPack('wordpress'); - - tinymce.create('tinymce.plugins.WordPress', { - init : function(ed, url) { - var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'); - var moreHTML = ''; - var nextpageHTML = ''; - - if ( getUserSetting('hidetb', '0') == '1' ) - ed.settings.wordpress_adv_hidden = 0; - - // Hides the specified toolbar and resizes the iframe - ed.onPostRender.add(function() { - if ( ed.getParam('wordpress_adv_hidden', 1) ) { - DOM.hide(ed.controlManager.get(tbId).id); - t._resizeIframe(ed, tbId, 28); - } - }); - - // Register commands - ed.addCommand('WP_More', function() { - ed.execCommand('mceInsertContent', 0, moreHTML); - }); - - ed.addCommand('WP_Page', function() { - ed.execCommand('mceInsertContent', 0, nextpageHTML); - }); - - ed.addCommand('WP_Help', function() { - ed.windowManager.open({ - url : tinymce.baseURL + '/wp-mce-help.php', - width : 450, - height : 420, - inline : 1 - }); - }); - - ed.addCommand('WP_Adv', function() { - var id = ed.controlManager.get(tbId).id, cm = ed.controlManager; - - if (DOM.isHidden(id)) { - cm.setActive('wp_adv', 1); - DOM.show(id); - t._resizeIframe(ed, tbId, -28); - ed.settings.wordpress_adv_hidden = 0; - setUserSetting('hidetb', '1'); - } else { - cm.setActive('wp_adv', 0); - DOM.hide(id); - t._resizeIframe(ed, tbId, 28); - ed.settings.wordpress_adv_hidden = 1; - setUserSetting('hidetb', '0'); - } - }); - - // Register buttons - ed.addButton('wp_more', { - title : 'wordpress.wp_more_desc', - image : url + '/img/more.gif', - cmd : 'WP_More' - }); - - ed.addButton('wp_page', { - title : 'wordpress.wp_page_desc', - image : url + '/img/page.gif', - cmd : 'WP_Page' - }); - - ed.addButton('wp_help', { - title : 'wordpress.wp_help_desc', - image : url + '/img/help.gif', - cmd : 'WP_Help' - }); - - ed.addButton('wp_adv', { - title : 'wordpress.wp_adv_desc', - image : url + '/img/toolbars.gif', - cmd : 'WP_Adv' - }); - - // Add Media buttons - ed.addButton('add_media', { - title : 'wordpress.add_media', - image : url + '/img/media.gif', - onclick : function() { - tb_show('', tinymce.DOM.get('add_media').href); - tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); - } - }); - - ed.addButton('add_image', { - title : 'wordpress.add_image', - image : url + '/img/image.gif', - onclick : function() { - tb_show('', tinymce.DOM.get('add_image').href); - tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); - } - }); - - ed.addButton('add_video', { - title : 'wordpress.add_video', - image : url + '/img/video.gif', - onclick : function() { - tb_show('', tinymce.DOM.get('add_video').href); - tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); - } - }); - - ed.addButton('add_audio', { - title : 'wordpress.add_audio', - image : url + '/img/audio.gif', - onclick : function() { - tb_show('', tinymce.DOM.get('add_audio').href); - tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); - } - }); - - // Add Media buttons to fullscreen - ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { - if ( 'mceFullScreen' != cmd ) return; - if ( 'mce_fullscreen' != ed.id ) - ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media'; - }); - - // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images. - ed.addCommand('JustifyLeft', function() { - var n = ed.selection.getNode(); - - if ( n.nodeName != 'IMG' ) - ed.editorCommands.mceJustify('JustifyLeft', 'left'); - else ed.plugins.wordpress.do_align(n, 'alignleft'); - }); - - ed.addCommand('JustifyRight', function() { - var n = ed.selection.getNode(); - - if ( n.nodeName != 'IMG' ) - ed.editorCommands.mceJustify('JustifyRight', 'right'); - else ed.plugins.wordpress.do_align(n, 'alignright'); - }); - - ed.addCommand('JustifyCenter', function() { - var n = ed.selection.getNode(), P = ed.dom.getParent(n, 'p'), DL = ed.dom.getParent(n, 'dl'); - - if ( n.nodeName == 'IMG' && ( P || DL ) ) - ed.plugins.wordpress.do_align(n, 'aligncenter'); - else ed.editorCommands.mceJustify('JustifyCenter', 'center'); - }); - - // Word count if script is loaded - if ( 'undefined' != typeof wpWordCount ) { - var last = 0; - ed.onKeyUp.add(function(ed, e) { - if ( e.keyCode == last ) return; - if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); - last = e.keyCode; - }); - }; - - // Add listeners to handle more break - t._handleMoreBreak(ed, url); - - // Add custom shortcuts - ed.addShortcut('alt+shift+c', ed.getLang('justifycenter_desc'), 'JustifyCenter'); - ed.addShortcut('alt+shift+r', ed.getLang('justifyright_desc'), 'JustifyRight'); - ed.addShortcut('alt+shift+l', ed.getLang('justifyleft_desc'), 'JustifyLeft'); - ed.addShortcut('alt+shift+j', ed.getLang('justifyfull_desc'), 'JustifyFull'); - ed.addShortcut('alt+shift+q', ed.getLang('blockquote_desc'), 'mceBlockQuote'); - ed.addShortcut('alt+shift+u', ed.getLang('bullist_desc'), 'InsertUnorderedList'); - ed.addShortcut('alt+shift+o', ed.getLang('numlist_desc'), 'InsertOrderedList'); - ed.addShortcut('alt+shift+d', ed.getLang('striketrough_desc'), 'Strikethrough'); - ed.addShortcut('alt+shift+n', ed.getLang('spellchecker.desc'), 'mceSpellCheck'); - ed.addShortcut('alt+shift+a', ed.getLang('link_desc'), 'mceLink'); - ed.addShortcut('alt+shift+s', ed.getLang('unlink_desc'), 'unlink'); - ed.addShortcut('alt+shift+m', ed.getLang('image_desc'), 'mceImage'); - ed.addShortcut('alt+shift+g', ed.getLang('fullscreen.desc'), 'mceFullScreen'); - ed.addShortcut('alt+shift+z', ed.getLang('wp_adv_desc'), 'WP_Adv'); - ed.addShortcut('alt+shift+h', ed.getLang('help_desc'), 'WP_Help'); - ed.addShortcut('alt+shift+t', ed.getLang('wp_more_desc'), 'WP_More'); - ed.addShortcut('alt+shift+p', ed.getLang('wp_page_desc'), 'WP_Page'); - - if ( tinymce.isWebKit ) { - ed.addShortcut('alt+shift+b', ed.getLang('bold_desc'), 'Bold'); - ed.addShortcut('alt+shift+i', ed.getLang('italic_desc'), 'Italic'); - } - }, - - getInfo : function() { - return { - longname : 'WordPress Plugin', - author : 'WordPress', // add Moxiecode? - authorurl : 'http://wordpress.org', - infourl : 'http://wordpress.org', - version : '3.0' - }; - }, - - // Internal functions - do_align : function(n, a) { - var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor; - - if ( /^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(n.className) ) - return; - - P = ed.dom.getParent(n, 'p'); - DL = ed.dom.getParent(n, 'dl'); - DIV = ed.dom.getParent(n, 'div'); - - if ( DL && DIV ) { - cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a; - DL.className = DL.className.replace(/align[^ '"]+\s?/g, ''); - ed.dom.addClass(DL, cls); - c = (cls == 'aligncenter') ? ed.dom.addClass(DIV, 'mceIEcenter') : ed.dom.removeClass(DIV, 'mceIEcenter'); - } else if ( P ) { - cls = ed.dom.hasClass(n, a) ? 'alignnone' : a; - n.className = n.className.replace(/align[^ '"]+\s?/g, ''); - ed.dom.addClass(n, cls); - if ( cls == 'aligncenter' ) - ed.dom.setStyle(P, 'textAlign', 'center'); - else if (P.style && P.style.textAlign == 'center') - ed.dom.setStyle(P, 'textAlign', ''); - } - - ed.execCommand('mceRepaint'); - }, - - // 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'; - } - - }); - } - }); - - // Replace morebreak with images - ed.onBeforeSetContent.add(function(ed, o) { - o.content = o.content.replace(//g, moreHTML); - o.content = o.content.replace(//g, nextpageHTML); - }); - - // 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, moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : ''; - im = ''; - } - if (im.indexOf('class="mceWPnextpage') !== -1) - im = ''; - - return im; - }); - }); - - // 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')); - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('wordpress', tinymce.plugins.WordPress); -})(); +(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{init:function(c,d){var e=this,h=c.getParam("wordpress_adv_toolbar","toolbar2"),g=0,f,b;f='';b='';if(getUserSetting("hidetb","0")=="1"){c.settings.wordpress_adv_hidden=0}c.onPostRender.add(function(){if(c.getParam("wordpress_adv_hidden",1)){a.hide(c.controlManager.get(h).id);e._resizeIframe(c,h,28)}});c.addCommand("WP_More",function(){c.execCommand("mceInsertContent",0,f)});c.addCommand("WP_Page",function(){c.execCommand("mceInsertContent",0,b)});c.addCommand("WP_Help",function(){c.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});c.addCommand("WP_Adv",function(){var j=c.controlManager.get(h).id,i=c.controlManager;if(a.isHidden(j)){i.setActive("wp_adv",1);a.show(j);e._resizeIframe(c,h,-28);c.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{i.setActive("wp_adv",0);a.hide(j);e._resizeIframe(c,h,28);c.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});c.addButton("wp_more",{title:"wordpress.wp_more_desc",image:d+"/img/more.gif",cmd:"WP_More"});c.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});c.addButton("wp_help",{title:"wordpress.wp_help_desc",image:d+"/img/help.gif",cmd:"WP_Help"});c.addButton("wp_adv",{title:"wordpress.wp_adv_desc",image:d+"/img/toolbars.gif",cmd:"WP_Adv"});c.addButton("add_media",{title:"wordpress.add_media",image:d+"/img/media.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_media").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_image",{title:"wordpress.add_image",image:d+"/img/image.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_image").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_video",{title:"wordpress.add_video",image:d+"/img/video.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_video").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.addButton("add_audio",{title:"wordpress.add_audio",image:d+"/img/audio.gif",onclick:function(){tb_show("",tinymce.DOM.get("add_audio").href);tinymce.DOM.setStyle(["TB_overlay","TB_window","TB_load"],"z-index","999999")}});c.onBeforeExecCommand.add(function(i,k,j,l){if("mceFullScreen"!=k){return}if("mce_fullscreen"!=i.id){i.settings.theme_advanced_buttons1+=",|,add_image,add_video,add_audio,add_media"}});c.addCommand("JustifyLeft",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyLeft","left")}else{c.plugins.wordpress.do_align(i,"alignleft")}});c.addCommand("JustifyRight",function(){var i=c.selection.getNode();if(i.nodeName!="IMG"){c.editorCommands.mceJustify("JustifyRight","right")}else{c.plugins.wordpress.do_align(i,"alignright")}});c.addCommand("JustifyCenter",function(){var k=c.selection.getNode(),j=c.dom.getParent(k,"p"),i=c.dom.getParent(k,"dl");if(k.nodeName=="IMG"&&(j||i)){c.plugins.wordpress.do_align(k,"aligncenter")}else{c.editorCommands.mceJustify("JustifyCenter","center")}});if("undefined"!=typeof wpWordCount){c.onKeyUp.add(function(i,j){if(j.keyCode==g){return}if(13==j.keyCode||8==g||46==g){wpWordCount.wc(i.getContent({format:"raw"}))}g=j.keyCode})}e._handleMoreBreak(c,d);c.addShortcut("alt+shift+c",c.getLang("justifycenter_desc"),"JustifyCenter");c.addShortcut("alt+shift+r",c.getLang("justifyright_desc"),"JustifyRight");c.addShortcut("alt+shift+l",c.getLang("justifyleft_desc"),"JustifyLeft");c.addShortcut("alt+shift+j",c.getLang("justifyfull_desc"),"JustifyFull");c.addShortcut("alt+shift+q",c.getLang("blockquote_desc"),"mceBlockQuote");c.addShortcut("alt+shift+u",c.getLang("bullist_desc"),"InsertUnorderedList");c.addShortcut("alt+shift+o",c.getLang("numlist_desc"),"InsertOrderedList");c.addShortcut("alt+shift+d",c.getLang("striketrough_desc"),"Strikethrough");c.addShortcut("alt+shift+n",c.getLang("spellchecker.desc"),"mceSpellCheck");c.addShortcut("alt+shift+a",c.getLang("link_desc"),"mceLink");c.addShortcut("alt+shift+s",c.getLang("unlink_desc"),"unlink");c.addShortcut("alt+shift+m",c.getLang("image_desc"),"mceImage");c.addShortcut("alt+shift+g",c.getLang("fullscreen.desc"),"mceFullScreen");c.addShortcut("alt+shift+z",c.getLang("wp_adv_desc"),"WP_Adv");c.addShortcut("alt+shift+h",c.getLang("help_desc"),"WP_Help");c.addShortcut("alt+shift+t",c.getLang("wp_more_desc"),"WP_More");c.addShortcut("alt+shift+p",c.getLang("wp_page_desc"),"WP_Page");if(tinymce.isWebKit){c.addShortcut("alt+shift+b",c.getLang("bold_desc"),"Bold");c.addShortcut("alt+shift+i",c.getLang("italic_desc"),"Italic")}},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},do_align:function(j,d){var h,f,g,b,i,e=tinyMCE.activeEditor;if(/^(mceItemFlash|mceItemShockWave|mceItemWindowsMedia|mceItemQuickTime|mceItemRealMedia)$/.test(j.className)){return}h=e.dom.getParent(j,"p");f=e.dom.getParent(j,"dl");g=e.dom.getParent(j,"div");if(f&&g){b=e.dom.hasClass(f,d)?"alignnone":d;f.className=f.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(f,b);i=(b=="aligncenter")?e.dom.addClass(g,"mceIEcenter"):e.dom.removeClass(g,"mceIEcenter")}else{if(h){b=e.dom.hasClass(j,d)?"alignnone":d;j.className=j.className.replace(/align[^ '"]+\s?/g,"");e.dom.addClass(j,b);if(b=="aligncenter"){e.dom.setStyle(h,"textAlign","center")}else{if(h.style&&h.style.textAlign=="center"){e.dom.setStyle(h,"textAlign","")}}}}e.execCommand("mceRepaint")},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='$1';b='';c.onInit.add(function(){c.dom.loadCSS(d+"/css/content.css")});c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){g.content=g.content.replace(//g,e);g.content=g.content.replace(//g,b)});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i=""}if(i.indexOf('class="mceWPnextpage')!==-1){i=""}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js new file mode 100644 index 000000000..2e256a07a --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.dev.js @@ -0,0 +1,243 @@ + +(function() { + tinymce.create('tinymce.plugins.wpEditImage', { + + init : function(ed, url) { + var t = this; + + t.url = url; + t._createButtons(); + + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...'); + ed.addCommand('WP_EditImage', function() { + var el = ed.selection.getNode(), vp = tinymce.DOM.getViewPort(), H = vp.h, W = ( 720 < vp.w ) ? 720 : vp.w, cls = ed.dom.getAttrib(el, 'class'); + + if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' ) + return; + + tb_show('', url + '/editimage.html?ver=321&TB_iframe=true'); + tinymce.DOM.setStyles('TB_window', { + 'width':( W - 50 )+'px', + 'height':( H - 45 )+'px', + 'margin-left':'-'+parseInt((( W - 50 ) / 2),10) + 'px' + }); + + if ( ! tinymce.isIE6 ) { + tinymce.DOM.setStyles('TB_window', { + 'top':'20px', + 'marginTop':'0' + }); + } + + tinymce.DOM.setStyles('TB_iframeContent', { + 'width':( W - 50 )+'px', + 'height':( H - 75 )+'px' + }); + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + }); + + ed.onInit.add(function(ed) { + tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { + ed.plugins.wpeditimage.hideButtons(); + }); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + ed.plugins.wpeditimage.hideButtons(); + }); + + ed.onSaveContent.add(function(ed, o) { + ed.plugins.wpeditimage.hideButtons(); + }); + + ed.onMouseUp.add(function(ed, e) { + var n, DL; + + if ( tinymce.isOpera ) { + if ( e.target.nodeName == 'IMG' ) + ed.plugins.wpeditimage.showButtons(e.target); + } else if ( ! tinymce.isWebKit ) { + n = ed.selection.getNode(); + + if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) { + window.setTimeout(function(){ + var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL'); + + if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) { + ed.dom.setStyle(DL, 'width', parseInt(n.width)+10); + ed.execCommand('mceRepaint'); + } + }, 100); + } + } + }); + + ed.onMouseDown.add(function(ed, e) { + if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) { + t.hideButtons(); + return; + } + ed.plugins.wpeditimage.showButtons(e.target); + }); + + ed.onKeyPress.add(function(ed, e) { + var DL, DIV, P; + + if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) ) { + P = ed.dom.create('p', {}, ' '); + if ( (DIV = DL.parentNode) && DIV.nodeName == 'DIV' ) + ed.dom.insertAfter( P, DIV ); + else ed.dom.insertAfter( P, DL ); + + tinymce.dom.Event.cancel(e); + ed.selection.select(P); + return false; + } + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t._do_shcode(o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = t._get_shcode(o.content); + }); + }, + + _do_shcode : function(co) { + return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){ + var id, cls, w, cap, div_cls; + + b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); + c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); + id = b.match(/id=['"]([^'"]+)/i); + cls = b.match(/align=['"]([^'"]+)/i); + w = b.match(/width=['"]([0-9]+)/); + cap = b.match(/caption=['"]([^'"]+)/i); + + id = ( id && id[1] ) ? id[1] : ''; + cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; + w = ( w && w[1] ) ? w[1] : ''; + cap = ( cap && cap[1] ) ? cap[1] : ''; + if ( ! w || ! cap ) return c; + + div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; + + return '
'+c+'
'+cap+'
'; + }); + }, + + _get_shcode : function(co) { + return co.replace(/
\s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ + var id, cls, w; + + id = b.match(/id=['"]([^'"]+)/i); + cls = b.match(/class=['"]([^'"]+)/i); + w = c.match(/width=['"]([0-9]+)/); + + id = ( id && id[1] ) ? id[1] : ''; + cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; + w = ( w && w[1] ) ? w[1] : ''; + + if ( ! w || ! cap ) return c; + cls = cls.match(/align[^ '"]+/) || 'alignnone'; + cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"'); + + return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; + }); + }, + + showButtons : function(n) { + var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y, cls = ed.dom.getAttrib(n, 'class'); + + if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 ) + return; + + vp = ed.dom.getViewPort(ed.getWin()); + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = ed.dom.getPos(n); + + X = Math.max(p2.x - vp.x, 0) + p1.x; + Y = Math.max(p2.y - vp.y, 0) + p1.y; + + DOM.setStyles('wp_editbtns', { + 'top' : Y+5+'px', + 'left' : X+5+'px', + 'display' : 'block' + }); + + t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 ); + }, + + hideButtons : function() { + if ( tinymce.DOM.isHidden('wp_editbtns') ) return; + + tinymce.DOM.hide('wp_editbtns'); + window.clearTimeout(this.btnsTout); + }, + + _createButtons : function() { + var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, wp_editbtns, wp_editimgbtn, wp_delimgbtn; + + DOM.remove('wp_editbtns'); + + wp_editbtns = DOM.add(document.body, 'div', { + id : 'wp_editbtns', + style : 'display:none;' + }); + + wp_editimgbtn = DOM.add('wp_editbtns', 'img', { + src : t.url+'/img/image.png', + id : 'wp_editimgbtn', + width : '24', + height : '24', + title : ed.getLang('wpeditimage.edit_img') + }); + + wp_editimgbtn.onmousedown = function(e) { + var ed = tinyMCE.activeEditor; + ed.windowManager.bookmark = ed.selection.getBookmark('simple'); + ed.execCommand("WP_EditImage"); + this.parentNode.style.display = 'none'; + }; + + wp_delimgbtn = DOM.add('wp_editbtns', 'img', { + src : t.url+'/img/delete.png', + id : 'wp_delimgbtn', + width : '24', + height : '24', + title : ed.getLang('wpeditimage.del_img') + }); + + wp_delimgbtn.onmousedown = function(e) { + var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p; + + if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) { + if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') ) + ed.dom.remove(p); + else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 ) + ed.dom.remove(p); + else ed.dom.remove(el); + + this.parentNode.style.display = 'none'; + ed.execCommand('mceRepaint'); + return false; + } + }; + }, + + getInfo : function() { + return { + longname : 'Edit Image', + author : 'WordPress', + authorurl : 'http://wordpress.org', + infourl : '', + version : "1.0" + }; + } + }); + + tinymce.PluginManager.add('wpeditimage', tinymce.plugins.wpEditImage); +})(); diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js index f24d0bafa..9c17ed34f 100644 --- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js @@ -1,236 +1 @@ - -(function() { - tinymce.create('tinymce.plugins.wpEditImage', { - - init : function(ed, url) { - var t = this; - - t.url = url; - t._createButtons(); - - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...'); - ed.addCommand('WP_EditImage', function() { - var el = ed.selection.getNode(), vp = tinymce.DOM.getViewPort(), H = vp.h, W = ( 720 < vp.w ) ? 720 : vp.w; - var cls = ed.dom.getAttrib(el, 'class'); - - if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 || el.nodeName != 'IMG' ) - return; - - tb_show('', url + '/editimage.html?ver=321&TB_iframe=true'); - tinymce.DOM.setStyles('TB_window', { - 'width':( W - 50 )+'px', - 'height':( H - 45 )+'px', - 'margin-left':'-'+parseInt((( W - 50 ) / 2),10) + 'px' - }); - - if ( ! tinymce.isIE6 ) { - tinymce.DOM.setStyles('TB_window', { - 'top':'20px', - 'marginTop':'0' - }); - } - - tinymce.DOM.setStyles('TB_iframeContent', { - 'width':( W - 50 )+'px', - 'height':( H - 75 )+'px' - }); - tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); - }); - - ed.onInit.add(function(ed) { - tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { - ed.plugins.wpeditimage.hideButtons(); - }); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { - ed.plugins.wpeditimage.hideButtons(); - }); - - ed.onSaveContent.add(function(ed, o) { - ed.plugins.wpeditimage.hideButtons(); - }); - - ed.onMouseUp.add(function(ed, e) { - if ( tinymce.isOpera ) { - if ( e.target.nodeName == 'IMG' ) - ed.plugins.wpeditimage.showButtons(e.target); - } else if ( ! tinymce.isWebKit ) { - var n = ed.selection.getNode(), DL; - - if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) { - window.setTimeout(function(){ - var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL'); - - if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) { - ed.dom.setStyle(DL, 'width', parseInt(n.width)+10); - ed.execCommand('mceRepaint'); - } - }, 100); - } - } - }); - - ed.onMouseDown.add(function(ed, e) { - if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) { - t.hideButtons(); - return; - } - ed.plugins.wpeditimage.showButtons(e.target); - }); - - ed.onKeyPress.add(function(ed, e) { - var DL, DIV; - - if ( e.keyCode == 13 && (DL = ed.dom.getParent(ed.selection.getNode(), 'DL')) ) { - var P = ed.dom.create('p', {}, ' '); - if ( (DIV = DL.parentNode) && DIV.nodeName == 'DIV' ) - ed.dom.insertAfter( P, DIV ); - else ed.dom.insertAfter( P, DL ); - - tinymce.dom.Event.cancel(e); - ed.selection.select(P); - return false; - } - }); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = t._do_shcode(o.content); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.get) - o.content = t._get_shcode(o.content); - }); - }, - - _do_shcode : function(co) { - return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){ - b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); - c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); - var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); - var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i); - - id = ( id && id[1] ) ? id[1] : ''; - cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; - w = ( w && w[1] ) ? w[1] : ''; - cap = ( cap && cap[1] ) ? cap[1] : ''; - if ( ! w || ! cap ) return c; - - var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; - - return '
'+c+'
'+cap+'
'; - }); - }, - - _get_shcode : function(co) { - return co.replace(/
\s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ - var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i); - var w = c.match(/width=['"]([0-9]+)/); - - id = ( id && id[1] ) ? id[1] : ''; - cls = ( cls && cls[1] ) ? cls[1] : 'alignnone'; - w = ( w && w[1] ) ? w[1] : ''; - - if ( ! w || ! cap ) return c; - cls = cls.match(/align[^ '"]+/) || 'alignnone'; - cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"'); - - return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; - }); - }, - - showButtons : function(n) { - var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; - var cls = ed.dom.getAttrib(n, 'class'); - - if ( cls.indexOf('mceItem') != -1 || cls.indexOf('wpGallery') != -1 ) - return; - - vp = ed.dom.getViewPort(ed.getWin()); - p1 = DOM.getPos(ed.getContentAreaContainer()); - p2 = ed.dom.getPos(n); - - X = Math.max(p2.x - vp.x, 0) + p1.x; - Y = Math.max(p2.y - vp.y, 0) + p1.y; - - DOM.setStyles('wp_editbtns', { - 'top' : Y+5+'px', - 'left' : X+5+'px', - 'display' : 'block' - }); - - t.btnsTout = window.setTimeout( function(){ed.plugins.wpeditimage.hideButtons();}, 5000 ); - }, - - hideButtons : function() { - if ( tinymce.DOM.isHidden('wp_editbtns') ) return; - - tinymce.DOM.hide('wp_editbtns'); - window.clearTimeout(this.btnsTout); - }, - - _createButtons : function() { - var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM; - - DOM.remove('wp_editbtns'); - - var wp_editbtns = DOM.add(document.body, 'div', { - id : 'wp_editbtns', - style : 'display:none;' - }); - - var wp_editimgbtn = DOM.add('wp_editbtns', 'img', { - src : t.url+'/img/image.png', - id : 'wp_editimgbtn', - width : '24', - height : '24', - title : ed.getLang('wpeditimage.edit_img') - }); - - wp_editimgbtn.onmousedown = function(e) { - var ed = tinyMCE.activeEditor; - ed.windowManager.bookmark = ed.selection.getBookmark('simple'); - ed.execCommand("WP_EditImage"); - this.parentNode.style.display = 'none'; - }; - - var wp_delimgbtn = DOM.add('wp_editbtns', 'img', { - src : t.url+'/img/delete.png', - id : 'wp_delimgbtn', - width : '24', - height : '24', - title : ed.getLang('wpeditimage.del_img') - }); - - wp_delimgbtn.onmousedown = function(e) { - var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), p; - - if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('mceItem') == -1 ) { - if ( (p = ed.dom.getParent(el, 'div')) && ed.dom.hasClass(p, 'mceTemp') ) - ed.dom.remove(p); - else if ( (p = ed.dom.getParent(el, 'A')) && p.childNodes.length == 1 ) - ed.dom.remove(p); - else ed.dom.remove(el); - - this.parentNode.style.display = 'none'; - ed.execCommand('mceRepaint'); - return false; - } - }; - }, - - getInfo : function() { - return { - longname : 'Edit Image', - author : 'WordPress', - authorurl : 'http://wordpress.org', - infourl : '', - version : "1.0" - }; - } - }); - - tinymce.PluginManager.add('wpeditimage', tinymce.plugins.wpEditImage); -})(); +(function(){tinymce.create("tinymce.plugins.wpEditImage",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_EditImage",function(){var h=a.selection.getNode(),f=tinymce.DOM.getViewPort(),g=f.h,d=(720
'+k+'
'+h+"
"})},_get_shcode:function(a){return a.replace(/
\s*]+)>\s*]+>([\s\S]+?)<\/dt>\s*]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi,function(g,d,j,h){var i,f,e;i=d.match(/id=['"]([^'"]+)/i);f=d.match(/class=['"]([^'"]+)/i);e=j.match(/width=['"]([0-9]+)/);i=(i&&i[1])?i[1]:"";f=(f&&f[1])?f[1]:"alignnone";e=(e&&e[1])?e[1]:"";if(!e||!h){return j}f=f.match(/align[^ '"]+/)||"alignnone";h=h.replace(/<\S[^<>]*>/gi,"").replace(/'/g,"'").replace(/"/g,""");return'[caption id="'+i+'" align="'+f+'" width="'+e+'" caption="'+h+'"]'+j+"[/caption]"})},showButtons:function(d){var j=this,e=tinyMCE.activeEditor,g,f,a,i=tinymce.DOM,c,b,h=e.dom.getAttrib(d,"class");if(h.indexOf("mceItem")!=-1||h.indexOf("wpGallery")!=-1){return}a=e.dom.getViewPort(e.getWin());g=i.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;i.setStyles("wp_editbtns",{top:b+5+"px",left:c+5+"px",display:"block"});j.btnsTout=window.setTimeout(function(){e.plugins.wpeditimage.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_editbtns")){return}tinymce.DOM.hide("wp_editbtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,a,c,f;e.remove("wp_editbtns");a=e.add(document.body,"div",{id:"wp_editbtns",style:"display:none;"});c=e.add("wp_editbtns","img",{src:d.url+"/img/image.png",id:"wp_editimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.edit_img")});c.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_EditImage");this.parentNode.style.display="none"};f=e.add("wp_editbtns","img",{src:d.url+"/img/delete.png",id:"wp_delimgbtn",width:"24",height:"24",title:b.getLang("wpeditimage.del_img")});f.onmousedown=function(j){var g=tinyMCE.activeEditor,h=g.selection.getNode(),i;if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("mceItem")==-1){if((i=g.dom.getParent(h,"div"))&&g.dom.hasClass(i,"mceTemp")){g.dom.remove(i)}else{if((i=g.dom.getParent(h,"A"))&&i.childNodes.length==1){g.dom.remove(i)}else{g.dom.remove(h)}}this.parentNode.style.display="none";g.execCommand("mceRepaint");return false}}},getInfo:function(){return{longname:"Edit Image",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpeditimage",tinymce.plugins.wpEditImage)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js new file mode 100644 index 000000000..3c9701d40 --- /dev/null +++ b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.dev.js @@ -0,0 +1,174 @@ + +(function() { + tinymce.create('tinymce.plugins.wpGallery', { + + init : function(ed, url) { + var t = this; + + t.url = url; + t._createButtons(); + + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...'); + ed.addCommand('WP_Gallery', function() { + var el = ed.selection.getNode(), post_id, vp = tinymce.DOM.getViewPort(), H = vp.h - 80, W = ( 640 < vp.w ) ? 640 : vp.w; + + if ( el.nodeName != 'IMG' ) return; + if ( ed.dom.getAttrib(el, 'class').indexOf('wpGallery') == -1 ) return; + + post_id = tinymce.DOM.get('post_ID').value; + tb_show('', tinymce.documentBaseURL + '/media-upload.php?post_id='+post_id+'&tab=gallery&TB_iframe=true&width='+W+'&height='+H); + + tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); + }); + + ed.onInit.add(function(ed) { + tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { + ed.plugins.wpgallery.hideButtons(); + }); + }); + + ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { + ed.plugins.wpgallery.hideButtons(); + }); + + ed.onSaveContent.add(function(ed, o) { + ed.plugins.wpgallery.hideButtons(); + }); + + ed.onMouseUp.add(function(ed, e) { + if ( tinymce.isOpera ) { + if ( e.target.nodeName == 'IMG' ) + ed.plugins.wpgallery.showButtons(e.target); + } + + }); + + ed.onMouseDown.add(function(ed, e) { + if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) { + t.hideButtons(); + return; + } + ed.plugins.wpgallery.showButtons(e.target); + }); + + ed.onBeforeSetContent.add(function(ed, o) { + o.content = t._do_gallery(o.content); + }); + + ed.onPostProcess.add(function(ed, o) { + if (o.get) + o.content = t._get_gallery(o.content); + }); + }, + + _do_gallery : function(co) { + return co.replace(/\[gallery([^\]]*)\]/g, function(a,b){ + return ''; + }); + }, + + _get_gallery : function(co) { + + function getAttr(s, n) { + n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s); + return n ? tinymce.DOM.decode(n[1]) : ''; + }; + + return co.replace(/(?:]*>)*(]+>)(?:<\/p>)*/g, function(a,im) { + var cls = getAttr(im, 'class'); + + if ( cls.indexOf('wpGallery') != -1 ) + return '

['+tinymce.trim(getAttr(im, 'title'))+']

'; + + return a; + }); + }, + + showButtons : function(n) { + var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; + + if (ed.dom.getAttrib(n, 'class').indexOf('wpGallery') == -1) + return; + + vp = ed.dom.getViewPort(ed.getWin()); + p1 = DOM.getPos(ed.getContentAreaContainer()); + p2 = ed.dom.getPos(n); + + X = Math.max(p2.x - vp.x, 0) + p1.x; + Y = Math.max(p2.y - vp.y, 0) + p1.y; + + DOM.setStyles('wp_gallerybtns', { + 'top' : Y+5+'px', + 'left' : X+5+'px', + 'display' : 'block' + }); + + t.btnsTout = window.setTimeout( function(){ed.plugins.wpgallery.hideButtons();}, 5000 ); + }, + + hideButtons : function() { + if ( tinymce.DOM.isHidden('wp_gallerybtns') ) return; + + tinymce.DOM.hide('wp_gallerybtns'); + window.clearTimeout(this.btnsTout); + }, + + _createButtons : function() { + var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM, wp_gallerybtns, wp_editgallery, wp_delgallery; + + DOM.remove('wp_gallerybtns'); + + wp_gallerybtns = DOM.add(document.body, 'div', { + id : 'wp_gallerybtns', + style : 'display:none;' + }); + + wp_editgallery = DOM.add('wp_gallerybtns', 'img', { + src : t.url+'/img/edit.png', + id : 'wp_editgallery', + width : '24', + height : '24', + title : ed.getLang('wordpress.editgallery') + }); + + wp_editgallery.onmousedown = function(e) { + var ed = tinyMCE.activeEditor; + ed.windowManager.bookmark = ed.selection.getBookmark('simple'); + ed.execCommand("WP_Gallery"); + this.parentNode.style.display = 'none'; + }; + + wp_delgallery = DOM.add('wp_gallerybtns', 'img', { + src : t.url+'/img/delete.png', + id : 'wp_delgallery', + width : '24', + height : '24', + title : ed.getLang('wordpress.delgallery') + }); + + wp_delgallery.onmousedown = function(e) { + var ed = tinyMCE.activeEditor, el = ed.selection.getNode(); + + if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('wpGallery') != -1 ) { + ed.dom.remove(el); + + this.parentNode.style.display = 'none'; + ed.execCommand('mceRepaint'); + return false; + } + }; + }, + + getInfo : function() { + return { + longname : 'Gallery Settings', + author : 'WordPress', + authorurl : 'http://wordpress.org', + infourl : '', + version : "1.0" + }; + } + }); + + tinymce.PluginManager.add('wpgallery', tinymce.plugins.wpGallery); +})(); diff --git a/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js index bdb6b7c71..e924e3dc2 100644 --- a/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js @@ -1,174 +1 @@ - -(function() { - tinymce.create('tinymce.plugins.wpGallery', { - - init : function(ed, url) { - var t = this; - - t.url = url; - t._createButtons(); - - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('...'); - ed.addCommand('WP_Gallery', function() { - var el = ed.selection.getNode(), vp = tinymce.DOM.getViewPort(), W = ( 720 < vp.w ) ? 720 : vp.w; - - if ( el.nodeName != 'IMG' ) return; - if ( ed.dom.getAttrib(el, 'class').indexOf('wpGallery') == -1 ) return; - - var post_id = tinymce.DOM.get('post_ID').value; - tb_show('', tinymce.documentBaseURL + '/media-upload.php?post_id='+post_id+'&tab=gallery&TB_iframe=true'); - - tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); - }); - - ed.onInit.add(function(ed) { - tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { - ed.plugins.wpgallery.hideButtons(); - }); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { - ed.plugins.wpgallery.hideButtons(); - }); - - ed.onSaveContent.add(function(ed, o) { - ed.plugins.wpgallery.hideButtons(); - }); - - ed.onMouseUp.add(function(ed, e) { - if ( tinymce.isOpera ) { - if ( e.target.nodeName == 'IMG' ) - ed.plugins.wpgallery.showButtons(e.target); - } - - }); - - ed.onMouseDown.add(function(ed, e) { - if ( tinymce.isOpera || e.target.nodeName != 'IMG' ) { - t.hideButtons(); - return; - } - ed.plugins.wpgallery.showButtons(e.target); - }); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = t._do_gallery(o.content); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.get) - o.content = t._get_gallery(o.content); - }); - }, - - _do_gallery : function(co) { - return co.replace(/\[gallery([^\]]*)\]/g, function(a,b){ - return ''; - }); - }, - - _get_gallery : function(co) { - - function getAttr(s, n) { - n = new RegExp(n + '=\"([^\"]+)\"', 'g').exec(s); - return n ? tinymce.DOM.decode(n[1]) : ''; - }; - - return co.replace(/(?:]*>)*(]+>)(?:<\/p>)*/g, function(a,im) { - var cls = getAttr(im, 'class'); - - if ( cls.indexOf('wpGallery') != -1 ) - return '

['+tinymce.trim(getAttr(im, 'title'))+']

'; - - return a; - }); - }, - - showButtons : function(n) { - var t = this, ed = tinyMCE.activeEditor, p1, p2, vp, DOM = tinymce.DOM, X, Y; - - if (ed.dom.getAttrib(n, 'class').indexOf('wpGallery') == -1) - return; - - vp = ed.dom.getViewPort(ed.getWin()); - p1 = DOM.getPos(ed.getContentAreaContainer()); - p2 = ed.dom.getPos(n); - - X = Math.max(p2.x - vp.x, 0) + p1.x; - Y = Math.max(p2.y - vp.y, 0) + p1.y; - - DOM.setStyles('wp_gallerybtns', { - 'top' : Y+5+'px', - 'left' : X+5+'px', - 'display' : 'block' - }); - - t.btnsTout = window.setTimeout( function(){ed.plugins.wpgallery.hideButtons();}, 5000 ); - }, - - hideButtons : function() { - if ( tinymce.DOM.isHidden('wp_gallerybtns') ) return; - - tinymce.DOM.hide('wp_gallerybtns'); - window.clearTimeout(this.btnsTout); - }, - - _createButtons : function() { - var t = this, ed = tinyMCE.activeEditor, DOM = tinymce.DOM; - - DOM.remove('wp_gallerybtns'); - - var wp_gallerybtns = DOM.add(document.body, 'div', { - id : 'wp_gallerybtns', - style : 'display:none;' - }); - - var wp_editgallery = DOM.add('wp_gallerybtns', 'img', { - src : t.url+'/img/edit.png', - id : 'wp_editgallery', - width : '24', - height : '24', - title : ed.getLang('wordpress.editgallery') - }); - - wp_editgallery.onmousedown = function(e) { - var ed = tinyMCE.activeEditor; - ed.windowManager.bookmark = ed.selection.getBookmark('simple'); - ed.execCommand("WP_Gallery"); - this.parentNode.style.display = 'none'; - }; - - var wp_delgallery = DOM.add('wp_gallerybtns', 'img', { - src : t.url+'/img/delete.png', - id : 'wp_delgallery', - width : '24', - height : '24', - title : ed.getLang('wordpress.delgallery') - }); - - wp_delgallery.onmousedown = function(e) { - var ed = tinyMCE.activeEditor, el = ed.selection.getNode(); - - if ( el.nodeName == 'IMG' && ed.dom.getAttrib(el, 'class').indexOf('wpGallery') != -1 ) { - ed.dom.remove(el); - - this.parentNode.style.display = 'none'; - ed.execCommand('mceRepaint'); - return false; - } - }; - }, - - getInfo : function() { - return { - longname : 'Gallery Settings', - author : 'WordPress', - authorurl : 'http://wordpress.org', - infourl : '', - version : "1.0" - }; - } - }); - - tinymce.PluginManager.add('wpgallery', tinymce.plugins.wpGallery); -})(); +(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c._createButtons();a.addCommand("WP_Gallery",function(){var h=a.selection.getNode(),f,e=tinymce.DOM.getViewPort(),g=e.h-80,d=(640'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:]*>)*(]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"

["+tinymce.trim(a(d,"title"))+"]

"}return e})},showButtons:function(d){var i=this,e=tinyMCE.activeEditor,g,f,a,h=tinymce.DOM,c,b;if(e.dom.getAttrib(d,"class").indexOf("wpGallery")==-1){return}a=e.dom.getViewPort(e.getWin());g=h.getPos(e.getContentAreaContainer());f=e.dom.getPos(d);c=Math.max(f.x-a.x,0)+g.x;b=Math.max(f.y-a.y,0)+g.y;h.setStyles("wp_gallerybtns",{top:b+5+"px",left:c+5+"px",display:"block"});i.btnsTout=window.setTimeout(function(){e.plugins.wpgallery.hideButtons()},5000)},hideButtons:function(){if(tinymce.DOM.isHidden("wp_gallerybtns")){return}tinymce.DOM.hide("wp_gallerybtns");window.clearTimeout(this.btnsTout)},_createButtons:function(){var d=this,b=tinyMCE.activeEditor,e=tinymce.DOM,c,f,a;e.remove("wp_gallerybtns");c=e.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});f=e.add("wp_gallerybtns","img",{src:d.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:b.getLang("wordpress.editgallery")});f.onmousedown=function(h){var g=tinyMCE.activeEditor;g.windowManager.bookmark=g.selection.getBookmark("simple");g.execCommand("WP_Gallery");this.parentNode.style.display="none"};a=e.add("wp_gallerybtns","img",{src:d.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:b.getLang("wordpress.delgallery")});a.onmousedown=function(i){var g=tinyMCE.activeEditor,h=g.selection.getNode();if(h.nodeName=="IMG"&&g.dom.getAttrib(h,"class").indexOf("wpGallery")!=-1){g.dom.remove(h);this.parentNode.style.display="none";g.execCommand("mceRepaint");return false}}},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})(); \ No newline at end of file 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 index 0ae41557e..aee70e763 100644 --- a/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css +++ b/wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css @@ -1,4 +1,4 @@ -body, td {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +/* default styles */ body {background:#FFF;} body.mceForceColors {background:#FFF; color:#000;} h1 {font-size: 2em} @@ -17,3 +17,76 @@ ins {border-bottom:1px solid green; text-decoration: none; color:green} del {color:red; text-decoration:line-through} cite {border-bottom:1px dashed blue} acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr, html\:abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* WordPress styles */ +html { + background-color: #fff; +} + +.aligncenter, +dl.aligncenter { + display: block; + margin-left: auto; + margin-right: auto; +} + +.alignleft { + float: left; +} + +.alignright { + float: right; +} + +.wp-caption { + border: 1px solid #ddd; + text-align: center; + background-color: #f3f3f3; + padding-top: 4px; + margin: 10px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.wp-caption img { + margin: 0; + padding: 0; + border: 0 none; +} + +.wp-caption-dd { + font-size: 11px; + line-height: 17px; + padding: 0 4px 5px; + margin: 0; +} + +img.wpGallery { + border: 1px dotted #cc0000; + background: #ffffcc url("../../../../plugins/wpgallery/img/gallery.png") no-repeat scroll center center; + width: 99%; + height: 250px; +} + +body.mceContentBody { + font: 13px/19px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + padding: 0.6em; + margin: 0; +} + +pre { + font: 12px/18px Consolas, Monaco, "Courier New", Courier, monospace; +} + +td { + color: #000; + font-size: 11px; + margin: 8px; +} + +.mceIEcenter { + text-align: center; +} diff --git a/wp-includes/js/tinymce/wordpress.css b/wp-includes/js/tinymce/wordpress.css deleted file mode 100644 index eff18ff22..000000000 --- a/wp-includes/js/tinymce/wordpress.css +++ /dev/null @@ -1,89 +0,0 @@ -/* This file contains the CSS data for the editable area(iframe) of TinyMCE */ -html { - background-color: #fff; -} - -.aligncenter, -dl.aligncenter { - display: block; - margin-left: auto; - margin-right: auto; -} - -.alignleft { - float: left; -} - -.alignright { - float: right; -} - -.wp-caption { - border: 1px solid #ddd; - text-align: center; - background-color: #f3f3f3; - padding-top: 4px; - margin: 10px; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.wp-caption img { - margin: 0; - padding: 0; - border: 0 none; -} - -.wp-caption-dd { - font-size: 11px; - line-height: 17px; - padding: 0 4px 5px; - margin: 0; -} - -img.wpGallery { - border: 1px dotted #cc0000; - background: #ffffcc url("plugins/wpgallery/img/gallery.png") no-repeat scroll center center; - width: 99%; - height: 250px; -} - -body.mceContentBody { - font: 13px/19px Georgia, "Times New Roman", "Bitstream Charter", Times, serif; - padding: 0.6em; - margin: 0; -} - -body.mceForceColors { - background:#fff; - color:#000; -} - -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} - -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid { - border: 1px dashed #BBB; -} - -img { - border:0; -} - -td { - font-size: 10px; -} - -pre { - font: 12px/18px "Courier New", monospace; -} - -.mceIEcenter { - text-align: center; -} diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index e698b5aaf..160cd3667 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -64,7 +64,7 @@ function wp_default_scripts( &$scripts ) { // Modify this version when tinyMCE plugins are changed. function mce_version() { - return '20081129'; + return '20090108'; } add_filter( 'tiny_mce_version', 'mce_version' );