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

« back to all changes in this revision

Viewing changes to userhist.html.it

  • 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 - Storico</title>
5
 
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
6
 
    <script src="shared.js"></script>
7
 
    <script src="emoticons.js"></script>
8
 
    <script src="switchStyle.js"></script>
9
 
    <script src="jsjac.js"></script>
10
 
    <script>
11
 
      <!--
12
 
function reloadHistory(iq) {
13
 
 
14
 
  if (iq && iq.getType != 'result')
15
 
        srcW.Debug.log(iq.xml(),1);
16
 
 
17
 
  // clear iframes
18
 
  selected_collection.document.body.innerHTML = '';
19
 
  collections.document.body.innerHTML = '';
20
 
 
21
 
  // get collections
22
 
  var aIQ = new JSJaCIQ();
23
 
  aIQ.setType('get');
24
 
  aIQ.setTo(srcW.loghost);
25
 
  var aNode = aIQ.appendNode(
26
 
        'list', 
27
 
        {'xmlns': 'http://jabber.org/protocol/archive',
28
 
         'with': jid});
29
 
  srcW.con.send(aIQ,me.handleCollsGet);
30
 
 
31
 
  return false;
32
 
}
33
 
 
34
 
function handleCollGet(iq) {
35
 
        if (!iq || iq.getType() != 'result')
36
 
                return;
37
 
 
38
 
        srcW.Debug.log(iq.xml(),2);
39
 
 
40
 
        var histHTML = '';
41
 
 
42
 
        var aStore = iq.getNode().firstChild;
43
 
        for (var i=0; i<aStore.childNodes.length; i++) {
44
 
                var aChild = aStore.childNodes.item(i);
45
 
                if (aChild.nodeName == 'to') // message from me
46
 
                        histHTML += "<font color=\"blue\">&lt;" + srcW.nick + "&gt;</font> ";
47
 
                else
48
 
                        histHTML += "<font color=\"red\">&lt;" + user.name + "&gt;</font> ";
49
 
 
50
 
                if (aChild.firstChild.firstChild)
51
 
                        histHTML += htmlEnc(aChild.firstChild.firstChild.nodeValue);
52
 
                histHTML += '<br>';
53
 
                continue;
54
 
        }
55
 
        selected_collection.document.body.innerHTML = histHTML;
56
 
}
57
 
 
58
 
function handleCollsGet(iq) {
59
 
        if (!iq || iq.getType() != 'result')
60
 
                return;
61
 
 
62
 
        srcW.Debug.log(iq.getDoc().xml,2);
63
 
 
64
 
        var items = iq.getNode().firstChild.getElementsByTagName('store');
65
 
 
66
 
        var myTable = collections.document.createElement("TABLE");
67
 
        var myTableBody = collections.document.createElement("TBODY");
68
 
 
69
 
        myTable.appendChild(myTableBody);
70
 
 
71
 
        var row, cell, textN;
72
 
        for (var i=0; i<items.length; i++) {
73
 
 
74
 
                var item = items.item(i);
75
 
 
76
 
                row = collections.document.createElement("TR");
77
 
                row.setAttribute("start",item.getAttribute('start'));
78
 
                myTableBody.appendChild(row);
79
 
 
80
 
                cell = collections.document.createElement("TD");
81
 
                row.appendChild(cell);
82
 
 
83
 
                textN = collections.document.createTextNode(hrTime(item.getAttribute('start')));
84
 
                cell.appendChild(textN);
85
 
 
86
 
        }
87
 
 
88
 
        myTable.setAttribute("id","myTable");
89
 
        myTable.setAttribute("WIDTH","100%");
90
 
        myTable.setAttribute("BORDER","0");
91
 
        myTable.setAttribute("CELLSPACING","0");
92
 
        myTable.setAttribute("CELLPADDING","0");
93
 
        myTable.setAttribute("RULES","rows");
94
 
 
95
 
        // add table
96
 
        collections.document.body.appendChild(myTable);
97
 
 
98
 
        // tell frame about it
99
 
        collections.init();
100
 
}
101
 
 
102
 
function deleteHistory() {
103
 
  if (!confirm("Are you sure you want to delete this chat history completely?"))
104
 
        return;
105
 
 
106
 
  var aIQ = new JSJaCIQ();
107
 
  aIQ.setType('set');
108
 
  aIQ.setTo(srcW.loghost);
109
 
  var aNode = 
110
 
        aIQ.appendNode('remove',
111
 
                                   {'xmlns': 'http://jabber.org/protocol/archive',
112
 
                                        'with': jid});
113
 
        
114
 
  srcW.Debug.log(aIQ.xml(),2);
115
 
 
116
 
  me = this;
117
 
  srcW.con.send(aIQ,me.reloadHistory);
118
 
}
119
 
 
120
 
var srcW;
121
 
function init() {
122
 
        // determine source window
123
 
        if (opener.top.roster)
124
 
                srcW = opener.top;
125
 
        if (typeof(srcW) == 'undefined' || !srcW)
126
 
                return;
127
 
 
128
 
        getArgs();
129
 
        jid = passedArgs['jid'];
130
 
 
131
 
        if (typeof(jid) == 'undefined' || jid == '') {
132
 
                alert("JID mancante.\nAnnullamento...");
133
 
                window.close();
134
 
        }
135
 
 
136
 
        user = srcW.roster.getUserByJID(jid);
137
 
 
138
 
        var dtitle = "Storico chat per "+user.name;
139
 
        document.getElementById('title').innerHTML = dtitle;
140
 
        document.title = dtitle;
141
 
 
142
 
        // get collections
143
 
        var aIQ = new JSJaCIQ();
144
 
        aIQ.setType('get');
145
 
        aIQ.setTo(srcW.loghost);
146
 
  var aNode = 
147
 
        aIQ.appendNode('list',
148
 
                                   {'xmlns': 'http://jabber.org/protocol/archive',
149
 
                                        'with': jid});
150
 
  me = this;
151
 
  srcW.con.send(aIQ,me.handleCollsGet);
152
 
}
153
 
 
154
 
function keyPressed(e) {
155
 
  if (e.keyCode == 27)
156
 
    window.close();
157
 
  return true;
158
 
}
159
 
 
160
 
onkeydown = keyPressed;
161
 
onload = init;
162
 
      //-->
163
 
    </script>
164
 
    <script for="document" event="onkeydown()" language="JScript">
165
 
      <!--
166
 
      return keyPressed(window.event);
167
 
      //-->
168
 
    </script>
169
 
  </head>
170
 
  <body style="margin:8px;">
171
 
                <table width="100%" height="100%" border=0>
172
 
                                <tr>
173
 
                                        <td><h2 id="title"></h2></td><td align="right"><button onClick="deleteHistory();">Rimuovi</button> <button onClick="reloadHistory();">Aggiorna</td>
174
 
                                </tr>
175
 
                                <tr height="100%">
176
 
                                        <td>
177
 
                                                <iframe id="collections" name="collections" src="userhist_collections_iframe.html" style="width:240px;height:100%;" scrolling="auto"></iframe>
178
 
                                        </td>
179
 
                                        <td width="100%">
180
 
                                                <iframe id="selected_collection" name="selected_collection" src="chat_iframe.html" style="width:100%;height:100%;"></iframe>
181
 
                                        </td>
182
 
                                </tr>
183
 
                </table>
184
 
  </body>
185
 
</html>