|
15 | 15 | transition-duration: 1s; |
16 | 16 | } |
17 | 17 |
|
| 18 | + .hidden { |
| 19 | + display: none !important; |
| 20 | + } |
| 21 | + |
| 22 | + #macos-buttons { |
| 23 | + display: flex; |
| 24 | + gap: 0.5rem; |
| 25 | + flex-wrap: wrap; |
| 26 | + } |
| 27 | + |
18 | 28 | .checksum { |
19 | 29 | cursor: pointer; |
20 | 30 | color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1)); |
|
84 | 94 | downloadUrl = `${cdnUrl}win/x86_64/Positron-${version}-UserSetup-x64.exe`; |
85 | 95 | allDownloadsText = 'System Installer & Other Platforms'; |
86 | 96 | } else if (userAgent.indexOf('Mac') !== -1) { |
| 97 | + // Show two buttons for macOS: Apple Silicon and Intel |
| 98 | + const macButtons = document.getElementById('macos-buttons'); |
| 99 | + const macArmBtn = document.getElementById('download-btn-mac-arm'); |
| 100 | + const macIntelBtn = document.getElementById('download-btn-mac-intel'); |
| 101 | + |
| 102 | + if (macButtons && macArmBtn && macIntelBtn) { |
| 103 | + // Hide the main download button, show the macOS buttons |
| 104 | + downloadBtn.style.display = 'none'; |
| 105 | + macButtons.classList.remove('hidden'); |
| 106 | + |
| 107 | + // Set download URLs for both buttons |
| 108 | + const armUrl = `${cdnUrl}mac/arm64/Positron-${version}-arm64.dmg`; |
| 109 | + const intelUrl = `${cdnUrl}mac/x64/Positron-${version}-x64.dmg`; |
| 110 | + macArmBtn.dataset.originalHref = armUrl; |
| 111 | + macArmBtn.href = armUrl; |
| 112 | + macIntelBtn.dataset.originalHref = intelUrl; |
| 113 | + macIntelBtn.href = intelUrl; |
| 114 | + } |
| 115 | + |
87 | 116 | detectedOS = 'for macOS'; |
88 | | - downloadUrl = `${cdnUrl}mac/universal/Positron-${version}-universal.dmg`; |
89 | 117 | allDownloadsText = 'Other Platforms'; |
90 | 118 | } else if (userAgent.indexOf('Linux') !== -1) { |
91 | 119 | detectedOS = 'for Linux'; |
|
119 | 147 | const downloadTable = window.document.querySelector("#download-table"); |
120 | 148 | const downloadLinks = window.document.querySelectorAll("#download-table a"); |
121 | 149 | const downloadBtn = window.document.getElementById("download-btn"); |
| 150 | + const macArmBtn = window.document.getElementById("download-btn-mac-arm"); |
| 151 | + const macIntelBtn = window.document.getElementById("download-btn-mac-intel"); |
122 | 152 |
|
123 | 153 | if (enable) { |
124 | 154 | if (downloadTable) { |
|
129 | 159 | downloadBtn.disabled = false; |
130 | 160 | downloadBtn.classList.remove("disabled"); |
131 | 161 | } |
| 162 | + if (macArmBtn) { |
| 163 | + macArmBtn.disabled = false; |
| 164 | + macArmBtn.classList.remove("disabled"); |
| 165 | + } |
| 166 | + if (macIntelBtn) { |
| 167 | + macIntelBtn.disabled = false; |
| 168 | + macIntelBtn.classList.remove("disabled"); |
| 169 | + } |
132 | 170 | } |
133 | 171 | else { |
134 | 172 | if (downloadTable) { |
|
139 | 177 | downloadBtn.disabled = true; |
140 | 178 | downloadBtn.classList.add("disabled"); |
141 | 179 | } |
| 180 | + if (macArmBtn) { |
| 181 | + macArmBtn.disabled = true; |
| 182 | + macArmBtn.classList.add("disabled"); |
| 183 | + } |
| 184 | + if (macIntelBtn) { |
| 185 | + macIntelBtn.disabled = true; |
| 186 | + macIntelBtn.classList.add("disabled"); |
| 187 | + } |
142 | 188 | } |
143 | 189 |
|
144 | 190 | downloadLinks.forEach((link) => { |
|
0 commit comments