From 2c0b56039fb56120a3a58d4a3cf2eb5bdb156e19 Mon Sep 17 00:00:00 2001 From: azaozz Date: Fri, 10 Jun 2011 21:08:49 +0000 Subject: [PATCH] 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 --- wp-admin/js/wp-fullscreen.dev.js | 19 +++++++++++++++--- wp-admin/js/wp-fullscreen.js | 2 +- .../plugins/wpfullscreen/editor_plugin.dev.js | 2 +- .../plugins/wpfullscreen/editor_plugin.js | 2 +- wp-includes/js/tinymce/wp-tinymce.js.gz | Bin 93414 -> 93417 bytes wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/wp-admin/js/wp-fullscreen.dev.js b/wp-admin/js/wp-fullscreen.dev.js index f7378ae2f5..48fa2299cd 100644 --- a/wp-admin/js/wp-fullscreen.dev.js +++ b/wp-admin/js/wp-fullscreen.dev.js @@ -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 ); } ); }); }, diff --git a/wp-admin/js/wp-fullscreen.js b/wp-admin/js/wp-fullscreen.js index 1c08cbe1dd..acd78c998e 100644 --- a/wp-admin/js/wp-fullscreen.js +++ b/wp-admin/js/wp-fullscreen.js @@ -1 +1 @@ -var PubSub,fullscreen,wptitlehint;PubSub=function(){this.topics={}};PubSub.prototype.subscribe=function(a,b){if(!this.topics[a]){this.topics[a]=[]}this.topics[a].push(b);return b};PubSub.prototype.unsubscribe=function(b,e){var c,a,d=this.topics[b];if(!d){return e||[]}if(e){for(c=0,a=d.length;c1200){return}g.width(h+f);setUserSetting("dfw_width",h+f)};e.subscribe("showToolbar",function(){a.toolbars.removeClass("fade-1000").addClass("fade-300");b.fade.In(a.toolbars,300,function(){e.publish("toolbarShown")},true);c("#wp-fullscreen-body").addClass("wp-fullscreen-focus");a.toolbar_shown=true});e.subscribe("hideToolbar",function(){a.toolbars.removeClass("fade-300").addClass("fade-1000");b.fade.Out(a.toolbars,1000,function(){e.publish("toolbarHidden")},true);c("#wp-fullscreen-body").removeClass("wp-fullscreen-focus")});e.subscribe("toolbarShown",function(){a.toolbars.removeClass("fade-300")});e.subscribe("toolbarHidden",function(){a.toolbars.removeClass("fade-1000");a.toolbar_shown=false});e.subscribe("show",function(){var f=c("#wp-fullscreen-title").val(c("#"+a.title_id).val());set_title_hint(f);c("#wp-fullscreen-save input").attr("title",c("#last-edit").text());a.textarea_obj.value=edCanvas.value;if(a.has_tinymce&&a.mode==="tinymce"){tinyMCE.execCommand("wpFullScreenInit")}a._edCanvas=edCanvas;edCanvas=a.textarea_obj;a.orig_y=c(window).scrollTop()});e.subscribe("showing",function(){c(document.body).addClass("fullscreen-active");b.refresh_buttons();c(document).bind("mousemove.fullscreen",function(f){d("showToolbar","hideToolbar",2000)});d("showToolbar","hideToolbar",2000);b.bind_resize();setTimeout(b.resize_textarea,200);scrollTo(0,0);c("#wpadminbar").hide()});e.subscribe("shown",function(){a.visible=true;if(a.has_tinymce&&!a.is_mce_on){htmled=document.getElementById(a.editor_id),old_val=htmled.value;htmled.value=switchEditors.wpautop(old_val);tinyMCE.settings.setup=function(f){f.onInit.add(function(g){g.hide();delete tinyMCE.settings.setup;g.getElement().value=old_val})};tinyMCE.execCommand("mceAddControl",false,a.editor_id);a.is_mce_on=true}});e.subscribe("hide",function(){if(a.has_tinymce&&a.mode==="tinymce"&&c("#"+a.editor_id).is(":visible")){switchEditors.go(a.editor_id,"tinymce")}else{if(a.mode==="html"&&c("#"+a.editor_id).is(":hidden")){switchEditors.go(a.editor_id,"html")}}b.savecontent();c(document).unbind(".fullscreen");c(a.textarea_obj).unbind(".grow");if(a.has_tinymce&&a.mode==="tinymce"){tinyMCE.execCommand("wpFullScreenSave")}set_title_hint(c("#"+a.title_id));edCanvas=a._edCanvas;edCanvas.value=a.textarea_obj.value});e.subscribe("hiding",function(){c(document.body).removeClass("fullscreen-active");scrollTo(0,a.orig_y);c("#wpadminbar").show()});e.subscribe("hidden",function(){a.visible=false;c("#wp_mce_fullscreen").removeAttr("style");if(a.has_tinymce&&a.is_mce_on){tinyMCE.execCommand("wpFullScreenClose")}a.textarea_obj.value="";b.oldheight=0});e.subscribe("switchMode",function(h,g){var f;if(!a.has_tinymce||!a.is_mce_on){return}f=tinyMCE.get("wp_mce_fullscreen");if(h==="html"&&g==="tinymce"){a.textarea_obj.value=switchEditors.wpautop(a.textarea_obj.value);if("undefined"==typeof(f)){tinyMCE.execCommand("wpFullScreenInit")}else{f.show()}}else{if(h==="tinymce"&&g==="html"){if(f){f.hide()}}}});e.subscribe("switchedMode",function(g,f){b.refresh_buttons(true);if(f==="html"){setTimeout(b.resize_textarea,200)}});b.b=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("Bold")}};b.i=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("Italic")}};b.ul=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("InsertUnorderedList")}};b.ol=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("InsertOrderedList")}};b.link=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("WP_Link")}else{wpLink.open()}};b.unlink=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("unlink")}};b.atd=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("mceWritingImprovementTool")}};b.help=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("WP_Help")}};b.blockquote=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("mceBlockQuote")}};b.refresh_buttons=function(f){f=f||false;if(a.mode==="html"){c("#wp-fullscreen-mode-bar").removeClass("wp-tmce-mode").addClass("wp-html-mode");if(f){c("#wp-fullscreen-button-bar").fadeOut(150,function(){c(this).addClass("wp-html-mode").fadeIn(150)})}else{c("#wp-fullscreen-button-bar").addClass("wp-html-mode")}}else{if(a.mode==="tinymce"){c("#wp-fullscreen-mode-bar").removeClass("wp-html-mode").addClass("wp-tmce-mode");if(f){c("#wp-fullscreen-button-bar").fadeOut(150,function(){c(this).removeClass("wp-html-mode").fadeIn(150)})}else{c("#wp-fullscreen-button-bar").removeClass("wp-html-mode")}}}};b.ui={init:function(){var f=c("#fullscreen-topbar"),h=c("#wp_mce_fullscreen"),g=0;a.toolbars=f.add(c("#wp-fullscreen-status"));a.element=c("#fullscreen-fader");a.textarea_obj=h[0];a.has_tinymce=typeof(tinyMCE)!="undefined";if(!a.has_tinymce){c("#wp-fullscreen-mode-bar").hide()}if(wptitlehint){wptitlehint("wp-fullscreen-title")}c(document).keyup(function(k){var l=k.keyCode||k.charCode,i,j;if(!fullscreen.settings.visible){return true}if(navigator.platform&&navigator.platform.indexOf("Mac")!=-1){i=k.ctrlKey}else{i=k.altKey}if(27==l){j={event:k,what:"dfw",cb:fullscreen.off,condition:function(){if(c("#TB_window").is(":visible")||c(".wp-dialog").is(":visible")){return false}return true}};if(!jQuery(document).triggerHandler("wp_CloseOnEscape",[j])){fullscreen.off()}}if(i&&(61==l||107==l||187==l)){b.dfw_width(25)}if(i&&(45==l||109==l||189==l)){b.dfw_width(-25)}if(i&&48==l){b.dfw_width(0)}return false});if(typeof(wpWordCount)!="undefined"){h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==g){return true}if(13==i||8==g||46==g){c(document).triggerHandler("wpcountwords",[h.val()])}g=i;return true})}f.mouseenter(function(i){a.toolbars.addClass("fullscreen-make-sticky");c(document).unbind(".fullscreen");clearTimeout(a.timer);a.timer=0}).mouseleave(function(i){a.toolbars.removeClass("fullscreen-make-sticky");if(a.visible){c(document).bind("mousemove.fullscreen",function(j){d("showToolbar","hideToolbar",2000)})}})},fade:function(g,f,h){if(!a.element){b.ui.init()}if(g&&!e.publish(g)){return}b.fade.In(a.element,600,function(){if(f){e.publish(f)}b.fade.Out(a.element,600,function(){if(h){e.publish(h)}})})}};b.fade={transitionend:"transitionend webkitTransitionEnd oTransitionEnd",sensitivity:100,In:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(b.fade.transitions){if(g.is(":visible")){g.addClass("fade-trigger");return g}g.show();g.first().one(this.transitionend,function(){i()});setTimeout(function(){g.addClass("fade-trigger")},this.sensitivity)}else{if(f){g.stop()}g.css("opacity",1);g.first().fadeIn(h,i);if(g.length>1){g.not(":first").fadeIn(h)}}return g},Out:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(!g.is(":visible")){return g}if(b.fade.transitions){g.first().one(b.fade.transitionend,function(){if(g.hasClass("fade-trigger")){return}g.hide();i()});setTimeout(function(){g.removeClass("fade-trigger")},this.sensitivity)}else{if(f){g.stop()}g.first().fadeOut(h,i);if(g.length>1){g.not(":first").fadeOut(h)}}return g},transitions:(function(){var f=document.documentElement.style;return(typeof(f.WebkitTransition)=="string"||typeof(f.MozTransition)=="string"||typeof(f.OTransition)=="string"||typeof(f.transition)=="string")})()};b.bind_resize=function(){c(a.textarea_obj).bind("keypress.grow click.grow paste.grow",function(){setTimeout(b.resize_textarea,200)})};b.oldheight=0;b.resize_textarea=function(){var f=a.textarea_obj,g;g=f.scrollHeight>300?f.scrollHeight:300;if(g!=b.oldheight){f.style.height=g+"px";b.oldheight=g}}})(jQuery); \ No newline at end of file +var PubSub,fullscreen,wptitlehint;PubSub=function(){this.topics={}};PubSub.prototype.subscribe=function(a,b){if(!this.topics[a]){this.topics[a]=[]}this.topics[a].push(b);return b};PubSub.prototype.unsubscribe=function(b,e){var c,a,d=this.topics[b];if(!d){return e||[]}if(e){for(c=0,a=d.length;c120){return}}if(block){return}block=true;setTimeout(function(){block=false},400);if(a.timer){clearTimeout(a.timer)}else{e.publish(l)}function f(){e.publish(h);a.timer=0}a.timer=setTimeout(f,g)};b.on=function(){if(a.visible){return}a.mode=c("#"+a.editor_id).is(":hidden")?"tinymce":"html";if(!a.element){b.ui.init()}a.is_mce_on=a.has_tinymce&&typeof(tinyMCE.get(a.editor_id))!="undefined";b.ui.fade("show","showing","shown")};b.off=function(){if(!a.visible){return}b.ui.fade("hide","hiding","hidden")};b.switchmode=function(g){var f=a.mode;if(!g||!a.visible||!a.has_tinymce){return f}if(f==g){return f}e.publish("switchMode",[f,g]);a.mode=g;e.publish("switchedMode",[f,g]);return g};b.save=function(){var h=c("#hiddenaction"),f=h.val(),i=c("#wp-fullscreen-save img"),g=c("#wp-fullscreen-save span");i.show();b.savecontent();h.val("wp-fullscreen-save-post");c.post(ajaxurl,c("form#post").serialize(),function(j){i.hide();g.show();setTimeout(function(){g.fadeOut(1000)},3000);if(j.last_edited){c("#wp-fullscreen-save input").attr("title",j.last_edited)}},"json");h.val(f)};b.savecontent=function(){var f,g;c("#"+a.title_id).val(c("#wp-fullscreen-title").val());if(a.mode==="tinymce"&&(f=tinyMCE.get("wp_mce_fullscreen"))){g=f.save()}else{g=c("#wp_mce_fullscreen").val()}c("#"+a.editor_id).val(g);c(document).triggerHandler("wpcountwords",[g])};set_title_hint=function(f){if(!f.val().length){f.siblings("label").css("visibility","")}else{f.siblings("label").css("visibility","hidden")}};b.dfw_width=function(h){var g=c("#wp-fullscreen-wrap"),f=g.width();if(!h){g.width(c("#wp-fullscreen-central-toolbar").width());deleteUserSetting("dfw_width");return}if(f<200||f>1200){return}g.width(h+f);setUserSetting("dfw_width",h+f)};e.subscribe("showToolbar",function(){a.toolbars.removeClass("fade-1000").addClass("fade-300");b.fade.In(a.toolbars,300,function(){e.publish("toolbarShown")},true);c("#wp-fullscreen-body").addClass("wp-fullscreen-focus");a.toolbar_shown=true});e.subscribe("hideToolbar",function(){a.toolbars.removeClass("fade-300").addClass("fade-1000");b.fade.Out(a.toolbars,1000,function(){e.publish("toolbarHidden")},true);c("#wp-fullscreen-body").removeClass("wp-fullscreen-focus")});e.subscribe("toolbarShown",function(){a.toolbars.removeClass("fade-300")});e.subscribe("toolbarHidden",function(){a.toolbars.removeClass("fade-1000");a.toolbar_shown=false});e.subscribe("show",function(){var f=c("#wp-fullscreen-title").val(c("#"+a.title_id).val());set_title_hint(f);c("#wp-fullscreen-save input").attr("title",c("#last-edit").text());a.textarea_obj.value=edCanvas.value;if(a.has_tinymce&&a.mode==="tinymce"){tinyMCE.execCommand("wpFullScreenInit")}a._edCanvas=edCanvas;edCanvas=a.textarea_obj;a.orig_y=c(window).scrollTop()});e.subscribe("showing",function(){c(document.body).addClass("fullscreen-active");b.refresh_buttons();c(document).bind("mousemove.fullscreen",function(f){d("showToolbar","hideToolbar",2000,f)});d("showToolbar","hideToolbar",2000);b.bind_resize();setTimeout(b.resize_textarea,200);scrollTo(0,0);c("#wpadminbar").hide()});e.subscribe("shown",function(){a.visible=true;if(a.has_tinymce&&!a.is_mce_on){htmled=document.getElementById(a.editor_id),old_val=htmled.value;htmled.value=switchEditors.wpautop(old_val);tinyMCE.settings.setup=function(f){f.onInit.add(function(g){g.hide();delete tinyMCE.settings.setup;g.getElement().value=old_val})};tinyMCE.execCommand("mceAddControl",false,a.editor_id);a.is_mce_on=true}});e.subscribe("hide",function(){if(a.has_tinymce&&a.mode==="tinymce"&&c("#"+a.editor_id).is(":visible")){switchEditors.go(a.editor_id,"tinymce")}else{if(a.mode==="html"&&c("#"+a.editor_id).is(":hidden")){switchEditors.go(a.editor_id,"html")}}b.savecontent();c(document).unbind(".fullscreen");c(a.textarea_obj).unbind(".grow");if(a.has_tinymce&&a.mode==="tinymce"){tinyMCE.execCommand("wpFullScreenSave")}set_title_hint(c("#"+a.title_id));edCanvas=a._edCanvas;edCanvas.value=a.textarea_obj.value});e.subscribe("hiding",function(){c(document.body).removeClass("fullscreen-active");scrollTo(0,a.orig_y);c("#wpadminbar").show()});e.subscribe("hidden",function(){a.visible=false;c("#wp_mce_fullscreen").removeAttr("style");if(a.has_tinymce&&a.is_mce_on){tinyMCE.execCommand("wpFullScreenClose")}a.textarea_obj.value="";b.oldheight=0});e.subscribe("switchMode",function(h,g){var f;if(!a.has_tinymce||!a.is_mce_on){return}f=tinyMCE.get("wp_mce_fullscreen");if(h==="html"&&g==="tinymce"){a.textarea_obj.value=switchEditors.wpautop(a.textarea_obj.value);if("undefined"==typeof(f)){tinyMCE.execCommand("wpFullScreenInit")}else{f.show()}}else{if(h==="tinymce"&&g==="html"){if(f){f.hide()}}}});e.subscribe("switchedMode",function(g,f){b.refresh_buttons(true);if(f==="html"){setTimeout(b.resize_textarea,200)}});b.b=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("Bold")}};b.i=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("Italic")}};b.ul=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("InsertUnorderedList")}};b.ol=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("InsertOrderedList")}};b.link=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("WP_Link")}else{wpLink.open()}};b.unlink=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("unlink")}};b.atd=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("mceWritingImprovementTool")}};b.help=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("WP_Help")}};b.blockquote=function(){if(a.has_tinymce&&"tinymce"===a.mode){tinyMCE.execCommand("mceBlockQuote")}};b.refresh_buttons=function(f){f=f||false;if(a.mode==="html"){c("#wp-fullscreen-mode-bar").removeClass("wp-tmce-mode").addClass("wp-html-mode");if(f){c("#wp-fullscreen-button-bar").fadeOut(150,function(){c(this).addClass("wp-html-mode").fadeIn(150)})}else{c("#wp-fullscreen-button-bar").addClass("wp-html-mode")}}else{if(a.mode==="tinymce"){c("#wp-fullscreen-mode-bar").removeClass("wp-html-mode").addClass("wp-tmce-mode");if(f){c("#wp-fullscreen-button-bar").fadeOut(150,function(){c(this).removeClass("wp-html-mode").fadeIn(150)})}else{c("#wp-fullscreen-button-bar").removeClass("wp-html-mode")}}}};b.ui={init:function(){var f=c("#fullscreen-topbar"),h=c("#wp_mce_fullscreen"),g=0;a.toolbars=f.add(c("#wp-fullscreen-status"));a.element=c("#fullscreen-fader");a.textarea_obj=h[0];a.has_tinymce=typeof(tinyMCE)!="undefined";if(!a.has_tinymce){c("#wp-fullscreen-mode-bar").hide()}if(wptitlehint){wptitlehint("wp-fullscreen-title")}c(document).keyup(function(k){var l=k.keyCode||k.charCode,i,j;if(!fullscreen.settings.visible){return true}if(navigator.platform&&navigator.platform.indexOf("Mac")!=-1){i=k.ctrlKey}else{i=k.altKey}if(27==l){j={event:k,what:"dfw",cb:fullscreen.off,condition:function(){if(c("#TB_window").is(":visible")||c(".wp-dialog").is(":visible")){return false}return true}};if(!jQuery(document).triggerHandler("wp_CloseOnEscape",[j])){fullscreen.off()}}if(i&&(61==l||107==l||187==l)){b.dfw_width(25)}if(i&&(45==l||109==l||189==l)){b.dfw_width(-25)}if(i&&48==l){b.dfw_width(0)}return false});if(typeof(wpWordCount)!="undefined"){h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==g){return true}if(13==i||8==g||46==g){c(document).triggerHandler("wpcountwords",[h.val()])}g=i;return true})}f.mouseenter(function(i){a.toolbars.addClass("fullscreen-make-sticky");c(document).unbind(".fullscreen");clearTimeout(a.timer);a.timer=0}).mouseleave(function(i){a.toolbars.removeClass("fullscreen-make-sticky");if(a.visible){c(document).bind("mousemove.fullscreen",function(j){d("showToolbar","hideToolbar",2000,j)})}})},fade:function(g,f,h){if(!a.element){b.ui.init()}if(g&&!e.publish(g)){return}b.fade.In(a.element,600,function(){if(f){e.publish(f)}b.fade.Out(a.element,600,function(){if(h){e.publish(h)}})})}};b.fade={transitionend:"transitionend webkitTransitionEnd oTransitionEnd",sensitivity:100,In:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(b.fade.transitions){if(g.is(":visible")){g.addClass("fade-trigger");return g}g.show();g.first().one(this.transitionend,function(){i()});setTimeout(function(){g.addClass("fade-trigger")},this.sensitivity)}else{if(f){g.stop()}g.css("opacity",1);g.first().fadeIn(h,i);if(g.length>1){g.not(":first").fadeIn(h)}}return g},Out:function(g,h,i,f){i=i||c.noop;h=h||400;f=f||false;if(!g.is(":visible")){return g}if(b.fade.transitions){g.first().one(b.fade.transitionend,function(){if(g.hasClass("fade-trigger")){return}g.hide();i()});setTimeout(function(){g.removeClass("fade-trigger")},this.sensitivity)}else{if(f){g.stop()}g.first().fadeOut(h,i);if(g.length>1){g.not(":first").fadeOut(h)}}return g},transitions:(function(){var f=document.documentElement.style;return(typeof(f.WebkitTransition)=="string"||typeof(f.MozTransition)=="string"||typeof(f.OTransition)=="string"||typeof(f.transition)=="string")})()};b.bind_resize=function(){c(a.textarea_obj).bind("keypress.grow click.grow paste.grow",function(){setTimeout(b.resize_textarea,200)})};b.oldheight=0;b.resize_textarea=function(){var f=a.textarea_obj,g;g=f.scrollHeight>300?f.scrollHeight:300;if(g!=b.oldheight){f.style.height=g+"px";b.oldheight=g}}})(jQuery); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js b/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js index 8ff59e56b4..19921c8966 100644 --- a/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js +++ b/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js @@ -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 ); }); } }); diff --git a/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js index d9172afc13..6204dd0edd 100644 --- a/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.js @@ -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)})(); \ No newline at end of file +(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)})(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index 2b67c0596d4ca6991dfdb9583ff4463c40c2838f..ef7c87d7c927a3730d4799fffe15d3542a0d68c5 100644 GIT binary patch delta 458 zcmV;*0X6>S*#+s@1qUCC2ngne@_`4n2LUl_f4h%y$dc7&+dGl@G>yx!lugwbGwNc- zD?{%zmzBe-;pBoWXVW82Z7LmhE z$>ATjEJ1izL&RH?!T#c0PpCS=n3xA!e}lyq@mELrdlj>k9lJ5?q=xRmSO|3zHU2)c zhAMfUH)Ie-#e7NMXGHN{G8{=<#K!58BbTTM1UYmmW(<;OjK$S>T>OQ54LYrSu4l|o z1gnCBh3zv#8f3gkqJwyQg2LUl_e}nmuawgo~h0LdDT!y7hToJRvl~yjQ24uA60(p3eme^ zrkMp0Y$dBznRbfD&kvQ847`_?9QVFIPdKxVd+dORlDX}r}p1n?jznV-rrByECohu{*N$%9RGi$(i$C63>?ynOY$ z_2vq!3^9bsbY(1ac8PC~uG@fgG?wqc8#Mi^4=Fx_Lv{puU#)}ciT)Yd)3zdVxG6FG zHCZ*+DnE5iHq1MU2^0S6?q_sF2#&N5{0q28jp*=aH~P5mB;mrxrty@ zaHz0-W=DgF7fG}bL#I-BF@*ne1f~gyd$6cCu6p~%yc%bDIpJC%Au%+Oh@?+2F=#6k x+|Nvys9r)YlR+NF+SHSUh9+)=D$yI?`kEUJ(6167;cBJv>>r6oKw(ON1OUb@)&~Fp diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 4b2374e355..d3ee99d845 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -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'); diff --git a/wp-includes/version.php b/wp-includes/version.php index ce6133b170..a9716150a8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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