# HG changeset patch # User ymh # Date 1731687429 -3600 # Node ID 2d713fdd532fe919aa8fd02983ccaae40305b409 # Parent 2b0cb7c8f34d87295fa948cf4b1f110c085dc253 remove default hashtag and improve reactivity diff -r 2b0cb7c8f34d -r 2d713fdd532f web/client.php --- a/web/client.php Fri Nov 15 02:01:12 2024 +0100 +++ b/web/client.php Fri Nov 15 17:17:09 2024 +0100 @@ -148,17 +148,20 @@ ?> - l10n = { "rechercher" : "_('Rechercher'); ?>" } + var l10n = { + "rechercher" : "_('Rechercher'); ?>", + "loading_messages" : "_('loading_messages'); ?>", + "loading_messages_error" : "_('loading_messages_error'); ?>", + }; + var annotations; if (typeof annotations == "undefined" || !annotations) { - var annotations = JSON.parse(""); + annotations = JSON.parse(""); for(var annot_cat in annotations) { if("keywords" in annotations[annot_cat]) { annotations[annot_cat]['keywords'] = [ new RegExp(annotations[annot_cat]['keywords']), ]; } } } - global.annotations = annotations; - console.log("ANNOTATIONS",annotations); @@ -213,31 +216,43 @@ console.log("Send disabled") return; } + var MyStatus = $('#status').val(); + if(MyStatus.length == 0) { + return; + } $('#sendTweet').prop('disabled', true); $('#sendTweet').toggleClass('sending sendTweetDisabled'); - var MyStatus = $('#status').val(); - $.post('tweet_ajax.php', { - status:MyStatus, - social_network: "", - domain: "", - hashtag: "", - group: "" - } - ,function(data) { - $('#sendTweet').toggleClass('sending sendTweetDisabled'); - $('#sendTweet').prop('disabled', false); - if(data=="true"){ - $("#messageSuccess").show('fast'); - $("#messageSuccess").delay(800).hide('slow'); - $('#status').val(""); - $('#status').change(); - }else{ - $("#error").text(data); + $.ajax({ + url: 'tweet_ajax.php', + type: 'POST', + data:{ + status:MyStatus, + social_network: "", + domain: "", + hashtag: "", + group: "" + }, + success: function(data) { + $('#sendTweet').toggleClass('sending sendTweetDisabled'); + $('#sendTweet').prop('disabled', false); + if(data=="true"){ + $("#messageSuccess").show('fast'); + $("#messageSuccess").delay(800).hide('slow'); + $('#status').val(""); + $('#status').change(); + }else{ + $("#error").text(data); + $("#messageFailed").show('fast'); + $("#messageFailed").delay(800).hide('slow'); + } + }, + timeout: 10000, + error: function(jqXHR, textStatus, errorThrown) { + $("#error").text(textStatus); $("#messageFailed").show('fast'); $("#messageFailed").delay(800).hide('slow'); } - }); }); @@ -455,14 +470,17 @@
- -
- + +
+
+

_("ClientTitle1 :"); ?>

"; - $socialNetwork = isset($config['social_network'])?$config['social_network']:'Twitter'; if($socialNetwork === 'Twitter') { $loginform .= "".$translate->_("Vous n'êtes pas connecté.").""; } else { @@ -480,7 +498,7 @@ echo($loginform); } else { echo('
'); - echo(""); + echo(""); } ?>