Add a little app to list apps.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3712 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
1
apps/cory/apps.json
Normal file
1
apps/cory/apps.json
Normal file
@ -0,0 +1 @@
|
||||
{"type":"tildefriends-app","files":{"app.js":"&8DbkWJq+bDlPNGZGVWrlVyMzo+weV5GBfcleQSjIPjI=.sha256"}}
|
24
apps/cory/apps/app.js
Normal file
24
apps/cory/apps/app.js
Normal file
@ -0,0 +1,24 @@
|
||||
async function main() {
|
||||
var apps = await core.apps();
|
||||
var doc = `<!DOCTYPE html>
|
||||
<html>
|
||||
<body style="background: #888">
|
||||
<h1>Apps</h1>
|
||||
<ul id="apps"></ul>
|
||||
</body>
|
||||
<script>
|
||||
var apps = ${JSON.stringify(apps)};
|
||||
for (let app of Object.keys(apps)) {
|
||||
var li = document.getElementById('apps').appendChild(document.createElement('li'));
|
||||
var a = document.createElement('a');
|
||||
a.innerText = app;
|
||||
a.href = '../' + app;
|
||||
a.target = '_top';
|
||||
li.appendChild(a);
|
||||
}
|
||||
</script>
|
||||
</html>`
|
||||
app.setDocument(doc);
|
||||
}
|
||||
|
||||
main();
|
Reference in New Issue
Block a user