-
+ C8B704B2B6D67AC065E7FC13F5C7CA4C1D51D6753175794FD6ABDED5C7C65F9B187CE364CF2E9661D8B771FE43BABE6701B2BF042BF3A9BB4A816F668BB7376F
mp-wp/wp-admin/js/link.js
(0 . 0)(1 . 57)
50416 jQuery(document).ready( function($) {
50417 // close postboxes that should be closed
50418 jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');
50419
50420 jQuery('#link_name').focus();
50421 // postboxes
50422 postboxes.add_postbox_toggles('link');
50423
50424 // category tabs
50425 var categoryTabs = jQuery('#category-tabs').tabs();
50426
50427 // Ajax Cat
50428 var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } );
50429 jQuery('#category-add-sumbit').click( function() { newCat.focus(); } );
50430 var noSyncChecks = false; // prophylactic. necessary?
50431 var syncChecks = function() {
50432 if ( noSyncChecks )
50433 return;
50434 noSyncChecks = true;
50435 var th = jQuery(this);
50436 var c = th.is(':checked');
50437 var id = th.val().toString();
50438 jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );
50439 noSyncChecks = false;
50440 };
50441 var catAddAfter = function( r, s ) {
50442 jQuery(s.what + ' response_data', r).each( function() {
50443 var t = jQuery(jQuery(this).text());
50444 t.find( 'label' ).each( function() {
50445 var th = jQuery(this);
50446 var val = th.find('input').val();
50447 var id = th.find('input')[0].id
50448 jQuery('#' + id).change( syncChecks );
50449 var name = jQuery.trim( th.text() );
50450 var o = jQuery( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
50451 } );
50452 } );
50453 };
50454 jQuery('#categorychecklist').wpList( {
50455 alt: '',
50456 what: 'link-category',
50457 response: 'category-ajax-response',
50458 addAfter: catAddAfter
50459 } );
50460
50461 $('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');});
50462 $('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');});
50463 if ( 'pop' == getUserSetting('cats') )
50464 $('a[href="#categories-pop"]').click();
50465
50466 jQuery('#category-add-toggle').click( function() {
50467 jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' );
50468 categoryTabs.tabsClick( 1 );
50469 return false;
50470 } );
50471 jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
50472 });