first working version

This commit is contained in:
Robin Linus 2015-12-26 13:33:16 +01:00
parent f1ad168e40
commit bda1a15750
24 changed files with 543 additions and 206 deletions

View file

@ -52,12 +52,10 @@
</file-input>
</template>
</div>
<div hidden$="{{buddies.length}}" class="explanation">
Open this page on another device
<wbr>to share files.
<div hidden$="{{buddies.0}}" class="explanation">
Open this page on other devices<br> to send files.
</div>
<personal-avatar class="me"></personal-avatar>
<!-- <iron-ajax id="ajax" auto url="https://yawim.com/findbuddies/{{me}}" handle-as="json" last-response="{{buddies}}"></iron-ajax> -->
</template>
<script>
'use strict';
@ -66,30 +64,11 @@
properties: {
buddies: {
type: Array,
value: []
notify: true
},
me: {
type: String,
}
},
attached: function() {
//Ask server every second for changes
var ajax = this.$.ajax;
function request() {
//ajax.generateRequest();
}
var intervalId = setInterval(request, 1000);
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
clearInterval(intervalId);
intervalId = 0;
} else {
if (!intervalId) {
intervalId = setInterval(request, 1000);
}
}
});
},
},
_fileSelected: function(e) {
var peerId = e.model.item.peerId;

View file

@ -13,11 +13,11 @@
width: 80px;
height: 80px;
color: #4285f4;
margin-bottom: 6px;
}
.paper-font-body1 {
font-size: 13px;
margin-top: 6px;
}
.discover {
@ -26,7 +26,7 @@
</style>
<iron-icon icon="chat:wifi-tethering"></iron-icon>
<div class="paper-font-body1">
SnapDrop lets you share instantly with people near by.
Snapdrop lets you share instantly with people near by.
</div>
<div class="paper-font-body1 discover">
Allow me to be discovered by: Everyone in this network.

View file

@ -7,7 +7,7 @@
@apply(--layout-vertical);
@apply(--layout-center);
width: 120px;
height: 120px;
height: 152px;
}
paper-icon-button {
@ -45,7 +45,7 @@
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
margin: 4px;
margin-top: 4px;
}
</style>
<paper-icon-button icon="{{_displayIcon}}"></paper-icon-button>
@ -85,7 +85,6 @@
if (contact.type === 'tablet') {
return 'chat:tablet-mac';
}
return 'chat:desktop-mac';
},
attached: function() {