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

« back to all changes in this revision

Viewing changes to userhist.html.sk

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2008-08-24 15:02:53 UTC
  • mfrom: (3.1.4 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080824150253-h0z39rzjmo4lc1k5
Tags: 1.0beta3-3
* Clean up README.Debian. (Closes: #481320)
* Add brazilian debconf messages translation. (Closes: #481522)
* Add swedish debconf messages translation. (Closes: #494887)
* Add italian debconf messages translation. (Closes: #495780)
* Add russian debconf messages translation. (Closes: #495573)
* Add finnish debconf messages translation. (Closes: #496227)

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 - História rozhovoru</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="xmlextras.js"></script>
 
10
    <script src="jsjac.js"></script>
 
11
    <script>
 
12
      <!--
 
13
function reloadHistory(iq) {
 
14
 
 
15
        if (iq && iq.getType != 'result')
 
16
                srcW.Debug.log(iq.xml(),1);
 
17
 
 
18
        // clear iframes
 
19
        selected_collection.document.body.innerHTML = '';
 
20
        collections.document.body.innerHTML = '';
 
21
 
 
22
        // get collections
 
23
        var aIQ = new JSJaCIQ();
 
24
        aIQ.setType('get');
 
25
        aIQ.setTo(srcW.loghost);
 
26
        var aNode = aIQ.getNode().appendChild(aIQ.getDoc().createElement('list'));
 
27
        aNode.setAttribute('xmlns','http://jabber.org/protocol/archive');
 
28
        aNode.setAttribute('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("Ste si skutočne istý(á), že chcete zmazať kompletnú históriu rozhovoru?"))
 
104
                return;
 
105
 
 
106
        var aIQ = new JSJaCIQ();
 
107
        aIQ.setType('set');
 
108
        aIQ.setTo(srcW.loghost);
 
109
        var aNode = aIQ.getNode().appendChild(aIQ.getDoc().createElement('remove'));
 
110
        aNode.setAttribute('xmlns','http://jabber.org/protocol/archive');
 
111
        aNode.setAttribute('with',jid);
 
112
        
 
113
        srcW.Debug.log(aIQ.xml(),2);
 
114
 
 
115
        me = this;
 
116
        srcW.con.send(aIQ,me.reloadHistory);
 
117
}
 
118
 
 
119
var srcW;
 
120
function init() {
 
121
        // determine source window
 
122
        if (opener.top.roster)
 
123
                srcW = opener.top;
 
124
        if (typeof(srcW) == 'undefined' || !srcW)
 
125
                return;
 
126
 
 
127
        getArgs();
 
128
        jid = passedArgs['jid'];
 
129
 
 
130
        if (typeof(jid) == 'undefined' || jid == '') {
 
131
                alert("JID chýba.\nUkončovanie...");
 
132
                window.close();
 
133
        }
 
134
 
 
135
        user = srcW.roster.getUserByJID(jid);
 
136
 
 
137
        var dtitle = "História rozhovoru pre "+user.name;
 
138
        document.getElementById('title').innerHTML = dtitle;
 
139
        document.title = dtitle;
 
140
 
 
141
        // get collections
 
142
        var aIQ = new JSJaCIQ();
 
143
        aIQ.setType('get');
 
144
        aIQ.setTo(srcW.loghost);
 
145
        var aNode = aIQ.getNode().appendChild(aIQ.getDoc().createElement('list'));
 
146
        aNode.setAttribute('xmlns','http://jabber.org/protocol/archive');
 
147
        aNode.setAttribute('with',jid);
 
148
        me = this;
 
149
        srcW.con.send(aIQ,me.handleCollsGet);
 
150
}
 
151
 
 
152
function keyPressed(e) {
 
153
  if (e.keyCode == 27)
 
154
    window.close();
 
155
  return true;
 
156
}
 
157
 
 
158
onkeydown = keyPressed;
 
159
onload = init;
 
160
      //-->
 
161
    </script>
 
162
    <script for="document" event="onkeydown()" language="JScript">
 
163
      <!--
 
164
      return keyPressed(window.event);
 
165
      //-->
 
166
    </script>
 
167
  </head>
 
168
  <body style="margin:8px;">
 
169
                <table width="100%" height="100%" border=0>
 
170
                                <tr>
 
171
                                        <td><h2 id="title"></h2></td><td align="right"><button onClick="deleteHistory();">Zmazať</button> <button onClick="reloadHistory();">Obnoviť</td>
 
172
                                </tr>
 
173
                                <tr height="100%">
 
174
                                        <td>
 
175
                                                <iframe id="collections" name="collections" src="userhist_collections_iframe.html" style="width:240px;height:100%;" scrolling="auto"></iframe>
 
176
                                        </td>
 
177
                                        <td width="100%">
 
178
                                                <iframe id="selected_collection" name="selected_collection" src="chat_iframe.html" style="width:100%;height:100%;"></iframe>
 
179
                                        </td>
 
180
                                </tr>
 
181
                </table>
 
182
  </body>
 
183
</html>