|
@@ -21,11 +21,6 @@
|
|
|
|
|
|
function link(scope, element, attrs) {
|
|
|
|
|
|
- // var gotoBottom = function() {
|
|
|
- // $location.hash("bottom");
|
|
|
- // $anchorScroll();
|
|
|
- // };
|
|
|
-
|
|
|
var getFileName = function(item) {
|
|
|
var arr = item.fileName.split("\\");
|
|
|
return arr[arr.length - 1];
|
|
@@ -62,6 +57,10 @@
|
|
|
return fileInfo;
|
|
|
};
|
|
|
|
|
|
+ var ifSelf = function(item) {
|
|
|
+ return item.operatorName == scope.msg.sender;
|
|
|
+ };
|
|
|
+
|
|
|
var replaceSystemFace = function(content) {
|
|
|
//匹配表情
|
|
|
var g = (/\/\:([\w]+)/).exec(content);
|
|
@@ -86,7 +85,6 @@
|
|
|
//匹配网址
|
|
|
var i = 0;
|
|
|
var m = content.match(/(((((http|ftp|https|HTTP|FTP|HTTPS):\/\/)[\w\-_]+)|www|WWW|[0-9]+)(\.(?!gif|jpg|png|mp3)[\w\-_]+)+([\w\-\.,@?^=%:/~\+#]*[\w\-\@?^=%/~\+#\r\n]))/ig);
|
|
|
- console.log(m);
|
|
|
if (m == null)
|
|
|
return content;
|
|
|
content = content.replace(/(((((http|ftp|https|HTTP|FTP|HTTPS):\/\/)[\w\-_]+)|www|WWW|[0-9]+)(\.(?!gif|jpg|png|mp3)[\w\-_]+)+([\w\-\.,@?^=%:/~\+#]*[\w\-\@?^=%/~\+#\r\n]))/ig, function() {
|
|
@@ -120,7 +118,7 @@
|
|
|
|
|
|
var replaceImage = function(content) {}
|
|
|
var html = '';
|
|
|
- console.log(scope.appContent.font);
|
|
|
+ //console.log(scope.appContent.font);
|
|
|
//var message = document.getElementById("sendmessage");
|
|
|
if (scope.msg.senderDisplayName === undefined || scope.msg.senderDisplayName == '')
|
|
|
scope.msg.senderDisplayName = scope.msg.sender;
|
|
@@ -182,28 +180,30 @@
|
|
|
'<a class="text-primary" role="button"><span ng-click="OpenDirectory(msg.content)">打开文件夹</span></a>' +
|
|
|
'</div>' +
|
|
|
'</div>';
|
|
|
- else if (content.way == 0 && content.status == 0 && content.direction == 0) {
|
|
|
+ else if (ifSelf(content) && content.way == 0 && content.status == 0) {
|
|
|
if (getUserID())
|
|
|
html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[0] + '</span></div>';
|
|
|
else
|
|
|
- html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[1] + '</span></div>';
|
|
|
- } else if (content.way == 0 && content.status == 0 && content.direction == 1) {
|
|
|
+ html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[2] + '</span></div>';
|
|
|
+ } else if (!ifSelf(content) && content.way == 0 && content.status == 0) {
|
|
|
if (getUserID())
|
|
|
html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[3] + '</span></div>';
|
|
|
else
|
|
|
- html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[2] + '</span></div>';
|
|
|
- } else if (content.way == 0 && content.status == 1 && content.direction == 0) {
|
|
|
+ html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[1] + '</span></div>';
|
|
|
+ } else if (ifSelf(content) && content.way == 0 && content.status == 1) {
|
|
|
if (getUserID())
|
|
|
html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[4] + '</span></div>';
|
|
|
else
|
|
|
- html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[5] + '</span></div>';
|
|
|
- } else if (content.way == 0 && content.status == 1 && content.direction == 1) {
|
|
|
+ html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[6] + '</span></div>';
|
|
|
+ } else if (!ifSelf(content) && content.way == 0 && content.status == 1) {
|
|
|
if (getUserID())
|
|
|
html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[7] + '</span></div>';
|
|
|
else
|
|
|
- html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[6] + '</span></div>';
|
|
|
- } else if (content.way == 1) {
|
|
|
- if (!getUserID())
|
|
|
+ html = '<div class="well m-l-xs m-t-xs fit-content" id="file-error"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[5] + '</span></div>';
|
|
|
+ } else if (ifSelf(content) && content.way == 1) {
|
|
|
+ if (getUserID())
|
|
|
+ html = '';
|
|
|
+ else
|
|
|
html = '<div class="well m-l-xs m-t-xs fit-content" id="file-info"><span class="glyphicon glyphicon-remove-sign"></span><span>' + getFileInfo(content)[8] + '</span></div>';
|
|
|
}
|
|
|
} else if (scope.msg.contentType == 4) {
|
|
@@ -239,7 +239,6 @@
|
|
|
}
|
|
|
}
|
|
|
console.log(html_g);
|
|
|
-
|
|
|
var compileFn = $compile(html_g);
|
|
|
// 传入scope,得到编译好的dom对象(已封装为jqlite对象)
|
|
|
// 也可以用$scope.$new()创建继承的作用域
|
|
@@ -252,21 +251,32 @@
|
|
|
};
|
|
|
/* @ngInject */
|
|
|
function ControllerController($scope, $timeout, $location, $anchorScroll, $sce) {
|
|
|
+
|
|
|
$scope.$on('font_changed', function(event, data) {
|
|
|
$scope.appContent.font = JSON.parse(data);
|
|
|
});
|
|
|
+
|
|
|
$scope.OpenFile = function(item) {
|
|
|
var file = JSON.parse(item);
|
|
|
return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenFile', JSON.stringify(file), $scope);
|
|
|
};
|
|
|
+
|
|
|
$scope.OpenDirectory = function(item) {
|
|
|
var file = JSON.parse(item);
|
|
|
return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenDirectory', JSON.stringify(file), $scope);
|
|
|
};
|
|
|
+
|
|
|
+ $scope.showImage = function(md5) {
|
|
|
+ var imgSrc = $scope.appContent.directory.received + md5 + ".JPG";
|
|
|
+ var img = { fileName: imgSrc };
|
|
|
+ return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenFile', JSON.stringify(img), $scope);
|
|
|
+ };
|
|
|
+
|
|
|
$scope.onLoad = function() {
|
|
|
$location.hash("bottom");
|
|
|
$anchorScroll();
|
|
|
};
|
|
|
+
|
|
|
$scope.onFaceLoadError = function(md5) {
|
|
|
$scope["img_" + md5] = "local://" + $scope.appContent.directory.base + "Images\\" + "Loading.gif";
|
|
|
$timeout();
|