Update for the Save box in edit comment form.
git-svn-id: https://develop.svn.wordpress.org/trunk@8913 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3e43adeb6e
commit
c9a085eac6
@ -20,16 +20,13 @@ $form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment-
|
|||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h2><?php echo $toprow_title; ?></h2>
|
<h2><?php echo $toprow_title; ?></h2>
|
||||||
|
|
||||||
<div id="previewview">
|
|
||||||
<a class="button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View this Comment'); ?></a>
|
|
||||||
</div>
|
|
||||||
<div id="poststuff">
|
<div id="poststuff">
|
||||||
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
|
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
|
||||||
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
|
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
|
||||||
<?php
|
<?php
|
||||||
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
|
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
|
||||||
|
|
||||||
function comment_submit_meta_box($comment) {
|
function comment_submit_meta_box($comment) { // not used, but keeping for a bit longer in case it's needed
|
||||||
?>
|
?>
|
||||||
<div class="submitbox" id="submitcomment">
|
<div class="submitbox" id="submitcomment">
|
||||||
<div class="inside-submitbox">
|
<div class="inside-submitbox">
|
||||||
@ -38,39 +35,74 @@ function comment_submit_meta_box($comment) {
|
|||||||
<p>
|
<p>
|
||||||
<select name='comment_status' id='comment_status'>
|
<select name='comment_status' id='comment_status'>
|
||||||
<option<?php selected( $comment->comment_approved, '1' ); ?> value='1'><?php _e('Approved') ?></option>
|
<option<?php selected( $comment->comment_approved, '1' ); ?> value='1'><?php _e('Approved') ?></option>
|
||||||
<option<?php selected( $comment->comment_approved, '0' ); ?> value='0'><?php _e('Moderated') ?></option>
|
<option<?php selected( $comment->comment_approved, '0' ); ?> value='0'><?php _e('Awaiting Moderation') ?></option>
|
||||||
<option<?php selected( $comment->comment_approved, 'spam' ); ?> value='spam'><?php _e('Spam') ?></option>
|
<option<?php selected( $comment->comment_approved, 'spam' ); ?> value='spam'><?php _e('Spam') ?></option>
|
||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<div class="insidebox" id="deletebutton">
|
||||||
|
<?php
|
||||||
|
echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>"; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$stamp = __('%1$s at %2$s');
|
$stamp = __('%1$s at %2$s');
|
||||||
$date = mysql2date(get_option('date_format'), $comment->comment_date);
|
$date = mysql2date(get_option('date_format'), $comment->comment_date);
|
||||||
$time = mysql2date(get_option('time_format'), $comment->comment_date);
|
$time = mysql2date(get_option('time_format'), $comment->comment_date);
|
||||||
?>
|
?>
|
||||||
<p class="curtime"><?php printf($stamp, $date, $time); ?>
|
<div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span>
|
||||||
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a></p>
|
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||||
|
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0, 5); ?></div></div>
|
||||||
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0, 5); ?></div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="save" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" />
|
<input type="submit" name="save" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" />
|
||||||
<?php
|
<a class="preview button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View Comment'); ?></a>
|
||||||
echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>";
|
|
||||||
?>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
add_meta_box('submitdiv', __('Save'), 'comment_submit_meta_box', 'comment', 'side', 'core');
|
// add_meta_box('submitdiv', __('Save'), 'comment_submit_meta_box', 'comment', 'side', 'core');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="side-info-column" class="inner-sidebar">
|
<div id="side-info-column" class="inner-sidebar">
|
||||||
|
<div id="submitdiv" class="stuffbox" >
|
||||||
|
<h3><span class='hndle'>Save</span></h3>
|
||||||
|
|
||||||
<?php $side_meta_boxes = do_meta_boxes('comment', 'side', $comment); ?>
|
<div class="submitbox" id="submitcomment">
|
||||||
|
<div class="inside-submitbox">
|
||||||
|
|
||||||
|
<div class="insidebox"><strong><label for='comment_status'><?php _e('This comment is') ?></label></strong><br />
|
||||||
|
<select name='comment_status' id='comment_status'>
|
||||||
|
<option<?php selected( $comment->comment_approved, '1' ); ?> value='1'><?php _e('Approved') ?></option>
|
||||||
|
<option<?php selected( $comment->comment_approved, '0' ); ?> value='0'><?php _e('Awaiting Moderation') ?></option>
|
||||||
|
<option<?php selected( $comment->comment_approved, 'spam' ); ?> value='spam'><?php _e('Spam') ?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="insidebox" id="deletebutton">
|
||||||
|
<?php
|
||||||
|
echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>"; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$stamp = __('%1$s at %2$s');
|
||||||
|
$date = mysql2date(get_option('date_format'), $comment->comment_date);
|
||||||
|
$time = mysql2date(get_option('time_format'), $comment->comment_date);
|
||||||
|
?>
|
||||||
|
<div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||||
|
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0, 5); ?></div></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="submit">
|
||||||
|
<input type="submit" name="save" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" />
|
||||||
|
<a class="preview button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View Comment'); ?></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
|
<div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
jQuery(document).ready( function() {
|
jQuery(document).ready( function($) {
|
||||||
postboxes.add_postbox_toggles('comment');
|
postboxes.add_postbox_toggles('comment');
|
||||||
|
|
||||||
// close postboxes that should be closed
|
// close postboxes that should be closed
|
||||||
@ -8,33 +8,40 @@ jQuery(document).ready( function() {
|
|||||||
jQuery('.hide-if-no-js').show();
|
jQuery('.hide-if-no-js').show();
|
||||||
jQuery('.hide-if-js').hide();
|
jQuery('.hide-if-js').hide();
|
||||||
|
|
||||||
jQuery('.edit-timestamp').click(function () {
|
var stamp = $('#timestamp').html();
|
||||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
$('.edit-timestamp').click(function () {
|
||||||
jQuery('#curtime').slideUp("normal");
|
if ($('#timestampdiv').is(":hidden")) {
|
||||||
jQuery('#timestampdiv').slideDown("normal");
|
$('#timestampdiv').slideDown("normal");
|
||||||
} else {
|
$('.edit-timestamp').hide();
|
||||||
jQuery('#timestampdiv').slideUp("normal");
|
|
||||||
jQuery('#mm').val(jQuery('#hidden_mm').val());
|
|
||||||
jQuery('#jj').val(jQuery('#hidden_jj').val());
|
|
||||||
jQuery('#aa').val(jQuery('#hidden_aa').val());
|
|
||||||
jQuery('#hh').val(jQuery('#hidden_hh').val());
|
|
||||||
jQuery('#mn').val(jQuery('#hidden_mn').val());
|
|
||||||
jQuery('#curtime').slideDown("normal");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
$('.cancel-timestamp').click(function() {
|
||||||
jQuery('#timestampdiv').hide();
|
$('#timestampdiv').slideUp("normal");
|
||||||
var link = jQuery('.timestamp a').clone( true );
|
$('#mm').val($('#hidden_mm').val());
|
||||||
jQuery('.timestamp').show().html(
|
$('#jj').val($('#hidden_jj').val());
|
||||||
jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' +
|
$('#aa').val($('#hidden_aa').val());
|
||||||
jQuery('#jj').val() + ',' +
|
$('#hh').val($('#hidden_hh').val());
|
||||||
jQuery('#aa').val() + '@' +
|
$('#mn').val($('#hidden_mn').val());
|
||||||
jQuery('#hh').val() + ':' +
|
$('#timestamp').html(stamp);
|
||||||
jQuery('#mn').val() + ' '
|
$('.edit-timestamp').show();
|
||||||
).append( link );
|
|
||||||
jQuery('#curtime').slideDown("normal");
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
||||||
|
$('#timestampdiv').slideUp("normal");
|
||||||
|
$('.edit-timestamp').show();
|
||||||
|
$('#timestamp').html(
|
||||||
|
$( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' +
|
||||||
|
$('#jj').val() + ', ' +
|
||||||
|
$('#aa').val() + ' @ ' +
|
||||||
|
$('#hh').val() + ':' +
|
||||||
|
$('#mn').val() + ' '
|
||||||
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1097,7 +1097,8 @@ table.form-table td .updated {
|
|||||||
border: 0 none;
|
border: 0 none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#side-sortables .inside-submitbox .insidebox {
|
#side-sortables .inside-submitbox .insidebox,
|
||||||
|
.stuffbox .insidebox {
|
||||||
margin: 11px 0;
|
margin: 11px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user