Changeset 6584
- Timestamp:
- 01/09/2008 05:46:13 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r6570 r6584 442 442 die('0'); 443 443 break; 444 case 'closed-postboxes' : 445 check_ajax_referer( $action ); 446 $closed = explode(',', $_POST['closed']); 447 if (!is_array($closed)) break; 448 $current_user = wp_get_current_user(); 449 update_usermeta($current_user->ID, 'closedpostboxes', $closed); 450 break; 444 451 default : 445 452 do_action( 'wp_ajax_' . $_POST['action'] ); -
trunk/wp-admin/edit-form-advanced.php
r6567 r6584 111 111 ?>" /></p> 112 112 113 <div id="tagsdiv" class="postbox ">113 <div id="tagsdiv" class="postbox <?php echo postbox_classes('tagsdiv'); ?>"> 114 114 <h3><?php _e('Tags'); ?></h3> 115 115 <div class="inside"> … … 119 119 </div> 120 120 121 <div id="categorydiv" class="postbox ">121 <div id="categorydiv" class="postbox <?php echo postbox_classes('categorydiv'); ?>"> 122 122 <h3><?php _e('Categories') ?></h3> 123 123 <div class="inside"> … … 141 141 <h2><?php _e('Advanced Options'); ?></h2> 142 142 143 <div id="postexcerpt" class="postbox ">143 <div id="postexcerpt" class="postbox <?php echo postbox_classes('postexcerpt'); ?>"> 144 144 <h3><?php _e('Optional Excerpt') ?></h3> 145 145 <div class="inside"><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea></div> 146 146 </div> 147 147 148 <div id="trackbacksdiv" class="postbox ">148 <div id="trackbacksdiv" class="postbox <?php echo postbox_classes('trackbacksdiv'); ?>"> 149 149 <h3><?php _e('Trackbacks') ?></h3> 150 150 <div class="inside"> … … 157 157 </div> 158 158 159 <div id="postcustom" class="postbox ">159 <div id="postcustom" class="postbox <?php echo postbox_classes('postcustom'); ?>"> 160 160 <h3><?php _e('Custom Fields') ?></h3> 161 161 <div class="inside"> … … 178 178 <?php do_action('dbx_post_advanced'); ?> 179 179 180 <div id="commentstatusdiv" class="postbox ">180 <div id="commentstatusdiv" class="postbox <?php echo postbox_classes('commentstatusdiv'); ?>"> 181 181 <h3><?php _e('Discussion') ?></h3> 182 182 <div class="inside"> … … 189 189 </div> 190 190 191 <div id="passworddiv" class="postbox ">191 <div id="passworddiv" class="postbox <?php echo postbox_classes('passworddiv'); ?>"> 192 192 <h3><?php _e('Post Password') ?></h3> 193 193 <div class="inside"> … … 196 196 </div> 197 197 198 <div id="slugdiv" class="postbox ">198 <div id="slugdiv" class="postbox <?php echo postbox_classes('slugdiv'); ?>"> 199 199 <h3><?php _e('Post Slug') ?></h3> 200 200 <div class="inside"> … … 203 203 </div> 204 204 205 <div id="poststatusdiv" class="postbox ">205 <div id="poststatusdiv" class="postbox <?php echo postbox_classes('poststatusdiv'); ?>"> 206 206 <h3><?php _e('Post Status') ?></h3> 207 207 <div class="inside"> … … 216 216 217 217 <?php if ( current_user_can('edit_posts') ) : ?> 218 <div id="posttimestampdiv" class="postbox ">218 <div id="posttimestampdiv" class="postbox <?php echo postbox_classes('posttimestampdiv'); ?>"> 219 219 <h3><?php _e('Post Timestamp'); ?></h3> 220 220 <div class="inside"><?php touch_time(($action == 'edit')); ?></div> … … 228 228 if ( $authors && count( $authors ) > 1 ) : 229 229 ?> 230 <div id="authordiv" class="postbox ">230 <div id="authordiv" class="postbox <?php echo postbox_classes('authordiv'); ?>"> 231 231 <h3><?php _e('Post Author'); ?></h3> 232 232 <div class="inside"> -
trunk/wp-admin/includes/post.php
r6354 r6584 514 514 } 515 515 516 function postbox_classes( $id ) { 517 $current_user = wp_get_current_user(); 518 $closed = get_usermeta( $current_user->ID, 'closedpostboxes' ); 519 if ( !is_array( $closed ) ) return ''; 520 return in_array( $id, $closed )? 'closed' : ''; 521 } 522 516 523 ?> -
trunk/wp-admin/js/post.js
r6578 r6584 32 32 }); 33 33 if ( shown ) 34 jQuery( '#tagchecklist' ).prepend( '<strong> Tags used on this post:</strong><br />' );34 jQuery( '#tagchecklist' ).prepend( '<strong>'+postL10n.tagsUsed+'</strong><br />' ); 35 35 } 36 36 … … 55 55 function add_postbox_toggles() { 56 56 jQuery('.postbox h3').prepend('<a class="togbox">+</a> '); 57 jQuery('.togbox').click( function() { jQuery(jQuery(this).parent().parent().get(0)).toggleClass('closed'); } ); 57 jQuery('.togbox').click( function() { jQuery(jQuery(this).parent().parent().get(0)).toggleClass('closed'); save_postboxes_state(); } ); 58 } 59 60 function save_postboxes_state() { 61 var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','); 62 jQuery.post(postL10n.requestFile, { 63 action: 'closed-postboxes', 64 closed: closed, 65 cookie: document.cookie}); 58 66 } 59 67 … … 62 70 tag_update_quickclicks(); 63 71 // add the quickadd form 64 jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" size="16" autocomplete="off" value=" Add new tag" /><input type="button" class="button" id="tagadd" value="' + catL10n.add + '"/><input type="hidden"/><input type="hidden"/><span class="howto">Separate tags with commas</span></span>');72 jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="button" class="button" id="tagadd" value="' + postL10n.add + '"/><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>'); 65 73 jQuery('#tagadd').click( tag_flush_to_text ); 66 74 // jQuery('#newtag').keydown( tag_press_key ); 67 75 jQuery('#newtag').focus(function() { 68 if ( this.value == 'Add new tag') {76 if ( this.value == postL10n.addTag ) { 69 77 this.value = ''; 70 78 this.style.color = '#333'; … … 73 81 jQuery('#newtag').blur(function() { 74 82 if ( this.value == '' ) { 75 this.value = 'Add new tag';83 this.value = postL10n.addTag; 76 84 this.style.color = '#999' 77 85 } … … 80 88 // auto-suggest stuff 81 89 jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { onSelect: tag_flush_to_text, delay: 500, minchars: 2 } ); 90 91 // postboxes 82 92 add_postbox_toggles(); 83 93 }); -
trunk/wp-includes/script-loader.php
r6582 r6584 109 109 $this->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); 110 110 $this->add( 'post', '/wp-admin/js/post.js', array('suggest'), '20080102' ); 111 $this->localize( 'post', 'postL10n', array( 112 'tagsUsed' => __('Tags used on this post:'), 113 'add' => attribute_escape(__('Add')), 114 'addTag' => attribute_escape(__('Add new tag')), 115 'separate' => __('Separate tags with commas'), 116 'requestFile' => get_option( 'siteurl' ) . '/wp-admin/admin-ajax.php', 117 ) ); 111 118 $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080109' ); 112 119 $this->localize( 'upload', 'uploadL10n', array(
Note: See TracChangeset
for help on using the changeset viewer.