Skip to content

Commit d9add86

Browse files
committed
New asset files.
1 parent 4711f8e commit d9add86

22 files changed

+901
-846
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* jQuery File Upload Plugin Angular JS Example 1.2.1
3+
* https://github.com/blueimp/jQuery-File-Upload
4+
*
5+
* Copyright 2013, Sebastian Tschan
6+
* https://blueimp.net
7+
*
8+
* Licensed under the MIT license:
9+
* http://www.opensource.org/licenses/MIT
10+
*/
11+
12+
/*jslint nomen: true, regexp: true */
13+
/*global window, angular */
14+
15+
(function () {
16+
'use strict';
17+
18+
var isOnGitHub = window.location.hostname === 'blueimp.github.io',
19+
url = isOnGitHub ? '//jquery-file-upload.appspot.com/' : 'server/php/';
20+
21+
angular.module('demo', [
22+
'blueimp.fileupload'
23+
])
24+
.config([
25+
'$httpProvider', 'fileUploadProvider',
26+
function ($httpProvider, fileUploadProvider) {
27+
delete $httpProvider.defaults.headers.common['X-Requested-With'];
28+
fileUploadProvider.defaults.redirect = window.location.href.replace(
29+
/\/[^\/]*$/,
30+
'/cors/result.html?%s'
31+
);
32+
if (isOnGitHub) {
33+
// Demo settings:
34+
angular.extend(fileUploadProvider.defaults, {
35+
// Enable image resizing, except for Android and Opera,
36+
// which actually support image resizing, but fail to
37+
// send Blob objects via XHR requests:
38+
disableImageResize: /Android(?!.*Chrome)|Opera/
39+
.test(window.navigator.userAgent),
40+
maxFileSize: 5000000,
41+
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
42+
});
43+
}
44+
}
45+
])
46+
47+
.controller('DemoFileUploadController', [
48+
'$scope', '$http', '$filter', '$window',
49+
function ($scope, $http) {
50+
$scope.options = {
51+
url: url
52+
};
53+
if (!isOnGitHub) {
54+
$scope.loadingFiles = true;
55+
$http.get(url)
56+
.then(
57+
function (response) {
58+
$scope.loadingFiles = false;
59+
$scope.queue = response.data.files || [];
60+
},
61+
function () {
62+
$scope.loadingFiles = false;
63+
}
64+
);
65+
}
66+
}
67+
])
68+
69+
.controller('FileDestroyController', [
70+
'$scope', '$http',
71+
function ($scope, $http) {
72+
var file = $scope.file,
73+
state;
74+
if (file.url) {
75+
file.$state = function () {
76+
return state;
77+
};
78+
file.$destroy = function () {
79+
state = 'pending';
80+
return $http({
81+
url: file.deleteUrl,
82+
method: file.deleteType
83+
}).then(
84+
function () {
85+
state = 'resolved';
86+
$scope.clear(file);
87+
},
88+
function () {
89+
state = 'rejected';
90+
}
91+
);
92+
};
93+
} else if (!file.$cancel && !file._index) {
94+
file.$cancel = function () {
95+
$scope.clear(file);
96+
};
97+
}
98+
}
99+
]);
100+
101+
}());

vendor/assets/javascripts/jquery-fileupload/basic.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

vendor/assets/javascripts/jquery-fileupload/cors/jquery.postmessage-transport.js

100755100644
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery postMessage Transport Plugin 1.1
2+
* jQuery postMessage Transport Plugin 1.1.1
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2011, Sebastian Tschan
@@ -64,8 +64,9 @@
6464
xhrUpload = options.xhr().upload;
6565
return {
6666
send: function (_, completeCallback) {
67+
counter += 1;
6768
var message = {
68-
id: 'postmessage-transport-' + (counter += 1)
69+
id: 'postmessage-transport-' + counter
6970
},
7071
eventName = 'message.' + message.id;
7172
iframe = $(

vendor/assets/javascripts/jquery-fileupload/cors/jquery.xdr-transport.js

100755100644
File mode changed.

vendor/assets/javascripts/jquery-fileupload/index.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)