-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.js
89 lines (88 loc) · 2.87 KB
/
view.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
function AppView(ctrl) {
return m('form.container', {
onsubmit: function () {
ctrl.handlePop()
ctrl.handlePush()
return false
}
}, [
m('.row', [
m('.column.one-quarter', [
m('button.button-primary.u-full-width', {
type: 'button',
onclick: ctrl.handlePop
}, 'pop'),
]),
m('.column.one-half', [
m('input.u-full-width', {
type: 'text',
oninput: m.withAttr('value', ctrl.newFrame),
value: ctrl.newFrame()
}),
]),
m('.column.one-quarter', [
m('button.u-full-width', {
type: 'button',
onclick: ctrl.handlePush
}, 'push'),
]),
]),
m('.row', [
m('.column.one-quarter', [
m('label', [
m("input", {
key: 1,
type: "checkbox",
onclick: ctrl.handleShowClosedToggle,
checked: ctrl.showClosed()
}),
m('span.label-body', 'Show Closed'),
]),
]),
m('.column.one-quarter', [
m('label', [
m("input", {
key: 1,
type: "checkbox",
onclick: ctrl.handleShowDebugToggle,
checked: ctrl.showDebug()
}),
m('span.label-body', 'Show Debug'),
]),
]),
m('.column.one-quarter', [
m('span', ctrl.lastMessage()),
]),
m('.column', {
'class': (ctrl.isSignedIn() ? 'three' : 'u-hide'),
},[
m('button', {
type: 'button',
'class': (ctrl.driveEnabled() ? 'u-pull-left' : 'u-hide'),
onclick: ctrl.handleSaveClick
}, 'Save'),
m('button.u-pull-right', {
type: 'button',
onclick: ctrl.handleSignoutClick
}, 'Sign Out'),
]),
m('.column.three', {
'class': (ctrl.isSignedIn() ? 'u-hide' : ''),
},[
m('#signin.u-pull-right')
]),
]),
m('.row', [
m('.column', {
class: ctrl.showDebug() ? 'one-half' : 'u-full-width'
},[
ctrl.staq.toMithril(ctrl.showClosed()),
]),
m('.column', {
class: ctrl.showDebug() ? 'one-half' : 'u-hide'
},[
m('pre', JSON.stringify(ctrl.staq, null, 4))
]),
]),
]);
}