Skip to content

Commit

Permalink
Homepage: Revised layout of main page; new download buttons
Browse files Browse the repository at this point in the history
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
skyjake committed Mar 4, 2017
1 parent 8ad6c07 commit 4f98038
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 512 deletions.
34 changes: 21 additions & 13 deletions web/plugins/pages/html/linux.html
@@ -1,7 +1,26 @@
<div class="block">
<article>
<h1>Stable</h1>
<?php
generate_badges('ubuntu16-x86_64', BT_CANDIDATE);
generate_badges('fedora23-x86_64', BT_CANDIDATE);
?>
</article>
</div>
<div class="block">
<article>
<h1>Unstable</h1>
<?php
generate_badges('ubuntu16-x86_64', BT_UNSTABLE);
generate_badges('fedora23-x86_64', BT_UNSTABLE);
?>
</article>
</div>
<div class="block">
<article>
<h1>Install Packages</h1>
<p>See the <a href="/dew/index.php?title=Installation_%28Unix%29">Unix installation</a> article on the wiki for platform specific instructions.</p>
<h1>Other Builds</h1>
<p>See the <a href="/dew/index.php?title=Installation_%28Unix%29">Unix installation</a> article on the wiki for platform-specific instructions.</p>

<h2><img src="images/debian.png" alt="debian" style="vertical-align:text-bottom;" /> Debian</h2>
<p>Add the required repo to your "/etc/apt/sources.list" file.</p>
<p class="leadparagraph">For Lenny:</p>
Expand All @@ -26,16 +45,5 @@ <h2><img src="images/opensuse.png" alt="openSUSE" style="vertical-align:text-bot
<h2><img src="images/redhat.gif" alt="RedHat" style="vertical-align:text-bottom;" /> RedHat Enterprise Linux 6</h2>
<p><a href="http://gapf.ninth.su/el/6/RPMS/repoview/doomsday.html" class="link-external">Doomsday RPM packages</a> built by forum user <a href="/forums/memberlist.php?mode=viewprofile&u=396">skolnick</a>. Should also be compatible with RHEL derivatives such as CentOS and Scientific Linux. For more information, see the <a href="http://gapf.ninth.su/" class="link-external">repository's home page.</a></p>

<h2><img src="images/ubuntu.png" alt="Ubuntu" style="vertical-align:text-bottom;" /> Ubuntu</h2>
<p>See the <a href="/ubuntu">Ubuntu download page</a>.</p>

</article>
<article>
<h1>Minimum System Requirements</h1>
<ul>
<li>Display adapter capable of 3D hardware acceleration using OpenGL.</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>
283 changes: 20 additions & 263 deletions web/plugins/pages/html/mac_os.html
@@ -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> &middot; ';
}

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>
21 changes: 17 additions & 4 deletions web/plugins/pages/html/source.html
@@ -1,11 +1,16 @@
<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.</p>
<div class="downloads_list">
<article><h1>Source Packages</h1>
<?php
generate_badges('source', BT_STABLE);
generate_badges('source', BT_UNSTABLE);
?>
<!--
<div class="package_badge">
<a class="package_name" href="http://files.dengine.net/builds/build1857/doomsday-stable-1.15.8.tar.gz" title="Download source code for Doomsday 1.15.8">Doomsday 1.15.8 (Source)</a><br /><span class="metalink"></span>
</div>
</div></article>
</div> -->
<p/>
</article>
<article><h1>New to Doomsday Source?</h1>
<p>The best place to begin is the <a href="http://wiki.dengine.net" title="deng project wiki">deng project wiki</a>. There you will find a lot of information from beginners guides to design documents and manifestos detailing concepts employed within the engine itself. In particular, all new developers should familiarize themselves with the following:</p>
<ul>
Expand Down Expand Up @@ -36,6 +41,14 @@ <h1>Internal APIs</h1>
</div>

<div id="column2" class="twocolumn collapsible">
<div class="block">
<article>
<h1>Git Repositories</h1>
<ul>
<li><a href="https://github.com/skyjake/Doomsday-Engine.git">GitHub: skyjake/Doomsday-Engine</a></li>
</ul>
</article>
</div>
<div class="block">
<article>
<h1>Commit Index</h1>
Expand Down

0 comments on commit 4f98038

Please sign in to comment.