diff -r 03c69425efa6 -r 738594562e44 tweetcast/nodejs/client/js/script.js --- a/tweetcast/nodejs/client/js/script.js Mon Oct 24 18:01:55 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,336 +0,0 @@ -var socket, - tlPaper, - twPaper, - tweetData = { - "tweetcount" : 0, - "position" : 0, - "followLast" : true, - "zoomLevel" : 3, - "timeLevel" : 2, - "tweets" : [], - "posIndex" : [], - "tlChanged" : true - }, - colors = { - 'positive' : "#1D973D", - 'reference' : "#C5A62D", - 'negative' : "#CE0A15", - 'question' : "#036AAE", - 'neutre' : "#585858" - }, - annotations = { - 'positive' : '++', - 'negative' : '--', - 'reference' : '==', - 'question' : '??' - }, - 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 placeHolder(className) { - return '
'; -} - -function tweetToHtml(tweet, className) { - html = '' + new Date(tweet.created_at).toLocaleTimeString() + '
'; - lastend = 0; - txt = ''; - entities = []; - for (var i in tweet.entities.hashtags) { - entities.push({ - "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) { - entities.push({ - "start" : tweet.entities.urls[i].indices[0], - "end" : tweet.entities.urls[i].indices[1], - "html" : '' + tweet.entities.urls[i].display_url + '' - }); - } - for (var i in tweet.entities.user_mentions) { - entities.push({ - "start" : tweet.entities.user_mentions[i].indices[0], - "end" : tweet.entities.user_mentions[i].indices[1], - "html" : '@' + tweet.entities.user_mentions[i].screen_name + '' - }); - } - entities.sort(function(a, b) { return a.start - b.start }); - for (var i in entities) { - txt += tweet.text.substring(lastend, entities[i].start) + entities[i].html; - lastend = entities[i].end; - } - txt += tweet.text.substring(lastend); - html += txt + '