version 0.2.5, download and update progress bar, we are on gitter, log on filerequest error, faster update

This commit is contained in:
HelloZeroNet 2015-02-26 01:32:27 +01:00
parent 34f6d1ee7c
commit bd7e76628b
12 changed files with 62 additions and 10 deletions

View file

@ -3,6 +3,15 @@ class Loading
if window.show_loadingscreen then @showScreen()
setProgress: (percent) ->
console.log "Progress:", percent
$(".progressbar").css("width", percent*100+"%").css("opacity", "1").css("display", "block")
hideProgress: ->
$(".progressbar").css("width", "100%").css("opacity", "0").cssLater("display", "none", 1000)
console.log "Hideprogress"
showScreen: ->
$(".loadingscreen").css("display", "block").addClassLater("ready")
@screen_visible = true

View file

@ -253,6 +253,11 @@ class Wrapper
if @loading.screen_visible and @inner_loaded and site_info.settings.size < site_info.size_limit*1024*1024 # Loading screen still visible, but inner loaded
@loading.hideScreen()
if site_info.tasks > 0 and site_info.started_task_num > 0
@loading.setProgress 1-(site_info.tasks / site_info.started_task_num)
else
@loading.hideProgress()
@site_info = site_info

View file

@ -100,6 +100,13 @@ a { color: black }
.loadingscreen.done .console { transform: translateY(300px); opacity: 0; transition: all 1.5s }
.loadingscreen.done .flipper-container { opacity: 0; transition: all 1.5s }
.progressbar { background: #26C281; position: fixed; z-index: 100; top: 0; left: 0; width: 0%; height: 2px; transition: width 0.5s, opacity 1s; display: none }
.progressbar .peg {
display: block; position: absolute; right: 0px; width: 100px; height: 100%;
box-shadow: 0 0 10px #AF3BFF, 0 0 5px #29d; opacity: 1.0; transform: rotate(3deg) translate(0px, -4px);
}
/* Animations */
@keyframes flip {

View file

@ -105,6 +105,13 @@ a { color: black }
.loadingscreen.done .console { -webkit-transform: translateY(300px); -moz-transform: translateY(300px); -o-transform: translateY(300px); -ms-transform: translateY(300px); transform: translateY(300px) ; opacity: 0; -webkit-transition: all 1.5s ; -moz-transition: all 1.5s ; -o-transition: all 1.5s ; -ms-transition: all 1.5s ; transition: all 1.5s }
.loadingscreen.done .flipper-container { opacity: 0; -webkit-transition: all 1.5s ; -moz-transition: all 1.5s ; -o-transition: all 1.5s ; -ms-transition: all 1.5s ; transition: all 1.5s }
.progressbar { background: #26C281; position: fixed; z-index: 100; top: 0; left: 0; width: 0%; height: 2px; -webkit-transition: width 0.5s, opacity 1s; -moz-transition: width 0.5s, opacity 1s; -o-transition: width 0.5s, opacity 1s; -ms-transition: width 0.5s, opacity 1s; transition: width 0.5s, opacity 1s ; display: none }
.progressbar .peg {
display: block; position: absolute; right: 0px; width: 100px; height: 100%;
-webkit-box-shadow: 0 0 10px #AF3BFF, 0 0 5px #29d; -moz-box-shadow: 0 0 10px #AF3BFF, 0 0 5px #29d; -o-box-shadow: 0 0 10px #AF3BFF, 0 0 5px #29d; -ms-box-shadow: 0 0 10px #AF3BFF, 0 0 5px #29d; box-shadow: 0 0 10px #AF3BFF, 0 0 5px #29d ; opacity: 1.0; -webkit-transform: rotate(3deg) translate(0px, -4px); -moz-transform: rotate(3deg) translate(0px, -4px); -o-transform: rotate(3deg) translate(0px, -4px); -ms-transform: rotate(3deg) translate(0px, -4px); transform: rotate(3deg) translate(0px, -4px) ;
}
/* Animations */
@keyframes flip {

View file

@ -471,6 +471,16 @@ jQuery.extend( jQuery.easing,
}
}
Loading.prototype.setProgress = function(percent) {
console.log("Progress:", percent);
return $(".progressbar").css("width", percent * 100 + "%").css("opacity", "1").css("display", "block");
};
Loading.prototype.hideProgress = function() {
$(".progressbar").css("width", "100%").css("opacity", "0").cssLater("display", "none", 1000);
return console.log("Hideprogress");
};
Loading.prototype.showScreen = function() {
$(".loadingscreen").css("display", "block").addClassLater("ready");
this.screen_visible = true;
@ -1060,6 +1070,11 @@ jQuery.extend( jQuery.easing,
if (this.loading.screen_visible && this.inner_loaded && site_info.settings.size < site_info.size_limit * 1024 * 1024) {
this.loading.hideScreen();
}
if (site_info.tasks > 0 && site_info.started_task_num > 0) {
this.loading.setProgress(1 - (site_info.tasks / site_info.started_task_num));
} else {
this.loading.hideProgress();
}
return this.site_info = site_info;
};