lychee/js/modules/loadingBar.js
Tobias Reich 4e5c836b8d Lychee 1.2
- Share whole albums
- Public Mode
- Import images via URL
- New Share-Button
- Improved Toolbar
- Check for updates (see config.php)
- ASC or DESC sorting (see config.php)
- Download album fixed
- Code optimizations (thanks @tibounise)
- Changes and enhancements

Update from version 1.0 or 1.1:
1. Replace all files, excluding `uploads/`
2. Open php/config.php and reconfigure your installation (We added new settings)
3. Open php/update.php in your browser
2013-06-17 20:40:04 +02:00

66 lines
1.6 KiB
JavaScript
Executable File

/**
* @name loadingBar.js
* @author Philipp Maurer
* @author Tobias Reich
* @copyright 2013 by Philipp Maurer, Tobias Reich
*
* LoadingBar Module
* This module is used to show and hide the loading bar.
*/
loadingBar = {
status: null,
show: function(status, errorTitle, errorText) {
clearTimeout(lychee.loadingBar.data("timeout"));
if (status=="error"&&loadingBar.status!="error") {
loadingBar.status = "error";
if (!errorTitle) errorTitle = "Error";
if (!errorText) errorText = "Whoops, it looks like something went wrong. Please reload the site and try again!"
lychee.loadingBar
.removeClass("loading uploading error")
.addClass(status)
.html("<h1>" + errorTitle + ": <span>" + errorText + "</span></h1>")
.show()
.css("height", "40px");
if (visible.controls()) lychee.header.css("margin-Top", "40px");
lychee.loadingBar.data("timeout", setTimeout(function () { loadingBar.hide(true) }, 3000));
} else if (loadingBar.status==null) {
loadingBar.status = "loading";
lychee.loadingBar.data("timeout", setTimeout(function () {
lychee.loadingBar
.show()
.removeClass("loading uploading error")
.addClass("loading");
if (visible.controls()) lychee.header.css("margin-Top", "3px");
}, 1000));
}
},
hide: function(force_hide) {
if ((loadingBar.status!="error"&&loadingBar.status!=null)||force_hide) {
loadingBar.status = null;
clearTimeout(lychee.loadingBar.data("timeout"));
lychee.loadingBar.html("").css("height", "3px");
if (visible.controls()) lychee.header.css("marginTop", "0px");
$.timer(300,function(){ lychee.loadingBar.hide(); });
}
}
}