Skip to content

Commit

Permalink
fixes for meteor
Browse files Browse the repository at this point in the history
  • Loading branch information
Danial Farid authored and Danial Farid committed Dec 3, 2015
1 parent 7f208af commit 82708b1
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion demo/src/main/webapp/js/FileAPI.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions demo/src/main/webapp/js/ng-file-upload-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* progress, resize, thumbnail, preview, validation and CORS
* FileAPI Flash shim for old browsers not supporting FormData
* @author Danial <[email protected]>
* @version 10.1.5
* @version 10.1.6
*/

(function () {
Expand Down Expand Up @@ -421,7 +421,7 @@ if (!window.FileReader) {
* AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
* progress, resize, thumbnail, preview, validation and CORS
* @author Danial <[email protected]>
* @version 10.1.5
* @version 10.1.6
*/

if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {
Expand All @@ -442,13 +442,13 @@ if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {

var ngFileUpload = angular.module('ngFileUpload', []);

ngFileUpload.version = '10.1.5';
ngFileUpload.version = '10.1.6';

ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, $q, $timeout) {
var upload = this;

this.isResumeSupported = function () {
return window.Blob && (Blob instanceof Function) && new Blob().slice;
return window.Blob && (window.Blob instanceof Function) && new window.Blob().slice;
};

var resumeSupported = this.isResumeSupported();
Expand Down Expand Up @@ -602,7 +602,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,
if (val != null && !angular.isString(val)) {
val = JSON.stringify(val);
}
var blob = new Blob([val], {type: 'application/json'});
var blob = new window.Blob([val], {type: 'application/json'});
blob._ngfBlob = true;
return blob;
};
Expand All @@ -623,7 +623,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,

this.upload = function (config, internal) {
function isFile(file) {
return file != null && (file instanceof Blob || (file.flashId && file.name && file.size));
return file != null && (file instanceof window.Blob || (file.flashId && file.name && file.size));
}

function toResumeFile(file, formData) {
Expand Down Expand Up @@ -698,7 +698,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,
(angular.isArray(config.transformRequest) ?
config.transformRequest : [config.transformRequest]) : [];
config.transformRequest.push(function (data) {
var formData = new FormData(), key;
var formData = new window.FormData(), key;
data = data || config.fields || {};
if (config.file) {
data.file = config.file;
Expand Down Expand Up @@ -730,7 +730,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,
this.http = function (config) {
config = copy(config);
config.transformRequest = config.transformRequest || function (data) {
if ((window.ArrayBuffer && data instanceof window.ArrayBuffer) || data instanceof Blob) {
if ((window.ArrayBuffer && data instanceof window.ArrayBuffer) || data instanceof window.Blob) {
return data;
}
return $http.defaults.transformRequest[0].apply(this, arguments);
Expand Down Expand Up @@ -1946,7 +1946,7 @@ ngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadVa
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
var blob = new Blob([u8arr], {type: mime});
var blob = new window.Blob([u8arr], {type: mime});
blob.name = name;
return blob;
};
Expand All @@ -1958,7 +1958,7 @@ ngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadVa

if (upload.isResizeSupported()) {
// add name getter to the blob constructor prototype
Object.defineProperty(Blob.prototype, 'name', {
Object.defineProperty(window.Blob.prototype, 'name', {
get: function () {
return this.$ngfName;
},
Expand Down Expand Up @@ -2109,7 +2109,7 @@ ngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadVa
$http({url: url, method: 'get', responseType: 'arraybuffer'}).then(function (resp) {
var arrayBufferView = new Uint8Array(resp.data);
var type = resp.headers('content-type') || 'image/WebP';
var blob = new Blob([arrayBufferView], {type: type});
var blob = new window.Blob([arrayBufferView], {type: type});
//var split = type.split('[/;]');
//blob.name = url.substring(0, 150).replace(/\W+/g, '') + '.' + (split.length > 1 ? split[1] : 'jpg');
upload.updateModel(ngModel, attr, scope, attrGetter('ngfChange') || attrGetter('ngfDrop'), [blob], evt);
Expand Down
6 changes: 3 additions & 3 deletions demo/src/main/webapp/js/ng-file-upload-all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/src/main/webapp/js/ng-file-upload-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* progress, resize, thumbnail, preview, validation and CORS
* FileAPI Flash shim for old browsers not supporting FormData
* @author Danial <[email protected]>
* @version 10.1.5
* @version 10.1.6
*/

(function () {
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/webapp/js/ng-file-upload-shim.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions demo/src/main/webapp/js/ng-file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* AngularJS file upload directives and services. Supoorts: file upload/drop/paste, resume, cancel/abort,
* progress, resize, thumbnail, preview, validation and CORS
* @author Danial <[email protected]>
* @version 10.1.5
* @version 10.1.6
*/

if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {
Expand All @@ -23,13 +23,13 @@ if (window.XMLHttpRequest && !(window.FileAPI && FileAPI.shouldLoad)) {

var ngFileUpload = angular.module('ngFileUpload', []);

ngFileUpload.version = '10.1.5';
ngFileUpload.version = '10.1.6';

ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, $q, $timeout) {
var upload = this;

this.isResumeSupported = function () {
return window.Blob && (Blob instanceof Function) && new Blob().slice;
return window.Blob && (window.Blob instanceof Function) && new window.Blob().slice;
};

var resumeSupported = this.isResumeSupported();
Expand Down Expand Up @@ -183,7 +183,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,
if (val != null && !angular.isString(val)) {
val = JSON.stringify(val);
}
var blob = new Blob([val], {type: 'application/json'});
var blob = new window.Blob([val], {type: 'application/json'});
blob._ngfBlob = true;
return blob;
};
Expand All @@ -204,7 +204,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,

this.upload = function (config, internal) {
function isFile(file) {
return file != null && (file instanceof Blob || (file.flashId && file.name && file.size));
return file != null && (file instanceof window.Blob || (file.flashId && file.name && file.size));
}

function toResumeFile(file, formData) {
Expand Down Expand Up @@ -279,7 +279,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,
(angular.isArray(config.transformRequest) ?
config.transformRequest : [config.transformRequest]) : [];
config.transformRequest.push(function (data) {
var formData = new FormData(), key;
var formData = new window.FormData(), key;
data = data || config.fields || {};
if (config.file) {
data.file = config.file;
Expand Down Expand Up @@ -311,7 +311,7 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http,
this.http = function (config) {
config = copy(config);
config.transformRequest = config.transformRequest || function (data) {
if ((window.ArrayBuffer && data instanceof window.ArrayBuffer) || data instanceof Blob) {
if ((window.ArrayBuffer && data instanceof window.ArrayBuffer) || data instanceof window.Blob) {
return data;
}
return $http.defaults.transformRequest[0].apply(this, arguments);
Expand Down Expand Up @@ -1527,7 +1527,7 @@ ngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadVa
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
var blob = new Blob([u8arr], {type: mime});
var blob = new window.Blob([u8arr], {type: mime});
blob.name = name;
return blob;
};
Expand All @@ -1539,7 +1539,7 @@ ngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadVa

if (upload.isResizeSupported()) {
// add name getter to the blob constructor prototype
Object.defineProperty(Blob.prototype, 'name', {
Object.defineProperty(window.Blob.prototype, 'name', {
get: function () {
return this.$ngfName;
},
Expand Down Expand Up @@ -1690,7 +1690,7 @@ ngFileUpload.service('UploadResize', ['UploadValidate', '$q', function (UploadVa
$http({url: url, method: 'get', responseType: 'arraybuffer'}).then(function (resp) {
var arrayBufferView = new Uint8Array(resp.data);
var type = resp.headers('content-type') || 'image/WebP';
var blob = new Blob([arrayBufferView], {type: type});
var blob = new window.Blob([arrayBufferView], {type: type});
//var split = type.split('[/;]');
//blob.name = url.substring(0, 150).replace(/\W+/g, '') + '.' + (split.length > 1 ? split[1] : 'jpg');
upload.updateModel(ngModel, attr, scope, attrGetter('ngfChange') || attrGetter('ngfDrop'), [blob], evt);
Expand Down
4 changes: 2 additions & 2 deletions demo/src/main/webapp/js/ng-file-upload.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/FileAPI.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82708b1

Please sign in to comment.