diff --git a/app/assets/js/movim_tpl.js b/app/assets/js/movim_tpl.js index 059695ea3..2b2242b20 100755 --- a/app/assets/js/movim_tpl.js +++ b/app/assets/js/movim_tpl.js @@ -97,6 +97,25 @@ var MovimTpl = { toggleMenu : function() { movim_toggle_class('body > nav', 'active'); }, + toggleContextMenu : function(e) { + var element = 'ul.context_menu'; + var classname = 'shown'; + + if(document.querySelector(element) == null) { + return; + } + + if(document.querySelector('.show_context_menu').contains(e.target)) { + movim_add_class(element, classname); + return; + } + + //if(!document.querySelector(element).contains(e.target)) + movim_remove_class(element, classname); + }, + hideContextMenu : function() { + movim_remove_class('ul.context_menu', 'shown'); + }, hideMenu : function() { movim_remove_class('body > nav', 'active'); }, @@ -122,4 +141,5 @@ var MovimTpl = { movim_add_onload(function() { MovimTpl.init(); + document.body.addEventListener('click', MovimTpl.toggleContextMenu, false); }); diff --git a/app/models/message/MessageDAO.php b/app/models/message/MessageDAO.php index 761a0cfb3..40fbad609 100755 --- a/app/models/message/MessageDAO.php +++ b/app/models/message/MessageDAO.php @@ -93,6 +93,22 @@ class MessageDAO extends SQL { return $this->run('Message'); } + + function getRoomSubject($room) { + $this->_sql = ' + select * from message + where jidfrom = :jidfrom + and subject != \'\''; + + $this->prepare( + 'Message', + array( + 'jidfrom' => $room + ) + ); + + return $this->run('Message', 'item'); + } function clearMessage() { $this->_sql = ' diff --git a/app/widgets/Chat/Chat.php b/app/widgets/Chat/Chat.php index 4e1a570a3..f01be284a 100644 --- a/app/widgets/Chat/Chat.php +++ b/app/widgets/Chat/Chat.php @@ -10,13 +10,14 @@ class Chat extends WidgetCommon function load() { $this->addjs('chat.js'); - $this->addjs('chat_otr.js'); + //$this->addjs('chat_otr.js'); $this->addcss('chat.css'); $this->registerEvent('carbons', 'onMessage'); $this->registerEvent('message', 'onMessage'); $this->registerEvent('composing', 'onComposing'); $this->registerEvent('paused', 'onPaused'); $this->registerEvent('gone', 'onGone'); + $this->registerEvent('conference_subject', 'onConferenceSubject'); //$this->registerEvent('presence', 'onPresence'); } @@ -97,6 +98,12 @@ class Chat extends WidgetCommon $this->setState($array, $this->__('message.gone')); } + function onConferenceSubject($message) + { + $header = $this->prepareHeaderRoom($message->jidfrom); + Header::fill($header); + } + private function setState($array, $message) { list($from, $to) = $array; @@ -283,8 +290,16 @@ class Chat extends WidgetCommon function prepareHeaderRoom($room) { $view = $this->tpl(); - + + $md = new \Modl\MessageDAO; + $s = $md->getRoomSubject($room); + + $cd = new \Modl\ConferenceDAO; + $c = $cd->get($room); + $view->assign('room', $room); + $view->assign('subject', $s); + $view->assign('conference', $c); return $view->draw('_chat_header_room', true); } diff --git a/app/widgets/Chat/_chat_header.tpl b/app/widgets/Chat/_chat_header.tpl index efb40d0cb..810725697 100644 --- a/app/widgets/Chat/_chat_header.tpl +++ b/app/widgets/Chat/_chat_header.tpl @@ -17,12 +17,14 @@ -

+
- {if="$contact != null"} - {$contact->getTrueName()} - {else} - {$jid|echapJS} - {/if} +

+ {if="$contact != null"} + {$contact->getTrueName()} + {else} + {$jid|echapJS} + {/if} +

diff --git a/app/widgets/Chat/_chat_header_room.tpl b/app/widgets/Chat/_chat_header_room.tpl index 9be96c9c6..935a511be 100644 --- a/app/widgets/Chat/_chat_header_room.tpl +++ b/app/widgets/Chat/_chat_header_room.tpl @@ -7,28 +7,38 @@ -

{$c->__('page.chats')}

+

{$c->__('page.chats')}

-

+
- {$room} -

+ {if="$conference != null && $conference->name"} +

{$conference->name}

+ {else} +

{$room}

+ {/if} + {if="$subject != null"} +

{$subject->subject}

+ {/if} +
+ diff --git a/app/widgets/Chat/locales.ini b/app/widgets/Chat/locales.ini index 85302f73e..bb04c933f 100644 --- a/app/widgets/Chat/locales.ini +++ b/app/widgets/Chat/locales.ini @@ -12,5 +12,6 @@ chat.smileys = 'Smileys' chat.empty_title = 'Chat' chat.empty_text = 'Discuss with your contacts' +chatroom.members = 'Chatroom members' chatroom.connected = 'Connected to the chatroom' chatroom.disconnected = 'Disconnected from the chatroom' diff --git a/app/widgets/Contact/_contact_header.tpl b/app/widgets/Contact/_contact_header.tpl index ada4789e3..d04ea6d7a 100644 --- a/app/widgets/Contact/_contact_header.tpl +++ b/app/widgets/Contact/_contact_header.tpl @@ -16,10 +16,10 @@ -

+
- {$contactr->getTrueName()} -

+

{$contactr->getTrueName()}

+ {else} {if="$contact != null"} {/if} -

isMine()"}r1{/if}" onclick="MovimTpl.hidePanel(); Post_ajaxClear();"> +
isMine()"}r1{/if}" onclick="MovimTpl.hidePanel(); Post_ajaxClear();"> - {if="$post != null"} - {if="$post->title != null"} - {$post->title} +

+ {if="$post != null"} + {if="$post->title != null"} + {$post->title} + {else} + {$c->__('post.default_title')} + {/if} {else} - {$c->__('post.default_title')} + Empty {/if} - {else} - Empty - {/if} +

diff --git a/themes/material/css/list.css b/themes/material/css/list.css index 722ce2e7c..bf5d9741c 100644 --- a/themes/material/css/list.css +++ b/themes/material/css/list.css @@ -9,7 +9,7 @@ ul li { box-sizing: border-box; text-overflow: ellipsis; overflow: hidden; - min-width: 12rem; + /*min-width: 12rem;*/ } ul > a { @@ -294,13 +294,18 @@ ul.tabs li.active { ul.context_menu { border-radius: 0.25rem; - display: inline-block; overflow: hidden; background-color: white; color: #333; position: absolute; - top: 1rem; - right: 1rem; + top: 0; + right: 0; + margin: 0.5rem; z-index: 3; box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.26), 0px 2px 10px 0px rgba(0, 0, 0, 0.16); + display: none; +} + +ul.context_menu.shown { + display: block; } diff --git a/themes/material/css/menu.css b/themes/material/css/menu.css index 06a29a61d..f091b04db 100644 --- a/themes/material/css/menu.css +++ b/themes/material/css/menu.css @@ -1,4 +1,4 @@ -/* Menu header */ +/* Menu */ body > nav > ul span.icon { left: 1rem; diff --git a/themes/material/css/style.css b/themes/material/css/style.css index 9d49d9bb9..31adbff02 100644 --- a/themes/material/css/style.css +++ b/themes/material/css/style.css @@ -237,7 +237,7 @@ main > header > div { padding-right: 1rem; } -main > header > div > * { +main > header > div > .return > * { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; @@ -248,7 +248,7 @@ main > header > div > ul.active:not(.context_menu) { margin-right: -1rem; } -main > header > div > ul.active:not(.context_menu) > li { +main > header > div > ul.active:not(.context_menu) li { float: left; height: 7rem; min-width: 0; @@ -258,15 +258,15 @@ main > header > div > ul.active:not(.context_menu) > li { font-size: 4rem; } -main > header > div > ul.active:not(.context_menu) > li.thin { +main > header > div > ul.active:not(.context_menu) li.thin { width: 5rem; } -main > header > div > ul.active:not(.context_menu) > li span.icon { +main > header > div > ul.active:not(.context_menu) li span.icon { left: 1rem; } -main > header > div > ul.active:not(.context_menu) > li.thin span.icon { +main > header > div > ul.active:not(.context_menu) li.thin span.icon { width: 3rem; } @@ -286,20 +286,29 @@ main > header > div > span.icon { margin: 0; } -main > header > div > h2 { +main > header > div > .return { padding-left: 9rem; margin-left: -9rem; display: inline-block; - padding-right: 3rem; + padding-right: 1rem; max-width: calc(100% + 10rem); + height: 7rem; box-sizing: border-box; } -main > header > div > h2.r1 { max-width: calc(100% + 2rem); } -main > header > div > h2.r2 { max-width: calc(100% - 5rem); } -main > header > div > h2.r3 { max-width: calc(100% - 12rem); } +main > header > div > .return.condensed > h2 { + line-height: 4.1rem; +} + +main > header > div > .return > h4 { + line-height: 2.5rem; +} -main > header > div > h2.active:hover, +main > header > div > .return.r1 { max-width: calc(100% + 2rem); } +main > header > div > .return.r2 { max-width: calc(100% - 5rem); } +main > header > div > .return.r3 { max-width: calc(100% - 12rem); } + +main > header > div > .return.active:hover, main > header > div > span.active:hover { background-color: rgba(0, 0, 0, 0.05); cursor: pointer; @@ -823,6 +832,8 @@ dl dd { .spinner.on:before, .spinner.on:after { top: 3rem; + animation: spinner 1s linear infinite; + -webkit-animation: spinner 1s linear infinite; } .spinner:before { @@ -836,8 +847,6 @@ dl dd { content: ''; border: 0.75rem solid transparent; border-top: 0.75rem solid #ddd; - animation: spinner 1s linear infinite; - -webkit-animation: spinner 1s linear infinite; } .spinner:after {