Commit 67c840f15e591de413d2779d9d2ec66f6251f59a
merged
Jolyon committed on 11/15/2017, 1:35:16 AMParent: baa22342b087822c62f566868a0ceb921337bb4b
Parent: b65df85068d01bbc7fd6b0ba8686cccbae6928ee
Files changed
.gitignore | changed |
modules/avatar-image.js | changed |
package-lock.json | changed |
package.json | changed |
src/components/Message.vue | changed |
src/components/Public.vue | changed |
src/plugins/source_observer.js | changed |
.eslintrc.json | added |
modules/avatar-image.js | ||
---|---|---|
@@ -77,28 +77,15 @@ | ||
77 | 77 … | avatars[a.id] = a |
78 | 78 … | }) |
79 | 79 … | ) |
80 | 80 … | }, |
81 | - avatar_image: function (author, classes) { | |
82 | - classes = classes || '' | |
83 | - if(classes && 'string' === typeof classes) classes = '.avatar--'+classes | |
84 | 81 … | |
85 | - function gen (id) { | |
86 | - if(cache[id]) return h('img', {src: cache[id]}) | |
87 | - var img = visualize(new Buffer(author.substring(1), 'base64'), 256) | |
88 | - cache[id] = img.src | |
89 | - return img | |
90 | - } | |
91 | 82 … | |
92 | - var img = ready && avatars[author] ? h('img', {src: api.blob_url(avatars[author].image)}) : gen(author) | |
93 | - | |
94 | - ;(classes || '').split('.').filter(Boolean).forEach(function (c) { | |
95 | - img.classList.add(c) | |
96 | - }) | |
97 | - | |
83 … | + avatar_image: function (author, classes) { | |
84 … | + var img = ready && avatars[author] ? api.blob_url(avatars[author].image) : "" | |
98 | 85 … | if(!ready) |
99 | 86 … | waiting.push(function () { |
100 | - if(avatars[author]) img.src = api.blob_url(avatars[author].image) | |
87 … | + if(avatars[author]) img = api.blob_url(avatars[author].image) | |
101 | 88 … | }) |
102 | 89 … | |
103 | 90 … | return img |
104 | 91 … | } |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 383484 bytes New file size: 390917 bytes |
package.json | ||
---|---|---|
@@ -88,9 +88,8 @@ | ||
88 | 88 … | "vue-rx": "^5.0.0", |
89 | 89 … | "xstream-from-pull-stream": "^1.1.0" |
90 | 90 … | }, |
91 | 91 … | "devDependencies": { |
92 | - "indexhtmlify": "^1.3.1", | |
93 | 92 … | "babel-core": "^6.0.0", |
94 | 93 … | "babel-plugin-transform-runtime": "^6.0.0", |
95 | 94 … | "babel-preset-es2015": "^6.0.0", |
96 | 95 … | "babel-preset-stage-2": "^6.0.0", |
@@ -99,9 +98,15 @@ | ||
99 | 98 … | "browserify": "^13.1.0", |
100 | 99 … | "browserify-hmr": "^0.3.1", |
101 | 100 … | "cross-env": "^2.0.0", |
102 | 101 … | "envify": "^3.4.1", |
102 … | + "eslint-config-standard": "^10.2.1", | |
103 … | + "eslint-plugin-import": "^2.8.0", | |
104 … | + "eslint-plugin-node": "^5.2.1", | |
105 … | + "eslint-plugin-promise": "^3.6.0", | |
106 … | + "eslint-plugin-standard": "^3.0.1", | |
103 | 107 … | "http-server": "^0.9.0", |
108 … | + "indexhtmlify": "^1.3.1", | |
104 | 109 … | "npm-run-all": "^2.3.0", |
105 | 110 … | "proxyquireify": "^3.0.1", |
106 | 111 … | "uglify-js": "^2.5.0", |
107 | 112 … | "vueify": "^9.0.0", |
src/components/Message.vue | |||
---|---|---|---|
@@ -1,12 +1,26 @@ | |||
1 | 1 … | ||
2 | 2 … | <template> | |
3 | 3 … | <div class="media"> | |
4 … | +<<<<<<< HEAD | ||
4 | 5 … | <img class="mr-3 w-25" :src="profile_image"> <!-- alt="Generic placeholder image" --> | |
5 | 6 … | <div class="media-body"> | |
6 | 7 … | <h5 class="mt-0">{{ author }}</h5> | |
7 | 8 … | <p>{{ message.value.content.type() }}</p> | |
8 | 9 … | <div v-html="content_text()"></div> | |
10 … | +======= | ||
11 … | + <img :src="image_url"></img> | ||
12 … | + | ||
13 … | + | ||
14 … | + <div class="media-body"> | ||
15 … | + <h5 class="mt-0">{{ author }}</h5> | ||
16 … | + | ||
17 … | + <span v-html="content_text()"></span> | ||
18 … | + | ||
19 … | + <p> | ||
20 … | + {{ message.value.content.type() }} | ||
21 … | + </p> | ||
22 … | +>>>>>>> b65df85068d01bbc7fd6b0ba8686cccbae6928ee | ||
9 | 23 … | </div> | |
10 | 24 … | </div> | |
11 | 25 … | </template> | |
12 | 26 … | ||
@@ -23,13 +37,12 @@ | |||
23 | 37 … | props: ['message'], | |
24 | 38 … | data () { | |
25 | 39 … | return { | |
26 | 40 … | author: "...", | |
27 | - image_url: "http://via.placeholder.com/90x90", | ||
28 | - api: this.$depject_api, | ||
29 | - | ||
41 … | + image_url: "http://via.placeholder.com/90x90" | ||
30 | 42 … | } | |
31 | 43 … | }, | |
44 … | +<<<<<<< HEAD | ||
32 | 45 … | // subscriptions: function () { | |
33 | 46 … | // return { | |
34 | 47 … | // messages: this.$observers.accumulated_observable( | |
35 | 48 … | // this.$depject_api.sbot_log[0]( { limit: 10, reverse: true, live: true } ) | |
@@ -45,18 +58,29 @@ | |||
45 | 58 … | // // // debugger | |
46 | 59 … | // // | |
47 | 60 … | // // return obj | |
48 | 61 … | // }, | |
62 … | +======= | ||
63 … | +>>>>>>> b65df85068d01bbc7fd6b0ba8686cccbae6928ee | ||
49 | 64 … | computed: { | |
50 | - profile_image: function(){ | ||
51 | - return vm.$depject_api.blob_url[0]("&aIbhv+YRJ85BAWzI1oCwa9716L5pdvMliMdh4KOT+SE=.sha256") } | ||
65 … | + // profile_image: function(){ | ||
66 … | + // // Get blob for about image | ||
67 … | + // // return this.$depject_api.avatar[0]("@TXKFQehlyoSn8UJAIVP/k2BjFINC591MlBC2e2d24mA=.ed25519")} | ||
68 … | + // } | ||
52 | 69 … | }, | |
53 | 70 … | methods: { | |
54 | 71 … | setAuthor(err, a){ | |
55 | 72 … | if(a[0] == null) | |
56 | 73 … | return | |
57 | 74 … | this.author = nn( a[0] ).name() | |
58 | 75 … | }, | |
76 … | + | ||
77 … | + set_image_url(err, a){ | ||
78 … | + console.log("Set image URL") | ||
79 … | + console.log(err, a) | ||
80 … | + // this.image_url = a | ||
81 … | + }, | ||
82 … | + | ||
59 | 83 … | // Get markdown formatted version of message content | |
60 | 84 … | content_text() | |
61 | 85 … | { | |
62 | 86 … | return md.block( this.message.value.content.text() ) | |
@@ -68,19 +92,15 @@ | |||
68 | 92 … | updated() { | |
69 | 93 … | // author name | |
70 | 94 … | this.$depject_api.signifier[0]( | |
71 | 95 … | this.message.value.author(), this.setAuthor | |
72 | - ) | ||
96 … | + ), | ||
73 | 97 … | ||
74 | - | ||
75 | - }, | ||
76 | - mounted() { | ||
77 | - | ||
78 | - this.$depject_api.signifier[0]( | ||
79 | - this.message.value.author(), this.cb | ||
98 … | + // this.$depject_api.avatar[0]("@TXKFQehlyoSn8UJAIVP/k2BjFINC591MlBC2e2d24mA=.ed25519")} | ||
99 … | + // this.image_url = "face" | ||
100 … | + this.image_url = this.$depject_api.avatar_image[0]( | ||
101 … | + this.message.value.author(), this.set_image_url, this.set_image_url | ||
80 | 102 … | ) | |
81 | - window.message = this.message | ||
82 | - console.log('this.message.value', this.message.value) | ||
83 | 103 … | } | |
84 | 104 … | } | |
85 | 105 … | ||
86 | 106 … | </script> |
src/components/Public.vue | ||
---|---|---|
@@ -17,14 +17,15 @@ | ||
17 | 17 … | }, |
18 | 18 … | subscriptions: function () { |
19 | 19 … | return { |
20 | 20 … | messages: this.$observers.accumulated_observable( |
21 | - this.$depject_api.sbot_log[0]( { limit: 10, reverse: true, live: true } ) | |
21 … | + this.$depject_api.sbot_log[0]( | |
22 … | + { limit: 10, reverse: true, live: true } | |
23 … | + ) | |
22 | 24 … | ) |
23 | 25 … | } |
24 | 26 … | } |
25 | 27 … | } |
26 | 28 … | </script> |
27 | 29 … | |
28 | 30 … | <style scoped> |
29 | - | |
30 | 31 … | </style> |
Built with git-ssb-web