Browse Source

finish adding backgrounds to profiles

master
Ev Bogue 3 years ago
parent
commit
dac0064cf5
  1. 4
      css/style.css
  2. 4
      gossip.js
  3. 6
      identify.js
  4. 12
      views.js

4
css/style.css

@ -56,6 +56,8 @@ hr {
.right { float: right;}
.banner {height: 10px; }
.message, .profile {
border: 1px solid #ddd;
background: white;
@ -67,8 +69,6 @@ hr {
border-radius: 5px;
}
.banner { height: 275px; }
#scroller:last-child { margin-bottom: 10em; }
.message, .message > *, .navbar, .navbar > *, #ad, #ad > *, #viewer > * {

4
gossip.js

@ -49,7 +49,7 @@ function processreq (req, pubkey, connection, keys) {
var src = window.location.hash.substring(1)
if ((src === msg.author) || (src === '')) {
var scroller = document.getElementById('scroller')
scroller.insertBefore(render(opened, keys), scroller.childNodes[2])
scroller.insertBefore(render(opened, keys), scroller.childNodes[1])
}
if (opened.seq === req.length) {
localforage.setItem('log', log)
@ -71,7 +71,7 @@ function processreq (req, pubkey, connection, keys) {
var src = window.location.hash.substring(1)
if ((src === msg.author) || (src === '')) {
var scroller = document.getElementById('scroller')
scroller.insertBefore(render(opened, keys), scroller.childNodes[2])
scroller.insertBefore(render(opened, keys), scroller.childNodes[1])
}
if (req.length + lastmsg.seq === opened.seq) {
localforage.setItem('log', log)

6
identify.js

@ -1,4 +1,4 @@
function identify (src, profile, keys) {
function identify (src, profile, keys, name) {
var identifyDiv = h('div')
@ -213,7 +213,6 @@ function identify (src, profile, keys) {
identifyButtons.parentNode.removeChild(identifyButtons)
}
}, ['Cancel']))
if (src[0] == '@') {
var identifyButton = h('button', {
onclick: function () {
@ -221,7 +220,7 @@ function identify (src, profile, keys) {
profile.appendChild(identifyButtons)
identifyButton.parentNode.removeChild(identifyButton)
}
}, ['Identify ' + src.substring(0, 10) + '...'])
}, ['Identify ' + name])
} else {
var identifyButton = h('button', {
onclick: function () {
@ -231,6 +230,7 @@ function identify (src, profile, keys) {
}
}, ['Add to ' + src.substring(0, 10) + '...'])
}
return identifyButton
}

12
views.js

@ -8,6 +8,7 @@ function profilePage (src, keys) {
var msg = {}
msg.author = src
var profileDiv = h('div')
var profile = h('div', {classList: 'profile'})
var banner = h('div', {classList: 'banner'})
@ -16,7 +17,8 @@ function profilePage (src, keys) {
if (log) {
for (var i = 0; i < log.length; i++) {
if ((log[i].backgrounded === src) && (log[i].author === src)) {
// if you've identified someone as something else show that something else
// if you've identified someone as something else show that something else
banner.style.height = '300px'
return banner.style.background = 'fixed top/680px no-repeat url(' + log[i].background + ')'
}
}
@ -26,9 +28,9 @@ function profilePage (src, keys) {
getBg(src, profile)
scroller.appendChild(banner)
scroller.appendChild(profile)
//scroller.appendChild(h('div'))
profileDiv.appendChild(banner)
profileDiv.appendChild(profile)
scroller.appendChild(profileDiv)
var subs = [src]
@ -45,8 +47,6 @@ function profilePage (src, keys) {
profile.appendChild(h('a', {href: '#' + src}, [
getImage(src, keys, 'profileAvatar'),
getName(src, keys),
h('br'),
h('br')
]))
profile.appendChild(h('br'))

Loading…
Cancel
Save