summaryrefslogtreecommitdiff
path: root/js/cheesesteak.js
diff options
context:
space:
mode:
authorJuuso Lapinlampi <wub@partyvan.eu>2015-09-27 21:34:56 +0200
committerJuuso Lapinlampi <wub@partyvan.eu>2015-09-27 21:34:56 +0200
commitcd23640ded6a29071d5b46a6594efa3ad5ac7c2b (patch)
tree487c06fbb0cb8f3026460141412a1aac280a134d /js/cheesesteak.js
parentf1c92f57d6a5ae01b8c67bf3f6d1189f41537339 (diff)
Fix cheesesteak.js comments to follow Airbnb style
Airbnb says to use /** ... */ for multiline comments and // for single line comments. Fixes JSCS requirePaddingNewLinesBeforeLineComments and validateIndentation warnings using Airbnb preset.
Diffstat (limited to 'js/cheesesteak.js')
-rw-r--r--js/cheesesteak.js25
1 files changed, 15 insertions, 10 deletions
diff --git a/js/cheesesteak.js b/js/cheesesteak.js
index 6cdeb77..a8b0d02 100644
--- a/js/cheesesteak.js
+++ b/js/cheesesteak.js
@@ -22,7 +22,7 @@
/* jshint browser:true, jquery:true */
(function() {
- /* Lightweight EventEmitter implementation */
+ // Lightweight EventEmitter implementation
EventEmitter = function() {};
EventEmitter.prototype.on = function(evt, fn) {
@@ -50,7 +50,7 @@
}
};
- /* Copy the stuff from Array to FileList */
+ // Copy the stuff from Array to FileList
FileList.prototype.forEach = Array.prototype.forEach;
FileList.prototype.every = Array.prototype.every;
FileList.prototype.some = Array.prototype.some;
@@ -67,7 +67,7 @@
}
});
- /* Utility to convert bytes into human units */
+ // Utility to convert bytes into human units
var humanSize = {
get: function humanSize() {
var units = [
@@ -97,7 +97,7 @@
}
});
- /* Object URL stuff */
+ // Object URL stuff
Object.defineProperty(File.prototype, 'url', {
get: function getURL() {
return window.URL.createObjectURL(this);
@@ -161,11 +161,15 @@
xhr.upload.addEventListener('progress', function(e) {
if (e.lengthComputable) {
size = e.loaded;
- // We know the size of the files, the order they're in, and how
- // much we've uploaded. Based on this data, we can do some magic
- // to figure out which file we're on, and how much we've uploaded
- // of that file.
- // TODO: This math has trouble on later uploads. Leak somewhere
+
+ /**
+ * We know the size of the files, the order they're in, and how
+ * much we've uploaded. Based on this data, we can do some magic
+ * to figure out which file we're on, and how much we've uploaded
+ * of that file.
+ */
+
+ // TODO: This math has trouble on later uploads. Leak somewhere.
for (var i = 0, l = files.length; i < l; i++) {
files[i].uploadedSize = Math.min(size, files[i].size);
size -= files[i].uploadedSize;
@@ -196,7 +200,8 @@
});
xhr.send(data);
- /* TODO: Add more event passthroughs, maybe abstract it into a helper? */
+
+ // TODO: Add more event passthroughs, maybe abstract it into a helper?
};
FileList.prototype.upload = function uploadFileList(url, opts) {