got self-hosted website working.
This commit is contained in:
+12
-12
@@ -1,5 +1,5 @@
|
||||
$(document).ready(function(){
|
||||
$('#starter,#watch').prop('disabled', 'disabled');
|
||||
$('#starter').prop('disabled', 'disabled');
|
||||
$("#error").hide();
|
||||
editor = ace.edit("editor");
|
||||
editor.setTheme("ace/theme/monokai");
|
||||
@@ -26,21 +26,13 @@ $(document).ready(function(){
|
||||
|
||||
$('#starter').click(function() {
|
||||
$('#tabs a[href="#arena"]').tab('show');
|
||||
var url = "ws://{{ server.hostname }}:8666/ws/";
|
||||
gorobots.set_spectator(false);
|
||||
gorobots.set_server(
|
||||
url,
|
||||
"{{ game }}"
|
||||
);
|
||||
gorobots.set_server(wsurl(), getGameID());
|
||||
});
|
||||
$('#watch').click(function() {
|
||||
$('#tabs a[href="#arena"]').tab('show');
|
||||
var url = "ws://{{ server.hostname }}:8666/ws/";
|
||||
gorobots.set_spectator(true);
|
||||
gorobots.set_server(
|
||||
url,
|
||||
"{{ game }}"
|
||||
);
|
||||
gorobots.set_server(wsurl(), getGameID());
|
||||
});
|
||||
|
||||
$('#tabs a[href="#code"]').tab('show');
|
||||
@@ -60,7 +52,7 @@ function loadCode() {
|
||||
editor.setValue(e);
|
||||
$("#editor").show();
|
||||
$("#fetch-area").hide();
|
||||
$('#starter,#watch').prop('disabled', function(i, v) { return !v; });
|
||||
$('#starter').prop('disabled', '');
|
||||
}).fail(function(e){
|
||||
var msg = "got a useless error message; is the remote server down?";
|
||||
if (e.statusText != "error") {
|
||||
@@ -69,3 +61,11 @@ function loadCode() {
|
||||
$("#error").text(msg).show();
|
||||
});
|
||||
}
|
||||
|
||||
function wsurl() {
|
||||
return "ws://" + window.location.host + "/ws/";
|
||||
}
|
||||
|
||||
function getGameID() {
|
||||
return window.location.search.split("=")[1];
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ var gorobots_render_webgl = function(){
|
||||
my.robot_geom = new THREE.CubeGeometry(5,5,5);
|
||||
|
||||
var loader = new THREE.OBJLoader();
|
||||
loader.load( '/s/robot.obj', function ( object ) {
|
||||
loader.load( '/ui/obj/robot.obj', function ( object ) {
|
||||
object.position.x = 100;
|
||||
object.position.y = 100;
|
||||
object.position.z = 1;
|
||||
|
||||
Reference in New Issue
Block a user