Switch and fix overlay clicks

This commit is contained in:
Zach Fox 2017-08-08 14:29:44 -07:00
parent 1493a310af
commit 7d26d2d88b
3 changed files with 16 additions and 10 deletions

View file

@ -241,6 +241,7 @@ void ContextOverlayInterface::contextOverlays_hoverLeaveEntity(const EntityItemI
}
static const QString MARKETPLACE_BASE_URL = "https://metaverse.highfidelity.com/marketplace/items/";
static const QString MARKETPLACES_INJECT_SCRIPT_URL = PathUtils::resourcesPath() + "../scripts/system/html/js/marketplacesInject.js";
void ContextOverlayInterface::openMarketplace() {
// lets open the tablet and go to the current item in
@ -250,7 +251,7 @@ void ContextOverlayInterface::openMarketplace() {
auto tablet = dynamic_cast<TabletProxy*>(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
// construct the url to the marketplace item
QString url = MARKETPLACE_BASE_URL + _entityMarketplaceID;
tablet->gotoWebScreen(url);
tablet->gotoWebScreen(url, MARKETPLACES_INJECT_SCRIPT_URL);
_hmdScriptingInterface->openTablet();
_isInMarketplaceInspectionMode = true;
}

View file

@ -25,6 +25,8 @@
var canWriteAssets = false;
var xmlHttpRequest = null;
var isPreparing = false; // Explicitly track download request status.
var confirmPurchases = true;
function injectCommonCode(isDirectoryPage) {
@ -97,17 +99,21 @@
}
function injectHiFiCode() {
$('.item-footer').find('#price-or-edit').find('a').attr('href', '#')
$('.item-footer').find('#price-or-edit').find('a').on('click', function () {
buyButtonClicked("TEST ITEM", "Zach Fox", 10);
});
if (confirmPurchases) {
$('.item-footer').find('#price-or-edit').find('a').attr('href', '#')
$('.item-footer').find('#price-or-edit').find('a').on('click', function () {
buyButtonClicked("TEST ITEM", "Zach Fox", 10);
});
}
}
function injectHiFiItemPageCode() {
$('#side-info').find('.btn').attr('href', '#')
$('#side-info').find('.btn').on('click', function () {
buyButtonClicked($('#top-center').find('h1').text(), $('#creator').find('.value').text(), 10);
});
if (confirmPurchases) {
$('#side-info').find('.btn').attr('href', '#')
$('#side-info').find('.btn').on('click', function () {
buyButtonClicked($('#top-center').find('h1').text(), $('#creator').find('.value').text(), 10);
});
}
}
function updateClaraCode() {

View file

@ -192,7 +192,6 @@
function fromQml(message) {
switch (message.method) {
case 'checkout_cancelClicked':
print('fromQml: ' + JSON.stringify(message));
tablet.popFromStack();
break;
case 'checkout_buyClicked':