]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/link.js
Wordpress 3.2.1
[autoinstalls/wordpress.git] / wp-admin / js / link.js
index 716b34452ad192598b47a86edd142a0613c82e52..3feeaebd22ef18232cfc617bc20fa6fb00c9cc42 100644 (file)
@@ -1,57 +1 @@
-jQuery(document).ready( function($) {
-       // close postboxes that should be closed
-       jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
-
-       jQuery('#link_name').focus();
-       // postboxes
-       postboxes.add_postbox_toggles('link');
-
-       // category tabs
-       var categoryTabs = jQuery('#category-tabs').tabs();
-
-       // Ajax Cat
-       var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } );
-       jQuery('#category-add-submit').click( function() { newCat.focus(); } );
-       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 catAddAfter = function( r, s ) {
-               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 );
-                               var name = jQuery.trim( th.text() );
-                               var o = jQuery( '<option value="' +  parseInt( val, 10 ) + '"></option>' ).text( name );
-                       } );
-               } );
-       };
-       jQuery('#categorychecklist').wpList( {
-               alt: '',
-               what: 'link-category',
-               response: 'category-ajax-response',
-               addAfter: catAddAfter
-       } );
-
-       $('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');});
-       $('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');});
-       if ( 'pop' == getUserSetting('cats') )
-               $('a[href="#categories-pop"]').click();
-
-       jQuery('#category-add-toggle').click( function() {
-               jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' );
-               categoryTabs.tabsClick( 1 );
-               return false;
-       } );
-       jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
-});
+jQuery(document).ready(function(c){var b,a=false,d,e;c("#link_name").focus();postboxes.add_postbox_toggles("link");c("#category-tabs a").click(function(){var f=c(this).attr("href");c(this).parent().addClass("tabs").siblings("li").removeClass("tabs");c(".tabs-panel").hide();c(f).show();if("#categories-all"==f){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){c('#category-tabs a[href="#categories-pop"]').click()}b=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")});c("#category-add-submit").click(function(){b.focus()});d=function(){if(a){return}a=true;var f=c(this),h=f.is(":checked"),g=f.val().toString();c("#in-link-category-"+g+", #in-popular-category-"+g).prop("checked",h);a=false};e=function(g,f){c(f.what+" response_data",g).each(function(){var h=c(c(this).text());h.find("label").each(function(){var j=c(this),l=j.find("input").val(),m=j.find("input")[0].id,i=c.trim(j.text()),k;c("#"+m).change(d);k=c('<option value="'+parseInt(l,10)+'"></option>').text(i)})})};c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e});c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")});c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")});if("pop"==getUserSetting("cats")){c('a[href="#categories-pop"]').click()}c("#category-add-toggle").click(function(){c(this).parents("div:first").toggleClass("wp-hidden-children");c('#category-tabs a[href="#categories-all"]').click();c("#newcategory").focus();return false});c(".categorychecklist :checkbox").change(d).filter(":checked").change()});
\ No newline at end of file