From e66598d77f4828fc409f1e3d148b9d2cec8d2ec8 Mon Sep 17 00:00:00 2001 From: Robin Linus Date: Wed, 10 Feb 2016 08:58:09 -0600 Subject: [PATCH] Squashed commit of the following: commit dd00d53895b824fbe4170c4a34b104303f722ccd Merge: 2b3698e cb9ea12 Author: Robin Linus Date: Wed Feb 10 00:27:32 2016 -0600 Merge branch 'name-device' into merge123 # Conflicts: # app/elements/buddy-finder/buddy-avatar.html # app/elements/buddy-finder/buddy-finder.html # app/elements/buddy-finder/personal-avatar.html # app/index.html commit cb9ea1235001f0cc23514cb622ce711cdc0538af Author: Robin Linus Date: Tue Feb 9 23:43:49 2016 -0600 #13 Feature Request: Name your device commit 6fa43b56f4e705a19e68b62bc671a4948b6968fb Author: Robin Linus Date: Fri Jan 1 19:54:56 2016 +0100 Initial commit fc55c86f5cf95039355d85be7409e68f27246696 Author: Robin Linus Date: Fri Jan 1 18:06:27 2016 +0100 Fix fullscreen layout on iOS --- app/elements/buddy-finder/buddy-avatar.html | 34 +++++-- app/elements/buddy-finder/buddy-finder.html | 1 + .../buddy-finder/device-name-dialog.html | 51 ++++++++++ app/elements/buddy-finder/device-name.html | 95 ++++++++++++++++++ .../buddy-finder/personal-avatar.html | 24 ++++- .../p2p-network/connection-wrapper.html | 3 + app/images/touch/JZH3ff5.png | Bin 0 -> 33411 bytes server/ws-server.js | 18 +++- 8 files changed, 210 insertions(+), 16 deletions(-) create mode 100644 app/elements/buddy-finder/device-name-dialog.html create mode 100644 app/elements/buddy-finder/device-name.html create mode 100644 app/images/touch/JZH3ff5.png diff --git a/app/elements/buddy-finder/buddy-avatar.html b/app/elements/buddy-finder/buddy-avatar.html index 14ddbb3..ac5fd35 100644 --- a/app/elements/buddy-finder/buddy-avatar.html +++ b/app/elements/buddy-finder/buddy-avatar.html @@ -31,8 +31,8 @@ .paper-font-subhead { text-align: center; - line-height: 22px; - margin-top: 2px; + margin-top: 0px; + line-height: 18px; } .paper-font-body1 { @@ -40,7 +40,8 @@ width: 100%; font-size: 13px; color: grey; - line-height: 13px; + margin-top: 0px !important; + line-height: 16px; } :host, @@ -91,11 +92,19 @@ }, status: { type: String, - value: '' + value: '', + }, + defaultStatus: { + computed: '_computeDefaultStatus(contact)' } }, _computeDisplayName: function(contact) { - contact = contact.name; + if (!contact.name.os) { + return contact.name; + } + return this._computeDeviceName(contact.name); + }, + _computeDeviceName: function(contact) { if (contact.model) { return contact.os + ' ' + contact.model; } @@ -103,7 +112,7 @@ return contact.os + ' ' + contact.browser; }, _computeDisplayIcon: function(contact) { - contact = contact.name; + contact = contact.device || contact.name; if (contact.type === 'mobile') { return 'chat:phone-iphone'; } @@ -112,6 +121,11 @@ } return 'chat:desktop-mac'; }, + _computeDefaultStatus: function(contact) { + var status = contact.device ? this._computeDeviceName(contact.device) : ''; + this.status = status; + return status; + }, attached: function() { this.async(function() { app.conn.addEventListener('file-offered', function(e) { @@ -131,21 +145,21 @@ }.bind(this), false); app.conn.addEventListener('upload-complete', function(e) { if (e.detail.from === this.contact.peerId) { - this.status = ''; + this.status = this.defaultStatus; } }.bind(this), false); app.conn.addEventListener('download-complete', function(e) { if (e.detail.from === this.contact.peerId) { - this.status = ''; + this.status = this.defaultStatus; } }.bind(this), false); app.conn.addEventListener('file-declined', function(e) { if (e.detail.from === this.contact.peerId) { - this.status = ''; + this.status = this.defaultStatus; } }.bind(this), false); app.conn.addEventListener('upload-error', function(e) { - this.status = ''; + this.status = this.defaultStatus; }.bind(this), false); }, 200); } diff --git a/app/elements/buddy-finder/buddy-finder.html b/app/elements/buddy-finder/buddy-finder.html index 599ea3e..81dc13d 100644 --- a/app/elements/buddy-finder/buddy-finder.html +++ b/app/elements/buddy-finder/buddy-finder.html @@ -102,6 +102,7 @@ opacity: 1; } } +
Tap to send File. diff --git a/app/elements/buddy-finder/device-name-dialog.html b/app/elements/buddy-finder/device-name-dialog.html new file mode 100644 index 0000000..b65d8dd --- /dev/null +++ b/app/elements/buddy-finder/device-name-dialog.html @@ -0,0 +1,51 @@ + + + + + + diff --git a/app/elements/buddy-finder/device-name.html b/app/elements/buddy-finder/device-name.html new file mode 100644 index 0000000..4f60536 --- /dev/null +++ b/app/elements/buddy-finder/device-name.html @@ -0,0 +1,95 @@ + + + + + + + diff --git a/app/elements/buddy-finder/personal-avatar.html b/app/elements/buddy-finder/personal-avatar.html index d3c4d40..9941092 100644 --- a/app/elements/buddy-finder/personal-avatar.html +++ b/app/elements/buddy-finder/personal-avatar.html @@ -1,5 +1,6 @@ +