forked from 8bitkick/PlayUEF
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
executable file
·105 lines (89 loc) · 2.89 KB
/
test.html
File metadata and controls
executable file
·105 lines (89 loc) · 2.89 KB
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
<!doctype html>
<html lang="us">
<head>
<meta charset="utf-8">
<title>PlayUEF test</title>
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-69288807-2"></script>
<script language="javascript" src="lib/sth.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-69288807-2');
</script>
</head>
<body>
<div id="tapes">
Loading UEF list from STH archive, this will take a while...
</div>
</body>
<script>
// ripped from https://github.com/mattgodbolt/jsbeeb
function sthClearList() {
$("#sth-list li:not('.template')").remove();
}
function sthStartLoad() {
$("#sth .loading").text("Loading catalog from STH archive");
$("#sth .loading").show();
sthClearList();
}
function makeOnCat(onClick) {
return function (cat) {
sthClearList();
var sthList = $("#sth-list");
$("#sth .loading").hide();
var template = sthList.find(".template");
function doSome(all) {
var MaxAtATime = 100;
var Delay = 30;
var cat = all.slice(0, MaxAtATime);
var remaining = all.slice(MaxAtATime);
var filter = $('#sth-filter').val();
$.each(cat, function (_, cat) {
var row = template.clone().removeClass("template").appendTo(sthList);
row.find(".name").text(cat);
$(row).on("click", function () {
onClick(cat);
$('#sth').modal("hide");
});
row.toggle(cat.toLowerCase().indexOf(filter) >= 0);
});
if (all.length) _.delay(doSome, Delay, remaining);
}
console.log("Found", cat.length, "STH entries");
doSome(cat);
};
}
function sthOnError() {
$('#sth .loading').text("There was an error accessing the STH archive");
$("#sth .loading").show();
sthClearList();
}
//tapeSth = new StairwayToHell(sthStartLoad, makeOnCat(null), sthOnError, true);
tapeSth = new StairwayToHell(sthStartLoad, listc, sthOnError, true);
function setSthFilter(filter) {
filter = filter.toLowerCase();
$("#sth-list li:not('.template')").each(function () {
var el = $(this);
el.toggle(el.text().toLowerCase().indexOf(filter) >= 0);
});
}
$('#sth-filter').on("change keyup", function () {
setSthFilter($('#sth-filter').val());
});
sthStartLoad()
tapeSth.populate();
url = "";
function listc(){
catalog = tapeSth.catalog();
console.log(catalog);
for (a=0; a<catalog.length; a++ )
{
item = "<a href='"+url+"/PlayUEF.html?FILE="+encodeURIComponent('https://www.stairwaytohell.com/bbc/archive/tapeimages/'+catalog[a])+"'>"+catalog[a]+"</a><br>";
document.getElementById("tapes").innerHTML += item;
}
console.log(encodeURIComponent('https://www.stairwaytohell.com/electron/uefarchive/Acornsoft/Boxer_E.zip'));
}
</script></body>