Skip to content

Commit 554f6cc

Browse files
committed
Update FileSaver.js.
* update JSHint config options to match the current coding style * use the important comment for the license header
1 parent 054378f commit 554f6cc

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

FileSaver.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
/* FileSaver.js
2-
* A saveAs() FileSaver implementation.
3-
* 2014-01-24
1+
/*! FileSaver.js
2+
* A saveAs() FileSaver implementation.
3+
* 2014-01-24
44
*
5-
* By Eli Grey, http://eligrey.com
6-
* License: X11/MIT
7-
* See LICENSE.md
5+
* By Eli Grey, http://eligrey.com
6+
* License: X11/MIT
7+
* See LICENSE.md
88
*/
99

1010
/*global self */
11-
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
12-
plusplus: true */
11+
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
1312

1413
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
1514

@@ -31,7 +30,7 @@ var saveAs = saveAs
3130
}
3231
, URL = view.URL || view.webkitURL || view
3332
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
34-
, can_use_save_link = !view.externalHost && "download" in save_link
33+
, can_use_save_link = !view.externalHost && "download" in save_link
3534
, click = function(node) {
3635
var event = doc.createEvent("MouseEvents");
3736
event.initMouseEvent(
@@ -42,7 +41,7 @@ var saveAs = saveAs
4241
}
4342
, webkit_req_fs = view.webkitRequestFileSystem
4443
, req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
45-
, throw_outside = function (ex) {
44+
, throw_outside = function(ex) {
4645
(view.setImmediate || view.setTimeout)(function() {
4746
throw ex;
4847
}, 0);
@@ -101,8 +100,8 @@ var saveAs = saveAs
101100
if (target_view) {
102101
target_view.location.href = object_url;
103102
} else {
104-
window.open(object_url, "_blank");
105-
}
103+
window.open(object_url, "_blank");
104+
}
106105
filesaver.readyState = filesaver.DONE;
107106
dispatch_all();
108107
}
@@ -220,12 +219,12 @@ var saveAs = saveAs
220219
FS_proto.DONE = 2;
221220

222221
FS_proto.error =
223-
FS_proto.onwritestart =
224-
FS_proto.onprogress =
225-
FS_proto.onwrite =
226-
FS_proto.onabort =
227-
FS_proto.onerror =
228-
FS_proto.onwriteend =
222+
FS_proto.onwritestart =
223+
FS_proto.onprogress =
224+
FS_proto.onwrite =
225+
FS_proto.onabort =
226+
FS_proto.onerror =
227+
FS_proto.onwriteend =
229228
null;
230229

231230
view.addEventListener("unload", process_deletion_queue, false);

0 commit comments

Comments
 (0)