|
@@ -5,9 +5,9 @@
|
|
|
.module('appMessage')
|
|
|
.directive('ngHistoryMsg', HistoryMsg);
|
|
|
|
|
|
- HistoryMsg.inject = ['$location', '$anchorScroll'];
|
|
|
+ HistoryMsg.inject = ['$location', '$anchorScroll', '$filter'];
|
|
|
|
|
|
- function HistoryMsg($location, $anchorScroll) {
|
|
|
+ function HistoryMsg($location, $anchorScroll, $filter) {
|
|
|
var directive = {
|
|
|
link: link,
|
|
|
restrict: 'A',
|
|
@@ -31,6 +31,12 @@
|
|
|
return arr[arr.length - 1];
|
|
|
};
|
|
|
|
|
|
+ var getUserID = function() {
|
|
|
+ var arr = scope.appContent.directory.user.split("\\");
|
|
|
+ var userself = arr[arr.length - 2];
|
|
|
+ return scope.msg.sender.indexOf(userself) !== -1;
|
|
|
+ };
|
|
|
+
|
|
|
var getFileSize = function(item) {
|
|
|
var fileSize = item.length;
|
|
|
if (fileSize > 1024 * 1024 * 1024)
|
|
@@ -41,6 +47,10 @@
|
|
|
return (Math.round(fileSize * 100 / 1024) / 100).toString() + 'KB';
|
|
|
};
|
|
|
|
|
|
+ var getTime = function(item) {
|
|
|
+ return $filter("date")(item.ts, "yyyy-MM-dd HH:mm:ss");
|
|
|
+ };
|
|
|
+
|
|
|
var replaceSystemFace = function(content) {
|
|
|
//匹配表情
|
|
|
var g = (/\/\:([\w]+)/).exec(content);
|
|
@@ -141,14 +151,21 @@
|
|
|
'<div class="media-body">' +
|
|
|
'<p><strong>' +
|
|
|
scope.msg.senderDisplayName +
|
|
|
- '</strong><small class="text-muted">-2017-2-6 15:57:17 ' +
|
|
|
- scope.msg.ts + '</small></p>' +
|
|
|
+ '</strong><small class="text-muted">-' +
|
|
|
+ getTime(scope.msg) + '</small></p>' +
|
|
|
'<div class="well m-l-xs m-t-xs fit-content" >' +
|
|
|
'<div class="text-point"></div>' + html +
|
|
|
'</div></div></div>';
|
|
|
|
|
|
angular.element("#loadmore").prepend(html_g);
|
|
|
console.log(html_g);
|
|
|
+ // if (getUserID()) {
|
|
|
+ // angular.element(".fit-content").removeClass("well");
|
|
|
+ // angular.element(".fit-content").addClass("wellself");
|
|
|
+ // } else if (!getUserID()) {
|
|
|
+ // angular.element(".fit-content").removeClass("wellself");
|
|
|
+ // angular.element(".fit-content").addClass("well");
|
|
|
+ // }
|
|
|
if (scope.count) {
|
|
|
message.addEventListener('load', gotoBottom());
|
|
|
}
|