mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 23:55:24 +02:00
Add placeholder image when previous snapshot can't be loaded
This commit is contained in:
parent
4a52f4090d
commit
0441d8c703
3 changed files with 23 additions and 15 deletions
BIN
interface/resources/snapshot/img/no-image.jpg
Normal file
BIN
interface/resources/snapshot/img/no-image.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -293,19 +293,25 @@ function addImage(image_data, isLoggedIn, canShare, isGifLoading, isShowingPrevi
|
|||
isGif = img.src.split('.').pop().toLowerCase() === "gif";
|
||||
imageContainer.appendChild(img);
|
||||
document.getElementById("snapshot-images").appendChild(imageContainer);
|
||||
paths.push(image_data.localPath);
|
||||
if (isGif) {
|
||||
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
||||
}
|
||||
if (!isGifLoading) {
|
||||
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
||||
}
|
||||
if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) {
|
||||
shareForUrl(id);
|
||||
}
|
||||
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
||||
updateShareInfo(id, image_data.story_id);
|
||||
}
|
||||
img.onload = function () {
|
||||
paths.push(image_data.localPath);
|
||||
if (isGif) {
|
||||
imageContainer.innerHTML += '<span class="gifLabel">GIF</span>';
|
||||
}
|
||||
if (!isGifLoading) {
|
||||
appendShareBar(id, isLoggedIn, canShare, isGif, blastButtonDisabled, hifiButtonDisabled, canBlast);
|
||||
}
|
||||
if (!isGifLoading || (isShowingPreviousImages && !image_data.story_id)) {
|
||||
shareForUrl(id);
|
||||
}
|
||||
if (isShowingPreviousImages && isLoggedIn && image_data.story_id) {
|
||||
updateShareInfo(id, image_data.story_id);
|
||||
}
|
||||
};
|
||||
img.onerror = function () {
|
||||
img.onload = null;
|
||||
img.src = image_data.errorPath;
|
||||
};
|
||||
}
|
||||
function showConfirmationMessage(selectedID, destination) {
|
||||
if (selectedID.id) {
|
||||
|
|
|
@ -273,7 +273,8 @@ function fillImageDataFromPrevious() {
|
|||
localPath: previousStillSnapPath,
|
||||
story_id: previousStillSnapStoryID,
|
||||
blastButtonDisabled: previousStillSnapBlastingDisabled,
|
||||
hifiButtonDisabled: previousStillSnapHifiSharingDisabled
|
||||
hifiButtonDisabled: previousStillSnapHifiSharingDisabled,
|
||||
errorPath: Script.resolvePath(Script.resourcesPath() + 'snapshot/img/no-image.jpg')
|
||||
});
|
||||
}
|
||||
if (previousAnimatedSnapPath !== "") {
|
||||
|
@ -281,7 +282,8 @@ function fillImageDataFromPrevious() {
|
|||
localPath: previousAnimatedSnapPath,
|
||||
story_id: previousAnimatedSnapStoryID,
|
||||
blastButtonDisabled: previousAnimatedSnapBlastingDisabled,
|
||||
hifiButtonDisabled: previousAnimatedSnapHifiSharingDisabled
|
||||
hifiButtonDisabled: previousAnimatedSnapHifiSharingDisabled,
|
||||
errorPath: Script.resolvePath(Script.resourcesPath() + 'snapshot/img/no-image.jpg')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue