Skip to content

Commit 28b46b9

Browse files
author
Philipp Alferov
committed
Move compiled scripts to to dist
1 parent 7cc9e55 commit 28b46b9

File tree

6 files changed

+65
-4
lines changed

6 files changed

+65
-4
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "angular-file-saver",
33
"version": "0.0.4",
44
"main": [
5-
"src/file-saver.js"
5+
"dist/angular-file-saver.js"
66
],
77
"authors": [
88
"Philipp Alferov <[email protected]>"

dist/angular-file-saver.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2+
/* angular-file-saver
3+
*
4+
* A AngularJS service that implements the HTML5 W3C saveAs() in browsers that
5+
* do not natively support it
6+
*
7+
* (c) 2015 Philipp Alferov
8+
* License: MIT
9+
*
10+
*/
11+
12+
(function() {
13+
'use strict';
14+
15+
angular
16+
.module('fileSaver', [])
17+
.factory('SaveAs', SaveAs);
18+
19+
function SaveAs() {
20+
21+
function isBlobInstance (data) {
22+
return data instanceof Blob;
23+
}
24+
25+
function save(blob, filename) {
26+
try {
27+
saveAs(blob, filename);
28+
} catch(err) {
29+
console.error(err.message);
30+
}
31+
}
32+
33+
return {
34+
35+
/**
36+
* saveFile - Immediately starts saving a file, returns undefined.
37+
*
38+
* @param {array|Blob} data Represented as an array or a Blob object
39+
* @param {string} filename
40+
* @param {object} options Set of Blob constructor options.
41+
* Optional parameter, if Blob object is passed as first argument
42+
* @return {undefined}
43+
*/
44+
45+
download: function (data, filename, options) {
46+
var blob;
47+
data = data instanceof Array ? data : [data];
48+
49+
if (isBlobInstance(data)) {
50+
save(data, filename);
51+
}
52+
53+
blob = new Blob(data, options);
54+
save(blob, filename);
55+
}
56+
};
57+
}
58+
59+
})();
60+
61+
},{}]},{},[1]);

dist/angular-file-saver.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var config = {
3333
fileSaver: {
3434
type: 'dragular',
3535
entryPoint: './src/file-saver.js',
36-
bundleName: 'file-saver.js',
36+
bundleName: 'angular-file-saver.js',
3737
dest: './dist',
3838
},
3939
docs: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/alferov/angular-file-saver.git"
88
},
99
"main": [
10-
"src/file-saver.js"
10+
"dist/angular-file-saver.js"
1111
],
1212
"keywords": [
1313
"filesaver",

src/file-saver.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)