It's working!

This commit is contained in:
Zach Fox 2017-04-11 16:37:28 -07:00
parent e296383b1b
commit 2579ac1baa
2 changed files with 12 additions and 9 deletions

View file

@ -21,6 +21,7 @@ function addImage(data) {
img = document.createElement("IMG"),
div2 = document.createElement("DIV"),
id = "p" + idCounter++;
img.id = id + "img";
function toggle() { data.share = input.checked; }
div.style.height = "" + Math.floor(100 / imageCount) + "%";
if (imageCount > 1) {
@ -31,7 +32,7 @@ function addImage(data) {
if (imageCount > 1) { // I'd rather use css, but the included stylesheet is quite particular.
// Our stylesheet(?) requires input.id to match label.for. Otherwise input doesn't display the check state.
label.setAttribute('for', id); // cannot do label.for =
input.id = id;
input.id = id + "check";
input.type = "checkbox";
input.checked = false;
data.share = input.checked;
@ -81,15 +82,14 @@ window.onload = function () {
handleShareButtons(messageOptions);
if (messageOptions.containsGif) {
var gifCheckbox = document.getElementById('p0');
if (messageOptions.processingGif) {
gifCheckbox.disabled = true;
imageCount = message.action.length + 1; // "+1" for the GIF that'll finish processing soon
message.action.unshift({ localPath: 'http://lorempixel.com/1512/1680' });
message.action.unshift({ localPath: '../../../resources/icons/profilePicLoading.gif' });
message.action.forEach(addImage);
document.getElementById('p0check').disabled = true;
} else {
gifCheckbox.disabled = false;
gifCheckbox.img.src = message.action.localPath;
document.getElementById('p0check').disabled = false;
document.getElementById('p0img').src = message.action[0].localPath;
}
} else {
imageCount = message.action.length;

View file

@ -212,6 +212,7 @@ function snapshotTaken(pathStillSnapshot, notify) {
{ localPath: pathStillSnapshot, href: href },
{
containsGif: false,
processingGif: false,
canShare: !!isDomainOpen(domainId),
openFeedAfterShare: shouldOpenFeedAfterShare()
}];
@ -222,7 +223,7 @@ function snapshotTaken(pathStillSnapshot, notify) {
HMD.openTablet();
}
function processingGifStarted() {
function processingGifStarted(pathStillSnapshot) {
Window.processingGifStarted.disconnect(processingGifStarted);
button.clicked.disconnect(onClicked);
buttonConnected = false;
@ -248,7 +249,7 @@ function processingGifStarted() {
HMD.openTablet();
}
function processingGifCompleted() {
function processingGifCompleted(pathAnimatedSnapshot) {
Window.processingGifCompleted.disconnect(processingGifCompleted);
button.clicked.connect(onClicked);
buttonConnected = true;
@ -257,7 +258,9 @@ function processingGifCompleted() {
{ localPath: pathAnimatedSnapshot, href: href },
{
containsGif: true,
processingGif: false
processingGif: false,
canShare: !!isDomainOpen(domainId),
openFeedAfterShare: shouldOpenFeedAfterShare()
}];
readyData = confirmShareContents;