git ssb

16+

Dominic / patchbay



Commit 0472f8a3c5d13f1555a5d894311fe2bfe060e75a

fix backlink styling

mix irving committed on 1/5/2017, 1:47:12 AM
Parent: f09fd788e61378d47dac27b0766e6ecc1ad51ffb

Files changed

modules_basic/message-backlinks.jschanged
modules_basic/message-backlinks.mcsschanged
modules_basic/message.mcsschanged
modules_basic/post.jschanged
modules_basic/message-backlinks.jsView
@@ -15,24 +15,24 @@
1515 function message_backlinks (msg) {
1616 var links = []
1717 for(var k in CACHE) {
1818 var _msg = CACHE[k]
19- if(Array.isArray(_msg.content.mentions)) {
20- for(var i = 0; i < _msg.content.mentions.length; i++)
21- if(_msg.content.mentions[i].link == msg.key)
22- links.push(k)
19 + var mentions = _msg.content.mentions
20 +
21 + if(Array.isArray(mentions)) {
22 + for(var i = 0; i < mentions.length; i++)
23 + if(mentions[i].link == msg.key)
24 + links.push(k)
2325 }
2426 }
2527
2628 if (links.length === 0) return null
2729
2830 return h('MessageBacklinks', [
2931 h('header', 'backlinks:'),
30- h('ul', links.map(function (link) {
32 + h('ul', links.map(link => {
3133 return h('li', [
32- h('a -backlink', {
33- href: `#${link}`
34- }, link)
34 + h('a -backlink', { href: `#${link}` }, link)
3535 ])
3636 }))
3737 ])
3838 }
modules_basic/message-backlinks.mcssView
@@ -1,12 +1,18 @@
11 MessageBacklinks {
2 + font-size: .9rem
3 +
24 header {
5 + $textSubtle
6 + }
37
4- }
58 ul {
9 + padding-left: 1rem
10 +
611 li {
712 a {
813 -backlink {
14 + $textSubtle
915
1016 }
1117 }
1218 }
modules_basic/message.mcssView
@@ -50,9 +50,11 @@
5050 }
5151 }
5252
5353 footer.backlinks {
54 + flex-basis: 100%
5455
56 + margin-top: .5rem
5557 }
5658
5759
5860 -mini {
modules_basic/post.jsView
@@ -9,9 +9,12 @@
99 //var message_link = plugs.first(exports.message_link = [])
1010 //var markdown = plugs.first(exports.markdown = [])
1111 //
1212
13-exports.needs = { message_link: 'first', markdown: 'first' }
13 +exports.needs = {
14 + message_link: 'first',
15 + markdown: 'first'
16 +}
1417
1518 exports.gives = {
1619 message_content: true,
1720 message_title: true
@@ -21,9 +24,9 @@
2124 return {
2225 message_content,
2326 message_title
2427 }
25-
28 +
2629 function message_content (data) {
2730 if(!data.value.content || !data.value.content.text) return
2831
2932 return h('div',

Built with git-ssb-web