diff --git a/apps/cory/ssb.json b/apps/cory/ssb.json index 6b7f9f49..54e97a8f 100644 --- a/apps/cory/ssb.json +++ b/apps/cory/ssb.json @@ -1 +1 @@ -{"type":"tildefriends-app","files":{"app.js":"&nbY2UrHp+GcW1FrromCZRyJNg7in7InypXSaFNipTrs=.sha256","index.html":"&xCI4SATYvlJkVX5EdlRROoDSMWlajF+wDFrWSUYZqd8=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&DdJwZYEo7AqFyutYMvEjykoVXxdHVog0UXye6Sbo0TU=.sha256","tf-message.js":"&kIpc5B2dt4oefsTgNASz2cVte3WRO0k2NCYJYRzu/MA=.sha256","tf.js":"&WvteLAg4G92YOUO3/B36kmar5lqFq8Pil4rsy7uFNDY=.sha256","commonmark.min.js":"&EP0OeR9zyLwZannz+0ga4s9AGES2RLvvIIQYHqqV6+k=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256","tf-shared.js":"&g17mCj0bfk0tw0sYk2VMU67Bt8Hdznjl44E01TxQF5Y=.sha256"}} \ No newline at end of file +{"type":"tildefriends-app","files":{"app.js":"&nbY2UrHp+GcW1FrromCZRyJNg7in7InypXSaFNipTrs=.sha256","index.html":"&oAZVhNbqs9mLhgZj6VLgRvmCYuiGjp9D+ZH3vFV/ViM=.sha256","vue-material.js":"&K5cdLqXYCENPak/TCINHQhyJhpS4G9DlZHGwoh/LF2g=.sha256","tf-user.js":"&BwircO1usZwNmgxReG3COtztqg6bVYnVenTKsLhOeLI=.sha256","tf-message.js":"&TcKxV+QGU2LQ+yLtZbD1xdWfDSAPLRj47fBaydho3ts=.sha256","tf.js":"&ih5SgLokhC5wnL7VNnFhSD/t2mqs5gTFzUUFWBlMp3k=.sha256","commonmark.min.js":"&EP0OeR9zyLwZannz+0ga4s9AGES2RLvvIIQYHqqV6+k=.sha256","vue.js":"&g1wvA+yHl1sVC+eufTsg9If7ZeVyMTBU+h0tks7ZNzE=.sha256","vue-material-theme-default-dark.css":"&RP2nr+2CR18BpHHw5ST9a5GJUCOG9n0G2kuGkcQioWE=.sha256","vue-material.min.css":"&kGbUM2QgFSyHZRzqQb0b+0S3EVIlZ0AXpdiAVjIhou8=.sha256","roboto.css":"&jJv43Om673mQO5JK0jj7714s5E+5Yrf82H6LcDx7wUs=.sha256","material-icons.css":"&a28PdcVvgq/DxyIvJAx/e+ZOEtOuHnr3kjLWKyzH11M=.sha256","tf-shared.js":"&g17mCj0bfk0tw0sYk2VMU67Bt8Hdznjl44E01TxQF5Y=.sha256"}} \ No newline at end of file diff --git a/apps/cory/ssb/index.html b/apps/cory/ssb/index.html index 0404e3be..18f0c29e 100644 --- a/apps/cory/ssb/index.html +++ b/apps/cory/ssb/index.html @@ -12,6 +12,7 @@ +
@@ -111,6 +112,7 @@
+ @@ -125,6 +127,9 @@
+ + attach_file + {{Object.keys(users[selected].followers).length}} followers diff --git a/apps/cory/ssb/tf-message.js b/apps/cory/ssb/tf-message.js index 4dd91e1e..99bf419f 100644 --- a/apps/cory/ssb/tf-message.js +++ b/apps/cory/ssb/tf-message.js @@ -144,7 +144,7 @@ Vue.component('tf-message', { {{v + (votes[message.id][v].length > 1 ? ' (' + votes[message.id][v].length + ')' : '')}} -
{{vote.author}}
+
diff --git a/apps/cory/ssb/tf-user.js b/apps/cory/ssb/tf-user.js index bc273610..df1344ba 100644 --- a/apps/cory/ssb/tf-user.js +++ b/apps/cory/ssb/tf-user.js @@ -18,8 +18,8 @@ Vue.component('tf-user', { window.parent.postMessage({action: 'setHash', hash: this.id}, '*'); }, }, - template: ` - {{users[id] && users[id].name ? users[id].name : id}} + template: ` + {{users[id] && users[id].name ? users[id].name : id}} {{id}} `, }); \ No newline at end of file diff --git a/apps/cory/ssb/tf.js b/apps/cory/ssb/tf.js index 2d57daf1..95f98d2a 100644 --- a/apps/cory/ssb/tf.js +++ b/apps/cory/ssb/tf.js @@ -20,6 +20,7 @@ var g_data = { selected: null, edit_profile_name: null, edit_profile_description: null, + edit_profile_image: null, load_time: null, post_text: null, times: {}, @@ -33,6 +34,7 @@ var g_process_pending = false; function updateEditUser() { g_data.edit_profile_name = g_data.users[g_data.whoami] ? g_data.users[g_data.whoami].name : null; g_data.edit_profile_description = g_data.users[g_data.whoami] ? g_data.users[g_data.whoami].description : null; + g_data.edit_profile_image = g_data.users[g_data.whoami] ? g_data.users[g_data.whoami].image : null; } function processMessages() { @@ -155,12 +157,16 @@ function processMessages() { } } else if (key == 'storeBlobComplete') { var blob = event.data.storeBlobComplete; - g_data.post_text = (g_data.post_text || '') + `\n![${blob.name}](${blob.path.substring(1)})`; - Vue.set(g_data.mentions, blob.path.substring(1), { - link: blob.path.substring(1), - name: blob.name, - type: blob.type, - }); + if (blob.context == 'profile') { + g_data.edit_profile_image = blob.path.substring(1); + } else { + g_data.post_text = (g_data.post_text || '') + `\n![${blob.name}](${blob.path.substring(1)})`; + Vue.set(g_data.mentions, blob.path.substring(1), { + link: blob.path.substring(1), + name: blob.name, + type: blob.type, + }); + } } else { g_data[key] = event.data[key]; } @@ -226,12 +232,15 @@ window.addEventListener('load', function() { Vue.delete(g_data.mentions, link); }, save_profile: function() { - var message = {appendMessage: { - type: 'about', - about: g_data.selected, - name: g_data.edit_profile_name, - description: g_data.edit_profile_description, - }}; + var message = { + appendMessage: { + type: 'about', + about: g_data.selected, + name: g_data.edit_profile_name, + description: g_data.edit_profile_description, + image: g_data.edit_profile_image, + } + }; window.parent.postMessage(message, '*'); }, follow: function(id) { @@ -257,7 +266,7 @@ window.addEventListener('load', function() { set_hash(hash) { window.parent.postMessage({action: 'setHash', hash: hash ? hash : '#'}, '*'); }, - attach() { + attach(context) { var input = document.createElement('input'); input.type = 'file'; input.onchange = function(event) { @@ -268,7 +277,8 @@ window.addEventListener('load', function() { name: file.name, type: file.type, buffer: buffer, - } + }, + context: context, }, '*'); }).catch(function(e) { console.log('error', e);