git ssb

0+

ev / microbay



forked from Dominic / patchbay

Commit 94b5d7d7eb82f9dc4ba29afbc22997a9107f3483

show names when mouseover avatar links

Dominic Tarr committed on 8/5/2016, 3:10:10 AM
Parent: f620b921a2133b93e775316a92ac76a61ba55798

Files changed

modules/avatar-profile.jschanged
modules/avatar.jschanged
modules/avatar-link.jsadded
modules/avatar-profile.jsView
@@ -1,10 +1,9 @@
11 var h = require('hyperscript')
22 var plugs = require('../plugs')
33 var pull = require('pull-stream')
44
5-var avatar_image = plugs.first(exports.avatar_image = [])
6-var avatar_name = plugs.first(exports.avatar_name = [])
5+var avatar_image_link = plugs.first(exports.avatar_image_link = [])
76 var avatar_action = plugs.map(exports.avatar_action = [])
87 var avatar_edit = plugs.first(exports.avatar_edit = [])
98
109 var follows = plugs.first(exports.follows = [])
@@ -20,9 +19,9 @@
2019 return el
2120 }
2221
2322 function image_link (id) {
24- return h('a', {href:'#'+id}, avatar_image(id, 'thumbnail'))
23+ return avatar_image_link(id, 'thumbnail')
2524 }
2625
2726 exports.avatar_profile = function (id) {
2827 return h('div.column.profile',
@@ -47,4 +46,8 @@
4746 )
4847 )
4948 }
5049
50+
51+
52+
53+
modules/avatar.jsView
@@ -1,16 +1,23 @@
11 var h = require('hyperscript')
22 var u = require('../util')
3+var plugs = require('../plugs')
34
4-
5-var plugs = require('../plugs')
65 var avatar_name = plugs.first(exports.avatar_name = [])
76 var avatar_image = plugs.first(exports.avatar_image = [])
7+var avatar_link = plugs.first(exports.avatar_link = [])
88
99 exports.avatar = function (author, classes) {
10- return h('a.avatar',
11- {href:'#'+author},
10+ return exports.avatar_image_name_link(author, classes)
11+}
12+
13+exports.avatar_image_name_link = function (author, classes) {
14+ return avatar_link(author, [
1215 avatar_image(author, classes),
1316 avatar_name(author)
14- )
17+ ])
1518 }
1619
20+exports.avatar_image_link = function (author, classes) {
21+ return avatar_link(author, avatar_image(author, classes))
22+}
23+
modules/avatar-link.jsView
@@ -1,0 +1,18 @@
1+var h = require('hyperscript')
2+var plugs = require('../plugs')
3+var avatar_name = plugs.first(exports.avatar_name = [])
4+
5+var signifier = require('../plugs').first(exports.signifier = [])
6+
7+exports.avatar_link = function (id, element) {
8+
9+ var link = h('a.avatar', {href: "#"+id, title: id}, element)
10+
11+ signifier(id, function (_, names) {
12+ if(names.length)
13+ link.title = names[0].name + '\n '+id
14+ })
15+
16+ return link
17+}
18+

Built with git-ssb-web