-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathearl-demo.html
121 lines (83 loc) · 2.03 KB
/
earl-demo.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
<script type="statebus">
# Develop your application in this script block!
dom.BODY = ->
loc = fetch 'location'
homepage = loc.url == '/' || loc.url == ''
DIV
style:
padding: 50
fontSize: 18
if !homepage
DIV
style:
position: 'absolute'
top: 20
left: 20
cursor: 'pointer'
textDecoration: 'underline'
onClick: ->
Earl.load_page '/',
came_from_skill_section: true
'back home'
if homepage
HOMEPAGE()
else
RESUME()
dom.HOMEPAGE = ->
DIV null,
DIV
style:
fontSize: 50
'Hello, I\'m Earl!'
DIV null,
'Click me to see what I can do'
A
href: '/what_i_do'
EARL()
dom.RESUME = ->
links = [
A
href: "/"
target: '_blank'
"I can open internal links in a new tab"
A
href: 'https://invisible.college'
'I let external link open freely'
A
href: 'https://invisible.college'
target: '_blank'
"...especially external links that open a new tab"
]
DIV null,
for l in links
DIV
style:
padding: 50
EARL
style:
width: 150
display: 'inline-block'
marginRight: 40
l
DIV
onClick: -> location.reload()
SPAN
style:
textDecoration: 'underline'
cursor: 'pointer'
'Reload the page'
' and see that we return right back here'
dom.EARL = ->
IMG
src: 'https://dl.dropboxusercontent.com/u/3403211/earl.jpg'
style: @props.style or {}
Earl.start_work
history_aware_links: true
root: '/earl-demo.html'
#</script><script>
var statebus_client = "https://stateb.us/client.js"
document.write( '<script src="' + statebus_client + '" charset="utf-8"><\/script>')
var earldir = "https://rawgit.com/invisible-college/Earl/master/"
//var earldir = "../"
document.write( '<script src="' + earldir + 'earl.js' + '" charset="utf-8"><\/script>')
</script>