From 0992e80254d746645d73b1c1fc7cf9dcdda9500d Mon Sep 17 00:00:00 2001 From: Zander Otavka Date: Thu, 21 Jul 2016 15:44:05 -0700 Subject: [PATCH 1/4] Add Toolbars to eslint globals --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index a7f4291257..ecdae56594 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -40,6 +40,7 @@ module.exports = { "SoundCache": false, "Stats": false, "TextureCache": false, + "Toolbars": false, "Uuid": false, "UndoStack": false, "Vec3": false, From 72978c5d96b0a8af7b8965196fef2ccfcafcdf9e Mon Sep 17 00:00:00 2001 From: Zander Otavka Date: Thu, 21 Jul 2016 15:44:42 -0700 Subject: [PATCH 2/4] Rename examples -> marketplace Includes the title of the marketplace web window. --- scripts/defaultScripts.js | 2 +- .../system/{examples.js => marketplace.js} | 37 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) rename scripts/system/{examples.js => marketplace.js} (56%) diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 6880de99b5..817d63582d 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -15,7 +15,7 @@ Script.load("system/users.js"); Script.load("system/mute.js"); Script.load("system/goto.js"); Script.load("system/hmd.js"); -Script.load("system/examples.js"); +Script.load("system/marketplace.js"); Script.load("system/edit.js"); Script.load("system/ignore.js"); Script.load("system/selectAudioDevice.js"); diff --git a/scripts/system/examples.js b/scripts/system/marketplace.js similarity index 56% rename from scripts/system/examples.js rename to scripts/system/marketplace.js index 6fdb2a2874..6526fb3460 100644 --- a/scripts/system/examples.js +++ b/scripts/system/marketplace.js @@ -1,6 +1,5 @@ // -// examples.js -// examples +// marketplace.js // // Created by Eric Levin on 8 Jan 2016 // Copyright 2016 High Fidelity, Inc. @@ -11,9 +10,9 @@ var toolIconUrl = Script.resolvePath("assets/images/tools/"); -var EXAMPLES_URL = "https://metaverse.highfidelity.com/examples"; -var examplesWindow = new OverlayWebWindow({ - title: 'Examples', +var MARKETPLACE_URL = "https://metaverse.highfidelity.com/marketplace"; +var marketplaceWindow = new OverlayWebWindow({ + title: "Marketplace", source: "about:blank", width: 900, height: 700, @@ -26,24 +25,24 @@ var TOOLBAR_MARGIN_Y = 0; function showExamples(marketplaceID) { - var url = EXAMPLES_URL; + var url = MARKETPLACE_URL; if (marketplaceID) { url = url + "/items/" + marketplaceID; } - print("setting examples URL to " + url); - examplesWindow.setURL(url); - examplesWindow.setVisible(true); + print("setting marketplace URL to " + url); + marketplaceWindow.setURL(url); + marketplaceWindow.setVisible(true); UserActivityLogger.openedMarketplace(); } function hideExamples() { - examplesWindow.setVisible(false); - examplesWindow.setURL("about:blank"); + marketplaceWindow.setVisible(false); + marketplaceWindow.setURL("about:blank"); } function toggleExamples() { - if (examplesWindow.visible) { + if (marketplaceWindow.visible) { hideExamples(); } else { showExamples(); @@ -54,7 +53,7 @@ var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var browseExamplesButton = toolBar.addButton({ imageURL: toolIconUrl + "market.svg", - objectName: "examples", + objectName: "marketplace", buttonState: 1, defaultState: 1, hoverState: 3, @@ -62,18 +61,18 @@ var browseExamplesButton = toolBar.addButton({ }); function onExamplesWindowVisibilityChanged() { - browseExamplesButton.writeProperty('buttonState', examplesWindow.visible ? 0 : 1); - browseExamplesButton.writeProperty('defaultState', examplesWindow.visible ? 0 : 1); - browseExamplesButton.writeProperty('hoverState', examplesWindow.visible ? 2 : 3); + browseExamplesButton.writeProperty('buttonState', marketplaceWindow.visible ? 0 : 1); + browseExamplesButton.writeProperty('defaultState', marketplaceWindow.visible ? 0 : 1); + browseExamplesButton.writeProperty('hoverState', marketplaceWindow.visible ? 2 : 3); } function onClick() { toggleExamples(); } browseExamplesButton.clicked.connect(onClick); -examplesWindow.visibleChanged.connect(onExamplesWindowVisibilityChanged); +marketplaceWindow.visibleChanged.connect(onExamplesWindowVisibilityChanged); Script.scriptEnding.connect(function () { - toolBar.removeButton("examples"); + toolBar.removeButton("marketplace"); browseExamplesButton.clicked.disconnect(onClick); - examplesWindow.visibleChanged.disconnect(onExamplesWindowVisibilityChanged); + marketplaceWindow.visibleChanged.disconnect(onExamplesWindowVisibilityChanged); }); From 30c5f277a099118e18cb8a574128ebaccbf7df7b Mon Sep 17 00:00:00 2001 From: Zander Otavka Date: Thu, 21 Jul 2016 15:52:19 -0700 Subject: [PATCH 3/4] Finish renaming functions --- scripts/system/marketplace.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/system/marketplace.js b/scripts/system/marketplace.js index 6526fb3460..3d28ff48f5 100644 --- a/scripts/system/marketplace.js +++ b/scripts/system/marketplace.js @@ -24,7 +24,7 @@ var toolWidth = 50; var TOOLBAR_MARGIN_Y = 0; -function showExamples(marketplaceID) { +function showMarketplace(marketplaceID) { var url = MARKETPLACE_URL; if (marketplaceID) { url = url + "/items/" + marketplaceID; @@ -36,16 +36,16 @@ function showExamples(marketplaceID) { UserActivityLogger.openedMarketplace(); } -function hideExamples() { +function hideMarketplace() { marketplaceWindow.setVisible(false); marketplaceWindow.setURL("about:blank"); } -function toggleExamples() { +function toggleMarketplace() { if (marketplaceWindow.visible) { - hideExamples(); + hideMarketplace(); } else { - showExamples(); + showMarketplace(); } } @@ -66,7 +66,7 @@ function onExamplesWindowVisibilityChanged() { browseExamplesButton.writeProperty('hoverState', marketplaceWindow.visible ? 2 : 3); } function onClick() { - toggleExamples(); + toggleMarketplace(); } browseExamplesButton.clicked.connect(onClick); marketplaceWindow.visibleChanged.connect(onExamplesWindowVisibilityChanged); From cc7e723e072344b51062967b9f9c57588a721dc1 Mon Sep 17 00:00:00 2001 From: Zander Otavka Date: Fri, 22 Jul 2016 15:23:39 -0700 Subject: [PATCH 4/4] Remove extra debug print --- scripts/system/marketplace.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/system/marketplace.js b/scripts/system/marketplace.js index 3d28ff48f5..356ed8e8cf 100644 --- a/scripts/system/marketplace.js +++ b/scripts/system/marketplace.js @@ -29,7 +29,6 @@ function showMarketplace(marketplaceID) { if (marketplaceID) { url = url + "/items/" + marketplaceID; } - print("setting marketplace URL to " + url); marketplaceWindow.setURL(url); marketplaceWindow.setVisible(true);