Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Freenerd committed Jun 17, 2011
1 parent e5f3945 commit 4d022fc
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ const EXAMPLES = [
var lyrics;
var counter;
var numberOfTracks;
var output;

var initGlobals = function() {
lyrics = {};
counter = {};
numberOfTracks = {};
output = {};
}

//
Expand Down Expand Up @@ -97,12 +99,17 @@ var getSentiment = function(lyrics, resultSelector) {
);

// Output
output[resultSelector] = averageSentiment;

$(".results ." + resultSelector + " .sentiment")
.find("p").text(averageSentiment).end()
.show();
if ( output.length >= RESULT_SELECTORS.length ) {
$.each(output, function(resultSelector, averageSentiment) {
$(".results ." + resultSelector + " .sentiment")
.find("p").text(averageSentiment).end()
.show();
});
}
}
);
);
};

//
Expand Down

0 comments on commit 4d022fc

Please sign in to comment.