-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdata.html
More file actions
169 lines (159 loc) · 5.92 KB
/
data.html
File metadata and controls
169 lines (159 loc) · 5.92 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
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
<html>
<head>
<title>rhes.es</title>
<style type="text/css">
body {
background-color: rgb(46,36,30);
background-image: url(img/x2/background-r.png);
background-size: 259px 259px;
}
@font-face {
font-family: 'wildride';
src: url('fonts/WildRide.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
.trans {
background-color: rgba(255,255,255,.5);
width: 80%;
height: 80%;
display:none;
}
#logo {
background-repeat: no-repeat;
width:171;
height:64;
position: absolute;
background-image: url(img/x2/rheses-color.png);
background-repeat: no-repeat;
background-size: 171px 64px;
}
#slogan {
font-family: wildride;
white-space: nowrap;
color: rgb(154,123,75);
font-size: 72px;
position: absolute;
text-shadow: 0px 0px 4px rgb(46,36,30);
}
</style>
<script type="text/javascript" src="lib/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="lib/acorn.js"></script>
<script type="text/javascript" src="lib/coffee-script.js"></script>
<script type="text/javascript" src="lib/json-path+json-ptr-0.1.3.min.js"></script>
<script type="text/javascript" src="layout.js"></script>
</head>
<body>
<view id="container" y="300" width="100" height="100" background-color="purple" border-radius="4px" clip="true">
<handler name="onclick">
if (this.bnd) this.bnd.destroy()
this.setAttribute('clip', false)
// console.log('onclick', this)
</handler>
<simplelayout name="lay" spacing="42" type="coffee">
<handler name="oninit">
# console.log('oninit instance', this)
this.hello('a', 'b', 'c')
</handler>
<method name="hello" args="a,b,c">
# console.log('hello instance', a,b,c, this)
</method>
</simplelayout>
<boundslayout name="bnd"></boundslayout>
<class name="clickresize" width="10" height="10" bgcolor="red">
<attribute name="data" value="null"></attribute>
<handler name="onclick">
this.animate({width: 100, height: 100})
</handler>
</class>
<clickresize bgcolor="red"></clickresize>
<clickresize bgcolor="yellow" onclick="this.destroy()"></clickresize>
<clickresize bgcolor="green"></clickresize>
<clickresize bgcolor="black"></clickresize>
<clickresize bgcolor="blue">
<handler name="onclick" type="coffee">
if (@subviews.length)
#console.log('destroy', @, @destroy)
@destroy()
else
lay = new lz.simplelayout(null, {parent: @, locked: true, inset: 15})
for i of ([0..1000])
#console.log('creating', i)
new lz.clickresize(null, {parent: @})
lay.setAttribute('locked', false)
</handler>
</clickresize>
<text onclick="this.setAttribute('text', 'Hi mum this is a lot wider!')" bgcolor="yellow">Hello</text>
<text width="100" multiline="true" bgcolor="orange">This text should wrap at my width</text>
<text text="${this.parent.inp.text}" bgcolor="red"></text>
<inputtext bgcolor="green" name="inp" onclick="this.setAttribute('text', 'Yooyoyo')">Text</inputtext>
<view width="10" height="10" bgcolor="cyan" x="${lz.mouse.x - this.parent.getAbsolute().x - (this.width * .5)}" y="${lz.mouse.y - this.parent.getAbsolute().y - (this.width * .5)}" clickable="false" ignorelayout="true">
<handler name="onclick" reference="lz.mouse">
if (this.width !== 100)
this.animate({width: 100, height: 100, opacity: .2}, 1000)
</handler>
</view>
<dataset name="storedata">
{ "store": {
"book": [
{ "category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{ "category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99
},
{ "category": "fiction",
"author": "Herman Melville",
"title": "Moby Dick",
"isbn": "0-553-21311-3",
"price": 8.99
},
{ "category": "fiction",
"author": "J. R. R. Tolkien",
"title": "The Lord of the Rings",
"isbn": "0-395-19395-8",
"price": 22.99
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}
</dataset>
<dataset name="tempdata" url="http://api.openweathermap.org/data/2.5/weather?q=San+Francisco,CA&units=imperial&callback=?"></dataset>
<replicator datapath="$storedata/store/book[*]/author" classname="text"></replicator>
<replicator datapath="$tempdata/main/temp" classname="inputtext"></replicator>
<class name="boundedview">
<boundslayout></boundslayout>
</class>
<!-- Test datapath binding through non-bound parents -->
<class name="weather" extends="boundedview">
<view>
<simplelayout></simplelayout>
<boundslayout></boundslayout>
<replicator datapath="/weather[0]/main" classname="text"></replicator>
<replicator datapath="/main/temp" classname="text"></replicator>
<replicator datapath="/wind/speed" classname="text"></replicator>
<replicator datapath="/wind/deg" classname="text"></replicator>
</view>
</class>
<replicator datapath="$tempdata" classname="weather"></replicator>
<class name="weather2" extends="boundedview">
<boundedview>
<simplelayout></simplelayout>
<replicator datapath="/weather[0]/main" classname="text"></replicator>
<replicator datapath="/main/temp" classname="text"></replicator>
<replicator datapath="/wind/speed" classname="text"></replicator>
<replicator datapath="/wind/deg" classname="text"></replicator>
</boundedview>
</class>
<replicator datapath="$tempdata" classname="weather2"></replicator>
</view
</body>
</html>