Browse Source

Update the dependencies

Cleanup the dates in the chatrooms
pull/183/head
Timothée Jaussoin 10 years ago
parent
commit
1eb50fecef
  1. 2
      app/helpers/DateHelper.php
  2. 11
      app/widgets/Chat/chat.js
  3. 12
      composer.lock

2
app/helpers/DateHelper.php

@ -68,7 +68,7 @@ function prepareDate($time, $hours = true, $compact = false) {
else {
$date = __('date.ago', ceil($reldays));
if($compact) return $date;
//if($compact) return $date;
}
}
//else print full date

11
app/widgets/Chat/chat.js

@ -4,6 +4,7 @@ var Chat = {
room: null,
date: null,
lastScroll: null,
lastDate: null,
edit: false,
sendMessage: function(jid, muc)
{
@ -72,6 +73,7 @@ var Chat = {
},
appendMessages : function(messages) {
if(messages) {
Chat.lastDate = null;
Chat.date = messages[0].published;
for(var i = 0, len = messages.length; i < len; ++i ) {
Chat.appendMessage(messages[i], false);
@ -211,6 +213,15 @@ var Chat = {
previous = 'left';
}
if(bubbles[i].className.indexOf('room') > -1) {
var lastDate = bubbles[i].querySelector('span.info').innerHTML;
if(lastDate == Chat.lastDate) {
bubbles[i].querySelector('span.info').innerHTML = '';
}
Chat.lastDate = lastDate;
}
}
}
}

12
composer.lock

@ -281,7 +281,6 @@
"event",
"exception"
],
"abandoned": "guzzle/guzzle",
"time": "2014-08-11 04:32:36"
},
{
@ -339,7 +338,6 @@
"http",
"http client"
],
"abandoned": "guzzle/guzzle",
"time": "2014-08-11 04:32:36"
},
{
@ -384,7 +382,6 @@
"message",
"url"
],
"abandoned": "guzzle/guzzle",
"time": "2014-02-05 18:29:46"
},
{
@ -438,7 +435,6 @@
"component",
"stream"
],
"abandoned": "guzzle/guzzle",
"time": "2014-05-01 21:36:02"
},
{
@ -1024,12 +1020,12 @@
"source": {
"type": "git",
"url": "https://github.com/reactphp/child-process.git",
"reference": "1c8183be536895f072843e47990b827ee873a698"
"reference": "92b29374188e7bbfcfd5b9c9c1d68d7ec8358b30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/reactphp/child-process/zipball/1c8183be536895f072843e47990b827ee873a698",
"reference": "1c8183be536895f072843e47990b827ee873a698",
"url": "https://api.github.com/repos/reactphp/child-process/zipball/92b29374188e7bbfcfd5b9c9c1d68d7ec8358b30",
"reference": "92b29374188e7bbfcfd5b9c9c1d68d7ec8358b30",
"shasum": ""
},
"require": {
@ -1060,7 +1056,7 @@
"keywords": [
"process"
],
"time": "2016-02-22 23:59:57"
"time": "2016-03-08 21:22:43"
},
{
"name": "react/dns",

Loading…
Cancel
Save