git ssb

2+

mixmix / ticktack



Commit 0b16e011754d8816fc45b0d388ab692c97826bf1

fix patch-settings, add uri-encoding!

mix irving committed on 5/8/2018, 7:56:44 AM
Parent: ca44a0a40e4d24c2b6b42467fac6072170073817

Files changed

message/html/webshares.jschanged
package-lock.jsonchanged
package.jsonchanged
message/html/webshares.jsView
@@ -13,9 +13,9 @@
1313
1414 exports.gives = nest('message.html.webshares')
1515
1616 exports.create = (api) => {
17- return nest('message.html.webshares', function shares(msg) {
17+ return nest('message.html.webshares', function shares (msg) {
1818 var id = api.keys.sync.id()
1919 var shares = api.message.obs.webshares(msg.key)
2020
2121 var iShared = computed(shares, shares => shares.includes(id))
@@ -27,9 +27,9 @@
2727 isOpen.set(false)
2828 }
2929 var confirmationDialog = h('div.dialog', [
3030 h('div.message', [
31- h('p', strings.share.externalShareLabel),
31+ h('p', strings.share.externalShareLabel)
3232 ]),
3333 h('div.actions', [
3434 h('Button', { 'ev-click': () => isOpen.set(false) }, strings.userShow.action.cancel),
3535 h('Button', { style: { 'margin-left': '10px', 'margin-right': '10px' }, 'ev-click': () => publishAndClose(msg, 'copy') }, strings.share.action.copy),
@@ -39,22 +39,21 @@
3939 ])
4040
4141 var lb = api.app.html.lightbox(confirmationDialog, isOpen)
4242
43-
4443 return h('WebShares', { 'ev-click': () => isOpen.set(true) }, [
4544 h('i.fa.fa-share-alt', { className: when(iShared, '', 'faint') }),
4645 h('div.count', count),
4746 lb
4847 ])
4948 })
5049
51- function publishShare(msg, action) {
50+ function publishShare (msg, action) {
5251 var sharingScope = api.settings.sync.get('websharingmetrics')
53- var url = `http://share2.ticktack.im:8807/${msg.key}`
52+ var url = `http://share2.ticktack.im:8807/${encodeURIComponent(msg.key)}`
5453 var share = {
5554 type: 'share',
56- share: { link: msg.key, content: "blog", url: url }
55+ share: { link: msg.key, content: 'blog', url: url }
5756 }
5857 // if it was a private message, then share as private ...
5958 if (msg.value.content.recps) {
6059 share.recps = msg.value.content.recps.map(function (e) {
@@ -63,30 +62,30 @@
6362 share.private = true
6463 } else {
6564 // ... else obey configuration settings.
6665 switch (sharingScope) {
67- case "private":
66+ case 'private':
6867 share.private = true
6968 break
70- case "author":
69+ case 'author':
7170 share.recps = [
7271 id,
7372 msg.value.author
7473 ]
7574 share.private = true
7675 break
77- case "public":
76+ case 'public':
7877 default:
7978 break
8079 }
8180 }
8281 api.sbot.async.publish(share)
8382
84- if (action == "copy") {
85- console.log("copying to clipboard")
83+ if (action == 'copy') {
84+ console.log('copying to clipboard')
8685 clipboard.writeText(url)
8786 } else {
88- console.log("opening external")
89- shell.openExternal(url, err => console.log("error", err))
87+ console.log('opening external')
88+ shell.openExternal(url, err => console.log('error', err))
9089 }
9190 }
9291 }
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 283856 bytes
New file size: 283856 bytes
package.jsonView
@@ -46,9 +46,9 @@
4646 "open-external": "^0.1.1",
4747 "patch-drafts": "0.0.6",
4848 "patch-history": "^1.0.0",
4949 "patch-profile": "^1.0.4",
50- "patch-settings": "^1.0.0",
50+ "patch-settings": "^1.1.2",
5151 "patch-suggest": "^1.1.0",
5252 "patchcore": "^1.23.3",
5353 "pull-next": "^1.0.1",
5454 "pull-next-step": "^1.0.0",

Built with git-ssb-web