wp/wp-admin/js/xfn.js
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
     1 jQuery(document).ready( function($) {
     1 jQuery( document ).ready(function( $ ) {
     2 	$('#link_rel').prop('readonly', true);
     2 	$( '#link_rel' ).prop( 'readonly', true );
     3 	$('#linkxfndiv input').bind('click keyup', function() {
     3 	$( '#linkxfndiv input' ).bind( 'click keyup', function() {
     4 		var isMe = $('#me').is(':checked'), inputs = '';
     4 		var isMe = $( '#me' ).is( ':checked' ), inputs = '';
     5 		$('input.valinp').each( function() {
     5 		$( 'input.valinp' ).each( function() {
     6 			if (isMe) {
     6 			if ( isMe ) {
     7 				$(this).prop('disabled', true).parent().addClass('disabled');
     7 				$( this ).prop( 'disabled', true ).parent().addClass( 'disabled' );
     8 			} else {
     8 			} else {
     9 				$(this).removeAttr('disabled').parent().removeClass('disabled');
     9 				$( this ).removeAttr( 'disabled' ).parent().removeClass( 'disabled' );
    10 				if ( $(this).is(':checked') && $(this).val() != '')
    10 				if ( $( this ).is( ':checked' ) && $( this ).val() !== '') {
    11 					inputs += $(this).val() + ' ';
    11 					inputs += $( this ).val() + ' ';
       
    12 				}
    12 			}
    13 			}
    13 		});
    14 		});
    14 		$('#link_rel').val( (isMe) ? 'me' : inputs.substr(0,inputs.length - 1) );
    15 		$( '#link_rel' ).val( ( isMe ) ? 'me' : inputs.substr( 0,inputs.length - 1 ) );
    15 	});
    16 	});
    16 });
    17 });