155 if("keywords" in annotations[annot_cat]) { |
155 if("keywords" in annotations[annot_cat]) { |
156 annotations[annot_cat]['keywords'] = [ new RegExp(annotations[annot_cat]['keywords']), ]; |
156 annotations[annot_cat]['keywords'] = [ new RegExp(annotations[annot_cat]['keywords']), ]; |
157 } |
157 } |
158 } |
158 } |
159 } |
159 } |
|
160 global.annotations = annotations; |
|
161 console.log("ANNOTATIONS",annotations); |
160 </script> |
162 </script> |
161 <?php if (isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) { ?> |
163 <?php if (isset($_SESSION['SOCIAL_ACCESS_TOKEN'])) { ?> |
162 <script type="text/javascript" src="<?php echo(URL_ROOT); ?>res/js/live-polemic.js" ></script> |
164 <script type="text/javascript" src="<?php echo(URL_ROOT); ?>res/js/live-polemic.js" ></script> |
163 <?php } ?> |
165 <?php } ?> |
164 <script type="text/javascript"> |
166 <script type="text/javascript"> |
206 }) |
208 }) |
207 |
209 |
208 // SEND TWEETS |
210 // SEND TWEETS |
209 $("#sendTweet").click(function(e){ |
211 $("#sendTweet").click(function(e){ |
210 if($('#sendTweet').prop('disabled')) { |
212 if($('#sendTweet').prop('disabled')) { |
|
213 console.log("Send disabled") |
211 return; |
214 return; |
212 } |
215 } |
|
216 $('#sendTweet').prop('disabled', true); |
|
217 $('#sendTweet').toggleClass('sending'); |
213 var MyStatus = $('#status').val(); |
218 var MyStatus = $('#status').val(); |
214 $.post('tweet_ajax.php', { |
219 $.post('tweet_ajax.php', { |
215 status:MyStatus, |
220 status:MyStatus, |
216 social_network: "<?php echo($config['social_network']) ?>", |
221 social_network: "<?php echo($config['social_network']) ?>", |
217 domain: "<?php echo(isset($_SESSION['SOCIAL_LOGIN_DOMAIN'])?$_SESSION['SOCIAL_LOGIN_DOMAIN']:'') ?>", |
222 domain: "<?php echo(isset($_SESSION['SOCIAL_LOGIN_DOMAIN'])?$_SESSION['SOCIAL_LOGIN_DOMAIN']:'') ?>", |
218 hashtag: "<?php echo($config['hashtag']) ?>", |
223 hashtag: "<?php echo($config['hashtag']) ?>", |
219 group: "<?php echo($config['group'] ?? "") ?>" |
224 group: "<?php echo($config['group'] ?? "") ?>" |
220 } |
225 } |
221 ,function(data) { |
226 ,function(data) { |
222 |
227 |
|
228 $('#sendTweet').toggleClass('sending'); |
|
229 $('#sendTweet').prop('disabled', false); |
223 if(data=="true"){ |
230 if(data=="true"){ |
224 $("#messageSuccess").show('fast'); |
231 $("#messageSuccess").show('fast'); |
225 $("#messageSuccess").delay(800).hide('slow'); |
232 $("#messageSuccess").delay(800).hide('slow'); |
226 $('#status').val("<?php echo($config['hashtag']); ?>"); |
233 $('#status').val("<?php echo($config['hashtag']); ?>"); |
227 $('#status').change(); |
234 $('#status').change(); |