diff --git a/app/elements/buddy-finder/buddy-finder.html b/app/elements/buddy-finder/buddy-finder.html
index 948994e..e2db07a 100644
--- a/app/elements/buddy-finder/buddy-finder.html
+++ b/app/elements/buddy-finder/buddy-finder.html
@@ -41,9 +41,18 @@
.explanation {
@apply(--paper-font-headline);
- color: #4285f4;
+ color: #4E4E4E;
text-align: center;
}
+
+ .short {
+ @apply(--paper-font-body1);
+ color: #333;
+ }
+
+ .url {
+ color: #4285f4;
+ }
- Snapdrop lets you share instantly with people near by.
+ The easiest way to transfer files across devices.
Allow me to be discovered by: Everyone in this network.
diff --git a/app/elements/elements.html b/app/elements/elements.html
index a81c90e..2601d93 100644
--- a/app/elements/elements.html
+++ b/app/elements/elements.html
@@ -8,7 +8,7 @@
-->
-
+
diff --git a/app/elements/invitation-link/invitation-link-behavior.html b/app/elements/invitation-link/invitation-link-behavior.html
new file mode 100644
index 0000000..9f78ef6
--- /dev/null
+++ b/app/elements/invitation-link/invitation-link-behavior.html
@@ -0,0 +1,45 @@
+
diff --git a/app/elements/invitation-link/invitation-link.html b/app/elements/invitation-link/invitation-link.html
new file mode 100644
index 0000000..4954dcb
--- /dev/null
+++ b/app/elements/invitation-link/invitation-link.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+ Get an Invitation Link to send files accross different networks.
+
+
+
+
diff --git a/app/elements/p2p-network/p2p-network.html b/app/elements/p2p-network/p2p-network.html
index f2c4df2..6a93374 100644
--- a/app/elements/p2p-network/p2p-network.html
+++ b/app/elements/p2p-network/p2p-network.html
@@ -23,47 +23,49 @@
}.bind(this);
},
initialize: function() {
- var options;
- if (window.debug) {
- options = {
- host: window.location.hostname,
- port: 3002,
- path: 'peerjs'
- };
- } else {
- options = {
- host: 'snapdrop.net',
- port: 443,
- path: 'peerjs',
- secure: true
- };
- }
- this._peer = new Peer(this.me, options);
- this._peer.on('open', function(id) {
- console.log('My peer ID is: ' + id);
- this.set('me', id);
- this._peerOpen = true;
- this._initCallbacks.forEach(function(cb) {
- cb();
- });
- }.bind(this));
+ if (window.isActive) {
+ clearInterval(this.reconnectTimer);
+ this.reconnectTimer = undefined;
+ var options;
+ if (window.debug) {
+ options = {
+ host: window.location.hostname,
+ port: 3002,
+ path: 'peerjs'
+ };
+ } else {
+ options = {
+ host: 'snapdrop.net',
+ port: 443,
+ path: 'peerjs',
+ secure: true
+ };
+ }
+ this._peer = new Peer(this.me, options);
+ this._peer.on('open', function(id) {
+ console.log('My peer ID is: ' + id);
+ this.set('me', id);
+ this._peerOpen = true;
+ this._initCallbacks.forEach(function(cb) {
+ cb();
+ });
+ }.bind(this));
- this._peer.on('connection', this.connect.bind(this));
- this._peer.on('error', function(err) {
- console.error(err);
- //ugly hack to find out error type
- if (err.message.indexOf('Could not connect to peer') > -1) {
- delete this._connectedPeers[this.peer];
- this.set('peer', 'error');
- return;
- }
- if (err.message.indexOf('Lost connection to server') > -1) {
- this._peer.destroy();
- this.set('me', this.me);
- this.async(this._initialize, 3000);
- return;
- }
- }.bind(this));
+ this._peer.on('connection', this.connect.bind(this));
+ this._peer.on('error', function(err) {
+ console.error(err);
+ //ugly hack to find out error type
+ if (err.message.indexOf('Could not connect to peer') > -1) {
+ delete this._connectedPeers[this.peer];
+ return;
+ }
+ if (err.message.indexOf('Lost connection to server') > -1) {
+ this._peer.destroy();
+ this._reconnect();
+ return;
+ }
+ }.bind(this));
+ }
},
connect: function(c) {
@@ -145,7 +147,7 @@
conns.forEach(function(conn) {
if (conn.label === 'file') {
conn.send(file);
- console.log('file send via WebRTC');
+ console.log('send file via WebRTC');
}
}.bind(this));
}
@@ -159,6 +161,12 @@
}
}.bind(this));
}
+ },
+ _reconnect: function(e) {
+ //try to reconnect after 3s
+ if (!this.reconnectTimer) {
+ this.reconnectTimer = setInterval(this.initialize.bind(this), 3000);
+ }
}
});
diff --git a/app/elements/p2p-network/tab-active.html b/app/elements/p2p-network/tab-active.html
new file mode 100644
index 0000000..912230a
--- /dev/null
+++ b/app/elements/p2p-network/tab-active.html
@@ -0,0 +1,25 @@
+
diff --git a/app/elements/p2p-network/web-socket.html b/app/elements/p2p-network/web-socket.html
index f90962d..916b29b 100644
--- a/app/elements/p2p-network/web-socket.html
+++ b/app/elements/p2p-network/web-socket.html
@@ -9,55 +9,68 @@
diff --git a/app/elements/x-cards/x-card.html b/app/elements/x-cards/about-page.html
similarity index 68%
rename from app/elements/x-cards/x-card.html
rename to app/elements/x-cards/about-page.html
index fdccdd1..7e95b0e 100644
--- a/app/elements/x-cards/x-card.html
+++ b/app/elements/x-cards/about-page.html
@@ -3,7 +3,7 @@
-
+
-
+
Snapdrop
-
The easiest way to transfer files accross devices.
+
The easiest way to transfer files across devices.
Frequently Asked Questions
-
+