forked from newspeaklanguage/newspeak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelloDOM.ns
34 lines (32 loc) · 847 Bytes
/
HelloDOM.ns
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
Newspeak3
'Samples'
class HelloDOM packageUsing: manifest = () (
public main: platform args: args = (
|
Image = platform js global at: 'Image'.
document = platform js global at: 'document'.
body = document at: 'body'.
|
body appendChild:
(document createTextNode: 'Hello, DOM New World!').
body appendChild:
((document createElement: 'p')
appendChild:
((document createElement: 'a')
at: 'href' put: 'http://newspeaklanguage.org';
at: 'innerHTML' put: 'Newspeak Language';
yourself);
yourself).
body appendChild:
(Image new
at: 'src' put: 'http://newspeaklanguage.org/peeking-eye-16-10.png';
yourself).
(body at: 'style')
at: 'border-style' put: 'solid';
at: 'border-width' put: '20px';
at: 'border-radius' put: '25px';
at: 'border-color' put: 'black';
at: 'padding' put: '10px'.
)
) : (
)