Skip to content

Commit e895846

Browse files
committed
launch web editor will be shown in all platforms where brackets native builds are not available
1 parent cca2e47 commit e895846

1 file changed

Lines changed: 37 additions & 26 deletions

File tree

index.html

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,6 @@ <h2>
229229
target="_blank"
230230
> <i class="fas fa-download" style="margin-right: 8px;"></i><span data-i18n="index.page.content.phoenixio" style="color: black;font-size: unset;">Get it from phcode.io</span>
231231
</a>
232-
<a
233-
onclick="logDownloadClicked('launchWebEditor');"
234-
style="margin-left: 10px;margin-right: 10px;"
235-
id="launch-editor-button"
236-
href="https://phcode.dev"
237-
class="rounded radius button"
238-
style="background-color: #fe9615; color: black;"
239-
data-i18n="index.page.content.phoenixLaunch"
240-
target="_blank"
241-
>Launch Web Editor</a
242-
>
243232
</div>
244233
<div style="display: flex">
245234
<a
@@ -286,23 +275,20 @@ <h1>
286275
<!-- Temporary link to download page -->
287276
<a
288277
id="download-plain-brackets"
289-
class="large rounded radius"
278+
class="rounded radius button"
290279
href="https://github.com/adobe/brackets/releases"
280+
style="display: inline-flex;background-color: black; color: white; align-items: center;padding-left: 1.5rem;justify-content: center;"
281+
onclick="mainDownloadClicked()"
291282
download>
292-
<button
293-
class="download-button"
294-
onclick="mainDownloadClicked()">
295-
<i
296-
class="fa fa-spinner fa-spin"
297-
style="
298-
visibility: hidden;
299-
margin-left: -16px;
283+
<i
284+
class="fa fa-spinner fa-spin"
285+
style="
286+
display: none;
300287
"
301-
id="mainDownloadSpinner"></i>
302-
<span data-i18n="[html]index.page.hero.download"
303-
>Download</span
304-
>
305-
</button>
288+
id="mainDownloadSpinner"></i>
289+
<span data-i18n="[html]index.page.hero.download" style="color: white;font-size: unset;"
290+
>Download</span
291+
>
306292
</a>
307293
<a
308294
id="phcodeio-button-main"
@@ -312,6 +298,15 @@ <h1>
312298
style="background-color: #fe9615; color: black; display: inline-flex;align-items: center;padding-left: 1.5rem;"
313299
> <i class="fas fa-download" style="margin-right: 8px;"></i><span data-i18n="index.page.content.phoenixioDownload" style="color: black;font-size: unset;">Download from phcode.io</span>
314300
</a>
301+
<a
302+
onclick="logDownloadClicked('launchWebEditor');"
303+
id="launch-editor-button"
304+
href="https://phcode.dev"
305+
class="rounded radius button forced-hidden"
306+
style="background-color: #fe9615; color: black;margin-left: 10px;margin-right: 10px;border-radius: 5px;"
307+
data-i18n="index.page.content.phoenixLaunch"
308+
target="_blank"
309+
>Launch Web Editor</a>
315310
<span style="font-size: small">
316311
<br />
317312
<span data-i18n="[html]index.page.hero.attribution"
@@ -729,6 +724,7 @@ <h5 data-i18n="footer.in-touch.header">Keep in Touch</h5>
729724
if (/NT ?5\.\d/.test(navigator.userAgent)) {
730725
FLAVOR = "Windows XP";
731726
}
727+
$("#launch-editor-button").removeClass("forced-hidden");
732728
} else if (/Mac/.test(navigator.userAgent)) {
733729
OS = "OSX";
734730
ext = ".dmg";
@@ -742,6 +738,7 @@ <h5 data-i18n="footer.in-touch.header">Keep in Touch</h5>
742738
// Mac OS X pre 10.6.8 is not supported
743739
FLAVOR = "Mac OS X 10." + osMatch;
744740
}
741+
$("#launch-editor-button").removeClass("forced-hidden");
745742
} else if (/Linux|X11/.test(navigator.userAgent)) {
746743
OS = "LINUX32";
747744
$("#download-plain-brackets").hide();
@@ -750,13 +747,27 @@ <h5 data-i18n="footer.in-touch.header">Keep in Touch</h5>
750747
}
751748
if (/iPad|iPod|iPhone|Android/.test(navigator.userAgent)) {
752749
OS = "OTHER";
753-
$("#download").hide();
750+
$("#download-plain-brackets").hide();
751+
$("#phcode-upgrade").hide();
752+
$("#phcodeio-button-main").hide();
753+
$("#launch-editor-button").removeClass("forced-hidden");
754754
} else {
755755
$(
756756
"<img src='img/hero.png' srcset='img/hero@2x.png 2x' height='370' width='1059' alt='Screenshot of Brackets'>"
757757
).appendTo("#download");
758758
}
759759

760+
function setUniformButtonWidth() {
761+
var width1 = document.getElementById('download-plain-brackets').offsetWidth;
762+
var width2 = document.getElementById('launch-editor-button').offsetWidth;
763+
var maxWidth = Math.max(width1, width2, 250);
764+
765+
document.getElementById('download-plain-brackets').style.width = maxWidth + 'px';
766+
document.getElementById('launch-editor-button').style.width = maxWidth + 'px';
767+
}
768+
setUniformButtonWidth();
769+
770+
760771
function setupDownloads() {
761772
let downloadURL =
762773
buildURL[OS] ||

0 commit comments

Comments
 (0)