download/debian,ubuntu: Support 2nd "copy script" button

This commit is contained in:
Christoph Berg
2024-04-16 14:04:11 +02:00
parent 83c2797722
commit 7a271485c8
3 changed files with 10 additions and 5 deletions

View 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);

View 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>

View 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>