Sha256: c12ad88fedc0d2ecca4f920276f2cd4cc00b6ff98a252eeabd2db7bcc4b4cb18

Contents?: true

Size: 1009 Bytes

Versions: 3

Compression:

Stored size: 1009 Bytes

Contents

!function(e){function t(t,n,r){var i=t[n];if(!i)return;t[n]=function(){return arguments[r]=arguments[r].replace(/@([\w\u00c0-\uFFFF\-]+)/g,'[role~="$1"]'),i.apply(t,arguments)},e.extend(t[n],i)}function n(t,n){var r,i=[],s=e.trim(t).split(/\s+/);for(var o=0;o<s.length;o++)r=s[o],!~e.inArray(r,i)&&(!n||!~e.inArray(r,n))&&i.push(r);return i}t(e,"find",0),t(e,"multiFilter",0),t(e.find,"matchesSelector",1),t(e.find,"matches",0),e.extend(e.fn,{roles:function(){return n(this.attr("role"))},hasRole:function(e){var t=n(e);for(var r=0;r<t.length;r++)if(!this.is("@"+t[r]))return!1;return!0},addRole:function(t){return this.hasRole(t)?this:this.each(function(r,i){var s=e(i);s.attr("role",n(s.attr("role")+" "+t).join(" "))})},removeRole:function(t){return this.hasRole(t)?this.each(function(r,i){var s=e(i);s.attr("role",n(s.attr("role"),n(t)).join(" "))}):this},toggleRole:function(e){var t=n(e);for(var r=0;r<t.length;r++)this[this.hasRole(t[r])?"removeRole":"addRole"].call(this,t[r]);return this}})}(jQuery);

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
role-rails-1.4.0 vendor/assets/javascripts/jquery.role.min.js
better-role-rails-1.0.0 vendor/assets/javascripts/jquery.role.min.js
role-rails-1.3.1 vendor/assets/javascripts/jquery.role.min.js