DFW: show the toolbar only when the mouse is near the top of the window, see #17503

git-svn-id: http://svn.automattic.com/wordpress/trunk@18241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-06-10 21:08:49 +00:00
parent 97f9874ef9
commit 2c0b56039f
7 changed files with 21 additions and 8 deletions

View File

@ -88,9 +88,22 @@ PubSub.prototype.publish = function( topic, args ) {
* Creates a function that publishes start/stop topics.
* Used to throttle events.
*/
bounder = api.bounder = function( start, stop, delay ) {
bounder = api.bounder = function( start, stop, delay, e ) {
var y, top;
delay = delay || 1250;
if ( e ) {
y = e.pageY || e.clientY || e.offsetY;
top = $(document).scrollTop();
if ( !e.isDefaultPrevented ) // test if e ic jQuery normalized
y = 135 + y;
if ( y - top > 120 )
return;
}
if ( block )
return;
@ -283,7 +296,7 @@ PubSub.prototype.publish = function( topic, args ) {
$( document.body ).addClass( 'fullscreen-active' );
api.refresh_buttons();
$( document ).bind( 'mousemove.fullscreen', function(e) { bounder( 'showToolbar', 'hideToolbar', 2000 ); } );
$( document ).bind( 'mousemove.fullscreen', function(e) { bounder( 'showToolbar', 'hideToolbar', 2000, e ); } );
bounder( 'showToolbar', 'hideToolbar', 2000 );
api.bind_resize();
@ -549,7 +562,7 @@ PubSub.prototype.publish = function( topic, args ) {
s.toolbars.removeClass('fullscreen-make-sticky');
if ( s.visible )
$( document ).bind( 'mousemove.fullscreen', function(e) { bounder( 'showToolbar', 'hideToolbar', 2000 ); } );
$( document ).bind( 'mousemove.fullscreen', function(e) { bounder( 'showToolbar', 'hideToolbar', 2000, e ); } );
});
},

File diff suppressed because one or more lines are too long

View File

@ -88,7 +88,7 @@
if ( 'undefined' != fullscreen ) {
fsed.dom.bind( fsed.dom.doc, 'mousemove', function(e){
fullscreen.bounder( 'showToolbar', 'hideToolbar', 2000 );
fullscreen.bounder( 'showToolbar', 'hideToolbar', 2000, e );
});
}
});

View File

