From a523c3db8e9106688b1adb35e251e812bdc7efce Mon Sep 17 00:00:00 2001
From: jonasled <git@jonasled.de>
Date: Sun, 28 Feb 2021 11:25:49 +0100
Subject: [PATCH] disable preview on index page

---
 public/index.php | 6 +++---
 ts/imgPreview.ts | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/public/index.php b/public/index.php
index 12e055c..f43f16d 100644
--- a/public/index.php
+++ b/public/index.php
@@ -14,7 +14,7 @@ if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
 getHeader("Jonas Leder", "home");
 ?>
     <div class="center">
-        <img id="homeImage" src="img/bildHome.webp">
+        <img id="homeImage" src="img/bildHome.webp" data-noPreview="true">
         <h2>&Uuml;ber mich</h2>
         <p class="left block">Hallo, mein Name ist Jonas Leder. Ich bin aktuell Student an der Dualen Hochschule Baden-Württemberg in Mannheim Fachrichtung Angewandte Informatik.</p>
         <p><a href="about.php"><button>Mehr</button></a></p>
@@ -53,8 +53,8 @@ getHeader("Jonas Leder", "home");
         </div>
         <div id="banner">
         <h2>Banner</h2>
-        <a target="_blank" href="https://ipv6.he.net"><img src="<?php echo($heIMG); ?>"></a>
-        <a target="_blank" href="https://www.abuseipdb.com/user/45130"><img style="width: 391px;background: #35c246 linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.3) 50%, rgba(0,0,0,.2) 51%, rgba(0,0,0,0));padding: 5px;" src="<?php echo($abuseIPIMG); ?>" style="width: 401px;"></a>
+        <a target="_blank" href="https://ipv6.he.net"><img src="<?php echo($heIMG); ?>" data-noPreview="true">></a>
+        <a target="_blank" href="https://www.abuseipdb.com/user/45130"><img style="width: 391px;background: #35c246 linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.3) 50%, rgba(0,0,0,.2) 51%, rgba(0,0,0,0));padding: 5px;" src="<?php echo($abuseIPIMG); ?>" style="width: 401px;" data-noPreview="true">></a>
         </div>
         <br>
         <br>
diff --git a/ts/imgPreview.ts b/ts/imgPreview.ts
index 7b9f614..d1dc0fb 100644
--- a/ts/imgPreview.ts
+++ b/ts/imgPreview.ts
@@ -1,7 +1,7 @@
 let images:HTMLCollectionOf<HTMLImageElement> = <HTMLCollectionOf<HTMLImageElement>> document.getElementsByTagName("img");
 for(let i = 0; i < images.length; i++){
     let element:HTMLImageElement = images[i];
-    if(element.getAttribute("data-noPreview") === "true") {
+    if(!(element.getAttribute("data-noPreview") === "true")) {
         element.onclick = () => createDialogImage(element.src);
     }
 }
\ No newline at end of file
-- 
GitLab