download/debian,ubuntu: Support 2nd "copy script" button
authorChristoph Berg <myon@debian.org>
Tue, 16 Apr 2024 12:04:11 +0000 (14:04 +0200)
committerChristoph Berg <myon@debian.org>
Tue, 16 Apr 2024 12:04:11 +0000 (14:04 +0200)
media/js/download.js
templates/pages/download/linux/debian.html
templates/pages/download/linux/ubuntu.html

index 5faa38004ff83f3bb8607cfb2a41742b114b086f..8493ef0683f6d25769e322c1218a86c3fa12ecdd 100644 (file)
@@ -16,12 +16,17 @@ function setupHandlers() {
         });
     }
 
-    /* Copy Script button on /download/linux/debian and /download/linux/ubuntu */
+    /* Copy Script buttons on /download/linux/debian and /download/linux/ubuntu */
     if (document.getElementById("copy-btn") && document.getElementById("script-box")) {
         document.getElementById('copy-btn').addEventListener('click', function () {
             copyScript(this, 'script-box');
         });
     }
+    if (document.getElementById("copy-btn2") && document.getElementById("script-box2")) {
+        document.getElementById('copy-btn2').addEventListener('click', function () {
+            copyScript(this, 'script-box2');
+        });
+    }
 }
 
 document.addEventListener("DOMContentLoaded", setupHandlers);
index 919c5c924910dd01e5136217cca850914e8c6310..8f628deb231b8cbec225161e90225ec796403962 100644 (file)
@@ -67,7 +67,7 @@ To manually configure the Apt repository, follow these steps:
 </p>
 
 <div class="pg-script-container">
-    <pre id="script-box" class="code"># Import the repository signing key:
+    <pre id="script-box2" class="code"># Import the repository signing key:
 sudo apt install curl ca-certificates
 sudo install -d /usr/share/postgresql-common/pgdg
 sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
@@ -81,7 +81,7 @@ sudo apt update
 # Install the latest version of PostgreSQL:
 # If you want a specific version, use 'postgresql-16' or similar instead of 'postgresql'
 sudo apt -y install postgresql</pre>
-    <button id="copy-btn" class="pg-script-copy-btn">Copy Script</button>
+    <button id="copy-btn2" class="pg-script-copy-btn">Copy Script</button>
 </div>
 
 <p>
index f721ba306fd55884df9fe3ce122523a162fae5bb..19c0a318c7cee88f21c591210ac96c65cb4f9a30 100644 (file)
@@ -66,7 +66,7 @@ To manually configure the Apt repository, follow these steps:
 </p>
 
 <div class="pg-script-container">
-    <pre id="script-box" class="code"># Import the repository signing key:
+    <pre id="script-box2" class="code"># Import the repository signing key:
 sudo apt install curl ca-certificates
 sudo install -d /usr/share/postgresql-common/pgdg
 sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
@@ -80,7 +80,7 @@ sudo apt update
 # Install the latest version of PostgreSQL:
 # If you want a specific version, use 'postgresql-16' or similar instead of 'postgresql'
 sudo apt -y install postgresql</pre>
-    <button id="copy-btn" class="pg-script-copy-btn">Copy Script</button>
+    <button id="copy-btn2" class="pg-script-copy-btn">Copy Script</button>
 </div>
 
 <p>