Skip to content

Commit

Permalink
Merge pull request #35 from tiltnyc/upgrade-node-0.8
Browse files Browse the repository at this point in the history
Upgrade node 0.8, fixes issues #33, #34
  • Loading branch information
jjgonecrypto committed Jul 27, 2012
2 parents 1b604f5 + 9bc81c2 commit e42847d
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules
public/stylesheets/*.css
*.sw[nomp]
npm-debug.log
build
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: node_js
node_js:
- 0.6
- 0.8
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
this is the web application for tilt, which creates and manages a virtual market, with investment occuring within a series of rounds.

__current version__: 0.3 (in development)

#current status

Expand All @@ -12,7 +13,7 @@ this is the web application for tilt, which creates and manages a virtual market

#developer requirements
* local installation of [mongodb (v2.0.2+)](http://www.mongodb.org/downloads).
* local install of node `0.6.8`+
* local install of node `0.8.3`+

#installation
* clone source `git clone [email protected]:justinjmoses/tilt.git`
Expand All @@ -28,7 +29,8 @@ this is the web application for tilt, which creates and manages a virtual market
* to change the port:

port=5000 coffee app
* alternatively, if you install foreman `npm install -g foreman`, you can run via foreman which will run using the web workers/dynos processes that heroku employs:

* alternatively, if you install foreman ([download heroku toolkit](https://toolbelt.heroku.com/)), you can run via foreman which will run using the web workers/dynos processes that heroku employs:

foreman start

Expand Down
12 changes: 6 additions & 6 deletions assets/js/charts.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $ ->
text: "Round " + $(container).data("round") + " distribution"

xAxis:
categories: $(container).data("teams").split(",")
categories: $(container).data("teams")

yAxis:
min: 0
Expand Down Expand Up @@ -38,13 +38,13 @@ $ ->

series: [
type: "column"
data: JSON.parse("[" + $(container).data("results") + "]")
data: $(container).data("results")
]
)

$(".price-chart").each (i, container) ->
old_prices = JSON.parse("[" + $(container).data("old_prices") + "]")
new_prices = JSON.parse("[" + $(container).data("prices") + "]")
old_prices = $(container).data("old_prices")
new_prices = $(container).data("prices")
new_data = []
for i of new_prices
color = (if (new_prices[i] > old_prices[i]) then "green" else (if (new_prices[i] < old_prices[i]) then "red" else "#666666"))
Expand All @@ -59,7 +59,7 @@ $ ->
text: "Round " + $(container).data("round") + " prices"

xAxis:
categories: $(container).data("teams").split(",")
categories: $(container).data("teams")

yAxis:
min: 0
Expand All @@ -80,7 +80,7 @@ $ ->
name: "old price"
type: "column"
color: "#BBBBBB"
data: JSON.parse("[" + $(container).data("old_prices") + "]")
data: $(container).data("old_prices")
,
name: "new price"
type: "column"
Expand Down
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
, "description": "live event app for tilt"
, "version": "0.2.0"
, "private": true
, "author": "justin j. moses (http://about.me/justinj)"
, "author": "tiltnyc (http://github.com/tiltnyc)"
, "contributors": [
{
"name": "justin j. moses"
, "email": "[email protected]"
}
, {
"name": "jon storer"
, "email": "[email protected]"
}
]
, "engines": {
"node" : "0.6.8"
, "npm" : "1.0.x"
"node" : "0.8.3"
, "npm" : "1.1.43"
}
, "devDependencies": {
"cucumber" : ">= 0.2.15"
Expand All @@ -18,9 +28,9 @@
, "database-cleaner" : ">= 0.7.0"
}
, "dependencies": {
"express" : "= 2.5.9"
"express" : "= 2.5.11"
, "stylus" : ">= 0.13.7"
, "jade" : "= 0.20.0"
, "jade" : "= 0.27.0"
, "mongoose" : ">= 2.5.0"
, "gzippo" : ">= 0.0.7"
, "express-messages" : ">= 0.0.2"
Expand Down
6 changes: 3 additions & 3 deletions views/investments/investment_list.jade
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
tr(class="investment")
td.round-column
#{investment.round}
=investment.round
td.text-column
#{investment.team.name}
=investment.team.name
td.value-column
#{(investment.percentage * 100).toFixed(2)}%
| #{Math.roundToFixed(investment.percentage * 100, 2)}%


8 changes: 4 additions & 4 deletions views/results/result_list.jade
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
- average = (roundResults[0].round.average*100).toFixed(2)
- each teamResult in roundResults
- teams.push(teamResult.team.name)
- results.push((teamResult.percentage_score*100).toFixed(2))
- prices.push(teamResult.after_price.toFixed(2))
- old_prices.push(teamResult.before_price.toFixed(2))
- results.push(Math.roundToFixed(teamResult.percentage_score*100, 2))
- prices.push(Math.roundToFixed(teamResult.after_price, 2))
- old_prices.push(Math.roundToFixed(teamResult.before_price, 2))
- roundResults.sort(function(a,b){ return b.after_price > a.after_price; })
li
table.round-results
Expand All @@ -32,7 +32,7 @@ li
+
else if (teamResult.movement < 0.00)
-
#{Math.abs(teamResult.movement.toFixed(2))} (#{teamResult.movement_percentage.toFixed(2)}%)
| #{Math.abs(Math.roundToFixed(teamResult.movement, 2))} (#{Math.roundToFixed(teamResult.movement_percentage, 2)}%)
td
strong $#{teamResult.after_price.toFixed(2)}
tr.footer
Expand Down
2 changes: 1 addition & 1 deletion views/rounds/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ else
end

hr
a(href="/rounds/reset", title="reset", data-message="are you sure???\n\n this will clear all transactions and reset tilt back to pregame settings???\n\n this cannot be undone.",class="confirm red-text") reset all
a(href="/rounds/reset", title="reset", data-message="are you sure??? this will clear all transactions and reset tilt back to pregame settings??? this cannot be undone.",class="confirm red-text") reset all
6 changes: 3 additions & 3 deletions views/transactions/transaction_list.jade
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tr(class="transaction")
td.round-column
#{transaction.round}
=transaction.round
td.text-column
#{transaction.label}
=transaction.label
td.value-column
$#{transaction.amount.toFixed(2)}
$#{Math.roundToFixed(transaction.amount, 2)}

0 comments on commit e42847d

Please sign in to comment.