diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 7a1b363550..0b621464e5 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -1,10 +1,12 @@ -/* global postL10n, ajaxurl, wpAjax, setPostThumbnailL10n, postboxes, pagenow, tinymce, alert, deleteUserSetting, getUserSetting, setUserSetting */ -/* global theList:true, theExtraList:true, autosave:true */ +/* global postL10n, ajaxurl, wpAjax, setPostThumbnailL10n, postboxes, pagenow, tinymce, alert, deleteUserSetting */ +/* global theList:true, theExtraList:true, getUserSetting, setUserSetting */ -var tagBox, commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint; +var tagBox, commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint, makeSlugeditClickable, editPermalink; // Back-compat: prevent fatal errors makeSlugeditClickable = editPermalink = function(){}; +window.wp = window.wp || {}; + // return an array with any duplicate, whitespace or values removed function array_unique_noempty(a) { var out = []; @@ -283,10 +285,10 @@ $(document).on( 'heartbeat-send.refresh-lock', function( e, data ) { wrap = $('#post-lock-dialog'); if ( wrap.length && ! wrap.is(':visible') ) { - if ( typeof wp != 'undefined' && wp.autosave ) { + if ( wp.autosave ) { // Save the latest changes and disable $(document).one( 'heartbeat-tick', function() { - wp.autosave.server.disable(); + wp.autosave.server.suspend(); wrap.removeClass('saving').addClass('saved'); $(window).off( 'beforeunload.edit-post' ); }); @@ -313,7 +315,7 @@ $(document).on( 'heartbeat-send.refresh-lock', function( e, data ) { $.post( ajaxurl, { action: 'sample-permalink', post_id: $('#post_ID').val(), - new_title: typeof fullscreen != 'undefined' && fullscreen.settings.visible ? $('#wp-fullscreen-title').val() : $('#title').val(), + new_title: $('#title').val(), samplepermalinknonce: $('#samplepermalinknonce').val() }, function( data ) { @@ -368,7 +370,7 @@ $(document).on( 'heartbeat-send.refresh-lock', function( e, data ) { }(jQuery)); jQuery(document).ready( function($) { - var stamp, visibility, $submitButtons, + var stamp, visibility, $submitButtons, updateVisibility, updateText, sticky = '', last = 0, co = $('#content'), @@ -399,7 +401,7 @@ jQuery(document).ready( function($) { }).filter(':visible').find('.wp-tab-first').focus(); // Set the heartbeat interval to 15 sec. if post lock dialogs are enabled - if ( typeof wp !== 'undefined' && wp.heartbeat && $('#post-lock-dialog').length ) { + if ( wp.heartbeat && $('#post-lock-dialog').length ) { wp.heartbeat.interval( 15 ); } @@ -407,7 +409,7 @@ jQuery(document).ready( function($) { $submitButtons = $submitpost.find( ':button, :submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) { var $button = $(this); - if ( $button.hasClass('button-disabled') ) { + if ( $button.hasClass('disabled') ) { event.preventDefault(); return; } @@ -423,14 +425,15 @@ jQuery(document).ready( function($) { return; } - if ( typeof wp != 'undefined' && wp.autosave ) { - wp.autosave.server.disable(); + // Stop autosave + if ( wp.autosave ) { + wp.autosave.server.suspend(); } releaseLock = false; $(window).off( 'beforeunload.edit-post' ); - $submitButtons.addClass( 'button-disabled' ); + $submitButtons.addClass( 'disabled' ); if ( $button.attr('id') === 'publish' ) { $submitpost.find('#major-publishing-actions .spinner').show(); @@ -447,14 +450,14 @@ jQuery(document).ready( function($) { $previewField = $('input#wp-preview'), target = $this.attr('target') || 'wp-preview', ua = navigator.userAgent.toLowerCase(); - + event.preventDefault(); - if ( $this.prop('disabled') ) { + if ( $this.hasClass('disabled') ) { return; } - if ( typeof wp != 'undefined' && wp.autosave ) { + if ( wp.autosave ) { wp.autosave.server.tempBlockSave(); } @@ -496,27 +499,31 @@ jQuery(document).ready( function($) { return; } - if ( typeof wp != 'undefined' && wp.autosave ) { + if ( wp.autosave ) { wp.autosave.server.triggerSave(); } }); } $(document).on( 'autosave-disable-buttons.edit-post', function() { - $submitButtons.addClass( 'button-disabled' ); + $submitButtons.addClass( 'disabled' ); }).on( 'autosave-enable-buttons.edit-post', function() { - if ( ! window.wp || ! window.wp.heartbeat || ! window.wp.heartbeat.hasConnectionError() ) { - $submitButtons.removeClass( 'button-disabled' ); + if ( ! wp.heartbeat || ! wp.heartbeat.hasConnectionError() ) { + $submitButtons.removeClass( 'disabled' ); } + }).on( 'before-autosave.edit-post', function() { + $( '.autosave-message' ).text( postL10n.savingText ); + }).on( 'after-autosave.edit-post', function( event, data ) { + $( '.autosave-message' ).text( data.message ); }); $(window).on( 'beforeunload.edit-post', function() { var editor = typeof tinymce !== 'undefined' && tinymce.get('content'); - if ( ( editor && ! editor.isHidden() && editor.isDirty() ) || - ( typeof wp !== 'undefined' && wp.autosave && wp.autosave.server.postChanged() ) ) { + if ( ( editor && ! editor.isHidden() && editor.isDirty() ) || + ( wp.autosave && wp.autosave.server.postChanged() ) ) { - return autosaveL10n.saveAlert; + return postL10n.saveAlert; } }).on( 'unload.edit-post', function( event ) { if ( ! releaseLock ) { @@ -817,7 +824,7 @@ jQuery(document).ready( function($) { event.preventDefault(); $timestampdiv.show(); - if ( typeof wp !== 'undefined' && wp.autosave ) { + if ( wp.autosave ) { wp.autosave.enableButtons(); } @@ -848,70 +855,76 @@ jQuery(document).ready( function($) { } // end submitdiv // permalink - if ( $editSlugWrap.length ) { - function editPermalink() { - var i, c = 0, e = $('#editable-post-name'), revert_e = e.html(), real_slug = $('#post_name'), - revert_slug = real_slug.val(), b = $('#edit-slug-buttons'), revert_b = b.html(), - full = $('#editable-post-name-full').html(); + function editPermalink() { + var i, slug_value, + c = 0, + e = $('#editable-post-name'), + revert_e = e.html(), + real_slug = $('#post_name'), + revert_slug = real_slug.val(), + b = $('#edit-slug-buttons'), + revert_b = b.html(), + full = $('#editable-post-name-full').html(); - $('#view-post-btn').hide(); - b.html(''+postL10n.ok+' '+postL10n.cancel+''); - b.children('.save').click(function() { - var new_slug = e.children('input').val(); - if ( new_slug == $('#editable-post-name-full').text() ) { - return $('#edit-slug-buttons .cancel').click(); - } - $.post(ajaxurl, { - action: 'sample-permalink', - post_id: postId, - new_slug: new_slug, - new_title: $('#title').val(), - samplepermalinknonce: $('#samplepermalinknonce').val() - }, function(data) { - var box = $('#edit-slug-box'); - box.html(data); - if (box.hasClass('hidden')) { - box.fadeIn('fast', function () { - box.removeClass('hidden'); - }); - } - b.html(revert_b); - real_slug.val(new_slug); - $('#view-post-btn').show(); - }); - return false; - }); - - $('#edit-slug-buttons .cancel').click(function() { - $('#view-post-btn').show(); - e.html(revert_e); - b.html(revert_b); - real_slug.val(revert_slug); - return false; - }); - - for ( i = 0; i < full.length; ++i ) { - if ( '%' == full.charAt(i) ) - c++; + $('#view-post-btn').hide(); + b.html(''+postL10n.ok+' '+postL10n.cancel+''); + b.children('.save').click(function() { + var new_slug = e.children('input').val(); + if ( new_slug == $('#editable-post-name-full').text() ) { + return $('#edit-slug-buttons .cancel').click(); } - - slug_value = ( c > full.length / 4 ) ? '' : full; - e.html('').children('input').keypress(function(e) { - var key = e.keyCode || 0; - // on enter, just save the new slug, don't save the post - if ( 13 == key ) { - b.children('.save').click(); - return false; + $.post(ajaxurl, { + action: 'sample-permalink', + post_id: postId, + new_slug: new_slug, + new_title: $('#title').val(), + samplepermalinknonce: $('#samplepermalinknonce').val() + }, function(data) { + var box = $('#edit-slug-box'); + box.html(data); + if (box.hasClass('hidden')) { + box.fadeIn('fast', function () { + box.removeClass('hidden'); + }); } - if ( 27 == key ) { - b.children('.cancel').click(); - return false; - } - } ).keyup( function() { - real_slug.val(this.value); - }).focus(); - }; + b.html(revert_b); + real_slug.val(new_slug); + $('#view-post-btn').show(); + }); + return false; + }); + $('#edit-slug-buttons .cancel').click(function() { + $('#view-post-btn').show(); + e.html(revert_e); + b.html(revert_b); + real_slug.val(revert_slug); + return false; + }); + + for ( i = 0; i < full.length; ++i ) { + if ( '%' == full.charAt(i) ) + c++; + } + + slug_value = ( c > full.length / 4 ) ? '' : full; + e.html('').children('input').keypress(function(e) { + var key = e.keyCode || 0; + // on enter, just save the new slug, don't save the post + if ( 13 == key ) { + b.children('.save').click(); + return false; + } + if ( 27 == key ) { + b.children('.cancel').click(); + return false; + } + } ).keyup( function() { + real_slug.val(this.value); + }).focus(); + } + + if ( $editSlugWrap.length ) { $editSlugWrap.on( 'click', function( event ) { var $target = $( event.target ); @@ -971,7 +984,7 @@ jQuery(document).ready( function($) { $document = $( document ), $textarea = $('textarea#content'), $handle = $('#post-status-info'); - + // No point for touch devices if ( ! $textarea.length || 'ontouchstart' in window ) { return; diff --git a/wp-admin/js/post.min.js b/wp-admin/js/post.min.js index a75911d109..e7be58b400 100644 --- a/wp-admin/js/post.min.js +++ b/wp-admin/js/post.min.js @@ -1 +1 @@ -function array_unique_noempty(a){var b=[];return jQuery.each(a,function(a,c){c=jQuery.trim(c),c&&-1==jQuery.inArray(c,b)&&b.push(c)}),b}var tagBox,commentsBox,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;makeSlugeditClickable=editPermalink=function(){},function(a){tagBox={clean:function(a){var b=postL10n.comma;return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(b){var c=b.id,d=c.split("-check-num-")[1],e=a(b).closest(".tagsdiv"),f=e.find(".the-tags"),g=postL10n.comma,h=f.val().split(g),i=[];return delete h[d],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),f.val(this.clean(i.join(g))),this.quickClicks(e),!1},quickClicks:function(b){var c,d,e=a(".the-tags",b),f=a(".tagchecklist",b),g=a(b).attr("id");e.length&&(d=e.prop("disabled"),c=e.val().split(postL10n.comma),f.empty(),a.each(c,function(b,c){var e,h;c=a.trim(c),c&&(e=a("").text(c),d||(h=a('X'),h.click(function(){tagBox.parseTags(this)}),e.prepend(" ").prepend(h)),f.append(e))}))},flushTags:function(b,c,d){var e,f,g,h=a(".the-tags",b),i=a("input.newtag",b),j=postL10n.comma;return c=c||!1,g=c?a(c).text():i.val(),e=h.val(),f=e?e+j+g:g,f=this.clean(f),f=array_unique_noempty(f.split(j)).join(j),h.val(f),this.quickClicks(b),c||i.val(""),"undefined"==typeof d&&i.focus(),!1},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){(0===d||"success"!=e)&&(d=wpAjax.broken),d=a('

