creative_tim 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 837cf7cf85278a70a63e9b67384ea4464537f2bd
4
- data.tar.gz: 7210a0943b9d36df9133a217d2e959cfa060e229
3
+ metadata.gz: d374832241a02c4397a6124f7becb0e94141a526
4
+ data.tar.gz: a46d2e6f6614d355e21fec13ff0938c5580ba78d
5
5
  SHA512:
6
- metadata.gz: f9d974b5a34822e5d8e55c7bacd1f4d0a3928bccf5ad1d91da09902393df89a4f0974ee8783e63ee24ec52fc5c163210478442355615fd457d601b01d537b482
7
- data.tar.gz: affcb9c0eee9888452247bdf6085afd1a270862d37d34a44f5b613e0a5597e6c97795e33dc6a34e6d714896d1e6d24db0f77b2a9b1ad53bdcf13efc03754be33
6
+ metadata.gz: cb1ffce2f89dca0117d6e0e0b589e63477bccb880a8d71c2d8f875b0a674b69593af8982b3f71896ecaf5a27a6c6286b7e5ea3087ef411efc16bcac33b1a7fa5
7
+ data.tar.gz: 9120b35ff777e77dfeee133c7b366a88c45bcf45fcfd7734036bf00d8f139b9658cc2bca7241f51432fffaf8e261efa7cf9663271255995936f0829e5b7cfeb7
@@ -1,6 +1,6 @@
1
1
  module CreativeTim
2
2
  MAJOR = 1
3
3
  MINOR = 0
4
- PATCH = 0
4
+ PATCH = 1
5
5
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
6
6
  end
