diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b28f7f1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: node_js -sudo: false -addons: - firefox: latest - apt: - sources: - - google-chrome - - ubuntu-toolchain-r-test - packages: - - google-chrome-stable - - g++-4.8 -node_js: - - '4.2' - - '5.1' -before_script: - - 'export DISPLAY=:99.0' - - sh -e /etc/init.d/xvfb start - - sleep 3 - - npm i -g bower gulp - - bower i -script: - - ./travis-runner.sh -env: - global: - - "CXX='g++-4.8'" - - secure: SbcQ7plU7aRGQlaAG2ffMhSvEs84073YSljOQ62DZAjRxgizMhF4xM7H2mPrmac9YRM4IBrQRvBKMMZy3L6OhN8gwpm8o+w2zV+5Q1fwpY9V8bilznnhp1JUY6jrB2l7aLTOFxt/cG+5ABxiupwWz/n+I7BaByYhBiHWntIBgDc528eecRNDYI5R36KWjLO/yr+SdElvyxDlDOdJGaluPvgMItbinFGcE1hYb/Jqrkkw8zpE6CTDmvMOq1aRBWSo9afgh2zDeKc02lTYP/4N0xcn8CqzHF7k5zGWHjN9DR8Ep8Bp1ff/sM7zHGZBqgVhn5WGv305jBQY6eOxiTp5cDP0WVIOjgJeM5rBu9hBQxhZSaMKBPr2B1NYUjIwTVQkBsnR4sr095Ugjg8JCZAmEevf/Ysl4CzQyW3gT+WcEluqjxUuicQWDclH6L/kOVPBJ+Eqdo/LY3G1tpLcc6fsvj4FlVO6LPTrbMyCagwQvnjX3uIdFyuthqtWWrHKQMGx2Ow9suNUi8Hyvk7WboS1Z6jrLIcs1rvXSX8rQmlMR5vJBK3Ejg6fS1OHxn/lrtLhj4lDLB9r/Fcu2PEHT1lcvQqsTa3W+t4Fk1qaShUlBDiwMbZWZgmlf1SdG5OzK1yrPLjTTdRFdqJGgb6TANCdetgczRWynvjIhr5IDMxvfJg= diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 7b10141..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,72 +0,0 @@ - - -# Polymer Elements -## Guide for Contributors - -Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines: - -### Filing Issues - -**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions: - - 1. **Who will use the feature?** _“As someone filling out a form…”_ - 2. **When will they use the feature?** _“When I enter an invalid value…”_ - 3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_ - -**If you are filing an issue to report a bug**, please provide: - - 1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug: - - ```markdown - The `paper-foo` element causes the page to turn pink when clicked. - - ## Expected outcome - - The page stays the same color. - - ## Actual outcome - - The page turns pink. - - ## Steps to reproduce - - 1. Put a `paper-foo` element in the page. - 2. Open the page in a web browser. - 3. Click the `paper-foo` element. - ``` - - 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output). - - 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. - -### Submitting Pull Requests - -**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request. - -When submitting pull requests, please provide: - - 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax: - - ```markdown - (For a single issue) - Fixes #20 - - (For multiple issues) - Fixes #32, #40 - ``` - - 2. **A succinct description of the design** used to fix any related issues. For example: - - ```markdown - This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked. - ``` - - 3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered. - -If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that! diff --git a/LICENSE.md b/LICENSE.md index bb3f440..e33fcf6 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -2,7 +2,7 @@ Everything in this repo is BSD style license unless otherwise specified. -Copyright (c) 2015 The Polymer Authors. All rights reserved. +Copyright (c) 2015 Robin Linus. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/app/elements/buddy-finder/buddy-avatar.html b/app/elements/buddy-finder/buddy-avatar.html index ab7f310..5c968c0 100644 --- a/app/elements/buddy-finder/buddy-avatar.html +++ b/app/elements/buddy-finder/buddy-avatar.html @@ -127,50 +127,39 @@ return status; }, attached: function() { - // var adsDialog = document.querySelector('#ads'); this.async(function() { app.conn.addEventListener('file-offered', function(e) { if (e.detail.to === this.contact.peerId) { this.status = 'Waiting to accept...'; - //adsDialog.open(); } }.bind(this), false); app.conn.addEventListener('upload-started', function(e) { if (e.detail.to === this.contact.peerId) { this.status = 'Uploading...'; - // adsDialog.setState('Uploading...'); } }.bind(this), false); app.conn.addEventListener('download-started', function(e) { if (e.detail.from === this.contact.peerId) { this.status = 'Downloading...'; - //adsDialog.open(); - // adsDialog.setState('Downloading...'); } }.bind(this), false); app.conn.addEventListener('upload-complete', function(e) { if (e.detail.from === this.contact.peerId) { this.status = this.defaultStatus; - adsDialog.setState('Transfer Complete'); - // adsDialog.close(); } }.bind(this), false); app.conn.addEventListener('download-complete', function(e) { if (e.detail.from === this.contact.peerId) { this.status = this.defaultStatus; - adsDialog.setState('Transfer Complete'); - // adsDialog.close(); } }.bind(this), false); app.conn.addEventListener('file-declined', function(e) { if (e.detail.from === this.contact.peerId) { this.status = this.defaultStatus; - // adsDialog.close(true); } }.bind(this), false); app.conn.addEventListener('upload-error', function(e) { this.status = this.defaultStatus; - // adsDialog.close(); }.bind(this), false); }, 200); } diff --git a/app/elements/buddy-finder/buddy-finder.html b/app/elements/buddy-finder/buddy-finder.html index 2701f73..455f533 100644 --- a/app/elements/buddy-finder/buddy-finder.html +++ b/app/elements/buddy-finder/buddy-finder.html @@ -167,7 +167,6 @@ var peerId = e.model.item.peerId; var file = e.detail; app.conn.sendFile(peerId, file); - //document.querySelector('#ads').open(); }, _computeShowExplanation: function(nBuddies) { if (!nBuddies || nBuddies === 0) { diff --git a/app/elements/elements.html b/app/elements/elements.html index d0c57b1..1a74c44 100644 --- a/app/elements/elements.html +++ b/app/elements/elements.html @@ -3,9 +3,7 @@ - + diff --git a/app/elements/file-sharing/file-selection-behavior.html b/app/elements/file-sharing/file-selection-behavior.html index 7f3167d..3641d55 100644 --- a/app/elements/file-sharing/file-selection-behavior.html +++ b/app/elements/file-sharing/file-selection-behavior.html @@ -8,7 +8,6 @@ Chat.FileSelectionBehavior = { return; } this._fileSelected(files[0]); //single select - //files.forEach(this._fileSelected.bind(this)); //multi-select }, _fileSelected: function(file) { if (file) { diff --git a/app/elements/p2p-network/binaryjs.html b/app/elements/p2p-network/binaryjs.html index 8dbd0c8..7d9160f 100644 --- a/app/elements/p2p-network/binaryjs.html +++ b/app/elements/p2p-network/binaryjs.html @@ -982,234 +982,7 @@ BlobReadStream.prototype._emitReadChunk = function(){ }; -/* - - - -function BlobWriteStream(options){ - - stream.Stream.call(this); - - options = _.extend({ - onFull: onFull, - onEnd: function(){}, - minBlockAllocSize: 0, - drainDelay:0 - }, options); - - this._onFull = options.onFull; - this._onEnd = options.onEnd; - this._onWrite = options.onWrite; - - this._minBlockAllocSize = options.minBlockAllocSize; - this._maxBlockAllocSize = options.maxBlockAllocSize; - this._drainDelay = options.drainDelay; - - this._buffer = new Buffer(options.minBlockAllocSize); - this._destination = this._buffer; - this._destinationPos = 0; - - this._writeQueue = []; - this._pendingOnFull = false; - this._pendingQueueDrain = false; - - this.writable = true; - this.bytesWritten = 0; -} - -util.inherits(BlobWriteStream, stream.Stream); - -BlobWriteStream.prototype.getBuffer = function(){ - return this._buffer; -}; - -BlobWriteStream.prototype.write = function(data, encoding){ - - if(!this.writable){ - throw new Error("stream is not writable"); - } - - if(!Buffer.isBuffer(data)){ - data = new Buffer(data, encoding); - } - - if(data.length){ - this._writeQueue.push(data); - } - - this._commit(); - - return this._writeQueue.length === 0; -}; - -BlobWriteStream.prototype._commit = function(){ - - var self = this; - - var destination = this._destination; - var writeQueue = this._writeQueue; - - var startDestinationPos = this._destinationPos; - - while(writeQueue.length && destination.length){ - - var head = writeQueue[0]; - - var copySize = Math.min(destination.length, head.length); - - head.copy(destination, 0, 0, copySize); - - head = head.slice(copySize); - destination = destination.slice(copySize); - - this.bytesWritten += copySize; - this._destinationPos += copySize; - - if(head.length === 0){ - writeQueue.shift(); - } - else{ - writeQueue[0] = head; - } - } - - this._destination = destination; - - bytesCommitted = this._destinationPos - startDestinationPos; - if(bytesCommitted){ - if(this._onWrite){ - - if(writeQueue.length){ - this._pendingQueueDrain = true; - } - - // By locking destination the buffer is frozen and the onWrite - // callback cannot miss any write commits - this._destination = emptyBuffer; - - var consumer = this._onWrite; - this._onWrite = null; - - consumer.call(this, function(nextCallback){ - util.setZeroTimeout(function(){ - self._destination = destination; - self._onWrite = nextCallback; - self._commit(); - }); - }, consumer); - - return; - } - } - - if(writeQueue.length){ - - this._pendingQueueDrain = true; - this._growBuffer(); - } - else if(this._pendingQueueDrain){ - - this._pendingQueueDrain = false; - - if(this._drainDelay !== 0){ - setTimeout(function(){ - self.emit("drain"); - }, this._drainDelay); - } - else{ - util.setZeroTimeout(function(){ - self.emit("drain"); - }); - } - } -}; - -BlobWriteStream.prototype._growBuffer = function(){ - - var self = this; - var writeQueue = this._writeQueue; - - var requestSize = this._minBlockAllocSize; - - var maxBlockAllocSize = this._maxBlockAllocSize; - var add = (maxBlockAllocSize === undefined ? function(a, b){return a + b;} : function(a, b){return Math.min(a + b, maxBlockAllocSize);}); - - for(var i = 0, queueLength = writeQueue.length; i < queueLength; i++){ - requestSize = add(requestSize, writeQueue[i].length); - } - - // Prevent concurrent onFull callbacks - if(this._pendingOnFull){ - return; - } - this._pendingOnFull = true; - - this._onFull(this._buffer, requestSize, function(buffer, destination){ - util.setZeroTimeout(function(){ - - self._pendingOnFull = false; - - if(!destination){ - if(self.writable){ - self.emit("error", new Error("buffer is full")); - } - self.destroy(); - return; - } - - self._buffer = buffer; - self._destination = destination; - - self._commit(); - }); - }); -}; - -BlobWriteStream.prototype.end = function(data, encoding){ - - var self = this; - - function _end(){ - self.writable = false; - self._onEnd(); - } - - if(data){ - if(this.write(data, encoding)){ - _end(); - }else{ - self.writable = false; - this.once("drain", _end); - } - } - else{ - _end(); - } -}; - -BlobWriteStream.prototype.destroy = function(){ - this.writable = false; - this._pendingQueueDrain = false; - this._writeQueue = []; -}; - -BlobWriteStream.prototype.consume = function(consume){ - - this._buffer = this._buffer.slice(consume); - this._destinationPos -= consume; -}; - -BlobWriteStream.prototype.getCommittedSlice = function(){ - return this._buffer.slice(0, this._destinationPos); -}; - -function onFull(buffer, extraSize, callback){ - var newBuffer = new Buffer(buffer.length + extraSize); - buffer.copy(newBuffer); - callback(newBuffer, newBuffer.slice(buffer.length)); -} -*/ exports.BlobReadStream = BlobReadStream; function BinaryStream(socket, id, create, meta) { diff --git a/app/elements/p2p-network/p2p-network.html b/app/elements/p2p-network/p2p-network.html index 2235917..0cfea0f 100644 --- a/app/elements/p2p-network/p2p-network.html +++ b/app/elements/p2p-network/p2p-network.html @@ -109,7 +109,6 @@ console.log(err); if (err.message.indexOf('Connection is not open') > -1) { console.error('Handle this error!!', err); - //this.connectToPeer(requestedPeer, callback); } }.bind(this)); diff --git a/app/elements/p2p-network/web-socket.html b/app/elements/p2p-network/web-socket.html index 3471796..5e76e16 100644 --- a/app/elements/p2p-network/web-socket.html +++ b/app/elements/p2p-network/web-socket.html @@ -33,7 +33,6 @@ parts.push(data); } }.bind(this)); - // when finished, set it as the background image stream.on('end', function() { var blob = new Blob(parts, { type: meta.type diff --git a/app/elements/routing.html b/app/elements/routing.html deleted file mode 100644 index 73936f3..0000000 --- a/app/elements/routing.html +++ /dev/null @@ -1,38 +0,0 @@ - - diff --git a/app/elements/text-sharing/demo/index.html b/app/elements/text-sharing/demo/index.html deleted file mode 100644 index dd6a607..0000000 --- a/app/elements/text-sharing/demo/index.html +++ /dev/null @@ -1,47 +0,0 @@ - - - -
- - - - - -