Commit 18a5a589 by 施宇

121212

parent 8823e059
...@@ -19,7 +19,55 @@ ...@@ -19,7 +19,55 @@
</div> </div>
</div> </div>
<div class="notice_right boxsiz"> <div class="notice_right boxsiz">
<textarea id="chat_textarea" style="display: none;" class="chat_textarea"></textarea> <div class="edit_content">
<ul class="face_ul clr">
<li class="fl"><img src="__PUBLIC__/faces/ee_1.png" alt="" data-text="[):]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_2.png" alt="" data-text="[:D]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_3.png" alt="" data-text="[;)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_4.png" alt="" data-text="[:-o]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_5.png" alt="" data-text="[:p]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_6.png" alt="" data-text="[(H)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_7.png" alt="" data-text="[:@]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_8.png" alt="" data-text="[:s]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_9.png" alt="" data-text="[:$]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_10.png" alt="" data-text='[:(]'></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_11.png" alt="" data-text='[:"(]'></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_12.png" alt="" data-text="[:|]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_13.png" alt="" data-text="[(a)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_14.png" alt="" data-text="[8o|]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_15.png" alt="" data-text="[|]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_16.png" alt="" data-text="[+o(]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_17.png" alt="" data-text="[o)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_18.png" alt="" data-text="[|-)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_19.png" alt="" data-text="[*-)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_20.png" alt="" data-text="[:-#]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_21.png" alt="" data-text="[:-*]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_22.png" alt="" data-text="[^o)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_23.png" alt="" data-text="[8-)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_24.png" alt="" data-text="[(|)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_25.png" alt="" data-text="[(u)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_26.png" alt="" data-text="[(S)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_27.png" alt="" data-text="[(*)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_28.png" alt="" data-text="[(#)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_29.png" alt="" data-text="[(R)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_30.png" alt="" data-text="[({)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_31.png" alt="" data-text="[(})]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_32.png" alt="" data-text="[(k)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_33.png" alt="" data-text="[(F)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_34.png" alt="" data-text="[(W)]"></li>
<li class="fl"><img src="__PUBLIC__/faces/ee_35.png" alt="" data-text="[(D)]"></li>
</ul>
<div class="edit_title">
<img src="__PUBLIC__/icons/face.png" alt="" class="face">
<img src="__PUBLIC__/icons/pic.png" alt="" class="pic">
<input type="file" id="img_upload" style="display: none"
accept="image/gif, image/jpeg,image/jpg, image/png,image/bmp">
</div>
<div class="edit_input">
<textarea id="chat_textarea" class="chat_textarea"></textarea>
</div>
</div>
<div class="chat_item_content"> <div class="chat_item_content">
<!-- <div class="chat_item"> <!-- <div class="chat_item">
<div class="title clr"> <div class="title clr">
...@@ -40,7 +88,6 @@ ...@@ -40,7 +88,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<include file="public/foot" /> <include file="public/foot" />
<script src="__PUBLIC__/js/chat/webim.config.js"></script> <script src="__PUBLIC__/js/chat/webim.config.js"></script>
<script src="__PUBLIC__/js/chat/strophe-1.2.8.js"></script> <script src="__PUBLIC__/js/chat/strophe-1.2.8.js"></script>
...@@ -50,6 +97,14 @@ ...@@ -50,6 +97,14 @@
<script src="__PUBLIC__/js/chat/uploadShim.js"></script> <script src="__PUBLIC__/js/chat/uploadShim.js"></script>
<script> <script>
// var browser = navigator.appName;
// var b_version = navigator.appVersion;
// var version = b_version.split(";");
// var trim_Version = version[1].replace(/[ ]/g, "");
// if (browser == "Microsoft Internet Explorer" &&
// (trim_Version == "MSIE6.0" || trim_Version == "MSIE7.0" || trim_Version == "MSIE8.0" || trim_Version ==
// "MSIE9.0")) {
// }
var CurentTime = function () { var CurentTime = function () {
var now = new Date(); var now = new Date();
...@@ -84,16 +139,6 @@ ...@@ -84,16 +139,6 @@
clock += ss; clock += ss;
return (clock); return (clock);
} }
var layedit = layui.layedit;
layedit.set({
hideTool: ['strong', 'italic', 'underline', 'del', '|', 'left', 'center', 'right',
'link', 'unlink'
]
});
layedit.build('chat_textarea', {
height: 200
}); //建立编辑器
var conn = {}; var conn = {};
conn = new WebIM.connection({ conn = new WebIM.connection({
isMultiLoginSessions: WebIM.config.isMultiLoginSessions, isMultiLoginSessions: WebIM.config.isMultiLoginSessions,
...@@ -103,15 +148,52 @@ ...@@ -103,15 +148,52 @@
isAutoLogin: true, isAutoLogin: true,
heartBeatWait: WebIM.config.heartBeatWait, heartBeatWait: WebIM.config.heartBeatWait,
autoReconnectNumMax: WebIM.config.autoReconnectNumMax, autoReconnectNumMax: WebIM.config.autoReconnectNumMax,
autoReconnectInterval: WebIM.config.autoReconnectInterval, autoReconnectInterval: WebIM.config.autoReconnectInterval
delivery: true,
}); });
// 初始化上传组件 fileInputId对应页面上的file组件id // 初始化上传组件 fileInputId对应页面上的file组件id
WebIM.flashUpload = UploadShim({ WebIM.flashUpload = UploadShim({
fileInputId: 'image' fileInputId: 'image'
}, conn).flashUpload; }, conn).flashUpload;
WebIM.Emoji = {
path: '__PUBLIC__/faces/',
map: {
'[):]': 'ee_1.png',
'[:D]': 'ee_2.png',
'[;)]': 'ee_3.png',
'[:-o]': 'ee_4.png',
'[:p]': 'ee_5.png',
'[(H)]': 'ee_6.png',
'[:@]': 'ee_7.png',
'[:s]': 'ee_8.png',
'[:$]': 'ee_9.png',
'[:(]': 'ee_10.png',
'[:"(]': 'ee_11.png',
'[:|]': 'ee_12.png',
'[(a)]': 'ee_13.png',
'[8o|]': 'ee_14.png',
'[|]': 'ee_15.png',
'[+o(]': 'ee_16.png',
'[o)]': 'ee_17.png',
'[|-)]': 'ee_18.png',
'[*-)]': 'ee_19.png',
'[:-#]': 'ee_20.png',
'[:-*]': 'ee_21.png',
'[^o)]': 'ee_22.png',
'[8-)]': 'ee_23.png',
'[(|)]': 'ee_24.png',
'[(u)]': 'ee_25.png',
'[(S)]': 'ee_26.png',
'[(*)]': 'ee_27.png',
'[(#)]': 'ee_28.png',
'[(R)]': 'ee_29.png',
'[({)]': 'ee_30.png',
'[(})]': 'ee_31.png',
'[(k)]': 'ee_32.png',
'[(F)]': 'ee_33.png',
'[(W)]': 'ee_34.png',
'[(D)]': 'ee_35.png'
}
};
function userHtml(num, user, message) { function userHtml(num, user, message) {
if (num == 0) { if (num == 0) {
...@@ -140,35 +222,44 @@ ...@@ -140,35 +222,44 @@
return '<div class="notice_item right clr">' + return '<div class="notice_item right clr">' +
'<img src="__PUBLIC__/images/test.jpg" alt="" class="fr user_logo">' + '<img src="__PUBLIC__/images/test.jpg" alt="" class="fr user_logo">' +
'<div class="notice_content">' + '<div class="notice_content">' +
'<p>' +
html + html +
'</p>' +
'<div>' + CurentTime() + '</div>' + '<div>' + CurentTime() + '</div>' +
'</div>' '</div>'
} else { } else {
return '<div class = "notice_item left clr" > ' + return '<div class = "notice_item left clr" > ' +
'<img src="__PUBLIC__/images/test.jpg" alt="" class="fl user_logo">' + '<img src="__PUBLIC__/images/test.jpg" alt="" class="fl user_logo">' +
'<div class="notice_content">' + '<div class="notice_content">' +
'<p>' +
html + html +
'</p>' +
'<div>' + CurentTime() + '</div>' + '<div>' + CurentTime() + '</div>' +
'</div>' '</div>'
} }
} }
// listern,添加回调函数;
conn.listen({ function receiveData(type, message) { //1 文字 2 图片 3 表情
onOpened: function (message) { var regContent = "";
console.log("Opened"); var htmlStr = "";
}, if (type == 1) {
// onReadMessage:function(message){ regContent = message.data;
// console.log("onReadMessage", message) htmlStr = message.data;
// }, } else if (type == 2) {
// onDeliveredMessage:function(message){ regContent = '[图片]';
// console.log("onDeliveredMessage", message) htmlStr = '<img src ="' + message.url + '" class="edit_img"/>';
// }, } else {
// onReceivedMessage:function(message){ var data = message.data;
// console.log("onReceivedMessage", message) for (var i = 0, l = data.length; i < l; i++) {
// }, if (data[i].type == 'emoji') {
onTextMessage: function (message) { regContent += '[表情]';
var reg = /<img[^>]*>/ig; htmlStr += '<img src ="' + data[i].data + '" width=25 height=25/>';
var regContent = message.data.replace(reg, '[图片]'); } else {
regContent += data[i].data;
htmlStr += data[i].data;
}
};
}
var len = $('.notice_classify').length; var len = $('.notice_classify').length;
var userSigleStr = '<img src="__PUBLIC__/images/test.jpg" alt="" class="user_logo">' + var userSigleStr = '<img src="__PUBLIC__/images/test.jpg" alt="" class="user_logo">' +
'<div class="user_right">' + '<div class="user_right">' +
...@@ -188,7 +279,7 @@ ...@@ -188,7 +279,7 @@
'</div>' + '</div>' +
'<div class="notice_list boxsiz">' + '<div class="notice_list boxsiz">' +
'<div class="notice_item_content">' + '<div class="notice_item_content">' +
messageHtml(2, message.data) + messageHtml(2, htmlStr) +
'</div>' + '</div>' +
'</div>' + '</div>' +
'</div>' '</div>'
...@@ -199,8 +290,8 @@ ...@@ -199,8 +290,8 @@
userHtml(0, message.from, regContent) + '</div>'; userHtml(0, message.from, regContent) + '</div>';
var messageStr = '<div class="chat_item active" id="' + message.from + '">' + var messageStr = '<div class="chat_item active" id="' + message.from + '">' +
messageSigleStr + '</div>' messageSigleStr + '</div>'
$('.notice_left_content').html(userStr); $('.notice_left_content').append(userStr);
$('.chat_item_content').html(messageStr) $('.chat_item_content').append(messageStr)
} else { } else {
$('.notice_classify').each(function (index) { $('.notice_classify').each(function (index) {
var userId = $(this).attr('userid'); var userId = $(this).attr('userid');
...@@ -211,8 +302,7 @@ ...@@ -211,8 +302,7 @@
//当前用户 //当前用户
$(this).html(userHtml(0, message.from, regContent)); $(this).html(userHtml(0, message.from, regContent));
$('#' + userId).find('.notice_item_content').append(messageHtml(2, $('#' + userId).find('.notice_item_content').append(messageHtml(2,
message htmlStr));
.data));
var contentHeight = $('#' + userId).find('.notice_item_content') var contentHeight = $('#' + userId).find('.notice_item_content')
.height(); .height();
$('#' + userId).find('.notice_list').scrollTop(contentHeight); $('#' + userId).find('.notice_list').scrollTop(contentHeight);
...@@ -222,8 +312,7 @@ ...@@ -222,8 +312,7 @@
var num = Number($(this).find('.num').text()); var num = Number($(this).find('.num').text());
$(this).html(userHtml(num + 1, message.from, regContent)); $(this).html(userHtml(num + 1, message.from, regContent));
$('#' + userId).find('.notice_item_content').append(messageHtml(2, $('#' + userId).find('.notice_item_content').append(messageHtml(2,
message htmlStr));
.data));
} }
return false; return false;
...@@ -242,93 +331,31 @@ ...@@ -242,93 +331,31 @@
} }
}) })
} }
}
// listern,添加回调函数;
conn.listen({
onOpened: function (message) {
console.log(message);
console.log('opend')
},
onTextMessage: function (message) {
receiveData(1, message)
console.log(message)
}, //收到文本消息; }, //收到文本消息;
onEmojiMessage: function (message) {
// 当为WebIM添加了Emoji属性后,若发送的消息含WebIM.Emoji里特定的字符串,connection就会自动将
// 这些字符串和其它文字按顺序组合成一个数组,每一个数组元素的结构为{type: 'emoji(或者txt)', data:''}
// 当type='emoji'时,data表示表情图像的路径,当type='txt'时,data表示文本消息;
receiveData(3, message)
}, //收到表情消息;
onPictureMessage: function (message) { onPictureMessage: function (message) {
console.log('Picture');
var options = { var options = {
url: message.url url: message.url
}; };
options.onFileDownloadComplete = function () { options.onFileDownloadComplete = function () {
// 图片下载成功; // 图片下载成功;
var regContent ='[图片]'; receiveData(2, message)
var len = $('.notice_classify').length;
var htmlStr = '<img src ="'+message.url+'"/>'
var userSigleStr = '<img src="__PUBLIC__/images/test.jpg" alt="" class="user_logo">' +
'<div class="user_right">' +
'<div class="clr">' +
'<span class="num fr">0</span>' +
'<h3 class="boxsiz ellipsis">' + message.from + '</h3>' +
'</div>' +
'<div class="message">' + regContent + '</div>' +
'</div>'
var messageSigleStr =
'<div class="title clr">' +
'<div class="fr btn btn_border">' +
'<span class="icon iconfont iconjuxing23"></span>' +
'<i>' + message.from + '</i>' +
'</div>' +
'<h3 class="bold boxsiz">' + message.from + '</h3>' +
'</div>' +
'<div class="notice_list boxsiz">' +
'<div class="notice_item_content">' +
messageHtml(2, htmlStr) +
'</div>' +
'</div>' +
'</div>'
if (!len) {
//新用户
var userStr = '<div class="notice_classify active" userid="' + message.from + '">' +
userHtml(0, message.from, regContent) + '</div>';
var messageStr = '<div class="chat_item active" id="' + message.from + '">' +
messageSigleStr + '</div>'
$('.notice_left_content').html(userStr);
$('.chat_item_content').html(messageStr)
} else {
$('.notice_classify').each(function (index) {
var userId = $(this).attr('userid');
var isNowChat = $('.notice_classify').eq(index).hasClass('active');
if (userId == message.from) {
//已有用户
if (isNowChat) {
//当前用户
$(this).html(userHtml(0, message.from, regContent));
$('#' + userId).find('.notice_item_content').append(messageHtml(2,
message
.data));
var contentHeight = $('#' + userId).find('.notice_item_content')
.height();
$('#' + userId).find('.notice_list').scrollTop(contentHeight);
} else {
//非当前用户
var num = Number($(this).find('.num').text());
$(this).html(userHtml(num + 1, message.from, regContent));
$('#' + userId).find('.notice_item_content').append(messageHtml(2,
message
.data));
}
return false;
} else {
if (index == len - 1) {
//新用户
var userStr = '<div class="notice_classify" userid="' +
message.from + '">' +
userHtml(1, message.from, regContent) + '</div>';
var messageStr = '<div class="chat_item" id="' +
message.from + '">' +
messageSigleStr + '</div>'
$('.notice_left_content').append(userStr);
$('.chat_item_content').append(messageStr)
}
}
})
}
console.log('Image download complete!'); console.log('Image download complete!');
...@@ -351,21 +378,18 @@ ...@@ -351,21 +378,18 @@
// console.log('Error', WebIM.utils.stringify(message)); // console.log('Error', WebIM.utils.stringify(message));
console.log("Error: " + WebIM.utils.stringify(message)); console.log("Error: " + WebIM.utils.stringify(message));
}, //失败回调; }, //失败回调;
onBlacklistUpdate: function (list) {
// 查询黑名单,将好友拉黑,将好友从黑名单移除都会回调这个函数,list则是黑名单现有的所有好友信息;
// console.log(list);
} // 黑名单变动;
}); });
// open,登录; // open,登录;
var options = { var options = {
apiUrl: WebIM.config.apiURL, apiUrl: WebIM.config.apiURL,
user: "myy5", user: "18271408717",
pwd: "m", pwd: "123456",
appKey: WebIM.config.appkey appKey: WebIM.config.appkey
}; };
try { try {
conn.open(options); conn.open(options);
} catch (e) { } catch (e) {
console.log(WebIM.config.apiURL)
// alert('open fail' + e.message) // alert('open fail' + e.message)
} }
...@@ -374,30 +398,25 @@ ...@@ -374,30 +398,25 @@
var userId = $('.notice_left ').find('.active').attr('userid') var userId = $('.notice_left ').find('.active').attr('userid')
var id = conn.getUniqueId(); var id = conn.getUniqueId();
var msg = new WebIM.message('txt', id); var msg = new WebIM.message('txt', id);
var emojiMessage = WebIM.utils.parseEmoji(content); //表情解析工具
msg.set({ msg.set({
msg: content, // 消息内容; msg: content, // 消息内容;
<<<<<<< .mine
to: userId, // 接收消息对象; to: userId, // 接收消息对象;
=======
to: 'myy4', // 接收消息对象;
>>>>>>> .theirs
roomType: false, roomType: false,
success: function (id, serverMsgId) { success: function (id, serverMsgId) {
$('#' + userId).find('.notice_item_content').append(messageHtml(1, $('#' + userId).find('.notice_item_content').append(messageHtml(1,
content)); emojiMessage));
var contentHeight = $('#' + userId).find('.notice_item_content') var contentHeight = $('#' + userId).find('.notice_item_content')
.height(); .height();
$('#' + userId).find('.notice_list').scrollTop(contentHeight); $('#' + userId).find('.notice_list').scrollTop(contentHeight);
layedit.setContent(1, '', false) $('#chat_textarea').val('');
}, },
fail: function () { fail: function () {
console.log("Send private text failed"); console.log("Send private text failed");
} }
}); });
console.log(msg)
// msg.body.chatType = 'singleChat';
conn.send(msg.body); conn.send(msg.body);
}; };
...@@ -405,133 +424,86 @@ ...@@ -405,133 +424,86 @@
var sendPrivateImg = function () { var sendPrivateImg = function () {
var id = conn.getUniqueId(); var id = conn.getUniqueId();
var msg = new WebIM.message('img', id); var msg = new WebIM.message('img', id);
var input = document.getElementById('image'); // 选择图片的input; var input = $('#img_upload')[0]; // 选择图片的input;
var file = WebIM.utils.getFileUrl(input); // 将图片转化为二进制文件; var file = WebIM.utils.getFileUrl(input); // 将图片转化为二进制文件;
var userId = $('.notice_left').find('.active').attr('userid');
console.log('xixiixixiiiixixix')
try {
console.log(input.files[0])
} catch (e) {
console.log('GetFile Error:', e);
}
console.log('xixiixixiiiixixix')
var allowType = { var allowType = {
'jpg': true, 'jpg': true,
'gif': true, 'gif': true,
'png': true, 'png': true,
'bmp': true 'bmp': true
}; };
// if (file.filetype.toLowerCase() in allowType) {;
// console.log('send', WebIM.config.apiURL);
var option = { var option = {
apiUrl: WebIM.config.apiURL, apiUrl: WebIM.config.apiURL,
file: file, file: file,
to: 'myy4', to: '18664936975',
roomType: false, roomType: false,
chatType: 'singleChat', chatType: 'singleChat',
flashUpload: WebIM.flashUpload,
onFileUploadError: function () { onFileUploadError: function () {
console.log(file); console.log(file);
console.log('失败')
}, },
onFileUploadComplete: function () { onFileUploadComplete: function () {},
console.log('onFileUploadComplete');
},
success: function () { success: function () {
console.log(file); var htmlStr = '<img src ="' + file.url + '" class="edit_img"/>';
$('#' + userId).find('.notice_item_content').append(messageHtml(1,
htmlStr));
var contentHeight = $('#' + userId).find('.notice_item_content')
.height();
$('#' + userId).find('.notice_list').scrollTop(contentHeight);
$('#img_upload').val('');
}, },
flashUpload: WebIM.flashUpload // 意义待查;
}; };
msg.set(option); msg.set(option);
conn.send(msg.body); conn.send(msg.body);
// };
}; };
$('#chat_textarea').on('keydown', function (e) {
// 获取好友列表; var et = e || window.event;
var getRoasters = function () { var keycode = et.charCode || et.keyCode;
var option = { var val = $(this).val();
success: function (roster) { if ((keycode === 13)) {
if (window.event) {
for (var o in roster) { window.event.returnValue = false;
} else {
e.preventDefault();
}
if (val) {
sendPrivateText(val)
} }
} }
};
conn.getRoster(option);
};
// 添加好友;
var addFriends = function () {
console.log('添加myy4为好友')
conn.subscribe({
to: "myy4",
message: "Hello World!" // Demo里面接收方没有展现出来这个message,在status字段里面;
}); });
}; $('.pic').on('click', function () {
$('#img_upload').click();
// 删除好友;
var removeFriends = function () {
conn.removeRoster({
to: 'asdfghj',
success: function () {
conn.unsubscribed({
to: 'asdfghj'
}); });
}, $('.face').on('click', function (event) {
error: function () {} event.stopPropagation ? event.stopPropagation() : event.cancelBubble = true;
$('.face_ul').show();
}); });
}; $('.face_ul').on('click', 'li', function () {
var text = $(this).find('img').attr('data-text');
var addToBlackList = function () { var val = $('#chat_textarea').val();
var list = { $('#chat_textarea').val(val + text)
// user_1;
asdfghj: {
jid: "easemob-demo#chatdemoui_asdfghj@easemob.com",
name: "asdfghj",
subscription: 'both',
order: 2,
type: 'jid'
},
// user_2;
wjy6: {
jid: "easemob-demo#chatdemoui_wjy6@easemob.com",
name: "wjy6",
subscription: 'both',
order: 3,
type: 'jid'
}
};
conn.addToBlackList({
list: list,
type: 'jid',
success: function () {
// console.log('Add friend to black list success');
},
error: function () {
// console.log('Add friend to black list error');
}
});
}
// 获取好友黑名单,调用这个函数会回调conn.listen里的onBlacklistUpdate函数,具体细节请参照test.js;
var getBlackList = function () {
conn.getBlacklist();
};
// 将好友从黑名单拉出来;
var removeBlackList = function () {
var list = {};
conn.removeFromBlackList({
list: list,
type: 'jid',
success: function () {
// console.log('Remove from black list success.');
},
error: function () {
// console.log('Remove from black list error.')
}
}); });
}; $(document).on('click', function () {
layedit.hotkey(function () { $('.face_ul').hide()
var content = layedit.getContent(1); })
if(content !== '<p><br></p>'){ $('#img_upload').on('change', function () {
sendPrivateText(content) if ($(this).val()) {
sendPrivateImg();
}else{ } else {
return return;
} }
}); })
$('.notice_left').on('click', '.notice_classify', function () { $('.notice_left').on('click', '.notice_classify', function () {
var id = $(this).attr('userid'); var id = $(this).attr('userid');
$('#' + id).addClass('active').siblings('.chat_item').removeClass('active'); $('#' + id).addClass('active').siblings('.chat_item').removeClass('active');
......
...@@ -9,6 +9,5 @@ ...@@ -9,6 +9,5 @@
<!--[if IE 8]> <!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common/ie.css"> <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/common/ie.css">
<![endif]--> <![endif]-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/layui/css/layui.css">
\ No newline at end of file
...@@ -86,18 +86,74 @@ ...@@ -86,18 +86,74 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.chat_content .content .content_div .notice_right .edit_img {
cursor: pointer;
}
.chat_content .content .content_div .notice_right .chat_item { .chat_content .content .content_div .notice_right .chat_item {
display: none; display: none;
} }
.chat_content .content .content_div .notice_right .chat_item.active { .chat_content .content .content_div .notice_right .chat_item.active {
display: block; display: block;
} }
.chat_content .content .content_div .notice_right .layui-layedit { .chat_content .content .content_div .notice_right .edit_content {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
} }
.chat_content .content .content_div .notice_right .edit_content .face_ul {
width: 350px;
height: 140px;
-webkit-box-shadow: 0 0 4px 0 rgba(173, 185, 193, 0.5);
box-shadow: 0 0 4px 0 rgba(173, 185, 193, 0.5);
display: none;
position: absolute;
left: 0;
top: -140px;
z-index: 99;
background-color: #fff;
}
.chat_content .content .content_div .notice_right .edit_content .face_ul li {
height: 25px;
width: 25px;
padding: 5px;
cursor: pointer;
border-radius: 2px 2px 0 0;
}
.chat_content .content .content_div .notice_right .edit_content .face_ul li:hover {
background-color: #ebfaf4;
}
.chat_content .content .content_div .notice_right .edit_content .face_ul li img {
height: 100%;
width: 100%;
}
.chat_content .content .content_div .notice_right .edit_content .edit_title {
padding: 3px 5px;
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
}
.chat_content .content .content_div .notice_right .edit_content .edit_title img {
margin: 3px 5px;
cursor: pointer;
}
.chat_content .content .content_div .notice_right .edit_content .edit_title img.face {
height: 25px;
width: 25px;
}
.chat_content .content .content_div .notice_right .edit_content .edit_title img.pic {
height: 20px;
width: 20px;
}
.chat_content .content .content_div .notice_right .edit_content .edit_input {
height: 150px;
padding: 10px;
}
.chat_content .content .content_div .notice_right .edit_content .edit_input .chat_textarea {
height: 100%;
width: 100%;
line-height: 20px;
resize: none;
}
.chat_content .content .content_div .notice_right .title { .chat_content .content .content_div .notice_right .title {
border-bottom: 2px solid #E6ECF2; border-bottom: 2px solid #E6ECF2;
} }
...@@ -121,7 +177,7 @@ ...@@ -121,7 +177,7 @@
top: 90px; top: 90px;
left: 0; left: 0;
right: 0; right: 0;
bottom: 244px; bottom: 210px;
overflow: auto; overflow: auto;
padding: 10px 20px; padding: 10px 20px;
} }
...@@ -166,4 +222,3 @@ ...@@ -166,4 +222,3 @@
color: #ADB6BF; color: #ADB6BF;
padding: 10px 15px; padding: 10px 15px;
} }
/*# sourceMappingURL=chat.css.map */
\ No newline at end of file
...@@ -105,17 +105,87 @@ ...@@ -105,17 +105,87 @@
left: 248px; left: 248px;
right: 0; right: 0;
bottom: 0; bottom: 0;
.chat_item{
.edit_img {
cursor: pointer;
}
.chat_item {
display: none; display: none;
&.active{
&.active {
display: block display: block
} }
} }
.layui-layedit {
.edit_content {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
.face_ul {
width: 350px;
height: 140px;
-webkit-box-shadow: 0 0 4px 0 rgba(173, 185, 193, 0.5);
box-shadow: 0 0 4px 0 rgba(173, 185, 193, 0.5);
display: none;
position: absolute;
left:0;
top:-140px;
z-index:99;
background-color: #fff;
li {
height: 25px;
width: 25px;
padding: 5px;
cursor: pointer;
border-radius: 2px 2px 0 0;
&:hover {
background-color: #ebfaf4;
}
img {
height: 100%;
width: 100%;
}
}
}
.edit_title {
padding: 3px 5px;
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
img {
margin: 3px 5px;
cursor: pointer;
&.face {
height: 25px;
width: 25px;
}
&.pic {
height: 20px;
width: 20px;
}
}
}
.edit_input {
height: 150px;
padding: 10px;
.chat_textarea {
height: 100%;
width: 100%;
line-height: 20px;
resize: none;
}
}
} }
.title { .title {
...@@ -145,7 +215,7 @@ ...@@ -145,7 +215,7 @@
top: 90px; top: 90px;
left: 0; left: 0;
right: 0; right: 0;
bottom: 244px; bottom: 210px;
overflow: auto; overflow: auto;
padding: 10px 20px; padding: 10px 20px;
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
/***/ 223: /***/ function (module, exports, __webpack_require__) { /***/ 223: /***/ function (module, exports, __webpack_require__) {
'use strict'; // 'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj; return typeof obj;
...@@ -264,10 +264,9 @@ ...@@ -264,10 +264,9 @@
_isCanUploadFileAsync = _isCanSetRequestHeader && _hasFormData, _isCanUploadFileAsync = _isCanSetRequestHeader && _hasFormData,
_isCanUploadFile = _isCanUploadFileAsync || _hasFlash, _isCanUploadFile = _isCanUploadFileAsync || _hasFlash,
_isCanDownLoadFile = _isCanSetRequestHeader && (_hasBlob || _hasOverrideMimeType); _isCanDownLoadFile = _isCanSetRequestHeader && (_hasBlob || _hasOverrideMimeType);
console.log('hahah')
if (!Object.keys) { if (!Object.keys) {
Object.keys = function () { Object.keys = function () {
'use strict'; // 'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty, var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !{toString: null}.propertyIsEnumerable('toString'), hasDontEnumBug = !{toString: null}.propertyIsEnumerable('toString'),
...@@ -1113,7 +1112,7 @@ ...@@ -1113,7 +1112,7 @@
/***/ 224: /***/ function (module, exports) { /***/ 224: /***/ function (module, exports) {
"use strict"; // "use strict";
; ;
(function () { (function () {
...@@ -1206,7 +1205,7 @@ ...@@ -1206,7 +1205,7 @@
/***/ 230: /***/ function (module, exports, __webpack_require__) { /***/ 230: /***/ function (module, exports, __webpack_require__) {
'use strict'; // 'use strict';
module.exports = __webpack_require__(231); module.exports = __webpack_require__(231);
...@@ -1215,7 +1214,7 @@ ...@@ -1215,7 +1214,7 @@
/***/ 231: /***/ function (module, exports, __webpack_require__) { /***/ 231: /***/ function (module, exports, __webpack_require__) {
'use strict'; // 'use strict';
var _version = '1.4.2'; var _version = '1.4.2';
var _code = __webpack_require__(224).code; var _code = __webpack_require__(224).code;
...@@ -4080,11 +4079,11 @@ ...@@ -4080,11 +4079,11 @@
/***/ 232: /***/ function (module, exports, __webpack_require__) { /***/ 232: /***/ function (module, exports, __webpack_require__) {
'use strict'; // 'use strict';
; ;
(function () { (function () {
'use strict'; // 'use strict';
var _utils = __webpack_require__(223).utils; var _utils = __webpack_require__(223).utils;
var Message = function Message(type, id) { var Message = function Message(type, id) {
...@@ -4404,7 +4403,7 @@ ...@@ -4404,7 +4403,7 @@
/***/ 233: /***/ function (module, exports) { /***/ 233: /***/ function (module, exports) {
"use strict"; // "use strict";
; ;
(function () { (function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment