There is a few seconds of things actually working.

This commit is contained in:
firebingo 2018-04-06 22:26:17 -07:00
parent 3b12dcbda5
commit 00be56d0a8
4 changed files with 207 additions and 62 deletions

View file

@ -1,6 +1,6 @@
'use strict';
var rootUrl = `${window.location.protocol}//${window.location.host}/`
var rootUrl = `${window.location.protocol}//${window.location.host}/`;
class commonFunctions {
static getFileText(file) {
@ -37,10 +37,10 @@ class commonFunctions {
} else if(!line) {
return undefined;
} else {
var split = line.split('\t');
var newEntry = {};
let split = line.split('\t');
let newEntry = {};
for(let i = 0; i < split.length; ++i) {
var x = split[i];
let x = split[i];
newEntry[headers[i]] = x;
}
return newEntry;
@ -61,4 +61,25 @@ class commonFunctions {
return 0xFFFFFF;
}
}
static convertUtageTextTags(text) {
text = text.replace(/<speed.*?>|<\/speed>/g, "");
text = text.replace("\\n", "<br/>")
return text;
}
static getAnchorFromCharPivot(pivot) {
let x = 0.5;
let y = 0.5;
let sp = pivot.split(" ");
for(let p of sp) {
if(p.startsWith("x=")) {
x = Number(p.substring(2));
} else if(p.startsWith("y=")) {
y = Number(p.substring(2));
y = 1 - y;
}
}
return {x, y};
}
}