diff --git a/media/css/main.css b/media/css/main.css index dede2b90..34e04cb5 100644 --- a/media/css/main.css +++ b/media/css/main.css @@ -2001,10 +2001,49 @@ button.imagebutton { position: relative; } +.pg-script-container pre.code { + padding-right: 2.5rem; + min-height: 3rem; + display: flex; + align-items: center; +} + .pg-script-copy-btn { position: absolute; - top: 8px; - right: 8px; + top: 0.5rem; + right: 0.5rem; + background: transparent; + border: none; + font-size: 1rem; + padding: 4px 6px; + cursor: pointer; + transition: color 0.2s; +} + +.pg-script-copy-btn i { + color: #555 !important; + margin: 0 !important; + transition: color 0.2s; +} + +.pg-script-copy-btn:hover i { + color: #336791 !important; +} + +.pg-script-copy-btn.copied i { + color: #28a745 !important; +} + +[data-theme="dark"] .pg-script-copy-btn i { + color: #ccc !important; +} + +[data-theme="dark"] .pg-script-copy-btn:hover i { + color: #fff !important; +} + +[data-theme="dark"] .pg-script-copy-btn.copied i { + color: #7dff7d !important; } .nobr { diff --git a/media/js/main.js b/media/js/main.js index 335efb2a..6be75fa8 100644 --- a/media/js/main.js +++ b/media/js/main.js @@ -79,12 +79,26 @@ function copyScript(trigger, elem) { scratch.parentNode.removeChild(scratch); // Indicate to the user that the script was copied - var label = trigger.innerHTML; - trigger.innerHTML = 'Copied!'; - - setTimeout(function() { - trigger.innerHTML = label; - }, 3000); + var icon = trigger.querySelector('i'); + if (icon) { + icon.classList.remove('fa-copy'); + icon.classList.add('fa-check'); + trigger.classList.add('copied'); + + setTimeout(function() { + icon.classList.remove('fa-check'); + icon.classList.add('fa-copy'); + trigger.classList.remove('copied'); + }, 3000); + } else { + // Fallback for text-based buttons + var label = trigger.innerHTML; + trigger.innerHTML = 'Copied!'; + + setTimeout(function() { + trigger.innerHTML = label; + }, 3000); + } } /* diff --git a/templates/pages/download/linux/debian.html b/templates/pages/download/linux/debian.html index a11e7a0f..6901eb38 100644 --- a/templates/pages/download/linux/debian.html +++ b/templates/pages/download/linux/debian.html @@ -58,7 +58,7 @@ Automated repository configuration:
sudo apt install -y postgresql-common
 sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
- +

@@ -77,14 +77,14 @@ sudo sh -c "echo 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresq # Update the package lists: sudo apt update - + Install PostgreSQL: (replace "18" by the version you want)

sudo apt install postgresql-18
- +

diff --git a/templates/pages/download/linux/redhat.html b/templates/pages/download/linux/redhat.html index e352dccb..7215a083 100644 --- a/templates/pages/download/linux/redhat.html +++ b/templates/pages/download/linux/redhat.html @@ -60,7 +60,7 @@ To use the PostgreSQL Yum Repository, follow these steps:

  • Copy, paste and run the relevant parts of the setup script:
    
    -        
    +        
         
  • diff --git a/templates/pages/download/linux/ubuntu.html b/templates/pages/download/linux/ubuntu.html index d2f123fa..7226616a 100644 --- a/templates/pages/download/linux/ubuntu.html +++ b/templates/pages/download/linux/ubuntu.html @@ -57,7 +57,7 @@ Automated repository configuration:
    sudo apt install -y postgresql-common
     sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
    - +

    @@ -76,14 +76,14 @@ sudo sh -c "echo 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresq # Update the package lists: sudo apt update - + Install PostgreSQL: (replace "18" by the version you want)

    sudo apt install postgresql-18
    - +