card-mod-script 0.13.3 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/script/decko/components.js.coffee +3 -0
- data/assets/script/decko/decko.js.coffee +0 -15
- data/assets/script/decko/editor.js.coffee +3 -1
- data/assets/script/decko/filter.js.coffee +13 -6
- data/assets/script/decko/mod.js.coffee +2 -8
- data/assets/script/{script_pointer_config.js.coffee → decko/pointer_config.js.coffee} +1 -2
- data/assets/script/{script_pointer_list_editor.js.coffee → decko/pointer_list_editor.js.coffee} +0 -0
- data/assets/script/decko/slot.js.coffee +2 -2
- data/assets/script/decko/slot_ready.js.coffee +1 -0
- data/assets/script/decko/slotter.js.coffee +23 -31
- data/assets/script/decko/type_editor.js.coffee +21 -0
- data/assets/script/decko/upload.js.coffee +12 -5
- data/assets/script/manifest.yml +15 -2
- data/set/abstract/00_script.rb +30 -31
- data/set/abstract/01_asset_script.rb +0 -16
- data/set/abstract/{script_asset_list.rb → script_group.rb} +12 -13
- data/set/all/head_javascript.rb +4 -5
- data/set/right/script.rb +1 -14
- data/set/type/local_script_folder_group.rb +2 -2
- data/set/type/local_script_manifest_group.rb +1 -1
- data/set/type_plus_right/mod/script.rb +56 -0
- data/set/type_plus_right/set/script.rb +7 -0
- data/vendor/jquery_file_upload/LICENSE.txt +11 -12
- data/vendor/jquery_file_upload/README.md +189 -72
- data/vendor/jquery_file_upload/SECURITY.md +227 -0
- data/vendor/jquery_file_upload/VULNERABILITIES.md +118 -0
- data/vendor/jquery_file_upload/cors/postmessage.html +68 -58
- data/vendor/jquery_file_upload/cors/result.html +12 -10
- data/vendor/jquery_file_upload/css/jquery.fileupload-ui.css +24 -13
- data/vendor/jquery_file_upload/css/jquery.fileupload.css +3 -4
- data/vendor/jquery_file_upload/docker-compose.yml +55 -0
- data/vendor/jquery_file_upload/index.html +332 -230
- data/vendor/jquery_file_upload/js/cors/jquery.postmessage-transport.js +109 -109
- data/vendor/jquery_file_upload/js/cors/jquery.xdr-transport.js +81 -73
- data/vendor/jquery_file_upload/js/demo.js +75 -0
- data/vendor/jquery_file_upload/js/jquery.fileupload-audio.js +82 -94
- data/vendor/jquery_file_upload/js/jquery.fileupload-image.js +321 -300
- data/vendor/jquery_file_upload/js/jquery.fileupload-process.js +138 -146
- data/vendor/jquery_file_upload/js/jquery.fileupload-ui.js +737 -692
- data/vendor/jquery_file_upload/js/jquery.fileupload-validate.js +91 -97
- data/vendor/jquery_file_upload/js/jquery.fileupload-video.js +82 -94
- data/vendor/jquery_file_upload/js/jquery.fileupload.js +1569 -1451
- data/vendor/jquery_file_upload/js/jquery.iframe-transport.js +208 -205
- data/vendor/jquery_file_upload/js/vendor/jquery.ui.widget.js +397 -340
- data/vendor/jquery_file_upload/package-lock.json +6853 -0
- data/vendor/jquery_file_upload/package.json +71 -10
- data/vendor/jquery_file_upload/server/gae-python/app.yaml +11 -10
- data/vendor/jquery_file_upload/server/php/Dockerfile +23 -17
- data/vendor/jquery_file_upload/server/php/UploadHandler.php +206 -137
- data/vendor/jquery_file_upload/server/php/php.ini +5 -0
- data/vendor/jquery_file_upload/test/index.html +36 -159
- data/vendor/jquery_file_upload/test/unit.js +989 -0
- data/vendor/jquery_file_upload/test/vendor/chai.js +10854 -0
- data/vendor/jquery_file_upload/test/vendor/mocha.css +325 -0
- data/vendor/jquery_file_upload/test/vendor/mocha.js +18178 -0
- data/vendor/jquery_file_upload/wdio/LICENSE.txt +20 -0
- data/vendor/jquery_file_upload/wdio/assets/black+white-3x2.jpg +0 -0
- data/vendor/jquery_file_upload/wdio/assets/black+white-60x40.gif +0 -0
- data/vendor/jquery_file_upload/wdio/conf/chrome.js +40 -0
- data/vendor/jquery_file_upload/wdio/conf/firefox.js +25 -0
- data/vendor/jquery_file_upload/wdio/hooks/index.js +36 -0
- data/vendor/jquery_file_upload/wdio/test/pages/file-upload.js +79 -0
- data/vendor/jquery_file_upload/wdio/test/specs/01-file-upload.js +25 -0
- data/vendor/jquery_file_upload/wdio/wdio.conf.js +4 -0
- metadata +34 -52
- data/file/mod_script_script_decko_machine_output/file.js +0 -2685
- data/file/mod_script_script_jquery_machine_output/file.js +0 -12924
- data/lib/javascript/script_html5shiv_printshiv.js +0 -1
- data/set/self/script_html5shiv_printshiv.rb +0 -11
- data/set/self/script_mods.rb +0 -1
- data/set/type/mod_script_assets.rb +0 -21
- data/vendor/jquery_file_upload/CONTRIBUTING.md +0 -15
- data/vendor/jquery_file_upload/angularjs.html +0 -211
- data/vendor/jquery_file_upload/basic-plus.html +0 -226
- data/vendor/jquery_file_upload/basic.html +0 -136
- data/vendor/jquery_file_upload/bower-version-update.js +0 -16
- data/vendor/jquery_file_upload/bower.json +0 -64
- data/vendor/jquery_file_upload/css/jquery-ui-demo-ie8.css +0 -21
- data/vendor/jquery_file_upload/css/jquery-ui-demo.css +0 -67
- data/vendor/jquery_file_upload/css/style.css +0 -15
- data/vendor/jquery_file_upload/jquery-ui.html +0 -252
- data/vendor/jquery_file_upload/js/app.js +0 -101
- data/vendor/jquery_file_upload/js/jquery.fileupload-angular.js +0 -437
- data/vendor/jquery_file_upload/js/jquery.fileupload-jquery-ui.js +0 -161
- data/vendor/jquery_file_upload/js/main.js +0 -75
- data/vendor/jquery_file_upload/server/gae-go/app/main.go +0 -361
- data/vendor/jquery_file_upload/server/gae-go/app.yaml +0 -12
- data/vendor/jquery_file_upload/server/gae-go/static/favicon.ico +0 -0
- data/vendor/jquery_file_upload/server/gae-go/static/robots.txt +0 -2
- data/vendor/jquery_file_upload/server/php/docker-compose.yml +0 -9
- data/vendor/jquery_file_upload/test/test.js +0 -1292
@@ -1,437 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery File Upload AngularJS Plugin
|
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
|
-
* https://opensource.org/licenses/MIT
|
10
|
-
*/
|
11
|
-
|
12
|
-
/* jshint nomen:false */
|
13
|
-
/* global define, angular, require */
|
14
|
-
|
15
|
-
;(function (factory) {
|
16
|
-
'use strict';
|
17
|
-
if (typeof define === 'function' && define.amd) {
|
18
|
-
// Register as an anonymous AMD module:
|
19
|
-
define([
|
20
|
-
'jquery',
|
21
|
-
'angular',
|
22
|
-
'./jquery.fileupload-image',
|
23
|
-
'./jquery.fileupload-audio',
|
24
|
-
'./jquery.fileupload-video',
|
25
|
-
'./jquery.fileupload-validate'
|
26
|
-
], factory);
|
27
|
-
} else if (typeof exports === 'object') {
|
28
|
-
// Node/CommonJS:
|
29
|
-
factory(
|
30
|
-
require('jquery'),
|
31
|
-
require('angular'),
|
32
|
-
require('./jquery.fileupload-image'),
|
33
|
-
require('./jquery.fileupload-audio'),
|
34
|
-
require('./jquery.fileupload-video'),
|
35
|
-
require('./jquery.fileupload-validate')
|
36
|
-
);
|
37
|
-
} else {
|
38
|
-
factory();
|
39
|
-
}
|
40
|
-
}(function () {
|
41
|
-
'use strict';
|
42
|
-
|
43
|
-
angular.module('blueimp.fileupload', [])
|
44
|
-
|
45
|
-
// The fileUpload service provides configuration options
|
46
|
-
// for the fileUpload directive and default handlers for
|
47
|
-
// File Upload events:
|
48
|
-
.provider('fileUpload', function () {
|
49
|
-
var scopeEvalAsync = function (expression) {
|
50
|
-
var scope = angular.element(this)
|
51
|
-
.fileupload('option', 'scope');
|
52
|
-
// Schedule a new $digest cycle if not already inside of one
|
53
|
-
// and evaluate the given expression:
|
54
|
-
scope.$evalAsync(expression);
|
55
|
-
},
|
56
|
-
addFileMethods = function (scope, data) {
|
57
|
-
var files = data.files,
|
58
|
-
file = files[0];
|
59
|
-
angular.forEach(files, function (file, index) {
|
60
|
-
file._index = index;
|
61
|
-
file.$state = function () {
|
62
|
-
return data.state();
|
63
|
-
};
|
64
|
-
file.$processing = function () {
|
65
|
-
return data.processing();
|
66
|
-
};
|
67
|
-
file.$progress = function () {
|
68
|
-
return data.progress();
|
69
|
-
};
|
70
|
-
file.$response = function () {
|
71
|
-
return data.response();
|
72
|
-
};
|
73
|
-
});
|
74
|
-
file.$submit = function () {
|
75
|
-
if (!file.error) {
|
76
|
-
return data.submit();
|
77
|
-
}
|
78
|
-
};
|
79
|
-
file.$cancel = function () {
|
80
|
-
return data.abort();
|
81
|
-
};
|
82
|
-
},
|
83
|
-
$config;
|
84
|
-
$config = this.defaults = {
|
85
|
-
handleResponse: function (e, data) {
|
86
|
-
var files = data.result && data.result.files;
|
87
|
-
if (files) {
|
88
|
-
data.scope.replace(data.files, files);
|
89
|
-
} else if (data.errorThrown ||
|
90
|
-
data.textStatus === 'error') {
|
91
|
-
data.files[0].error = data.errorThrown ||
|
92
|
-
data.textStatus;
|
93
|
-
}
|
94
|
-
},
|
95
|
-
add: function (e, data) {
|
96
|
-
if (e.isDefaultPrevented()) {
|
97
|
-
return false;
|
98
|
-
}
|
99
|
-
var scope = data.scope,
|
100
|
-
filesCopy = [];
|
101
|
-
angular.forEach(data.files, function (file) {
|
102
|
-
filesCopy.push(file);
|
103
|
-
});
|
104
|
-
scope.$parent.$applyAsync(function () {
|
105
|
-
addFileMethods(scope, data);
|
106
|
-
var method = scope.option('prependFiles') ?
|
107
|
-
'unshift' : 'push';
|
108
|
-
Array.prototype[method].apply(scope.queue, data.files);
|
109
|
-
});
|
110
|
-
data.process(function () {
|
111
|
-
return scope.process(data);
|
112
|
-
}).always(function () {
|
113
|
-
scope.$parent.$applyAsync(function () {
|
114
|
-
addFileMethods(scope, data);
|
115
|
-
scope.replace(filesCopy, data.files);
|
116
|
-
});
|
117
|
-
}).then(function () {
|
118
|
-
if ((scope.option('autoUpload') ||
|
119
|
-
data.autoUpload) &&
|
120
|
-
data.autoUpload !== false) {
|
121
|
-
data.submit();
|
122
|
-
}
|
123
|
-
});
|
124
|
-
},
|
125
|
-
done: function (e, data) {
|
126
|
-
if (e.isDefaultPrevented()) {
|
127
|
-
return false;
|
128
|
-
}
|
129
|
-
var that = this;
|
130
|
-
data.scope.$apply(function () {
|
131
|
-
data.handleResponse.call(that, e, data);
|
132
|
-
});
|
133
|
-
},
|
134
|
-
fail: function (e, data) {
|
135
|
-
if (e.isDefaultPrevented()) {
|
136
|
-
return false;
|
137
|
-
}
|
138
|
-
var that = this,
|
139
|
-
scope = data.scope;
|
140
|
-
if (data.errorThrown === 'abort') {
|
141
|
-
scope.clear(data.files);
|
142
|
-
return;
|
143
|
-
}
|
144
|
-
scope.$apply(function () {
|
145
|
-
data.handleResponse.call(that, e, data);
|
146
|
-
});
|
147
|
-
},
|
148
|
-
stop: scopeEvalAsync,
|
149
|
-
processstart: scopeEvalAsync,
|
150
|
-
processstop: scopeEvalAsync,
|
151
|
-
getNumberOfFiles: function () {
|
152
|
-
var scope = this.scope;
|
153
|
-
return scope.queue.length - scope.processing();
|
154
|
-
},
|
155
|
-
dataType: 'json',
|
156
|
-
autoUpload: false
|
157
|
-
};
|
158
|
-
this.$get = [
|
159
|
-
function () {
|
160
|
-
return {
|
161
|
-
defaults: $config
|
162
|
-
};
|
163
|
-
}
|
164
|
-
];
|
165
|
-
})
|
166
|
-
|
167
|
-
// Format byte numbers to readable presentations:
|
168
|
-
.provider('formatFileSizeFilter', function () {
|
169
|
-
var $config = {
|
170
|
-
// Byte units following the IEC format
|
171
|
-
// http://en.wikipedia.org/wiki/Kilobyte
|
172
|
-
units: [
|
173
|
-
{size: 1000000000, suffix: ' GB'},
|
174
|
-
{size: 1000000, suffix: ' MB'},
|
175
|
-
{size: 1000, suffix: ' KB'}
|
176
|
-
]
|
177
|
-
};
|
178
|
-
this.defaults = $config;
|
179
|
-
this.$get = function () {
|
180
|
-
return function (bytes) {
|
181
|
-
if (!angular.isNumber(bytes)) {
|
182
|
-
return '';
|
183
|
-
}
|
184
|
-
var unit = true,
|
185
|
-
i = 0,
|
186
|
-
prefix,
|
187
|
-
suffix;
|
188
|
-
while (unit) {
|
189
|
-
unit = $config.units[i];
|
190
|
-
prefix = unit.prefix || '';
|
191
|
-
suffix = unit.suffix || '';
|
192
|
-
if (i === $config.units.length - 1 || bytes >= unit.size) {
|
193
|
-
return prefix + (bytes / unit.size).toFixed(2) + suffix;
|
194
|
-
}
|
195
|
-
i += 1;
|
196
|
-
}
|
197
|
-
};
|
198
|
-
};
|
199
|
-
})
|
200
|
-
|
201
|
-
// The FileUploadController initializes the fileupload widget and
|
202
|
-
// provides scope methods to control the File Upload functionality:
|
203
|
-
.controller('FileUploadController', [
|
204
|
-
'$scope', '$element', '$attrs', '$window', 'fileUpload','$q',
|
205
|
-
function ($scope, $element, $attrs, $window, fileUpload, $q) {
|
206
|
-
var uploadMethods = {
|
207
|
-
progress: function () {
|
208
|
-
return $element.fileupload('progress');
|
209
|
-
},
|
210
|
-
active: function () {
|
211
|
-
return $element.fileupload('active');
|
212
|
-
},
|
213
|
-
option: function (option, data) {
|
214
|
-
if (arguments.length === 1) {
|
215
|
-
return $element.fileupload('option', option);
|
216
|
-
}
|
217
|
-
$element.fileupload('option', option, data);
|
218
|
-
},
|
219
|
-
add: function (data) {
|
220
|
-
return $element.fileupload('add', data);
|
221
|
-
},
|
222
|
-
send: function (data) {
|
223
|
-
return $element.fileupload('send', data);
|
224
|
-
},
|
225
|
-
process: function (data) {
|
226
|
-
return $element.fileupload('process', data);
|
227
|
-
},
|
228
|
-
processing: function (data) {
|
229
|
-
return $element.fileupload('processing', data);
|
230
|
-
}
|
231
|
-
};
|
232
|
-
$scope.disabled = !$window.jQuery.support.fileInput;
|
233
|
-
$scope.queue = $scope.queue || [];
|
234
|
-
$scope.clear = function (files) {
|
235
|
-
var queue = this.queue,
|
236
|
-
i = queue.length,
|
237
|
-
file = files,
|
238
|
-
length = 1;
|
239
|
-
if (angular.isArray(files)) {
|
240
|
-
file = files[0];
|
241
|
-
length = files.length;
|
242
|
-
}
|
243
|
-
while (i) {
|
244
|
-
i -= 1;
|
245
|
-
if (queue[i] === file) {
|
246
|
-
return queue.splice(i, length);
|
247
|
-
}
|
248
|
-
}
|
249
|
-
};
|
250
|
-
$scope.replace = function (oldFiles, newFiles) {
|
251
|
-
var queue = this.queue,
|
252
|
-
file = oldFiles[0],
|
253
|
-
i,
|
254
|
-
j;
|
255
|
-
for (i = 0; i < queue.length; i += 1) {
|
256
|
-
if (queue[i] === file) {
|
257
|
-
for (j = 0; j < newFiles.length; j += 1) {
|
258
|
-
queue[i + j] = newFiles[j];
|
259
|
-
}
|
260
|
-
return;
|
261
|
-
}
|
262
|
-
}
|
263
|
-
};
|
264
|
-
$scope.applyOnQueue = function (method) {
|
265
|
-
var list = this.queue.slice(0),
|
266
|
-
i,
|
267
|
-
file,
|
268
|
-
promises = [];
|
269
|
-
for (i = 0; i < list.length; i += 1) {
|
270
|
-
file = list[i];
|
271
|
-
if (file[method]) {
|
272
|
-
promises.push(file[method]());
|
273
|
-
}
|
274
|
-
}
|
275
|
-
return $q.all(promises);
|
276
|
-
};
|
277
|
-
$scope.submit = function () {
|
278
|
-
return this.applyOnQueue('$submit');
|
279
|
-
};
|
280
|
-
$scope.cancel = function () {
|
281
|
-
return this.applyOnQueue('$cancel');
|
282
|
-
};
|
283
|
-
// Add upload methods to the scope:
|
284
|
-
angular.extend($scope, uploadMethods);
|
285
|
-
// The fileupload widget will initialize with
|
286
|
-
// the options provided via "data-"-parameters,
|
287
|
-
// as well as those given via options object:
|
288
|
-
$element.fileupload(angular.extend(
|
289
|
-
{scope: $scope},
|
290
|
-
fileUpload.defaults
|
291
|
-
)).on('fileuploadadd', function (e, data) {
|
292
|
-
data.scope = $scope;
|
293
|
-
}).on('fileuploadfail', function (e, data) {
|
294
|
-
if (data.errorThrown === 'abort') {
|
295
|
-
return;
|
296
|
-
}
|
297
|
-
if (data.dataType &&
|
298
|
-
data.dataType.indexOf('json') === data.dataType.length - 4) {
|
299
|
-
try {
|
300
|
-
data.result = angular.fromJson(data.jqXHR.responseText);
|
301
|
-
} catch (ignore) {}
|
302
|
-
}
|
303
|
-
}).on([
|
304
|
-
'fileuploadadd',
|
305
|
-
'fileuploadsubmit',
|
306
|
-
'fileuploadsend',
|
307
|
-
'fileuploaddone',
|
308
|
-
'fileuploadfail',
|
309
|
-
'fileuploadalways',
|
310
|
-
'fileuploadprogress',
|
311
|
-
'fileuploadprogressall',
|
312
|
-
'fileuploadstart',
|
313
|
-
'fileuploadstop',
|
314
|
-
'fileuploadchange',
|
315
|
-
'fileuploadpaste',
|
316
|
-
'fileuploaddrop',
|
317
|
-
'fileuploaddragover',
|
318
|
-
'fileuploadchunksend',
|
319
|
-
'fileuploadchunkdone',
|
320
|
-
'fileuploadchunkfail',
|
321
|
-
'fileuploadchunkalways',
|
322
|
-
'fileuploadprocessstart',
|
323
|
-
'fileuploadprocess',
|
324
|
-
'fileuploadprocessdone',
|
325
|
-
'fileuploadprocessfail',
|
326
|
-
'fileuploadprocessalways',
|
327
|
-
'fileuploadprocessstop'
|
328
|
-
].join(' '), function (e, data) {
|
329
|
-
$scope.$parent.$applyAsync(function () {
|
330
|
-
if ($scope.$emit(e.type, data).defaultPrevented) {
|
331
|
-
e.preventDefault();
|
332
|
-
}
|
333
|
-
});
|
334
|
-
}).on('remove', function () {
|
335
|
-
// Remove upload methods from the scope,
|
336
|
-
// when the widget is removed:
|
337
|
-
var method;
|
338
|
-
for (method in uploadMethods) {
|
339
|
-
if (uploadMethods.hasOwnProperty(method)) {
|
340
|
-
delete $scope[method];
|
341
|
-
}
|
342
|
-
}
|
343
|
-
});
|
344
|
-
// Observe option changes:
|
345
|
-
$scope.$watch(
|
346
|
-
$attrs.fileUpload,
|
347
|
-
function (newOptions) {
|
348
|
-
if (newOptions) {
|
349
|
-
$element.fileupload('option', newOptions);
|
350
|
-
}
|
351
|
-
}
|
352
|
-
);
|
353
|
-
}
|
354
|
-
])
|
355
|
-
|
356
|
-
// Provide File Upload progress feedback:
|
357
|
-
.controller('FileUploadProgressController', [
|
358
|
-
'$scope', '$attrs', '$parse',
|
359
|
-
function ($scope, $attrs, $parse) {
|
360
|
-
var fn = $parse($attrs.fileUploadProgress),
|
361
|
-
update = function () {
|
362
|
-
var progress = fn($scope);
|
363
|
-
if (!progress || !progress.total) {
|
364
|
-
return;
|
365
|
-
}
|
366
|
-
$scope.num = Math.floor(
|
367
|
-
progress.loaded / progress.total * 100
|
368
|
-
);
|
369
|
-
};
|
370
|
-
update();
|
371
|
-
$scope.$watch(
|
372
|
-
$attrs.fileUploadProgress + '.loaded',
|
373
|
-
function (newValue, oldValue) {
|
374
|
-
if (newValue !== oldValue) {
|
375
|
-
update();
|
376
|
-
}
|
377
|
-
}
|
378
|
-
);
|
379
|
-
}
|
380
|
-
])
|
381
|
-
|
382
|
-
// Display File Upload previews:
|
383
|
-
.controller('FileUploadPreviewController', [
|
384
|
-
'$scope', '$element', '$attrs',
|
385
|
-
function ($scope, $element, $attrs) {
|
386
|
-
$scope.$watch(
|
387
|
-
$attrs.fileUploadPreview + '.preview',
|
388
|
-
function (preview) {
|
389
|
-
$element.empty();
|
390
|
-
if (preview) {
|
391
|
-
$element.append(preview);
|
392
|
-
}
|
393
|
-
}
|
394
|
-
);
|
395
|
-
}
|
396
|
-
])
|
397
|
-
|
398
|
-
.directive('fileUpload', function () {
|
399
|
-
return {
|
400
|
-
controller: 'FileUploadController',
|
401
|
-
scope: true
|
402
|
-
};
|
403
|
-
})
|
404
|
-
|
405
|
-
.directive('fileUploadProgress', function () {
|
406
|
-
return {
|
407
|
-
controller: 'FileUploadProgressController',
|
408
|
-
scope: true
|
409
|
-
};
|
410
|
-
})
|
411
|
-
|
412
|
-
.directive('fileUploadPreview', function () {
|
413
|
-
return {
|
414
|
-
controller: 'FileUploadPreviewController'
|
415
|
-
};
|
416
|
-
})
|
417
|
-
|
418
|
-
// Enhance the HTML5 download attribute to
|
419
|
-
// allow drag&drop of files to the desktop:
|
420
|
-
.directive('download', function () {
|
421
|
-
return function (scope, elm) {
|
422
|
-
elm.on('dragstart', function (e) {
|
423
|
-
try {
|
424
|
-
e.originalEvent.dataTransfer.setData(
|
425
|
-
'DownloadURL',
|
426
|
-
[
|
427
|
-
'application/octet-stream',
|
428
|
-
elm.prop('download'),
|
429
|
-
elm.prop('href')
|
430
|
-
].join(':')
|
431
|
-
);
|
432
|
-
} catch (ignore) {}
|
433
|
-
});
|
434
|
-
};
|
435
|
-
});
|
436
|
-
|
437
|
-
}));
|
@@ -1,161 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery File Upload jQuery UI Plugin
|
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
|
-
* https://opensource.org/licenses/MIT
|
10
|
-
*/
|
11
|
-
|
12
|
-
/* jshint nomen:false */
|
13
|
-
/* global define, require, window */
|
14
|
-
|
15
|
-
;(function (factory) {
|
16
|
-
'use strict';
|
17
|
-
if (typeof define === 'function' && define.amd) {
|
18
|
-
// Register as an anonymous AMD module:
|
19
|
-
define([
|
20
|
-
'jquery',
|
21
|
-
'./jquery.fileupload-ui'
|
22
|
-
], factory);
|
23
|
-
} else if (typeof exports === 'object') {
|
24
|
-
// Node/CommonJS:
|
25
|
-
factory(
|
26
|
-
require('jquery'),
|
27
|
-
require('./jquery.fileupload-ui')
|
28
|
-
);
|
29
|
-
} else {
|
30
|
-
// Browser globals:
|
31
|
-
factory(window.jQuery);
|
32
|
-
}
|
33
|
-
}(function ($) {
|
34
|
-
'use strict';
|
35
|
-
|
36
|
-
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
|
37
|
-
|
38
|
-
options: {
|
39
|
-
processdone: function (e, data) {
|
40
|
-
data.context.find('.start').button('enable');
|
41
|
-
},
|
42
|
-
progress: function (e, data) {
|
43
|
-
if (data.context) {
|
44
|
-
data.context.find('.progress').progressbar(
|
45
|
-
'option',
|
46
|
-
'value',
|
47
|
-
parseInt(data.loaded / data.total * 100, 10)
|
48
|
-
);
|
49
|
-
}
|
50
|
-
},
|
51
|
-
progressall: function (e, data) {
|
52
|
-
var $this = $(this);
|
53
|
-
$this.find('.fileupload-progress')
|
54
|
-
.find('.progress').progressbar(
|
55
|
-
'option',
|
56
|
-
'value',
|
57
|
-
parseInt(data.loaded / data.total * 100, 10)
|
58
|
-
).end()
|
59
|
-
.find('.progress-extended').each(function () {
|
60
|
-
$(this).html(
|
61
|
-
($this.data('blueimp-fileupload') ||
|
62
|
-
$this.data('fileupload'))
|
63
|
-
._renderExtendedProgress(data)
|
64
|
-
);
|
65
|
-
});
|
66
|
-
}
|
67
|
-
},
|
68
|
-
|
69
|
-
_renderUpload: function (func, files) {
|
70
|
-
var node = this._super(func, files),
|
71
|
-
showIconText = $(window).width() > 480;
|
72
|
-
node.find('.progress').empty().progressbar();
|
73
|
-
node.find('.start').button({
|
74
|
-
icons: {primary: 'ui-icon-circle-arrow-e'},
|
75
|
-
text: showIconText
|
76
|
-
});
|
77
|
-
node.find('.cancel').button({
|
78
|
-
icons: {primary: 'ui-icon-cancel'},
|
79
|
-
text: showIconText
|
80
|
-
});
|
81
|
-
if (node.hasClass('fade')) {
|
82
|
-
node.hide();
|
83
|
-
}
|
84
|
-
return node;
|
85
|
-
},
|
86
|
-
|
87
|
-
_renderDownload: function (func, files) {
|
88
|
-
var node = this._super(func, files),
|
89
|
-
showIconText = $(window).width() > 480;
|
90
|
-
node.find('.delete').button({
|
91
|
-
icons: {primary: 'ui-icon-trash'},
|
92
|
-
text: showIconText
|
93
|
-
});
|
94
|
-
if (node.hasClass('fade')) {
|
95
|
-
node.hide();
|
96
|
-
}
|
97
|
-
return node;
|
98
|
-
},
|
99
|
-
|
100
|
-
_startHandler: function (e) {
|
101
|
-
$(e.currentTarget).button('disable');
|
102
|
-
this._super(e);
|
103
|
-
},
|
104
|
-
|
105
|
-
_transition: function (node) {
|
106
|
-
var deferred = $.Deferred();
|
107
|
-
if (node.hasClass('fade')) {
|
108
|
-
node.fadeToggle(
|
109
|
-
this.options.transitionDuration,
|
110
|
-
this.options.transitionEasing,
|
111
|
-
function () {
|
112
|
-
deferred.resolveWith(node);
|
113
|
-
}
|
114
|
-
);
|
115
|
-
} else {
|
116
|
-
deferred.resolveWith(node);
|
117
|
-
}
|
118
|
-
return deferred;
|
119
|
-
},
|
120
|
-
|
121
|
-
_create: function () {
|
122
|
-
this._super();
|
123
|
-
this.element
|
124
|
-
.find('.fileupload-buttonbar')
|
125
|
-
.find('.fileinput-button').each(function () {
|
126
|
-
var input = $(this).find('input:file').detach();
|
127
|
-
$(this)
|
128
|
-
.button({icons: {primary: 'ui-icon-plusthick'}})
|
129
|
-
.append(input);
|
130
|
-
})
|
131
|
-
.end().find('.start')
|
132
|
-
.button({icons: {primary: 'ui-icon-circle-arrow-e'}})
|
133
|
-
.end().find('.cancel')
|
134
|
-
.button({icons: {primary: 'ui-icon-cancel'}})
|
135
|
-
.end().find('.delete')
|
136
|
-
.button({icons: {primary: 'ui-icon-trash'}})
|
137
|
-
.end().find('.progress').progressbar();
|
138
|
-
},
|
139
|
-
|
140
|
-
_destroy: function () {
|
141
|
-
this.element
|
142
|
-
.find('.fileupload-buttonbar')
|
143
|
-
.find('.fileinput-button').each(function () {
|
144
|
-
var input = $(this).find('input:file').detach();
|
145
|
-
$(this)
|
146
|
-
.button('destroy')
|
147
|
-
.append(input);
|
148
|
-
})
|
149
|
-
.end().find('.start')
|
150
|
-
.button('destroy')
|
151
|
-
.end().find('.cancel')
|
152
|
-
.button('destroy')
|
153
|
-
.end().find('.delete')
|
154
|
-
.button('destroy')
|
155
|
-
.end().find('.progress').progressbar('destroy');
|
156
|
-
this._super();
|
157
|
-
}
|
158
|
-
|
159
|
-
});
|
160
|
-
|
161
|
-
}));
|
@@ -1,75 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery File Upload Plugin JS Example
|
3
|
-
* https://github.com/blueimp/jQuery-File-Upload
|
4
|
-
*
|
5
|
-
* Copyright 2010, Sebastian Tschan
|
6
|
-
* https://blueimp.net
|
7
|
-
*
|
8
|
-
* Licensed under the MIT license:
|
9
|
-
* https://opensource.org/licenses/MIT
|
10
|
-
*/
|
11
|
-
|
12
|
-
/* global $, window */
|
13
|
-
|
14
|
-
$(function () {
|
15
|
-
'use strict';
|
16
|
-
|
17
|
-
// Initialize the jQuery File Upload widget:
|
18
|
-
$('#fileupload').fileupload({
|
19
|
-
// Uncomment the following to send cross-domain cookies:
|
20
|
-
//xhrFields: {withCredentials: true},
|
21
|
-
url: 'server/php/'
|
22
|
-
});
|
23
|
-
|
24
|
-
// Enable iframe cross-domain access via redirect option:
|
25
|
-
$('#fileupload').fileupload(
|
26
|
-
'option',
|
27
|
-
'redirect',
|
28
|
-
window.location.href.replace(
|
29
|
-
/\/[^\/]*$/,
|
30
|
-
'/cors/result.html?%s'
|
31
|
-
)
|
32
|
-
);
|
33
|
-
|
34
|
-
if (window.location.hostname === 'blueimp.github.io') {
|
35
|
-
// Demo settings:
|
36
|
-
$('#fileupload').fileupload('option', {
|
37
|
-
url: '//jquery-file-upload.appspot.com/',
|
38
|
-
// Enable image resizing, except for Android and Opera,
|
39
|
-
// which actually support image resizing, but fail to
|
40
|
-
// send Blob objects via XHR requests:
|
41
|
-
disableImageResize: /Android(?!.*Chrome)|Opera/
|
42
|
-
.test(window.navigator.userAgent),
|
43
|
-
maxFileSize: 999000,
|
44
|
-
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
|
45
|
-
});
|
46
|
-
// Upload server status check for browsers with CORS support:
|
47
|
-
if ($.support.cors) {
|
48
|
-
$.ajax({
|
49
|
-
url: '//jquery-file-upload.appspot.com/',
|
50
|
-
type: 'HEAD'
|
51
|
-
}).fail(function () {
|
52
|
-
$('<div class="alert alert-danger"/>')
|
53
|
-
.text('Upload server currently unavailable - ' +
|
54
|
-
new Date())
|
55
|
-
.appendTo('#fileupload');
|
56
|
-
});
|
57
|
-
}
|
58
|
-
} else {
|
59
|
-
// Load existing files:
|
60
|
-
$('#fileupload').addClass('fileupload-processing');
|
61
|
-
$.ajax({
|
62
|
-
// Uncomment the following to send cross-domain cookies:
|
63
|
-
//xhrFields: {withCredentials: true},
|
64
|
-
url: $('#fileupload').fileupload('option', 'url'),
|
65
|
-
dataType: 'json',
|
66
|
-
context: $('#fileupload')[0]
|
67
|
-
}).always(function () {
|
68
|
-
$(this).removeClass('fileupload-processing');
|
69
|
-
}).done(function (result) {
|
70
|
-
$(this).fileupload('option', 'done')
|
71
|
-
.call(this, $.Event('done'), {result: result});
|
72
|
-
});
|
73
|
-
}
|
74
|
-
|
75
|
-
});
|