Concatenate all general js files into tutti.js

This commit is contained in:
2016-09-29 12:22:53 +02:00
parent bdbf460623
commit 4c4489a890
5 changed files with 75 additions and 63 deletions

View File

@@ -0,0 +1,52 @@
(function ( $ ) {
$.fn.flashOnce = function() {
var target = this;
this
.addClass('flash-on')
.delay(1000) // this delay is linked to the transition in the flash-on CSS class.
.queue(function() {
target
.removeClass('flash-on')
.addClass('flash-off')
.dequeue()
;})
.delay(1000) // this delay is just to clean up the flash-X classes.
.queue(function() {
target
.removeClass('flash-on flash-off')
.dequeue()
;})
;
return this;
};
/**
* Fades out the element, then erases its contents and shows the now-empty element again.
*/
$.fn.fadeOutAndClear = function(fade_speed) {
var target = this;
this
.fadeOut(fade_speed, function() {
target
.html('')
.show();
});
}
$.fn.hideAndRemove = function(hide_speed, finished) {
this.slideUp(hide_speed, function() {
this.remove();
if (typeof finished !== 'undefined') finished();
});
}
$.fn.removeClassPrefix = function(prefix) {
this.each(function(i, el) {
var classes = el.className.split(" ").filter(function(c) {
return c.lastIndexOf(prefix, 0) !== 0;
});
el.className = $.trim(classes.join(" "));
});
return this;
};
}(jQuery));