You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

18 lines
628 B

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