Sha256: ef6bd4a247dc01923e8694ed8b336adeef91b2f62efc340616c7acb43f9b10ca
Contents?: true
Size: 1009 Bytes
Versions: 1
Compression:
Stored size: 1009 Bytes
Contents
!function(a){function b(b,c,d){var e=b[c];if(!e)return;b[c]=function(){return arguments[d]=arguments[d].replace(/@([\w\u00c0-\uFFFF\-]+)/g,'[role~="$1"]'),e.apply(b,arguments)},a.extend(b[c],e)}function c(b,c){var d,e=[],f=a.trim(b).split(/\s+/);for(var g=0;g<f.length;g++)d=f[g],!~a.inArray(d,e)&&(!c||!~a.inArray(d,c))&&e.push(d);return e}b(a,"find",0),b(a,"multiFilter",0),b(a.find,"matchesSelector",1),b(a.find,"matches",0),a.extend(a.fn,{roles:function(){return c(this.attr("role"))},hasRole:function(a){var b=c(a);for(var d=0;d<b.length;d++)if(!this.is("@"+b[d]))return!1;return!0},addRole:function(b){return this.hasRole(b)?this:this.each(function(d,e){var f=a(e);f.attr("role",c(f.attr("role")+" "+b).join(" "))})},removeRole:function(b){return this.hasRole(b)?this.each(function(d,e){var f=a(e);f.attr("role",c(f.attr("role"),c(b)).join(" "))}):this},toggleRole:function(a){var b=c(a);for(var d=0;d<b.length;d++)this[this.hasRole(b[d])?"removeRole":"addRole"].call(this,b[d]);return this}})}(jQuery);
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
role-rails-1.3.0 | vendor/assets/javascripts/jquery.role.min.js |