Rename examples -> marketplace

Includes the title of the marketplace web window.
This commit is contained in:
Zander Otavka 2016-07-21 15:44:42 -07:00
parent 0992e80254
commit 72978c5d96
2 changed files with 19 additions and 20 deletions

View file

@ -15,7 +15,7 @@ Script.load("system/users.js");
Script.load("system/mute.js"); Script.load("system/mute.js");
Script.load("system/goto.js"); Script.load("system/goto.js");
Script.load("system/hmd.js"); Script.load("system/hmd.js");
Script.load("system/examples.js"); Script.load("system/marketplace.js");
Script.load("system/edit.js"); Script.load("system/edit.js");
Script.load("system/ignore.js"); Script.load("system/ignore.js");
Script.load("system/selectAudioDevice.js"); Script.load("system/selectAudioDevice.js");

View file

@ -1,6 +1,5 @@
// //
// examples.js // marketplace.js
// examples
// //
// Created by Eric Levin on 8 Jan 2016 // Created by Eric Levin on 8 Jan 2016
// Copyright 2016 High Fidelity, Inc. // Copyright 2016 High Fidelity, Inc.
@ -11,9 +10,9 @@
var toolIconUrl = Script.resolvePath("assets/images/tools/"); var toolIconUrl = Script.resolvePath("assets/images/tools/");
var EXAMPLES_URL = "https://metaverse.highfidelity.com/examples"; var MARKETPLACE_URL = "https://metaverse.highfidelity.com/marketplace";
var examplesWindow = new OverlayWebWindow({ var marketplaceWindow = new OverlayWebWindow({
title: 'Examples', title: "Marketplace",
source: "about:blank", source: "about:blank",
width: 900, width: 900,
height: 700, height: 700,
@ -26,24 +25,24 @@ var TOOLBAR_MARGIN_Y = 0;
function showExamples(marketplaceID) { function showExamples(marketplaceID) {
var url = EXAMPLES_URL; var url = MARKETPLACE_URL;
if (marketplaceID) { if (marketplaceID) {
url = url + "/items/" + marketplaceID; url = url + "/items/" + marketplaceID;
} }
print("setting examples URL to " + url); print("setting marketplace URL to " + url);
examplesWindow.setURL(url); marketplaceWindow.setURL(url);
examplesWindow.setVisible(true); marketplaceWindow.setVisible(true);
UserActivityLogger.openedMarketplace(); UserActivityLogger.openedMarketplace();
} }
function hideExamples() { function hideExamples() {
examplesWindow.setVisible(false); marketplaceWindow.setVisible(false);
examplesWindow.setURL("about:blank"); marketplaceWindow.setURL("about:blank");
} }
function toggleExamples() { function toggleExamples() {
if (examplesWindow.visible) { if (marketplaceWindow.visible) {
hideExamples(); hideExamples();
} else { } else {
showExamples(); showExamples();
@ -54,7 +53,7 @@ var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
var browseExamplesButton = toolBar.addButton({ var browseExamplesButton = toolBar.addButton({
imageURL: toolIconUrl + "market.svg", imageURL: toolIconUrl + "market.svg",
objectName: "examples", objectName: "marketplace",
buttonState: 1, buttonState: 1,
defaultState: 1, defaultState: 1,
hoverState: 3, hoverState: 3,
@ -62,18 +61,18 @@ var browseExamplesButton = toolBar.addButton({
}); });
function onExamplesWindowVisibilityChanged() { function onExamplesWindowVisibilityChanged() {
browseExamplesButton.writeProperty('buttonState', examplesWindow.visible ? 0 : 1); browseExamplesButton.writeProperty('buttonState', marketplaceWindow.visible ? 0 : 1);
browseExamplesButton.writeProperty('defaultState', examplesWindow.visible ? 0 : 1); browseExamplesButton.writeProperty('defaultState', marketplaceWindow.visible ? 0 : 1);
browseExamplesButton.writeProperty('hoverState', examplesWindow.visible ? 2 : 3); browseExamplesButton.writeProperty('hoverState', marketplaceWindow.visible ? 2 : 3);
} }
function onClick() { function onClick() {
toggleExamples(); toggleExamples();
} }
browseExamplesButton.clicked.connect(onClick); browseExamplesButton.clicked.connect(onClick);
examplesWindow.visibleChanged.connect(onExamplesWindowVisibilityChanged); marketplaceWindow.visibleChanged.connect(onExamplesWindowVisibilityChanged);
Script.scriptEnding.connect(function () { Script.scriptEnding.connect(function () {
toolBar.removeButton("examples"); toolBar.removeButton("marketplace");
browseExamplesButton.clicked.disconnect(onClick); browseExamplesButton.clicked.disconnect(onClick);
examplesWindow.visibleChanged.disconnect(onExamplesWindowVisibilityChanged); marketplaceWindow.visibleChanged.disconnect(onExamplesWindowVisibilityChanged);
}); });