'+d+"

"),a("a",d).click(function(){return tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this),!1}),a("#"+b).after(d)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))}),a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()}),a("input.newtag",c).blur(function(){""===this.value&&a(this).parent().siblings(".taghint").css("visibility","")}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(b){return 13==b.which?(tagBox.flushTags(a(this).closest(".tagsdiv")),!1):void 0}).keypress(function(a){return 13==a.which?(a.preventDefault(),!1):void 0}).each(function(){var b=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:!0,multipleSep:postL10n.comma+" "})}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a("a.tagcloud-link").click(function(){return tagBox.get(a(this).attr("id")),a(this).unbind().click(function(){return a(this).siblings(".the-tagcloud").toggle(),!1}),!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").show(),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").hide(),"object"==typeof b&&b.responses[0]?(a("#the-comment-list").append(b.responses[0].data),theList=theExtraList=null,a("a[className*=':']").unbind(),commentsBox.st>commentsBox.total?a("#show-comments").hide():a("#show-comments").show().children("a").html(postL10n.showcomm),void 0):1==b?(a("#show-comments").html(postL10n.endcomm),void 0):(a("#the-comment-list").append(''+wpAjax.broken+""),void 0)}),!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")&&("undefined"!=typeof wp&&wp.autosave&&(a(document).one("heartbeat-tick",function(){wp.autosave.server.disable(),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("after-autosave.update-post-slug",function(){a("#edit-slug-box > *").length||a.post(ajaxurl,{action:"sample-permalink",post_id:a("#post_ID").val(),new_title:"undefined"!=typeof fullscreen&&fullscreen.settings.visible?a("#wp-fullscreen-title").val():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=0,d=a("#editable-post-name"),e=d.html(),f=a("#post_name"),g=f.val(),h=a("#edit-slug-buttons"),i=h.html(),k=a("#editable-post-name-full").html();for(a("#view-post-btn").hide(),h.html(''+postL10n.ok+' '+postL10n.cancel+""),h.children(".save").click(function(){var b=d.children("input").val();return b==a("#editable-post-name-full").text()?a("#edit-slug-buttons .cancel").click():(a.post(ajaxurl,{action:"sample-permalink",post_id:j,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")}),h.html(i),f.val(b),a("#view-post-btn").show()}),!1)}),a("#edit-slug-buttons .cancel").click(function(){return a("#view-post-btn").show(),d.html(e),h.html(i),f.val(g),!1}),b=0;bk.length/4?"":k,d.html('').children("input").keypress(function(a){var b=a.keyCode||0;return 13==b?(h.children(".save").click(),!1):27==b?(h.children(".cancel").click(),!1):void 0}).keyup(function(){f.val(this.value)}).focus()}var c,d,e,f="",g=0,h=a("#content"),i=a("#edit-slug-box"),j=a("#post_ID").val()||0,k=a("#submitpost"),l=!0,m=a("#post-visibility-select"),n=a("#timestampdiv"),o=a("#post-status-select");postboxes.add_postbox_toggles(pagenow),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(),"undefined"!=typeof wp&&wp.heartbeat&&a("#post-lock-dialog").length&&wp.heartbeat.interval(15),e=k.find(":button, :submit, a.submitdelete, #post-preview").on("click.edit-post",function(b){var c=a(this);return c.hasClass("button-disabled")?(b.preventDefault(),void 0):(c.hasClass("submitdelete")||c.is("#post-preview")||a("form#post").off("submit.edit-post").on("submit.edit-post",function(b){b.isDefaultPrevented()||("undefined"!=typeof wp&&wp.autosave&&wp.autosave.server.disable(),l=!1,a(window).off("beforeunload.edit-post"),e.addClass("button-disabled"),"publish"===c.attr("id")?k.find("#major-publishing-actions .spinner").show():k.find("#minor-publishing .spinner").show())}),void 0)}),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.prop("disabled")||("undefined"!=typeof wp&&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(b){var c;9!==b.keyCode||b.ctrlKey||b.altKey||b.shiftKey||(c="undefined"!=typeof tinymce&&tinymce.get("content"),c&&!c.isHidden()?c.focus():a("#content").focus(),b.preventDefault())}),a("#auto_draft").val()&&a("#title").blur(function(){this.value&&"1"===a("#auto_draft").val()&&"undefined"!=typeof wp&&wp.autosave&&wp.autosave.server.triggerSave()}),a(document).on("autosave-disable-buttons.edit-post",function(){e.addClass("button-disabled")}).on("autosave-enable-buttons.edit-post",function(){window.wp&&window.wp.heartbeat&&window.wp.heartbeat.hasConnectionError()||e.removeClass("button-disabled")}),a(window).on("beforeunload.edit-post",function(){var a="undefined"!=typeof tinymce&&tinymce.get("content");return a&&!a.isHidden()&&a.isDirty()||"undefined"!=typeof wp&&wp.autosave&&wp.autosave.server.postChanged()?autosaveL10n.saveAlert:void 0}).on("unload.edit-post",function(b){l&&(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?tagBox.init():a("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){return 0===this.id.indexOf("tagsdiv-")?(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(),updateVisibility=function(){"public"!=m.find("input:radio:checked").val()?(a("#sticky").prop("checked",!1),a("#sticky-span").hide()):a("#sticky-span").show(),"password"!=m.find("input:radio:checked").val()?a("#password-span").hide():a("#password-span").show()},updateText=function(){if(!n.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(),o=a("#mn").val();return b=new Date(i,j-1,k,l,o),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()!=o?(n.find(".timestamp-wrap").addClass("form-invalid"),!1):(n.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)),d.toUTCString()==b.toUTCString()?a("#timestamp").html(c):a("#timestamp").html(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",o)+" "),"private"==m.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(),"pending"==a("option:selected",g).val()?a("#save-post").show().val(postL10n.savePending):a("#save-post").show().val(postL10n.saveDraft)),!0)},a("#visibility .edit-visibility").click(function(){return m.is(":hidden")&&(updateVisibility(),m.slideDown("fast").find('input[type="radio"]').first().focus(),a(this).hide()),!1}),m.find(".cancel-post-visibility").click(function(b){m.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(),updateText(),b.preventDefault()}),m.find(".save-post-visibility").click(function(b){m.slideUp("fast"),a("#visibility .edit-visibility").show(),updateText(),"public"!=m.find("input:radio:checked").val()&&a("#sticky").prop("checked",!1),f=a("#sticky").prop("checked")?"Sticky":"",a("#post-visibility-display").html(postL10n[m.find("input:radio:checked").val()+f]),b.preventDefault()}),m.find("input:radio").change(function(){updateVisibility()}),n.siblings("a.edit-timestamp").click(function(b){n.is(":hidden")&&(n.slideDown("fast"),a("#mm").focus(),a(this).hide()),b.preventDefault()}),n.find(".cancel-timestamp").click(function(b){n.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()),updateText(),b.preventDefault()}),n.find(".save-timestamp").click(function(a){updateText()&&(n.slideUp("fast"),n.siblings("a.edit-timestamp").show()),a.preventDefault()}),a("#post").on("submit",function(b){updateText()||(b.preventDefault(),n.show(),"undefined"!=typeof wp&&wp.autosave&&wp.autosave.enableButtons(),a("#publishing-action .spinner").hide())}),o.siblings("a.edit-post-status").click(function(b){o.is(":hidden")&&(o.slideDown("fast").find("select").focus(),a(this).hide()),b.preventDefault()}),o.find(".save-post-status").click(function(a){o.slideUp("fast").siblings("a.edit-post-status").show(),updateText(),a.preventDefault()}),o.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()),updateText(),b.preventDefault()})),i.length&&i.on("click",function(c){var d=a(c.target);(d.is("#editable-post-name")||d.hasClass("edit-slug"))&&b()}),"undefined"!=typeof wpWordCount&&(a(document).triggerHandler("wpcountwords",[h.val()]),h.keyup(function(b){var c=b.keyCode||b.charCode;return c==g?!0:((13==c||8==g||46==g)&&a(document).triggerHandler("wpcountwords",[h.val()]),g=c,!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){f?d.theme.resizeTo(null,e+a.pageY):h.height(Math.max(50,e+a.pageY)),a.preventDefault()}function c(){var b,c;f?(d.focus(),c=a("#wp-content-editor-container .mce-toolbar-grp").height(),b=parseInt(a("#content_ifr").css("height"),10)+c-28):(h.focus(),b=parseInt(h.css("height"),10)),g.off("mousemove.wp-editor-resize mouseup.wp-editor-resize"),b&&b>50&&5e3>b&&setUserSetting("ed_size",b)}var d,e,f,g=a(document),h=a("textarea#content"),i=a("#post-status-info");!h.length||"ontouchstart"in window||(h.css("resize","none"),i.on("mousedown.wp-editor-resize",function(i){"undefined"!=typeof tinymce&&(d=tinymce.get("content")),d&&!d.isHidden()?(f=!0,e=a("#content_ifr").height()-i.pageY):(f=!1,e=h.height()-i.pageY,h.blur()),g.on("mousemove.wp-editor-resize",b).on("mouseup.wp-editor-resize",c),i.preventDefault()}))}(),"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"),b&&(c=b.getBody(),c.className=c.className.replace(/\bpost-format-[^ ]+/,""),b.dom.addClass(c,"post-format-0"==d?"post-format-standard":d)))})}); \ No newline at end of file +function array_unique_noempty(a){var b=[];return jQuery.each(a,function(a,c){c=jQuery.trim(c),c&&-1==jQuery.inArray(c,b)&&b.push(c)}),b}var tagBox,commentsBox,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint,makeSlugeditClickable,editPermalink;makeSlugeditClickable=editPermalink=function(){},window.wp=window.wp||{},function(a){tagBox={clean:function(a){var b=postL10n.comma;return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(b){var c=b.id,d=c.split("-check-num-")[1],e=a(b).closest(".tagsdiv"),f=e.find(".the-tags"),g=postL10n.comma,h=f.val().split(g),i=[];return delete h[d],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),f.val(this.clean(i.join(g))),this.quickClicks(e),!1},quickClicks:function(b){var c,d,e=a(".the-tags",b),f=a(".tagchecklist",b),g=a(b).attr("id");e.length&&(d=e.prop("disabled"),c=e.val().split(postL10n.comma),f.empty(),a.each(c,function(b,c){var e,h;c=a.trim(c),c&&(e=a("").text(c),d||(h=a('X'),h.click(function(){tagBox.parseTags(this)}),e.prepend(" ").prepend(h)),f.append(e))}))},flushTags:function(b,c,d){var e,f,g,h=a(".the-tags",b),i=a("input.newtag",b),j=postL10n.comma;return c=c||!1,g=c?a(c).text():i.val(),e=h.val(),f=e?e+j+g:g,f=this.clean(f),f=array_unique_noempty(f.split(j)).join(j),h.val(f),this.quickClicks(b),c||i.val(""),"undefined"==typeof d&&i.focus(),!1},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){(0===d||"success"!=e)&&(d=wpAjax.broken),d=a('

'+d+"

"),a("a",d).click(function(){return tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this),!1}),a("#"+b).after(d)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))}),a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()}),a("input.newtag",c).blur(function(){""===this.value&&a(this).parent().siblings(".taghint").css("visibility","")}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(b){return 13==b.which?(tagBox.flushTags(a(this).closest(".tagsdiv")),!1):void 0}).keypress(function(a){return 13==a.which?(a.preventDefault(),!1):void 0}).each(function(){var b=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:!0,multipleSep:postL10n.comma+" "})}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a("a.tagcloud-link").click(function(){return tagBox.get(a(this).attr("id")),a(this).unbind().click(function(){return a(this).siblings(".the-tagcloud").toggle(),!1}),!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").show(),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").hide(),"object"==typeof b&&b.responses[0]?(a("#the-comment-list").append(b.responses[0].data),theList=theExtraList=null,a("a[className*=':']").unbind(),commentsBox.st>commentsBox.total?a("#show-comments").hide():a("#show-comments").show().children("a").html(postL10n.showcomm),void 0):1==b?(a("#show-comments").html(postL10n.endcomm),void 0):(a("#the-comment-list").append(''+wpAjax.broken+""),void 0)}),!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("after-autosave.update-post-slug",function(){a("#edit-slug-box > *").length||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").html();for(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()?a("#edit-slug-buttons .cancel").click():(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)}),a("#edit-slug-buttons .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("#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");postboxes.add_postbox_toggles(pagenow),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(":button, :submit, a.submitdelete, #post-preview").on("click.edit-post",function(b){var c=a(this);return c.hasClass("disabled")?(b.preventDefault(),void 0):(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").show():m.find("#minor-publishing .spinner").show())}),void 0)}),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(b){var c;9!==b.keyCode||b.ctrlKey||b.altKey||b.shiftKey||(c="undefined"!=typeof tinymce&&tinymce.get("content"),c&&!c.isHidden()?c.focus():a("#content").focus(),b.preventDefault())}),a("#auto_draft").val()&&a("#title").blur(function(){this.value&&"1"===a("#auto_draft").val()&&wp.autosave&&wp.autosave.server.triggerSave()}),a(document).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?tagBox.init():a("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){return 0===this.id.indexOf("tagsdiv-")?(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)),d.toUTCString()==b.toUTCString()?a("#timestamp").html(c):a("#timestamp").html(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(),"pending"==a("option:selected",g).val()?a("#save-post").show().val(postL10n.savePending):a("#save-post").show().val(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").hide())}),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()}),"undefined"!=typeof wpWordCount&&(a(document).triggerHandler("wpcountwords",[j.val()]),j.keyup(function(b){var c=b.keyCode||b.charCode;return c==i?!0:((13==c||8==i||46==i)&&a(document).triggerHandler("wpcountwords",[j.val()]),i=c,!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){f?d.theme.resizeTo(null,e+a.pageY):h.height(Math.max(50,e+a.pageY)),a.preventDefault()}function c(){var b,c;f?(d.focus(),c=a("#wp-content-editor-container .mce-toolbar-grp").height(),b=parseInt(a("#content_ifr").css("height"),10)+c-28):(h.focus(),b=parseInt(h.css("height"),10)),g.off("mousemove.wp-editor-resize mouseup.wp-editor-resize"),b&&b>50&&5e3>b&&setUserSetting("ed_size",b)}var d,e,f,g=a(document),h=a("textarea#content"),i=a("#post-status-info");!h.length||"ontouchstart"in window||(h.css("resize","none"),i.on("mousedown.wp-editor-resize",function(i){"undefined"!=typeof tinymce&&(d=tinymce.get("content")),d&&!d.isHidden()?(f=!0,e=a("#content_ifr").height()-i.pageY):(f=!1,e=h.height()-i.pageY,h.blur()),g.on("mousemove.wp-editor-resize",b).on("mouseup.wp-editor-resize",c),i.preventDefault()}))}(),"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"),b&&(c=b.getBody(),c.className=c.className.replace(/\bpost-format-[^ ]+/,""),b.dom.addClass(c,"post-format-0"==d?"post-format-standard":d)))})}); \ No newline at end of file diff --git a/wp-includes/css/buttons-rtl.css b/wp-includes/css/buttons-rtl.css index 80f3883f3e..f32c62e6bf 100644 --- a/wp-includes/css/buttons-rtl.css +++ b/wp-includes/css/buttons-rtl.css @@ -165,8 +165,10 @@ TABLE OF CONTENTS: .wp-core-ui .button[disabled], .wp-core-ui .button:disabled, +.wp-core-ui .button.disabled, .wp-core-ui .button-secondary[disabled], .wp-core-ui .button-secondary:disabled, +.wp-core-ui .button-secondary.disabled, .wp-core-ui .button-disabled { color: #aaa !important; border-color: #ddd !important; @@ -221,7 +223,8 @@ TABLE OF CONTENTS: .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, -.wp-core-ui .button-primary-disabled { +.wp-core-ui .button-primary-disabled, +.wp-core-ui .button-primary.disabled { color: #94cde7 !important; background: #298cba !important; border-color: #1b607f !important; diff --git a/wp-includes/css/buttons-rtl.min.css b/wp-includes/css/buttons-rtl.min.css index 85e43fbc1e..31721778f4 100644 --- a/wp-includes/css/buttons-rtl.min.css +++ b/wp-includes/css/buttons-rtl.min.css @@ -1 +1 @@ -.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type=reset]::-moz-focus-inner,.wp-core-ui input[type=button]::-moz-focus-inner,.wp-core-ui input[type=submit]::-moz-focus-inner{border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}.wp-core-ui .button.button-large,.wp-core-ui .button-group.button-large .button{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button.button-small,.wp-core-ui .button-group.button-small .button{height:24px;line-height:22px;padding:0 8px 1px;font-size:11px}.wp-core-ui .button.button-hero,.wp-core-ui .button-group.button-hero .button{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active{outline:0}.wp-core-ui .button.hidden{display:none}.wp-core-ui input[type=reset],.wp-core-ui input[type=reset]:hover,.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:focus{background:0;border:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;padding:0 2px 1px;width:auto}.wp-core-ui .button,.wp-core-ui .button-secondary{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.wp-core-ui p .button{vertical-align:baseline}.wp-core-ui .button.hover,.wp-core-ui .button:hover,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{background:#fafafa;border-color:#999;color:#222}.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2)}.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button.active:focus,.wp-core-ui .button:active,.wp-core-ui .button-secondary:active{background:#eee;border-color:#999;color:#333;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.wp-core-ui .button[disabled],.wp-core-ui .button:disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-disabled{color:#aaa!important;border-color:#ddd!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:hover,.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4)}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary:active{background:#1b7aa6;border-color:#005684;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);vertical-align:top}.wp-core-ui .button-primary[disabled],.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary-disabled{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.wp-core-ui .button-group{position:relative;display:inline-block;white-space:nowrap;font-size:0;vertical-align:middle}.wp-core-ui .button-group>.button{display:inline-block;border-radius:0;margin-left:-1px;z-index:10}.wp-core-ui .button-group>.button-primary{z-index:100}.wp-core-ui .button-group>.button:hover{z-index:20}.wp-core-ui .button-group>.button:first-child{border-radius:0 3px 3px 0}.wp-core-ui .button-group>.button:last-child{border-radius:3px 0 0 3px}@media screen and (max-width:782px){.wp-core-ui .button,.wp-core-ui .button.button-large,.wp-core-ui .button.button-small,input#publish,input#save-post,a.preview{padding:10px 14px;line-height:1;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}#media-upload.wp-core-ui .button{padding:0 10px 1px;height:24px;line-height:22px;font-size:13px}.wp-core-ui .save-post-status.button{position:relative;margin:0 10px 0 14px}.wp-core-ui.wp-customizer .button,.press-this.wp-core-ui .button,.press-this input#publish,.press-this input#save-post,.press-this a.preview{padding:0 10px 1px;font-size:13px;line-height:26px;height:28px;margin:0;vertical-align:inherit}.interim-login .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}} \ No newline at end of file +.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type=reset]::-moz-focus-inner,.wp-core-ui input[type=button]::-moz-focus-inner,.wp-core-ui input[type=submit]::-moz-focus-inner{border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}.wp-core-ui .button.button-large,.wp-core-ui .button-group.button-large .button{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button.button-small,.wp-core-ui .button-group.button-small .button{height:24px;line-height:22px;padding:0 8px 1px;font-size:11px}.wp-core-ui .button.button-hero,.wp-core-ui .button-group.button-hero .button{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active{outline:0}.wp-core-ui .button.hidden{display:none}.wp-core-ui input[type=reset],.wp-core-ui input[type=reset]:hover,.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:focus{background:0;border:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;padding:0 2px 1px;width:auto}.wp-core-ui .button,.wp-core-ui .button-secondary{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.wp-core-ui p .button{vertical-align:baseline}.wp-core-ui .button.hover,.wp-core-ui .button:hover,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{background:#fafafa;border-color:#999;color:#222}.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2)}.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button.active:focus,.wp-core-ui .button:active,.wp-core-ui .button-secondary:active{background:#eee;border-color:#999;color:#333;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.wp-core-ui .button[disabled],.wp-core-ui .button:disabled,.wp-core-ui .button.disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-secondary.disabled,.wp-core-ui .button-disabled{color:#aaa!important;border-color:#ddd!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:hover,.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4)}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary:active{background:#1b7aa6;border-color:#005684;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);vertical-align:top}.wp-core-ui .button-primary[disabled],.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary-disabled,.wp-core-ui .button-primary.disabled{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.wp-core-ui .button-group{position:relative;display:inline-block;white-space:nowrap;font-size:0;vertical-align:middle}.wp-core-ui .button-group>.button{display:inline-block;border-radius:0;margin-left:-1px;z-index:10}.wp-core-ui .button-group>.button-primary{z-index:100}.wp-core-ui .button-group>.button:hover{z-index:20}.wp-core-ui .button-group>.button:first-child{border-radius:0 3px 3px 0}.wp-core-ui .button-group>.button:last-child{border-radius:3px 0 0 3px}@media screen and (max-width:782px){.wp-core-ui .button,.wp-core-ui .button.button-large,.wp-core-ui .button.button-small,input#publish,input#save-post,a.preview{padding:10px 14px;line-height:1;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}#media-upload.wp-core-ui .button{padding:0 10px 1px;height:24px;line-height:22px;font-size:13px}.wp-core-ui .save-post-status.button{position:relative;margin:0 10px 0 14px}.wp-core-ui.wp-customizer .button,.press-this.wp-core-ui .button,.press-this input#publish,.press-this input#save-post,.press-this a.preview{padding:0 10px 1px;font-size:13px;line-height:26px;height:28px;margin:0;vertical-align:inherit}.interim-login .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}} \ No newline at end of file diff --git a/wp-includes/css/buttons.css b/wp-includes/css/buttons.css index c941133d53..3bde649288 100644 --- a/wp-includes/css/buttons.css +++ b/wp-includes/css/buttons.css @@ -165,8 +165,10 @@ TABLE OF CONTENTS: .wp-core-ui .button[disabled], .wp-core-ui .button:disabled, +.wp-core-ui .button.disabled, .wp-core-ui .button-secondary[disabled], .wp-core-ui .button-secondary:disabled, +.wp-core-ui .button-secondary.disabled, .wp-core-ui .button-disabled { color: #aaa !important; border-color: #ddd !important; @@ -221,7 +223,8 @@ TABLE OF CONTENTS: .wp-core-ui .button-primary[disabled], .wp-core-ui .button-primary:disabled, -.wp-core-ui .button-primary-disabled { +.wp-core-ui .button-primary-disabled, +.wp-core-ui .button-primary.disabled { color: #94cde7 !important; background: #298cba !important; border-color: #1b607f !important; diff --git a/wp-includes/css/buttons.min.css b/wp-includes/css/buttons.min.css index db6ba04506..c2a5327960 100644 --- a/wp-includes/css/buttons.min.css +++ b/wp-includes/css/buttons.min.css @@ -1 +1 @@ -.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type=reset]::-moz-focus-inner,.wp-core-ui input[type=button]::-moz-focus-inner,.wp-core-ui input[type=submit]::-moz-focus-inner{border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}.wp-core-ui .button.button-large,.wp-core-ui .button-group.button-large .button{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button.button-small,.wp-core-ui .button-group.button-small .button{height:24px;line-height:22px;padding:0 8px 1px;font-size:11px}.wp-core-ui .button.button-hero,.wp-core-ui .button-group.button-hero .button{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active{outline:0}.wp-core-ui .button.hidden{display:none}.wp-core-ui input[type=reset],.wp-core-ui input[type=reset]:hover,.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:focus{background:0;border:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;padding:0 2px 1px;width:auto}.wp-core-ui .button,.wp-core-ui .button-secondary{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.wp-core-ui p .button{vertical-align:baseline}.wp-core-ui .button.hover,.wp-core-ui .button:hover,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{background:#fafafa;border-color:#999;color:#222}.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2)}.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button.active:focus,.wp-core-ui .button:active,.wp-core-ui .button-secondary:active{background:#eee;border-color:#999;color:#333;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.wp-core-ui .button[disabled],.wp-core-ui .button:disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-disabled{color:#aaa!important;border-color:#ddd!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:hover,.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4)}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary:active{background:#1b7aa6;border-color:#005684;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);vertical-align:top}.wp-core-ui .button-primary[disabled],.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary-disabled{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.wp-core-ui .button-group{position:relative;display:inline-block;white-space:nowrap;font-size:0;vertical-align:middle}.wp-core-ui .button-group>.button{display:inline-block;border-radius:0;margin-right:-1px;z-index:10}.wp-core-ui .button-group>.button-primary{z-index:100}.wp-core-ui .button-group>.button:hover{z-index:20}.wp-core-ui .button-group>.button:first-child{border-radius:3px 0 0 3px}.wp-core-ui .button-group>.button:last-child{border-radius:0 3px 3px 0}@media screen and (max-width:782px){.wp-core-ui .button,.wp-core-ui .button.button-large,.wp-core-ui .button.button-small,input#publish,input#save-post,a.preview{padding:10px 14px;line-height:1;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}#media-upload.wp-core-ui .button{padding:0 10px 1px;height:24px;line-height:22px;font-size:13px}.wp-core-ui .save-post-status.button{position:relative;margin:0 14px 0 10px}.wp-core-ui.wp-customizer .button,.press-this.wp-core-ui .button,.press-this input#publish,.press-this input#save-post,.press-this a.preview{padding:0 10px 1px;font-size:13px;line-height:26px;height:28px;margin:0;vertical-align:inherit}.interim-login .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}} \ No newline at end of file +.wp-core-ui .button,.wp-core-ui .button-primary,.wp-core-ui .button-secondary{display:inline-block;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.wp-core-ui button::-moz-focus-inner,.wp-core-ui input[type=reset]::-moz-focus-inner,.wp-core-ui input[type=button]::-moz-focus-inner,.wp-core-ui input[type=submit]::-moz-focus-inner{border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}.wp-core-ui .button.button-large,.wp-core-ui .button-group.button-large .button{height:30px;line-height:28px;padding:0 12px 2px}.wp-core-ui .button.button-small,.wp-core-ui .button-group.button-small .button{height:24px;line-height:22px;padding:0 8px 1px;font-size:11px}.wp-core-ui .button.button-hero,.wp-core-ui .button-group.button-hero .button{font-size:14px;height:46px;line-height:44px;padding:0 36px}.wp-core-ui .button:active{outline:0}.wp-core-ui .button.hidden{display:none}.wp-core-ui input[type=reset],.wp-core-ui input[type=reset]:hover,.wp-core-ui input[type=reset]:active,.wp-core-ui input[type=reset]:focus{background:0;border:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;padding:0 2px 1px;width:auto}.wp-core-ui .button,.wp-core-ui .button-secondary{color:#555;border-color:#ccc;background:#f7f7f7;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);vertical-align:top}.wp-core-ui p .button{vertical-align:baseline}.wp-core-ui .button.hover,.wp-core-ui .button:hover,.wp-core-ui .button-secondary:hover,.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{background:#fafafa;border-color:#999;color:#222}.wp-core-ui .button.focus,.wp-core-ui .button:focus,.wp-core-ui .button-secondary:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2)}.wp-core-ui .button.active,.wp-core-ui .button.active:hover,.wp-core-ui .button.active:focus,.wp-core-ui .button:active,.wp-core-ui .button-secondary:active{background:#eee;border-color:#999;color:#333;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}.wp-core-ui .button[disabled],.wp-core-ui .button:disabled,.wp-core-ui .button.disabled,.wp-core-ui .button-secondary[disabled],.wp-core-ui .button-secondary:disabled,.wp-core-ui .button-secondary.disabled,.wp-core-ui .button-disabled{color:#aaa!important;border-color:#ddd!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}.wp-core-ui .button-primary{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;text-decoration:none}.wp-core-ui .button-primary.hover,.wp-core-ui .button-primary:hover,.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{background:#1e8cbe;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);box-shadow:inset 0 1px 0 rgba(120,200,230,.6);color:#fff}.wp-core-ui .button-primary.focus,.wp-core-ui .button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4);box-shadow:inset 0 1px 0 rgba(120,200,230,.6),1px 1px 2px rgba(0,0,0,.4)}.wp-core-ui .button-primary.active,.wp-core-ui .button-primary.active:hover,.wp-core-ui .button-primary.active:focus,.wp-core-ui .button-primary:active{background:#1b7aa6;border-color:#005684;color:rgba(255,255,255,.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(0,0,0,.1);vertical-align:top}.wp-core-ui .button-primary[disabled],.wp-core-ui .button-primary:disabled,.wp-core-ui .button-primary-disabled,.wp-core-ui .button-primary.disabled{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.wp-core-ui .button-group{position:relative;display:inline-block;white-space:nowrap;font-size:0;vertical-align:middle}.wp-core-ui .button-group>.button{display:inline-block;border-radius:0;margin-right:-1px;z-index:10}.wp-core-ui .button-group>.button-primary{z-index:100}.wp-core-ui .button-group>.button:hover{z-index:20}.wp-core-ui .button-group>.button:first-child{border-radius:3px 0 0 3px}.wp-core-ui .button-group>.button:last-child{border-radius:0 3px 3px 0}@media screen and (max-width:782px){.wp-core-ui .button,.wp-core-ui .button.button-large,.wp-core-ui .button.button-small,input#publish,input#save-post,a.preview{padding:10px 14px;line-height:1;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}#media-upload.wp-core-ui .button{padding:0 10px 1px;height:24px;line-height:22px;font-size:13px}.wp-core-ui .save-post-status.button{position:relative;margin:0 14px 0 10px}.wp-core-ui.wp-customizer .button,.press-this.wp-core-ui .button,.press-this input#publish,.press-this input#save-post,.press-this a.preview{padding:0 10px 1px;font-size:13px;line-height:26px;height:28px;margin:0;vertical-align:inherit}.interim-login .button.button-large{height:30px;line-height:28px;padding:0 12px 2px}} \ No newline at end of file diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index ab6952b08f..11251e19b0 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -6,7 +6,6 @@ window.autosave = function(){}; function autosave() { var initialCompareString, lastTriggerSave = 0, - isSuspended = false, $document = $(document); /** @@ -87,18 +86,11 @@ window.autosave = function(){}; $document.trigger( 'autosave-enable-buttons' ); } - function suspend() { - isSuspended = true; - } - - function resume() { - isSuspended = false; - } - // Autosave in localStorage function autosaveLocal() { var restorePostData, undoPostData, blog_id, post_id, hasStorage, intervalTimer, - lastCompareString; + lastCompareString, + isSuspended = false; // Check if the browser supports sessionStorage and it's not disabled function checkStorage() { @@ -196,6 +188,14 @@ window.autosave = function(){}; return setStorage( stored ); } + function suspend() { + isSuspended = true; + } + + function resume() { + isSuspended = false; + } + /** * Save post data for the current post * @@ -415,14 +415,17 @@ window.autosave = function(){}; return { hasStorage: hasStorage, getSavedPostData: getSavedPostData, - save: save + save: save, + suspend: suspend, + resume: resume }; } // Autosave on the server function autosaveServer() { - var _disabled, _blockSave, _blockSaveTimer, previousCompareString, lastCompareString, - nextRun = 0; + var _blockSave, _blockSaveTimer, previousCompareString, lastCompareString, + nextRun = 0, + isSuspended = false; // Block saving for the next 10 sec. function tempBlockSave() { @@ -434,6 +437,14 @@ window.autosave = function(){}; }, 10000 ); } + function suspend() { + isSuspended = true; + } + + function resume() { + isSuspended = false; + } + // Runs on heartbeat-response function response( data ) { _schedule(); @@ -442,7 +453,6 @@ window.autosave = function(){}; previousCompareString = ''; $document.trigger( 'after-autosave', [data] ); - $( '.autosave-message' ).text( data.message ); enableButtons(); if ( data.success ) { @@ -451,15 +461,6 @@ window.autosave = function(){}; } } - /** - * Disable autosave - * - * Intended to run on form.submit - */ - function disable() { - _disabled = true; - } - /** * Save immediately * @@ -488,7 +489,7 @@ window.autosave = function(){}; function save() { var postData, compareString; - if ( isSuspended || _disabled || _blockSave ) { + if ( isSuspended || _blockSave ) { return false; } @@ -516,7 +517,6 @@ window.autosave = function(){}; $document.trigger( 'wpcountwords', [ postData.content ] ) .trigger( 'before-autosave', [ postData ] ); - $( '.autosave-message' ).text( autosaveL10n.savingText ); postData._wpnonce = $( '#_wpnonce' ).val() || ''; return postData; @@ -556,10 +556,11 @@ window.autosave = function(){}; }); return { - disable: disable, tempBlockSave: tempBlockSave, triggerSave: triggerSave, - postChanged: postChanged + postChanged: postChanged, + suspend: suspend, + resume: resume }; } @@ -584,8 +585,6 @@ window.autosave = function(){}; getCompareString: getCompareString, disableButtons: disableButtons, enableButtons: enableButtons, - suspend: suspend, - resume: resume, local: autosaveLocal(), server: autosaveServer() }; diff --git a/wp-includes/js/autosave.min.js b/wp-includes/js/autosave.min.js index e19af65811..3b80b4580f 100644 --- a/wp-includes/js/autosave.min.js +++ b/wp-includes/js/autosave.min.js @@ -1 +1 @@ -window.autosave=function(){},function(a,b){function c(){function c(b){var c,d,e,f=(new Date).getTime(),g=[],h="undefined"!=typeof tinymce&&tinymce.get("content");return h&&!h.isHidden()&&f-3e3>l&&(h.save(),l=f),e={post_id:a("#post_ID").val()||0,post_type:a("#post_type").val()||"",post_author:a("#post_author").val()||"",post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""},"local"===b?e:(a('input[id^="in-category-"]:checked').each(function(){g.push(this.value)}),e.catslist=g.join(","),(c=a("#post_name").val())&&(e.post_name=c),(d=a("#parent_id").val())&&(e.parent_id=d),a("#comment_status").prop("checked")&&(e.comment_status="open"),a("#ping_status").prop("checked")&&(e.ping_status="open"),"1"===a("#auto_draft").val()&&(e.auto_draft="1"),e)}function d(b){return"object"==typeof b?(b.post_title||"")+"::"+(b.content||"")+"::"+(b.excerpt||""):(a("#title").val()||"")+"::"+(a("#content").val()||"")+"::"+(a("#excerpt").val()||"")}function e(){n.trigger("autosave-disable-buttons"),setTimeout(f,5e3)}function f(){n.trigger("autosave-enable-buttons")}function g(){m=!0}function h(){m=!1}function i(){function e(){var a=Math.random().toString(),c=!1;try{b.sessionStorage.setItem("wp-test",a),c=b.sessionStorage.getItem("wp-test")===a,b.sessionStorage.removeItem("wp-test")}catch(d){}return v=c,c}function f(){var a=!1;return v&&t&&(a=sessionStorage.getItem("wp-autosave-"+t),a=a?JSON.parse(a):{}),a}function g(a){var b;return v&&t?(b="wp-autosave-"+t,sessionStorage.setItem(b,JSON.stringify(a)),null!==sessionStorage.getItem(b)):!1}function h(){var a=f();return a&&u?a["post_"+u]||!1:!1}function i(a){var b=f();if(!b||!u)return!1;if(a)b["post_"+u]=a;else{if(!b.hasOwnProperty("post_"+u))return!1;delete b["post_"+u]}return g(b)}function j(b){var e,f,g=!1;return m?!1:(b?(e=h()||{},a.extend(e,b)):e=c("local"),f=d(e),"undefined"==typeof x&&(x=k),f===x?!1:(e.save_time=(new Date).getTime(),e.status=a("#post_status").val()||"",g=i(e),g&&(x=f),g))}function l(){u=a("#post_ID").val()||0,a("#wp-content-wrap").hasClass("tmce-active")?n.on("tinymce-editor-init.autosave",function(){b.setTimeout(function(){p()},1500)}):p(),w=b.setInterval(j,15e3),a("form#post").on("submit.autosave-local",function(){var b="undefined"!=typeof tinymce&&tinymce.get("content"),c=a("#post_ID").val()||0;b&&!b.isHidden()?b.on("submit",function(){j({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})}):j({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""}),wpCookies.set("wp-saving-post-"+c,"check")})}function o(a,b){function c(a){return a.toString().replace(/[\x20\t\r\n\f]+/g,"")}return c(a||"")===c(b||"")}function p(){var b,c,d,e,f=h(),g=wpCookies.get("wp-saving-post-"+u);if(f)return g&&(wpCookies.remove("wp-saving-post-"+u),"saved"===g)?(i(!1),void 0):(a("#has-newer-autosave").length||(b=a("#content").val()||"",c=a("#title").val()||"",d=a("#excerpt").val()||"","check"!==g&&o(b,f.content)&&o(c,f.post_title)&&o(d,f.excerpt)||(r=f,s={content:b,post_title:c,excerpt:d},e=a("#local-storage-notice"),a(".wrap h2").first().after(e.addClass("updated").show()),e.on("click.autosae-local",function(b){var c=a(b.target);c.hasClass("restore-backup")?(q(r),c.parent().hide(),a(this).find("p.undo-restore").show()):c.hasClass("undo-restore-backup")&&(q(s),c.parent().hide(),a(this).find("p.local-restore").show()),b.preventDefault()}))),void 0)}function q(b){var c;return b?(x=d(b),a("#title").val()!==b.post_title&&a("#title").focus().val(b.post_title||""),a("#excerpt").val(b.excerpt||""),c="undefined"!=typeof tinymce&&tinymce.get("content"),c&&!c.isHidden()&&"undefined"!=typeof switchEditors?(c.undoManager.add(),c.setContent(b.content?switchEditors.wpautop(b.content):"")):(a("#content-html").click(),a("#content").val(b.content)),!0):!1}var r,s,t,u,v,w,x;return t="undefined"!=typeof b.autosaveL10n&&b.autosaveL10n.blog_id,e()&&t&&(a("#content").length||a("#excerpt").length)?(n.ready(l),{hasStorage:v,getSavedPostData:h,save:j}):void 0}function j(){function g(){r=!0,b.clearTimeout(s),s=b.setTimeout(function(){r=!1},1e4)}function h(b){p(),r=!1,u=t,t="",n.trigger("after-autosave",[b]),a(".autosave-message").text(b.message),f(),b.success&&a("#auto_draft").val("")}function i(){q=!0}function j(){v=0,wp.heartbeat.connectNow()}function l(){return d()!==k}function o(){var b,f;return m||q||r?!1:(new Date).getTime()j&&(h.save(),j=f),e={post_id:a("#post_ID").val()||0,post_type:a("#post_type").val()||"",post_author:a("#post_author").val()||"",post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""},"local"===b?e:(a('input[id^="in-category-"]:checked').each(function(){g.push(this.value)}),e.catslist=g.join(","),(c=a("#post_name").val())&&(e.post_name=c),(d=a("#parent_id").val())&&(e.parent_id=d),a("#comment_status").prop("checked")&&(e.comment_status="open"),a("#ping_status").prop("checked")&&(e.ping_status="open"),"1"===a("#auto_draft").val()&&(e.auto_draft="1"),e)}function d(b){return"object"==typeof b?(b.post_title||"")+"::"+(b.content||"")+"::"+(b.excerpt||""):(a("#title").val()||"")+"::"+(a("#content").val()||"")+"::"+(a("#excerpt").val()||"")}function e(){k.trigger("autosave-disable-buttons"),setTimeout(f,5e3)}function f(){k.trigger("autosave-enable-buttons")}function g(){function e(){var a=Math.random().toString(),c=!1;try{b.sessionStorage.setItem("wp-test",a),c=b.sessionStorage.getItem("wp-test")===a,b.sessionStorage.removeItem("wp-test")}catch(d){}return w=c,c}function f(){var a=!1;return w&&u&&(a=sessionStorage.getItem("wp-autosave-"+u),a=a?JSON.parse(a):{}),a}function g(a){var b;return w&&u?(b="wp-autosave-"+u,sessionStorage.setItem(b,JSON.stringify(a)),null!==sessionStorage.getItem(b)):!1}function h(){var a=f();return a&&v?a["post_"+v]||!1:!1}function j(a){var b=f();if(!b||!v)return!1;if(a)b["post_"+v]=a;else{if(!b.hasOwnProperty("post_"+v))return!1;delete b["post_"+v]}return g(b)}function l(){z=!0}function m(){z=!1}function n(b){var e,f,g=!1;return z?!1:(b?(e=h()||{},a.extend(e,b)):e=c("local"),f=d(e),"undefined"==typeof y&&(y=i),f===y?!1:(e.save_time=(new Date).getTime(),e.status=a("#post_status").val()||"",g=j(e),g&&(y=f),g))}function o(){v=a("#post_ID").val()||0,a("#wp-content-wrap").hasClass("tmce-active")?k.on("tinymce-editor-init.autosave",function(){b.setTimeout(function(){q()},1500)}):q(),x=b.setInterval(n,15e3),a("form#post").on("submit.autosave-local",function(){var b="undefined"!=typeof tinymce&&tinymce.get("content"),c=a("#post_ID").val()||0;b&&!b.isHidden()?b.on("submit",function(){n({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})}):n({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""}),wpCookies.set("wp-saving-post-"+c,"check")})}function p(a,b){function c(a){return a.toString().replace(/[\x20\t\r\n\f]+/g,"")}return c(a||"")===c(b||"")}function q(){var b,c,d,e,f=h(),g=wpCookies.get("wp-saving-post-"+v);if(f)return g&&(wpCookies.remove("wp-saving-post-"+v),"saved"===g)?(j(!1),void 0):(a("#has-newer-autosave").length||(b=a("#content").val()||"",c=a("#title").val()||"",d=a("#excerpt").val()||"","check"!==g&&p(b,f.content)&&p(c,f.post_title)&&p(d,f.excerpt)||(s=f,t={content:b,post_title:c,excerpt:d},e=a("#local-storage-notice"),a(".wrap h2").first().after(e.addClass("updated").show()),e.on("click.autosae-local",function(b){var c=a(b.target);c.hasClass("restore-backup")?(r(s),c.parent().hide(),a(this).find("p.undo-restore").show()):c.hasClass("undo-restore-backup")&&(r(t),c.parent().hide(),a(this).find("p.local-restore").show()),b.preventDefault()}))),void 0)}function r(b){var c;return b?(y=d(b),a("#title").val()!==b.post_title&&a("#title").focus().val(b.post_title||""),a("#excerpt").val(b.excerpt||""),c="undefined"!=typeof tinymce&&tinymce.get("content"),c&&!c.isHidden()&&"undefined"!=typeof switchEditors?(c.undoManager.add(),c.setContent(b.content?switchEditors.wpautop(b.content):"")):(a("#content-html").click(),a("#content").val(b.content)),!0):!1}var s,t,u,v,w,x,y,z=!1;return u="undefined"!=typeof b.autosaveL10n&&b.autosaveL10n.blog_id,e()&&u&&(a("#content").length||a("#excerpt").length)?(k.ready(o),{hasStorage:w,getSavedPostData:h,save:n,suspend:l,resume:m}):void 0}function h(){function g(){q=!0,b.clearTimeout(r),r=b.setTimeout(function(){q=!1},1e4)}function h(){v=!0}function j(){v=!1}function l(b){p(),q=!1,t=s,s="",k.trigger("after-autosave",[b]),f(),b.success&&a("#auto_draft").val("")}function m(){u=0,wp.heartbeat.connectNow()}function n(){return d()!==i}function o(){var b,f;return v||q?!1:(new Date).getTime() __('Privately Published'), 'published' => __('Published'), 'comma' => _x( ',', 'tag delimiter' ), + 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), + 'savingText' => __('Saving Draft…'), ) ); $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array( 'wp-lists', 'postbox' ), false, 1 ); @@ -653,8 +655,6 @@ function wp_just_in_time_script_localization() { wp_localize_script( 'autosave', 'autosaveL10n', array( 'autosaveInterval' => AUTOSAVE_INTERVAL, - 'savingText' => __('Saving Draft…'), - 'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), 'blog_id' => get_current_blog_id(), ) );