git ssb

16+

Dominic / patchbay



Commit a168beb1551b3abbd4db5b2ccc4bd53583876661

Merge branch 'fixes' of ssb://%s9mSFATE4RGyJx9wgH22lBrvD4CgUQW4yeguSWWjtqc=.sha256

Dominic Tarr committed on 12/14/2016, 8:49:10 PM
Parent: c197e9f63517b0f5a43f48d84688058cc0bc5efe
Parent: a6a59db36ece748b70579031447cb554d68038a1

Files changed

modules_basic/markdown.jschanged
modules_basic/private.jschanged
modules_core/file-input.jschanged
modules_extra/channel.jschanged
modules_basic/markdown.jsView
@@ -1,32 +1,26 @@
11 var markdown = require('ssb-markdown')
22 var h = require('hyperscript')
33 var ref = require('ssb-ref')
44
5-//var plugs = require('../plugs')
6-//var blob_url = plugs.first(exports.blob_url = [])
7-//var emoji_url = plugs.first(exports.emoji_url = [])
8-
95 exports.needs = {
106 blob_url: 'first',
11-// emoji_url: 'first'
7 + emoji_url: 'first'
128 }
139
1410 exports.gives = 'markdown'
1511
1612 exports.create = function (api) {
1713
18-//emoji is in extra, disable for a sec
14 + function renderEmoji(emoji) {
15 + var url = api.emoji_url(emoji)
16 + if (!url) return ':' + emoji + ':'
17 + return '<img src="' + encodeURI(url) + '"'
18 + + ' alt=":' + escape(emoji) + ':"'
19 + + ' title=":' + escape(emoji) + ':"'
20 + + ' class="emoji">'
21 + }
1922
20-// function renderEmoji(emoji) {
21-// var url = api.emoji_url(emoji)
22-// if (!url) return ':' + emoji + ':'
23-// return '<img src="' + encodeURI(url) + '"'
24-// + ' alt=":' + escape(emoji) + ':"'
25-// + ' title=":' + escape(emoji) + ':"'
26-// + ' class="emoji">'
27-// }
28-
2923 return function (content) {
3024 if('string' === typeof content)
3125 content = {text: content}
3226 //handle patchwork style mentions.
@@ -37,9 +31,9 @@
3731 })
3832
3933 var md = h('div.markdown')
4034 md.innerHTML = markdown.block(content.text, {
41- // emoji: renderEmoji,
35 + emoji: renderEmoji,
4236 toUrl: function (id) {
4337 if(ref.isBlob(id)) return api.blob_url(id)
4438 return '#'+(mentions[id]?mentions[id]:id)
4539 }
modules_basic/private.jsView
@@ -4,18 +4,8 @@
44 var pull = require('pull-stream')
55 var Scroller = require('pull-scroll')
66 var ref = require('ssb-ref')
77
8-//var plugs = require('../plugs')
9-//
10-//var message_render = plugs.first(exports.message_render = [])
11-//var message_compose = plugs.first(exports.message_compose = [])
12-//var message_unbox = plugs.first(exports.message_unbox = [])
13-//var sbot_log = plugs.first(exports.sbot_log = [])
14-//var sbot_whoami = plugs.first(exports.sbot_whoami = [])
15-//var avatar_image_link = plugs.first(exports.avatar_image_link = [])
16-//var emoji_url = plugs.first(exports.emoji_url = [])
17-
188 function map(ary, iter) {
199 if(Array.isArray(ary)) return ary.map(iter)
2010 }
2111
@@ -25,9 +15,9 @@
2515 message_unbox: 'first',
2616 sbot_log: 'first',
2717 sbot_whoami: 'first',
2818 avatar_image_link: 'first',
29-// emoji_link: 'first'
19 + emoji_url: 'first'
3020 }
3121
3222 exports.gives = {
3323 builtin_tabs: true,
@@ -115,9 +105,9 @@
115105 },
116106
117107 message_content_mini: function (msg, sbot) {
118108 if (typeof msg.value.content === 'string') {
119- var icon = false //api.emoji_url('lock')
109 + var icon = api.emoji_url('lock')
120110 return icon
121111 ? h('img', {className: 'emoji', src: icon})
122112 : 'PRIVATE'
123113 }
modules_core/file-input.jsView
@@ -3,16 +3,12 @@
33 var pull = require('pull-stream')
44 var mime = require('simple-mime')('application/octect-stream')
55 var split = require('split-buffer')
66
7-var plugs = require('../plugs')
8-
9-var add = plugs.first(exports.sbot_blobs_add = [])
10-
117 module.exports = {
128 needs: {sbot_blobs_add: 'first'},
139 gives: 'file_input',
14- create: function () {
10 + create: function (api) {
1511 return function FileInput(onAdded) {
1612 return h('input', { type: 'file',
1713 onchange: function (ev) {
1814 var file = ev.target.files[0]
@@ -20,9 +16,9 @@
2016 var reader = new FileReader()
2117 reader.onload = function () {
2218 pull(
2319 pull.values(split(new Buffer(reader.result), 64*1024)),
24- add(function (err, blob) {
20 + api.sbot_blobs_add(function (err, blob) {
2521 if(err) return console.error(err)
2622 onAdded({
2723 link: blob,
2824 name: file.name,
modules_extra/channel.jsView
@@ -3,14 +3,8 @@
33 var pull = require('pull-stream')
44 var Scroller = require('pull-scroll')
55 var mfr = require('map-filter-reduce')
66
7-//var plugs = require('../plugs')
8-//var message_render = plugs.first(exports.message_render = [])
9-//var message_compose = plugs.first(exports.message_compose = [])
10-//var sbot_log = plugs.first(exports.sbot_log = [])
11-//var sbot_query = plugs.first(exports.sbot_query = [])
12-
137 exports.needs = {
148 message_render: 'first',
159 message_compose: 'first',
1610 sbot_log: 'first',

Built with git-ssb-web