|
|
@ -4,6 +4,7 @@ class app.Settings
|
|
|
|
DARK_KEY = 'dark'
|
|
|
|
DARK_KEY = 'dark'
|
|
|
|
LAYOUT_KEY = 'layout'
|
|
|
|
LAYOUT_KEY = 'layout'
|
|
|
|
SIZE_KEY = 'size'
|
|
|
|
SIZE_KEY = 'size'
|
|
|
|
|
|
|
|
SIDEBAR_KEY = 'sidebar'
|
|
|
|
|
|
|
|
|
|
|
|
@defaults:
|
|
|
|
@defaults:
|
|
|
|
count: 0
|
|
|
|
count: 0
|
|
|
@ -77,10 +78,17 @@ class app.Settings
|
|
|
|
catch
|
|
|
|
catch
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setSidebar: (value) ->
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
Cookies.set SIDEBAR_KEY, value, path: '/', expires: 1e8
|
|
|
|
|
|
|
|
catch
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
reset: ->
|
|
|
|
reset: ->
|
|
|
|
try Cookies.expire DOCS_KEY
|
|
|
|
try Cookies.expire DOCS_KEY
|
|
|
|
try Cookies.expire DARK_KEY
|
|
|
|
try Cookies.expire DARK_KEY
|
|
|
|
try Cookies.expire LAYOUT_KEY
|
|
|
|
try Cookies.expire LAYOUT_KEY
|
|
|
|
try Cookies.expire SIZE_KEY
|
|
|
|
try Cookies.expire SIZE_KEY
|
|
|
|
|
|
|
|
try Cookies.expire SIDEBAR_KEY
|
|
|
|
try @store.del(SETTINGS_KEY)
|
|
|
|
try @store.del(SETTINGS_KEY)
|
|
|
|
return
|
|
|
|
return
|
|
|
|