aboutsummaryrefslogtreecommitdiffstats
path: root/static/js/index.coffee
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2017-01-21 18:56:05 -0800
committerAdam Soltys <[email protected]>2017-01-21 18:56:05 -0800
commitc413e457579b68b7a92ab47cdd867202ee7bb47e (patch)
tree4d84c4af06e936a54890468cc4351deabcd8c0f9 /static/js/index.coffee
parent931f2262d9ef7f571fe87b176f6cd531b3579a68 (diff)
downloadcoinos-server-c413e457579b68b7a92ab47cdd867202ee7bb47e.tar.gz
coinos-server-c413e457579b68b7a92ab47cdd867202ee7bb47e.zip
Ditch coffeescript
Diffstat (limited to 'static/js/index.coffee')
-rw-r--r--static/js/index.coffee44
1 files changed, 0 insertions, 44 deletions
diff --git a/static/js/index.coffee b/static/js/index.coffee
deleted file mode 100644
index 090abbe2..00000000
--- a/static/js/index.coffee
+++ /dev/null
@@ -1,44 +0,0 @@
-#= require js/jquery-1.8.2.min.js
-#= require js/bootstrap.min.js
-
-g = exports ? this
-
-$(->
- fetchExchangeRate('ask')
- fetchExchangeRate('bid')
-
- $('#username').blur(->
- $.get(
- "/#{$(this).val()}/exists",
- username: $(this).val(),
- (data) ->
- if data is "true"
- $('#username').prev().css('color', 'red').html('Username (taken)')
- g.preventSubmit = true
- else
- $('#username').prev().css('color', 'black').html('Username')
- g.preventSubmit = false
- )
- )
-
- $('#signup').submit(->
- return false if g.preventSubmit
- return true
- )
-)
-
-fetchExchangeRate = (type) ->
- commission = 0.015
- commission *= -1 if type is 'bid'
-
- $.ajax(
- url: "/ticker?symbol=virtexCAD&type=#{type}&amount=100",
- success: (exchange) ->
- if not exchange?
- exchange = '??'
-
- exchange = exchange - exchange * commission
- $("##{type}").html(exchange.toFixed(2))
- error: ->
- $("##{type}").html('??')
- )