about summary refs log tree commit diff
path: root/pkgs/profpatsch/profpatsch.de
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-09-17 16:01:57 +0200
committerProfpatsch <mail@profpatsch.de>2020-09-17 16:04:06 +0200
commitad1e0dea56daafb396d4266d29c30905e9e0f984 (patch)
treed800d2aecce87da7f9523daa3eddfa5d86360c73 /pkgs/profpatsch/profpatsch.de
parent7b8164be35c9d82d6e7389a407150a9128f7fb0c (diff)
pkgs/profpatsch.de: replace jquery by native js
It was only used for a single use-case, by now all browsers support
this functionality. It’s a pretty heavy dependency for a single use :)

Co-Authored-By: midzer <midzer@gmail.com>
Diffstat (limited to 'pkgs/profpatsch/profpatsch.de')
-rw-r--r--pkgs/profpatsch/profpatsch.de/default.nix12
-rw-r--r--pkgs/profpatsch/profpatsch.de/index.html.nix9
-rw-r--r--pkgs/profpatsch/profpatsch.de/talkies.js4
3 files changed, 7 insertions, 18 deletions
diff --git a/pkgs/profpatsch/profpatsch.de/default.nix b/pkgs/profpatsch/profpatsch.de/default.nix
index 91313e49..338599ae 100644
--- a/pkgs/profpatsch/profpatsch.de/default.nix
+++ b/pkgs/profpatsch/profpatsch.de/default.nix
@@ -4,11 +4,6 @@ let
   bins = getBins pkgs.coreutils [ "ln" "mkdir" "echo" "printenv" "cat" "env" ]
     // getBins pkgs.fdtools [ "multitee" ];
 
-  jquery = pkgs.fetchurl {
-    url = "https://code.jquery.com/jquery-3.5.1.min.js";
-    sha256 = "0gbfbfcbcpl8nq2shknsyz5pirf5wbnb54m3dynxs68x9y4sbxpp";
-  };
-
   quattrocento-latin = pkgs.fetchurl {
     url = "https://fonts.gstatic.com/s/quattrocento/v11/OZpEg_xvsDZQL_LKIF7q4jP3w2j6.woff2";
     sha256 = "161dzd0az6zw8js1q8ikf4yhm0h9zidc5wqlnsrpzw5npdzmbzbi";
@@ -35,11 +30,6 @@ let
 
   staticFiles =
     rec {
-      jsJquery = {
-        relativeDir = [ "js" ];
-        relativeFile = "jquery.js";
-        path = jquery;
-      };
       jsTalkies = {
         relativeDir = [ "js" ];
         relativeFile = "talkies.js";
@@ -89,7 +79,7 @@ let
         relativeDir = [];
         relativeFile = "index.html";
         path = applyTemplate "index.html" ./index.html.nix {
-          inherit jsJquery jsTalkies;
+          inherit jsTalkies;
           inherit cssNormalize cssMain;
           inherit cv_pdf id_txt;
           # preloading
diff --git a/pkgs/profpatsch/profpatsch.de/index.html.nix b/pkgs/profpatsch/profpatsch.de/index.html.nix
index c87190d9..e6c73b14 100644
--- a/pkgs/profpatsch/profpatsch.de/index.html.nix
+++ b/pkgs/profpatsch/profpatsch.de/index.html.nix
@@ -1,4 +1,4 @@
-{ jsJquery, jsTalkies
+{ jsTalkies
 , cssNormalize, cssMain
 , id_txt, cv_pdf
 , fontsQuattrocentoLatin, fontsOpenSansLatin
@@ -20,7 +20,6 @@
     -->
     <link rel="icon" href="data:,">
 
-    <link rel="preload" href="${jsJquery}" as="script">
     <link rel="preload" href="${jsTalkies}" as="script">
     <link rel="preload" href="${cssNormalize}" as="style">
     <link rel="preload" href="${cssMain}" as="style">
@@ -31,9 +30,7 @@
     <link rel="stylesheet" href="${cssNormalize}">
     <link rel="stylesheet" href="${cssMain}">
 
-    <!-- TODO: get rid of jquery -->
     <script src="${jsTalkies}"></script>
-    <script src="${jsJquery}"></script>
   </head>
   <body>
 
@@ -41,7 +38,7 @@
       <h1>Profpatsch</h1>
       <h2>
         <script>
-          appendTalkies($('#title h2'));
+          appendTalkies(document.querySelector('#title h2'));
         </script>
         <noscript>
           Oh the things you’ll see …
@@ -68,6 +65,8 @@
       <p>On another note, you can find me practically everywhere under my nick (Github, G+, several mailinglists, SO, &amp;c.)
 
       <p>There you go. Cya!</p>
+
+
     </main>
   </body>
 </html>
diff --git a/pkgs/profpatsch/profpatsch.de/talkies.js b/pkgs/profpatsch/profpatsch.de/talkies.js
index 9f6a13c7..7cbf77ad 100644
--- a/pkgs/profpatsch/profpatsch.de/talkies.js
+++ b/pkgs/profpatsch/profpatsch.de/talkies.js
@@ -1,4 +1,4 @@
-function appendTalkies(jquery_element) {
+function appendTalkies(append_to_element) {
     talkies = [
         { talk: "Oh the things you’ll see …" },
         { talk: "I’ll manage." },
@@ -149,5 +149,5 @@ function appendTalkies(jquery_element) {
             return '<span '+attrs+'>'+content+'</span>';
         };
     }
-    $(jquery_element).append(elem(talkie.talk, title));
+    append_to_element.innerHTML = elem(talkie.talk, title);
 }