mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 09:42:20 +02:00
Moved Blocks to tablet app
This commit is contained in:
parent
b0c91547b4
commit
28476960bb
4 changed files with 26 additions and 37 deletions
|
@ -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",
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
$("body").append(
|
||||
'<div id="marketplace-navigation">' +
|
||||
(!isInitialHiFiPage ? '<input id="back-button" type="button" class="white" value="< Back" />' : '') +
|
||||
(isInitialHiFiPage ? '<span class="glyph">🛈</span> <span class="text">Get items from Blocks and Clara.io!</span>' : '') +
|
||||
(isInitialHiFiPage ? '<span class="glyph">🛈</span> <span class="text">Get items from Clara.io!</span>' : '') +
|
||||
(!isDirectoryPage ? '<input id="all-markets" type="button" class="white" value="See All Markets" />' : '') +
|
||||
(isDirectoryPage ? '<span class="right"><span class="glyph">🛈</span> <span class="text">Select a marketplace to explore.</span><span>' : '') +
|
||||
'</div>'
|
||||
|
@ -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(
|
||||
'<div id="marketplace-navigation">' +
|
||||
'<input id="all-markets" type="button" class="white" value="See All Markets" />' +
|
||||
'</div>'
|
||||
);*/
|
||||
$("body").append(
|
||||
'<p>hello</p>'
|
||||
);
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -31,18 +31,6 @@
|
|||
</div>
|
||||
<hr class="tile-divider">
|
||||
</div>
|
||||
<div class="marketplace-tile">
|
||||
<div class="marketplace-tile-first-column">
|
||||
<img class="marketplace-tile-image" src="img/blocks-tile.png">
|
||||
</div>
|
||||
<div class="marketplace-tile-second-column">
|
||||
<p class="marketplace-tile-description">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.</p>
|
||||
</div>
|
||||
<div class="exploreButton-holder">
|
||||
<input class="blue exploreButton" type="button" value="Explore" id="exploreBlocksMarketplace" />
|
||||
</div>
|
||||
<hr class="tile-divider">
|
||||
</div>
|
||||
<div class="marketplace-tile">
|
||||
<div class="marketplace-tile-first-column">
|
||||
<img class="marketplace-tile-image" src="img/clara-tile.png">
|
||||
|
|
22
scripts/system/marketplaces/blocksApp.js
Normal file
22
scripts/system/marketplaces/blocksApp.js
Normal file
|
@ -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);
|
||||
}());
|
Loading…
Reference in a new issue