improved layout and fixed bugs introduced new ones
This commit is contained in:
@@ -12,7 +12,7 @@ export class OutputFrame extends BaseElement {
|
||||
super();
|
||||
}
|
||||
|
||||
private scripts: any = {};
|
||||
private contents: any = {};
|
||||
|
||||
onInit(): void {
|
||||
this.reset();
|
||||
@@ -58,21 +58,21 @@ export class OutputFrame extends BaseElement {
|
||||
});
|
||||
}
|
||||
|
||||
setScript(language: string, value: string) {
|
||||
this.scripts[language] = value;
|
||||
setContent(language: string, value: string) {
|
||||
this.contents[language] = value;
|
||||
this.reset(() => {
|
||||
for (const lang in this.scripts) {
|
||||
for (const lang in this.contents) {
|
||||
if (lang != "javascript")
|
||||
this.doPostMessage(lang, this.scripts[lang]);
|
||||
this.doPostMessage(lang, this.contents[lang]);
|
||||
}
|
||||
|
||||
if (this.scripts["javascript"])
|
||||
this.doPostMessage("javascript", this.scripts["javascript"]);
|
||||
if (this.contents["javascript"])
|
||||
this.doPostMessage("javascript", this.contents["javascript"]);
|
||||
});
|
||||
}
|
||||
|
||||
doPostMessage(language: string, value: string) {
|
||||
this.CurrentIframeScriptRemoveResponseListener = postMessage(this.Iframe?.contentWindow, language, this.scripts[language], language == 'javascript' ? (executeTimeInMs, exceedTimeInMs) => {
|
||||
this.CurrentIframeScriptRemoveResponseListener = postMessage(this.Iframe?.contentWindow, language, this.contents[language], language == 'javascript' ? (executeTimeInMs, exceedTimeInMs) => {
|
||||
if (executeTimeInMs === -1) {
|
||||
this.setError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user