--- a/web/client.php Tue Nov 17 12:15:00 2015 +0100
+++ b/web/client.php Wed Nov 18 15:39:05 2015 +0100
@@ -50,6 +50,8 @@
$_SESSION['TWITTER_REDIRECT_URL'] = isset($_REQUEST['auth_redirect']) ? $_REQUEST['auth_redirect'] : $_SERVER['HTTP_REFERER'];
};
+$annotations = get_default_annotations_config($config, $translate);
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
@@ -63,7 +65,7 @@
<!-- 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'));?>?v=210512" type="text/css" media="screen, projection"/>
@@ -78,7 +80,7 @@
<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
if (isset($config['tracking_keywords']) && count($config['tracking_keywords'])) {
@@ -88,64 +90,33 @@
}
?>
<?php if (isset($config['suggested_keywords'])) echo "var suggested_keywords = ".json_encode($config['suggested_keywords']).";"; ?>
- <?php if (isset($config['js_config'])) echo $config['js_config']; ?>
+ <?php if (isset($config['js_config'])) echo "\n".$config['js_config']."\n"; ?>
l10n = { "rechercher" : "<?php echo $translate->_('Rechercher'); ?>" }
- var annotations = {
- "default" : {
- "colors" : {
- "h" : 0,
- "s" : 0
- }
- },
- "positive" : {
- "display_name" : "++ | <?php echo $translate->_('Agree'); ?>",
- "keywords" : [ /\+\+/ ],
- "colors" : {
- "h" : .3,
- "s" : .65
- }
- },
- "negative" : {
- "display_name" : "-- | <?php echo $translate->_('Disagree'); ?>",
- "keywords" : [ /\-\-/ ],
- "colors" : {
- "h" : 0,
- "s" : .8
- }
- },
- "reference" : {
- "display_name" : "== | <?php echo $translate->_('Reference'); ?>",
- "keywords" : [ /\=\=/ ],
- "colors" : {
- "h" : .16,
- "s" : .8
- }
- },
- "question" : {
- "display_name" : "?? | <?php echo $translate->_('Question'); ?>",
- "keywords" : [ /\?\?/ ],
- "colors" : {
- "h" : .6,
- "s" : .8
+ if (typeof annotations == "undefined" || !annotations) {
+ var annotations = JSON.parse("<?php echo addslashes(json_encode($annotations)); ?>");
+ for(var annot_cat in annotations) {
+ if("keywords" in annotations[annot_cat]) {
+ annotations[annot_cat]['keywords'] = [ new RegExp(annotations[annot_cat]['keywords']), ];
}
}
}
+ console.log(annotations);
</script>
<?php if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])) { ?>
<script type="text/javascript" src="<?php echo(registry_url('twcx-main','js'))?>"></script>
<?php } ?>
<script type="text/javascript">
-
+
function add_grammar(value) {
var _st = $('#status'),
_val = _st.val();
_st.val( _val + ( _val[_val.length - 1] == " " ? "" : " " ) + value ).change();
}
-
+
$(document).ready(function() {
-
-
+
+
function updateCounter() {
var _v = $("#status").val();
if (_v.length > 140) {
@@ -167,19 +138,19 @@
}
});
}
-
+
// BUTTONS
$(".tweetButton").click(function() {
add_grammar($(this).find('span.twbSyntax').text());
updateCounter();
})
-
+
// 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');
@@ -190,15 +161,15 @@
$("#messageFailed").show('fast');
$("#messageFailed").delay(800).hide('slow');
}
-
+
});
-
+
});
-
+
$("#status").bind("change keyup paste blur focus",updateCounter);
-
-
+
+
$("#Program").fancybox({
'width' : '75%',
'height' : '75%',
@@ -215,7 +186,7 @@
'transitionOut' : 'none',
'type' : 'iframe'
});
-
+
$("#onglets a").click(function() {
$("div.ifwrap").hide();
$("#onglets li").removeClass("selected");
@@ -229,7 +200,7 @@
}
return false;
});
-
+
});
@@ -248,30 +219,30 @@
// 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<?php if ($embed) { echo ' class="embed"'; } ?>>
<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="coldroite">
-
+
<div class="embedbar">
<a class="embedbutton" href="<?php echo(URL_ROOT.$rep)?>/live_embed_form.php">Intégrer</a>
<!-- AddThis Button BEGIN -->
@@ -332,7 +303,7 @@
<?php
}
?>
-
+
</div>
<div class="ifwrap hidden" id="iframeWrap">
<iframe id="graphFrame"></iframe>
@@ -439,34 +410,26 @@
<a href="#" id="sendTweet" >
<span><?php print $translate->_("Envoyer"); ?></span>
</a>
- <a id="positive" title="++ | <?php echo $translate->_('Agree'); ?>" class="tweetButton twbGreen">
- <span class="twbSyntax">++</span>
- <span class="twbSeparator">|</span>
- <span class="twbLabel"><?php echo $translate->_('Agree'); ?></span>
- </a>
- <a id="negative" title="-- | <?php echo $translate->_('Disagree'); ?>" class="tweetButton twbRed">
- <span class="twbSyntax">--</span>
- <span class="twbSeparator">|</span>
- <span class="twbLabel"><?php echo $translate->_('Disagree'); ?></span>
- </a>
- <a id="reference" title="== | <?php echo $translate->_('Reference'); ?>" class="tweetButton twbYellow">
- <span class="twbSyntax">==</span>
- <span class="twbSeparator">|</span>
- <span class="twbLabel"><?php echo $translate->_('Reference'); ?></span>
- </a>
- <a id="question" title="?? | <?php echo $translate->_('Question'); ?>" class="tweetButton twbBlue">
- <span class="twbSyntax">??</span>
- <span class="twbSeparator">|</span>
- <span class="twbLabel"><?php echo $translate->_('Question'); ?></span>
- </a>
-
+ <?php foreach ($annotations as $annot_cat => $annot_def) {
+ if($annot_cat == "default") {
+ continue;
+ }
+ $display_parts = explode(" | ", $annot_def['display_name']);
+ ?>
+ <a id="<?php echo $annot_cat; ?>" title="<?php echo $annot_def['display_name']; ?>" class="tweetButton <?php echo $annot_def['colors_class']; ?>">
+ <span class="twbSyntax"><?php echo $display_parts[0]; ?></span>
+ <span class="twbSeparator">|</span>
+ <span class="twbLabel"><?php echo $display_parts[1]; ?></span>
+ </a>
+ <?php } ?>
+
<div style="clear: both;"></div>
</form>
</div>
</div>
-
+
<?php if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])) { ?>
-
+
<div id="tweetviz">
<div class="barre">
<form id="recherche">
@@ -490,13 +453,13 @@
<div id="scrollin"></div>
</div>
</div>
-
+
<?php } else {?>
-
+
<p class="connect-message"><a href="<?php echo URL_ROOT.$rep; ?>/client.php?CONNECT=true"><?php echo $translate->_('You must be connected with your Twitter account to read the conversation'); ?></a></p>
-
+
<?php } ?>
-
+
</div>
<?php $pad_url = $translate->_('config__pad_url');?>
<?php if ($pad_url !== "config__pad_url"):?>
@@ -515,7 +478,7 @@
<hr />
<?php
echo("<span id=\"event-partenaires\">".$translate->_('config__partenaires')."</span>");
-
+
if (isset($_SESSION['TWITTER_ACCESS_TOKEN'])){
echo("| <a href='clear.php' class='footerLink'>".$translate->_("Déconnexion")."</a>");
}