diff options
author | friendica <info@friendica.com> | 2014-01-29 20:14:18 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-01-29 20:14:18 -0800 |
commit | 9fdee53c9a35d584de8cacd071c6608de88a18b6 (patch) | |
tree | c978f5d246c0358fd3a8d978523f22925aeff927 /view | |
parent | 838ebbcb62aaaca8f19e338fe89c484f9d4ececd (diff) | |
download | volse-hubzilla-9fdee53c9a35d584de8cacd071c6608de88a18b6.tar.gz volse-hubzilla-9fdee53c9a35d584de8cacd071c6608de88a18b6.tar.bz2 volse-hubzilla-9fdee53c9a35d584de8cacd071c6608de88a18b6.zip |
start on the ajax bits
Diffstat (limited to 'view')
-rw-r--r-- | view/tpl/chat.tpl | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index 6378b8776..d0f9418a0 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -8,11 +8,36 @@ <div id="chatBottomBar" class="rounded"> <div class="tip"></div> - <form id="submitForm" method="post" action=""> - <input id="chatText" name="chatText" class="rounded" maxlength="255" /> - <input type="submit" class="blueButton" value="Submit" /> + <form id="chat-form" method="post" action="#"> + <input type="hidden" name="room_id" value="{{$room_id}}" /> + <textarea id="chatText" name="chat_text" rows=3 cols=80></textarea><br /> + <input type="submit" name="submit" value="{{$submit}}" /> </form> </div> -</div>
\ No newline at end of file +</div> + +<script> +var room_id = {{$room_id}}; + +$('#chat-form').submit(function(ev) { + $('body').css('cursor','wait'); + $.post("chatsvc", $('#chat-form').serialize(),function(data) { + load_chats(data); + $('body').css('cursor','auto'); + },'json'); + ev.preventDefault(); +}); + +function load_chats(data) { + var chat_data = data; + if(! data) { + $.get("chatsvc?f=&room_id=" + room_id,function(data) { + chat_data = $this; + }); + } + + +} +</script> |