2009-01-12 08:43:17 -05:00
|
|
|
jQuery(document).ready(function(f){postboxes.add_postbox_toggles("page");make_slugedit_clickable();f("#title").blur(function(){if((f("#post_ID").val()>0)||(f("#title").val().length==0)){return}autosave()});var c=f("#timestamp").html(),a=f("#post-visibility-display").html(),b=true;function e(){if(f("#post-visibility-select input:radio:checked").val()!="public"){f("#sticky").attr("checked",false);f("#sticky-span").hide()}else{f("#sticky-span").show()}if(f("#post-visibility-select input:radio:checked").val()!="password"){f("#password-span").hide()}else{f("#password-span").show()}}function d(){var g,i,h,j;g=new Date(f("#aa").val(),f("#mm").val()-1,f("#jj").val(),f("#hh").val(),f("#mn").val());i=new Date(f("#hidden_aa").val(),f("#hidden_mm").val()-1,f("#hidden_jj").val(),f("#hidden_hh").val(),f("#hidden_mn").val());h=new Date(f("#cur_aa").val(),f("#cur_mm").val()-1,f("#cur_jj").val(),f("#cur_hh").val(),f("#cur_mn").val());if(g>h&&f("#original_post_status").val()!="future"){j=postL10n.publishOnFuture;f("#publish").val(postL10n.schedule)}else{if(g<=h&&f("#original_post_status").val()!="publish"){j=postL10n.publishOn;f("#publish").val(postL10n.publish)}else{j=postL10n.publishOnPast;f("#publish").val(postL10n.update)}}if(i.toUTCString()==g.toUTCString()){f("#timestamp").html(c)}else{f("#timestamp").html(j+" <b>"+f("#mm option[value="+f("#mm").val()+"]").text()+" "+f("#jj").val()+", "+f("#aa").val()+" @ "+f("#hh").val()+":"+f("#mn").val()+"</b> ")}if(f("#post-visibility-select input:radio:checked").val()=="private"){f("#publish").val(postL10n.update);if(f("#post_status option[value=publish]").length==0){f("#post_status").append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}f("#post_status option[value=publish]").html(postL10n.privatelyPublished);f("#post_status option[value=publish]").attr("selected",true);f(".edit-post-status").hide()}else{if(f("#original_post_status").val()=="future"||f("#original_post_status").val()=="draft"){if(f("#post_status option[value=publish]").length!=0){f("#post_status option[value=publish]").remove();f("#post_status").val(f("#hidden_post_status").val())}}else{f("#post_status option[value=publish]").html(postL10n.published)}f(".edit-post-status").show()}f("#post-status-display").html(f("#post_status :selected").text());if(f("#post_status :selected").val()=="private"||f("#post_status :selected").val()=="publish"){f("#save-post").hide()}else{f("#save-post").show();if(f("#post_status :selected").val()=="pending"){f("#save-post").show().val(postL10n.savePending)}else{f("#save-post").show().val(postL10n.saveDraft)}}}f(".edit-visibility").click(function(){if(f("#post-visibility-select").is(":hidden")){e();f("#post-visibility-select").slideDown("normal");f(".edit-visibility").hide()}return false});f(".cancel-post-visibility").click(function(){f("#post-visibility-select").slideUp("normal");f("#visibility-radio-"+f("#hidden-post-visibility").val()).attr("checked",true);f("#post_password").val(f("#hidden_post_password").val());f("#post-visibility-display").html(a);f(".edit-visibility").show();d();return false});f(".save-post-visibility").click(function(){f("#post-visibility-select").slideUp("normal");f(".edit-visibility").show();d();f("#post-visibility-display").html(postL10n[f("#post-visibility-select input:radio:checked").val()]);return false});f("#post-visibility-select input:radio").change(function(){e()});f(".edit-timestamp").click(function(){if(f("#timestampdiv").is(":hidden")){f("#timestampdiv").slideDown("normal");f(".edit-timestamp").hide()}return false});f(".cancel-timestamp").click(function(){f("#timestampdiv").slideUp("normal");f("#mm").val(f("#hidden_mm").val());f("#jj").val(f("#hidden_jj").val());f("#aa").val(f("#hidden_aa").val());f("#hh").val(f("#hidden_hh").val());f("#mn").val(f("#hidden_mn").val());f(".edit-timestamp").show();d();return false});f(".save-timestamp").click(function(){f("#timestampdiv").slideUp("normal");f(".edit-timestamp").show();d();return false});f(".edit-post-status").click(function(){if(f("#post-status-select").is(":hidden")){f("#post-status-select").s
|