diff options
Diffstat (limited to 'view/tpl')
-rw-r--r-- | view/tpl/bookmarkedchats.tpl | 4 | ||||
-rw-r--r-- | view/tpl/chat.tpl | 99 | ||||
-rw-r--r-- | view/tpl/chatroomlist.tpl | 7 | ||||
-rwxr-xr-x | view/tpl/mail_display.tpl | 10 | ||||
-rwxr-xr-x | view/tpl/xchan_vcard.tpl | 2 |
5 files changed, 75 insertions, 47 deletions
diff --git a/view/tpl/bookmarkedchats.tpl b/view/tpl/bookmarkedchats.tpl index ab4372c25..3aabf835a 100644 --- a/view/tpl/bookmarkedchats.tpl +++ b/view/tpl/bookmarkedchats.tpl @@ -1,5 +1,5 @@ {{if $rooms}} -<div class="widget"> +<div id="chatroom_bookmarks" class="widget"> <h3>{{$header}}</h3> <ul class="bookmarkchat nav nav-pills nav-stacked"> {{foreach $rooms as $room}} @@ -7,4 +7,4 @@ {{/foreach}} </ul> </div> -{{/if}}
\ No newline at end of file +{{/if}} diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index a040cbd3f..4750f81fd 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -1,14 +1,16 @@ <div class="generic-content-wrapper"> <div class="section-title-wrapper"> - {{if $is_owner}} - <div id="chatDrop" class="pull-right"> + <div class="pull-right"> + <button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(); adjustFullscreenTopBarHeight();"><i class="icon-resize-full"></i></button> + <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false); adjustInlineTopBarHeight();"><i class="icon-resize-small"></i></button> + {{if $is_owner}} <form id="chat-destroy" method="post" action="chat"> <input type="hidden" name="room_name" value="{{$room_name}}" /> <input type="hidden" name="action" value="drop" /> <button class="btn btn-danger btn-xs" type="submit" name="submit" value="{{$drop}}" onclick="return confirmDelete();"><i class="icon-trash"></i> {{$drop}}</button> </form> + {{/if}} </div> - {{/if}} <h2>{{$room_name}}</h2> <div class="clear"></div> </div> @@ -28,8 +30,8 @@ <div class="form-group"> </div> - <div id="chat-submit-wrapper" class="form-group"> - <div id="chat-submit" class="btn-group dropup pull-right"> + <div id="chat-submit-wrapper"> + <div id="chat-submit" class="dropup pull-right"> <button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown"><i class="icon-caret-down"></i></button> <button class="btn btn-primary btn-sm" type="submit" id="chat-submit" name="submit" value="{{$submit}}">{{$submit}}</button> <ul class="dropdown-menu"> @@ -103,10 +105,22 @@ var last_chat = 0; var chat_timer = null; $(document).ready(function() { + $('#chatTopBar').spin('small'); chat_timer = setTimeout(load_chats,300); - + $('#chatroom_bookmarks, #vcard').hide(); + $('#chatroom_list, #chatroom_members').show(); + adjustInlineTopBarHeight(); }); +$(window).resize(function () { + if($('.generic-content-wrapper').hasClass('fullscreen')) { + adjustFullscreenTopBarHeight(); + } + else { + adjustInlineTopBarHeight(); + } + $('#chatTopBar').scrollTop($('#chatTopBar').scrollTop() + $('#chatTopBar').outerHeight(true)); +}); $('#chat-form').submit(function(ev) { $('body').css('cursor','wait'); @@ -124,6 +138,7 @@ function load_chats() { if(data.success && (! stopped)) { update_inroom(data.inroom); update_chats(data.chats); + $('#chatTopBar').spin(false); } }); @@ -136,20 +151,27 @@ function update_inroom(inroom) { var count = inroom.length; $.each( inroom, function(index, item) { var newNode = document.createElement('div'); + newNode.setAttribute('class', 'member-item'); $(newNode).html('<img style="height: 32px; width: 32px;" src="' + item.img + '" alt="' + item.name + '" /> ' + '<span class="name">' + item.name + '</span><br /><span class="' + item.status_class + '">' + item.status + '</span>'); html.appendChild(newNode); }); - $('#chatUsers').html(html); + $('#chatMembers').html(html); } function update_chats(chats) { - var count = chats.length; $.each( chats, function(index, item) { last_chat = item.id; var newNode = document.createElement('div'); - newNode.setAttribute('class', 'chat-item'); - $(newNode).html('<img class="chat-item-photo" src="' + item.img + '" alt="' + item.name + '" /><div class="chat-body"><div class="chat-item-title"><span class="chat-item-name">' + item.name + ' </span><span class="autotime chat-item-time" title="' + item.isotime + '">' + item.localtime + '</span></div><div class="chat-item-text">' + item.text + '</div></div><div class="chat-item-end"></div>'); + + if(item.self) { + newNode.setAttribute('class', 'chat-item-self clear'); + $(newNode).html('<div class="chat-body-self"><div class="chat-item-title-self"><span class="chat-item-name-self">' + item.name + ' </span><span class="autotime chat-item-time-self" title="' + item.isotime + '">' + item.localtime + '</span></div><div class="chat-item-text-self">' + item.text + '</div></div><img class="chat-item-photo-self" src="' + item.img + '" alt="' + item.name + '" />'); + } + else { + newNode.setAttribute('class', 'chat-item clear'); + $(newNode).html('<img class="chat-item-photo" src="' + item.img + '" alt="' + item.name + '" /><div class="chat-body"><div class="chat-item-title"><span class="chat-item-name">' + item.name + ' </span><span class="autotime chat-item-time" title="' + item.isotime + '">' + item.localtime + '</span></div><div class="chat-item-text">' + item.text + '</div></div>'); + } $('#chatLineHolder').append(newNode); $(".autotime").timeago(); @@ -159,7 +181,6 @@ function update_chats(chats) { } - function chatJotGetLink() { reply = prompt("{{$linkurl}}"); if(reply && reply.length) { @@ -175,32 +196,40 @@ function addmailtext(data) { var currentText = $("#chatText").val(); $("#chatText").val(currentText + data); } -</script> -<script> -function isMobile() { -if( navigator.userAgent.match(/Android/i) - || navigator.userAgent.match(/webOS/i) - || navigator.userAgent.match(/iPhone/i) - || navigator.userAgent.match(/iPad/i) - || navigator.userAgent.match(/iPod/i) - || navigator.userAgent.match(/BlackBerry/i) - || navigator.userAgent.match(/Windows Phone/i) - ){ - return true; - } - else { - return false; - } + +function adjustFullscreenTopBarHeight() { + $('#chatTopBar').height($(window).height() - $('#chatBottomBar').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - 23); +} + +function adjustInlineTopBarHeight() { + $('#chatTopBar').height($(window).height() - $('#chatBottomBar').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - $('nav').outerHeight(true) - 23); } -$(function(){ - $('#chatText').keypress(function(e){ - if (e.keyCode == 13 && e.shiftKey||isMobile()) { +function isMobile() { + if( navigator.userAgent.match(/Android/i) + || navigator.userAgent.match(/webOS/i) + || navigator.userAgent.match(/iPhone/i) + || navigator.userAgent.match(/iPad/i) + || navigator.userAgent.match(/iPod/i) + || navigator.userAgent.match(/BlackBerry/i) + || navigator.userAgent.match(/Windows Phone/i) + ){ + return true; + } + else { + return false; } - else if (e.keyCode == 13) { - e.preventDefault(); - $('#chat-form').trigger('submit'); - } - }); +} + +$(function(){ + $('#chatText').keypress(function(e){ + if (e.keyCode == 13 && e.shiftKey||isMobile()) { + //do nothing + } + else if (e.keyCode == 13) { + e.preventDefault(); + $('#chat-form').trigger('submit'); + } + }); }); </script> diff --git a/view/tpl/chatroomlist.tpl b/view/tpl/chatroomlist.tpl index 542ff9a0c..ff4b79a4b 100644 --- a/view/tpl/chatroomlist.tpl +++ b/view/tpl/chatroomlist.tpl @@ -1,15 +1,10 @@ -<div class="widget"> +<div id="chatroom_list" class="widget"> <h3>{{$header}}</h3> - {{if $items}} <ul class="nav nav-pills nav-stacked"> <li><a href="{{$baseurl}}/chat/{{$nickname}}">{{$overview}}</a></li> {{foreach $items as $item}} <li><a href="{{$baseurl}}/chat/{{$nickname}}/{{$item.cr_id}}"><span class="badge pull-right">{{$item.cr_inroom}}</span>{{$item.cr_name}}</a></li> {{/foreach}} </ul> - {{/if}} - <div id="chatSide"> - <div id="chatUsers"></div> - </div> </div> diff --git a/view/tpl/mail_display.tpl b/view/tpl/mail_display.tpl index 24e763571..a7754daf2 100755 --- a/view/tpl/mail_display.tpl +++ b/view/tpl/mail_display.tpl @@ -1,8 +1,12 @@ <div class="generic-content-wrapper"> <div class="section-title-wrapper"> - {{if $mailbox == 'combined'}} - <a class="btn btn-xs btn-danger pull-right" href="mail/{{$mailbox}}/dropconv/{{$thread_id}}" onclick="return confirmDelete();"><i class="icon-trash"></i> {{$delete}}</a> - {{/if}} + <div class="pull-right"> + <button id="fullscreen-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen();"><i class="icon-resize-full"></i></button> + <button id="inline-btn" type="button" class="btn btn-default btn-xs" onclick="makeFullScreen(false);"><i class="icon-resize-small"></i></button> + {{if $mailbox == 'combined'}} + <a class="btn btn-xs btn-danger" href="mail/{{$mailbox}}/dropconv/{{$thread_id}}" onclick="return confirmDelete();"><i class="icon-trash"></i> {{$delete}}</a> + {{/if}} + </div> <h2>{{$prvmsg_header}}</h2> <div class="clear"></div> </div> diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl index ad409d75b..52bf6ab47 100755 --- a/view/tpl/xchan_vcard.tpl +++ b/view/tpl/xchan_vcard.tpl @@ -1,4 +1,4 @@ -<div class="vcard"> +<div id="vcard" class="vcard"> <div id="profile-photo-wrapper"><a href="{{$link}}"><img class="vcard-photo photo" src="{{$photo}}" alt="{{$name}}" /></a></div> {{if $connect}} <div class="connect-btn-wrapper"><a href="follow?f=&url={{$follow}}" class="btn btn-block btn-success btn-sm"><i class="icon-plus"></i> {{$connect}}</a></div> |