git ssb

3+

dangerousbeans / scuttle-vue



Commit 67c840f15e591de413d2779d9d2ec66f6251f59a

merged

Jolyon committed on 11/15/2017, 1:35:16 AM
Parent: baa22342b087822c62f566868a0ceb921337bb4b
Parent: b65df85068d01bbc7fd6b0ba8686cccbae6928ee

Files changed

.gitignorechanged
modules/avatar-image.jschanged
package-lock.jsonchanged
package.jsonchanged
src/components/Message.vuechanged
src/components/Public.vuechanged
src/plugins/source_observer.jschanged
.eslintrc.jsonadded
.gitignoreView
@@ -10,4 +10,5 @@
1010 *.suo
1111 *.ntvs*
1212 *.njsproj
1313 *.sln
14 +snippets*
modules/avatar-image.jsView
@@ -77,28 +77,15 @@
7777 avatars[a.id] = a
7878 })
7979 )
8080 },
81- avatar_image: function (author, classes) {
82- classes = classes || ''
83- if(classes && 'string' === typeof classes) classes = '.avatar--'+classes
8481
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- }
9182
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) : ""
9885 if(!ready)
9986 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)
10188 })
10289
10390 return img
10491 }
package-lock.jsonView
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.jsonView
@@ -88,9 +88,8 @@
8888 "vue-rx": "^5.0.0",
8989 "xstream-from-pull-stream": "^1.1.0"
9090 },
9191 "devDependencies": {
92- "indexhtmlify": "^1.3.1",
9392 "babel-core": "^6.0.0",
9493 "babel-plugin-transform-runtime": "^6.0.0",
9594 "babel-preset-es2015": "^6.0.0",
9695 "babel-preset-stage-2": "^6.0.0",
@@ -99,9 +98,15 @@
9998 "browserify": "^13.1.0",
10099 "browserify-hmr": "^0.3.1",
101100 "cross-env": "^2.0.0",
102101 "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",
103107 "http-server": "^0.9.0",
108 + "indexhtmlify": "^1.3.1",
104109 "npm-run-all": "^2.3.0",
105110 "proxyquireify": "^3.0.1",
106111 "uglify-js": "^2.5.0",
107112 "vueify": "^9.0.0",
src/components/Message.vueView
@@ -1,12 +1,26 @@
11
22 <template>
33 <div class="media">
4 +<<<<<<< HEAD
45 <img class="mr-3 w-25" :src="profile_image"> <!-- alt="Generic placeholder image" -->
56 <div class="media-body">
67 <h5 class="mt-0">{{ author }}</h5>
78 <p>{{ message.value.content.type() }}</p>
89 <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
923 </div>
1024 </div>
1125 </template>
1226
@@ -23,13 +37,12 @@
2337 props: ['message'],
2438 data () {
2539 return {
2640 author: "...",
27- image_url: "http://via.placeholder.com/90x90",
28- api: this.$depject_api,
29-
41 + image_url: "http://via.placeholder.com/90x90"
3042 }
3143 },
44 +<<<<<<< HEAD
3245 // subscriptions: function () {
3346 // return {
3447 // messages: this.$observers.accumulated_observable(
3548 // this.$depject_api.sbot_log[0]( { limit: 10, reverse: true, live: true } )
@@ -45,18 +58,29 @@
4558 // // // debugger
4659 // //
4760 // // return obj
4861 // },
62 +=======
63 +>>>>>>> b65df85068d01bbc7fd6b0ba8686cccbae6928ee
4964 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 + // }
5269 },
5370 methods: {
5471 setAuthor(err, a){
5572 if(a[0] == null)
5673 return
5774 this.author = nn( a[0] ).name()
5875 },
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 +
5983 // Get markdown formatted version of message content
6084 content_text()
6185 {
6286 return md.block( this.message.value.content.text() )
@@ -68,19 +92,15 @@
6892 updated() {
6993 // author name
7094 this.$depject_api.signifier[0](
7195 this.message.value.author(), this.setAuthor
72- )
96 + ),
7397
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
80102 )
81- window.message = this.message
82- console.log('this.message.value', this.message.value)
83103 }
84104 }
85105
86106 </script>
src/components/Public.vueView
@@ -17,14 +17,15 @@
1717 },
1818 subscriptions: function () {
1919 return {
2020 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 + )
2224 )
2325 }
2426 }
2527 }
2628 </script>
2729
2830 <style scoped>
29-
3031 </style>
src/plugins/source_observer.jsView
@@ -16,8 +16,9 @@
1616 pull.drain(msg => observer.next(msg))
1717 )
1818 }).scan((accumulator, newMsg) => [nn(newMsg), ...accumulator], [])
1919 },
20 +
2021 cb_obs(f, args){
2122 return Rx.Observable.bindCallback(f)(args)
2223 }
2324 }
.eslintrc.jsonView
@@ -1,0 +1,3 @@
1 +{
2 + "extends": "standard"
3 +}

Built with git-ssb-web