Files: 3796b03e7cca3a486a8bbe5974532f14242cea4b / modules / message-confirm.js
704 bytesRaw
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 | |
32 |
Built with git-ssb-web