vinova_sunspot_autocomplete 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +7 -0
- data/README +91 -0
- data/README.rdoc +91 -0
- data/Rakefile +37 -0
- data/VERSION +1 -0
- data/assets/javascripts/jquery.js +6240 -0
- data/assets/javascripts/solr-autocomplete/ajax-solr/core/AbstractManager.js +182 -0
- data/assets/javascripts/solr-autocomplete/ajax-solr/core/Core.js +226 -0
- data/assets/javascripts/solr-autocomplete/ajax-solr/core/Parameter.js +161 -0
- data/assets/javascripts/solr-autocomplete/ajax-solr/core/ParameterStore.js +354 -0
- data/assets/javascripts/solr-autocomplete/ajax-solr/managers/Manager.jquery.js +20 -0
- data/assets/javascripts/solr-autocomplete/jquery-autocomplete/indicator.gif +0 -0
- data/assets/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.css +49 -0
- data/assets/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.js +867 -0
- data/lib/autocomplete_view_helpers.rb +126 -0
- data/lib/sunspot_autocomplete.rb +38 -0
- data/rails/init.rb +3 -0
- data/rdoc/classes/AutocompleteViewHelpers.html +322 -0
- data/rdoc/classes/Sunspot.html +111 -0
- data/rdoc/classes/Sunspot/Type.html +112 -0
- data/rdoc/classes/Sunspot/Type/AutocompleteType.html +117 -0
- data/rdoc/classes/Sunspot/Type/AutosuggestType.html +117 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README.html +238 -0
- data/rdoc/files/README_rdoc.html +238 -0
- data/rdoc/files/lib/autocomplete_view_helpers_rb.html +236 -0
- data/rdoc/files/lib/sunspot_autocomplete_rb.html +101 -0
- data/rdoc/fr_class_index.html +31 -0
- data/rdoc/fr_file_index.html +29 -0
- data/rdoc/fr_method_index.html +28 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/tasks/tasks.rake +10 -0
- data/test/sunspot_autocomplete_test.rb +21 -0
- data/test/test_helper.rb +3 -0
- data/vinova_sunspot_autocomplete.gemspec +80 -0
- metadata +118 -0
data/rdoc/rdoc-style.css
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
|
2
|
+
body {
|
3
|
+
font-family: Verdana,Arial,Helvetica,sans-serif;
|
4
|
+
font-size: 90%;
|
5
|
+
margin: 0;
|
6
|
+
margin-left: 40px;
|
7
|
+
padding: 0;
|
8
|
+
background: white;
|
9
|
+
}
|
10
|
+
|
11
|
+
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
12
|
+
h1 { font-size: 150%; }
|
13
|
+
h2,h3,h4 { margin-top: 1em; }
|
14
|
+
|
15
|
+
a { background: #eef; color: #039; text-decoration: none; }
|
16
|
+
a:hover { background: #039; color: #eef; }
|
17
|
+
|
18
|
+
/* Override the base stylesheet's Anchor inside a table cell */
|
19
|
+
td > a {
|
20
|
+
background: transparent;
|
21
|
+
color: #039;
|
22
|
+
text-decoration: none;
|
23
|
+
}
|
24
|
+
|
25
|
+
/* and inside a section title */
|
26
|
+
.section-title > a {
|
27
|
+
background: transparent;
|
28
|
+
color: #eee;
|
29
|
+
text-decoration: none;
|
30
|
+
}
|
31
|
+
|
32
|
+
/* === Structural elements =================================== */
|
33
|
+
|
34
|
+
div#index {
|
35
|
+
margin: 0;
|
36
|
+
margin-left: -40px;
|
37
|
+
padding: 0;
|
38
|
+
font-size: 90%;
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
div#index a {
|
43
|
+
margin-left: 0.7em;
|
44
|
+
}
|
45
|
+
|
46
|
+
div#index .section-bar {
|
47
|
+
margin-left: 0px;
|
48
|
+
padding-left: 0.7em;
|
49
|
+
background: #ccc;
|
50
|
+
font-size: small;
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
div#classHeader, div#fileHeader {
|
55
|
+
width: auto;
|
56
|
+
color: white;
|
57
|
+
padding: 0.5em 1.5em 0.5em 1.5em;
|
58
|
+
margin: 0;
|
59
|
+
margin-left: -40px;
|
60
|
+
border-bottom: 3px solid #006;
|
61
|
+
}
|
62
|
+
|
63
|
+
div#classHeader a, div#fileHeader a {
|
64
|
+
background: inherit;
|
65
|
+
color: white;
|
66
|
+
}
|
67
|
+
|
68
|
+
div#classHeader td, div#fileHeader td {
|
69
|
+
background: inherit;
|
70
|
+
color: white;
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
div#fileHeader {
|
75
|
+
background: #057;
|
76
|
+
}
|
77
|
+
|
78
|
+
div#classHeader {
|
79
|
+
background: #048;
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
.class-name-in-header {
|
84
|
+
font-size: 180%;
|
85
|
+
font-weight: bold;
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
div#bodyContent {
|
90
|
+
padding: 0 1.5em 0 1.5em;
|
91
|
+
}
|
92
|
+
|
93
|
+
div#description {
|
94
|
+
padding: 0.5em 1.5em;
|
95
|
+
background: #efefef;
|
96
|
+
border: 1px dotted #999;
|
97
|
+
}
|
98
|
+
|
99
|
+
div#description h1,h2,h3,h4,h5,h6 {
|
100
|
+
color: #125;;
|
101
|
+
background: transparent;
|
102
|
+
}
|
103
|
+
|
104
|
+
div#validator-badges {
|
105
|
+
text-align: center;
|
106
|
+
}
|
107
|
+
div#validator-badges img { border: 0; }
|
108
|
+
|
109
|
+
div#copyright {
|
110
|
+
color: #333;
|
111
|
+
background: #efefef;
|
112
|
+
font: 0.75em sans-serif;
|
113
|
+
margin-top: 5em;
|
114
|
+
margin-bottom: 0;
|
115
|
+
padding: 0.5em 2em;
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
/* === Classes =================================== */
|
120
|
+
|
121
|
+
table.header-table {
|
122
|
+
color: white;
|
123
|
+
font-size: small;
|
124
|
+
}
|
125
|
+
|
126
|
+
.type-note {
|
127
|
+
font-size: small;
|
128
|
+
color: #DEDEDE;
|
129
|
+
}
|
130
|
+
|
131
|
+
.xxsection-bar {
|
132
|
+
background: #eee;
|
133
|
+
color: #333;
|
134
|
+
padding: 3px;
|
135
|
+
}
|
136
|
+
|
137
|
+
.section-bar {
|
138
|
+
color: #333;
|
139
|
+
border-bottom: 1px solid #999;
|
140
|
+
margin-left: -20px;
|
141
|
+
}
|
142
|
+
|
143
|
+
|
144
|
+
.section-title {
|
145
|
+
background: #79a;
|
146
|
+
color: #eee;
|
147
|
+
padding: 3px;
|
148
|
+
margin-top: 2em;
|
149
|
+
margin-left: -30px;
|
150
|
+
border: 1px solid #999;
|
151
|
+
}
|
152
|
+
|
153
|
+
.top-aligned-row { vertical-align: top }
|
154
|
+
.bottom-aligned-row { vertical-align: bottom }
|
155
|
+
|
156
|
+
/* --- Context section classes ----------------------- */
|
157
|
+
|
158
|
+
.context-row { }
|
159
|
+
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
160
|
+
.context-item-value { font-size: small; color: #448; }
|
161
|
+
.context-item-desc { color: #333; padding-left: 2em; }
|
162
|
+
|
163
|
+
/* --- Method classes -------------------------- */
|
164
|
+
.method-detail {
|
165
|
+
background: #efefef;
|
166
|
+
padding: 0;
|
167
|
+
margin-top: 0.5em;
|
168
|
+
margin-bottom: 1em;
|
169
|
+
border: 1px dotted #ccc;
|
170
|
+
}
|
171
|
+
.method-heading {
|
172
|
+
color: black;
|
173
|
+
background: #ccc;
|
174
|
+
border-bottom: 1px solid #666;
|
175
|
+
padding: 0.2em 0.5em 0 0.5em;
|
176
|
+
}
|
177
|
+
.method-signature { color: black; background: inherit; }
|
178
|
+
.method-name { font-weight: bold; }
|
179
|
+
.method-args { font-style: italic; }
|
180
|
+
.method-description { padding: 0 0.5em 0 0.5em; }
|
181
|
+
|
182
|
+
/* --- Source code sections -------------------- */
|
183
|
+
|
184
|
+
a.source-toggle { font-size: 90%; }
|
185
|
+
div.method-source-code {
|
186
|
+
background: #262626;
|
187
|
+
color: #ffdead;
|
188
|
+
margin: 1em;
|
189
|
+
padding: 0.5em;
|
190
|
+
border: 1px dashed #999;
|
191
|
+
overflow: hidden;
|
192
|
+
}
|
193
|
+
|
194
|
+
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
195
|
+
|
196
|
+
/* --- Ruby keyword styles --------------------- */
|
197
|
+
|
198
|
+
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
199
|
+
|
200
|
+
.ruby-constant { color: #7fffd4; background: transparent; }
|
201
|
+
.ruby-keyword { color: #00ffff; background: transparent; }
|
202
|
+
.ruby-ivar { color: #eedd82; background: transparent; }
|
203
|
+
.ruby-operator { color: #00ffee; background: transparent; }
|
204
|
+
.ruby-identifier { color: #ffdead; background: transparent; }
|
205
|
+
.ruby-node { color: #ffa07a; background: transparent; }
|
206
|
+
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
207
|
+
.ruby-regexp { color: #ffa07a; background: transparent; }
|
208
|
+
.ruby-value { color: #7fffd4; background: transparent; }
|
data/tasks/tasks.rake
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
namespace :sunspot_autocomplete do
|
2
|
+
desc "Copy assets to public"
|
3
|
+
task :copy_assets do
|
4
|
+
puts "copying javascripts/solr-autocomplete"
|
5
|
+
FileUtils.cp_r "#{File.dirname(__FILE__)}/../assets/javascripts/solr-autocomplete", "#{Rails.root}/public/javascripts"
|
6
|
+
puts "copying javascripts/jquery"
|
7
|
+
FileUtils.cp "#{File.dirname(__FILE__)}/../assets/javascripts/jquery.js", "#{Rails.root}/public/javascripts"
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
require "sunspot"
|
3
|
+
require File.dirname(__FILE__) + "/../lib/sunspot_autocomplete"
|
4
|
+
|
5
|
+
class SunspotAutocompleteTest < ActiveSupport::TestCase
|
6
|
+
|
7
|
+
test "autocomplete type" do
|
8
|
+
type = Sunspot::Type::AutocompleteType.send :new
|
9
|
+
assert_equal type.indexed_name("post_title"), "post_title_ac"
|
10
|
+
assert_equal type.to_indexed(3), "3"
|
11
|
+
assert_equal type.cast("value"), "value"
|
12
|
+
end
|
13
|
+
|
14
|
+
test "autosuggest type" do
|
15
|
+
type = Sunspot::Type::AutosuggestType.send :new
|
16
|
+
assert_equal type.indexed_name("post_title"), "post_title_as"
|
17
|
+
assert_equal type.to_indexed(3), "3"
|
18
|
+
assert_equal type.cast("value"), "value"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{vinova_sunspot_autocomplete}
|
8
|
+
s.version = "1.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Haitham Mohammad"]
|
12
|
+
s.date = %q{2010-08-17}
|
13
|
+
s.description = %q{A Rails plugin encapsulating autocompletion of HTML text input using Solr and Sunspot}
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"LICENSE",
|
16
|
+
"README",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
"LICENSE",
|
21
|
+
"README",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"assets/javascripts/jquery.js",
|
26
|
+
"assets/javascripts/solr-autocomplete/ajax-solr/core/AbstractManager.js",
|
27
|
+
"assets/javascripts/solr-autocomplete/ajax-solr/core/Core.js",
|
28
|
+
"assets/javascripts/solr-autocomplete/ajax-solr/core/Parameter.js",
|
29
|
+
"assets/javascripts/solr-autocomplete/ajax-solr/core/ParameterStore.js",
|
30
|
+
"assets/javascripts/solr-autocomplete/ajax-solr/managers/Manager.jquery.js",
|
31
|
+
"assets/javascripts/solr-autocomplete/jquery-autocomplete/indicator.gif",
|
32
|
+
"assets/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.css",
|
33
|
+
"assets/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.js",
|
34
|
+
"lib/autocomplete_view_helpers.rb",
|
35
|
+
"lib/sunspot_autocomplete.rb",
|
36
|
+
"rails/init.rb",
|
37
|
+
"rdoc/classes/AutocompleteViewHelpers.html",
|
38
|
+
"rdoc/classes/Sunspot.html",
|
39
|
+
"rdoc/classes/Sunspot/Type.html",
|
40
|
+
"rdoc/classes/Sunspot/Type/AutocompleteType.html",
|
41
|
+
"rdoc/classes/Sunspot/Type/AutosuggestType.html",
|
42
|
+
"rdoc/created.rid",
|
43
|
+
"rdoc/files/README.html",
|
44
|
+
"rdoc/files/README_rdoc.html",
|
45
|
+
"rdoc/files/lib/autocomplete_view_helpers_rb.html",
|
46
|
+
"rdoc/files/lib/sunspot_autocomplete_rb.html",
|
47
|
+
"rdoc/fr_class_index.html",
|
48
|
+
"rdoc/fr_file_index.html",
|
49
|
+
"rdoc/fr_method_index.html",
|
50
|
+
"rdoc/index.html",
|
51
|
+
"rdoc/rdoc-style.css",
|
52
|
+
"tasks/tasks.rake",
|
53
|
+
"test/sunspot_autocomplete_test.rb",
|
54
|
+
"test/test_helper.rb",
|
55
|
+
"vinova_sunspot_autocomplete.gemspec"
|
56
|
+
]
|
57
|
+
s.homepage = %q{http://github.com/vinova/sunspot_autocomplete}
|
58
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
59
|
+
s.require_paths = ["lib"]
|
60
|
+
s.rubygems_version = %q{1.3.7}
|
61
|
+
s.summary = %q{}
|
62
|
+
s.test_files = [
|
63
|
+
"test/sunspot_autocomplete_test.rb",
|
64
|
+
"test/test_helper.rb"
|
65
|
+
]
|
66
|
+
|
67
|
+
if s.respond_to? :specification_version then
|
68
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
69
|
+
s.specification_version = 3
|
70
|
+
|
71
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
72
|
+
s.add_runtime_dependency(%q<sunspot_rails>, [">= 0"])
|
73
|
+
else
|
74
|
+
s.add_dependency(%q<sunspot_rails>, [">= 0"])
|
75
|
+
end
|
76
|
+
else
|
77
|
+
s.add_dependency(%q<sunspot_rails>, [">= 0"])
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vinova_sunspot_autocomplete
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Haitham Mohammad
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-08-17 00:00:00 +07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: sunspot_rails
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description: A Rails plugin encapsulating autocompletion of HTML text input using Solr and Sunspot
|
36
|
+
email:
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README
|
44
|
+
- README.rdoc
|
45
|
+
files:
|
46
|
+
- LICENSE
|
47
|
+
- README
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- assets/javascripts/jquery.js
|
52
|
+
- assets/javascripts/solr-autocomplete/ajax-solr/core/AbstractManager.js
|
53
|
+
- assets/javascripts/solr-autocomplete/ajax-solr/core/Core.js
|
54
|
+
- assets/javascripts/solr-autocomplete/ajax-solr/core/Parameter.js
|
55
|
+
- assets/javascripts/solr-autocomplete/ajax-solr/core/ParameterStore.js
|
56
|
+
- assets/javascripts/solr-autocomplete/ajax-solr/managers/Manager.jquery.js
|
57
|
+
- assets/javascripts/solr-autocomplete/jquery-autocomplete/indicator.gif
|
58
|
+
- assets/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.css
|
59
|
+
- assets/javascripts/solr-autocomplete/jquery-autocomplete/jquery.autocomplete.js
|
60
|
+
- lib/autocomplete_view_helpers.rb
|
61
|
+
- lib/sunspot_autocomplete.rb
|
62
|
+
- rails/init.rb
|
63
|
+
- rdoc/classes/AutocompleteViewHelpers.html
|
64
|
+
- rdoc/classes/Sunspot.html
|
65
|
+
- rdoc/classes/Sunspot/Type.html
|
66
|
+
- rdoc/classes/Sunspot/Type/AutocompleteType.html
|
67
|
+
- rdoc/classes/Sunspot/Type/AutosuggestType.html
|
68
|
+
- rdoc/created.rid
|
69
|
+
- rdoc/files/README.html
|
70
|
+
- rdoc/files/README_rdoc.html
|
71
|
+
- rdoc/files/lib/autocomplete_view_helpers_rb.html
|
72
|
+
- rdoc/files/lib/sunspot_autocomplete_rb.html
|
73
|
+
- rdoc/fr_class_index.html
|
74
|
+
- rdoc/fr_file_index.html
|
75
|
+
- rdoc/fr_method_index.html
|
76
|
+
- rdoc/index.html
|
77
|
+
- rdoc/rdoc-style.css
|
78
|
+
- tasks/tasks.rake
|
79
|
+
- test/sunspot_autocomplete_test.rb
|
80
|
+
- test/test_helper.rb
|
81
|
+
- vinova_sunspot_autocomplete.gemspec
|
82
|
+
has_rdoc: true
|
83
|
+
homepage: http://github.com/vinova/sunspot_autocomplete
|
84
|
+
licenses: []
|
85
|
+
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options:
|
88
|
+
- --charset=UTF-8
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
hash: 3
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
version: "0"
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
requirements: []
|
110
|
+
|
111
|
+
rubyforge_project:
|
112
|
+
rubygems_version: 1.3.7
|
113
|
+
signing_key:
|
114
|
+
specification_version: 3
|
115
|
+
summary: ""
|
116
|
+
test_files:
|
117
|
+
- test/sunspot_autocomplete_test.rb
|
118
|
+
- test/test_helper.rb
|