revised utils deleted old code
This commit is contained in:
@@ -21,29 +21,6 @@ export default class Utils {
|
|||||||
loopSearch();
|
loopSearch();
|
||||||
}, inCheckIntervalInMs);
|
}, inCheckIntervalInMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// let value: boolean = Utils.querySelector(inSelector);
|
|
||||||
// console.log(inSelector);
|
|
||||||
|
|
||||||
// if (inSwitch === "selector")
|
|
||||||
// value = Utils.querySelector(inSelector);
|
|
||||||
// else if (inSwitch === "function")
|
|
||||||
// value = Utils.isFunction(inSelector);
|
|
||||||
// else
|
|
||||||
// value = false;
|
|
||||||
|
|
||||||
// if (value) {
|
|
||||||
// console.log("defined");
|
|
||||||
// inCallback();
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// setTimeout(function (): void {
|
|
||||||
// console.log("repeating");
|
|
||||||
// if (inTimeoutInMs && Date.now() - startTimeInMs > inTimeoutInMs)
|
|
||||||
// return;
|
|
||||||
// loopSearch();
|
|
||||||
// }, inCheckIntervalInMs);
|
|
||||||
// }
|
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,18 +32,6 @@ export default class Utils {
|
|||||||
static waitForSeatmap(inCallback: Function): void {
|
static waitForSeatmap(inCallback: Function): void {
|
||||||
const seatCharts: CallableFunction = (<any>window).jQuery("#containerSeatmap").seatCharts;
|
const seatCharts: CallableFunction = (<any>window).jQuery("#containerSeatmap").seatCharts;
|
||||||
this.waitForElement(seatCharts, inCallback, "seatmap");
|
this.waitForElement(seatCharts, inCallback, "seatmap");
|
||||||
// const startTimeInMs: number = Date.now();
|
|
||||||
|
|
||||||
// if (Utils.isFunction(seatCharts))
|
|
||||||
// inCallback();
|
|
||||||
// else {
|
|
||||||
// setTimeout(() => {
|
|
||||||
// if (inTimeoutInMs && Date.now() - startTimeInMs > inTimeoutInMs)
|
|
||||||
// return;
|
|
||||||
|
|
||||||
// Utils.waitForSeatmap(inCallback);
|
|
||||||
// }, inCheckIntervalInMs);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static querySelector(selector: string): boolean {
|
static querySelector(selector: string): boolean {
|
||||||
@@ -78,11 +43,6 @@ export default class Utils {
|
|||||||
|
|
||||||
static isFunction(inSelector: CallableFunction): boolean {
|
static isFunction(inSelector: CallableFunction): boolean {
|
||||||
return typeof inSelector === "function" ? true : false;
|
return typeof inSelector === "function" ? true : false;
|
||||||
|
|
||||||
// if (typeof inSelector === "function")
|
|
||||||
// return true;
|
|
||||||
// else
|
|
||||||
// return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inject(inContent: string, inType: string = "js", inLoc: string = "head"): void {
|
static inject(inContent: string, inType: string = "js", inLoc: string = "head"): void {
|
||||||
@@ -121,35 +81,6 @@ export default class Utils {
|
|||||||
|
|
||||||
if (script)
|
if (script)
|
||||||
Utils.appendScript(script, inLoc);
|
Utils.appendScript(script, inLoc);
|
||||||
|
|
||||||
// if (inType === "js") {
|
|
||||||
// script = document.createElement('script');
|
|
||||||
// script.type = 'text/javascript';
|
|
||||||
// script.src = inContent;
|
|
||||||
// }
|
|
||||||
// else if (inType === "css") {
|
|
||||||
// script = document.createElement('link');
|
|
||||||
// script.type = 'text/css';
|
|
||||||
// (<HTMLLinkElement>script).rel = "stylesheet";
|
|
||||||
// (<HTMLLinkElement>script).href = inContent;
|
|
||||||
// }
|
|
||||||
// else if (inType === "cssCustom") {
|
|
||||||
// script = document.createElement('style');
|
|
||||||
// script.type = 'text/css';
|
|
||||||
// script.innerHTML = inContent;
|
|
||||||
// }
|
|
||||||
// else if (inType === "script") {
|
|
||||||
// script = document.createElement('script');
|
|
||||||
// script.type = 'text/javascript';
|
|
||||||
// script.innerHTML = inContent;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// return;
|
|
||||||
|
|
||||||
// if (inLoc === "body")
|
|
||||||
// document.body.appendChild(script);
|
|
||||||
// else if (inLoc === "head")
|
|
||||||
// document.head.appendChild(script);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static appendScript(inScript: I.TypeInjectScript, inLoc: string): void {
|
static appendScript(inScript: I.TypeInjectScript, inLoc: string): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user