Squashed commit of the following:

commit dd00d53895b824fbe4170c4a34b104303f722ccd
Merge: 2b3698e cb9ea12
Author: Robin Linus <robin_woll@capira.de>
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 <robin_woll@capira.de>
Date:   Tue Feb 9 23:43:49 2016 -0600

    #13 Feature Request: Name your device

commit 6fa43b56f4e705a19e68b62bc671a4948b6968fb
Author: Robin Linus <robin_woll@capira.de>
Date:   Fri Jan 1 19:54:56 2016 +0100

    Initial

commit fc55c86f5cf95039355d85be7409e68f27246696
Author: Robin Linus <robin_woll@capira.de>
Date:   Fri Jan 1 18:06:27 2016 +0100

    Fix fullscreen layout on iOS
This commit is contained in:
Robin Linus 2016-02-10 08:58:09 -06:00
parent 2b3698ece0
commit e66598d77f
8 changed files with 210 additions and 16 deletions

View file

@ -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);
}