Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Homepage: Revised layout of main page; new download buttons
The download buttons were moved to the center of the top status box. Build information for downloads is fetched instantly from BDB. Removed the Ubuntu-specific download page, now part of the Linux page.
- Loading branch information
Showing
8 changed files
with
163 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,266 +1,23 @@ | ||
<div class="block"> | ||
<article><h1>Install Packages</h1> | ||
<p>Select the package you wish to install by clicking on it. You will then be directed to our primary download server and after a few moments your download should begin automatically. Once downloaded, run the install package and follow the onsreen instructions to complete the install.</p> | ||
<p><b>About Unstable Builds — Proceed with Caution!</b></p> | ||
<p>The unstable 2.0 builds are still being worked on rather heavily and miss several important features that are going to be in the final stable 2.0. The Snowberry front-end, for example, has now been <b>removed</b> in the unstable 2.0 builds. The front-end is required for certain basic things like loading PWADs, resource packs and other add-ons.</p> | ||
<p>Please consider using the stable 1.15 releases, especially if you are new to Doomsday.</p> | ||
<div id="downloads_list1" class="downloads_list"></div> | ||
<div id="downloads_list2" class="downloads_list"></div> | ||
<section id="overview"> | ||
<p>Doomsday Engine can run on recent 64-bit versions of macOS. If your macOS is more than two years old, please check out the <a href="http://wiki.dengine.net/w/Supported_platforms">older Doomsday releases</a>.</p> | ||
</section> | ||
</div> | ||
<div class="block"><article><h1>Stable</h1> | ||
<?php | ||
generate_badges('mac10_8-x86_64', BT_STABLE); | ||
?> | ||
</article></div> | ||
<div class="block"><article><h1>Release Candidate</h1> | ||
<p>Release candidate of the next upcoming stable build.</p> | ||
<?php | ||
generate_badges('mac10_10-x86_64', BT_CANDIDATE); | ||
?> | ||
</article></div> | ||
<div class="block"><article><h1>Unstable / Nightly</h1> | ||
<p>Unstable builds are made automatically every day when changes are committed to the <a href="http://dengine.net/source">source repository</a>. They contain work-in-progress code and sometimes may crash on you.</p> | ||
<?php | ||
generate_badges('mac10_10-x86_64', BT_UNSTABLE); | ||
?> | ||
</article> | ||
<article><h1>Minimum System Requirements</h1> | ||
<ul> | ||
<li>macOS version 10.6 (or later).</li> | ||
<li>Original game data files for each supported game that you wish to play (e.g., in the case of <strong>DOOM</strong> the only file needed is <em>doom.wad</em>).</li> | ||
<li>Some <a href="/addons" title="Doomsday add-ons">add-ons</a> may require a large amount of disk space (especially high quality texture and music packs).</li> | ||
</ul></article> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
|
||
var packages = new Array(); | ||
|
||
/// @return @c true if @a object is a string. | ||
function is_string(object) | ||
{ | ||
return typeof(object) == 'string'; | ||
} | ||
|
||
/** | ||
* Remove all DOM child elements of @a elementId. | ||
*/ | ||
function removeAllChildren(elementId) | ||
{ | ||
if(!is_string(elementId)) | ||
elementId = elementId.toString(); | ||
|
||
var element = document.getElementById(elementId); | ||
if(element && element.hasChildNodes()) | ||
{ | ||
while(element.childNodes.length) | ||
{ | ||
element.removeChild(element.firstChild); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Generate a fancy HTML badge for this package. | ||
*/ | ||
function genPackageBadgeHTML(json, downloadUri) | ||
{ | ||
// Compose badge title. | ||
var cleanTitle = json.title + ' ' + json.version; | ||
|
||
// Generate metadata HMTL. | ||
var metaData = '<span class="metalink">'; | ||
if(json.hasOwnProperty('is_unstable')) | ||
{ | ||
var isUnstable = json.is_unstable; | ||
var buildId = ''; | ||
|
||
if(json.hasOwnProperty('build_uniqueid')) | ||
{ | ||
buildId += ' build' + json.build_uniqueid; | ||
} | ||
|
||
if(isUnstable) | ||
{ | ||
cleanTitle += ' (Unstable)'; | ||
} | ||
} | ||
|
||
if(json.hasOwnProperty('release_date')) | ||
{ | ||
var releaseDate = new Date(Date.parse(json.release_date)); | ||
var shortDate = (releaseDate.getDate()) + '/' + (1 + releaseDate.getMonth()) + '/' + releaseDate.getFullYear(); | ||
metaData += '<span title="Release Date">' + shortDate + '</span> · '; | ||
} | ||
|
||
if(json.platform_name == 'mac10_8-x86_64') | ||
{ | ||
metaData += 'macOS 10.8+'; | ||
} | ||
else if(json.platform_name == 'mac10_6-x86-x86_64') | ||
{ | ||
metaData += 'macOS 10.6+'; | ||
} | ||
else | ||
{ | ||
metaData += 'macOS 10.4+'; | ||
} | ||
metaData += '</span>'; | ||
|
||
return $('<div class="package_badge"><a class="package_name" href="' + downloadUri + '" title="Download ' + json.fulltitle + '">' + cleanTitle + '</a><br />' + metaData + '</div>'); | ||
} | ||
|
||
/** | ||
* Called upon receipt of a new JSON package object graph to add it | ||
* to the global list of packages. | ||
*/ | ||
function addPackages(json, downloadUri, packageListElementId) | ||
{ | ||
var record = new Array(); | ||
var json_copy = json; | ||
record['json'] = json_copy; | ||
record['downloadUri'] = downloadUri; | ||
record['packageListElementId'] = packageListElementId; | ||
packages.push(record); | ||
} | ||
|
||
/** | ||
* Sort comparator for JSON graph data. | ||
*/ | ||
function recordSorter(recordA, recordB) | ||
{ | ||
var a = recordA['json']; | ||
var a_is_unstable = a.hasOwnProperty('is_unstable'); | ||
var b = recordB['json']; | ||
var b_is_unstable = b.hasOwnProperty('is_unstable'); | ||
|
||
// Order stable packages first. | ||
if(a_is_unstable != b_is_unstable) | ||
{ | ||
return a_is_unstable? 1 : -1; | ||
} | ||
|
||
// Platform ids are arranged such that latest appears first. | ||
if(a.platform_id != b.platform_id) | ||
{ | ||
return a.platform_id > b.platform_id? -1 : 1; | ||
} | ||
|
||
// Use the lexicographical difference between titles. | ||
return a.title - b.title; | ||
} | ||
|
||
/** | ||
* Update the identified DOM element attaching new HTML for each package. | ||
*/ | ||
function populatePackages() | ||
{ | ||
// Order packages | ||
packages.sort(recordSorter); | ||
|
||
// Update the named DOM element attaching new HTML for each package. | ||
for(var i in packages) | ||
{ | ||
var record = packages[i]; | ||
var json = record['json']; | ||
if(json.title === undefined) continue; | ||
genPackageBadgeHTML(json, record['downloadUri']).appendTo(record['packageListElementId']); | ||
} | ||
} | ||
|
||
/** | ||
* Query the latest packages, generate HTML badges and append | ||
* them to the specified DOM object. | ||
*/ | ||
function updateLatestPackages(requests) | ||
{ | ||
// Clear the packages staging area. | ||
packages = []; | ||
|
||
// Fire the requests and compose the deferreds collection. | ||
var allDeferred = new Array(); | ||
for(var i in requests) | ||
{ | ||
var task = requests[i]; | ||
|
||
// Request! | ||
var deferred = $.ajax({ | ||
url: task['request'], | ||
data: task['data'], | ||
context: { | ||
downloadUri: task['downloadUri'], | ||
packageListElementId: task['packageListElementId'] | ||
}, | ||
success: function(json){ | ||
addPackages(json, this.downloadUri, this.packageListElementId); | ||
} | ||
}); | ||
|
||
// Add this Deferred to the collection. | ||
allDeferred.push(deferred); | ||
} | ||
|
||
// When all requests complete populate the package list. | ||
$.when.apply(null, allDeferred).then(function() | ||
{ | ||
populatePackages(); | ||
}); | ||
} | ||
|
||
// Construct the request queue. | ||
requests = new Array(); | ||
|
||
// Latest stable packages. | ||
task = new Array(); | ||
task['request'] = 'latestbuild?'; | ||
task['data'] = { | ||
graph: 'json', | ||
platform: 'mac10_8-x86_64' | ||
}; | ||
task['downloadUri'] = 'latestbuild?' + 'platform=mac10_8-x86_64'; | ||
task['packageListElementId'] = '#downloads_list1'; | ||
requests.push(task); | ||
|
||
task = new Array(); | ||
task['request'] = 'latestbuild?'; | ||
task['data'] = { | ||
graph: 'json', | ||
platform: 'mac10_6-x86-x86_64' | ||
}; | ||
task['downloadUri'] = 'latestbuild?' + 'platform=mac10_6-x86-x86_64'; | ||
task['packageListElementId'] = '#downloads_list1'; | ||
requests.push(task); | ||
|
||
/* No longer supported? | ||
task = new Array(); | ||
task['request'] = 'latestbuild?'; | ||
task['data'] = { | ||
graph: 'json', | ||
platform: 'mac10_4-x86-ppc' | ||
}; | ||
task['downloadUri'] = 'latestbuild?' + 'platform=mac10_4-x86-ppc'; | ||
task['packageListElementId'] = '#downloads_list1'; | ||
requests.push(task);*/ | ||
|
||
// Latest unstable packages. | ||
task = new Array(); | ||
task['request'] = 'latestbuild?'; | ||
task['data'] = { | ||
graph: 'json', | ||
platform: 'mac10_8-x86_64', | ||
unstable: 'yes' | ||
}; | ||
task['downloadUri'] = 'latestbuild?' + 'platform=mac10_8-x86_64' + '&unstable'; | ||
task['packageListElementId'] = '#downloads_list2'; | ||
requests.push(task); | ||
|
||
task = new Array(); | ||
task['request'] = 'latestbuild?'; | ||
task['data'] = { | ||
graph: 'json', | ||
platform: 'mac10_6-x86-x86_64', | ||
unstable: 'yes' | ||
}; | ||
task['downloadUri'] = 'latestbuild?' + 'platform=mac10_6-x86-x86_64' + '&unstable'; | ||
task['packageListElementId'] = '#downloads_list2'; | ||
requests.push(task); | ||
|
||
/* No longer supported? | ||
task = new Array(); | ||
task['request'] = 'latestbuild?'; | ||
task['data'] = { | ||
graph: 'json', | ||
platform: 'mac10_4-x86-ppc', | ||
unstable: 'yes' | ||
}; | ||
task['downloadUri'] = 'latestbuild?' + 'platform=mac10_4-x86-ppc' + '&unstable'; | ||
task['packageListElementId'] = '#downloads_list2'; | ||
requests.push(task);*/ | ||
|
||
removeAllChildren('#downloads_list1'); | ||
removeAllChildren('#downloads_list2'); | ||
updateLatestPackages(requests); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.