Commit ceab09c9e34bbabf034b57309315733a28ec5e7a
write opens a lightbox to confirm any publish
Dominic Tarr committed on 5/20/2016, 9:08:48 AMParent: 48ba3a4876c5ca8a507b2aca1a33c709c7feb5c9
Files changed
modules/compose.js | changed |
modules/message-confirm.js | added |
modules/compose.js | ||
---|---|---|
@@ -7,8 +7,9 @@ | ||
7 | 7 | |
8 | 8 | exports.suggest = [] |
9 | 9 | exports.publish = [] |
10 | 10 | exports.message_content = [] |
11 | +exports.message_confirm = [] | |
11 | 12 | |
12 | 13 | //this decorator expects to be the first |
13 | 14 | exports.message_compose = function (el, meta, sbot) { |
14 | 15 | if(el) return el |
@@ -62,4 +63,5 @@ | ||
62 | 63 | } |
63 | 64 | |
64 | 65 | |
65 | 66 | |
67 | + |
modules/message-confirm.js | ||
---|---|---|
@@ -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