diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index ae0c094bd5..d265b520f7 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -203,7 +203,6 @@ $(document).on( 'heartbeat-send.refresh-lock', function( e, data ) { jQuery(document).ready( function($) { var stamp, visibility, $submitButtons, updateVisibility, updateText, sticky = '', - last = 0, $textarea = $('#content'), $document = $(document), $editSlugWrap = $('#edit-slug-box'), @@ -788,24 +787,6 @@ jQuery(document).ready( function($) { }); } - // word count - if ( typeof(wpWordCount) != 'undefined' ) { - $document.triggerHandler('wpcountwords', [ $textarea.val() ]); - - $textarea.keyup( function(e) { - var k = e.keyCode || e.charCode; - - if ( k == last ) - return true; - - if ( 13 == k || 8 == last || 46 == last ) - $document.triggerHandler('wpcountwords', [ $textarea.val() ]); - - last = k; - return true; - }); - } - wptitlehint = function(id) { id = id || 'title'; @@ -935,3 +916,44 @@ jQuery(document).ready( function($) { } }); }); + +( function( $, counter ) { + $( function() { + var $content = $( '#content' ), + $count = $( '#wp-word-count' ).find( '.word-count' ), + prevCount = 0, + contentEditor; + + function update() { + var text, count; + + if ( ! contentEditor || contentEditor.isHidden() ) { + text = $content.val(); + } else { + text = contentEditor.getContent( { format: 'raw' } ); + } + + count = counter.count( text ); + + if ( count !== prevCount ) { + $count.text( count ); + } + + prevCount = count; + } + + $( document ).on( 'tinymce-editor-init', function( event, editor ) { + if ( editor.id !== 'content' ) { + return; + } + + contentEditor = editor; + + editor.on( 'nodechange keyup', _.debounce( update, 2000 ) ); + } ); + + $content.on( 'input keyup', _.debounce( update, 2000 ) ); + + update(); + } ); +} )( jQuery, new wp.utils.WordCounter() ); diff --git a/wp-admin/js/post.min.js b/wp-admin/js/post.min.js index 2fa09958e4..9621b7f08d 100644 --- a/wp-admin/js/post.min.js +++ b/wp-admin/js/post.min.js @@ -1 +1 @@ -var commentsBox,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint,makeSlugeditClickable,editPermalink;makeSlugeditClickable=editPermalink=function(){},window.wp=window.wp||{},function(a){var b=!1;commentsBox={st:0,get:function(b,c){var d,e=this.st;return c||(c=20),this.st+=c,this.total=b,a("#commentsdiv .spinner").addClass("is-active"),d={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:e,number:c},a.post(ajaxurl,d,function(b){return b=wpAjax.parseAjaxResponse(b),a("#commentsdiv .widefat").show(),a("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof b&&b.responses[0]?(a("#the-comment-list").append(b.responses[0].data),theList=theExtraList=null,a("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?a("#show-comments").hide():a("#show-comments").show().children("a").html(postL10n.showcomm))):1==b?void a("#show-comments").html(postL10n.endcomm):void a("#the-comment-list").append(''+wpAjax.broken+"")}),!1}},WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)},WPSetThumbnailID=function(b){var c=a('input[value="_thumbnail_id"]',"#list-table");c.size()>0&&a("#meta\\["+c.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(b)},WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(a){"0"==a?alert(setPostThumbnailL10n.error):WPSetThumbnailHTML(a)})},a(document).on("heartbeat-send.refresh-lock",function(b,c){var d=a("#active_post_lock").val(),e=a("#post_ID").val(),f={};e&&a("#post-lock-dialog").length&&(f.post_id=e,d&&(f.lock=d),c["wp-refresh-post-lock"]=f)}).on("heartbeat-tick.refresh-lock",function(b,c){var d,e,f;c["wp-refresh-post-lock"]&&(d=c["wp-refresh-post-lock"],d.lock_error?(e=a("#post-lock-dialog"),e.length&&!e.is(":visible")&&(wp.autosave&&(a(document).one("heartbeat-tick",function(){wp.autosave.server.suspend(),e.removeClass("saving").addClass("saved"),a(window).off("beforeunload.edit-post")}),e.addClass("saving"),wp.autosave.server.triggerSave()),d.lock_error.avatar_src&&(f=a('').attr("src",d.lock_error.avatar_src.replace(/&/g,"&")),e.find("div.post-locked-avatar").empty().append(f)),e.show().find(".currently-editing").text(d.lock_error.text),e.find(".wp-tab-first").focus())):d.new_lock&&a("#active_post_lock").val(d.new_lock))}).on("before-autosave.update-post-slug",function(){b=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){a("#edit-slug-box > *").length||b||a.post(ajaxurl,{action:"sample-permalink",post_id:a("#post_ID").val(),new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(b){"-1"!=b&&a("#edit-slug-box").html(b)})})}(jQuery),function(a){function b(){c=!1,window.clearTimeout(d),d=window.setTimeout(function(){c=!0},3e5)}var c,d;a(document).on("heartbeat-send.wp-refresh-nonces",function(b,d){var e,f;c&&(f=a("#post_ID").val())&&(e=a("#_wpnonce").val())&&(d["wp-refresh-post-nonces"]={post_id:f,post_nonce:e})}).on("heartbeat-tick.wp-refresh-nonces",function(c,d){var e=d["wp-refresh-post-nonces"];e&&(b(),e.replace&&a.each(e.replace,function(b,c){a("#"+b).val(c)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){b()})}(jQuery),jQuery(document).ready(function(a){function b(){var b,c,d=0,e=a("#editable-post-name"),f=e.html(),g=a("#post_name"),h=g.val(),i=a("#edit-slug-buttons"),j=i.html(),k=a("#editable-post-name-full");for(k.find("img").replaceWith(function(){return this.alt}),k=k.html(),a("#view-post-btn").hide(),i.html(''+postL10n.ok+' '+postL10n.cancel+""),i.children(".save").click(function(){var b=e.children("input").val();return b==a("#editable-post-name-full").text()?(i.children(".cancel").click(),!1):(a.post(ajaxurl,{action:"sample-permalink",post_id:m,new_slug:b,new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(c){var d=a("#edit-slug-box");d.html(c),d.hasClass("hidden")&&d.fadeIn("fast",function(){d.removeClass("hidden")}),i.html(j),g.val(b),a("#view-post-btn").show()}),!1)}),i.children(".cancel").click(function(){return a("#view-post-btn").show(),e.html(f),i.html(j),g.val(h),!1}),b=0;bk.length/4?"":k,e.html('').children("input").keypress(function(a){var b=a.keyCode||0;return 13==b?(i.children(".save").click(),!1):27==b?(i.children(".cancel").click(),!1):void 0}).keyup(function(){g.val(this.value)}).focus()}var c,d,e,f,g,h="",i=0,j=a("#content"),k=a(document),l=a("#edit-slug-box"),m=a("#post_ID").val()||0,n=a("#submitpost"),o=!0,p=a("#post-visibility-select"),q=a("#timestampdiv"),r=a("#post-status-select"),s=window.navigator.platform?-1!==window.navigator.platform.indexOf("Mac"):!1;postboxes.add_postbox_toggles(pagenow),window.name="",a("#post-lock-dialog .notification-dialog").on("keydown",function(b){if(9==b.which){var c=a(b.target);c.hasClass("wp-tab-first")&&b.shiftKey?(a(this).find(".wp-tab-last").focus(),b.preventDefault()):c.hasClass("wp-tab-last")&&!b.shiftKey&&(a(this).find(".wp-tab-first").focus(),b.preventDefault())}}).filter(":visible").find(".wp-tab-first").focus(),wp.heartbeat&&a("#post-lock-dialog").length&&wp.heartbeat.interval(15),e=n.find(":submit, a.submitdelete, #post-preview").on("click.edit-post",function(b){var c=a(this);return c.hasClass("disabled")?void b.preventDefault():void(c.hasClass("submitdelete")||c.is("#post-preview")||a("form#post").off("submit.edit-post").on("submit.edit-post",function(b){b.isDefaultPrevented()||(wp.autosave&&wp.autosave.server.suspend(),o=!1,a(window).off("beforeunload.edit-post"),e.addClass("disabled"),"publish"===c.attr("id")?n.find("#major-publishing-actions .spinner").addClass("is-active"):n.find("#minor-publishing .spinner").addClass("is-active"))}))}),a("#post-preview").on("click.post-preview",function(b){var c=a(this),d=a("form#post"),e=a("input#wp-preview"),f=c.attr("target")||"wp-preview",g=navigator.userAgent.toLowerCase();b.preventDefault(),c.hasClass("disabled")||(wp.autosave&&wp.autosave.server.tempBlockSave(),e.val("dopreview"),d.attr("target",f).submit().attr("target",""),-1!==g.indexOf("safari")&&-1===g.indexOf("chrome")&&d.attr("action",function(a,b){return b+"?t="+(new Date).getTime()}),e.val(""))}),a("#title").on("keydown.editor-focus",function(a){var b;if(9===a.keyCode&&!a.ctrlKey&&!a.altKey&&!a.shiftKey){if(b="undefined"!=typeof tinymce&&tinymce.get("content"),b&&!b.isHidden())b.focus();else{if(!j.length)return;j.focus()}a.preventDefault()}}),a("#auto_draft").val()&&a("#title").blur(function(){var b;this.value&&!a("#edit-slug-box > *").length&&(a("form#post").one("submit",function(){b=!0}),window.setTimeout(function(){!b&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),k.on("autosave-disable-buttons.edit-post",function(){e.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||e.removeClass("disabled")}).on("before-autosave.edit-post",function(){a(".autosave-message").text(postL10n.savingText)}).on("after-autosave.edit-post",function(b,c){a(".autosave-message").text(c.message)}),a(window).on("beforeunload.edit-post",function(){var a="undefined"!=typeof tinymce&&tinymce.get("content");return a&&!a.isHidden()&&a.isDirty()||wp.autosave&&wp.autosave.server.postChanged()?postL10n.saveAlert:void 0}).on("unload.edit-post",function(b){o&&(b.target&&"#document"!=b.target.nodeName||a.ajax({type:"POST",url:ajaxurl,async:!1,data:{action:"wp-remove-post-lock",_wpnonce:a("#_wpnonce").val(),post_ID:a("#post_ID").val(),active_post_lock:a("#active_post_lock").val()}}))}),a("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():a("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){return 0===this.id.indexOf("tagsdiv-")?(window.tagBox&&window.tagBox.init(),!1):void 0}),a(".categorydiv").each(function(){var b,c,d,e,f,g=a(this).attr("id");d=g.split("-"),d.shift(),e=d.join("-"),f=e+"_tab","category"==e&&(f="cats"),a("a","#"+e+"-tabs").click(function(){var b=a(this).attr("href");return a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a("#"+e+"-tabs").siblings(".tabs-panel").hide(),a(b).show(),"#"+e+"-all"==b?deleteUserSetting(f):setUserSetting(f,"pop"),!1}),getUserSetting(f)&&a('a[href="#'+e+'-pop"]',"#"+e+"-tabs").click(),a("#new"+e).one("focus",function(){a(this).val("").removeClass("form-input-tip")}),a("#new"+e).keypress(function(b){13===b.keyCode&&(b.preventDefault(),a("#"+e+"-add-submit").click())}),a("#"+e+"-add-submit").click(function(){a("#new"+e).focus()}),b=function(b){return a("#new"+e).val()?(b.data+="&"+a(":checked","#"+e+"checklist").serialize(),a("#"+e+"-add-submit").prop("disabled",!0),b):!1},c=function(b,c){var d,f=a("#new"+e+"_parent");a("#"+e+"-add-submit").prop("disabled",!1),"undefined"!=c.parsed.responses[0]&&(d=c.parsed.responses[0].supplemental.newcat_parent)&&(f.before(d),f.remove())},a("#"+e+"checklist").wpList({alt:"",response:e+"-ajax-response",addBefore:b,addAfter:c}),a("#"+e+"-add-toggle").click(function(){return a("#"+e+"-adder").toggleClass("wp-hidden-children"),a('a[href="#'+e+'-all"]',"#"+e+"-tabs").click(),a("#new"+e).focus(),!1}),a("#"+e+"checklist, #"+e+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var b=a(this),c=b.is(":checked"),d=b.val();d&&b.parents("#taxonomy-"+e).length&&a("#in-"+e+"-"+d+", #in-popular-"+e+"-"+d).prop("checked",c)})}),a("#postcustom").length&&a("#the-list").wpList({addAfter:function(){a("table#list-table").show()},addBefore:function(b){return b.data+="&post_id="+a("#post_ID").val(),b}}),a("#submitdiv").length&&(c=a("#timestamp").html(),d=a("#post-visibility-display").html(),f=function(){"public"!=p.find("input:radio:checked").val()?(a("#sticky").prop("checked",!1),a("#sticky-span").hide()):a("#sticky-span").show(),"password"!=p.find("input:radio:checked").val()?a("#password-span").hide():a("#password-span").show()},g=function(){if(!q.length)return!0;var b,d,e,f,g=a("#post_status"),h=a('option[value="publish"]',g),i=a("#aa").val(),j=a("#mm").val(),k=a("#jj").val(),l=a("#hh").val(),m=a("#mn").val();return b=new Date(i,j-1,k,l,m),d=new Date(a("#hidden_aa").val(),a("#hidden_mm").val()-1,a("#hidden_jj").val(),a("#hidden_hh").val(),a("#hidden_mn").val()),e=new Date(a("#cur_aa").val(),a("#cur_mm").val()-1,a("#cur_jj").val(),a("#cur_hh").val(),a("#cur_mn").val()),b.getFullYear()!=i||1+b.getMonth()!=j||b.getDate()!=k||b.getMinutes()!=m?(q.find(".timestamp-wrap").addClass("form-invalid"),!1):(q.find(".timestamp-wrap").removeClass("form-invalid"),b>e&&"future"!=a("#original_post_status").val()?(f=postL10n.publishOnFuture,a("#publish").val(postL10n.schedule)):e>=b&&"publish"!=a("#original_post_status").val()?(f=postL10n.publishOn,a("#publish").val(postL10n.publish)):(f=postL10n.publishOnPast,a("#publish").val(postL10n.update)),a("#timestamp").html(d.toUTCString()==b.toUTCString()?c:f+" "+postL10n.dateFormat.replace("%1$s",a('option[value="'+a("#mm").val()+'"]',"#mm").text()).replace("%2$s",k).replace("%3$s",i).replace("%4$s",l).replace("%5$s",m)+" "),"private"==p.find("input:radio:checked").val()?(a("#publish").val(postL10n.update),0===h.length?g.append('"):h.html(postL10n.privatelyPublished),a('option[value="publish"]',g).prop("selected",!0),a("#misc-publishing-actions .edit-post-status").hide()):("future"==a("#original_post_status").val()||"draft"==a("#original_post_status").val()?h.length&&(h.remove(),g.val(a("#hidden_post_status").val())):h.html(postL10n.published),g.is(":hidden")&&a("#misc-publishing-actions .edit-post-status").show()),a("#post-status-display").html(a("option:selected",g).text()),"private"==a("option:selected",g).val()||"publish"==a("option:selected",g).val()?a("#save-post").hide():(a("#save-post").show(),a("#save-post").show().val("pending"==a("option:selected",g).val()?postL10n.savePending:postL10n.saveDraft)),!0)},a("#visibility .edit-visibility").click(function(){return p.is(":hidden")&&(f(),p.slideDown("fast").find('input[type="radio"]').first().focus(),a(this).hide()),!1}),p.find(".cancel-post-visibility").click(function(b){p.slideUp("fast"),a("#visibility-radio-"+a("#hidden-post-visibility").val()).prop("checked",!0),a("#post_password").val(a("#hidden-post-password").val()),a("#sticky").prop("checked",a("#hidden-post-sticky").prop("checked")),a("#post-visibility-display").html(d),a("#visibility .edit-visibility").show().focus(),g(),b.preventDefault()}),p.find(".save-post-visibility").click(function(b){p.slideUp("fast"),a("#visibility .edit-visibility").show(),g(),"public"!=p.find("input:radio:checked").val()&&a("#sticky").prop("checked",!1),h=a("#sticky").prop("checked")?"Sticky":"",a("#post-visibility-display").html(postL10n[p.find("input:radio:checked").val()+h]),b.preventDefault()}),p.find("input:radio").change(function(){f()}),q.siblings("a.edit-timestamp").click(function(b){q.is(":hidden")&&(q.slideDown("fast"),a("#mm").focus(),a(this).hide()),b.preventDefault()}),q.find(".cancel-timestamp").click(function(b){q.slideUp("fast").siblings("a.edit-timestamp").show().focus(),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),g(),b.preventDefault()}),q.find(".save-timestamp").click(function(a){g()&&(q.slideUp("fast"),q.siblings("a.edit-timestamp").show()),a.preventDefault()}),a("#post").on("submit",function(b){g()||(b.preventDefault(),q.show(),wp.autosave&&wp.autosave.enableButtons(),a("#publishing-action .spinner").removeClass("is-active"))}),r.siblings("a.edit-post-status").click(function(b){r.is(":hidden")&&(r.slideDown("fast").find("select").focus(),a(this).hide()),b.preventDefault()}),r.find(".save-post-status").click(function(a){r.slideUp("fast").siblings("a.edit-post-status").show(),g(),a.preventDefault()}),r.find(".cancel-post-status").click(function(b){a("#post-status-select").slideUp("fast").siblings("a.edit-post-status").show().focus(),a("#post_status").val(a("#hidden_post_status").val()),g(),b.preventDefault()})),l.length&&l.on("click",function(c){var d=a(c.target);(d.is("#editable-post-name")||d.hasClass("edit-slug"))&&b()}),"undefined"!=typeof wpWordCount&&(k.triggerHandler("wpcountwords",[j.val()]),j.keyup(function(a){var b=a.keyCode||a.charCode;return b==i?!0:((13==b||8==i||46==i)&&k.triggerHandler("wpcountwords",[j.val()]),i=b,!0)})),wptitlehint=function(b){b=b||"title";var c=a("#"+b),d=a("#"+b+"-prompt-text");""===c.val()&&d.removeClass("screen-reader-text"),d.click(function(){a(this).addClass("screen-reader-text"),c.focus()}),c.blur(function(){""===this.value&&d.removeClass("screen-reader-text")}).focus(function(){d.addClass("screen-reader-text")}).keydown(function(b){d.addClass("screen-reader-text"),a(this).unbind(b)})},wptitlehint(),function(){function b(a){h.hasClass("wp-editor-expand")||(f?d.theme.resizeTo(null,e+a.pageY):j.height(Math.max(50,e+a.pageY)),a.preventDefault())}function c(){var b,c;h.hasClass("wp-editor-expand")||(f?(d.focus(),c=parseInt(a("#wp-content-editor-container .mce-toolbar-grp").height(),10),(10>c||c>200)&&(c=30),b=parseInt(a("#content_ifr").css("height"),10)+c-28):(j.focus(),b=parseInt(j.css("height"),10)),k.off(".wp-editor-resize"),b&&b>50&&5e3>b&&setUserSetting("ed_size",b))}var d,e,f,g=a("#post-status-info"),h=a("#postdivrich");return!j.length||"ontouchstart"in window?void a("#content-resize-handle").hide():void g.on("mousedown.wp-editor-resize",function(g){"undefined"!=typeof tinymce&&(d=tinymce.get("content")),d&&!d.isHidden()?(f=!0,e=a("#content_ifr").height()-g.pageY):(f=!1,e=j.height()-g.pageY,j.blur()),k.on("mousemove.wp-editor-resize",b).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",c),g.preventDefault()}).on("mouseup.wp-editor-resize",c)}(),"undefined"!=typeof tinymce&&a("#post-formats-select input.post-format").on("change.set-editor-class",function(){var b,c,d=this.id;d&&a(this).prop("checked")&&(b=tinymce.get("content"))&&(c=b.getBody(),c.className=c.className.replace(/\bpost-format-[^ ]+/,""),b.dom.addClass(c,"post-format-0"==d?"post-format-standard":d),a(document).trigger("editor-classchange"))}),j.on("keydown.wp-autosave",function(a){if(83===a.which){if(a.shiftKey||a.altKey||s&&(!a.metaKey||a.ctrlKey)||!s&&!a.ctrlKey)return;wp.autosave&&wp.autosave.server.triggerSave(),a.preventDefault()}})}); \ No newline at end of file +var commentsBox,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint,makeSlugeditClickable,editPermalink;makeSlugeditClickable=editPermalink=function(){},window.wp=window.wp||{},function(a){var b=!1;commentsBox={st:0,get:function(b,c){var d,e=this.st;return c||(c=20),this.st+=c,this.total=b,a("#commentsdiv .spinner").addClass("is-active"),d={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:e,number:c},a.post(ajaxurl,d,function(b){return b=wpAjax.parseAjaxResponse(b),a("#commentsdiv .widefat").show(),a("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof b&&b.responses[0]?(a("#the-comment-list").append(b.responses[0].data),theList=theExtraList=null,a("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?a("#show-comments").hide():a("#show-comments").show().children("a").html(postL10n.showcomm))):1==b?void a("#show-comments").html(postL10n.endcomm):void a("#the-comment-list").append(''+wpAjax.broken+"")}),!1}},WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)},WPSetThumbnailID=function(b){var c=a('input[value="_thumbnail_id"]',"#list-table");c.size()>0&&a("#meta\\["+c.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(b)},WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(a){"0"==a?alert(setPostThumbnailL10n.error):WPSetThumbnailHTML(a)})},a(document).on("heartbeat-send.refresh-lock",function(b,c){var d=a("#active_post_lock").val(),e=a("#post_ID").val(),f={};e&&a("#post-lock-dialog").length&&(f.post_id=e,d&&(f.lock=d),c["wp-refresh-post-lock"]=f)}).on("heartbeat-tick.refresh-lock",function(b,c){var d,e,f;c["wp-refresh-post-lock"]&&(d=c["wp-refresh-post-lock"],d.lock_error?(e=a("#post-lock-dialog"),e.length&&!e.is(":visible")&&(wp.autosave&&(a(document).one("heartbeat-tick",function(){wp.autosave.server.suspend(),e.removeClass("saving").addClass("saved"),a(window).off("beforeunload.edit-post")}),e.addClass("saving"),wp.autosave.server.triggerSave()),d.lock_error.avatar_src&&(f=a('').attr("src",d.lock_error.avatar_src.replace(/&/g,"&")),e.find("div.post-locked-avatar").empty().append(f)),e.show().find(".currently-editing").text(d.lock_error.text),e.find(".wp-tab-first").focus())):d.new_lock&&a("#active_post_lock").val(d.new_lock))}).on("before-autosave.update-post-slug",function(){b=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){a("#edit-slug-box > *").length||b||a.post(ajaxurl,{action:"sample-permalink",post_id:a("#post_ID").val(),new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(b){"-1"!=b&&a("#edit-slug-box").html(b)})})}(jQuery),function(a){function b(){c=!1,window.clearTimeout(d),d=window.setTimeout(function(){c=!0},3e5)}var c,d;a(document).on("heartbeat-send.wp-refresh-nonces",function(b,d){var e,f;c&&(f=a("#post_ID").val())&&(e=a("#_wpnonce").val())&&(d["wp-refresh-post-nonces"]={post_id:f,post_nonce:e})}).on("heartbeat-tick.wp-refresh-nonces",function(c,d){var e=d["wp-refresh-post-nonces"];e&&(b(),e.replace&&a.each(e.replace,function(b,c){a("#"+b).val(c)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){b()})}(jQuery),jQuery(document).ready(function(a){function b(){var b,c,d=0,e=a("#editable-post-name"),f=e.html(),g=a("#post_name"),h=g.val(),i=a("#edit-slug-buttons"),j=i.html(),k=a("#editable-post-name-full");for(k.find("img").replaceWith(function(){return this.alt}),k=k.html(),a("#view-post-btn").hide(),i.html(''+postL10n.ok+' '+postL10n.cancel+""),i.children(".save").click(function(){var b=e.children("input").val();return b==a("#editable-post-name-full").text()?(i.children(".cancel").click(),!1):(a.post(ajaxurl,{action:"sample-permalink",post_id:l,new_slug:b,new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(c){var d=a("#edit-slug-box");d.html(c),d.hasClass("hidden")&&d.fadeIn("fast",function(){d.removeClass("hidden")}),i.html(j),g.val(b),a("#view-post-btn").show()}),!1)}),i.children(".cancel").click(function(){return a("#view-post-btn").show(),e.html(f),i.html(j),g.val(h),!1}),b=0;bk.length/4?"":k,e.html('').children("input").keypress(function(a){var b=a.keyCode||0;return 13==b?(i.children(".save").click(),!1):27==b?(i.children(".cancel").click(),!1):void 0}).keyup(function(){g.val(this.value)}).focus()}var c,d,e,f,g,h="",i=a("#content"),j=a(document),k=a("#edit-slug-box"),l=a("#post_ID").val()||0,m=a("#submitpost"),n=!0,o=a("#post-visibility-select"),p=a("#timestampdiv"),q=a("#post-status-select"),r=window.navigator.platform?-1!==window.navigator.platform.indexOf("Mac"):!1;postboxes.add_postbox_toggles(pagenow),window.name="",a("#post-lock-dialog .notification-dialog").on("keydown",function(b){if(9==b.which){var c=a(b.target);c.hasClass("wp-tab-first")&&b.shiftKey?(a(this).find(".wp-tab-last").focus(),b.preventDefault()):c.hasClass("wp-tab-last")&&!b.shiftKey&&(a(this).find(".wp-tab-first").focus(),b.preventDefault())}}).filter(":visible").find(".wp-tab-first").focus(),wp.heartbeat&&a("#post-lock-dialog").length&&wp.heartbeat.interval(15),e=m.find(":submit, a.submitdelete, #post-preview").on("click.edit-post",function(b){var c=a(this);return c.hasClass("disabled")?void b.preventDefault():void(c.hasClass("submitdelete")||c.is("#post-preview")||a("form#post").off("submit.edit-post").on("submit.edit-post",function(b){b.isDefaultPrevented()||(wp.autosave&&wp.autosave.server.suspend(),n=!1,a(window).off("beforeunload.edit-post"),e.addClass("disabled"),"publish"===c.attr("id")?m.find("#major-publishing-actions .spinner").addClass("is-active"):m.find("#minor-publishing .spinner").addClass("is-active"))}))}),a("#post-preview").on("click.post-preview",function(b){var c=a(this),d=a("form#post"),e=a("input#wp-preview"),f=c.attr("target")||"wp-preview",g=navigator.userAgent.toLowerCase();b.preventDefault(),c.hasClass("disabled")||(wp.autosave&&wp.autosave.server.tempBlockSave(),e.val("dopreview"),d.attr("target",f).submit().attr("target",""),-1!==g.indexOf("safari")&&-1===g.indexOf("chrome")&&d.attr("action",function(a,b){return b+"?t="+(new Date).getTime()}),e.val(""))}),a("#title").on("keydown.editor-focus",function(a){var b;if(9===a.keyCode&&!a.ctrlKey&&!a.altKey&&!a.shiftKey){if(b="undefined"!=typeof tinymce&&tinymce.get("content"),b&&!b.isHidden())b.focus();else{if(!i.length)return;i.focus()}a.preventDefault()}}),a("#auto_draft").val()&&a("#title").blur(function(){var b;this.value&&!a("#edit-slug-box > *").length&&(a("form#post").one("submit",function(){b=!0}),window.setTimeout(function(){!b&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),j.on("autosave-disable-buttons.edit-post",function(){e.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||e.removeClass("disabled")}).on("before-autosave.edit-post",function(){a(".autosave-message").text(postL10n.savingText)}).on("after-autosave.edit-post",function(b,c){a(".autosave-message").text(c.message)}),a(window).on("beforeunload.edit-post",function(){var a="undefined"!=typeof tinymce&&tinymce.get("content");return a&&!a.isHidden()&&a.isDirty()||wp.autosave&&wp.autosave.server.postChanged()?postL10n.saveAlert:void 0}).on("unload.edit-post",function(b){n&&(b.target&&"#document"!=b.target.nodeName||a.ajax({type:"POST",url:ajaxurl,async:!1,data:{action:"wp-remove-post-lock",_wpnonce:a("#_wpnonce").val(),post_ID:a("#post_ID").val(),active_post_lock:a("#active_post_lock").val()}}))}),a("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():a("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){return 0===this.id.indexOf("tagsdiv-")?(window.tagBox&&window.tagBox.init(),!1):void 0}),a(".categorydiv").each(function(){var b,c,d,e,f,g=a(this).attr("id");d=g.split("-"),d.shift(),e=d.join("-"),f=e+"_tab","category"==e&&(f="cats"),a("a","#"+e+"-tabs").click(function(){var b=a(this).attr("href");return a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a("#"+e+"-tabs").siblings(".tabs-panel").hide(),a(b).show(),"#"+e+"-all"==b?deleteUserSetting(f):setUserSetting(f,"pop"),!1}),getUserSetting(f)&&a('a[href="#'+e+'-pop"]',"#"+e+"-tabs").click(),a("#new"+e).one("focus",function(){a(this).val("").removeClass("form-input-tip")}),a("#new"+e).keypress(function(b){13===b.keyCode&&(b.preventDefault(),a("#"+e+"-add-submit").click())}),a("#"+e+"-add-submit").click(function(){a("#new"+e).focus()}),b=function(b){return a("#new"+e).val()?(b.data+="&"+a(":checked","#"+e+"checklist").serialize(),a("#"+e+"-add-submit").prop("disabled",!0),b):!1},c=function(b,c){var d,f=a("#new"+e+"_parent");a("#"+e+"-add-submit").prop("disabled",!1),"undefined"!=c.parsed.responses[0]&&(d=c.parsed.responses[0].supplemental.newcat_parent)&&(f.before(d),f.remove())},a("#"+e+"checklist").wpList({alt:"",response:e+"-ajax-response",addBefore:b,addAfter:c}),a("#"+e+"-add-toggle").click(function(){return a("#"+e+"-adder").toggleClass("wp-hidden-children"),a('a[href="#'+e+'-all"]',"#"+e+"-tabs").click(),a("#new"+e).focus(),!1}),a("#"+e+"checklist, #"+e+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var b=a(this),c=b.is(":checked"),d=b.val();d&&b.parents("#taxonomy-"+e).length&&a("#in-"+e+"-"+d+", #in-popular-"+e+"-"+d).prop("checked",c)})}),a("#postcustom").length&&a("#the-list").wpList({addAfter:function(){a("table#list-table").show()},addBefore:function(b){return b.data+="&post_id="+a("#post_ID").val(),b}}),a("#submitdiv").length&&(c=a("#timestamp").html(),d=a("#post-visibility-display").html(),f=function(){"public"!=o.find("input:radio:checked").val()?(a("#sticky").prop("checked",!1),a("#sticky-span").hide()):a("#sticky-span").show(),"password"!=o.find("input:radio:checked").val()?a("#password-span").hide():a("#password-span").show()},g=function(){if(!p.length)return!0;var b,d,e,f,g=a("#post_status"),h=a('option[value="publish"]',g),i=a("#aa").val(),j=a("#mm").val(),k=a("#jj").val(),l=a("#hh").val(),m=a("#mn").val();return b=new Date(i,j-1,k,l,m),d=new Date(a("#hidden_aa").val(),a("#hidden_mm").val()-1,a("#hidden_jj").val(),a("#hidden_hh").val(),a("#hidden_mn").val()),e=new Date(a("#cur_aa").val(),a("#cur_mm").val()-1,a("#cur_jj").val(),a("#cur_hh").val(),a("#cur_mn").val()),b.getFullYear()!=i||1+b.getMonth()!=j||b.getDate()!=k||b.getMinutes()!=m?(p.find(".timestamp-wrap").addClass("form-invalid"),!1):(p.find(".timestamp-wrap").removeClass("form-invalid"),b>e&&"future"!=a("#original_post_status").val()?(f=postL10n.publishOnFuture,a("#publish").val(postL10n.schedule)):e>=b&&"publish"!=a("#original_post_status").val()?(f=postL10n.publishOn,a("#publish").val(postL10n.publish)):(f=postL10n.publishOnPast,a("#publish").val(postL10n.update)),a("#timestamp").html(d.toUTCString()==b.toUTCString()?c:f+" "+postL10n.dateFormat.replace("%1$s",a('option[value="'+a("#mm").val()+'"]',"#mm").text()).replace("%2$s",k).replace("%3$s",i).replace("%4$s",l).replace("%5$s",m)+" "),"private"==o.find("input:radio:checked").val()?(a("#publish").val(postL10n.update),0===h.length?g.append('"):h.html(postL10n.privatelyPublished),a('option[value="publish"]',g).prop("selected",!0),a("#misc-publishing-actions .edit-post-status").hide()):("future"==a("#original_post_status").val()||"draft"==a("#original_post_status").val()?h.length&&(h.remove(),g.val(a("#hidden_post_status").val())):h.html(postL10n.published),g.is(":hidden")&&a("#misc-publishing-actions .edit-post-status").show()),a("#post-status-display").html(a("option:selected",g).text()),"private"==a("option:selected",g).val()||"publish"==a("option:selected",g).val()?a("#save-post").hide():(a("#save-post").show(),a("#save-post").show().val("pending"==a("option:selected",g).val()?postL10n.savePending:postL10n.saveDraft)),!0)},a("#visibility .edit-visibility").click(function(){return o.is(":hidden")&&(f(),o.slideDown("fast").find('input[type="radio"]').first().focus(),a(this).hide()),!1}),o.find(".cancel-post-visibility").click(function(b){o.slideUp("fast"),a("#visibility-radio-"+a("#hidden-post-visibility").val()).prop("checked",!0),a("#post_password").val(a("#hidden-post-password").val()),a("#sticky").prop("checked",a("#hidden-post-sticky").prop("checked")),a("#post-visibility-display").html(d),a("#visibility .edit-visibility").show().focus(),g(),b.preventDefault()}),o.find(".save-post-visibility").click(function(b){o.slideUp("fast"),a("#visibility .edit-visibility").show(),g(),"public"!=o.find("input:radio:checked").val()&&a("#sticky").prop("checked",!1),h=a("#sticky").prop("checked")?"Sticky":"",a("#post-visibility-display").html(postL10n[o.find("input:radio:checked").val()+h]),b.preventDefault()}),o.find("input:radio").change(function(){f()}),p.siblings("a.edit-timestamp").click(function(b){p.is(":hidden")&&(p.slideDown("fast"),a("#mm").focus(),a(this).hide()),b.preventDefault()}),p.find(".cancel-timestamp").click(function(b){p.slideUp("fast").siblings("a.edit-timestamp").show().focus(),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),g(),b.preventDefault()}),p.find(".save-timestamp").click(function(a){g()&&(p.slideUp("fast"),p.siblings("a.edit-timestamp").show()),a.preventDefault()}),a("#post").on("submit",function(b){g()||(b.preventDefault(),p.show(),wp.autosave&&wp.autosave.enableButtons(),a("#publishing-action .spinner").removeClass("is-active"))}),q.siblings("a.edit-post-status").click(function(b){q.is(":hidden")&&(q.slideDown("fast").find("select").focus(),a(this).hide()),b.preventDefault()}),q.find(".save-post-status").click(function(a){q.slideUp("fast").siblings("a.edit-post-status").show(),g(),a.preventDefault()}),q.find(".cancel-post-status").click(function(b){a("#post-status-select").slideUp("fast").siblings("a.edit-post-status").show().focus(),a("#post_status").val(a("#hidden_post_status").val()),g(),b.preventDefault()})),k.length&&k.on("click",function(c){var d=a(c.target);(d.is("#editable-post-name")||d.hasClass("edit-slug"))&&b()}),wptitlehint=function(b){b=b||"title";var c=a("#"+b),d=a("#"+b+"-prompt-text");""===c.val()&&d.removeClass("screen-reader-text"),d.click(function(){a(this).addClass("screen-reader-text"),c.focus()}),c.blur(function(){""===this.value&&d.removeClass("screen-reader-text")}).focus(function(){d.addClass("screen-reader-text")}).keydown(function(b){d.addClass("screen-reader-text"),a(this).unbind(b)})},wptitlehint(),function(){function b(a){h.hasClass("wp-editor-expand")||(f?d.theme.resizeTo(null,e+a.pageY):i.height(Math.max(50,e+a.pageY)),a.preventDefault())}function c(){var b,c;h.hasClass("wp-editor-expand")||(f?(d.focus(),c=parseInt(a("#wp-content-editor-container .mce-toolbar-grp").height(),10),(10>c||c>200)&&(c=30),b=parseInt(a("#content_ifr").css("height"),10)+c-28):(i.focus(),b=parseInt(i.css("height"),10)),j.off(".wp-editor-resize"),b&&b>50&&5e3>b&&setUserSetting("ed_size",b))}var d,e,f,g=a("#post-status-info"),h=a("#postdivrich");return!i.length||"ontouchstart"in window?void a("#content-resize-handle").hide():void g.on("mousedown.wp-editor-resize",function(g){"undefined"!=typeof tinymce&&(d=tinymce.get("content")),d&&!d.isHidden()?(f=!0,e=a("#content_ifr").height()-g.pageY):(f=!1,e=i.height()-g.pageY,i.blur()),j.on("mousemove.wp-editor-resize",b).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",c),g.preventDefault()}).on("mouseup.wp-editor-resize",c)}(),"undefined"!=typeof tinymce&&a("#post-formats-select input.post-format").on("change.set-editor-class",function(){var b,c,d=this.id;d&&a(this).prop("checked")&&(b=tinymce.get("content"))&&(c=b.getBody(),c.className=c.className.replace(/\bpost-format-[^ ]+/,""),b.dom.addClass(c,"post-format-0"==d?"post-format-standard":d),a(document).trigger("editor-classchange"))}),i.on("keydown.wp-autosave",function(a){if(83===a.which){if(a.shiftKey||a.altKey||r&&(!a.metaKey||a.ctrlKey)||!r&&!a.ctrlKey)return;wp.autosave&&wp.autosave.server.triggerSave(),a.preventDefault()}})}),function(a,b){a(function(){function c(){var a,c;a=!d||d.isHidden()?e.val():d.getContent({format:"raw"}),c=b.count(a),c!==g&&f.text(c),g=c}var d,e=a("#content"),f=a("#wp-word-count").find(".word-count"),g=0;a(document).on("tinymce-editor-init",function(a,b){"content"===b.id&&(d=b,b.on("nodechange keyup",_.debounce(c,2e3)))}),e.on("input keyup",_.debounce(c,2e3)),c()})}(jQuery,new wp.utils.WordCounter); \ No newline at end of file diff --git a/wp-admin/js/word-count.js b/wp-admin/js/word-count.js index 0c537ba179..c1902c39bc 100644 --- a/wp-admin/js/word-count.js +++ b/wp-admin/js/word-count.js @@ -1,44 +1,48 @@ -/* global wordCountL10n */ -var wpWordCount; -(function($,undefined) { - wpWordCount = { +( function() { + function WordCounter( settings ) { + var key; - settings : { - strip : /<[a-zA-Z\/][^<>]*>/g, // strip HTML tags - clean : /[0-9.(),;:!?%#$¿'"_+=\\/-]+/g, // regexp to remove punctuation, etc. - w : /\S\s+/g, // word-counting regexp - c : /\S/g // char-counting regexp for asian languages - }, - - block : 0, - - wc : function(tx, type) { - var t = this, w = $('.word-count'), tc = 0; - - if ( type === undefined ) - type = wordCountL10n.type; - if ( type !== 'w' && type !== 'c' ) - type = 'w'; - - if ( t.block ) - return; - - t.block = 1; - - setTimeout( function() { - if ( tx ) { - tx = tx.replace( t.settings.strip, ' ' ).replace( / | /gi, ' ' ); - tx = tx.replace( t.settings.clean, '' ); - tx.replace( t.settings[type], function(){tc++;} ); + if ( settings ) { + for ( key in settings ) { + if ( settings.hasOwnProperty( key ) ) { + this.settings[ key ] = settings[ key ]; } - w.html(tc.toString()); - - setTimeout( function() { t.block = 0; }, 2000 ); - }, 1 ); + } } + } + + WordCounter.prototype.settings = { + HTMLRegExp: /<\/?[a-z][^>]*?>/gi, + spaceRegExp: / | /gi, + removeRegExp: /[0-9.(),;:!?%#$¿'"_+=\\\/-]+/g, + wordsRegExp: /\S\s+/g, + charactersRegExp: /\S/g, + l10n: window.wordCountL10n || {} }; - $(document).bind( 'wpcountwords', function(e, txt) { - wpWordCount.wc(txt); - }); -}(jQuery)); + WordCounter.prototype.count = function( text, type ) { + var count = 0; + + type = type || this.settings.l10n.type || 'words'; + + if ( text ) { + text = ' ' + text + ' '; + + text = text.replace( this.settings.HTMLRegExp, ' ' ); + text = text.replace( this.settings.spaceRegExp, ' ' ); + text = text.replace( this.settings.removeRegExp, '' ); + + text = text.match( this.settings[ type + 'RegExp' ] ); + + if ( text ) { + count = text.length; + } + } + + return count; + }; + + window.wp = window.wp || {}; + window.wp.utils = window.wp.utils || {}; + window.wp.utils.WordCounter = WordCounter; +} )(); diff --git a/wp-admin/js/word-count.min.js b/wp-admin/js/word-count.min.js index cfe5c702c1..0fd30ecca3 100644 --- a/wp-admin/js/word-count.min.js +++ b/wp-admin/js/word-count.min.js @@ -1 +1 @@ -var wpWordCount;!function(a,b){wpWordCount={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$¿'"_+=\\/-]+/g,w:/\S\s+/g,c:/\S/g},block:0,wc:function(c,d){var e=this,f=a(".word-count"),g=0;d===b&&(d=wordCountL10n.type),"w"!==d&&"c"!==d&&(d="w"),e.block||(e.block=1,setTimeout(function(){c&&(c=c.replace(e.settings.strip," ").replace(/ | /gi," "),c=c.replace(e.settings.clean,""),c.replace(e.settings[d],function(){g++})),f.html(g.toString()),setTimeout(function(){e.block=0},2e3)},1))}},a(document).bind("wpcountwords",function(a,b){wpWordCount.wc(b)})}(jQuery); \ No newline at end of file +!function(){function a(a){var b;if(a)for(b in a)a.hasOwnProperty(b)&&(this.settings[b]=a[b])}a.prototype.settings={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,spaceRegExp:/ | /gi,removeRegExp:/[0-9.(),;:!?%#$¿'"_+=\\\/-]+/g,wordsRegExp:/\S\s+/g,charactersRegExp:/\S/g,l10n:window.wordCountL10n||{}},a.prototype.count=function(a,b){var c=0;return b=b||this.settings.l10n.type||"words",a&&(a=" "+a+" ",a=a.replace(this.settings.HTMLRegExp," "),a=a.replace(this.settings.spaceRegExp," "),a=a.replace(this.settings.removeRegExp,""),a=a.match(this.settings[b+"RegExp"]),a&&(c=a.length)),c},window.wp=window.wp||{},window.wp.utils=window.wp.utils||{},window.wp.utils.WordCounter=a}(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.js index 0006d66969..73075e6f89 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -7,8 +7,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { var DOM = tinymce.DOM, each = tinymce.each, __ = editor.editorManager.i18n.translate, - wpAdvButton, style, - last = 0; + wpAdvButton, style; if ( typeof window.jQuery !== 'undefined' ) { window.jQuery( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] ); @@ -363,23 +362,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } }); - // Word count - if ( typeof window.jQuery !== 'undefined' ) { - editor.on( 'keyup', function( e ) { - var key = e.keyCode || e.charCode; - - if ( key === last ) { - return; - } - - if ( 13 === key || 8 === last || 46 === last ) { - window.jQuery( document ).triggerHandler( 'wpcountwords', [ editor.getContent({ format : 'raw' }) ] ); - } - - last = key; - }); - } - editor.on( 'SaveContent', function( e ) { // If editor is hidden, we just want the textarea's value to be saved if ( ! editor.inline && editor.isHidden() ) { diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js index 90fd404423..3039b2f411 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()})}),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 +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;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)})}))}),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 e91ddfc955..2bda9f0254 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/script-loader.php b/wp-includes/script-loader.php index 71e07f5500..0bf838d501 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -371,11 +371,11 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'wpdialogs', "/wp-includes/js/wpdialog$suffix.js", array( 'jquery-ui-dialog' ), false, 1 ); - $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array( 'jquery' ), false, 1 ); + $scripts->add( 'word-count', "/wp-admin/js/word-count$suffix.js", array(), false, 1 ); did_action( 'init' ) && $scripts->localize( 'word-count', 'wordCountL10n', array( /* translators: If your word count is based on single characters (East Asian characters), enter 'characters'. Otherwise, enter 'words'. Do not translate into your own language. */ - 'type' => 'characters' == _x( 'words', 'word count: words or characters?' ) ? 'c' : 'w', + 'type' => _x( 'words', 'word count: words or characters?' ) ) ); $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode' ), false, 1 ); @@ -451,7 +451,7 @@ function wp_default_scripts( &$scripts ) { 'tagDelimiter' => _x( ',', 'tag delimiter' ), ) ); - $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box' ), false, 1 ); + $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'underscore', 'word-count' ), false, 1 ); did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array( 'ok' => __('OK'), 'cancel' => __('Cancel'), diff --git a/wp-includes/version.php b/wp-includes/version.php index b087931fd6..2c89881c0c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32855'; +$wp_version = '4.3-alpha-32856'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.