diff options
author | bob <bcz@cs.brown.edu> | 2019-09-17 11:26:54 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-09-17 11:26:54 -0400 |
commit | 5b09512cf4aa2319e498a233c16dba93ae83fbda (patch) | |
tree | 7a0b831c0ecaab879110955fa92aa438f986cb46 /src/Utils.ts | |
parent | 624d44ad339d55df66a4ed8bf4b2cb91608efeef (diff) |
lots of code cleanup in collectionFreeFormDocumentView and DocumentView
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 3921a49c3..415023ac4 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -37,6 +37,7 @@ export class Utils { public static prepend(extension: string): string { return window.location.origin + extension; } + public static CorsProxy(url: string): string { return this.prepend(RouteStore.corsProxy + "/") + encodeURIComponent(url); } @@ -239,6 +240,10 @@ export function timenow() { return now.toLocaleDateString() + ' ' + h + ':' + m + ' ' + ampm; } +export function percent2frac(percent: string) { + return Number(percent.substr(0, percent.length - 1)) / 100; +} + export function numberRange(num: number) { return Array.from(Array(num)).map((v, i) => i); } export function returnTrue() { return true; } |