git ssb

16+

Dominic / patchbay



Commit ceab09c9e34bbabf034b57309315733a28ec5e7a

write opens a lightbox to confirm any publish

Dominic Tarr committed on 5/20/2016, 9:08:48 AM
Parent: 48ba3a4876c5ca8a507b2aca1a33c709c7feb5c9

Files changed

modules/compose.jschanged
modules/message-confirm.jsadded
modules/compose.jsView
@@ -7,8 +7,9 @@
77
88 exports.suggest = []
99 exports.publish = []
1010 exports.message_content = []
11+exports.message_confirm = []
1112
1213 //this decorator expects to be the first
1314 exports.message_compose = function (el, meta, sbot) {
1415 if(el) return el
@@ -62,4 +63,5 @@
6263 }
6364
6465
6566
67+
modules/message-confirm.jsView
@@ -1,0 +1,31 @@
1+var lightbox = require('hyperlightbox')
2+var h = require('hyperscript')
3+var u = require('../util')
4+//publish or add
5+
6+exports.publish = []
7+exports.message_content = []
8+
9+exports.message_confirm = function (content, sbot) {
10+
11+ var lb = lightbox()
12+ document.body.appendChild(lb)
13+
14+ lb.show(h('div.column',
15+ u.firstPlug(exports.message_content,
16+ {key: "DRAFT", value: {content: content}}, sbot
17+ ) || h('pre', JSON.stringify(content, null, 2)),
18+ h('div.row',
19+ h('button', 'okay', {onclick: function () {
20+ u.firstPlug(exports.publish, content, null, sbot)
21+ lb.remove()
22+ }}),
23+ h('button', 'cancel', {onclick: function () {
24+ lb.remove()
25+ }})
26+ )
27+ ))
28+
29+}
30+
31+

Built with git-ssb-web