1(function($) { 2 $.fn.checkbox = function() { 3 $(this).each(function() { 4 var $el = $(this); 5 var typeClass = $el.attr('type'); 6 $el.hide(); 7 $el.next('.'+typeClass+'-sign').remove(); 8 var $checkbox = $('<span class="'+typeClass+'-sign" />').insertAfter($el); 9 $checkbox.click(function() { 10 if($el.attr('type') == 'radio') { 11 $el.prop('checked', true).trigger('change').trigger('click'); 12 } else { 13 $el.prop('checked', !($el.is(':checked'))).trigger('change'); 14 } 15 }); 16 $el.change(function() { 17 console.log($el); 18 $('input[name="'+$el.attr('name')+'"]').each(function() { 19 if($(this).is(':checked')) { 20 $(this).next('.'+$(this).attr('type')+'-sign').addClass('checked'); 21 } else { 22 $(this).next('.'+$(this).attr('type')+'-sign').removeClass('checked'); 23 } 24 }); 25 }); 26 if($el.is(':checked')) { 27 $checkbox.addClass('checked'); 28 } else { 29 $checkbox.removeClass('checked'); 30 } 31 }); 32 } 33})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.