~ubuntu-branches/ubuntu/trusty/jwchat/trusty

« back to all changes in this revision

Viewing changes to vcard.html.vi_VN

  • Committer: Bazaar Package Importer
  • Author(s): Lincoln de Sousa, Lincoln de Sousa, Marcelo Jorge Vieira
  • Date: 2010-09-16 11:42:28 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100916114228-5s5ne28n1w6wrfbl
Tags: 1.0+dfsg-1
[Lincoln de Sousa]

* Switch to dpkg-source 3.0 (quilt) format
* Migrating package from cdbs to debhelper 7.0.50~
* Changing the rule get-orig-source to generate a dfsg compatible
  package striping swf files from the orig (Closes: #591962)
* Updated Standards-Version to 3.9.1
* Removing po-debconf from the Build-Depends-Indep list.

[Marcelo Jorge Vieira]

* Fixing the default backend
* Fixing Debugger dependency
* Changing information about packaging from old maintainers to
  Debian XMPP Team.
* Removing sound support.
* Setting a port for apache VirtualHost.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
  <head>
4
 
    <title>JWChat - VCard - </title>
5
 
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
6
 
    <script src="shared.js"></script>
7
 
    <script src="switchStyle.js"></script>
8
 
    <script src="xmlextras.js"></script>
9
 
    <script src="jsjac.js"></script>
10
 
    <script>
11
 
      <!--
12
 
var jid , vcard;
13
 
var srcW; // the source window with necessary data
14
 
 
15
 
function sendSub() {
16
 
  var iq = new JSJaCIQ();
17
 
  iq.setType('set');
18
 
  
19
 
  var vCard = iq.appendNode('vCard', {'xmlns': 'vcard-temp'});
20
 
  
21
 
  for (var i=0; i<document.forms[0].elements.length; i++) {
22
 
    var item = document.forms[0].elements[i];
23
 
    if (item.id == '') continue;
24
 
    if (item.value == '' ) continue;
25
 
    if (item.id.indexOf('.') != -1) {
26
 
      var tagname = item.id.substring(0,item.id.indexOf('.'));
27
 
      var aNode;
28
 
      if (vCard.getElementsByTagName(tagname).length > 0)
29
 
        aNode = vCard.getElementsByTagName(tagname).item(0);
30
 
      else
31
 
        aNode = vCard.appendChild(iq.getDoc().createElement(tagname));
32
 
      aNode.appendChild(iq.getDoc().createElement(item.id.substring(item.id.indexOf('.')+1))).appendChild(iq.getDoc().createTextNode(item.value));
33
 
    } else {
34
 
      vCard.appendChild(iq.getDoc().createElement(item.id)).appendChild(iq.getDoc().createTextNode(item.value));
35
 
    }
36
 
  }
37
 
  srcW.Debug.log(iq.xml(),3);
38
 
  srcW.con.send(iq);
39
 
  window.close();
40
 
}
41
 
 
42
 
function init() {
43
 
  srcW = opener.top;
44
 
  
45
 
  getArgs();
46
 
  
47
 
  jid = passedArgs['jid'];
48
 
  document.title += jid;
49
 
  
50
 
  for (var i=0; i<document.forms[0].elements.length;i++) {
51
 
    if (document.forms[0].elements[i].id == '') continue;
52
 
    if (cutResource(jid) != srcW.cutResource(srcW.jid)) {
53
 
      document.forms[0].elements[i].className = "vcardBox";
54
 
      document.forms[0].elements[i].readOnly = true;
55
 
    }
56
 
  }
57
 
  
58
 
  if (cutResource(jid) != srcW.cutResource(srcW.jid))
59
 
    document.getElementById("savebox").style.display = 'none';
60
 
  
61
 
  // request vcard
62
 
  
63
 
  var iq = new JSJaCIQ();
64
 
  iq.setType('get');
65
 
  if (cutResource(jid) != srcW.cutResource(srcW.jid)) // not me
66
 
    iq.setTo(jid);
67
 
  iq.appendNode('vCard', {'xmlns': 'vcard-temp'});
68
 
  me = this;
69
 
  srcW.con.send(iq,me.handleVCard);
70
 
}
71
 
 
72
 
function handleVCard(iq) {
73
 
  if (!iq) {
74
 
    srcW.Debug.log('got empty iq result',1);
75
 
    return;
76
 
  }
77
 
  
78
 
  srcW.Debug.log(iq.xml(),3);
79
 
  
80
 
  if (iq.getNode().getElementsByTagName('vCard').item(0)) {
81
 
    for (var i=0; i<iq.getNode().getElementsByTagName('vCard').item(0).childNodes.length; i++) {
82
 
      var token = iq.getNode().getElementsByTagName('vCard').item(0).childNodes.item(i);
83
 
      tokenname = token.nodeName;
84
 
      if (token.firstChild && token.firstChild.nodeType != 3) { // found a container
85
 
        for (var j=0; j<token.childNodes.length; j++) {
86
 
          if (typeof(document.forms[0].elements[tokenname+"."+token.childNodes.item(j).nodeName]) != 'undefined' && token.childNodes.item(j).firstChild)
87
 
            document.forms[0].elements[tokenname+"."+token.childNodes.item(j).nodeName].value = token.childNodes.item(j).firstChild.nodeValue;
88
 
        }
89
 
        
90
 
      } else
91
 
        if (typeof(document.forms[0].elements[tokenname]) != 'undefined' && token.firstChild)
92
 
          document.forms[0].elements[tokenname].value = token.firstChild.nodeValue;
93
 
    }
94
 
  }
95
 
}
96
 
 
97
 
function keyPressed(e) {
98
 
  if (e.keyCode == 27)
99
 
    window.close();
100
 
}
101
 
onkeydown = keyPressed;
102
 
                onload = init;
103
 
//-->
104
 
</script>
105
 
<script for="document" event="onkeydown()" language="JScript">
106
 
<!--
107
 
 if (window.event.keyCode == 27)
108
 
  window.close();
109
 
//-->
110
 
</script>
111
 
<style type="text/css">
112
 
/*<![CDATA[*/
113
 
 th { 
114
 
  font-family: sans-serif;
115
 
  font-size: 12px;
116
 
    text-align: right;
117
 
}
118
 
/*]]>*/
119
 
</style>
120
 
</head>
121
 
<body style="margin:8px">
122
 
<form>
123
 
    <fieldset>
124
 
      <legend>Name</legend>
125
 
      <table>
126
 
          <tr><th nowrap>Full Name:</th><td width="100%"><input type=text id="FN" class="vcardBoxEditable"></td></tr>
127
 
          <tr><th nowrap>Family Name:</th><td width="100%"><input type=text id="N.FAMILY" class="vcardBoxEditable"></td></tr>
128
 
          <tr><th nowrap>Name:</th><td width="100%"><input type=text id="N.GIVEN" class="vcardBoxEditable"></td></tr>
129
 
          <tr><th nowrap>Nickname:</th><td width="100%"><input type=text id="NICKNAME" class="vcardBoxEditable"></td></tr>
130
 
      </table>
131
 
    </fieldset>
132
 
    
133
 
    <fieldset>
134
 
      <legend>Information</legend>
135
 
      <table>
136
 
          <tr><th nowrap>E-mail:</th><td width="100%"><input type=text id="EMAIL" class="vcardBoxEditable"></td></tr>
137
 
          <tr><th nowrap>Web Site:</th><td width="100%"><input type=text id="URL" class="vcardBoxEditable"></td></tr>
138
 
      </table>
139
 
    </fieldset>
140
 
    
141
 
    <fieldset>
142
 
      <legend>Address</legend>
143
 
      <table>
144
 
          <tr><th nowrap>Address:</th><td width="100%"><input type=text id="ADR.STREET" class="vcardBoxEditable"></td></tr>
145
 
          <tr><th nowrap>Address2:</th><td width="100%"><input type=text id="ADR.EXTADD" class="vcardBoxEditable"></td></tr>
146
 
          <tr><th nowrap>City:</th><td width="100%"><input type=text id="ADR.LOCALITY" class="vcardBoxEditable"></td></tr>
147
 
          <tr><th nowrap>State:</th><td width="100%"><input type=text id="ADR.REGION" class="vcardBoxEditable"></td></tr>
148
 
          <tr><th nowrap>Postal Code:</th><td width="100%"><input type=text id="ADR.PCODE" class="vcardBoxEditable"></td></tr>
149
 
          <tr><th nowrap>Country:</th><td width="100%"><input type=text id="ADR.CTRY" class="vcardBoxEditable"></td></tr>
150
 
      </table>
151
 
    </fieldset>
152
 
 
153
 
    <fieldset>
154
 
      <legend>Organization</legend>
155
 
      <table>
156
 
          <tr><th nowrap>Name:</th><td width="100%"><input type=text id="ORG.ORGNAME" class="vcardBoxEditable"></td></tr>
157
 
          <tr><th nowrap>Unit:</th><td width="100%"><input type=text id="ORG.ORGUNIT" class="vcardBoxEditable"></td></tr>
158
 
          <tr><th nowrap>Title:</th><td width="100%"><input type=text id="TITLE" class="vcardBoxEditable"></td></tr>
159
 
          <tr><th nowrap>Role:</th><td width="100%"><input type=text id="ROLE" class="vcardBoxEditable"></td></tr>
160
 
      </table>
161
 
    </fieldset>
162
 
 
163
 
    <fieldset>
164
 
      <legend>About</legend>
165
 
      <table width="100%">
166
 
          <tr><th>Birthday:</th><td width="100%"><input type=text id="BDAY" class="vcardBoxEditable"></td></tr>
167
 
                <tr><td colspan=2>&nbsp;</td></tr>
168
 
          <tr><th>Description:</th><td width="100%">&nbsp;</td></tr>
169
 
          <tr><td colspan=2 width="100%"><textarea id="DESC" class="vcardBoxEditable" style="width:100%;" rows=4 wrap=virtual></textarea></td></tr>
170
 
      </table>
171
 
    </fieldset>
172
 
    <div id="savebox">
173
 
                <hr noshade size="1" size="100%">
174
 
                <div align="right">
175
 
                        <button onClick="window.close();">Cancel</button>&nbsp;<button onClick="return sendSub();">Save</button>
176
 
                </div>
177
 
      </div>
178
 
    </form>
179
 
        </body>
180
 
</html>