selectBoxIt 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +52 -0
  6. data/Rakefile +2 -0
  7. data/app/assets/javascripts/selectBoxIt/jquery.selectBoxIt.js +3259 -0
  8. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.add.js +183 -0
  9. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.ariaAccessibility.js +117 -0
  10. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.copyAttributes.js +63 -0
  11. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.core.js +1802 -0
  12. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.destroy.js +58 -0
  13. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.disable.js +137 -0
  14. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.dynamicPositioning.js +102 -0
  15. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.enable.js +76 -0
  16. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.endClosure.js +1 -0
  17. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.keyboardNavigation.js +143 -0
  18. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.keyboardSearch.js +209 -0
  19. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.mobile.js +158 -0
  20. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.remove.js +90 -0
  21. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.selectOption.js +36 -0
  22. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.setOption.js +33 -0
  23. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.setOptions.js +32 -0
  24. data/app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.wait.js +19 -0
  25. data/app/assets/stylesheets/selectBoxIt/jquery.selectBoxIt.css +278 -0
  26. data/lib/selectBoxIt.rb +6 -0
  27. data/lib/selectBoxIt/engine.rb +4 -0
  28. data/lib/selectBoxIt/version.rb +3 -0
  29. data/selectBoxIt.gemspec +23 -0
  30. metadata +100 -0
