diff --git a/app/css/app.css b/app/css/app.css index b7335691..1141a6eb 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -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 filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='2'); margin: -1px; padding: 1px; + max-width: 100%; } .img_gif_image { diff --git a/app/js/filters.js b/app/js/filters.js index faf2a155..96589e8e 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -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 = {}; diff --git a/app/js/services.js b/app/js/services.js index 99543855..fa3db00c 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -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', []) 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'; } diff --git a/app/partials/message.html b/app/partials/message.html index ddae6666..3b0805f5 100644 --- a/app/partials/message.html +++ b/app/partials/message.html @@ -81,7 +81,7 @@
- : +