|
|
@ -10,7 +10,6 @@
|
|
|
|
init: ->
|
|
|
|
init: ->
|
|
|
|
try @initErrorTracking() catch
|
|
|
|
try @initErrorTracking() catch
|
|
|
|
return unless @browserCheck()
|
|
|
|
return unless @browserCheck()
|
|
|
|
@showLoading()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@el = $('._app')
|
|
|
|
@el = $('._app')
|
|
|
|
@localStorage = new LocalStorageStore
|
|
|
|
@localStorage = new LocalStorageStore
|
|
|
@ -38,8 +37,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
browserCheck: ->
|
|
|
|
browserCheck: ->
|
|
|
|
return true if @isSupportedBrowser()
|
|
|
|
return true if @isSupportedBrowser()
|
|
|
|
document.body.className = ''
|
|
|
|
|
|
|
|
document.body.innerHTML = app.templates.unsupportedBrowser
|
|
|
|
document.body.innerHTML = app.templates.unsupportedBrowser
|
|
|
|
|
|
|
|
@hideLoadingScreen()
|
|
|
|
false
|
|
|
|
false
|
|
|
|
|
|
|
|
|
|
|
|
initErrorTracking: ->
|
|
|
|
initErrorTracking: ->
|
|
|
@ -103,7 +102,7 @@
|
|
|
|
@initDoc(doc) for doc in @docs.all()
|
|
|
|
@initDoc(doc) for doc in @docs.all()
|
|
|
|
@trigger 'ready'
|
|
|
|
@trigger 'ready'
|
|
|
|
@router.start()
|
|
|
|
@router.start()
|
|
|
|
@hideLoading()
|
|
|
|
@hideLoadingScreen()
|
|
|
|
setTimeout =>
|
|
|
|
setTimeout =>
|
|
|
|
@welcomeBack() unless @doc
|
|
|
|
@welcomeBack() unless @doc
|
|
|
|
@removeEvent 'ready bootError'
|
|
|
|
@removeEvent 'ready bootError'
|
|
|
@ -181,15 +180,9 @@
|
|
|
|
new app.views.Tip(tip)
|
|
|
|
new app.views.Tip(tip)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
showLoading: ->
|
|
|
|
hideLoadingScreen: ->
|
|
|
|
document.body.classList.remove '_noscript'
|
|
|
|
|
|
|
|
document.body.classList.add '_loading'
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hideLoading: ->
|
|
|
|
|
|
|
|
document.body.classList.add '_overlay-scrollbars' if $.overlayScrollbarsEnabled()
|
|
|
|
document.body.classList.add '_overlay-scrollbars' if $.overlayScrollbarsEnabled()
|
|
|
|
document.body.classList.remove '_booting'
|
|
|
|
document.documentElement.classList.remove '_booting'
|
|
|
|
document.body.classList.remove '_loading'
|
|
|
|
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
indexHost: ->
|
|
|
|
indexHost: ->
|
|
|
@ -199,7 +192,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
onBootError: (args...) ->
|
|
|
|
onBootError: (args...) ->
|
|
|
|
@trigger 'bootError'
|
|
|
|
@trigger 'bootError'
|
|
|
|
@hideLoading()
|
|
|
|
@hideLoadingScreen()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
onQuotaExceeded: ->
|
|
|
|
onQuotaExceeded: ->
|
|
|
@ -221,7 +214,7 @@
|
|
|
|
@onInjectionError()
|
|
|
|
@onInjectionError()
|
|
|
|
else if @isAppError args...
|
|
|
|
else if @isAppError args...
|
|
|
|
@previousErrorHandler? args...
|
|
|
|
@previousErrorHandler? args...
|
|
|
|
@hideLoading()
|
|
|
|
@hideLoadingScreen()
|
|
|
|
@errorNotif or= new app.views.Notif 'Error'
|
|
|
|
@errorNotif or= new app.views.Notif 'Error'
|
|
|
|
@errorNotif.show()
|
|
|
|
@errorNotif.show()
|
|
|
|
return
|
|
|
|
return
|
|
|
|