@@ -0,0 +1,36 @@
1
+
2
+ // Select Option Module
3
+ // ====================
4
+
5
+ // Select Option
6
+ // -------------
7
+ // Programatically selects a drop down option by either index or value
8
+
9
+ selectBoxIt.selectOption = function(val, callback) {
10
+
11
+ // Stores the plugin context inside of the self variable
12
+ var self = this,
13
+ type = $.type(val);
14
+
15
+ // Makes sure the passed in position is a number
16
+ if(type === "number") {
17
+
18
+ // Set's the original select box value and triggers the change event (which SelectBoxIt listens for)
19
+ self.selectBox.val(self.selectItems.eq(val).val()).change();
20
+
21
+ }
22
+
23
+ else if(type === "string") {
24
+
25
+ // Set's the original select box value and triggers the change event (which SelectBoxIt listens for)
26
+ self.selectBox.val(val).change();
27
+
28
+ }
29
+
30
+ // Calls the callback function
31
+ self._callbackSupport(callback);
32
+
33
+ // Maintains chainability
34
+ return self;
35
+
36
+ };
@@ -0,0 +1,33 @@
1
+
2
+ // Set Option Module
3
+ // =================
4
+
5
+ // Set Option
6
+ // ----------
7
+ // Accepts an string key, a value, and a callback function to replace a single
8
+ // property of the plugin options object
9
+
10
+ selectBoxIt.setOption = function(key, value, callback) {
11
+
12
+ var self = this;
13
+
14
+ //Makes sure a string is passed in
15
+ if($.type(key) === "string") {
16
+
17
+ // Sets the plugin option to the new value provided by the user
18
+ self.options[key] = value;
19
+
20
+ }
21
+
22
+ // Rebuilds the dropdown
23
+ self.refresh(function() {
24
+
25
+ // Provide callback function support
26
+ self._callbackSupport(callback);
27
+
28
+ }, true);
29
+
30
+ // Maintains chainability
31
+ return self;
32
+
33
+ };
@@ -0,0 +1,32 @@
1
+
2
+ // Set Options Module
3
+ // ==================
4
+
5
+ // Set Options
6
+ // ----------
7
+ // Accepts an object to replace plugin options
8
+ // properties of the plugin options object
9
+
10
+ selectBoxIt.setOptions = function(newOptions, callback) {
11
+
12
+ var self = this;
13
+
14
+ // If the passed in parameter is an object literal
15
+ if($.isPlainObject(newOptions)) {
16
+
17
+ self.options = $.extend({}, self.options, newOptions);
18
+
19
+ }
20
+
21
+ // Rebuilds the dropdown
22
+ self.refresh(function() {
23
+
24
+ // Provide callback function support
25
+ self._callbackSupport(callback);
26
+
27
+ }, true);
28
+
29
+ // Maintains chainability
30
+ return self;
31
+
32
+ };
@@ -0,0 +1,19 @@
1
+
2
+ // Wait Module
3
+ // ===========
4
+
5
+ // Wait
6
+ // ----
7
+ // Delays execution by the amount of time
8
+ // specified by the parameter
9
+
10
+ selectBoxIt.wait = function(time, callback) {
11
+
12
+ var self = this;
13
+
14
+ self.widgetProto._delay.call(self, callback, time);
15
+
16
+ // Maintains chainability
17
+ return self;
18
+
19
+ };
@@ -0,0 +1,278 @@
1
+ /*
2
+ * jquery.selectBoxIt.css 3.8.1
3
+ * Author: @gregfranko
4
+ */
5
+
6
+ /*
7
+ Common CSS Properties
8
+ ---------------------
9
+ These properties will be applied to any themes that you use
10
+ */
11
+
12
+ /* SelectBoxIt container */
13
+ .selectboxit-container {
14
+ position: relative;
15
+ display: inline-block;
16
+ vertical-align: top;
17
+ }
18
+
19
+ /* Styles that apply to all SelectBoxIt elements */
20
+ .selectboxit-container * {
21
+ font: 14px Helvetica, Arial;
22
+ /* Prevents text selection */
23
+ -webkit-touch-callout: none;
24
+ -webkit-user-select: none;
25
+ -khtml-user-select: none;
26
+ -moz-user-select: -moz-none;
27
+ -ms-user-select: none;
28
+ -o-user-select: none;
29
+ user-select: none;
30
+ outline: none;
31
+ white-space: nowrap;
32
+ }
33
+
34
+ /* Button */
35
+ .selectboxit-container .selectboxit {
36
+ width: 220px; /* Width of the dropdown button */
37
+ cursor: pointer;
38
+ margin: 0;
39
+ padding: 0;
40
+ border-radius: 6px;
41
+ overflow: hidden;
42
+ display: block;
43
+ position: relative;
44
+ }
45
+
46
+ /* Height and Vertical Alignment of Text */
47
+ .selectboxit-container span, .selectboxit-container .selectboxit-options a {
48
+ height: 30px; /* Height of the drop down */
49
+ line-height: 30px; /* Vertically positions the drop down text */
50
+ display: block;
51
+ }
52
+
53
+ /* Focus pseudo selector */
54
+ .selectboxit-container .selectboxit:focus {
55
+ outline: 0;
56
+ }
57
+
58
+ /* Disabled Mouse Interaction */
59
+ .selectboxit.selectboxit-disabled, .selectboxit-options .selectboxit-disabled {
60
+ opacity: 0.65;
61
+ filter: alpha(opacity=65);
62
+ -webkit-box-shadow: none;
63
+ -moz-box-shadow: none;
64
+ box-shadow: none;
65
+ cursor: default;
66
+ }
67
+
68
+ /* Button Text */
69
+ .selectboxit-text {
70
+ text-indent: 5px;
71
+ overflow: hidden;
72
+ text-overflow: ellipsis;
73
+ float: left;
74
+ }
75
+
76
+ .selectboxit .selectboxit-option-icon-container {
77
+ margin-left: 5px;
78
+ }
79
+
80
+ /* Options List */
81
+ .selectboxit-container .selectboxit-options {
82
+ -moz-box-sizing: border-box;
83
+ box-sizing: border-box;
84
+ min-width: 100%; /* Minimum Width of the dropdown list box options */
85
+ *width: 100%;
86
+ margin: 0;
87
+ padding: 0;
88
+ list-style: none;
89
+ position: absolute;
90
+ overflow-x: hidden;
91
+ overflow-y: auto;
92
+ cursor: pointer;
93
+ display: none;
94
+ z-index: 9999999999999;
95
+ border-radius: 6px;
96
+ text-align: left;
97
+ -webkit-box-shadow: none;
98
+ -moz-box-shadow: none;
99
+ box-shadow: none;
100
+ }
101
+
102
+ /* Individual options */
103
+ .selectboxit-option .selectboxit-option-anchor{
104
+ padding: 0 2px;
105
+ }
106
+
107
+ /* Individual Option Hover Action */
108
+ .selectboxit-option .selectboxit-option-anchor:hover {
109
+ text-decoration: none;
110
+ }
111
+
112
+ /* Individual Option Optgroup Header */
113
+ .selectboxit-option, .selectboxit-optgroup-header {
114
+ text-indent: 5px; /* Horizontal Positioning of the select box option text */
115
+ margin: 0;
116
+ list-style-type: none;
117
+ }
118
+
119
+ /* The first Drop Down option */
120
+ .selectboxit-option-first {
121
+ border-top-right-radius: 6px;
122
+ border-top-left-radius: 6px;
123
+ }
124
+
125
+ /* The first Drop Down option optgroup */
126
+ .selectboxit-optgroup-header + .selectboxit-option-first {
127
+ border-top-right-radius: 0px;
128
+ border-top-left-radius: 0px;
129
+ }
130
+
131
+ /* The last Drop Down option */
132
+ .selectboxit-option-last {
133
+ border-bottom-right-radius: 6px;
134
+ border-bottom-left-radius: 6px;
135
+ }
136
+
137
+ /* Drop Down optgroup headers */
138
+ .selectboxit-optgroup-header {
139
+ font-weight: bold;
140
+ }
141
+
142
+ /* Drop Down optgroup header hover psuedo class */
143
+ .selectboxit-optgroup-header:hover {
144
+ cursor: default;
145
+ }
146
+
147
+ /* Drop Down down arrow container */
148
+ .selectboxit-arrow-container {
149
+ /* Positions the down arrow */
150
+ width: 30px;
151
+ position: absolute;
152
+ right: 0;
153
+ }
154
+
155
+ /* Drop Down down arrow */
156
+ .selectboxit .selectboxit-arrow-container .selectboxit-arrow {
157
+ /* Horizontally centers the down arrow */
158
+ margin: 0 auto;
159
+ position: absolute;
160
+ top: 50%;
161
+ right: 0;
162
+ left: 0;
163
+ }
164
+
165
+ /* Drop Down down arrow for jQueryUI and jQuery Mobile */
166
+ .selectboxit .selectboxit-arrow-container .selectboxit-arrow.ui-icon {
167
+ top: 30%;
168
+ }
169
+
170
+ /* Drop Down individual option icon positioning */
171
+ .selectboxit-option-icon-container {
172
+ float: left;
173
+ }
174
+
175
+ .selectboxit-container .selectboxit-option-icon {
176
+ margin: 0;
177
+ padding: 0;
178
+ vertical-align: middle;
179
+ }
180
+
181
+ /* Drop Down individual option icon positioning */
182
+ .selectboxit-option-icon-url {
183
+ width: 18px;
184
+ background-size: 18px 18px;
185
+ background-repeat: no-repeat;
186
+ height: 100%;
187
+ background-position: center;
188
+ float: left;
189
+ }
190
+
191
+ .selectboxit-rendering {
192
+ display: inline-block !important;
193
+ *display: inline !important;
194
+ zoom: 1 !important;
195
+ visibility: visible !important;
196
+ position: absolute !important;
197
+ top: -9999px !important;
198
+ left: -9999px !important;
199
+ }
200
+
201
+ /* jQueryUI and jQuery Mobile compatability fix - Feel free to remove this style if you are not using jQuery Mobile */
202
+ .jqueryui .ui-icon {
203
+ background-color: inherit;
204
+ }
205
+
206
+ /* Another jQueryUI and jQuery Mobile compatability fix - Feel free to remove this style if you are not using jQuery Mobile */
207
+ .jqueryui .ui-icon-triangle-1-s {
208
+ background-position: -64px -16px;
209
+ }
210
+
211
+ /*
212
+ Default Theme
213
+ -------------
214
+ Note: Feel free to remove all of the CSS underneath this line if you are not using the default theme
215
+ */
216
+ .selectboxit-btn {
217
+ background-color: #f5f5f5;
218
+ background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
219
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
220
+ background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
221
+ background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
222
+ background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
223
+ background-repeat: repeat-x;
224
+ border: 1px solid #cccccc;
225
+ border-color: #e6e6e6 #e6e6e6 #bfbfbf;
226
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
227
+ border-bottom-color: #b3b3b3;
228
+ }
229
+
230
+ .selectboxit-btn.selectboxit-enabled:hover,
231
+ .selectboxit-btn.selectboxit-enabled:focus,
232
+ .selectboxit-btn.selectboxit-enabled:active {
233
+ color: #333333;
234
+ background-color: #e6e6e6;
235
+ }
236
+
237
+ .selectboxit-btn.selectboxit-enabled:hover,
238
+ .selectboxit-btn.selectboxit-enabled:focus {
239
+ color: #333333;
240
+ text-decoration: none;
241
+ background-position: 0 -15px;
242
+ }
243
+
244
+ .selectboxit-default-arrow {
245
+ width: 0;
246
+ height: 0;
247
+ border-top: 4px solid #000000;
248
+ border-right: 4px solid transparent;
249
+ border-left: 4px solid transparent;
250
+ }
251
+
252
+ .selectboxit-list {
253
+ background-color: #ffffff;
254
+ border: 1px solid #ccc;
255
+ border: 1px solid rgba(0, 0, 0, 0.2);
256
+ -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
257
+ -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
258
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
259
+ }
260
+
261
+ .selectboxit-list .selectboxit-option-anchor {
262
+ color: #333333;
263
+ }
264
+
265
+ .selectboxit-list > .selectboxit-focus > .selectboxit-option-anchor {
266
+ color: #ffffff;
267
+ background-color: #0081c2;
268
+ background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
269
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
270
+ background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
271
+ background-image: -o-linear-gradient(top, #0088cc, #0077b3);
272
+ background-image: linear-gradient(to bottom, #0088cc, #0077b3);
273
+ background-repeat: repeat-x;
274
+ }
275
+
276
+ .selectboxit-list > .selectboxit-disabled > .selectboxit-option-anchor {
277
+ color: #999999;
278
+ }
@@ -0,0 +1,6 @@
1
+ require "selectBoxIt/version"
2
+ require "selectBoxIt/engine"
3
+
4
+ module SelectBoxIt
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,4 @@
1
+ module SelectBoxIt
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module SelectBoxIt
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'selectBoxIt/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "selectBoxIt"
8
+ spec.version = SelectBoxIt::VERSION
9
+ spec.authors = ["Pouya Gharib Pour"]
10
+ spec.email = ["p.gharibpour@gmail.com"]
11
+ spec.summary = %q{selectBoxIt JS library.}
12
+ spec.description = %q{This gem adds selectBoxIt JS to your rails project.}
13
+ spec.homepage = "https://github.com/psparabara/selectBoxIt"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: selectBoxIt
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pouya Gharib Pour
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: This gem adds selectBoxIt JS to your rails project.
42
+ email:
43
+ - p.gharibpour@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - app/assets/javascripts/selectBoxIt/jquery.selectBoxIt.js
54
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.add.js
55
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.ariaAccessibility.js
56
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.copyAttributes.js
57
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.core.js
58
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.destroy.js
59
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.disable.js
60
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.dynamicPositioning.js
61
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.enable.js
62
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.endClosure.js
63
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.keyboardNavigation.js
64
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.keyboardSearch.js
65
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.mobile.js
66
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.remove.js
67
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.selectOption.js
68
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.setOption.js
69
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.setOptions.js
70
+ - app/assets/javascripts/selectBoxIt/modules/jquery.selectBoxIt.wait.js
71
+ - app/assets/stylesheets/selectBoxIt/jquery.selectBoxIt.css
72
+ - lib/selectBoxIt.rb
73
+ - lib/selectBoxIt/engine.rb
74
+ - lib/selectBoxIt/version.rb
75
+ - selectBoxIt.gemspec
76
+ homepage: https://github.com/psparabara/selectBoxIt
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.5.1
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: selectBoxIt JS library.
100
+ test_files: []