git ssb

16+

Dominic / patchbay



Commit a3d2c0a84691aab64838207f75583d4e86d564b5

working experimental case

mix irving committed on 1/16/2017, 5:53:25 AM
Parent: dab8336e2c9b7ae4d3e407ce7c8059bea3f4e566

Files changed

modules_basic/index.jschanged
modules_basic/message/author.jschanged
modules_basic/message/backlinks.jschanged
modules_basic/message/link.jschanged
modules_basic/message/name.jschanged
modules_basic/message/render.jschanged
modules_core/index.jschanged
modules_core/message-confirm.jsdeleted
modules_core/message/confirm.jsadded
modules_core/message/confirm.mcssadded
modules_core/message-confirm.mcssdeleted
modules_basic/index.jsView
@@ -1,35 +1,35 @@
11 module.exports = {
2- "about.js": require('./about.js'),
3- "avatar-edit.js": require('./avatar-edit.js'),
4- "avatar-image.js": require('./avatar-image.js'),
5- "avatar-link.js": require('./avatar-link.js'),
6- "avatar-name.js": require('./avatar-name.js'),
7- "avatar-profile.js": require('./avatar-profile.js'),
8- "avatar.js": require('./avatar.js'),
9- "compose.js": require('./compose.js'),
10- "feed.js": require('./feed.js'),
11- "follow.js": require('./follow.js'),
12- "invite.js": require('./invite.js'),
13- "like.js": require('./like.js'),
14- "markdown.js": require('./markdown.js'),
2 + "about.js": require('./about'),
3 + "avatar-edit.js": require('./avatar-edit'),
4 + "avatar-image.js": require('./avatar-image'),
5 + "avatar-link.js": require('./avatar-link'),
6 + "avatar-name.js": require('./avatar-name'),
7 + "avatar-profile.js": require('./avatar-profile'),
8 + "avatar.js": require('./avatar'),
9 + "compose.js": require('./compose'),
10 + "feed.js": require('./feed'),
11 + "follow.js": require('./follow'),
12 + "invite.js": require('./invite'),
13 + "like.js": require('./like'),
14 + "markdown.js": require('./markdown'),
1515 message: {
16- author: require('./message/author.js'),
17- backlinks: require('./message/backlinks.js'),
18- link: require('./message/link.js'),
19- name: require('./message/name.js'),
20- render: require('./message/render.js'),
16 + author: require('./message/author'),
17 + backlinks: require('./message/backlinks'),
18 + link: require('./message/link'),
19 + name: require('./message/name'),
20 + render: require('./message/render'),
2121 },
22- "names.js": require('./names.js'),
23- "post.js": require('./post.js'),
24- "private.js": require('./private.js'),
25- "pub.js": require('./pub.js'),
26- "public.js": require('./public.js'),
27- "relationships.js": require('./relationships.js'),
28- "reply.js": require('./reply.js'),
29- "search-box.js": require('./search-box.js'),
22 + "names.js": require('./names'),
23 + "post.js": require('./post'),
24 + "private.js": require('./private'),
25 + "pub.js": require('./pub'),
26 + "public.js": require('./public'),
27 + "relationships.js": require('./relationships'),
28 + "reply.js": require('./reply'),
29 + "search-box.js": require('./search-box'),
3030 "setup.js": require('./setup'),
31- "suggest-mentions.js": require('./suggest-mentions.js'),
32- "thread.js": require('./thread.js'),
33- "timestamp.js": require('./timestamp.js')
31 + "suggest-mentions.js": require('./suggest-mentions'),
32 + "thread.js": require('./thread'),
33 + "timestamp.js": require('./timestamp')
3434 }
3535
modules_basic/message/author.jsView
@@ -9,19 +9,19 @@
99 timestamp: 'first'
1010 }
1111
1212 exports.gives = {
13- author: true,
13 + message_author: true,
1414 mcss: true
1515 }
1616
1717 exports.create = function (api) {
1818 return {
19- author,
19 + message_author,
2020 mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8')
2121 }
2222
23- function author (msg, opts = {}) {
23 + function message_author (msg, opts = {}) {
2424 var { size = 'small' } = opts
2525 var { value } = msg
2626 var { author } = value
2727
modules_basic/message/backlinks.jsView
@@ -5,19 +5,19 @@
55 message_name: 'first'
66 }
77
88 exports.gives = {
9- backlinks: true,
9 + message_backlinks: true,
1010 mcss: true
1111 }
1212
1313 exports.create = function (api) {
1414 return {
15- backlinks,
15 + message_backlinks,
1616 mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8')
1717 }
1818
19- function backlinks (msg) {
19 + function message_backlinks (msg) {
2020 var links = []
2121 for(var k in CACHE) {
2222 var _msg = CACHE[k]
2323 var mentions = _msg.content.mentions
modules_basic/message/link.jsView
@@ -8,9 +8,9 @@
88 exports.needs = {
99 message_name: 'first'
1010 }
1111
12-exports.gives = 'link'
12 +exports.gives = 'message_link'
1313
1414 exports.create = function (api) {
1515
1616 return function (id) {
modules_basic/message/name.jsView
@@ -4,9 +4,9 @@
44 return m && (m[1].length == 40 ? m[1]+'...' : m[1])
55 }
66
77 exports.needs = { sbot_get: 'first' }
8-exports.gives = 'name'
8 +exports.gives = 'message_name'
99
1010 //TODO: rewrite as observable?
1111
1212 exports.create = function (api) {
modules_basic/message/render.jsView
@@ -16,9 +16,9 @@
1616 message_meta: 'map',
1717 }
1818
1919 exports.gives = {
20- render: true,
20 + message_render: true,
2121 mcss: true
2222 }
2323
2424 exports.create = function (api) {
modules_core/index.jsView
@@ -1,15 +1,17 @@
11 module.exports = {
22 // "_screen_view.js": require('./_screen_view.js'),
3- "app.js": require('./app.js'),
4- "blob-url.js": require('./blob-url.js'),
5- "crypto.js": require('./crypto.js'),
6- "external-confirm.js": require('./external-confirm.js'),
7- "file-input.js": require('./file-input.js'),
8- "menu.js": require('./menu.js'),
9- "message-confirm.js": require('./message-confirm.js'),
10- "tabs.js": require('./tabs.js'),
11- "sbot.js": require('./sbot.js'),
12- "styles.js": require('./styles.js'),
13- "style-mixins.js": require('./style-mixins.js')
3 + "app.js": require('./app'),
4 + "blob-url.js": require('./blob-url'),
5 + "crypto.js": require('./crypto'),
6 + "external-confirm.js": require('./external-confirm'),
7 + "file-input.js": require('./file-input'),
8 + "menu.js": require('./menu'),
9 + message: {
10 + confirm: require('./message/confirm')
11 + },
12 + "tabs.js": require('./tabs'),
13 + "sbot.js": require('./sbot'),
14 + "styles.js": require('./styles'),
15 + "style-mixins.js": require('./style-mixins')
1416 }
1517
modules_core/message-confirm.jsView
@@ -1,76 +1,0 @@
1-var fs = require('fs')
2-var lightbox = require('hyperlightbox')
3-var h = require('../h')
4-var u = require('../util')
5-var self_id = require('../keys').id
6-//publish or add
7-
8-var plugs = require('../plugs')
9-
10-exports.needs = {
11- publish: 'first',
12- message_render: 'first',
13- avatar: 'first',
14- message_meta: 'map'
15-}
16-
17-exports.gives = {
18- message_confirm: true,
19- mcss: true
20-}
21-
22-exports.create = function (api) {
23- return {
24- message_confirm,
25- mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8')
26- }
27-
28- function message_confirm (content, cb) {
29-
30- cb = cb || function () {}
31-
32- var lb = lightbox()
33- document.body.appendChild(lb)
34-
35- var msg = {
36- key: "DRAFT",
37- value: {
38- author: self_id,
39- previous: null,
40- sequence: null,
41- timestamp: Date.now(),
42- content: content
43- }
44- }
45-
46- var okay = h('button', {
47- 'ev-click': () => {
48- lb.remove()
49- api.publish(content, cb)
50- }},
51- 'okay'
52- )
53-
54- var cancel = h('button', {
55- 'ev-click': () => {
56- lb.remove()
57- cb(null)
58- }},
59- 'Cancel'
60- )
61-
62- okay.addEventListener('keydown', function (ev) {
63- if(ev.keyCode === 27) cancel.click() //escape
64- })
65-
66- lb.show(h('MessageConfirm', [
67- h('header -preview_description', h('h1', 'Preview')),
68- h('section -message_preview', api.message_render(msg)),
69- h('section -actions', [okay, cancel])
70- ]
71- ))
72-
73- okay.focus()
74- }
75-}
76-
modules_core/message/confirm.jsView
@@ -1,0 +1,74 @@
1 +var fs = require('fs')
2 +var lightbox = require('hyperlightbox')
3 +var h = require('../../h')
4 +var u = require('../../util')
5 +var self_id = require('../../keys').id
6 +//publish or add
7 +
8 +exports.needs = {
9 + publish: 'first',
10 + message_render: 'first',
11 + avatar: 'first',
12 + message_meta: 'map'
13 +}
14 +
15 +exports.gives = {
16 + message_confirm: true,
17 + mcss: true
18 +}
19 +
20 +exports.create = function (api) {
21 + return {
22 + message_confirm,
23 + mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8')
24 + }
25 +
26 + function message_confirm (content, cb) {
27 +
28 + cb = cb || function () {}
29 +
30 + var lb = lightbox()
31 + document.body.appendChild(lb)
32 +
33 + var msg = {
34 + key: "DRAFT",
35 + value: {
36 + author: self_id,
37 + previous: null,
38 + sequence: null,
39 + timestamp: Date.now(),
40 + content: content
41 + }
42 + }
43 +
44 + var okay = h('button', {
45 + 'ev-click': () => {
46 + lb.remove()
47 + api.publish(content, cb)
48 + }},
49 + 'okay'
50 + )
51 +
52 + var cancel = h('button', {
53 + 'ev-click': () => {
54 + lb.remove()
55 + cb(null)
56 + }},
57 + 'Cancel'
58 + )
59 +
60 + okay.addEventListener('keydown', function (ev) {
61 + if(ev.keyCode === 27) cancel.click() //escape
62 + })
63 +
64 + lb.show(h('MessageConfirm', [
65 + h('header -preview_description', h('h1', 'Preview')),
66 + h('section -message_preview', api.message_render(msg)),
67 + h('section -actions', [okay, cancel])
68 + ]
69 + ))
70 +
71 + okay.focus()
72 + }
73 +}
74 +
modules_core/message/confirm.mcssView
@@ -1,0 +1,39 @@
1 +MessageConfirm {
2 + section {
3 + -preview_description {
4 + }
5 +
6 + -message_preview {
7 + background-color: white
8 +
9 + div {
10 + border: none
11 +
12 + header.author {
13 + div {
14 + section {
15 + -timestamp {
16 + display: none
17 + }
18 + }
19 + }
20 + }
21 +
22 + section.action {
23 + display: none
24 + }
25 + }
26 + }
27 +
28 + -actions {
29 + margin-top: 1rem
30 + display: flex
31 + justify-content: flex-end
32 +
33 + button {
34 + margin: 0 0 0 1rem
35 + }
36 + }
37 + }
38 +}
39 +
modules_core/message-confirm.mcssView
@@ -1,39 +1,0 @@
1-MessageConfirm {
2- section {
3- -preview_description {
4- }
5-
6- -message_preview {
7- background-color: white
8-
9- div {
10- border: none
11-
12- header.author {
13- div {
14- section {
15- -timestamp {
16- display: none
17- }
18- }
19- }
20- }
21-
22- section.action {
23- display: none
24- }
25- }
26- }
27-
28- -actions {
29- margin-top: 1rem
30- display: flex
31- justify-content: flex-end
32-
33- button {
34- margin: 0 0 0 1rem
35- }
36- }
37- }
38-}
39-

Built with git-ssb-web