mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 08:44:00 -06:00
Server side simulator using v8 (loads *.js so far)
This commit is contained in:
@@ -1083,7 +1083,7 @@ function LoadGame(sheet) {
|
|||||||
$.each([Plots,Quests], function () {
|
$.each([Plots,Quests], function () {
|
||||||
this.rows().find("input:checkbox").not(':last').attr("checked", "true");
|
this.rows().find("input:checkbox").not(':last').attr("checked", "true");
|
||||||
});
|
});
|
||||||
Log('Loaded game: ' + name);
|
Log('Loaded game: ' + game.Traits.Name);
|
||||||
if (!game.elapsed)
|
if (!game.elapsed)
|
||||||
Brag('start');
|
Brag('start');
|
||||||
StartTimer();
|
StartTimer();
|
||||||
@@ -1099,7 +1099,6 @@ $(window).unload(function (event) {
|
|||||||
SaveGame();
|
SaveGame();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function GameSaveName() {
|
function GameSaveName() {
|
||||||
if (!game.saveName) {
|
if (!game.saveName) {
|
||||||
game.saveName = Get(Traits, 'Name');
|
game.saveName = Get(Traits, 'Name');
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function fill(e, a, n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function () {
|
function NewGuyFormLoad() {
|
||||||
fill("#races", K.Races, "Race");
|
fill("#races", K.Races, "Race");
|
||||||
fill("#classes", K.Klasses, "Class");
|
fill("#classes", K.Klasses, "Class");
|
||||||
|
|
||||||
@@ -83,8 +83,8 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
if (!$("#Name").text()) {
|
if (!$("#Name").text()) {
|
||||||
GenClick();
|
GenClick();
|
||||||
$("#Name")[0].focus();
|
$("#Name").focus();
|
||||||
$("#Name")[0].select();
|
$("#Name").select();
|
||||||
}
|
}
|
||||||
|
|
||||||
seed = new Alea();
|
seed = new Alea();
|
||||||
@@ -92,9 +92,10 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
if (window.location.href.indexOf("?sold") > 0)
|
if (window.location.href.indexOf("?sold") > 0)
|
||||||
sold(); // TODO: cheesy
|
sold(); // TODO: cheesy
|
||||||
});
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(NewGuyFormLoad);
|
||||||
|
|
||||||
/* Multiplayer:
|
/* Multiplayer:
|
||||||
function TNewGuyForm_ParseSoldResponse(body) {
|
function TNewGuyForm_ParseSoldResponse(body) {
|
||||||
|
|||||||
@@ -0,0 +1,90 @@
|
|||||||
|
//!/usr/bin/env v8
|
||||||
|
|
||||||
|
function noop() {}
|
||||||
|
function nada() { return {}; }
|
||||||
|
|
||||||
|
var document = {
|
||||||
|
addEventListener: noop,
|
||||||
|
createElement: function () {
|
||||||
|
return {
|
||||||
|
style: {},
|
||||||
|
getElementsByTagName: nada,
|
||||||
|
appendChild: noop,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
documentElement: {
|
||||||
|
insertBefore: noop,
|
||||||
|
removeChild: noop,
|
||||||
|
},
|
||||||
|
getElementById: nada,
|
||||||
|
createComment: noop,
|
||||||
|
createDocumentFragment: nada,
|
||||||
|
};
|
||||||
|
|
||||||
|
var window = {
|
||||||
|
location: {href: "#Woogle"},
|
||||||
|
localStorage: {
|
||||||
|
getItem: function(key) {
|
||||||
|
return JSON.stringify({Woogle: {
|
||||||
|
Traits: {
|
||||||
|
Name: "Woogle"
|
||||||
|
}
|
||||||
|
}});
|
||||||
|
},
|
||||||
|
|
||||||
|
setItem: function (key, value) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
removeItem: function (key) {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
document: document,
|
||||||
|
addEventListener: noop,
|
||||||
|
};
|
||||||
|
|
||||||
|
var location = window.location;
|
||||||
|
|
||||||
|
/*
|
||||||
|
var $ = function () {
|
||||||
|
return {
|
||||||
|
click: noop,
|
||||||
|
keypress: noop,
|
||||||
|
ready: noop,
|
||||||
|
unload: noop,
|
||||||
|
bind: noop,
|
||||||
|
text: noop,
|
||||||
|
appendTo: noop,
|
||||||
|
attr: noop,
|
||||||
|
focus: noop,
|
||||||
|
select: noop,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
$.each = function (collection, callback) {
|
||||||
|
isArray: function( obj ) {
|
||||||
|
return toString.call(obj) === "[object Array]";
|
||||||
|
},
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
var navigator = { userAgent: "V8 Shell" };
|
||||||
|
var alert = function (m) { print("ALERT: " + m); };
|
||||||
|
|
||||||
|
function loadSheet(name) {
|
||||||
|
return { name: "bob" };
|
||||||
|
}
|
||||||
|
var storage = {
|
||||||
|
removeItem: function () {}
|
||||||
|
};
|
||||||
|
var randseed = function () {};
|
||||||
|
|
||||||
|
load("jquery.js");
|
||||||
|
var $ = window.$;
|
||||||
|
load("config.js");
|
||||||
|
|
||||||
|
load("newguy.js");
|
||||||
|
//NewGuyFormLoad();
|
||||||
|
|
||||||
|
load("main.js");
|
||||||
|
//FormCreate();
|
||||||
|
|
||||||
Reference in New Issue
Block a user