/
welcome.html
69 lines (60 loc) · 1.67 KB
/
welcome.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
<!DOCTYPE html>
<html>
<head>
<script>
var shell = require('shell')
var insertCss = require('insert-css')
var version = require('./package.json').version
var ipc = require('ipc')
var h = require('hyperscript')
function newProject() {
ipc.send('choose-project', 'new')
}
function demoProject() {
ipc.send('choose-project', 'demo')
}
function browse() {
ipc.send('choose-project', 'browse')
}
insertCss(require('./styles'))
</script>
</head>
<body>
<div class='ChooseProject'>
<header>
<img src='logo.png' width='128' />
<h1>Loop Drop</h1>
<h2 id='version-container'>version <script>document.write(version)</script></h2>
</header>
<section class='.actions'>
<button onclick='newProject()' class='-new'>New Project</button>
<button onclick='demoProject()'>Open Demo Project</button>
<button onclick='browse()'>Browse...</button>
</section>
<div>
<p>
visit
<a href='javascript:shell.openExternal("http://loopjs.com")'>loopjs.com</a>
for help
</p>
</div>
</div>
<script>
fetch('http://loopjs.com/loop-drop/check-version/' + version).then(
function(response){ return response.json() }
).then(function(data) {
if (data.updateAvailable) {
document.getElementById('version-container').appendChild(
h('span', [
' - ',
h('a', {
href: data.url,
title: 'version ' + data.version
}, 'update available')
])
)
}
})
</script>
</body>
</html>