Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ qx.Class.define("osparc.Application", {
}

// libs
osparc.wrapper.IntlTelInput.getInstance().init();
await Promise.all([
osparc.wrapper.DOMPurify.getInstance().init(),
osparc.wrapper.IntlTelInput.getInstance().init()
]);

// trackers
osparc.announcement.Tracker.getInstance().startTracker();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ qx.Class.define("osparc.dashboard.Dashboard", {
osparc.wrapper.JsonDiffPatch.getInstance().init();
osparc.wrapper.JsonTreeViewer.getInstance().init();
osparc.wrapper.JsonFormatter.getInstance().init();
osparc.wrapper.DOMPurify.getInstance().init();
osparc.wrapper.RadialMenu.getInstance().init();

this.__createMainViewLayout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,27 @@ qx.Class.define("osparc.wrapper.DOMPurify", {

members: {
init: function() {
// initialize the script loading
const purifyPath = "DOMPurify/purify-3.2.7.min.js";
const dynLoader = new qx.util.DynamicScriptLoader([
purifyPath
]);

dynLoader.addListenerOnce("ready", e => {
console.log(purifyPath + " loaded");
this.setLibReady(true);
}, this);

dynLoader.addListener("failed", e => {
let data = e.getData();
console.error("failed to load " + data.script);
}, this);

dynLoader.start();
return new Promise((resolve, reject) => {
// initialize the script loading
const purifyPath = "DOMPurify/purify-3.2.7.min.js";
const dynLoader = new qx.util.DynamicScriptLoader([
purifyPath
]);

dynLoader.addListenerOnce("ready", e => {
console.log(purifyPath + " loaded");
this.setLibReady(true);
resolve();
}, this);

dynLoader.addListener("failed", e => {
let data = e.getData();
console.error("failed to load " + data.script);
reject(data);
}, this);

dynLoader.start();
});
},

sanitize: function(html) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,34 @@ qx.Class.define("osparc.wrapper.IntlTelInput", {
},
members: {
init: function() {
// initialize the script loading
let intlTelInputPath = "intl-tel-input/js/intlTelInput.min.js";
let dataPath = "intl-tel-input/js/data.min.js";
let utilsPath = "intl-tel-input/js/utils.js";
let intlTelInputCss = "intl-tel-input/css/intlTelInput.css";
let intlTelInputCssUri = qx.util.ResourceManager.getInstance().toUri(intlTelInputCss);
qx.module.Css.includeStylesheet(intlTelInputCssUri);
let dynLoader = new qx.util.DynamicScriptLoader([
intlTelInputPath,
dataPath,
utilsPath
]);
return new Promise((resolve, reject) => {
// initialize the script loading
let intlTelInputPath = "intl-tel-input/js/intlTelInput.min.js";
let dataPath = "intl-tel-input/js/data.min.js";
let utilsPath = "intl-tel-input/js/utils.js";
let intlTelInputCss = "intl-tel-input/css/intlTelInput.css";
let intlTelInputCssUri = qx.util.ResourceManager.getInstance().toUri(intlTelInputCss);
qx.module.Css.includeStylesheet(intlTelInputCssUri);
let dynLoader = new qx.util.DynamicScriptLoader([
intlTelInputPath,
dataPath,
utilsPath
]);

dynLoader.addListenerOnce("ready", () => {
console.log(intlTelInputPath + " loaded");
this.setLibReady(true);
}, this);
dynLoader.addListenerOnce("ready", () => {
console.log(intlTelInputPath + " loaded");
this.setLibReady(true);
resolve();
}, this);

dynLoader.addListener("failed", e => {
let data = e.getData();
console.error("failed to load " + data.script);
}, this);
dynLoader.addListener("failed", e => {
let data = e.getData();
console.error("failed to load " + data.script);
reject(data);
}, this);

dynLoader.start();
dynLoader.start();
});
}
}
});
Loading