File: error_message.html.gr

package info (click to toggle)
jwchat 1.0beta2-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,200 kB
  • ctags: 405
  • sloc: xml: 462; sh: 80; makefile: 6
file content (110 lines) | stat: -rw-r--r-- 3,589 bytes parent folder | download | duplicates (5)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>JWChat - Show Message</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <script src="emoticons.js" language="JavaScript1.2"></script>
    <script src="shared.js" language="JavaScript1.2"></script>
    <script src="switchStyle.js"></script>
    <script language="JavaScript1.2">
      <!--
var messages = new Array();
var curMSG = lastMSG = 0;
		
function showMSG() {

  /* look for error message */
  if (messages[curMSG].type == 'error' && messages[curMSG].o) {
    for (var i in messages[curMSG].o) {
      if (messages[curMSG].o[i].tagname && messages[curMSG].o[i].tagname == 'error') {
				document.getElementById('error_code').innerHTML = messages[curMSG].o[i].code;
				document.getElementById('error_data').innerHTML = messages[curMSG].o[i].data;
      }
    }
      
  }
  /*set subject */
  if (messages[curMSG].subject)
    document.getElementById('subject').innerHTML = messages[curMSG].subject;

  /* set date */
  var date;
  if (messages[curMSG].o && messages[curMSG].o[0] && typeof(messages[curMSG].o[0].stamp) != 'undefined') {
    var now = new Date();
    var stamp = messages[curMSG].o[0].stamp;
    date = new Date(Date.UTC(stamp.substring(0,4),stamp.substring(4,6)-1,stamp.substring(6,8),stamp.substring(9,11),stamp.substring(12,14),stamp.substring(15,17)));
  } else {
    date = new Date();
  }
  document.getElementById('date').innerHTML = date.toLocaleString();

	/* set body */
	msgbox.document.body.innerHTML = msgFormat(messages[curMSG].body);


  /* set buttons */
  if (curMSG == 0)
    document.forms[0].elements["prevButton"].disabled = true;
  else 
    document.forms[0].elements["prevButton"].disabled = false;
  if (curMSG+1==lastMSG && srcW.error_messages.length == 0)
    document.forms[0].elements["nextButton"].disabled = true;
  else
    document.forms[0].elements["nextButton"].disabled = false;
}
		
function getNextMSG() { // gets message from roster
	messages[lastMSG++] = srcW.error_messages[0];
	srcW.error_messages = srcW.error_messages.slice(1,srcW.error_messages.length);
}
		
function next() {
  curMSG++;
  if (curMSG == lastMSG) {
    if (srcW.error_messages.length > 0)
      getNextMSG();
    else
      curMSG--;
  }
  
  showMSG();
  return false;
}

function prev() {
  curMSG--;
  if (curMSG < 0)
    curMSG = 0;
  showMSG();
  return false;
}
		
var srcW, user;
function init() {
  srcW = opener.top;
  if (srcW.error_messages.length > 0) {
    // show messages
    document.title = "Error"; // set title
    getNextMSG();
    showMSG();
  }
}

onload = init;
      //-->
    </script>
  </head>
  <body style="margin:8px;">
    <form name="msg" style="margin:0; padding:0;">
    <table width="100%" height="100%">
        <tr><td style="color: red;"><b>Error <span id="error_code"></span>:</b> <span id="error_data"></span></td></tr>
        <tr><td><hr noshade size="1"></td></tr>
        <tr><td><b>Date:</b> <span id="date"></span></td></tr>
        <tr><td><b>Subject:</b> <span id="subject"></span></td></tr>
        <tr height="100%"><td height="100%"><iframe src="chat_iframe.html" id="msgbox" name="msgbox" scrolling="auto" style="width: 100%; height: 100%;"></iframe></td></tr>
        <tr><td><hr noshade size="1"></td></tr>
        <tr><td align="right"><button onClick="return prev();" id="prevButton">prev</button>&nbsp;<button onClick="return next();" id="nextButton">next</button>&nbsp;<button onClick="window.close();">Close</button></td></tr>
    </table>
    </form>
  </body>
</html>