6
6
<script src="shared.js"></script>
7
7
<script src="switchStyle.js"></script>
8
8
<script src="xmlextras.js"></script>
9
<script src="JSJaCPacket.js"></script>
9
<script src="jsjac.js"></script>
10
10
<script language="JavaScript1.2">
13
13
var srcW; // the source window with necessary data
15
15
function sendSub() {
16
var aPresence = new JSJaCPresence();
17
aPresence.setType('subscribe');
16
var aPresence = new JSJaCPresence();
17
aPresence.setType('subscribe');
19
19
if (!document.forms[0].to.value || document.forms[0].to.value == '') {
20
20
alert("JID missing");
29
29
aPresence.setTo(to);
30
30
if (document.forms[0].msg.value && document.forms[0].msg.value != '')
31
aPresence.setStatus(document.forms[0].msg.value);
31
aPresence.setStatus(document.forms[0].msg.value);
33
srcW.con.syncSend(aPresence);
33
srcW.con.send(aPresence);
38
38
function selectService(selbox) {
39
var el = selbox.options[selbox.selectedIndex];
40
var to = document.forms[0].elements['to'];
42
var i = to.value.indexOf('@');
44
to.value = to.value.substring(0,i);
46
to.value += "@" + el.value;
39
var el = selbox.options[selbox.selectedIndex];
40
var to = document.forms[0].elements['to'];
42
var i = to.value.indexOf('@');
44
to.value = to.value.substring(0,i);
46
to.value += "@" + el.value;
60
60
document.title += (jid)?" to " + jid:"";
62
62
document.forms[0].to.value = jid;
66
var services = document.forms[0].elements["services"];
68
for (var i in srcW.disco) {
69
if (srcW.disco[i].getNode().getElementsByTagName('identity').item(0)) {
70
var item = srcW.disco[i].getNode().getElementsByTagName('identity').item(0);
71
if (item.getAttribute('category') == 'gateway')
72
services.options[optidx++] = new Option(item.getAttribute('name'),srcW.disco[i].getFrom());
66
var services = document.forms[0].elements["services"];
68
for (var i in srcW.disco) {
69
if (!srcW.disco[i].getNode) continue;
70
if (srcW.disco[i].getNode().getElementsByTagName('identity').item(0)) {
71
var item = srcW.disco[i].getNode().getElementsByTagName('identity').item(0);
72
if (item.getAttribute('category') == 'gateway')
73
services.options[optidx++] = new Option(item.getAttribute('name'),srcW.disco[i].getFrom());
97
98
<body style="margin:8px">
98
99
<form name="sub" style="border:0;padding:0;margin:0;" onSubmit="return sendSub();">
99
<table border=0 width="100%" height="100%">
100
<tr><td nowrap>Search for a User:</td><td><button onClick="return srcW.openSearch();">Open Search</button></td></tr>
100
<table border="0" width="100%" height="100%">
101
<tr><td nowrap>Search for a User:</td><td><button onClick="return srcW.openSearch();">Open Search</button></td></tr>
101
102
<tr><td colspan=2><hr noshade size="1" size="100%"></td></tr>
103
<td align='right' nowrap><label for="to">Send subscription to</label></td>
104
<td width="100%"><input type="text" id="to" name="to" size="1" style="width:100%;" tabindex=1></td>
107
<td nowrap align="right"><label for="services">Service (optional)</label></td>
109
<select name="services" id="services" onChange="selectService(this);" tabindex=2><option value=''>local jabber user</option></select>
104
<td align="right" nowrap><label for="to">Send subscription to</label></td>
105
<td width="100%"><input type="text" id="to" name="to" size="1" style="width:100%;" tabindex="1"></td>
108
<td nowrap align="right"><label for="services">Service (optional)</label></td>
110
<select name="services" id="services" onChange="selectService(this);" tabindex="2"><option value="">local jabber user</option></select>
112
113
<tr height="100%">
114
<textarea id="msg" wrap="physical" class="msgBox" tabindex=3>I would like to add you to my roster.</textarea>
117
<tr><td colspan=2><hr noshade size="1" size="100%"></td></tr>
115
<textarea id="msg" wrap="physical" class="msgBox" tabindex="3">I would like to add you to my roster.</textarea>
118
<tr><td colspan="2"><hr noshade size="1" size="100%"></td></tr>
119
<td colspan=2 align="right">
120
<button onClick="window.close();" tabindex=5>Cancel</button> <button type="submit" tabindex=4>Send</button>
120
<td colspan="2" align="right">
121
<button type="button" onClick="window.close();" tabindex="5">Cancel</button> <button type="submit" tabindex="4">Send</button>