diff options
Diffstat (limited to 'js/cheesesteak.js')
| -rw-r--r-- | js/cheesesteak.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/js/cheesesteak.js b/js/cheesesteak.js index e090a12..ee357f1 100644 --- a/js/cheesesteak.js +++ b/js/cheesesteak.js @@ -23,7 +23,7 @@ /* jshint browser:true, jquery:true */ (function() { // Lightweight EventEmitter implementation - EventEmitter = function() {}; + var EventEmitter = function() {}; EventEmitter.prototype.on = function(evt, fn) { this._events = this._events || {}; @@ -64,18 +64,18 @@ return this.reduce(function(prev, curr) { return prev + curr.size; }, 0); - } + }, }); // Utility to convert bytes into human units var humanSize = { get: function humanSize() { var units = [ - 'B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB' + 'B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB', ]; var e = Math.floor(Math.log(this.size) / Math.log(1024)); return (this.size / Math.pow(1024, e)).toFixed(2) + ' ' + units[e]; - } + }, }; Object.defineProperty(FileList.prototype, 'humanSize', humanSize); Object.defineProperty(File.prototype, 'humanSize', humanSize); @@ -83,7 +83,7 @@ var percentUploaded = { get: function percentUploaded() { return this.uploadedSize / this.size; - } + }, }; Object.defineProperty(FileList.prototype, 'percentUploaded', percentUploaded); @@ -94,14 +94,14 @@ return this.reduce(function(prev, curr) { return prev + (curr.uploadedSize || 0); }, 0); - } + }, }); // Object URL stuff Object.defineProperty(File.prototype, 'url', { get: function getURL() { return window.URL.createObjectURL(this); - } + }, }); File.revokeURL = function revokeURL(url) { window.URL.revokeObjectURL(url); @@ -125,13 +125,13 @@ this.url = url; this.files = files; - opts = opts || {}; + var request = opts || {}; this.opts = merge({ field: 'files[]', method: 'POST', - data: {} - }, opts); + data: {}, + }, request); }; FileListUploader.prototype = Object.create(EventEmitter.prototype); @@ -162,7 +162,7 @@ function updateProgressBar(e) { if (e.lengthComputable) { - size = e.loaded; + var size = e.loaded; /** * We know the size of the files, the order they're in, and how |
