semantic-ui-sass 0.19.3.1 → 1.7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +5 -6
- data/app/assets/fonts/semantic-ui/icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/icons.otf +0 -0
- data/app/assets/fonts/semantic-ui/icons.svg +472 -367
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/images/semantic-ui/flags.png +0 -0
- data/app/assets/javascripts/semantic-ui.js +9 -5
- data/app/assets/javascripts/semantic-ui/accordion.js +169 -102
- data/app/assets/javascripts/semantic-ui/api.js +840 -0
- data/app/assets/javascripts/semantic-ui/checkbox.js +203 -46
- data/app/assets/javascripts/semantic-ui/{behavior/colorize.js → colorize.js} +4 -2
- data/app/assets/javascripts/semantic-ui/dimmer.js +110 -76
- data/app/assets/javascripts/semantic-ui/dropdown.js +897 -285
- data/app/assets/javascripts/semantic-ui/{behavior/form.js → form.js} +127 -42
- data/app/assets/javascripts/semantic-ui/modal.js +294 -219
- data/app/assets/javascripts/semantic-ui/nag.js +120 -186
- data/app/assets/javascripts/semantic-ui/popup.js +491 -223
- data/app/assets/javascripts/semantic-ui/progress.js +779 -0
- data/app/assets/javascripts/semantic-ui/rating.js +66 -22
- data/app/assets/javascripts/semantic-ui/search.js +219 -99
- data/app/assets/javascripts/semantic-ui/shape.js +72 -29
- data/app/assets/javascripts/semantic-ui/sidebar.js +678 -142
- data/app/assets/javascripts/semantic-ui/site.js +487 -0
- data/app/assets/javascripts/semantic-ui/{behavior/state.js → state.js} +116 -151
- data/app/assets/javascripts/semantic-ui/sticky.js +771 -0
- data/app/assets/javascripts/semantic-ui/tab.js +680 -603
- data/app/assets/javascripts/semantic-ui/transition.js +269 -158
- data/app/assets/javascripts/semantic-ui/video.js +113 -32
- data/app/assets/javascripts/semantic-ui/visibility.js +970 -0
- data/app/assets/javascripts/semantic-ui/visit.js +513 -0
- data/app/assets/stylesheets/semantic-ui.scss +2 -0
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +58 -14
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +464 -372
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +1385 -533
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +482 -655
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +238 -139
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +631 -280
- data/app/assets/stylesheets/semantic-ui/elements/_all.scss +3 -2
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +1614 -657
- data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +143 -80
- data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +1018 -0
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +302 -145
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +1653 -1365
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +160 -59
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +247 -118
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +501 -470
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +888 -0
- data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +189 -98
- data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +125 -0
- data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +147 -212
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +328 -190
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +261 -185
- data/app/assets/stylesheets/semantic-ui/globals/_all.scss +2 -0
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +430 -0
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +128 -0
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +190 -106
- data/app/assets/stylesheets/semantic-ui/modules/_all.scss +2 -1
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +303 -201
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +72 -63
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +711 -331
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +262 -140
- data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +82 -71
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +163 -119
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +435 -0
- data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +163 -68
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +223 -150
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +39 -40
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +413 -147
- data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +80 -0
- data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +49 -20
- data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +542 -568
- data/app/assets/stylesheets/semantic-ui/modules/_video.scss +69 -37
- data/app/assets/stylesheets/semantic-ui/views/_ad.scss +265 -0
- data/app/assets/stylesheets/semantic-ui/views/_all.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +758 -0
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +133 -92
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +200 -87
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +298 -523
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +390 -12
- data/lib/semantic/ui/sass/version.rb +2 -2
- data/tasks/converter.rb +99 -216
- metadata +22 -27
- data/app/assets/fonts/semantic-ui/basic.icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/basic.icons.svg +0 -450
- data/app/assets/fonts/semantic-ui/basic.icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/basic.icons.woff +0 -0
- data/app/assets/images/semantic-ui/loader-large-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-large.gif +0 -0
- data/app/assets/images/semantic-ui/loader-medium-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-medium.gif +0 -0
- data/app/assets/images/semantic-ui/loader-mini-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-mini.gif +0 -0
- data/app/assets/images/semantic-ui/loader-small-inverted.gif +0 -0
- data/app/assets/images/semantic-ui/loader-small.gif +0 -0
- data/app/assets/javascripts/semantic-ui/behavior/api.js +0 -634
- data/app/assets/javascripts/semantic-ui/chatroom.js +0 -772
- data/app/assets/stylesheets/semantic-ui/depends/_basic.icon.scss +0 -4
- data/app/assets/stylesheets/semantic-ui/depends/_icon.scss +0 -4
- data/app/assets/stylesheets/semantic-ui/depends/_loader.scss +0 -8
- data/app/assets/stylesheets/semantic-ui/elements/_basic.icon.scss +0 -1124
- data/app/assets/stylesheets/semantic-ui/elements/_progress.scss +0 -280
- data/app/assets/stylesheets/semantic-ui/modules/_chatroom.scss +0 -299
- data/app/assets/stylesheets/semantic-ui/modules/_reveal.scss +0 -322
- data/app/assets/stylesheets/semantic-ui/views/_list.scss +0 -700
@@ -1,9 +1,9 @@
|
|
1
1
|
/*
|
2
2
|
* # Semantic - Checkbox
|
3
|
-
* http://github.com/
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributor
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
;(function ( $, window, document, undefined ) {
|
13
13
|
|
14
|
+
"use strict";
|
15
|
+
|
14
16
|
$.fn.checkbox = function(parameters) {
|
15
17
|
var
|
16
18
|
$allModules = $(this),
|
@@ -32,18 +34,19 @@ $.fn.checkbox = function(parameters) {
|
|
32
34
|
|
33
35
|
className = settings.className,
|
34
36
|
namespace = settings.namespace,
|
37
|
+
selector = settings.selector,
|
35
38
|
error = settings.error,
|
36
39
|
|
37
40
|
eventNamespace = '.' + namespace,
|
38
41
|
moduleNamespace = 'module-' + namespace,
|
39
42
|
|
40
43
|
$module = $(this),
|
41
|
-
$label = $(this).
|
42
|
-
$input = $(this).find(
|
44
|
+
$label = $(this).find(selector.label).first(),
|
45
|
+
$input = $(this).find(selector.input),
|
43
46
|
|
44
|
-
selector = $module.selector || '',
|
45
47
|
instance = $module.data(moduleNamespace),
|
46
48
|
|
49
|
+
observer,
|
47
50
|
element = this,
|
48
51
|
module
|
49
52
|
;
|
@@ -52,22 +55,24 @@ $.fn.checkbox = function(parameters) {
|
|
52
55
|
|
53
56
|
initialize: function() {
|
54
57
|
module.verbose('Initializing checkbox', settings);
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
;
|
58
|
+
|
59
|
+
module.create.label();
|
60
|
+
module.add.events();
|
61
|
+
|
62
|
+
if( module.is.checked() ) {
|
63
|
+
module.set.checked();
|
64
|
+
if(settings.fireOnInit) {
|
65
|
+
$.proxy(settings.onChecked, $input.get())();
|
66
|
+
}
|
61
67
|
}
|
62
68
|
else {
|
63
|
-
|
64
|
-
|
65
|
-
.
|
66
|
-
|
67
|
-
$label
|
68
|
-
.on('click' + eventNamespace, module.toggle)
|
69
|
-
;
|
69
|
+
module.remove.checked();
|
70
|
+
if(settings.fireOnInit) {
|
71
|
+
$.proxy(settings.onUnchecked, $input.get())();
|
72
|
+
}
|
70
73
|
}
|
74
|
+
module.observeChanges();
|
75
|
+
|
71
76
|
module.instantiate();
|
72
77
|
},
|
73
78
|
|
@@ -80,66 +85,212 @@ $.fn.checkbox = function(parameters) {
|
|
80
85
|
},
|
81
86
|
|
82
87
|
destroy: function() {
|
83
|
-
module.verbose('Destroying
|
88
|
+
module.verbose('Destroying module');
|
89
|
+
module.remove.events();
|
84
90
|
$module
|
85
|
-
.off(eventNamespace)
|
86
91
|
.removeData(moduleNamespace)
|
87
92
|
;
|
88
93
|
},
|
89
94
|
|
95
|
+
refresh: function() {
|
96
|
+
$module = $(this);
|
97
|
+
$label = $(this).find(selector.label).first();
|
98
|
+
$input = $(this).find(selector.input);
|
99
|
+
},
|
100
|
+
|
101
|
+
observeChanges: function() {
|
102
|
+
if('MutationObserver' in window) {
|
103
|
+
observer = new MutationObserver(function(mutations) {
|
104
|
+
module.debug('DOM tree modified, updating selector cache');
|
105
|
+
module.refresh();
|
106
|
+
});
|
107
|
+
observer.observe(element, {
|
108
|
+
childList : true,
|
109
|
+
subtree : true
|
110
|
+
});
|
111
|
+
module.debug('Setting up mutation observer', observer);
|
112
|
+
}
|
113
|
+
},
|
114
|
+
|
115
|
+
attachEvents: function(selector, event) {
|
116
|
+
var
|
117
|
+
$element = $(selector)
|
118
|
+
;
|
119
|
+
event = $.isFunction(module[event])
|
120
|
+
? module[event]
|
121
|
+
: module.toggle
|
122
|
+
;
|
123
|
+
if($element.size() > 0) {
|
124
|
+
module.debug('Attaching checkbox events to element', selector, event);
|
125
|
+
$element
|
126
|
+
.on('click' + eventNamespace, event)
|
127
|
+
;
|
128
|
+
}
|
129
|
+
else {
|
130
|
+
module.error(error.notFound);
|
131
|
+
}
|
132
|
+
},
|
133
|
+
|
134
|
+
event: {
|
135
|
+
keydown: function(event) {
|
136
|
+
var
|
137
|
+
key = event.which,
|
138
|
+
keyCode = {
|
139
|
+
enter : 13,
|
140
|
+
escape : 27
|
141
|
+
}
|
142
|
+
;
|
143
|
+
if( key == keyCode.escape) {
|
144
|
+
module.verbose('Escape key pressed blurring field');
|
145
|
+
$module
|
146
|
+
.blur()
|
147
|
+
;
|
148
|
+
}
|
149
|
+
if(!event.ctrlKey && key == keyCode.enter) {
|
150
|
+
module.verbose('Enter key pressed, toggling checkbox');
|
151
|
+
$.proxy(module.toggle, this)();
|
152
|
+
event.preventDefault();
|
153
|
+
}
|
154
|
+
}
|
155
|
+
},
|
156
|
+
|
90
157
|
is: {
|
91
158
|
radio: function() {
|
92
159
|
return $module.hasClass(className.radio);
|
93
160
|
},
|
94
|
-
|
161
|
+
checked: function() {
|
95
162
|
return $input.prop('checked') !== undefined && $input.prop('checked');
|
96
163
|
},
|
97
|
-
|
98
|
-
return !module.is.
|
164
|
+
unchecked: function() {
|
165
|
+
return !module.is.checked();
|
99
166
|
}
|
100
167
|
},
|
101
168
|
|
102
169
|
can: {
|
103
|
-
|
104
|
-
return (
|
105
|
-
|
170
|
+
change: function() {
|
171
|
+
return !( $module.hasClass(className.disabled) || $module.hasClass(className.readOnly) || $input.prop('disabled') );
|
172
|
+
},
|
173
|
+
uncheck: function() {
|
174
|
+
return (typeof settings.uncheckable === 'boolean')
|
175
|
+
? settings.uncheckable
|
106
176
|
: !module.is.radio()
|
107
177
|
;
|
108
178
|
}
|
109
179
|
},
|
110
180
|
|
181
|
+
set: {
|
182
|
+
checked: function() {
|
183
|
+
$module.addClass(className.checked);
|
184
|
+
},
|
185
|
+
tab: function() {
|
186
|
+
if( $input.attr('tabindex') === undefined) {
|
187
|
+
$input
|
188
|
+
.attr('tabindex', 0)
|
189
|
+
;
|
190
|
+
}
|
191
|
+
}
|
192
|
+
},
|
193
|
+
|
194
|
+
create: {
|
195
|
+
label: function() {
|
196
|
+
if($input.prevAll(selector.label).size() > 0) {
|
197
|
+
$input.prev(selector.label).detach().insertAfter($input);
|
198
|
+
module.debug('Moving existing label', $label);
|
199
|
+
}
|
200
|
+
else if( !module.has.label() ) {
|
201
|
+
$label = $('<label>').insertAfter($input);
|
202
|
+
module.debug('Creating label', $label);
|
203
|
+
}
|
204
|
+
}
|
205
|
+
},
|
206
|
+
|
207
|
+
has: {
|
208
|
+
label: function() {
|
209
|
+
return ($label.size() > 0);
|
210
|
+
}
|
211
|
+
},
|
212
|
+
|
213
|
+
add: {
|
214
|
+
events: function() {
|
215
|
+
module.verbose('Attaching checkbox events');
|
216
|
+
$module
|
217
|
+
.on('click' + eventNamespace, module.toggle)
|
218
|
+
.on('keydown' + eventNamespace, selector.input, module.event.keydown)
|
219
|
+
;
|
220
|
+
}
|
221
|
+
},
|
222
|
+
|
223
|
+
remove: {
|
224
|
+
checked: function() {
|
225
|
+
$module.removeClass(className.checked);
|
226
|
+
},
|
227
|
+
events: function() {
|
228
|
+
module.debug('Removing events');
|
229
|
+
$module
|
230
|
+
.off(eventNamespace)
|
231
|
+
.removeData(moduleNamespace)
|
232
|
+
;
|
233
|
+
$input
|
234
|
+
.off(eventNamespace, module.event.keydown)
|
235
|
+
;
|
236
|
+
$label
|
237
|
+
.off(eventNamespace)
|
238
|
+
;
|
239
|
+
}
|
240
|
+
},
|
241
|
+
|
111
242
|
enable: function() {
|
243
|
+
module.debug('Enabling checkbox functionality');
|
244
|
+
$module.removeClass(className.disabled);
|
245
|
+
$input.prop('disabled', false);
|
246
|
+
$.proxy(settings.onEnabled, $input.get())();
|
247
|
+
},
|
248
|
+
|
249
|
+
disable: function() {
|
250
|
+
module.debug('Disabling checkbox functionality');
|
251
|
+
$module.addClass(className.disabled);
|
252
|
+
$input.prop('disabled', 'disabled');
|
253
|
+
$.proxy(settings.onDisabled, $input.get())();
|
254
|
+
},
|
255
|
+
|
256
|
+
check: function() {
|
112
257
|
module.debug('Enabling checkbox', $input);
|
113
258
|
$input
|
114
259
|
.prop('checked', true)
|
115
260
|
.trigger('change')
|
116
261
|
;
|
262
|
+
module.set.checked();
|
117
263
|
$.proxy(settings.onChange, $input.get())();
|
118
|
-
$.proxy(settings.
|
264
|
+
$.proxy(settings.onChecked, $input.get())();
|
119
265
|
},
|
120
266
|
|
121
|
-
|
267
|
+
uncheck: function() {
|
122
268
|
module.debug('Disabling checkbox');
|
123
269
|
$input
|
124
270
|
.prop('checked', false)
|
125
271
|
.trigger('change')
|
126
272
|
;
|
273
|
+
module.remove.checked();
|
127
274
|
$.proxy(settings.onChange, $input.get())();
|
128
|
-
$.proxy(settings.
|
275
|
+
$.proxy(settings.onUnchecked, $input.get())();
|
129
276
|
},
|
130
277
|
|
131
278
|
toggle: function(event) {
|
279
|
+
if( !module.can.change() ) {
|
280
|
+
console.log(module.can.change());
|
281
|
+
module.debug('Checkbox is read-only or disabled, ignoring toggle');
|
282
|
+
return;
|
283
|
+
}
|
132
284
|
module.verbose('Determining new checkbox state');
|
133
|
-
if(
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
module.disable();
|
139
|
-
}
|
285
|
+
if( module.is.unchecked() ) {
|
286
|
+
module.check();
|
287
|
+
}
|
288
|
+
else if( module.is.checked() && module.can.uncheck() ) {
|
289
|
+
module.uncheck();
|
140
290
|
}
|
141
291
|
},
|
142
292
|
setting: function(name, value) {
|
293
|
+
module.debug('Changing setting', name, value);
|
143
294
|
if( $.isPlainObject(name) ) {
|
144
295
|
$.extend(true, settings, name);
|
145
296
|
}
|
@@ -200,9 +351,9 @@ $.fn.checkbox = function(parameters) {
|
|
200
351
|
executionTime = currentTime - previousTime;
|
201
352
|
time = currentTime;
|
202
353
|
performance.push({
|
203
|
-
'Element' : element,
|
204
354
|
'Name' : message[0],
|
205
355
|
'Arguments' : [].slice.call(message, 1) || '',
|
356
|
+
'Element' : element,
|
206
357
|
'Execution Time' : executionTime
|
207
358
|
});
|
208
359
|
}
|
@@ -270,6 +421,7 @@ $.fn.checkbox = function(parameters) {
|
|
270
421
|
return false;
|
271
422
|
}
|
272
423
|
else {
|
424
|
+
module.error(error.method, query);
|
273
425
|
return false;
|
274
426
|
}
|
275
427
|
});
|
@@ -324,24 +476,29 @@ $.fn.checkbox.settings = {
|
|
324
476
|
performance : true,
|
325
477
|
|
326
478
|
// delegated event context
|
327
|
-
|
328
|
-
|
479
|
+
uncheckable : 'auto',
|
480
|
+
fireOnInit : true,
|
329
481
|
|
330
482
|
onChange : function(){},
|
331
|
-
|
332
|
-
|
483
|
+
onChecked : function(){},
|
484
|
+
onUnchecked : function(){},
|
485
|
+
onEnabled : function(){},
|
486
|
+
onDisabled : function(){},
|
487
|
+
|
488
|
+
className : {
|
489
|
+
checked : 'checked',
|
490
|
+
disabled : 'disabled',
|
491
|
+
radio : 'radio',
|
492
|
+
readOnly : 'read-only'
|
493
|
+
},
|
333
494
|
|
334
495
|
error : {
|
335
|
-
method : 'The method you called is not defined
|
496
|
+
method : 'The method you called is not defined'
|
336
497
|
},
|
337
498
|
|
338
499
|
selector : {
|
339
500
|
input : 'input[type=checkbox], input[type=radio]',
|
340
501
|
label : 'label'
|
341
|
-
},
|
342
|
-
|
343
|
-
className : {
|
344
|
-
radio : 'radio'
|
345
502
|
}
|
346
503
|
|
347
504
|
};
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/*
|
2
2
|
* # Semantic - Colorize
|
3
|
-
* http://github.com/
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributor
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
;(function ( $, window, document, undefined ) {
|
13
13
|
|
14
|
+
"use strict";
|
15
|
+
|
14
16
|
$.fn.colorize = function(parameters) {
|
15
17
|
var
|
16
18
|
settings = $.extend(true, {}, $.fn.colorize.settings, parameters),
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/*
|
2
2
|
* # Semantic - Dimmer
|
3
|
-
* http://github.com/
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributor
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -64,7 +64,12 @@ $.fn.dimmer = function(parameters) {
|
|
64
64
|
else {
|
65
65
|
$dimmable = $module;
|
66
66
|
if( module.has.dimmer() ) {
|
67
|
-
|
67
|
+
if(settings.dimmerName) {
|
68
|
+
$dimmer = $dimmable.children(selector.dimmer).filter('.' + settings.dimmerName);
|
69
|
+
}
|
70
|
+
else {
|
71
|
+
$dimmer = $dimmable.children(selector.dimmer);
|
72
|
+
}
|
68
73
|
}
|
69
74
|
else {
|
70
75
|
$dimmer = module.create();
|
@@ -85,13 +90,12 @@ $.fn.dimmer = function(parameters) {
|
|
85
90
|
.on(clickEvent + eventNamespace, module.toggle)
|
86
91
|
;
|
87
92
|
}
|
88
|
-
|
89
93
|
if( module.is.page() ) {
|
90
94
|
module.debug('Setting as a page dimmer', $dimmable);
|
91
95
|
module.set.pageDimmer();
|
92
96
|
}
|
93
97
|
|
94
|
-
if(
|
98
|
+
if( module.is.closable() ) {
|
95
99
|
module.verbose('Adding dimmer close event', $dimmer);
|
96
100
|
$dimmer
|
97
101
|
.on(clickEvent + eventNamespace, module.event.click)
|
@@ -123,7 +127,6 @@ $.fn.dimmer = function(parameters) {
|
|
123
127
|
},
|
124
128
|
|
125
129
|
event: {
|
126
|
-
|
127
130
|
click: function(event) {
|
128
131
|
module.verbose('Determining if event occured on dimmer', event);
|
129
132
|
if( $dimmer.find(event.target).size() === 0 || $(event.target).is(selector.content) ) {
|
@@ -131,7 +134,6 @@ $.fn.dimmer = function(parameters) {
|
|
131
134
|
event.stopImmediatePropagation();
|
132
135
|
}
|
133
136
|
}
|
134
|
-
|
135
137
|
},
|
136
138
|
|
137
139
|
addContent: function(element) {
|
@@ -145,7 +147,63 @@ $.fn.dimmer = function(parameters) {
|
|
145
147
|
},
|
146
148
|
|
147
149
|
create: function() {
|
148
|
-
|
150
|
+
var
|
151
|
+
$element = $( settings.template.dimmer() )
|
152
|
+
;
|
153
|
+
if(settings.variation) {
|
154
|
+
module.debug('Creating dimmer with variation', settings.variation);
|
155
|
+
$element.addClass(className.variation);
|
156
|
+
}
|
157
|
+
if(settings.dimmerName) {
|
158
|
+
module.debug('Creating named dimmer', settings.dimmerName);
|
159
|
+
$element.addClass(settings.dimmerName);
|
160
|
+
}
|
161
|
+
$element
|
162
|
+
.appendTo($dimmable)
|
163
|
+
;
|
164
|
+
return $element;
|
165
|
+
},
|
166
|
+
|
167
|
+
show: function(callback) {
|
168
|
+
callback = $.isFunction(callback)
|
169
|
+
? callback
|
170
|
+
: function(){}
|
171
|
+
;
|
172
|
+
module.debug('Showing dimmer', $dimmer, settings);
|
173
|
+
if( (!module.is.dimmed() || module.is.animating()) && module.is.enabled() ) {
|
174
|
+
module.animate.show(callback);
|
175
|
+
$.proxy(settings.onShow, element)();
|
176
|
+
$.proxy(settings.onChange, element)();
|
177
|
+
}
|
178
|
+
else {
|
179
|
+
module.debug('Dimmer is already shown or disabled');
|
180
|
+
}
|
181
|
+
},
|
182
|
+
|
183
|
+
hide: function(callback) {
|
184
|
+
callback = $.isFunction(callback)
|
185
|
+
? callback
|
186
|
+
: function(){}
|
187
|
+
;
|
188
|
+
if( module.is.dimmed() || module.is.animating() ) {
|
189
|
+
module.debug('Hiding dimmer', $dimmer);
|
190
|
+
module.animate.hide(callback);
|
191
|
+
$.proxy(settings.onHide, element)();
|
192
|
+
$.proxy(settings.onChange, element)();
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
module.debug('Dimmer is not visible');
|
196
|
+
}
|
197
|
+
},
|
198
|
+
|
199
|
+
toggle: function() {
|
200
|
+
module.verbose('Toggling dimmer visibility', $dimmer);
|
201
|
+
if( !module.is.dimmed() ) {
|
202
|
+
module.show();
|
203
|
+
}
|
204
|
+
else {
|
205
|
+
module.hide();
|
206
|
+
}
|
149
207
|
},
|
150
208
|
|
151
209
|
animate: {
|
@@ -154,14 +212,16 @@ $.fn.dimmer = function(parameters) {
|
|
154
212
|
? callback
|
155
213
|
: function(){}
|
156
214
|
;
|
157
|
-
|
158
|
-
if(settings.on != 'hover' && settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) {
|
215
|
+
if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) {
|
159
216
|
$dimmer
|
160
217
|
.transition({
|
161
218
|
animation : settings.transition + ' in',
|
162
|
-
queue
|
219
|
+
queue : false,
|
163
220
|
duration : module.get.duration(),
|
164
|
-
|
221
|
+
onStart : function() {
|
222
|
+
module.set.dimmed();
|
223
|
+
},
|
224
|
+
onComplete : function() {
|
165
225
|
module.set.active();
|
166
226
|
callback();
|
167
227
|
}
|
@@ -170,6 +230,7 @@ $.fn.dimmer = function(parameters) {
|
|
170
230
|
}
|
171
231
|
else {
|
172
232
|
module.verbose('Showing dimmer animation with javascript');
|
233
|
+
module.set.dimmed();
|
173
234
|
$dimmer
|
174
235
|
.stop()
|
175
236
|
.css({
|
@@ -190,15 +251,17 @@ $.fn.dimmer = function(parameters) {
|
|
190
251
|
? callback
|
191
252
|
: function(){}
|
192
253
|
;
|
193
|
-
if(settings.
|
254
|
+
if(settings.useCSS && $.fn.transition !== undefined && $dimmer.transition('is supported')) {
|
194
255
|
module.verbose('Hiding dimmer with css');
|
195
256
|
$dimmer
|
196
257
|
.transition({
|
197
|
-
animation
|
198
|
-
|
199
|
-
|
200
|
-
|
258
|
+
animation : settings.transition + ' out',
|
259
|
+
queue : false,
|
260
|
+
duration : module.get.duration(),
|
261
|
+
onStart : function() {
|
201
262
|
module.remove.dimmed();
|
263
|
+
},
|
264
|
+
onComplete : function() {
|
202
265
|
module.remove.active();
|
203
266
|
callback();
|
204
267
|
}
|
@@ -207,12 +270,12 @@ $.fn.dimmer = function(parameters) {
|
|
207
270
|
}
|
208
271
|
else {
|
209
272
|
module.verbose('Hiding dimmer with javascript');
|
273
|
+
module.remove.dimmed();
|
210
274
|
$dimmer
|
211
275
|
.stop()
|
212
276
|
.fadeOut(module.get.duration(), function() {
|
213
|
-
$dimmer.removeAttr('style');
|
214
|
-
module.remove.dimmed();
|
215
277
|
module.remove.active();
|
278
|
+
$dimmer.removeAttr('style');
|
216
279
|
callback();
|
217
280
|
})
|
218
281
|
;
|
@@ -239,7 +302,12 @@ $.fn.dimmer = function(parameters) {
|
|
239
302
|
|
240
303
|
has: {
|
241
304
|
dimmer: function() {
|
242
|
-
|
305
|
+
if(settings.dimmerName) {
|
306
|
+
return ($module.children(selector.dimmer).filter('.' + settings.dimmerName).size() > 0);
|
307
|
+
}
|
308
|
+
else {
|
309
|
+
return ( $module.children(selector.dimmer).size() > 0 );
|
310
|
+
}
|
243
311
|
}
|
244
312
|
},
|
245
313
|
|
@@ -248,7 +316,16 @@ $.fn.dimmer = function(parameters) {
|
|
248
316
|
return $dimmer.hasClass(className.active);
|
249
317
|
},
|
250
318
|
animating: function() {
|
251
|
-
return ( $dimmer.is(':animated') || $dimmer.hasClass(className.
|
319
|
+
return ( $dimmer.is(':animated') || $dimmer.hasClass(className.animating) );
|
320
|
+
},
|
321
|
+
closable: function() {
|
322
|
+
if(settings.closable == 'auto') {
|
323
|
+
if(settings.on == 'hover') {
|
324
|
+
return false;
|
325
|
+
}
|
326
|
+
return true;
|
327
|
+
}
|
328
|
+
return settings.closable;
|
252
329
|
},
|
253
330
|
dimmer: function() {
|
254
331
|
return $module.is(selector.dimmer);
|
@@ -281,11 +358,7 @@ $.fn.dimmer = function(parameters) {
|
|
281
358
|
|
282
359
|
set: {
|
283
360
|
active: function() {
|
284
|
-
|
285
|
-
$dimmer
|
286
|
-
.removeClass(className.transition)
|
287
|
-
.addClass(className.active)
|
288
|
-
;
|
361
|
+
$dimmer.addClass(className.active);
|
289
362
|
},
|
290
363
|
dimmable: function() {
|
291
364
|
$dimmable.addClass(className.dimmable);
|
@@ -304,7 +377,6 @@ $.fn.dimmer = function(parameters) {
|
|
304
377
|
remove: {
|
305
378
|
active: function() {
|
306
379
|
$dimmer
|
307
|
-
.removeClass(className.transition)
|
308
380
|
.removeClass(className.active)
|
309
381
|
;
|
310
382
|
},
|
@@ -316,49 +388,8 @@ $.fn.dimmer = function(parameters) {
|
|
316
388
|
}
|
317
389
|
},
|
318
390
|
|
319
|
-
show: function(callback) {
|
320
|
-
callback = $.isFunction(callback)
|
321
|
-
? callback
|
322
|
-
: function(){}
|
323
|
-
;
|
324
|
-
module.debug('Showing dimmer', $dimmer, settings);
|
325
|
-
if( !module.is.active() && module.is.enabled() ) {
|
326
|
-
module.animate.show(callback);
|
327
|
-
$.proxy(settings.onShow, element)();
|
328
|
-
$.proxy(settings.onChange, element)();
|
329
|
-
}
|
330
|
-
else {
|
331
|
-
module.debug('Dimmer is already shown or disabled');
|
332
|
-
}
|
333
|
-
},
|
334
|
-
|
335
|
-
hide: function(callback) {
|
336
|
-
callback = $.isFunction(callback)
|
337
|
-
? callback
|
338
|
-
: function(){}
|
339
|
-
;
|
340
|
-
if( module.is.active() || module.is.animating() ) {
|
341
|
-
module.debug('Hiding dimmer', $dimmer);
|
342
|
-
module.animate.hide(callback);
|
343
|
-
$.proxy(settings.onHide, element)();
|
344
|
-
$.proxy(settings.onChange, element)();
|
345
|
-
}
|
346
|
-
else {
|
347
|
-
module.debug('Dimmer is not visible');
|
348
|
-
}
|
349
|
-
},
|
350
|
-
|
351
|
-
toggle: function() {
|
352
|
-
module.verbose('Toggling dimmer visibility', $dimmer);
|
353
|
-
if( !module.is.dimmed() ) {
|
354
|
-
module.show();
|
355
|
-
}
|
356
|
-
else {
|
357
|
-
module.hide();
|
358
|
-
}
|
359
|
-
},
|
360
|
-
|
361
391
|
setting: function(name, value) {
|
392
|
+
module.debug('Changing setting', name, value);
|
362
393
|
if( $.isPlainObject(name) ) {
|
363
394
|
$.extend(true, settings, name);
|
364
395
|
}
|
@@ -419,9 +450,9 @@ $.fn.dimmer = function(parameters) {
|
|
419
450
|
executionTime = currentTime - previousTime;
|
420
451
|
time = currentTime;
|
421
452
|
performance.push({
|
422
|
-
'Element' : element,
|
423
453
|
'Name' : message[0],
|
424
454
|
'Arguments' : [].slice.call(message, 1) || '',
|
455
|
+
'Element' : element,
|
425
456
|
'Execution Time' : executionTime
|
426
457
|
});
|
427
458
|
}
|
@@ -492,6 +523,7 @@ $.fn.dimmer = function(parameters) {
|
|
492
523
|
return false;
|
493
524
|
}
|
494
525
|
else {
|
526
|
+
module.error(error.method, query);
|
495
527
|
return false;
|
496
528
|
}
|
497
529
|
});
|
@@ -547,10 +579,12 @@ $.fn.dimmer.settings = {
|
|
547
579
|
verbose : true,
|
548
580
|
performance : true,
|
549
581
|
|
582
|
+
dimmerName : false,
|
583
|
+
variation : false,
|
584
|
+
closable : 'auto',
|
550
585
|
transition : 'fade',
|
551
586
|
useCSS : true,
|
552
587
|
on : false,
|
553
|
-
closable : true,
|
554
588
|
|
555
589
|
duration : {
|
556
590
|
show : 500,
|
@@ -566,7 +600,7 @@ $.fn.dimmer.settings = {
|
|
566
600
|
},
|
567
601
|
|
568
602
|
selector: {
|
569
|
-
dimmable : '.
|
603
|
+
dimmable : '.dimmable',
|
570
604
|
dimmer : '.ui.dimmer',
|
571
605
|
content : '.ui.dimmer > .content, .ui.dimmer > .content > .center'
|
572
606
|
},
|
@@ -579,13 +613,13 @@ $.fn.dimmer.settings = {
|
|
579
613
|
|
580
614
|
className : {
|
581
615
|
active : 'active',
|
582
|
-
|
616
|
+
animating : 'animating',
|
617
|
+
dimmable : 'dimmable',
|
583
618
|
dimmed : 'dimmed',
|
584
619
|
disabled : 'disabled',
|
585
|
-
pageDimmer : 'page',
|
586
620
|
hide : 'hide',
|
587
|
-
|
588
|
-
|
621
|
+
pageDimmer : 'page',
|
622
|
+
show : 'show'
|
589
623
|
}
|
590
624
|
|
591
625
|
};
|