diff --git a/wp-includes/js/autosave.min.js b/wp-includes/js/autosave.min.js index 58623329d4..9e6fb54bba 100644 --- a/wp-includes/js/autosave.min.js +++ b/wp-includes/js/autosave.min.js @@ -1 +1 @@ -var autosave,autosaveLast="",autosavePeriodical,autosaveDelayPreview=false,notSaved=true,blockSave=false,fullscreen,autosaveLockRelease=true;jQuery(document).ready(function(a){autosaveLast=(a("#post #title").val()||"")+(a("#post #content").val()||"");autosavePeriodical=a.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});a("#post").submit(function(){a.cancel(autosavePeriodical);autosaveLockRelease=false});a('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;a(":button, :submit","#submitpost").each(function(){var b=a(this);if(b.hasClass("button-primary")){b.addClass("button-primary-disabled")}else{b.addClass("button-disabled")}});if(a(this).attr("id")=="publish"){a("#major-publishing-actions .spinner").show()}else{a("#minor-publishing .spinner").show()}});window.onbeforeunload=function(){var b=typeof(tinymce)!="undefined"?tinymce.activeEditor:false,d,c;if(b&&!b.isHidden()){if(b.isDirty()){return autosaveL10n.saveAlert}}else{if(fullscreen&&fullscreen.settings.visible){d=a("#wp-fullscreen-title").val()||"";c=a("#wp_mce_fullscreen").val()||""}else{d=a("#post #title").val()||"";c=a("#post #content").val()||""}if((d||c)&&d+c!=autosaveLast){return autosaveL10n.saveAlert}}};a(window).unload(function(b){if(!autosaveLockRelease){return}if(b.target&&b.target.nodeName!="#document"){return}a.ajax({type:"POST",url:ajaxurl,async:false,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("#post-preview").click(function(){if(a("#auto_draft").val()=="1"&¬Saved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){a("input#wp-preview").val("dopreview");a("form#post").attr("target","wp-preview").submit().attr("target","");var b=navigator.userAgent.toLowerCase();if(b.indexOf("safari")!=-1&&b.indexOf("chrome")==-1){a("form#post").attr("action",function(c,d){return d+"?t="+new Date().getTime()})}a("input#wp-preview").val("")};a("#title").on("keydown.editor-focus",function(c){var b;if(c.which!=9){return}if(!c.ctrlKey&&!c.altKey&&!c.shiftKey){if(typeof(tinymce)!="undefined"){b=tinymce.get("content")}if(b&&!b.isHidden()){a(this).one("keyup",function(d){a("#content_tbl td.mceToolbar > a").focus()})}else{a("#content").focus()}c.preventDefault()}});if("1"==a("#auto_draft").val()){a("#title").blur(function(){if(!this.value||a("#auto_draft").val()!="1"){return}delayed_autosave()})}});function autosave_parse_response(b){var d=wpAjax.parseAjaxResponse(b,"autosave"),c,a;if(d&&d.responses&&d.responses.length){if(d.responses[0].supplemental){a=d.responses[0].supplemental;jQuery.each(a,function(e,f){if(e.match(/^replace-/)){jQuery("#"+e.replace("replace-","")).val(f)}})}if(!d.errors){if(c=parseInt(d.responses[0].id,10)){autosave_update_slug(c)}if(d.responses[0].data){jQuery(".autosave-message").text(d.responses[0].data)}}}return d}function autosave_saved(a){blockSave=false;autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(a){blockSave=false;var c=autosave_parse_response(a),b;if(c&&c.responses.length&&!c.errors){b=parseInt(c.responses[0].id,10);if(b){notSaved=false;jQuery("#auto_draft").val("0")}autosave_enable_buttons();if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_slug(a){if("undefined"!=makeSlugeditClickable&&jQuery.isFunction(makeSlugeditClickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(ajaxurl,{action:"sample-permalink",post_id:a,new_title:fullscreen&&fullscreen.settings.visible?jQuery("#wp-fullscreen-title").val():jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(c){if(c!=="-1"){var b=jQuery("#edit-slug-box");b.html(c);if(b.hasClass("hidden")){b.fadeIn("fast",function(){b.removeClass("hidden")})}makeSlugeditClickable()}})}}function autosave_loading(){jQuery(".autosave-message").html(autosaveL10n.savingText)}function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery(".spinner","#submitpost").hide()},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").prop("disabled",true);setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){blockSave=true;var c=(typeof tinymce!="undefined")&&tinymce.activeEditor&&!tinymce.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d=wp.autosave.getPostData();f=d.autosave;if(jQuery("#TB_window").css("display")=="block"){f=false}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}if(f){autosaveLast=d.post_title+d.content;jQuery(document).triggerHandler("wpcountwords",[d.content])}else{d.autosave=0}if(d.auto_draft=="1"){a=autosave_saved_new}else{a=autosave_saved}jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:ajaxurl,success:a})};window.wp=window.wp||{};wp.autosave=wp.autosave||{};(function(a){wp.autosave.getPostData=function(){var b=typeof tinymce!="undefined"?tinymce.activeEditor:null,d,f,c=[],e={action:"autosave",autosave:true,post_id:a("#post_ID").val()||0,autosavenonce:a("#autosavenonce").val()||"",post_type:a("#post_type").val()||"",post_author:a("#post_author").val()||"",excerpt:a("#excerpt").val()||""};if(b&&!b.isHidden()){if(b.plugins.spellchecker&&b.plugins.spellchecker.active){e.autosave=false;return e}else{if("mce_fullscreen"==b.id){tinymce.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinymce.triggerSave()}}if(typeof fullscreen!="undefined"&&fullscreen.settings.visible){e.post_title=a("#wp-fullscreen-title").val()||"";e.content=a("#wp_mce_fullscreen").val()||""}else{e.post_title=a("#title").val()||"";e.content=a("#content").val()||""}a('input[id^="in-category-"]:checked').each(function(){c.push(this.value)});e.catslist=c.join(",");if(d=a("#post_name").val()){e.post_name=d}if(f=a("#parent_id").val()){e.parent_id=f}if(a("#comment_status").prop("checked")){e.comment_status="open"}if(a("#ping_status").prop("checked")){e.ping_status="open"}if(a("#auto_draft").val()=="1"){e.auto_draft="1"}return e};wp.autosave.local={lastsaveddata:"",blog_id:0,ajaxurl:window.ajaxurl||"wp-admin/admin-ajax.php",hasStorage:false,checkStorage:function(){var d=Math.random(),b=false;try{sessionStorage.setItem("wp-test",d);b=sessionStorage.getItem("wp-test")==d;sessionStorage.removeItem("wp-test")}catch(c){}this.hasStorage=b;return b},getStorage:function(){var b=false;if(this.hasStorage&&this.blog_id){b=sessionStorage.getItem("wp-autosave-"+this.blog_id);if(b){b=JSON.parse(b)}else{b={}}}return b},setStorage:function(b){var c;if(this.hasStorage&&this.blog_id){c="wp-autosave-"+this.blog_id;sessionStorage.setItem(c,JSON.stringify(b));return sessionStorage.getItem(c)!==null}return false},getData:function(){var c=this.getStorage(),b=a("#post_ID").val();if(!c||!b){return false}return c["post_"+b]||false},setData:function(b){var d=this.getStorage(),c=a("#post_ID").val();if(!d||!c){return false}if(b){d["post_"+c]=b}else{if(d.hasOwnProperty("post_"+c)){delete d["post_"+c]}else{return false}}return this.setStorage(d)},save:function(c){var b=false;if(!c){post_data=wp.autosave.getPostData()}else{post_data=this.getData()||{};a.extend(post_data,c)}if(post_data.post_title+": "+post_data.content==this.lastsaveddata){return false}if(!post_data.autosave){return false}post_data.save_time=(new Date()).getTime();post_data.status=a("#post_status").val()||"";b=this.setData(post_data);if(typeof console!="undefined"){console.log("Local autosave: saved, post content = %s",post_data.content)}if(b){this.lastsaveddata=post_data.post_title+": "+post_data.content}return b},init:function(c){var b=this;if("post"!=window.pagenow||!this.checkStorage()){return}if(typeof switchEditors=="undefined"){return}if(c){a.extend(this,c)}if(!this.blog_id){this.blog_id=typeof window.autosaveL10n!="undefined"?window.autosaveL10n.blog_id:0}this.checkPost();a(document).ready(function(){b.run()})},run:function(){var b=this,c;if(!this.lastsaveddata){c=wp.autosave.getPostData();if(c.content&&a("#wp-content-wrap").hasClass("tmce-active")){this.lastsaveddata=c.post_title+": "+switchEditors.pre_wpautop(c.content)}else{this.lastsaveddata=c.post_title+": "+c.content}}this.schedule=a.schedule({time:15*1000,func:function(){wp.autosave.local.save()},repeat:true,protect:true});a("form#post").on("submit.autosave-local",function(){var e=typeof tinymce!="undefined"&&tinymce.get("content"),d=a("#post_ID").val()||0;if(e&&!e.isHidden()){e.onSubmit.add(function(){wp.autosave.local.save({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})})}else{b.save({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})}wpCookies.set("wp-saving-post-"+d,"check")})},compare:function(d,c){function b(e){return e.toString().replace(/[\x20\t\r\n\f]+/g,"")}return(b(d||"")==b(c||""))},checkPost:function(){var b=this,i=this.getData(),f,h,e=false,g,c=a("#post_ID").val()||0,d=wpCookies.get("wp-saving-post-"+c);if(typeof console!="undefined"){console.log("Local autosave: checkPost, cookie = %s, post content = %s",d,i&&i.content)}if(!i){return}if(d){wpCookies.remove("wp-saving-post-"+c);if(d=="saved"){this.setData(false);return}}if(a("#has-newer-autosave").length){return}if(d!="check"){f=a("#content").val();h=a.extend({},i);if(a("#wp-content-wrap").hasClass("tmce-active")){f=switchEditors.pre_wpautop(f)}if(this.compare(f,h.content)&&this.compare(a("#title").val(),h.post_title)&&this.compare(a("#excerpt").val(),h.excerpt)){return}}this.restore_post_data=i;this.undo_post_data=wp.autosave.getPostData();g=a("#local-storage-notice");a("form#post").before(g.addClass("updated").show());g.on("click",function(k){var j=a(k.target);if(j.hasClass("restore-backup")){b.restorePost(b.restore_post_data);j.parent().hide();a(this).find("p.undo-restore").show()}else{if(j.hasClass("undo-restore-backup")){b.restorePost(b.undo_post_data);j.parent().hide();a(this).find("p.local-restore").show()}}k.preventDefault()})},restorePost:function(c){var b;if(c){this.lastsaveddata=c.post_title+": "+c.content;if(a("#title").val()!=c.post_title){a("#title").focus().val(c.post_title||"")}a("#excerpt").val(c.excerpt||"");b=typeof tinymce!="undefined"&&tinymce.get("content");if(b&&!b.isHidden()){b.undoManager.add();b.setContent(c.content?switchEditors.wpautop(c.content):"")}else{a("#content-html").click();a("#content").val(c.content)}return true}return false}};wp.autosave.local.init()}(jQuery)); \ No newline at end of file +var autosave,autosaveLast="",autosavePeriodical,autosaveDelayPreview=false,notSaved=true,blockSave=false,fullscreen,autosaveLockRelease=true;jQuery(document).ready(function(a){autosaveLast=(a("#post #title").val()||"")+(a("#post #content").val()||"");autosavePeriodical=a.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});a("#post").submit(function(){a.cancel(autosavePeriodical);autosaveLockRelease=false});a('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;a(":button, :submit","#submitpost").each(function(){var b=a(this);if(b.hasClass("button-primary")){b.addClass("button-primary-disabled")}else{b.addClass("button-disabled")}});if(a(this).attr("id")=="publish"){a("#major-publishing-actions .spinner").show()}else{a("#minor-publishing .spinner").show()}});window.onbeforeunload=function(){var b=typeof(tinymce)!="undefined"?tinymce.activeEditor:false,d,c;if(b&&!b.isHidden()){if(b.isDirty()){return autosaveL10n.saveAlert}}else{if(fullscreen&&fullscreen.settings.visible){d=a("#wp-fullscreen-title").val()||"";c=a("#wp_mce_fullscreen").val()||""}else{d=a("#post #title").val()||"";c=a("#post #content").val()||""}if((d||c)&&d+c!=autosaveLast){return autosaveL10n.saveAlert}}};a(window).unload(function(b){if(!autosaveLockRelease){return}if(b.target&&b.target.nodeName!="#document"){return}a.ajax({type:"POST",url:ajaxurl,async:false,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("#post-preview").click(function(){if(a("#auto_draft").val()=="1"&¬Saved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){a("input#wp-preview").val("dopreview");a("form#post").attr("target","wp-preview").submit().attr("target","");var b=navigator.userAgent.toLowerCase();if(b.indexOf("safari")!=-1&&b.indexOf("chrome")==-1){a("form#post").attr("action",function(c,d){return d+"?t="+new Date().getTime()})}a("input#wp-preview").val("")};a("#title").on("keydown.editor-focus",function(c){var b;if(c.which!=9){return}if(!c.ctrlKey&&!c.altKey&&!c.shiftKey){if(typeof(tinymce)!="undefined"){b=tinymce.get("content")}if(b&&!b.isHidden()){a(this).one("keyup",function(d){a("#content_tbl td.mceToolbar > a").focus()})}else{a("#content").focus()}c.preventDefault()}});if("1"==a("#auto_draft").val()){a("#title").blur(function(){if(!this.value||a("#auto_draft").val()!="1"){return}delayed_autosave()})}a(document).on("heartbeat-connection-lost.autosave",function(){autosave_disable_buttons();a("#lost-connection-notice").show()}).on("heartbeat-connection-restored.autosave",function(){autosave_enable_buttons();a("#lost-connection-notice").hide()})});function autosave_parse_response(b){var d=wpAjax.parseAjaxResponse(b,"autosave"),c,a;if(d&&d.responses&&d.responses.length){if(d.responses[0].supplemental){a=d.responses[0].supplemental;jQuery.each(a,function(e,f){if(e.match(/^replace-/)){jQuery("#"+e.replace("replace-","")).val(f)}})}if(!d.errors){if(c=parseInt(d.responses[0].id,10)){autosave_update_slug(c)}if(d.responses[0].data){jQuery(".autosave-message").text(d.responses[0].data)}}}return d}function autosave_saved(a){blockSave=false;autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(a){blockSave=false;var c=autosave_parse_response(a),b;if(c&&c.responses.length&&!c.errors){b=parseInt(c.responses[0].id,10);if(b){notSaved=false;jQuery("#auto_draft").val("0")}autosave_enable_buttons();if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_slug(a){if("undefined"!=makeSlugeditClickable&&jQuery.isFunction(makeSlugeditClickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(ajaxurl,{action:"sample-permalink",post_id:a,new_title:fullscreen&&fullscreen.settings.visible?jQuery("#wp-fullscreen-title").val():jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(c){if(c!=="-1"){var b=jQuery("#edit-slug-box");b.html(c);if(b.hasClass("hidden")){b.fadeIn("fast",function(){b.removeClass("hidden")})}makeSlugeditClickable()}})}}function autosave_loading(){jQuery(".autosave-message").html(autosaveL10n.savingText)}function autosave_enable_buttons(){if(!wp.heartbeat.connectionLost){setTimeout(function(){var a=jQuery("#submitpost");a.find(":button, :submit").removeAttr("disabled");a.find(".spinner").hide()},500)}}function autosave_disable_buttons(){jQuery("#submitpost").find(":button, :submit").prop("disabled",true);setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){blockSave=true;var c=(typeof tinymce!="undefined")&&tinymce.activeEditor&&!tinymce.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d=wp.autosave.getPostData();f=d.autosave;if(jQuery("#TB_window").css("display")=="block"){f=false}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}if(f){autosaveLast=d.post_title+d.content;jQuery(document).triggerHandler("wpcountwords",[d.content])}else{d.autosave=0}if(d.auto_draft=="1"){a=autosave_saved_new}else{a=autosave_saved}jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:ajaxurl,success:a})};window.wp=window.wp||{};wp.autosave=wp.autosave||{};(function(a){wp.autosave.getPostData=function(){var b=typeof tinymce!="undefined"?tinymce.activeEditor:null,d,f,c=[],e={action:"autosave",autosave:true,post_id:a("#post_ID").val()||0,autosavenonce:a("#autosavenonce").val()||"",post_type:a("#post_type").val()||"",post_author:a("#post_author").val()||"",excerpt:a("#excerpt").val()||""};if(b&&!b.isHidden()){if(b.plugins.spellchecker&&b.plugins.spellchecker.active){e.autosave=false;return e}else{if("mce_fullscreen"==b.id){tinymce.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinymce.triggerSave()}}if(typeof fullscreen!="undefined"&&fullscreen.settings.visible){e.post_title=a("#wp-fullscreen-title").val()||"";e.content=a("#wp_mce_fullscreen").val()||""}else{e.post_title=a("#title").val()||"";e.content=a("#content").val()||""}a('input[id^="in-category-"]:checked').each(function(){c.push(this.value)});e.catslist=c.join(",");if(d=a("#post_name").val()){e.post_name=d}if(f=a("#parent_id").val()){e.parent_id=f}if(a("#comment_status").prop("checked")){e.comment_status="open"}if(a("#ping_status").prop("checked")){e.ping_status="open"}if(a("#auto_draft").val()=="1"){e.auto_draft="1"}return e};wp.autosave.local={lastsaveddata:"",blog_id:0,ajaxurl:window.ajaxurl||"wp-admin/admin-ajax.php",hasStorage:false,checkStorage:function(){var d=Math.random(),b=false;try{sessionStorage.setItem("wp-test",d);b=sessionStorage.getItem("wp-test")==d;sessionStorage.removeItem("wp-test")}catch(c){}this.hasStorage=b;return b},getStorage:function(){var b=false;if(this.hasStorage&&this.blog_id){b=sessionStorage.getItem("wp-autosave-"+this.blog_id);if(b){b=JSON.parse(b)}else{b={}}}return b},setStorage:function(b){var c;if(this.hasStorage&&this.blog_id){c="wp-autosave-"+this.blog_id;sessionStorage.setItem(c,JSON.stringify(b));return sessionStorage.getItem(c)!==null}return false},getData:function(){var c=this.getStorage(),b=a("#post_ID").val();if(!c||!b){return false}return c["post_"+b]||false},setData:function(b){var d=this.getStorage(),c=a("#post_ID").val();if(!d||!c){return false}if(b){d["post_"+c]=b}else{if(d.hasOwnProperty("post_"+c)){delete d["post_"+c]}else{return false}}return this.setStorage(d)},save:function(c){var b=false;if(!c){post_data=wp.autosave.getPostData()}else{post_data=this.getData()||{};a.extend(post_data,c)}if(post_data.post_title+": "+post_data.content==this.lastsaveddata){return false}if(!post_data.autosave){return false}post_data.save_time=(new Date()).getTime();post_data.status=a("#post_status").val()||"";b=this.setData(post_data);if(typeof console!="undefined"){console.log("Local autosave: saved, post content = %s",post_data.content)}if(b){this.lastsaveddata=post_data.post_title+": "+post_data.content}return b},init:function(c){var b=this;if("post"!=window.pagenow||!this.checkStorage()){return}if(typeof switchEditors=="undefined"){return}if(c){a.extend(this,c)}if(!this.blog_id){this.blog_id=typeof window.autosaveL10n!="undefined"?window.autosaveL10n.blog_id:0}this.checkPost();a(document).ready(function(){b.run()})},run:function(){var b=this,c;if(!this.lastsaveddata){c=wp.autosave.getPostData();if(c.content&&a("#wp-content-wrap").hasClass("tmce-active")){this.lastsaveddata=c.post_title+": "+switchEditors.pre_wpautop(c.content)}else{this.lastsaveddata=c.post_title+": "+c.content}}this.schedule=a.schedule({time:15*1000,func:function(){wp.autosave.local.save()},repeat:true,protect:true});a("form#post").on("submit.autosave-local",function(){var e=typeof tinymce!="undefined"&&tinymce.get("content"),d=a("#post_ID").val()||0;if(e&&!e.isHidden()){e.onSubmit.add(function(){wp.autosave.local.save({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})})}else{b.save({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})}wpCookies.set("wp-saving-post-"+d,"check")})},compare:function(d,c){function b(e){return e.toString().replace(/[\x20\t\r\n\f]+/g,"")}return(b(d||"")==b(c||""))},checkPost:function(){var b=this,i=this.getData(),f,h,e=false,g,c=a("#post_ID").val()||0,d=wpCookies.get("wp-saving-post-"+c);if(typeof console!="undefined"){console.log("Local autosave: checkPost, cookie = %s, post content = %s",d,i&&i.content)}if(!i){return}if(d){wpCookies.remove("wp-saving-post-"+c);if(d=="saved"){this.setData(false);return}}if(a("#has-newer-autosave").length){return}if(d!="check"){f=a("#content").val();h=a.extend({},i);if(a("#wp-content-wrap").hasClass("tmce-active")){f=switchEditors.pre_wpautop(f)}if(this.compare(f,h.content)&&this.compare(a("#title").val(),h.post_title)&&this.compare(a("#excerpt").val(),h.excerpt)){return}}this.restore_post_data=i;this.undo_post_data=wp.autosave.getPostData();g=a("#local-storage-notice");a("form#post").before(g.addClass("updated").show());g.on("click",function(k){var j=a(k.target);if(j.hasClass("restore-backup")){b.restorePost(b.restore_post_data);j.parent().hide();a(this).find("p.undo-restore").show()}else{if(j.hasClass("undo-restore-backup")){b.restorePost(b.undo_post_data);j.parent().hide();a(this).find("p.local-restore").show()}}k.preventDefault()})},restorePost:function(c){var b;if(c){this.lastsaveddata=c.post_title+": "+c.content;if(a("#title").val()!=c.post_title){a("#title").focus().val(c.post_title||"")}a("#excerpt").val(c.excerpt||"");b=typeof tinymce!="undefined"&&tinymce.get("content");if(b&&!b.isHidden()){b.undoManager.add();b.setContent(c.content?switchEditors.wpautop(c.content):"")}else{a("#content-html").click();a("#content").val(c.content)}return true}return false}};wp.autosave.local.init()}(jQuery)); \ No newline at end of file diff --git a/wp-includes/js/heartbeat.min.js b/wp-includes/js/heartbeat.min.js index bea578b980..e479e54b3c 100644 --- a/wp-includes/js/heartbeat.min.js +++ b/wp-includes/js/heartbeat.min.js @@ -1 +1 @@ -window.wp=window.wp||{};(function(a){var b=function(){var s=this,e,c,B,m=typeof pagenow!="undefined"?pagenow:"",h=typeof ajaxurl!="undefined"?ajaxurl:"",C,A=0,w={},D,i,q=0,z=0,x,f=true,p,j,g,v=-1;this.autostart=true;this.connectionLost=false;if(typeof(window.heartbeatSettings!="undefined")){C=window.heartbeatSettings;B=C.nonce||"";delete C.nonce;h=C.ajaxurl||h;delete C.ajaxurl;D=C.interval||15;delete C.interval;if(D<5){D=5}else{if(D>60){D=60}}D=D*1000;m=m||C.screenid||"site";delete C.screenid;a.extend(this,C)}function k(F){if(F){return parseInt((new Date()).getTime()/1000)}return(new Date()).getTime()}function y(G){try{if(G.contentWindow.document){return true}}catch(F){}return false}function u(G){var F;if(G){switch(G){case"abort":break;case"timeout":F=true;break;case"parsererror":case"error":case"empty":case"unknown":z++;if(z>2){F=true}break}if(F&&!s.connectionLost){s.connectionLost=true;a(document).trigger("heartbeat-connection-lost")}}else{if(s.connectionLost){z=0;s.connectionLost=false;a(document).trigger("heartbeat-connection-restored")}}}function d(){var F={};A=k();F.data=a.extend({},w);w={};a(document).trigger("heartbeat-send",[F.data]);F.interval=D/1000;F._nonce=B;F.action="heartbeat";F.screenid=m;F.has_focus=f;i=true;s.xhr=a.ajax({url:h,type:"post",timeout:30000,data:F,dataType:"json"}).done(function(I,K,H){var J,G;if(!I){return u("empty")}if(s.connectionLost){u()}J=I.heartbeat_interval;delete I.heartbeat_interval;s.tick(I,K,H);if(J){s.interval.call(s,J)}}).always(function(){i=false;t()}).fail(function(H,I,G){u(I||"unknown");s.error(H,I,G)})}function t(){var G=k()-A,F=D;if(!e){return}if(!f){F=120000}else{if(q>0&&x){F=x;q--}}window.clearTimeout(c);if(G300000&&f){o()}if(!j){a(document).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){E()});a("iframe").each(function(G,H){if(!y(H)){return}a(H.contentWindow).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){E()})});j=true}}window.setInterval(function(){l()},30000);if(this.autostart){a(document).ready(function(){e=true;A=k();t()})}this.hasFocus=function(){return f};this.interval=function(G){var F,H;if(G){switch(G){case"fast":H=5;q=30;break;case"slow":H=60;q=0;break;case"long-polling":D=0;return 0;break;default:H=15;q=0}F=H*10000){x=H*1000}else{D=H*1000;x=0}if(F){t()}}if(!f){return 120}return x?x/1000:D/1000};this.start=function(){if(e){return false}e=true;d();return true};this.stop=function(){if(s.xhr&&s.xhr.readyState!=4){s.xhr.abort()}e=false;return true};this.enqueue=function(H,G,F){if(H){if(w.hasOwnProperty(H)&&F){return false}w[H]=G;return true}return false};this.isQueued=function(F){return w[F]}};a.extend(b.prototype,{tick:function(d,e,c){a(document).trigger("heartbeat-tick",[d,e,c])},error:function(d,e,c){a(document).trigger("heartbeat-error",[d,e,c])}});wp.heartbeat=new b()}(jQuery)); \ No newline at end of file +window.wp=window.wp||{};(function(a){var b=function(){var s=this,e,c,B,m=typeof pagenow!="undefined"?pagenow:"",h=typeof ajaxurl!="undefined"?ajaxurl:"",C,A=0,w={},D,i,q=0,z=0,x,f=true,p,j,g,v=-1;this.autostart=true;this.connectionLost=false;if(typeof(window.heartbeatSettings!="undefined")){C=window.heartbeatSettings;B=C.nonce||"";delete C.nonce;h=C.ajaxurl||h;delete C.ajaxurl;D=C.interval||15;delete C.interval;if(D<5){D=5}else{if(D>60){D=60}}D=D*1000;m=m||C.screenid||"site";delete C.screenid;a.extend(this,C)}function k(F){if(F){return parseInt((new Date()).getTime()/1000)}return(new Date()).getTime()}function y(G){try{if(G.contentWindow.document){return true}}catch(F){}return false}function u(G){var F;if(G){switch(G){case"abort":break;case"timeout":F=true;break;case"parsererror":case"error":case"empty":case"unknown":z++;if(z>2){F=true}break}if(F&&!s.connectionLost){s.connectionLost=true;a(document).trigger("heartbeat-connection-lost")}}else{if(s.connectionLost){z=0;s.connectionLost=false;a(document).trigger("heartbeat-connection-restored")}}}function d(){var F={};A=k();F.data=a.extend({},w);w={};a(document).trigger("heartbeat-send",[F.data]);F.interval=D/1000;F._nonce=B;F.action="heartbeat";F.screenid=m;F.has_focus=f;i=true;s.xhr=a.ajax({url:h,type:"post",timeout:30000,data:F,dataType:"json"}).done(function(I,K,H){var J,G;if(!I){return u("empty")}if(s.connectionLost){u()}J=I.heartbeat_interval;delete I.heartbeat_interval;s.tick(I,K,H);if(J){s.interval.call(s,J)}}).always(function(){i=false;t()}).fail(function(H,I,G){u(I||"unknown");s.error(H,I,G)})}function t(){var G=k()-A,F=D;if(!e){return}if(!f){F=120000}else{if(q>0&&x){F=x;q--}}window.clearTimeout(c);if(G300000&&f){o()}if(!j){a(document).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){E()});a("iframe").each(function(G,H){if(!y(H)){return}a(H.contentWindow).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){E()})});j=true}}window.setInterval(function(){l()},30000);if(this.autostart){a(document).ready(function(){e=true;A=k();t()})}this.hasFocus=function(){return f};this.interval=function(G){var F,H;if(G){switch(G){case"fast":H=5;q=30;break;case"slow":H=60;q=0;break;case"long-polling":D=0;return 0;break;default:H=15;q=0}F=H*10000){x=H*1000}else{D=H*1000;x=0}if(F){t()}}if(!f){return 120}return x?x/1000:D/1000};this.start=function(){if(e){return false}e=true;d();return true};this.stop=function(){if(s.xhr&&s.xhr.readyState!=4){s.xhr.abort()}u();e=false;return true};this.enqueue=function(H,G,F){if(H){if(w.hasOwnProperty(H)&&F){return false}w[H]=G;return true}return false};this.isQueued=function(F){return w[F]}};a.extend(b.prototype,{tick:function(d,e,c){a(document).trigger("heartbeat-tick",[d,e,c])},error:function(d,e,c){a(document).trigger("heartbeat-error",[d,e,c])}});wp.heartbeat=new b()}(jQuery)); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 0aaf90c127..972b95c63f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '3.6-alpha-23883'; +$wp_version = '3.6-alpha-23887'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.