Commit 787f858837541c7b94531c9b98603402cfb7f06b
Merge remote-tracking branch 'ssb/master' into about_refactor
mix irving committed on 12/30/2016, 9:55:01 PMParent: 1462eddad93e346c412fe00dd5fb4468adf1ee04
Parent: 5cb4510e7266ce92c57a4468efce4479ec64d714
Files changed
modules_basic/avatar-image.js | changed |
package.json | changed |
modules_basic/avatar-image.js | |||
---|---|---|---|
@@ -33,8 +33,10 @@ | |||
33 | 33 … | var waiting = [] | |
34 | 34 … | ||
35 | 35 … | var last = 0 | |
36 | 36 … | ||
37 … | +var cache = {} | ||
38 … | + | ||
37 | 39 … | exports.create = function (api) { | |
38 | 40 … | var avatars = {} | |
39 | 41 … | ||
40 | 42 … | //blah blah | |
@@ -89,20 +91,25 @@ | |||
89 | 91 … | avatar_image: function (author, classes) { | |
90 | 92 … | classes = classes || '' | |
91 | 93 … | if(classes && 'string' === typeof classes) classes = '.avatar--'+classes | |
92 | 94 … | ||
93 | - var img = visualize(new Buffer(author.substring(1), 'base64'), 256) | ||
95 … | + function gen (id) { | ||
96 … | + if(cache[id]) return h('img', {src: cache[id]}) | ||
97 … | + var img = visualize(new Buffer(author.substring(1), 'base64'), 256) | ||
98 … | + cache[id] = img.src | ||
99 … | + return img | ||
100 … | + } | ||
101 … | + | ||
102 … | + var img = ready && avatars[author] ? h('img', {src: api.blob_url(avatars[author].image)}) : gen(author) | ||
103 … | + | ||
94 | 104 … | ;(classes || '').split('.').filter(Boolean).forEach(function (c) { | |
95 | 105 … | img.classList.add(c) | |
96 | 106 … | }) | |
97 | 107 … | ||
98 | - function go () { | ||
99 | - if(avatars[author]) img.src = api.blob_url(avatars[author].image) | ||
100 | - } | ||
101 | - | ||
102 | 108 … | if(!ready) | |
103 | - waiting.push(go) | ||
104 | - else go() | ||
109 … | + waiting.push(function () { | ||
110 … | + if(avatars[author]) img.src = api.blob_url(avatars[author].image) | ||
111 … | + }) | ||
105 | 112 … | ||
106 | 113 … | return img | |
107 | 114 … | } | |
108 | 115 … | } |
package.json | ||
---|---|---|
@@ -1,8 +1,8 @@ | ||
1 | 1 … | { |
2 | 2 … | "name": "patchbay", |
3 | 3 … | "description": "a pluggable patchwork", |
4 | - "version": "6.1.5", | |
4 … | + "version": "6.1.6", | |
5 | 5 … | "homepage": "https://github.com/dominictarr/patchbay", |
6 | 6 … | "repository": { |
7 | 7 … | "type": "git", |
8 | 8 … | "url": "git://github.com/dominictarr/patchbay.git" |
@@ -22,9 +22,9 @@ | ||
22 | 22 … | "hyperprogress": "0.1.0", |
23 | 23 … | "hyperscript": "^1.4.7", |
24 | 24 … | "hypertabs": "^3.0.0", |
25 | 25 … | "insert-css": "^2.0.0", |
26 | - "is-visible": "^2.0.4", | |
26 … | + "is-visible": "^2.1.1", | |
27 | 27 … | "kvgraph": "^0.1.0", |
28 | 28 … | "map-filter-reduce": "^3.0.1", |
29 | 29 … | "micro-css": "^0.6.2", |
30 | 30 … | "mime-types": "^2.1.11", |
@@ -35,9 +35,9 @@ | ||
35 | 35 … | "pull-many": "^1.0.7", |
36 | 36 … | "pull-next": "^0.0.1", |
37 | 37 … | "pull-paramap": "^1.1.6", |
38 | 38 … | "pull-reconnect": "^0.0.3", |
39 | - "pull-scroll": "^0.2.0", | |
39 … | + "pull-scroll": "^0.3.3", | |
40 | 40 … | "pull-stream": "^3.4.5", |
41 | 41 … | "scuttlebot": "^8.7.2", |
42 | 42 … | "setimmediate": "^1.0.5", |
43 | 43 … | "simple-mime": "^0.1.0", |
@@ -57,9 +57,9 @@ | ||
57 | 57 … | "ssb-sort": "^1.0.0", |
58 | 58 … | "ssb-ws": "^0.6.2", |
59 | 59 … | "suggest-box": "^2.2.1", |
60 | 60 … | "text-node-searcher": "^1.1.0", |
61 | - "visualize-buffer": "0.0.0" | |
61 … | + "visualize-buffer": "0.0.1" | |
62 | 62 … | }, |
63 | 63 … | "devDependencies": { |
64 | 64 … | "browselectrify": "^1.0.1", |
65 | 65 … | "electro": "^2.0.3", |
Built with git-ssb-web