Rev3337, Fix big site download button

This commit is contained in:
shortcutme 2018-02-22 23:34:18 +01:00
parent dea669ac26
commit bda31aea59
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
4 changed files with 15 additions and 11 deletions

View file

@ -10,7 +10,7 @@ class Config(object):
def __init__(self, argv): def __init__(self, argv):
self.version = "0.6.2" self.version = "0.6.2"
self.rev = 3335 self.rev = 3337
self.argv = argv self.argv = argv
self.action = None self.action = None
self.config_file = "zeronet.conf" self.config_file = "zeronet.conf"

View file

@ -1,5 +1,5 @@
class Loading class Loading
constructor: -> constructor: (@wrapper) ->
if window.show_loadingscreen then @showScreen() if window.show_loadingscreen then @showScreen()
@timer_hide = null @timer_hide = null
@ -27,7 +27,8 @@ class Loading
if $(".console .button-setlimit").length == 0 # Not displaying it yet if $(".console .button-setlimit").length == 0 # Not displaying it yet
line = @printLine("Site size: <b>#{parseInt(site_info.settings.size/1024/1024)}MB</b> is larger than default allowed #{parseInt(site_info.size_limit)}MB", "warning") line = @printLine("Site size: <b>#{parseInt(site_info.settings.size/1024/1024)}MB</b> is larger than default allowed #{parseInt(site_info.size_limit)}MB", "warning")
button = $("<a href='#Set+limit' class='button button-setlimit'>" + "Open site and set size limit to #{site_info.next_size_limit}MB" + "</a>") button = $("<a href='#Set+limit' class='button button-setlimit'>" + "Open site and set size limit to #{site_info.next_size_limit}MB" + "</a>")
button.on "click", (-> return window.wrapper.setSizeLimit(site_info.next_size_limit) ) button.on "click", =>
return @wrapper.setSizeLimit(site_info.next_size_limit)
line.after(button) line.after(button)
setTimeout (=> setTimeout (=>
@printLine('Ready.') @printLine('Ready.')

View file

@ -2,7 +2,7 @@ class Wrapper
constructor: (ws_url) -> constructor: (ws_url) ->
@log "Created!" @log "Created!"
@loading = new Loading() @loading = new Loading(@)
@notifications = new Notifications($(".notifications")) @notifications = new Notifications($(".notifications"))
@fixbutton = new Fixbutton() @fixbutton = new Fixbutton()

View file

@ -574,7 +574,8 @@ jQuery.extend( jQuery.easing,
var Loading; var Loading;
Loading = (function() { Loading = (function() {
function Loading() { function Loading(wrapper) {
this.wrapper = wrapper;
if (window.show_loadingscreen) { if (window.show_loadingscreen) {
this.showScreen(); this.showScreen();
} }
@ -610,9 +611,11 @@ jQuery.extend( jQuery.easing,
if ($(".console .button-setlimit").length === 0) { if ($(".console .button-setlimit").length === 0) {
line = this.printLine("Site size: <b>" + (parseInt(site_info.settings.size / 1024 / 1024)) + "MB</b> is larger than default allowed " + (parseInt(site_info.size_limit)) + "MB", "warning"); line = this.printLine("Site size: <b>" + (parseInt(site_info.settings.size / 1024 / 1024)) + "MB</b> is larger than default allowed " + (parseInt(site_info.size_limit)) + "MB", "warning");
button = $("<a href='#Set+limit' class='button button-setlimit'>" + ("Open site and set size limit to " + site_info.next_size_limit + "MB") + "</a>"); button = $("<a href='#Set+limit' class='button button-setlimit'>" + ("Open site and set size limit to " + site_info.next_size_limit + "MB") + "</a>");
button.on("click", (function() { button.on("click", (function(_this) {
return window.wrapper.setSizeLimit(site_info.next_size_limit); return function() {
})); return _this.wrapper.setSizeLimit(site_info.next_size_limit);
};
})(this));
line.after(button); line.after(button);
return setTimeout(((function(_this) { return setTimeout(((function(_this) {
return function() { return function() {
@ -680,6 +683,7 @@ jQuery.extend( jQuery.easing,
}).call(this); }).call(this);
/* ---- src/Ui/media/Notifications.coffee ---- */ /* ---- src/Ui/media/Notifications.coffee ---- */
@ -830,7 +834,7 @@ jQuery.extend( jQuery.easing,
this.onMessageWebsocket = bind(this.onMessageWebsocket, this); this.onMessageWebsocket = bind(this.onMessageWebsocket, this);
this.verifyEvent = bind(this.verifyEvent, this); this.verifyEvent = bind(this.verifyEvent, this);
this.log("Created!"); this.log("Created!");
this.loading = new Loading(); this.loading = new Loading(this);
this.notifications = new Notifications($(".notifications")); this.notifications = new Notifications($(".notifications"));
this.fixbutton = new Fixbutton(); this.fixbutton = new Fixbutton();
window.addEventListener("message", this.onMessageInner, false); window.addEventListener("message", this.onMessageInner, false);
@ -1618,7 +1622,6 @@ jQuery.extend( jQuery.easing,
}).call(this); }).call(this);
/* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */ /* ---- src/Ui/media/WrapperZeroFrame.coffee ---- */