Browse Source

- Complete some translations

- Add the last published message in the open chat list + date
- Click on the session list icon to choose the session on the Login widget
- Little CSS fix in style.css + CSS3 translation (to use material acceleration)
pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
0b2a877320
  1. 8
      app/assets/js/movim_tpl.js
  2. 2
      app/widgets/Chat/Chat.php
  3. 12
      app/widgets/Chats/Chats.php
  4. 16
      app/widgets/Chats/_chats.tpl
  5. 5
      app/widgets/Chats/locales.ini
  6. 2
      app/widgets/Login/_login_sessions.tpl
  7. 9
      themes/material/css/style.css

8
app/assets/js/movim_tpl.js

@ -55,11 +55,11 @@ var MovimTpl = {
var selector = 'main section > div:first-child:nth-last-child(2) ~ div';
var inner = document.querySelector(selector + ' div');
// Clear the right panel
if(inner != null) inner.innerHTML = '';
else document.querySelector(selector).innerHTML = '';
movim_remove_class(selector, 'enabled');
// Clear the right panel
//if(inner != null) inner.innerHTML = '';
//else document.querySelector(selector).innerHTML = '';
},
scrollPanel : function() { // On for panel that are .contained
var selector = document.querySelector('main section > div:first-child:nth-last-child(2) ~ div div');

2
app/widgets/Chat/Chat.php

@ -190,7 +190,7 @@ class Chat extends WidgetCommon
$view = $this->tpl();
$contact = $cd->get($jid);
if($contact != null) {
if($contact != null && $status != null) {
RPC::call(
'Chat.notify',
$contact->getTrueName(),

12
app/widgets/Chats/Chats.php

@ -25,6 +25,8 @@ class Chats extends WidgetCommon
$chats = Cache::c('chats');
if(!array_key_exists($from, $chats)) {
$this->ajaxOpen($from);
} else {
RPC::call('movim_fill', 'chats_widget_list', $this->prepareChats());
}
}
@ -67,11 +69,13 @@ class Chats extends WidgetCommon
function prepareChats()
{
$chats = Cache::c('chats');
$messages = array();
$view = $this->tpl();
$cd = new \Modl\ContactDAO;
$cod = new \modl\ConferenceDAO();
$md = new \modl\MessageDAO();
foreach($chats as $jid => $value) {
$cr = $cd->getRosterItem($jid);
@ -80,18 +84,22 @@ class Chats extends WidgetCommon
} else {
$chats[$jid] = $cd->get($jid);
}
$m = $md->getContact($jid, 0, 1);
if(isset($m)) {
$messages[$jid] = $m[0];
}
}
$view->assign('conferences', $cod->getAll());
$view->assign('chats', array_reverse($chats));
$view->assign('messages', $messages);
return $view->draw('_chats', true);
}
function prepareChatrooms()
{
return $view->draw('_chatrooms', true);
}

16
app/widgets/Chats/_chats.tpl

@ -1,16 +1,24 @@
{loop="$chats"}
<li data-jid="{$value->jid}">
<div class="control">
<li data-jid="{$value->jid}" {if="isset($messages[$value->jid])"}class="condensed"{/if}>
<!--<div class="control">
<i class="md md-chevron-right"></i>
</div>
</div>-->
<span class="icon bubble">
<img src="{$value->getPhoto('s')}">
</span>
<span>{$value->getTrueName()}</span>
{if="isset($messages[$value->jid])"}
<span class="info">{$messages[$value->jid]->delivered|strtotime|prepareDate}</span>
{if="preg_match('#^\?OTR#', $messages[$value->jid]->body)"}
<p><i class="md md-lock"></i> {$c->__('message.encrypted')}</p>
{else}
<p>{$messages[$value->jid]->body}</p>
{/if}
{/if}
</li>
{/loop}
<li class="subheader">
Chatrooms **FIXME**
{$c->__('chatrooms.title')}
</li>
{loop="$conferences"}
<li data-jid="{$value->conference}">

5
app/widgets/Chats/locales.ini

@ -0,0 +1,5 @@
[message]
message.encrypted = 'Encrypted message'
[chatrooms]
chatrooms.title ='Chatrooms'

2
app/widgets/Login/_login_sessions.tpl

@ -7,7 +7,7 @@
<div class="control">
<i onclick="Login.removeSession('{$value->jid}')" class="fa fa-times"></i>
</div>
<span class="icon bubble">
<span onclick="Login.choose('{$value->jid}')" class="icon bubble">
<img src="{$value->getPhoto('s')}"/>
</span>
<span onclick="Login.choose('{$value->jid}')">{$value->getTrueName()}</span>

9
themes/material/css/style.css

@ -250,7 +250,8 @@ main > section > div:first-child:nth-last-child(2) ~ div {
position: absolute;
top: 0;
right: 0;
transition: right 0.2s ease;
/*transition: right 0.2s ease;*/
transition: transform .5s ease;
}
main > section > div > div.contained { /* Specific behaviour when the scroll need to be inside the block */
@ -274,12 +275,14 @@ main > section > div > div.contained > * {
main > section > div:first-child:nth-last-child(2) ~ div {
background-color: white;
width: 100%;
right: -100%;
/*right: -100%;*/
transform: translateX(100%);
z-index: 1;
}
main > section > div:first-child:nth-last-child(2) ~ div.enabled {
right: 0;
/*right: 0;*/
transform: translateX(0);
}
main,

Loading…
Cancel
Save