WordPress/wp-admin/js/xfn.js
Sergey Biryukov 8080762e93 External Libraries: Further fix jQuery deprecations in WordPress core.
This addresses `JQMIGRATE` warnings in some admin files and the Thickbox library.

Follow-up to [50001], [50270].

Props bordoni, poena.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50367


git-svn-id: http://core.svn.wordpress.org/trunk@49978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-16 20:25:03 +00:00

24 lines
757 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' ).on( '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 ) );
});
});