]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/editor-expand.min.js
WordPress 4.1
[autoinstalls/wordpress.git] / wp-admin / js / editor-expand.min.js
index 44d70d93bc4b9279e35eb748ca9ca49b80f8d87e..aacf99eb0d2c17d18463ed436eda4cc395dbd380 100644 (file)
@@ -1 +1 @@
-window.wp=window.wp||{},jQuery(document).ready(function(a){function b(){var a=m.width();R={windowHeight:m.height(),windowWidth:a,adminBarHeight:a>600?o.outerHeight():0,toolsHeight:s.outerHeight()||0,menuBarHeight:z.outerHeight()||0,visualTopHeight:t.outerHeight()||0,textTopHeight:v.outerHeight()||0,bottomHeight:y.outerHeight()||0,statusBarHeight:A.outerHeight()||0,sideSortablesHeight:B.height()||0},R.menuBarHeight<3&&(R.menuBarHeight=0)}function c(a){var b,c,d,e,f,g=jQuery.ui.keyCode,h=a.keyCode,i=document.createRange(),j=w[0].selectionStart,k=w[0].selectionEnd,l=x[0].firstChild,m=10;if(!j||!k||j===k){try{i.setStart(l,j),i.setEnd(l,k+1)}catch(n){}b=i.getBoundingClientRect(),b.height&&(c=b.top-m,d=c+b.height+m,e=R.adminBarHeight+R.toolsHeight+R.textTopHeight,f=R.windowHeight-R.bottomHeight,e>c&&(h===g.UP||h===g.LEFT||h===g.BACKSPACE)?window.scrollTo(window.pageXOffset,c+window.pageYOffset-e):d>f&&window.scrollTo(window.pageXOffset,d+window.pageYOffset-f))}}function d(){if(!(k&&!k.isHidden()||!k&&"tinymce"===Q)){var a,b=w.height();x.width(w.width()-22),x.text(w.val()+"&nbsp;"),a=x.height(),P>a&&(a=P),a!==b&&(w.height(a),e())}}function e(a){if(!E||!E.settings.visible){var c,e,f,g,h,i,j,l,o,q=m.scrollTop(),F="scroll"!==a,G=k&&!k.isHidden(),M=P,Q=D.offset().top,S=1,T=r.width();(F||!R.windowHeight)&&b(),G||"resize"!==a||d(),G?(c=t,e=u,j=R.visualTopHeight):(c=v,e=w,j=R.textTopHeight),i=c.parent().offset().top,l=e.offset().top,o=e.outerHeight(),h=G?P+j:P+20,h=o>h+5,h?((!H||F)&&q>=i-R.toolsHeight-R.adminBarHeight&&q<=i-R.toolsHeight-R.adminBarHeight+o-M?(H=!0,s.css({position:"fixed",top:R.adminBarHeight,width:T}),G&&z.length&&z.css({position:"fixed",top:R.adminBarHeight+R.toolsHeight,width:T-2*S-(G?0:c.outerWidth()-c.width())}),c.css({position:"fixed",top:R.adminBarHeight+R.toolsHeight+R.menuBarHeight,width:T-2*S-(G?0:c.outerWidth()-c.width())})):(H||F)&&(q<=i-R.toolsHeight-R.adminBarHeight?(H=!1,s.css({position:"absolute",top:0,width:T}),G&&z.length&&z.css({position:"absolute",top:0,width:T-2*S}),c.css({position:"absolute",top:R.menuBarHeight,width:T-2*S-(G?0:c.outerWidth()-c.width())})):q>=i-R.toolsHeight-R.adminBarHeight+o-M&&(H=!1,s.css({position:"absolute",top:o-M,width:T}),G&&z.length&&z.css({position:"absolute",top:o-M,width:T-2*S}),c.css({position:"absolute",top:o-M+R.menuBarHeight,width:T-2*S-(G?0:c.outerWidth()-c.width())}))),(!I||F)&&q+R.windowHeight<=l+o+R.bottomHeight+R.statusBarHeight+S?(I=!0,A.css({position:"fixed",bottom:R.bottomHeight,width:T-2*S}),y.css({position:"fixed",bottom:0,width:T})):(I||F)&&q+R.windowHeight>l+o+R.bottomHeight+R.statusBarHeight-S&&(I=!1,A.add(y).attr("style",""))):F&&(s.css({position:"absolute",top:0,width:T}),G&&z.length&&z.css({position:"absolute",top:0,width:T-2*S}),c.css({position:"absolute",top:R.menuBarHeight,width:T-2*S-(G?0:c.outerWidth()-c.width())}),A.add(y).attr("style","")),C.width()<300&&R.windowWidth>600&&n.height()>B.height()+Q+120&&R.windowHeight<o?(R.sideSortablesHeight+N+O>R.windowHeight||J||K?Q>=q+N?(B.attr("style",""),J=K=!1):q>L?J?(J=!1,f=B.offset().top-R.adminBarHeight,g=p.offset().top,g<f+R.sideSortablesHeight+O&&(f=g-R.sideSortablesHeight-12),B.css({position:"absolute",top:f,bottom:""})):!K&&R.sideSortablesHeight+B.offset().top+O<q+R.windowHeight&&(K=!0,B.css({position:"fixed",top:"auto",bottom:O})):L>q&&(K?(K=!1,f=B.offset().top-O,g=p.offset().top,g<f+R.sideSortablesHeight+O&&(f=g-R.sideSortablesHeight-12),B.css({position:"absolute",top:f,bottom:""})):!J&&B.offset().top>=q+N&&(J=!0,B.css({position:"fixed",top:N,bottom:""}))):(q>=Q-N?B.css({position:"fixed",top:N}):B.attr("style",""),J=K=!1),L=q):(B.attr("style",""),J=K=!1),F&&(r.css({paddingTop:R.toolsHeight}),G?u.css({paddingTop:R.visualTopHeight+R.menuBarHeight}):(w.css({marginTop:R.textTopHeight}),x.width(T-20-2*S)))}}function f(){d(),e()}function g(a){for(var b=1;6>b;b++)setTimeout(a,500*b)}function h(){clearTimeout(l),l=setTimeout(e,100)}function i(){window.pageYOffset&&window.pageYOffset>M&&window.scrollTo(window.pageXOffset,0),q.addClass("wp-editor-expand"),m.on("scroll.editor-expand resize.editor-expand",function(a){e(a.type),h()}),n.on("wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand",e).on("postbox-toggled.editor-expand",function(){!J&&!K&&window.pageYOffset>N&&(K=!0,window.scrollBy(0,-1),e(),window.scrollBy(0,1)),e()}).on("wp-window-resized.editor-expand",function(){k&&!k.isHidden()?k.execCommand("wpAutoResize"):d()}),w.on("focus.editor-expand input.editor-expand propertychange.editor-expand",d),w.on("keyup.editor-expand",c),F(),E&&E.pubsub.subscribe("hidden",f),k&&(k.settings.wp_autoresize_on=!0,k.execCommand("wpAutoResizeOn"),k.isHidden()||k.execCommand("wpAutoResize")),(!k||k.isHidden())&&d(),e()}function j(){var b=window.getUserSetting("ed_size");window.pageYOffset&&window.pageYOffset>M&&window.scrollTo(window.pageXOffset,0),q.removeClass("wp-editor-expand"),m.off(".editor-expand"),n.off(".editor-expand"),w.off(".editor-expand"),G(),E&&E.pubsub.unsubscribe("hidden",f),a.each([t,v,s,z,y,A,r,u,w,B],function(a,b){b&&b.attr("style","")}),H=I=J=K=!1,k&&(k.settings.wp_autoresize_on=!1,k.execCommand("wpAutoResizeOff"),k.isHidden()||(w.hide(),b&&k.theme.resizeTo(null,b))),b&&w.height(b)}var k,l,m=a(window),n=a(document),o=a("#wpadminbar"),p=a("#wpfooter"),q=a("#postdivrich"),r=a("#wp-content-wrap"),s=a("#wp-content-editor-tools"),t=a(),u=a(),v=a("#ed_toolbar"),w=a("#content"),x=a('<div id="content-textarea-clone"></div>'),y=a("#post-status-info"),z=a(),A=a(),B=a("#side-sortables"),C=a("#postbox-container-1"),D=a("#post-body"),E=window.wp.editor&&window.wp.editor.fullscreen,F=function(){},G=function(){},H=!1,I=!1,J=!1,K=!1,L=0,M=130,N=56,O=20,P=300,Q=window.getUserSetting("editor"),R={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0};x.insertAfter(w),x.css({"font-family":w.css("font-family"),"font-size":w.css("font-size"),"line-height":w.css("line-height"),"white-space":"pre-wrap","word-wrap":"break-word"}),n.on("tinymce-editor-init.editor-expand",function(b,c){function f(){var a,b,d=c.selection.getNode();return b=c.plugins.wpview&&(a=c.plugins.wpview.getView(d))?a.getBoundingClientRect():d.getBoundingClientRect(),b.height?b:!1}function h(a){var b,d,e,g,h=tinymce.util.VK,i=a.keyCode,j=f(),k=10;j&&(47>=i&&i!==h.SPACEBAR&&i!==h.ENTER&&i!==h.DELETE&&i!==h.BACKSPACE&&i!==h.UP&&i!==h.LEFT&&i!==h.DOWN&&i!==h.UP||i>=91&&93>=i||i>=112&&123>=i||144===i||145===i||(b=j.top+c.iframeElement.getBoundingClientRect().top,d=b+j.height,b-=k,d+=k,e=R.adminBarHeight+R.toolsHeight+R.menuBarHeight+R.visualTopHeight,g=R.windowHeight-R.bottomHeight-R.statusBarHeight,g-e<j.height||(e>b&&(i===h.UP||i===h.LEFT||i===h.BACKSPACE)?window.scrollTo(window.pageXOffset,b+window.pageYOffset-e):d>g&&window.scrollTo(window.pageXOffset,d+window.pageYOffset-g))))}function i(){m.on("scroll.mce-float-panels",l),setTimeout(function(){c.execCommand("wpAutoResize"),e()},300)}function j(){m.off("scroll.mce-float-panels"),setTimeout(function(){var a=r.offset().top;window.pageYOffset>a&&window.scrollTo(window.pageXOffset,a-R.adminBarHeight),d(),e()},100),e()}var l=_.debounce(function(){!a(".mce-floatpanel:hover").length&&tinymce.ui.FloatPanel.hideAll(),a(".mce-tooltip").hide()},1e3,!0);"content"===c.id&&(k=c,c.settings.autoresize_min_height=P,t=r.find(".mce-toolbar-grp"),u=r.find(".mce-edit-area"),A=r.find(".mce-statusbar"),z=r.find(".mce-menubar"),F=function(){c.on("keyup",h),c.on("show",i),c.on("hide",j),c.on("setcontent wp-autoresize wp-toolbar-toggle",e),m.off("scroll.mce-float-panels").on("scroll.mce-float-panels",l)},G=function(){c.off("keyup",h),c.off("show",i),c.off("hide",j),c.off("setcontent wp-autoresize wp-toolbar-toggle",e),m.off("scroll.mce-float-panels")},q.hasClass("wp-editor-expand")&&(F(),g(e)))}),q.hasClass("wp-editor-expand")&&(i(),r.hasClass("html-active")&&g(function(){e(),d()})),a("#adv-settings .editor-expand").show(),a("#editor-expand-toggle").on("change.editor-expand",function(){a(this).prop("checked")?(i(),window.setUserSetting("editor_expand","on")):(j(),window.setUserSetting("editor_expand","off"))}),window.editorExpand={on:i,off:j}});
\ No newline at end of file
+!function(a,b){"use strict";var c=b(a),d=b(document),e=b("#wpadminbar"),f=b("#wpfooter");b(function(){function g(){var a=c.width();T={windowHeight:c.height(),windowWidth:a,adminBarHeight:a>600?e.outerHeight():0,toolsHeight:t.outerHeight()||0,menuBarHeight:A.outerHeight()||0,visualTopHeight:u.outerHeight()||0,textTopHeight:w.outerHeight()||0,bottomHeight:z.outerHeight()||0,statusBarHeight:B.outerHeight()||0,sideSortablesHeight:C.height()||0},T.menuBarHeight<3&&(T.menuBarHeight=0)}function h(b){var c,d,e,f,g,h=jQuery.ui.keyCode,i=b.keyCode,j=document.createRange(),k=x[0].selectionStart,l=x[0].selectionEnd,m=y[0].firstChild,n=10;if(!k||!l||k===l){try{j.setStart(m,k),j.setEnd(m,l+1)}catch(o){}c=j.getBoundingClientRect(),c.height&&(d=c.top-n,e=d+c.height+n,f=T.adminBarHeight+T.toolsHeight+T.textTopHeight,g=T.windowHeight-T.bottomHeight,f>d&&(i===h.UP||i===h.LEFT||i===h.BACKSPACE)?a.scrollTo(a.pageXOffset,d+a.pageYOffset-f):e>g&&a.scrollTo(a.pageXOffset,e+a.pageYOffset-g))}}function i(){if(!(p&&!p.isHidden()||!p&&"tinymce"===R)){var a,b=x.height();y.width(x.width()-22),y.text(x.val()+"&nbsp;"),a=y.height(),Q>a&&(a=Q),a!==b&&(x.height(a),j())}}function j(b){if(!F||!F.settings.visible){var e,h,j,k,l,m,n,o,q,r=c.scrollTop(),G=b&&b.type,H="scroll"!==G,N=p&&!p.isHidden(),R=Q,U=E.offset().top,V=1,W=s.width();(H||!T.windowHeight)&&g(),N||"resize"!==G||i(),N?(e=u,h=v,n=T.visualTopHeight):(e=w,h=x,n=T.textTopHeight),m=e.parent().offset().top,o=h.offset().top,q=h.outerHeight(),l=N?Q+n:Q+20,l=q>l+5,l?((!I||H)&&r>=m-T.toolsHeight-T.adminBarHeight&&r<=m-T.toolsHeight-T.adminBarHeight+q-R?(I=!0,t.css({position:"fixed",top:T.adminBarHeight,width:W}),N&&A.length&&A.css({position:"fixed",top:T.adminBarHeight+T.toolsHeight,width:W-2*V-(N?0:e.outerWidth()-e.width())}),e.css({position:"fixed",top:T.adminBarHeight+T.toolsHeight+T.menuBarHeight,width:W-2*V-(N?0:e.outerWidth()-e.width())})):(I||H)&&(r<=m-T.toolsHeight-T.adminBarHeight?(I=!1,t.css({position:"absolute",top:0,width:W}),N&&A.length&&A.css({position:"absolute",top:0,width:W-2*V}),e.css({position:"absolute",top:T.menuBarHeight,width:W-2*V-(N?0:e.outerWidth()-e.width())})):r>=m-T.toolsHeight-T.adminBarHeight+q-R&&(I=!1,t.css({position:"absolute",top:q-R,width:W}),N&&A.length&&A.css({position:"absolute",top:q-R,width:W-2*V}),e.css({position:"absolute",top:q-R+T.menuBarHeight,width:W-2*V-(N?0:e.outerWidth()-e.width())}))),(!J||H&&S)&&r+T.windowHeight<=o+q+T.bottomHeight+T.statusBarHeight+V?b&&b.deltaHeight>0&&b.deltaHeight<100?a.scrollBy(0,b.deltaHeight):S&&(J=!0,B.css({position:"fixed",bottom:T.bottomHeight,visibility:"",width:W-2*V}),z.css({position:"fixed",bottom:0,width:W})):(!S&&J||(J||H)&&r+T.windowHeight>o+q+T.bottomHeight+T.statusBarHeight-V)&&(J=!1,B.add(z).attr("style",""),S||B.css("visibility","hidden"))):H&&(t.css({position:"absolute",top:0,width:W}),N&&A.length&&A.css({position:"absolute",top:0,width:W-2*V}),e.css({position:"absolute",top:T.menuBarHeight,width:W-2*V-(N?0:e.outerWidth()-e.width())}),B.add(z).attr("style","")),D.width()<300&&T.windowWidth>600&&d.height()>C.height()+U+120&&T.windowHeight<q?(T.sideSortablesHeight+O+P>T.windowHeight||K||L?U>=r+O?(C.attr("style",""),K=L=!1):r>M?K?(K=!1,j=C.offset().top-T.adminBarHeight,k=f.offset().top,k<j+T.sideSortablesHeight+P&&(j=k-T.sideSortablesHeight-12),C.css({position:"absolute",top:j,bottom:""})):!L&&T.sideSortablesHeight+C.offset().top+P<r+T.windowHeight&&(L=!0,C.css({position:"fixed",top:"auto",bottom:P})):M>r&&(L?(L=!1,j=C.offset().top-P,k=f.offset().top,k<j+T.sideSortablesHeight+P&&(j=k-T.sideSortablesHeight-12),C.css({position:"absolute",top:j,bottom:""})):!K&&C.offset().top>=r+O&&(K=!0,C.css({position:"fixed",top:O,bottom:""}))):(r>=U-O?C.css({position:"fixed",top:O}):C.attr("style",""),K=L=!1),M=r):(C.attr("style",""),K=L=!1),H&&(s.css({paddingTop:T.toolsHeight}),N?v.css({paddingTop:T.visualTopHeight+T.menuBarHeight}):(x.css({marginTop:T.textTopHeight}),y.width(W-20-2*V)))}}function k(){i(),j()}function l(a){for(var b=1;6>b;b++)setTimeout(a,500*b)}function m(){clearTimeout(q),q=setTimeout(j,100)}function n(){a.pageYOffset&&a.pageYOffset>N&&a.scrollTo(a.pageXOffset,0),r.addClass("wp-editor-expand"),c.on("scroll.editor-expand resize.editor-expand",function(a){j(a.type),m()}),d.on("wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand",j).on("postbox-toggled.editor-expand",function(){!K&&!L&&a.pageYOffset>O&&(L=!0,a.scrollBy(0,-1),j(),a.scrollBy(0,1)),j()}).on("wp-window-resized.editor-expand",function(){p&&!p.isHidden()?p.execCommand("wpAutoResize"):i()}),x.on("focus.editor-expand input.editor-expand propertychange.editor-expand",i),x.on("keyup.editor-expand",h),G(),F&&F.pubsub.subscribe("hidden",k),p&&(p.settings.wp_autoresize_on=!0,p.execCommand("wpAutoResizeOn"),p.isHidden()||p.execCommand("wpAutoResize")),(!p||p.isHidden())&&i(),j(),d.trigger("editor-expand-on")}function o(){var e=a.getUserSetting("ed_size");a.pageYOffset&&a.pageYOffset>N&&a.scrollTo(a.pageXOffset,0),r.removeClass("wp-editor-expand"),c.off(".editor-expand"),d.off(".editor-expand"),x.off(".editor-expand"),H(),F&&F.pubsub.unsubscribe("hidden",k),b.each([u,w,t,A,z,B,s,v,x,C],function(a,b){b&&b.attr("style","")}),I=J=K=L=!1,p&&(p.settings.wp_autoresize_on=!1,p.execCommand("wpAutoResizeOff"),p.isHidden()||(x.hide(),e&&p.theme.resizeTo(null,e))),e&&x.height(e),d.trigger("editor-expand-off")}var p,q,r=b("#postdivrich"),s=b("#wp-content-wrap"),t=b("#wp-content-editor-tools"),u=b(),v=b(),w=b("#ed_toolbar"),x=b("#content"),y=b('<div id="content-textarea-clone"></div>'),z=b("#post-status-info"),A=b(),B=b(),C=b("#side-sortables"),D=b("#postbox-container-1"),E=b("#post-body"),F=a.wp.editor&&a.wp.editor.fullscreen,G=function(){},H=function(){},I=!1,J=!1,K=!1,L=!1,M=0,N=130,O=56,P=20,Q=300,R=s.hasClass("tmce-active")?"tinymce":"html",S=!!parseInt(a.getUserSetting("hidetb"),10),T={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0};y.insertAfter(x),y.css({"font-family":x.css("font-family"),"font-size":x.css("font-size"),"line-height":x.css("line-height"),"white-space":"pre-wrap","word-wrap":"break-word"}),d.on("tinymce-editor-init.editor-expand",function(d,e){function f(){var a,b,c,d=e.selection.getNode();if(e.plugins.wpview&&(b=e.plugins.wpview.getView(d)))c=b.getBoundingClientRect();else{a=e.selection.getRng();try{c=a.getClientRects()[0]}catch(f){}c||(c=d.getBoundingClientRect())}return c.height?c:!1}function g(a){var b=a.keyCode;47>=b&&b!==q.SPACEBAR&&b!==q.ENTER&&b!==q.DELETE&&b!==q.BACKSPACE&&b!==q.UP&&b!==q.LEFT&&b!==q.DOWN&&b!==q.UP||b>=91&&93>=b||b>=112&&123>=b||144===b||145===b||h(b)}function h(b){var c,d,g,h,i=f(),j=50;i&&(c=i.top+e.iframeElement.getBoundingClientRect().top,d=c+i.height,c-=j,d+=j,g=T.adminBarHeight+T.toolsHeight+T.menuBarHeight+T.visualTopHeight,h=T.windowHeight-(S?T.bottomHeight+T.statusBarHeight:0),h-g<i.height||(g>c&&(b===q.UP||b===q.LEFT||b===q.BACKSPACE)?a.scrollTo(a.pageXOffset,c+a.pageYOffset-g):d>h&&a.scrollTo(a.pageXOffset,d+a.pageYOffset-h)))}function k(a){a.state||j()}function m(){c.on("scroll.mce-float-panels",t),setTimeout(function(){e.execCommand("wpAutoResize"),j()},300)}function n(){c.off("scroll.mce-float-panels"),setTimeout(function(){var b=s.offset().top;a.pageYOffset>b&&a.scrollTo(a.pageXOffset,b-T.adminBarHeight),i(),j()},100),j()}function o(){S=!S}var q=a.tinymce.util.VK,t=_.debounce(function(){!b(".mce-floatpanel:hover").length&&a.tinymce.ui.FloatPanel.hideAll(),b(".mce-tooltip").hide()},1e3,!0);"content"===e.id&&(p=e,e.settings.autoresize_min_height=Q,u=s.find(".mce-toolbar-grp"),v=s.find(".mce-edit-area"),B=s.find(".mce-statusbar"),A=s.find(".mce-menubar"),G=function(){e.on("keyup",g),e.on("show",m),e.on("hide",n),e.on("wp-toolbar-toggle",o),e.on("setcontent wp-autoresize wp-toolbar-toggle",j),e.on("undo redo",h),e.on("FullscreenStateChanged",k),c.off("scroll.mce-float-panels").on("scroll.mce-float-panels",t)},H=function(){e.off("keyup",g),e.off("show",m),e.off("hide",n),e.off("wp-toolbar-toggle",o),e.off("setcontent wp-autoresize wp-toolbar-toggle",j),e.off("undo redo",h),e.off("FullscreenStateChanged",k),c.off("scroll.mce-float-panels")},r.hasClass("wp-editor-expand")&&(G(),l(j)))}),r.hasClass("wp-editor-expand")&&(n(),s.hasClass("html-active")&&l(function(){j(),i()})),b("#adv-settings .editor-expand").show(),b("#editor-expand-toggle").on("change.editor-expand",function(){b(this).prop("checked")?(n(),a.setUserSetting("editor_expand","on")):(o(),a.setUserSetting("editor_expand","off"))}),a.editorExpand={on:n,off:o}}),b(function(){function g(){z=J.offset(),z.right=z.left+J.outerWidth(),z.bottom=z.top+J.outerHeight()}function h(){S||(S=!0,d.trigger("dfw-activate"),L.on("keydown.focus-shortcut",v))}function i(){S&&(l(),S=!1,d.trigger("dfw-deactivate"),L.off("keydown.focus-shortcut"))}function j(){return S}function k(){!T&&S&&(T=!0,L.on("keydown.focus",o),K.add(L).on("blur.focus",q),o(),a.setUserSetting("post_dfw","on"),d.trigger("dfw-on"))}function l(){T&&(T=!1,K.add(L).off(".focus"),p(),J.off(".focus"),a.setUserSetting("post_dfw","off"),d.trigger("dfw-off"))}function m(){T?l():k()}function n(){return T}function o(b){var d=b&&b.keyCode;return 27===d||87===d&&b.altKey&&b.shiftKey?void p(b):void(b&&(b.metaKey||b.ctrlKey&&!b.altKey||b.altKey&&b.shiftKey||d&&(47>=d&&8!==d&&13!==d&&32!==d&&46!==d||d>=91&&93>=d||d>=112&&135>=d||d>=144&&150>=d||d>=224))||(w||(w=!0,clearTimeout(F),F=setTimeout(function(){M.show()},600),J.css("z-index",9998),M.on("mouseenter.focus",function(){g(),c.on("scroll.focus",function(){var b=a.pageYOffset;D&&C&&D!==b&&(C<z.top-W||C>z.bottom+W)&&p(),D=b})}).on("mouseleave.focus",function(){A=B=null,U=V=0,c.off("scroll.focus")}).on("mousemove.focus",function(b){var c=b.clientX,d=b.clientY,e=a.pageYOffset,f=a.pageXOffset;if(A&&B&&(c!==A||d!==B))if(B>=d&&d<z.top-e||d>=B&&d>z.bottom-e||A>=c&&c<z.left-f||c>=A&&c>z.right-f){if(U+=Math.abs(A-c),V+=Math.abs(B-d),(d<=z.top-W-e||d>=z.bottom+W-e||c<=z.left-W-f||c>=z.right+W-f)&&(U>10||V>10))return p(),A=B=null,void(U=V=0)}else U=V=0;A=c,B=d}).on("touchstart.focus",function(a){a.preventDefault(),p()}),J.off("mouseenter.focus"),E&&(clearTimeout(E),E=null),H.addClass("focus-on").removeClass("focus-off")),r(),t()))}function p(a){w&&(w=!1,clearTimeout(F),F=setTimeout(function(){M.hide()},200),J.css("z-index",""),M.off("mouseenter.focus mouseleave.focus mousemove.focus touchstart.focus"),"undefined"==typeof a&&J.on("mouseenter.focus",function(){(b.contains(J.get(0),document.activeElement)||G)&&o()}),E=setTimeout(function(){E=null,J.off("mouseenter.focus")},1e3),H.addClass("focus-off").removeClass("focus-on")),s(),u()}function q(){setTimeout(function(){function a(a){return b.contains(a.get(0),document.activeElement)}var c=document.activeElement.compareDocumentPosition(J.get(0));2!==c&&4!==c||!(a(P)||a(I)||a(f))||p()},0)}function r(){!x&&w&&(x=!0,e.on("mouseenter.focus",function(){e.addClass("focus-off")}).on("mouseleave.focus",function(){e.removeClass("focus-off")}))}function s(){x&&(x=!1,e.off(".focus"))}function t(){y||!w||N.find(":focus").length||(y=!0,N.stop().fadeTo("fast",.3).on("mouseenter.focus",u).off("mouseleave.focus"),O.on("focus.focus",u).off("blur.focus"))}function u(){y&&(y=!1,N.stop().fadeTo("fast",1).on("mouseleave.focus",t).off("mouseenter.focus"),O.on("blur.focus",t).off("focus.focus"))}function v(a){a.altKey&&a.shiftKey&&87===a.keyCode&&m()}var w,x,y,z,A,B,C,D,E,F,G,H=b(document.body),I=b("#wpcontent"),J=b("#post-body-content"),K=b("#title"),L=b("#content"),M=b(document.createElement("DIV")),N=b("#edit-slug-box"),O=N.find("a").add(N.find("button")).add(N.find("input")),P=b("#adminmenuwrap"),Q=b(),R=b(),S="on"===a.getUserSetting("editor_expand","on"),T=S?"on"===a.getUserSetting("post_dfw"):!1,U=0,V=0,W=20;H.append(M),M.css({display:"none",position:"fixed",top:e.height(),right:0,bottom:0,left:0,"z-index":9997}),J.css({position:"relative"}),c.on("mousemove.focus",function(a){C=a.pageY}),b("#postdivrich").hasClass("wp-editor-expand")&&L.on("keydown.focus-shortcut",v),d.on("tinymce-editor-setup.focus",function(a,b){b.addButton("dfw",{active:T,classes:"wp-dfw btn widget",disabled:!S,onclick:m,onPostRender:function(){var a=this;d.on("dfw-activate.focus",function(){a.disabled(!1)}).on("dfw-deactivate.focus",function(){a.disabled(!0)}).on("dfw-on.focus",function(){a.active(!0)}).on("dfw-off.focus",function(){a.active(!1)})},tooltip:"Distraction-free writing mode",shortcut:"Alt+Shift+W"}),b.addCommand("wpToggleDFW",m),b.addShortcut("alt+shift+w","","wpToggleDFW")}),d.on("tinymce-editor-init.focus",function(a,c){function e(){G=!0}function f(){G=!1}var h,i;"content"===c.id&&(Q=b(c.getWin()),R=b(c.getContentAreaContainer()).find("iframe"),h=function(){c.on("keydown",o),c.on("blur",q),c.on("focus",e),c.on("blur",f),c.on("wp-autoresize",g)},i=function(){c.off("keydown",o),c.off("blur",q),c.off("focus",e),c.off("blur",f),c.off("wp-autoresize",g)},T&&h(),d.on("dfw-on.focus",h).on("dfw-off.focus",i),c.on("click",function(a){a.target===c.getDoc().documentElement&&c.focus()}))}),d.on("quicktags-init",function(a,c){var d;c.settings.buttons&&-1!==(","+c.settings.buttons+",").indexOf(",dfw,")&&(d=b("#"+c.name+"_dfw"),b(document).on("dfw-activate",function(){d.prop("disabled",!1)}).on("dfw-deactivate",function(){d.prop("disabled",!0)}).on("dfw-on",function(){d.addClass("active")}).on("dfw-off",function(){d.removeClass("active")}))}),d.on("editor-expand-on.focus",h).on("editor-expand-off.focus",i),T&&(L.on("keydown.focus",o),K.add(L).on("blur.focus",q)),a.wp=a.wp||{},a.wp.editor=a.wp.editor||{},a.wp.editor.dfw={activate:h,deactivate:i,isActive:j,on:k,off:l,toggle:m,isOn:n}})}(window,window.jQuery);
\ No newline at end of file