diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 2270118861..bddb2ae703 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -24,6 +24,7 @@ var DEFAULT_SCRIPTS_COMBINED = [ "system/makeUserConnection.js", "system/tablet-goto.js", "system/marketplaces/marketplaces.js", + "system/marketplaces/blocksApp.js", // temporarily in default scripts for testing purposes "system/edit.js", "system/notifications.js", "system/dialTone.js", diff --git a/scripts/system/html/js/marketplacesInject.js b/scripts/system/html/js/marketplacesInject.js index e078112360..dd239463d2 100644 --- a/scripts/system/html/js/marketplacesInject.js +++ b/scripts/system/html/js/marketplacesInject.js @@ -59,7 +59,7 @@ $("body").append( '
' + (!isInitialHiFiPage ? '' : '') + - (isInitialHiFiPage ? '🛈 Get items from Blocks and Clara.io!' : '') + + (isInitialHiFiPage ? '🛈 Get items from Clara.io!' : '') + (!isDirectoryPage ? '' : '') + (isDirectoryPage ? '🛈 Select a marketplace to explore.' : '') + '
' @@ -82,9 +82,6 @@ // Add button links. - $('#exploreBlocksMarketplace').on('click', function () { - window.location = "https://vr.google.com/objects"; - }); $('#exploreClaraMarketplace').on('click', function () { window.location = "https://clara.io/library?gameCheck=true&public=true"; }); @@ -155,18 +152,6 @@ } } - function injectBlocksCode() { - // Make space for marketplaces footer in Blocks pages. - /*$("body").append( - '
' + - '' + - '
' - );*/ - $("body").append( - '

hello

' - ); - } - function updateClaraCode() { // Have to repeatedly update Clara page because its content can change dynamically without location.href changing. @@ -387,13 +372,11 @@ function injectCode() { var DIRECTORY = 0; var HIFI = 1; - var BLOCKS = 2; - var CLARA = 3; - var HIFI_ITEM_PAGE = 4; + var CLARA = 2; + var HIFI_ITEM_PAGE = 3; var pageType = DIRECTORY; if (location.href.indexOf("highfidelity.com/") !== -1) { pageType = HIFI; } - if (location.href.indexOf("google.com/") !== -1) { pageType = BLOCKS; } if (location.href.indexOf("clara.io/") !== -1) { pageType = CLARA; } if (location.href.indexOf("highfidelity.com/marketplace/items/") !== -1) { pageType = HIFI_ITEM_PAGE; } @@ -408,11 +391,6 @@ case CLARA: injectClaraCode(); break; - case BLOCKS: - console.log("in Blocks"); - //injectBlocksCode(); - //console.log("blocks injection"); - break; case HIFI_ITEM_PAGE: injectHiFiItemPageCode(); break; diff --git a/scripts/system/html/marketplaces.html b/scripts/system/html/marketplaces.html index 10184ae101..9e001c064f 100644 --- a/scripts/system/html/marketplaces.html +++ b/scripts/system/html/marketplaces.html @@ -31,18 +31,6 @@
-
-
- -
-
-

Blocks, released by Google, allows anyone to create 3D models using just a few simple tools. Browse through other users' creations for low-poly assets to add to your world.

-
-
- -
-
-
diff --git a/scripts/system/marketplaces/blocksApp.js b/scripts/system/marketplaces/blocksApp.js new file mode 100644 index 0000000000..46a102042e --- /dev/null +++ b/scripts/system/marketplaces/blocksApp.js @@ -0,0 +1,22 @@ +(function() { + var APP_NAME = "BLOCKS"; + var APP_URL = "https://vr.google.com/objects/"; + var APP_ICON = "https://hifi-content.s3.amazonaws.com/faye/gemstoneMagicMaker/gemstoneAppIcon.svg"; + + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var button = tablet.addButton({ + icon: APP_ICON, + text: APP_NAME + }); + + function onClicked() { + tablet.gotoWebScreen(APP_URL); + } + button.clicked.connect(onClicked); + + function cleanup() { + tablet.removeButton(button); + } + + Script.scriptEnding.connect(cleanup); +}()); \ No newline at end of file