|
@@ -6,7 +6,6 @@
|
|
|
.directive('ngMsg', Directive);
|
|
|
|
|
|
Directive.inject = [];
|
|
|
-
|
|
|
function Directive() {
|
|
|
var directive = {
|
|
|
link: link,
|
|
@@ -20,16 +19,19 @@
|
|
|
|
|
|
function link(scope, element, attrs) {
|
|
|
var replaceSystemFace = function(content){
|
|
|
- if (scope.appContent === undefined || scope.appContent.faceConfig ===undefined || scope.appContent.faceConfig.sys === undefined)
|
|
|
- return content;
|
|
|
scope.appContent.faceConfig.sys.forEach(function(element) {
|
|
|
- content = content.replace(element.shortcut,'<img src="' + scope.appContent.directory.base + element.image + '">');
|
|
|
+ content = content.replace(element.shortcut,'<img src="local://' + scope.appContent.directory.base + element.image + '">');
|
|
|
}, this);
|
|
|
- return content;
|
|
|
- }
|
|
|
+ return content;
|
|
|
+ };
|
|
|
+ var replaceImage = function(content){
|
|
|
+
|
|
|
+ }
|
|
|
var html = '';
|
|
|
// 消息类型([1,文本消息],[2,图片消息],[3,文件消息],[4,语音消息], [5,位置消息])
|
|
|
- if (scope.msg.contentType == 1) {
|
|
|
+ if (scope.appContent === undefined || scope.appContent.faceConfig ===undefined || scope.appContent.faceConfig.sys === undefined){
|
|
|
+ html = '<span class="text-message">' + scope.msg.content + '</span>';
|
|
|
+ } else if (scope.msg.contentType == 1) {
|
|
|
html = '<span class="text-message">' + replaceSystemFace(scope.msg.content) + '</span>';
|
|
|
} else if (scope.msg.contentType == 2) {
|
|
|
html = '<span class="text-message">' +
|
|
@@ -61,7 +63,7 @@
|
|
|
'</audio>' +
|
|
|
'</span>';
|
|
|
}
|
|
|
- console.log(html);
|
|
|
+
|
|
|
var newElement = angular.element(html);
|
|
|
element.append(newElement);
|
|
|
}
|