icheck-rails 0.9.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +4 -0
  3. data/README.md +96 -0
  4. data/Rakefile +38 -0
  5. data/lib/icheck-rails.rb +2 -0
  6. data/lib/icheck/rails/engine.rb +8 -0
  7. data/lib/icheck/rails/version.rb +5 -0
  8. data/test/dummy/README.rdoc +261 -0
  9. data/test/dummy/Rakefile +7 -0
  10. data/test/dummy/app/assets/javascripts/application.js +15 -0
  11. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  12. data/test/dummy/app/controllers/application_controller.rb +3 -0
  13. data/test/dummy/app/helpers/application_helper.rb +2 -0
  14. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  15. data/test/dummy/config.ru +4 -0
  16. data/test/dummy/config/application.rb +59 -0
  17. data/test/dummy/config/boot.rb +10 -0
  18. data/test/dummy/config/database.yml +25 -0
  19. data/test/dummy/config/environment.rb +5 -0
  20. data/test/dummy/config/environments/development.rb +37 -0
  21. data/test/dummy/config/environments/production.rb +67 -0
  22. data/test/dummy/config/environments/test.rb +37 -0
  23. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  24. data/test/dummy/config/initializers/inflections.rb +15 -0
  25. data/test/dummy/config/initializers/mime_types.rb +5 -0
  26. data/test/dummy/config/initializers/secret_token.rb +7 -0
  27. data/test/dummy/config/initializers/session_store.rb +8 -0
  28. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  29. data/test/dummy/config/locales/en.yml +5 -0
  30. data/test/dummy/config/routes.rb +58 -0
  31. data/test/dummy/db/development.sqlite3 +0 -0
  32. data/test/dummy/db/schema.rb +16 -0
  33. data/test/dummy/db/test.sqlite3 +0 -0
  34. data/test/dummy/log/development.log +0 -0
  35. data/test/dummy/log/test.log +0 -0
  36. data/test/dummy/public/404.html +26 -0
  37. data/test/dummy/public/422.html +26 -0
  38. data/test/dummy/public/500.html +25 -0
  39. data/test/dummy/public/favicon.ico +0 -0
  40. data/test/dummy/script/rails +6 -0
  41. data/test/dummy/tmp/cache/assets/C49/860/sprockets%2Ff95ca6fa195a121539576516050f0442 +0 -0
  42. data/test/dummy/tmp/cache/assets/C9D/6A0/sprockets%2F4e5f511955e048e988945f98fa362d50 +0 -0
  43. data/test/dummy/tmp/cache/assets/CA6/AD0/sprockets%2F54996ad04dbd12db290577520c5700a8 +0 -0
  44. data/test/dummy/tmp/cache/assets/D38/750/sprockets%2Fc329f8e2db11af756248e0ad6641af14 +0 -0
  45. data/test/dummy/tmp/cache/assets/D47/4E0/sprockets%2Fe628b0a79f40ee32cde4ee70e1671786 +0 -0
  46. data/test/dummy/tmp/cache/assets/D64/5D0/sprockets%2F3239d9cc3226b6f515f4b30fbfc46ac0 +0 -0
  47. data/test/dummy/tmp/cache/assets/DCB/2C0/sprockets%2F88aac4e21c3d3e6cfa7b82d245362def +0 -0
  48. data/test/dummy/tmp/cache/assets/E3A/2E0/sprockets%2Fd64d85294b8d3da8cfb8cdb4ce7e1fa6 +0 -0
  49. data/test/integration/icheck_deployment_test.rb +15 -0
  50. data/test/test_helper.rb +12 -0
  51. data/vendor/assets/images/icheck/flat/aero.png +0 -0
  52. data/vendor/assets/images/icheck/flat/aero@2x.png +0 -0
  53. data/vendor/assets/images/icheck/flat/blue.png +0 -0
  54. data/vendor/assets/images/icheck/flat/blue@2x.png +0 -0
  55. data/vendor/assets/images/icheck/flat/flat.png +0 -0
  56. data/vendor/assets/images/icheck/flat/flat@2x.png +0 -0
  57. data/vendor/assets/images/icheck/flat/green.png +0 -0
  58. data/vendor/assets/images/icheck/flat/green@2x.png +0 -0
  59. data/vendor/assets/images/icheck/flat/grey.png +0 -0
  60. data/vendor/assets/images/icheck/flat/grey@2x.png +0 -0
  61. data/vendor/assets/images/icheck/flat/orange.png +0 -0
  62. data/vendor/assets/images/icheck/flat/orange@2x.png +0 -0
  63. data/vendor/assets/images/icheck/flat/pink.png +0 -0
  64. data/vendor/assets/images/icheck/flat/pink@2x.png +0 -0
  65. data/vendor/assets/images/icheck/flat/purple.png +0 -0
  66. data/vendor/assets/images/icheck/flat/purple@2x.png +0 -0
  67. data/vendor/assets/images/icheck/flat/red.png +0 -0
  68. data/vendor/assets/images/icheck/flat/red@2x.png +0 -0
  69. data/vendor/assets/images/icheck/flat/yellow.png +0 -0
  70. data/vendor/assets/images/icheck/flat/yellow@2x.png +0 -0
  71. data/vendor/assets/images/icheck/futurico/futurico.png +0 -0
  72. data/vendor/assets/images/icheck/futurico/futurico@2x.png +0 -0
  73. data/vendor/assets/images/icheck/line/line.png +0 -0
  74. data/vendor/assets/images/icheck/line/line@2x.png +0 -0
  75. data/vendor/assets/images/icheck/minimal/aero.png +0 -0
  76. data/vendor/assets/images/icheck/minimal/aero@2x.png +0 -0
  77. data/vendor/assets/images/icheck/minimal/blue.png +0 -0
  78. data/vendor/assets/images/icheck/minimal/blue@2x.png +0 -0
  79. data/vendor/assets/images/icheck/minimal/green.png +0 -0
  80. data/vendor/assets/images/icheck/minimal/green@2x.png +0 -0
  81. data/vendor/assets/images/icheck/minimal/grey.png +0 -0
  82. data/vendor/assets/images/icheck/minimal/grey@2x.png +0 -0
  83. data/vendor/assets/images/icheck/minimal/minimal.png +0 -0
  84. data/vendor/assets/images/icheck/minimal/minimal@2x.png +0 -0
  85. data/vendor/assets/images/icheck/minimal/orange.png +0 -0
  86. data/vendor/assets/images/icheck/minimal/orange@2x.png +0 -0
  87. data/vendor/assets/images/icheck/minimal/pink.png +0 -0
  88. data/vendor/assets/images/icheck/minimal/pink@2x.png +0 -0
  89. data/vendor/assets/images/icheck/minimal/purple.png +0 -0
  90. data/vendor/assets/images/icheck/minimal/purple@2x.png +0 -0
  91. data/vendor/assets/images/icheck/minimal/red.png +0 -0
  92. data/vendor/assets/images/icheck/minimal/red@2x.png +0 -0
  93. data/vendor/assets/images/icheck/minimal/yellow.png +0 -0
  94. data/vendor/assets/images/icheck/minimal/yellow@2x.png +0 -0
  95. data/vendor/assets/images/icheck/polaris/polaris.png +0 -0
  96. data/vendor/assets/images/icheck/polaris/polaris@2x.png +0 -0
  97. data/vendor/assets/images/icheck/square/aero.png +0 -0
  98. data/vendor/assets/images/icheck/square/aero@2x.png +0 -0
  99. data/vendor/assets/images/icheck/square/blue.png +0 -0
  100. data/vendor/assets/images/icheck/square/blue@2x.png +0 -0
  101. data/vendor/assets/images/icheck/square/green.png +0 -0
  102. data/vendor/assets/images/icheck/square/green@2x.png +0 -0
  103. data/vendor/assets/images/icheck/square/grey.png +0 -0
  104. data/vendor/assets/images/icheck/square/grey@2x.png +0 -0
  105. data/vendor/assets/images/icheck/square/orange.png +0 -0
  106. data/vendor/assets/images/icheck/square/orange@2x.png +0 -0
  107. data/vendor/assets/images/icheck/square/pink.png +0 -0
  108. data/vendor/assets/images/icheck/square/pink@2x.png +0 -0
  109. data/vendor/assets/images/icheck/square/purple.png +0 -0
  110. data/vendor/assets/images/icheck/square/purple@2x.png +0 -0
  111. data/vendor/assets/images/icheck/square/red.png +0 -0
  112. data/vendor/assets/images/icheck/square/red@2x.png +0 -0
  113. data/vendor/assets/images/icheck/square/square.png +0 -0
  114. data/vendor/assets/images/icheck/square/square@2x.png +0 -0
  115. data/vendor/assets/images/icheck/square/yellow.png +0 -0
  116. data/vendor/assets/images/icheck/square/yellow@2x.png +0 -0
  117. data/vendor/assets/javascripts/jquery.icheck.js +397 -0
  118. data/vendor/assets/javascripts/zepto.icheck.js +402 -0
  119. data/vendor/assets/stylesheets/icheck/flat/_all.css +540 -0
  120. data/vendor/assets/stylesheets/icheck/flat/aero.css +54 -0
  121. data/vendor/assets/stylesheets/icheck/flat/blue.css +54 -0
  122. data/vendor/assets/stylesheets/icheck/flat/flat.css +54 -0
  123. data/vendor/assets/stylesheets/icheck/flat/green.css +54 -0
  124. data/vendor/assets/stylesheets/icheck/flat/grey.css +54 -0
  125. data/vendor/assets/stylesheets/icheck/flat/orange.css +54 -0
  126. data/vendor/assets/stylesheets/icheck/flat/pink.css +54 -0
  127. data/vendor/assets/stylesheets/icheck/flat/purple.css +54 -0
  128. data/vendor/assets/stylesheets/icheck/flat/red.css +54 -0
  129. data/vendor/assets/stylesheets/icheck/flat/yellow.css +54 -0
  130. data/vendor/assets/stylesheets/icheck/futurico/futurico.css +54 -0
  131. data/vendor/assets/stylesheets/icheck/line/_all.css +740 -0
  132. data/vendor/assets/stylesheets/icheck/line/aero.css +74 -0
  133. data/vendor/assets/stylesheets/icheck/line/blue.css +74 -0
  134. data/vendor/assets/stylesheets/icheck/line/green.css +74 -0
  135. data/vendor/assets/stylesheets/icheck/line/grey.css +74 -0
  136. data/vendor/assets/stylesheets/icheck/line/line.css +74 -0
  137. data/vendor/assets/stylesheets/icheck/line/orange.css +74 -0
  138. data/vendor/assets/stylesheets/icheck/line/pink.css +74 -0
  139. data/vendor/assets/stylesheets/icheck/line/purple.css +74 -0
  140. data/vendor/assets/stylesheets/icheck/line/red.css +74 -0
  141. data/vendor/assets/stylesheets/icheck/line/yellow.css +74 -0
  142. data/vendor/assets/stylesheets/icheck/minimal/_all.css +600 -0
  143. data/vendor/assets/stylesheets/icheck/minimal/aero.css +60 -0
  144. data/vendor/assets/stylesheets/icheck/minimal/blue.css +60 -0
  145. data/vendor/assets/stylesheets/icheck/minimal/green.css +60 -0
  146. data/vendor/assets/stylesheets/icheck/minimal/grey.css +60 -0
  147. data/vendor/assets/stylesheets/icheck/minimal/minimal.css +60 -0
  148. data/vendor/assets/stylesheets/icheck/minimal/orange.css +60 -0
  149. data/vendor/assets/stylesheets/icheck/minimal/pink.css +60 -0
  150. data/vendor/assets/stylesheets/icheck/minimal/purple.css +60 -0
  151. data/vendor/assets/stylesheets/icheck/minimal/red.css +60 -0
  152. data/vendor/assets/stylesheets/icheck/minimal/yellow.css +60 -0
  153. data/vendor/assets/stylesheets/icheck/polaris/polaris.css +60 -0
  154. data/vendor/assets/stylesheets/icheck/square/_all.css +600 -0
  155. data/vendor/assets/stylesheets/icheck/square/aero.css +60 -0
  156. data/vendor/assets/stylesheets/icheck/square/blue.css +60 -0
  157. data/vendor/assets/stylesheets/icheck/square/green.css +60 -0
  158. data/vendor/assets/stylesheets/icheck/square/grey.css +60 -0
  159. data/vendor/assets/stylesheets/icheck/square/orange.css +60 -0
  160. data/vendor/assets/stylesheets/icheck/square/pink.css +60 -0
  161. data/vendor/assets/stylesheets/icheck/square/purple.css +60 -0
  162. data/vendor/assets/stylesheets/icheck/square/red.css +60 -0
  163. data/vendor/assets/stylesheets/icheck/square/square.css +60 -0
  164. data/vendor/assets/stylesheets/icheck/square/yellow.css +60 -0
  165. metadata +319 -0
