wmForWeb.jsp
8.49 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<jsp:useBean id="PluginLicense" class="weaver.license.PluginLicenseForInterface" scope="page" />
<jsp:useBean id="GetPhysicalAddress" class="weaver.system.GetPhysicalAddress" scope="page" />
<jsp:useBean id="PluginUserCheck" class="weaver.license.PluginUserCheck" scope="page" />
<jsp:useBean id="MessagerSettingCominfo" class="weaver.messager.MessagerSettingCominfo" scope="page" />
<%@ page import="weaver.general.Util"%>
<%@ include file="/page/maint/common/initNoCache.jsp" %>
<%
request.setCharacterEncoding("UTF-8");
String loginid = Util.null2String(request.getParameter("loginid"));
String psw = Util.null2String(request.getParameter("psw"));
String width = Util.null2String(request.getParameter("width"));
String height = Util.null2String(request.getParameter("height"));
int pingInterval = Util.getIntValue(Util.null2String(MessagerSettingCominfo.getSettingValueByName("PingInterval")),15000);
int licenseState=PluginLicense.getLicenseState("messager");
int userAccess = PluginUserCheck.checkPluginUserRight("messager",user.getUID()+"");
licenseState=1;
userAccess=1;
if(licenseState!=1){
out.println("<div style='border:1px solid #ccc;padding:20px;padding-top:200px;padding-bottom:200px;'>"+PluginLicense.getErrorMsg(licenseState)+"<br>"+SystemEnv.getHtmlLabelName(24528, user.getLanguage())+"。<br>"+SystemEnv.getHtmlLabelName(18639, user.getLanguage())+":<br>"
+"<span style='word-break:break-all'>"+Util.getEncrypt(GetPhysicalAddress.getPhysicalAddress())+"</span></div>");
} else if(userAccess!=1) {
out.println("<div style='border:1px solid #ccc;padding:20px;padding-top:200px;padding-bottom:200px;'>"+SystemEnv.getHtmlLabelName(24529, user.getLanguage())+"!</div>");
} else {
%>
<style type="text/css" media="screen">
object:focus {
outline: none;
}
#flashContent {
display: none;
}
</style>
<script type="text/javascript" src="/messager/flex/swfobject_wev8.js"></script>
<script type="text/javascript">
var swfVersionStr = "10.0.0";
var xiSwfUrlStr = "/messager/flex/playerProductInstall.swf";
var flashvars = {
loginid:"<%=loginid%>",
psw:"<%=psw%>",
remoteEcologyServer:"",
remoteServiceUrl:"/Messager/MessagerServlet",
remoteOpenFireServer:Config.JABBERSERVER,
pingInterval:"<%=pingInterval%>"
};
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
//params.wmode="transparent";
var attributes = {};
attributes.id = "wmForWeb";
attributes.name = "wmForWeb";
attributes.align = "middle";
swfobject.embedSWF(
"/messager/flex/wmForWeb.swf", "flashContent",
"<%=width%>", "<%=height%>",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
<div id="flashContent">
<p>To view this page ensure that Adobe Flash Player version 10.0.0
or greater is installed.</p>
<script type="text/javascript">
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player_wev8.gif' alt='Get Adobe Flash player' /></a>" );
</script></div>
<%}%>
<script language="javascript">
var isMesasgerUnavailable=true;
var jidCurrent="<%=loginid%>"+"@"+Config.JABBERSERVER;
var windowTitleOld=window.document.title;
/*For common*/
function getUserIconPath(loginid) {
str = document.getElementById("wmForWeb").getUserIconPath(loginid);
return str;
}
function changeMessageWindowIcon(item) {
//alert(item.loginid+"===="+item.state+"====="+ControlWindow.isWindowExist(item.loginid))
if (ControlWindow.isWindowExist(item.loginid)) {
ControlWindow.getWindow(item.loginid).changeLogo(getUserStateImg(item.state));
}
}
function reloadMyLogo(){
document.getElementById("wmForWeb").reloadMyLogo();
}
function logoutForMessager() {
try {
document.getElementById("wmForWeb").doDisconnect();
} catch (e) {
}
}
function openHistory(item) {
try {
openPage("allhistory",jidCurrent,rMsg.toolHistory);
} catch (e) {
}
}
/*For Presence Manager begin..............*/
function getUserStateImg(state) {
switch (state) {
case "Free To Chat":
return "/messager/images/status/im_free_chat_wev8.png";
case "Available":
return "/messager/images/status/im_available_wev8.png";
case "Away":
return "/messager/images/status/im_away_wev8.png";
case "On Phone":
return "/messager/images/status/on-phone_wev8.png";
case "Extended Awa":
return "/messager/images/status/im_away_wev8.png";
case "On The Road":
return "/messager/images/status/airplane_wev8.png";
case "Do Not Disturb":
return "/messager/images/status/im_dnd_wev8.png";
case "msg":
return "/messager/images/msgComing_wev8.gif";
default:
return "/messager/images/status/im_unavailable_wev8.png";
}
}
function changeMyPrense(user) {
if (user.state == "unavailable") {
$("#divMessager").fadeOut("normal");
isMessagerShow=false;
$("#tdMessageState").html("");
$("#tdMessageState").append("<img src='" + getUserStateImg(user.state) + "' id='imgMsgStateBar' align='absmiddle' width='16px' title='" + rMsg.offline + "' isMsgAlert='false'/>");;
isMesasgerUnavailable = true;
} else {
if ($("#imgMsgStateBar").attr("isMsgAlert") != "true") {
$("#tdMessageState").html("");
$("#tdMessageState").append("<img src='" + getUserStateImg(user.state) + "' id='imgMsgStateBar' align='absmiddle' width='16px' title='" + user.sign + "'/>");;
}
isMesasgerUnavailable = false;
}
}
/*For Msg Manager begin..............*/
function isMessageWindowShow(msg) {
var fromJid = msg.fromJid;
if (ControlWindow.isWindowExist(fromJid)) {
var win = ControlWindow.getWindow(fromJid);
return win.isShow;
} else {
return false;
}
}
function messageWindowShow(msg, user) {
var img = getUserStateImg(user.state)
var win = ControlWindow.getWindow(user.loginid, user.lastname, img, img,user);
win.show();
if(msg!=null){
ControlWindow.getWindow(msg.fromJid).receive(msg.body, msg.fromJid,msg.receiveTime)
}
}
function messagerIconStateShow(count, state, sign) {
if (count > 0) {
$("#tdMessageState").html("");
$("#tdMessageState").append("<img src='" + getUserStateImg("msg") + "' id='imgMsgStateBar' align='absmiddle' width='16px' title='" + rMsg.controlUserMessageHave + count +rMsg.controlUserMessageCount + "' isMsgAlert='true'/>");;
} else {
$("#tdMessageState").html("");
$("#tdMessageState").append("<img src='" + getUserStateImg(state) + "' id='imgMsgStateBar' align='absmiddle' width='16px' title='" + sign + "' isMsgAlert='false'/>");;
}
}
function windowTitleMsg(strMsg) {
if ($.trim(strMsg) != "") {
TitleFlash.setTitle(strMsg);
TitleFlash.go();
} else {
//alert(windowTitleOld)
TitleFlash.stop();
window.setTimeout(function() {
document.title=windowTitleOld;
}, 1000);
}
}
function doShowAllTempMsg() {
try{
document.getElementById("wmForWeb").popAllMsg();
} catch(e){}
}
function sendMessage(sendto, msg) {
//msg=msg+" ";
document.getElementById("wmForWeb").sendMessage(sendto, msg);
}
/*For TitleFlash.................
* 调用方法
* TitleFlash.stop();
* TitleFlash.setTitle(str);
* TitleFlash.go();
*/
var TitleFlash = (function() {
var msg = "";
var msgud = " " + msg;
var isStop=false;
function titleScroll() {
try{
if (msgud.length < msg.length)
msgud += " - " + msg;
msgud = msgud.substring(1, msgud.length);
if (!isStop) {
T = window.setTimeout(function() {
titleScroll()
}, 500)
document.title = msgud.substring(0, msg.length);
} else {
msg = "";
msgud = " " + msg;
}
} catch(e){
}
}
return {
setTitle : function(title) {
msg = title;
},
go : function() {
titleScroll();
},
stop : function() {
isStop=true
}
}
})();
var Page={
showMessage:function(loginid){
document.getElementById("wmForWeb").popSomeBodyMsg(loginid);
}
}
function messageTips(msg) {
document.getElementById('msgTips').contentWindow.doPopup("1,<tr><td width='13'><img src='/images/PopupMsgDot_wev8.gif'></td><td><a href='#' id='messagerTips'>" + msg + "</a></td></tr>");
}
</script>