1
/* global postboxes:true, commentL10n:true */
2
jQuery(document).ready( function($) {
4
postboxes.add_postbox_toggles('comment');
6
var stamp = $('#timestamp').html();
7
$('.edit-timestamp').click(function () {
8
if ($('#timestampdiv').is(':hidden')) {
9
$('#timestampdiv').slideDown('normal');
10
$('.edit-timestamp').hide();
15
$('.cancel-timestamp').click(function() {
16
$('#timestampdiv').slideUp('normal');
17
$('#mm').val($('#hidden_mm').val());
18
$('#jj').val($('#hidden_jj').val());
19
$('#aa').val($('#hidden_aa').val());
20
$('#hh').val($('#hidden_hh').val());
21
$('#mn').val($('#hidden_mn').val());
22
$('#timestamp').html(stamp);
23
$('.edit-timestamp').show();
27
$('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
28
var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
29
newD = new Date( aa, mm - 1, jj, hh, mn );
31
if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) {
32
$('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');
35
$('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');
38
$('#timestampdiv').slideUp('normal');
39
$('.edit-timestamp').show();
41
commentL10n.submittedOn + ' <b>' +
42
$( '#mm option[value="' + mm + '"]' ).text() + ' ' +