Skip to content

Commit

Permalink
if this all goes to plan
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Mar 5, 2013
1 parent fa59c42 commit 27a7344
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
scores
1 change: 0 additions & 1 deletion play.js
Expand Up @@ -4,7 +4,6 @@
'use strict';

var game = express();

game.set( 'title', 'Scores' );
game.set( 'scores file', 'scores' );
game.set( 'scores', undefined );
Expand Down
11 changes: 11 additions & 0 deletions public/js/score.js
Expand Up @@ -7,6 +7,7 @@
var chart = jQuery( ".scores" );
var oldScore = jQuery( ".old-score" );
var source;
var topScore;

String.prototype.lpad = function( padWith, length ) {
var string = this;
Expand Down Expand Up @@ -35,6 +36,11 @@

function processScores ( data ) {
var items = jQuery( "<ul>" );

if ( _.has( data, topScore ) ) {
return;
}

_( data ).keys().reverse().each(function ( points, i ) {
var name = data[ points ];
var item = jQuery( "<li>" );
Expand All @@ -45,6 +51,11 @@
item.append( nameSpan ).append( " " ).append( scoreSpan );

items.append( item );

// omg i promise this is temporary
if ( i === 0 ) {
topScore = points;
}
});

cleanScores( items );
Expand Down
1 change: 0 additions & 1 deletion scores

This file was deleted.

1 change: 0 additions & 1 deletion scores2

This file was deleted.

0 comments on commit 27a7344

Please sign in to comment.