WordPress/wp-admin/js/comment.min.js

1 line
1.3 KiB
JavaScript
Raw Normal View History

jQuery(document).ready(function(a){postboxes.add_postbox_toggles("comment");var b=a("#timestampdiv"),c=a("#timestamp").html();b.siblings("a.edit-timestamp").click(function(c){b.is(":hidden")&&(b.slideDown("fast",function(){a("input, select",b.find(".timestamp-wrap")).first().focus()}),a(this).hide()),c.preventDefault()}),b.find(".cancel-timestamp").click(function(d){b.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()),a("#timestamp").html(c),d.preventDefault()}),b.find(".save-timestamp").click(function(c){var d=a("#aa").val(),e=a("#mm").val(),f=a("#jj").val(),g=a("#hh").val(),h=a("#mn").val(),i=new Date(d,e-1,f,g,h);return c.preventDefault(),i.getFullYear()!=d||1+i.getMonth()!=e||i.getDate()!=f||i.getMinutes()!=h?void b.find(".timestamp-wrap").addClass("form-invalid"):(b.find(".timestamp-wrap").removeClass("form-invalid"),a("#timestamp").html(commentL10n.submittedOn+" <b>"+commentL10n.dateFormat.replace("%1$s",a('option[value="'+e+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(f,10)).replace("%3$s",d).replace("%4$s",("00"+g).slice(-2)).replace("%5$s",("00"+h).slice(-2))+"</b> "),b.slideUp("fast"),void b.siblings("a.edit-timestamp").show())})});