Skip to content

Commit

Permalink
Only download store logos in index; fixes #114
Browse files Browse the repository at this point in the history
  • Loading branch information
bilde2910 committed Dec 17, 2019
1 parent 088e4b5 commit 8c4a893
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion frontend/assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@
"btn_close": "Close",
"btn_show_all": "Show all",
"f_droid_badge_url": "https://fdroid.gitlab.io/artwork/badge/get-it-on.png",
"google_play_badge_url": "https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png"
"f_droid_badge_text": "Get it on F-Droid",
"google_play_badge_url": "https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png",
"google_play_badge_text": "Get it on Google Play"
}
16 changes: 8 additions & 8 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
<p class="body" style="margin-top:7vmin;" data-i18n="point_app_to"></p>
<p class="body" id="url">https://localhost/</p>
<p class="body"><a href="https://f-droid.org/packages/info.varden.hauk">
<img data-i18n="f_droid_badge_url"
data-i18n-attr="src"
alt="Get it on F-Droid"
class="store-icon"></a>
<img data-i18n="f_droid_badge_text"
data-i18n-attr="alt"
class="store-icon"
id="store-icon-fdroid"></a>
<a href="https://play.google.com/store/apps/details?id=info.varden.hauk">
<img data-i18n="google_play_badge_url"
data-i18n-attr="src"
alt="Get it on Google Play"
class="store-icon">
<img data-i18n="google_play_badge_text"
data-i18n-attr="alt"
class="store-icon"
id="store-icon-gplay">
</a></p>
</div>

Expand Down
4 changes: 4 additions & 0 deletions frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ function init() {

var urlE = document.getElementById("url");
var indexE = document.getElementById("index");
var storeIconFdroidE = document.getElementById("store-icon-fdroid");
var storeIconGplayE = document.getElementById("store-icon-gplay");
if (urlE !== null) urlE.textContent = url;
if (indexE !== null) indexE.style.display = "block";
if (storeIconFdroidE !== null) storeIconFdroidE.src = LANG["f_droid_badge_url"];
if (storeIconGplayE !== null) storeIconGplayE.src = LANG["google_play_badge_url"];
} else {
// Attempt to fetch location data from the server once.
getJSON("./api/fetch.php?id=" + id, function(data) {
Expand Down

0 comments on commit 8c4a893

Please sign in to comment.