role-rails 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +3 -0
- data/Rakefile +1 -0
- data/lib/role-rails.rb +8 -0
- data/lib/role-rails/engine.rb +8 -0
- data/lib/role-rails/version.rb +5 -0
- data/role-rails.gemspec +22 -0
- data/vendor/assets/javascripts/jquery.role.js +45 -0
- metadata +88 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/lib/role-rails.rb
ADDED
data/role-rails.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'role-rails/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'role-rails'
|
7
|
+
s.version = Role::Rails::VERSION
|
8
|
+
s.authors = ['Sasha Koss']
|
9
|
+
s.email = ['koss@nocorp.me']
|
10
|
+
s.homepage = ''
|
11
|
+
s.summary = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
|
12
|
+
s.description = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
|
13
|
+
|
14
|
+
s.rubyforge_project = 'role-rails'
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ['lib']
|
20
|
+
|
21
|
+
s.add_dependency 'rails', '>= 3.1.0'
|
22
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/*
|
2
|
+
jquery.role.js
|
3
|
+
|
4
|
+
Version: 0.3.2
|
5
|
+
|
6
|
+
Copyright (c) 2011 Sasha Koss
|
7
|
+
*/
|
8
|
+
|
9
|
+
(function ($) {
|
10
|
+
$.expr.match['ROLE'] = /@((?:[\w\u00c0-\uFFFF\-]|\\.)+)/;
|
11
|
+
|
12
|
+
$.expr.preFilter['ROLE'] = function( match, curLoop, inplace, result, not, isXML ) {
|
13
|
+
match = " " + match[1] + " ";
|
14
|
+
|
15
|
+
return match;
|
16
|
+
}
|
17
|
+
|
18
|
+
$.expr.filter['ROLE'] = function( elem, match ) {
|
19
|
+
return (" " + elem.getAttribute('role') + " ").indexOf( match ) > -1;
|
20
|
+
}
|
21
|
+
|
22
|
+
for ( var type in $.expr.match ) {
|
23
|
+
$.expr.match[ type ] = new RegExp( $.expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
|
24
|
+
$.expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + $.expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num) {
|
25
|
+
return "\\" + (num - 0 + 1);
|
26
|
+
}));
|
27
|
+
}
|
28
|
+
|
29
|
+
$.role = function (roleName, context) {
|
30
|
+
|
31
|
+
var selector;
|
32
|
+
|
33
|
+
if ( roleName.charAt(0) === '#' ) {
|
34
|
+
selector = '#role-' + roleName.substring(1);
|
35
|
+
} else {
|
36
|
+
selector = '[role="' + roleName + '"]';
|
37
|
+
}
|
38
|
+
|
39
|
+
return $(selector, context);
|
40
|
+
};
|
41
|
+
|
42
|
+
if (typeof $.r === 'undefined') {
|
43
|
+
$.r = $.role;
|
44
|
+
}
|
45
|
+
})(jQuery);
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: role-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Sasha Koss
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-09-06 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rails
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 3
|
31
|
+
- 1
|
32
|
+
- 0
|
33
|
+
version: 3.1.0
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
description: jQuery plugin to provide easy way to handle DOM elements by role attribute
|
37
|
+
email:
|
38
|
+
- koss@nocorp.me
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files: []
|
44
|
+
|
45
|
+
files:
|
46
|
+
- .gitignore
|
47
|
+
- Gemfile
|
48
|
+
- Rakefile
|
49
|
+
- lib/role-rails.rb
|
50
|
+
- lib/role-rails/engine.rb
|
51
|
+
- lib/role-rails/version.rb
|
52
|
+
- role-rails.gemspec
|
53
|
+
- vendor/assets/javascripts/jquery.role.js
|
54
|
+
homepage: ""
|
55
|
+
licenses: []
|
56
|
+
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
hash: 3
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
version: "0"
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
version: "0"
|
80
|
+
requirements: []
|
81
|
+
|
82
|
+
rubyforge_project: role-rails
|
83
|
+
rubygems_version: 1.8.6
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: jQuery plugin to provide easy way to handle DOM elements by role attribute
|
87
|
+
test_files: []
|
88
|
+
|