aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2012-12-06 20:23:34 -0800
committerAdam Soltys <[email protected]>2012-12-06 20:23:34 -0800
commit749787381c3fdcfb45852b2234b8099483ff0cf5 (patch)
tree776f0b44a839426bcdf1e628eadc1b4b57b6638d /public
parent00a08d7c8b10b726830505b58a045a49bb2046fe (diff)
downloadcoinos-server-749787381c3fdcfb45852b2234b8099483ff0cf5.tar.gz
coinos-server-749787381c3fdcfb45852b2234b8099483ff0cf5.zip
Code re-org
Diffstat (limited to 'public')
-rw-r--r--public/css/index.less2
-rw-r--r--public/js/calculator.coffee8
-rw-r--r--public/js/index.coffee2
-rw-r--r--public/js/report.coffee2
-rw-r--r--public/js/setup.coffee15
5 files changed, 17 insertions, 12 deletions
diff --git a/public/css/index.less b/public/css/index.less
index cc31fc1b..6cd236ca 100644
--- a/public/css/index.less
+++ b/public/css/index.less
@@ -10,5 +10,5 @@ footer {
}
#ask, #bid { color: white; }
-div.directory img { width: 150px; height: 150px; float: left; padding-right: 20px; }
+div.directory img { width: 150px; height: 150px; float: left; padding-right: 5px; }
div.row-fluid td.first { text-align: right; }
diff --git a/public/js/calculator.coffee b/public/js/calculator.coffee
index ef26fd63..505a1a09 100644
--- a/public/js/calculator.coffee
+++ b/public/js/calculator.coffee
@@ -15,7 +15,7 @@ g = exports ? this
$(->
g.user = $('#user').val()
- g.name = get('name')
+ g.title = get('title')
g.address = get('address')
g.symbol = get('symbol')
g.commission = parseFloat(get('commission'))
@@ -28,7 +28,7 @@ $(->
dataType: 'json',
success: (data) ->
if data?
- g.name = data.name
+ g.title = data.title
g.address = data.address
g.symbol = data.symbol
g.commission = data.commission
@@ -54,10 +54,10 @@ setup = ->
if g.logo
$('#logo').attr('src', g.logo).show()
- else if not g.name
+ else if not g.title
$('#logo').attr('src', 'img/bitcoin.png').show()
else
- $('#name').html(g.name).show()
+ $('#title').html(g.title).show()
address = g.address
if g.user? and g.user
diff --git a/public/js/index.coffee b/public/js/index.coffee
index 2a8a6b5a..b180ee2d 100644
--- a/public/js/index.coffee
+++ b/public/js/index.coffee
@@ -3,6 +3,7 @@
$(->
fetchExchangeRate('ask')
fetchExchangeRate('bid')
+ setTimeout(fetchExchangeRate, 900000)
)
fetchExchangeRate = (type) ->
@@ -20,4 +21,3 @@ fetchExchangeRate = (type) ->
error: ->
$("##{type}").html('??')
)
- setTimeout(fetchExchangeRate, 900000)
diff --git a/public/js/report.coffee b/public/js/report.coffee
index 06c99050..28ec988b 100644
--- a/public/js/report.coffee
+++ b/public/js/report.coffee
@@ -8,7 +8,7 @@ $(->
$('#from').val(moment().subtract('days', 7).format("MM/DD/YYYY"))
$('#to').val(moment().format("MM/DD/YYYY"))
$('.date').datepicker(onClose: filterDates)
- $.getJSON('transactions', (data) ->
+ $.getJSON('transactions.json', (data) ->
g.transactions = data.transactions
display(g.transactions)
filterDates()
diff --git a/public/js/setup.coffee b/public/js/setup.coffee
index d53a4e48..6c38d4b5 100644
--- a/public/js/setup.coffee
+++ b/public/js/setup.coffee
@@ -6,10 +6,14 @@
$(->
symbols = ['mtgoxUSD', 'btceUSD', 'bitstampUSD', 'virwoxSLL', 'btcdeEUR', 'mtgoxEUR', 'btc24EUR', 'mtgoxAUD', 'cryptoxAUD', 'mtgoxGBP', 'btcnCNY', 'intrsngEUR', 'virtexCAD', 'mtgoxPLN', 'cbxUSD', 'bitcurexPLN', 'bitmarketEUR', 'bitfloorUSD', 'mrcdBRL', 'bcEUR']
+ symbols = symbols.sort()
+
+ user = $('#username').val()
$.each(symbols, (i, v) ->
$('#symbol').append("<option value='#{v}'>#{v}</option>")
)
+ $("#symbol option[value='mtgoxUSD']").attr('selected', 'selected')
$('#address').change(->
if check_address($(this).val())
@@ -18,12 +22,13 @@ $(->
$(this).css('color', 'red')
)
- if $('#login').val() != ""
- $.getJSON('/' + $('#login').val() + '.json', (data) ->
- $('#name').val(data.name)
- $('#image').val(data.image)
+ if user
+ $('#setup').attr('action', "/#{user}/update").attr('method', 'post')
+ $.getJSON("/#{user}.json", (data) ->
+ $('#title').val(data.title)
+ $('#logo').val(data.logo)
$('#address').val(data.address)
- $('#symbol option[value=' + data.symbol + ']').attr('selected', 'selected')
+ $("#symbol option[value='#{data.symbol}']").attr('selected', 'selected')
$('#commission').val(data.commission)
)
)