forked from zeroc-ice/ice-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
160 lines (143 loc) · 5.02 KB
/
index.html
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- Ie8 works better in compatible mode -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>ZeroC - Chat Demo - PHP Client</title>
<link rel="stylesheet" href="resources/style.css" type="text/css" media="screen"/>
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/chat.js" type="text/javascript"></script>
<script type="text/javascript">
//
// This method is a handler for window.onreszize event.
// It is called when the window is resized to adjust
// the size of the chat interface.
//
function adjustSize()
{
var minHeight = 480;
var h = $('body').getHeight() - 200;
if(h < minHeight)
{
h = minHeight;
}
$('livechat').style.height = h + 'px';
$('chatcontent').style.height = (h - 69) + 'px';
$('conversationView').style.height = (h - 69) + 'px';
$('userList').style.height = (h - 102) + 'px';
$('messageView').style.height = (h - 102) + 'px';
var minWidth = 745;
var w = $('body').getWidth();
if(w < minWidth)
{
w = minWidth;
}
$('livechat').style.width = (w - 100) + 'px';
$('txtMessage').style.width = (w - 120) + 'px';
$('messageView').style.width = (w - 240) + 'px';
$('messageView').scrollTop = $('messageView').scrollHeight;
}
window.onresize = function()
{
adjustSize();
};
//
// The application calls this to return to the login form
// when the connection is lost.
//
// It reloads the main page and shows the login form.
//
function reloadPage()
{
var pos = window.location.href.lastIndexOf("/");
var loc = window.location.href;
if(pos > 0)
{
loc = location.href.substr(0, pos);
}
window.location.href = loc + "/index.html";
}
var chatView;
var chat;
//
// This operation initializes the chat interface.
//
function initialize()
{
var opts =
{
encoding:'UTF-8',
method: 'get',
parameters: '',
asynchronous: false ,
onComplete:function(response)
{
$('loadingContainer').hide();
$('jsSupportError').replace(response.responseText);
adjustSize();
}
};
new Ajax.Request("chatview.html",opts);
chatView = new ChatView();
chat = new Chat(chatView);
}
</script>
</head>
<body id="body" onload="initialize();">
<div id="livechat">
<div id="header">
<div id="header-left"><p>Chat Demo</p></div>
<div id="header-right"><p>ZeroC</p></div>
</div>
<!-- Main menu begin -->
<!-- The menu is by default hidden using css, later we display it
using JavaScript, so if JavaScript isn't supported the menu
will never be shown. -->
<div id="menu" style="display:none;">
<ul>
<li id="loginLink">
<a class="button" href="#" onclick="reloadPage();" tabindex="1">
<span>Login</span>
</a>
</li>
<li id="logoutLink">
<a class="button" href="#" onclick="chatView.logout();" tabindex="1">
<span>Logout</span>
</a>
</li>
</ul>
</div>
<script type="text/javascript">
$('loginLink').hide();
$('logoutLink').hide();
$('menu').style.diplay = "block";
$('menu').hide();
</script>
<!-- Main Menu end -->
<!-- Main Content begin -->
<div id="chatcontent">
<div id="loadingContainer">
<div id="connecting">Loading</div>
</div>
<div id="jsSupportError">
Your browser's JavaScript support is not enabled or your browser is not
compatible with the Prototype JavaScript library required by this demo.
</div>
<script type="text/javascript">
// This hides the JavaScript error message, using prototype JavaScript library,
// so if JavaScript isn't enabled or prototype doesn't work the error message
// is displayed.
$('jsSupportError').hide();
$('loadingContainer').style.display = "block";
</script>
</div>
<!--Main Content end-->
<div id="footer">
<div id="footer-left"><p id="statusBar">Offline</p></div>
<div id="footer-right"><div class="copyright">Copyright © 2003-2017 ZeroC, Inc.</div></div>
</div>
</div>
</body>
</html>