diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.js index df0c68a4ff..0006d66969 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -443,23 +443,21 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { * Experimental: create a floating toolbar. * This functionality will change in the next releases. Not recommended for use by plugins. */ - ( function() { + editor.on( 'preinit', function() { var Factory = tinymce.ui.Factory, settings = editor.settings, activeToolbar, currentSelection, + timeout, wpAdminbar = document.getElementById( 'wpadminbar' ), - mceIframe, mceToolbar, mceStatusbar, wpStatusbar; - - editor.on( 'init', function() { - mceIframe = document.getElementById( editor.id + '_ifr' ); - mceToolbar = tinymce.$( '.mce-toolbar-grp', editor.getContainer() )[0]; - mceStatusbar = tinymce.$( '.mce-statusbar', editor.getContainer() )[0]; + mceIframe = document.getElementById( editor.id + '_ifr' ), + mceToolbar = tinymce.$( '.mce-toolbar-grp', editor.getContainer() )[0], + mceStatusbar = tinymce.$( '.mce-statusbar', editor.getContainer() )[0], + wpStatusbar; if ( editor.id === 'content' ) { wpStatusbar = document.getElementById( 'post-status-info' ); } - } ); function create( buttons, bottom ) { var toolbar, @@ -587,10 +585,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { toolbar.bottom = bottom; - function hide() { - toolbar.hide(); - } - function reposition() { var scrollX = window.pageXOffset || document.documentElement.scrollLeft, scrollY = window.pageYOffset || document.documentElement.scrollTop, @@ -617,6 +611,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { className = '', top, left; + if ( spaceTop >= editorHeight || spaceBottom >= editorHeight ) { + return this.hide(); + } + if ( this.bottom ) { if ( spaceBottom >= spaceNeeded ) { className = ' mce-arrow-up'; @@ -677,18 +675,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } } ); - toolbar.on( 'remove', function() { - DOM.unbind( window, 'resize scroll', hide ); - editor.dom.unbind( editor.getWin(), 'resize scroll', hide ); - editor.off( 'blur hide', hide ); - } ); - - editor.once( 'init', function() { - DOM.bind( window, 'resize scroll', hide ); - editor.dom.bind( editor.getWin(), 'resize scroll', hide ); - editor.on( 'blur hide', hide ); - } ); - toolbar.reposition = reposition; toolbar.hide().renderTo( document.body ); @@ -735,13 +721,29 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } } ); - editor.on( 'hide', function() { - activeToolbar = false; - } ); + function hide( event ) { + if ( activeToolbar ) { + activeToolbar.hide(); + + if ( event.type === 'hide' ) { + activeToolbar = false; + } else if ( event.type === 'resize' || event.type === 'scroll' ) { + clearTimeout( timeout ); + + timeout = setTimeout( function() { + activeToolbar.show(); + }, 250 ); + } + } + } + + DOM.bind( window, 'resize scroll', hide ); + editor.dom.bind( editor.getWin(), 'resize scroll', hide ); + editor.on( 'blur hide', hide ); editor.wp = editor.wp || {}; editor.wp._createToolbar = create; - }()); + }, true ); function noop() {} diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js index 4fc7e72322..90fd404423 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js @@ -1 +1 @@ -tinymce.ui.FloatPanel.zIndex=100100,tinymce.PluginManager.add("wordpress",function(a){function b(b){var c,e,h,i=0;e="hide"===b,a.theme.panel&&(h=a.theme.panel.find(".toolbar:not(.menubar)")),!h||h.length<2||"hide"===b&&!h[1].visible()||(!b&&h[1].visible()&&(b="hide"),g(h,function(a,c){c>0&&("hide"===b?(a.hide(),i+=30):(a.show(),i-=30))}),i&&!e&&(tinymce.Env.iOS||(c=a.getContentAreaContainer().firstChild,f.setStyle(c,"height",c.clientHeight+i)),"hide"===b?(setUserSetting("hidetb","0"),d&&d.active(!1)):(setUserSetting("hidetb","1"),d&&d.active(!0))),a.fire("wp-toolbar-toggle"))}function c(){}var d,e,f=tinymce.DOM,g=tinymce.each,h=a.editorManager.i18n.translate,i=0;return"undefined"!=typeof window.jQuery&&window.jQuery(document).triggerHandler("tinymce-editor-setup",[a]),a.addButton("wp_adv",{tooltip:"Toolbar Toggle",cmd:"WP_Adv",onPostRender:function(){d=this,d.active("1"===getUserSetting("hidetb")?!0:!1)}}),a.on("PostRender",function(){a.getParam("wordpress_adv_hidden",!0)&&"0"===getUserSetting("hidetb","0")&&b("hide")}),a.addCommand("WP_Adv",function(){b()}),a.on("focus",function(){window.wpActiveEditor=a.id}),a.on("BeforeSetContent",function(a){var b;a.content&&(-1!==a.content.indexOf("/g,function(a,c){return''})),-1!==a.content.indexOf("")&&(b=h("Page break"),a.content=a.content.replace(//g,'')))}),a.on("PostProcess",function(a){a.get&&(a.content=a.content.replace(/]+>/g,function(a){var b,c="";return-1!==a.indexOf('data-wp-more="more"')?((b=a.match(/data-wp-more-text="([^"]+)"/))&&(c=b[1]),a=""):-1!==a.indexOf('data-wp-more="nextpage"')&&(a=""),a}))}),a.on("ResolveName",function(b){var c;"IMG"===b.target.nodeName&&(c=a.dom.getAttrib(b.target,"data-wp-more"))&&(b.name=c)}),a.addCommand("WP_More",function(b){var c,d,e,f="wp-more-tag",g=a.dom,i=a.selection.getNode();return b=b||"more",f+=" mce-wp-"+b,e="more"===b?"Read more...":"Next page",e=h(e),d='',"BODY"===i.nodeName||"P"===i.nodeName&&"BODY"===i.parentNode.nodeName?void a.insertContent(d):(c=g.getParent(i,function(a){return a.parentNode&&"BODY"===a.parentNode.nodeName?!0:!1},a.getBody()),void(c&&("P"===c.nodeName?c.appendChild(g.create("p",null,d).firstChild):g.insertAfter(g.create("p",null,d),c),a.nodeChanged())))}),a.addCommand("WP_Code",function(){a.formatter.toggle("code")}),a.addCommand("WP_Page",function(){a.execCommand("WP_More","nextpage")}),a.addCommand("WP_Help",function(){a.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",title:"Keyboard Shortcuts",width:450,height:420,classes:"wp-help",buttons:{text:"Close",onclick:"close"}})}),a.addCommand("WP_Medialib",function(){"undefined"!=typeof wp&&wp.media&&wp.media.editor&&wp.media.editor.open(a.id)}),a.addButton("wp_more",{tooltip:"Insert Read More tag",onclick:function(){a.execCommand("WP_More","more")}}),a.addButton("wp_page",{tooltip:"Page break",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.addButton("wp_help",{tooltip:"Keyboard Shortcuts",cmd:"WP_Help"}),a.addButton("wp_code",{tooltip:"Code",cmd:"WP_Code",stateSelector:"code"}),"undefined"!=typeof wp&&wp.media&&wp.media.editor&&a.addMenuItem("add_media",{text:"Add Media",icon:"wp-media-library",context:"insert",cmd:"WP_Medialib"}),a.addMenuItem("wp_more",{text:"Insert Read More tag",icon:"wp_more",context:"insert",onclick:function(){a.execCommand("WP_More","more")}}),a.addMenuItem("wp_page",{text:"Page break",icon:"wp_page",context:"insert",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.on("BeforeExecCommand",function(b){!tinymce.Env.webkit||"InsertUnorderedList"!==b.command&&"InsertOrderedList"!==b.command||(e||(e=a.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}")),a.getDoc().head.appendChild(e))}),a.on("ExecCommand",function(b){tinymce.Env.webkit&&e&&("InsertUnorderedList"===b.command||"InsertOrderedList"===b.command)&&a.dom.remove(e)}),a.on("init",function(){var b=tinymce.Env,c=["mceContentBody"],d=a.getDoc(),e=a.dom;tinymce.Env.iOS&&e.addClass(d.documentElement,"ios"),"rtl"===a.getParam("directionality")&&(c.push("rtl"),e.setAttrib(d.documentElement,"dir","rtl")),b.ie?9===parseInt(b.ie,10)?c.push("ie9"):8===parseInt(b.ie,10)?c.push("ie8"):b.ie<8&&c.push("ie7"):b.webkit&&c.push("webkit"),c.push("wp-editor"),g(c,function(a){a&&e.addClass(d.body,a)}),a.on("BeforeSetContent",function(a){a.content&&(a.content=a.content.replace(/

\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>"),a.content=a.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,""))}),"undefined"!=typeof window.jQuery&&window.jQuery(document).triggerHandler("tinymce-editor-init",[a]),window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&e.bind(d,"dragstart dragend dragover drop",function(a){"undefined"!=typeof window.jQuery&&window.jQuery(document).trigger(new window.jQuery.Event(a))}),a.getParam("wp_paste_filters",!0)&&(tinymce.Env.webkit||a.on("PastePreProcess",function(a){a.content=a.content.replace(/(<[^>]+) style="[^"]*"([^>]*>)/gi,"$1$2"),a.content=a.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi,"$1 style=$2")}),a.on("PastePostProcess",function(a){g(e.select("p",a.node),function(a){e.isEmpty(a)&&e.remove(a)})}))}),"undefined"!=typeof window.jQuery&&a.on("keyup",function(b){var c=b.keyCode||b.charCode;c!==i&&((13===c||8===i||46===i)&&window.jQuery(document).triggerHandler("wpcountwords",[a.getContent({format:"raw"})]),i=c)}),a.on("SaveContent",function(b){return!a.inline&&a.isHidden()?void(b.content=b.element.value):(b.content=b.content.replace(/

(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

"),void(a.getParam("wpautop",!0)&&"undefined"!=typeof window.switchEditors&&(b.content=window.switchEditors.pre_wpautop(b.content))))}),a.on("BeforeSetContent",function(a){var b=tinymce.Env.webkit?"


":"

";a.content&&(a.content=a.content.replace(/

(?: |\u00a0|\uFEFF|\s)+<\/p>/gi,b))}),a.on("preInit",function(){a.schema.addValidElements("@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b"),tinymce.Env.iOS&&(a.settings.height=300),g({c:"JustifyCenter",r:"JustifyRight",l:"JustifyLeft",j:"JustifyFull",q:"mceBlockQuote",u:"InsertUnorderedList",o:"InsertOrderedList",s:"unlink",m:"WP_Medialib",z:"WP_Adv",t:"WP_More",d:"Strikethrough",h:"WP_Help",p:"WP_Page",x:"WP_Code"},function(b,c){a.shortcuts.add("access+"+c,"",b)}),a.addShortcut("meta+s","",function(){"undefined"!=typeof wp&&wp.autosave&&wp.autosave.server.triggerSave()})}),function(){function b(b,c){function n(){p.hide()}function o(){var a,b,c=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop,k=window.innerWidth,l=window.innerHeight,n=e.getBoundingClientRect(),o=this.getEl(),p=o.offsetWidth,q=o.offsetHeight,r=d.getBoundingClientRect(),s=(r.left+r.right)/2,t=5,u=8,v=q+u+t,w=m?m.getBoundingClientRect().bottom:0,x=h?h.getBoundingClientRect().bottom:0,y=i?l-i.getBoundingClientRect().top:0,z=j?l-j.getBoundingClientRect().top:0,A=Math.max(0,w,x,n.top),B=Math.max(0,y,z,l-n.bottom),C=r.top+n.top-A,D=l-n.top-r.bottom-B,E=l-A-B,F="";return this.bottom?D>=v?(F=" mce-arrow-up",a=r.bottom+n.top+g):C>=v&&(F=" mce-arrow-down",a=r.top+n.top+g-q-u):C>=v?(F=" mce-arrow-down",a=r.top+n.top+g-q-u):D>=v&&E/2>r.bottom+n.top-A&&(F=" mce-arrow-up",a=r.bottom+n.top+g),"undefined"==typeof a&&(a=g+A+t),b=s-p/2+n.left+c,r.left<0||r.right>n.width?b=n.left+c+(n.width-p)/2:p>=k?(F+=" mce-arrow-full",b=0):0>b&&r.left+p>k||b+p>k&&r.right-p<0?b=(k-p)/2:bn.width+n.left+c&&(F+=" mce-arrow-right",b=r.right-p+n.left+c),o.className=o.className.replace(/ ?mce-arrow-[\w]+/g,"")+F,f.setStyles(o,{left:b,top:a}),this}var p,q,r=[];return g(b,function(b){function c(){var c=a.selection;"bullist"===d&&c.selectorChanged("ul > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!==d&&"UL"!=d););b.active(a&&"UL"===d)}),"numlist"===d&&c.selectorChanged("ol > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!==d&&"UL"!==d););b.active(a&&"OL"===d)}),b.settings.stateSelector&&c.selectorChanged(b.settings.stateSelector,function(a){b.active(a)},!0),b.settings.disabledStateSelector&&c.selectorChanged(b.settings.disabledStateSelector,function(a){b.disabled(a)})}var d;"|"===b?q=null:k.has(b)?(b={type:b},l.toolbar_items_size&&(b.size=l.toolbar_items_size),r.push(b),q=null):(q||(q={type:"buttongroup",items:[]},r.push(q)),a.buttons[b]&&(d=b,b=a.buttons[d],"function"==typeof b&&(b=b()),b.type=b.type||"button",l.toolbar_items_size&&(b.size=l.toolbar_items_size),b=k.create(b),q.items.push(b),a.initialized?c():a.on("init",c)))}),p=k.create({type:"panel",layout:"stack",classes:"toolbar-grp inline-toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:[{type:"toolbar",layout:"flow",items:r}]}),p.bottom=c,p.on("show",function(){this.reposition()}),p.on("keydown",function(b){27===b.keyCode&&(this.hide(),a.focus())}),p.on("remove",function(){f.unbind(window,"resize scroll",n),a.dom.unbind(a.getWin(),"resize scroll",n),a.off("blur hide",n)}),a.once("init",function(){f.bind(window,"resize scroll",n),a.dom.bind(a.getWin(),"resize scroll",n),a.on("blur hide",n)}),p.reposition=o,p.hide().renderTo(document.body),p}var c,d,e,h,i,j,k=tinymce.ui.Factory,l=a.settings,m=document.getElementById("wpadminbar");a.on("init",function(){e=document.getElementById(a.id+"_ifr"),h=tinymce.$(".mce-toolbar-grp",a.getContainer())[0],i=tinymce.$(".mce-statusbar",a.getContainer())[0],"content"===a.id&&(j=document.getElementById("post-status-info"))}),a.shortcuts.add("alt+119","",function(){var a;c&&(a=c.find("toolbar")[0],a&&a.focus(!0))}),a.on("nodechange",function(b){var e=a.selection.isCollapsed(),f={element:b.element,parents:b.parents,collapsed:e};a.fire("wptoolbar",f),d=f.selection||f.element,c&&c.hide(),f.toolbar?(c=f.toolbar,c.show()):c=!1}),a.on("focus",function(){c&&c.show()}),a.on("hide",function(){c=!1}),a.wp=a.wp||{},a.wp._createToolbar=b}(),{_showButtons:c,_hideButtons:c,_setEmbed:c,_getEmbed:c}}); \ No newline at end of file +tinymce.ui.FloatPanel.zIndex=100100,tinymce.PluginManager.add("wordpress",function(a){function b(b){var c,e,h,i=0;e="hide"===b,a.theme.panel&&(h=a.theme.panel.find(".toolbar:not(.menubar)")),!h||h.length<2||"hide"===b&&!h[1].visible()||(!b&&h[1].visible()&&(b="hide"),g(h,function(a,c){c>0&&("hide"===b?(a.hide(),i+=30):(a.show(),i-=30))}),i&&!e&&(tinymce.Env.iOS||(c=a.getContentAreaContainer().firstChild,f.setStyle(c,"height",c.clientHeight+i)),"hide"===b?(setUserSetting("hidetb","0"),d&&d.active(!1)):(setUserSetting("hidetb","1"),d&&d.active(!0))),a.fire("wp-toolbar-toggle"))}function c(){}var d,e,f=tinymce.DOM,g=tinymce.each,h=a.editorManager.i18n.translate,i=0;return"undefined"!=typeof window.jQuery&&window.jQuery(document).triggerHandler("tinymce-editor-setup",[a]),a.addButton("wp_adv",{tooltip:"Toolbar Toggle",cmd:"WP_Adv",onPostRender:function(){d=this,d.active("1"===getUserSetting("hidetb")?!0:!1)}}),a.on("PostRender",function(){a.getParam("wordpress_adv_hidden",!0)&&"0"===getUserSetting("hidetb","0")&&b("hide")}),a.addCommand("WP_Adv",function(){b()}),a.on("focus",function(){window.wpActiveEditor=a.id}),a.on("BeforeSetContent",function(a){var b;a.content&&(-1!==a.content.indexOf("/g,function(a,c){return''})),-1!==a.content.indexOf("")&&(b=h("Page break"),a.content=a.content.replace(//g,'')))}),a.on("PostProcess",function(a){a.get&&(a.content=a.content.replace(/]+>/g,function(a){var b,c="";return-1!==a.indexOf('data-wp-more="more"')?((b=a.match(/data-wp-more-text="([^"]+)"/))&&(c=b[1]),a=""):-1!==a.indexOf('data-wp-more="nextpage"')&&(a=""),a}))}),a.on("ResolveName",function(b){var c;"IMG"===b.target.nodeName&&(c=a.dom.getAttrib(b.target,"data-wp-more"))&&(b.name=c)}),a.addCommand("WP_More",function(b){var c,d,e,f="wp-more-tag",g=a.dom,i=a.selection.getNode();return b=b||"more",f+=" mce-wp-"+b,e="more"===b?"Read more...":"Next page",e=h(e),d='',"BODY"===i.nodeName||"P"===i.nodeName&&"BODY"===i.parentNode.nodeName?void a.insertContent(d):(c=g.getParent(i,function(a){return a.parentNode&&"BODY"===a.parentNode.nodeName?!0:!1},a.getBody()),void(c&&("P"===c.nodeName?c.appendChild(g.create("p",null,d).firstChild):g.insertAfter(g.create("p",null,d),c),a.nodeChanged())))}),a.addCommand("WP_Code",function(){a.formatter.toggle("code")}),a.addCommand("WP_Page",function(){a.execCommand("WP_More","nextpage")}),a.addCommand("WP_Help",function(){a.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",title:"Keyboard Shortcuts",width:450,height:420,classes:"wp-help",buttons:{text:"Close",onclick:"close"}})}),a.addCommand("WP_Medialib",function(){"undefined"!=typeof wp&&wp.media&&wp.media.editor&&wp.media.editor.open(a.id)}),a.addButton("wp_more",{tooltip:"Insert Read More tag",onclick:function(){a.execCommand("WP_More","more")}}),a.addButton("wp_page",{tooltip:"Page break",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.addButton("wp_help",{tooltip:"Keyboard Shortcuts",cmd:"WP_Help"}),a.addButton("wp_code",{tooltip:"Code",cmd:"WP_Code",stateSelector:"code"}),"undefined"!=typeof wp&&wp.media&&wp.media.editor&&a.addMenuItem("add_media",{text:"Add Media",icon:"wp-media-library",context:"insert",cmd:"WP_Medialib"}),a.addMenuItem("wp_more",{text:"Insert Read More tag",icon:"wp_more",context:"insert",onclick:function(){a.execCommand("WP_More","more")}}),a.addMenuItem("wp_page",{text:"Page break",icon:"wp_page",context:"insert",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.on("BeforeExecCommand",function(b){!tinymce.Env.webkit||"InsertUnorderedList"!==b.command&&"InsertOrderedList"!==b.command||(e||(e=a.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}")),a.getDoc().head.appendChild(e))}),a.on("ExecCommand",function(b){tinymce.Env.webkit&&e&&("InsertUnorderedList"===b.command||"InsertOrderedList"===b.command)&&a.dom.remove(e)}),a.on("init",function(){var b=tinymce.Env,c=["mceContentBody"],d=a.getDoc(),e=a.dom;tinymce.Env.iOS&&e.addClass(d.documentElement,"ios"),"rtl"===a.getParam("directionality")&&(c.push("rtl"),e.setAttrib(d.documentElement,"dir","rtl")),b.ie?9===parseInt(b.ie,10)?c.push("ie9"):8===parseInt(b.ie,10)?c.push("ie8"):b.ie<8&&c.push("ie7"):b.webkit&&c.push("webkit"),c.push("wp-editor"),g(c,function(a){a&&e.addClass(d.body,a)}),a.on("BeforeSetContent",function(a){a.content&&(a.content=a.content.replace(/

\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>"),a.content=a.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,""))}),"undefined"!=typeof window.jQuery&&window.jQuery(document).triggerHandler("tinymce-editor-init",[a]),window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&e.bind(d,"dragstart dragend dragover drop",function(a){"undefined"!=typeof window.jQuery&&window.jQuery(document).trigger(new window.jQuery.Event(a))}),a.getParam("wp_paste_filters",!0)&&(tinymce.Env.webkit||a.on("PastePreProcess",function(a){a.content=a.content.replace(/(<[^>]+) style="[^"]*"([^>]*>)/gi,"$1$2"),a.content=a.content.replace(/(<[^>]+) data-mce-style=([^>]+>)/gi,"$1 style=$2")}),a.on("PastePostProcess",function(a){g(e.select("p",a.node),function(a){e.isEmpty(a)&&e.remove(a)})}))}),"undefined"!=typeof window.jQuery&&a.on("keyup",function(b){var c=b.keyCode||b.charCode;c!==i&&((13===c||8===i||46===i)&&window.jQuery(document).triggerHandler("wpcountwords",[a.getContent({format:"raw"})]),i=c)}),a.on("SaveContent",function(b){return!a.inline&&a.isHidden()?void(b.content=b.element.value):(b.content=b.content.replace(/

(?:
|\u00a0|\uFEFF| )*<\/p>/g,"

 

"),void(a.getParam("wpautop",!0)&&"undefined"!=typeof window.switchEditors&&(b.content=window.switchEditors.pre_wpautop(b.content))))}),a.on("BeforeSetContent",function(a){var b=tinymce.Env.webkit?"


":"

";a.content&&(a.content=a.content.replace(/

(?: |\u00a0|\uFEFF|\s)+<\/p>/gi,b))}),a.on("preInit",function(){a.schema.addValidElements("@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b"),tinymce.Env.iOS&&(a.settings.height=300),g({c:"JustifyCenter",r:"JustifyRight",l:"JustifyLeft",j:"JustifyFull",q:"mceBlockQuote",u:"InsertUnorderedList",o:"InsertOrderedList",s:"unlink",m:"WP_Medialib",z:"WP_Adv",t:"WP_More",d:"Strikethrough",h:"WP_Help",p:"WP_Page",x:"WP_Code"},function(b,c){a.shortcuts.add("access+"+c,"",b)}),a.addShortcut("meta+s","",function(){"undefined"!=typeof wp&&wp.autosave&&wp.autosave.server.triggerSave()})}),a.on("preinit",function(){function b(b,c){function d(){var a,b,c=window.pageXOffset||document.documentElement.scrollLeft,d=window.pageYOffset||document.documentElement.scrollTop,g=window.innerWidth,h=window.innerHeight,j=m.getBoundingClientRect(),k=this.getEl(),p=k.offsetWidth,q=k.offsetHeight,r=e.getBoundingClientRect(),s=(r.left+r.right)/2,t=5,u=8,v=q+u+t,w=l?l.getBoundingClientRect().bottom:0,x=n?n.getBoundingClientRect().bottom:0,y=o?h-o.getBoundingClientRect().top:0,z=i?h-i.getBoundingClientRect().top:0,A=Math.max(0,w,x,j.top),B=Math.max(0,y,z,h-j.bottom),C=r.top+j.top-A,D=h-j.top-r.bottom-B,E=h-A-B,F="";return C>=E||D>=E?this.hide():(this.bottom?D>=v?(F=" mce-arrow-up",a=r.bottom+j.top+d):C>=v&&(F=" mce-arrow-down",a=r.top+j.top+d-q-u):C>=v?(F=" mce-arrow-down",a=r.top+j.top+d-q-u):D>=v&&E/2>r.bottom+j.top-A&&(F=" mce-arrow-up",a=r.bottom+j.top+d),"undefined"==typeof a&&(a=d+A+t),b=s-p/2+j.left+c,r.left<0||r.right>j.width?b=j.left+c+(j.width-p)/2:p>=g?(F+=" mce-arrow-full",b=0):0>b&&r.left+p>g||b+p>g&&r.right-p<0?b=(g-p)/2:bj.width+j.left+c&&(F+=" mce-arrow-right",b=r.right-p+j.left+c),k.className=k.className.replace(/ ?mce-arrow-[\w]+/g,"")+F,f.setStyles(k,{left:b,top:a}),this)}var h,p,q=[];return g(b,function(b){function c(){var c=a.selection;"bullist"===d&&c.selectorChanged("ul > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!==d&&"UL"!=d););b.active(a&&"UL"===d)}),"numlist"===d&&c.selectorChanged("ol > li",function(a,c){for(var d,e=c.parents.length;e--&&(d=c.parents[e].nodeName,"OL"!==d&&"UL"!==d););b.active(a&&"OL"===d)}),b.settings.stateSelector&&c.selectorChanged(b.settings.stateSelector,function(a){b.active(a)},!0),b.settings.disabledStateSelector&&c.selectorChanged(b.settings.disabledStateSelector,function(a){b.disabled(a)})}var d;"|"===b?p=null:j.has(b)?(b={type:b},k.toolbar_items_size&&(b.size=k.toolbar_items_size),q.push(b),p=null):(p||(p={type:"buttongroup",items:[]},q.push(p)),a.buttons[b]&&(d=b,b=a.buttons[d],"function"==typeof b&&(b=b()),b.type=b.type||"button",k.toolbar_items_size&&(b.size=k.toolbar_items_size),b=j.create(b),p.items.push(b),a.initialized?c():a.on("init",c)))}),h=j.create({type:"panel",layout:"stack",classes:"toolbar-grp inline-toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:[{type:"toolbar",layout:"flow",items:q}]}),h.bottom=c,h.on("show",function(){this.reposition()}),h.on("keydown",function(b){27===b.keyCode&&(this.hide(),a.focus())}),h.reposition=d,h.hide().renderTo(document.body),h}function c(a){d&&(d.hide(),"hide"===a.type?d=!1:("resize"===a.type||"scroll"===a.type)&&(clearTimeout(h),h=setTimeout(function(){d.show()},250)))}var d,e,h,i,j=tinymce.ui.Factory,k=a.settings,l=document.getElementById("wpadminbar"),m=document.getElementById(a.id+"_ifr"),n=tinymce.$(".mce-toolbar-grp",a.getContainer())[0],o=tinymce.$(".mce-statusbar",a.getContainer())[0];"content"===a.id&&(i=document.getElementById("post-status-info")),a.shortcuts.add("alt+119","",function(){var a;d&&(a=d.find("toolbar")[0],a&&a.focus(!0))}),a.on("nodechange",function(b){var c=a.selection.isCollapsed(),f={element:b.element,parents:b.parents,collapsed:c};a.fire("wptoolbar",f),e=f.selection||f.element,d&&d.hide(),f.toolbar?(d=f.toolbar,d.show()):d=!1}),a.on("focus",function(){d&&d.show()}),f.bind(window,"resize scroll",c),a.dom.bind(a.getWin(),"resize scroll",c),a.on("blur hide",c),a.wp=a.wp||{},a.wp._createToolbar=b},!0),{_showButtons:c,_hideButtons:c,_setEmbed:c,_getEmbed:c}}); \ 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 3631e04b1f..f3eb9039be 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ diff --git a/wp-includes/version.php b/wp-includes/version.php index 76b072d9f1..9a34c591f6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32830'; +$wp_version = '4.3-alpha-32831'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.