diff -r 5064d838962b -r 03c69425efa6 tweetcast/nodejs/client/js/script.js --- a/tweetcast/nodejs/client/js/script.js Wed Oct 19 00:05:09 2011 +0200 +++ b/tweetcast/nodejs/client/js/script.js Mon Oct 24 18:01:55 2011 +0200 @@ -1,60 +1,74 @@ var socket, - paper, + tlPaper, + twPaper, tweetData = { "tweetcount" : 0, - "position" : -1, + "position" : 0, + "followLast" : true, "zoomLevel" : 3, - "timeLevel" : 2 + "timeLevel" : 2, + "tweets" : [], + "posIndex" : [], + "tlChanged" : true }, - zoomLevels = [ - { - "description" : "160 tweets per page", - "className" : "icons", - "displayCount" : 160 - }, - { - "description" : "24 tweets per page", - "className" : "quarter", - "displayCount" : 24 - }, - { - "description" : "12 tweets per page", - "className" : "half", - "displayCount" : 12 - }, - { - "description" : "6 tweets per page", - "className" : "full", - "displayCount" : 6 - } - ], colors = { 'positive' : "#1D973D", 'reference' : "#C5A62D", 'negative' : "#CE0A15", - 'question' : "#036AAE" + 'question' : "#036AAE", + 'neutre' : "#585858" + }, + annotations = { + 'positive' : '++', + 'negative' : '--', + 'reference' : '==', + 'question' : '??' }, - timeWindow; + displaySplitting = [ + { + positions : [ 10, 20, 22, 24, 25, 26, 27, 28, 29, 31, 33, 43, 53 ], + classNames : [ 'icons fade', 'icons', 'quarter fade', 'quarter', 'half fade', 'half', 'full', 'half', 'half fade', 'quarter', 'quarter fade', 'icons', 'icons fade' ] + }, + { + positions : [ 1, 3, 5, 7, 13, 33, 53 ], + classNames : [ 'full', 'half', 'half fade', 'quarter', 'quarter fade', 'icons', 'icons fade' ] + } + ], + blockUpdate = false, + waitUpdate = true, + wheeldelta = 0; -function tweetToHtml(tweet) { - html = '
'; +} + +function tweetToHtml(tweet, className) { + html = '' + new Date(tweet.created_at).toLocaleTimeString() + '
'; + html += '
' + new Date(tweet.created_at).toLocaleTimeString() + '
'; lastend = 0; txt = ''; entities = []; - for (var i in tweet.entities.hashtag) { + for (var i in tweet.entities.hashtags) { entities.push({ - "start" : tweet.entities.hashtag[i].indices[0], - "end" : tweet.entities.hashtag[i].indices[1], - "html" : '#' + tweet.entities.hashtag[i].text + '' + "start" : tweet.entities.hashtags[i].indices[0], + "end" : tweet.entities.hashtags[i].indices[1], + "html" : '#' + tweet.entities.hashtags[i].text + '' }); } for (var i in tweet.entities.urls) { @@ -77,110 +91,246 @@ lastend = entities[i].end; } txt += tweet.text.substring(lastend); - html += txt + '
'; + html += txt + '