Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,28 @@ <h5 data-i18n="footer.in-touch.header">Keep in Touch</h5>
});

$.when(ajaxRequest, i18nLoaded).done(function (data) {
var build = data[0][0],
buildName = build.versionString;
var allBuilds = data[0],
build = data[0][0]; // default initialization with latest build

// Find the applicable build for current platform
// If current platform is unsupported (OTHERS), then take the last common release
// If a build entry doesn't have 'platforms' key -> Older format for all supported OS
for (var buildIndex = 0; buildIndex < allBuilds.length; buildIndex++) {
build = allBuilds[buildIndex];
if (!build.platforms) { // Older format detected - Applicable to all platforms
break;
} else {
if (build.platforms[OS]) { // Current platform is one of the supported platforms
break;
} else if (OS == "OTHER") { // Unsupported platform detected
if (Object.keys(build.platforms).length == 4) { // Build applicable for all platforms
break;
}
}
}
}

var buildName = build.versionString;

if (buildName) {
var buildNum = buildName.match(/([\d.]+)/);
Expand All @@ -470,11 +490,16 @@ <h5 data-i18n="footer.in-touch.header">Keep in Touch</h5>

// update button
if (OS !== "OTHER" && buildNum) {
var tag = buildName.toLowerCase().split(" ").join("-"),
var url;
if (build.platforms && build.platforms[OS]) { // Fetch download url from platform entry
url = build.platforms[OS].downloadURL;
} else { // Generate the download URI
var tag = buildName.toLowerCase().split(" ").join("-");
url = "https://github.com/adobe/brackets/releases/" + tag;

if (ext) {
url = "https://github.com/adobe/brackets/releases/download/" + tag + "/Brackets." + buildName.split(" ").join(".") + ext;
if (ext) {
url = "https://github.com/adobe/brackets/releases/download/" + tag + "/Brackets." + buildName.split(" ").join(".") + ext;
}
}

$("#download-brackets-version").text(buildNum);
Expand Down