]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/xfn.js
WordPress 4.4.1-scripts
[autoinstalls/wordpress.git] / wp-admin / js / xfn.js
index c243a9fdfb06984fa2fb940566704b552b068dac..de8401b6636f4c6955cc7b82b12e51545cc3ef79 100644 (file)
@@ -1 +1,17 @@
-jQuery(document).ready(function(a){a("#link_rel").attr("readonly","readonly");a("#linkxfndiv input").bind("click keyup",function(){var c=a("#me").is(":checked"),b="";a("input.valinp").each(function(){if(c){a(this).attr("disabled","disabled").parent().addClass("disabled")}else{a(this).removeAttr("disabled").parent().removeClass("disabled");if(a(this).is(":checked")&&a(this).val()!=""){b+=a(this).val()+" "}}});a("#link_rel").val((c)?"me":b.substr(0,b.length-1))})});
\ No newline at end of file
+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 ) );
+       });
+});