From d5f5f07270148720c22b312c6faef232fa68864e Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 17 Apr 2008 19:32:38 +0000 Subject: [PATCH] Revert [7689], gonna try another approach. see #6677 git-svn-id: http://svn.automattic.com/wordpress/trunk@7720 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced-tabs.php | 28 ------- wp-admin/edit-form-advanced.php | 20 ++++- wp-admin/images/loading.gif | Bin 2530 -> 0 bytes wp-admin/includes/template.php | 4 +- wp-admin/js/post.js | 109 +++++++++++---------------- wp-admin/wp-admin.css | 10 --- wp-includes/script-loader.php | 2 +- 7 files changed, 63 insertions(+), 110 deletions(-) delete mode 100644 wp-admin/edit-form-advanced-tabs.php delete mode 100644 wp-admin/images/loading.gif diff --git a/wp-admin/edit-form-advanced-tabs.php b/wp-admin/edit-form-advanced-tabs.php deleted file mode 100644 index 34acad8829..0000000000 --- a/wp-admin/edit-form-advanced-tabs.php +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 15b653ffe3..b531b9c42e 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -219,17 +219,29 @@ endif; ?>

-

+

+ + 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> + + + +

+ +
+
diff --git a/wp-admin/images/loading.gif b/wp-admin/images/loading.gif deleted file mode 100644 index 85b99d46b9911ba53a792d716d9f688f3bb3c784..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2530 zcmb8xdrVVT90%}oAH9#>bK6p?cF>G=h0@JhTLdf!(gIdN1QeV+L;)2XD9^zNN@xod zwcvQjRvj8}y3J)yFv=3A2@i*l5Fc|hs2f3R;^QAN{$aL%*eO}IEP(~izxV$0$@lmB zp0hT=YKq8{00}@xHO(cjNl%Njq^=3k8whNA8mRstISPn@&imc_Tf_3@%d4xaj~qF2 z`t<3uXU|@|c=5`WE2E>Mw{G3KfB*i(#Kf~_&tAQH_4e)C>6t?woVxLBCtLOMhuB(t zGPLP@xf$T%5Zyz3iOuKI^?SO*zNFJ?wrL@=YKNznIpw!L(PPjKYQ7%}eBCama_c91pIJ1~(b1Kal`fZSz8V+OJY|r^QHxE6+WMoDB(^~{XdW=!#+uo_ zaF>U{k0Hho~yN%NrSyV`soxiBvd>cj#}5&$KDA)3{S^?ffCPkeDi5Vo>T8sy}Wj_Hf}N$J0Hz& zv|)_<-f+~-Hi-jgzIkG5vY*T|>7-8J0U*@$d8~ScFqA)f4R7yaDBs3j(<2>@V?*ZD zy6{Vy+~KLc_m5He=9(fsy~0c&4a-*{&i)i(02j`@8?In8dBM!Y(Znu4jtn@VMj|y5 zrTNa5ki}vtEiGN(#07>Rk#HaVI5ZB4@@yk%765mBN(yieTXgm{oK}vXn!h0oZG3gj;>>W?MbZnG6Q_cX~h&<^+R)8g9 zSd!4lZEm4K#ma0{aTpMHv%wr`1VF@rrKl5H7Hyn$;=;nh3JVMEcKbqhXnqO(3z}-# zu=v1OV7q%OY`*dVI>Y}97i4s2yl$S zmSto?fO|=u8h;vSPKY2zqaEs;LlhJgv~%aqwzjtUie_4FUNiT>r-& zOO#{4cBb6f^ zov;AUp?UAne>@_GHz5+(221Xlve$OHK)tvvi!~l<%)zr4PhU@ z(CY^us$O5!${6Pje5gy?*WtA2j>{<;$_PvVQNKa&69IX)a|Fw5>C&=WQ6s37gabVh SjHs`-`=fdj^ILtus=om5Wbpz3 diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 34ff96a4c0..01c3a28820 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -194,8 +194,6 @@ function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() } function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10 ) { - global $checked_categories; - wp_set_checked_post_categories( $default ); $categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number ) ); $popular_ids = array(); @@ -206,7 +204,7 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10 ) { diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 790cfa4a34..18c9706fac 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -100,79 +100,60 @@ jQuery(document).ready( function() { jQuery('#newtag').keypress( tag_press_key ); // category tabs - var newCatFocus = false; - var categoryTabs =jQuery('#category-tabs').tabs( { - cache: true, - show: function(ui) { - if ( 'category-tabs-all' != ui.id ) { return; } // only do this for the all tab - var adder = jQuery('#category-add-hidden'); + var categoryTabs =jQuery('#category-tabs').tabs(); - if ( !adder.size() ) { return; } // we're already done - - // Put HTML in proper place and set up the wp-lists etc - jQuery('#category-add').html( adder.remove().html() ); - - // Ajax Cat - var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } ); - jQuery('#category-add-sumbit').click( function() { newCat.focus(); } ); - var newCatParent = false; - var newCatParentOption = false; - var noSyncChecks = false; // prophylactic. necessary? - var syncChecks = function() { - if ( noSyncChecks ) - return; - noSyncChecks = true; + // Ajax Cat + var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } ); + jQuery('#category-add-sumbit').click( function() { newCat.focus(); } ); + var newCatParent = false; + var newCatParentOption = false; + var noSyncChecks = false; // prophylactic. necessary? + var syncChecks = function() { + if ( noSyncChecks ) + return; + noSyncChecks = true; + var th = jQuery(this); + var c = th.is(':checked'); + var id = th.val().toString(); + jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c ); + noSyncChecks = false; + }; + var catAddBefore = function( s ) { + s.data += '&' + jQuery( '#categorychecklist :checked' ).serialize(); + return s; + }; + var catAddAfter = function( r, s ) { + if ( !newCatParent ) newCatParent = jQuery('#newcat_parent'); + if ( !newCatParentOption ) newCatParentOption = newCatParent.find( 'option[value=-1]' ); + jQuery(s.what + ' response_data', r).each( function() { + var t = jQuery(jQuery(this).text()); + t.find( 'label' ).each( function() { var th = jQuery(this); - var c = th.is(':checked'); - var id = th.val().toString(); - jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c ); - noSyncChecks = false; - }; - var catAddBefore = function( s ) { - s.data += '&' + jQuery( '#categorychecklist :checked' ).serialize(); - return s; - }; - var catAddAfter = function( r, s ) { - if ( !newCatParent ) newCatParent = jQuery('#newcat_parent'); - if ( !newCatParentOption ) newCatParentOption = newCatParent.find( 'option[value=-1]' ); - jQuery(s.what + ' response_data', r).each( function() { - var t = jQuery(jQuery(this).text()); - t.find( 'label' ).each( function() { - var th = jQuery(this); - var val = th.find('input').val(); - var id = th.find('input')[0].id - jQuery('#' + id).change( syncChecks ); - if ( newCatParent.find( 'option[value=' + val + ']' ).size() ) - return; - var name = jQuery.trim( th.text() ); - var o = jQuery( '' ).text( name ); - newCatParent.prepend( o ); - } ); - newCatParentOption.attr( 'selected', true ); - } ); - }; - jQuery('#categorychecklist').wpList( { - alt: '', - response: 'category-ajax-response', - addBefore: catAddBefore, - addAfter: catAddAfter + var val = th.find('input').val(); + var id = th.find('input')[0].id + jQuery('#' + id).change( syncChecks ); + if ( newCatParent.find( 'option[value=' + val + ']' ).size() ) + return; + var name = jQuery.trim( th.text() ); + var o = jQuery( '' ).text( name ); + newCatParent.prepend( o ); } ); - jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change(); - - if ( newCatFocus ) { - jQuery('#newcat').focus(); - newCatFocus = false; - } - } + newCatParentOption.attr( 'selected', true ); + } ); + }; + jQuery('#categorychecklist').wpList( { + alt: '', + response: 'category-ajax-response', + addBefore: catAddBefore, + addAfter: catAddAfter } ); - jQuery('#category-add-toggle').click( function() { jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' ); - categoryTabs.tabsClick( 2 ); + categoryTabs.tabsClick( 1 ); jQuery('#newcat').focus(); - newCatFocus = true; return false; } ); + jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change(); jQuery('.edit-timestamp').click(function () { if (jQuery('#timestampdiv').is(":hidden")) { diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index ad1bfd3fb8..7a9283ca19 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -1269,16 +1269,6 @@ ul.categorychecklist li { margin: 0; } -ul#category-tabs a { - width: 100%; - display: block; -} - -.ui-tabs-loading { - outline: none; - background: url(../images/loading.gif) no-repeat 0 50%; -} - #linkcategorydiv ul#category-tabs { float: left; width: 120px; diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 80d4d2a54d..11faca2f70 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -144,7 +144,7 @@ class WP_Scripts { 'save' => __('Save'), 'cancel' => __('Cancel'), ) ); - $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080412' ); + $this->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug'), '20080411' ); $this->localize( 'post', 'postL10n', array( 'tagsUsed' => __('Tags used on this post:'), 'add' => attribute_escape(__('Add')),