-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubscriptionRequest.html
More file actions
92 lines (78 loc) · 2.6 KB
/
Copy pathsubscriptionRequest.html
File metadata and controls
92 lines (78 loc) · 2.6 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JWChat - Subscription-Request</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script src="shared.js"></script>
<script src="emoticons.js"></script>
<script src="switchStyle.js"></script>
<script src="jsjac.js"></script>
<script>
<!--
var jid;
var msg;
var srcW; // the source window with necessary data
function sendSub() {
var aPresence = new JSJaCPresence();
aPresence.setTo(jid);
aPresence.setType('subscribed');
srcW.con.send(aPresence);
// maybe we want to subscribe to?
var user = srcW.roster.getUserByJID(jid);
if (!user || (user.subscription != 'both' && user.subscription != 'to'))
srcW.openSubscription(jid);
window.close();
}
function sendUnsub() {
var aPresence = new JSJaCPresence();
aPresence.setTo(jid);
aPresence.setType('unsubscribed');
window.close();
}
function init() {
// determine source window
srcW = opener;
getArgs();
jid = passedArgs['jid'];
if (typeof(passedArgs['msg']) != 'undefined')
msg = passedArgs['msg'];
document.title = "Subscribe request from "+jid;
var from = "<b><span class=\"link\" onClick=\"return srcW.openUserInfo('"+jid+"');\" title=\""+"show user info for "+jid+"\">"+jid.substring(0,jid.indexOf('@'))+"</a></b> ";
document.getElementById("requestingUser").innerHTML = from;
if (msg)
msgbox.document.body.innerHTML = msgFormat(msg);
}
function keyPressed(e) {
if (e.ctrlKey && e.keyCode == 13)
sendSub();
else if (e.keyCode == 27)
window.close();
}
onkeydown = keyPressed;
onload = init;
//-->
</script>
<script for="document" event="onkeydown()" language="JScript">
<!--
if (window.event.ctrlKey && window.event.keyCode == 13)
sendSub();
if (window.event.keyCode == 27)
window.close();
//-->
</script>
</head>
<body style="margin:8px;">
<table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0 style="margin-bottom: 8px;">
<tr><td>
<span id="requestingUser"></span> wants to add you to his roster:
</td></tr>
<tr height="100%"><td style="padding-top: 4px;"><iframe src="chat_iframe.html" id="msgbox" name="msgbox" scrolling="yes" class="msgbox"></iframe></td></tr>
<form name="sub">
<tr><td><hr noshade size="1" size="100%"></td></tr>
<tr><td align="right">
<button onClick="return sendUnsub();">Deny</button> <button onClick="return sendSub();" tabindex=1>Allow</button>
</td></tr>
</form>
</table>
</body>
</html>