WordPress/wp-admin/js/xfn.js
Andrew Ozz 87acdab81d Privacy tools: Organize privacy functions into logical files and classes.
Props xkon, birgire, desrosj, garrett-eclipse, azaozz.
See #43895.
Built from https://develop.svn.wordpress.org/trunk@45448


git-svn-id: http://core.svn.wordpress.org/trunk@45259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 20:50:53 +00:00

24 lines
759 B
JavaScript

/**
* Generates the XHTML Friends Network 'rel' string from the inputs.
*
* @deprecated 3.5.0
* @output wp-admin/js/xfn.js
*/
jQuery( document ).ready(function( $ ) {
$( '#link_rel' ).prop( 'readonly', true );
$( '#linkxfndiv input' ).bind( 'click keyup', function() {
var isMe = $( '#me' ).is( ':checked' ), inputs = '';
$( 'input.valinp' ).each( function() {
if ( isMe ) {
$( this ).prop( 'disabled', true ).parent().addClass( 'disabled' );
} else {
$( this ).removeAttr( 'disabled' ).parent().removeClass( 'disabled' );
if ( $( this ).is( ':checked' ) && $( this ).val() !== '') {
inputs += $( this ).val() + ' ';
}
}
});
$( '#link_rel' ).val( ( isMe ) ? 'me' : inputs.substr( 0,inputs.length - 1 ) );
});
});