{:uriI"file:///Users/marten/rgoc/quby/vendor/assets/javascripts/jquery.deselectableRadio.1.0.3.js?type=application/javascript&pipeline=self&id=d4222bf65f0e0d55caffec8b24edd12d1959ab2464740d1bd3f36aaec311526d:ET:load_pathI"6/Users/marten/rgoc/quby/vendor/assets/javascripts;T: filenameI"X/Users/marten/rgoc/quby/vendor/assets/javascripts/jquery.deselectableRadio.1.0.3.js;T: nameI"#jquery.deselectableRadio.1.0.3;T:logical_pathI"+jquery.deselectableRadio.1.0.3.self.js;T:content_typeI"application/javascript;T: sourceI" /* * jQuery deselectable/decheckable radio button plugin * * Copyright 2009 David Sanders * Released under the LGPL license * * Usage: * * a.) Apply to all elements of a radio group: * * $('input[name="test"]').deselectable(); * * b.) or apply to a subset of buttons within a group: * * $('input[name="test"][value="c"]').deselectable(); * */ (function($) { $.fn.deselectable = function() { var radio_values = {}; var radio_groups = {}; return $(this).each(function() { // Prevent this callback from being applied to non-radio buttons and // radio buttons that have already been enabled if ($(this).attr("type") !== "radio" || $(this).data("_isDeselectable")) { return; } $(this).data("_isDeselectable", true); // Test for initially checked radios if (this.checked) { radio_values[this.name] = this.value; } $(this).click(function() { if (this.value === radio_values[this.name]) { this.checked = false; $(this).change(); radio_values[this.name] = null; } // // Record which button is currently checked. // // a.) This value is recorded here (as opposed to adding to the else statement // in the above click callback) to allow subsets of buttons to set // up as deselectable. // // This would normally happen with a change event but IE6 has issues with // radios and change - only fire on blur. // // b.) Apply after the first click so that radio groups created before attaching // to the dom are looked after. // if (!$(this).data("_isRecorded")) { $('input[type="radio"][name="' + this.name + '"]').each(function() { $(this).data("_isRecorded", true); var record_radio_value = function() { }; // Record the radio value now and for further click events if (this.checked) { radio_values[this.name] = this.value; } $(this).click(function() { if (this.checked) { radio_values[this.name] = this.value; } }); }); } }); radio_groups[this.name] = true; }); }; })(jQuery); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"ffile-digest:///Users/marten/rgoc/quby/vendor/assets/javascripts/jquery.deselectableRadio.1.0.3.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%{e.oL_k0w: lengthi :dependencies_digest"%d,di1(o?PH6ߨ:idI"Ed4222bf65f0e0d55caffec8b24edd12d1959ab2464740d1bd3f36aaec311526d;F: mtimel+g,]