# HG changeset patch # User Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> # Date 1323863213 -3600 # Node ID bf5cf5a9e737e6a8c210a7a4c3f6a57ec0c08647 # Parent f7ceddf99d6d79646fc6f90ad94c8e6bcc7fdbab# Parent 86b62b98fea7050098b879d03fed52cd36894baa Merge with e4533dcbcedb987898b0da9f24f5279bc3455137 diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/config.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/client/config.js Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,51 @@ +var tracking_keywords = [ "#rsln" ], + annotations = { + "default" : { + "colors" : { + "tweet" : "#ffffff", + "timeline" : "#585858", + "h" : 0, + "s" : 0 + } + }, + "positive" : { + "display_name" : "++", + "keywords" : [ /\+\+/ ], + "colors" : { + "tweet" : "#c5e7cd", + "timeline" : "#1D973D", + "h" : .3, + "s" : .65 + } + }, + "negative" : { + "display_name" : "--", + "keywords" : [ /\-\-/ ], + "colors" : { + "tweet" : "#f6ced0", + "timeline" : "#CE0A15", + "h" : 0, + "s" : .8 + } + }, + "reference" : { + "display_name" : "==", + "keywords" : [ /\=\=/ ], + "colors" : { + "tweet" : "#ecedc1", + "timeline" : "#C5A62D", + "h" : .16, + "s" : .8 + } + }, + "question" : { + "display_name" : "??", + "keywords" : [ /\?\?/ ], + "colors" : { + "tweet" : "#bfdbec", + "timeline" : "#036AAE", + "h" : .6, + "s" : .8 + } + } + } diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/css/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/client/css/style.css Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,336 @@ +/* Browser-reset CSS */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} + +body { + font-family: Helvetica, Arial, sans-serif; background-color: #F7F6F6; background-image: url("../img/bgd.jpg"); background-repeat: repeat-x; +} + +b { + font-weight: bold; +} + +.highlight { + background: #ffff00; +} + +#container { + width: 960px; margin: 0 auto; +} + +#colgauche { + float: left; width: 455px; margin-right: 13px; +} + +.barre { + float: left; width: 100%; +} + +.greyed { + color: #999; font-style: italic; +} + +.rechercheCourante { + background: #ffa0ff; font-weight: bold; color: #000080; +} + +/* Menu */ + +#headlogo { + float: left; margin-right: 10px; +} + +.menu { + border-left: 1px solid #C3C3C3; + float: left; + list-style: none; + font-size: 12px; + height: 62px; overflow: hidden; +} + +.menu li { + background: url("../img/menu_underline.gif") left bottom no-repeat; + padding: 3px 0 0 5px; + height: 18px; + min-width: 80px; +} + +.menu a { + color: #000000; text-decoration: none; +} + +.menu a:hover { + color: #0099FF; +} + +/* Formulaire */ + +#twwWrap { + float: left; width: 450px; background: #ffffff; padding: 1px; border-width: 1px; border-style: solid solid none solid; border-color: #ababab; margin-top: 6px; +} + +#tweetWriter { + width: 430px; padding: 10px; background: #efefef; +} + +/* Liste de Tweets */ + +#tweetviz { + float: left; width: 452px; border: 1px solid #999; +} + +/* Recherche */ + +#recherche { + position: relative; float: left; padding: 2px 0; width: 452px; border-bottom: 1px solid #999; +} + +#recherche input { + float: left; +} + +#inp_q { + width: 236px; border: none; padding: 1px; margin-left: 2px; height: 17px; font-size: 13px; +} + +#inp_submit, #inp_reset { + border: 0; padding: 0; width: 20px; height: 20px; overflow: hidden; text-indent: 800px; background: url(../img/searchcancel.png) +} + +#inp_submit:hover { + background-position: -20px 0; +} + +#inp_submit:active { + background-position: -40px 0; +} + +#inp_reset { + background-position: 0 -20px; +} + +#inp_reset:hover { + background-position: -20px -20px; +} + +#inp_reset:active { + background-position: -40px -20px; +} + +#time_legende { + float: left; margin-left: 30px; width: 30px; height: 20px; background: url(../img/scale.png) left; +} + +#time_scale { + float: left; font-size: 12px; margin: 3px 0 0; color: #666; width: 50px; text-align: center; +} + +#time_zoomout, #time_zoomin { + float: left; width: 12px; height: 20px; background: url(../img/scale.png); +} + +#time_zoomout { + background-position: -30px; +} + +#time_zoomout.inactive { + background-position: -54px; +} + +#time_zoomin { + background-position: -42px; +} + +#time_zoomin.inactive { + background-position: -66px; +} + +#recherche_annot { + position: absolute; top: 20px; z-index: 4; background: #ffffff; border: 1px solid #ccc; padding: 4px; font-size: 12px; + display: none; box-shadow: 2px 2px 2px rgba(0, 0, 0, .5) +} + +#recherche_annot a { + padding: 1px; line-height: 13px; margin: 1px; font-weight: bold; text-decoration: none; color: #000000; +} + +/* Liste des tweets */ + +#tweetlist { + float: left; width: 280px; height: 480px; list-style: none; border-right: 1px solid #999; color: #585858; cursor: pointer; cursor: hand; background: #ffffff; +} + +#tweetlist a { + text-decoration: none; color: #1985B5; +} + +#tweetlist a:hover { + text-decoration: underline; color: #105060; +} + +li.tweet, li.placeholder { + border-bottom : 1px dotted; overflow: hidden; float: left; border-color: #ccc; +} + +li.tweet { + position: relative; background: #fff; +} + +li.full { + width: 270px; height: 117px; border-right: 10px solid #ff0; +} + +li.half { + width: 280px; height: 46px; +} + +li.icons { + width: 20px; height: 20px; border: none; +} + +li.placeholder { + visibility: hidden; +} + +.tweet p { + overflow: hidden; +} + +.full p.tweet_text { + font-size: 12px; margin: 5px 0 5px 58px; height: 108px; width: 207px; color: #000000; +} + +.half p.tweet_text { + font-size: 11px; margin: 5px 0 5px 49px; height: 36px; line-height: 12px; width: 216px; +} + +div.around_img { + float: left; +} + +.full .profile_image { + margin: 5px 5px 0 5px; width: 48px; height: 48px; +} + +.half .profile_image { + margin: 5px; width: 36px; height: 36px; +} + +.icons .profile_image { + margin: 2px; width: 16px; height: 16px; +} + +p.created_at { + font-size: 12px; text-align: center; font-style: italic; color: #999999; width: 58px; overflow: hidden; +} + +.annotations { + position: absolute; margin: 0; padding: 0; top: 0; left: 0; width: 100%; height: 100%; +} + +.icons .annotations { + position: absolute; width: 20px; height: 6px; left: 0; top: 16px; z-index: 3; +} + +div.annotation { + float: left; height: 100%; +} + +div.twmain { + position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; overflow: hidden; +} + +div.tweet_actions { + position: absolute; bottom : 2px; right: 4px; font-size: 11px; +} + +/* timeline */ + +#timeline { + float: left; height: 480px; width: 150px; border-right: 1px solid #999; cursor: pointer; cursor: hand; +} + +#scrollcont { + float: left; width: 20px; height: 480px; overflow: auto; +} + +#scrollin { + width: 1px; height: 8000px; +} + +/* hovertweet */ + +#hovertweet { + position: absolute; display: none; margin: -20px 0 0 15px; z-index: 12; +} + +div.full { + position: absolute; background: #eeeeee; width: 270px; height: 84px; border: 1px solid #808080; border-radius: 3px; box-shadow: 5px 5px 5px rgba(0,0,0,.3); +} + +#hoverarrow { + position: absolute; width: 10px; height: 18px; left: -9px; top: 13px; background: url(../img/arrow.png); +} + +/* Colonne de droite */ + +#coldroite { + float: left; width: 492px; +} + +#vlWrap { + float: left; border: 5px solid #ffffff; background: #999999; padding: 1px; margin-top: 20px; +} + +#videoLivePlayer { + width: 480px; height: 320px; background: #000000; +} + +#out_fleche { + float: left; position: relative; width: 492px; height: 14px; background: url(../img/bgnoarrow.png); +} + +#in_fleche { + position: absolute; left: 10px; width: 27px; height: 15px; background: url(../img/arrowtop.png); +} + +#accordeon { + float: left; width: 492px; list-style: none; background: #777777; +} + +#accordeon li { + float: left; width: 480px; margin: 0 1px 1px 1px; padding: 4px; border: 1px solid #ffffff; background: #efefef; +} + +#accordeon li.deplie { + background: url(../img/bgdeplie.png) top repeat-x #efefef; +} + +/* Tag Cloud */ + +#motscles { + text-align: center; +} + +#motscles span { + padding: 2px; cursor: pointer; cursor: hand; +} diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/arrow.png Binary file tweetcast/client/img/arrow.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/arrowtop.png Binary file tweetcast/client/img/arrowtop.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/bgd.jpg Binary file tweetcast/client/img/bgd.jpg has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/bgdeplie.png Binary file tweetcast/client/img/bgdeplie.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/bgnoarrow.png Binary file tweetcast/client/img/bgnoarrow.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/head_logo.gif Binary file tweetcast/client/img/head_logo.gif has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/menu_underline.gif Binary file tweetcast/client/img/menu_underline.gif has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/placeholder.png Binary file tweetcast/client/img/placeholder.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/scale.png Binary file tweetcast/client/img/scale.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/img/searchcancel.png Binary file tweetcast/client/img/searchcancel.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/client/index.html Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,80 @@ + + + + + Polemic Tweet “TweetCast” + + + + + + + + + + + +
+
+
+ + +
+
+
+

Annotations polémiques

