From 91b980a9215ce8c5f5cdb09a9ffb60fad9eee366 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 22 Mar 2020 10:29:35 -0400 Subject: [PATCH] Attempt to reference Image/wwtlogo.png relatively everywhere possible --- controllers/modals/ShareController.js | 15 +++++++++++++-- index.html | 4 ++-- views/modals/intro.html | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/controllers/modals/ShareController.js b/controllers/modals/ShareController.js index 63a09c5..ca4fc7e 100644 --- a/controllers/modals/ShareController.js +++ b/controllers/modals/ShareController.js @@ -42,9 +42,20 @@ wwt.controllers.controller('ShareController', hashManager.removeHashVal('dec', true); $scope.shareUrlReadOnly = $scope.shareUrl = hashManager.removeHashVal('fov', true); } + + var title, image; + + if ($scope.trackingObj) { + title = $scope.trackingObj.get_name() + ' - WorldWide Telescope'; + image = $scope.trackingObj.get_thumbnailUrl(); + } else { + title = $scope.getFromEn('WorldWide Telescope Web Client'); + image = new URL("Images/wwtlogo.png", window.location).toString(); + } + $('meta[property="og:url"]').attr('content', $scope.shareUrlReadOnly); - $('meta[property="og:title"]').attr('content', $scope.trackingObj ? $scope.trackingObj.get_name() + ' - WorldWide Telescope' : $scope.getFromEn('WorldWide Telescope Web Client')); - $('meta[property="og:image"]').attr('content', $scope.trackingObj ? $scope.trackingObj.get_thumbnailUrl() : 'https://wwtweb.blob.core.windows.net/webclient/wwtlogo.png'); + $('meta[property="og:title"]').attr('content', title); + $('meta[property="og:image"]').attr('content', image); selectUrl(222); }; diff --git a/index.html b/index.html index 86c5a26..e3057d7 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - + @@ -877,7 +877,7 @@