Igor Zhukov 10 years ago
parent
commit
fae8e2ae5a
  1. 10
      app/css/app.css
  2. 12
      app/js/filters.js
  3. 14
      app/js/services.js
  4. 2
      app/partials/message.html

10
app/css/app.css

@ -1818,15 +1818,6 @@ img.im_message_document_thumb { @@ -1818,15 +1818,6 @@ img.im_message_document_thumb {
padding: 0 0 20px 10px;
}
.im_message_date_seconds {
padding: 0;
margin: 0;
position: absolute;
display: none;
}
.im_message_meta:hover .im_message_date_seconds {
display: inline;
}
@media (max-width: 900px) {
@ -3255,6 +3246,7 @@ ce671b orange @@ -3255,6 +3246,7 @@ ce671b orange
filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='2');
margin: -1px;
padding: 1px;
max-width: 100%;
}
.img_gif_image {

12
app/js/filters.js

@ -86,6 +86,18 @@ angular.module('myApp.filters', []) @@ -86,6 +86,18 @@ angular.module('myApp.filters', [])
}
}])
.filter('timeSecs', ['$filter', function($filter) {
var cachedDates = {};
return function (timestamp) {
if (cachedDates[timestamp]) {
return cachedDates[timestamp];
}
return cachedDates[timestamp] = $filter('date')(timestamp * 1000, 'HH:mm:ss');
}
}])
.filter('myDate', ['$filter', function($filter) {
var cachedDates = {};

14
app/js/services.js

@ -1797,12 +1797,14 @@ angular.module('myApp.services', []) @@ -1797,12 +1797,14 @@ angular.module('myApp.services', [])
for (i = start; i < end; i++) {
curMessage = history[i];
curDay = Math.floor((curMessage.date - midnightOffset) / 86400);
if (curDay !== prevDay) {
curMessage.needDate = true;
} else if (prevMessage) {
curDay = Math.floor((curMessage.date + midnightOffset) / 86400);
if (curDay === prevDay) {
delete curMessage.needDate;
} else if (!i || prevMessage) {
curMessage.needDate = true;
}
if (prevMessage &&
curMessage.from_id == prevMessage.from_id &&
!prevMessage.fwd_from_id == !curMessage.fwd_from_id &&
@ -2559,9 +2561,9 @@ angular.module('myApp.services', []) @@ -2559,9 +2561,9 @@ angular.module('myApp.services', [])
doc.thumb = thumb;
doc.canDownload = !(window.chrome && chrome.fileSystem && chrome.fileSystem.chooseEntry);
doc.withPreview = doc.canDownload && doc.mime_type.match(/^(image\/|application\/pdf)/) ? 1 : 0;
doc.withPreview = doc.canDownload && doc.thumb && doc.mime_type.match(/^(image\/|application\/pdf)/) ? 1 : 0;
if (isGif) {
if (doc.withPreview && isGif) {
doc.isSpecial = 'gif';
}

2
app/partials/message.html

@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
</a>
<div class="im_message_meta pull-right text-right">
<i class="icon-message-status-tick"></i>
<span class="im_message_date" ng-bind="historyMessage.date | time"></span><span class="im_message_date im_message_date_seconds">:<span ng-bind="historyMessage.date | seconds"></span></span>
<span class="im_message_date" ng-bind="historyMessage.date | timeSecs"></span>
</div>
<div class="im_message_body">

Loading…
Cancel
Save