diff -r b90c2bd832dd -r f7fd2458fc5c web/client_new.php --- a/web/client_new.php Mon Feb 13 12:47:01 2012 +0100 +++ b/web/client_new.php Tue Feb 14 14:17:43 2012 +0100 @@ -58,9 +58,32 @@ document.location.href="/client.php?CONNECT=true"; }); + function updateCounter() { + var _v = $("#status").val(); + if (_v.length > 140) { + _v = _v.substr(0,140); + $("#status").val(_v); + } + $('#tweetCounter').html(140-_v.length); + if(140-_v.length < 0) { + $('#tweetCounter').addClass("tweetCounterNegative"); + } + else { + $('#tweetCounter').removeClass("tweetCounterNegative"); + } + $(".tweetButton").each(function(_i, _e) { + if (_v.search($(_e).find('span.twbSyntax').text().replace(/(\W)/g, '\\$1')) > -1) { + $(_e).addClass('selected'); + } else { + $(_e).removeClass('selected'); + } + }); + } + // BUTTONS $(".tweetButton").click(function() { - add_grammar($(this).text()); + add_grammar($(this).find('span.twbSyntax').text()); + updateCounter(); }) // SEND TWEETS @@ -83,17 +106,9 @@ }); }); + - $("#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"); - } - }); + $("#status").bind("change keyup paste blur focus",updateCounter); $("#Program").fancybox({ @@ -123,9 +138,6 @@ }); // @@ -288,12 +300,15 @@
+ +
+

_("ClientTitle1 :"); ?>

".$translate->_("Vous n'ĂȘtes pas connectĂ©.")."
"); } else { - echo(""); + echo(""); } ?>