|
110 | 110 | var ua = (navigator.userAgent || '').toLowerCase(); |
111 | 111 | var plat = (navigator.platform || '').toLowerCase(); |
112 | 112 | if (ua.indexOf('windows') !== -1 || plat.indexOf('win') !== -1) return 'windows'; |
113 | | - if (ua.indexOf('mac') !== -1 || plat.indexOf('mac') !== -1) { |
114 | | - // Apple Silicon is the default for new Macs; cannot read arch reliably. |
115 | | - return 'macos-arm'; |
116 | | - } |
| 113 | + if (ua.indexOf('mac') !== -1 || plat.indexOf('mac') !== -1) return 'macos'; |
117 | 114 | if (ua.indexOf('linux') !== -1 || ua.indexOf('x11') !== -1) return 'linux-deb'; |
118 | 115 | return null; |
119 | 116 | } |
120 | 117 |
|
121 | | - /* ---------- Platforms ---------- */ |
| 118 | + /* ---------- Platforms (pre-built: Windows + Linux only) ---------- */ |
122 | 119 | var PLATFORMS = [ |
123 | 120 | { id: 'windows', label: 'Windows', icon: 'i-windows', note: 'NSIS installer. Adds a Start Menu shortcut.', |
124 | 121 | match: function (n) { return n.endsWith('.exe') && n.indexOf('blockmap') === -1; } }, |
125 | | - { id: 'macos-arm', label: 'macOS, Apple Silicon', icon: 'i-apple', note: 'For M1, M2, M3 and M4 Macs.', |
126 | | - match: function (n) { return n.endsWith('.dmg') && n.indexOf('arm64') !== -1; } }, |
127 | | - { id: 'macos-intel', label: 'macOS, Intel', icon: 'i-apple', note: 'For older Intel based Macs.', |
128 | | - match: function (n) { return n.endsWith('.dmg') && n.indexOf('arm64') === -1; } }, |
129 | 122 | { id: 'linux-deb', label: 'Linux, Debian or Ubuntu', icon: 'i-linux', note: 'Pulls system deps automatically.', |
130 | 123 | match: function (n) { return n.endsWith('.deb'); } }, |
131 | 124 | { id: 'linux-appimage', label: 'Linux, universal', icon: 'i-linux', note: 'No install. Mark executable and run.', |
|
170 | 163 | }); |
171 | 164 |
|
172 | 165 | // Grid |
| 166 | + var macCard = |
| 167 | + '<div class="platform">' + |
| 168 | + '<div class="platform-head">' + icon('i-apple') + '<h4>macOS</h4></div>' + |
| 169 | + '<p class="pnote">No pre-built download — the unsigned app is blocked by Gatekeeper. Build from source instead.</p>' + |
| 170 | + '<div class="dl-links">' + |
| 171 | + '<a class="asset" href="https://github.com/' + REPO + '#quick-start" target="_blank" rel="noopener">' + |
| 172 | + icon('i-download') + |
| 173 | + '<span class="meta"><span class="fname">git clone & ./setup.sh</span>' + |
| 174 | + '<span class="fsize">Runs from source</span></span>' + |
| 175 | + '<span class="go"><svg class="ic"><use href="#i-arrow"/></svg></span>' + |
| 176 | + '</a>' + |
| 177 | + '</div>' + |
| 178 | + '</div>'; |
173 | 179 | el('dl-grid').innerHTML = byPlatform.map(function (g) { |
174 | 180 | var links = g.assets.length |
175 | 181 | ? g.assets.map(assetRow).join('') |
|
179 | 185 | '<p class="pnote">' + g.p.note + '</p>' + |
180 | 186 | '<div class="dl-links">' + links + '</div>' + |
181 | 187 | '</div>'; |
182 | | - }).join(''); |
| 188 | + }).join('') + macCard; |
183 | 189 |
|
184 | 190 | // Recommended card for the visitor's OS |
185 | 191 | var os = detectOS(); |
186 | | - var rec = null; |
187 | | - for (var k = 0; k < byPlatform.length; k++) { |
188 | | - if (byPlatform[k].p.id === os && byPlatform[k].assets.length) { rec = byPlatform[k]; break; } |
189 | | - } |
190 | | - if (rec) { |
191 | | - var a = rec.assets[0]; |
| 192 | + if (os === 'macos') { |
192 | 193 | el('dl-recommend').innerHTML = |
193 | 194 | '<div class="rec-left">' + |
194 | | - '<span class="rec-ic">' + icon(rec.p.icon) + '</span>' + |
| 195 | + '<span class="rec-ic">' + icon('i-apple') + '</span>' + |
195 | 196 | '<span class="rec-text">' + |
196 | | - '<span class="rec-label">Recommended for you</span>' + |
197 | | - '<span class="rec-title">' + rec.p.label + '</span>' + |
198 | | - '<span class="rec-file">' + a.name + ' · ' + fmtBytes(a.size) + '</span>' + |
| 197 | + '<span class="rec-label">You are on macOS</span>' + |
| 198 | + '<span class="rec-title">Build from source</span>' + |
| 199 | + '<span class="rec-file">No signed build yet · one-line ./setup.sh</span>' + |
199 | 200 | '</span>' + |
200 | 201 | '</div>' + |
201 | | - '<a class="btn btn-solid" href="' + a.browser_download_url + '" target="_blank" rel="noopener" download>' + |
202 | | - icon('i-download') + 'Download</a>'; |
| 202 | + '<a class="btn btn-solid" href="https://github.com/' + REPO + '#quick-start" target="_blank" rel="noopener">' + |
| 203 | + icon('i-download') + 'How to run</a>'; |
203 | 204 | el('dl-recommend').classList.remove('hidden'); |
204 | | - var heroLbl = el('hero-dl-label'); |
205 | | - if (heroLbl) { heroLbl.textContent = 'Download for ' + (os.indexOf('mac') === 0 ? 'macOS' : os.indexOf('win') === 0 ? 'Windows' : 'Linux'); } |
| 205 | + var heroLblMac = el('hero-dl-label'); |
| 206 | + if (heroLblMac) { heroLblMac.textContent = 'Build from source for macOS'; } |
| 207 | + } else { |
| 208 | + var rec = null; |
| 209 | + for (var k = 0; k < byPlatform.length; k++) { |
| 210 | + if (byPlatform[k].p.id === os && byPlatform[k].assets.length) { rec = byPlatform[k]; break; } |
| 211 | + } |
| 212 | + if (rec) { |
| 213 | + var a = rec.assets[0]; |
| 214 | + el('dl-recommend').innerHTML = |
| 215 | + '<div class="rec-left">' + |
| 216 | + '<span class="rec-ic">' + icon(rec.p.icon) + '</span>' + |
| 217 | + '<span class="rec-text">' + |
| 218 | + '<span class="rec-label">Recommended for you</span>' + |
| 219 | + '<span class="rec-title">' + rec.p.label + '</span>' + |
| 220 | + '<span class="rec-file">' + a.name + ' · ' + fmtBytes(a.size) + '</span>' + |
| 221 | + '</span>' + |
| 222 | + '</div>' + |
| 223 | + '<a class="btn btn-solid" href="' + a.browser_download_url + '" target="_blank" rel="noopener" download>' + |
| 224 | + icon('i-download') + 'Download</a>'; |
| 225 | + el('dl-recommend').classList.remove('hidden'); |
| 226 | + var heroLbl = el('hero-dl-label'); |
| 227 | + if (heroLbl) { heroLbl.textContent = 'Download for ' + (os.indexOf('win') === 0 ? 'Windows' : 'Linux'); } |
| 228 | + } |
206 | 229 | } |
207 | 230 |
|
208 | 231 | el('dl-loading').classList.add('hidden'); |
|
0 commit comments