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
This commit is contained in:
ryan 2008-07-03 15:55:45 +00:00
parent 03932fa14f
commit 48f963e437
11 changed files with 64 additions and 9 deletions

View File

@ -64,7 +64,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
?>
{
"betaManifestVersion" : 1,
"version" : "<?php echo $man_version; ?>_20080701",
"version" : "<?php echo $man_version; ?>_20080703",
"entries" : [
<?php echo $defaults; ?>
@ -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" }
]}

View File

@ -231,10 +231,10 @@ function media_buttons() {
$audio_title = __('Add Audio');
$out = <<<EOF
<a href="{$image_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
<a href="{$video_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
<a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
<a href="{$media_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
<a href="{$image_upload_iframe_src}&amp;TB_iframe=true" id="add_image" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
<a href="{$video_upload_iframe_src}&amp;TB_iframe=true" id="add_video" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
<a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
<a href="{$media_upload_iframe_src}&amp;TB_iframe=true" id="add_media" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
EOF;
printf($context, $out);

View File

@ -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;

View File

@ -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",{

View File

@ -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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

View File

@ -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;

View File

@ -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');