|
44 | 44 | autoUpload: false,
|
45 | 45 | // The following option limits the number of files that are
|
46 | 46 | // allowed to be uploaded using this widget:
|
47 |
| - maxNumberOfFiles: undefined, |
| 47 | + maxNumberOfFiles: 15, |
48 | 48 | // The maximum allowed file size:
|
49 |
| - maxFileSize: undefined, |
| 49 | + maxFileSize: 3500000, |
50 | 50 | // The minimum allowed file size:
|
51 |
| - minFileSize: undefined, |
| 51 | + minFileSize: 10000, |
52 | 52 | // The regular expression for allowed file types, matches
|
53 | 53 | // against either file type or file name:
|
54 | 54 | acceptFileTypes: /.+$/i,
|
|
454 | 454 | // maxNumberOfFiles before validation, so we check if
|
455 | 455 | // maxNumberOfFiles is below 0 (instead of below 1):
|
456 | 456 | if (this.options.maxNumberOfFiles < 0) {
|
457 |
| - return 'Maximum number of files exceeded'; |
| 457 | + return "Превышено максимальное количество файлов"; |
458 | 458 | }
|
459 | 459 | // Files are accepted if either the file type or the file name
|
460 | 460 | // matches against the acceptFileTypes regular expression, as
|
461 | 461 | // only browsers with support for the File API report the type:
|
462 | 462 | if (!(this.options.acceptFileTypes.test(file.type) ||
|
463 | 463 | this.options.acceptFileTypes.test(file.name))) {
|
464 |
| - return 'Filetype not allowed'; |
| 464 | + return "Неправильный тип файла"; |
465 | 465 | }
|
466 | 466 | if (this.options.maxFileSize &&
|
467 | 467 | file.size > this.options.maxFileSize) {
|
468 |
| - return 'File is too big'; |
| 468 | + return "Файл слишком большой"; |
469 | 469 | }
|
470 | 470 | if (typeof file.size === 'number' &&
|
471 | 471 | file.size < this.options.minFileSize) {
|
472 |
| - return 'File is too small'; |
| 472 | + return "Файл слишком маленький"; |
473 | 473 | }
|
474 | 474 | return null;
|
475 | 475 | },
|
|
0 commit comments