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 { else {
$date = __('date.ago', ceil($reldays)); $date = __('date.ago', ceil($reldays));
if($compact) return $date;
//if($compact) return $date;
} }
} }
//else print full date //else print full date

11
app/widgets/Chat/chat.js

@ -4,6 +4,7 @@ var Chat = {
room: null, room: null,
date: null, date: null,
lastScroll: null, lastScroll: null,
lastDate: null,
edit: false, edit: false,
sendMessage: function(jid, muc) sendMessage: function(jid, muc)
{ {
@ -72,6 +73,7 @@ var Chat = {
}, },
appendMessages : function(messages) { appendMessages : function(messages) {
if(messages) { if(messages) {
Chat.lastDate = null;
Chat.date = messages[0].published; Chat.date = messages[0].published;
for(var i = 0, len = messages.length; i < len; ++i ) { for(var i = 0, len = messages.length; i < len; ++i ) {
Chat.appendMessage(messages[i], false); Chat.appendMessage(messages[i], false);
@ -211,6 +213,15 @@ var Chat = {
previous = 'left'; 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", "event",
"exception" "exception"
], ],
"abandoned": "guzzle/guzzle",
"time": "2014-08-11 04:32:36" "time": "2014-08-11 04:32:36"
}, },
{ {
@ -339,7 +338,6 @@
"http", "http",
"http client" "http client"
], ],
"abandoned": "guzzle/guzzle",
"time": "2014-08-11 04:32:36" "time": "2014-08-11 04:32:36"
}, },
{ {
@ -384,7 +382,6 @@
"message", "message",
"url" "url"
], ],
"abandoned": "guzzle/guzzle",
"time": "2014-02-05 18:29:46" "time": "2014-02-05 18:29:46"
}, },
{ {
@ -438,7 +435,6 @@
"component", "component",
"stream" "stream"
], ],
"abandoned": "guzzle/guzzle",
"time": "2014-05-01 21:36:02" "time": "2014-05-01 21:36:02"
}, },
{ {
@ -1024,12 +1020,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/reactphp/child-process.git", "url": "https://github.com/reactphp/child-process.git",
"reference": "1c8183be536895f072843e47990b827ee873a698"
"reference": "92b29374188e7bbfcfd5b9c9c1d68d7ec8358b30"
}, },
"dist": { "dist": {
"type": "zip", "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": "" "shasum": ""
}, },
"require": { "require": {
@ -1060,7 +1056,7 @@
"keywords": [ "keywords": [
"process" "process"
], ],
"time": "2016-02-22 23:59:57"
"time": "2016-03-08 21:22:43"
}, },
{ {
"name": "react/dns", "name": "react/dns",

Loading…
Cancel
Save