Skip to content

Commit a04b8b3

Browse files
committed
Rocket Preview button on window
1 parent 9691271 commit a04b8b3

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

services/static-webserver/client/source/class/osparc/navigation/UserMenu.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ qx.Class.define("osparc.navigation.UserMenu", {
9898
control.addListener("execute", () => osparc.vipMarket.MarketWindow.openWindow());
9999
this.add(control);
100100
break;
101+
case "rocket-preview":
102+
control = new qx.ui.menu.Button(this.tr("Rocket Preview"));
103+
control.addListener("execute", () => osparc.wrapper.RocketPreview.openWindow());
104+
this.add(control);
105+
break;
101106
case "about":
102107
control = new qx.ui.menu.Button(this.tr("About oSPARC"));
103108
osparc.utils.Utils.setIdToWidget(control, "userMenuAboutBtn");
@@ -177,6 +182,10 @@ qx.Class.define("osparc.navigation.UserMenu", {
177182
this.getChildControl("market");
178183
}
179184

185+
if (osparc.utils.Utils.isDevelopmentPlatform()) {
186+
this.getChildControl("rocket-preview");
187+
}
188+
180189
this.getChildControl("about");
181190
if (osparc.product.Utils.showAboutProduct()) {
182191
this.getChildControl("about-product");

services/static-webserver/client/source/class/osparc/wrapper/RocketPreview.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,31 @@ qx.Class.define("osparc.wrapper.RocketPreview", {
4141
window.addEventListener("message", this.__onMessage.bind(this));
4242
},
4343

44+
statics: {
45+
openWindow: function() {
46+
const win = new osparc.ui.window.Window();
47+
win.set({
48+
caption: "Rocket Preview",
49+
width: 800,
50+
height: 600,
51+
minWidth: 400,
52+
minHeight: 300,
53+
showMinimize: false,
54+
showMaximize: false,
55+
modal: true,
56+
allowClose: true,
57+
contentPadding: 0,
58+
layout: new qx.ui.layout.Grow()
59+
});
60+
61+
const rocketPreview = new osparc.wrapper.RocketPreview();
62+
win.add(rocketPreview);
63+
win.center();
64+
win.open();
65+
return win;
66+
}
67+
},
68+
4469
properties: {
4570
/**
4671
* True once the iframe signals it's ready (osparc:ready).

0 commit comments

Comments
 (0)