From df891f4ad2eee3b07bad73d703a46364dad03508 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 31 Mar 2016 00:37:40 +0200 Subject: more work on mod chat --- mod/chat.php | 18 ++++- mod/chatsvc.php | 4 +- view/css/mod_chat.css | 102 +++++++++++-------------- view/theme/redbasic/css/style.css | 7 +- view/tpl/chat.tpl | 156 ++++++++++++++++++++++++++++---------- view/tpl/chatroomlist.tpl | 3 + 6 files changed, 184 insertions(+), 106 deletions(-) diff --git a/mod/chat.php b/mod/chat.php index ecd94bd95..95b3802a8 100644 --- a/mod/chat.php +++ b/mod/chat.php @@ -161,6 +161,7 @@ function chat_content(&$a) { intval($room_id), intval($a->profile['profile_uid']) ); + if($x) { $acl = new Zotlabs\Access\AccessList(false); $acl->set($x[0]); @@ -175,6 +176,11 @@ function chat_content(&$a) { return; } + $cipher = get_pconfig(local_channel(),'system','default_cipher'); + if(! $cipher) + $cipher = 'aes256'; + + $o = replace_macros(get_markup_template('chat.tpl'),array( '$is_owner' => ((local_channel() && local_channel() == $x[0]['cr_uid']) ? true : false), '$room_name' => $room_name, @@ -183,12 +189,16 @@ function chat_content(&$a) { '$nickname' => argv(1), '$submit' => t('Submit'), '$leave' => t('Leave Room'), - '$drop' => t('Delete This Room'), + '$drop' => t('Delete Room'), '$away' => t('I am away right now'), '$online' => t('I am online'), '$bookmark_link' => $bookmark_link, - '$bookmark' => t('Bookmark this room') - + '$bookmark' => t('Bookmark this room'), + '$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false), + '$cipher' => $cipher, + '$linkurl' => t('Please enter a link URL:'), + '$encrypt' => t('Encrypt text'), + '$insert' => t('Insert web link') )); return $o; } @@ -229,7 +239,7 @@ function chat_content(&$a) { '$norooms' => t('No chatrooms available'), '$newroom' => t('Create New'), '$is_owner' => ((local_channel() && local_channel() == $a->profile['profile_uid']) ? 1 : 0), - '$chatroom_new' => $chatroom_new + '$chatroom_new' => $chatroom_new, )); return $o; diff --git a/mod/chatsvc.php b/mod/chatsvc.php index 44225e6dd..829fef6f8 100644 --- a/mod/chatsvc.php +++ b/mod/chatsvc.php @@ -109,14 +109,16 @@ function chatsvc_content(&$a) { switch($rr['cp_status']) { case 'away': $status = t('Away'); + $status_class = 'away'; break; case 'online': default: $status = t('Online'); + $status_class = 'online'; break; } - $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name'], status => $status); + $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name'], 'status' => $status, 'status_class' => $status_class); } } diff --git a/view/css/mod_chat.css b/view/css/mod_chat.css index c59d8d459..69c2e1528 100644 --- a/view/css/mod_chat.css +++ b/view/css/mod_chat.css @@ -20,77 +20,67 @@ padding: 7px 10px; } +section, +aside { + padding-bottom: 0px; +} + +#chatTopBar { + float: left; + height: 400px; + overflow-y: auto; +} - #chatContainer { - height: 100%; - width: 100%; - } - - #chatTopBar { - float: left; - height: 400px; - width: 77%; - overflow-y: auto; - } - - #chatSide { - float: right; - width: 20%; - height: 100%; - } - - #chatDrop { - margin: 20px 0; - float: right; -} - - #chatUsers { - border: 1px solid #000; -} - - #chatBottomBar { - position: relative; - bottom: 0; - height: 150px; - margin-top: 20px; - } - -#chatOptionsBar { - margin-top: 20px; -} - - #chatText { - width: 100%; - } - - section { - padding-bottom: 0; - } -.chat-item { - padding: 3px; +#chatUsers img { + float: left; + margin-right: 5px; +} + +.name { + font-weight: bold; } -.chat-item-end { - clear: both; +#chatBottomBar { + position: relative; + bottom: 0; + margin-top: 10px; +} + +.chat-item { + display: table; + table-layout: fixed; + } .chat-item-photo { - float: left; + display: table-cell; height: 32px; width: 32px; + vertical-align: top; } .chat-body { - float: left; - width: 80%; - margin-left: 15px; + display: table-cell; + vertical-align: top; + padding: 0px 0px 20px 10px; } -.chat-item-text { - float: left; - padding: 3px; +.chat-item-title { display: inline-block; + padding: 3px; + margin-bottom: 3px; } +.online { + color: green; +} + +.away { + color: orange; +} + +.leave { + color: red; +} diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index b92fe5afe..7f9f621a3 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1263,7 +1263,8 @@ img.mail-conv-sender-photo { .wall-item-content, .mail-conv-body, -.page-body { +.page-body, +.chat-item-text { font-size: $font_size; clear: both; } @@ -1366,9 +1367,9 @@ img.mail-conv-sender-photo { border-radius: $radiuspx; } -.chat-item-text { +.chat-item-title { border-radius: $radiuspx; - background-color: #eee; + background-color: $item_colour; } /* nav bootstrap */ diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index 5ea1ae22e..a040cbd3f 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -1,44 +1,101 @@ -
- - {{if $is_owner}} -
-
- - - -
-
- {{/if}} - -

{{$room_name}}

- - -
- -
-
-
- -
- -

+
+
+ {{if $is_owner}} +
+
+ + + +
+
+ {{/if}} +

{{$room_name}}

+
-
-
-
- -
- -
- -
- -
-
- {{$leave}} | {{$away}} | {{$online}}{{if $bookmark_link}} | {{$bookmark}}{{/if}} +
+
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + + +
+
+
+ + + + + +
+ + {{if $feature_encrypt}} + + {{/if}} +
+ + +
+ + +
+
+
+
+
+
+
+
-