Social_wev8.js
2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
function initAtwho(targetid,url){
var allatids = ",";
var datas=[{"uid":"1","data":"张三","datapy":"zs"},{"uid":"2","data":"李四","datapy":"ls"}];
/*
var names =jQuery.map(datas, function(value, i) {
if (allatids.indexOf("," + value.id + ",") == -1) {
allatids += value.id + ",";
alert("value.uid:"+value.id+" value.data:"+value.name+" value.datapy:"+value.py);
return {'id':value.id,'name':value.name, 'py':value.py};
}
});
*/
url=url?url:"/social/SocialGetData.jsp";
var at_config = {
at: "@",
data: url,
tpl: "<li data-value='@${name}'>${name}</li>",
insert_tpl: "<a href='/hrm/HrmTab.jsp?_fromURL=HrmResource&id=${id}' class='hrmecho' _relatedid='${id}' atsome='@${id}' contenteditable='false' style='cursor:pointer;text-decoration:none !important;margin-right:8px;' target='_blank'>${atwho-data-value}</a>",
limit: 200,
callbacks:{before_save:function(data){
//alert("1111");
var names =jQuery.map(data, function(value, i) {
if (allatids.indexOf("," + value.id + ",") == -1) {
allatids += value.id + ",";
return {'id':value.id,'name':value.name, 'py':value.py};
}
});
return names;
}},
show_the_at: true,
start_with_space : false,
with_repeat_matcher : false,
search_key_py : 'py'
}
$('#'+targetid).atwho(at_config);
}
function initCxScroll(){
$("#msgTipList .uimg").each(function(){
$(this).replaceWith("[图片]");
});
$("#msgTipList .faceicon").each(function(){
$(this).replaceWith("[表情]");
});
$('#msgTipList').cxScroll({
direction: 'bottom',
speed: 500,
time: 1500,
plus: false,
minus: false,
prevBtn:false,
nextBtn:false
});
}
function initPageEvent(){
//没有创建群组、百科分享、同事圈分享,右边的提示
$(".noneTip").live("mouseenter",function(){
$(this).html($(this).attr("_activeTip"));
}).live("mouseleave",function(){
$(this).html($(this).attr("_normalTip"));
});
$(".groupMsgdiv").live("mouseenter",function(){
$(this).find(".gmoptdiv").show();
}).live("mouseleave",function(){
$(this).find(".gmoptdiv").hide();
});
$(".sharetable").live("mouseenter",function(){
$(this).find(".share_optionItems").show();
}).live("mouseleave",function(){
$(this).find(".share_optionItems").hide();
});
}
function initFancyImg(obj){
$(obj).fancybox({
'overlayShow' : false,
'titleShow':false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'type':'image'
});
}