+
+
+
+
+
+ + + +
+
+
+ + +
+
+ Recherche par annotation :
+
+
+
+
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/js/connect-gevent.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/client/js/connect-gevent.js Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,14 @@ +function connectTweets() { + $.getJSON('http://' + document.location.hostname + ':8888/?callback=?', function(data) { + loadTweets(data.tweets) + } ); + + setInterval(function() { + if (!twCx.tweets) { + return; + } + $.getJSON('http://' + document.location.hostname + ':8888/?after_id=' + twCx.tweets[twCx.tweets.length - 1].id + '&callback=?', function(data) { + loadTweets(data.tweets, true); + }); + }, 1000) +} \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/client/js/connect-nodejs.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/client/js/connect-nodejs.js Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,16 @@ +document.write(' - - - - -

    Liste de Tweets

    -
    - -
    - - \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/gevent/client/js/script.js --- a/tweetcast/gevent/client/js/script.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -gtto = null; -tweets = []; - -function tweetToHtml(tweet) { - html = '
  • '; - a_user = ''; - if (tweet.user.profile_image_url) { - html += a_user + ''; - } - html += '

    ' + a_user + '@' + tweet.user.screen_name + '

    ' + tweet.created_at + '

    '; - lastend = 0; - txt = ''; - tweet.entities.sort(function(a, b) { return a.indice_start - b.indice_start }); - for (var i in tweet.entities) { - txt += tweet.text.substring(lastend, tweet.entities[i].indice_start); - lastend = tweet.entities[i].indice_end; - switch(tweet.entities[i].type) { - case "entity_hashtag": - txt += '#' + tweet.entities[i].entity.text + ''; - break; - case "entity_user": - txt += '@' + tweet.entities[i].entity.screen_name + ''; - break; - case "entity_url": - case "entity_media": - txt += '' + tweet.entities[i].entity.expanded_url + ''; - break; - } - } - txt += tweet.text.substring(lastend); - html += txt + '

  • '; - return html; -} - -function scheduleTweets() { - var tl = $("#tweetlist"), tc = $("#tweetcontainer"); - if (tweets.length != tl.children().length) { - console.log("Tweet count error"); - } - if (tweets.length) { - while (tl.height() - (tc.scrollTop() + tc.height()) > 1000) { - tl.children().last().detach(); - tweets.pop(); - } - if (tl.height() - (tc.scrollTop() + tc.height()) < 120) { - getTweets({ - before_id : tweets[tweets.length - 1].id, - limit : 5 - }); - } - getTweets({ - after_id : tweets[0].id - }); - } else { - getTweets({ - limit: 15 - }); - } -} - -function getTweets(params) { - $.getJSON("http://" + document.location.hostname + ":8888/?callback=?", params, function(data, a, b) { - if (data.tweets && data.tweets.length) { - var tl = $("#tweetlist"), tc = $("#tweetcontainer"); - html = ''; - for (var i in data.tweets) { - html += tweetToHtml(data.tweets[i]); - } - if (params.before_id) { - tl.append(html); - tweets = tweets.concat(data.tweets); - } else { - var pos = tc.scrollTop(), fixScroll = (pos > 80); - pos -= tl.height(); - tl.prepend(html); - tweets = data.tweets.concat(tweets); - if (fixScroll) { - tc.scrollTop(tl.height() + pos); - } - } - } - }); -} - -$(document).ready(function() { - gtto = setInterval(scheduleTweets, 1500); -}); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/gevent/server/tweetcast.py --- a/tweetcast/gevent/server/tweetcast.py Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from gevent import monkey; monkey.patch_all() -# Importer d'abord, sinon exception -import anyjson, gevent, psycopg2 -from sqlalchemy import (Boolean, Column, BigInteger, Integer, String, - ForeignKey, DateTime, create_engine, desc, func) -from sqlalchemy.orm import backref, relationship, sessionmaker -from sqlalchemy.ext.declarative import declarative_base -from gevent.pywsgi import WSGIServer -from urlparse import parse_qs - -annotation_keywords = { - "positive" : '++', - "negative" : '--', - "reference" : '==', - "question" : '??' -} - -Base = declarative_base() -engine = create_engine('postgresql://postgres:doiteshimashite@localhost/tweet_live') -Session = sessionmaker(bind=engine) - -class EntityType(Base): - __tablename__ = "tweet_entity_type" - id = Column(Integer, primary_key=True, autoincrement=True) - label = Column(String) - -class Entity(Base): - __tablename__ = "tweet_entity" - id = Column(Integer, primary_key=True) - tweet_id = Column(BigInteger, ForeignKey('tweet_tweet.id')) - type = Column(String) - entity_type_id = Column(Integer, ForeignKey('tweet_entity_type.id'), nullable=False) - entity_type = relationship("EntityType", backref="entities") - indice_start = Column(Integer) - indice_end = Column(Integer) - source = Column(String) - __mapper_args__ = {'polymorphic_on': type, 'polymorphic_identity': 'entity_entity', 'with_polymorphic':'*'} - - def jsondict(self): - return { - "indice_start" : self.indice_start, - "indice_end" : self.indice_end, - "type" : self.type - } - -class Tweet(Base): - __tablename__ = 'tweet_tweet' - - id = Column(BigInteger, primary_key=True, autoincrement=False) - created_at = Column(DateTime) - text = Column(String) - user_id = Column(Integer, ForeignKey('tweet_user.id')) - user = relationship("User", backref="tweets") - entity_list = relationship(Entity, backref='tweet') - - def annotations(self): - aa = [] - for a in annotation_keywords: - n = self.text.count(annotation_keywords[a]) - if n: - aa.append({ - "name" : a, - "text" : annotation_keywords[a], - "count" : n - }) - return aa - - def jsondict(self): - return { - "id" : str(self.id), - "created_at" : str(self.created_at), - "text" : self.text, - "user" : self.user.jsondict(), - "entities" : [en.jsondict() for en in self.entity_list], - "annotations" : self.annotations() - } - -class User(Base): - __tablename__ = "tweet_user" - - id = Column(BigInteger, primary_key=True, autoincrement=False) - screen_name = Column(String, index=True) - profile_image_url = Column(String) - - def jsondict(self): - return { - "id" : str(self.id), - "screen_name" : self.screen_name, - "profile_image_url" : self.profile_image_url - } - -class Hashtag(Base): - __tablename__ = "tweet_hashtag" - id = Column(Integer, primary_key=True) - text = Column(String, unique=True, index=True) - - def jsondict(self): - return { - "text" : self.text - } - -class Url(Base): - __tablename__ = "tweet_url" - id = Column(Integer, primary_key=True) - url = Column(String, unique=True) - expanded_url = Column(String) - - def jsondict(self): - return { - "url" : self.url, - "expanded_url" : self.expanded_url - } - -class Media(Base): - __tablename__ = "tweet_media" - id = Column(BigInteger, primary_key=True, autoincrement=False) - url = Column(String) - expanded_url = Column(String) - - def jsondict(self): - return { - "url" : self.url, - "expanded_url" : self.expanded_url - } - -class EntityHashtag(Entity): - __tablename__ = "tweet_entity_hashtag" - __mapper_args__ = {'polymorphic_identity': 'entity_hashtag'} - id = Column(Integer, ForeignKey('tweet_entity.id'), primary_key=True) - hashtag_id = Column(Integer, ForeignKey("tweet_hashtag.id")) - hashtag = relationship(Hashtag, primaryjoin=hashtag_id == Hashtag.id) - - def jsondict(self): - d = super(EntityHashtag, self).jsondict() - d['entity'] = self.hashtag.jsondict() - return d - -class EntityUrl(Entity): - __tablename__ = "tweet_entity_url" - __mapper_args__ = {'polymorphic_identity': 'entity_url'} - id = Column(Integer, ForeignKey('tweet_entity.id'), primary_key=True) - url_id = Column(Integer, ForeignKey("tweet_url.id")) - url = relationship(Url, primaryjoin=url_id == Url.id) - - def jsondict(self): - d = super(EntityUrl, self).jsondict() - d['entity'] = self.url.jsondict() - return d - -class EntityUser(Entity): - __tablename__ = "tweet_entity_user" - __mapper_args__ = {'polymorphic_identity': 'entity_user'} - id = Column(Integer, ForeignKey('tweet_entity.id'), primary_key=True) - user_id = Column(BigInteger, ForeignKey('tweet_user.id')) - user = relationship(User, primaryjoin=(user_id == User.id)) - - def jsondict(self): - d = super(EntityUser, self).jsondict() - d['entity'] = self.user.jsondict() - return d - -class EntityMedia(Entity): - __tablename__ = "tweet_entity_media" - __mapper_args__ = {'polymorphic_identity': 'entity_media'} - id = Column(Integer, ForeignKey('tweet_entity.id'), primary_key=True) - media_id = Column(BigInteger, ForeignKey('tweet_media.id')) - media = relationship(Media, primaryjoin=(media_id == Media.id)) - - def jsondict(self): - d = super(EntityMedia, self).jsondict() - d['entity'] = self.media.jsondict() - return d - -# ranges = [] -# lastid = 0L -# -# def define_ranges: -# - -def webserver(env, start_response): - if env['PATH_INFO'] == '/': - httpquery = parse_qs(env['QUERY_STRING']) - print "serving tweets to", env['REMOTE_ADDR'], httpquery - query = session.query(Tweet) - if "since_id" in httpquery: - query = query.filter(Tweet.id >= long(httpquery["since_id"][0])) - if "after_id" in httpquery: - query = query.filter(Tweet.id > long(httpquery["after_id"][0])) - if "max_id" in httpquery: - query = query.filter(Tweet.id <= long(httpquery["max_id"][0])) - if "before_id" in httpquery: - query = query.filter(Tweet.id < long(httpquery["before_id"][0])) - query = query.order_by(desc(Tweet.id)) - if "limit" in httpquery: - result = query[:int(httpquery["limit"][0])] - else: - result = query[:200] - start_response('200 OK', [('Content-Type', 'application/javascript' if "callback" in httpquery else 'application/json' )]) - return ["%s%s%s"%( - "%s("%httpquery["callback"][0] if "callback" in httpquery else "", - anyjson.serialize({"tweets" : [t.jsondict() for t in result]}), - ")" if "callback" in httpquery else "" - )] - else: - start_response('404 Not Found', [('Content-Type', 'text/html')]) - return ['

    Not Found

    '] - -session = Session() -WSGIServer(('', 8888), webserver).serve_forever() \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/css/style.css --- a/tweetcast/nodejs-bis/client/css/style.css Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,336 +0,0 @@ -/* Browser-reset CSS */ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -body { - font-family: Helvetica, Arial, sans-serif; background-color: #F7F6F6; background-image: url("../img/bgd.jpg"); background-repeat: repeat-x; -} - -b { - font-weight: bold; -} - -.highlight { - background: #ffff00; -} - -#container { - width: 960px; margin: 0 auto; -} - -#colgauche { - float: left; width: 455px; margin-right: 13px; -} - -.barre { - float: left; width: 100%; -} - -.greyed { - color: #999; font-style: italic; -} - -.rechercheCourante { - background: #ffa0ff; font-weight: bold; color: #000080; -} - -/* Menu */ - -#headlogo { - float: left; margin-right: 10px; -} - -.menu { - border-left: 1px solid #C3C3C3; - float: left; - list-style: none; - font-size: 12px; - height: 62px; overflow: hidden; -} - -.menu li { - background: url("../img/menu_underline.gif") left bottom no-repeat; - padding: 3px 0 0 5px; - height: 18px; - min-width: 80px; -} - -.menu a { - color: #000000; text-decoration: none; -} - -.menu a:hover { - color: #0099FF; -} - -/* Formulaire */ - -#twwWrap { - float: left; width: 450px; background: #ffffff; padding: 1px; border-width: 1px; border-style: solid solid none solid; border-color: #ababab; margin-top: 6px; -} - -#tweetWriter { - width: 430px; padding: 10px; background: #efefef; -} - -/* Liste de Tweets */ - -#tweetviz { - float: left; width: 452px; border: 1px solid #999; -} - -/* Recherche */ - -#recherche { - position: relative; float: left; padding: 2px 0; width: 452px; border-bottom: 1px solid #999; -} - -#recherche input { - float: left; -} - -#inp_q { - width: 236px; border: none; padding: 1px; margin-left: 2px; height: 17px; font-size: 13px; -} - -#inp_submit, #inp_reset { - border: 0; padding: 0; width: 20px; height: 20px; overflow: hidden; text-indent: 800px; background: url(../img/searchcancel.png) -} - -#inp_submit:hover { - background-position: -20px 0; -} - -#inp_submit:active { - background-position: -40px 0; -} - -#inp_reset { - background-position: 0 -20px; -} - -#inp_reset:hover { - background-position: -20px -20px; -} - -#inp_reset:active { - background-position: -40px -20px; -} - -#time_legende { - float: left; margin-left: 30px; width: 30px; height: 20px; background: url(../img/scale.png) left; -} - -#time_scale { - float: left; font-size: 12px; margin: 3px 0 0; color: #666; width: 50px; text-align: center; -} - -#time_zoomout, #time_zoomin { - float: left; width: 12px; height: 20px; background: url(../img/scale.png); -} - -#time_zoomout { - background-position: -30px; -} - -#time_zoomout.inactive { - background-position: -54px; -} - -#time_zoomin { - background-position: -42px; -} - -#time_zoomin.inactive { - background-position: -66px; -} - -#recherche_annot { - position: absolute; top: 20px; z-index: 4; background: #ffffff; border: 1px solid #ccc; padding: 4px; font-size: 12px; - display: none; box-shadow: 2px 2px 2px rgba(0, 0, 0, .5) -} - -#recherche_annot a { - padding: 1px; line-height: 13px; margin: 1px; font-weight: bold; text-decoration: none; color: #000000; -} - -/* Liste des tweets */ - -#tweetlist { - float: left; width: 280px; height: 480px; list-style: none; border-right: 1px solid #999; color: #585858; cursor: pointer; cursor: hand; background: #ffffff; -} - -#tweetlist a { - text-decoration: none; color: #1985B5; -} - -#tweetlist a:hover { - text-decoration: underline; color: #105060; -} - -li.tweet, li.placeholder { - border-bottom : 1px dotted; overflow: hidden; float: left; border-color: #ccc; -} - -li.tweet { - position: relative; background: #fff; -} - -li.full { - width: 270px; height: 117px; border-right: 10px solid #ff0; -} - -li.half { - width: 280px; height: 46px; -} - -li.icons { - width: 20px; height: 20px; border: none; -} - -li.placeholder { - visibility: hidden; -} - -.tweet p { - overflow: hidden; -} - -.full p.tweet_text { - font-size: 12px; margin: 5px 0 5px 58px; height: 108px; width: 207px; color: #000000; -} - -.half p.tweet_text { - font-size: 11px; margin: 5px 0 5px 49px; height: 36px; line-height: 12px; width: 216px; -} - -div.around_img { - float: left; -} - -.full .profile_image { - margin: 5px 5px 0 5px; width: 48px; height: 48px; -} - -.half .profile_image { - margin: 5px; width: 36px; height: 36px; -} - -.icons .profile_image { - margin: 2px; width: 16px; height: 16px; -} - -p.created_at { - font-size: 12px; text-align: center; font-style: italic; color: #999999; width: 58px; overflow: hidden; -} - -.annotations { - position: absolute; margin: 0; padding: 0; top: 0; left: 0; width: 100%; height: 100%; -} - -.icons .annotations { - position: absolute; width: 20px; height: 6px; left: 0; top: 16px; z-index: 3; -} - -div.annotation { - float: left; height: 100%; -} - -div.twmain { - position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; overflow: hidden; -} - -div.tweet_actions { - position: absolute; bottom : 2px; right: 4px; font-size: 11px; -} - -/* timeline */ - -#timeline { - float: left; height: 480px; width: 150px; border-right: 1px solid #999; cursor: pointer; cursor: hand; -} - -#scrollcont { - float: left; width: 20px; height: 480px; overflow: auto; -} - -#scrollin { - width: 1px; height: 8000px; -} - -/* hovertweet */ - -#hovertweet { - position: absolute; display: none; margin: -20px 0 0 15px; z-index: 12; -} - -div.full { - position: absolute; background: #eeeeee; width: 270px; height: 84px; border: 1px solid #808080; border-radius: 3px; box-shadow: 5px 5px 5px rgba(0,0,0,.3); -} - -#hoverarrow { - position: absolute; width: 10px; height: 18px; left: -9px; top: 13px; background: url(../img/arrow.png); -} - -/* Colonne de droite */ - -#coldroite { - float: left; width: 492px; -} - -#vlWrap { - float: left; border: 5px solid #ffffff; background: #999999; padding: 1px; margin-top: 20px; -} - -#videoLivePlayer { - width: 480px; height: 320px; background: #000000; -} - -#out_fleche { - float: left; position: relative; width: 492px; height: 14px; background: url(../img/bgnoarrow.png); -} - -#in_fleche { - position: absolute; left: 10px; width: 27px; height: 15px; background: url(../img/arrowtop.png); -} - -#accordeon { - float: left; width: 492px; list-style: none; background: #777777; -} - -#accordeon li { - float: left; width: 480px; margin: 0 1px 1px 1px; padding: 4px; border: 1px solid #ffffff; background: #efefef; -} - -#accordeon li.deplie { - background: url(../img/bgdeplie.png) top repeat-x #efefef; -} - -/* Tag Cloud */ - -#motscles { - text-align: center; -} - -#motscles span { - padding: 2px; cursor: pointer; cursor: hand; -} diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/arrow.png Binary file tweetcast/nodejs-bis/client/img/arrow.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/arrowtop.png Binary file tweetcast/nodejs-bis/client/img/arrowtop.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/bgd.jpg Binary file tweetcast/nodejs-bis/client/img/bgd.jpg has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/bgdeplie.png Binary file tweetcast/nodejs-bis/client/img/bgdeplie.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/bgnoarrow.png Binary file tweetcast/nodejs-bis/client/img/bgnoarrow.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/head_logo.gif Binary file tweetcast/nodejs-bis/client/img/head_logo.gif has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/menu_underline.gif Binary file tweetcast/nodejs-bis/client/img/menu_underline.gif has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/placeholder.png Binary file tweetcast/nodejs-bis/client/img/placeholder.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/img/searchcancel.png Binary file tweetcast/nodejs-bis/client/img/searchcancel.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/index.html --- a/tweetcast/nodejs-bis/client/index.html Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ - - - - - Polemic Tweet “TweetCast” - - - - - - - - - - -
    -
    -
    - - -
    -
    -
    -

    Annotations polémiques

    -
    -
    -
    -
    -
    - - - -
    -
    -
    - - -
    -
    - Recherche par annotation :
    -
    -
    -
    -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      -
      - -
      -
      -
      -
      -
      -
      - - \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/js/jquery-1.6.4.min.js --- a/tweetcast/nodejs-bis/client/js/jquery-1.6.4.min.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ -(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
      a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
      ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
      t
      ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

      ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
      ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
      ","
      "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
      ").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
      ";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/js/jquery.mousewheel.min.js --- a/tweetcast/nodejs-bis/client/js/jquery.mousewheel.min.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * - * Version: 3.0.2 - * - * Requires: 1.2.2+ - */ -(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/js/raphael-min.js --- a/tweetcast/nodejs-bis/client/js/raphael-min.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -// ┌─────────────────────────────────────────────────────────────────────┐ \\ -// │ Raphaël 2.0 - JavaScript Vector Library │ \\ -// ├─────────────────────────────────────────────────────────────────────┤ \\ -// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ -// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ -// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ -// └─────────────────────────────────────────────────────────────────────┘ \\ -(function(a){var b="0.3.2",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=[];h=a,i=0;for(var s=0,t=f.length;sf*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(attr in j)if(j[g](attr))if(U[g](attr)||d.paper.customAttributes[g](attr)){u[attr]=d.attr(attr),u[attr]==null&&(u[attr]=T[attr]),v[attr]=j[attr];switch(U[attr]){case C:w[attr]=(v[attr]-u[attr])/t;break;case"colour":u[attr]=a.getRGB(u[attr]);var A=a.getRGB(v[attr]);w[attr]={r:(A.r-u[attr].r)/t,g:(A.g-u[attr].g)/t,b:(A.b-u[attr].b)/t};break;case"path":var B=bG(u[attr],v[attr]),D=B[1];u[attr]=B[0],w[attr]=[];for(y=0,z=u[attr].length;yd)return d;while(cf?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cd(){return this.x+q+this.y+q+this.width+" × "+this.height}function cc(){return this.x+q+this.y}function bR(a,b,c,d,e,f){a!=null?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function bw(a){var b=[];for(var c=0,d=a.length;d-2>c;c+=2){var e=[{x:+a[c],y:+a[c+1]},{x:+a[c],y:+a[c+1]},{x:+a[c+2],y:+a[c+3]},{x:+a[c+4],y:+a[c+5]}];d-4==c?(e[0]={x:+a[c-2],y:+a[c-1]},e[3]=e[2]):c&&(e[0]={x:+a[c-2],y:+a[c-1]}),b.push(["C",(-e[0].x+6*e[1].x+e[2].x)/6,(-e[0].y+6*e[1].y+e[2].y)/6,(e[1].x+6*e[2].x-e[3].x)/6,(e[1].y+6*e[2].y-e[3].y)/6,e[2].x,e[2].y])}return b}function bv(){return this.hex}function bt(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bs(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bs(a,b){for(var c=0,d=a.length;c',bk=bj.firstChild,bk.style.behavior="url(#default#VML)";if(!bk||typeof bk.adj!="object")return a.type=p;bj=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a&&a!==null||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};var bl=a.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){eve("setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,initWin&&initWin(h.win)};var bm=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bm=bt(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bm=bt(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bm(b)},bn=function(){return"hsb("+[this.h,this.s,this.b]+")"},bo=function(){return"hsl("+[this.h,this.s,this.l]+")"},bp=function(){return this.hex},bq=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},br=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:bp};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},crl.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=bp;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bn}},a.rgb2hsl=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bo}},a._path2string=function(){return this.join(",").replace(X,"$1")};var bu=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bt(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bv};!W[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bm(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bv},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv}},a),a.hsb=bt(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bt(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bt(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=bt(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=by(b)),d.length||r(b).replace(Y,function(a,b,e){var f=[],g=b.toLowerCase();e.replace($,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(d.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");if(g=="r")d.push([b][n](f));else while(f.length>=c[g]){d.push([b][n](f.splice(0,c[g])));if(!c[g])break}}),d.toString=a._path2string;return d}),a.parseTransformString=bt(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=by(b)),d.length||r(b).replace(Z,function(a,b,c){var e=[],f=v.call(b);c.replace($,function(a,b){b&&e.push(+b)}),d.push([b][n](e))}),d.toString=a._path2string;return d}),a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3),l=A(j,2),m=i*i,n=m*i,o=k*a+l*3*i*c+j*3*i*i*e+n*g,p=k*b+l*3*i*d+j*3*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,x=j*e+i*g,y=j*f+i*h,z=90-w.atan2(q-s,r-t)*180/B;(q>s||r1&&(v=w.sqrt(v),c=v*c,d=v*d);var x=c*c,y=d*d,A=(f==g?-1:1)*w.sqrt(z((x*y-x*u*u-y*t*t)/(x*u*u+y*t*t))),C=A*c*u/d+(a+h)/2,D=A*-d*t/c+(b+i)/2,E=w.asin(((b-D)/d).toFixed(9)),F=w.asin(((i-D)/d).toFixed(9));E=aF&&(E=E-B*2),!g&&F>E&&(F=F-B*2)}else E=j[0],F=j[1],C=j[2],D=j[3];var G=F-E;if(z(G)>k){var H=F,I=h,J=i;F=E+k*(g&&F>E?1:-1),h=C+c*w.cos(F),i=D+d*w.sin(F),m=bD(h,i,c,d,e,0,g,I,J,[F,H,C,D])}G=F-E;var K=w.cos(E),L=w.sin(E),M=w.cos(F),N=w.sin(F),O=w.tan(G/4),P=4/3*c*O,Q=4/3*d*O,R=[a,b],S=[a+P*L,b-Q*K],T=[h+P*N,i-Q*M],U=[h,i];S[0]=2*R[0]-S[0],S[1]=2*R[1]-S[1];if(j)return[S,T,U][n](m);m=[S,T,U][n](m).join()[s](",");var V=[];for(var W=0,X=m.length;W"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bE(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bE(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bE(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bE(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bG=a._path2curve=bt(function(a,b){var c=bA(a),d=b&&bA(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bD[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bC(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bC(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bB(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bB(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bB(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bB(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b].length>7){a[b].shift();var e=a[b];while(e.length)a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1),k=x(c.length,d&&d.length||0)}},i=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],k=x(c.length,d&&d.length||0))};for(var j=0,k=x(c.length,d&&d.length||0);j=j)return p;o=p}if(j==null)return k},cg=function(b,c){return function(d,e,f){d=bG(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},ch=cg(1),ci=cg(),cj=cg(0,1);a.getTotalLength=ch,a.getPointAtLength=ci,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cj(a,b).end;var d=cj(a,c,1);return b?cj(d,b).end:d},b_.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return ch(this.attrs.path)}},b_.getPointAtLength=function(a){if(this.type=="path")return ci(this.attrs.path,a)},b_.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var ck=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};ck.easeIn=ck["ease-in"]=ck["<"],ck.easeOut=ck["ease-out"]=ck[">"],ck.easeInOut=ck["ease-in-out"]=ck["<>"],ck["back-in"]=ck.backIn,ck["back-out"]=ck.backOut;var cl=[],cm=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cn=function(){var b=+(new Date),c=0;for(;c1&&!d.next){for(s in k)k[g](s)&&(r[s]=d.totalOrigin[s]);d.el.attr(r),cr(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&cr(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}a.svg&&m&&m.paper&&m.paper.safari(),cl.length&&cm(cn)},co=function(a){return a>255?255:a<0?0:a};b_.animateWith=function(b,c,d,e,f,g){var h=d?a.animation(d,e,f,g):c;status=b.status(c);return this.animate(h).status(h,status*c.ms/h.ms)},b_.onAnimation=function(a){a?eve.on("anim.frame."+this.id,a):eve.unbind("anim.frame."+this.id);return this},cq.prototype.delay=function(a){var b=new cq(this.anim,this.ms);b.times=this.times,b.del=+a||0;return b},cq.prototype.repeat=function(a){var b=new cq(this.anim,this.ms);b.del=this.del,b.times=w.floor(x(a,0))||1;return b},a.animation=function(b,c,d,e){if(b instanceof cq)return b;if(a.is(d,"function")||!d)e=e||d||null,d=null;b=Object(b),c=+c||0;var f={},h,i;for(i in b)b[g](i)&&Q(i)!=i&&Q(i)+"%"!=i&&(h=!0,f[i]=b[i]);if(!h)return new cq(b,c);d&&(f.easing=d),e&&(f.callback=e);return new cq({100:f},c)},b_.animate=function(b,c,d,e){var f=this;if(f.removed){e&&e.call(f);return f}var g=b instanceof cq?b:a.animation(b,c,d,e);cr(g,f,g.percents[0],null,f.attr());return f},b_.setTime=function(a,b){a&&b!=null&&this.status(a,y(b,a.ms)/a.ms);return this},b_.status=function(a,b){var c=[],d=0,e,f;if(b!=null){cr(a,this,-1,y(b,1));return this}e=cl.length;for(;d.5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;b.gradient&&(p.defs.removeChild(b.gradient),delete b.gradient),k=k.replace(/[\(\)\s,\xb0#]/g,"-"),s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x1?E.opacity/100:E.opacity});case"stroke":E=a.getRGB(p),i.setAttribute(o,E.hex),o=="stroke"&&E[b]("opacity")&&q(i,{"stroke-opacity":E.opacity>1?E.opacity/100:E.opacity}),o=="stroke"&&d._.arrows&&("startString"in d._.arrows&&w(d,d._.arrows.startString),"endString"in d._.arrows&&w(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&u(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){F=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),F&&(G=F.getElementsByTagName("stop"),q(G[G.length-1],{"stop-opacity":p}));break};default:o=="font-size"&&(p=e(p,10)+"px");var H=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[H]=p,d._.dirty=1,i.setAttribute(o,p)}}B(d,f),i.style.visibility=m},A=1.2,B=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n"));var Y=V.getBoundingClientRect();t.W=m.w=(Y.right-Y.left)/W,t.H=m.h=(Y.bottom-Y.top)/W,t.X=m.x,t.Y=m.y+t.H/2,("x"in i||"y"in i)&&(t.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));var Z=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var $=0,_=Z.length;$<_;$++)if(Z[$]in i){t._.dirty=1;break}switch(m["text-anchor"]){case"start":t.textpath.style["v-text-align"]="left",t.bbx=t.W/2;break;case"end":t.textpath.style["v-text-align"]="right",t.bbx=-t.W/2;break;default:t.textpath.style["v-text-align"]="center",t.bbx=0}t.textpath.style["v-text-kern"]=!0}},addGradientFill=function(b,f,g){b.attrs=b.attrs||{};var h=b.attrs,i=Math.pow,j,k,l="linear",m=".5 .5";b.attrs.gradient=f,f=c(f).replace(a._radial_gradient,function(a,b,c){l="radial",b&&c&&(b=d(b),c=d(c),i(b-.5,2)+i(c-.5,2)>.25&&(c=e.sqrt(.25-i(b-.5,2))*((c>.5)*2-1)+.5),m=b+n+c);return o}),f=f.split(/\s*\-\s*/);if(l=="linear"){var p=f.shift();p=-d(p);if(isNaN(p))return null}var q=a._parseDots(f);if(!q)return null;b=b.shape||b.node;if(q.length){b.removeChild(g),g.on=!0,g.method="none",g.color=q[0].color,g.color2=q[q.length-1].color;var r=[];for(var s=0,t=q.length;s')}}catch(c){B=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}};C(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=u*1e3+n+u*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=removed(b);return!0};var D=a.st;for(var E in A)A[b](E)&&!D[b](E)&&(D[E]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(E))}(window.Raphael) \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/js/script.js --- a/tweetcast/nodejs-bis/client/js/script.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,967 +0,0 @@ -/** - * @author raph - */ - -var socket, - tlPaper, - twCx = { - followLast : true, - position : "0", - date_levels : [ - 3600 * 1000, - 15 * 60 * 1000, - 5 * 60 * 1000, - 60 * 1000 - ], - timeLevel : 1, - deltaX : 40, - tlWidth : 150, - tlHeight : 480, - globalWords : {}, - refMouse : { x : 0, y : 0}, - refPosTl : { x : 0, y : 0}, - tlMouseMoved : false, - tlMouseClicked : false, - filtre : null - }, - tlBuffer = '', - relHover = [], - wheelDelta = 0, - scrollEnabled = false, - scrollExtent = 8000 - 480, - lastScrollPos = 0, - rx_url = /https?:\/\/[0-9a-zA-Z\.%\/-_]+/g, - rx_word = /[^ \.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g, - stop_list = [ 'and', 'avec', 'aux', 'car', 'comme', 'dans', 'donc', 'des', 'elle', 'est', 'être', 'eux', 'ils', 'les', 'leur', 'leurs', 'mes', 'mon', 'tes', 'ton', 'notre', 'nos', 'nous', 'ont', 'pas', 'que', 'qui', 'sont', 'the', 'une', 'votre', 'vos', 'vous' ]; - -function getColor(annotation, lum) { - return Raphael.hsl2rgb(annotations[annotation].colors.h, annotations[annotation].colors.s, lum); -} - -function arc(source, target) { - var x3 = .3 * target.y - .3 * source.y + .8 * source.x + .2 * target.x; - var y3 = .8 * source.y + .2 * target.y - .3 * target.x + .3 * source.x; - var x4 = .3 * target.y - .3 * source.y + .2 * source.x + .8 * target.x; - var y4 = .2 * source.y + .8 * target.y - .3 * target.x + .3 * source.x; - return "M" + source.x + " " + source.y + "C" + [x3, y3, x4, y4, target.x, target.y].join(" "); -} - -function addTweet(tweet) { - function backRef(source_id, target_id, type) { - var target = tweetById(target_id); - if (target) { - var brobj = { - "referenced_by_id" : source_id, - "type" : type - } - if (target.backRefs) { - target.backRefs.push(brobj); - } else { - target.backRefs = [ brobj ] - } - } - } - - if (twCx.idIndex.indexOf(tweet.id) != -1) { - return; - } - - var txt_date = tweet.created_at; - if (navigator.userAgent.search(/MSIE/) != -1) { - txt_date = txt_date.replace(/( \+)/, ' UTC$1'); - } - tweet.date_value = Date.parse(txt_date); - - var tab = tweet.text.match(/\&\#[0-9]+\;/g); - for (var i in tab) { - var n = parseInt(tab[i].substr(2)); - if (n != NaN) { - tweet.text = tweet.text.replace(tab[i], String.fromCharCode(n)); - } - } - - var ann = []; - for (var j in annotations) { - if (j != "default") { - for (var k in annotations[j].keywords) { - if (tweet.text.search(annotations[j].keywords[k]) != -1) { - ann.push(j); - break; - } - } - } - } - tweet.annotations = ann; - - if (tweet.in_reply_to_status_id) { - backRef( tweet.id, tweet.in_reply_to_status_id, "reply" ); - } - if (tweet.retweeted_status) { - backRef( tweet.id, tweet.retweeted_status.id, "retweet" ); - } - - var localWords = [] - - var tab = tweet.text.replace(rx_url,'').match(rx_word); - for (var i in tab) { - var word = tab[i].toLowerCase(); - if (stop_list.indexOf(word) == -1 && tracking_keywords.indexOf(word) == -1) { - if (twCx.globalWords[word]) { - twCx.globalWords[word]++; - } else { - twCx.globalWords[word] = 1; - } - localWords.push(word); - } - } - - tweet.words = localWords; - - var p = twCx.idIndex.length; - while (p && tweet.id < twCx.idIndex[p-1]) { - p--; - } - twCx.tweets.splice(p, 0, tweet); - twCx.idIndex.splice(p, 0, tweet.id); - - if (!twCx.timeline.length) { - twCx.timeline = [ populateDateStruct(0, twCx.date_levels[0] * parseInt(tweet.date_value / twCx.date_levels[0])) ] - } - while (tweet.date_value > twCx.timeline[twCx.timeline.length - 1].end) { - twCx.timeline.push( populateDateStruct(0, twCx.timeline[twCx.timeline.length - 1].end) ); - } - - insertIntoDateStruct(twCx.timeline, tweet); -} - -function getSliceContent(slice) { - if (slice.slices) { - var result = []; - for (var i in slice.slices) { - result = result.concat(getSliceContent(slice.slices[i])); - } - } else { - var result = slice.tweets; - } - return result; -} - -function flattenDateStruct(slices, target_level) { - var current_level = slices[0].level, - result = []; - if (current_level < target_level) { - if (slices[0].slices) { - for (var i in slices) { - result = result.concat(flattenDateStruct(slices[i].slices, target_level)); - } - } - } - else { - for (var i in slices) { - result.push({ - "start" : slices[i].start, - "end" : slices[i].end, - "tweets" : getSliceContent(slices[i]) - }); - } - } - return result; -} - -function trimFDS() { - var slices = flattenDateStruct(twCx.timeline, twCx.timeLevel); - while (slices[0].tweets.length == 0) { - slices.splice(0,1); - } - while (slices[slices.length - 1].tweets.length == 0) { - slices.pop(); - } - var centralTweet = ( twCx.centralTweet ? twCx.centralTweet : twCx.tweets[twCx.tweets.length - 1] ), - delta = 30 * twCx.date_levels[twCx.timeLevel], - centre = Math.min(slices[slices.length - 1].end - delta , Math.max(slices[0].start + delta, centralTweet.date_value)), - min = centre - delta, - max = centre + delta; - while (slices[0].start < min) { - slices.splice(0,1); - } - while (slices[slices.length - 1].end > max) { - slices.pop(); - } - return slices; -} - -function populateDateStruct(level, start) { - var end = start + twCx.date_levels[level], - struct = { - "level" : level, - "start" : start, - "end" : end - }; - if (level < twCx.date_levels.length - 1) { - struct.slices = []; - var newstart = start; - while (newstart < end) { - struct.slices.push(populateDateStruct(level + 1, newstart)); - newstart += twCx.date_levels[level + 1]; - } - } else { - struct.tweets = []; - } - return struct; -} - -function insertIntoDateStruct(slices, tweet) { - var creadate = tweet.date_value; - for (var i in slices) { - if (creadate < slices[i].end) { - if (slices[i].slices) { - insertIntoDateStruct(slices[i].slices, tweet); - } else { - slices[i].tweets.push(tweet.id); - } - break; - } - } -} - -function placeHolder(className) { - return '
    • '; -} - -function tweetById(tweetid) { - var pos = twCx.idIndex.indexOf(tweetid); - return (pos == -1) ? false : twCx.tweets[pos]; -} - -function selectTweet(tweetid) { - twCx.position = tweetid; - twCx.followLast = (twCx.position == twCx.idIndex[twCx.tweets.length - 1]); - updateDisplay(); -} - -function goToPos(nPos) { - twCx.position = twCx.currentIdIndex[Math.min( twCx.currentIdIndex.length - 1, Math.max(0, nPos ) )]; - twCx.followLast = (!twCx.filtre && nPos == twCx.tweets.length - 1); - updateDisplay(); -} - -function movePos(delta) { - goToPos( delta + twCx.currentIdIndex.indexOf(twCx.position) ); -} - -function tweetToHtml(tweet, className, elName) { - - function highlight(texte) { - return ( twCx.filtre ? texte.replace(twCx.filtre, '$1' ) : texte ); - } - - if (!tweet) { - return placeHolder(className); - } - var el = (elName ? elName : 'li'); - var html = '<' + el + ' class="tweet ' + className + '" id="tweet_' + tweet.id + '"'; - if (className != 'full') { - html += ' onclick="selectTweet(\'' + tweet.id + '\'); return false;"'; - } - html += ' onmouseover="rolloverTweet(\'' + tweet.id + "', " + ( className == 'icons' ) + ');"'; - if (twCx.followLast && className == 'full' && el == 'li') { - html += ' style="display: none"'; - } - html += '>'; - if (tweet.annotations.length) { - html += '
      '; - for (var i in tweet.annotations) { - html += '
      '; - } - html += '
      '; - } - html += '
      '; - a_user = ''; - html += '
      ' + a_user + ''; - if (className == 'full') { - html += '

      ' + new Date(tweet.date_value).toTimeString().substr(0,8) + '

      '; - } - html += '
      '; - if (className != 'icons') { - lastend = 0; - var 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], - "link" : '', - "text" : '#' + tweet.entities.hashtags[i].text - }); - } - for (var i in tweet.entities.urls) { - var linkurl = ( tweet.entities.urls[i].expanded_url ? tweet.entities.urls[i].expanded_url : tweet.entities.urls[i].url ), - dispurl = linkurl.replace(/https?:\/\//,''); - if (linkurl.search(/https?:\/\//) == -1) { - linkurl = 'http://' + linkurl; - } - entities.push({ - "start" : tweet.entities.urls[i].indices[0], - "end" : tweet.entities.urls[i].indices[1], - "link" : '', - "text" : dispurl - }); - } - 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], - "link" : '', - "text" : '@' + tweet.entities.user_mentions[i].screen_name - }); - } - entities.sort(function(a, b) { return a.start - b.start }); - for (var i in entities) { - txt += highlight( tweet.text.substring(lastend, entities[i].start) ) + entities[i].link + highlight( entities[i].text ) + ''; - lastend = entities[i].end; - } - txt += highlight( tweet.text.substring(lastend) ); - html += '

      ' + a_user + highlight('@' + tweet.user.screen_name) + '' + ( className == 'full' ? ' (' + tweet.user.name + ')
      ' : ' : ') + txt + '

      '; - if (className == 'full' && el == 'li') { - html += '
      répondre · '; - html += 'retweeter · '; - html += 'favori
      '; - } - } - html += '
      '; - return html; -} - -function tlIdFromPos(x, y, outside) { - if (!twCx.tlOnDisplay) { - return; - } - var ligne = Math.min( twCx.tlOnDisplay.length - 1, Math.max( 0, Math.floor(( twCx.tlHeight - y ) / twCx.scaleY) ) ), - colonne = Math.floor(( x - twCx.deltaX ) / twCx.scaleX ), - l = 0; - if (colonne >= twCx.tlOnDisplay[ligne].totalTweets || colonne < 0 ) { - if (outside) { - colonne = Math.min( twCx.tlOnDisplay[ligne].totalTweets - 1, Math.max( 0, colonne )); - } else { - return null; - } - } - for (var i in twCx.tlOnDisplay[ligne].displayData) { - var nl = l + twCx.tlOnDisplay[ligne].displayData[i].length; - if (colonne < nl) { - return { - "id" : twCx.tlOnDisplay[ligne].displayData[i][colonne - l], - "annotation" : i - } - } - l = nl; - } -} - -function tlPosTweet(tweet, annotation) { - if (!twCx.tweets) { - return; - } - var x, - y, - dt = tweet.date_value, - ann = ( annotation ? annotation : ( tweet.annotations.length ? tweet.annotations[0] : 'default' ) ); - for (var i = 0; i < twCx.tlOnDisplay.length; i++) { - if (twCx.tlOnDisplay[i].end > dt) { - y = twCx.tlHeight - (i + .5) * twCx.scaleY; - var l = 0; - for (var j in twCx.tlOnDisplay[i].displayData) { - if (j == ann) { - var p = twCx.tlOnDisplay[i].displayData[j].indexOf(tweet.id); - if (p != -1) { - x = twCx.deltaX + twCx.scaleX * ( p + l + .5 ); - } - break; - } - l += twCx.tlOnDisplay[i].displayData[j].length; - } - break; - } - } - return ( x && y ? { "x" : x, "y" : y } : null); -} - -function rolloverTweet(tweetid, showPopup, annotation) { - var t = tweetById(tweetid); - if (!t) { - return; - } - var p = tlPosTweet(t, annotation); - if (!p) { - return; - } - var ptl = $("#timeline").offset(); - if (showPopup) { - $("#hovercontent").html(tweetToHtml(t, 'full', 'div')); - $("#hovertweet").css({ - "left" : parseInt(ptl.left + p.x) + "px", - "top" : parseInt(ptl.top + p.y), - "display" : "block"}); - } else { - $("#hovertweet").hide(); - } - for (var i in relHover) { - relHover[i].remove(); - } - relHover = drawTweetArcs(t, p, '#303030'); - relHover.push(drawTweetPos(p, '#ffffff')); -} - -function drawTweetPos(pos, color) { - var rel = tlPaper.rect(pos.x - .5 * twCx.scaleX, pos.y - .5 * twCx.scaleY, twCx.scaleX, twCx.scaleY); - rel.attr({ "stroke" : color, "fill" : color, "fill-opacity" : .25 }); - return rel; -} - -function drawTweetArcs(tweet, pos, color) { - - var res = []; - - function tweetAndArc(a, b, aorb) { - if (a && b) { - res.push(drawTweetPos(aorb ? a : b, color)); - var aa = tlPaper.path(arc(a,b)) - .attr({ "stroke" : color, "stroke-width" : 1.5, "stroke-opacity" : .8 }); - res.push(aa); - } - } - - if (tweet.retweeted_status) { - var t = tweetById(tweet.retweeted_status.id); - if (t) { - tweetAndArc(pos, tlPosTweet(t)); - } - } - - if (tweet.in_reply_to_status_id) { - var t = tweetById(tweet.in_reply_to_status_id); - if (t) { - tweetAndArc(pos, tlPosTweet(t)); - } - } - - if (tweet.backRefs) { - for (var i in tweet.backRefs) { - var t = tweetById(tweet.backRefs[i].referenced_by_id); - if (t) { - tweetAndArc(tlPosTweet(t), pos, true); - } - } - } - - return res; -} - -function updateDisplay() { - if (!twCx.tweets) { - return; - } - if (twCx.filtre) { - var tweets = twCx.tweets.filter(function(tweet) { - var mention = '@' + tweet.user.screen_name; - return ( tweet.text.search(twCx.filtre) != -1 ) || ( mention.search(twCx.filtre) != -1 ); - }); - $("#inp_q").val(twCx.filtreTexte + ' (' + tweets.length + ' tweets)'); - if (tweets.length) { - var idIndex = tweets.map(function(tweet) { - return tweet.id; - }); - var p = idIndex.indexOf(twCx.position); - if (p == -1) { - for (p = idIndex.length - 1; p > 0 && idIndex[p] > twCx.position; p--) { - } - } - twCx.position = idIndex[p]; - twCx.currentIdIndex = idIndex; - } - - } else { - twCx.currentIdIndex = twCx.idIndex; - var tweets = twCx.tweets; - var p = twCx.idIndex.indexOf(twCx.position); - if (p == -1) { - p = (twCx.followLast ? twCx.idIndex.length - 1 : 0); - } - } - - var l = tweets.length, - lines = 0, - ppy = 0, - html = '', - tweetsOnDisplay = [], - localWords = {}; - - function pushTweet(tp, className) { - if (tp < l && tp >= 0) { - html += tweetToHtml(tweets[tp], className) - tweetsOnDisplay.push(tp); - for (var i in tweets[tp].words) { - var w = tweets[tp].words[i]; - if (localWords[w]) { - localWords[w].freq++ - } else { - localWords[w] = { - "freq" : 1, - "annotations" : {} - } - for (var j in annotations) { - if (j != 'default') { - localWords[w].annotations[j] = 0; - } - } - } - for (var j in tweets[tp].annotations) { - localWords[w].annotations[tweets[tp].annotations[j]]++; - } - } - } else { - html += placeHolder(className); - } - } - - if (l) { - - lastScrollPos = Math.floor( scrollExtent * ( 1 - ( p / l ) ) ); - $("#scrollcont").scrollTop(lastScrollPos); - - if (l > p + 18) { - lines++; - ppy += 20; - for (var i = p + 31; i >= p + 18; i--) { - pushTweet(i, 'icons'); - } - } - if (l > p + 4) { - lines++; - ppy += 20; - for (var i = p + 17; i >= p + 4; i--) { - pushTweet(i, 'icons'); - } - } - for (var k = 3; k >= 1; k--) { - if (l > p + k) { - ppy += 47; - lines++; - pushTweet(p + k, 'half'); - } - } - pushTweet(p, 'full'); - var n = p - 1; - for (var i = 0; i < Math.min(6, Math.max(3, 6 - lines)); i++) { - if (n < 0) { - break; - } - pushTweet(n, 'half'); - n--; - } - for (var i = 0; i < 14 * Math.min(4, Math.max(2, 7 - lines)); i++) { - if (n < 0) { - break; - } - pushTweet(n, 'icons'); - n--; - } - if (html != tlBuffer) { - $("#tweetlist").html(html); - $(".tweet.full").fadeIn(); - tlBuffer = html; - } - - /* Recherche des mots pertinents correspondant à la sélection */ - - var tab = _(localWords).map(function(v, k) { - return { - "word": k, - "freq" : v.freq, - "annotations" : v.annotations, - "score" : v.freq / Math.log( 2 + twCx.globalWords[j] ) - }; - }).filter(function(v) { - return v.freq > 1; - }); - - if (tab.length) { - - tab = _(tab).sortBy( function(a) { return ( - a.score ) }).slice(0,20); - var minfreq = _(tab).min( function(a) { return a.freq} ).freq, - maxfreq = Math.max(minfreq + .1, _(tab).max( function(a) { return a.freq} ).freq), - echfreq = 8 / Math.sqrt( maxfreq - minfreq ), - html = ''; - for (var j in tab) { - var maxann = 0, - ann = "default"; - for (var k in tab[j].annotations) { - if (tab[j].annotations[k] == maxann) { - ann = "default"; - } - if (tab[j].annotations[k] > maxann) { - ann = k; - maxann = tab[j].annotations[k]; - } - } - if (ann == "default") { - var coul = ''; - } else { - var c = getColor(ann, .6), - coul = "background: rgba(" + [ Math.floor(c.r), Math.floor(c.g), Math.floor(c.b), ( tab[j].annotations[ann] / tab[j].freq )].join(',') + ")"; - } - var fontsize = Math.floor( ( 12 + Math.sqrt( tab[j].freq - minfreq ) * echfreq ) ); - html += '' + tab[j].word + ' '; - } - $("#motscles").html(html); - } else { - $("#motscles").html(''); - } - twCx.centralTweet = tweets[p]; - } else { - $("#tweetlist").html(''); - tlBuffer = ''; - $("#motscles").html(''); - } - - twCx.tlOnDisplay = trimFDS(); - twCx.scaleY = twCx.tlHeight / twCx.tlOnDisplay.length; - var maxTweets = 0, - startTl = 0, - endTl = twCx.tlOnDisplay.length - 1; - if (l) { - var startTw = tweets[tweetsOnDisplay[tweetsOnDisplay.length - 1]].date_value, - endTw = tweets[tweetsOnDisplay[0]].date_value; - } - for (var i = 0; i < twCx.tlOnDisplay.length; i++) { - if (l) { - if (startTw >= twCx.tlOnDisplay[i].start && startTw < twCx.tlOnDisplay[i].end) { - startTl = i; - } - if (endTw >= twCx.tlOnDisplay[i].start && endTw < twCx.tlOnDisplay[i].end) { - endTl = i; - } - } - var displayData = {}; - for (var j in annotations) { - displayData[j] = []; - } - for (var j in twCx.tlOnDisplay[i].tweets) { - var tweetid = twCx.tlOnDisplay[i].tweets[j], - tweet = tweetById(tweetid); - if (tweet) { - if (tweet.annotations.length) { - for (var k in tweet.annotations) { - displayData[tweet.annotations[k]].push(tweetid); - } - } else { - displayData['default'].push(tweetid); - } - } - } - var nbT = 0; - for (var j in displayData) { - nbT += displayData[j].length; - } - maxTweets = Math.max(maxTweets, nbT); - twCx.tlOnDisplay[i].displayData = displayData; - twCx.tlOnDisplay[i].totalTweets = nbT; - } - twCx.scaleX = ( twCx.tlWidth - twCx.deltaX ) / maxTweets; - tlPaper.clear(); - relHover = null; - - // Dessin de la correspondance liste-timeline - if (l) { - var startY = twCx.tlHeight - startTl * twCx.scaleY, - endY = twCx.tlHeight - ( endTl + 1 ) * twCx.scaleY, - path = "M0 " + twCx.tlHeight + "C" + .7*twCx.deltaX + " " + twCx.tlHeight + " " + .3*twCx.deltaX + " " + startY + " " + twCx.deltaX + " " + startY + "L" + twCx.tlWidth + " " + startY + "L" + twCx.tlWidth + " " + endY + "L" + twCx.deltaX + " " + endY + "C" + .3*twCx.deltaX + " " + endY + " " + .7*twCx.deltaX + " 0 0 0"; - tlPaper.path( path ).attr({ "stroke" : "none", "fill" : "#000080", "opacity" : .2 }); - } - // dessin de la date de début - - tlPaper.text(twCx.deltaX / 2, twCx.tlHeight - 7, new Date(twCx.tlOnDisplay[0].start).toTimeString().substr(0,5)) - .attr({ "text-anchor" : "middle", "font-size": "9px" }); - - // dessin de la date de fin - - tlPaper.text(twCx.deltaX / 2, 7, new Date(twCx.tlOnDisplay[twCx.tlOnDisplay.length - 1].end).toTimeString().substr(0,5)) - .attr({ "text-anchor" : "middle", "font-size": "9px" }); - - for (var i = 0; i < twCx.tlOnDisplay.length; i++) { - var n = 0, - posY = twCx.tlHeight - ( i + 1 ) * twCx.scaleY; - for (var j in twCx.tlOnDisplay[i].displayData) { - var ll = twCx.tlOnDisplay[i].displayData[j].length; - if (ll > 0) { - tlPaper.rect( twCx.deltaX + n * twCx.scaleX, posY, ll * twCx.scaleX, twCx.scaleY ) - .attr({"stroke" : "none", "fill" : getColor(j, .4).hex }); - n += ll; - } - } - - // Si on est à une demi-heure, on trace un axe secondaire + heure - - if (i < twCx.tlOnDisplay.length - 1 && !(twCx.tlOnDisplay[i].end % 1800000)) { - tlPaper.path("M0 "+posY+"L" + twCx.tlWidth +" "+posY).attr({"stroke":"#ccc"}); - tlPaper.text(twCx.deltaX / 2, posY, new Date(twCx.tlOnDisplay[i].end).toTimeString().substr(0,5)).attr({ "text-anchor" : "middle", "font-size": "9px" }); - } - } - - // dessin du tweet courant - - if (l) { - - if (twCx.filtre) { - for (var i = 0; i < tweets.length; i++) { - if (i != p) { - var pos = tlPosTweet(tweets[i]); - if (pos) { - drawTweetPos(pos, "#ffccff"); - } - } - } - - } - - var posp = tlPosTweet(tweets[p]); - if (posp) { - - drawTweetPos(posp, "#ffff00"); - var yy = posp.y - .5 * twCx.scaleY, - path = "M0 " + ppy + "C" + ( .7 * twCx.deltaX ) + " " + ppy + " " + ( .2 * twCx.deltaX ) + " " + yy + " " + ( twCx.deltaX ) + " " + yy + "L" + ( posp.x - .5 * twCx.scaleX ) + " " + yy; - yy = posp.y + .5 * twCx.scaleY; - ppy += 117; - path += "L" + ( posp.x - .5 * twCx.scaleX ) + " " + yy + "L" + twCx.deltaX + " " + yy + "C" + ( .2 * twCx.deltaX ) + " " + yy + " " + ( .7 * twCx.deltaX ) + " " + ppy + " 0 " + ppy; - tlPaper.path( path ).attr({"stroke":"#ffff00", "fill" : "#ffff00", "fill-opacity" : .15}); - - drawTweetArcs(tweets[p], posp, '#800080'); - } - } -} - -function filtrerAnnotation(annotation) { - if (annotations[annotation]) { - effectuerFiltrage(annotations[annotation].display_name, - new RegExp( "(" + annotations[annotation].keywords.map(function(a) { return a.source }).join("|") + ")", "gi" ) ); - } else { - effectuerFiltrage('', null) - } -} - -function filtrerTexte(valeur) { - effectuerFiltrage( valeur, valeur ? new RegExp("(" + valeur.replace(/(\W)/g, '\\$1') + ")" ,'gi') : null ); -} - -function effectuerFiltrage(filtreTexte, tabRegexp) { - $("#recherche_annot").slideUp(); - $("#inp_q").val(filtreTexte).attr("class","rechercheCourante"); - twCx.filtreTexte = filtreTexte; - twCx.filtre = tabRegexp; - twCx.followLast = !tabRegexp && (twCx.position == twCx.idIndex[twCx.idIndex.length - 1]); - updateDisplay(); -} - -function clicTl(evt) { - var o = $("#timeline").offset(); - if (twCx.tlMouseClicked && twCx.tlMouseMoved) { - var twid = tlIdFromPos(evt.pageX - o.left + twCx.refPosTl.x - twCx.refMouse.x, evt.pageY - o.top + twCx.refPosTl.y - twCx.refMouse.y, true); - if (twid) { - selectTweet(twid.id); - } - } else { - var twid = tlIdFromPos(evt.pageX - o.left, evt.pageY - o.top, twCx.tlMouseClicked); - if (twCx.tlMouseMoved && !twCx.tlMouseClicked) { - if (twid) { - rolloverTweet(twid.id, true, twid.annotation); - } else { - $("#hovertweet").hide(); - } - } - if (twCx.tlMouseClicked && !twCx.tlMouseMoved) { - if (twid) { - selectTweet(twid.id); - } - } - } -} - -function loadTweets(tweets) { - twCx.timeline = []; - twCx.idIndex = []; - twCx.tweets = []; - for (var i in tweets) { - addTweet(tweets[i]); - } - if (twCx.followLast) { - twCx.position = twCx.idIndex[twCx.tweets.length - 1]; - } - updateDisplay(); -} - -function focusOutRecherche() { - $("#recherche_annot").slideUp(); - var inpq = $("#inp_q"), - val = inpq.val(); - if (val == '' || val == twCx.filtreTexte) { - if (twCx.filtre) { - inpq.attr("class", "rechercheCourante").val(twCx.filtreTexte); - } else { - inpq.attr("class", "greyed").val("Rechercher"); - } - } -} - -function chaineTimeZoom() { - var chaine = "", - t = twCx.date_levels[twCx.timeLevel], - h = 3600*1000, - m = 60*1000, - s = 1000, - heures = Math.floor(t/h); - if (heures) { chaine += heures + ' h. ' }; - t -= (heures * h); - var minutes = Math.floor(t/m); - if (minutes) { chaine += minutes + ' min. ' }; - t -= (minutes * m); - if (t) { chaine += Math.floor(t/s) + ' sec.' } - $("#time_scale").html(chaine); - $("#time_zoomout").attr("class",(twCx.timeLevel == 0 ? "inactive" : "")); - $("#time_zoomin").attr("class",(twCx.timeLevel == twCx.date_levels.length - 1 ? "inactive" : "")); -} - -$(document).ready(function() { - tlPaper = Raphael("timeline", twCx.tlWidth, twCx.tlHeight); - - if (typeof STANDALONE_APP == "undefined" || !STANDALONE_APP) { - console.log("Loading from socket.io"); - socket = io.connect('http://' + document.location.hostname ); - socket.on("initial_data", function(data) { - loadTweets(data.tweets) - }); - socket.on("update", function(data) { - if (!twCx.tweets) { - return; - } - for (var i in data.new_tweets) { - addTweet(data.new_tweets[i]); - } - if (twCx.followLast) { - twCx.position = twCx.idIndex[twCx.tweets.length - 1]; - } - updateDisplay(); - }); - } else { - $.getScript("tweetdata.js"); - } - - var html = ''; - for (var j in annotations) { - if (j != "default") { - html += '' + annotations[j].display_name + ' ' - } - } - $("#rech_list_annot").html(html); - - chaineTimeZoom(); - - $("#tweetlist").mousewheel(function(e, d) { - wheelDelta += d; - if (Math.abs(wheelDelta) >= 1) { - movePos( parseInt(wheelDelta) ); - wheelDelta = 0; - } - return false; - }); - $("#timeline").mousewheel(function(e, d) { - wheelDelta += d; - if (Math.abs(wheelDelta) >= 1) { - if (wheelDelta > 0) { - tl = Math.min(twCx.date_levels.length - 1, twCx.timeLevel + 1); - } else { - tl = Math.max(0, twCx.timeLevel - 1); - } - if (tl != twCx.timeLevel) { - twCx.timeLevel = tl; - chaineTimeZoom(); - updateDisplay(); - } - wheelDelta = 0; - } - return false; - }); - $("#time_zoomin").click(function() { - if (twCx.timeLevel < twCx.date_levels.length - 1) { - twCx.timeLevel++; - chaineTimeZoom(); - updateDisplay(); - } - }); - $("#time_zoomout").click(function() { - if (twCx.timeLevel > 0) { - twCx.timeLevel--; - chaineTimeZoom(); - updateDisplay(); - } - }); - $("#timeline, #tweetlist").mouseout(function() { - twCx.tlMouseClicked = false; - twCx.tlMouseMoved = false; - $("#hovertweet").hide(); - }); - $("#timeline").mousemove(function(evt) { - twCx.tlMouseMoved = true; - clicTl(evt); - }); - $("#timeline").mousedown(function(evt) { - twCx.tlMouseClicked = true; - twCx.tlMouseMoved = false; - var o = $(this).offset(); - twCx.refMouse = { x : evt.pageX - o.left, y : evt.pageY - o.top }; - twCx.refPosTl = tlPosTweet(tweetById(twCx.position)) || twCx.refMouse; - }); - $("#timeline").mouseup(function(evt) { - clicTl(evt); - twCx.tlMouseClicked = false; - twCx.tlMouseMoved = false; - }); - $("#inp_q").focus(function() { - $("#recherche_annot").slideDown(); - $(this).val($(this).val().replace(/ \(.+\)$/, '')) - if ($(this).hasClass("greyed")) { - $(this).val(""); - } - $(this).attr("class",""); - }); - $("#inp_q").focusout(function() { - focusOutRecherche(); - }); - $("#inp_reset").click(function() { - $("#inp_q").val(''); - if (twCx.filtre) { - twCx.filtre = null; - updateDisplay(); - } - twCx.filtreTexte = ''; - focusOutRecherche(); - return false; - }) - $("#recherche").submit(function(evt) { - evt.preventDefault(); - if (!$("#inp_q").hasClass("greyed")) { - var valeur = $("#inp_q").val(); - filtrerTexte(valeur); - } - return false; - }); - - setInterval(function() { - var sc = $("#scrollcont"); - if (sc.scrollTop() != lastScrollPos && twCx.tweets) { - var p = Math.floor( twCx.currentIdIndex.length * ( 1 - sc.scrollTop() / scrollExtent ) ); - goToPos(p); - } - - }, 100) -}); - diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/client/js/underscore-min.js --- a/tweetcast/nodejs-bis/client/js/underscore-min.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -// Underscore.js 1.2.2 -// (c) 2011 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function r(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(b.isFunction(a.isEqual))return a.isEqual(c);if(b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return String(a)==String(c);case "[object Number]":return a=+a,c=+c,a!=a?c!=c:a==0?1/a==1/c:a==c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&r(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(m.call(a,h)&&(f++,!(g=m.call(c,h)&&r(a[h],c[h],d))))break;if(g){for(h in c)if(m.call(c, -h)&&!f--)break;g=!f}}d.pop();return g}var s=this,F=s._,o={},k=Array.prototype,p=Object.prototype,i=k.slice,G=k.unshift,l=p.toString,m=p.hasOwnProperty,v=k.forEach,w=k.map,x=k.reduce,y=k.reduceRight,z=k.filter,A=k.every,B=k.some,q=k.indexOf,C=k.lastIndexOf,p=Array.isArray,H=Object.keys,t=Function.prototype.bind,b=function(a){return new n(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else typeof define==="function"&&define.amd? -define("underscore",function(){return b}):s._=b;b.VERSION="1.2.2";var j=b.each=b.forEach=function(a,c,b){if(a!=null)if(v&&a.forEach===v)a.forEach(c,b);else if(a.length===+a.length)for(var e=0,f=a.length;e=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,c){var b=e(a,c);(d[b]||(d[b]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e< -f;){var g=e+f>>1;d(a[g])=0})})};b.difference=function(a,c){return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=H||function(a){if(a!== -Object(a))throw new TypeError("Invalid object");var b=[],d;for(d in a)m.call(a,d)&&(b[b.length]=d);return b};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)b[d]!==void 0&&(a[d]=b[d])});return a};b.defaults=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)? -a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return r(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(m.call(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=p||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=l.call(arguments)=="[object Arguments]"?function(a){return l.call(a)=="[object Arguments]"}: -function(a){return!(!a||!m.call(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null}; -b.isUndefined=function(a){return a===void 0};b.noConflict=function(){s._=F;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a),function(c){I(c,b[c]=a[c])})};var J=0;b.uniqueId=function(a){var b=J++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g, -interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape,function(a,b){return"',_.escape("+b.replace(/\\'/g,"'")+"),'"}).replace(d.interpolate,function(a,b){return"',"+b.replace(/\\'/g,"'")+",'"}).replace(d.evaluate||null,function(a,b){return"');"+b.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g, -"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e(a,b)}};var n=function(a){this._wrapped=a};b.prototype=n.prototype;var u=function(a,c){return c?b(a).chain():a},I=function(a,c){n.prototype[a]=function(){var a=i.call(arguments);G.call(a,this._wrapped);return u(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];n.prototype[a]=function(){b.apply(this._wrapped, -arguments);return u(this._wrapped,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];n.prototype[a]=function(){return u(b.apply(this._wrapped,arguments),this._chain)}});n.prototype.chain=function(){this._chain=true;return this};n.prototype.value=function(){return this._wrapped}}).call(this); diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/conf.js --- a/tweetcast/nodejs-bis/conf.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* CONFIGURATION FILE USED BY BOTH CLIENT AND SERVER */ - -RECORD_NEW_TWEETS = false; -STANDALONE_APP = true; - -var app_port = 8000, - tracking_keywords = [ "sarkozy" ], - annotations = { - "default" : { - "colors" : { - "tweet" : "#ffffff", - "timeline" : "#585858" - } - }, - "positive" : { - "keywords" : [ /\+\+/ ], - "colors" : { - "tweet" : "#c5e7cd", - "timeline" : "#1D973D" - } - }, - "negative" : { - "keywords" : [ /\-\-/ ], - "colors" : { - "tweet" : "#f6ced0", - "timeline" : "#CE0A15" - } - }, - "reference" : { - "keywords" : [ /\=\=/ ], - "colors" : { - "tweet" : "#ecedc1", - "timeline" : "#C5A62D" - } - }, - "question" : { - "keywords" : [ /\?\?/ ], - "colors" : { - "tweet" : "#bfdbec", - "timeline" : "#036AAE" - } - } - } \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs-bis/tweetcast.js --- a/tweetcast/nodejs-bis/tweetcast.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,233 +0,0 @@ -READ_OLD_TWEETS = true; -RECORD_NEW_TWEETS = true; -var conf_file = flagOption('-c', 'conf.js'); -console.log('Reading Configuration from ' + conf_file); -var fs = require('fs'); -eval(fs.readFileSync(conf_file,'utf8')); - -tweet_file = flagOption('-f', (typeof tweet_file == "undefined" ? 'tweets.txt' : tweet_file )); -tracking_keyword = flagOption('-t', (typeof tracking_keywords == "undefined" ? null : tracking_keywords.join(",") )); -user_pass = flagOption('-u', (typeof user_pass == "undefined" ? null : user_pass )); - -if (!user_pass) { - console.log("You must provide user credentials in " + conf_file + " or on the command-line, e.g. node tweetcast.js -u user:pass") - process.exit(); -} -if (!tracking_keyword) { - console.log("You must provide keyword(s) in " + conf_file + " or on the command-line, e.g. node tweetcast.js -t Bieber") - process.exit(); -} - -console.log("Tracking keyword "+tracking_keyword); - -var http = require('http'), - https = require('https'), - socketio = require('socket.io'), - app = http.createServer(httpHandler), - io = socketio.listen(app) - tweets = [], - tweet_ids = [], - keys_to_delete = [ - 'in_reply_to_screen_name', - 'in_reply_to_user_id', - 'retweeted', - 'place', - 'geo', - 'source', - 'contributors', - 'coordinates', - 'retweet_count', - 'favorited', - 'truncated', - 'possibly_sensitive' - ], - user_keys_to_delete = [ - 'default_profile_image', - 'show_all_inline_media', - 'contributors_enabled', - 'profile_sidebar_fill_color', - 'created_at', - 'lang', - 'time_zone', - 'profile_sidebar_border_color', - 'follow_request_sent', - 'profile_background_image_url', - 'profile_background_image_url_https', - 'followers_count', - 'description', - 'url', - 'geo_enabled', - 'profile_use_background_image', - 'default_profile', - 'following', - 'profile_text_color', - 'is_translator', - 'favourites_count', - 'listed_count', - 'friends_count', - 'profile_link_color', - 'protected', - 'location', - 'notifications', - 'profile_image_url_https', - 'statuses_count', - 'verified', - 'profile_background_color', - 'profile_background_tile', - 'utc_offset' - ], - content_types = { - css : "text/css; charset=utf-8", - html : "text/html; charset=utf-8", - js : "text/javascript; charset=utf-8", - png : "image/png" - }; - -function httpHandler(req, res) { - console.log("HTTP Request for URL "+req.url); - var url = req.url.split('?')[0]; - url = ( url == "/config.js" ? conf_file : __dirname + "/client" + url + ( url[url.length - 1] == "/" ? "index.html" : "" ) ); - var ext = url.split('.').slice(-1)[0].toLowerCase(); - fs.readFile( url, function(err, data) { - if (err) { - console.log("Error 404"); - res.writeHead(404); - return res.end('File not found'); - } - res.writeHead(200, { - "Content-Type" : ( content_types[ext] ? content_types[ext] : 'text/plain' ) - }); - res.end(data); - }); -} - -function flagOption(flag, defaultValue) { - var flagPos = process.argv.indexOf(flag); - return ( flagPos != -1 && flagPos < process.argv.length - 1) ? process.argv[flagPos + 1] : defaultValue; -} - -function addToList(tweet) { - if (tweet_ids.indexOf(tweet.id) != -1) { - console.log("Error: Tweet already in list"); - return false; - } - tweets.push(tweet); - tweet_ids.push(tweet.id); - return true; -} - -function textids(object) { - for (var key in object) { - // Workaround for Unicode bug in socket.io. - - if (typeof object[key] == "string") { - var tmp = ''; - for (var i = 0; i < object[key].length; i++) { - tmp += ( object[key].charCodeAt(i) < 128 ? object[key].charAt(i) : "&#" + object[key].charCodeAt(i) + ";" ); - } - object[key] = tmp; - } - if (key.substr(-2) == 'id') { - object[key] = object[key + '_str']; - delete object[key + '_str']; - } - } -} - -function readTweetsFromFile(file_name) { - console.log("Trying to read tweets from " + file_name); - try { - var oldtweets = fs.readFileSync(file_name, 'utf8').split('\n'); - var tweetscopied = 0; - for (var i in oldtweets) { - if (oldtweets[i].length > 0) { - addToList(JSON.parse(oldtweets[i])); - tweetscopied++; - } - } - console.log(tweetscopied + " tweets copied"); - } - catch (err) { - console.log("Error opening "+file_name); - } -} - -function requestTweets() { - console.log("Fetching tweets from https://stream.twitter.com/1/statuses/filter.json") - var writestream = null; - var req = https.request({ - host: "stream.twitter.com", - path: "/1/statuses/filter.json", - method: "POST", - headers: { - 'Authorization': 'Basic ' + new Buffer( user_pass ).toString('base64'), - 'Content-Type': 'application/x-www-form-urlencoded' - } - }, function(res) { - writestream = fs.createWriteStream( tweet_file, { flags: 'a+', encoding: 'utf-8' } ); - console.log('Response received, status : ' + res.statusCode); - res.setEncoding('utf8'); - res.on('data', function(chunk) { - var newdata = chunk.split('\r\n'), - tweetpos = tweets.length; - try { - for (var i in newdata) { - if (newdata[i].length > 0) { - var tweet = JSON.parse(newdata[i]); - textids(tweet); - for (var j in keys_to_delete) { - delete tweet[keys_to_delete[j]]; - } - textids(tweet.user); - for (var j in user_keys_to_delete) { - delete tweet.user[user_keys_to_delete[j]]; - } - if (tweet.retweeted_status) { - textids(tweet.retweeted_status); - for (var j in keys_to_delete) { - delete tweet.retweeted_status[keys_to_delete[j]]; - } - } - /* tweet.date_value = Date.parse(tweet.created_at); */ - if (addToList(tweet)) { - writestream.write(JSON.stringify(tweet)+'\n'); - } - } - } - io.sockets.emit('update', { - "new_tweets" : tweets.slice(tweetpos) - }); - console.log("New tweets received. We now have", tweets.length, "tweets in memory"); - } - catch(err) { - console.log(err.message); - } - }); - }); - - req.write('track=' + encodeURIComponent( ( tracking_keyword ) ) ); - req.end(); -} - -app.listen(app_port); -console.log("Listening on port: "+app_port); - -if (READ_OLD_TWEETS) { - readTweetsFromFile(tweet_file); -} else { - console.log("Reading old tweets disabled !"); -} - -if (RECORD_NEW_TWEETS) { - requestTweets(); -} else { - console.log("Recording new tweets disabled !"); -} - -io.set('log level', 0); -io.sockets.on('connection', function(socket) { - console.log("New connection from "+socket.handshake.address.address); - socket.emit('initial_data', { - "tweets" : tweets - }); -}); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/client/css/style.css --- a/tweetcast/nodejs/client/css/style.css Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* Browser-reset CSS */ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -body { - font-family: Helvetica, Arial, sans-serif; -} - -/* Liste de Tweets */ - -#container { - position: absolute; left: 50%; top: 50%; margin-left: -236px; margin-top: -300px; -} - -#modeselector { - position: absolute; width: 240px; top: 600px; border: 1px solid #999; font-size: 18px; text-align: center; padding: 5px; cursor: pointer; -} - -#tweetlist { - position: absolute; left: 0; top: 0; width: 250px; height: 600px; list-style: none; border: 1px solid #999; -} - -li.tweet, li.placeholder { - border: 1px solid; overflow: hidden; float: left; margin: -1px 0 0 -1px; border-color: #ccc; -} - -li.tweet { - position: relative; background: #fff; cursor: pointer; -} - -li.full { - width: 240px; height: 119px; border-right: 10px solid #ff0; -} - -li.half { - width: 250px; height: 49px; -} - -li.quarter { - width: 124px; height: 44px; -} - -li.icons { - width: 24px; height: 24px; -} - -li.placeholder { - height: 0; visibility: hidden; -} - -.tweet h4 { - font-weight: bold; -} - -.quarter p { - word-break: break-all; -} - -.full h4, .full p, .half p { - margin: 5px; -} - -.full h4 { - font-size: 15px; -} - -.full p, .half p { - font-size: 12px; -} - -.quarter p { - margin: 2px; font-size: 10px; -} - -img.profile_image { - float: left; -} - -.full .profile_image { - margin: 5px; width: 48px; height: 48px; -} - -.half .profile_image { - margin: 5px; width: 39px; height: 39px; -} - -.quarter .profile_image { - margin: 2px; width: 22px; height: 22px; -} - -.icons .profile_image { - margin: 2px; width: 20px; height: 20px; -} - -.full .created_at { - font-style: italic; color: #999; -} - -.half h4, .half p.created_at, .quarter h4, .quarter p.created_at, .icons h4, .icons p { - display: none -} - -.full .tweet_text { - clear: left; -} - -.annotations { - position: absolute; margin: 0; padding: 0; top: 0; left: 0; width: 100%; height: 100%; -} - -/*.icons .annotations { - position: absolute; width: 6px; height: 6px; right: 2px; bottom: 2px; border: 1px solid #ccc; z-index: 3; -}*/ - -div.annotation { - float: left; height: 100%; -} - -div.twmain { - position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; overflow: hidden; -} - -.full .twmain { -} - -.half .twmain { - opacity: .9 -} - -.half.fade .twmain { - opacity: .8 -} - -.quarter .twmain { - opacity: .7 -} - -.quarter.fade .twmain { - opacity: .6 -} - -.icons .twmain { - opacity: .5 -} - -.icons.fade .twmain { - opacity: .4 -} - -/* timeline */ - -#timeline, #timewindow { - position: absolute; top: 0; left: 251px; height: 600px; width: 220px; border: 1px solid #999; -} - -#timeline { - z-index: 42 -} - -#timewindow { - z-index: 47 -} \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/client/index.html --- a/tweetcast/nodejs/client/index.html Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - - - - - Polemic Tweet “TweetCast” - - - - - - - - - -
      -
      Mode Flux
      -
        -
      -
      -
      -
      - - \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/client/js/jquery-1.6.4.min.js --- a/tweetcast/nodejs/client/js/jquery-1.6.4.min.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ -(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
      a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
      ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
      t
      ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

      ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
      ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
      ","
      "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
      ").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
      ";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/client/js/jquery.mousewheel.min.js --- a/tweetcast/nodejs/client/js/jquery.mousewheel.min.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * - * Version: 3.0.2 - * - * Requires: 1.2.2+ - */ -(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/client/js/raphael-min.js --- a/tweetcast/nodejs/client/js/raphael-min.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -// ┌─────────────────────────────────────────────────────────────────────┐ \\ -// │ Raphaël 2.0 - JavaScript Vector Library │ \\ -// ├─────────────────────────────────────────────────────────────────────┤ \\ -// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ -// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ -// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ -// └─────────────────────────────────────────────────────────────────────┘ \\ -(function(a){var b="0.3.2",c="hasOwnProperty",d=/[\.\/]/,e="*",f=function(){},g=function(a,b){return a-b},h,i,j={n:{}},k=function(a,b){var c=j,d=i,e=Array.prototype.slice.call(arguments,2),f=k.listeners(a),l=0,m=!1,n,o=[],p={},q=[],r=[];h=a,i=0;for(var s=0,t=f.length;sf*b.top){e=b.percents[y],p=b.percents[y-1]||0,t=t/b.top*(e-p),o=b.percents[y+1],j=b.anim[e];break}f&&d.attr(b.anim[b.percents[y]])}if(!!j){if(!k){for(attr in j)if(j[g](attr))if(U[g](attr)||d.paper.customAttributes[g](attr)){u[attr]=d.attr(attr),u[attr]==null&&(u[attr]=T[attr]),v[attr]=j[attr];switch(U[attr]){case C:w[attr]=(v[attr]-u[attr])/t;break;case"colour":u[attr]=a.getRGB(u[attr]);var A=a.getRGB(v[attr]);w[attr]={r:(A.r-u[attr].r)/t,g:(A.g-u[attr].g)/t,b:(A.b-u[attr].b)/t};break;case"path":var B=bG(u[attr],v[attr]),D=B[1];u[attr]=B[0],w[attr]=[];for(y=0,z=u[attr].length;yd)return d;while(cf?c=e:d=e,e=(d-c)/2+c}return e}function n(a,b){var c=o(a,b);return((l*c+k)*c+j)*c}function m(a){return((i*a+h)*a+g)*a}var g=3*b,h=3*(d-b)-g,i=1-g-h,j=3*c,k=3*(e-c)-j,l=1-j-k;return n(a,1/(200*f))}function cd(){return this.x+q+this.y+q+this.width+" × "+this.height}function cc(){return this.x+q+this.y}function bR(a,b,c,d,e,f){a!=null?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function bw(a){var b=[];for(var c=0,d=a.length;d-2>c;c+=2){var e=[{x:+a[c],y:+a[c+1]},{x:+a[c],y:+a[c+1]},{x:+a[c+2],y:+a[c+3]},{x:+a[c+4],y:+a[c+5]}];d-4==c?(e[0]={x:+a[c-2],y:+a[c-1]},e[3]=e[2]):c&&(e[0]={x:+a[c-2],y:+a[c-1]}),b.push(["C",(-e[0].x+6*e[1].x+e[2].x)/6,(-e[0].y+6*e[1].y+e[2].y)/6,(e[1].x+6*e[2].x-e[3].x)/6,(e[1].y+6*e[2].y-e[3].y)/6,e[2].x,e[2].y])}return b}function bv(){return this.hex}function bt(a,b,c){function d(){var e=Array.prototype.slice.call(arguments,0),f=e.join("␀"),h=d.cache=d.cache||{},i=d.count=d.count||[];if(h[g](f)){bs(i,f);return c?c(h[f]):h[f]}i.length>=1e3&&delete h[i.shift()],i.push(f),h[f]=a[m](b,e);return c?c(h[f]):h[f]}return d}function bs(a,b){for(var c=0,d=a.length;c',bk=bj.firstChild,bk.style.behavior="url(#default#VML)";if(!bk||typeof bk.adj!="object")return a.type=p;bj=null}a.svg=!(a.vml=a.type=="VML"),a._Paper=j,a.fn=k=j.prototype=a.prototype,a._id=0,a._oid=0,a.is=function(a,b){b=v.call(b);if(b=="finite")return!M[g](+a);if(b=="array")return a instanceof Array;return b=="null"&&a===null||b==typeof a&&a!==null||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||H.call(a).slice(8,-1).toLowerCase()==b},a.angle=function(b,c,d,e,f,g){if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return(180+w.atan2(-i,-h)*180/B+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)},a.rad=function(a){return a%360*B/180},a.deg=function(a){return a*180/B%360},a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,E)){var e=b.length;while(e--)if(z(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};var bl=a.createUUID=function(a,b){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,b).toUpperCase()}}(/[xy]/g,function(a){var b=w.random()*16|0,c=a=="x"?b:b&3|8;return c.toString(16)});a.setWindow=function(b){eve("setWindow",a,h.win,b),h.win=b,h.doc=h.win.document,initWin&&initWin(h.win)};var bm=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),d=e.body}catch(f){d=createPopup().document.body}var g=d.createTextRange();bm=bt(function(a){try{d.style.color=r(a).replace(c,p);var b=g.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b.toString(16)).slice(-6)}catch(e){return"none"}})}else{var i=h.doc.createElement("i");i.title="Raphaël Colour Picker",i.style.display="none",h.doc.body.appendChild(i),bm=bt(function(a){i.style.color=a;return h.doc.defaultView.getComputedStyle(i,p).getPropertyValue("color")})}return bm(b)},bn=function(){return"hsb("+[this.h,this.s,this.b]+")"},bo=function(){return"hsl("+[this.h,this.s,this.l]+")"},bp=function(){return this.hex},bq=function(b,c,d){c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b&&(d=b.b,c=b.g,b=b.r);if(c==null&&a.is(b,D)){var e=a.getRGB(b);b=e.r,c=e.g,d=e.b}if(b>1||c>1||d>1)b/=255,c/=255,d/=255;return[b,c,d]},br=function(b,c,d,e){b*=255,c*=255,d*=255;var f={r:b,g:c,b:d,hex:a.rgb(b,c,d),toString:bp};a.is(e,"finite")&&(f.opacity=e);return f};a.color=function(b){var c;a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b?(c=a.hsb2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b?(c=a.hsl2rgb(b),b.r=c.r,b.g=c.g,b.b=c.b,b.hex=c.hex):(a.is(b,"string")&&(b=a.getRGB(b)),a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b?(c=a.rgb2hsl(b),b.h=c.h,b.s=c.s,b.l=c.l,c=a.rgb2hsb(b),b.v=c.b):(b={hex:"none"},crl.r=b.g=b.b=b.h=b.s=b.v=b.l=-1)),b.toString=bp;return b},a.hsb2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;a=a%360/60,i=c*b,h=i*(1-z(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.hsl2rgb=function(a,b,c,d){this.is(a,"object")&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h);if(a>1||b>1||c>1)a/=360,b/=100,c/=100;a*=360;var e,f,g,h,i;a=a%360/60,i=2*b*(c<.5?c:1-c),h=i*(1-z(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a];return br(e,f,g,d)},a.rgb2hsb=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;f=x(a,b,c),g=f-y(a,b,c),d=g==0?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=g==0?0:g/f;return{h:d,s:e,b:f,toString:bn}},a.rgb2hsl=function(a,b,c){c=bq(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;g=x(a,b,c),h=y(a,b,c),i=g-h,d=i==0?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=i==0?0:f<.5?i/(2*f):i/(2-2*f);return{h:d,s:e,l:f,toString:bo}},a._path2string=function(){return this.join(",").replace(X,"$1")};var bu=a._preload=function(a,b){var c=h.doc.createElement("img");c.style.cssText="position:absolute;left:-9999em;top-9999em",c.onload=function(){b.call(this),this.onload=null,h.doc.body.removeChild(this)},c.onerror=function(){h.doc.body.removeChild(this)},h.doc.body.appendChild(c),c.src=a};a.getRGB=bt(function(b){if(!b||!!((b=r(b)).indexOf("-")+1))return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:bv};!W[g](b.toLowerCase().substring(0,2))&&b.charAt()!="#"&&(b=bm(b));var c,d,e,f,h,i,j,k=b.match(L);if(k){k[2]&&(f=R(k[2].substring(5),16),e=R(k[2].substring(3,5),16),d=R(k[2].substring(1,3),16)),k[3]&&(f=R((i=k[3].charAt(3))+i,16),e=R((i=k[3].charAt(2))+i,16),d=R((i=k[3].charAt(1))+i,16)),k[4]&&(j=k[4][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),k[1].toLowerCase().slice(0,4)=="rgba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100));if(k[5]){j=k[5][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsba"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,f,h)}if(k[6]){j=k[6][s](V),d=Q(j[0]),j[0].slice(-1)=="%"&&(d*=2.55),e=Q(j[1]),j[1].slice(-1)=="%"&&(e*=2.55),f=Q(j[2]),j[2].slice(-1)=="%"&&(f*=2.55),(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360),k[1].toLowerCase().slice(0,4)=="hsla"&&(h=Q(j[3])),j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,f,h)}k={r:d,g:e,b:f,toString:bv},k.hex="#"+(16777216|f|e<<8|d<<16).toString(16).slice(1),a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:bv}},a),a.hsb=bt(function(b,c,d){return a.hsb2rgb(b,c,d).hex}),a.hsl=bt(function(b,c,d){return a.hsl2rgb(b,c,d).hex}),a.rgb=bt(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b}));return c.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=bt(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=by(b)),d.length||r(b).replace(Y,function(a,b,e){var f=[],g=b.toLowerCase();e.replace($,function(a,b){b&&f.push(+b)}),g=="m"&&f.length>2&&(d.push([b][n](f.splice(0,2))),g="l",b=b=="m"?"l":"L");if(g=="r")d.push([b][n](f));else while(f.length>=c[g]){d.push([b][n](f.splice(0,c[g])));if(!c[g])break}}),d.toString=a._path2string;return d}),a.parseTransformString=bt(function(b){if(!b)return null;var c={r:3,s:4,t:2,m:6},d=[];a.is(b,E)&&a.is(b[0],E)&&(d=by(b)),d.length||r(b).replace(Z,function(a,b,c){var e=[],f=v.call(b);c.replace($,function(a,b){b&&e.push(+b)}),d.push([b][n](e))}),d.toString=a._path2string;return d}),a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=A(j,3),l=A(j,2),m=i*i,n=m*i,o=k*a+l*3*i*c+j*3*i*i*e+n*g,p=k*b+l*3*i*d+j*3*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,x=j*e+i*g,y=j*f+i*h,z=90-w.atan2(q-s,r-t)*180/B;(q>s||r1&&(v=w.sqrt(v),c=v*c,d=v*d);var x=c*c,y=d*d,A=(f==g?-1:1)*w.sqrt(z((x*y-x*u*u-y*t*t)/(x*u*u+y*t*t))),C=A*c*u/d+(a+h)/2,D=A*-d*t/c+(b+i)/2,E=w.asin(((b-D)/d).toFixed(9)),F=w.asin(((i-D)/d).toFixed(9));E=aF&&(E=E-B*2),!g&&F>E&&(F=F-B*2)}else E=j[0],F=j[1],C=j[2],D=j[3];var G=F-E;if(z(G)>k){var H=F,I=h,J=i;F=E+k*(g&&F>E?1:-1),h=C+c*w.cos(F),i=D+d*w.sin(F),m=bD(h,i,c,d,e,0,g,I,J,[F,H,C,D])}G=F-E;var K=w.cos(E),L=w.sin(E),M=w.cos(F),N=w.sin(F),O=w.tan(G/4),P=4/3*c*O,Q=4/3*d*O,R=[a,b],S=[a+P*L,b-Q*K],T=[h+P*N,i-Q*M],U=[h,i];S[0]=2*R[0]-S[0],S[1]=2*R[1]-S[1];if(j)return[S,T,U][n](m);m=[S,T,U][n](m).join()[s](",");var V=[];for(var W=0,X=m.length;W"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bE(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bE(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y)),i=f-2*d+b-(h-2*f+d),j=2*(d-b)-2*(f-d),k=b-d,l=(-j+w.sqrt(j*j-4*i*k))/2/i,n=(-j-w.sqrt(j*j-4*i*k))/2/i,z(l)>"1e12"&&(l=.5),z(n)>"1e12"&&(n=.5),l>0&&l<1&&(q=bE(a,b,c,d,e,f,g,h,l),p.push(q.x),o.push(q.y)),n>0&&n<1&&(q=bE(a,b,c,d,e,f,g,h,n),p.push(q.x),o.push(q.y));return{min:{x:y[m](0,p),y:y[m](0,o)},max:{x:x[m](0,p),y:x[m](0,o)}}}),bG=a._path2curve=bt(function(a,b){var c=bA(a),d=b&&bA(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][n](bD[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][n](bC(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][n](bC(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](bB(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](bB(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](bB(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](bB(b.x,b.y,b.X,b.Y))}return a},h=function(a,b){if(a[b].length>7){a[b].shift();var e=a[b];while(e.length)a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1),k=x(c.length,d&&d.length||0)}},i=function(a,b,e,f,g){a&&b&&a[g][0]=="M"&&b[g][0]!="M"&&(b.splice(g,0,["M",f.x,f.y]),e.bx=0,e.by=0,e.x=a[g][1],e.y=a[g][2],k=x(c.length,d&&d.length||0))};for(var j=0,k=x(c.length,d&&d.length||0);j=j)return p;o=p}if(j==null)return k},cg=function(b,c){return function(d,e,f){d=bG(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),k+=["C"+m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k,k=["M"+m.x,m.y+"C"+m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!b&&!c){m=cf(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j,g=+i[5],h=+i[6]}k+=i.shift()+i}l.end=k,m=b?n:c?l:a.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},ch=cg(1),ci=cg(),cj=cg(0,1);a.getTotalLength=ch,a.getPointAtLength=ci,a.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return cj(a,b).end;var d=cj(a,c,1);return b?cj(d,b).end:d},b_.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return ch(this.attrs.path)}},b_.getPointAtLength=function(a){if(this.type=="path")return ci(this.attrs.path,a)},b_.getSubpath=function(b,c){if(this.type=="path")return a.getSubpath(this.attrs.path,b,c)};var ck=a.easing_formulas={linear:function(a){return a},"<":function(a){return A(a,1.7)},">":function(a){return A(a,.48)},"<>":function(a){var b=.48-a/1.04,c=w.sqrt(.1734+b*b),d=c-b,e=A(z(d),1/3)*(d<0?-1:1),f=-c-b,g=A(z(f),1/3)*(f<0?-1:1),h=e+g+.5;return(1-h)*3*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==!!a)return a;return A(2,-10*a)*w.sin((a-.075)*2*B/.3)+1},bounce:function(a){var b=7.5625,c=2.75,d;a<1/c?d=b*a*a:a<2/c?(a-=1.5/c,d=b*a*a+.75):a<2.5/c?(a-=2.25/c,d=b*a*a+.9375):(a-=2.625/c,d=b*a*a+.984375);return d}};ck.easeIn=ck["ease-in"]=ck["<"],ck.easeOut=ck["ease-out"]=ck[">"],ck.easeInOut=ck["ease-in-out"]=ck["<>"],ck["back-in"]=ck.backIn,ck["back-out"]=ck.backOut;var cl=[],cm=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,16)},cn=function(){var b=+(new Date),c=0;for(;c1&&!d.next){for(s in k)k[g](s)&&(r[s]=d.totalOrigin[s]);d.el.attr(r),cr(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&cr(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}a.svg&&m&&m.paper&&m.paper.safari(),cl.length&&cm(cn)},co=function(a){return a>255?255:a<0?0:a};b_.animateWith=function(b,c,d,e,f,g){var h=d?a.animation(d,e,f,g):c;status=b.status(c);return this.animate(h).status(h,status*c.ms/h.ms)},b_.onAnimation=function(a){a?eve.on("anim.frame."+this.id,a):eve.unbind("anim.frame."+this.id);return this},cq.prototype.delay=function(a){var b=new cq(this.anim,this.ms);b.times=this.times,b.del=+a||0;return b},cq.prototype.repeat=function(a){var b=new cq(this.anim,this.ms);b.del=this.del,b.times=w.floor(x(a,0))||1;return b},a.animation=function(b,c,d,e){if(b instanceof cq)return b;if(a.is(d,"function")||!d)e=e||d||null,d=null;b=Object(b),c=+c||0;var f={},h,i;for(i in b)b[g](i)&&Q(i)!=i&&Q(i)+"%"!=i&&(h=!0,f[i]=b[i]);if(!h)return new cq(b,c);d&&(f.easing=d),e&&(f.callback=e);return new cq({100:f},c)},b_.animate=function(b,c,d,e){var f=this;if(f.removed){e&&e.call(f);return f}var g=b instanceof cq?b:a.animation(b,c,d,e);cr(g,f,g.percents[0],null,f.attr());return f},b_.setTime=function(a,b){a&&b!=null&&this.status(a,y(b,a.ms)/a.ms);return this},b_.status=function(a,b){var c=[],d=0,e,f;if(b!=null){cr(a,this,-1,y(b,1));return this}e=cl.length;for(;d.5)*2-1;i(m-.5,2)+i(n-.5,2)>.25&&(n=f.sqrt(.25-i(m-.5,2))*e+.5)&&n!=.5&&(n=n.toFixed(5)-1e-5*e)}return l}),e=e.split(/\s*\-\s*/);if(j=="linear"){var t=e.shift();t=-d(t);if(isNaN(t))return null;var u=[0,0,f.cos(a.rad(t)),f.sin(a.rad(t))],v=1/(g(h(u[2]),h(u[3]))||1);u[2]*=v,u[3]*=v,u[2]<0&&(u[0]=-u[2],u[2]=0),u[3]<0&&(u[1]=-u[3],u[3]=0)}var w=a._parseDots(e);if(!w)return null;b.gradient&&(p.defs.removeChild(b.gradient),delete b.gradient),k=k.replace(/[\(\)\s,\xb0#]/g,"-"),s=q(j+"Gradient",{id:k}),b.gradient=s,q(s,j=="radial"?{fx:m,fy:n}:{x1:u[0],y1:u[1],x2:u[2],y2:u[3],gradientTransform:b.matrix.invert()}),p.defs.appendChild(s);for(var x=0,y=w.length;x1?E.opacity/100:E.opacity});case"stroke":E=a.getRGB(p),i.setAttribute(o,E.hex),o=="stroke"&&E[b]("opacity")&&q(i,{"stroke-opacity":E.opacity>1?E.opacity/100:E.opacity}),o=="stroke"&&d._.arrows&&("startString"in d._.arrows&&w(d,d._.arrows.startString),"endString"in d._.arrows&&w(d,d._.arrows.endString,1));break;case"gradient":(d.type=="circle"||d.type=="ellipse"||c(p).charAt()!="r")&&u(d,p);break;case"opacity":k.gradient&&!k[b]("stroke-opacity")&&q(i,{"stroke-opacity":p>1?p/100:p});case"fill-opacity":if(k.gradient){F=a._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,l)),F&&(G=F.getElementsByTagName("stop"),q(G[G.length-1],{"stop-opacity":p}));break};default:o=="font-size"&&(p=e(p,10)+"px");var H=o.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});i.style[H]=p,d._.dirty=1,i.setAttribute(o,p)}}B(d,f),i.style.visibility=m},A=1.2,B=function(d,f){if(d.type=="text"&&!!(f[b]("text")||f[b]("font")||f[b]("font-size")||f[b]("x")||f[b]("y"))){var g=d.attrs,h=d.node,i=h.firstChild?e(a._g.doc.defaultView.getComputedStyle(h.firstChild,l).getPropertyValue("font-size"),10):10;if(f[b]("text")){g.text=f.text;while(h.firstChild)h.removeChild(h.firstChild);var j=c(f.text).split("\n"),k=[],m;for(var n=0,o=j.length;n"));var Y=V.getBoundingClientRect();t.W=m.w=(Y.right-Y.left)/W,t.H=m.h=(Y.bottom-Y.top)/W,t.X=m.x,t.Y=m.y+t.H/2,("x"in i||"y"in i)&&(t.path.v=a.format("m{0},{1}l{2},{1}",f(m.x*u),f(m.y*u),f(m.x*u)+1));var Z=["x","y","text","font","font-family","font-weight","font-style","font-size"];for(var $=0,_=Z.length;$<_;$++)if(Z[$]in i){t._.dirty=1;break}switch(m["text-anchor"]){case"start":t.textpath.style["v-text-align"]="left",t.bbx=t.W/2;break;case"end":t.textpath.style["v-text-align"]="right",t.bbx=-t.W/2;break;default:t.textpath.style["v-text-align"]="center",t.bbx=0}t.textpath.style["v-text-kern"]=!0}},addGradientFill=function(b,f,g){b.attrs=b.attrs||{};var h=b.attrs,i=Math.pow,j,k,l="linear",m=".5 .5";b.attrs.gradient=f,f=c(f).replace(a._radial_gradient,function(a,b,c){l="radial",b&&c&&(b=d(b),c=d(c),i(b-.5,2)+i(c-.5,2)>.25&&(c=e.sqrt(.25-i(b-.5,2))*((c>.5)*2-1)+.5),m=b+n+c);return o}),f=f.split(/\s*\-\s*/);if(l=="linear"){var p=f.shift();p=-d(p);if(isNaN(p))return null}var q=a._parseDots(f);if(!q)return null;b=b.shape||b.node;if(q.length){b.removeChild(g),g.on=!0,g.method="none",g.color=q[0].color,g.color2=q[q.length-1].color;var r=[];for(var s=0,t=q.length;s')}}catch(c){B=function(a){return b.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}};C(a._g.win),a._engine.create=function(){var b=a._getContainer.apply(0,arguments),c=b.container,d=b.height,e,f=b.width,g=b.x,h=b.y;if(!c)throw new Error("VML container not found.");var i=new a._Paper,j=i.canvas=a._g.doc.createElement("div"),k=j.style;g=g||0,h=h||0,f=f||512,d=d||342,i.width=f,i.height=d,f==+f&&(f+="px"),d==+d&&(d+="px"),i.coordsize=u*1e3+n+u*1e3,i.coordorigin="0 0",i.span=a._g.doc.createElement("span"),i.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",j.appendChild(i.span),k.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d),c==1?(a._g.doc.body.appendChild(j),k.left=g+"px",k.top=h+"px",k.position="absolute"):c.firstChild?c.insertBefore(j,c.firstChild):c.appendChild(j),i.renderfix=function(){};return i},a.prototype.clear=function(){a.eve("clear",this),this.canvas.innerHTML=o,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){a.eve("remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var b in this)this[b]=removed(b);return!0};var D=a.st;for(var E in A)A[b](E)&&!D[b](E)&&(D[E]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(E))}(window.Raphael) \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/client/js/script.js --- a/tweetcast/nodejs/client/js/script.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,446 +0,0 @@ -var socket, - tlPaper, - twPaper, - tweetData = { - "tweetcount" : 0, - "position" : 0, - "feedMode" : true, - "followLast" : true, - "zoomLevel" : 3, - "timeLevel" : 2, - "tweets" : [], - "posIndex" : [], - "tlChanged" : true, - "tlLevelChanged" : true, - "blockUpdate" : false, - "waitUpdate" : true, - "htmlBuffer" : '', - "wheelDelta" : 0 - }, - 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' ] - } - ]; - -function placeHolder(className) { - return '
    • '; -} - -function getLinkedTweets() { - socket.emit('linkedTweets',{"tweetpos":tweetData.position}); -} - -function changeMode() { - if (tweetData.feedMode) { - getLinkedTweets(); - } else { - tweetData.feedMode = true; - updateDisplay(); - } -} - -function clicTweet(tweetPos) { - if (tweetPos != tweetData.position) { - tweetData.position = tweetPos; - if (tweetData.feedMode) { - tweetData.followLast = (tweetData.position == tweetData.tweetcount); - } else { - getLinkedTweets(); - } - return false; - } else { - changeMode(); - } -} - -function tweetToHtml(tweet, className) { - if (!tweet) { - return placeHolder(className); - } - var html = '
    • '; - } - html += ''; - } - html += '
      '; - a_user = ''; - if (tweet.user.profile_image_url) { - html += a_user + ''; - } - html += '

      ' + a_user + '@' + tweet.user.screen_name + '

      ' + new Date(tweet.created_at).toLocaleTimeString() + '

      '; - lastend = 0; - var tab = tweet.text.split(/\&\#|\;/); - var txta = ''; - for (i = 0; i < tab.length; i++) { - txta += (i % 2 && parseInt(tab[i]) != NaN) ? String.fromCharCode(tab[i]) : tab[i]; - } - var 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].expanded_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 += txta.substring(lastend, entities[i].start) + entities[i].html; - lastend = entities[i].end; - } - txt += txta.substring(lastend); - html += txt + '

    • '; - return html; -} - - -function getUpdate() { - tweetData.posToDisplay = []; - if (tweetData.feedMode) { - if (tweetData.followLast) { - tweetData.position = tweetData.tweetcount; - for (var i = tweetData.tweetcount; i >= tweetData.tweetcount - 52; i--) { - tweetData.posToDisplay.push( i > 0 ? i : -1 ); - } - tweetData.end = tweetData.tweetcount; - tweetData.start = Math.max(1, tweetData.end - 52); - } else { - for (var i = tweetData.position + 26; i >= tweetData.position - 26; i--) { - tweetData.posToDisplay.push( i > 0 && i <= tweetData.tweetcount ? i : -1 ); - } - tweetData.end = Math.min(tweetData.tweetcount, tweetData.position + 26 ); - tweetData.start = Math.max(1, tweetData.position - 26); - } - if ($("#modeselector").text() != "Mode flux") { - $("#modeselector").html("Mode Flux").css({"color":"#000000","background":"#ffffff"}); - $("#tweetlist").css({"background":"#ffffff"}); - } - } else { - tweetData.linkedTweets.referenced_by.sort(function(a,b) { return b.pos - a.pos }); - tweetData.linkedTweets.referencing.sort(function(a,b) { return b.pos - a.pos }); - for (var i in tweetData.linkedTweets.referenced_by) { - tweetData.posToDisplay.push(tweetData.linkedTweets.referenced_by[i].pos); - } - tweetData.posToDisplay.push(tweetData.position); - for (var i in tweetData.linkedTweets.referencing) { - tweetData.posToDisplay.push(tweetData.linkedTweets.referencing[i].pos); - } - if ($("#modeselector").text() != "Conversation") { - $("#modeselector").html("Conversation").css({"color":"#ffffff","background":"#000080"}); - $("#tweetlist").css({"background":"#000080"}); - } - } - var tweetsToGet = []; - for (var i in tweetData.posToDisplay) { - if (tweetData.posToDisplay[i] != -1 && !tweetByPos(tweetData.posToDisplay[i])) { - tweetsToGet.push(tweetData.posToDisplay[i]); - } - } - if (tweetsToGet.length) { -// console.log('We need to get '+tweetsToGet.join(',')); - socket.emit('updateTweets', { - "tweets" : tweetsToGet - }); - } else { - drawTweetList(); - } -/* html = ''; - for (var i in tweetData.linkedTweets.referenced_by) { - console.log(tweetData.linkedTweets.referenced_by[i]); - html += tweetToHtml(tweetData.linkedTweets.referenced_by[i].tweet,'half'); - } - html += tweetToHtml(tweetByPos(tweetData.position),'full'); - for (var i in tweetData.linkedTweets.referencing) { - console.log(tweetData.linkedTweets.referencing[i]); - html += tweetToHtml(tweetData.linkedTweets.referencing[i].tweet,'half'); - } - if (tweetData.htmlBuffer != html) { - $("#tweetlist").html(html); - tweetData.htmlBuffer = html; - } */ - if (tweetData.tlChanged || tweetData.tlLevelChanged) { - socket.emit('updateTimeline', { - "level" : tweetData.timeLevel, - "full" : tweetData.tlLevelChanged - }); - } else { - drawTimeLine(); - } -} - -function addTweet(tweet) { - if (tweetData.posIndex.indexOf(tweet.pos) == -1) { - tweetData.tweets.push(tweet); - tweetData.posIndex.push(tweet.pos); - } -} - -function tweetByPos(pos) { - var index = tweetData.posIndex.indexOf(pos); - return (index == -1 ? false : tweetData.tweets[index]); -} - -function delayedUpdate() { - tweetData.blockUpdate = false; - if (tweetData.waitUpdate) { - updateDisplay(); - } -} - -function updateDisplay() { - if (tweetData.blockUpdate) { - tweetData.waitUpdate = true; - } else { - tweetData.waitUpdate = false; - getUpdate(); - tweetData.blockUpdate = true; - setTimeout(delayedUpdate, 100); - } -} - -function setTimeZoom(level) { - if (level >= 0 && level <= 4) { - tweetData.timeLevel = level; - tweetData.tlChanged = true; - updateDisplay(); - } -} - -function drawTweetList() { - html = ''; - var i = 0; - while (i < tweetData.posIndex.length) { - if (tweetData.posToDisplay.indexOf(tweetData.posIndex[i]) == -1) { - tweetData.posIndex.splice(i,1); - tweetData.tweets.splice(i,1); - } else { - i++; - } - } - if (tweetData.feedMode) { - for (var i in tweetData.posToDisplay) { - var ds = displaySplitting[tweetData.followLast ? 1 : 0]; - for (var j in ds.positions) { - if (ds.positions[j] > i) { - var className = ds.classNames[j]; - break; - } - } - html += ( tweetData.posToDisplay[i] != -1 ? tweetToHtml(tweetByPos(tweetData.posToDisplay[i]), className) : placeHolder(className) ); - } - } else { - for (var i in tweetData.posToDisplay) { - html += tweetToHtml(tweetByPos(tweetData.posToDisplay[i]), (tweetData.posToDisplay[i] == tweetData.position ? 'full' : 'half' )); - } - } - if (tweetData.htmlBuffer != html) { - $("#tweetlist").html(html); - tweetData.htmlBuffer = html; - } - if (tweetData.followLast) { - $("#tweet_" + tweetData.position).fadeIn(500); - } - drawTimeWindow(); -} - -function drawTimeWindow() { - twPaper.clear(); - if (!tweetData.timeline || !tweetData.timeline.length) return; - - var dtfintl = tweetData.timeline[ tweetData.timeline.length - 1 ].end, - dtdebtl = tweetData.timeline[0].start, - scY = 600 / ( dtfintl - dtdebtl ); - if (tweetData.feedMode) { - var dtfintw = new Date( tweetByPos( tweetData.end ).created_at ), - dtdebtw = new Date( tweetByPos( tweetData.start ).created_at ), - rTop = scY * ( dtfintl - dtfintw ), - rHeight = scY * ( dtfintw - dtdebtw ); - if (rHeight > 0) { - twPaper.rect( 0, rTop, 300, rHeight).attr({"stroke":"none","fill":"#8080ff","fill-opacity":.2}); - } - } else { - for (var i in tweetData.posToDisplay) { - if (tweetData.posToDisplay[i] != -1) { - var tw = tweetByPos(tweetData.posToDisplay[i]); - if (tw) { - var dtcour = new Date( tw.created_at ), - posY = scY * ( dtfintl - dtcour ); - twPaper.path("M0 "+posY+"L300 "+posY).attr({"stroke":"#88f"}); - } - } - } - } - var dtcour = new Date( tweetByPos( tweetData.position ).created_at ), - posY = scY * ( dtfintl - dtcour ); - twPaper.path("M0 "+posY+"L300 "+posY).attr({"stroke":"#ff0"}); -} - -function drawTimeLine() { - tlPaper.clear(); - if (!tweetData.timeline || !tweetData.timeline.length) return; - tweetData.tlTweetRects = []; - var scaleY = 600 / tweetData.timeline.length, - max = 0; - for (var i = 0; i < tweetData.timeline.length; i++) { - max = Math.max(max, tweetData.timeline[i].tweets); - } - var scaleX = 160 / max; - - // dessin de l'axe vertical - - tlPaper.path("M160 0L160 600").attr({"stroke":"#ccc"}); - - // dessin de la date de début - - tlPaper.text(165, 592, new Date(tweetData.timeline[0].start).toLocaleTimeString()).attr({ "text-anchor" : "start", "font-size": "12px" }); - - // dessin de la date de fin - - tlPaper.text(165, 7, new Date(tweetData.timeline[tweetData.timeline.length - 1].end).toLocaleTimeString()).attr({ "text-anchor" : "start", "font-size": "12px" }); - for (var i = 0; i < tweetData.timeline.length; i++) { - var posY = 600 - (i * scaleY); - - // Si on est à une demi-heure, on trace un axe secondaire + heure - - if (i && !(new Date(tweetData.timeline[i].start).valueOf() % 1800000)) { - tlPaper.path("M0 "+posY+"L165 "+posY).attr({"stroke":"#ccc"}); - tlPaper.text(165, posY, new Date(tweetData.timeline[i].start).toLocaleTimeString()).attr({ "text-anchor" : "start", "font-size": "12px" }); - } - var anz = { - "default" :tweetData.timeline[i].tweets - }; - for (var j in tweetData.timeline[i].annotations) { - anz.default -= tweetData.timeline[i].annotations[j]; - anz[j] = tweetData.timeline[i].annotations[j]; - } - var posX = 0; - for (var j in anz) { - var largX = scaleX * anz[j]; - if (largX > 0) { - tlPaper.rect(posX, 600 - scaleY * (i+1), largX, scaleY).attr({"stroke": "none", "fill": annotations[j].colors.timeline}); - posX += largX; - } - } - } - - drawTimeWindow(); -} - -$(document).ready(function() { - tlPaper = Raphael("timeline", 220, 600); - twPaper = Raphael("timewindow", 220, 600); - socket = io.connect('http://' + document.location.hostname ); - socket.on('tweetSummary', function (data) { - if (tweetData.tweetcount != data.tweetcount) { - tweetData.tweetcount = data.tweetcount; - tweetData.tlLevelChanged = true; - updateDisplay(); - } - }); - socket.on('tweetPosByDate', function (data) { - tweetData.position = data.tweetpos; - tweetData.feedMode = true; - tweetData.followLast = (tweetData.position == tweetData.tweetcount); - updateDisplay(); - }); - socket.on('tweets', function (data) { - for (var i in data) { - addTweet(data[i]); - } - drawTweetList(); - }); - socket.on('timeline', function (data) { - tweetData.tlChanged = false; - if (data.full) { - tweetData.timeline = data.data; - } else { - if (tweetData.timeline[tweetData.timeline.length - 1].start == data.data[0].start) { - tweetData.timeline[tweetData.timeline.length - 1] = data.data[0]; - } else { - tweetData.timeline.push(data.data[0]); - } - } - while (tweetData.length > 50) { - tweetData.splice(0,1); - } - drawTimeLine(); - }); - socket.on('linkedTweets', function(data) { - tweetData.followLast = false; - tweetData.feedMode = false; - tweetData.position = data.tweetpos; - tweetData.linkedTweets = data; - updateDisplay(); - }); - $("#tweetlist").mousewheel(function(e, d) { - tweetData.wheelDelta += d; - if (Math.abs(tweetData.wheelDelta) >= 1) { - if (tweetData.feedMode) { - tweetData.position = Math.min( tweetData.tweetcount, Math.max(1, parseInt(tweetData.wheelDelta) + tweetData.position ) ); - tweetData.followLast = (tweetData.position == tweetData.tweetcount); - updateDisplay(); - } else { - if (tweetData.wheelDelta > 0) { - if (tweetData.linkedTweets.referenced_by.length) { - tweetData.position = tweetData.linkedTweets.referenced_by[tweetData.linkedTweets.referenced_by.length - 1].pos; - getLinkedTweets(); - } - } else { - if (tweetData.linkedTweets.referencing.length) { - tweetData.position = tweetData.linkedTweets.referencing[0].pos; - getLinkedTweets(); - } - } - } - tweetData.wheelDelta = 0; - } - return false; - }); - $("#timewindow").mousewheel(function(e, d) { - tweetData.wheelDelta += d; - if (Math.abs(tweetData.wheelDelta) >= 1) { - if (tweetData.wheelDelta > 0) { - setTimeZoom(tweetData.timeLevel + 1); - } else { - setTimeZoom(tweetData.timeLevel - 1); - } - tweetData.wheelDelta = 0; - } - return false; - }); - $("#timewindow").click(function(evt) { - var offsetY = evt.pageY - $(this).offset().top, - dtfintl = tweetData.timeline[ tweetData.timeline.length - 1 ].end, - dtdebtl = tweetData.timeline[0].start, - clicTime = dtdebtl + (1 - ( offsetY / 600 ) ) * ( dtfintl - dtdebtl ); - socket.emit('tweetPosByDate',{ date: clicTime }); - }); - $("#modeselector").click(changeMode); -}); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/conf-pol.js --- a/tweetcast/nodejs/conf-pol.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* CONFIGURATION FILE USED BY BOTH CLIENT AND SERVER */ - -var app_port = 8000, - sqlfile = "politique.sqlite", - tracking_keyword = "Hervé Morin,Eva Joly,Hollande,Sarkozy,Mélenchon,Bayrou,Villepin,Le Pen", - annotations = { - "default" : { - "colors" : { - "tweet" : "#ffffff", - "timeline" : "#808080" - } - }, - "droite" : { - "keywords" : [ /\bump\b/i, /sarkozy/i ], - "colors" : { - "tweet" : "#ddddff", - "timeline" : "#000080" - } - }, - "gauche" : { - "keywords" : [ /hollande/i, /mélenchon/i, /melenchon/i, /gauche/i, /\bps\b/i, /socialiste/i ], - "colors" : { - "tweet" : "#ffdddd", - "timeline" : "#800000" - } - }, - "centre" : { - "keywords" : [ /modem/i, /centre/i, /morin/i, /bayrou/i ], - "colors" : { - "tweet" : "#ffeedd", - "timeline" : "#ff8000" - } - }, - "verts" : { - "keywords" : [ /eelv/i, /joly/i, /écologiste/i, /ecologiste/i, /les verts/i ], - "colors" : { - "tweet" : "#ddffdd", - "timeline" : "#008000" - } - }, - "extremeDroite" : { - "keywords" : [ /le pen/i, /extreme\-droite/i, /extrême\-droite/i, /front national/i, /\bfn\b/i, /marine/i ], - "colors" : { - "tweet" : "#e0d8d0", - "timeline" : "#402000" - } - } - } \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/conf.js --- a/tweetcast/nodejs/conf.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* CONFIGURATION FILE USED BY BOTH CLIENT AND SERVER */ - -var app_port = 8000, - tracking_keyword = "Obama,Bieber", - annotations = { - "default" : { - "colors" : { - "tweet" : "#ffffff", - "timeline" : "#585858" - } - }, - "positive" : { - "keywords" : [ /\+\+/ ], - "colors" : { - "tweet" : "#c5e7cd", - "timeline" : "#1D973D" - } - }, - "negative" : { - "keywords" : [ /\-\-/ ], - "colors" : { - "tweet" : "#f6ced0", - "timeline" : "#CE0A15" - } - }, - "reference" : { - "keywords" : [ /\=\=/ ], - "colors" : { - "tweet" : "#ecedc1", - "timeline" : "#C5A62D" - } - }, - "question" : { - "keywords" : [ /\?\?/ ], - "colors" : { - "tweet" : "#bfdbec", - "timeline" : "#036AAE" - } - } - } \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/node-direct.js --- a/tweetcast/nodejs/node-direct.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,459 +0,0 @@ -/* DEFAULT CONFIGURATION */ - -//var TWITTER_USER = 'materiauxnum', -// TWITTER_PASS = 'm473r14ux7w337', -var TWITTER_USER = 'raphv', - TWITTER_PASS = '7w337LfC23gE', - RECORD_NEW_TWEETS = true, - commit_script = ''; - -/* CALLING COMMON CONFIGURATION FILE */ - -var conf_file = flagOption('-c', 'conf.js'); - -myLog('Reading Configuration from ' + conf_file); - -var fs = require('fs'); -eval(fs.readFileSync(conf_file,'utf8')); - -if (typeof sqlfile == "undefined") { - sqlfile = __dirname + '/tweets-' + encodeURIComponent(tracking_keyword) + '.sqlite' - } - -/* FUNCTIONS */ - -function flagOption(flag, defaultValue) { - var flagPos = process.argv.indexOf(flag); - return ( flagPos != -1 && flagPos < process.argv.length - 1) ? process.argv[flagPos + 1] : defaultValue; -} - -function myLog() { - var args = ["\033[1;34m["+new Date().toLocaleTimeString()+"]\033[0m"]; - for (var i in arguments) { - args.push(arguments[i]); - } - console.log.apply(console, args); -} - -function annotationMap(callback, options) { - var includeDefault = ( options && options.includeDefault ? options.includeDefault : false ); - var returnObject = ( options && options.returnObject ? options.returnObject : false ); - res = (returnObject ? {} : []); - for (var i in annotations) { - if (i != "default" || includeDefault) { - var el = callback(i, annotations[i]) - if (returnObject) { - res[i] = el; - } else { - res.push(el); - } - } - } - return res; -} - -function createTables() { - - var requete = "CREATE TABLE IF NOT EXISTS tweets ( pos INTEGER PRIMARY KEY, tweet_id TEXT UNIQUE, created_at INTEGER, json TEXT" - + annotationMap(function(a) { return ', a_' + a + ' INTEGER' }).join("") - + " );\n" - + "CREATE TABLE IF NOT EXISTS tweet_refs ( id INTEGER PRIMARY KEY, from_id TEXT, to_id TEXT, ref_type TEXT );\n" - + "CREATE INDEX IF NOT EXISTS idx_created_at ON tweets ( created_at );"; - db.executeScript(requete, function(err) { - if (err) { myLog("SQLITE error",err.stack); } - getSendLastPos(); - }); -} - -function commitReference(from_id, to_id, ref_type) { - commit_script += 'INSERT OR IGNORE INTO tweet_refs ( from_id, to_id, ref_type ) VALUES ( "' + from_id + '", "' + to_id + '", "' + ref_type + '" );\n'; -} - -function commitTweet(data) { - - var tweet = JSON.parse(data), - ann = []; - - if (!tweet.id) { - myLog("Error: Could not parse data",data); - return; - } - - try { - textids(tweet); - for (var j in keys_to_delete) { - delete tweet[keys_to_delete[j]]; - } - textids(tweet.user); - for (var j in user_keys_to_delete) { - delete tweet.user[user_keys_to_delete[j]]; - } - if (tweet.retweeted_status) { - textids(tweet.retweeted_status); - for (var j in keys_to_delete) { - delete tweet.retweeted_status[keys_to_delete[j]]; - } - } - annotationMap(function(i, annotation) { - for (var j in annotation.keywords) { - if (tweet.text.search(annotation.keywords[j]) != -1) { - ann.push(i); - break; - } - } - }); - tweet.annotations = ann; - tweet.created_at = new Date(tweet.created_at); -// myLog("Time delta :",(new Date() - tweet.created_at) / 1000); - } catch (err) { - myLog("Error while processing tweet",err.stack); - } - - if (tweet.in_reply_to_status_id) { - commitReference( tweet.id, tweet.in_reply_to_status_id, "reply" ); - } - if (tweet.retweeted_status) { - commitReference( tweet.id, tweet.retweeted_status.id, "retweet" ); - } - commit_script += 'INSERT INTO tweets ( tweet_id, created_at, json ' - + annotationMap(function(a) { return ', a_' + a }).join("") - + ' ) VALUES ( "' - + tweet.id - + '", ' - + tweet.created_at.valueOf() - + ', "' - + JSON.stringify(tweet).replace(/\"/g, '""') - + '"' - + annotationMap(function(a) { - return ann.indexOf(a) == -1 ? ', 0' : ', 1' - }).join("") - + ' );\n'; -} - -function callBackNewTweets(chunk) { - var newdata = chunk.split('\r\n'); - for (var i in newdata) { - if (newdata[i].length > 0) { - commitTweet(newdata[i]); - } - } -// myLog("Data received - length :",chunk.length); -} - -function requestTwitter() { - myLog("Requesting Twitter to track keyword(s): "+tracking_keyword); - var req = https.request({ - host: "stream.twitter.com", - path: "/1/statuses/filter.json", - method: "POST", - headers: { - 'Authorization': 'Basic ' + new Buffer( TWITTER_USER + ":" + TWITTER_PASS ).toString('base64'), - 'Content-Type': 'application/x-www-form-urlencoded' - } - }, function(res) { - myLog('Reply from stream.twitter.com: ' + res.statusCode); - myLog('Headers: ' + JSON.stringify(res.headers)); - res.setEncoding('utf8'); - res.on('data', callBackNewTweets); - res.on('end', function() { - myLog('End Twitter Connection — Trying to reconnect'); - requestTwitter(); - }); - }); - - req.write('track=' + encodeURIComponent(tracking_keyword)); - req.socket.setTimeout(60000); - req.socket.on('timeout', function() { - myLog('TimeOut - Trying to reconnect'); - requestTwitter(); - }); - req.end(); -} - -function getSendLastPos() { - db.execute("SELECT MAX(pos) lastpos FROM tweets", function (err, results) { - if (err) { myLog("SQLITE error",err.stack); } - if (results[0].lastpos != lastpos) { - lastpos = results[0].lastpos ? results[0].lastpos : 0; - try { - io.sockets.emit('tweetSummary', { - tweetcount : lastpos - }); - } catch(err) { - myLog("SOCKET.IO error while Broadcasting tweetSummary",err.stack); - } - } - }); -} - -function commitTweets() { - if (commit_script != '') { - var requete = commit_script; - commit_script = ''; - // console.log(requete); - // var reqd = new Date(); - db.executeScript(requete, function (err) { - if (err) { myLog("SQLITE error",err.stack); } - // myLog("Commit took",(new Date() - reqd),"ms"); - getSendLastPos(); - }); - } -} - -function getSendTweetPosByDate(date, socket) { - db.execute("SELECT pos, created_at, ABS(created_at-" + date + ") AS dist FROM tweets ORDER BY dist ASC LIMIT 0,9", function (err, results) { - if (err) { myLog("SQLITE error",err.stack); } - if (results.length) { - try { - socket.emit('tweetPosByDate', { - tweetpos : results[0].pos, - date : results[0].created_at - }); - } catch(err) { - myLog("SOCKET.IO error while sending tweetPosByDate",err.stack); - } - } - }); -} - -function getSendLinkedTweets(pos, socket) { -// myLog("request for tweets linked to",pos); - db.execute("SELECT A.pos pos_a, A.tweet_id id_a, B.pos pos_b, B.tweet_id id_b, ref_type, ABS(B.created_at - A.created_at) delta FROM tweets A, tweets B, tweet_refs WHERE id_a = from_id AND id_b = to_id AND (pos_a = ? OR pos_b = ?) ORDER BY delta ASC LIMIT 0, 10", [ pos, pos ], function(err, results) { - if (err) { myLog("SQLITE error: ",err.stack); } - var struct = { - "tweetpos" : pos, - "referencing" : [], - "referenced_by" : [] - }; - for (var i in results) { - if (results[i].pos_a == pos) { - struct.referencing.push({ - "pos" : results[i].pos_b, - "ref_type" : results[i].ref_type - }); - } else { - struct.referenced_by.push({ - "pos" : results[i].pos_a, - "ref_type" : results[i].ref_type - }); - } - } - try { - socket.emit('linkedTweets', struct); - } catch(err) { - myLog("SOCKET.IO error while sending linkedTweets: ",err.stack); - } - }); -} - -function getSendTweets(posList, socket) { -// myLog("request for tweets ("+posList.join(',')+") from "+socket.id); - db.execute("SELECT * FROM tweets WHERE pos IN ( " + posList.join(',') + " )", function (err, results) { - if (err) { myLog("SQLITE error",err.stack); } - try { - socket.emit('tweets', - results.map(function(line) { - var tw = JSON.parse(line.json); - tw.pos = line.pos; - return tw; - }) - ); - } catch (err) { - myLog("SOCKET.IO error while sending tweets",err.stack); - } - }); -} - -function getSendTimeline(data, socket) { -// myLog("request for timeline (",data.level, data.full,") from "+socket.id); - var lvl = date_levels[data.level], - requete = "SELECT COUNT(*) AS nb, " - + lvl - + "*ROUND(created_at/" - + lvl - + ") AS tranche" - + annotationMap(function (a) { return " , SUM(a_" + a + ") AS s_" + a }).join("") - + " FROM tweets GROUP BY tranche ORDER BY tranche DESC LIMIT 0," + ( data.full ? "50" : "1" ); - db.execute(requete, function (err, results) { - if (err) { myLog("SQLITE error",err.stack); } - if (!results.length) { - return; - } - var tbl = [], - lastend = parseInt(results[results.length - 1].tranche); - for (var i = results.length - 1; i >= 0; i--) { - var start = parseInt(results[i].tranche); - while (start > lastend) { - var struct = { "start": lastend, "tweets" : 0, "annotations" : {} }; - lastend += lvl; - struct.end = lastend; - tbl.push(struct); - } - lastend += lvl; - var struct = { - "start" : start, - "end" : lastend, - "tweets" : results[i].nb, - "annotations" : annotationMap(function (a) { - return results[i]['s_'+a]; - },{returnObject: true}) - } - tbl.push(struct); - } - try { - socket.emit('timeline', { - "full" : data.full, - "level" : data.level, - "data" : tbl - }); - } catch (err) { - myLog("SOCKET.IO error while sending timeline",err.stack); - } - }); -} - -function textids(object) { - for (var key in object) { - // Workaround for Unicode bug in socket.io. - - if (typeof object[key] == "string") { - var tmp = ''; - for (var i = 0; i < object[key].length; i++) { - tmp += ( object[key].charCodeAt(i) < 128 ? object[key].charAt(i) : "&#" + object[key].charCodeAt(i) + ";" ); - } - object[key] = tmp; - } - - if (key.substr(-2) == 'id') { - object[key] = object[key + '_str']; - delete object[key + '_str']; - } - - } -} - -function httpHandler(req, res) { - myLog("HTTP Request for URL "+req.url); - var url = ( req.url == "/config" ? conf_file : __dirname + "/client" + req.url + ( req.url[req.url.length - 1] == "/" ? "index.html" : "" ) ); - fs.readFile( url, function(err, data) { - if (err) { - myLog("Error 404"); - res.writeHead(404); - return res.end('File not found'); - } - res.writeHead(200); - res.end(data); - }); -} - -/* Initialization */ - -var http = require('http'), - https = require('https'), - sqlite = require('sqlite'), - socketio = require('socket.io'), - tweets = [], - lastpos = 0, - arcs = [], - tweet_ids = [], - date_struct = [], - date_levels = [ - 3600 * 1000, - 15 * 60 * 1000, - 5 * 60 * 1000, - 60 * 1000, - 15 * 1000 - ], - keys_to_delete = [ - 'in_reply_to_screen_name', - 'in_reply_to_user_id', - 'retweeted', - 'place', - 'geo', - 'source', - 'contributors', - 'coordinates', - 'retweet_count', - 'favorited', - 'truncated', - 'possibly_sensitive' - ], - user_keys_to_delete = [ - 'default_profile_image', - 'show_all_inline_media', - 'contributors_enabled', - 'profile_sidebar_fill_color', - 'created_at', - 'lang', - 'time_zone', - 'profile_sidebar_border_color', - 'follow_request_sent', - 'profile_background_image_url', - 'profile_background_image_url_https', - 'followers_count', - 'description', - 'url', - 'geo_enabled', - 'profile_use_background_image', - 'default_profile', - 'following', - 'profile_text_color', - 'is_translator', - 'favourites_count', - 'listed_count', - 'friends_count', - 'profile_link_color', - 'protected', - 'location', - 'notifications', - 'profile_image_url_https', - 'statuses_count', - 'verified', - 'profile_background_color', - 'profile_background_tile', - 'utc_offset' - ], - app = http.createServer(httpHandler), - io = socketio.listen(app), - db = new sqlite.Database(); - -/* MAIN CODE */ - -app.listen(app_port); -myLog("Listening on port: "+app_port); -myLog("Opening SQLITE file: "+sqlfile); -db.open(sqlfile , function(err) { - if (err) { myLog("SQLITE error",err.stack); } - createTables(); -}); - -setInterval(commitTweets,500); -setInterval(function(){myLog("Still alive, tweet count",lastpos)}, 60000); - -if (RECORD_NEW_TWEETS) { - requestTwitter(); -} - -io.set('log level', 0); -io.sockets.on('connection', function(socket) { - myLog("New connection from", socket.handshake.address.address, "with id=", socket.id); - try { - socket.emit('tweetSummary', { tweetcount : lastpos }); - } catch (err) { - myLog("SOCKET.IO error while sending tweetSummary",err.stack); - } - socket.on('updateTweets', function(data) { - if (data.tweets.length) { - getSendTweets(data.tweets, socket); - } - }); - socket.on('updateTimeline', function(data) { - getSendTimeline(data, socket); - }); - socket.on('tweetPosByDate', function(data) { - getSendTweetPosByDate(data.date, socket); - }); - socket.on('linkedTweets', function(data) { - getSendLinkedTweets(data.tweetpos, socket); - }); -}); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/readme.txt --- a/tweetcast/nodejs/readme.txt Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ - - - --------------------------------------------------------------------------------- - -INSTALLATION - - - 1. Installer la dernière version stable de Node.js - - Actuellement, la v0.4.x (disponible à partir de Ubuntu 11.10) - - http://nodejs.org/dist/node-v0.4.12.tar.gz - - ./configure - - Pour compiler avec support SSL (nécessaire pour requêter Twitter), il faut installer (sur Ubuntu) le package libssl-dev - - make - - sudo make install - - 2. Installer le gestionnaire de paquets node (npm) - - curl http://npmjs.org/install.sh | sudo sh - - 3. Installer les paquets socket.io et sqlite - - npm install socket.io - npm install sqlite - --------------------------------------------------------------------------------- - -CONFIGURATION - - Modifier le fichier conf.js ou créer un fichier similaire - - - diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/nodejs/sqlite2txt.py --- a/tweetcast/nodejs/sqlite2txt.py Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import sqlite3, sys, os.path, codecs, re - -if len(sys.argv) > 1: - filename = sys.argv[1] - if os.path.exists(filename): - print "Chargement du fichier %s" % filename - conn = sqlite3.connect(filename) - c = conn.cursor() - c.execute("SELECT json FROM tweets") - f = codecs.open("%s.txt" % filename, mode='w', encoding='utf-8') - for r in c: - txt = '' - t = re.split("&#([0-9]+);",r[0]) - for i in range(len(t)): - txt += ( ( '\\u' + hex(int(t[i])).replace('0x','').rjust(4,'0') ) if i % 2 else t[i] ) - f.write(u'%s\n' % txt) - f.close() - print "Le fichier %s.txt a ete cree" % filename - else: - print "Le fichier n'existe pas" -else: - print "Merci de preciser le nom du fichier" \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/server-gevent/server_setup.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/server-gevent/server_setup.py Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,2 @@ +SQL_CONNECT = 'postgresql://user:pass@hostname/database' +WEB_PORT = 8888 \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/server-gevent/tweetcast.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/server-gevent/tweetcast.py Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,138 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from gevent import monkey; monkey.patch_all() +# Importer d'abord, sinon exception +import anyjson, gevent, psycopg2 +from sqlalchemy import (Boolean, Column, BigInteger, Integer, String, + ForeignKey, DateTime, create_engine, asc, func) +from sqlalchemy.orm import backref, relationship, sessionmaker, joinedload +from sqlalchemy.ext.declarative import declarative_base +from gevent.pywsgi import WSGIServer +from urlparse import parse_qs +import datetime +from server_setup import SQL_CONNECT, WEB_PORT + +Base = declarative_base() +engine = create_engine(SQL_CONNECT) +Session = sessionmaker(bind=engine) + +class TweetSource(Base): + __tablename__ = 'tweet_tweet_source' + id = Column(Integer, primary_key=True, autoincrement=True) + original_json = Column(String) + received_at = Column(DateTime, default=datetime.datetime.utcnow, index=True) + +class Tweet(Base): + __tablename__ = 'tweet_tweet' + id = Column(BigInteger, primary_key=True, autoincrement=False) + tweet_source_id = Column(Integer, ForeignKey('tweet_tweet_source.id')) + tweet_source = relationship("TweetSource", backref="tweet") + def jsondict(self): + tweetdict = anyjson.deserialize(self.tweet_source.original_json) + keys_to_delete = [ + 'in_reply_to_screen_name', + 'in_reply_to_user_id', + 'retweeted', + 'place', + 'geo', + 'source', + 'contributors', + 'coordinates', + 'retweet_count', + 'favorited', + 'truncated', + 'possibly_sensitive' + ] + user_keys_to_delete = [ + 'default_profile_image', + 'show_all_inline_media', + 'contributors_enabled', + 'profile_sidebar_fill_color', + 'created_at', + 'lang', + 'time_zone', + 'profile_sidebar_border_color', + 'follow_request_sent', + 'profile_background_image_url', + 'profile_background_image_url_https', + 'followers_count', + 'description', + 'url', + 'geo_enabled', + 'profile_use_background_image', + 'default_profile', + 'following', + 'profile_text_color', + 'is_translator', + 'favourites_count', + 'listed_count', + 'friends_count', + 'profile_link_color', + 'protected', + 'location', + 'notifications', + 'profile_image_url_https', + 'statuses_count', + 'verified', + 'profile_background_color', + 'profile_background_tile', + 'utc_offset' + ] + + def textids(dictionary): + idfields = [key for key in dictionary if key[-2:] == 'id'] + for key in idfields: + keystr = key + '_str' + if keystr in dictionary: + dictionary[key] = dictionary[keystr] + del dictionary[keystr] + + for key in keys_to_delete: + if key in tweetdict: + del tweetdict[key] + for key in user_keys_to_delete: + if key in tweetdict['user']: + del tweetdict['user'][key] + textids(tweetdict) + textids(tweetdict['user']) + if 'retweeted_status' in tweetdict: + for key in keys_to_delete: + if key in tweetdict['retweeted_status']: + del tweetdict['retweeted_status'][key] + for key in user_keys_to_delete: + if key in tweetdict['retweeted_status']['user']: + del tweetdict['retweeted_status']['user'][key] + textids(tweetdict['retweeted_status']) + return tweetdict + + +def webserver(env, start_response): + if env['PATH_INFO'] == '/': + httpquery = parse_qs(env['QUERY_STRING']) + print "serving tweets to", env['REMOTE_ADDR'], httpquery + query = session.query(Tweet).order_by(asc(Tweet.id)).options(joinedload(Tweet.tweet_source)) + if "since_id" in httpquery: + query = query.filter(Tweet.id >= long(httpquery["since_id"][0])) + if "after_id" in httpquery: + query = query.filter(Tweet.id > long(httpquery["after_id"][0])) + if "max_id" in httpquery: + query = query.filter(Tweet.id <= long(httpquery["max_id"][0])) + if "before_id" in httpquery: + query = query.filter(Tweet.id < long(httpquery["before_id"][0])) + if "limit" in httpquery: + result = query[:int(httpquery["limit"][0])] + else: + result = query + start_response('200 OK', [('Content-Type', 'application/javascript' if "callback" in httpquery else 'application/json' )]) + return ["%s%s%s"%( + "%s("%httpquery["callback"][0] if "callback" in httpquery else "", + anyjson.serialize({"tweets" : [t.jsondict() for t in result]}), + ")" if "callback" in httpquery else "" + )] + else: + start_response('404 Not Found', [('Content-Type', 'text/html')]) + return ['

      Not Found

      '] + +session = Session() +WSGIServer(('', WEB_PORT), webserver).serve_forever() \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/server-nodejs/conf.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/server-nodejs/conf.js Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,43 @@ +/* CONFIGURATION FILE USED BY BOTH CLIENT AND SERVER */ + +RECORD_NEW_TWEETS = false; +STANDALONE_APP = true; + +var app_port = 8000, + tracking_keywords = [ "sarkozy" ], + annotations = { + "default" : { + "colors" : { + "tweet" : "#ffffff", + "timeline" : "#585858" + } + }, + "positive" : { + "keywords" : [ /\+\+/ ], + "colors" : { + "tweet" : "#c5e7cd", + "timeline" : "#1D973D" + } + }, + "negative" : { + "keywords" : [ /\-\-/ ], + "colors" : { + "tweet" : "#f6ced0", + "timeline" : "#CE0A15" + } + }, + "reference" : { + "keywords" : [ /\=\=/ ], + "colors" : { + "tweet" : "#ecedc1", + "timeline" : "#C5A62D" + } + }, + "question" : { + "keywords" : [ /\?\?/ ], + "colors" : { + "tweet" : "#bfdbec", + "timeline" : "#036AAE" + } + } + } \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/server-nodejs/tweetcast.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tweetcast/server-nodejs/tweetcast.js Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,235 @@ +READ_OLD_TWEETS = true; +RECORD_NEW_TWEETS = true; + +tweet_file = flagOption('-f', 'tweets.txt'); +app_port = flagOption('-p', 8000); +tracking_keyword = flagOption('-t', null); +user_pass = flagOption('-u', null); + +if (!user_pass) { + console.log("You must provide user credentials on the command-line, e.g. node tweetcast.js -u user:pass") + process.exit(); +} +if (!tracking_keyword) { + console.log("You must provide keyword(s) on the command-line, e.g. node tweetcast.js -t Bieber") + process.exit(); +} + +console.log("Tracking keyword "+tracking_keyword); + +var fs = require('fs'), + http = require('http'), + https = require('https'), + socketio = require('socket.io'), + app = http.createServer(httpHandler), + io = socketio.listen(app) + tweets = [], + tweet_ids = [], + keys_to_delete = [ + 'in_reply_to_screen_name', + 'in_reply_to_user_id', + 'retweeted', + 'place', + 'geo', + 'source', + 'contributors', + 'coordinates', + 'retweet_count', + 'favorited', + 'truncated', + 'possibly_sensitive' + ], + user_keys_to_delete = [ + 'default_profile_image', + 'show_all_inline_media', + 'contributors_enabled', + 'profile_sidebar_fill_color', + 'created_at', + 'lang', + 'time_zone', + 'profile_sidebar_border_color', + 'follow_request_sent', + 'profile_background_image_url', + 'profile_background_image_url_https', + 'followers_count', + 'description', + 'url', + 'geo_enabled', + 'profile_use_background_image', + 'default_profile', + 'following', + 'profile_text_color', + 'is_translator', + 'favourites_count', + 'listed_count', + 'friends_count', + 'profile_link_color', + 'protected', + 'location', + 'notifications', + 'profile_image_url_https', + 'statuses_count', + 'verified', + 'profile_background_color', + 'profile_background_tile', + 'utc_offset' + ], + content_types = { + css : "text/css; charset=utf-8", + html : "text/html; charset=utf-8", + js : "text/javascript; charset=utf-8", + png : "image/png" + }; + +function wrapContentType(ext) { + return { + "Content-Type" : ( content_types[ext] ? content_types[ext] : 'text/plain' ) + } +} + +function httpHandler(req, res) { + console.log("HTTP Request for URL "+req.url); + var url = req.url.split('?')[0]; + url = __dirname + "/client" + url + ( url[url.length - 1] == "/" ? "index.html" : "" ); + var ext = url.split('.').slice(-1)[0].toLowerCase(); + fs.readFile( url, function(err, data) { + if (err) { + console.log("Error 404"); + res.writeHead(404); + return res.end('File not found'); + } + res.writeHead(200, wrapContentType(ext)); + res.end(data); + }); +} + +function flagOption(flag, defaultValue) { + var flagPos = process.argv.indexOf(flag); + return ( flagPos != -1 && flagPos < process.argv.length - 1) ? process.argv[flagPos + 1] : defaultValue; +} + +function addToList(tweet) { + if (tweet_ids.indexOf(tweet.id) != -1) { + console.log("Error: Tweet already in list"); + return false; + } + tweets.push(tweet); + tweet_ids.push(tweet.id); + return true; +} + +function textids(object) { + for (var key in object) { + // Workaround for Unicode bug in socket.io. + + if (typeof object[key] == "string") { + var tmp = ''; + for (var i = 0; i < object[key].length; i++) { + tmp += ( object[key].charCodeAt(i) < 128 ? object[key].charAt(i) : "&#" + object[key].charCodeAt(i) + ";" ); + } + object[key] = tmp; + } + if (key.substr(-2) == 'id') { + object[key] = object[key + '_str']; + delete object[key + '_str']; + } + } +} + +function readTweetsFromFile(file_name) { + console.log("Trying to read tweets from " + file_name); + try { + var oldtweets = fs.readFileSync(file_name, 'utf8').split('\n'); + var tweetscopied = 0; + for (var i in oldtweets) { + if (oldtweets[i].length > 0) { + addToList(JSON.parse(oldtweets[i])); + tweetscopied++; + } + } + console.log(tweetscopied + " tweets copied"); + } + catch (err) { + console.log("Error opening "+file_name); + } +} + +function requestTweets() { + console.log("Fetching tweets from https://stream.twitter.com/1/statuses/filter.json") + var writestream = null; + var req = https.request({ + host: "stream.twitter.com", + path: "/1/statuses/filter.json", + method: "POST", + headers: { + 'Authorization': 'Basic ' + new Buffer( user_pass ).toString('base64'), + 'Content-Type': 'application/x-www-form-urlencoded' + } + }, function(res) { + writestream = fs.createWriteStream( tweet_file, { flags: 'a+', encoding: 'utf-8' } ); + console.log('Response received, status : ' + res.statusCode); + res.setEncoding('utf8'); + res.on('data', function(chunk) { + var newdata = chunk.split('\r\n'), + tweetpos = tweets.length; + try { + for (var i in newdata) { + if (newdata[i].length > 0) { + var tweet = JSON.parse(newdata[i]); + textids(tweet); + for (var j in keys_to_delete) { + delete tweet[keys_to_delete[j]]; + } + textids(tweet.user); + for (var j in user_keys_to_delete) { + delete tweet.user[user_keys_to_delete[j]]; + } + if (tweet.retweeted_status) { + textids(tweet.retweeted_status); + for (var j in keys_to_delete) { + delete tweet.retweeted_status[keys_to_delete[j]]; + } + } + /* tweet.date_value = Date.parse(tweet.created_at); */ + if (addToList(tweet)) { + writestream.write(JSON.stringify(tweet)+'\n'); + } + } + } + io.sockets.emit('update', { + "new_tweets" : tweets.slice(tweetpos) + }); + console.log("New tweets received. We now have", tweets.length, "tweets in memory"); + } + catch(err) { + console.log(err.message); + } + }); + }); + + req.write('track=' + encodeURIComponent( ( tracking_keyword ) ) ); + req.end(); +} + +app.listen(app_port); +console.log("Listening on port: "+app_port); + +if (READ_OLD_TWEETS) { + readTweetsFromFile(tweet_file); +} else { + console.log("Reading old tweets disabled !"); +} + +if (RECORD_NEW_TWEETS) { + requestTweets(); +} else { + console.log("Recording new tweets disabled !"); +} + +io.set('log level', 0); +io.sockets.on('connection', function(socket) { + console.log("New connection from "+socket.handshake.address.address); + socket.emit('initial_data', { + "tweets" : tweets + }); +}); \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/css/style.css --- a/tweetcast/twisted/client/css/style.css Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* Browser-reset CSS */ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -body { - font-family: Helvetica, Arial, sans-serif; -} - -/* Liste de Tweets */ - -#tweetlist { - list-style: none; -} - -li.tweet { - float: left; border: 1px solid #999; margin: 5px; width: 240px; height: 100px; -} - -.tweet h4, .tweet p { - margin: 5px; -} - -.tweet h4 { - font-size: 15px; -} - -.tweet p { - font-size: 12px; -} - -img.tweet_profile_image { - float: left; margin: 5px; width: 32px; height: 32px; -} - -p.tweet_created_at { - font-style: italic; color: #999; -} - -.a_positive { - background: #c5e7cd; -} - -.a_negative { - background: #f6ced0; -} - -.a_reference { - background: #ecedc1; -} - -.a_question { - background: #bfdbec; -} \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/index.html --- a/tweetcast/twisted/client/index.html Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - - - Polemic Tweet “TweetCast” - - - - - - - - -

      Liste de Tweets

      -
        -
      - - \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/js/script.js --- a/tweetcast/twisted/client/js/script.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -// Web Socket definitions - -WEB_SOCKET_SWF_LOCATION = "lib/websocket-js/WebSocketMain.swf"; -WEB_SOCKET_DEBUG = true; -var ws, tweets = []; - -$(document).ready(function() { - ws = new WebSocket("ws://" + document.location.hostname + ":9000/"); - ws.onopen = function() { - console.log("open"); - } - ws.onmessage = function(e) { - d = $.parseJSON(e.data); - console.log(d); - if (d.tweets) { - tweets = tweets.concat(d.tweets); - html = ''; - for (var i = d.tweets.length - 1; i >= 0; i--) { - html += Mustache.to_html('
    • @{{screen_name}}:

      {{created_at}}

      {{text}}

    • ',d.tweets[i]); - } - console.log(html); - $("#tweetlist").prepend(html); - } - }; - ws.onclose = function() { - console.log("close"); - }; - ws.onerror = function() { - console.log("error"); - }; - - -}) \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/mustache/mustache.js --- a/tweetcast/twisted/client/lib/mustache/mustache.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,396 +0,0 @@ -/* - mustache.js — Logic-less templates in JavaScript - - See http://mustache.github.com/ for more info. -*/ - -var Mustache = function() { - var regexCache = {}; - var Renderer = function() {}; - - Renderer.prototype = { - otag: "{{", - ctag: "}}", - pragmas: {}, - buffer: [], - pragmas_implemented: { - "IMPLICIT-ITERATOR": true - }, - context: {}, - - render: function(template, context, partials, in_recursion) { - // reset buffer & set context - if(!in_recursion) { - this.context = context; - this.buffer = []; // TODO: make this non-lazy - } - - // fail fast - if(!this.includes("", template)) { - if(in_recursion) { - return template; - } else { - this.send(template); - return; - } - } - - // get the pragmas together - template = this.render_pragmas(template); - - // render the template - var html = this.render_section(template, context, partials); - - // render_section did not find any sections, we still need to render the tags - if (html === false) { - html = this.render_tags(template, context, partials, in_recursion); - } - - if (in_recursion) { - return html; - } else { - this.sendLines(html); - } - }, - - /* - Sends parsed lines - */ - send: function(line) { - if(line !== "") { - this.buffer.push(line); - } - }, - - sendLines: function(text) { - if (text) { - var lines = text.split("\n"); - for (var i = 0; i < lines.length; i++) { - this.send(lines[i]); - } - } - }, - - /* - Looks for %PRAGMAS - */ - render_pragmas: function(template) { - // no pragmas - if(!this.includes("%", template)) { - return template; - } - - var that = this; - var regex = this.getCachedRegex("render_pragmas", function(otag, ctag) { - return new RegExp(otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" + ctag, "g"); - }); - - return template.replace(regex, function(match, pragma, options) { - if(!that.pragmas_implemented[pragma]) { - throw({message: - "This implementation of mustache doesn't understand the '" + - pragma + "' pragma"}); - } - that.pragmas[pragma] = {}; - if(options) { - var opts = options.split("="); - that.pragmas[pragma][opts[0]] = opts[1]; - } - return ""; - // ignore unknown pragmas silently - }); - }, - - /* - Tries to find a partial in the curent scope and render it - */ - render_partial: function(name, context, partials) { - name = this.trim(name); - if(!partials || partials[name] === undefined) { - throw({message: "unknown_partial '" + name + "'"}); - } - if(typeof(context[name]) != "object") { - return this.render(partials[name], context, partials, true); - } - return this.render(partials[name], context[name], partials, true); - }, - - /* - Renders inverted (^) and normal (#) sections - */ - render_section: function(template, context, partials) { - if(!this.includes("#", template) && !this.includes("^", template)) { - // did not render anything, there were no sections - return false; - } - - var that = this; - - var regex = this.getCachedRegex("render_section", function(otag, ctag) { - // This regex matches _the first_ section ({{#foo}}{{/foo}}), and captures the remainder - return new RegExp( - "^([\\s\\S]*?)" + // all the crap at the beginning that is not {{*}} ($1) - - otag + // {{ - "(\\^|\\#)\\s*(.+)\\s*" + // #foo (# == $2, foo == $3) - ctag + // }} - - "\n*([\\s\\S]*?)" + // between the tag ($2). leading newlines are dropped - - otag + // {{ - "\\/\\s*\\3\\s*" + // /foo (backreference to the opening tag). - ctag + // }} - - "\\s*([\\s\\S]*)$", // everything else in the string ($4). leading whitespace is dropped. - - "g"); - }); - - - // for each {{#foo}}{{/foo}} section do... - return template.replace(regex, function(match, before, type, name, content, after) { - // before contains only tags, no sections - var renderedBefore = before ? that.render_tags(before, context, partials, true) : "", - - // after may contain both sections and tags, so use full rendering function - renderedAfter = after ? that.render(after, context, partials, true) : "", - - // will be computed below - renderedContent, - - value = that.find(name, context); - - if (type === "^") { // inverted section - if (!value || that.is_array(value) && value.length === 0) { - // false or empty list, render it - renderedContent = that.render(content, context, partials, true); - } else { - renderedContent = ""; - } - } else if (type === "#") { // normal section - if (that.is_array(value)) { // Enumerable, Let's loop! - renderedContent = that.map(value, function(row) { - return that.render(content, that.create_context(row), partials, true); - }).join(""); - } else if (that.is_object(value)) { // Object, Use it as subcontext! - renderedContent = that.render(content, that.create_context(value), - partials, true); - } else if (typeof value === "function") { - // higher order section - renderedContent = value.call(context, content, function(text) { - return that.render(text, context, partials, true); - }); - } else if (value) { // boolean section - renderedContent = that.render(content, context, partials, true); - } else { - renderedContent = ""; - } - } - - return renderedBefore + renderedContent + renderedAfter; - }); - }, - - /* - Replace {{foo}} and friends with values from our view - */ - render_tags: function(template, context, partials, in_recursion) { - // tit for tat - var that = this; - - - - var new_regex = function() { - return that.getCachedRegex("render_tags", function(otag, ctag) { - return new RegExp(otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" + ctag + "+", "g"); - }); - }; - - var regex = new_regex(); - var tag_replace_callback = function(match, operator, name) { - switch(operator) { - case "!": // ignore comments - return ""; - case "=": // set new delimiters, rebuild the replace regexp - that.set_delimiters(name); - regex = new_regex(); - return ""; - case ">": // render partial - return that.render_partial(name, context, partials); - case "{": // the triple mustache is unescaped - return that.find(name, context); - default: // escape the value - return that.escape(that.find(name, context)); - } - }; - var lines = template.split("\n"); - for(var i = 0; i < lines.length; i++) { - lines[i] = lines[i].replace(regex, tag_replace_callback, this); - if(!in_recursion) { - this.send(lines[i]); - } - } - - if(in_recursion) { - return lines.join("\n"); - } - }, - - set_delimiters: function(delimiters) { - var dels = delimiters.split(" "); - this.otag = this.escape_regex(dels[0]); - this.ctag = this.escape_regex(dels[1]); - }, - - escape_regex: function(text) { - // thank you Simon Willison - if(!arguments.callee.sRE) { - var specials = [ - '/', '.', '*', '+', '?', '|', - '(', ')', '[', ']', '{', '}', '\\' - ]; - arguments.callee.sRE = new RegExp( - '(\\' + specials.join('|\\') + ')', 'g' - ); - } - return text.replace(arguments.callee.sRE, '\\$1'); - }, - - /* - find `name` in current `context`. That is find me a value - from the view object - */ - find: function(name, context) { - name = this.trim(name); - - // Checks whether a value is thruthy or false or 0 - function is_kinda_truthy(bool) { - return bool === false || bool === 0 || bool; - } - - var value; - if(is_kinda_truthy(context[name])) { - value = context[name]; - } else if(is_kinda_truthy(this.context[name])) { - value = this.context[name]; - } - - if(typeof value === "function") { - return value.apply(context); - } - if(value !== undefined) { - return value; - } - // silently ignore unkown variables - return ""; - }, - - // Utility methods - - /* includes tag */ - includes: function(needle, haystack) { - return haystack.indexOf(this.otag + needle) != -1; - }, - - /* - Does away with nasty characters - */ - escape: function(s) { - s = String(s === null ? "" : s); - return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) { - switch(s) { - case "&": return "&"; - case '"': return '"'; - case "'": return '''; - case "<": return "<"; - case ">": return ">"; - default: return s; - } - }); - }, - - // by @langalex, support for arrays of strings - create_context: function(_context) { - if(this.is_object(_context)) { - return _context; - } else { - var iterator = "."; - if(this.pragmas["IMPLICIT-ITERATOR"]) { - iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator; - } - var ctx = {}; - ctx[iterator] = _context; - return ctx; - } - }, - - is_object: function(a) { - return a && typeof a == "object"; - }, - - is_array: function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }, - - /* - Gets rid of leading and trailing whitespace - */ - trim: function(s) { - return s.replace(/^\s*|\s*$/g, ""); - }, - - /* - Why, why, why? Because IE. Cry, cry cry. - */ - map: function(array, fn) { - if (typeof array.map == "function") { - return array.map(fn); - } else { - var r = []; - var l = array.length; - for(var i = 0; i < l; i++) { - r.push(fn(array[i])); - } - return r; - } - }, - - getCachedRegex: function(name, generator) { - var byOtag = regexCache[this.otag]; - if (!byOtag) { - byOtag = regexCache[this.otag] = {}; - } - - var byCtag = byOtag[this.ctag]; - if (!byCtag) { - byCtag = byOtag[this.ctag] = {}; - } - - var regex = byCtag[name]; - if (!regex) { - regex = byCtag[name] = generator(this.otag, this.ctag); - } - - return regex; - } - }; - - return({ - name: "mustache.js", - version: "0.4.0-dev", - - /* - Turns a template and view into HTML - */ - to_html: function(template, view, partials, send_fun) { - var renderer = new Renderer(); - if(send_fun) { - renderer.send = send_fun; - } - renderer.render(template, view || {}, partials); - if(!send_fun) { - return renderer.buffer.join("\n"); - } - } - }); -}(); diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/websocket-js/.gitignore --- a/tweetcast/twisted/client/lib/websocket-js/.gitignore Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -test.html -WebSocket.swc -flash-src-websocket diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/websocket-js/NEWS.md --- a/tweetcast/twisted/client/lib/websocket-js/NEWS.md Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -- 2011-09-18 - - web-socket-js now speaks WebSocket version hybi-10. Old versions spoke - hixie-76. If you really need web-socket-js which speaks hixie-76, you can - get it from - [hixie-76 branch](https://github.com/gimite/web-socket-js/tree/hixie-76), - but the branch is no longer maintained. Implementation of hybi-10 is - mostly done by Joel Martin (kanaka). diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/websocket-js/README.md --- a/tweetcast/twisted/client/lib/websocket-js/README.md Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -## How to try the sample - -Assuming you have Web server (e.g. Apache) running at **http://example.com/** . - -1. Download [web-socket-ruby](http://github.com/gimite/web-socket-ruby/tree/master). -2. Run sample Web Socket server (echo server) in example.com with: (#1)
      -``` -$ ruby web-socket-ruby/samples/echo_server.rb example.com 10081 -``` -3. If your server already provides socket policy file at port **843**, modify the file to allow access to port **10081**. Otherwise you can skip this step. See below for details. -4. Publish the web-socket-js directory with your Web server (e.g. put it in ~/public_html). -5. Change ws://localhost:10081 to **ws://example.com:10081** in sample.html. -6. Open sample.html in your browser. -7. After "onopen" is shown, input something, click [Send] and confirm echo back. - -\#1: First argument of echo_server.rb means that it accepts Web Socket connection from HTML pages in example.com. - - -## How to use it in your application - -- Copy swfobject.js, web_socket.js, WebSocketMain.swf to your application directory. -- Write JavaScript code: - -```html - - - - - -``` - -- Put Flash socket policy file to your server unless you use web-socket-ruby or em-websocket as your WebSocket server. See "Flash socket policy file" section below for details. - - -## Troubleshooting - -If it doesn't work, try these: - -1. Try Chrome and Firefox 3.x. - - - It doesn't work on Chrome:
      - It's likely an issue of your code or the server. Debug your code as usual e.g. using console.log. - - It works on Chrome but it doesn't work on Firefox:
      - It's likely an issue of web-socket-js specific configuration (e.g. 3 and 4 below). - - It works on both Chrome and Firefox, but it doesn't work on your browser:
      - Check "Supported environment" section below. Your browser may not be supported by web-socket-js. - -2. Add this line before your code: - WEB_SOCKET_DEBUG = true; -and use Developer Tools (Chrome/Safari) or Firebug (Firefox) to see if console.log outputs any errors. - -3. Make sure you do NOT open your HTML page as local file e.g. file:///.../sample.html. web-socket-js doesn't work on local file. Open it via Web server e.g. http:///.../sample.html. - -4. Make sure you host your HTML page and WebSocketMain.swf in the same domain. Otherwise, see "How to host HTML file and SWF file in different domains" section. - -5. If you are NOT using web-socket-ruby or em-websocket as your WebSocket server, you need to place Flash socket policy file on your server. See "Flash socket policy file" section below for details. - -6. Check if sample.html bundled with web-socket-js works. - -7. Make sure the port used for WebSocket (10081 in example above) is not blocked by your server/client's firewall. - -8. Install [debugger version of Flash Player](http://www.adobe.com/support/flashplayer/downloads.html) to see Flash errors. - - -## Supported environments - -It should work on: - -- Google Chrome 4 or later (just uses native implementation) -- Firefox 3.x, 4.x, Internet Explorer 8, 9 + Flash Player 10 or later - -It may or may not work on other browsers such as Safari, Opera or IE 6. Patch for these browsers are appreciated, but I will not work on fixing issues specific to these browsers by myself. - - -## Limitations/differences compared to native WebSocket - -- You need some more lines in your JavaScript code. See "How to use it in your application" section above for details. -- It requires Flash Player 10 or later unless the browser supports native WebSocket. -- Your server must provide Flash socket policy file, unless you use web-socket-ruby or em-websocket. See "Flash socket policy file" section below for details. -- It has limited support for Cookies on WebSocket. See "Cookie support" section below for details. -- It doesn't use proxies specified in browser config. See "Proxy support" section below for details. - - -### Flash socket policy file - -This implementation uses Flash's socket, which means that your server must provide Flash socket policy file to declare the server accepts connections from Flash. - -If you use [web-socket-ruby](http://github.com/gimite/web-socket-ruby/tree/master) or [em-websocket](https://github.com/igrigorik/em-websocket), you don't need anything special, because they handle Flash socket policy file request. But if you already provide socket policy file at port **843**, you need to modify the file to allow access to Web Socket port, because it precedes what the libraries provide. - -If you use other Web Socket server implementation, you need to provide socket policy file yourself. See [Setting up A Flash Socket Policy File](http://www.lightsphere.com/dev/articles/flash_socket_policy.html) for details and sample script to run socket policy file server. [node.js implementation is available here](https://github.com/3rd-Eden/FlashPolicyFileServer). - -Actually, it's still better to provide socket policy file at port 843 even if you use web-socket-ruby or em-websocket. Flash always try to connect to port 843 first, so providing the file at port 843 makes startup faster. - - -### Cookie support - -web-socket-js has limited supported for Cookies on WebSocket. - -Cookie is sent if Web Socket host is exactly the same as the origin of JavaScript (The port can be different). Otherwise it is not sent, because I don't know way to send right Cookie (which is Cookie of the host of Web Socket, I heard). Also, HttpOnly Cookies are not sent. - -Note that it's technically possible that client sends arbitrary string as Cookie and any other headers (by modifying this library for example) once you place Flash socket policy file in your server. So don't trust Cookie and other headers if you allow connection from untrusted origin. - - -### Proxy support - -[The WebSocket spec](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10) specifies instructions for User Agents to support proxied connections by implementing the HTTP CONNECT method. - -The AS3 Socket class doesn't implement this mechanism, which renders it useless for the scenarios where the user trying to open a socket is behind a proxy. - -The class RFC2817Socket (by Christian Cantrell) effectively lets us implement this, as long as the proxy settings are known and provided by the interface that instantiates the WebSocket. As such, if you want to support proxied conncetions, you'll have to supply this information to the WebSocket constructor when Flash is being used. One way to go about it would be to ask the user for proxy settings information if the initial connection fails. - - -## How to host HTML file and SWF file in different domains - -By default, HTML file and SWF file must be in the same domain. You can follow steps below to allow hosting them in different domain. - -**WARNING**: If you use the method below, HTML files in ANY domains can send arbitrary TCP data to your WebSocket server, regardless of configuration in Flash socket policy file. Arbitrary TCP data means that they can even fake request headers including Origin and Cookie. - -1. Unzip WebSocketMainInsecure.zip to extract WebSocketMainInsecure.swf. -2. Put WebSocketMainInsecure.swf on your server, instead of WebSocketMain.swf. -3. In JavaScript, set WEB_SOCKET_SWF_LOCATION to URL of your WebSocketMainInsecure.swf. - - -## How to build WebSocketMain.swf - -Install [Flex 4 SDK](http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4). - - $ cd flash-src - $ ./build.sh - - -## WebSocket protocol versions - -- web-socket-js supports [hybi-10 version](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10) of WebSocket protocol. -- web-socket-js doesn't speak other versions including hixie-76, which was supported by old version of this library. If you really need web-socket-js which speaks hixie-76, you can get it from [hixie-76 branch](https://github.com/gimite/web-socket-js/tree/hixie-76), but the branch is no longer maintained. - - -## License - -New BSD License. diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/websocket-js/WebSocketMain.swf Binary file tweetcast/twisted/client/lib/websocket-js/WebSocketMain.swf has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/websocket-js/WebSocketMainInsecure.zip Binary file tweetcast/twisted/client/lib/websocket-js/WebSocketMainInsecure.zip has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/websocket-js/sample.html --- a/tweetcast/twisted/client/lib/websocket-js/sample.html Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ - - - - - Sample of web_socket.js - - - - - - - -
      - - - -
      -
      - diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/client/lib/websocket-js/swfobject.js --- a/tweetcast/twisted/client/lib/websocket-js/swfobject.js Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -/* SWFObject v2.2 - is released under the MIT License -*/ -var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab -// License: New BSD License -// Reference: http://dev.w3.org/html5/websockets/ -// Reference: http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10 - -(function() { - - if (window.WebSocket && !window.WEB_SOCKET_FORCE_FLASH) return; - - var logger; - if (window.WEB_SOCKET_LOGGER) { - logger = WEB_SOCKET_LOGGER; - } else if (window.console && window.console.log && window.console.error) { - // In some environment, console is defined but console.log or console.error is missing. - logger = window.console; - } else { - logger = {log: function(){ }, error: function(){ }}; - } - - // swfobject.hasFlashPlayerVersion("10.0.0") doesn't work with Gnash. - if (swfobject.getFlashPlayerVersion().major < 10) { - logger.error("Flash Player >= 10.0.0 is required."); - return; - } - if (location.protocol == "file:") { - logger.error( - "WARNING: web-socket-js doesn't work in file:///... URL " + - "unless you set Flash Security Settings properly. " + - "Open the page via Web server i.e. http://..."); - } - - /** - * This class represents a faux web socket. - * @param {string} url - * @param {array or string} protocols - * @param {string} proxyHost - * @param {int} proxyPort - * @param {string} headers - */ - WebSocket = function(url, protocols, proxyHost, proxyPort, headers) { - var self = this; - self.__id = WebSocket.__nextId++; - WebSocket.__instances[self.__id] = self; - self.readyState = WebSocket.CONNECTING; - self.bufferedAmount = 0; - self.__events = {}; - if (!protocols) { - protocols = []; - } else if (typeof protocols == "string") { - protocols = [protocols]; - } - // Uses setTimeout() to make sure __createFlash() runs after the caller sets ws.onopen etc. - // Otherwise, when onopen fires immediately, onopen is called before it is set. - self.__createTask = setTimeout(function() { - WebSocket.__addTask(function() { - self.__createTask = null; - WebSocket.__flash.create( - self.__id, url, protocols, proxyHost || null, proxyPort || 0, headers || null); - }); - }, 0); - }; - - /** - * Send data to the web socket. - * @param {string} data The data to send to the socket. - * @return {boolean} True for success, false for failure. - */ - WebSocket.prototype.send = function(data) { - if (this.readyState == WebSocket.CONNECTING) { - throw "INVALID_STATE_ERR: Web Socket connection has not been established"; - } - // We use encodeURIComponent() here, because FABridge doesn't work if - // the argument includes some characters. We don't use escape() here - // because of this: - // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Functions#escape_and_unescape_Functions - // But it looks decodeURIComponent(encodeURIComponent(s)) doesn't - // preserve all Unicode characters either e.g. "\uffff" in Firefox. - // Note by wtritch: Hopefully this will not be necessary using ExternalInterface. Will require - // additional testing. - var result = WebSocket.__flash.send(this.__id, encodeURIComponent(data)); - if (result < 0) { // success - return true; - } else { - this.bufferedAmount += result; - return false; - } - }; - - /** - * Close this web socket gracefully. - */ - WebSocket.prototype.close = function() { - if (this.__createTask) { - clearTimeout(this.__createTask); - this.__createTask = null; - this.readyState = WebSocket.CLOSED; - return; - } - if (this.readyState == WebSocket.CLOSED || this.readyState == WebSocket.CLOSING) { - return; - } - this.readyState = WebSocket.CLOSING; - WebSocket.__flash.close(this.__id); - }; - - /** - * Implementation of {@link DOM 2 EventTarget Interface} - * - * @param {string} type - * @param {function} listener - * @param {boolean} useCapture - * @return void - */ - WebSocket.prototype.addEventListener = function(type, listener, useCapture) { - if (!(type in this.__events)) { - this.__events[type] = []; - } - this.__events[type].push(listener); - }; - - /** - * Implementation of {@link DOM 2 EventTarget Interface} - * - * @param {string} type - * @param {function} listener - * @param {boolean} useCapture - * @return void - */ - WebSocket.prototype.removeEventListener = function(type, listener, useCapture) { - if (!(type in this.__events)) return; - var events = this.__events[type]; - for (var i = events.length - 1; i >= 0; --i) { - if (events[i] === listener) { - events.splice(i, 1); - break; - } - } - }; - - /** - * Implementation of {@link DOM 2 EventTarget Interface} - * - * @param {Event} event - * @return void - */ - WebSocket.prototype.dispatchEvent = function(event) { - var events = this.__events[event.type] || []; - for (var i = 0; i < events.length; ++i) { - events[i](event); - } - var handler = this["on" + event.type]; - if (handler) handler.apply(this, [event]); - }; - - /** - * Handles an event from Flash. - * @param {Object} flashEvent - */ - WebSocket.prototype.__handleEvent = function(flashEvent) { - - if ("readyState" in flashEvent) { - this.readyState = flashEvent.readyState; - } - if ("protocol" in flashEvent) { - this.protocol = flashEvent.protocol; - } - - var jsEvent; - if (flashEvent.type == "open" || flashEvent.type == "error") { - jsEvent = this.__createSimpleEvent(flashEvent.type); - } else if (flashEvent.type == "close") { - jsEvent = this.__createSimpleEvent("close"); - jsEvent.wasClean = flashEvent.wasClean ? true : false; - jsEvent.code = flashEvent.code; - jsEvent.reason = flashEvent.reason; - } else if (flashEvent.type == "message") { - var data = decodeURIComponent(flashEvent.message); - jsEvent = this.__createMessageEvent("message", data); - } else { - throw "unknown event type: " + flashEvent.type; - } - - this.dispatchEvent(jsEvent); - - }; - - WebSocket.prototype.__createSimpleEvent = function(type) { - if (document.createEvent && window.Event) { - var event = document.createEvent("Event"); - event.initEvent(type, false, false); - return event; - } else { - return {type: type, bubbles: false, cancelable: false}; - } - }; - - WebSocket.prototype.__createMessageEvent = function(type, data) { - if (document.createEvent && window.MessageEvent && !window.opera) { - var event = document.createEvent("MessageEvent"); - event.initMessageEvent("message", false, false, data, null, null, window, null); - return event; - } else { - // IE and Opera, the latter one truncates the data parameter after any 0x00 bytes. - return {type: type, data: data, bubbles: false, cancelable: false}; - } - }; - - /** - * Define the WebSocket readyState enumeration. - */ - WebSocket.CONNECTING = 0; - WebSocket.OPEN = 1; - WebSocket.CLOSING = 2; - WebSocket.CLOSED = 3; - - WebSocket.__flash = null; - WebSocket.__instances = {}; - WebSocket.__tasks = []; - WebSocket.__nextId = 0; - - /** - * Load a new flash security policy file. - * @param {string} url - */ - WebSocket.loadFlashPolicyFile = function(url){ - WebSocket.__addTask(function() { - WebSocket.__flash.loadManualPolicyFile(url); - }); - }; - - /** - * Loads WebSocketMain.swf and creates WebSocketMain object in Flash. - */ - WebSocket.__initialize = function() { - if (WebSocket.__flash) return; - - if (WebSocket.__swfLocation) { - // For backword compatibility. - window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation; - } - if (!window.WEB_SOCKET_SWF_LOCATION) { - logger.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf"); - return; - } - if (!window.WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR && - !WEB_SOCKET_SWF_LOCATION.match(/(^|\/)WebSocketMainInsecure\.swf(\?.*)?$/) && - WEB_SOCKET_SWF_LOCATION.match(/^\w+:\/\/([^\/]+)/)) { - var swfHost = RegExp.$1; - if (location.host != swfHost) { - logger.error( - "[WebSocket] You must host HTML and WebSocketMain.swf in the same host " + - "('" + location.host + "' != '" + swfHost + "'). " + - "See also 'How to host HTML file and SWF file in different domains' section " + - "in README.md. If you use WebSocketMainInsecure.swf, you can suppress this message " + - "by WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR = true;"); - } - } - var container = document.createElement("div"); - container.id = "webSocketContainer"; - // Hides Flash box. We cannot use display: none or visibility: hidden because it prevents - // Flash from loading at least in IE. So we move it out of the screen at (-100, -100). - // But this even doesn't work with Flash Lite (e.g. in Droid Incredible). So with Flash - // Lite, we put it at (0, 0). This shows 1x1 box visible at left-top corner but this is - // the best we can do as far as we know now. - container.style.position = "absolute"; - if (WebSocket.__isFlashLite()) { - container.style.left = "0px"; - container.style.top = "0px"; - } else { - container.style.left = "-100px"; - container.style.top = "-100px"; - } - var holder = document.createElement("div"); - holder.id = "webSocketFlash"; - container.appendChild(holder); - document.body.appendChild(container); - // See this article for hasPriority: - // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html - swfobject.embedSWF( - WEB_SOCKET_SWF_LOCATION, - "webSocketFlash", - "1" /* width */, - "1" /* height */, - "10.0.0" /* SWF version */, - null, - null, - {hasPriority: true, swliveconnect : true, allowScriptAccess: "always"}, - null, - function(e) { - if (!e.success) { - logger.error("[WebSocket] swfobject.embedSWF failed"); - } - }); - }; - - /** - * Called by Flash to notify JS that it's fully loaded and ready - * for communication. - */ - WebSocket.__onFlashInitialized = function() { - // We need to set a timeout here to avoid round-trip calls - // to flash during the initialization process. - setTimeout(function() { - WebSocket.__flash = document.getElementById("webSocketFlash"); - WebSocket.__flash.setCallerUrl(location.href); - WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG); - for (var i = 0; i < WebSocket.__tasks.length; ++i) { - WebSocket.__tasks[i](); - } - WebSocket.__tasks = []; - }, 0); - }; - - /** - * Called by Flash to notify WebSockets events are fired. - */ - WebSocket.__onFlashEvent = function() { - setTimeout(function() { - try { - // Gets events using receiveEvents() instead of getting it from event object - // of Flash event. This is to make sure to keep message order. - // It seems sometimes Flash events don't arrive in the same order as they are sent. - var events = WebSocket.__flash.receiveEvents(); - for (var i = 0; i < events.length; ++i) { - WebSocket.__instances[events[i].webSocketId].__handleEvent(events[i]); - } - } catch (e) { - logger.error(e); - } - }, 0); - return true; - }; - - // Called by Flash. - WebSocket.__log = function(message) { - logger.log(decodeURIComponent(message)); - }; - - // Called by Flash. - WebSocket.__error = function(message) { - logger.error(decodeURIComponent(message)); - }; - - WebSocket.__addTask = function(task) { - if (WebSocket.__flash) { - task(); - } else { - WebSocket.__tasks.push(task); - } - }; - - /** - * Test if the browser is running flash lite. - * @return {boolean} True if flash lite is running, false otherwise. - */ - WebSocket.__isFlashLite = function() { - if (!window.navigator || !window.navigator.mimeTypes) { - return false; - } - var mimeType = window.navigator.mimeTypes["application/x-shockwave-flash"]; - if (!mimeType || !mimeType.enabledPlugin || !mimeType.enabledPlugin.filename) { - return false; - } - return mimeType.enabledPlugin.filename.match(/flashlite/i) ? true : false; - }; - - if (!window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION) { - if (window.addEventListener) { - window.addEventListener("load", function(){ - WebSocket.__initialize(); - }, false); - } else { - window.attachEvent("onload", function(){ - WebSocket.__initialize(); - }); - } - } - -})(); diff -r f7ceddf99d6d -r bf5cf5a9e737 tweetcast/twisted/server/tweetcast.py --- a/tweetcast/twisted/server/tweetcast.py Wed Dec 07 19:28:46 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import anyjson -from twisted.enterprise import adbapi -from twisted.internet import reactor, task -from twisted.internet.protocol import Protocol, Factory -from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol - -connectstring = "dbname='tweet_live' user='postgres' host='localhost' password='doiteshimashite'" -columns = [ 'id', 'created_at', 'text', 'user_id', 'screen_name', 'profile_image_url' ] -selectcommon = "SELECT tweet_tweet.id, tweet_tweet.created_at, text, user_id, screen_name, profile_image_url FROM tweet_tweet JOIN tweet_user ON tweet_tweet.user_id = tweet_user.id" -annotations = { - "positive" : '++', - "negative" : '--', - "reference" : '==', - "question" : '??' - } - -dbpool = adbapi.ConnectionPool("psycopg2",connectstring) - -class Tweet: - - def __init__(self, ligne): - self.data = dict((columns[i], str(ligne[i])) for i in range(len(columns))) - self.data['annotations'] = [] - for a in annotations: - n = self.data['text'].count(annotations[a]) - if n: - self.data['annotations'].append({ - "name" : a, - "text" : annotations[a], - "count" : n - }) - - def __repr__(self): - return anyjson.serialize(self.data) - -class TweetCast: - - lastid = 0L - tweets = [] - - def __init__(self): - self.lastid = 0L - self.serverfactory = TweetcastServerFactory(tweetcast=self) - dbpool.runQuery("%s ORDER BY tweet_tweet.id DESC LIMIT 20"%selectcommon).addCallback(self.callbackInit) - - def callbackInit(self, result): - if result: - self.lastid = result[0][0] - for ligne in result: - self.tweets.insert(0, Tweet(ligne)) - print "Requesting older tweets" - task.LoopingCall(self.scheduleTweets).start(1) - - def scheduleTweets(self): - dbpool.runQuery("%s WHERE tweet_tweet.id > %d ORDER BY tweet_tweet.id ASC"%(selectcommon, self.lastid)).addCallback(self.callbackTweets) - - def callbackTweets(self, result): - if result: - self.lastid = result[len(result)-1][0] - newtweets = [ Tweet(ligne) for ligne in result ] - data = { "tweets" : [ tweet.data for tweet in newtweets ] } - self.serverfactory.broadcast(anyjson.serialize(data)) - print "%d new tweets"%len(result) - for tweet in newtweets: - self.tweets.append(tweet) - -class TweetcastServerProtocol(WebSocketServerProtocol): - - def onOpen(self): - self.factory.register(self) - if len(self.factory.tweetcast.tweets): - data = { "tweets" : [ tweet.data for tweet in self.factory.tweetcast.tweets ] } - self.sendMessage(anyjson.serialize(data)) - print "sending %d old tweets to new client"%len(self.factory.tweetcast.tweets) - - def connectionLost(self, reason): - WebSocketServerProtocol.connectionLost(self, reason) - self.factory.unregister(self) - - def onMessage(self, msg, binary): - print "Got message: " + msg - -class TweetcastServerFactory(WebSocketServerFactory): - - protocol = TweetcastServerProtocol - - def __init__(self, tweetcast=None): - WebSocketServerFactory.__init__(self) - self.clients = [] - self.tweetcast = tweetcast - - def register(self, client): - if not client in self.clients: - print "registered client " + client.peerstr - self.clients.append(client) - - def unregister(self, client): - if client in self.clients: - print "unregistered client " + client.peerstr - self.clients.remove(client) - - def broadcast(self, msg): - print "broadcasting ids up to %d" % self.tweetcast.lastid - for c in self.clients: - print "send to " + c.peerstr - c.sendMessage(msg) - -class FlashPolicySocketProtocol(Protocol): - def dataReceived(self, data): - self.transport.write("\0") - -class FlashPolicyFactory(Factory): - def __init__(self): - self.protocol = FlashPolicySocketProtocol; - -tc = TweetCast() -reactor.listenTCP(843, FlashPolicyFactory()) -reactor.listenTCP(9000, tc.serverfactory) -reactor.run() \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 web/client.php --- a/web/client.php Wed Dec 07 19:28:46 2011 +0100 +++ b/web/client.php Wed Dec 14 12:46:53 2011 +0100 @@ -31,12 +31,12 @@ $big_visual_url = URL_ROOT."/$rep/images/big_visuel_rsln_mb.jpg"; if($translate->_('config__client_visual') != 'config__client_visual' && $translate->_('config__client_visual') != null ) { - $big_visual_url = URL_ROOT."$rep/".$translate->_('config__client_visual'); + $big_visual_url = URL_ROOT."$rep/".$translate->_('config__client_visual'); } $head_logo = URL_ROOT."$rep/images/head_logo.gif"; if($translate->_('config__head_logo') != 'config__head_logo' && $translate->_('config__head_logo') != null ) { - $head_logo = URL_ROOT."$rep/".$translate->_('config__head_logo'); + $head_logo = URL_ROOT."$rep/".$translate->_('config__head_logo'); } ?> @@ -48,374 +48,283 @@ Live Video and Annotation - + - - - - - - - + + ' rel='stylesheet' type='text/css'> + ' rel='stylesheet' type='text/css'> + + + + - - - - - - - - ' rel='stylesheet' type='text/css'> - ' rel='stylesheet' type='text/css'> - ' rel='stylesheet' type='text/css'> + + + + + + + + + + - - - - + + + + -
      -
      - - - - - - - -
      - -
      - - - - - - - - - -
      - 0):?> -
      - -
      - -
      - -
      - - -
      - -
      - -
      -
      -
      -
      - _('config__title')); ?>
      -
      -
      _('config__description')); ?>
      - - -
      - - "); - }else{ - echo(""); - } - ?> - +
      -
      - _("Envoyé"); ?>

      -
      - -
      - _("Erreur1"); ?>
       


      -
      - - - - - _("Envoyer"); ?> - - - - - - ++ - -- - == - ?? - -
      - -
      - -
      - - - - - - +
      +
      + +
      + "); + } else { + echo(""); + } + ?> + + + + _("Envoyer"); ?> + + + + + ++ + -- + == + ?? + +
      + +
      +
      +
      +
      +
      + + + +
      +
      +
      + + +
      +
      + _('SearchByPolemic'); ?> :
      +
      +
      +
      +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + + + + + + + + + + 0):?> + + + + +
        +
        +
        + +
        +
          +
        • +

          _('config__title')); ?>

          +
        • +
        • +

          _('config__description')); ?>

          +
        • +
        • +

          _('Tagcloud'); ?>

          +
        • + +
        +
        + + +
        +
        +
        +
        - + \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 web/common.php --- a/web/common.php Wed Dec 07 19:28:46 2011 +0100 +++ b/web/common.php Wed Dec 14 12:46:53 2011 +0100 @@ -185,6 +185,11 @@ 'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js', 'swfobject' => URL_ROOT.'res/metadataplayer/res/js/swfobject.js', 'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js', + 'underscore' => URL_ROOT.'res/underscore/underscore-min.js' , + 'twcx-gevent' => URL_ROOT.'res/js-tweetcast/connect-gevent.js' , + 'twcx-nodejs' => URL_ROOT.'res/js-tweetcast/connect-nodejs.js' , + 'twcx-standalone'=> URL_ROOT.'res/js-tweetcast/connect-standalone.js' , + 'twcx-main' => URL_ROOT.'res/js-tweetcast/live-polemic.js' , ), 'cdn' => array( @@ -200,6 +205,11 @@ 'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js', 'swfobject' => 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', 'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js', + 'underscore' => URL_ROOT.'res/underscore/underscore-min.js' , + 'twcx-gevent' => URL_ROOT.'res/js-tweetcast/connect-gevent.js' , + 'twcx-nodejs' => URL_ROOT.'res/js-tweetcast/connect-nodejs.js' , + 'twcx-standalone'=> URL_ROOT.'res/js-tweetcast/connect-standalone.js' , + 'twcx-main' => URL_ROOT.'res/js-tweetcast/live-polemic.js' , ) ); @@ -228,6 +238,7 @@ 'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css', 'jquery-ui' => URL_ROOT.'res/metadataplayer/res/css/jq-css/themes/base/jquery-ui.css', 'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css', + 'tweetcast' => URL_ROOT.'res/css/tweetcast.css' ), 'cdn' => array( 'blueprint-screen' => URL_ROOT.'res/blueprint/screen.css', @@ -238,6 +249,7 @@ 'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css', 'jquery-ui' => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css", 'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css', + 'tweetcast' => URL_ROOT.'res/css/tweetcast.css' ) ); diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/arrow.png Binary file web/res/css/twcx-img/arrow.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/arrowtop.png Binary file web/res/css/twcx-img/arrowtop.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/bgd.jpg Binary file web/res/css/twcx-img/bgd.jpg has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/bgdeplie.png Binary file web/res/css/twcx-img/bgdeplie.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/bgnoarrow.png Binary file web/res/css/twcx-img/bgnoarrow.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/head_logo.gif Binary file web/res/css/twcx-img/head_logo.gif has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/menu_underline.gif Binary file web/res/css/twcx-img/menu_underline.gif has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/placeholder.png Binary file web/res/css/twcx-img/placeholder.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/scale.png Binary file web/res/css/twcx-img/scale.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/twcx-img/searchcancel.png Binary file web/res/css/twcx-img/searchcancel.png has changed diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/css/tweetcast.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/res/css/tweetcast.css Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,448 @@ +/* Browser-reset CSS */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} + +img a { + border: none; +} + +body { + font-family: 'PT Sans', Helvetica, Arial, sans-serif; background-color: #F7F6F6; background-image: url("twcx-img/bgd.jpg"); background-repeat: repeat-x; +} + +h2, h3, h4 { + font-family: 'PT Sans Narrow', Helvetica, Arial, sans-serif; +} + +p { + font-size: 12px; +} + +b { + font-weight: bold; +} + +i { + font-style: italic; +} + +.highlight { + background: #ffff00; +} + +.hidden { + display: none; +} + +/* feedback */ + +#sendUsFeedBack { + position: absolute; right: 0; top: 0; width: 100px; z-index: 999999; +} + +#container { + width: 960px; margin: 0 auto; +} + +#colgauche { + float: left; width: 455px; margin-right: 13px; +} + +.barre { + float: left; width: 100%; +} + +.greyed { + color: #999; font-style: italic; +} + +.rechercheCourante { + background: #ffa0ff; font-weight: bold; color: #000080; +} + + +/* Menu */ + +#headlogo { + float: left; margin-right: 10px; +} + +.menu { + border-left: 1px solid #C3C3C3; + float: left; + list-style: none; + font-size: 12px; + height: 62px; overflow: hidden; +} + +.menu li { + background: url("twcx-img/menu_underline.gif") left bottom no-repeat; + padding: 3px 0 0 5px; + height: 18px; + min-width: 80px; +} + +.menu a { + color: #000000; text-decoration: none; +} + +.menu a:hover { + color: #0099FF; +} + +/* Formulaire */ + +#twwWrap { + float: left; width: 450px; background: #ffffff; padding: 1px; border-width: 1px; border-style: solid solid none solid; border-color: #ababab; margin-top: 6px; +} +#tweetWriter { + width: 430px; padding: 10px; background: #efefef; +} +.loginbutton{ + margin: 10px auto; height: 60px; width: 330px; padding:5px; + background: url(../../images/tweetWriterBgdUnconnect.gif) no-repeat; + border: none; color:#fff; +} +.loginlink{ + text-decoration:none; + color:#fff; +} +textarea { + display: block; margin: 10px auto; height: 60px; width: 330px; padding:5px; + background: url(../../images/tweetWriterBgdTxtArea.gif) no-repeat; + border: none; resize: none; +} + +a#sendTweet { + background: transparent url('../../images/bg_button_a_w.png') no-repeat top right; + color: #444; display: block; font-size: 12px; height: 24px; line-height: 14px; + float:right; margin: 0 45px 0 50px; padding: 0 18px 0 0; text-decoration: none; +} +a#sendTweet span { + background: transparent url('../../images/bg_button_span_w.png') no-repeat; display: block; height: 14px; + padding: 5px 0 5px 18px; +} +a#sendTweet:hover, a#sendTweet:active { + background-position: right -24px; +} +a#sendTweet:hover span, a#sendTweet:active span { + background-position: 0 -24px; +} +a.tweetButton { + float:right; margin: 2px 5px 0 0; width:32px; height:20px; text-decoration: none; font: normal 12px; + color: #444; text-align:center; cursor: pointer; cursor: hand; +} + +#question { + background: transparent url('../../images/bt_blue.png') no-repeat; +} +#reference{ + background: transparent url('../../images/bt_yellow.png') no-repeat; +} +#positive{ + background: transparent url('../../images/bt_green.png') no-repeat; +} +#negative{ + background: transparent url('../../images/bt_red.png') no-repeat; +} + +#tweetCounter{ + float: left; background: transparent; border: none;font-weight:bold; margin: 2px 0 0 42px; padding: 0; +} +.tweetCounterNegative{ + color:red; +} + +/* Liste de Tweets */ + +#tweetviz { + float: left; width: 452px; border: 1px solid #999; +} + +/* Recherche */ + +#recherche { + position: relative; float: left; padding: 2px 0; width: 452px; border-bottom: 1px solid #999; +} + +#recherche input { + float: left; +} + +#inp_q { + width: 236px; border: none; padding: 1px; margin-left: 2px; height: 17px; font-size: 13px; +} + +#inp_submit, #inp_reset { + border: 0; padding: 0; width: 20px; height: 20px; overflow: hidden; text-indent: 800px; background: url(twcx-img/searchcancel.png) +} + +#inp_submit:hover { + background-position: -20px 0; +} + +#inp_submit:active { + background-position: -40px 0; +} + +#inp_reset { + background-position: 0 -20px; +} + +#inp_reset:hover { + background-position: -20px -20px; +} + +#inp_reset:active { + background-position: -40px -20px; +} + +#time_legende { + float: left; margin-left: 30px; width: 30px; height: 20px; background: url(twcx-img/scale.png) left; +} + +#time_scale { + float: left; font-size: 12px; margin: 3px 0 0; color: #666; width: 50px; text-align: center; +} + +#time_zoomout, #time_zoomin { + float: left; width: 12px; height: 20px; background: url(twcx-img/scale.png); +} + +#time_zoomout { + background-position: -30px; +} + +#time_zoomout.inactive { + background-position: -54px; +} + +#time_zoomin { + background-position: -42px; +} + +#time_zoomin.inactive { + background-position: -66px; +} + +#recherche_annot { + position: absolute; top: 20px; z-index: 4; background: #ffffff; border: 1px solid #ccc; padding: 4px; font-size: 12px; + display: none; box-shadow: 2px 2px 2px rgba(0, 0, 0, .5) +} + +#recherche_annot a { + padding: 1px; line-height: 13px; margin: 1px; font-weight: bold; text-decoration: none; color: #000000; +} + +/* Liste des tweets */ + +#tweetlist { + float: left; width: 280px; height: 480px; list-style: none; border-right: 1px solid #999; color: #585858; cursor: pointer; cursor: hand; background: #ffffff; +} + +#tweetlist a { + text-decoration: none; color: #1985B5; +} + +#tweetlist a:hover { + text-decoration: underline; color: #105060; +} + +li.tweet, li.placeholder { + border-bottom : 1px dotted; overflow: hidden; float: left; border-color: #ccc; +} + +li.tweet { + position: relative; background: #fff; +} + +li.full { + width: 270px; height: 117px; border-right: 10px solid #ff0; +} + +li.half { + width: 280px; height: 46px; +} + +li.icons { + width: 20px; height: 20px; border: none; +} + +li.placeholder { + visibility: hidden; +} + +.tweet p { + overflow: hidden; +} + +.full p.tweet_text { + font-size: 12px; margin: 5px 0 5px 58px; height: 108px; width: 207px; color: #000000; +} + +.half p.tweet_text { + font-size: 11px; margin: 5px 0 5px 49px; height: 36px; line-height: 12px; width: 216px; +} + +div.around_img { + float: left; +} + +.full .profile_image { + margin: 5px 5px 0 5px; width: 48px; height: 48px; +} + +.half .profile_image { + margin: 5px; width: 36px; height: 36px; +} + +.icons .profile_image { + margin: 2px; width: 16px; height: 16px; +} + +p.created_at { + font-size: 12px; text-align: center; font-style: italic; color: #999999; width: 58px; overflow: hidden; +} + +.annotations { + position: absolute; margin: 0; padding: 0; top: 0; left: 0; width: 100%; height: 100%; +} + +.icons .annotations { + position: absolute; width: 20px; height: 6px; left: 0; top: 16px; z-index: 3; +} + +div.annotation { + float: left; height: 100%; +} + +div.twmain { + position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; overflow: hidden; +} + +div.tweet_actions { + position: absolute; bottom : 2px; right: 4px; font-size: 11px; +} + +/* timeline */ + +#timeline { + float: left; height: 480px; width: 150px; border-right: 1px solid #999; cursor: pointer; cursor: hand; +} + +#scrollcont { + float: left; width: 20px; height: 480px; overflow: auto; +} + +#scrollin { + width: 1px; height: 8000px; +} + +/* hovertweet */ + +#hovertweet { + position: absolute; display: none; margin: -20px 0 0 15px; z-index: 12; +} + +div.full { + position: absolute; background: #eeeeee; width: 270px; height: 84px; border: 1px solid #808080; border-radius: 3px; box-shadow: 5px 5px 5px rgba(0,0,0,.3); +} + +#hoverarrow { + position: absolute; width: 10px; height: 18px; left: -9px; top: 13px; background: url(twcx-img/arrow.png); +} + +/* Colonne de droite */ + +#coldroite { + float: left; width: 492px; +} + +#vlWrap { + float: left; border: 5px solid #ffffff; background: #999999; padding: 1px; margin-top: 70px; +} + +#videoLivePlayer { + width: 480px; height: 320px; background: #000000; +} + +#out_fleche { + float: left; position: relative; width: 492px; height: 14px; background: url(twcx-img/bgnoarrow.png); +} + +#in_fleche { + position: absolute; left: 10px; width: 27px; height: 15px; background: url(twcx-img/arrowtop.png); +} + +#accordeon { + float: left; width: 492px; list-style: none; background: #999999; +} + +#accordeon h3 { + font-size: 16px; font-weight: bold; color: #666; +} + +#accordeon p { + margin: 5px 0; line-height: 1.5em; +} + +#accordeon li { + float: left; width: 480px; margin: 0 1px 1px 1px; padding: 4px; border: 1px solid #ffffff; +} + +li.acctitre { + background: #efefef; cursor: pointer; cursor: hand; +} + +li.acctexte { + background: url(twcx-img/bgdeplie.png) top repeat-x #efefef; +} + +/* Tag Cloud */ + +#motscles { + text-align: center; +} + +#motscles span { + padding: 2px; cursor: pointer; cursor: hand; +} + +/* Footer */ +.footer { + float: left; width: 100%; margin: 40px 0 10px; text-align: center; +} + +hr { + background: #cccccc; border: none; height: 1px; margin: 0 0 10px; width: 100%; +} + +a.footerLink { + text-decoration:none; margin:5px; color: #000000; + font-family: 'PT Sans Narrow', Arial, Helvetica, sans-serif; font-size: 13px; +} + +a.footerLink:hover { + color: #0099FF; +} + + diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/js-tweetcast/connect-gevent.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/res/js-tweetcast/connect-gevent.js Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,14 @@ +function connectTweets() { + $.getJSON('http://' + document.location.hostname + ':8888/?callback=?', function(data) { + loadTweets(data.tweets) + } ); + + setInterval(function() { + if (!twCx.tweets) { + return; + } + $.getJSON('http://' + document.location.hostname + ':8888/?after_id=' + twCx.tweets[twCx.tweets.length - 1].id + '&callback=?', function(data) { + loadTweets(data.tweets, true); + }); + }, 1000) +} \ No newline at end of file diff -r f7ceddf99d6d -r bf5cf5a9e737 web/res/js-tweetcast/connect-nodejs.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/res/js-tweetcast/connect-nodejs.js Wed Dec 14 12:46:53 2011 +0100 @@ -0,0 +1,16 @@ +document.write('