-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
43 lines (38 loc) · 973 Bytes
/
script.js
File metadata and controls
43 lines (38 loc) · 973 Bytes
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
(function(window, document, undefined) {
/** Сайт с пронумерованными анекдотами
*
*/
"use strict";
/** @subsection Controllers */
let anekdot = new AnekdotUI({
view: {
list: 'ul.list.aside.anekdots',
name: '#anekdot > h2',
text: '#anekdot > div'
},
form: {
add : { // Добавление анекдота
form: '#input-anekdot',
name: '#input-anekdot input',
text: '#input-anekdot textarea'
},
next: '#next-anekdot' // "следующий анекдот"
}
});
let tag = new TagUI({
view: {
list: 'ul.list.aside.tags',
edit: 'div.tags > ul.list.aside.tags'
},
form: {
add: { // Добавление тега
form: '#input-tag',
name: '#input-tag input'
}
}
});
/** @section DATA */
let ui = new UI({anekdot, tag});
/** @section INIT */
$.ready(_ => ui.ready());
})(window, document);