summaryrefslogtreecommitdiffstats
path: root/wp-admin/js/xfn.js
diff options
context:
space:
mode:
Diffstat (limited to 'wp-admin/js/xfn.js')
-rw-r--r--wp-admin/js/xfn.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/wp-admin/js/xfn.js b/wp-admin/js/xfn.js
new file mode 100644
index 0000000..cf7fcf8
--- /dev/null
+++ b/wp-admin/js/xfn.js
@@ -0,0 +1,23 @@
+/**
+ * Generates the XHTML Friends Network 'rel' string from the inputs.
+ *
+ * @deprecated 3.5.0
+ * @output wp-admin/js/xfn.js
+ */
+jQuery( 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 ) );
+ });
+});