mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Fix sharing; disable HiFi buttons independently
This commit is contained in:
parent
b82a333a5e
commit
ac86c13477
2 changed files with 128 additions and 103 deletions
|
@ -52,7 +52,7 @@ function clearImages() {
|
||||||
imageCount = 0;
|
imageCount = 0;
|
||||||
idCounter = 0;
|
idCounter = 0;
|
||||||
}
|
}
|
||||||
function addImage(image_data, isGifLoading, isShowingPreviousImages, canSharePreviousImages, hifiShareButtonsDisabled) {
|
function addImage(image_data, isGifLoading, canShare, isShowingPreviousImages, blastButtonDisabled, hifiButtonDisabled) {
|
||||||
if (!image_data.localPath) {
|
if (!image_data.localPath) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -80,22 +80,22 @@ function addImage(image_data, isGifLoading, isShowingPreviousImages, canSharePre
|
||||||
if (isGif) {
|
if (isGif) {
|
||||||
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
||||||
}
|
}
|
||||||
if (!isGifLoading && !isShowingPreviousImages) {
|
if (!isGifLoading && !isShowingPreviousImages && canShare) {
|
||||||
shareForUrl(id);
|
shareForUrl(id);
|
||||||
} else if (isShowingPreviousImages && canSharePreviousImages) {
|
} else if (isShowingPreviousImages && canShare) {
|
||||||
appendShareBar(id, image_data.story_id, isGif, hifiShareButtonsDisabled)
|
appendShareBar(id, image_data.story_id, isGif, blastButtonDisabled, hifiButtonDisabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function appendShareBar(divID, story_id, isGif, hifiShareButtonsDisabled) {
|
function appendShareBar(divID, story_id, isGif, blastButtonDisabled, hifiButtonDisabled) {
|
||||||
var story_url = "https://highfidelity.com/user_stories/" + story_id;
|
var story_url = "https://highfidelity.com/user_stories/" + story_id;
|
||||||
var parentDiv = document.getElementById(divID);
|
var parentDiv = document.getElementById(divID);
|
||||||
parentDiv.setAttribute('data-story-id', story_id);
|
parentDiv.setAttribute('data-story-id', story_id);
|
||||||
document.getElementById(divID).appendChild(createShareBar(divID, isGif, story_url, hifiShareButtonsDisabled));
|
document.getElementById(divID).appendChild(createShareBar(divID, isGif, story_url, blastButtonDisabled, hifiButtonDisabled));
|
||||||
if (divID === "p0") {
|
if (divID === "p0") {
|
||||||
selectImageToShare(divID, true);
|
selectImageToShare(divID, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function createShareBar(parentID, isGif, shareURL, hifiShareButtonsDisabled) {
|
function createShareBar(parentID, isGif, shareURL, blastButtonDisabled, hifiButtonDisabled) {
|
||||||
var shareBar = document.createElement("div");
|
var shareBar = document.createElement("div");
|
||||||
shareBar.id = parentID + "shareBar";
|
shareBar.id = parentID + "shareBar";
|
||||||
shareBar.className = "shareControls";
|
shareBar.className = "shareControls";
|
||||||
|
@ -109,8 +109,8 @@ function createShareBar(parentID, isGif, shareURL, hifiShareButtonsDisabled) {
|
||||||
var twitterButtonID = parentID + "twitterButton";
|
var twitterButtonID = parentID + "twitterButton";
|
||||||
shareBar.innerHTML += '' +
|
shareBar.innerHTML += '' +
|
||||||
'<div class="shareButtons" id="' + shareButtonsDivID + '" style="visibility:hidden">' +
|
'<div class="shareButtons" id="' + shareButtonsDivID + '" style="visibility:hidden">' +
|
||||||
'<input type="button"' + (hifiShareButtonsDisabled ? ' disabled' : '') + ' class="blastToConnections blueButton" id="' + blastToConnectionsButtonID + '" value="BLAST TO MY CONNECTIONS" onclick="blastToConnections(' + parentID + ', ' + isGif + ')" />' +
|
'<input type="button"' + (blastButtonDisabled ? ' disabled' : '') + ' class="blastToConnections blueButton" id="' + blastToConnectionsButtonID + '" value="BLAST TO MY CONNECTIONS" onclick="blastToConnections(' + parentID + ', ' + isGif + ')" />' +
|
||||||
'<input type="button"' + (hifiShareButtonsDisabled ? ' disabled' : '') + ' class="shareWithEveryone" id="' + shareWithEveryoneButtonID + '" onclick="shareWithEveryone(' + parentID + ', ' + isGif + ')" />' +
|
'<input type="button"' + (hifiButtonDisabled ? ' disabled' : '') + ' class="shareWithEveryone" id="' + shareWithEveryoneButtonID + '" onclick="shareWithEveryone(' + parentID + ', ' + isGif + ')" />' +
|
||||||
'<a class="facebookButton" id="' + facebookButtonID + '" onclick="shareButtonClicked(' + parentID + ')" target="_blank" href="https://www.facebook.com/dialog/feed?app_id=1585088821786423&link=' + shareURL + '"></a>' +
|
'<a class="facebookButton" id="' + facebookButtonID + '" onclick="shareButtonClicked(' + parentID + ')" target="_blank" href="https://www.facebook.com/dialog/feed?app_id=1585088821786423&link=' + shareURL + '"></a>' +
|
||||||
'<a class="twitterButton" id="' + twitterButtonID + '" onclick="shareButtonClicked(' + parentID + ')" target="_blank" href="https://twitter.com/intent/tweet?text=I%20just%20took%20a%20snapshot!&url=' + shareURL + '&via=highfidelity&hashtags=VR,HiFi"></a>' +
|
'<a class="twitterButton" id="' + twitterButtonID + '" onclick="shareButtonClicked(' + parentID + ')" target="_blank" href="https://twitter.com/intent/tweet?text=I%20just%20took%20a%20snapshot!&url=' + shareURL + '&via=highfidelity&hashtags=VR,HiFi"></a>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
|
@ -173,7 +173,6 @@ function blastToConnections(selectedID, isGif) {
|
||||||
selectedID = selectedID.id; // `selectedID` is passed as an HTML object to these functions; we just want the ID
|
selectedID = selectedID.id; // `selectedID` is passed as an HTML object to these functions; we just want the ID
|
||||||
|
|
||||||
document.getElementById(selectedID + "blastToConnectionsButton").disabled = true;
|
document.getElementById(selectedID + "blastToConnectionsButton").disabled = true;
|
||||||
document.getElementById(selectedID + "shareWithEveryoneButton").disabled = true;
|
|
||||||
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: "snapshot",
|
type: "snapshot",
|
||||||
|
@ -185,7 +184,6 @@ function blastToConnections(selectedID, isGif) {
|
||||||
function shareWithEveryone(selectedID, isGif) {
|
function shareWithEveryone(selectedID, isGif) {
|
||||||
selectedID = selectedID.id; // `selectedID` is passed as an HTML object to these functions; we just want the ID
|
selectedID = selectedID.id; // `selectedID` is passed as an HTML object to these functions; we just want the ID
|
||||||
|
|
||||||
document.getElementById(selectedID + "blastToConnectionsButton").disabled = true;
|
|
||||||
document.getElementById(selectedID + "shareWithEveryoneButton").disabled = true;
|
document.getElementById(selectedID + "shareWithEveryoneButton").disabled = true;
|
||||||
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
@ -260,7 +258,7 @@ window.onload = function () {
|
||||||
var messageOptions = message.options;
|
var messageOptions = message.options;
|
||||||
imageCount = message.image_data.length;
|
imageCount = message.image_data.length;
|
||||||
message.image_data.forEach(function (element, idx, array) {
|
message.image_data.forEach(function (element, idx, array) {
|
||||||
addImage(element, true, true, message.canShare, message.image_data[idx].buttonDisabled);
|
addImage(element, true, message.canShare, true, message.image_data[idx].blastButtonDisabled, message.image_data[idx].hifiButtonDisabled);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'addImages':
|
case 'addImages':
|
||||||
|
@ -274,7 +272,7 @@ window.onload = function () {
|
||||||
imageCount = message.image_data.length + 1; // "+1" for the GIF that'll finish processing soon
|
imageCount = message.image_data.length + 1; // "+1" for the GIF that'll finish processing soon
|
||||||
message.image_data.unshift({ localPath: messageOptions.loadingGifPath });
|
message.image_data.unshift({ localPath: messageOptions.loadingGifPath });
|
||||||
message.image_data.forEach(function (element, idx, array) {
|
message.image_data.forEach(function (element, idx, array) {
|
||||||
addImage(element, idx === 0, false, false);
|
addImage(element, idx === 0, messageOptions.canShare, false);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
var gifPath = message.image_data[0].localPath;
|
var gifPath = message.image_data[0].localPath;
|
||||||
|
@ -282,12 +280,14 @@ window.onload = function () {
|
||||||
p0img.src = gifPath;
|
p0img.src = gifPath;
|
||||||
|
|
||||||
paths[0] = gifPath;
|
paths[0] = gifPath;
|
||||||
shareForUrl("p0");
|
if (messageOptions.canShare) {
|
||||||
|
shareForUrl("p0");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
imageCount = message.image_data.length;
|
imageCount = message.image_data.length;
|
||||||
message.image_data.forEach(function (element, idx, array) {
|
message.image_data.forEach(function (element, idx, array) {
|
||||||
addImage(element, false, false, false);
|
addImage(element, false, messageOptions.canShare, false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -329,6 +329,6 @@ function testInBrowser(isTestingSetupInstructions) {
|
||||||
} else {
|
} else {
|
||||||
imageCount = 1;
|
imageCount = 1;
|
||||||
//addImage({ localPath: 'http://lorempixel.com/553/255' });
|
//addImage({ localPath: 'http://lorempixel.com/553/255' });
|
||||||
addImage({ localPath: 'C:/Users/valef/Desktop/hifi-snap-by-zfox-on-2017-04-26_10-26-53.gif' }, false, true, true, false);
|
addImage({ localPath: 'C:/Users/valef/Desktop/hifi-snap-by-zfox-on-2017-04-26_10-26-53.gif' }, false, true, true, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,13 +117,15 @@ function onMessage(message) {
|
||||||
setting: Settings.getValue("alsoTakeAnimatedSnapshot", true)
|
setting: Settings.getValue("alsoTakeAnimatedSnapshot", true)
|
||||||
}));
|
}));
|
||||||
if (Snapshot.getSnapshotsLocation() !== "") {
|
if (Snapshot.getSnapshotsLocation() !== "") {
|
||||||
tablet.emitScriptEvent(JSON.stringify({
|
isDomainOpen(Settings.getValue("previousSnapshotDomainID"), function (canShare) {
|
||||||
type: "snapshot",
|
tablet.emitScriptEvent(JSON.stringify({
|
||||||
action: "showPreviousImages",
|
type: "snapshot",
|
||||||
options: snapshotOptions,
|
action: "showPreviousImages",
|
||||||
image_data: imageData,
|
options: snapshotOptions,
|
||||||
canShare: !isDomainOpen(Settings.getValue("previousSnapshotDomainID"))
|
image_data: imageData,
|
||||||
}));
|
canShare: canShare
|
||||||
|
}));
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
tablet.emitScriptEvent(JSON.stringify({
|
tablet.emitScriptEvent(JSON.stringify({
|
||||||
type: "snapshot",
|
type: "snapshot",
|
||||||
|
@ -131,10 +133,12 @@ function onMessage(message) {
|
||||||
}));
|
}));
|
||||||
Settings.setValue("previousStillSnapPath", "");
|
Settings.setValue("previousStillSnapPath", "");
|
||||||
Settings.setValue("previousStillSnapStoryID", "");
|
Settings.setValue("previousStillSnapStoryID", "");
|
||||||
Settings.setValue("previousStillSnapSharingDisabled", false);
|
Settings.setValue("previousStillSnapBlastingDisabled", false);
|
||||||
|
Settings.setValue("previousStillSnapHifiSharingDisabled", false);
|
||||||
Settings.setValue("previousAnimatedSnapPath", "");
|
Settings.setValue("previousAnimatedSnapPath", "");
|
||||||
Settings.setValue("previousAnimatedSnapStoryID", "");
|
Settings.setValue("previousAnimatedSnapStoryID", "");
|
||||||
Settings.setValue("previousAnimatedSnapSharingDisabled", false);
|
Settings.setValue("previousAnimatedSnapBlastingDisabled", false);
|
||||||
|
Settings.setValue("previousAnimatedSnapHifiSharingDisabled", false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'chooseSnapshotLocation':
|
case 'chooseSnapshotLocation':
|
||||||
|
@ -180,9 +184,9 @@ function onMessage(message) {
|
||||||
isLoggedIn = Account.isLoggedIn();
|
isLoggedIn = Account.isLoggedIn();
|
||||||
storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(message.story_id), 1);
|
storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(message.story_id), 1);
|
||||||
if (message.isGif) {
|
if (message.isGif) {
|
||||||
Settings.setValue("previousAnimatedSnapSharingDisabled", true);
|
Settings.setValue("previousAnimatedSnapBlastingDisabled", true);
|
||||||
} else {
|
} else {
|
||||||
Settings.setValue("previousStillSnapSharingDisabled", true);
|
Settings.setValue("previousStillSnapBlastingDisabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
|
@ -220,9 +224,9 @@ function onMessage(message) {
|
||||||
if (error || (response.status !== 'success')) {
|
if (error || (response.status !== 'success')) {
|
||||||
print("ERROR uploading announcement story: ", error || response.status);
|
print("ERROR uploading announcement story: ", error || response.status);
|
||||||
if (message.isGif) {
|
if (message.isGif) {
|
||||||
Settings.setValue("previousAnimatedSnapSharingDisabled", false);
|
Settings.setValue("previousAnimatedSnapBlastingDisabled", false);
|
||||||
} else {
|
} else {
|
||||||
Settings.setValue("previousStillSnapSharingDisabled", false);
|
Settings.setValue("previousStillSnapBlastingDisabled", false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -240,9 +244,9 @@ function onMessage(message) {
|
||||||
isLoggedIn = Account.isLoggedIn();
|
isLoggedIn = Account.isLoggedIn();
|
||||||
storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(message.story_id), 1);
|
storyIDsToMaybeDelete.splice(storyIDsToMaybeDelete.indexOf(message.story_id), 1);
|
||||||
if (message.isGif) {
|
if (message.isGif) {
|
||||||
Settings.setValue("previousAnimatedSnapSharingDisabled", true);
|
Settings.setValue("previousAnimatedSnapHifiSharingDisabled", true);
|
||||||
} else {
|
} else {
|
||||||
Settings.setValue("previousStillSnapSharingDisabled", true);
|
Settings.setValue("previousStillSnapHifiSharingDisabled", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
|
@ -264,9 +268,9 @@ function onMessage(message) {
|
||||||
if (error || (response.status !== 'success')) {
|
if (error || (response.status !== 'success')) {
|
||||||
print("ERROR changing audience: ", error || response.status);
|
print("ERROR changing audience: ", error || response.status);
|
||||||
if (message.isGif) {
|
if (message.isGif) {
|
||||||
Settings.setValue("previousAnimatedSnapSharingDisabled", false);
|
Settings.setValue("previousAnimatedSnapHifiSharingDisabled", false);
|
||||||
} else {
|
} else {
|
||||||
Settings.setValue("previousStillSnapSharingDisabled", false);
|
Settings.setValue("previousStillSnapHifiSharingDisabled", false);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -301,10 +305,12 @@ function onButtonClicked() {
|
||||||
shouldActivateButton = true;
|
shouldActivateButton = true;
|
||||||
var previousStillSnapPath = Settings.getValue("previousStillSnapPath");
|
var previousStillSnapPath = Settings.getValue("previousStillSnapPath");
|
||||||
var previousStillSnapStoryID = Settings.getValue("previousStillSnapStoryID");
|
var previousStillSnapStoryID = Settings.getValue("previousStillSnapStoryID");
|
||||||
var previousStillSnapSharingDisabled = Settings.getValue("previousStillSnapSharingDisabled");
|
var previousStillSnapBlastingDisabled = Settings.getValue("previousStillSnapBlastingDisabled");
|
||||||
|
var previousStillSnapHifiSharingDisabled = Settings.getValue("previousStillSnapHifiSharingDisabled");
|
||||||
var previousAnimatedSnapPath = Settings.getValue("previousAnimatedSnapPath");
|
var previousAnimatedSnapPath = Settings.getValue("previousAnimatedSnapPath");
|
||||||
var previousAnimatedSnapStoryID = Settings.getValue("previousAnimatedSnapStoryID");
|
var previousAnimatedSnapStoryID = Settings.getValue("previousAnimatedSnapStoryID");
|
||||||
var previousAnimatedSnapSharingDisabled = Settings.getValue("previousAnimatedSnapSharingDisabled");
|
var previousAnimatedSnapBlastingDisabled = Settings.getValue("previousAnimatedSnapBlastingDisabled");
|
||||||
|
var previousAnimatedSnapHifiSharingDisabled = Settings.getValue("previousAnimatedSnapHifiSharingDisabled");
|
||||||
snapshotOptions = {
|
snapshotOptions = {
|
||||||
containsGif: previousAnimatedSnapPath !== "",
|
containsGif: previousAnimatedSnapPath !== "",
|
||||||
processingGif: false,
|
processingGif: false,
|
||||||
|
@ -312,10 +318,20 @@ function onButtonClicked() {
|
||||||
}
|
}
|
||||||
imageData = [];
|
imageData = [];
|
||||||
if (previousAnimatedSnapPath !== "") {
|
if (previousAnimatedSnapPath !== "") {
|
||||||
imageData.push({ localPath: previousAnimatedSnapPath, story_id: previousAnimatedSnapStoryID, buttonDisabled: previousAnimatedSnapSharingDisabled });
|
imageData.push({
|
||||||
|
localPath: previousAnimatedSnapPath,
|
||||||
|
story_id: previousAnimatedSnapStoryID,
|
||||||
|
blastButtonDisabled: previousAnimatedSnapBlastingDisabled,
|
||||||
|
hifiButtonDisabled: previousAnimatedSnapHifiSharingDisabled
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (previousStillSnapPath !== "") {
|
if (previousStillSnapPath !== "") {
|
||||||
imageData.push({ localPath: previousStillSnapPath, story_id: previousStillSnapStoryID, buttonDisabled: previousStillSnapSharingDisabled });
|
imageData.push({
|
||||||
|
localPath: previousStillSnapPath,
|
||||||
|
story_id: previousStillSnapStoryID,
|
||||||
|
blastButtonDisabled: previousStillSnapBlastingDisabled,
|
||||||
|
hifiButtonDisabled: previousStillSnapHifiSharingDisabled
|
||||||
|
});
|
||||||
}
|
}
|
||||||
tablet.gotoWebScreen(SNAPSHOT_REVIEW_URL);
|
tablet.gotoWebScreen(SNAPSHOT_REVIEW_URL);
|
||||||
tablet.webEventReceived.connect(onMessage);
|
tablet.webEventReceived.connect(onMessage);
|
||||||
|
@ -355,10 +371,12 @@ function takeSnapshot() {
|
||||||
}));
|
}));
|
||||||
Settings.setValue("previousStillSnapPath", "");
|
Settings.setValue("previousStillSnapPath", "");
|
||||||
Settings.setValue("previousStillSnapStoryID", "");
|
Settings.setValue("previousStillSnapStoryID", "");
|
||||||
Settings.setValue("previousStillSnapSharingDisabled", false);
|
Settings.setValue("previousStillSnapBlastingDisabled", false);
|
||||||
|
Settings.setValue("previousStillSnapHifiSharingDisabled", false);
|
||||||
Settings.setValue("previousAnimatedSnapPath", "");
|
Settings.setValue("previousAnimatedSnapPath", "");
|
||||||
Settings.setValue("previousAnimatedSnapStoryID", "");
|
Settings.setValue("previousAnimatedSnapStoryID", "");
|
||||||
Settings.setValue("previousAnimatedSnapSharingDisabled", false);
|
Settings.setValue("previousAnimatedSnapBlastingDisabled", false);
|
||||||
|
Settings.setValue("previousAnimatedSnapHifiSharingDisabled", false);
|
||||||
|
|
||||||
// Raising the desktop for the share dialog at end will interact badly with clearOverlayWhenMoving.
|
// Raising the desktop for the share dialog at end will interact badly with clearOverlayWhenMoving.
|
||||||
// Turn it off now, before we start futzing with things (and possibly moving).
|
// Turn it off now, before we start futzing with things (and possibly moving).
|
||||||
|
@ -403,32 +421,34 @@ function takeSnapshot() {
|
||||||
}, FINISH_SOUND_DELAY);
|
}, FINISH_SOUND_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isDomainOpen(id) {
|
function isDomainOpen(id, callback) {
|
||||||
print("Checking open status of domain with ID:", id);
|
print("Checking open status of domain with ID:", id);
|
||||||
if (!id) {
|
var status = false;
|
||||||
return false;
|
if (id) {
|
||||||
|
var options = [
|
||||||
|
'now=' + new Date().toISOString(),
|
||||||
|
'include_actions=concurrency',
|
||||||
|
'domain_id=' + id.slice(1, -1),
|
||||||
|
'restriction=open,hifi' // If we're sharing, we're logged in
|
||||||
|
// If we're here, protocol matches, and it is online
|
||||||
|
];
|
||||||
|
var url = METAVERSE_BASE + "/api/v1/user_stories?" + options.join('&');
|
||||||
|
|
||||||
|
request({
|
||||||
|
uri: url,
|
||||||
|
method: 'GET'
|
||||||
|
}, function (error, response) {
|
||||||
|
if (error || (response.status !== 'success')) {
|
||||||
|
print("ERROR getting open status of domain: ", error || response.status);
|
||||||
|
} else {
|
||||||
|
status = response.total_entries ? true : false;
|
||||||
|
}
|
||||||
|
print("Domain open status:", status);
|
||||||
|
callback(status);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
callback(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = [
|
|
||||||
'now=' + new Date().toISOString(),
|
|
||||||
'include_actions=concurrency',
|
|
||||||
'domain_id=' + id.slice(1, -1),
|
|
||||||
'restriction=open,hifi' // If we're sharing, we're logged in
|
|
||||||
// If we're here, protocol matches, and it is online
|
|
||||||
];
|
|
||||||
var url = METAVERSE_BASE + "/api/v1/user_stories?" + options.join('&');
|
|
||||||
|
|
||||||
return request({
|
|
||||||
uri: url,
|
|
||||||
method: 'GET'
|
|
||||||
}, function (error, response) {
|
|
||||||
if (error || (response.status !== 'success')) {
|
|
||||||
print("ERROR getting open status of domain: ", error || response.status);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return response.total_entries;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function stillSnapshotTaken(pathStillSnapshot, notify) {
|
function stillSnapshotTaken(pathStillSnapshot, notify) {
|
||||||
|
@ -448,25 +468,27 @@ function stillSnapshotTaken(pathStillSnapshot, notify) {
|
||||||
// during which time the user may have moved. So stash that info in the dialog so that
|
// during which time the user may have moved. So stash that info in the dialog so that
|
||||||
// it records the correct href. (We can also stash in .jpegs, but not .gifs.)
|
// it records the correct href. (We can also stash in .jpegs, but not .gifs.)
|
||||||
// last element in data array tells dialog whether we can share or not
|
// last element in data array tells dialog whether we can share or not
|
||||||
snapshotOptions = {
|
|
||||||
containsGif: false,
|
|
||||||
processingGif: false,
|
|
||||||
canShare: !isDomainOpen(domainId)
|
|
||||||
};
|
|
||||||
imageData = [{ localPath: pathStillSnapshot, href: href }];
|
|
||||||
Settings.setValue("previousStillSnapPath", pathStillSnapshot);
|
Settings.setValue("previousStillSnapPath", pathStillSnapshot);
|
||||||
|
|
||||||
tablet.emitScriptEvent(JSON.stringify({
|
|
||||||
type: "snapshot",
|
|
||||||
action: "addImages",
|
|
||||||
options: snapshotOptions,
|
|
||||||
image_data: imageData
|
|
||||||
}));
|
|
||||||
|
|
||||||
if (clearOverlayWhenMoving) {
|
if (clearOverlayWhenMoving) {
|
||||||
MyAvatar.setClearOverlayWhenMoving(true); // not until after the share dialog
|
MyAvatar.setClearOverlayWhenMoving(true); // not until after the share dialog
|
||||||
}
|
}
|
||||||
HMD.openTablet();
|
HMD.openTablet();
|
||||||
|
|
||||||
|
isDomainOpen(domainId, function (canShare) {
|
||||||
|
snapshotOptions = {
|
||||||
|
containsGif: false,
|
||||||
|
processingGif: false,
|
||||||
|
canShare: canShare
|
||||||
|
};
|
||||||
|
imageData = [{ localPath: pathStillSnapshot, href: href }];
|
||||||
|
tablet.emitScriptEvent(JSON.stringify({
|
||||||
|
type: "snapshot",
|
||||||
|
action: "addImages",
|
||||||
|
options: snapshotOptions,
|
||||||
|
image_data: imageData
|
||||||
|
}));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function processingGifStarted(pathStillSnapshot) {
|
function processingGifStarted(pathStillSnapshot) {
|
||||||
|
@ -478,27 +500,28 @@ function processingGifStarted(pathStillSnapshot) {
|
||||||
if (resetOverlays) {
|
if (resetOverlays) {
|
||||||
Menu.setIsOptionChecked("Overlays", true);
|
Menu.setIsOptionChecked("Overlays", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
snapshotOptions = {
|
|
||||||
containsGif: true,
|
|
||||||
processingGif: true,
|
|
||||||
loadingGifPath: Script.resolvePath(Script.resourcesPath() + 'icons/loadingDark.gif'),
|
|
||||||
canShare: !isDomainOpen(domainId)
|
|
||||||
};
|
|
||||||
imageData = [{ localPath: pathStillSnapshot, href: href }];
|
|
||||||
Settings.setValue("previousStillSnapPath", pathStillSnapshot);
|
Settings.setValue("previousStillSnapPath", pathStillSnapshot);
|
||||||
|
|
||||||
tablet.emitScriptEvent(JSON.stringify({
|
|
||||||
type: "snapshot",
|
|
||||||
action: "addImages",
|
|
||||||
options: snapshotOptions,
|
|
||||||
image_data: imageData
|
|
||||||
}));
|
|
||||||
|
|
||||||
if (clearOverlayWhenMoving) {
|
if (clearOverlayWhenMoving) {
|
||||||
MyAvatar.setClearOverlayWhenMoving(true); // not until after the share dialog
|
MyAvatar.setClearOverlayWhenMoving(true); // not until after the share dialog
|
||||||
}
|
}
|
||||||
HMD.openTablet();
|
HMD.openTablet();
|
||||||
|
|
||||||
|
isDomainOpen(domainId, function (canShare) {
|
||||||
|
snapshotOptions = {
|
||||||
|
containsGif: true,
|
||||||
|
processingGif: true,
|
||||||
|
loadingGifPath: Script.resolvePath(Script.resourcesPath() + 'icons/loadingDark.gif'),
|
||||||
|
canShare: canShare
|
||||||
|
};
|
||||||
|
imageData = [{ localPath: pathStillSnapshot, href: href }];
|
||||||
|
tablet.emitScriptEvent(JSON.stringify({
|
||||||
|
type: "snapshot",
|
||||||
|
action: "addImages",
|
||||||
|
options: snapshotOptions,
|
||||||
|
image_data: imageData
|
||||||
|
}));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function processingGifCompleted(pathAnimatedSnapshot) {
|
function processingGifCompleted(pathAnimatedSnapshot) {
|
||||||
|
@ -508,20 +531,22 @@ function processingGifCompleted(pathAnimatedSnapshot) {
|
||||||
buttonConnected = true;
|
buttonConnected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
snapshotOptions = {
|
|
||||||
containsGif: true,
|
|
||||||
processingGif: false,
|
|
||||||
canShare: !isDomainOpen(domainId)
|
|
||||||
}
|
|
||||||
imageData = [{ localPath: pathAnimatedSnapshot, href: href }];
|
|
||||||
Settings.setValue("previousAnimatedSnapPath", pathAnimatedSnapshot);
|
Settings.setValue("previousAnimatedSnapPath", pathAnimatedSnapshot);
|
||||||
|
|
||||||
tablet.emitScriptEvent(JSON.stringify({
|
isDomainOpen(domainId, function (canShare) {
|
||||||
type: "snapshot",
|
snapshotOptions = {
|
||||||
action: "addImages",
|
containsGif: true,
|
||||||
options: snapshotOptions,
|
processingGif: false,
|
||||||
image_data: imageData
|
canShare: canShare
|
||||||
}));
|
};
|
||||||
|
imageData = [{ localPath: pathAnimatedSnapshot, href: href }];
|
||||||
|
tablet.emitScriptEvent(JSON.stringify({
|
||||||
|
type: "snapshot",
|
||||||
|
action: "addImages",
|
||||||
|
options: snapshotOptions,
|
||||||
|
image_data: imageData
|
||||||
|
}));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function maybeDeleteSnapshotStories() {
|
function maybeDeleteSnapshotStories() {
|
||||||
storyIDsToMaybeDelete.forEach(function (element, idx, array) {
|
storyIDsToMaybeDelete.forEach(function (element, idx, array) {
|
||||||
|
|
Loading…
Reference in a new issue