aboutsummaryrefslogtreecommitdiff
path: root/src/js/main.coffee
diff options
context:
space:
mode:
authorCamil Staps2015-05-13 23:10:22 +0200
committerCamil Staps2015-05-13 23:10:22 +0200
commit2388099227d1c0528e640ceb4631a35521201c76 (patch)
tree9a56f7b379f8e7c296e8229dc5b82893c5fae6ce /src/js/main.coffee
parentTurned javascript into coffeescript (diff)
Cleanup coffeescript
Diffstat (limited to 'src/js/main.coffee')
-rw-r--r--src/js/main.coffee22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/js/main.coffee b/src/js/main.coffee
index 4bf9c20..5d21ede 100644
--- a/src/js/main.coffee
+++ b/src/js/main.coffee
@@ -1,12 +1,13 @@
$ ->
# Show extra links if user is logged in
- email = $.cookie(Botleagues.cookie_login_email)
+ email = $.cookie Botleagues.cookie_login_email
setupLoginMenu() if email? && $.cookie(Botleagues.cookie_login_valid_till) > (new Date()).getTime()
return
# Show extra links if user is logged in
setupLoginMenu = ->
- $('#nav .login-link').remove()
+ $ '#nav .login-link'
+ .remove()
extra_links =
'Leagues': '/leagues'
@@ -15,15 +16,16 @@ setupLoginMenu = ->
'Logout': '/logout'
for title, link of extra_links
- li = $('<li>').append(
- $('<a>')
- .attr 'role', 'presentation'
- .attr 'title', title
- .attr 'href', link
- .text title
- )
+ li = $ '<li>'
+ .append(
+ $ '<a>'
+ .attr 'role', 'presentation'
+ .attr 'title', title
+ .attr 'href', link
+ .text title
+ )
if link == selected_page
li.addClass 'active'
- li.appendTo $('#nav')
+ li.appendTo ($ '#nav')
return \ No newline at end of file