forked from sirikata/kataspace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
198 lines (181 loc) · 9.08 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
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
<!--
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.
--> <!DOCTYPE html>
<html>
<head>
<title>KataSpace</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="scripts/modernizr-1.6.min.js">
</script>
<!-- Chat UI -->
<link rel="stylesheet" href="externals/jquery-ui-1.8.9/themes/base/minified/jquery-ui.min.css" />
<script type="text/javascript" src="externals/jquery-ui-1.8.9/jquery-1.4.4.js">
</script>
<script type="text/javascript" src="externals/jquery-ui-1.8.9/ui/minified/jquery-ui.min.js">
</script>
<link type="text/css" href="css/jquery.ui.chatbox.css" rel="stylesheet" />
<link type="text/css" href="css/jquery.ui.ppmenu.css" rel="stylesheet" />
<script type="text/javascript" src="scripts/jquery.ui.chatbox.js">
</script>
<!-- Notifications -->
<link type="text/css" href="externals/css/jquery.jnotify.css" rel="stylesheet" media="all" />
<script type="text/javascript" src="externals/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">
Kata.WEB_WORKERS_ENABLED = true;
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>
// 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 = "GLGE";
var loginName = null;
var avatarURL = null;
var avatarScale = null;
function handleLogin(name, avatar) {
loginName = name;
avatarURL = avatar.url;
avatarScale = avatar.scale;
Kata.require([
// Post login
'katajs/oh/MainThread.js',
'katajs/space/loop/Space.js',
'katajs/oh/GraphicsSimulation.js',
'katajs/gfx/glgegfx.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/panorama.js',
kata_base_offset + 'scripts/ui/create.js',
kata_base_offset + 'scripts/ui/transform.js',
kata_base_offset + 'scripts/ui/importexport.js',
kata_base_offset + 'scripts/ui/piemenu.js',
kata_base_offset + 'scripts/ui/help.js'
], function() {
loadGFX();
});
}
function onDocReady() {
$('#container').hide();
var have_deps = true;
if (!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;
}
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();
toolbar = new ToolbarUI($('#container'));
function graphicsReady () {
window.kata = new Kata.MainThread(
kata_base_offset + "scripts/BlessedScript.js",
"Example.BlessedScript",
{
//main_thread:true,//Uncomment to run the blessed script on the main thread
//disable_simulation:true,//Uncomment to disable simulations on the main thread
space: SpaceURL,
name: loginName,
loc: {scale : [0,0,0,avatarScale]},
visual: avatarURL
});
graphics = new Kata.GraphicsSimulation(driver, window.kata.getChannel(), document.getElementById("container"));
session = new SessionUI(window.kata.getChannel());
situi = new SitUI(window.kata.getChannel(), toolbar);
panoramaui = new PanoramaUI(window.kata.getChannel(), toolbar);
createui = new CreateUI(window.kata.getChannel(), toolbar);
exportui = new ExportUI(window.kata.getChannel(), toolbar);
helpui = new HelpUI(window.kata.getChannel(), toolbar);
chats = new ChatUI(window.kata.getChannel(), loginName, 300);
transformUI = new TransformUI(window.kata.getChannel());
pieUI = new PieUI(window.kata.getChannel());
chats.create("Chat");
}
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>
<!-- */ // -->