mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
menu fixes
This commit is contained in:
parent
2343049227
commit
a837d2099c
3 changed files with 6 additions and 8 deletions
|
|
@ -43,11 +43,6 @@ function (http, nodeStatic, Api) {
|
||||||
console.checkpoint('HTTP Server serves index');
|
console.checkpoint('HTTP Server serves index');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case req.url == '/game.html':
|
|
||||||
fileServer.serveFile('./static/html/game.html', 200, {}, req, res);
|
|
||||||
console.checkpoint('HTTP Server serves game');
|
|
||||||
break;
|
|
||||||
|
|
||||||
case req.url == '/client.js':
|
case req.url == '/client.js':
|
||||||
fileServer.serveFile('./client.js', 200, {}, req, res);
|
fileServer.serveFile('./client.js', 200, {}, req, res);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ function (Parent, Settings, Nc, Exception) {
|
||||||
Doll.prototype.setActionState = function(state, force) {
|
Doll.prototype.setActionState = function(state, force) {
|
||||||
|
|
||||||
if(!force && this.actionState == state) return;
|
if(!force && this.actionState == state) return;
|
||||||
console.log(state)
|
|
||||||
|
|
||||||
if(!state) throw new Exception("action state is undefined");
|
if(!state) throw new Exception("action state is undefined");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ if(!Chuck) var Chuck = {};
|
||||||
|
|
||||||
window.onhashchange = function() {
|
window.onhashchange = function() {
|
||||||
if(window.location.hash) {
|
if(window.location.hash) {
|
||||||
|
if($("#game").style.display == "block") {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
refresh(function(list) {
|
refresh(function(list) {
|
||||||
var channelName = unescape(window.location.hash.substr(1));
|
var channelName = unescape(window.location.hash.substr(1));
|
||||||
if(channelExists(list, channelName)) {
|
if(channelExists(list, channelName)) {
|
||||||
|
|
@ -148,6 +151,7 @@ if(!Chuck) var Chuck = {};
|
||||||
function quickstart() {
|
function quickstart() {
|
||||||
refresh(function(list){
|
refresh(function(list){
|
||||||
var defaultChannelName = "Dungeon";
|
var defaultChannelName = "Dungeon";
|
||||||
|
history.pushState("", document.title, window.location.pathname + "#" + defaultChannelName);
|
||||||
var nickname = $("#nick").value;
|
var nickname = $("#nick").value;
|
||||||
|
|
||||||
if(!nickname) {
|
if(!nickname) {
|
||||||
|
|
@ -250,7 +254,6 @@ if(!Chuck) var Chuck = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
function join(nickname, channelName) {
|
function join(nickname, channelName) {
|
||||||
|
|
||||||
if(validateForJoin(nickname, channelName)) {
|
if(validateForJoin(nickname, channelName)) {
|
||||||
localStorage["player"] = JSON.stringify({
|
localStorage["player"] = JSON.stringify({
|
||||||
nickname: nickname
|
nickname: nickname
|
||||||
|
|
@ -314,6 +317,7 @@ if(!Chuck) var Chuck = {};
|
||||||
var refreshInterval = setInterval(refresh, 5000);
|
var refreshInterval = setInterval(refresh, 5000);
|
||||||
|
|
||||||
Chuck.menu = {
|
Chuck.menu = {
|
||||||
show: show
|
show: show,
|
||||||
|
quickstart: quickstart
|
||||||
}
|
}
|
||||||
})(Chuck);
|
})(Chuck);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue