lychee/js/modules/loadingBar.js
Tobias Reich 34413640e4 V1.3
New:
- Protect public albums with passwords
- Export to Dropbox
- Sharing-Link is displayed directly inside the sharing-dropdown
- Delete photos with cmd+backspace

Improved:
- Massive speed improvements
- Changing the title, starring, description, etc. is now instant
- Longer filenames for pictures (more security)

ShortLinks are removed for more independency and privacy.
There are a lot of changes under the hood, including a lot of bug fixes and improvements. Please report every bug you find!

How to update:
1. Replace all files, excluding `uploads/` and `php/config.php`
2. Open `php/update.php` in your browser
2013-09-03 11:59:30 +02:00

66 lines
1.7 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) {
if (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");
clearTimeout(lychee.loadingBar.data("timeout"));
lychee.loadingBar.data("timeout", setTimeout(function() { loadingBar.hide(true) }, 3000));
} else if (loadingBar.status==null) {
loadingBar.status = "loading";
clearTimeout(lychee.loadingBar.data("timeout"));
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(); });
}
}
}