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 - Transition
|
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.transition = function() {
|
15
17
|
var
|
16
18
|
$allModules = $(this),
|
@@ -45,31 +47,32 @@ $.fn.transition = function() {
|
|
45
47
|
error,
|
46
48
|
className,
|
47
49
|
metadata,
|
50
|
+
animationStart,
|
48
51
|
animationEnd,
|
49
52
|
animationName,
|
50
53
|
|
51
54
|
namespace,
|
52
55
|
moduleNamespace,
|
56
|
+
eventNamespace,
|
53
57
|
module
|
54
58
|
;
|
55
59
|
|
56
60
|
module = {
|
57
61
|
|
58
62
|
initialize: function() {
|
59
|
-
// get settings
|
60
|
-
settings = module.get.settings.apply(element, moduleArguments);
|
61
|
-
module.verbose('Converted arguments into settings object', settings);
|
62
63
|
|
63
|
-
//
|
64
|
-
|
64
|
+
// get full settings
|
65
|
+
moduleNamespace = 'module-' + namespace;
|
66
|
+
settings = module.get.settings.apply(element, moduleArguments);
|
65
67
|
className = settings.className;
|
66
|
-
namespace = settings.namespace;
|
67
68
|
metadata = settings.metadata;
|
68
|
-
moduleNamespace = 'module-' + namespace;
|
69
69
|
|
70
|
-
|
70
|
+
animationStart = module.get.animationStartEvent();
|
71
|
+
animationEnd = module.get.animationEndEvent();
|
71
72
|
animationName = module.get.animationName();
|
72
|
-
|
73
|
+
error = settings.error;
|
74
|
+
namespace = settings.namespace;
|
75
|
+
eventNamespace = '.' + settings.namespace;
|
73
76
|
instance = $module.data(moduleNamespace) || module;
|
74
77
|
|
75
78
|
if(methodInvoked) {
|
@@ -77,9 +80,10 @@ $.fn.transition = function() {
|
|
77
80
|
}
|
78
81
|
// no internal method was found matching query or query not made
|
79
82
|
if(methodInvoked === false) {
|
83
|
+
module.verbose('Converted arguments into settings object', settings);
|
80
84
|
module.animate();
|
85
|
+
module.instantiate();
|
81
86
|
}
|
82
|
-
module.instantiate();
|
83
87
|
},
|
84
88
|
|
85
89
|
instantiate: function() {
|
@@ -98,7 +102,7 @@ $.fn.transition = function() {
|
|
98
102
|
|
99
103
|
refresh: function() {
|
100
104
|
module.verbose('Refreshing display type on next animation');
|
101
|
-
delete
|
105
|
+
delete module.displayType;
|
102
106
|
},
|
103
107
|
|
104
108
|
forceRepaint: function() {
|
@@ -129,37 +133,41 @@ $.fn.transition = function() {
|
|
129
133
|
return false;
|
130
134
|
}
|
131
135
|
module.debug('Preparing animation', settings.animation);
|
132
|
-
if(module.is.animating()
|
133
|
-
if(
|
134
|
-
module.
|
136
|
+
if(module.is.animating()) {
|
137
|
+
if(settings.queue) {
|
138
|
+
if(!settings.allowRepeats && module.has.direction() && module.is.occuring() && module.queuing !== true) {
|
139
|
+
module.error(error.repeated, settings.animation, $module);
|
140
|
+
}
|
141
|
+
else {
|
142
|
+
module.queue(settings.animation);
|
143
|
+
}
|
144
|
+
return false;
|
135
145
|
}
|
136
146
|
else {
|
137
|
-
|
147
|
+
|
138
148
|
}
|
139
|
-
return false;
|
140
149
|
}
|
141
|
-
if(module.can.animate) {
|
150
|
+
if( module.can.animate() ) {
|
142
151
|
module.set.animating(settings.animation);
|
143
152
|
}
|
144
153
|
else {
|
145
|
-
module.error(error.noAnimation, settings.animation);
|
154
|
+
module.error(error.noAnimation, settings.animation, element);
|
146
155
|
}
|
147
156
|
},
|
148
157
|
|
149
158
|
reset: function() {
|
150
159
|
module.debug('Resetting animation to beginning conditions');
|
151
|
-
|
160
|
+
module.remove.animationEndCallback();
|
152
161
|
module.restore.conditions();
|
153
|
-
module.hide();
|
154
162
|
module.remove.animating();
|
155
163
|
},
|
156
164
|
|
157
165
|
queue: function(animation) {
|
158
166
|
module.debug('Queueing animation of', animation);
|
159
|
-
|
167
|
+
module.queuing = true;
|
160
168
|
$module
|
161
|
-
.one(animationEnd, function() {
|
162
|
-
|
169
|
+
.one(animationEnd + eventNamespace, function() {
|
170
|
+
module.queuing = false;
|
163
171
|
module.repaint();
|
164
172
|
module.animate.apply(this, settings);
|
165
173
|
})
|
@@ -168,11 +176,12 @@ $.fn.transition = function() {
|
|
168
176
|
|
169
177
|
complete: function () {
|
170
178
|
module.verbose('CSS animation complete', settings.animation);
|
179
|
+
module.remove.animationEndCallback();
|
180
|
+
module.remove.failSafe();
|
171
181
|
if(!module.is.looping()) {
|
172
182
|
if( module.is.outward() ) {
|
173
183
|
module.verbose('Animation is outward, hiding element');
|
174
184
|
module.restore.conditions();
|
175
|
-
module.remove.display();
|
176
185
|
module.hide();
|
177
186
|
$.proxy(settings.onHide, this)();
|
178
187
|
}
|
@@ -180,15 +189,16 @@ $.fn.transition = function() {
|
|
180
189
|
module.verbose('Animation is outward, showing element');
|
181
190
|
module.restore.conditions();
|
182
191
|
module.show();
|
192
|
+
module.set.display();
|
183
193
|
$.proxy(settings.onShow, this)();
|
184
194
|
}
|
185
195
|
else {
|
186
196
|
module.restore.conditions();
|
187
197
|
}
|
188
|
-
module.remove.
|
198
|
+
module.remove.animation();
|
189
199
|
module.remove.animating();
|
190
200
|
}
|
191
|
-
$.proxy(settings.
|
201
|
+
$.proxy(settings.onComplete, this)();
|
192
202
|
},
|
193
203
|
|
194
204
|
has: {
|
@@ -199,14 +209,23 @@ $.fn.transition = function() {
|
|
199
209
|
return true;
|
200
210
|
}
|
201
211
|
return false;
|
212
|
+
},
|
213
|
+
inlineDisplay: function() {
|
214
|
+
var
|
215
|
+
style = $module.attr('style') || ''
|
216
|
+
;
|
217
|
+
return $.isArray(style.match(/display.*?;/, ''));
|
202
218
|
}
|
203
219
|
},
|
204
220
|
|
205
221
|
set: {
|
206
|
-
|
207
222
|
animating: function(animation) {
|
208
223
|
animation = animation || settings.animation;
|
209
|
-
module.
|
224
|
+
if(!module.is.animating()) {
|
225
|
+
module.save.conditions();
|
226
|
+
}
|
227
|
+
module.remove.direction();
|
228
|
+
module.remove.animationEndCallback();
|
210
229
|
if(module.can.transition() && !module.has.direction()) {
|
211
230
|
module.set.direction();
|
212
231
|
}
|
@@ -216,28 +235,49 @@ $.fn.transition = function() {
|
|
216
235
|
.addClass(className.animating)
|
217
236
|
.addClass(className.transition)
|
218
237
|
.addClass(animation)
|
219
|
-
.one(animationEnd, module.complete)
|
238
|
+
.one(animationEnd + '.complete' + eventNamespace, module.complete)
|
220
239
|
;
|
240
|
+
if(settings.useFailSafe) {
|
241
|
+
module.add.failSafe();
|
242
|
+
}
|
221
243
|
module.set.duration(settings.duration);
|
222
|
-
|
244
|
+
$.proxy(settings.onStart, this)();
|
245
|
+
module.debug('Starting tween', animation, $module.attr('class'));
|
246
|
+
},
|
247
|
+
duration: function(animationName, duration) {
|
248
|
+
duration = duration || settings.duration;
|
249
|
+
duration = (typeof duration == 'number')
|
250
|
+
? duration + 'ms'
|
251
|
+
: duration
|
252
|
+
;
|
253
|
+
module.verbose('Setting animation duration', duration);
|
254
|
+
$module
|
255
|
+
.css({
|
256
|
+
'-webkit-animation-duration': duration,
|
257
|
+
'-moz-animation-duration': duration,
|
258
|
+
'-ms-animation-duration': duration,
|
259
|
+
'-o-animation-duration': duration,
|
260
|
+
'animation-duration': duration
|
261
|
+
})
|
262
|
+
;
|
223
263
|
},
|
224
|
-
|
225
264
|
display: function() {
|
226
265
|
var
|
227
|
-
|
266
|
+
style = module.get.style(),
|
267
|
+
displayType = module.get.displayType(),
|
268
|
+
overrideStyle = style + 'display: ' + displayType + ' !important;'
|
228
269
|
;
|
229
|
-
|
230
|
-
|
270
|
+
$module.css('display', '');
|
271
|
+
module.refresh();
|
272
|
+
if( $module.css('display') !== displayType ) {
|
273
|
+
module.verbose('Setting inline visibility to', displayType);
|
231
274
|
$module
|
232
|
-
.
|
233
|
-
display: displayType
|
234
|
-
})
|
275
|
+
.attr('style', overrideStyle)
|
235
276
|
;
|
236
277
|
}
|
237
278
|
},
|
238
|
-
|
239
279
|
direction: function() {
|
240
|
-
if($module.is(':visible')) {
|
280
|
+
if($module.is(':visible') && !module.is.hidden()) {
|
241
281
|
module.debug('Automatically determining the direction of animation', 'Outward');
|
242
282
|
$module
|
243
283
|
.removeClass(className.inward)
|
@@ -252,39 +292,26 @@ $.fn.transition = function() {
|
|
252
292
|
;
|
253
293
|
}
|
254
294
|
},
|
255
|
-
|
256
295
|
looping: function() {
|
257
296
|
module.debug('Transition set to loop');
|
258
297
|
$module
|
259
298
|
.addClass(className.looping)
|
260
299
|
;
|
261
300
|
},
|
262
|
-
|
263
|
-
duration: function(duration) {
|
264
|
-
duration = duration || settings.duration;
|
265
|
-
duration = (typeof duration == 'number')
|
266
|
-
? duration + 'ms'
|
267
|
-
: duration
|
268
|
-
;
|
269
|
-
module.verbose('Setting animation duration', duration);
|
270
|
-
$module
|
271
|
-
.css({
|
272
|
-
'-webkit-animation-duration': duration,
|
273
|
-
'-moz-animation-duration': duration,
|
274
|
-
'-ms-animation-duration': duration,
|
275
|
-
'-o-animation-duration': duration,
|
276
|
-
'animation-duration': duration
|
277
|
-
})
|
278
|
-
;
|
279
|
-
},
|
280
|
-
|
281
301
|
hidden: function() {
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
302
|
+
if(!module.is.hidden()) {
|
303
|
+
$module
|
304
|
+
.addClass(className.transition)
|
305
|
+
.addClass(className.hidden)
|
306
|
+
;
|
307
|
+
if($module.css('display') !== 'none') {
|
308
|
+
module.verbose('Overriding default display to hide element');
|
309
|
+
$module
|
310
|
+
.css('display', 'none')
|
311
|
+
;
|
312
|
+
}
|
313
|
+
}
|
286
314
|
},
|
287
|
-
|
288
315
|
visible: function() {
|
289
316
|
$module
|
290
317
|
.addClass(className.transition)
|
@@ -295,102 +322,124 @@ $.fn.transition = function() {
|
|
295
322
|
|
296
323
|
save: {
|
297
324
|
displayType: function(displayType) {
|
298
|
-
|
325
|
+
$module.data(metadata.displayType, displayType);
|
299
326
|
},
|
300
327
|
transitionExists: function(animation, exists) {
|
301
328
|
$.fn.transition.exists[animation] = exists;
|
302
329
|
module.verbose('Saving existence of transition', animation, exists);
|
303
330
|
},
|
304
331
|
conditions: function() {
|
305
|
-
|
332
|
+
var
|
333
|
+
clasName = $module.attr('class') || false,
|
334
|
+
style = $module.attr('style') || ''
|
335
|
+
;
|
336
|
+
$module.removeClass(settings.animation);
|
337
|
+
module.remove.direction();
|
338
|
+
module.cache = {
|
306
339
|
className : $module.attr('class'),
|
307
|
-
style :
|
340
|
+
style : module.get.style()
|
308
341
|
};
|
309
|
-
module.verbose('Saving original attributes',
|
342
|
+
module.verbose('Saving original attributes', module.cache);
|
310
343
|
}
|
311
344
|
},
|
312
345
|
|
313
346
|
restore: {
|
314
347
|
conditions: function() {
|
315
|
-
if(
|
348
|
+
if(module.cache === undefined) {
|
316
349
|
return false;
|
317
350
|
}
|
318
|
-
if(
|
319
|
-
$module.attr('class',
|
351
|
+
if(module.cache.className) {
|
352
|
+
$module.attr('class', module.cache.className);
|
320
353
|
}
|
321
354
|
else {
|
322
355
|
$module.removeAttr('class');
|
323
356
|
}
|
324
|
-
if(
|
325
|
-
|
326
|
-
|
327
|
-
else {
|
328
|
-
if(module.get.displayType() === 'block') {
|
329
|
-
$module.removeAttr('style');
|
330
|
-
}
|
357
|
+
if(module.cache.style) {
|
358
|
+
module.verbose('Restoring original style attribute', module.cache.style);
|
359
|
+
$module.attr('style', module.cache.style);
|
331
360
|
}
|
332
361
|
if(module.is.looping()) {
|
333
362
|
module.remove.looping();
|
334
363
|
}
|
335
|
-
module.verbose('Restoring original attributes',
|
364
|
+
module.verbose('Restoring original attributes', module.cache);
|
336
365
|
}
|
337
366
|
},
|
338
367
|
|
339
|
-
|
368
|
+
add: {
|
369
|
+
failSafe: function() {
|
370
|
+
var
|
371
|
+
duration = module.get.duration()
|
372
|
+
;
|
373
|
+
module.timer = setTimeout(module.complete, duration + 100);
|
374
|
+
module.verbose('Adding fail safe timer', module.timer);
|
375
|
+
}
|
376
|
+
},
|
340
377
|
|
378
|
+
remove: {
|
341
379
|
animating: function() {
|
342
380
|
$module.removeClass(className.animating);
|
343
381
|
},
|
344
|
-
|
345
|
-
display: function() {
|
346
|
-
if(instance.displayType !== undefined) {
|
347
|
-
$module.css('display', '');
|
348
|
-
}
|
349
|
-
},
|
350
|
-
|
351
|
-
duration: function() {
|
382
|
+
animation: function() {
|
352
383
|
$module
|
353
384
|
.css({
|
354
|
-
'-webkit-animation
|
355
|
-
'-moz-animation
|
356
|
-
'-ms-animation
|
357
|
-
'-o-animation
|
358
|
-
'animation
|
385
|
+
'-webkit-animation' : '',
|
386
|
+
'-moz-animation' : '',
|
387
|
+
'-ms-animation' : '',
|
388
|
+
'-o-animation' : '',
|
389
|
+
'animation' : ''
|
359
390
|
})
|
360
391
|
;
|
361
392
|
},
|
362
|
-
|
393
|
+
animationEndCallback: function() {
|
394
|
+
$module.off('.complete');
|
395
|
+
},
|
396
|
+
display: function() {
|
397
|
+
$module.css('display', '');
|
398
|
+
},
|
399
|
+
direction: function() {
|
400
|
+
$module
|
401
|
+
.removeClass(className.inward)
|
402
|
+
.removeClass(className.outward)
|
403
|
+
;
|
404
|
+
},
|
405
|
+
failSafe: function() {
|
406
|
+
module.verbose('Removing fail safe timer', module.timer);
|
407
|
+
if(module.timer) {
|
408
|
+
clearTimeout(module.timer);
|
409
|
+
}
|
410
|
+
},
|
363
411
|
hidden: function() {
|
364
412
|
$module.removeClass(className.hidden);
|
365
413
|
},
|
366
|
-
|
367
414
|
visible: function() {
|
368
415
|
$module.removeClass(className.visible);
|
369
416
|
},
|
370
|
-
|
371
417
|
looping: function() {
|
372
418
|
module.debug('Transitions are no longer looping');
|
373
419
|
$module
|
374
420
|
.removeClass(className.looping)
|
375
421
|
;
|
376
422
|
module.forceRepaint();
|
423
|
+
},
|
424
|
+
transition: function() {
|
425
|
+
$module
|
426
|
+
.removeClass(className.visible)
|
427
|
+
.removeClass(className.hidden)
|
428
|
+
;
|
377
429
|
}
|
378
|
-
|
379
430
|
},
|
380
|
-
|
381
431
|
get: {
|
382
|
-
|
383
|
-
settings: function(animation, duration, complete) {
|
432
|
+
settings: function(animation, duration, onComplete) {
|
384
433
|
// single settings object
|
385
434
|
if(typeof animation == 'object') {
|
386
435
|
return $.extend(true, {}, $.fn.transition.settings, animation);
|
387
436
|
}
|
388
437
|
// all arguments provided
|
389
|
-
else if(typeof
|
438
|
+
else if(typeof onComplete == 'function') {
|
390
439
|
return $.extend({}, $.fn.transition.settings, {
|
391
|
-
animation
|
392
|
-
|
393
|
-
duration
|
440
|
+
animation : animation,
|
441
|
+
onComplete : onComplete,
|
442
|
+
duration : duration
|
394
443
|
});
|
395
444
|
}
|
396
445
|
// only duration provided
|
@@ -409,8 +458,8 @@ $.fn.transition = function() {
|
|
409
458
|
// duration is actually callback
|
410
459
|
else if(typeof duration == 'function') {
|
411
460
|
return $.extend({}, $.fn.transition.settings, {
|
412
|
-
animation
|
413
|
-
|
461
|
+
animation : animation,
|
462
|
+
onComplete : duration
|
414
463
|
});
|
415
464
|
}
|
416
465
|
// only animation provided
|
@@ -421,19 +470,34 @@ $.fn.transition = function() {
|
|
421
470
|
}
|
422
471
|
return $.fn.transition.settings;
|
423
472
|
},
|
424
|
-
|
473
|
+
duration: function(duration) {
|
474
|
+
duration = duration || settings.duration;
|
475
|
+
return (typeof settings.duration === 'string')
|
476
|
+
? (duration.indexOf('ms') > -1)
|
477
|
+
? parseFloat(duration)
|
478
|
+
: parseFloat(duration) * 1000
|
479
|
+
: duration
|
480
|
+
;
|
481
|
+
},
|
425
482
|
displayType: function() {
|
426
|
-
if(
|
483
|
+
if(settings.displayType) {
|
484
|
+
return settings.displayType;
|
485
|
+
}
|
486
|
+
if($module.data(metadata.displayType) === undefined) {
|
427
487
|
// create fake element to determine display state
|
428
|
-
module.can.transition();
|
488
|
+
module.can.transition(true);
|
429
489
|
}
|
430
|
-
return
|
490
|
+
return $module.data(metadata.displayType);
|
491
|
+
},
|
492
|
+
style: function() {
|
493
|
+
var
|
494
|
+
style = $module.attr('style') || ''
|
495
|
+
;
|
496
|
+
return style.replace(/display.*?;/, '');
|
431
497
|
},
|
432
|
-
|
433
498
|
transitionExists: function(animation) {
|
434
499
|
return $.fn.transition.exists[animation];
|
435
500
|
},
|
436
|
-
|
437
501
|
animationName: function() {
|
438
502
|
var
|
439
503
|
element = document.createElement('div'),
|
@@ -447,27 +511,42 @@ $.fn.transition = function() {
|
|
447
511
|
;
|
448
512
|
for(animation in animations){
|
449
513
|
if( element.style[animation] !== undefined ){
|
450
|
-
module.verbose('Determined animation vendor name property', animations[animation]);
|
451
514
|
return animations[animation];
|
452
515
|
}
|
453
516
|
}
|
454
517
|
return false;
|
455
518
|
},
|
456
|
-
|
457
|
-
|
519
|
+
animationStartEvent: function() {
|
520
|
+
var
|
521
|
+
element = document.createElement('div'),
|
522
|
+
animations = {
|
523
|
+
'animation' :'animationstart',
|
524
|
+
'OAnimation' :'oAnimationStart',
|
525
|
+
'MozAnimation' :'mozAnimationStart',
|
526
|
+
'WebkitAnimation' :'webkitAnimationStart'
|
527
|
+
},
|
528
|
+
animation
|
529
|
+
;
|
530
|
+
for(animation in animations){
|
531
|
+
if( element.style[animation] !== undefined ){
|
532
|
+
return animations[animation];
|
533
|
+
}
|
534
|
+
}
|
535
|
+
return false;
|
536
|
+
},
|
537
|
+
animationEndEvent: function() {
|
458
538
|
var
|
459
539
|
element = document.createElement('div'),
|
460
540
|
animations = {
|
461
541
|
'animation' :'animationend',
|
462
542
|
'OAnimation' :'oAnimationEnd',
|
463
|
-
'MozAnimation' :'
|
543
|
+
'MozAnimation' :'mozAnimationEnd',
|
464
544
|
'WebkitAnimation' :'webkitAnimationEnd'
|
465
545
|
},
|
466
546
|
animation
|
467
547
|
;
|
468
548
|
for(animation in animations){
|
469
549
|
if( element.style[animation] !== undefined ){
|
470
|
-
module.verbose('Determined animation vendor end event', animations[animation]);
|
471
550
|
return animations[animation];
|
472
551
|
}
|
473
552
|
}
|
@@ -477,35 +556,27 @@ $.fn.transition = function() {
|
|
477
556
|
},
|
478
557
|
|
479
558
|
can: {
|
480
|
-
|
481
|
-
if($module.css(settings.animation) !== 'none') {
|
482
|
-
module.debug('CSS definition found', $module.css(settings.animation));
|
483
|
-
return true;
|
484
|
-
}
|
485
|
-
else {
|
486
|
-
module.debug('Unable to find css definition', $module.attr('class'));
|
487
|
-
return false;
|
488
|
-
}
|
489
|
-
},
|
490
|
-
transition: function() {
|
559
|
+
transition: function(forced) {
|
491
560
|
var
|
492
|
-
elementClass
|
493
|
-
|
494
|
-
|
561
|
+
elementClass = $module.attr('class'),
|
562
|
+
tagName = $module.prop('tagName'),
|
563
|
+
animation = settings.animation,
|
564
|
+
transitionExists = module.get.transitionExists(animation),
|
495
565
|
$clone,
|
496
566
|
currentAnimation,
|
497
567
|
inAnimation,
|
568
|
+
directionExists,
|
498
569
|
displayType
|
499
570
|
;
|
500
|
-
if( transitionExists === undefined ||
|
571
|
+
if( transitionExists === undefined || forced) {
|
501
572
|
module.verbose('Determining whether animation exists');
|
502
|
-
$clone = $('<
|
573
|
+
$clone = $('<' + tagName + ' />').addClass( elementClass ).insertAfter($module);
|
503
574
|
currentAnimation = $clone
|
575
|
+
.addClass(animation)
|
504
576
|
.removeClass(className.inward)
|
505
577
|
.removeClass(className.outward)
|
506
578
|
.addClass(className.animating)
|
507
579
|
.addClass(className.transition)
|
508
|
-
.addClass(animation)
|
509
580
|
.css(animationName)
|
510
581
|
;
|
511
582
|
inAnimation = $clone
|
@@ -514,23 +585,37 @@ $.fn.transition = function() {
|
|
514
585
|
;
|
515
586
|
displayType = $clone
|
516
587
|
.attr('class', elementClass)
|
588
|
+
.removeAttr('style')
|
589
|
+
.removeClass(className.hidden)
|
590
|
+
.removeClass(className.visible)
|
517
591
|
.show()
|
518
592
|
.css('display')
|
519
593
|
;
|
520
594
|
module.verbose('Determining final display state', displayType);
|
595
|
+
$clone.remove();
|
521
596
|
if(currentAnimation != inAnimation) {
|
522
|
-
module.debug('
|
523
|
-
|
597
|
+
module.debug('Direction exists for animation', animation);
|
598
|
+
directionExists = true;
|
599
|
+
}
|
600
|
+
else if(currentAnimation == 'none' || !currentAnimation) {
|
601
|
+
module.debug('No animation defined in css', animation);
|
602
|
+
return;
|
524
603
|
}
|
525
604
|
else {
|
526
605
|
module.debug('Static animation found', animation, displayType);
|
527
|
-
|
606
|
+
directionExists = false;
|
528
607
|
}
|
529
|
-
$clone.remove();
|
530
608
|
module.save.displayType(displayType);
|
531
|
-
module.save.transitionExists(animation,
|
609
|
+
module.save.transitionExists(animation, directionExists);
|
532
610
|
}
|
533
|
-
return transitionExists
|
611
|
+
return (transitionExists !== undefined)
|
612
|
+
? transitionExists
|
613
|
+
: directionExists
|
614
|
+
;
|
615
|
+
},
|
616
|
+
animate: function() {
|
617
|
+
// can transition does not return a value if animation does not exist
|
618
|
+
return (module.can.transition() !== undefined);
|
534
619
|
}
|
535
620
|
},
|
536
621
|
|
@@ -549,11 +634,15 @@ $.fn.transition = function() {
|
|
549
634
|
},
|
550
635
|
occuring: function(animation) {
|
551
636
|
animation = animation || settings.animation;
|
552
|
-
|
637
|
+
animation = animation.replace(' ', '.');
|
638
|
+
return ( $module.filter(animation).size() > 0 );
|
553
639
|
},
|
554
640
|
visible: function() {
|
555
641
|
return $module.is(':visible');
|
556
642
|
},
|
643
|
+
hidden: function() {
|
644
|
+
return $module.css('visibility') === 'hidden';
|
645
|
+
},
|
557
646
|
supported: function() {
|
558
647
|
return(animationName !== false && animationEnd !== false);
|
559
648
|
}
|
@@ -561,6 +650,10 @@ $.fn.transition = function() {
|
|
561
650
|
|
562
651
|
hide: function() {
|
563
652
|
module.verbose('Hiding element');
|
653
|
+
if( module.is.animating() ) {
|
654
|
+
module.reset();
|
655
|
+
}
|
656
|
+
module.remove.display();
|
564
657
|
module.remove.visible();
|
565
658
|
module.set.hidden();
|
566
659
|
module.repaint();
|
@@ -589,6 +682,7 @@ $.fn.transition = function() {
|
|
589
682
|
},
|
590
683
|
|
591
684
|
setting: function(name, value) {
|
685
|
+
module.debug('Changing setting', name, value);
|
592
686
|
if( $.isPlainObject(name) ) {
|
593
687
|
$.extend(true, settings, name);
|
594
688
|
}
|
@@ -649,14 +743,14 @@ $.fn.transition = function() {
|
|
649
743
|
executionTime = currentTime - previousTime;
|
650
744
|
time = currentTime;
|
651
745
|
performance.push({
|
652
|
-
'Element' : element,
|
653
746
|
'Name' : message[0],
|
654
747
|
'Arguments' : [].slice.call(message, 1) || '',
|
748
|
+
'Element' : element,
|
655
749
|
'Execution Time' : executionTime
|
656
750
|
});
|
657
751
|
}
|
658
752
|
clearTimeout(module.performance.timer);
|
659
|
-
module.performance.timer = setTimeout(module.performance.display,
|
753
|
+
module.performance.timer = setTimeout(module.performance.display, 600);
|
660
754
|
},
|
661
755
|
display: function() {
|
662
756
|
var
|
@@ -690,6 +784,7 @@ $.fn.transition = function() {
|
|
690
784
|
performance = [];
|
691
785
|
}
|
692
786
|
},
|
787
|
+
// modified for transition to return invoke success
|
693
788
|
invoke: function(query, passedArguments, context) {
|
694
789
|
var
|
695
790
|
object = instance,
|
@@ -732,6 +827,7 @@ $.fn.transition = function() {
|
|
732
827
|
else if(found !== undefined) {
|
733
828
|
response = found;
|
734
829
|
}
|
830
|
+
|
735
831
|
if($.isArray(returnedValue)) {
|
736
832
|
returnedValue.push(response);
|
737
833
|
}
|
@@ -741,7 +837,10 @@ $.fn.transition = function() {
|
|
741
837
|
else if(response !== undefined) {
|
742
838
|
returnedValue = response;
|
743
839
|
}
|
744
|
-
return found
|
840
|
+
return (found !== undefined)
|
841
|
+
? found
|
842
|
+
: false
|
843
|
+
;
|
745
844
|
}
|
746
845
|
};
|
747
846
|
module.initialize();
|
@@ -753,40 +852,52 @@ $.fn.transition = function() {
|
|
753
852
|
;
|
754
853
|
};
|
755
854
|
|
855
|
+
// Records if CSS transition is available
|
756
856
|
$.fn.transition.exists = {};
|
757
857
|
|
758
858
|
$.fn.transition.settings = {
|
759
859
|
|
760
860
|
// module info
|
761
|
-
name
|
861
|
+
name : 'Transition',
|
762
862
|
|
763
863
|
// debug content outputted to console
|
764
|
-
debug
|
864
|
+
debug : false,
|
765
865
|
|
766
866
|
// verbose debug output
|
767
|
-
verbose
|
867
|
+
verbose : true,
|
768
868
|
|
769
869
|
// performance data output
|
770
|
-
performance
|
870
|
+
performance : true,
|
771
871
|
|
772
872
|
// event namespace
|
773
|
-
namespace
|
873
|
+
namespace : 'transition',
|
774
874
|
|
775
875
|
// animation complete event
|
776
|
-
|
777
|
-
|
778
|
-
|
876
|
+
onStart : function() {},
|
877
|
+
onComplete : function() {},
|
878
|
+
onShow : function() {},
|
879
|
+
onHide : function() {},
|
779
880
|
|
780
|
-
// whether
|
881
|
+
// whether timeout should be used to ensure callback fires in cases animationend does not
|
882
|
+
useFailSafe : false,
|
883
|
+
|
884
|
+
// whether EXACT animation can occur twice in a row
|
781
885
|
allowRepeats : false,
|
782
886
|
|
887
|
+
// Override final display type on visible
|
888
|
+
displayType : false,
|
889
|
+
|
783
890
|
// animation duration
|
784
|
-
animation
|
785
|
-
duration
|
891
|
+
animation : 'fade',
|
892
|
+
duration : '500ms',
|
786
893
|
|
787
894
|
// new animations will occur after previous ones
|
788
895
|
queue : true,
|
789
896
|
|
897
|
+
metadata : {
|
898
|
+
displayType: 'display'
|
899
|
+
},
|
900
|
+
|
790
901
|
className : {
|
791
902
|
animating : 'animating',
|
792
903
|
disabled : 'disabled',
|
@@ -795,7 +906,7 @@ $.fn.transition.settings = {
|
|
795
906
|
loading : 'loading',
|
796
907
|
looping : 'looping',
|
797
908
|
outward : 'out',
|
798
|
-
transition : '
|
909
|
+
transition : 'transition',
|
799
910
|
visible : 'visible'
|
800
911
|
},
|
801
912
|
|