-
Notifications
You must be signed in to change notification settings - Fork 0
/
examples.js
101 lines (93 loc) · 2.64 KB
/
examples.js
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
var bemgen = require('./common.blocks/bemjson-generator/bemjson-generator.js');
// globals
var ctx = bemgen['ctx'],
tag = bemgen['tag'],
block = bemgen['block'],
elem = bemgen['elem'],
b = bemgen['b'],
e = bemgen['e'];
var page = block('b-page')
.ctx('title', 'examples')
.ctx('head', [
elem('css')
.ctx({
url: 'test.css',
ie: false
})()
])
.mod('theme', 'normal')
.content(
//short form
b('link')
.e('inner')
.m({ valign: 'middle' })
('yandex'),
/*{
block: 'link',
elem: 'inner',
mods: { valign: 'middle' },
content: 'yandex'
},*/
// link
block('link')
.tag('a')
.mod('pseudo', 'yes')
.attr('target', '_blank')
.ctx('url', 'ya.ru')
.js(true)
('yandex'),
/*{
block: 'link',
tag: 'a',
mods: { pseudo: 'yes' },
attrs: { target: '_blank' },
url: 'ya.ru',
js: true,
content: 'yandex'
},*/
// select
block('select')
.ctx('name', 'mail')
.mods({ size: 'm', theme: 'normal' })
(
block('button')('Отправленные'),
elem('control')
(
elem('options')
.attrs({ value: 'send' })
('Отправленные'),
elem('options')
.attrs({ value: 'draft' })
('Черновики')
)
)
/*{
block: 'select',
name: 'mail',
mods: { size: 'm', theme: 'normal' },
content: [
{
block: 'button',
content: 'Отправленные'
},
{
elem: 'control',
content: [
{
elem: 'option',
attrs: { value: 'send' },
content: 'Отправленные'
},
{
elem: 'option',
attrs: { value: 'draft' },
content: 'Черновики'
}
]
}
]
},*/
);
console.log(JSON.stringify(
page()
, false, ' '));