summaryrefslogtreecommitdiff
path: root/users/app/assets/javascripts/users.js.coffee
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2013-07-06 07:51:54 -0700
committerazul <azul@riseup.net>2013-07-06 07:51:54 -0700
commita18efa42ddc1cf8692d55f76ca3e92792913f40d (patch)
tree00527737a38bdafcd2e175bb6caf5e30b3360de1 /users/app/assets/javascripts/users.js.coffee
parentd03e82b4df5075f796f56fb9568992b0ba0d7c07 (diff)
parentdc98ad8c6445182d60b3f1909e0260ace6fbfca5 (diff)
Merge pull request #55 from elijh/feature/new-ui
Feature/new ui
Diffstat (limited to 'users/app/assets/javascripts/users.js.coffee')
-rw-r--r--users/app/assets/javascripts/users.js.coffee46
1 files changed, 0 insertions, 46 deletions
diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee
deleted file mode 100644
index 955556c..0000000
--- a/users/app/assets/javascripts/users.js.coffee
+++ /dev/null
@@ -1,46 +0,0 @@
-preventDefault = (event) ->
- event.preventDefault()
-
-srp.session = new srp.Session()
-srp.signedUp = ->
- srp.login()
-
-srp.loggedIn = ->
- window.location = '/'
-
-#// TODO: not sure this is what we want.
-srp.updated = ->
- window.location = '/'
-
-srp.error = (message) ->
- if $.isPlainObject(message) && message.errors
- for field, error of message.errors
- element = $('form input[name$="['+field+']"]')
- next unless element
- element.trigger('element:validate:fail.ClientSideValidations', error).data('valid', false)
- else
- alert(message)
-
-pollUsers = (query, process) ->
- $.get( "/users.json", query: query).done(process)
-
-followLocationHash = ->
- location = window.location.hash
- if location
- href_select = 'a[href="' + location + '"]'
- link = $(href_select)
- link.tab('show') if link
-
-$(document).ready ->
- followLocationHash()
- $('#new_user').submit preventDefault
- $('#new_user').submit srp.signup
- $('#new_session').submit preventDefault
- $('#new_session').submit srp.login
- $('.user.form.update_login_and_password').submit srp.update
- $('.user.form.update_login_and_password').submit preventDefault
- $('.user.typeahead').typeahead({source: pollUsers});
- $('a[data-toggle="tab"]').on('shown', ->
- $(ClientSideValidations.selectors.forms).validate()
- )
-