WordPress.org

Make WordPress Core

Changeset 6675


Ignore:
Timestamp:
01/28/2008 09:34:42 PM (10 years ago)
Author:
ryan
Message:

Move postbox to postbox.js. Don't load cat and tag js for pages.

Location:
trunk
Files:
1 added
2 edited

Legend:

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

    r6674 r6675  
    1 // this file shoudl contain all the scripts used in the post/edit page
     1// this file contains all the scripts used in the post/edit page
    22
    33function new_tag_remove_tag() {
     
    5353}
    5454
    55 function add_postbox_toggles() {
    56     jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
    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});
    66 }
    67 
    6855function edit_permalink(post_id) {
    6956    var i, c = 0;
     
    113100
    114101addLoadEvent( function() {
     102    // postboxes
     103    add_postbox_toggles();
     104
     105    // If no tags on the page, skip the tag and category stuff.
     106    if ( !jQuery('#tags-input').size() ) {
     107        return;
     108    }
     109
     110    // Editable slugs
     111    make_slugedit_clickable();
     112
    115113    jQuery('#tags-input').hide();
    116114    tag_update_quickclicks();
     
    130128    jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2 } );
    131129    jQuery('#newtag').keypress( tag_press_key );
    132 
    133     // postboxes
    134     add_postbox_toggles();
    135130
    136131    // category tabs
     
    183178    } );
    184179    jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
    185 
    186     make_slugedit_clickable();
    187180});
  • trunk/wp-includes/script-loader.php

    r6674 r6675  
    132132            $this->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' );
    133133            $this->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' );
    134             $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists'), '20080128' );
     134            $this->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery'), '20080128' );
     135            $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox'), '20080128' );
    135136            $this->localize( 'post', 'postL10n', array(
    136137                'tagsUsed' =>  __('Tags used on this post:'),
Note: See TracChangeset for help on using the changeset viewer.