Cleanup unused files

This commit is contained in:
Robin Linus 2016-06-22 14:10:27 -06:00
parent aa9e9497d6
commit c962909c0e
33 changed files with 5 additions and 1206 deletions

View file

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

View file

@ -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) {

View file

@ -3,9 +3,7 @@
<link rel="import" href="../bower_components/paper-toast/paper-toast.html">
<link rel="import" href="../bower_components/paper-progress/paper-progress.html">
<link rel="import" href="../bower_components/neon-animation/neon-animated-pages.html">
<!-- Configure your routes here
<link rel="import" href="routing.html">
-->
<!-- Add your elements here -->
<link rel="import" href="../styles/app-theme.html">
<link rel="import" href="x-cards/about-page.html">

View file

@ -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) {

View file

@ -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) {

View file

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

View file

@ -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

View file

@ -1,38 +0,0 @@
<script src="../bower_components/page/page.js"></script>
<script>
window.addEventListener('WebComponentsReady', function() {
// We use Page.js for routing. This is a Micro
// client-side router inspired by the Express router
// More info: https://visionmedia.github.io/page.js/
// Removes end / from app.baseUrl which page.base requires for production
if (window.location.port === '') { // if production
page.base(app.baseUrl.replace(/\/$/, ''));
}
page('/', function() {
app.route = 'home';
});
page(app.baseUrl, function() {
app.route = 'home';
});
// 404
page('*', function() {
app.$.toast.text = 'Can\'t find: ' + window.location.href + '. Redirected you to Home Page';
app.$.toast.show();
page.redirect(app.baseUrl);
});
// add #! before urls
page({
hashbang: true
});
});
</script>

View file

@ -1,47 +0,0 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<title>paper-dialog demo</title>
<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../text-input-dialog.html">
<link rel="import" href="../../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../../../bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html">
<link rel="import" href="../../../bower_components/paper-styles/color.html">
<link rel="import" href="../../../bower_components/paper-styles/demo-pages.html">
<link rel="import" href="../../../bower_components/neon-animation/neon-animations.html">
<link rel="import" href="../../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="../../../bower_components/paper-menu/paper-menu.html">
<link rel="import" href="../../../bower_components/paper-item/paper-item.html">
<link rel="stylesheet" href="../../../paper-styles/demo.css">
</head>
<body>
<text-input-dialog></text-input-dialog>
<script>
document.querySelector("text-input-dialog").open();
</script>
</body>
</html>

View file

@ -13,12 +13,6 @@
background-color: #4285f4;
@apply(--layout-fit);
}
/* paper-icon-button {
position: absolute;
top: 16px;
right: 16px;
z-index: 2;
}*/
#container {
@apply(--layout-fit);