Update FileSaver.js.

* update JSHint config options to match the current coding style
* use the important comment for the license header
This commit is contained in:
XhmikosR
2014-02-09 13:34:41 +02:00
parent 054378f822
commit 554f6cc11b
+17 -18
View File
@@ -1,15 +1,14 @@
/* FileSaver.js /*! FileSaver.js
* A saveAs() FileSaver implementation. * A saveAs() FileSaver implementation.
* 2014-01-24 * 2014-01-24
* *
* By Eli Grey, http://eligrey.com * By Eli Grey, http://eligrey.com
* License: X11/MIT * License: X11/MIT
* See LICENSE.md * See LICENSE.md
*/ */
/*global self */ /*global self */
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, /*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
plusplus: true */
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
@@ -31,7 +30,7 @@ var saveAs = saveAs
} }
, URL = view.URL || view.webkitURL || view , URL = view.URL || view.webkitURL || view
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a") , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
, can_use_save_link = !view.externalHost && "download" in save_link , can_use_save_link = !view.externalHost && "download" in save_link
, click = function(node) { , click = function(node) {
var event = doc.createEvent("MouseEvents"); var event = doc.createEvent("MouseEvents");
event.initMouseEvent( event.initMouseEvent(
@@ -42,7 +41,7 @@ var saveAs = saveAs
} }
, webkit_req_fs = view.webkitRequestFileSystem , webkit_req_fs = view.webkitRequestFileSystem
, req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
, throw_outside = function (ex) { , throw_outside = function(ex) {
(view.setImmediate || view.setTimeout)(function() { (view.setImmediate || view.setTimeout)(function() {
throw ex; throw ex;
}, 0); }, 0);
@@ -101,8 +100,8 @@ var saveAs = saveAs
if (target_view) { if (target_view) {
target_view.location.href = object_url; target_view.location.href = object_url;
} else { } else {
window.open(object_url, "_blank"); window.open(object_url, "_blank");
} }
filesaver.readyState = filesaver.DONE; filesaver.readyState = filesaver.DONE;
dispatch_all(); dispatch_all();
} }
@@ -220,12 +219,12 @@ var saveAs = saveAs
FS_proto.DONE = 2; FS_proto.DONE = 2;
FS_proto.error = FS_proto.error =
FS_proto.onwritestart = FS_proto.onwritestart =
FS_proto.onprogress = FS_proto.onprogress =
FS_proto.onwrite = FS_proto.onwrite =
FS_proto.onabort = FS_proto.onabort =
FS_proto.onerror = FS_proto.onerror =
FS_proto.onwriteend = FS_proto.onwriteend =
null; null;
view.addEventListener("unload", process_deletion_queue, false); view.addEventListener("unload", process_deletion_queue, false);