searchify 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -23,6 +23,10 @@ Add both jquery-ui and searchify to your `app/assets/javascripts/application.js`
|
|
23
23
|
//= require jquery-ui
|
24
24
|
//= require searchify/searchify
|
25
25
|
|
26
|
+
Finally, call the `searchify()` method on all `.searchify` field.
|
27
|
+
|
28
|
+
$('.searchify').searchify();
|
29
|
+
|
26
30
|
Usage
|
27
31
|
-----
|
28
32
|
### Autocomplete search
|
@@ -0,0 +1,15 @@
|
|
1
|
+
(function( $ ) {
|
2
|
+
$.fn.searchify = function() {
|
3
|
+
return this.each(function() {
|
4
|
+
$(this).autocomplete({
|
5
|
+
source: $(this).data("search-url"),
|
6
|
+
select: function (event, ui) {
|
7
|
+
if (select_url = $(this).data("select-url"))
|
8
|
+
window.location.href = $(this).data("select-url").replace(/\(id\)/, ui.item.id);
|
9
|
+
else
|
10
|
+
$(this).prev().val(ui.item.id);
|
11
|
+
}
|
12
|
+
});
|
13
|
+
});
|
14
|
+
};
|
15
|
+
})( jQuery );
|
data/lib/searchify/version.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,78 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: searchify
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Christian Blais
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-11-16 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: rails
|
16
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
25
|
none: false
|
18
|
-
requirements:
|
26
|
+
requirements:
|
19
27
|
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 1
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 1
|
33
|
+
- 1
|
21
34
|
version: 3.1.1
|
22
35
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
26
38
|
name: jquery-rails
|
27
|
-
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
41
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
version: "0"
|
33
49
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
37
52
|
name: sqlite3
|
38
|
-
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
55
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
62
|
+
version: "0"
|
44
63
|
type: :development
|
45
|
-
|
46
|
-
version_requirements: *2157148780
|
64
|
+
version_requirements: *id003
|
47
65
|
description: Searchify provides a quick way to search your collections.
|
48
|
-
email:
|
66
|
+
email:
|
49
67
|
- christ.blais@gmail.com
|
50
68
|
executables: []
|
69
|
+
|
51
70
|
extensions: []
|
71
|
+
|
52
72
|
extra_rdoc_files: []
|
53
|
-
|
54
|
-
|
73
|
+
|
74
|
+
files:
|
75
|
+
- app/assets/javascripts/searchify/searchify.js
|
55
76
|
- app/controllers/searchify/searchify_controller.rb
|
56
77
|
- app/helpers/searchify/searchify_helper.rb
|
57
78
|
- config/routes.rb
|
@@ -96,31 +117,41 @@ files:
|
|
96
117
|
- test/searchify_test.rb
|
97
118
|
- test/test_helper.rb
|
98
119
|
- test/unit/helpers/searchify/searchify_helper_test.rb
|
120
|
+
has_rdoc: true
|
99
121
|
homepage: http://github.com/christianblais/searchify
|
100
122
|
licenses: []
|
123
|
+
|
101
124
|
post_install_message:
|
102
125
|
rdoc_options: []
|
103
|
-
|
126
|
+
|
127
|
+
require_paths:
|
104
128
|
- lib
|
105
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
130
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
|
131
|
+
requirements:
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
hash: 3
|
135
|
+
segments:
|
136
|
+
- 0
|
137
|
+
version: "0"
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
139
|
none: false
|
113
|
-
requirements:
|
114
|
-
- -
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
hash: 3
|
144
|
+
segments:
|
145
|
+
- 0
|
146
|
+
version: "0"
|
117
147
|
requirements: []
|
148
|
+
|
118
149
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.
|
150
|
+
rubygems_version: 1.6.2
|
120
151
|
signing_key:
|
121
152
|
specification_version: 3
|
122
153
|
summary: Search with ease!
|
123
|
-
test_files:
|
154
|
+
test_files:
|
124
155
|
- test/dummy/app/assets/javascripts/application.js
|
125
156
|
- test/dummy/app/assets/stylesheets/application.css
|
126
157
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -1,12 +0,0 @@
|
|
1
|
-
$ ->
|
2
|
-
$(".searchify").each (i, object) ->
|
3
|
-
self = $(object)
|
4
|
-
|
5
|
-
self.autocomplete({
|
6
|
-
source: $(this).data("search-url"),
|
7
|
-
select: (event, ui) ->
|
8
|
-
if select_url = $(this).data("select-url")
|
9
|
-
window.location.href = $(this).data("select-url").replace(/\(id\)/, ui.item.id)
|
10
|
-
else
|
11
|
-
self.prev().val(ui.item.id)
|
12
|
-
});
|