Make WordPress Core


Ignore:
Timestamp:
03/26/2008 08:06:18 PM (17 years ago)
Author:
markjaquith
Message:

Clean up the Write Post/Write Page/Edit Comment screens for people without JS. Introduce the hide-if-no-js and hide-if-js automagical classes. fixes #6395

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/comment.js

    r7325 r7529  
    11jQuery(document).ready( function() {
    22    add_postbox_toggles('comment');
     3
     4    // close postboxes that should be closed
     5    jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
     6
     7    // show things that should be visible, hide what should be hidden
     8    jQuery('.hide-if-no-js').show();
     9    jQuery('.hide-if-js').hide();
    310
    411    jQuery('.edit-timestamp').click(function () {
    512        if (jQuery('#timestampdiv').is(":hidden")) {
    613            jQuery('#timestampdiv').slideDown("normal");
     14            jQuery('.edit-timestamp').text(commentL10n.cancel);
    715        } else {
    816            jQuery('#timestampdiv').hide();
     17            jQuery('#mm').val(jQuery('#hidden_mm').val());
     18            jQuery('#jj').val(jQuery('#hidden_jj').val());
     19            jQuery('#aa').val(jQuery('#hidden_aa').val());
     20            jQuery('#hh').val(jQuery('#hidden_hh').val());
     21            jQuery('#mn').val(jQuery('#hidden_mn').val());
     22            jQuery('.edit-timestamp').text(commentL10n.edit);
    923        }
    1024        return false;
Note: See TracChangeset for help on using the changeset viewer.