forked from sirikata/kataspace
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.xhtml
219 lines (196 loc) · 9.65 KB
/
index.xhtml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
self.onmessage=function(msg){importScripts(msg.data);};
/* -->
<!-- KataJS Chat
index.html
Copyright (c) 2010, Ewen Cheslack-Postava
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of katajs nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>KataSpace</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="externals/modernizr/modernizr-1.6.min.js">
</script>
<!-- Chat UI -->
<link rel="stylesheet" href="externals/jquery-ui/css/smoothness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="externals/jquery/jquery-1.6.1.min.js">
</script>
<script type="text/javascript" src="externals/jquery-ui/js/jquery-ui-1.8.16.custom.min.js">
</script>
<link type="text/css" href="css/jquery.ui.chatbox.css" rel="stylesheet" />
<script type="text/javascript" src="externals/jquery-plugins/chatbox/jquery.ui.chatbox.js">
</script>
<!-- Notifications -->
<link type="text/css" href="externals/jquery-plugins/jnotify/css/jquery.jnotify.css" rel="stylesheet" media="all" />
<script type="text/javascript" src="externals/jquery-plugins/jnotify/lib/jquery.jnotify.js">
</script>
<!-- Core must be loaded before web-socket-js because it cludges window.console -->
<script type="text/javascript" src="externals/katajs/katajs/core/Core.js">
</script>
<script type="text/javascript"><![CDATA[
Kata.WEB_WORKERS_ENABLED = false;
Kata.bootstrapWorker=window.location.href;
]]></script>
<!--
<script type="text/javascript" src="externals/katajs/katajs.compiled.js">
</script>
-->
<!-- Deployment-specific configuraton. Ideally, everything
that needs to be modified to make this run on different servers
is isolated in this file.
-->
<script type="text/javascript" src="scripts/deployment.js">
</script>
<link type="text/css" href="css/deployment.css" rel="stylesheet" media="all" />
<script><![CDATA[
// This gives the offset that Kata.include needs prepended
// to get to the base of our code directory (it starts at
// katajs.git, so we need to get out of externals/katajs.git).
var kata_base_offset = "../../";
var kata, graphics;
var driver = "XML3D";
var loginName = null;
var avatarURL = null;
var avatarScale = null;
if (driver == "XML3D") {
var xml3dLevel = "static/glass.xml3d";
var xml3dAvatar = "static/car.xml3d";
}
function handleLogin(name, avatar) {
loginName = name;
avatarURL = avatar.url;
avatarScale = avatar.scale;
xml3dAvatar = avatar;
Kata.require([
// Post login
'katajs/oh/MainThread.js',
'katajs/space/loop/Space.js',
'katajs/oh/GraphicsSimulation.js',
'katajs/gfx/glgegfx.js',
'katajs/gfx/xml3dgfx.js',
'katajs/oh/Script.js',
'katajs/oh/plugins/loop/LoopbackSpaceConnection.js',
'katajs/oh/plugins/sirikata/SirikataSpaceConnection.js',
'katajs/oh/ObjectHost.js',
kata_base_offset + 'scripts/ui/html5slider.js',
kata_base_offset + 'scripts/ui/transform.js',
kata_base_offset + 'scripts/ui/session.js',
kata_base_offset + 'scripts/ui/chat.js',
kata_base_offset + 'scripts/ui/toolbar.js',
kata_base_offset + 'scripts/ui/sit.js',
kata_base_offset + 'scripts/ui/create.js',
kata_base_offset + 'scripts/ui/help.js',
kata_base_offset + 'scripts/ui/animlib.js'
], function() {
loadGFX();
});
}
function onDocReady() {
//$('#container').hide();
var have_deps = true;
if (driver == "GLGE" && !Modernizr.webgl) {
$.jnotify("Your browser doesn't support WebGL.", 'error', true);
have_deps = false;
}
if (!Modernizr.websockets) {
$.jnotify("Your browser doesn't support WebSockets.", 'error', true);
have_deps = false;
}
if (!Modernizr.webworkers) {
$.jnotify("Your browser doesn't support WebWorkers.", 'error', true);
have_deps = false;
}
if (!have_deps) {
$.jnotify("We recommend <a href=\"http://www.google.com/chrome\">Chrome</a> for all platforms.<br>In recent Firefox Betas you may need to explicitly enable these features via the about:config page.", 'error', true);
return;
}
// automatic login for XML3D testing
Kata.require([
// Pre login
kata_base_offset + 'scripts/ui/login.js',
kata_base_offset + 'scripts/ui/footer.js'
], function() {
loginui = new LoginUI( $("#login"), Avatars, handleLogin);
//$('#title').append(Title);
//footerui = new FooterUI(
// $(FooterContent())
//);
});
}
function loadGFX(){
$('#container').show();
if (driver != "XML3D")
toolbar = new ToolbarUI($('#container'));
function graphicsReady () {
var scriptArgs = {
space: SpaceURL,
name: loginName,
loc: {scale : [0,0,0,avatarScale]},
visual: {mesh: avatarURL}
};
if (driver == "XML3D") {
scriptArgs["level"] = xml3dLevel;
scriptArgs["avatar"] = xml3dAvatar;
}
window.kata = new Kata.MainThread(
kata_base_offset + "scripts/BlessedScript.js",
"Example.BlessedScript",
scriptArgs);
graphics = new Kata.GraphicsSimulation(driver, window.kata.getChannel(), document.getElementById("container"));
session = new SessionUI(window.kata.getChannel());
if (driver != "XML3D") {
situi = new SitUI(window.kata.getChannel(), toolbar);
createui = new CreateUI(window.kata.getChannel(), toolbar);
helpui = new HelpUI(window.kata.getChannel(), toolbar);
transformUI = new TransformUI(window.kata.getChannel());
}
else if (driver == "XML3D")
animlibui = new AnimLibUI(window.kata.getChannel());
chats = new ChatUI(window.kata.getChannel(), loginName, 300);
chats.create("Chat");
}
if (driver == "XML3D")
Kata.GraphicsSimulation.initializeDriver(driver, xml3dLevel, graphicsReady);
else
Kata.GraphicsSimulation.initializeDriver(driver, "static/glge_level.xml", graphicsReady);
}
window.onload = onDocReady;
]]></script>
</head>
<body>
<div id="login" title="Login"></div>
<div class=".container-fullscreen" id="main">
<div id="title" class="ui-widget" style="width:900px;margin:auto;padding:15px;font-size:150%">
</div>
<div class="view" style="margin:auto;position:relative;-webkit-box-shadow: rgba(0, 0, 0, 0.699219) 0px 0px 10px;" id="container">
</div>
</div>
</body>
</html>
<!-- */ // -->