@ -1 +1 @@
(function(){tinymce.create("tinymce.plugins.wpFullscreenPlugin",{init:function(b,d){var e=this,h=0,f={},g=tinymce.DOM,a=false;b.addCommand("wpFullScreenClose",function(){if(b.getParam("wp_fullscreen_is_enabled")){g.win.setTimeout(function(){tinyMCE.remove(b);g.remove("wp_mce_fullscreen_parent");tinyMCE.settings=tinyMCE.oldSettings},10)}});b.addCommand("wpFullScreenSave",function(){var i=tinyMCE.get("wp_mce_fullscreen"),j;i.focus();j=tinyMCE.get(i.getParam("wp_fullscreen_editor_id"));j.setContent(i.getContent({format:"raw"}),{format:"raw"})});b.addCommand("wpFullScreenInit",function(){var k=b.getDoc(),i=k.body,j;if(b.id=="wp_mce_fullscreen"){return}tinyMCE.oldSettings=tinyMCE.settings;tinymce.each(b.settings,function(l,m){f[m]=l});f.id="wp_mce_fullscreen";f.wp_fullscreen_is_enabled=true;f.wp_fullscreen_editor_id=b.id;f.theme_advanced_resizing=false;f.theme_advanced_statusbar_location="none";f.content_css=f.content_css?f.content_css+","+f.wp_fullscreen_content_css:f.wp_fullscreen_content_css;f.height=tinymce.isIE?i.scrollHeight:i.offsetHeight;tinymce.each(b.getParam("wp_fullscreen_settings"),function(m,l){f[l]=m});j=new tinymce.Editor("wp_mce_fullscreen",f);j.onInit.add(function(l){var n=tinymce.DOM,m=n.select("a.mceButton",n.get("wp-fullscreen-buttons"));if(!b.isHidden()){l.setContent(b.getContent())}else{l.setContent(switchEditors.wpautop(l.getElement().value))}setTimeout(function(){l.onNodeChange.add(function(p,o,q){tinymce.each(m,function(t){var s,r;if(s=n.get("wp_mce_fullscreen_"+t.id.substr(6))){r=s.className;if(r){t.className=r}}})})},1000);l.dom.addClass(l.getBody(),"wp-fullscreen-editor");l.focus()});j.render();if("undefined"!=fullscreen){j.dom.bind(j.dom.doc,"mousemove",function(l){fullscreen.bounder("showToolbar","hideToolbar",2000)})}});if("undefined"!=fullscreen){b.addButton("fullscreen",{title:"fullscreen.desc",onclick:function(){fullscreen.on()}})}if(b.getParam("fullscreen_is_enabled")||!b.getParam("wp_fullscreen_is_enabled")){return}function c(){if(a){return}var k=b.getDoc(),j=tinymce.DOM,l,i;if(tinymce.isIE){i=k.body.scrollHeight}else{if(tinymce.isWebKit){i=k.height}else{i=k.documentElement.offsetHeight}}l=(i>300)?i:300;if(h!=l){h=l;a=true;setTimeout(function(){a=false},100);j.setStyle(j.get(b.id+"_ifr"),"height",l+"px")}}b.onInit.add(function(j,i){j.onChange.add(c);j.onSetContent.add(c);j.onPaste.add(c);j.onKeyUp.add(c);j.onPostRender.add(c);j.getBody().style.overflowY="hidden"});if(b.getParam("autoresize_on_init",true)){b.onLoadContent.add(function(j,i){setTimeout(function(){c()},1200)})}b.addCommand("wpAutoResize",c)},getInfo:function(){return{longname:"WP Fullscreen",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpfullscreen",tinymce.plugins.wpFullscreenPlugin)})();
(function(){tinymce.create("tinymce.plugins.wpFullscreenPlugin",{init:function(b,d){var e=this,h=0,f={},g=tinymce.DOM,a=false;b.addCommand("wpFullScreenClose",function(){if(b.getParam("wp_fullscreen_is_enabled")){g.win.setTimeout(function(){tinyMCE.remove(b);g.remove("wp_mce_fullscreen_parent");tinyMCE.settings=tinyMCE.oldSettings},10)}});b.addCommand("wpFullScreenSave",function(){var i=tinyMCE.get("wp_mce_fullscreen"),j;i.focus();j=tinyMCE.get(i.getParam("wp_fullscreen_editor_id"));j.setContent(i.getContent({format:"raw"}),{format:"raw"})});b.addCommand("wpFullScreenInit",function(){var k=b.getDoc(),i=k.body,j;if(b.id=="wp_mce_fullscreen"){return}tinyMCE.oldSettings=tinyMCE.settings;tinymce.each(b.settings,function(l,m){f[m]=l});f.id="wp_mce_fullscreen";f.wp_fullscreen_is_enabled=true;f.wp_fullscreen_editor_id=b.id;f.theme_advanced_resizing=false;f.theme_advanced_statusbar_location="none";f.content_css=f.content_css?f.content_css+","+f.wp_fullscreen_content_css:f.wp_fullscreen_content_css;f.height=tinymce.isIE?i.scrollHeight:i.offsetHeight;tinymce.each(b.getParam("wp_fullscreen_settings"),function(m,l){f[l]=m});j=new tinymce.Editor("wp_mce_fullscreen",f);j.onInit.add(function(l){var n=tinymce.DOM,m=n.select("a.mceButton",n.get("wp-fullscreen-buttons"));if(!b.isHidden()){l.setContent(b.getContent())}else{l.setContent(switchEditors.wpautop(l.getElement().value))}setTimeout(function(){l.onNodeChange.add(function(p,o,q){tinymce.each(m,function(t){var s,r;if(s=n.get("wp_mce_fullscreen_"+t.id.substr(6))){r=s.className;if(r){t.className=r}}})})},1000);l.dom.addClass(l.getBody(),"wp-fullscreen-editor");l.focus()});j.render();if("undefined"!=fullscreen){j.dom.bind(j.dom.doc,"mousemove",function(l){fullscreen.bounder("showToolbar","hideToolbar",2000,l)})}});if("undefined"!=fullscreen){b.addButton("fullscreen",{title:"fullscreen.desc",onclick:function(){fullscreen.on()}})}if(b.getParam("fullscreen_is_enabled")||!b.getParam("wp_fullscreen_is_enabled")){return}function c(){if(a){return}var k=b.getDoc(),j=tinymce.DOM,l,i;if(tinymce.isIE){i=k.body.scrollHeight}else{if(tinymce.isWebKit){i=k.height}else{i=k.documentElement.offsetHeight}}l=(i>300)?i:300;if(h!=l){h=l;a=true;setTimeout(function(){a=false},100);j.setStyle(j.get(b.id+"_ifr"),"height",l+"px")}}b.onInit.add(function(j,i){j.onChange.add(c);j.onSetContent.add(c);j.onPaste.add(c);j.onKeyUp.add(c);j.onPostRender.add(c);j.getBody().style.overflowY="hidden"});if(b.getParam("autoresize_on_init",true)){b.onLoadContent.add(function(j,i){setTimeout(function(){c()},1200)})}b.addCommand("wpAutoResize",c)},getInfo:function(){return{longname:"WP Fullscreen",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpfullscreen",tinymce.plugins.wpFullscreenPlugin)})();

View File

@ -96,7 +96,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), '20110411' );
$scripts->add_data( 'editor', 'group', 1 );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110608' );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110610' );
$scripts->add_data( 'wp-fullscreen', 'group', 1 );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');

View File

@ -18,7 +18,7 @@ $wp_db_version = 18226;
*
* @global string $tinymce_version
*/
$tinymce_version = '342-20110605';
$tinymce_version = '342-20110610';
/**
* Holds the cache manifest version