--- a/web/client.php Fri Dec 16 10:39:51 2011 +0100
+++ b/web/client.php Fri Dec 16 15:57:23 2011 +0100
@@ -39,322 +39,6 @@
$head_logo = URL_ROOT."$rep/".$translate->_('config__head_logo');
}
-?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html lang="<?php echo($actual); ?>">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Live Video and Annotation</title>
- <meta http-equiv="X-UA-Compatible" content="IE=9" />
-
- <!-- FONT -->
- <link href='<?php echo(registry_url('PT-Sans_Narrow','font'))?>' rel='stylesheet' type='text/css'>
- <link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
-
- <!-- CSS -->
- <link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" type="text/css" media="screen">
- <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>" type="text/css" media="screen, projection"/>
-
- <!-- JAVASCRIPT -->
- <script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
- <script type="text/javascript" src="<?php echo(registry_url('jquery-mousewheel','js'))?>"></script>
- <script type="text/javascript" src="<?php echo(registry_url('jquery-scrollto','js'))?>"></script>
- <script type="text/javascript" src="<?php echo(registry_url('underscore','js'))?>"></script>
- <script type="text/javascript" src="<?php echo(registry_url('raphael','js'))?>"></script>
- <script type="text/javascript" src="<?php echo(registry_url('fancybox','js'))?>"></script>
-
- <script type="text/javascript" src="<?php echo(registry_url('twcx-standalone','js'))?>"></script>
- <script type="text/javascript" src="<?php echo(registry_url('twcx-main','js'))?>"></script>
- <script type="text/javascript" src="config.js"></script>
-
- <script type="text/javascript">
- l10n = { "rechercher" : "<?php echo $translate->_('Rechercher'); ?>" }
-
- function add_grammar(value) {
- var _st = $('#status'),
- _val = _st.val();
- _st.val( _val + ( _val[_val.length - 1] == " " ? "" : " " ) + value ).change();
- }
-
- $(document).ready(function() {
-
- setTimeout(function() {
- $.scrollTo(70, 1000);
- }, 2000);
-
- $("#accordeon li.acctitre").click(function() {
- $("#accordeon li.acctexte").slideToggle();
- })
-
- //$("txt").hide();
- $(".loginbutton").click(function() {
- document.location.href="<?php echo(URL_ROOT.$rep); ?>/client.php?CONNECT=true";
- });
- $("#IDENTIFIER").click(function() {
- document.location.href="<?php echo(URL_ROOT.$rep); ?>/client.php?CONNECT=true";
- });
-
- // BUTTONS
- $(".tweetButton").click(function() {
- add_grammar($(this).text());
- })
-
- // SEND TWEETS
- $("#sendTweet").click(function(){
- var MyStatus = $('#status').val();
- $.post('tweet_ajax.php', {status:MyStatus}
- ,function(data) {
-
- if(data=="true"){
- $("#messageSuccess").show('fast');
- $("#messageSuccess").delay(800).hide('slow');
- $('#status').val("<?php echo($config['hashtag']); ?>");
- $('#status').change();
- }else{
- $("#error").text(data);
- $("#messageFailed").show('fast');
- $("#messageFailed").delay(800).hide('slow');
- }
-
- });
-
- });
-
- $("#status").bind("change keyup paste blur focus",function() {
- newval = 140-$("#status").val().length;
- $('#tweetCounter').val(newval);
- if(newval < 0) {
- $('#tweetCounter').addClass("tweetCounterNegative");
- }
- else {
- $('#tweetCounter').removeClass("tweetCounterNegative");
- }
- });
-
-
- $("#Program").fancybox({
- 'width' : '75%',
- 'height' : '75%',
- 'autoScale' : false,
- 'transitionIn' : 'none',
- 'transitionOut' : 'none',
- 'type' : 'iframe'
- });
-
-
- });
-
- //<!-- LIMIT TEXTAREA:
- function imposemax(obj) {
- obj.value = obj.value.substr(0,140);
- };
- // End -->
-
- </script>
-
- <script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-23581291-1']);
- _gaq.push(['_trackPageview']);
- _gaq.push(['_setAllowAnchor', true]);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
-
- </script>
-
- </head>
- <body>
- <div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>
+include dirname(__FILE__). ( ( isset($config['use_tweetcast']) && $config['use_tweetcast'] ) ? '/client_new.php' : '/client_old.php' )
- <div id="container">
- <div id="colgauche">
- <div class="barre">
- <img id="headlogo" src="<?php echo($head_logo); ?>" width="171" height="63" />
- <div id="minilogo"></div>
- <ul class="menu">
- <li>
- <a href="<?php echo(URL_ROOT); ?>" class="menuLink">
- <?php print $translate->_("Accueil"); ?>
- </a>
- </li>
- <li>
- <a href="<?php echo($translate->_('config__link')); ?>" class="menuLink" target="_blank" id='Program'>
- <?php print $translate->_("Programme"); ?>
- </a>
- </li>
- <li>
- <a href="../about.php" class="menuLink" >
- <?php print $translate->_("A propos"); ?>
- </a>
- </li>
- </ul>
- <ul class="menu">
- <li>
- <a href="<?php URL_ROOT ?>client.php?lang=ja_JP" class="menuLink" >
- <img src='<?php echo(URL_ROOT); ?>images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
- <?php print $translate->_("Japonais"); ?>
- </a></li>
- <li>
- <a href="<?php URL_ROOT ?>client.php?lang=fr" class="menuLink">
- <img src='<?php echo(URL_ROOT); ?>images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
- <?php print $translate->_("Français"); ?>
- </a>
- </li>
- <li>
- <a href="<?php URL_ROOT ?>client.php?lang=en" class="menuLink">
- <img src='<?php echo(URL_ROOT); ?>images/flag_en.gif' <?php if($actual!="en"){echo("style='opacity: .5;'"); } ?> />
- <?php print $translate->_("Anglais"); ?>
- </a>
- </li>
- </ul>
- </div>
- <div id="twwWrap">
- <div id="tweetWriter">
- <h3 class="tweetWriterTitle"><?php print $translate->_("ClientTitle1 :"); ?></h3>
- <form action="tweet.php" method="post" id="statusform" >
- <?php if (!isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
- echo("<div class='loginbutton'><a href='".URL_ROOT."$rep/client.php?CONNECT=true' class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</a></div>");
- } else {
- echo("<textarea name='status' id='status' rows='3' cols='50' onkeypress='imposemax(this);'>$config[hashtag]</textarea>");
- }
- ?>
- <div id="messageSuccess" style="background-color:lightgreen; display: none;">
- <?php print $translate->_("Envoyé"); ?><br/><br/>
- </div>
- <div id="messageFailed" style="background-color:red; display: none;">
- <?php print $translate->_("Erreur1"); ?><div id="error"> </div><br/><br/>
- </div>
- <a href="#" id="sendTweet" >
- <span><?php print $translate->_("Envoyer"); ?></span>
- </a>
- <?php if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])): ?>
- <input id="tweetCounter" value="<?php echo(140-strlen($config['hashtag']));?>" disabled="disabled" size="3"/>
- <?php endif;?>
- <a id="positive" title="<?php echo $translate->_('Agree'); ?>" class="tweetButton">++</a>
- <a id="negative" title="<?php echo $translate->_('Disagree'); ?>" class="tweetButton">--</a>
- <a id="reference" title="<?php echo $translate->_('Reference'); ?>" class="tweetButton">==</a>
- <a id="question" title="<?php echo $translate->_('Question'); ?>" class="tweetButton"> ??</a>
-
- <div style="clear: both;"></div>
- </form>
- </div>
- </div>
- <div id="tweetviz">
- <div class="barre">
- <form id="recherche">
- <input autocomplete="off" class="greyed" id="inp_q" value="<?php echo $translate->_('Rechercher'); ?>" />
- <input id="inp_submit" type="submit" />
- <input id="inp_reset" type="reset" />
- <div id="time_controls">
- <div id="time_legende"></div>
- <div id="time_scale"></div>
- <a href="#" id="time_zoomout"></a>
- <a href="#" id="time_zoomin"></a>
- </div>
- <div id="recherche_annot">
- <?php echo $translate->_('SearchByPolemic'); ?> : <span id="rech_list_annot"></span><br />
- </div>
- </form>
- </div>
- <ul id="tweetlist"></ul>
- <div id="timeline"></div>
- <div id="scrollcont">
- <div id="scrollin"></div>
- </div>
- </div>
- </div>
- <div id="coldroite">
- <div id="vlWrap">
- <div id="videoLivePlayer">
- <?php if ($config['islive']):?>
- <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="480" height="320">
- <param name="movie" value="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf" />
- <param name="allowfullscreen" value="true" />
- <param name="allowscriptaccess" value="always" />
- <param name="wmode" value="transparent" />
- <param name="flashvars" value="autostart=true&live=true&image=<?php echo($big_visual_url); ?>&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&controlbar=none&autostart=true" />
- <embed
- type="application/x-shockwave-flash"
- id="player2"
- name="player2"
- src="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf"
- width="480"
- height="320"
- allowscriptaccess="always"
- allowfullscreen="true"
- wmode="transparent"
- flashvars="autostart=true&live=true&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&image=<?php echo($big_visual_url); ?>&controlbar=none&autostart=true"
- />
- </object>
- <?php elseif(isset($config['islive_embed']) && count($config['islive_embed'])>0):?>
- <?php echo($config['islive_embed']); ?>
- <?php else: ?>
- <img src="<?php echo($big_visual_url); ?>" width="480" height="320" />
- <?php endif; ?>
- </div>
- </div>
- <div id="out_fleche">
- <!-- <div id="in_fleche"></div> -->
- </div>
- <ul id="accordeon">
- <li class="acctitre">
- <h3><?php echo($translate->_('config__title')); ?></h3>
- </li>
- <li class="acctexte">
- <p><?php echo($translate->_('config__description')); ?></p>
- </li>
- <li class="acctitre">
- <h3><?php echo($translate->_('keywords')); ?></h3>
- </li>
- <li class="acctexte hidden">
- <div class="accsubtitle">
- <div class="aroundsubtitle">
- <h4><?php echo($translate->_('suggested')); ?></h4>
- </div>
- </div>
- <div class="tagcloud" id="suggkw"></div>
- </li>
- <li class="acctexte hidden">
- <div class="accsubtitle">
- <div class="aroundsubtitle">
- <h4><?php echo($translate->_('contextual')); ?></h4>
- </div>
- </div>
- <div class="tagcloud" id="motscles"></div>
- </li>
- <li class="acctitre">
- <h3>
- <a href="../sweet-tweet" target="_blank">Visualisation par thèmes "Sweet Tweets"</a>
- </h3>
- </li>
- </ul>
- </div>
- <div class="footer">
- <hr />
- <?php
- echo($translate->_('config__partenaires'));
-
- if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
- echo("| <a href='clear.php' class='footerLink'>".$translate->_("Déconnexion")."</a>");
- }
- ?>
- </div>
- </div>
- <div id="hovertweet">
- <div id="hovercontent"></div>
- <div id="hoverarrow"></div>
- </div>
- <ul id="hoverkw">
- <li><a id="hkwsearch" href="#"><?php echo $translate->_('Rechercher'); ?></a></li>
- <li><a id="hkwtweet" href="#"><?php echo $translate->_('addToTweet'); ?></a></li>
- </ul>
- </body>
-</html>
\ No newline at end of file
+?>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/client_new.php Fri Dec 16 15:57:23 2011 +0100
@@ -0,0 +1,320 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+
+<html lang="<?php echo($actual); ?>">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Live Video and Annotation</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=9" />
+
+ <!-- FONT -->
+ <link href='<?php echo(registry_url('PT-Sans_Narrow','font'))?>' rel='stylesheet' type='text/css'>
+ <link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
+
+ <!-- CSS -->
+ <link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" type="text/css" media="screen">
+ <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>" type="text/css" media="screen, projection"/>
+
+ <!-- JAVASCRIPT -->
+ <script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('jquery-mousewheel','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('jquery-scrollto','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('underscore','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('raphael','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('fancybox','js'))?>"></script>
+
+ <script type="text/javascript">
+ <?php echo $config['js_config']; ?>
+ </script>
+ <script type="text/javascript" src="<?php echo(registry_url('twcx-main','js'))?>"></script>
+
+ <script type="text/javascript">
+ l10n = { "rechercher" : "<?php echo $translate->_('Rechercher'); ?>" }
+
+ function add_grammar(value) {
+ var _st = $('#status'),
+ _val = _st.val();
+ _st.val( _val + ( _val[_val.length - 1] == " " ? "" : " " ) + value ).change();
+ }
+
+ $(document).ready(function() {
+
+ setTimeout(function() {
+ $.scrollTo(70, 1000);
+ }, 2000);
+
+ $("#accordeon h3").click(function() {
+ console.log("click");
+ $("li.acctexte").slideToggle();
+ return false;
+ })
+
+ //$("txt").hide();
+ $(".loginbutton").click(function() {
+ document.location.href="<?php echo(URL_ROOT.$rep); ?>/client.php?CONNECT=true";
+ });
+ $("#IDENTIFIER").click(function() {
+ document.location.href="<?php echo(URL_ROOT.$rep); ?>/client.php?CONNECT=true";
+ });
+
+ // BUTTONS
+ $(".tweetButton").click(function() {
+ add_grammar($(this).text());
+ })
+
+ // SEND TWEETS
+ $("#sendTweet").click(function(){
+ var MyStatus = $('#status').val();
+ $.post('tweet_ajax.php', {status:MyStatus}
+ ,function(data) {
+
+ if(data=="true"){
+ $("#messageSuccess").show('fast');
+ $("#messageSuccess").delay(800).hide('slow');
+ $('#status').val("<?php echo($config['hashtag']); ?>");
+ $('#status').change();
+ }else{
+ $("#error").text(data);
+ $("#messageFailed").show('fast');
+ $("#messageFailed").delay(800).hide('slow');
+ }
+
+ });
+
+ });
+
+ $("#status").bind("change keyup paste blur focus",function() {
+ newval = 140-$("#status").val().length;
+ $('#tweetCounter').val(newval);
+ if(newval < 0) {
+ $('#tweetCounter').addClass("tweetCounterNegative");
+ }
+ else {
+ $('#tweetCounter').removeClass("tweetCounterNegative");
+ }
+ });
+
+
+ $("#Program").fancybox({
+ 'width' : '75%',
+ 'height' : '75%',
+ 'autoScale' : false,
+ 'transitionIn' : 'none',
+ 'transitionOut' : 'none',
+ 'type' : 'iframe'
+ });
+
+
+ });
+
+ //<!-- LIMIT TEXTAREA:
+ function imposemax(obj) {
+ obj.value = obj.value.substr(0,140);
+ };
+ // End -->
+
+ </script>
+
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-23581291-1']);
+ _gaq.push(['_trackPageview']);
+ _gaq.push(['_setAllowAnchor', true]);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+
+ </head>
+ <body>
+ <div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>
+
+ <div id="container">
+ <div id="colgauche">
+ <div class="barre">
+ <img id="headlogo" src="<?php echo($head_logo); ?>" width="171" height="63" />
+ <div id="minilogo"></div>
+ <ul class="menu">
+ <li>
+ <a href="<?php echo(URL_ROOT); ?>" class="menuLink">
+ <?php print $translate->_("Accueil"); ?>
+ </a>
+ </li>
+ <li>
+ <a href="<?php echo($translate->_('config__link')); ?>" class="menuLink" target="_blank" id='Program'>
+ <?php print $translate->_("Programme"); ?>
+ </a>
+ </li>
+ <li>
+ <a href="../about.php" class="menuLink" >
+ <?php print $translate->_("A propos"); ?>
+ </a>
+ </li>
+ </ul>
+ <ul class="menu">
+ <li>
+ <a href="<?php URL_ROOT ?>client.php?lang=ja_JP" class="menuLink" >
+ <img src='<?php echo(URL_ROOT); ?>images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
+ <?php print $translate->_("Japonais"); ?>
+ </a></li>
+ <li>
+ <a href="<?php URL_ROOT ?>client.php?lang=fr" class="menuLink">
+ <img src='<?php echo(URL_ROOT); ?>images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
+ <?php print $translate->_("Français"); ?>
+ </a>
+ </li>
+ <li>
+ <a href="<?php URL_ROOT ?>client.php?lang=en" class="menuLink">
+ <img src='<?php echo(URL_ROOT); ?>images/flag_en.gif' <?php if($actual!="en"){echo("style='opacity: .5;'"); } ?> />
+ <?php print $translate->_("Anglais"); ?>
+ </a>
+ </li>
+ </ul>
+ </div>
+ <div id="twwWrap">
+ <div id="tweetWriter">
+ <h3 class="tweetWriterTitle"><?php print $translate->_("ClientTitle1 :"); ?></h3>
+ <form action="tweet.php" method="post" id="statusform" >
+ <?php if (!isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
+ echo("<div class='loginbutton'><a href='".URL_ROOT."$rep/client.php?CONNECT=true' class='loginlink'>".$translate->_("Vous n'êtes pas connecté.")."</a></div>");
+ } else {
+ echo("<textarea name='status' id='status' rows='3' cols='50' onkeypress='imposemax(this);'>$config[hashtag]</textarea>");
+ }
+ ?>
+ <div id="messageSuccess" style="background-color:lightgreen; display: none;">
+ <?php print $translate->_("Envoyé"); ?><br/><br/>
+ </div>
+ <div id="messageFailed" style="background-color:red; display: none;">
+ <?php print $translate->_("Erreur1"); ?><div id="error"> </div><br/><br/>
+ </div>
+ <a href="#" id="sendTweet" >
+ <span><?php print $translate->_("Envoyer"); ?></span>
+ </a>
+ <?php if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])): ?>
+ <input id="tweetCounter" value="<?php echo(140-strlen($config['hashtag']));?>" disabled="disabled" size="3"/>
+ <?php endif;?>
+ <a id="positive" title="<?php echo $translate->_('Agree'); ?>" class="tweetButton">++</a>
+ <a id="negative" title="<?php echo $translate->_('Disagree'); ?>" class="tweetButton">--</a>
+ <a id="reference" title="<?php echo $translate->_('Reference'); ?>" class="tweetButton">==</a>
+ <a id="question" title="<?php echo $translate->_('Question'); ?>" class="tweetButton"> ??</a>
+
+ <div style="clear: both;"></div>
+ </form>
+ </div>
+ </div>
+ <div id="tweetviz">
+ <div class="barre">
+ <form id="recherche">
+ <input autocomplete="off" class="greyed" id="inp_q" value="<?php echo $translate->_('Rechercher'); ?>" />
+ <input id="inp_submit" type="submit" />
+ <input id="inp_reset" type="reset" />
+ <div id="time_controls">
+ <div id="time_legende"></div>
+ <div id="time_scale"></div>
+ <a href="#" id="time_zoomout"></a>
+ <a href="#" id="time_zoomin"></a>
+ </div>
+ <div id="recherche_annot">
+ <?php echo $translate->_('SearchByPolemic'); ?> : <span id="rech_list_annot"></span><br />
+ </div>
+ </form>
+ </div>
+ <ul id="tweetlist"></ul>
+ <div id="timeline"></div>
+ <div id="scrollcont">
+ <div id="scrollin"></div>
+ </div>
+ </div>
+ </div>
+ <ul id="onglets">
+ <li class="selected">Vidéo</li>
+ <li>Tweet Wall</li>
+ <li>Graphe des contributeurs</li>
+ </ul>
+ <div id="coldroite">
+ <div id="vlWrap">
+ <div id="videoLivePlayer">
+ <?php if ($config['islive']):?>
+ <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="480" height="320">
+ <param name="movie" value="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf" />
+ <param name="allowfullscreen" value="true" />
+ <param name="allowscriptaccess" value="always" />
+ <param name="wmode" value="transparent" />
+ <param name="flashvars" value="autostart=true&live=true&image=<?php echo($big_visual_url); ?>&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&controlbar=none&autostart=true" />
+ <embed
+ type="application/x-shockwave-flash"
+ id="player2"
+ name="player2"
+ src="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf"
+ width="480"
+ height="320"
+ allowscriptaccess="always"
+ allowfullscreen="true"
+ wmode="transparent"
+ flashvars="autostart=true&live=true&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&image=<?php echo($big_visual_url); ?>&controlbar=none&autostart=true"
+ />
+ </object>
+ <?php elseif(isset($config['islive_embed']) && count($config['islive_embed'])>0):?>
+ <?php echo($config['islive_embed']); ?>
+ <?php else: ?>
+ <img src="<?php echo($big_visual_url); ?>" width="480" height="320" />
+ <?php endif; ?>
+ </div>
+ </div>
+ <div id="out_fleche">
+ <!-- <div id="in_fleche"></div> -->
+ </div>
+ <ul id="accordeon">
+ <li class="acctitre">
+ <h3><?php echo($translate->_('config__title')); ?></h3>
+ </li>
+ <li class="acctexte">
+ <p><?php echo($translate->_('config__description')); ?></p>
+ </li>
+ <li class="acctitre">
+ <h3><?php echo($translate->_('keywords')); ?></h3>
+ </li>
+ <li class="acctexte hidden">
+ <div class="accsubtitle">
+ <div class="aroundsubtitle">
+ <h4><?php echo($translate->_('suggested')); ?></h4>
+ </div>
+ </div>
+ <div class="tagcloud" id="suggkw"></div>
+ </li>
+ <li class="acctexte hidden">
+ <div class="accsubtitle">
+ <div class="aroundsubtitle">
+ <h4><?php echo($translate->_('contextual')); ?></h4>
+ </div>
+ </div>
+ <div class="tagcloud" id="motscles"></div>
+ </li>
+ </ul>
+ </div>
+ <div class="footer">
+ <hr />
+ <?php
+ echo($translate->_('config__partenaires'));
+
+ if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
+ echo("| <a href='clear.php' class='footerLink'>".$translate->_("Déconnexion")."</a>");
+ }
+ ?>
+ </div>
+ </div>
+ <div id="hovertweet">
+ <div id="hovercontent"></div>
+ <div id="hoverarrow"></div>
+ </div>
+ <ul id="hoverkw">
+ <li><a id="hkwsearch" href="#"><?php echo $translate->_('Rechercher'); ?></a></li>
+ <li><a id="hkwtweet" href="#"><?php echo $translate->_('addToTweet'); ?></a></li>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/client_old.php Fri Dec 16 15:57:23 2011 +0100
@@ -0,0 +1,378 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+
+<html lang="<?php echo($actual); ?>">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Live Video and Annotation</title>
+ <meta http-equiv="X-UA-Compatible" content="IE=8" />
+
+ <!-- Framework CSS -->
+ <link rel="stylesheet" href="<?php echo(registry_url('blueprint-screen','css'));?>" type="text/css" media="screen, projection"/>
+ <link rel="stylesheet" href="<?php echo(registry_url('blueprint-print','css'));?>" type="text/css" media="print"/>
+ <!--[if lt IE 8]><link rel="stylesheet" href="<?php echo(registry_url('blueprint-ie','css'));?>" type="text/css" media="screen, projection"><![endif]-->
+ <link rel="stylesheet" href="<?php echo(registry_url('blueprint-plugins-fancy-type','css'));?>" type="text/css" media="screen, projection"/>
+ <link rel="stylesheet" href="<?php echo(registry_url('custom','css'));?>" type="text/css" media="screen, projection"/>
+ <link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" type="text/css" media="screen">
+
+ <!-- JAVASCRIPT -->
+ <script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('fancybox','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('jquery-tools','js'))?>"></script>
+ <script type="text/javascript" src="<?php echo(registry_url('tw-widget','js'))?>"></script>
+
+ <!-- FONT -->
+ <link href='<?php echo(registry_url('PT-Sans_Narrow','font'))?>' rel='stylesheet' type='text/css'>
+ <link href='<?php echo(registry_url('PT-Sans','font'))?>' rel='stylesheet' type='text/css'>
+ <link href='<?php echo(registry_url('Geo','font'))?>' rel='stylesheet' type='text/css'>
+
+ <script type="text/javascript">
+ $(document).ready(function() {
+
+ doTimer();
+ //$("txt").hide();
+ $(".loginbutton").click(function() {
+ document.location.href="<?php echo(URL_ROOT.$rep); ?>/client.php?CONNECT=true";
+ });
+ $("#IDENTIFIER").click(function() {
+ document.location.href="<?php echo(URL_ROOT.$rep); ?>/client.php?CONNECT=true";
+ });
+
+ $("#messageSuccess").hide();
+ $("#messageFailed").hide();
+
+
+ function add_grammar(value) {
+ $('#status').val($('#status').val()+value+" ");
+ $('#status').change();
+ }
+
+ // BUTTONS
+ $("#positive").click(function(){
+ add_grammar("++");
+ });
+ $("#negative").click(function(){
+ add_grammar("--");
+ });
+ $("#reference").click(function(){
+ add_grammar("==");
+ });
+ $("#question").click(function(){
+ add_grammar("??");
+ });
+
+ // SEND TWEETS
+ $("#sendTweet").click(function(){
+ var MyStatus = $('#status').val();
+ $.post('tweet_ajax.php', {status:MyStatus}
+ ,function(data) {
+
+ if(data=="true"){
+ $("#messageSuccess").show('fast');
+ $("#messageSuccess").delay(800).hide('slow');
+ $('#status').val("<?php echo($config['hashtag']); ?>");
+ $('#status').change();
+ }else{
+ $("#error").text(data);
+ $("#messageFailed").show('fast');
+ $("#messageFailed").delay(800).hide('slow');
+ }
+
+ });
+
+ });
+
+ $("#status").bind("change keyup paste blur focus",function() {
+ newval = 140-$("#status").val().length;
+ $('#tweetCounter').val(newval);
+ if(newval < 0) {
+ $('#tweetCounter').addClass("tweetCounterNegative");
+ }
+ else {
+ $('#tweetCounter').removeClass("tweetCounterNegative");
+ }
+ });
+
+ $(".timeFrame").tooltip();
+ /*
+ * Lightbox button
+ */
+
+ $("#Program").fancybox({
+ 'width' : '75%',
+ 'height' : '75%',
+ 'autoScale' : false,
+ 'transitionIn' : 'none',
+ 'transitionOut' : 'none',
+ 'type' : 'iframe'
+ });
+
+ $("#ACCES").click(function() {
+ $.fancybox.close();
+ });
+
+ // Buttons
+
+
+ });
+
+ //<!-- LIMIT TEXTAREA:
+ function imposemax(Object) {
+ return (Object.value.length <= 140);
+ };
+ // End -->
+
+ //<!-- TIMER
+ var c=0;
+ var t;
+ var timer_is_on=0;
+
+ function timedCount()
+ {
+ document.getElementById('txt').value=c;
+ c = c+1;
+ t = window.setTimeout("timedCount()",1000);
+ $(".twtr-ft").hide();
+ $(".twtr-hd").hide();
+ //twtr-tweet
+ $(".twtr-tweet").each(colorTweetings);
+
+ }
+
+ function colorTweetings (){
+ var tweettemp = $(this).html();
+ if (tweettemp.search(/\x3F\x3F/)!=-1){
+ $(this).css({'background-color': '#bfdbec','color':"#000"});
+ }
+ if (tweettemp.search(/\x2B\x2B/)!=-1){
+ $(this).css({'background-color': '#c5e7cd','color':"#fff"});
+ }
+ if (tweettemp.search(/\x2D\x2D/)!=-1){
+ $(this).css({'background-color': '#f6ced0','color':"#fff"});
+ }
+ if (tweettemp.search(/\x3D\x3D/)!=-1){
+ $(this).css({'background-color': '#ecedc1','color':"#000"});
+ }
+ };
+
+
+
+ function doTimer()
+ {
+ if (!timer_is_on)
+ {
+ timer_is_on=1;
+ timedCount();
+ }
+ }
+
+ function stopCount()
+ {
+ clearTimeout(t);
+ timer_is_on=0;
+ }
+ //
+ //-->
+ </script>
+
+ <script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-23581291-1']);
+ _gaq.push(['_trackPageview']);
+ _gaq.push(['_setAllowAnchor', true]);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+ </script>
+
+ </head>
+ <body>
+ <div id="sendUsFeedBack"><a href="<?php echo($C_feedback_form_url); ?>" target="_blank"><img src="<?php echo(URL_ROOT); ?>images/sendusfeedback.png"></a></div>
+ <div class="container">
+ <img src="<?php echo($head_logo); ?>" class="Producteur logo">
+ <div id="minilogo" style="height:5px;top:5px;"></div>
+ <ul class="menu">
+ <li class="menuUnderline"><a href="<?php echo(URL_ROOT); ?>" class="menuLink">
+ <?php print $translate->_("Accueil"); ?> </a></li>
+ <li class="menuUnderline" ><a href="<?php echo($translate->_('config__link')); ?>" class="menuLink" target="_blank" id='Program'>
+ <?php print $translate->_("Programme"); ?></a></li>
+ <li ><a href="../about.php" class="menuLink" >
+ <?php print $translate->_("A propos"); ?></a></li>
+
+ </ul>
+
+ <ul class="menu" >
+ <li class="menuUnderline"><a href="<?php URL_ROOT ?>client.php?lang=ja_JP" class="menuLink" >
+ <img src='<?php echo(URL_ROOT); ?>images/flag_jp.gif'<?php if($actual!="ja_JP"){echo("style='opacity: .5;'"); } ?> />
+ <?php print $translate->_("Japonais"); ?></a></li>
+ <li class="menuUnderline"><a href="<?php URL_ROOT ?>client.php?lang=fr" class="menuLink">
+ <img src='<?php echo(URL_ROOT); ?>images/flag_fr.gif' <?php if($actual!="fr"){echo("style='opacity: .5;'"); } ?> />
+ <?php print $translate->_("Français"); ?></a></li>
+ <li ><a href="<?php URL_ROOT ?>client.php?lang=en" class="menuLink">
+ <img src='<?php echo(URL_ROOT); ?>images/flag_en.gif' <?php if($actual!="en"){echo("style='opacity: .5;'"); } ?> />
+ <?php print $translate->_("Anglais"); ?></a></li>
+ </ul>
+
+
+ <div class="videoLive">
+ <?php if ($config['islive']):?>
+ <div class="videoLivePlayer">
+ <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="500" height="375">
+ <param name="movie" value="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf" />
+ <param name="allowfullscreen" value="true" />
+ <param name="allowscriptaccess" value="always" />
+ <param name="wmode" value="transparent" />
+ <param name="flashvars" value="autostart=true&live=true&image=<?php echo($big_visual_url); ?>&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&controlbar=none&autostart=true" />
+ <embed
+ type="application/x-shockwave-flash"
+ id="player2"
+ name="player2"
+ src="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf"
+ width="500"
+ height="375"
+ allowscriptaccess="always"
+ allowfullscreen="true"
+ wmode="transparent"
+ flashvars="autostart=true&live=true&provider=rtmp&streamer=rtmp://media.iri.centrepompidou.fr/ddc_player/&file=livestream&image=<?php echo($big_visual_url); ?>&controlbar=none&autostart=true"
+
+ />
+ </object>
+
+ </div>
+ <?php elseif(isset($config['islive_embed']) && count($config['islive_embed'])>0):?>
+ <div class="videoLivePlayer">
+ <?php echo($config['islive_embed']); ?>
+ </div>
+ <?php else: ?>
+ <div class="videoLivePlayer">
+ <img src="<?php echo($big_visual_url); ?>" width="500" height="375" />
+ </div>
+ <?php endif; ?>
+
+ </div>
+
+ <div class="videoLiveProgram">
+
+ <div class="arrowContainer">
+ <div class="arrow"> </div>
+ </div>
+ <div class="videoLiveProgramTitle">
+ <b><?php echo($translate->_('config__title')); ?></b></div>
+ <div class="videoLiveProgramDescription">
+ <br><?php echo($translate->_('config__description')); ?></div>
+
+
+ </div>
+
+ <div class="tweetWriter">
+ <h3 class="tweetWriterTitle"><?php print $translate->_("ClientTitle1 :"); ?></h3>
+ <form action="tweet.php" method="post" id="statusform" >
+ <?php if (!isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
+ echo("<div class='loginbutton' ><a href='".URL_ROOT."$rep/client.php?CONNECT=true' class='loginlink'>
+ ".$translate->_("Vous n'êtes pas connecté.")."</a></div>");
+ }else{
+ echo("<textarea name='status' id='status' rows='3' cols='50' onkeypress='return imposemax(this);'>$config[hashtag]</textarea>");
+ }
+ ?>
+
+
+ <div id="messageSuccess" style="background-color:lightgreen;">
+ <?php print $translate->_("Envoyé"); ?><br><br>
+ </div>
+
+ <div id="messageFailed" style="background-color:red;">
+ <?php print $translate->_("Erreur1"); ?><div id="error"> </div><br/><br>
+ </div>
+
+
+
+ <a class="button_w" href="#" id="sendTweet" style="float:right;margin-right:15px;margin-left:35px;width:70px;" >
+ <span><?php print $translate->_("Envoyer"); ?></span>
+ </a>
+ <!--<button name="s" type="button" id="sendTweet"
+ style="float:right;margin-right:15px;margin-left:35px;width:70px;" >Envoyer</button>-->
+ <?php if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])): ?>
+ <input id="tweetCounter" value="<?php echo(140-strlen($config['hashtag']));?>" disabled="disabled" size="3"/>
+ <?php endif;?>
+ <a
+
+ id="positive"
+ title="accord"
+ class="tweetButton">++</a>
+ <a
+
+ id="negative"
+ title="désaccord"
+ class="tweetButton">--</a>
+ <a
+
+ id="reference"
+ title="reference"
+ class="tweetButton">==</a>
+ <a
+
+ id="question"
+ title="question"
+ class="tweetButton"> ??</a>
+ </form>
+ </div>
+
+ <div class="tweetReader">
+ <script>
+ new TWTR.Widget({
+ version: 2,
+ type: 'search',
+ search: '<?php echo($config['hashtag']); ?>',
+ interval: 3000,
+ title: '',
+ subject: '',
+ width: 377,
+ height: 450,
+ theme: {
+ shell: {
+ background: '#ffffff',
+ color: '#ffffff'
+ },
+ tweets: {
+ background: '#ffffff',
+ color: '#444444',
+ links: '#1985b5'
+ }
+ },
+ features: {
+ scrollbar: true,
+ loop: false,
+ live: true,
+ hashtags: true,
+ timestamp: true,
+ avatars: true,
+ toptweets: true,
+ behavior: 'all'
+ }
+ }).render().start();
+ </script>
+ </div>
+
+ <div class="footer">
+ <hr>
+ <?php
+ echo($translate->_('config__partenaires'));
+
+ if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
+ echo("| <a href='clear.php' class='footerLink'>".$translate->_("Déconnexion")."</a>");
+ }
+ ?>
+ <input type="hidden" id="txt"/>
+
+ </div>
+
+
+ </div>
+
+ </body>
+</html>
--- a/web/common.php Fri Dec 16 10:39:51 2011 +0100
+++ b/web/common.php Fri Dec 16 15:57:23 2011 +0100
@@ -187,9 +187,6 @@
'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js',
'underscore' => URL_ROOT.'res/underscore/underscore-min.js' ,
'jquery-scrollto'=>URL_ROOT.'res/jquery.scrollto/jquery.scrollTo-1.4.2-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' ,
),
@@ -208,9 +205,6 @@
'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js',
'underscore' => URL_ROOT.'res/underscore/underscore-min.js' ,
'jquery-scrollto'=>URL_ROOT.'res/jquery.scrollto/jquery.scrollTo-1.4.2-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' ,
)
--- a/web/config.js.tmpl Fri Dec 16 10:39:51 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-var tracking_keywords = [ "#rsln" ],
- suggested_keywords = [
- "confiance",
- "croyance",
- "crédit",
- "trace",
- "foi",
- "risque",
- "assurance",
- "démocratie",
- "expertise",
- "catastrophe",
- "transparence",
- "politique"
- ],
- 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
- }
- }
- }
--- a/web/enmi2011/config.php Fri Dec 16 10:39:51 2011 +0100
+++ b/web/enmi2011/config.php Fri Dec 16 15:57:23 2011 +0100
@@ -69,4 +69,67 @@
'div_height' => 700,
'player_width' => 650,
'player_height' => 488,
+
+ // New Tweet live parameters
+ 'use_tweetcast' => true,
+ 'js_config' => "
+ var connect_type = 'standalone',
+ source_address = 'http://velt.info/polemic/tweetdata.js',
+ tracking_keywords = [ \"#enmi\" ],
+ suggested_keywords = [
+ \"confiance\",
+ \"croyance\",
+ \"crédit\",
+ \"trace\",
+ \"foi\",
+ \"risque\",
+ \"assurance\",
+ \"démocratie\",
+ \"expertise\",
+ \"catastrophe\",
+ \"transparence\",
+ \"politique\"
+ ],
+ annotations = {
+ \"default\" : {
+ \"colors\" : {
+ \"h\" : 0,
+ \"s\" : 0
+ }
+ },
+ \"positive\" : {
+ \"display_name\" : \"++\",
+ \"keywords\" : [ /\\+\\+/ ],
+ \"colors\" : {
+ \"h\" : .3,
+ \"s\" : .65
+ }
+ },
+ \"negative\" : {
+ \"display_name\" : \"--\",
+ \"keywords\" : [ /\\-\\-/ ],
+ \"colors\" : {
+ \"h\" : 0,
+ \"s\" : .8
+ }
+ },
+ \"reference\" : {
+ \"display_name\" : \"==\",
+ \"keywords\" : [ /\\=\\=/ ],
+ \"colors\" : {
+ \"h\" : .16,
+ \"s\" : .8
+ }
+ },
+ \"question\" : {
+ \"display_name\" : \"??\",
+ \"keywords\" : [ /\\?\\?/ ],
+ \"colors\" : {
+ \"h\" : .6,
+ \"s\" : .8
+ }
+ }
+ }"
+
+
);
\ No newline at end of file
Binary file web/res/css/twcx-img/bg_onglet.png has changed
--- a/web/res/css/tweetcast.css Fri Dec 16 10:39:51 2011 +0100
+++ b/web/res/css/tweetcast.css Fri Dec 16 15:57:23 2011 +0100
@@ -379,12 +379,27 @@
/* Colonne de droite */
+#onglets {
+ float: left; width: 441px; margin: 43px 25px 0; list-style: none;
+ border-left: 1px solid #999;
+}
+
+#onglets li {
+ float: left; text-transform: uppercase; background: url(twcx-img/bg_onglet.png) repeat-x;
+ line-height: 12px; font-size: 12px; height: 12px; padding: 6px 10px; font-weight: bold;
+ border: 1px #999; border-style: solid solid solid none; margin-top: 1px;
+}
+
+#onglets li.selected {
+ background-position: 0 -22px; padding-bottom: 8px; border-bottom: none; margin-top: 0;
+}
+
#coldroite {
float: left; width: 492px;
}
#vlWrap {
- float: left; border: 5px solid #ffffff; background: #999999; padding: 1px; margin-top: 70px;
+ float: left; border: 5px solid #ffffff; background: #999999; padding: 1px;
}
#videoLivePlayer {
@@ -449,6 +464,7 @@
li.acctexte {
background: url(twcx-img/bgdeplie.png) top repeat-x #efefef;
+ max-height: 228px; overflow: auto;
}
/* Tag Cloud */
--- a/web/res/js-tweetcast/connect-gevent.js Fri Dec 16 10:39:51 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-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
--- a/web/res/js-tweetcast/connect-nodejs.js Fri Dec 16 10:39:51 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-document.write('<script type="text/javascript" src="/socket.io/socket.io.js"><' + '/script>');
-
-function connectTweets() {
- socket = io.connect('http://' + document.location.host );
-
- socket.on("initial_data", function(data) {
- loadTweets(data.tweets)
- });
-
- socket.on("update", function(data) {
- if (!twCx.tweets) {
- return;
- }
- loadTweets(data.new_tweets, true);
- });
-}
\ No newline at end of file
--- a/web/res/js-tweetcast/connect-standalone.js Fri Dec 16 10:39:51 2011 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-function connectTweets() {
- $.getScript("http://velt.info/polemic/tweetdata.js");
-}
--- a/web/res/js-tweetcast/live-polemic.js Fri Dec 16 10:39:51 2011 +0100
+++ b/web/res/js-tweetcast/live-polemic.js Fri Dec 16 15:57:23 2011 +0100
@@ -1034,3 +1034,43 @@
}, 100)
});
+if (connect_type == "socketio") {
+ document.write('<script type="text/javascript" src="' + source_address + '/socket.io/socket.io.js"><' + '/script>');
+}
+
+function connectTweets() {
+ switch (connect_type) {
+ case "socketio" :
+ socket = io.connect( source_address );
+ socket.on("initial_data", function(data) {
+ loadTweets(data.tweets)
+ });
+ socket.on("update", function(data) {
+ if (!twCx.tweets) {
+ return;
+ }
+ loadTweets(data.new_tweets, true);
+ });
+ break;
+
+ case "gevent" :
+ $.getJSON( source_address + '/?callback=?', function(data) {
+ loadTweets(data.tweets)
+ } );
+
+ setInterval(function() {
+ if (!twCx.tweets) {
+ return;
+ }
+ $.getJSON( source_address + '/?after_id=' + twCx.tweets[twCx.tweets.length - 1].id + '&callback=?', function(data) {
+ loadTweets(data.tweets, true);
+ });
+ }, 1000);
+ break;
+
+ case "standalone" :
+ $.getScript( source_address );
+ }
+}
+
+
--- a/web/sweet-tweet/index.html Fri Dec 16 10:39:51 2011 +0100
+++ b/web/sweet-tweet/index.html Fri Dec 16 15:57:23 2011 +0100
@@ -9,10 +9,11 @@
<script type="text/javascript" src="lib/underscore-min.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
- <body>
+ <body class="nuit">
<div id="container">
<div id="tweetcont">
</div>
+ <img id="ptimg" src="pt_logo.gif" />
<div id="columncont"></div>
<div id="logos">
<img class="fl" src="logo_enmi.png" />
Binary file web/sweet-tweet/pt_logo.gif has changed
--- a/web/sweet-tweet/script.js Fri Dec 16 10:39:51 2011 +0100
+++ b/web/sweet-tweet/script.js Fri Dec 16 15:57:23 2011 +0100
@@ -1,12 +1,10 @@
-var AVATARWIDTH = 35,
- COLUMNWIDTH = 2,
- COLUMNHEIGHT = 420,
- THRESHOLD = 24,
+var THRESHOLD = 12,
DROPCOUNT = 12;
var swTw = {
"keyword" : "#enmi",
"columns_words" : [
+ "politique",
"confiance",
"croyance",
"crédit",
@@ -17,58 +15,57 @@
"démocratie",
"expertise",
"catastrophe",
- "transparence",
- "politique"
+ "transparence"
],
"tweets" : [],
"tweetsIndex" : [],
+ "twInCol" : [],
"firstDisplayedTweet" : 0,
"cursor" : -1,
-/* "annotations" : {
+ "annotations" : {
"positive" : {
"keyword" : "+",
"colors" : {
"tweet" : "#c5e7cd",
- "timeline" : "#00ff00"
+ "timeline" : "#1D973D"
}
},
"negative" : {
"keyword" : "-",
"colors" : {
"tweet" : "#f6ced0",
- "timeline" : "#ff0000"
+ "timeline" : "#CE0A15"
}
},
"reference" : {
- "keyword" : "#",
+ "keyword" : " #",
"colors" : {
"tweet" : "#efefa1",
- "timeline" : "#ffff00"
+ "timeline" : "#C5A62D"
}
},
"question" : {
"keyword" : "?",
"colors" : {
"tweet" : "#bfdbec",
- "timeline" : "#0000ff"
+ "timeline" : "#036AAE"
}
}
-} */
+ }
}
-function highlightKeyword(stra, strb) {
+function highlightKeyword(stra, strb, color) {
var rgxp = RegExp( '(' + strb.replace(/(\W)/gm, '\\$1') + ')', "gim");
- return stra.replace(rgxp, '<span class="highlight">$1</span>');
+ return stra.replace(rgxp, '<span class="highlight" style="background:' + color + ';">$1</span>');
}
function highlightText(txt) {
- var res = highlightKeyword(txt, swTw.keyword);
res = swTw.columns_words.reduce(function(a, b) {
- return highlightKeyword(a,b);
+ return highlightKeyword(a,b, '#333333');
+ }, txt);
+ res = _(swTw.annotations).reduce(function(a, b) {
+ return (b.keyword ? highlightKeyword(a,b.keyword,b.colors.timeline) : a);
}, res);
-/* res = _(swTw.annotations).reduce(function(a, b) {
- return (b.keyword ? highlightKeyword(a,b.keyword) : a);
- }, res); */
return res;
}
@@ -78,31 +75,21 @@
}
if (swTw.cursor < swTw.tweets.length - 1) {
swTw.cursor = Math.max(swTw.cursor + 1, swTw.tweets.length - 120);
- var nTweet = swTw.cursor;
+ var tweet = swTw.tweets[swTw.cursor],
+ html = '<img src="'
+ + tweet.profile_image_url
+ + '" /><p>@'
+ + tweet.from_user
+ + ' ('
+ + tweet.from_user_name
+ + ')'
+ + '</p><p class="tweet_text">'
+ + highlightText(tweet.text)
+ + '</p>';
+ $("#tweetcont").html(html)
} else {
- var nTweet = swTw.tweets.length - 1 - ~~( Math.random() * Math.min(swTw.tweets.length,50) );
+ $("#tweetcont").html("")
}
- var tweet = swTw.tweets[nTweet];
- $("#tweetcont").html('<img src="'
- + tweet.profile_image_url
- + '" /><p>@'
- + tweet.from_user
- + ' ('
- + tweet.from_user_name
- + ')'
- + '</p><p class="tweet_text">'
- + highlightText(tweet.text)
- + '</p>');
-/* var bgcolor = '';
- for (var i in swTw.annotations) {
- if (swTw.annotations[i].keyword) {
- if (tweet.text.indexOf(swTw.annotations[i].keyword) != -1) {
- bgcolor = swTw.annotations[i].colors.tweet;
- break;
- }
- }
- } */
- $("#tweetcont").css("background",bgcolor);
}
function dropOldTweets() {
@@ -112,26 +99,15 @@
return _(col).without(tweet.id_str);
});
_(tweet.elements).each(function(elid) {
- $("#" + elid).fadeOut(2000, function() {
+ $("#" + elid).animate({
+ "width": "0px"
+ },
+ 2000,
+ function() {
$(this).detach();
- });
+ })
});
});
-
- _(swTw.tweets.slice(_newPos)).each(function(tweet) {
- _(tweet.elements).each(function(elid) {
- var iword = parseInt(elid.split('_')[2]),
- iel = swTw.twInCol[iword].indexOf(tweet.id_str),
- posx = COLUMNHEIGHT - AVATARWIDTH * (1 + ~~( iel / COLUMNWIDTH)),
- posy = AVATARWIDTH * (iel % COLUMNWIDTH);
- $("#" + elid).delay(500).animate({
- "top" : posy + "px",
- "left" : posx + "px"
- },
- 500);
- });
- });
- console.log("fin");
swTw.firstDisplayedTweet = _newPos;
}
@@ -144,36 +120,30 @@
tweet.elements = [];
_(tweet.columns).each(function(word) {
var iword = swTw.columns_words.indexOf(word),
- tcl = swTw.twInCol[iword],
- tclen = tcl.length;
- var posx = COLUMNHEIGHT - AVATARWIDTH * (1 + ~~( tclen / COLUMNWIDTH)),
- posy = AVATARWIDTH * (tclen % COLUMNWIDTH),
+ icol = ( swTw.twInCol[iword*2+1].length < swTw.twInCol[iword*2].length ? iword*2+1 : iword*2 ),
elid = 'avatar_' + tweet.id_str + '_' + iword,
- bgcolor = '#999999';
-/* for (var i in swTw.annotations) {
- if (swTw.annotations[i].keyword) {
- if (tweet.text.indexOf(swTw.annotations[i].keyword) != -1) {
- bgcolor = swTw.annotations[i].colors.timeline;
- break;
- }
- }
- } */
- $('#column_' + iword).append(
+ colA = swTw.colAnnot[iword],
+ ttl = 0;
+ _(swTw.annotations).each(function(v,k) {
+ if (tweet.text.indexOf(v.keyword) != -1) {
+ colA[k]++;
+ ttl++;
+ }
+ });
+ colA.total += Math.max(1,ttl);
+ $('#tube_' + icol).append(
'<div class="avatar" id="'
+ elid
- + '" style="left: -200px; top: '
- + posy
- + 'px; background: '
- + bgcolor
- + '"><img src="'
+ + '" style="margin-right: 500px;"><img src="'
+ tweet.profile_image_url
+ '" /></div>'
);
tweet.elements.push(elid);
- tcl.push(tweet.id_str);
+ swTw.twInCol[icol].push(tweet.id_str);
$("#" + elid).animate({
- "left" : posx + "px"
- }, 2000);
+ "margin-right" : "0px"
+ },
+ 2000);
})
swTw.tweets.push(tweet);
swTw.tweetsIndex.push(tweet.id_str);
@@ -183,6 +153,11 @@
})) {
dropOldTweets();
}
+ _(swTw.colAnnot).each(function(colA, i) {
+ _(swTw.annotations).each(function(v, k) {
+ $("#polemic_" + i + "_" + k).css("width", ~~(100 * colA[k] / colA.total) + "%");
+ });
+ })
}
function retrieveTweets() {
@@ -191,7 +166,7 @@
"lang" : "fr",
// "keyword" : "#enmi",
"pages" : 1,
- "rpp" : 50,
+ "rpp" : 100,
"cbEnd" : function() {
callbackTweets(this.tweets);
}
@@ -240,20 +215,42 @@
function(mot, i) {
return '<div class="column" id="column_'
+ i
- + '"><div class="column-tube"></div><div class="column-title"><h3>'
+ + '"><div class="column-tube"><div class="tube" id="tube_'
+ + (2*i)
+ + '"></div><div class="tube" id="tube_'
+ + (2*i+1)
+ + '"></div></div><div class="column-title">'
+ + _(swTw.annotations).map(function(v,k) {
+ return '<div class="polemicvol" id="polemic_'
+ + i
+ + '_'
+ + k
+ + '" style="background:'
+ + v.colors.timeline
+ + '"></div>'
+ }).join('')
+ +'<h3>'
+ mot
+ '</h3></div></div>'
}
).join("") );
-
- swTw.twInCol = swTw.columns_words.map(function() {
- return [];
+
+ for (var i = 0; i < swTw.columns_words.length * 2; i++) {
+ swTw.twInCol.push([]);
+ }
+
+ swTw.colAnnot = swTw.columns_words.map(function() {
+ var res = { "total" : 0 }
+ _(swTw.annotations).map(function(v,k) {
+ res[k] = 0;
+ });
+ return res;
});
retrieveTweets();
- setInterval(retrieveTweets,5000);
+ setInterval(retrieveTweets, 5000);
- setInterval(nextTweet, 3000);
+ setInterval(nextTweet, 6000);
});
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/web/sweet-tweet/small.html Fri Dec 16 15:57:23 2011 +0100
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="fr">
+ <head>
+ <meta charset="utf-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+ <title>Sweet Tweet</title>
+ <style type="text/css">
+ body {
+ margin: 0; background: #000000;
+ }
+ #aroundtw {
+ margin: 0 auto; width: 400px; height: 640px; overflow: hidden;
+ }
+ #tweetwall {
+ -moz-transform: scale(.5);
+ -moz-transform-origin: top left;
+ -webkit-transform: scale(.5);
+ -webkit-transform-origin: top left;
+ -ms-transform: scale(.5);
+ -ms-transform-origin: top left;
+ width: 800px;
+ height: 1280px;
+ border: none;
+ padding: 0; margin: 0;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="aroundtw">
+ <iframe id="tweetwall" src="index.html"></iframe>
+ </div>
+
+ </body>
+</html>
\ No newline at end of file
--- a/web/sweet-tweet/style.css Fri Dec 16 10:39:51 2011 +0100
+++ b/web/sweet-tweet/style.css Fri Dec 16 15:57:23 2011 +0100
@@ -2,12 +2,20 @@
margin: 0; font-family: Helvetica, Arial, sans-serif;
}
+body.jour {
+ background: #ffffff;
+}
+
+body.nuit {
+ background: #000000;
+}
+
img {
border: none;
}
.highlight {
- background: #ffff80;
+ font-weight: bold; padding: 0 2px; color: #ffffff;
}
#container {
@@ -15,52 +23,73 @@
height: 1280px;
margin: 0 auto;
position: relative;
+ overflow: hidden;
}
#tweetcont {
- float: left; width: 780px; height: 72px; background: #dddddd;
- padding: 15px 10px;
+ float: left; width: 760px; height: 96px; background: #dddddd;
+ padding: 20px;
}
#tweetcont img {
- float: left; width: 72px; height: 72px;
+ float: left; width: 96px; height: 96px;
}
#tweetcont p {
- margin: -2px 5px 10px 82px; padding: 0; font-size: 18px;
+ margin: -2px 5px 10px 106px; padding: 0; font-size: 20px;
}
p.tweet_text {
color: #666;
}
+#ptimg {
+ position: absolute; top: -5px; right: -10px;
+}
+
#columncont {
float: left; width: 800px; margin-top: 20px;
}
.column {
- float: left; width: 780px; height: 70px; margin: 8px 10px; overflow: hidden; position: relative;
+ float: left; width: 780px; height: 70px; margin: 8px 10px; position: relative;
}
.column-tube {
- float: left; width: 420px; height: 70px; background: #eeeeee;
+ float: left; width: 420px; height: 70px;
+}
+
+.tube {
+ width: 1000px; height: 35px; margin-left: -580px; overflow: hidden;
}
.column-title {
- float: left; margin-left: 10px; width: 350px; height: 70px; background: #eeeeee;
+ float: left; margin-left: 10px; width: 350px; height: 70px;
+}
+
+.polemicvol {
+ float: right; height: 70px;
}
.column-title h3 {
- margin: 10px; padding: 0; font-size: 40px; line-height: 50px;
- height: 50px; text-transform: uppercase; color: #666;
+ position: absolute; margin: 10px; padding: 0; font-size: 40px; line-height: 50px;
+ height: 50px; text-transform: uppercase;
}
+.jour .column-tube, .jour .column-title {
+ background: #cccccc; color: #ffffff;
+}
+
+.nuit .column-tube, .nuit .column-title {
+ background: #eeeeee; color: #000000;
+}
+
div.avatar {
- display: block; position: absolute; width: 35px; height: 35px; z-index: 2;
+ float: right; width: 35px; height: 35px; overflow: hidden;
}
.avatar img {
- width: 35px; height: 35px;
+ width: 100%; height: 100%;
}
div#logos {