More logging to wrapper
This commit is contained in:
parent
995d87c167
commit
820346c98d
2 changed files with 10 additions and 4 deletions
|
@ -10,7 +10,7 @@ class Loading
|
||||||
$(".progressbar").css("transform": "scaleX(#{parseInt(percent*100)/100})").css("opacity", "1").css("display", "block")
|
$(".progressbar").css("transform": "scaleX(#{parseInt(percent*100)/100})").css("opacity", "1").css("display", "block")
|
||||||
|
|
||||||
hideProgress: ->
|
hideProgress: ->
|
||||||
console.log "hideProgress"
|
@log "hideProgress"
|
||||||
@timer_hide = setTimeout ( =>
|
@timer_hide = setTimeout ( =>
|
||||||
$(".progressbar").css("transform": "scaleX(1)").css("opacity", "0").hideLater(1000)
|
$(".progressbar").css("transform": "scaleX(1)").css("opacity", "0").hideLater(1000)
|
||||||
), 300
|
), 300
|
||||||
|
@ -23,6 +23,7 @@ class Loading
|
||||||
|
|
||||||
|
|
||||||
showTooLarge: (site_info) ->
|
showTooLarge: (site_info) ->
|
||||||
|
@log "Displaying large site confirmation"
|
||||||
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>")
|
||||||
|
@ -52,7 +53,7 @@ class Loading
|
||||||
|
|
||||||
# We dont need loadingscreen anymore
|
# We dont need loadingscreen anymore
|
||||||
hideScreen: ->
|
hideScreen: ->
|
||||||
console.log "hideScreen"
|
@log "hideScreen"
|
||||||
if not $(".loadingscreen").hasClass("done") # Only if its not animating already
|
if not $(".loadingscreen").hasClass("done") # Only if its not animating already
|
||||||
if @screen_visible # Hide with animate
|
if @screen_visible # Hide with animate
|
||||||
$(".loadingscreen").addClass("done").removeLater(2000)
|
$(".loadingscreen").addClass("done").removeLater(2000)
|
||||||
|
@ -80,6 +81,8 @@ class Loading
|
||||||
if type == "warning" then line.addClass("console-warning")
|
if type == "warning" then line.addClass("console-warning")
|
||||||
return line
|
return line
|
||||||
|
|
||||||
|
log: (args...) ->
|
||||||
|
console.log "[Loading]", args...
|
||||||
|
|
||||||
|
|
||||||
window.Loading = Loading
|
window.Loading = Loading
|
||||||
|
|
|
@ -417,6 +417,7 @@ class Wrapper
|
||||||
@reload(message.params[0])
|
@reload(message.params[0])
|
||||||
|
|
||||||
reload: (url_post="") ->
|
reload: (url_post="") ->
|
||||||
|
@log "Reload"
|
||||||
current_url = window.location.toString().replace(/#.*/g, "")
|
current_url = window.location.toString().replace(/#.*/g, "")
|
||||||
if url_post
|
if url_post
|
||||||
if current_url.indexOf("?") > 0
|
if current_url.indexOf("?") > 0
|
||||||
|
@ -492,6 +493,7 @@ class Wrapper
|
||||||
|
|
||||||
# Iframe loaded
|
# Iframe loaded
|
||||||
onPageLoad: (e) =>
|
onPageLoad: (e) =>
|
||||||
|
@log "onPageLoad"
|
||||||
@inner_loaded = true
|
@inner_loaded = true
|
||||||
if not @inner_ready then @sendInner {"cmd": "wrapperReady"} # Inner frame loaded before wrapper
|
if not @inner_ready then @sendInner {"cmd": "wrapperReady"} # Inner frame loaded before wrapper
|
||||||
#if not @site_error then @loading.hideScreen() # Hide loading screen
|
#if not @site_error then @loading.hideScreen() # Hide loading screen
|
||||||
|
@ -553,8 +555,8 @@ class Wrapper
|
||||||
@loading.hideScreen()
|
@loading.hideScreen()
|
||||||
if not @site_info then @reloadSiteInfo()
|
if not @site_info then @reloadSiteInfo()
|
||||||
if site_info.content
|
if site_info.content
|
||||||
window.document.title = site_info.content.title+" - ZeroNet"
|
window.document.title = site_info.content.title + " - ZeroNet"
|
||||||
@log "Required file done, setting title to", window.document.title
|
@log "Required file #{window.file_inner_path} done, setting title to", window.document.title
|
||||||
if not window.show_loadingscreen
|
if not window.show_loadingscreen
|
||||||
@notifications.add("modified", "info", "New version of this page has just released.<br>Reload to see the modified content.")
|
@notifications.add("modified", "info", "New version of this page has just released.<br>Reload to see the modified content.")
|
||||||
# File failed downloading
|
# File failed downloading
|
||||||
|
@ -675,6 +677,7 @@ class Wrapper
|
||||||
|
|
||||||
|
|
||||||
setSizeLimit: (size_limit, reload=true) =>
|
setSizeLimit: (size_limit, reload=true) =>
|
||||||
|
@log "setSizeLimit: #{size_limit}, reload: #{reload}"
|
||||||
@ws.cmd "siteSetLimit", [size_limit], (res) =>
|
@ws.cmd "siteSetLimit", [size_limit], (res) =>
|
||||||
if res != "ok"
|
if res != "ok"
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue