aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/chat.tpl
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-30 01:00:46 -0800
committerfriendica <info@friendica.com>2014-01-30 01:00:46 -0800
commit6c6a9b963a925d33b2cc436d877a4edc5f0d59b1 (patch)
tree3e723662de15092ab666ab412526ac0e17e150f7 /view/tpl/chat.tpl
parent080928f214c9f83879f1578e05baa6032fa2b7b8 (diff)
downloadvolse-hubzilla-6c6a9b963a925d33b2cc436d877a4edc5f0d59b1.tar.gz
volse-hubzilla-6c6a9b963a925d33b2cc436d877a4edc5f0d59b1.tar.bz2
volse-hubzilla-6c6a9b963a925d33b2cc436d877a4edc5f0d59b1.zip
a bit more ajax work on chat and chatsvc and some fiddling with layouts
Diffstat (limited to 'view/tpl/chat.tpl')
-rw-r--r--view/tpl/chat.tpl35
1 files changed, 25 insertions, 10 deletions
diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl
index d0f9418a0..13862c339 100644
--- a/view/tpl/chat.tpl
+++ b/view/tpl/chat.tpl
@@ -1,11 +1,12 @@
-<div id="chatContainer">
+<div id="chatContainer" style="height: 100%; width: 100%; position: absolute; right: 0; bottom: 0;">
- <div id="chatTopBar" class="rounded"></div>
+ <div id="chatTopBar" style="float: left; height: 80%;"></div>
<div id="chatLineHolder"></div>
- <div id="chatUsers" class="rounded"></div>
+ <div id="chatUsers" style="float: right; width: 120px; height: 100%; border: 1px solid #000;" ></div>
- <div id="chatBottomBar" class="rounded">
+ <div class="clear"></div>
+ <div id="chatBottomBar" style="position: absolute; bottom: 0; height: 150px;">
<div class="tip"></div>
<form id="chat-form" method="post" action="#">
@@ -20,24 +21,38 @@
<script>
var room_id = {{$room_id}};
+var last_chat = 0;
+var chat_timer = null;
$('#chat-form').submit(function(ev) {
$('body').css('cursor','wait');
$.post("chatsvc", $('#chat-form').serialize(),function(data) {
- load_chats(data);
+ if(chat_timer) clearTimeout(chat_timer);
+ load_chats();
$('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;
+function load_chats() {
+
+ $.get("chatsvc?f=&room_id=" + room_id + '&last=' + last_chat,function(data) {
+ if(data.success) {
+ update_inroom(data.inroom);
+ update_chats(data.chats);
});
}
+ chat_timer = setTimeout(load_chats,10000);
+
+}
+
+function update_inroom(inroom) {
}
+
+function update_chats(chats) {
+
+}
+
</script>