From cd8932b139537aaeec7f5767e17594c56ee002da Mon Sep 17 00:00:00 2001 From: Sam Wight Date: Sun, 3 Feb 2019 00:02:18 -0600 Subject: [PATCH] Finished main view. --- .meteor/packages | 1 + .meteor/versions | 1 + client/blobs/components/blob.html | 28 ++++++++++++++++++++++ client/blobs/components/blob.js | 37 ++++++++++++++++++++++++++++++ client/blobs/showBlobs.html | 13 ++++------- client/blobs/showBlobs.js | 5 ++-- client/main.css | 2 +- client/main.html | 7 ++++-- client/stats/received.js | 6 ++++- client/stats/sent.js | 4 ++++ public/emergency.png | Bin 0 -> 6530 bytes 11 files changed, 89 insertions(+), 15 deletions(-) create mode 100644 client/blobs/components/blob.html create mode 100644 client/blobs/components/blob.js create mode 100644 public/emergency.png diff --git a/.meteor/packages b/.meteor/packages index 4221036..6c745e0 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -19,3 +19,4 @@ shell-server@0.4.0 # Server-side component of the `meteor shell` comm autopublish@1.0.7 # Publish all data to the clients (for prototyping) insecure@1.0.7 # Allow all DB writes from clients (for prototyping) +reactive-dict diff --git a/.meteor/versions b/.meteor/versions index dcf0b35..1446733 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -57,6 +57,7 @@ observe-sequence@1.0.16 ordered-dict@1.1.0 promise@0.11.2 random@1.1.0 +reactive-dict@1.2.1 reactive-var@1.0.11 reload@1.2.0 retry@1.1.0 diff --git a/client/blobs/components/blob.html b/client/blobs/components/blob.html new file mode 100644 index 0000000..44bc353 --- /dev/null +++ b/client/blobs/components/blob.html @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/client/blobs/components/blob.js b/client/blobs/components/blob.js new file mode 100644 index 0000000..140d809 --- /dev/null +++ b/client/blobs/components/blob.js @@ -0,0 +1,37 @@ +import './blob.html' +import { Template } from 'meteor/templating'; +import { ReactiveDict } from 'meteor/reactive-dict'; + +Template.singlenumber.onCreated(function singlenumberOnCreated() { + this.state = new ReactiveDict(); + this.state.set('buttonClosed', true); +}); + +Template.singlenumber.onRendered(function() { + this.$('.singleitem').transition('fade in up'); +}) + +Template.singlenumber.helpers({ + blobs: function() { + const instance = Template.instance(); + if (instance.state.get('buttonClosed')) { + return this.document.blobs.sort(function(a, b) { return b.lastEdited - a.lastEdited }).slice(0, 3); + } + else return this.document.blobs.sort(function(a, b) { return b.lastEdited - a.lastEdited }); + }, + opened: function() { + return Template.instance().state.get('buttonClosed'); + } +}); + +Template.singlenumber.events({ + 'click #showMore': function(e) { + e.preventDefault(); + const instance = Template.instance(); + instance.state.set('buttonClosed', !instance.state.get('buttonClosed')); + } +}); + +Template.blobview.onRendered(function() { + this.$('.item').transition('fade in up'); +}); \ No newline at end of file diff --git a/client/blobs/showBlobs.html b/client/blobs/showBlobs.html index e62f20b..d23398e 100644 --- a/client/blobs/showBlobs.html +++ b/client/blobs/showBlobs.html @@ -1,14 +1,9 @@