replaced console.log, installed envify, added appendVersion
This commit is contained in:
@@ -7,13 +7,13 @@ export default class Utils {
|
||||
|
||||
(function loopSearch(): void {
|
||||
const element: boolean | HTMLElement = inSwitch === "selector" ? jQuery(<string>inSelector).get(0) : Utils.getSeatmapElement();
|
||||
|
||||
|
||||
if (element) {
|
||||
console.log("ready");
|
||||
Utils.consoleLog("ready");
|
||||
inCallback();
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log(`Repeating for ${inSwitch}`);
|
||||
Utils.consoleLog(`Repeating for ${inSwitch}`);
|
||||
setTimeout(() => {
|
||||
if (inTimeoutInMs && Date.now() - startTimeInMs > inTimeoutInMs)
|
||||
return;
|
||||
@@ -67,7 +67,7 @@ export default class Utils {
|
||||
script.type = 'text/css';
|
||||
script.innerHTML = inContent;
|
||||
break;
|
||||
|
||||
|
||||
case "script":
|
||||
script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
@@ -76,11 +76,11 @@ export default class Utils {
|
||||
|
||||
default:
|
||||
script = undefined;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if (script)
|
||||
Utils.appendScript(script, inLoc);
|
||||
Utils.appendScript(script, inLoc);
|
||||
}
|
||||
|
||||
static appendScript(inScript: I.TypeInjectScript, inLoc: string): void {
|
||||
@@ -92,5 +92,10 @@ export default class Utils {
|
||||
|
||||
static getDayName(inDate: Date, inLocale: string): string {
|
||||
return inDate.toLocaleDateString(inLocale, { weekday: 'long' });
|
||||
}
|
||||
}
|
||||
|
||||
static consoleLog(inMessage: any) {
|
||||
if (process.env["NODE_ENV"] === "development")
|
||||
console.log(inMessage);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user