From 48f963e437ce6361ea75efc0b5cc22a488119055 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 3 Jul 2008 15:55:45 +0000 Subject: [PATCH] Add med buttons to TinyMCE fullscreen. Props azaozz. fixes #7232 git-svn-id: http://svn.automattic.com/wordpress/trunk@8248 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/gears-manifest.php | 8 +++- wp-admin/includes/media.php | 8 ++-- wp-admin/includes/post.php | 3 ++ wp-includes/js/tinymce/langs/wp-langs.php | 6 ++- .../plugins/wordpress/editor_plugin.js | 44 ++++++++++++++++++ .../tinymce/plugins/wordpress/img/audio.gif | Bin 0 -> 146 bytes .../tinymce/plugins/wordpress/img/image.gif | Bin 0 -> 101 bytes .../tinymce/plugins/wordpress/img/media.gif | Bin 0 -> 149 bytes .../tinymce/plugins/wordpress/img/video.gif | Bin 0 -> 99 bytes wp-includes/js/tinymce/tiny_mce_config.php | 2 +- wp-includes/script-loader.php | 2 +- 11 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/audio.gif create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/image.gif create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/media.gif create mode 100644 wp-includes/js/tinymce/plugins/wordpress/img/video.gif diff --git a/wp-admin/gears-manifest.php b/wp-admin/gears-manifest.php index 0e887a831c..c8ea4333cd 100644 --- a/wp-admin/gears-manifest.php +++ b/wp-admin/gears-manifest.php @@ -64,7 +64,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); ?> { "betaManifestVersion" : 1, -"version" : "_20080701", +"version" : "_20080703", "entries" : [ @@ -191,5 +191,9 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' ); { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" }, { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" }, -{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" } +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" }, +{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif" } ]} diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index c44864c852..a79944a053 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -231,10 +231,10 @@ function media_buttons() { $audio_title = __('Add Audio'); $out = <<$image_title - $video_title - $audio_title - $media_title + $image_title + $video_title + $audio_title + $media_title EOF; printf($context, $out); diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index f98b9deece..a34aeab72a 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -93,7 +93,10 @@ function _wp_translate_postdata( $update = false ) { $hh = $_POST['hh']; $mn = $_POST['mn']; $ss = $_POST['ss']; + $aa = ($aa <= 0 ) ? date('Y') : $aa; + $mm = ($mm <= 0 ) ? date('n') : $mm; $jj = ($jj > 31 ) ? 31 : $jj; + $jj = ($jj <= 0 ) ? date('j') : $jj; $hh = ($hh > 23 ) ? $hh -24 : $hh; $mn = ($mn > 59 ) ? $mn -60 : $mn; $ss = ($ss > 59 ) ? $ss -60 : $ss; diff --git a/wp-includes/js/tinymce/langs/wp-langs.php b/wp-includes/js/tinymce/langs/wp-langs.php index a38d5d1981..69228311e8 100644 --- a/wp-includes/js/tinymce/langs/wp-langs.php +++ b/wp-includes/js/tinymce/langs/wp-langs.php @@ -395,7 +395,11 @@ wp_more_desc:"' . mce_escape( __('Insert More tag') ) . ' (Alt+Shift+T)", wp_page_desc:"' . mce_escape( __('Insert Page break') ) . ' (Alt+Shift+P)", wp_help_desc:"' . mce_escape( __('Help') ) . ' (Alt+Shift+H)", wp_more_alt:"' . mce_escape( __('More...') ) . '", -wp_page_alt:"' . mce_escape( __('Next page...') ) . '" +wp_page_alt:"' . mce_escape( __('Next page...') ) . '", +add_media:"' . mce_escape( __('Add Media') ) . '", +add_image:"' . mce_escape( __('Add an Image') ) . '", +add_video:"' . mce_escape( __('Add Video') ) . '", +add_audio:"' . mce_escape( __('Add Audio') ) . '" }); tinyMCE.addI18n("' . $language . '.wpeditimage",{ diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index 418f3a4914..ab3eb12476 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -89,6 +89,50 @@ 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.onExecCommand.add(function( ed, cmd ) { var n, bl, dom = ed.dom; diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif b/wp-includes/js/tinymce/plugins/wordpress/img/audio.gif new file mode 100644 index 0000000000000000000000000000000000000000..f8ad22383aa716922cef904a151cadcc001e033d GIT binary patch literal 146 zcmZ?wbhEHb6k!ly*v!B%bLPyItJfSndh+tE`_JBg-Lie>nTuDq@7}jz)0SHgpC3AY z3aEeq2`K(#VHIKEX3znNfy`iFu`f93xq7d~>$9ewZAB~$2c~LNEqirro0Nb|(?o$~ p*-t;#c{MXRba3(&cZjInOkxu77AZ;8;puY9PCxy&YPTSRH2~cMIspIx literal 0 HcmV?d00001 diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/image.gif b/wp-includes/js/tinymce/plugins/wordpress/img/image.gif new file mode 100644 index 0000000000000000000000000000000000000000..6736e6b009f4bd3c24b9a1cc5a5292d2e34b9dff GIT binary patch literal 101 zcmZ?wbhEHb6k!lyn8?5|bLPzd|NjF?1_lPjpDe5*3``6$ZMql3e5duGdgZkzjgM#cYTcgXac0@ms#}|9?%uv*qHL7IU4gVtjp=997Betd F0|4u+Cw~9{ literal 0 HcmV?d00001 diff --git a/wp-includes/js/tinymce/plugins/wordpress/img/media.gif b/wp-includes/js/tinymce/plugins/wordpress/img/media.gif new file mode 100644 index 0000000000000000000000000000000000000000..786e4f55de224e5d346df90e2d490e51b16474f4 GIT binary patch literal 149 zcmZ?wbhEHb6k!ly*v!B%bLPxVTen}k`{>ZIQx9IeyLkQ1;w4L;zWZ|f(TnZ7_W@-Y zP=Vr47FH1kE(RTtFvtuB7N>xdo~!p-ygqBr>9U;Tq#?uMi5#~X_ZSr9bO?a({K4j zXKcB|+H@~5tD$iA_12{6Q!jPaE%Ru4Etz~xSN%usvVGRSOB;5@sy6v(P48i1um%8* Cg(Zdn literal 0 HcmV?d00001 diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 5959c87587..8a72ad4723 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -222,7 +222,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { // Setup cache info if ( $disk_cache ) { - $cacheKey = apply_filters('tiny_mce_version', '20080702'); + $cacheKey = apply_filters('tiny_mce_version', '20080703'); foreach ( $initArray as $v ) $cacheKey .= $v; diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index b9bb7150ac..e8a7d40570 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -37,7 +37,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080702' ); // Modify this version when tinyMCE plugins are changed. - $mce_version = apply_filters('tiny_mce_version', '20080701'); + $mce_version = apply_filters('tiny_mce_version', '20080703'); $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); $scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');