@@ -1,248 +1,253 @@
1
- !function ($) {
1
+ function setupInputs() {
2
+ !function ($) {
2
3
 
3
- /* CHECKBOX PUBLIC CLASS DEFINITION
4
- * ============================== */
5
-
6
- var Checkbox = function (element, options) {
7
- this.init(element, options);
8
- }
4
+ /* CHECKBOX PUBLIC CLASS DEFINITION
5
+ * ============================== */
9
6
 
10
- Checkbox.prototype = {
7
+ var Checkbox = function (element, options) {
8
+ this.init(element, options);
9
+ }
10
+
11
+ Checkbox.prototype = {
12
+
13
+ constructor: Checkbox
14
+
15
+ , init: function (element, options) {
16
+ var $el = this.$element = $(element)
17
+
18
+ this.options = $.extend({}, $.fn.checkbox.defaults, options);
19
+ $el.before(this.options.template);
20
+ this.setState();
21
+ }
22
+
23
+ , setState: function () {
24
+ var $el = this.$element
25
+ , $parent = $el.closest('.checkbox');
26
+
27
+ $el.prop('disabled') && $parent.addClass('disabled');
28
+ $el.prop('checked') && $parent.addClass('checked');
29
+ }
30
+
31
+ , toggle: function () {
32
+ var ch = 'checked'
33
+ , $el = this.$element
34
+ , $parent = $el.closest('.checkbox')
35
+ , checked = $el.prop(ch)
36
+ , e = $.Event('toggle')
11
37
 
12
- constructor: Checkbox
38
+ if ($el.prop('disabled') == false) {
39
+ $parent.toggleClass(ch) && checked ? $el.removeAttr(ch) : $el.prop(ch, ch);
40
+ $el.trigger(e).trigger('change');
41
+ }
42
+ }
43
+
44
+ , setCheck: function (option) {
45
+ var d = 'disabled'
46
+ , ch = 'checked'
47
+ , $el = this.$element
48
+ , $parent = $el.closest('.checkbox')
49
+ , checkAction = option == 'check' ? true : false
50
+ , e = $.Event(option)
51
+
52
+ $parent[checkAction ? 'addClass' : 'removeClass' ](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
53
+ $el.trigger(e).trigger('change');
54
+ }
13
55
 
14
- , init: function (element, options) {
15
- var $el = this.$element = $(element)
56
+ }
16
57
 
17
- this.options = $.extend({}, $.fn.checkbox.defaults, options);
18
- $el.before(this.options.template);
19
- this.setState();
20
- }
21
58
 
22
- , setState: function () {
23
- var $el = this.$element
24
- , $parent = $el.closest('.checkbox');
59
+ /* CHECKBOX PLUGIN DEFINITION
60
+ * ======================== */
25
61
 
26
- $el.prop('disabled') && $parent.addClass('disabled');
27
- $el.prop('checked') && $parent.addClass('checked');
28
- }
62
+ var old = $.fn.checkbox
29
63
 
30
- , toggle: function () {
31
- var ch = 'checked'
32
- , $el = this.$element
33
- , $parent = $el.closest('.checkbox')
34
- , checked = $el.prop(ch)
35
- , e = $.Event('toggle')
64
+ $.fn.checkbox = function (option) {
65
+ return this.each(function () {
66
+ var $this = $(this)
67
+ , data = $this.data('checkbox')
68
+ , options = $.extend({}, $.fn.checkbox.defaults, $this.data(), typeof option == 'object' && option);
69
+ if (!data) $this.data('checkbox', (data = new Checkbox(this, options)));
70
+ if (option == 'toggle') data.toggle()
71
+ if (option == 'check' || option == 'uncheck') data.setCheck(option)
72
+ else if (option) data.setState();
73
+ });
74
+ }
75
+
76
+ $.fn.checkbox.defaults = {
77
+ template: '<span class="icons"><span class="first-icon fa fa-square fa-base"></span><span class="second-icon fa fa-check-square fa-base"></span></span>'
78
+ }
36
79
 
37
- if ($el.prop('disabled') == false) {
38
- $parent.toggleClass(ch) && checked ? $el.removeAttr(ch) : $el.prop(ch, ch);
39
- $el.trigger(e).trigger('change');
40
- }
41
- }
42
80
 
43
- , setCheck: function (option) {
44
- var d = 'disabled'
45
- , ch = 'checked'
46
- , $el = this.$element
47
- , $parent = $el.closest('.checkbox')
48
- , checkAction = option == 'check' ? true : false
49
- , e = $.Event(option)
81
+ /* CHECKBOX NO CONFLICT
82
+ * ================== */
50
83
 
51
- $parent[checkAction ? 'addClass' : 'removeClass' ](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
52
- $el.trigger(e).trigger('change');
53
- }
54
-
55
- }
84
+ $.fn.checkbox.noConflict = function () {
85
+ $.fn.checkbox = old;
86
+ return this;
87
+ }
56
88
 
57
89
 
58
- /* CHECKBOX PLUGIN DEFINITION
59
- * ======================== */
90
+ /* CHECKBOX DATA-API
91
+ * =============== */
60
92
 
61
- var old = $.fn.checkbox
93
+ $(document).on('click.checkbox.data-api', '[data-toggle^=checkbox], .checkbox', function (e) {
94
+ var $checkbox = $(e.target);
95
+ if (e.target.tagName != "A") {
96
+ e && e.preventDefault() && e.stopPropagation();
97
+ if (!$checkbox.hasClass('checkbox')) $checkbox = $checkbox.closest('.checkbox');
98
+ $checkbox.find(':checkbox').checkbox('toggle');
99
+ }
100
+ });
62
101
 
63
- $.fn.checkbox = function (option) {
64
- return this.each(function () {
65
- var $this = $(this)
66
- , data = $this.data('checkbox')
67
- , options = $.extend({}, $.fn.checkbox.defaults, $this.data(), typeof option == 'object' && option);
68
- if (!data) $this.data('checkbox', (data = new Checkbox(this, options)));
69
- if (option == 'toggle') data.toggle()
70
- if (option == 'check' || option == 'uncheck') data.setCheck(option)
71
- else if (option) data.setState();
72
- });
73
- }
102
+ $(function () {
103
+ $('input[type="checkbox"]').each(function () {
104
+ var $checkbox = $(this);
105
+ $checkbox.checkbox();
106
+ });
107
+ });
74
108
 
75
- $.fn.checkbox.defaults = {
76
- template: '<span class="icons"><span class="first-icon fa fa-square fa-base"></span><span class="second-icon fa fa-check-square fa-base"></span></span>'
77
- }
109
+ }(window.jQuery);
78
110
 
111
+ /* =============================================================
112
+ * flatui-radio v0.0.3
113
+ * ============================================================ */
79
114
 
80
- /* CHECKBOX NO CONFLICT
81
- * ================== */
115
+ !function ($) {
82
116
 
83
- $.fn.checkbox.noConflict = function () {
84
- $.fn.checkbox = old;
85
- return this;
86
- }
117
+ /* RADIO PUBLIC CLASS DEFINITION
118
+ * ============================== */
87
119
 
120
+ var Radio = function (element, options) {
121
+ this.init(element, options);
122
+ }
88
123
 
89
- /* CHECKBOX DATA-API
90
- * =============== */
124
+ Radio.prototype = {
91
125
 
92
- $(document).on('click.checkbox.data-api', '[data-toggle^=checkbox], .checkbox', function (e) {
93
- var $checkbox = $(e.target);
94
- if (e.target.tagName != "A") {
95
- e && e.preventDefault() && e.stopPropagation();
96
- if (!$checkbox.hasClass('checkbox')) $checkbox = $checkbox.closest('.checkbox');
97
- $checkbox.find(':checkbox').checkbox('toggle');
98
- }
99
- });
126
+ constructor: Radio
100
127
 
101
- $(function () {
102
- $('input[type="checkbox"]').each(function () {
103
- var $checkbox = $(this);
104
- $checkbox.checkbox();
105
- });
106
- });
128
+ , init: function (element, options) {
129
+ var $el = this.$element = $(element)
107
130
 
108
- }(window.jQuery);
131
+ this.options = $.extend({}, $.fn.radio.defaults, options);
132
+ $el.before(this.options.template);
133
+ this.setState();
134
+ }
109
135
 
110
- /* =============================================================
111
- * flatui-radio v0.0.3
112
- * ============================================================ */
113
-
114
- !function ($) {
115
-
116
- /* RADIO PUBLIC CLASS DEFINITION
117
- * ============================== */
118
-
119
- var Radio = function (element, options) {
120
- this.init(element, options);
121
- }
122
-
123
- Radio.prototype = {
124
-
125
- constructor: Radio
126
-
127
- , init: function (element, options) {
128
- var $el = this.$element = $(element)
129
-
130
- this.options = $.extend({}, $.fn.radio.defaults, options);
131
- $el.before(this.options.template);
132
- this.setState();
133
- }
134
-
135
- , setState: function () {
136
- var $el = this.$element
137
- , $parent = $el.closest('.radio');
138
-
139
- $el.prop('disabled') && $parent.addClass('disabled');
140
- $el.prop('checked') && $parent.addClass('checked');
141
- }
136
+ , setState: function () {
137
+ var $el = this.$element
138
+ , $parent = $el.closest('.radio');
142
139
 
143
- , toggle: function () {
144
- var d = 'disabled'
145
- , ch = 'checked'
146
- , $el = this.$element
147
- , checked = $el.prop(ch)
148
- , $parent = $el.closest('.radio')
149
- , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
150
- , $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
151
- , e = $.Event('toggle')
140
+ $el.prop('disabled') && $parent.addClass('disabled');
141
+ $el.prop('checked') && $parent.addClass('checked');
142
+ }
152
143
 
153
- if ($el.prop(d) == false) {
154
- $elemGroup.not($el).each(function () {
155
- var $el = $(this)
156
- , $parent = $(this).closest('.radio');
144
+ , toggle: function () {
145
+ var d = 'disabled'
146
+ , ch = 'checked'
147
+ , $el = this.$element
148
+ , checked = $el.prop(ch)
149
+ , $parent = $el.closest('.radio')
150
+ , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
151
+ , $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
152
+ , e = $.Event('toggle')
157
153
 
158
154
  if ($el.prop(d) == false) {
159
- $parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
160
- }
161
- });
155
+ $elemGroup.not($el).each(function () {
156
+ var $el = $(this)
157
+ , $parent = $(this).closest('.radio');
162
158
 
163
- if (checked == false) $parent.addClass(ch) && $el.prop(ch, true);
164
- $el.trigger(e);
159
+ if ($el.prop(d) == false) {
160
+ $parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
161
+ }
162
+ });
165
163
 
166
- if (checked !== $el.prop(ch)) {
167
- $el.trigger('change');
164
+ if (checked == false) $parent.addClass(ch) && $el.prop(ch, true);
165
+ $el.trigger(e);
166
+
167
+ if (checked !== $el.prop(ch)) {
168
+ $el.trigger('change');
169
+ }
170
+ }
168
171
  }
169
- }
170
- }
171
172
 
172
- , setCheck: function (option) {
173
- var ch = 'checked'
174
- , $el = this.$element
175
- , $parent = $el.closest('.radio')
176
- , checkAction = option == 'check' ? true : false
177
- , checked = $el.prop(ch)
178
- , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
179
- , $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
180
- , e = $.Event(option)
173
+ , setCheck: function (option) {
174
+ var ch = 'checked'
175
+ , $el = this.$element
176
+ , $parent = $el.closest('.radio')
177
+ , checkAction = option == 'check' ? true : false
178
+ , checked = $el.prop(ch)
179
+ , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
180
+ , $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
181
+ , e = $.Event(option)
181
182
 
182
- $elemGroup.not($el).each(function () {
183
- var $el = $(this)
184
- , $parent = $(this).closest('.radio');
183
+ $elemGroup.not($el).each(function () {
184
+ var $el = $(this)
185
+ , $parent = $(this).closest('.radio');
185
186
 
186
- $parent.removeClass(ch) && $el.removeAttr(ch);
187
- });
187
+ $parent.removeClass(ch) && $el.removeAttr(ch);
188
+ });
188
189
 
189
- $parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
190
- $el.trigger(e);
190
+ $parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
191
+ $el.trigger(e);
191
192
 
192
- if (checked !== $el.prop(ch)) {
193
- $el.trigger('change');
194
- }
195
- }
193
+ if (checked !== $el.prop(ch)) {
194
+ $el.trigger('change');
195
+ }
196
+ }
197
+
198
+ }
196
199
 
197
- }
198
200
 
201
+ /* RADIO PLUGIN DEFINITION
202
+ * ======================== */
199
203
 
200
- /* RADIO PLUGIN DEFINITION
201
- * ======================== */
204
+ var old = $.fn.radio
202
205
 
203
- var old = $.fn.radio
206
+ $.fn.radio = function (option) {
207
+ return this.each(function () {
208
+ var $this = $(this)
209
+ , data = $this.data('radio')
210
+ , options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
211
+ if (!data) $this.data('radio', (data = new Radio(this, options)));
212
+ if (option == 'toggle') data.toggle()
213
+ if (option == 'check' || option == 'uncheck') data.setCheck(option)
214
+ else if (option) data.setState();
215
+ });
216
+ }
204
217
 
205
- $.fn.radio = function (option) {
206
- return this.each(function () {
207
- var $this = $(this)
208
- , data = $this.data('radio')
209
- , options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
210
- if (!data) $this.data('radio', (data = new Radio(this, options)));
211
- if (option == 'toggle') data.toggle()
212
- if (option == 'check' || option == 'uncheck') data.setCheck(option)
213
- else if (option) data.setState();
214
- });
215
- }
218
+ $.fn.radio.defaults = {
219
+ template: '<span class="icons"><span class="first-icon fa fa-circle-o fa-base"></span><span class="second-icon fa fa-dot-circle-o fa-base"></span></span>'
220
+ }
216
221
 
217
- $.fn.radio.defaults = {
218
- template: '<span class="icons"><span class="first-icon fa fa-circle-o fa-base"></span><span class="second-icon fa fa-dot-circle-o fa-base"></span></span>'
219
- }
220
222
 
223
+ /* RADIO NO CONFLICT
224
+ * ================== */
221
225
 
222
- /* RADIO NO CONFLICT
223
- * ================== */
226
+ $.fn.radio.noConflict = function () {
227
+ $.fn.radio = old;
228
+ return this;
229
+ }
224
230
 
225
- $.fn.radio.noConflict = function () {
226
- $.fn.radio = old;
227
- return this;
228
- }
229
231
 
232
+ /* RADIO DATA-API
233
+ * =============== */
230
234
 
231
- /* RADIO DATA-API
232
- * =============== */
235
+ $(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
236
+ var $radio = $(e.target);
237
+ e && e.preventDefault() && e.stopPropagation();
238
+ if (!$radio.hasClass('radio')) $radio = $radio.closest('.radio');
239
+ $radio.find(':radio').radio('toggle');
240
+ });
233
241
 
234
- $(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
235
- var $radio = $(e.target);
236
- e && e.preventDefault() && e.stopPropagation();
237
- if (!$radio.hasClass('radio')) $radio = $radio.closest('.radio');
238
- $radio.find(':radio').radio('toggle');
239
- });
242
+ $(function () {
243
+ $('input[type="radio"]').each(function () {
244
+ var $radio = $(this);
245
+ $radio.radio();
246
+ });
247
+ });
240
248
 
241
- $(function () {
242
- $('input[type="radio"]').each(function () {
243
- var $radio = $(this);
244
- $radio.radio();
245
- });
246
- });
249
+ }(window.jQuery);
250
+ }
247
251
 
248
- }(window.jQuery);
252
+ $(setupInputs);
253
+ $(document).on('page:load', setupInputs);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: creative_tim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilton Garcia
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-25 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler