mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 00:34:00 -06:00
First pass at charsheet
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
// TODO These code bits don't really belong here, but this is the only shared bit of js
|
||||
|
||||
|
||||
function template(id, data) {
|
||||
var tmpl = $("#" + id).html();
|
||||
var brag = tmpl.replace(/\$([_A-Za-z.]+)/g, function (str, p1) {
|
||||
var dict = data;
|
||||
$.each(p1.split("."), function (i,v) {
|
||||
if (!dict) return true;
|
||||
dict = dict[v];
|
||||
return null;
|
||||
});
|
||||
return dict || '';
|
||||
});
|
||||
return brag;
|
||||
}
|
||||
|
||||
// From http://baagoe.com/en/RandomMusings/javascript/
|
||||
// Johannes Baagøe <baagoe@baagoe.com>, 2010
|
||||
function Mash() {
|
||||
|
||||
Reference in New Issue
Block a user