diff -r 1a77b44dfa7d -r d60efd677b50 tweetcast/nodejs/client/js/script.js --- a/tweetcast/nodejs/client/js/script.js Tue Oct 25 18:26:39 2011 +0200 +++ b/tweetcast/nodejs/client/js/script.js Tue Oct 25 18:27:08 2011 +0200 @@ -1,60 +1,61 @@ 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 = [ + displaySplitting = [ { - "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 + 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' ] }, { - "description" : "6 tweets per page", - "className" : "full", - "displayCount" : 6 + positions : [ 1, 3, 5, 7, 13, 33, 53 ], + classNames : [ 'full', 'half', 'half fade', 'quarter', 'quarter fade', 'icons', 'icons fade' ] } ], - colors = { - 'positive' : "#1D973D", - 'reference' : "#C5A62D", - 'negative' : "#CE0A15", - 'question' : "#036AAE" - }, - timeWindow; + blockUpdate = false, + waitUpdate = true, + wheeldelta = 0; + +function placeHolder(className) { + return '
'; +} -function tweetToHtml(tweet) { - 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 +78,246 @@ lastend = entities[i].end; } txt += tweet.text.substring(lastend); - html += txt + '
'; + html += txt + '