Skip to content

Commit

Permalink
randomly change the percent down
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Dahan committed Sep 9, 2011
1 parent 0c06bb6 commit 9045ab6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/public/scripts/lepidoptera.coffee
Expand Up @@ -44,12 +44,12 @@ lepidoptera = ->

updateFeed = (resource_id, body) ->
data = JSON.parse body.data
down = Math.random() < .5

console.log "updateFeed(#{resource_id},#{JSON.stringify data})"
console.log "updateFeed(#{resource_id},#{JSON.stringify data}, #{down})"

dom_name = $("##{resource_id} > .car_name")
dom_name.html(data.car_name) if dom_name[0]?

for feed in config.feeds
# if the feed doesn't exist, add it
dom_feed = $("##{resource_id} > .feeds > .#{feed.name}")
Expand All @@ -59,6 +59,7 @@ lepidoptera = ->

# replace the inner html with the new mpg data
dom_feed.find(".data").html "#{data[feed.name]}"
dom_feed.toggleClass('down', down)

# see if we have a marker on the map for this resource
for m in markers
Expand Down
2 changes: 1 addition & 1 deletion src/public/stylesheets/screen.css
Expand Up @@ -235,7 +235,7 @@ html, body {
height:15px;
}

#content #sidebar #resources .resource .feeds .feed.change.down .icion_wrapper {
#content #sidebar #resources .resource .feeds .feed.change.down .icon_wrapper {
background-image:url("../images/icon-arrow-down.png");
}

Expand Down

0 comments on commit 9045ab6

Please sign in to comment.