There is a few seconds of things actually working.
This commit is contained in:
parent
3b12dcbda5
commit
00be56d0a8
4 changed files with 207 additions and 62 deletions
29
Js/Common.js
29
Js/Common.js
|
@ -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};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue