mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 08:44:00 -06:00
Second pass at char sheet - ugly but mostly all there
This commit is contained in:
@@ -1,13 +1,27 @@
|
|||||||
// TODO These code bits don't really belong here, but this is the only shared bit of js
|
// TODO These code bits don't really belong here, but this is the only shared bit of js
|
||||||
|
|
||||||
|
|
||||||
|
function tabulate(html) {
|
||||||
|
var result = '';
|
||||||
|
$("<table>").html(html).find("tr").each(function () {
|
||||||
|
result += " " + $(this).children().first().text() + ": " +
|
||||||
|
$(this).children().last().text() + "\n";
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function template(id, data) {
|
function template(id, data) {
|
||||||
var tmpl = $("#" + id).html();
|
var tmpl = $("#" + id).html();
|
||||||
var brag = tmpl.replace(/\$([_A-Za-z.]+)/g, function (str, p1) {
|
var brag = tmpl.replace(/\$([_A-Za-z.]+)/g, function (str, p1) {
|
||||||
var dict = data;
|
var dict = data;
|
||||||
$.each(p1.split("."), function (i,v) {
|
$.each(p1.split("."), function (i,v) {
|
||||||
if (!dict) return true;
|
if (!dict) return true;
|
||||||
dict = dict[v];
|
if (v == "___") {
|
||||||
|
dict = tabulate(dict.html);
|
||||||
|
} else {
|
||||||
|
dict = dict[v.replace("_"," ")];
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
return dict || '';
|
return dict || '';
|
||||||
|
|||||||
@@ -191,13 +191,13 @@ Stats:
|
|||||||
CHA $Stats.CHA MP Max $Stats.MP_Max
|
CHA $Stats.CHA MP Max $Stats.MP_Max
|
||||||
|
|
||||||
Equipment:
|
Equipment:
|
||||||
$Equips.___
|
$Equips.___
|
||||||
|
|
||||||
Spell Book:
|
Spell Book:
|
||||||
$Spells.___
|
$Spells.___
|
||||||
|
|
||||||
Inventory ($EncumBar.Hint):
|
Inventory ($EncumBar.Hint):
|
||||||
$Inventory.___
|
$Inventory.___
|
||||||
|
|
||||||
-- $date
|
-- $date
|
||||||
-- Progress Quest 6.3.web - http://progressquest.com/
|
-- Progress Quest 6.3.web - http://progressquest.com/
|
||||||
|
|||||||
Reference in New Issue
Block a user