@@ -0,0 +1,402 @@
1
+ /*!
2
+ * iCheck v0.9, http://git.io/uhUPMA
3
+ * =================================
4
+ * Powerful Zepto plugin for checkboxes and radio buttons customization
5
+ *
6
+ * (c) 2013 Damir Foy, http://damirfoy.com
7
+ * MIT Licensed
8
+ */
9
+
10
+ (function($, _iCheck, _checkbox, _radio, _checked, _disabled, _type, _click, _touch, _add, _remove, _cursor) {
11
+
12
+ // Create a plugin
13
+ $.fn[_iCheck] = function(options, fire) {
14
+
15
+ // Cached vars
16
+ var user = navigator.userAgent,
17
+ mobile = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini/i.test(user),
18
+ handle = 'input[type="' + _checkbox + '"], input[type="' + _radio + '"]',
19
+ stack = $(),
20
+ walker = function(object) {
21
+ object.each(function() {
22
+ var self = $(this);
23
+
24
+ if (self.is(handle)) {
25
+ stack = stack.add(self);
26
+ } else {
27
+ stack = stack.add(self.find(handle));
28
+ };
29
+ });
30
+ };
31
+
32
+ // Check if we should operate with some method
33
+ if (/^(check|uncheck|toggle|disable|enable|update|destroy)$/.test(options)) {
34
+
35
+ // Find checkboxes and radio buttons
36
+ walker(this);
37
+
38
+ return stack.each(function() {
39
+ var self = $(this);
40
+
41
+ if (options == 'destroy') {
42
+ tidy(self, 'ifDestroyed');
43
+ } else {
44
+ operate(self, true, options);
45
+ };
46
+
47
+ // Fire method's callback
48
+ if ($.isFunction(fire)) {
49
+ fire();
50
+ };
51
+ });
52
+
53
+ // Customization
54
+ } else if (typeof options == 'object' || !options) {
55
+
56
+ // Check if any options were passed
57
+ var settings = $.extend({
58
+ checkedClass: _checked,
59
+ disabledClass: _disabled,
60
+ labelHover: true
61
+ }, options),
62
+
63
+ selector = settings.handle,
64
+ hoverClass = settings.hoverClass || 'hover',
65
+ focusClass = settings.focusClass || 'focus',
66
+ activeClass = settings.activeClass || 'active',
67
+ labelHover = !!settings.labelHover,
68
+ labelHoverClass = settings.labelHoverClass || 'hover',
69
+
70
+ // Setup clickable area
71
+ area = ('' + settings.increaseArea).replace('%', '') | 0;
72
+
73
+ // Selector limit
74
+ if (selector == _checkbox || selector == _radio) {
75
+ handle = 'input[type="' + selector + '"]';
76
+ };
77
+
78
+ // Clickable area limit
79
+ if (area < -50) {
80
+ area = -50;
81
+ };
82
+
83
+ // Walk around the selector
84
+ walker(this);
85
+
86
+ return stack.each(function() {
87
+ var self = $(this);
88
+
89
+ // If already customized
90
+ tidy(self);
91
+
92
+ var node = this,
93
+ id = node.id,
94
+
95
+ // Layer styles
96
+ offset = -area + '%',
97
+ size = 100 + (area * 2) + '%',
98
+ layer = {
99
+ position: 'absolute',
100
+ top: offset,
101
+ left: offset,
102
+ display: 'block',
103
+ width: size,
104
+ height: size,
105
+ margin: 0,
106
+ padding: 0,
107
+ background: '#fff',
108
+ border: 0,
109
+ opacity: 0
110
+ },
111
+
112
+ // Choose how to hide input
113
+ hide = mobile ? {
114
+ position: 'absolute',
115
+ visibility: 'hidden'
116
+ } : area ? layer : {
117
+ position: 'absolute',
118
+ opacity: 0
119
+ },
120
+
121
+ // Get proper class
122
+ className = node[_type] == _checkbox ? settings.checkboxClass || 'i' + _checkbox : settings.radioClass || 'i' + _radio,
123
+
124
+ // Find assigned labels
125
+ label = $('label[for="' + id + '"]').add(self.closest('label')),
126
+
127
+ // Wrap input
128
+ parent = self.wrap('<div class="' + className + '"/>').trigger('ifCreated').parent().append(settings.insert),
129
+
130
+ // Layer addition
131
+ helper = $('<ins class="' + _iCheck + '-helper"/>').css(layer).appendTo(parent);
132
+
133
+ // Finalize customization
134
+ self.data(_iCheck, {o: settings, s: self.attr('style')}).css(hide);
135
+ !!settings.inheritClass && parent[_add](node.className || '');
136
+ !!settings.inheritID && id && parent.attr('id', _iCheck + '-' + id);
137
+ parent.css('position') == 'static' && parent.css('position', 'relative');
138
+ operate(self, true, 'update');
139
+
140
+ // Label events
141
+ if (label.length) {
142
+ label.on(_click + '.i mouseover.i mouseout.i ' + _touch, function(event) {
143
+ var type = event[_type],
144
+ item = $(this);
145
+
146
+ // Do nothing if input is disabled
147
+ if (!node[_disabled]) {
148
+
149
+ // Click
150
+ if (type == _click) {
151
+ operate(self, false, true);
152
+
153
+ // Hover state
154
+ } else if (labelHover) {
155
+ if (/ut|nd/.test(type)) {
156
+ // mouseout|touchend
157
+ parent[_remove](hoverClass);
158
+ item[_remove](labelHoverClass);
159
+ } else {
160
+ parent[_add](hoverClass);
161
+ item[_add](labelHoverClass);
162
+ };
163
+ };
164
+
165
+ if (mobile) {
166
+ event.stopPropagation();
167
+ } else {
168
+ return false;
169
+ };
170
+ };
171
+ });
172
+ };
173
+
174
+ // Input events
175
+ self.on(_click + '.i focus.i blur.i keyup.i keydown.i keypress.i', function(event) {
176
+ var type = event[_type],
177
+ key = event.keyCode;
178
+
179
+ // Click
180
+ if (type == _click) {
181
+ return false;
182
+
183
+ // Keydown
184
+ } else if (type == 'keydown' && key == 32) {
185
+ if (!(node[_type] == _radio && node[_checked])) {
186
+ if (node[_checked]) {
187
+ off(self, _checked);
188
+ } else {
189
+ on(self, _checked);
190
+ };
191
+ };
192
+
193
+ return false;
194
+
195
+ // Keyup
196
+ } else if (type == 'keyup' && node[_type] == _radio) {
197
+ !node[_checked] && on(self, _checked);
198
+
199
+ // Focus/blur
200
+ } else if (/us|ur/.test(type)) {
201
+ parent[type == 'blur' ? _remove : _add](focusClass);
202
+ };
203
+ });
204
+
205
+ // Helper events
206
+ helper.on(_click + ' mousedown mouseup mouseover mouseout ' + _touch, function(event) {
207
+ var type = event[_type],
208
+
209
+ // mousedown|mouseup
210
+ toggle = /wn|up/.test(type) ? activeClass : hoverClass;
211
+
212
+ // Do nothing if input is disabled
213
+ if (!node[_disabled]) {
214
+
215
+ // Click
216
+ if (type == _click) {
217
+ operate(self, false, true);
218
+
219
+ // Active and hover states
220
+ } else {
221
+
222
+ // State is on
223
+ if (/wn|er|in/.test(type)) {
224
+ // mousedown|mouseover|touchbegin
225
+ parent[_add](toggle);
226
+
227
+ // State is off
228
+ } else {
229
+ parent[_remove](toggle + ' ' + activeClass);
230
+ };
231
+
232
+ // Label hover
233
+ if (label.length && labelHover && toggle == hoverClass) {
234
+
235
+ // mouseout|touchend
236
+ label[/ut|nd/.test(type) ? _remove : _add](labelHoverClass);
237
+ };
238
+ };
239
+
240
+ if (mobile) {
241
+ event.stopPropagation();
242
+ } else {
243
+ return false;
244
+ };
245
+ };
246
+ });
247
+ });
248
+ } else {
249
+ return this;
250
+ };
251
+ };
252
+
253
+ // Do something with inputs
254
+ function operate(input, direct, method) {
255
+ var node = input[0];
256
+
257
+ // disable|enable
258
+ state = /ble/.test(method) ? _disabled : _checked,
259
+ active = method == 'update' ? {checked: node[_checked], disabled: node[_disabled]} : node[state];
260
+
261
+ // Check and disable
262
+ if (/^ch|di/.test(method) && !active) {
263
+ on(input, state);
264
+
265
+ // Uncheck and enable
266
+ } else if (/^un|en/.test(method) && active) {
267
+ off(input, state);
268
+
269
+ // Update
270
+ } else if (method == 'update') {
271
+
272
+ // Both checked and disabled states
273
+ for (var state in active) {
274
+ if (active[state]) {
275
+ on(input, state, true);
276
+ } else {
277
+ off(input, state, true);
278
+ };
279
+ };
280
+
281
+ } else if (!direct || method == 'toggle') {
282
+
283
+ // Helper or label was clicked
284
+ if (!direct) {
285
+ input.trigger('ifClicked');
286
+ };
287
+
288
+ // Toggle checked state
289
+ if (active) {
290
+ if (node[_type] !== _radio) {
291
+ off(input, state);
292
+ };
293
+ } else {
294
+ on(input, state);
295
+ };
296
+ };
297
+ };
298
+
299
+ // Set checked or disabled state
300
+ function on(input, state, keep) {
301
+ var node = input[0],
302
+ parent = input.parent(),
303
+ remove = state == _disabled ? 'enabled' : 'un' + _checked,
304
+ regular = option(input, remove + capitalize(node[_type])),
305
+ specific = option(input, state + capitalize(node[_type]));
306
+
307
+ // Prevent unnecessary actions
308
+ if (node[state] !== true && !keep) {
309
+
310
+ // Toggle state
311
+ node[state] = true;
312
+
313
+ // Trigger callbacks
314
+ input.trigger('ifChanged').trigger('if' + capitalize(state));
315
+
316
+ // Toggle assigned radio buttons
317
+ if (state == _checked && node[_type] == _radio && node.name) {
318
+ var form = input.closest('form'),
319
+ stack = 'input[name="' + node.name + '"]';
320
+
321
+ stack = form.length ? form.find(stack) : $(stack);
322
+
323
+ stack.each(function() {
324
+ if (this !== node && $(this).data(_iCheck)) {
325
+ off($(this), state);
326
+ };
327
+ });
328
+ };
329
+ };
330
+
331
+ // Add proper cursor
332
+ if (node[_disabled] && !!option(input, _cursor, true)) {
333
+ parent.find('.' + _iCheck + '-helper').css(_cursor, 'default');
334
+ };
335
+
336
+ // Add state class
337
+ parent[_add](specific || option(input, state) || '');
338
+
339
+ // Remove regular state class
340
+ parent[_remove](regular || option(input, remove) || '');
341
+ };
342
+
343
+ // Remove checked or disabled state
344
+ function off(input, state, keep) {
345
+ var node = input[0],
346
+ parent = input.parent(),
347
+ callback = state == _disabled ? 'enabled' : 'un' + _checked,
348
+ regular = option(input, callback + capitalize(node[_type])),
349
+ specific = option(input, state + capitalize(node[_type]));
350
+
351
+ // Prevent unnecessary actions
352
+ if (node[state] !== false && !keep) {
353
+
354
+ // Toggle state
355
+ node[state] = false;
356
+
357
+ // Trigger callbacks
358
+ input.trigger('ifChanged').trigger('if' + capitalize(callback));
359
+ };
360
+
361
+ // Add proper cursor
362
+ if (!node[_disabled] && !!option(input, _cursor, true)) {
363
+ parent.find('.' + _iCheck + '-helper').css(_cursor, 'pointer');
364
+ };
365
+
366
+ // Remove state class
367
+ parent[_remove](specific || option(input, state) || '');
368
+
369
+ // Add regular state class
370
+ parent[_add](regular || option(input, callback) || '');
371
+ };
372
+
373
+ // Remove all traces of iCheck
374
+ function tidy(input, callback) {
375
+ if (input.data(_iCheck)) {
376
+
377
+ // Remove everything except input
378
+ input.parent().html(input.attr('style', input.data(_iCheck).s || ''));
379
+
380
+ // Callback
381
+ if (callback) {
382
+ input.trigger(callback);
383
+ };
384
+
385
+ // Unbind events
386
+ input.off('.i').unwrap();
387
+ $('label[for="' + input[0].id + '"]').add(input.closest('label')).off('.i');
388
+ };
389
+ };
390
+
391
+ // Get some option
392
+ function option(input, state, regular) {
393
+ if (input.data(_iCheck)) {
394
+ return input.data(_iCheck).o[state + (regular ? '' : 'Class')];
395
+ };
396
+ };
397
+
398
+ // Capitalize some string
399
+ function capitalize(string) {
400
+ return string.charAt(0).toUpperCase() + string.slice(1);
401
+ };
402
+ })(Zepto, 'iCheck', 'checkbox', 'radio', 'checked', 'disabled', 'type', 'click', 'touchbegin.i touchend.i', 'addClass', 'removeClass', 'cursor');
@@ -0,0 +1,540 @@
1
+ /* iCheck plugin Flat skin
2
+ ----------------------------------- */
3
+ .icheckbox_flat,
4
+ .iradio_flat {
5
+ display: block;
6
+ margin: 0;
7
+ padding: 0;
8
+ width: 20px;
9
+ height: 20px;
10
+ background: url(/assets/icheck/flat/flat.png) no-repeat;
11
+ border: none;
12
+ cursor: pointer;
13
+ }
14
+
15
+ .icheckbox_flat {
16
+ background-position: 0 0;
17
+ }
18
+ .icheckbox_flat.checked {
19
+ background-position: -22px 0;
20
+ }
21
+ .icheckbox_flat.disabled {
22
+ background-position: -44px 0;
23
+ cursor: default;
24
+ }
25
+ .icheckbox_flat.checked.disabled {
26
+ background-position: -66px 0;
27
+ }
28
+
29
+ .iradio_flat {
30
+ background-position: -88px 0;
31
+ }
32
+ .iradio_flat.checked {
33
+ background-position: -110px 0;
34
+ }
35
+ .iradio_flat.disabled {
36
+ background-position: -132px 0;
37
+ cursor: default;
38
+ }
39
+ .iradio_flat.checked.disabled {
40
+ background-position: -154px 0;
41
+ }
42
+
43
+ /* Retina support */
44
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
45
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
46
+ only screen and (-o-min-device-pixel-ratio: 3/2),
47
+ only screen and (min-device-pixel-ratio: 1.5) {
48
+ .icheckbox_flat,
49
+ .iradio_flat {
50
+ background-image: url(/assets/icheck/flat/flat@2x.png);
51
+ -webkit-background-size: 176px 22px;
52
+ background-size: 176px 22px;
53
+ }
54
+ }
55
+
56
+ /* red */
57
+ .icheckbox_flat-red,
58
+ .iradio_flat-red {
59
+ display: block;
60
+ margin: 0;
61
+ padding: 0;
62
+ width: 20px;
63
+ height: 20px;
64
+ background: url(/assets/icheck/flat/red.png) no-repeat;
65
+ border: none;
66
+ cursor: pointer;
67
+ }
68
+
69
+ .icheckbox_flat-red {
70
+ background-position: 0 0;
71
+ }
72
+ .icheckbox_flat-red.checked {
73
+ background-position: -22px 0;
74
+ }
75
+ .icheckbox_flat-red.disabled {
76
+ background-position: -44px 0;
77
+ cursor: default;
78
+ }
79
+ .icheckbox_flat-red.checked.disabled {
80
+ background-position: -66px 0;
81
+ }
82
+
83
+ .iradio_flat-red {
84
+ background-position: -88px 0;
85
+ }
86
+ .iradio_flat-red.checked {
87
+ background-position: -110px 0;
88
+ }
89
+ .iradio_flat-red.disabled {
90
+ background-position: -132px 0;
91
+ cursor: default;
92
+ }
93
+ .iradio_flat-red.checked.disabled {
94
+ background-position: -154px 0;
95
+ }
96
+
97
+ /* Retina support */
98
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
99
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
100
+ only screen and (-o-min-device-pixel-ratio: 3/2),
101
+ only screen and (min-device-pixel-ratio: 1.5) {
102
+ .icheckbox_flat-red,
103
+ .iradio_flat-red {
104
+ background-image: url(/assets/icheck/flat/red@2x.png);
105
+ -webkit-background-size: 176px 22px;
106
+ background-size: 176px 22px;
107
+ }
108
+ }
109
+
110
+ /* green */
111
+ .icheckbox_flat-green,
112
+ .iradio_flat-green {
113
+ display: block;
114
+ margin: 0;
115
+ padding: 0;
116
+ width: 20px;
117
+ height: 20px;
118
+ background: url(/assets/icheck/flat/green.png) no-repeat;
119
+ border: none;
120
+ cursor: pointer;
121
+ }
122
+
123
+ .icheckbox_flat-green {
124
+ background-position: 0 0;
125
+ }
126
+ .icheckbox_flat-green.checked {
127
+ background-position: -22px 0;
128
+ }
129
+ .icheckbox_flat-green.disabled {
130
+ background-position: -44px 0;
131
+ cursor: default;
132
+ }
133
+ .icheckbox_flat-green.checked.disabled {
134
+ background-position: -66px 0;
135
+ }
136
+
137
+ .iradio_flat-green {
138
+ background-position: -88px 0;
139
+ }
140
+ .iradio_flat-green.checked {
141
+ background-position: -110px 0;
142
+ }
143
+ .iradio_flat-green.disabled {
144
+ background-position: -132px 0;
145
+ cursor: default;
146
+ }
147
+ .iradio_flat-green.checked.disabled {
148
+ background-position: -154px 0;
149
+ }
150
+
151
+ /* Retina support */
152
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
153
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
154
+ only screen and (-o-min-device-pixel-ratio: 3/2),
155
+ only screen and (min-device-pixel-ratio: 1.5) {
156
+ .icheckbox_flat-green,
157
+ .iradio_flat-green {
158
+ background-image: url(/assets/icheck/flat/green@2x.png);
159
+ -webkit-background-size: 176px 22px;
160
+ background-size: 176px 22px;
161
+ }
162
+ }
163
+
164
+ /* blue */
165
+ .icheckbox_flat-blue,
166
+ .iradio_flat-blue {
167
+ display: block;
168
+ margin: 0;
169
+ padding: 0;
170
+ width: 20px;
171
+ height: 20px;
172
+ background: url(/assets/icheck/flat/blue.png) no-repeat;
173
+ border: none;
174
+ cursor: pointer;
175
+ }
176
+
177
+ .icheckbox_flat-blue {
178
+ background-position: 0 0;
179
+ }
180
+ .icheckbox_flat-blue.checked {
181
+ background-position: -22px 0;
182
+ }
183
+ .icheckbox_flat-blue.disabled {
184
+ background-position: -44px 0;
185
+ cursor: default;
186
+ }
187
+ .icheckbox_flat-blue.checked.disabled {
188
+ background-position: -66px 0;
189
+ }
190
+
191
+ .iradio_flat-blue {
192
+ background-position: -88px 0;
193
+ }
194
+ .iradio_flat-blue.checked {
195
+ background-position: -110px 0;
196
+ }
197
+ .iradio_flat-blue.disabled {
198
+ background-position: -132px 0;
199
+ cursor: default;
200
+ }
201
+ .iradio_flat-blue.checked.disabled {
202
+ background-position: -154px 0;
203
+ }
204
+
205
+ /* Retina support */
206
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
207
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
208
+ only screen and (-o-min-device-pixel-ratio: 3/2),
209
+ only screen and (min-device-pixel-ratio: 1.5) {
210
+ .icheckbox_flat-blue,
211
+ .iradio_flat-blue {
212
+ background-image: url(/assets/icheck/flat/blue@2x.png);
213
+ -webkit-background-size: 176px 22px;
214
+ background-size: 176px 22px;
215
+ }
216
+ }
217
+
218
+ /* aero */
219
+ .icheckbox_flat-aero,
220
+ .iradio_flat-aero {
221
+ display: block;
222
+ margin: 0;
223
+ padding: 0;
224
+ width: 20px;
225
+ height: 20px;
226
+ background: url(/assets/icheck/flat/aero.png) no-repeat;
227
+ border: none;
228
+ cursor: pointer;
229
+ }
230
+
231
+ .icheckbox_flat-aero {
232
+ background-position: 0 0;
233
+ }
234
+ .icheckbox_flat-aero.checked {
235
+ background-position: -22px 0;
236
+ }
237
+ .icheckbox_flat-aero.disabled {
238
+ background-position: -44px 0;
239
+ cursor: default;
240
+ }
241
+ .icheckbox_flat-aero.checked.disabled {
242
+ background-position: -66px 0;
243
+ }
244
+
245
+ .iradio_flat-aero {
246
+ background-position: -88px 0;
247
+ }
248
+ .iradio_flat-aero.checked {
249
+ background-position: -110px 0;
250
+ }
251
+ .iradio_flat-aero.disabled {
252
+ background-position: -132px 0;
253
+ cursor: default;
254
+ }
255
+ .iradio_flat-aero.checked.disabled {
256
+ background-position: -154px 0;
257
+ }
258
+
259
+ /* Retina support */
260
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
261
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
262
+ only screen and (-o-min-device-pixel-ratio: 3/2),
263
+ only screen and (min-device-pixel-ratio: 1.5) {
264
+ .icheckbox_flat-aero,
265
+ .iradio_flat-aero {
266
+ background-image: url(/assets/icheck/flat/aero@2x.png);
267
+ -webkit-background-size: 176px 22px;
268
+ background-size: 176px 22px;
269
+ }
270
+ }
271
+
272
+ /* grey */
273
+ .icheckbox_flat-grey,
274
+ .iradio_flat-grey {
275
+ display: block;
276
+ margin: 0;
277
+ padding: 0;
278
+ width: 20px;
279
+ height: 20px;
280
+ background: url(/assets/icheck/flat/grey.png) no-repeat;
281
+ border: none;
282
+ cursor: pointer;
283
+ }
284
+
285
+ .icheckbox_flat-grey {
286
+ background-position: 0 0;
287
+ }
288
+ .icheckbox_flat-grey.checked {
289
+ background-position: -22px 0;
290
+ }
291
+ .icheckbox_flat-grey.disabled {
292
+ background-position: -44px 0;
293
+ cursor: default;
294
+ }
295
+ .icheckbox_flat-grey.checked.disabled {
296
+ background-position: -66px 0;
297
+ }
298
+
299
+ .iradio_flat-grey {
300
+ background-position: -88px 0;
301
+ }
302
+ .iradio_flat-grey.checked {
303
+ background-position: -110px 0;
304
+ }
305
+ .iradio_flat-grey.disabled {
306
+ background-position: -132px 0;
307
+ cursor: default;
308
+ }
309
+ .iradio_flat-grey.checked.disabled {
310
+ background-position: -154px 0;
311
+ }
312
+
313
+ /* Retina support */
314
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
315
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
316
+ only screen and (-o-min-device-pixel-ratio: 3/2),
317
+ only screen and (min-device-pixel-ratio: 1.5) {
318
+ .icheckbox_flat-grey,
319
+ .iradio_flat-grey {
320
+ background-image: url(/assets/icheck/flat/grey@2x.png);
321
+ -webkit-background-size: 176px 22px;
322
+ background-size: 176px 22px;
323
+ }
324
+ }
325
+
326
+ /* orange */
327
+ .icheckbox_flat-orange,
328
+ .iradio_flat-orange {
329
+ display: block;
330
+ margin: 0;
331
+ padding: 0;
332
+ width: 20px;
333
+ height: 20px;
334
+ background: url(/assets/icheck/flat/orange.png) no-repeat;
335
+ border: none;
336
+ cursor: pointer;
337
+ }
338
+
339
+ .icheckbox_flat-orange {
340
+ background-position: 0 0;
341
+ }
342
+ .icheckbox_flat-orange.checked {
343
+ background-position: -22px 0;
344
+ }
345
+ .icheckbox_flat-orange.disabled {
346
+ background-position: -44px 0;
347
+ cursor: default;
348
+ }
349
+ .icheckbox_flat-orange.checked.disabled {
350
+ background-position: -66px 0;
351
+ }
352
+
353
+ .iradio_flat-orange {
354
+ background-position: -88px 0;
355
+ }
356
+ .iradio_flat-orange.checked {
357
+ background-position: -110px 0;
358
+ }
359
+ .iradio_flat-orange.disabled {
360
+ background-position: -132px 0;
361
+ cursor: default;
362
+ }
363
+ .iradio_flat-orange.checked.disabled {
364
+ background-position: -154px 0;
365
+ }
366
+
367
+ /* Retina support */
368
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
369
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
370
+ only screen and (-o-min-device-pixel-ratio: 3/2),
371
+ only screen and (min-device-pixel-ratio: 1.5) {
372
+ .icheckbox_flat-orange,
373
+ .iradio_flat-orange {
374
+ background-image: url(/assets/icheck/flat/orange@2x.png);
375
+ -webkit-background-size: 176px 22px;
376
+ background-size: 176px 22px;
377
+ }
378
+ }
379
+
380
+ /* yellow */
381
+ .icheckbox_flat-yellow,
382
+ .iradio_flat-yellow {
383
+ display: block;
384
+ margin: 0;
385
+ padding: 0;
386
+ width: 20px;
387
+ height: 20px;
388
+ background: url(/assets/icheck/flat/yellow.png) no-repeat;
389
+ border: none;
390
+ cursor: pointer;
391
+ }
392
+
393
+ .icheckbox_flat-yellow {
394
+ background-position: 0 0;
395
+ }
396
+ .icheckbox_flat-yellow.checked {
397
+ background-position: -22px 0;
398
+ }
399
+ .icheckbox_flat-yellow.disabled {
400
+ background-position: -44px 0;
401
+ cursor: default;
402
+ }
403
+ .icheckbox_flat-yellow.checked.disabled {
404
+ background-position: -66px 0;
405
+ }
406
+
407
+ .iradio_flat-yellow {
408
+ background-position: -88px 0;
409
+ }
410
+ .iradio_flat-yellow.checked {
411
+ background-position: -110px 0;
412
+ }
413
+ .iradio_flat-yellow.disabled {
414
+ background-position: -132px 0;
415
+ cursor: default;
416
+ }
417
+ .iradio_flat-yellow.checked.disabled {
418
+ background-position: -154px 0;
419
+ }
420
+
421
+ /* Retina support */
422
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
423
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
424
+ only screen and (-o-min-device-pixel-ratio: 3/2),
425
+ only screen and (min-device-pixel-ratio: 1.5) {
426
+ .icheckbox_flat-yellow,
427
+ .iradio_flat-yellow {
428
+ background-image: url(/assets/icheck/flat/yellow@2x.png);
429
+ -webkit-background-size: 176px 22px;
430
+ background-size: 176px 22px;
431
+ }
432
+ }
433
+
434
+ /* pink */
435
+ .icheckbox_flat-pink,
436
+ .iradio_flat-pink {
437
+ display: block;
438
+ margin: 0;
439
+ padding: 0;
440
+ width: 20px;
441
+ height: 20px;
442
+ background: url(/assets/icheck/flat/pink.png) no-repeat;
443
+ border: none;
444
+ cursor: pointer;
445
+ }
446
+
447
+ .icheckbox_flat-pink {
448
+ background-position: 0 0;
449
+ }
450
+ .icheckbox_flat-pink.checked {
451
+ background-position: -22px 0;
452
+ }
453
+ .icheckbox_flat-pink.disabled {
454
+ background-position: -44px 0;
455
+ cursor: default;
456
+ }
457
+ .icheckbox_flat-pink.checked.disabled {
458
+ background-position: -66px 0;
459
+ }
460
+
461
+ .iradio_flat-pink {
462
+ background-position: -88px 0;
463
+ }
464
+ .iradio_flat-pink.checked {
465
+ background-position: -110px 0;
466
+ }
467
+ .iradio_flat-pink.disabled {
468
+ background-position: -132px 0;
469
+ cursor: default;
470
+ }
471
+ .iradio_flat-pink.checked.disabled {
472
+ background-position: -154px 0;
473
+ }
474
+
475
+ /* Retina support */
476
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
477
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
478
+ only screen and (-o-min-device-pixel-ratio: 3/2),
479
+ only screen and (min-device-pixel-ratio: 1.5) {
480
+ .icheckbox_flat-pink,
481
+ .iradio_flat-pink {
482
+ background-image: url(/assets/icheck/flat/pink@2x.png);
483
+ -webkit-background-size: 176px 22px;
484
+ background-size: 176px 22px;
485
+ }
486
+ }
487
+
488
+ /* purple */
489
+ .icheckbox_flat-purple,
490
+ .iradio_flat-purple {
491
+ display: block;
492
+ margin: 0;
493
+ padding: 0;
494
+ width: 20px;
495
+ height: 20px;
496
+ background: url(/assets/icheck/flat/purple.png) no-repeat;
497
+ border: none;
498
+ cursor: pointer;
499
+ }
500
+
501
+ .icheckbox_flat-purple {
502
+ background-position: 0 0;
503
+ }
504
+ .icheckbox_flat-purple.checked {
505
+ background-position: -22px 0;
506
+ }
507
+ .icheckbox_flat-purple.disabled {
508
+ background-position: -44px 0;
509
+ cursor: default;
510
+ }
511
+ .icheckbox_flat-purple.checked.disabled {
512
+ background-position: -66px 0;
513
+ }
514
+
515
+ .iradio_flat-purple {
516
+ background-position: -88px 0;
517
+ }
518
+ .iradio_flat-purple.checked {
519
+ background-position: -110px 0;
520
+ }
521
+ .iradio_flat-purple.disabled {
522
+ background-position: -132px 0;
523
+ cursor: default;
524
+ }
525
+ .iradio_flat-purple.checked.disabled {
526
+ background-position: -154px 0;
527
+ }
528
+
529
+ /* Retina support */
530
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
531
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
532
+ only screen and (-o-min-device-pixel-ratio: 3/2),
533
+ only screen and (min-device-pixel-ratio: 1.5) {
534
+ .icheckbox_flat-purple,
535
+ .iradio_flat-purple {
536
+ background-image: url(/assets/icheck/flat/purple@2x.png);
537
+ -webkit-background-size: 176px 22px;
538
+ background-size: 176px 22px;
539
+ }
540
+ }