/
mac_os.html
263 lines (231 loc) · 7.29 KB
/
mac_os.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<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>
<div id="downloads_list1" class="downloads_list"></div>
<div id="downloads_list2" class="downloads_list"></div>
</article>
<article><h1>Minimum System Requirements</h1>
<ul>
<li>Mac OS X 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 += 'OS X 10.8+';
}
else if(json.platform_name == 'mac10_6-x86-x86_64')
{
metaData += 'OS X 10.6+';
}
else
{
metaData += 'OS X 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>