snapdrop

A Progressive Web App for local file sharing
git clone http://git.hanabi.in/repos/snapdrop.git
Log | Files | Refs | README | LICENSE

commit 78dd7764260a8455bf91c83945dad9326cd709dd
parent 7ed10a7ba413522d84c3c479eacb432adb68843b
Author: Robin Linus <robin_woll@capira.de>
Date:   Thu, 23 Jun 2016 11:03:49 -0600

Rename global variable 'Chat' to 'Snapdrop'

Initially a lot of code was copied from another project. This lead to confusing naming conventions.

Diffstat:
Mapp/elements/buddy-finder/buddy-avatar.html | 2+-
Mapp/elements/file-sharing/file-button-behavior.html | 6+++---
Mapp/elements/file-sharing/file-button.html | 2+-
Mapp/elements/file-sharing/file-drop-behavior.html | 6+++---
Mapp/elements/file-sharing/file-input-behavior.html | 2+-
Mapp/elements/file-sharing/file-receiver.html | 2+-
Mapp/elements/file-sharing/file-selection-behavior.html | 4++--
Mapp/elements/invitation-link/invitation-link-behavior.html | 4++--
Mapp/elements/invitation-link/invitation-link.html | 2+-
Mapp/elements/p2p-network/connection-wrapper.html | 2+-
Mapp/elements/p2p-network/file-transfer-protocol.html | 4++--
Mapp/elements/sound-notification/sound-notification-behavior.html | 4++--
Mapp/elements/text-sharing/clipboard-behavior.html | 2+-
Mapp/elements/text-sharing/text-input-behavior.html | 4++--
Mapp/elements/text-sharing/text-input-dialog.html | 2+-
15 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/app/elements/buddy-finder/buddy-avatar.html b/app/elements/buddy-finder/buddy-avatar.html @@ -81,7 +81,7 @@ 'use strict'; Polymer({ is: 'buddy-avatar', - behaviors: [Chat.FileInputBehavior, Chat.TextInputBehavior], + behaviors: [Snapdrop.FileInputBehavior, Snapdrop.TextInputBehavior], properties: { contact: Object, _displayName: { diff --git a/app/elements/file-sharing/file-button-behavior.html b/app/elements/file-sharing/file-button-behavior.html @@ -1,8 +1,8 @@ <link rel="import" href="file-selection-behavior.html"> <script> 'use strict'; -window.Chat = window.Chat || {}; -Chat.FileButtonBehaviorImpl = { +window.Snapdrop = window.Snapdrop || {}; +Snapdrop.FileButtonBehaviorImpl = { get fileInput() { var fileInput = Polymer.dom(this).querySelector('.fileInput'); if (!fileInput) { @@ -33,5 +33,5 @@ Chat.FileButtonBehaviorImpl = { }.bind(this), false); } }; -Chat.FileButtonBehavior = [Chat.FileButtonBehaviorImpl, Chat.FileSelectionBehavior]; +Snapdrop.FileButtonBehavior = [Snapdrop.FileButtonBehaviorImpl, Snapdrop.FileSelectionBehavior]; </script> diff --git a/app/elements/file-sharing/file-button.html b/app/elements/file-sharing/file-button.html @@ -8,7 +8,7 @@ 'use strict'; Polymer({ is: 'file-button', - behaviors: [Chat.FileButtonBehavior] + behaviors: [Snapdrop.FileButtonBehavior] }); </script> </dom-module> diff --git a/app/elements/file-sharing/file-drop-behavior.html b/app/elements/file-sharing/file-drop-behavior.html @@ -1,8 +1,8 @@ <link rel="import" href="file-selection-behavior.html"> <script> 'use strict'; -window.Chat = window.Chat || {}; -Chat.FileDropBehaviorImpl = { +window.Snapdrop = window.Snapdrop || {}; +Snapdrop.FileDropBehaviorImpl = { attached: function() { var dropZone = this; @@ -44,5 +44,5 @@ document.body.addEventListener('drop', function(event) { event.stopPropagation(); event.preventDefault(); }); -Chat.FileDropBehavior = [Chat.FileDropBehaviorImpl, Chat.FileSelectionBehavior]; +Snapdrop.FileDropBehavior = [Snapdrop.FileDropBehaviorImpl, Snapdrop.FileSelectionBehavior]; </script> diff --git a/app/elements/file-sharing/file-input-behavior.html b/app/elements/file-sharing/file-input-behavior.html @@ -2,5 +2,5 @@ <link rel="import" href="file-button-behavior.html"> <script> 'use strict'; - Chat.FileInputBehavior = [Chat.FileDropBehavior,Chat.FileButtonBehavior]; + Snapdrop.FileInputBehavior = [Snapdrop.FileDropBehavior,Snapdrop.FileButtonBehavior]; </script> \ No newline at end of file diff --git a/app/elements/file-sharing/file-receiver.html b/app/elements/file-sharing/file-receiver.html @@ -48,7 +48,7 @@ (function() { Polymer({ is: 'file-receiver', - behaviors: [Chat.SoundNotificationBehavior], + behaviors: [Snapdrop.SoundNotificationBehavior], attached: function() { this.async(function() { app.conn.addEventListener('file-offer', function(e) { diff --git a/app/elements/file-sharing/file-selection-behavior.html b/app/elements/file-sharing/file-selection-behavior.html @@ -1,7 +1,7 @@ <script> 'use strict'; -window.Chat = window.Chat || {}; -Chat.FileSelectionBehavior = { +window.Snapdrop = window.Snapdrop || {}; +Snapdrop.FileSelectionBehavior = { notifyFilesSelection: function(files) { if (!files) { console.log('no files selected...'); diff --git a/app/elements/invitation-link/invitation-link-behavior.html b/app/elements/invitation-link/invitation-link-behavior.html @@ -1,7 +1,7 @@ <script> 'use strict'; -window.Chat = window.Chat || {}; -Chat.InvitationLinkBehavior = { +window.Snapdrop = window.Snapdrop || {}; +Snapdrop.InvitationLinkBehavior = { properties: { contact: { type: String diff --git a/app/elements/invitation-link/invitation-link.html b/app/elements/invitation-link/invitation-link.html @@ -23,7 +23,7 @@ 'use strict'; Polymer({ is: 'invitation-link', - behaviors: [Chat.InvitationLinkBehavior] + behaviors: [Snapdrop.InvitationLinkBehavior] }); </script> </dom-module> diff --git a/app/elements/p2p-network/connection-wrapper.html b/app/elements/p2p-network/connection-wrapper.html @@ -20,7 +20,7 @@ notify: true }, }, - behaviors: [Chat.FileTransferProtocol], + behaviors: [Snapdrop.FileTransferProtocol], _sendFile: function(toPeer, file) { if (!rtcConnectionSupported(toPeer)) { this.$.ws._sendFile(toPeer, file); diff --git a/app/elements/p2p-network/file-transfer-protocol.html b/app/elements/p2p-network/file-transfer-protocol.html @@ -1,7 +1,7 @@ <script> 'use strict'; -window.Chat = window.Chat || {}; -Chat.FileTransferProtocol = { +window.Snapdrop = window.Snapdrop || {}; +Snapdrop.FileTransferProtocol = { properties: { loading: { type: Boolean, diff --git a/app/elements/sound-notification/sound-notification-behavior.html b/app/elements/sound-notification/sound-notification-behavior.html @@ -1,8 +1,8 @@ <link rel="import" href="sound-notification.html"> <script> 'use strict'; -Chat = window.Chat || {}; -Chat.SoundNotificationBehavior = { +Snapdrop = window.Snapdrop || {}; +Snapdrop.SoundNotificationBehavior = { sounds: function() { var sounds = document.querySelector('sound-notification'); if (!sounds) { diff --git a/app/elements/text-sharing/clipboard-behavior.html b/app/elements/text-sharing/clipboard-behavior.html @@ -8,7 +8,7 @@ style.top = '-10000px'; document.body.appendChild(copyTextarea); - window.Chat.ClipboardBehavior = { + window.Snapdrop.ClipboardBehavior = { copyToClipboard: function(content) { copyTextarea.value = content; var range = document.createRange(); diff --git a/app/elements/text-sharing/text-input-behavior.html b/app/elements/text-sharing/text-input-behavior.html @@ -1,12 +1,12 @@ <link rel="import" href="text-input-dialog.html"> <script> 'use strict'; -window.Chat = window.Chat || {}; +window.Snapdrop = window.Snapdrop || {}; (function() { var textInput = Polymer.Base.create('text-input-dialog'); textInput.className = 'textInput'; document.body.appendChild(textInput); - Chat.TextInputBehavior = { + Snapdrop.TextInputBehavior = { properties: { contact: Object, }, diff --git a/app/elements/text-sharing/text-input-dialog.html b/app/elements/text-sharing/text-input-dialog.html @@ -91,7 +91,7 @@ Polymer({ is: 'text-input-dialog', - behaviors: [Chat.ClipboardBehavior, Chat.SoundNotificationBehavior], + behaviors: [Snapdrop.ClipboardBehavior, Snapdrop.SoundNotificationBehavior], properties: { textToSend: { type: String