update blueimp

This commit is contained in:
nobody 2020-09-25 09:45:54 +10:00
parent 0170a7ae6c
commit 9a6888989a
81 changed files with 39036 additions and 7776 deletions

View file

@ -38,7 +38,7 @@
"ramsey/uuid": "^3.8",
"twbs/bootstrap": "4.1.3",
"indieweb/rel-me": "dev-master",
"blueimp/jquery-file-upload": "^9.23",
"blueimp/jquery-file-upload": "10.*",
"league/flysystem": "^1.0",
"simshaun/recurr": "^4.0",
"jbroadway/urlify": "^1.1",

283
composer.lock generated
View file

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "46f7659df7a4f537c8846f1a9c177d8c",
"content-hash": "a0ef1b3559f46d6fb71586406f3f1cf5",
"packages": [
{
"name": "blueimp/jquery-file-upload",
"version": "v9.34.0",
"version": "v10.31.0",
"source": {
"type": "git",
"url": "https://github.com/vkhramtsov/jQuery-File-Upload.git",
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2"
"reference": "0740f81829698b84efe17e72501e0f420ea0d611"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/0740f81829698b84efe17e72501e0f420ea0d611",
"reference": "0740f81829698b84efe17e72501e0f420ea0d611",
"shasum": ""
},
"type": "library",
@ -59,7 +59,13 @@
"upload",
"widget"
],
"time": "2019-07-22T13:10:51+00:00"
"funding": [
{
"url": "https://github.com/blueimp",
"type": "github"
}
],
"time": "2020-07-13T05:42:06+00:00"
},
{
"name": "bshaffer/oauth2-server-php",
@ -862,16 +868,16 @@
},
{
"name": "league/mime-type-detection",
"version": "1.4.0",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/mime-type-detection.git",
"reference": "fda190b62b962d96a069fcc414d781db66d65b69"
"reference": "ea2fbfc988bade315acd5967e6d02274086d0f28"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/fda190b62b962d96a069fcc414d781db66d65b69",
"reference": "fda190b62b962d96a069fcc414d781db66d65b69",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ea2fbfc988bade315acd5967e6d02274086d0f28",
"reference": "ea2fbfc988bade315acd5967e6d02274086d0f28",
"shasum": ""
},
"require": {
@ -909,7 +915,7 @@
"type": "tidelift"
}
],
"time": "2020-08-09T10:34:01+00:00"
"time": "2020-09-21T18:10:53+00:00"
},
{
"name": "league/oauth2-client",
@ -2304,16 +2310,16 @@
},
{
"name": "symfony/deprecation-contracts",
"version": "v2.1.3",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14"
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5e20b83385a77593259c9f8beb2c43cd03b2ac14",
"reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"shasum": ""
},
"require": {
@ -2322,7 +2328,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -2364,11 +2370,11 @@
"type": "tidelift"
}
],
"time": "2020-06-06T08:49:21+00:00"
"time": "2020-09-07T11:33:47+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
@ -2910,7 +2916,7 @@
},
{
"name": "symfony/process",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
@ -3735,16 +3741,16 @@
},
{
"name": "nikic/php-parser",
"version": "v4.9.0",
"version": "v4.10.1",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "aaee038b912e567780949787d5fe1977be11a778"
"reference": "1b479e7592812411c20c34d9ed33db3957bde66e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/aaee038b912e567780949787d5fe1977be11a778",
"reference": "aaee038b912e567780949787d5fe1977be11a778",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1b479e7592812411c20c34d9ed33db3957bde66e",
"reference": "1b479e7592812411c20c34d9ed33db3957bde66e",
"shasum": ""
},
"require": {
@ -3783,7 +3789,7 @@
"parser",
"php"
],
"time": "2020-08-18T19:48:01+00:00"
"time": "2020-09-23T18:23:49+00:00"
},
{
"name": "phar-io/manifest",
@ -4110,16 +4116,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "5.2.1",
"version": "5.2.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "d870572532cd70bc3fab58f2e23ad423c8404c44"
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44",
"reference": "d870572532cd70bc3fab58f2e23ad423c8404c44",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
"shasum": ""
},
"require": {
@ -4158,20 +4164,20 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2020-08-15T11:14:08+00:00"
"time": "2020-09-03T19:13:55+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.3.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "e878a14a65245fbe78f8080eba03b47c3b705651"
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651",
"reference": "e878a14a65245fbe78f8080eba03b47c3b705651",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"shasum": ""
},
"require": {
@ -4203,7 +4209,7 @@
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"time": "2020-06-27T10:12:23+00:00"
"time": "2020-09-17T18:55:26+00:00"
},
{
"name": "phpspec/prophecy",
@ -4330,16 +4336,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "9.1.4",
"version": "9.1.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "4422fca28c3634e2de8c7c373af97a104dd1a45f"
"reference": "c9394cb9d07ecfa9351b96f2e296bad473195f4d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4422fca28c3634e2de8c7c373af97a104dd1a45f",
"reference": "4422fca28c3634e2de8c7c373af97a104dd1a45f",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c9394cb9d07ecfa9351b96f2e296bad473195f4d",
"reference": "c9394cb9d07ecfa9351b96f2e296bad473195f4d",
"shasum": ""
},
"require": {
@ -4347,7 +4353,7 @@
"ext-libxml": "*",
"ext-xmlwriter": "*",
"nikic/php-parser": "^4.8",
"php": "^7.3 || ^8.0",
"php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
"sebastian/code-unit-reverse-lookup": "^2.0.2",
@ -4399,7 +4405,7 @@
"type": "github"
}
],
"time": "2020-08-13T15:04:53+00:00"
"time": "2020-09-19T05:29:17+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -4628,16 +4634,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.3.7",
"version": "9.3.11",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c638a0cac77347980352485912de48c99b42ad00"
"reference": "f7316ea106df7c9507f4fdaa88c47bc10a3b27a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c638a0cac77347980352485912de48c99b42ad00",
"reference": "c638a0cac77347980352485912de48c99b42ad00",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f7316ea106df7c9507f4fdaa88c47bc10a3b27a1",
"reference": "f7316ea106df7c9507f4fdaa88c47bc10a3b27a1",
"shasum": ""
},
"require": {
@ -4651,13 +4657,14 @@
"myclabs/deep-copy": "^1.10.1",
"phar-io/manifest": "^2.0.1",
"phar-io/version": "^3.0.2",
"php": "^7.3 || ^8.0",
"php": ">=7.3",
"phpspec/prophecy": "^1.11.1",
"phpunit/php-code-coverage": "^9.1.1",
"phpunit/php-code-coverage": "^9.1.11",
"phpunit/php-file-iterator": "^3.0.4",
"phpunit/php-invoker": "^3.1",
"phpunit/php-text-template": "^2.0.2",
"phpunit/php-timer": "^5.0.1",
"sebastian/cli-parser": "^1.0",
"sebastian/code-unit": "^1.0.5",
"sebastian/comparator": "^4.0.3",
"sebastian/diff": "^4.0.2",
@ -4722,7 +4729,7 @@
"type": "github"
}
],
"time": "2020-08-11T15:36:12+00:00"
"time": "2020-09-24T08:08:49+00:00"
},
{
"name": "psr/container",
@ -4819,6 +4826,58 @@
],
"time": "2019-01-08T18:20:26+00:00"
},
{
"name": "sebastian/cli-parser",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/cli-parser.git",
"reference": "2a4a38c56e62f7295bedb8b1b7439ad523d4ea82"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2a4a38c56e62f7295bedb8b1b7439ad523d4ea82",
"reference": "2a4a38c56e62f7295bedb8b1b7439ad523d4ea82",
"shasum": ""
},
"require": {
"php": "^7.3 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Library for parsing CLI options",
"homepage": "https://github.com/sebastianbergmann/cli-parser",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-08-12T10:49:21+00:00"
},
{
"name": "sebastian/code-unit",
"version": "1.0.5",
@ -5669,7 +5728,7 @@
},
{
"name": "symfony/browser-kit",
"version": "v4.4.11",
"version": "v4.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
@ -5742,16 +5801,16 @@
},
{
"name": "symfony/config",
"version": "v4.4.11",
"version": "v4.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "b1d8f0d9341ea1d378b8b043ba90739f37c49d36"
"reference": "043bf8652c307ebc23ce44047d215eec889d8850"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/b1d8f0d9341ea1d378b8b043ba90739f37c49d36",
"reference": "b1d8f0d9341ea1d378b8b043ba90739f37c49d36",
"url": "https://api.github.com/repos/symfony/config/zipball/043bf8652c307ebc23ce44047d215eec889d8850",
"reference": "043bf8652c307ebc23ce44047d215eec889d8850",
"shasum": ""
},
"require": {
@ -5816,20 +5875,20 @@
"type": "tidelift"
}
],
"time": "2020-07-15T08:27:46+00:00"
"time": "2020-08-10T07:27:51+00:00"
},
{
"name": "symfony/console",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "2226c68009627934b8cfc01260b4d287eab070df"
"reference": "186f395b256065ba9b890c0a4e48a91d598fa2cf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/2226c68009627934b8cfc01260b4d287eab070df",
"reference": "2226c68009627934b8cfc01260b4d287eab070df",
"url": "https://api.github.com/repos/symfony/console/zipball/186f395b256065ba9b890c0a4e48a91d598fa2cf",
"reference": "186f395b256065ba9b890c0a4e48a91d598fa2cf",
"shasum": ""
},
"require": {
@ -5909,11 +5968,11 @@
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00"
"time": "2020-09-02T07:07:40+00:00"
},
{
"name": "symfony/css-selector",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
@ -5980,16 +6039,16 @@
},
{
"name": "symfony/dependency-injection",
"version": "v4.4.11",
"version": "v4.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "f33a28edd42708ed579377391b3a556bcd6a626d"
"reference": "384c2601e5a6228d60b041911d63f010e0885ffb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f33a28edd42708ed579377391b3a556bcd6a626d",
"reference": "f33a28edd42708ed579377391b3a556bcd6a626d",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/384c2601e5a6228d60b041911d63f010e0885ffb",
"reference": "384c2601e5a6228d60b041911d63f010e0885ffb",
"shasum": ""
},
"require": {
@ -6063,20 +6122,20 @@
"type": "tidelift"
}
],
"time": "2020-07-23T08:31:43+00:00"
"time": "2020-09-01T17:42:15+00:00"
},
{
"name": "symfony/dom-crawler",
"version": "v4.4.11",
"version": "v4.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "72b3a65ddd5052cf6d65eac6669748ed311f39bf"
"reference": "6dd1e7adef4b7efeeb9691fd619279027d4dcf85"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/72b3a65ddd5052cf6d65eac6669748ed311f39bf",
"reference": "72b3a65ddd5052cf6d65eac6669748ed311f39bf",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/6dd1e7adef4b7efeeb9691fd619279027d4dcf85",
"reference": "6dd1e7adef4b7efeeb9691fd619279027d4dcf85",
"shasum": ""
},
"require": {
@ -6138,20 +6197,20 @@
"type": "tidelift"
}
],
"time": "2020-07-23T08:31:43+00:00"
"time": "2020-08-12T06:20:35+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "7827d55911f91c070fc293ea51a06eec80797d76"
"reference": "94871fc0a69c3c5da57764187724cdce0755899c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7827d55911f91c070fc293ea51a06eec80797d76",
"reference": "7827d55911f91c070fc293ea51a06eec80797d76",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/94871fc0a69c3c5da57764187724cdce0755899c",
"reference": "94871fc0a69c3c5da57764187724cdce0755899c",
"shasum": ""
},
"require": {
@ -6224,20 +6283,20 @@
"type": "tidelift"
}
],
"time": "2020-06-18T18:24:02+00:00"
"time": "2020-08-13T14:19:42+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
"version": "v2.1.3",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
"reference": "f6f613d74cfc5a623fc36294d3451eb7fa5a042b"
"reference": "0ba7d54483095a198fa51781bc608d17e84dffa2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f6f613d74cfc5a623fc36294d3451eb7fa5a042b",
"reference": "f6f613d74cfc5a623fc36294d3451eb7fa5a042b",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2",
"reference": "0ba7d54483095a198fa51781bc608d17e84dffa2",
"shasum": ""
},
"require": {
@ -6250,7 +6309,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -6300,20 +6359,20 @@
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00"
"time": "2020-09-07T11:33:47+00:00"
},
{
"name": "symfony/filesystem",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "6e4320f06d5f2cce0d96530162491f4465179157"
"reference": "f7b9ed6142a34252d219801d9767dedbd711da1a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/6e4320f06d5f2cce0d96530162491f4465179157",
"reference": "6e4320f06d5f2cce0d96530162491f4465179157",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/f7b9ed6142a34252d219801d9767dedbd711da1a",
"reference": "f7b9ed6142a34252d219801d9767dedbd711da1a",
"shasum": ""
},
"require": {
@ -6364,7 +6423,7 @@
"type": "tidelift"
}
],
"time": "2020-05-30T20:35:19+00:00"
"time": "2020-08-21T17:19:47+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
@ -6599,16 +6658,16 @@
},
{
"name": "symfony/service-contracts",
"version": "v2.1.3",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "58c7475e5457c5492c26cc740cc0ad7464be9442"
"reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442",
"reference": "58c7475e5457c5492c26cc740cc0ad7464be9442",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1",
"reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1",
"shasum": ""
},
"require": {
@ -6621,7 +6680,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -6671,20 +6730,20 @@
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00"
"time": "2020-09-07T11:33:47+00:00"
},
{
"name": "symfony/string",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b"
"reference": "0de4cc1e18bb596226c06a82e2e7e9bc6001a63a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/f629ba9b611c76224feb21fe2bcbf0b6f992300b",
"reference": "f629ba9b611c76224feb21fe2bcbf0b6f992300b",
"url": "https://api.github.com/repos/symfony/string/zipball/0de4cc1e18bb596226c06a82e2e7e9bc6001a63a",
"reference": "0de4cc1e18bb596226c06a82e2e7e9bc6001a63a",
"shasum": ""
},
"require": {
@ -6756,20 +6815,20 @@
"type": "tidelift"
}
],
"time": "2020-07-08T08:27:49+00:00"
"time": "2020-08-17T07:48:54+00:00"
},
{
"name": "symfony/translation",
"version": "v4.4.11",
"version": "v4.4.13",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "a8ea9d97353294eb6783f2894ef8cee99a045822"
"reference": "700e6e50174b0cdcf0fa232773bec5c314680575"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/a8ea9d97353294eb6783f2894ef8cee99a045822",
"reference": "a8ea9d97353294eb6783f2894ef8cee99a045822",
"url": "https://api.github.com/repos/symfony/translation/zipball/700e6e50174b0cdcf0fa232773bec5c314680575",
"reference": "700e6e50174b0cdcf0fa232773bec5c314680575",
"shasum": ""
},
"require": {
@ -6846,20 +6905,20 @@
"type": "tidelift"
}
],
"time": "2020-07-23T08:31:43+00:00"
"time": "2020-08-17T09:56:45+00:00"
},
{
"name": "symfony/translation-contracts",
"version": "v2.1.3",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation-contracts.git",
"reference": "616a9773c853097607cf9dd6577d5b143ffdcd63"
"reference": "77ce1c3627c9f39643acd9af086631f842c50c4d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/616a9773c853097607cf9dd6577d5b143ffdcd63",
"reference": "616a9773c853097607cf9dd6577d5b143ffdcd63",
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/77ce1c3627c9f39643acd9af086631f842c50c4d",
"reference": "77ce1c3627c9f39643acd9af086631f842c50c4d",
"shasum": ""
},
"require": {
@ -6871,7 +6930,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -6921,20 +6980,20 @@
"type": "tidelift"
}
],
"time": "2020-07-06T13:23:11+00:00"
"time": "2020-09-07T11:33:47+00:00"
},
{
"name": "symfony/yaml",
"version": "v5.1.3",
"version": "v5.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "ea342353a3ef4f453809acc4ebc55382231d4d23"
"reference": "a44bd3a91bfbf8db12367fa6ffac9c3eb1a8804a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/ea342353a3ef4f453809acc4ebc55382231d4d23",
"reference": "ea342353a3ef4f453809acc4ebc55382231d4d23",
"url": "https://api.github.com/repos/symfony/yaml/zipball/a44bd3a91bfbf8db12367fa6ffac9c3eb1a8804a",
"reference": "a44bd3a91bfbf8db12367fa6ffac9c3eb1a8804a",
"shasum": ""
},
"require": {
@ -6998,7 +7057,7 @@
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
"time": "2020-08-26T08:30:57+00:00"
},
{
"name": "theseer/tokenizer",

View file

@ -0,0 +1 @@
github: [blueimp]

View file

@ -0,0 +1,84 @@
name: Test
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm install
env:
CI: true
- name: lint
run: npm run lint
env:
CI: true
mocha:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: chmod
run: chmod -R 777 server/php/files
- name: docker-compose build
run: docker-compose build example mocha
- name: mocha
run: docker-compose run --rm mocha
- name: docker-compose logs
if: always()
run: docker-compose logs example
- name: docker-compose down
if: always()
run: docker-compose down -v
wdio-chrome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: chmod
run: chmod -R 777 server/php/files wdio/reports
- name: docker-compose build
run: docker-compose build example
- name: wdio chrome
run: docker-compose run --rm wdio
- name: docker-compose logs
if: always()
run: docker-compose logs example
- name: docker-compose down
if: always()
run: docker-compose down -v
- name: Upload reports
if: always()
uses: actions/upload-artifact@master
with:
name: reports
path: wdio/reports
wdio-firefox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: chmod
run: chmod -R 777 server/php/files wdio/reports
- name: docker-compose build
run: docker-compose build example
- name: wdio firefox
run: docker-compose run --rm wdio conf/firefox.js
- name: docker-compose logs
if: always()
run: docker-compose logs example
- name: docker-compose down
if: always()
run: docker-compose down -v
- name: Upload reports
if: always()
uses: actions/upload-artifact@master
with:
name: reports
path: wdio/reports

View file

@ -1,3 +1,3 @@
.DS_Store
*.pyc
.env
node_modules

View file

@ -1,81 +0,0 @@
{
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : true, // true: Identifiers must be in camelCase
"curly" : true, // true: Require {} for every new block or scope
"eqeqeq" : true, // true: Require triple equals (===) for comparison
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"immed" : true, // true: Require immediate invocations to be wrapped in parens
// e.g. `(function () { } ());`
"indent" : 4, // {int} Number of spaces to use for indentation
"latedef" : true, // true: Require variables/functions to be defined before being used
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // true: Require all defined variables be used
"strict" : true, // true: Requires all functions run in ES5 Strict Mode
"trailing" : true, // true: Prohibit trailing whitespaces
"maxparams" : false, // {int} Max number of formal params allowed per function
"maxdepth" : false, // {int} Max depth of nested blocks (within functions)
"maxstatements" : false, // {int} Max number statements per function
"maxcomplexity" : false, // {int} Max cyclomatic complexity per function
"maxlen" : false, // {int} Max number of characters per line
// Relaxing
"asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : false, // true: Tolerate assignments where comparisons would be expected
"debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull" : false, // true: Tolerate use of `== null`
"es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
"esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
"moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil" : false, // true: Tolerate use of `eval` and `new Function()`
"expr" : false, // true: Tolerate `ExpressionStatement` as Programs
"funcscope" : false, // true: Tolerate defining variables inside control statements"
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
"iterator" : false, // true: Tolerate using the `__iterator__` property
"lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
"laxbreak" : false, // true: Tolerate possibly unsafe line breakings
"laxcomma" : false, // true: Tolerate comma-first style coding
"loopfunc" : false, // true: Tolerate functions being defined in loops
"multistr" : false, // true: Tolerate multi-line strings
"proto" : false, // true: Tolerate using the `__proto__` property
"scripturl" : false, // true: Tolerate script-targeted URLs
"smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
"shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis" : false, // true: Tolerate using this in a non-constructor function
// Environments
"browser" : false, // Web Browser (window, document, etc)
"couch" : false, // CouchDB
"devel" : false, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jquery" : false, // jQuery
"mootools" : false, // MooTools
"node" : false, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"rhino" : false, // Rhino
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface
// Legacy
"nomen" : true, // true: Prohibit dangling `_` in variables
"onevar" : true, // true: Allow only one `var` statement per function
"passfail" : false, // true: Stop on first error
"white" : true, // true: Check against strict whitespace and indentation rules
// Custom Globals
"globals" : {} // additional predefined global variables
}

View file

@ -1,20 +0,0 @@
*
!css/jquery.fileupload-noscript.css
!css/jquery.fileupload-ui-noscript.css
!css/jquery.fileupload-ui.css
!css/jquery.fileupload.css
!img/loading.gif
!img/progressbar.gif
!js/cors/jquery.postmessage-transport.js
!js/cors/jquery.xdr-transport.js
!js/vendor/jquery.ui.widget.js
!js/jquery.fileupload-angular.js
!js/jquery.fileupload-audio.js
!js/jquery.fileupload-image.js
!js/jquery.fileupload-jquery-ui.js
!js/jquery.fileupload-process.js
!js/jquery.fileupload-ui.js
!js/jquery.fileupload-validate.js
!js/jquery.fileupload-video.js
!js/jquery.fileupload.js
!js/jquery.iframe-transport.js

View file

@ -1,15 +0,0 @@
Please follow these pull request guidelines:
1. Update your fork to the latest upstream version.
2. Follow the coding conventions of the original source files (indentation, spaces, brackets layout).
3. Code changes must pass JSHint validation with the `.jshintrc` settings of this project.
4. Code changes must pass the QUnit tests defined in the `test` folder.
5. New features should be covered by accompanying QUnit tests.
6. Keep your commits as atomic as possible, i.e. create a new commit for every single bug fix or feature added.
7. Always add meaningful commit messages.

View file

@ -2,20 +2,19 @@ MIT License
Copyright © 2010 Sebastian Tschan, https://blueimp.net
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,121 +1,224 @@
# jQuery File Upload Plugin
# jQuery File Upload
## Contents
- [Description](#description)
- [Demo](#demo)
- [Features](#features)
- [Security](#security)
- [Setup](#setup)
- [Requirements](#requirements)
- [Mandatory requirements](#mandatory-requirements)
- [Optional requirements](#optional-requirements)
- [Cross-domain requirements](#cross-domain-requirements)
- [Browsers](#browsers)
- [Desktop browsers](#desktop-browsers)
- [Mobile browsers](#mobile-browsers)
- [Extended browser support information](#extended-browser-support-information)
- [Testing](#testing)
- [Support](#support)
- [License](#license)
## Description
File Upload widget with multiple file selection, drag&drop support, progress bars, validation and preview images, audio and video for jQuery.
Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.
> File Upload widget with multiple file selection, drag&drop support, progress
> bars, validation and preview images, audio and video for jQuery.
> Supports cross-domain, chunked and resumable file uploads and client-side
> image resizing.
> Works with any server-side platform (PHP, Python, Ruby on Rails, Java,
> Node.js, Go etc.) that supports standard HTML form file uploads.
## Demo
[Demo File Upload](https://blueimp.github.io/jQuery-File-Upload/)
## ⚠️ Security Notice
Security related releases:
## Features
* [v9.25.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.25.1) Mitigates some [Potential vulnerabilities with PHP+ImageMagick](VULNERABILITIES.md#potential-vulnerabilities-with-php-imagemagick).
* [v9.24.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.24.1) Fixes a [Remote code execution vulnerability in the PHP component](VULNERABILITIES.md#remote-code-execution-vulnerability-in-the-php-component).
* v[9.10.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/9.10.1) Fixes an [Open redirect vulnerability in the GAE components](VULNERABILITIES.md#open-redirect-vulnerability-in-the-gae-components).
* Commit [4175032](https://github.com/blueimp/jQuery-File-Upload/commit/41750323a464e848856dc4c5c940663498beb74a) (*fixed in all tagged releases*) Fixes a [Cross-site scripting vulnerability in the Iframe Transport](VULNERABILITIES.md#cross-site-scripting-vulnerability-in-the-iframe-transport).
- **Multiple file upload:**
Allows to select multiple files at once and upload them simultaneously.
- **Drag & Drop support:**
Allows to upload files by dragging them from your desktop or file manager and
dropping them on your browser window.
- **Upload progress bar:**
Shows a progress bar indicating the upload progress for individual files and
for all uploads combined.
- **Cancelable uploads:**
Individual file uploads can be canceled to stop the upload progress.
- **Resumable uploads:**
Aborted uploads can be resumed with browsers supporting the Blob API.
- **Chunked uploads:**
Large files can be uploaded in smaller chunks with browsers supporting the
Blob API.
- **Client-side image resizing:**
Images can be automatically resized on client-side with browsers supporting
the required JS APIs.
- **Preview images, audio and video:**
A preview of image, audio and video files can be displayed before uploading
with browsers supporting the required APIs.
- **No browser plugins (e.g. Adobe Flash) required:**
The implementation is based on open standards like HTML5 and JavaScript and
requires no additional browser plugins.
- **Graceful fallback for legacy browsers:**
Uploads files via XMLHttpRequests if supported and uses iframes as fallback
for legacy browsers.
- **HTML file upload form fallback:**
Allows progressive enhancement by using a standard HTML file upload form as
widget element.
- **Cross-site file uploads:**
Supports uploading files to a different domain with cross-site XMLHttpRequests
or iframe redirects.
- **Multiple plugin instances:**
Allows to use multiple plugin instances on the same webpage.
- **Customizable and extensible:**
Provides an API to set individual options and define callback methods for
various upload events.
- **Multipart and file contents stream uploads:**
Files can be uploaded as standard "multipart/form-data" or file contents
stream (HTTP PUT file upload).
- **Compatible with any server-side application platform:**
Works with any server-side platform (PHP, Python, Ruby on Rails, Java,
Node.js, Go etc.) that supports standard HTML form file uploads.
Please read the [SECURITY](SECURITY.md) document for instructions on how to securely configure your Webserver for file uploads.
## Security
⚠️ Please read the [VULNERABILITIES](VULNERABILITIES.md) document for a list of
fixed vulnerabilities
Please also read the [SECURITY](SECURITY.md) document for instructions on how to
securely configure your Web server for file uploads.
## Setup
* [How to setup the plugin on your website](https://github.com/blueimp/jQuery-File-Upload/wiki/Setup)
* [How to use only the basic plugin (minimal setup guide).](https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin)
## Features
* **Multiple file upload:**
Allows to select multiple files at once and upload them simultaneously.
* **Drag & Drop support:**
Allows to upload files by dragging them from your desktop or file manager and dropping them on your browser window.
* **Upload progress bar:**
Shows a progress bar indicating the upload progress for individual files and for all uploads combined.
* **Cancelable uploads:**
Individual file uploads can be canceled to stop the upload progress.
* **Resumable uploads:**
Aborted uploads can be resumed with browsers supporting the Blob API.
* **Chunked uploads:**
Large files can be uploaded in smaller chunks with browsers supporting the Blob API.
* **Client-side image resizing:**
Images can be automatically resized on client-side with browsers supporting the required JS APIs.
* **Preview images, audio and video:**
A preview of image, audio and video files can be displayed before uploading with browsers supporting the required APIs.
* **No browser plugins (e.g. Adobe Flash) required:**
The implementation is based on open standards like HTML5 and JavaScript and requires no additional browser plugins.
* **Graceful fallback for legacy browsers:**
Uploads files via XMLHttpRequests if supported and uses iframes as fallback for legacy browsers.
* **HTML file upload form fallback:**
Allows progressive enhancement by using a standard HTML file upload form as widget element.
* **Cross-site file uploads:**
Supports uploading files to a different domain with cross-site XMLHttpRequests or iframe redirects.
* **Multiple plugin instances:**
Allows to use multiple plugin instances on the same webpage.
* **Customizable and extensible:**
Provides an API to set individual options and define callback methods for various upload events.
* **Multipart and file contents stream uploads:**
Files can be uploaded as standard "multipart/form-data" or file contents stream (HTTP PUT file upload).
* **Compatible with any server-side application platform:**
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.
jQuery File Upload can be installed via [NPM](https://www.npmjs.com/):
```sh
npm install blueimp-file-upload
```
This allows you to include [jquery.fileupload.js](js/jquery.fileupload.js) and
its extensions via `node_modules`, e.g:
```html
<script src="node_modules/blueimp-file-upload/js/jquery.fileupload.js"></script>
```
The widget can then be initialized on a file upload form the following way:
```js
$('#fileupload').fileupload();
```
For further information, please refer to the following guides:
- [Main documentation page](https://github.com/blueimp/jQuery-File-Upload/wiki)
- [List of all available Options](https://github.com/blueimp/jQuery-File-Upload/wiki/Options)
- [The plugin API](https://github.com/blueimp/jQuery-File-Upload/wiki/API)
- [How to setup the plugin on your website](https://github.com/blueimp/jQuery-File-Upload/wiki/Setup)
- [How to use only the basic plugin.](https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin)
## Requirements
### Mandatory requirements
* [jQuery](https://jquery.com/) v. 1.6+
* [jQuery UI widget factory](https://api.jqueryui.com/jQuery.widget/) v. 1.9+ (included): Required for the basic File Upload plugin, but very lightweight without any other dependencies from the jQuery UI suite.
* [jQuery Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js) (included): Required for [browsers without XHR file upload support](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support).
- [jQuery](https://jquery.com/) v1.7+
- [jQuery UI widget factory](https://api.jqueryui.com/jQuery.widget/) v1.9+
(included): Required for the basic File Upload plugin, but very lightweight
without any other dependencies from the jQuery UI suite.
- [jQuery Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js)
(included): Required for
[browsers without XHR file upload support](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support).
### Optional requirements
* [JavaScript Templates engine](https://github.com/blueimp/JavaScript-Templates) v. 2.5.4+: Used to render the selected and uploaded files for the Basic Plus UI and jQuery UI versions.
* [JavaScript Load Image library](https://github.com/blueimp/JavaScript-Load-Image) v. 1.13.0+: Required for the image previews and resizing functionality.
* [JavaScript Canvas to Blob polyfill](https://github.com/blueimp/JavaScript-Canvas-to-Blob) v. 2.1.1+:Required for the image previews and resizing functionality.
* [blueimp Gallery](https://github.com/blueimp/Gallery) v. 2.15.1+: Used to display the uploaded images in a lightbox.
* [Bootstrap](http://getbootstrap.com/) v. 3.2.0+
* [Glyphicons](http://glyphicons.com/)
The user interface of all versions, except the jQuery UI version, is built with [Bootstrap](http://getbootstrap.com/) and icons from [Glyphicons](http://glyphicons.com/).
- [JavaScript Templates engine](https://github.com/blueimp/JavaScript-Templates)
v3+: Used to render the selected and uploaded files.
- [JavaScript Load Image library](https://github.com/blueimp/JavaScript-Load-Image)
v2+: Required for the image previews and resizing functionality.
- [JavaScript Canvas to Blob polyfill](https://github.com/blueimp/JavaScript-Canvas-to-Blob)
v3+:Required for the resizing functionality.
- [blueimp Gallery](https://github.com/blueimp/Gallery) v2+: Used to display the
uploaded images in a lightbox.
- [Bootstrap](https://getbootstrap.com/) v3+: Used for the demo design.
- [Glyphicons](https://glyphicons.com/) Icon set used by Bootstrap.
### Cross-domain requirements
[Cross-domain File Uploads](https://github.com/blueimp/jQuery-File-Upload/wiki/Cross-domain-uploads) using the [Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js) require a redirect back to the origin server to retrieve the upload results. The [example implementation](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/main.js) makes use of [result.html](https://github.com/blueimp/jQuery-File-Upload/blob/master/cors/result.html) as a static redirect page for the origin server.
The repository also includes the [jQuery XDomainRequest Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/cors/jquery.xdr-transport.js), which enables limited cross-domain AJAX requests in Microsoft Internet Explorer 8 and 9 (IE 10 supports cross-domain XHR requests).
The XDomainRequest object allows GET and POST requests only and doesn't support file uploads. It is used on the [Demo](https://blueimp.github.io/jQuery-File-Upload/) to delete uploaded files from the cross-domain demo file upload service.
[Cross-domain File Uploads](https://github.com/blueimp/jQuery-File-Upload/wiki/Cross-domain-uploads)
using the
[Iframe Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js)
require a redirect back to the origin server to retrieve the upload results. The
[example implementation](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/main.js)
makes use of
[result.html](https://github.com/blueimp/jQuery-File-Upload/blob/master/cors/result.html)
as a static redirect page for the origin server.
### Custom Backends
You can add support for various backends by adhering to the specification [outlined here](https://github.com/blueimp/jQuery-File-Upload/wiki/JSON-Response).
The repository also includes the
[jQuery XDomainRequest Transport plugin](https://github.com/blueimp/jQuery-File-Upload/blob/master/js/cors/jquery.xdr-transport.js),
which enables limited cross-domain AJAX requests in Microsoft Internet Explorer
8 and 9 (IE 10 supports cross-domain XHR requests).
The XDomainRequest object allows GET and POST requests only and doesn't support
file uploads. It is used on the
[Demo](https://blueimp.github.io/jQuery-File-Upload/) to delete uploaded files
from the cross-domain demo file upload service.
## Browsers
### Desktop browsers
The File Upload plugin is regularly tested with the latest browser versions and supports the following minimal versions:
* Google Chrome
* Apple Safari 4.0+
* Mozilla Firefox 3.0+
* Opera 11.0+
* Microsoft Internet Explorer 6.0+
The File Upload plugin is regularly tested with the latest browser versions and
supports the following minimal versions:
- Google Chrome
- Apple Safari 4.0+
- Mozilla Firefox 3.0+
- Opera 11.0+
- Microsoft Internet Explorer 6.0+
### Mobile browsers
The File Upload plugin has been tested with and supports the following mobile browsers:
* Apple Safari on iOS 6.0+ (see Caveats below)
* Google Chrome on iOS 6.0+ (see Caveats below)
* Google Chrome on Android 4.0+
* Default Browser on Android 2.3+
* Opera Mobile 12.0+
The File Upload plugin has been tested with and supports the following mobile
browsers:
### Caveats
- Apple Safari on iOS 6.0+
- Google Chrome on iOS 6.0+
- Google Chrome on Android 4.0+
- Default Browser on Android 2.3+
- Opera Mobile 12.0+
- iOS 9 has a [known bug](https://apple.stackexchange.com/questions/118154) where photos chosen from the Photo Library are all given the name `image.jpeg`, which is problematic when uploading multiple files at a time. Ideally your server should be responsible for deduplicating file uploads ([example](https://github.com/blueimp/jQuery-File-Upload/blob/master/server/php/UploadHandler.php#L490)). If you don't have control, as in the case of direct uploads to S3, you can pass an option `uniqueFilenames: {}` as part of the options object, which tells the uploader to deduplicate filenames. More details [here](https://github.com/blueimp/jQuery-File-Upload/commit/d419f43478aeafe95a794815f80a3016f58eb3b7).
### Extended browser support information
### Supported features
For a detailed overview of the features supported by each browser version, please have a look at the [Extended browser support information](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support).
For a detailed overview of the features supported by each browser version and
known operating system / browser bugs, please have a look at the
[Extended browser support information](https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support).
## Contributing
**Bug fixes** and **new features** can be proposed using [pull requests](https://github.com/blueimp/jQuery-File-Upload/pulls).
Please read the [contribution guidelines](https://github.com/blueimp/jQuery-File-Upload/blob/master/CONTRIBUTING.md) before submitting a pull request.
## Testing
The project comes with three sets of tests:
1. Code linting using [ESLint](https://eslint.org/).
2. Unit tests using [Mocha](https://mochajs.org/).
3. End-to-end tests using [blueimp/wdio](https://github.com/blueimp/wdio).
To run the tests, follow these steps:
1. Start [Docker](https://docs.docker.com/).
2. Install development dependencies:
```sh
npm install
```
3. Run the tests:
```sh
npm test
```
## Support
This project is actively maintained, but there is no official support channel.
If you have a question that another developer might help you with, please post to [Stack Overflow](http://stackoverflow.com/questions/tagged/blueimp+jquery+file-upload) and tag your question with `blueimp jquery file upload`.
If you have a question that another developer might help you with, please post
to
[Stack Overflow](https://stackoverflow.com/questions/tagged/blueimp+jquery+file-upload)
and tag your question with `blueimp jquery file upload`.
## License
Released under the [MIT license](https://opensource.org/licenses/MIT).

View file

@ -1,97 +1,182 @@
# File Upload Security
For an in-depth understanding of the potential security risks of providing file uploads and possible mitigations, please refer to the [OWASP - Unrestricted File Upload](https://www.owasp.org/index.php/Unrestricted_File_Upload) documentation.
To securely setup the project to serve uploaded files, please refer to the sample [Secure file upload serving configurations](#secure-file-upload-serving-configurations).
## Contents
To mitigate potential vulnerabilities in image processing libraries, please refer to the [Secure image processing configurations](#secure-image-processing-configurations).
- [Introduction](#introduction)
- [Purpose of this project](#purpose-of-this-project)
- [Mitigations against file upload risks](#mitigations-against-file-upload-risks)
- [Prevent code execution on the server](#prevent-code-execution-on-the-server)
- [Prevent code execution in the browser](#prevent-code-execution-in-the-browser)
- [Prevent distribution of malware](#prevent-distribution-of-malware)
- [Secure file upload serving configurations](#secure-file-upload-serving-configurations)
- [Apache config](#apache-config)
- [NGINX config](#nginx-config)
- [Secure image processing configurations](#secure-image-processing-configurations)
- [ImageMagick config](#imagemagick-config)
By default, all sample upload handlers allow only upload of image files, which mitigates some attack vectors, but should not be relied on as the only protection.
## Introduction
Please also have a look at the [list of fixed vulnerabilities](VULNERABILITIES.md) in jQuery File Upload, which relates mostly to the sample server-side upload handlers and how they have been configured.
For an in-depth understanding of the potential security risks of providing file
uploads and possible mitigations, please refer to the
[OWASP - Unrestricted File Upload](https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload)
documentation.
To securely setup the project to serve uploaded files, please refer to the
sample
[Secure file upload serving configurations](#secure-file-upload-serving-configurations).
To mitigate potential vulnerabilities in image processing libraries, please
refer to the
[Secure image processing configurations](#secure-image-processing-configurations).
By default, all sample upload handlers allow only upload of image files, which
mitigates some attack vectors, but should not be relied on as the only
protection.
Please also have a look at the
[list of fixed vulnerabilities](VULNERABILITIES.md) in jQuery File Upload, which
relates mostly to the sample server-side upload handlers and how they have been
configured.
## Purpose of this project
Please note that this project is not a complete file management product, but foremost a client-side file upload library for [jQuery](https://jquery.com/).
The server-side sample upload handlers are just examples to demonstrate the client-side file upload functionality.
Please note that this project is not a complete file management product, but
foremost a client-side file upload library for [jQuery](https://jquery.com/).
The server-side sample upload handlers are just examples to demonstrate the
client-side file upload functionality.
To make this very clear, there is **no user authentication** by default:
* **everyone can upload files**
* **everyone can delete uploaded files**
In some cases this can be acceptable, but for most projects you will want to extend the sample upload handlers to integrate user authentication, or implement your own.
- **everyone can upload files**
- **everyone can delete uploaded files**
It is also up to you to configure your Webserver to securely serve the uploaded files, e.g. using the [sample server configurations](#secure-file-upload-serving-configurations).
In some cases this can be acceptable, but for most projects you will want to
extend the sample upload handlers to integrate user authentication, or implement
your own.
It is also up to you to configure your web server to securely serve the uploaded
files, e.g. using the
[sample server configurations](#secure-file-upload-serving-configurations).
## Mitigations against file upload risks
### Prevent code execution on the server
To prevent execution of scripts or binaries on server-side, the upload directory must be configured to not execute files in the upload directory (e.g. `server/php/files` as the default for the PHP upload handler) and only treat uploaded files as static content.
The recommended way to do this is to configure the upload directory path to point outside of the web application root.
Then the Webserver can be configured to serve files from the upload directory with their default static files handler only.
To prevent execution of scripts or binaries on server-side, the upload directory
must be configured to not execute files in the upload directory (e.g.
`server/php/files` as the default for the PHP upload handler) and only treat
uploaded files as static content.
Limiting file uploads to a whitelist of safe file types (e.g. image files) also mitigates this issue, but should not be the only protection.
The recommended way to do this is to configure the upload directory path to
point outside of the web application root.
Then the web server can be configured to serve files from the upload directory
with their default static files handler only.
Limiting file uploads to a whitelist of safe file types (e.g. image files) also
mitigates this issue, but should not be the only protection.
### Prevent code execution in the browser
To prevent execution of scripts on client-side, the following headers must
be sent when delivering generic uploaded files to the client:
To prevent execution of scripts on client-side, the following headers must be
sent when delivering generic uploaded files to the client:
```
Content-Type: application/octet-stream
X-Content-Type-Options: nosniff
```
The `Content-Type: application/octet-stream` header instructs browsers to display a download dialog instead of parsing it and possibly executing script content e.g. in HTML files.
The `Content-Type: application/octet-stream` header instructs browsers to
display a download dialog instead of parsing it and possibly executing script
content e.g. in HTML files.
The `X-Content-Type-Options: nosniff` header prevents browsers to try to detect the file mime type despite the given content-type header.
The `X-Content-Type-Options: nosniff` header prevents browsers to try to detect
the file mime type despite the given content-type header.
For known safe files, the content-type header can be adjusted using a **whitelist**, e.g. sending `Content-Type: image/png` for PNG files.
For known safe files, the content-type header can be adjusted using a
**whitelist**, e.g. sending `Content-Type: image/png` for PNG files.
### Prevent distribution of malware
To prevent attackers from uploading and distributing malware (e.g. computer viruses), it is recommended to limit file uploads only to a whitelist of safe file types.
Please note that the detection of file types in the sample file upload handlers is based on the file extension and not the actual file content. This makes it still possible for attackers to upload malware by giving their files an image file extension, but should prevent automatic execution on client computers when opening those files.
To prevent attackers from uploading and distributing malware (e.g. computer
viruses), it is recommended to limit file uploads only to a whitelist of safe
file types.
It does not protect at all from exploiting vulnerabilities in image display programs, nor from users renaming file extensions to inadvertently execute the contained malicious code.
Please note that the detection of file types in the sample file upload handlers
is based on the file extension and not the actual file content. This makes it
still possible for attackers to upload malware by giving their files an image
file extension, but should prevent automatic execution on client computers when
opening those files.
It does not protect at all from exploiting vulnerabilities in image display
programs, nor from users renaming file extensions to inadvertently execute the
contained malicious code.
## Secure file upload serving configurations
The following configurations serve uploaded files as static files with the proper headers as [mitigation against file upload risks](#mitigations-against-file-upload-risks).
Please do not simply copy&paste these configurations, but make sure you understand what they are doing and that you have implemented them correctly.
The following configurations serve uploaded files as static files with the
proper headers as
[mitigation against file upload risks](#mitigations-against-file-upload-risks).
Please do not simply copy&paste these configurations, but make sure you
understand what they are doing and that you have implemented them correctly.
> Always test your own setup and make sure that it is secure!
e.g. try uploading PHP scripts (as "example.php", "example.php.png" and "example.png") to see if they get executed by your Webserver.
e.g. try uploading PHP scripts (as "example.php", "example.php.png" and
"example.png") to see if they get executed by your web server, e.g. the content
of the following sample:
```php
GIF89ad <?php echo mime_content_type(__FILE__); phpinfo();
```
### Apache config
Add the following directive to the Apache config, replacing the directory path with the absolute path to the upload directory:
Add the following directive to the Apache config (e.g.
/etc/apache2/apache2.conf), replacing the directory path with the absolute path
to the upload directory:
```ApacheConf
<Directory "/path/to/project/server/php/files">
# To enable the Headers module, execute the following command and reload Apache:
# Some of the directives require the Apache Headers module. If it is not
# already enabled, please execute the following command and reload Apache:
# sudo a2enmod headers
#
# Please note that the order of directives across configuration files matters,
# see also:
# https://httpd.apache.org/docs/current/sections.html#merging
# The following directives prevent the execution of script files
# in the context of the website.
# They also force the content-type application/octet-stream and
# force browsers to display a download dialog for non-image files.
# The following directive matches all files and forces them to be handled as
# static content, which prevents the server from parsing and executing files
# that are associated with a dynamic runtime, e.g. PHP files.
# It also forces their Content-Type header to "application/octet-stream" and
# adds a "Content-Disposition: attachment" header to force a download dialog,
# which prevents browsers from interpreting files in the context of the
# web server, e.g. HTML files containing JavaScript.
# Lastly it also prevents browsers from MIME-sniffing the Content-Type,
# preventing them from interpreting a file as a different Content-Type than
# the one sent by the webserver.
<FilesMatch ".*">
SetHandler default-handler
ForceType application/octet-stream
Header set Content-Disposition attachment
Header set X-Content-Type-Options nosniff
</FilesMatch>
# The following unsets the forced type and Content-Disposition headers
# for known image files:
<FilesMatch "(?i)\.(gif|jpe?g|png)$">
# The following directive matches known image files and unsets the forced
# Content-Type so they can be served with their original mime type.
# It also unsets the Content-Disposition header to allow displaying them
# inline in the browser.
<FilesMatch ".+\.(?i:(gif|jpe?g|png))$">
ForceType none
Header unset Content-Disposition
</FilesMatch>
# The following directive prevents browsers from MIME-sniffing the content-type.
# This is an important complement to the ForceType directive above:
Header set X-Content-Type-Options nosniff
</Directory>
```
### NGINX config
Add the following directive to the NGINX config, replacing the directory path with the absolute path to the upload directory:
Add the following directive to the NGINX config, replacing the directory path
with the absolute path to the upload directory:
```Nginx
location ^~ /path/to/project/server/php/files {
@ -113,13 +198,22 @@ location ^~ /path/to/project/server/php/files {
```
## Secure image processing configurations
The following configuration mitigates [potential image processing vulnerabilities with ImageMagick](VULNERABILITIES.md#potential-vulnerabilities-with-php-imagemagick) by limiting the attack vectors to a small subset of image types (`GIF/JPEG/PNG`).
Please also consider using alternative, safer image processing libraries like [libvips](https://github.com/libvips/libvips) or [imageflow](https://github.com/imazen/imageflow).
The following configuration mitigates
[potential image processing vulnerabilities with ImageMagick](VULNERABILITIES.md#potential-vulnerabilities-with-php-imagemagick)
by limiting the attack vectors to a small subset of image types
(`GIF/JPEG/PNG`).
Please also consider using alternative, safer image processing libraries like
[libvips](https://github.com/libvips/libvips) or
[imageflow](https://github.com/imazen/imageflow).
## ImageMagick config
It is recommended to disable all non-required ImageMagick coders via [policy.xml](https://wiki.debian.org/imagemagick/security).
To do so, locate the ImageMagick `policy.xml` configuration file and add the following policies:
It is recommended to disable all non-required ImageMagick coders via
[policy.xml](https://wiki.debian.org/imagemagick/security).
To do so, locate the ImageMagick `policy.xml` configuration file and add the
following policies:
```xml
<?xml version="1.0" encoding="UTF-8"?>

View file

@ -1,65 +1,118 @@
# ⚠️ List of fixed vulnerabilities
# List of fixed vulnerabilities
## Contents
- [Potential vulnerabilities with PHP+ImageMagick](#potential-vulnerabilities-with-phpimagemagick)
- [Remote code execution vulnerability in the PHP component](#remote-code-execution-vulnerability-in-the-php-component)
- [Open redirect vulnerability in the GAE components](#open-redirect-vulnerability-in-the-gae-components)
- [Cross-site scripting vulnerability in the Iframe Transport](#cross-site-scripting-vulnerability-in-the-iframe-transport)
## Potential vulnerabilities with PHP+ImageMagick
> Mitigated: 2018-10-25 (GMT)
The sample [PHP upload handler](server/php/UploadHandler.php) before [v9.25.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.25.1) did not validate file signatures before invoking [ImageMagick](https://www.imagemagick.org/) (via [Imagick](http://php.net/manual/en/book.imagick.php)).
Verifying those [magic bytes](https://en.wikipedia.org/wiki/List_of_file_signatures) mitigates potential vulnerabilities when handling input files other than `GIF/JPEG/PNG`.
The sample [PHP upload handler](server/php/UploadHandler.php) before
[v9.25.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.25.1)
did not validate file signatures before invoking
[ImageMagick](https://www.imagemagick.org/) (via
[Imagick](https://php.net/manual/en/book.imagick.php)).
Verifying those
[magic bytes](https://en.wikipedia.org/wiki/List_of_file_signatures) mitigates
potential vulnerabilities when handling input files other than `GIF/JPEG/PNG`.
Please also configure ImageMagick to only enable the coders required for `GIF/JPEG/PNG` processing, e.g. with the sample [ImageMagick config](SECURITY.md#imagemagick-config).
Please also configure ImageMagick to only enable the coders required for
`GIF/JPEG/PNG` processing, e.g. with the sample
[ImageMagick config](SECURITY.md#imagemagick-config).
**Further information:**
* Commit containing the mitigation: [fe44d34](https://github.com/blueimp/jQuery-File-Upload/commit/fe44d34be43be32c6b8d507932f318dababb25dd)
* [ImageTragick](https://imagetragick.com/)
* [CERT Vulnerability Note VU#332928](https://www.kb.cert.org/vuls/id/332928)
* [ImageMagick CVE entries](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=imagemagick)
- Commit containing the mitigation:
[fe44d34](https://github.com/blueimp/jQuery-File-Upload/commit/fe44d34be43be32c6b8d507932f318dababb25dd)
- [ImageTragick](https://imagetragick.com/)
- [CERT Vulnerability Note VU#332928](https://www.kb.cert.org/vuls/id/332928)
- [ImageMagick CVE entries](https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=imagemagick)
## Remote code execution vulnerability in the PHP component
> Fixed: 2018-10-23 (GMT)
The sample [PHP upload handler](server/php/UploadHandler.php) before [v9.24.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.24.1) allowed to upload all file types by default.
This opens up a remote code execution vulnerability, unless the server is configured to not execute (PHP) files in the upload directory (`server/php/files`).
The sample [PHP upload handler](server/php/UploadHandler.php) before
[v9.24.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/v9.24.1)
allowed to upload all file types by default.
This opens up a remote code execution vulnerability, unless the server is
configured to not execute (PHP) files in the upload directory
(`server/php/files`).
The provided [.htaccess](server/php/files/.htaccess) file includes instructions for Apache to disable script execution, however [.htaccess support](https://httpd.apache.org/docs/current/howto/htaccess.html) is disabled by default since Apache `v2.3.9` via [AllowOverride Directive](https://httpd.apache.org/docs/current/mod/core.html#allowoverride).
The provided [.htaccess](server/php/files/.htaccess) file includes instructions
for Apache to disable script execution, however
[.htaccess support](https://httpd.apache.org/docs/current/howto/htaccess.html)
is disabled by default since Apache `v2.3.9` via
[AllowOverride Directive](https://httpd.apache.org/docs/current/mod/core.html#allowoverride).
**You are affected if you:**
1. A) Uploaded jQuery File Upload < `v9.24.1` on a Webserver that executes files with `.php` as part of the file extension (e.g. "example.php.png"), e.g. Apache with `mod_php` enabled and the following directive (*not a recommended configuration*):
1. A) Uploaded jQuery File Upload < `v9.24.1` on a Webserver that executes files
with `.php` as part of the file extension (e.g. "example.php.png"), e.g.
Apache with `mod_php` enabled and the following directive (_not a recommended
configuration_):
```ApacheConf
AddHandler php5-script .php
```
B) Uploaded jQuery File Upload < `v9.22.1` on a Webserver that executes files with the file extension `.php`, e.g. Apache with `mod_php` enabled and the following directive:
B) Uploaded jQuery File Upload < `v9.22.1` on a Webserver that executes files
with the file extension `.php`, e.g. Apache with `mod_php` enabled and the
following directive:
```ApacheConf
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
```
2. Did not actively configure your Webserver to not execute files in the upload directory (`server/php/files`).
3. Are running Apache `v2.3.9+` with the default `AllowOverride` Directive set to `None` or another Webserver with no `.htaccess` support.
2. Did not actively configure your Webserver to not execute files in the upload
directory (`server/php/files`).
3. Are running Apache `v2.3.9+` with the default `AllowOverride` Directive set
to `None` or another Webserver with no `.htaccess` support.
**How to fix it:**
1. Upgrade to the latest version of jQuery File Upload.
2. Configure your Webserver to not execute files in the upload directory, e.g. with the [sample Apache configuration](SECURITY.md#apache-config)
2. Configure your Webserver to not execute files in the upload directory, e.g.
with the [sample Apache configuration](SECURITY.md#apache-config)
**Further information:**
* Commits containing the security fix: [aeb47e5](https://github.com/blueimp/jQuery-File-Upload/commit/aeb47e51c67df8a504b7726595576c1c66b5dc2f), [ad4aefd](https://github.com/blueimp/jQuery-File-Upload/commit/ad4aefd96e4056deab6fea2690f0d8cf56bb2d7d)
* [Full disclosure post on Hacker News](https://news.ycombinator.com/item?id=18267309).
* [CVE-2018-9206](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-9206)
* [OWASP - Unrestricted File Upload](https://www.owasp.org/index.php/Unrestricted_File_Upload)
- Commits containing the security fix:
[aeb47e5](https://github.com/blueimp/jQuery-File-Upload/commit/aeb47e51c67df8a504b7726595576c1c66b5dc2f),
[ad4aefd](https://github.com/blueimp/jQuery-File-Upload/commit/ad4aefd96e4056deab6fea2690f0d8cf56bb2d7d)
- [Full disclosure post on Hacker News](https://news.ycombinator.com/item?id=18267309).
- [CVE-2018-9206](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-9206)
- [OWASP - Unrestricted File Upload](https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload)
## Open redirect vulnerability in the GAE components
> Fixed: 2015-06-12 (GMT)
The sample Google App Engine upload handlers before v[9.10.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/9.10.1) accepted any URL as redirect target, making it possible to use the Webserver's domain for phishing attacks.
The sample Google App Engine upload handlers before
v[9.10.1](https://github.com/blueimp/jQuery-File-Upload/releases/tag/9.10.1)
accepted any URL as redirect target, making it possible to use the Webserver's
domain for phishing attacks.
**Further information:**
* Commit containing the security fix: [f74d2a8](https://github.com/blueimp/jQuery-File-Upload/commit/f74d2a8c3e3b1e8e336678d2899facd5bcdb589f)
* [OWASP - Unvalidated Redirects and Forwards Cheat Sheet](https://www.owasp.org/index.php/Unvalidated_Redirects_and_Forwards_Cheat_Sheet)
- Commit containing the security fix:
[f74d2a8](https://github.com/blueimp/jQuery-File-Upload/commit/f74d2a8c3e3b1e8e336678d2899facd5bcdb589f)
- [OWASP - Unvalidated Redirects and Forwards Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html)
## Cross-site scripting vulnerability in the Iframe Transport
> Fixed: 2012-08-09 (GMT)
The [redirect page](cors/result.html) for the [Iframe Transport](js/jquery.iframe-transport.js) before commit [4175032](https://github.com/blueimp/jQuery-File-Upload/commit/41750323a464e848856dc4c5c940663498beb74a) (*fixed in all tagged releases*) allowed executing arbitrary JavaScript in the context of the Webserver.
The [redirect page](cors/result.html) for the
[Iframe Transport](js/jquery.iframe-transport.js) before commit
[4175032](https://github.com/blueimp/jQuery-File-Upload/commit/41750323a464e848856dc4c5c940663498beb74a)
(_fixed in all tagged releases_) allowed executing arbitrary JavaScript in the
context of the Webserver.
**Further information:**
* Commit containing the security fix: [4175032](https://github.com/blueimp/jQuery-File-Upload/commit/41750323a464e848856dc4c5c940663498beb74a)
* [OWASP - Cross-site Scripting (XSS)](https://www.owasp.org/index.php/Cross-site_Scripting_(XSS))
- Commit containing the security fix:
[4175032](https://github.com/blueimp/jQuery-File-Upload/commit/41750323a464e848856dc4c5c940663498beb74a)
- [OWASP - Cross-site Scripting (XSS)](https://owasp.org/www-community/attacks/xss/)

View file

@ -1,211 +0,0 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin AngularJS Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Demo - AngularJS version</title>
<meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for AngularJS. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap styles -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css">
<!-- blueimp Gallery styles -->
<link rel="stylesheet" href="https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
<link rel="stylesheet" href="css/jquery.fileupload-ui.css">
<!-- CSS adjustments for browsers with JavaScript disabled -->
<noscript><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"></noscript>
<noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
<style>
/* Hide Angular JS elements before initializing */
.ng-cloak {
display: none;
}
</style>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
<li><a href="https://blueimp.net">&copy; Sebastian Tschan</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<h1>jQuery File Upload Demo</h1>
<h2 class="lead">AngularJS version</h2>
<ul class="nav nav-tabs">
<li><a href="basic.html">Basic</a></li>
<li><a href="basic-plus.html">Basic Plus</a></li>
<li><a href="index.html">Basic Plus UI</a></li>
<li class="active"><a href="angularjs.html">AngularJS</a></li>
<li><a href="jquery-ui.html">jQuery UI</a></li>
</ul>
<br>
<blockquote>
<p>File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for AngularJS.<br>
Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br>
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
</blockquote>
<br>
<!-- The file upload form used as target for the file upload widget -->
<form id="fileupload" action="https://jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data" data-ng-app="demo" data-ng-controller="DemoFileUploadController" data-file-upload="options" data-ng-class="{'fileupload-processing': processing() || loadingFiles}">
<!-- Redirect browsers with JavaScript disabled to the origin page -->
<noscript><input type="hidden" name="redirect" value="https://blueimp.github.io/jQuery-File-Upload/"></noscript>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="col-lg-7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button" ng-class="{disabled: disabled}">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple ng-disabled="disabled">
</span>
<button type="button" class="btn btn-primary start" data-ng-click="submit()">
<i class="glyphicon glyphicon-upload"></i>
<span>Start upload</span>
</button>
<button type="button" class="btn btn-warning cancel" data-ng-click="cancel()">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel upload</span>
</button>
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="col-lg-5 fade" data-ng-class="{in: active()}">
<!-- The global progress bar -->
<div class="progress progress-striped active" data-file-upload-progress="progress()"><div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div></div>
<!-- The extended global progress state -->
<div class="progress-extended">&nbsp;</div>
</div>
</div>
<!-- The table listing the files available for upload/download -->
<table class="table table-striped files ng-cloak">
<tr data-ng-repeat="file in queue" data-ng-class="{'processing': file.$processing()}">
<td data-ng-switch data-on="!!file.thumbnailUrl">
<div class="preview" data-ng-switch-when="true">
<a data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}" data-gallery><img data-ng-src="{{file.thumbnailUrl}}" alt=""></a>
</div>
<div class="preview" data-ng-switch-default data-file-upload-preview="file"></div>
</td>
<td>
<p class="name" data-ng-switch data-on="!!file.url">
<span data-ng-switch-when="true" data-ng-switch data-on="!!file.thumbnailUrl">
<a data-ng-switch-when="true" data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}" data-gallery>{{file.name}}</a>
<a data-ng-switch-default data-ng-href="{{file.url}}" title="{{file.name}}" download="{{file.name}}">{{file.name}}</a>
</span>
<span data-ng-switch-default>{{file.name}}</span>
</p>
<strong data-ng-show="file.error" class="error text-danger">{{file.error}}</strong>
</td>
<td>
<p class="size">{{file.size | formatFileSize}}</p>
<div class="progress progress-striped active fade" data-ng-class="{pending: 'in'}[file.$state()]" data-file-upload-progress="file.$progress()"><div class="progress-bar progress-bar-success" data-ng-style="{width: num + '%'}"></div></div>
</td>
<td>
<button type="button" class="btn btn-primary start" data-ng-click="file.$submit()" data-ng-hide="!file.$submit || options.autoUpload" data-ng-disabled="file.$state() == 'pending' || file.$state() == 'rejected'">
<i class="glyphicon glyphicon-upload"></i>
<span>Start</span>
</button>
<button type="button" class="btn btn-warning cancel" data-ng-click="file.$cancel()" data-ng-hide="!file.$cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
<button data-ng-controller="FileDestroyController" type="button" class="btn btn-danger destroy" data-ng-click="file.$destroy()" data-ng-hide="!file.$destroy">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
</td>
</tr>
</table>
</form>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Demo Notes</h3>
</div>
<div class="panel-body">
<ul>
<li>The maximum file size for uploads in this demo is <strong>999 KB</strong> (default file size is unlimited).</li>
<li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
<li>Uploaded files will be deleted automatically after <strong>5 minutes or less</strong> (demo files are stored in memory).</li>
<li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
<li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
<li>Built with the <a href="http://getbootstrap.com/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>
</ul>
</div>
</div>
</div>
<!-- The blueimp Gallery widget -->
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev"></a>
<a class="next"></a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js" integrity="sha384-r6jjWwxAypHaESwS5an5J9dkfzwQuKVNV9FZM9B6fnt8PFuY0cVwLhV7BltCZhLy" crossorigin="anonymous"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- blueimp Gallery script -->
<script src="https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery.fileupload-validate.js"></script>
<!-- The File Upload Angular JS module -->
<script src="js/jquery.fileupload-angular.js"></script>
<!-- The main application script -->
<script src="js/app.js"></script>
</body>
</html>

View file

@ -1,226 +0,0 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin Basic Plus Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Demo - Basic Plus version</title>
<meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap styles -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
<li><a href="https://blueimp.net">&copy; Sebastian Tschan</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<h1>jQuery File Upload Demo</h1>
<h2 class="lead">Basic Plus version</h2>
<ul class="nav nav-tabs">
<li><a href="basic.html">Basic</a></li>
<li class="active"><a href="basic-plus.html">Basic Plus</a></li>
<li><a href="index.html">Basic Plus UI</a></li>
<li><a href="angularjs.html">AngularJS</a></li>
<li><a href="jquery-ui.html">jQuery UI</a></li>
</ul>
<br>
<blockquote>
<p>File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images, audio and video for jQuery.<br>
Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br>
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
</blockquote>
<br>
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<!-- The file input field used as target for the file upload widget -->
<input id="fileupload" type="file" name="files[]" multiple>
</span>
<br>
<br>
<!-- The global progress bar -->
<div id="progress" class="progress">
<div class="progress-bar progress-bar-success"></div>
</div>
<!-- The container for the uploaded files -->
<div id="files" class="files"></div>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Demo Notes</h3>
</div>
<div class="panel-body">
<ul>
<li>The maximum file size for uploads in this demo is <strong>999 KB</strong> (default file size is unlimited).</li>
<li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
<li>Uploaded files will be deleted automatically after <strong>5 minutes or less</strong> (demo files are stored in memory).</li>
<li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
<li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
<li>Built with the <a href="http://getbootstrap.com/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>
</ul>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" crossorigin="anonymous"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery.fileupload-validate.js"></script>
<script>
/*jslint unparam: true, regexp: true */
/*global window, $ */
$(function () {
'use strict';
// Change this to the location of your server-side upload handler:
var url = window.location.hostname === 'blueimp.github.io' ?
'//jquery-file-upload.appspot.com/' : 'server/php/',
uploadButton = $('<button/>')
.addClass('btn btn-primary')
.prop('disabled', true)
.text('Processing...')
.on('click', function () {
var $this = $(this),
data = $this.data();
$this
.off('click')
.text('Abort')
.on('click', function () {
$this.remove();
data.abort();
});
data.submit().always(function () {
$this.remove();
});
});
$('#fileupload').fileupload({
url: url,
dataType: 'json',
autoUpload: false,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
maxFileSize: 999000,
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
previewMaxWidth: 100,
previewMaxHeight: 100,
previewCrop: true
}).on('fileuploadadd', function (e, data) {
data.context = $('<div/>').appendTo('#files');
$.each(data.files, function (index, file) {
$('<p/>')
.append($('<span/>').text(file.name))
.appendTo(data.context);
if (index === data.files.length - 1) {
$('<p/>')
.append(uploadButton.clone(true).data(data))
.appendTo(data.context);
}
});
}).on('fileuploadprocessalways', function (e, data) {
var index = data.index,
file = data.files[index],
node = $(data.context.children()[index]);
if (file.preview) {
node
.prepend('<br>')
.prepend(file.preview);
}
if (file.error) {
node
.append('<br>')
.append($('<span class="text-danger"/>').text(file.error));
}
if (index + 1 === data.files.length) {
data.context.find('button')
.text('Upload')
.prop('disabled', !!data.files.error);
}
}).on('fileuploadprogressall', function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .progress-bar').css(
'width',
progress + '%'
);
}).on('fileuploaddone', function (e, data) {
$.each(data.result.files, function (index, file) {
if (file.url) {
var link = $('<a>')
.attr('target', '_blank')
.prop('href', file.url);
$(data.context.children()[index])
.wrap(link);
} else if (file.error) {
var error = $('<span class="text-danger"/>').text(file.error);
$(data.context.children()[index])
.append('<br>')
.append(error);
}
});
}).on('fileuploadfail', function (e, data) {
$.each(data.files, function (index) {
var error = $('<span class="text-danger"/>').text('File upload failed.');
$(data.context.children()[index])
.append('<br>')
.append(error);
});
}).prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
});
</script>
</body>
</html>

View file

@ -1,136 +0,0 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin Basic Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Demo - Basic version</title>
<meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support and progress bar for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap styles -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
<li><a href="https://blueimp.net">&copy; Sebastian Tschan</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<h1>jQuery File Upload Demo</h1>
<h2 class="lead">Basic version</h2>
<ul class="nav nav-tabs">
<li class="active"><a href="basic.html">Basic</a></li>
<li><a href="basic-plus.html">Basic Plus</a></li>
<li><a href="index.html">Basic Plus UI</a></li>
<li><a href="angularjs.html">AngularJS</a></li>
<li><a href="jquery-ui.html">jQuery UI</a></li>
</ul>
<br>
<blockquote>
<p>File Upload widget with multiple file selection, drag&amp;drop support and progress bar for jQuery.<br>
Supports cross-domain, chunked and resumable file uploads.<br>
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
</blockquote>
<br>
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Select files...</span>
<!-- The file input field used as target for the file upload widget -->
<input id="fileupload" type="file" name="files[]" multiple>
</span>
<br>
<br>
<!-- The global progress bar -->
<div id="progress" class="progress">
<div class="progress-bar progress-bar-success"></div>
</div>
<!-- The container for the uploaded files -->
<div id="files" class="files"></div>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Demo Notes</h3>
</div>
<div class="panel-body">
<ul>
<li>The maximum file size for uploads in this demo is <strong>999 KB</strong> (default file size is unlimited).</li>
<li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
<li>Uploaded files will be deleted automatically after <strong>5 minutes or less</strong> (demo files are stored in memory).</li>
<li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
<li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
<li>Built with the <a href="http://getbootstrap.com/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>
</ul>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" crossorigin="anonymous"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script>
/*jslint unparam: true */
/*global window, $ */
$(function () {
'use strict';
// Change this to the location of your server-side upload handler:
var url = window.location.hostname === 'blueimp.github.io' ?
'//jquery-file-upload.appspot.com/' : 'server/php/';
$('#fileupload').fileupload({
url: url,
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo('#files');
});
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .progress-bar').css(
'width',
progress + '%'
);
}
}).prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
});
</script>
</body>
</html>

View file

@ -1,16 +0,0 @@
#!/usr/bin/env node
'use strict';
var path = require('path');
var packageJSON = require(path.join(__dirname, 'package.json'));
var bowerFile = path.join(__dirname, 'bower.json');
var bowerJSON = require('bower-json').parse(
require(bowerFile),
{normalize: true}
);
bowerJSON.version = packageJSON.version;
require('fs').writeFileSync(
bowerFile,
JSON.stringify(bowerJSON, null, 2) + '\n'
);

View file

@ -1,64 +0,0 @@
{
"name": "blueimp-file-upload",
"version": "9.34.0",
"title": "jQuery File Upload",
"description": "File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images.",
"keywords": [
"jquery",
"file",
"upload",
"widget",
"multiple",
"selection",
"drag",
"drop",
"progress",
"preview",
"cross-domain",
"cross-site",
"chunk",
"resume",
"gae",
"go",
"python",
"php",
"bootstrap"
],
"homepage": "https://github.com/blueimp/jQuery-File-Upload",
"author": {
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
},
"maintainers": [
{
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
}
],
"repository": {
"type": "git",
"url": "git://github.com/blueimp/jQuery-File-Upload.git"
},
"bugs": "https://github.com/blueimp/jQuery-File-Upload/issues",
"license": "MIT",
"dependencies": {
"jquery": ">=1.6",
"blueimp-tmpl": ">=2.5.4",
"blueimp-load-image": ">=1.13.0",
"blueimp-canvas-to-blob": ">=2.1.1"
},
"main": [
"js/jquery.fileupload.js"
],
"ignore": [
"/*.*",
"/cors",
"css/jquery-ui-demo-ie8.css",
"css/jquery-ui-demo.css",
"css/style.css",
"js/app.js",
"js/main.js",
"server",
"test"
]
}

View file

@ -28,7 +28,7 @@
}
]
, "support": {
"forum": "https://groups.google.com/forum/#!forum/jquery-fileupload"
"forum": "https://stackoverflow.com/questions/tagged/blueimp+jquery+file-upload"
}
, "license": "MIT"
, "autoload": {

View file

@ -1,4 +1,4 @@
<!DOCTYPE HTML>
<!DOCTYPE html>
<!--
/*
* jQuery File Upload Plugin postMessage API
@ -12,19 +12,21 @@
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery File Upload Plugin postMessage API</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" crossorigin="anonymous"></script>
</head>
<body>
<script>
/*jslint unparam: true, regexp: true */
/*global $, Blob, FormData, location */
'use strict';
var origin = /^http:\/\/example.org/,
<head>
<meta charset="utf-8" />
<title>jQuery File Upload Plugin postMessage API</title>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"
integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
crossorigin="anonymous"
></script>
</head>
<body>
<script>
'use strict';
var origin = /^https:\/\/example.org/,
target = new RegExp('^(http(s)?:)?\\/\\/' + location.host + '\\/');
$(window).on('message', function (e) {
$(window).on('message', function (e) {
e = e.originalEvent;
var s = e.data,
xhr = $.ajaxSettings.xhr(),
@ -33,18 +35,23 @@ $(window).on('message', function (e) {
throw new Error('Origin "' + e.origin + '" does not match ' + origin);
}
if (!target.test(e.data.url)) {
throw new Error('Target "' + e.data.url + '" does not match ' + target);
throw new Error(
'Target "' + e.data.url + '" does not match ' + target
);
}
$(xhr.upload).on('progress', function (ev) {
ev = ev.originalEvent;
e.source.postMessage({
e.source.postMessage(
{
id: s.id,
type: ev.type,
timeStamp: ev.timeStamp,
lengthComputable: ev.lengthComputable,
loaded: ev.loaded,
total: ev.total
}, e.origin);
},
e.origin
);
});
s.xhr = function () {
return xhr;
@ -61,15 +68,18 @@ $(window).on('message', function (e) {
jqXHR = result;
result = null;
}
e.source.postMessage({
e.source.postMessage(
{
id: s.id,
status: jqXHR.status,
statusText: statusText,
result: result,
headers: jqXHR.getAllResponseHeaders()
}, e.origin);
},
e.origin
);
});
});
</script>
</body>
});
</script>
</body>
</html>

View file

@ -1,4 +1,4 @@
<!DOCTYPE HTML>
<!DOCTYPE html>
<!--
/*
* jQuery Iframe Transport Plugin Redirect Page
@ -12,13 +12,15 @@
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Iframe Transport Plugin Redirect Page</title>
</head>
<body>
<script>
document.body.innerText=document.body.textContent=decodeURIComponent(window.location.search.slice(1));
</script>
</body>
<head>
<meta charset="utf-8" />
<title>jQuery Iframe Transport Plugin Redirect Page</title>
</head>
<body>
<script>
document.body.innerText = document.body.textContent = decodeURIComponent(
window.location.search.slice(1)
);
</script>
</body>
</html>

View file

@ -1,21 +0,0 @@
@charset "UTF-8";
/*
* jQuery File Upload Demo CSS Fixes for IE<9
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
.navigation {
list-style: none;
padding: 0;
margin: 1em 0;
}
.navigation li {
display: inline;
margin-right: 10px;
}

View file

@ -1,67 +0,0 @@
@charset "UTF-8";
/*
* jQuery File Upload Demo CSS
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
body {
max-width: 750px;
margin: 0 auto;
padding: 1em;
font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif;
font-size: 1em;
line-height: 1.4em;
background: #222;
color: #fff;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
a {
color: orange;
text-decoration: none;
}
img {
border: 0;
vertical-align: middle;
}
h1 {
line-height: 1em;
}
blockquote {
padding: 0 0 0 15px;
margin: 0 0 20px;
border-left: 5px solid #eee;
}
table {
width: 100%;
margin: 10px 0;
}
.fileupload-progress {
margin: 10px 0;
}
.fileupload-progress .progress-extended {
margin-top: 5px;
}
.error {
color: red;
}
@media (min-width: 481px) {
.navigation {
list-style: none;
padding: 0;
}
.navigation li {
display: inline-block;
}
.navigation li:not(:first-child):before {
content: "| ";
}
}

View file

@ -10,13 +10,9 @@
* https://opensource.org/licenses/MIT
*/
.fileupload-buttonbar .btn,
.fileupload-buttonbar .toggle {
margin-bottom: 5px;
}
.progress-animated .progress-bar,
.progress-animated .bar {
background: url("../img/progressbar.gif") !important;
background: url('../img/progressbar.gif') !important;
filter: none;
}
.fileupload-process {
@ -28,30 +24,45 @@
display: block;
width: 32px;
height: 32px;
background: url("../img/loading.gif") center no-repeat;
background: url('../img/loading.gif') center no-repeat;
background-size: contain;
}
.files audio,
.files video {
max-width: 300px;
}
.files .name {
word-wrap: break-word;
overflow-wrap: anywhere;
-webkit-hyphens: auto;
hyphens: auto;
}
.files button {
margin-bottom: 5px;
}
.toggle[type='checkbox'] {
transform: scale(2);
margin-left: 10px;
}
@media (max-width: 767px) {
.fileupload-buttonbar .btn {
margin-bottom: 5px;
}
.fileupload-buttonbar .delete,
.fileupload-buttonbar .toggle,
.files .toggle,
.files .btn span {
display: none;
}
.files .name {
width: 80px;
word-wrap: break-word;
}
.files audio,
.files video {
max-width: 80px;
}
.files img,
.files canvas {
max-width: 100%;
}
@media (max-width: 480px) {
.files .image td:nth-child(2) {
display: none;
}
}

View file

@ -20,8 +20,9 @@
top: 0;
right: 0;
margin: 0;
height: 100%;
opacity: 0;
-ms-filter: 'alpha(opacity=0)';
filter: alpha(opacity=0);
font-size: 200px !important;
direction: ltr;
cursor: pointer;
@ -30,8 +31,6 @@
/* Fixes for IE < 8 */
@media screen\9 {
.fileinput-button input {
filter: alpha(opacity=0);
font-size: 100%;
height: 100%;
font-size: 150% !important;
}
}

View file

@ -1,15 +0,0 @@
@charset "UTF-8";
/*
* jQuery File Upload Plugin CSS Example
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
body {
padding-top: 60px;
}

View file

@ -0,0 +1,59 @@
version: '3.7'
services:
example:
build: server/php
ports:
- 127.0.0.1:80:80
- ${SERVER_HOST:-127.0.0.1}:${SERVER_PORT-}:80
volumes:
- .:/var/www/html
mocha:
image: blueimp/mocha-chrome
command: http://example/test
environment:
- WAIT_FOR_HOSTS=example:80
depends_on:
- example
chromedriver:
image: blueimp/chromedriver
init: true
tmpfs: /tmp
environment:
- DISABLE_X11=false
- ENABLE_VNC=true
- EXPOSE_X11=true
volumes:
- ./wdio/assets:/home/webdriver/assets:ro
ports:
- 127.0.0.1:5900:5900
geckodriver:
image: blueimp/geckodriver
init: true
tmpfs: /tmp
shm_size: 2g
environment:
- DISABLE_X11=false
- ENABLE_VNC=true
- EXPOSE_X11=true
volumes:
- ./wdio/assets:/home/webdriver/assets:ro
ports:
- 127.0.0.1:5901:5900
wdio:
image: blueimp/wdio
init: true
read_only: true
tmpfs:
- /tmp
environment:
- WAIT_FOR_HOSTS= chromedriver:4444 geckodriver:4444 example:80
- WINDOWS_HOST
- MACOS_ASSETS_DIR=$PWD/wdio/assets/
- WINDOWS_ASSETS_DIR
volumes:
- ./wdio:/opt:ro
- ./wdio/reports:/opt/reports
depends_on:
- chromedriver
- geckodriver
- example

View file

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<!DOCTYPE html>
<!--
/*
* jQuery File Upload Plugin Demo
* jQuery File Upload Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
@ -12,70 +12,95 @@
*/
-->
<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Demo</title>
<meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap styles -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css">
<!-- blueimp Gallery styles -->
<link rel="stylesheet" href="https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
<link rel="stylesheet" href="css/jquery.fileupload-ui.css">
<!-- CSS adjustments for browsers with JavaScript disabled -->
<noscript><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"></noscript>
<noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<![endif]-->
<meta charset="utf-8" />
<title>jQuery File Upload Demo</title>
<meta
name="description"
content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads."
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Bootstrap styles -->
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous"
/>
<!-- Generic page styles -->
<style>
#navigation {
margin: 10px 0;
}
@media (max-width: 767px) {
#title,
#description {
display: none;
}
}
</style>
<!-- blueimp Gallery styles -->
<link
rel="stylesheet"
href="https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css"
/>
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css" />
<link rel="stylesheet" href="css/jquery.fileupload-ui.css" />
<!-- CSS adjustments for browsers with JavaScript disabled -->
<noscript
><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"
/></noscript>
<noscript
><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"
/></noscript>
</head>
<body>
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
<li><a href="https://blueimp.net">&copy; Sebastian Tschan</a></li>
<ul class="nav nav-tabs" id="navigation">
<li>
<a href="https://github.com/blueimp/jQuery-File-Upload">Project</a>
</li>
<li class="active">
<a href="#">Demo</a>
</li>
<li>
<a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Wiki</a>
</li>
<li>
<a href="https://blueimp.net">Author</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<h1>jQuery File Upload Demo</h1>
<h2 class="lead">Basic Plus UI version</h2>
<ul class="nav nav-tabs">
<li><a href="basic.html">Basic</a></li>
<li><a href="basic-plus.html">Basic Plus</a></li>
<li class="active"><a href="index.html">Basic Plus UI</a></li>
<li><a href="angularjs.html">AngularJS</a></li>
<li><a href="jquery-ui.html">jQuery UI</a></li>
</ul>
<br>
<blockquote>
<p>File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery.<br>
Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br>
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
<h1 id="title">jQuery File Upload Demo</h1>
<blockquote id="description">
<p>
File Upload widget with multiple file selection, drag&amp;drop
support, progress bars, validation and preview images, audio and video
for jQuery.<br />
Supports cross-domain, chunked and resumable file uploads and
client-side image resizing.<br />
Works with any server-side platform (PHP, Python, Ruby on Rails, Java,
Node.js, Go etc.) that supports standard HTML form file uploads.
</p>
</blockquote>
<br>
<!-- The file upload form used as target for the file upload widget -->
<form id="fileupload" action="https://jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
<form
id="fileupload"
action="https://jquery-file-upload.appspot.com/"
method="POST"
enctype="multipart/form-data"
>
<!-- Redirect browsers with JavaScript disabled to the origin page -->
<noscript><input type="hidden" name="redirect" value="https://blueimp.github.io/jQuery-File-Upload/"></noscript>
<noscript
><input
type="hidden"
name="redirect"
value="https://blueimp.github.io/jQuery-File-Upload/"
/></noscript>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="col-lg-7">
@ -83,7 +108,7 @@
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
<input type="file" name="files[]" multiple />
</span>
<button type="submit" class="btn btn-primary start">
<i class="glyphicon glyphicon-upload"></i>
@ -95,63 +120,130 @@
</button>
<button type="button" class="btn btn-danger delete">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
<span>Delete selected</span>
</button>
<input type="checkbox" class="toggle">
<input type="checkbox" class="toggle" />
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="col-lg-5 fileupload-progress fade">
<!-- The global progress bar -->
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-success" style="width:0%;"></div>
<div
class="progress progress-striped active"
role="progressbar"
aria-valuemin="0"
aria-valuemax="100"
>
<div
class="progress-bar progress-bar-success"
style="width: 0%;"
></div>
</div>
<!-- The extended global progress state -->
<div class="progress-extended">&nbsp;</div>
</div>
</div>
<!-- The table listing the files available for upload/download -->
<table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
<table role="presentation" class="table table-striped">
<tbody class="files"></tbody>
</table>
</form>
<br>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Demo Notes</h3>
</div>
<div class="panel-body">
<ul>
<li>The maximum file size for uploads in this demo is <strong>999 KB</strong> (default file size is unlimited).</li>
<li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
<li>Uploaded files will be deleted automatically after <strong>5 minutes or less</strong> (demo files are stored in memory).</li>
<li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
<li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
<li>Built with the <a href="http://getbootstrap.com/">Bootstrap</a> CSS framework and Icons from <a href="http://glyphicons.com/">Glyphicons</a>.</li>
<li>
The maximum file size for uploads in this demo is
<strong>999 KB</strong> (default file size is unlimited).
</li>
<li>
Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in
this demo (by default there is no file type restriction).
</li>
<li>
Uploaded files will be deleted automatically after
<strong>5 minutes or less</strong> (demo files are stored in
memory).
</li>
<li>
You can <strong>drag &amp; drop</strong> files from your desktop
on this webpage (see
<a
href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support"
>Browser support</a
>).
</li>
<li>
Please refer to the
<a href="https://github.com/blueimp/jQuery-File-Upload"
>project website</a
>
and
<a href="https://github.com/blueimp/jQuery-File-Upload/wiki"
>documentation</a
>
for more information.
</li>
<li>
Built with the
<a href="https://getbootstrap.com/">Bootstrap</a> CSS framework
and Icons from <a href="https://glyphicons.com/">Glyphicons</a>.
</li>
</ul>
</div>
</div>
</div>
<!-- The blueimp Gallery widget -->
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
<div class="slides"></div>
</div>
<!-- The blueimp Gallery widget -->
<div
id="blueimp-gallery"
class="blueimp-gallery blueimp-gallery-controls"
aria-label="image gallery"
aria-modal="true"
role="dialog"
data-filter=":even"
>
<div class="slides" aria-live="polite"></div>
<h3 class="title"></h3>
<a class="prev"></a>
<a class="next"></a>
<a class="close">×</a>
<a class="play-pause"></a>
<a
class="prev"
aria-controls="blueimp-gallery"
aria-label="previous slide"
aria-keyshortcuts="ArrowLeft"
></a>
<a
class="next"
aria-controls="blueimp-gallery"
aria-label="next slide"
aria-keyshortcuts="ArrowRight"
></a>
<a
class="close"
aria-controls="blueimp-gallery"
aria-label="close"
aria-keyshortcuts="Escape"
></a>
<a
class="play-pause"
aria-controls="blueimp-gallery"
aria-label="play slideshow"
aria-keyshortcuts="Space"
aria-pressed="false"
role="button"
></a>
<ol class="indicator"></ol>
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade{%=o.options.loadImageFileTypes.test(file.type)?' image':''%}">
<td>
<span class="preview"></span>
</td>
<td>
{% if (window.innerWidth > 480 || !o.options.loadImageFileTypes.test(file.type)) { %}
<p class="name">{%=file.name%}</p>
{% } %}
<strong class="error text-danger"></strong>
</td>
<td>
@ -159,6 +251,12 @@
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
</td>
<td>
{% if (!o.options.autoUpload && o.options.edit && o.options.loadImageFileTypes.test(file.type)) { %}
<button class="btn btn-success edit" data-index="{%=i%}" disabled>
<i class="glyphicon glyphicon-edit"></i>
<span>Edit</span>
</button>
{% } %}
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-primary start" disabled>
<i class="glyphicon glyphicon-upload"></i>
@ -173,12 +271,12 @@
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade">
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade{%=file.thumbnailUrl?' image':''%}">
<td>
<span class="preview">
{% if (file.thumbnailUrl) { %}
@ -187,7 +285,6 @@
</span>
</td>
<td>
{% if (window.innerWidth > 480 || !file.thumbnailUrl) { %}
<p class="name">
{% if (file.url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
@ -195,7 +292,6 @@
<span>{%=file.name%}</span>
{% } %}
</p>
{% } %}
{% if (file.error) { %}
<div><span class="label label-danger">Error</span> {%=file.error%}</div>
{% } %}
@ -218,42 +314,44 @@
{% } %}
</td>
</tr>
{% } %}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" crossorigin="anonymous"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- blueimp Gallery script -->
<script src="https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="js/jquery.fileupload-ui.js"></script>
<!-- The main application script -->
<script src="js/main.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
<!--[if (gte IE 8)&(lt IE 10)]>
<script src="js/cors/jquery.xdr-transport.js"></script>
<![endif]-->
</body>
{% } %}
</script>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"
integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
crossorigin="anonymous"
></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="js/vendor/jquery.ui.widget.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<!-- blueimp Gallery script -->
<script src="https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="js/jquery.fileupload-ui.js"></script>
<!-- The main application script -->
<script src="js/demo.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
<!--[if (gte IE 8)&(lt IE 10)]>
<script src="js/cors/jquery.xdr-transport.js"></script>
<![endif]-->
</body>
</html>

View file

@ -1,256 +0,0 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin jQuery UI Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Demo - jQuery UI version</title>
<meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- jQuery UI styles -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/dark-hive/jquery-ui.css" integrity="sha384-ufZtQaOYGuy/CibAC5jmelOpBu3H78Js7HrXSLo4LGccHUrGGHXt+uaTcDbio3kI" crossorigin="anonymous">
<!-- Generic page styles -->
<link rel="stylesheet" href="css/style.css">
<!-- Demo styles -->
<link rel="stylesheet" href="css/jquery-ui-demo.css">
<!--[if lte IE 8]>
<link rel="stylesheet" href="css/jquery-ui-demo-ie8.css">
<![endif]-->
<style>
/* Adjust the jQuery UI widget font-size: */
.ui-widget {
font-size: 0.95em;
}
</style>
<!-- blueimp Gallery styles -->
<link rel="stylesheet" href="https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="css/jquery.fileupload.css">
<link rel="stylesheet" href="css/jquery.fileupload-ui.css">
<!-- CSS adjustments for browsers with JavaScript disabled -->
<noscript><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"></noscript>
<noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
</head>
<body>
<ul class="navigation">
<li><h3><a href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a></h3></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload/tags">Download</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
<li><a href="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
<li><a href="https://blueimp.net">&copy; blueimp.net</a></li>
</ul>
<h1>jQuery File Upload Demo</h1>
<h2>jQuery UI version</h2>
<form>
<label for="theme-switcher">Theme:</label>
<select id="theme-switcher" class="pull-right">
<option value="black-tie">Black Tie</option>
<option value="blitzer">Blitzer</option>
<option value="cupertino">Cupertino</option>
<option value="dark-hive" selected>Dark Hive</option>
<option value="dot-luv">Dot Luv</option>
<option value="eggplant">Eggplant</option>
<option value="excite-bike">Excite Bike</option>
<option value="flick">Flick</option>
<option value="hot-sneaks">Hot sneaks</option>
<option value="humanity">Humanity</option>
<option value="le-frog">Le Frog</option>
<option value="mint-choc">Mint Choc</option>
<option value="overcast">Overcast</option>
<option value="pepper-grinder">Pepper Grinder</option>
<option value="redmond">Redmond</option>
<option value="smoothness">Smoothness</option>
<option value="south-street">South Street</option>
<option value="start">Start</option>
<option value="sunny">Sunny</option>
<option value="swanky-purse">Swanky Purse</option>
<option value="trontastic">Trontastic</option>
<option value="ui-darkness">UI Darkness</option>
<option value="ui-lightness">UI Lightness</option>
<option value="vader">Vader</option>
</select>
</form>
<ul class="navigation">
<li><a href="basic.html">Basic</a></li>
<li><a href="basic-plus.html">Basic Plus</a></li>
<li><a href="index.html">Basic Plus UI</a></li>
<li><a href="angularjs.html">AngularJS</a></li>
<li class="active"><a href="jquery-ui.html">jQuery UI</a></li>
</ul>
<blockquote>
<p>File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery UI.<br>
Supports cross-domain, chunked and resumable file uploads and client-side image resizing.<br>
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
</blockquote>
<!-- The file upload form used as target for the file upload widget -->
<form id="fileupload" action="https://jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
<!-- Redirect browsers with JavaScript disabled to the origin page -->
<noscript><input type="hidden" name="redirect" value="https://blueimp.github.io/jQuery-File-Upload/"></noscript>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="fileupload-buttonbar">
<div class="fileupload-buttons">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="fileinput-button">
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button type="submit" class="start">Start upload</button>
<button type="reset" class="cancel">Cancel upload</button>
<button type="button" class="delete">Delete</button>
<input type="checkbox" class="toggle">
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="fileupload-progress fade" style="display:none">
<!-- The global progress bar -->
<div class="progress" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
<!-- The extended global progress state -->
<div class="progress-extended">&nbsp;</div>
</div>
</div>
<!-- The table listing the files available for upload/download -->
<table role="presentation"><tbody class="files"></tbody></table>
</form>
<br>
<h3>Demo Notes</h3>
<ul>
<li>The maximum file size for uploads in this demo is <strong>999 KB</strong> (default file size is unlimited).</li>
<li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
<li>Uploaded files will be deleted automatically after <strong>5 minutes or less</strong> (demo files are stored in memory).</li>
<li>You can <strong>drag &amp; drop</strong> files from your desktop on this webpage (see <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</li>
<li>Please refer to the <a href="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <a href="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
<li>Built with <a href="https://jqueryui.com">jQuery UI</a>.</li>
</ul>
<!-- The blueimp Gallery widget -->
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev"></a>
<a class="next"></a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol>
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td>
<span class="preview"></span>
</td>
<td>
{% if (window.innerWidth > 480 || !o.options.loadImageFileTypes.test(file.type)) { %}
<p class="name">{%=file.name%}</p>
{% } %}
<strong class="error"></strong>
</td>
<td>
<p class="size">Processing...</p>
<div class="progress"></div>
</td>
<td>
{% if (!i && !o.options.autoUpload) { %}
<button class="start" disabled>Start</button>
{% } %}
{% if (!i) { %}
<button class="cancel">Cancel</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade">
<td>
<span class="preview">
{% if (file.thumbnailUrl) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
{% } %}
</span>
</td>
<td>
{% if (window.innerWidth > 480 || !file.thumbnailUrl) { %}
<p class="name">
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
</p>
{% } %}
{% if (file.error) { %}
<div><span class="error">Error</span> {%=file.error%}</div>
{% } %}
</td>
<td>
<span class="size">{%=o.formatFileSize(file.size)%}</span>
</td>
<td>
<button class="delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>Delete</button>
<input type="checkbox" name="delete" value="1" class="toggle">
</td>
</tr>
{% } %}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha384-xBuQ/xzmlsLoJpyjoggmTEz8OWUFM0/RC5BsqQBDX2v5cMvDHcMakNTNrHIW2I5f" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" integrity="sha384-Dziy8F2VlJQLMShA6FHWNul/veM9bCkRUaLqr199K94ntO5QUrLJBEbYegdSkkqX" crossorigin="anonymous"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<!-- blueimp Gallery script -->
<script src="https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="js/jquery.fileupload-process.js"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="js/jquery.fileupload-image.js"></script>
<!-- The File Upload audio preview plugin -->
<script src="js/jquery.fileupload-audio.js"></script>
<!-- The File Upload video preview plugin -->
<script src="js/jquery.fileupload-video.js"></script>
<!-- The File Upload validation plugin -->
<script src="js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="js/jquery.fileupload-ui.js"></script>
<!-- The File Upload jQuery UI plugin -->
<script src="js/jquery.fileupload-jquery-ui.js"></script>
<!-- The main application script -->
<script src="js/main.js"></script>
<script>
// Initialize the jQuery UI theme switcher:
$('#theme-switcher').change(function () {
var theme = $('#theme');
theme.prop(
'href',
theme.prop('href').replace(
/[\w\-]+\/jquery-ui.css/,
$(this).val() + '/jquery-ui.css'
)
);
});
</script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
<!--[if (gte IE 8)&(lt IE 10)]>
<script src="js/cors/jquery.xdr-transport.js"></script>
<![endif]-->
</body>
</html>

View file

@ -1,101 +0,0 @@
/*
* jQuery File Upload Plugin Angular JS Example
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global window, angular */
;(function () {
'use strict';
var isOnGitHub = window.location.hostname === 'blueimp.github.io',
url = isOnGitHub ? '//jquery-file-upload.appspot.com/' : 'server/php/';
angular.module('demo', [
'blueimp.fileupload'
])
.config([
'$httpProvider', 'fileUploadProvider',
function ($httpProvider, fileUploadProvider) {
delete $httpProvider.defaults.headers.common['X-Requested-With'];
fileUploadProvider.defaults.redirect = window.location.href.replace(
/\/[^\/]*$/,
'/cors/result.html?%s'
);
if (isOnGitHub) {
// Demo settings:
angular.extend(fileUploadProvider.defaults, {
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
maxFileSize: 999000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
});
}
}
])
.controller('DemoFileUploadController', [
'$scope', '$http', '$filter', '$window',
function ($scope, $http) {
$scope.options = {
url: url
};
if (!isOnGitHub) {
$scope.loadingFiles = true;
$http.get(url)
.then(
function (response) {
$scope.loadingFiles = false;
$scope.queue = response.data.files || [];
},
function () {
$scope.loadingFiles = false;
}
);
}
}
])
.controller('FileDestroyController', [
'$scope', '$http',
function ($scope, $http) {
var file = $scope.file,
state;
if (file.url) {
file.$state = function () {
return state;
};
file.$destroy = function () {
state = 'pending';
return $http({
url: file.deleteUrl,
method: file.deleteType
}).then(
function () {
state = 'resolved';
$scope.clear(file);
},
function () {
state = 'rejected';
}
);
};
} else if (!file.$cancel && !file._index) {
file.$cancel = function () {
$scope.clear(file);
};
}
}
]);
}());

View file

@ -9,9 +9,9 @@
* https://opensource.org/licenses/MIT
*/
/* global define, require, window, document */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
@ -23,7 +23,7 @@
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
})(function ($) {
'use strict';
var counter = 0,
@ -61,7 +61,7 @@
$.ajaxTransport('postmessage', function (options) {
if (options.postMessage && window.postMessage) {
var iframe,
loc = $('<a>').prop('href', options.postMessage)[0],
loc = $('<a></a>').prop('href', options.postMessage)[0],
target = loc.protocol + '//' + loc.host,
xhrUpload = options.xhr().upload;
// IE always includes the port for the host property of a link
@ -79,17 +79,20 @@
eventName = 'message.' + message.id;
iframe = $(
'<iframe style="display:none;" src="' +
options.postMessage + '" name="' +
message.id + '"></iframe>'
).bind('load', function () {
options.postMessage +
'" name="' +
message.id +
'"></iframe>'
)
.on('load', function () {
$.each(names, function (i, name) {
message[name] = options[name];
});
message.dataType = message.dataType.replace('postmessage ', '');
$(window).bind(eventName, function (e) {
e = e.originalEvent;
var data = e.data,
ev;
$(window).on(eventName, function (event) {
var e = event.originalEvent;
var data = e.data;
var ev;
if (e.origin === target && data.id === message.id) {
if (data.type === 'progress') {
ev = document.createEvent('Event');
@ -100,19 +103,17 @@
completeCallback(
data.status,
data.statusText,
{postmessage: data.result},
{ postmessage: data.result },
data.headers
);
iframe.remove();
$(window).unbind(eventName);
$(window).off(eventName);
}
}
});
iframe[0].contentWindow.postMessage(
message,
target
);
}).appendTo(document.body);
iframe[0].contentWindow.postMessage(message, target);
})
.appendTo(document.body);
},
abort: function () {
if (iframe) {
@ -122,5 +123,4 @@
};
}
});
}));
});

View file

@ -12,9 +12,9 @@
* https://github.com/jaubourg/ajaxHooks/
*/
/* global define, require, window, XDomainRequest */
/* global define, require, XDomainRequest */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
@ -26,7 +26,7 @@
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
})(function ($) {
'use strict';
if (window.XDomainRequest && !$.support.cors) {
$.ajaxTransport(function (s) {
@ -39,6 +39,14 @@
return {
send: function (headers, completeCallback) {
var addParamChar = /\?/.test(s.url) ? '&' : '?';
/**
* Callback wrapper function
*
* @param {number} status HTTP status code
* @param {string} statusText HTTP status text
* @param {object} [responses] Content-type specific responses
* @param {string} [responseHeaders] Response headers string
*/
function callback(status, statusText, responses, responseHeaders) {
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
xdr = null;
@ -61,7 +69,7 @@
callback(
200,
'OK',
{text: xdr.responseText},
{ text: xdr.responseText },
'Content-Type: ' + xdr.contentType
);
};
@ -86,4 +94,4 @@
}
});
}
}));
});

View file

@ -0,0 +1,75 @@
/*
* jQuery File Upload Demo
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global $ */
$(function () {
'use strict';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: 'server/php/'
});
// Enable iframe cross-domain access via redirect option:
$('#fileupload').fileupload(
'option',
'redirect',
window.location.href.replace(/\/[^/]*$/, '/cors/result.html?%s')
);
if (window.location.hostname === 'blueimp.github.io') {
// Demo settings:
$('#fileupload').fileupload('option', {
url: '//jquery-file-upload.appspot.com/',
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/.test(
window.navigator.userAgent
),
maxFileSize: 999000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
});
// Upload server status check for browsers with CORS support:
if ($.support.cors) {
$.ajax({
url: '//jquery-file-upload.appspot.com/',
type: 'HEAD'
}).fail(function () {
$('<div class="alert alert-danger"></div>')
.text('Upload server currently unavailable - ' + new Date())
.appendTo('#fileupload');
});
}
} else {
// Load existing files:
$('#fileupload').addClass('fileupload-processing');
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: $('#fileupload').fileupload('option', 'url'),
dataType: 'json',
context: $('#fileupload')[0]
})
.always(function () {
$(this).removeClass('fileupload-processing');
})
.done(function (result) {
$(this)
.fileupload('option', 'done')
// eslint-disable-next-line new-cap
.call(this, $.Event('done'), { result: result });
});
}
});

View file

@ -1,438 +0,0 @@
/*
* jQuery File Upload AngularJS Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, angular, require */
;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'angular',
'./jquery.fileupload-image',
'./jquery.fileupload-audio',
'./jquery.fileupload-video',
'./jquery.fileupload-validate'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('angular'),
require('./jquery.fileupload-image'),
require('./jquery.fileupload-audio'),
require('./jquery.fileupload-video'),
require('./jquery.fileupload-validate')
);
} else {
factory();
}
}(function () {
'use strict';
angular.module('blueimp.fileupload', [])
// The fileUpload service provides configuration options
// for the fileUpload directive and default handlers for
// File Upload events:
.provider('fileUpload', function () {
var scopeEvalAsync = function (expression) {
var scope = angular.element(this)
.fileupload('option', 'scope');
// Schedule a new $digest cycle if not already inside of one
// and evaluate the given expression:
scope.$evalAsync(expression);
},
addFileMethods = function (scope, data) {
var files = data.files,
file = files[0];
angular.forEach(files, function (file, index) {
file._index = index;
file.$state = function () {
return data.state();
};
file.$processing = function () {
return data.processing();
};
file.$progress = function () {
return data.progress();
};
file.$response = function () {
return data.response();
};
});
file.$submit = function () {
if (!file.error) {
return data.submit();
}
};
file.$cancel = function () {
return data.abort();
};
},
$config;
$config = this.defaults = {
handleResponse: function (e, data) {
var files = data.result && data.result.files;
if (files) {
data.scope.replace(data.files, files);
} else if (data.errorThrown ||
data.textStatus === 'error') {
data.files[0].error = data.errorThrown ||
data.textStatus;
}
},
add: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var scope = data.scope,
filesCopy = [];
angular.forEach(data.files, function (file) {
filesCopy.push(file);
});
scope.$parent.$applyAsync(function () {
addFileMethods(scope, data);
var method = scope.option('prependFiles') ?
'unshift' : 'push';
Array.prototype[method].apply(scope.queue, data.files);
});
data.process(function () {
return scope.process(data);
}).always(function () {
scope.$parent.$applyAsync(function () {
addFileMethods(scope, data);
scope.replace(filesCopy, data.files);
});
}).then(function () {
if ((scope.option('autoUpload') ||
data.autoUpload) &&
data.autoUpload !== false) {
data.submit();
}
});
},
done: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = this;
data.scope.$apply(function () {
data.handleResponse.call(that, e, data);
});
},
fail: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = this,
scope = data.scope;
if (data.errorThrown === 'abort') {
scope.clear(data.files);
return;
}
scope.$apply(function () {
data.handleResponse.call(that, e, data);
});
},
stop: scopeEvalAsync,
processstart: scopeEvalAsync,
processstop: scopeEvalAsync,
getNumberOfFiles: function () {
var scope = this.scope;
return scope.queue.length - scope.processing();
},
dataType: 'json',
autoUpload: false
};
this.$get = [
function () {
return {
defaults: $config
};
}
];
})
// Format byte numbers to readable presentations:
.provider('formatFileSizeFilter', function () {
var $config = {
// Byte units following the IEC format
// http://en.wikipedia.org/wiki/Kilobyte
units: [
{size: 1000000000, suffix: ' GB'},
{size: 1000000, suffix: ' MB'},
{size: 1000, suffix: ' KB'}
]
};
this.defaults = $config;
this.$get = function () {
return function (bytes) {
if (!angular.isNumber(bytes)) {
return '';
}
var unit = true,
i = 0,
prefix,
suffix;
while (unit) {
unit = $config.units[i];
prefix = unit.prefix || '';
suffix = unit.suffix || '';
if (i === $config.units.length - 1 || bytes >= unit.size) {
return prefix + (bytes / unit.size).toFixed(2) + suffix;
}
i += 1;
}
};
};
})
// The FileUploadController initializes the fileupload widget and
// provides scope methods to control the File Upload functionality:
.controller('FileUploadController', [
'$scope', '$element', '$attrs', '$window', 'fileUpload','$q',
function ($scope, $element, $attrs, $window, fileUpload, $q) {
var uploadMethods = {
progress: function () {
return $element.fileupload('progress');
},
active: function () {
return $element.fileupload('active');
},
option: function (option, data) {
if (arguments.length === 1) {
return $element.fileupload('option', option);
}
$element.fileupload('option', option, data);
},
add: function (data) {
return $element.fileupload('add', data);
},
send: function (data) {
return $element.fileupload('send', data);
},
process: function (data) {
return $element.fileupload('process', data);
},
processing: function (data) {
return $element.fileupload('processing', data);
}
};
$scope.disabled = !$window.jQuery.support.fileInput;
$scope.queue = $scope.queue || [];
$scope.clear = function (files) {
var queue = this.queue,
i = queue.length,
file = files,
length = 1;
if (angular.isArray(files)) {
file = files[0];
length = files.length;
}
while (i) {
i -= 1;
if (queue[i] === file) {
return queue.splice(i, length);
}
}
};
$scope.replace = function (oldFiles, newFiles) {
var queue = this.queue,
file = oldFiles[0],
i,
j;
for (i = 0; i < queue.length; i += 1) {
if (queue[i] === file) {
for (j = 0; j < newFiles.length; j += 1) {
queue[i + j] = newFiles[j];
}
return;
}
}
};
$scope.applyOnQueue = function (method) {
var list = this.queue.slice(0),
i,
file,
promises = [];
for (i = 0; i < list.length; i += 1) {
file = list[i];
if (file[method]) {
promises.push(file[method]());
}
}
return $q.all(promises);
};
$scope.submit = function () {
return this.applyOnQueue('$submit');
};
$scope.cancel = function () {
return this.applyOnQueue('$cancel');
};
// Add upload methods to the scope:
angular.extend($scope, uploadMethods);
// The fileupload widget will initialize with
// the options provided via "data-"-parameters,
// as well as those given via options object:
$element.fileupload(angular.extend(
{scope: $scope},
fileUpload.defaults
)).on('fileuploadadd', function (e, data) {
data.scope = $scope;
}).on('fileuploadfail', function (e, data) {
if (data.errorThrown === 'abort') {
return;
}
if (data.dataType &&
data.dataType.indexOf('json') === data.dataType.length - 4) {
try {
data.result = angular.fromJson(data.jqXHR.responseText);
} catch (ignore) {}
}
}).on([
'fileuploadadd',
'fileuploadsubmit',
'fileuploadsend',
'fileuploaddone',
'fileuploadfail',
'fileuploadalways',
'fileuploadprogress',
'fileuploadprogressall',
'fileuploadstart',
'fileuploadstop',
'fileuploadchange',
'fileuploadpaste',
'fileuploaddrop',
'fileuploaddragover',
'fileuploadchunkbeforesend',
'fileuploadchunksend',
'fileuploadchunkdone',
'fileuploadchunkfail',
'fileuploadchunkalways',
'fileuploadprocessstart',
'fileuploadprocess',
'fileuploadprocessdone',
'fileuploadprocessfail',
'fileuploadprocessalways',
'fileuploadprocessstop'
].join(' '), function (e, data) {
$scope.$parent.$applyAsync(function () {
if ($scope.$emit(e.type, data).defaultPrevented) {
e.preventDefault();
}
});
}).on('remove', function () {
// Remove upload methods from the scope,
// when the widget is removed:
var method;
for (method in uploadMethods) {
if (uploadMethods.hasOwnProperty(method)) {
delete $scope[method];
}
}
});
// Observe option changes:
$scope.$watch(
$attrs.fileUpload,
function (newOptions) {
if (newOptions) {
$element.fileupload('option', newOptions);
}
}
);
}
])
// Provide File Upload progress feedback:
.controller('FileUploadProgressController', [
'$scope', '$attrs', '$parse',
function ($scope, $attrs, $parse) {
var fn = $parse($attrs.fileUploadProgress),
update = function () {
var progress = fn($scope);
if (!progress || !progress.total) {
return;
}
$scope.num = Math.floor(
progress.loaded / progress.total * 100
);
};
update();
$scope.$watch(
$attrs.fileUploadProgress + '.loaded',
function (newValue, oldValue) {
if (newValue !== oldValue) {
update();
}
}
);
}
])
// Display File Upload previews:
.controller('FileUploadPreviewController', [
'$scope', '$element', '$attrs',
function ($scope, $element, $attrs) {
$scope.$watch(
$attrs.fileUploadPreview + '.preview',
function (preview) {
$element.empty();
if (preview) {
$element.append(preview);
}
}
);
}
])
.directive('fileUpload', function () {
return {
controller: 'FileUploadController',
scope: true
};
})
.directive('fileUploadProgress', function () {
return {
controller: 'FileUploadProgressController',
scope: true
};
})
.directive('fileUploadPreview', function () {
return {
controller: 'FileUploadPreviewController'
};
})
// Enhance the HTML5 download attribute to
// allow drag&drop of files to the desktop:
.directive('download', function () {
return function (scope, elm) {
elm.on('dragstart', function (e) {
try {
e.originalEvent.dataTransfer.setData(
'DownloadURL',
[
'application/octet-stream',
elm.prop('download'),
elm.prop('href')
].join(':')
);
} catch (ignore) {}
});
};
});
}));

View file

@ -9,18 +9,13 @@
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, document */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'./jquery.fileupload-process'
], factory);
define(['jquery', 'load-image', './jquery.fileupload-process'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
@ -30,12 +25,9 @@
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
factory(window.jQuery, window.loadImage);
}
}(function ($, loadImage) {
})(function ($, loadImage) {
'use strict';
// Prepend to the default processQueue:
@ -58,7 +50,6 @@
// The File Upload Audio Preview plugin extends the fileupload widget
// with audio preview functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of audio files to load,
// matched against the file type:
@ -68,7 +59,6 @@
_audioElement: document.createElement('audio'),
processActions: {
// Loads the audio file given via data.files and data.index
// as audio element if the browser supports playing it.
// Accepts the options fileTypes (regular expression)
@ -80,12 +70,13 @@
var file = data.files[data.index],
url,
audio;
if (this._audioElement.canPlayType &&
if (
this._audioElement.canPlayType &&
this._audioElement.canPlayType(file.type) &&
($.type(options.maxFileSize) !== 'number' ||
file.size <= options.maxFileSize) &&
(!options.fileTypes ||
options.fileTypes.test(file.type))) {
(!options.fileTypes || options.fileTypes.test(file.type))
) {
url = loadImage.createObjectURL(file);
if (url) {
audio = this._audioElement.cloneNode(false);
@ -105,9 +96,6 @@
}
return data;
}
}
});
}));
});

View file

@ -9,10 +9,9 @@
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, Blob */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
@ -22,6 +21,7 @@
'load-image-meta',
'load-image-scale',
'load-image-exif',
'load-image-orientation',
'canvas-to-blob',
'./jquery.fileupload-process'
], factory);
@ -33,28 +33,32 @@
require('blueimp-load-image/js/load-image-meta'),
require('blueimp-load-image/js/load-image-scale'),
require('blueimp-load-image/js/load-image-exif'),
require('blueimp-load-image/js/load-image-orientation'),
require('blueimp-canvas-to-blob'),
require('./jquery.fileupload-process')
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
factory(window.jQuery, window.loadImage);
}
}(function ($, loadImage) {
})(function ($, loadImage) {
'use strict';
// Prepend to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.unshift(
{
action: 'loadImageMetaData',
maxMetaDataSize: '@',
disableImageHead: '@',
disableMetaDataParsers: '@',
disableExif: '@',
disableExifThumbnail: '@',
disableExifSub: '@',
disableExifGps: '@',
disableExifOffsets: '@',
includeExifTags: '@',
excludeExifTags: '@',
disableIptc: '@',
disableIptcOffsets: '@',
includeIptcTags: '@',
excludeIptcTags: '@',
disabled: '@disableImageMetaDataLoad'
},
{
@ -117,7 +121,6 @@
// The File Upload Resize plugin extends the fileupload widget
// with image resize functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of images to load:
// matched against the file type:
@ -130,7 +133,7 @@
imageMaxHeight: 1080,
// Defines the image orientation (1-8) or takes the orientation
// value from Exif data if set to true:
imageOrientation: false,
imageOrientation: true,
// Define if resized images should be cropped or only scaled:
imageCrop: false,
// Disable the resize image functionality by default:
@ -151,7 +154,6 @@
},
processActions: {
// Loads the image given via data.files and data.index
// as img element, if the browser supports the File API.
// Accepts the options fileTypes (regular expression)
@ -162,11 +164,12 @@
}
var that = this,
file = data.files[data.index],
// eslint-disable-next-line new-cap
dfd = $.Deferred();
if (($.type(options.maxFileSize) === 'number' &&
if (
($.type(options.maxFileSize) === 'number' &&
file.size > options.maxFileSize) ||
(options.fileTypes &&
!options.fileTypes.test(file.type)) ||
(options.fileTypes && !options.fileTypes.test(file.type)) ||
!loadImage(
file,
function (img) {
@ -176,7 +179,8 @@
dfd.resolveWith(that, [data]);
},
options
)) {
)
) {
return data;
}
return dfd.promise();
@ -191,40 +195,43 @@
if (options.disabled || !(data.canvas || data.img)) {
return data;
}
options = $.extend({canvas: true}, options);
// eslint-disable-next-line no-param-reassign
options = $.extend({ canvas: true }, options);
var that = this,
// eslint-disable-next-line new-cap
dfd = $.Deferred(),
img = (options.canvas && data.canvas) || data.img,
resolve = function (newImg) {
if (newImg && (newImg.width !== img.width ||
if (
newImg &&
(newImg.width !== img.width ||
newImg.height !== img.height ||
options.forceResize)) {
options.forceResize)
) {
data[newImg.getContext ? 'canvas' : 'img'] = newImg;
}
data.preview = newImg;
dfd.resolveWith(that, [data]);
},
thumbnail;
if (data.exif) {
if (options.orientation === true) {
options.orientation = data.exif.get('Orientation');
}
if (options.thumbnail) {
thumbnail,
thumbnailBlob;
if (data.exif && options.thumbnail) {
thumbnail = data.exif.get('Thumbnail');
if (thumbnail) {
loadImage(thumbnail, resolve, options);
thumbnailBlob = thumbnail && thumbnail.get('Blob');
if (thumbnailBlob) {
options.orientation = data.exif.get('Orientation');
loadImage(thumbnailBlob, resolve, options);
return dfd.promise();
}
}
// Prevent orienting the same image twice:
if (data.orientation) {
// Prevent orienting the same image twice:
delete options.orientation;
} else {
data.orientation = options.orientation;
}
data.orientation = options.orientation || loadImage.orientation;
}
if (img) {
resolve(loadImage.scale(img, options));
resolve(loadImage.scale(img, options, data));
return dfd.promise();
}
return data;
@ -238,6 +245,7 @@
}
var that = this,
file = data.files[data.index],
// eslint-disable-next-line new-cap
dfd = $.Deferred();
if (data.canvas.toBlob) {
data.canvas.toBlob(
@ -275,29 +283,44 @@
return data;
}
var that = this,
// eslint-disable-next-line new-cap
dfd = $.Deferred();
loadImage.parseMetaData(data.files[data.index], function (result) {
loadImage.parseMetaData(
data.files[data.index],
function (result) {
$.extend(data, result);
dfd.resolveWith(that, [data]);
}, options);
},
options
);
return dfd.promise();
},
saveImageMetaData: function (data, options) {
if (!(data.imageHead && data.canvas &&
data.canvas.toBlob && !options.disabled)) {
if (
!(
data.imageHead &&
data.canvas &&
data.canvas.toBlob &&
!options.disabled
)
) {
return data;
}
var file = data.files[data.index],
blob = new Blob([
data.imageHead,
// Resized images always have a head size of 20 bytes,
// including the JPEG marker and a minimal JFIF header:
this._blobSlice.call(file, 20)
], {type: file.type});
var that = this,
file = data.files[data.index],
// eslint-disable-next-line new-cap
dfd = $.Deferred();
if (data.orientation === true && data.exifOffsets) {
// Reset Exif Orientation data:
loadImage.writeExifData(data.imageHead, data, 'Orientation', 1);
}
loadImage.replaceHead(file, data.imageHead, function (blob) {
blob.name = file.name;
data.files[data.index] = blob;
return data;
dfd.resolveWith(that, [data]);
});
return dfd.promise();
},
// Sets the resized version of the image as a property of the
@ -318,9 +341,6 @@
}
return data;
}
}
});
}));
});

View file

@ -1,161 +0,0 @@
/*
* jQuery File Upload jQuery UI Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
;(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload-ui'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('./jquery.fileupload-ui')
);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
processdone: function (e, data) {
data.context.find('.start').button('enable');
},
progress: function (e, data) {
if (data.context) {
data.context.find('.progress').progressbar(
'option',
'value',
parseInt(data.loaded / data.total * 100, 10)
);
}
},
progressall: function (e, data) {
var $this = $(this);
$this.find('.fileupload-progress')
.find('.progress').progressbar(
'option',
'value',
parseInt(data.loaded / data.total * 100, 10)
).end()
.find('.progress-extended').each(function () {
$(this).html(
($this.data('blueimp-fileupload') ||
$this.data('fileupload'))
._renderExtendedProgress(data)
);
});
}
},
_renderUpload: function (func, files) {
var node = this._super(func, files),
showIconText = $(window).width() > 480;
node.find('.progress').empty().progressbar();
node.find('.start').button({
icons: {primary: 'ui-icon-circle-arrow-e'},
text: showIconText
});
node.find('.cancel').button({
icons: {primary: 'ui-icon-cancel'},
text: showIconText
});
if (node.hasClass('fade')) {
node.hide();
}
return node;
},
_renderDownload: function (func, files) {
var node = this._super(func, files),
showIconText = $(window).width() > 480;
node.find('.delete').button({
icons: {primary: 'ui-icon-trash'},
text: showIconText
});
if (node.hasClass('fade')) {
node.hide();
}
return node;
},
_startHandler: function (e) {
$(e.currentTarget).button('disable');
this._super(e);
},
_transition: function (node) {
var deferred = $.Deferred();
if (node.hasClass('fade')) {
node.fadeToggle(
this.options.transitionDuration,
this.options.transitionEasing,
function () {
deferred.resolveWith(node);
}
);
} else {
deferred.resolveWith(node);
}
return deferred;
},
_create: function () {
this._super();
this.element
.find('.fileupload-buttonbar')
.find('.fileinput-button').each(function () {
var input = $(this).find('input:file').detach();
$(this)
.button({icons: {primary: 'ui-icon-plusthick'}})
.append(input);
})
.end().find('.start')
.button({icons: {primary: 'ui-icon-circle-arrow-e'}})
.end().find('.cancel')
.button({icons: {primary: 'ui-icon-cancel'}})
.end().find('.delete')
.button({icons: {primary: 'ui-icon-trash'}})
.end().find('.progress').progressbar();
},
_destroy: function () {
this.element
.find('.fileupload-buttonbar')
.find('.fileinput-button').each(function () {
var input = $(this).find('input:file').detach();
$(this)
.button('destroy')
.append(input);
})
.end().find('.start')
.button('destroy')
.end().find('.cancel')
.button('destroy')
.end().find('.delete')
.button('destroy')
.end().find('.progress').progressbar('destroy');
this._super();
}
});
}));

View file

@ -9,30 +9,21 @@
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload'
], factory);
define(['jquery', './jquery.fileupload'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('./jquery.fileupload')
);
factory(require('jquery'), require('./jquery.fileupload'));
} else {
// Browser globals:
factory(
window.jQuery
);
factory(window.jQuery);
}
}(function ($) {
})(function ($) {
'use strict';
var originalAdd = $.blueimp.fileupload.prototype.options.add;
@ -40,7 +31,6 @@
// The File Upload Processing plugin extends the fileupload widget
// with file processing functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The list of processing actions:
processQueue: [
@ -72,14 +62,15 @@
_processFile: function (data, originalData) {
var that = this,
// eslint-disable-next-line new-cap
dfd = $.Deferred().resolveWith(that, [data]),
chain = dfd.promise();
this._trigger('process', null, data);
$.each(data.processQueue, function (i, settings) {
var func = function (data) {
if (originalData.errorThrown) {
return $.Deferred()
.rejectWith(that, [originalData]).promise();
// eslint-disable-next-line new-cap
return $.Deferred().rejectWith(that, [originalData]).promise();
}
return that.processActions[settings.action].call(
that,
@ -87,7 +78,7 @@
settings
);
};
chain = chain.then(func, settings.always && func);
chain = chain[that._promisePipe](func, settings.always && func);
});
chain
.done(function () {
@ -112,16 +103,17 @@
action = this.action,
prefix = this.prefix === true ? action : this.prefix;
$.each(this, function (key, value) {
if ($.type(value) === 'string' &&
value.charAt(0) === '@') {
settings[key] = options[
value.slice(1) || (prefix ? prefix +
key.charAt(0).toUpperCase() + key.slice(1) : key)
if ($.type(value) === 'string' && value.charAt(0) === '@') {
settings[key] =
options[
value.slice(1) ||
(prefix
? prefix + key.charAt(0).toUpperCase() + key.slice(1)
: key)
];
} else {
settings[key] = value;
}
});
processQueue.push(settings);
});
@ -147,15 +139,17 @@
var opts = index ? $.extend({}, options) : options,
func = function () {
if (data.errorThrown) {
return $.Deferred()
.rejectWith(that, [data]).promise();
// eslint-disable-next-line new-cap
return $.Deferred().rejectWith(that, [data]).promise();
}
return that._processFile(opts, data);
};
opts.index = index;
that._processing += 1;
that._processingQueue = that._processingQueue.then(func, func)
.always(function () {
that._processingQueue = that._processingQueue[that._promisePipe](
func,
func
).always(function () {
that._processing -= 1;
if (that._processing === 0) {
that._trigger('processstop');
@ -169,10 +163,8 @@
_create: function () {
this._super();
this._processing = 0;
this._processingQueue = $.Deferred().resolveWith(this)
.promise();
// eslint-disable-next-line new-cap
this._processingQueue = $.Deferred().resolveWith(this).promise();
}
});
}));
});

View file

@ -9,10 +9,9 @@
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
@ -36,12 +35,9 @@
);
} else {
// Browser globals:
factory(
window.jQuery,
window.tmpl
);
factory(window.jQuery, window.tmpl);
}
}(function ($, tmpl) {
})(function ($, tmpl) {
'use strict';
$.blueimp.fileupload.prototype._specialOptions.push(
@ -53,12 +49,13 @@
// The UI version extends the file upload widget
// and adds complete user interface interaction:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// By default, files added to the widget are uploaded as soon
// as the user clicks on the start buttons. To enable automatic
// uploads, set the following option to true:
autoUpload: false,
// The class to show/hide UI elements:
showElementClass: 'in',
// The ID of the upload template:
uploadTemplateId: 'template-upload',
// The ID of the download template:
@ -81,8 +78,7 @@
// Function returning the current number of files,
// used by the maxNumberOfFiles validation:
getNumberOfFiles: function () {
return this.filesContainer.children()
.not('.processing').length;
return this.filesContainer.children().not('.processing').length;
},
// Callback to retrieve the list of files from the server response:
@ -101,34 +97,42 @@
return false;
}
var $this = $(this),
that = $this.data('blueimp-fileupload') ||
$this.data('fileupload'),
that = $this.data('blueimp-fileupload') || $this.data('fileupload'),
options = that.options;
data.context = that._renderUpload(data.files)
data.context = that
._renderUpload(data.files)
.data('data', data)
.addClass('processing');
options.filesContainer[
options.prependFiles ? 'prepend' : 'append'
](data.context);
options.filesContainer[options.prependFiles ? 'prepend' : 'append'](
data.context
);
that._forceReflow(data.context);
that._transition(data.context);
data.process(function () {
data
.process(function () {
return $this.fileupload('process', data);
}).always(function () {
data.context.each(function (index) {
$(this).find('.size').text(
that._formatFileSize(data.files[index].size)
);
}).removeClass('processing');
})
.always(function () {
data.context
.each(function (index) {
$(this)
.find('.size')
.text(that._formatFileSize(data.files[index].size));
})
.removeClass('processing');
that._renderPreviews(data);
}).done(function () {
data.context.find('.start').prop('disabled', false);
if ((that._trigger('added', e, data) !== false) &&
})
.done(function () {
data.context.find('.edit,.start').prop('disabled', false);
if (
that._trigger('added', e, data) !== false &&
(options.autoUpload || data.autoUpload) &&
data.autoUpload !== false) {
data.autoUpload !== false
) {
data.submit();
}
}).fail(function () {
})
.fail(function () {
if (data.files.error) {
data.context.each(function (index) {
var error = data.files[index].error;
@ -144,22 +148,23 @@
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload');
if (data.context && data.dataType &&
data.dataType.substr(0, 6) === 'iframe') {
var that =
$(this).data('blueimp-fileupload') || $(this).data('fileupload');
if (
data.context &&
data.dataType &&
data.dataType.substr(0, 6) === 'iframe'
) {
// Iframe Transport does not support progress events.
// In lack of an indeterminate progress bar, we set
// the progress to 100%, showing the full animated bar:
data.context
.find('.progress').addClass(
!$.support.transition && 'progress-animated'
)
.find('.progress')
.addClass(!$.support.transition && 'progress-animated')
.attr('aria-valuenow', 100)
.children().first().css(
'width',
'100%'
);
.children()
.first()
.css('width', '100%');
}
return that._trigger('sent', e, data);
},
@ -168,49 +173,43 @@
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
getFilesFromResponse = data.getFilesFromResponse ||
that.options.getFilesFromResponse,
var that =
$(this).data('blueimp-fileupload') || $(this).data('fileupload'),
getFilesFromResponse =
data.getFilesFromResponse || that.options.getFilesFromResponse,
files = getFilesFromResponse(data),
template,
deferred;
if (data.context) {
data.context.each(function (index) {
var file = files[index] ||
{error: 'Empty file upload result'};
var file = files[index] || { error: 'Empty file upload result' };
deferred = that._addFinishedDeferreds();
that._transition($(this)).done(
function () {
that._transition($(this)).done(function () {
var node = $(this);
template = that._renderDownload([file])
.replaceAll(node);
template = that._renderDownload([file]).replaceAll(node);
that._forceReflow(template);
that._transition(template).done(
function () {
that._transition(template).done(function () {
data.context = $(this);
that._trigger('completed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
}
);
});
});
});
} else {
template = that._renderDownload(files)[
that.options.prependFiles ? 'prependTo' : 'appendTo'
](that.options.filesContainer);
template = that
._renderDownload(files)
[that.options.prependFiles ? 'prependTo' : 'appendTo'](
that.options.filesContainer
);
that._forceReflow(template);
deferred = that._addFinishedDeferreds();
that._transition(template).done(
function () {
that._transition(template).done(function () {
data.context = $(this);
that._trigger('completed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
});
}
},
// Callback for failed (abort or error) uploads:
@ -218,60 +217,53 @@
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
var that =
$(this).data('blueimp-fileupload') || $(this).data('fileupload'),
template,
deferred;
if (data.context) {
data.context.each(function (index) {
if (data.errorThrown !== 'abort') {
var file = data.files[index];
file.error = file.error || data.errorThrown ||
data.i18n('unknownError');
file.error =
file.error || data.errorThrown || data.i18n('unknownError');
deferred = that._addFinishedDeferreds();
that._transition($(this)).done(
function () {
that._transition($(this)).done(function () {
var node = $(this);
template = that._renderDownload([file])
.replaceAll(node);
template = that._renderDownload([file]).replaceAll(node);
that._forceReflow(template);
that._transition(template).done(
function () {
that._transition(template).done(function () {
data.context = $(this);
that._trigger('failed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
}
);
});
});
} else {
deferred = that._addFinishedDeferreds();
that._transition($(this)).done(
function () {
that._transition($(this)).done(function () {
$(this).remove();
that._trigger('failed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
});
}
});
} else if (data.errorThrown !== 'abort') {
data.context = that._renderUpload(data.files)[
that.options.prependFiles ? 'prependTo' : 'appendTo'
](that.options.filesContainer)
data.context = that
._renderUpload(data.files)
[that.options.prependFiles ? 'prependTo' : 'appendTo'](
that.options.filesContainer
)
.data('data', data);
that._forceReflow(data.context);
deferred = that._addFinishedDeferreds();
that._transition(data.context).done(
function () {
that._transition(data.context).done(function () {
data.context = $(this);
that._trigger('failed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
});
} else {
that._trigger('failed', e, data);
that._trigger('finished', e, data);
@ -283,15 +275,15 @@
if (e.isDefaultPrevented()) {
return false;
}
var progress = Math.floor(data.loaded / data.total * 100);
var progress = Math.floor((data.loaded / data.total) * 100);
if (data.context) {
data.context.each(function () {
$(this).find('.progress')
$(this)
.find('.progress')
.attr('aria-valuenow', progress)
.children().first().css(
'width',
progress + '%'
);
.children()
.first()
.css('width', progress + '%');
});
}
},
@ -301,59 +293,60 @@
return false;
}
var $this = $(this),
progress = Math.floor(data.loaded / data.total * 100),
progress = Math.floor((data.loaded / data.total) * 100),
globalProgressNode = $this.find('.fileupload-progress'),
extendedProgressNode = globalProgressNode
.find('.progress-extended');
extendedProgressNode = globalProgressNode.find('.progress-extended');
if (extendedProgressNode.length) {
extendedProgressNode.html(
($this.data('blueimp-fileupload') || $this.data('fileupload'))
._renderExtendedProgress(data)
(
$this.data('blueimp-fileupload') || $this.data('fileupload')
)._renderExtendedProgress(data)
);
}
globalProgressNode
.find('.progress')
.attr('aria-valuenow', progress)
.children().first().css(
'width',
progress + '%'
);
.children()
.first()
.css('width', progress + '%');
},
// Callback for uploads start, equivalent to the global ajaxStart event:
start: function (e) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload');
var that =
$(this).data('blueimp-fileupload') || $(this).data('fileupload');
that._resetFinishedDeferreds();
that._transition($(this).find('.fileupload-progress')).done(
function () {
that
._transition($(this).find('.fileupload-progress'))
.done(function () {
that._trigger('started', e);
}
);
});
},
// Callback for uploads stop, equivalent to the global ajaxStop event:
stop: function (e) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
var that =
$(this).data('blueimp-fileupload') || $(this).data('fileupload'),
deferred = that._addFinishedDeferreds();
$.when.apply($, that._getFinishedDeferreds())
.done(function () {
$.when.apply($, that._getFinishedDeferreds()).done(function () {
that._trigger('stopped', e);
});
that._transition($(this).find('.fileupload-progress')).done(
function () {
$(this).find('.progress')
that
._transition($(this).find('.fileupload-progress'))
.done(function () {
$(this)
.find('.progress')
.attr('aria-valuenow', '0')
.children().first().css('width', '0%');
.children()
.first()
.css('width', '0%');
$(this).find('.progress-extended').html('&nbsp;');
deferred.resolve();
}
);
});
},
processstart: function (e) {
if (e.isDefaultPrevented()) {
@ -372,19 +365,19 @@
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
var that =
$(this).data('blueimp-fileupload') || $(this).data('fileupload'),
removeNode = function () {
that._transition(data.context).done(
function () {
that._transition(data.context).done(function () {
$(this).remove();
that._trigger('destroyed', e, data);
}
);
});
};
if (data.url) {
data.dataType = data.dataType || that.options.dataType;
$.ajax(data).done(removeNode).fail(function () {
$.ajax(data)
.done(removeNode)
.fail(function () {
that._trigger('destroyfailed', e, data);
});
} else {
@ -398,11 +391,10 @@
},
_addFinishedDeferreds: function (deferred) {
if (!deferred) {
deferred = $.Deferred();
}
this._finishedUploads.push(deferred);
return deferred;
// eslint-disable-next-line new-cap
var promise = deferred || $.Deferred();
this._finishedUploads.push(promise);
return promise;
},
_getFinishedDeferreds: function () {
@ -416,13 +408,15 @@
url = link.prop('href'),
name = link.prop('download'),
type = 'application/octet-stream';
link.bind('dragstart', function (e) {
link.on('dragstart', function (e) {
try {
e.originalEvent.dataTransfer.setData(
'DownloadURL',
[type, name, url].join(':')
);
} catch (ignore) {}
} catch (ignore) {
// Ignore exceptions
}
});
},
@ -459,10 +453,14 @@
var date = new Date(seconds * 1000),
days = Math.floor(seconds / 86400);
days = days ? days + 'd ' : '';
return days +
('0' + date.getUTCHours()).slice(-2) + ':' +
('0' + date.getUTCMinutes()).slice(-2) + ':' +
('0' + date.getUTCSeconds()).slice(-2);
return (
days +
('0' + date.getUTCHours()).slice(-2) +
':' +
('0' + date.getUTCMinutes()).slice(-2) +
':' +
('0' + date.getUTCSeconds()).slice(-2)
);
},
_formatPercentage: function (floatValue) {
@ -470,15 +468,17 @@
},
_renderExtendedProgress: function (data) {
return this._formatBitrate(data.bitrate) + ' | ' +
this._formatTime(
(data.total - data.loaded) * 8 / data.bitrate
) + ' | ' +
this._formatPercentage(
data.loaded / data.total
) + ' | ' +
this._formatFileSize(data.loaded) + ' / ' +
this._formatFileSize(data.total);
return (
this._formatBitrate(data.bitrate) +
' | ' +
this._formatTime(((data.total - data.loaded) * 8) / data.bitrate) +
' | ' +
this._formatPercentage(data.loaded / data.total) +
' | ' +
this._formatFileSize(data.loaded) +
' / ' +
this._formatFileSize(data.total)
);
},
_renderTemplate: function (func, files) {
@ -498,22 +498,54 @@
_renderPreviews: function (data) {
data.context.find('.preview').each(function (index, elm) {
$(elm).append(data.files[index].preview);
$(elm).empty().append(data.files[index].preview);
});
},
_renderUpload: function (files) {
return this._renderTemplate(
this.options.uploadTemplate,
files
);
return this._renderTemplate(this.options.uploadTemplate, files);
},
_renderDownload: function (files) {
return this._renderTemplate(
this.options.downloadTemplate,
files
).find('a[download]').each(this._enableDragToDesktop).end();
return this._renderTemplate(this.options.downloadTemplate, files)
.find('a[download]')
.each(this._enableDragToDesktop)
.end();
},
_editHandler: function (e) {
e.preventDefault();
if (!this.options.edit) return;
var that = this,
button = $(e.currentTarget),
template = button.closest('.template-upload'),
data = template.data('data'),
index = button.data().index;
this.options.edit(data.files[index]).then(function (file) {
if (!file) return;
data.files[index] = file;
data.context.addClass('processing');
template.find('.edit,.start').prop('disabled', true);
$(that.element)
.fileupload('process', data)
.always(function () {
template
.find('.size')
.text(that._formatFileSize(data.files[index].size));
data.context.removeClass('processing');
that._renderPreviews(data);
})
.done(function () {
template.find('.edit,.start').prop('disabled', false);
})
.fail(function () {
template.find('.edit').prop('disabled', false);
var error = data.files[index].error;
if (error) {
template.find('.error').text(error);
}
});
});
},
_startHandler: function (e) {
@ -529,8 +561,9 @@
_cancelHandler: function (e) {
e.preventDefault();
var template = $(e.currentTarget)
.closest('.template-upload,.template-download'),
var template = $(e.currentTarget).closest(
'.template-upload,.template-download'
),
data = template.data('data') || {};
data.context = data.context || template;
if (data.abort) {
@ -544,33 +577,44 @@
_deleteHandler: function (e) {
e.preventDefault();
var button = $(e.currentTarget);
this._trigger('destroy', e, $.extend({
this._trigger(
'destroy',
e,
$.extend(
{
context: button.closest('.template-download'),
type: 'DELETE'
}, button.data()));
},
button.data()
)
);
},
_forceReflow: function (node) {
return $.support.transition && node.length &&
node[0].offsetWidth;
return $.support.transition && node.length && node[0].offsetWidth;
},
_transition: function (node) {
// eslint-disable-next-line new-cap
var dfd = $.Deferred();
if ($.support.transition && node.hasClass('fade') && node.is(':visible')) {
node.bind(
$.support.transition.end,
function (e) {
// Make sure we don't respond to other transitions events
if (
$.support.transition &&
node.hasClass('fade') &&
node.is(':visible')
) {
var transitionEndHandler = function (e) {
// Make sure we don't respond to other transition events
// in the container element, e.g. from button elements:
if (e.target === node[0]) {
node.unbind($.support.transition.end);
node.off($.support.transition.end, transitionEndHandler);
dfd.resolveWith(node);
}
}
).toggleClass('in');
};
node
.on($.support.transition.end, transitionEndHandler)
.toggleClass(this.options.showElementClass);
} else {
node.toggleClass('in');
node.toggleClass(this.options.showElementClass);
dfd.resolveWith(node);
}
return dfd;
@ -582,50 +626,49 @@
this._on(fileUploadButtonBar.find('.start'), {
click: function (e) {
e.preventDefault();
filesList.find('.start').click();
filesList.find('.start').trigger('click');
}
});
this._on(fileUploadButtonBar.find('.cancel'), {
click: function (e) {
e.preventDefault();
filesList.find('.cancel').click();
filesList.find('.cancel').trigger('click');
}
});
this._on(fileUploadButtonBar.find('.delete'), {
click: function (e) {
e.preventDefault();
filesList.find('.toggle:checked')
filesList
.find('.toggle:checked')
.closest('.template-download')
.find('.delete').click();
fileUploadButtonBar.find('.toggle')
.prop('checked', false);
.find('.delete')
.trigger('click');
fileUploadButtonBar.find('.toggle').prop('checked', false);
}
});
this._on(fileUploadButtonBar.find('.toggle'), {
change: function (e) {
filesList.find('.toggle').prop(
'checked',
$(e.currentTarget).is(':checked')
);
filesList
.find('.toggle')
.prop('checked', $(e.currentTarget).is(':checked'));
}
});
},
_destroyButtonBarEventHandlers: function () {
this._off(
this.element.find('.fileupload-buttonbar')
this.element
.find('.fileupload-buttonbar')
.find('.start, .cancel, .delete'),
'click'
);
this._off(
this.element.find('.fileupload-buttonbar .toggle'),
'change.'
);
this._off(this.element.find('.fileupload-buttonbar .toggle'), 'change.');
},
_initEventHandlers: function () {
this._super();
this._on(this.options.filesContainer, {
'click .edit': this._editHandler,
'click .start': this._startHandler,
'click .cancel': this._cancelHandler,
'click .delete': this._deleteHandler
@ -640,15 +683,19 @@
},
_enableFileInputButton: function () {
this.element.find('.fileinput-button input')
this.element
.find('.fileinput-button input')
.prop('disabled', false)
.parent().removeClass('disabled');
.parent()
.removeClass('disabled');
},
_disableFileInputButton: function () {
this.element.find('.fileinput-button input')
this.element
.find('.fileinput-button input')
.prop('disabled', true)
.parent().addClass('disabled');
.parent()
.addClass('disabled');
},
_initTemplates: function () {
@ -708,7 +755,5 @@
}
this._super();
}
});
}));
});

View file

@ -9,34 +9,25 @@
* https://opensource.org/licenses/MIT
*/
/* global define, require, window */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload-process'
], factory);
define(['jquery', './jquery.fileupload-process'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('./jquery.fileupload-process')
);
factory(require('jquery'), require('./jquery.fileupload-process'));
} else {
// Browser globals:
factory(
window.jQuery
);
factory(window.jQuery);
}
}(function ($) {
})(function ($) {
'use strict';
// Append to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.push(
{
$.blueimp.fileupload.prototype.options.processQueue.push({
action: 'validate',
// Always trigger this action,
// even if the previous action was rejected:
@ -47,13 +38,11 @@
minFileSize: '@',
maxNumberOfFiles: '@',
disabled: '@disableValidation'
}
);
});
// The File Upload Validation plugin extends the fileupload widget
// with file validation functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
/*
// The regular expression for allowed file types, matches
@ -81,11 +70,11 @@
},
processActions: {
validate: function (data, options) {
if (options.disabled) {
return data;
}
// eslint-disable-next-line new-cap
var dfd = $.Deferred(),
settings = this.options,
file = data.files[data.index],
@ -93,18 +82,26 @@
if (options.minFileSize || options.maxFileSize) {
fileSize = file.size;
}
if ($.type(options.maxNumberOfFiles) === 'number' &&
if (
$.type(options.maxNumberOfFiles) === 'number' &&
(settings.getNumberOfFiles() || 0) + data.files.length >
options.maxNumberOfFiles) {
options.maxNumberOfFiles
) {
file.error = settings.i18n('maxNumberOfFiles');
} else if (options.acceptFileTypes &&
!(options.acceptFileTypes.test(file.type) ||
options.acceptFileTypes.test(file.name))) {
} else if (
options.acceptFileTypes &&
!(
options.acceptFileTypes.test(file.type) ||
options.acceptFileTypes.test(file.name)
)
) {
file.error = settings.i18n('acceptFileTypes');
} else if (fileSize > options.maxFileSize) {
file.error = settings.i18n('maxFileSize');
} else if ($.type(fileSize) === 'number' &&
fileSize < options.minFileSize) {
} else if (
$.type(fileSize) === 'number' &&
fileSize < options.minFileSize
) {
file.error = settings.i18n('minFileSize');
} else {
delete file.error;
@ -117,9 +114,6 @@
}
return dfd.promise();
}
}
});
}));
});

View file

@ -9,18 +9,13 @@
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, document */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'./jquery.fileupload-process'
], factory);
define(['jquery', 'load-image', './jquery.fileupload-process'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
@ -30,12 +25,9 @@
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
factory(window.jQuery, window.loadImage);
}
}(function ($, loadImage) {
})(function ($, loadImage) {
'use strict';
// Prepend to the default processQueue:
@ -58,7 +50,6 @@
// The File Upload Video Preview plugin extends the fileupload widget
// with video preview functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of video files to load,
// matched against the file type:
@ -68,7 +59,6 @@
_videoElement: document.createElement('video'),
processActions: {
// Loads the video file given via data.files and data.index
// as video element if the browser supports playing it.
// Accepts the options fileTypes (regular expression)
@ -80,12 +70,13 @@
var file = data.files[data.index],
url,
video;
if (this._videoElement.canPlayType &&
if (
this._videoElement.canPlayType &&
this._videoElement.canPlayType(file.type) &&
($.type(options.maxFileSize) !== 'number' ||
file.size <= options.maxFileSize) &&
(!options.fileTypes ||
options.fileTypes.test(file.type))) {
(!options.fileTypes || options.fileTypes.test(file.type))
) {
url = loadImage.createObjectURL(file);
if (url) {
video = this._videoElement.cloneNode(false);
@ -105,9 +96,6 @@
}
return data;
}
}
});
}));
});

View file

@ -9,33 +9,28 @@
* https://opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, document, location, Blob, FormData */
/* global define, require */
/* eslint-disable new-cap */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'jquery-ui/ui/widget'
], factory);
define(['jquery', 'jquery-ui/ui/widget'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('./vendor/jquery.ui.widget')
);
factory(require('jquery'), require('./vendor/jquery.ui.widget'));
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
})(function ($) {
'use strict';
// Detect file input support, based on
// http://viljamis.com/blog/2012/file-upload-support-on-mobile/
$.support.fileInput = !(new RegExp(
// https://viljamis.com/2012/file-upload-support-on-mobile/
$.support.fileInput = !(
new RegExp(
// Handle devices which give false positives for the feature detection:
'(Android (1\\.[0156]|2\\.[01]))' +
'|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +
@ -43,7 +38,8 @@
'|(Kindle/(1\\.0|2\\.[05]|3\\.0))'
).test(window.navigator.userAgent) ||
// Feature detection for all other devices:
$('<input type="file"/>').prop('disabled'));
$('<input type="file"/>').prop('disabled')
);
// The FileReader API is not actually used, but works as feature detection,
// as some Safari versions (5?) support XHR file uploads via the FormData API,
@ -54,20 +50,28 @@
$.support.xhrFormDataFileUpload = !!window.FormData;
// Detect support for Blob slicing (required for chunked uploads):
$.support.blobSlice = window.Blob && (Blob.prototype.slice ||
Blob.prototype.webkitSlice || Blob.prototype.mozSlice);
$.support.blobSlice =
window.Blob &&
(Blob.prototype.slice ||
Blob.prototype.webkitSlice ||
Blob.prototype.mozSlice);
// Helper function to create drag handlers for dragover/dragenter/dragleave:
/**
* Helper function to create drag handlers for dragover/dragenter/dragleave
*
* @param {string} type Event type
* @returns {Function} Drag handler
*/
function getDragHandler(type) {
var isDragOver = type === 'dragover';
return function (e) {
e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
var dataTransfer = e.dataTransfer;
if (dataTransfer && $.inArray('Files', dataTransfer.types) !== -1 &&
this._trigger(
type,
$.Event(type, {delegatedEvent: e})
) !== false) {
if (
dataTransfer &&
$.inArray('Files', dataTransfer.types) !== -1 &&
this._trigger(type, $.Event(type, { delegatedEvent: e })) !== false
) {
e.preventDefault();
if (isDragOver) {
dataTransfer.dropEffect = 'copy';
@ -85,7 +89,6 @@
// "add" method are uploaded immediately, but it is possible to override
// the "add" callback option to queue file uploads.
$.widget('blueimp.fileupload', {
options: {
// The drop target element(s), by the default the complete document.
// Set to null to disable drag & drop support:
@ -183,9 +186,11 @@
// Translation function, gets the message key to be translated
// and an object with context specific data as arguments:
i18n: function (message, context) {
// eslint-disable-next-line no-param-reassign
message = this.messages[message] || message.toString();
if (context) {
$.each(context, function (key, value) {
// eslint-disable-next-line no-param-reassign
message = message.replace('{' + key + '}', value);
});
}
@ -212,7 +217,7 @@
// and allows you to override plugin options as well as define ajax settings.
//
// Listeners for this callback can also be bound the following way:
// .bind('fileuploadadd', func);
// .on('fileuploadadd', func);
//
// data.submit() returns a Promise object and allows to attach additional
// handlers using jQuery's Deferred callbacks:
@ -221,8 +226,11 @@
if (e.isDefaultPrevented()) {
return false;
}
if (data.autoUpload || (data.autoUpload !== false &&
$(this).fileupload('option', 'autoUpload'))) {
if (
data.autoUpload ||
(data.autoUpload !== false &&
$(this).fileupload('option', 'autoUpload'))
) {
data.process().done(function () {
data.submit();
});
@ -232,58 +240,58 @@
// Other callbacks:
// Callback for the submit event of each file upload:
// submit: function (e, data) {}, // .bind('fileuploadsubmit', func);
// submit: function (e, data) {}, // .on('fileuploadsubmit', func);
// Callback for the start of each file upload request:
// send: function (e, data) {}, // .bind('fileuploadsend', func);
// send: function (e, data) {}, // .on('fileuploadsend', func);
// Callback for successful uploads:
// done: function (e, data) {}, // .bind('fileuploaddone', func);
// done: function (e, data) {}, // .on('fileuploaddone', func);
// Callback for failed (abort or error) uploads:
// fail: function (e, data) {}, // .bind('fileuploadfail', func);
// fail: function (e, data) {}, // .on('fileuploadfail', func);
// Callback for completed (success, abort or error) requests:
// always: function (e, data) {}, // .bind('fileuploadalways', func);
// always: function (e, data) {}, // .on('fileuploadalways', func);
// Callback for upload progress events:
// progress: function (e, data) {}, // .bind('fileuploadprogress', func);
// progress: function (e, data) {}, // .on('fileuploadprogress', func);
// Callback for global upload progress events:
// progressall: function (e, data) {}, // .bind('fileuploadprogressall', func);
// progressall: function (e, data) {}, // .on('fileuploadprogressall', func);
// Callback for uploads start, equivalent to the global ajaxStart event:
// start: function (e) {}, // .bind('fileuploadstart', func);
// start: function (e) {}, // .on('fileuploadstart', func);
// Callback for uploads stop, equivalent to the global ajaxStop event:
// stop: function (e) {}, // .bind('fileuploadstop', func);
// stop: function (e) {}, // .on('fileuploadstop', func);
// Callback for change events of the fileInput(s):
// change: function (e, data) {}, // .bind('fileuploadchange', func);
// change: function (e, data) {}, // .on('fileuploadchange', func);
// Callback for paste events to the pasteZone(s):
// paste: function (e, data) {}, // .bind('fileuploadpaste', func);
// paste: function (e, data) {}, // .on('fileuploadpaste', func);
// Callback for drop events of the dropZone(s):
// drop: function (e, data) {}, // .bind('fileuploaddrop', func);
// drop: function (e, data) {}, // .on('fileuploaddrop', func);
// Callback for dragover events of the dropZone(s):
// dragover: function (e) {}, // .bind('fileuploaddragover', func);
// dragover: function (e) {}, // .on('fileuploaddragover', func);
// Callback before the start of each chunk upload request (before form data initialization):
// chunkbeforesend: function (e, data) {}, // .bind('fileuploadchunkbeforesend', func);
// chunkbeforesend: function (e, data) {}, // .on('fileuploadchunkbeforesend', func);
// Callback for the start of each chunk upload request:
// chunksend: function (e, data) {}, // .bind('fileuploadchunksend', func);
// chunksend: function (e, data) {}, // .on('fileuploadchunksend', func);
// Callback for successful chunk uploads:
// chunkdone: function (e, data) {}, // .bind('fileuploadchunkdone', func);
// chunkdone: function (e, data) {}, // .on('fileuploadchunkdone', func);
// Callback for failed (abort or error) chunk uploads:
// chunkfail: function (e, data) {}, // .bind('fileuploadchunkfail', func);
// chunkfail: function (e, data) {}, // .on('fileuploadchunkfail', func);
// Callback for completed (success, abort or error) chunk upload requests:
// chunkalways: function (e, data) {}, // .bind('fileuploadchunkalways', func);
// chunkalways: function (e, data) {}, // .on('fileuploadchunkalways', func);
// The plugin options are used as settings object for the ajax calls.
// The following are jQuery ajax settings required for the file uploads:
@ -293,6 +301,16 @@
timeout: 0
},
// jQuery versions before 1.8 require promise.pipe if the return value is
// used, as promise.then in older versions has a different behavior, see:
// https://blog.jquery.com/2012/08/09/jquery-1-8-released/
// https://bugs.jquery.com/ticket/11010
// https://github.com/blueimp/jQuery-File-Upload/pull/3435
_promisePipe: (function () {
var parts = $.fn.jquery.split('.');
return Number(parts[0]) > 1 || Number(parts[1]) > 7 ? 'then' : 'pipe';
})(),
// A list of options that require reinitializing event listeners and/or
// special initialization code:
_specialOptions: [
@ -303,13 +321,15 @@
'forceIframeTransport'
],
_blobSlice: $.support.blobSlice && function () {
_blobSlice:
$.support.blobSlice &&
function () {
var slice = this.slice || this.webkitSlice || this.mozSlice;
return slice.apply(this, arguments);
},
_BitrateTimer: function () {
this.timestamp = ((Date.now) ? Date.now() : (new Date()).getTime());
this.timestamp = Date.now ? Date.now() : new Date().getTime();
this.loaded = 0;
this.bitrate = 0;
this.getBitrate = function (now, loaded, interval) {
@ -324,9 +344,11 @@
},
_isXHRUpload: function (options) {
return !options.forceIframeTransport &&
return (
!options.forceIframeTransport &&
((!options.multipart && $.support.xhrFileUpload) ||
$.support.xhrFormDataFileUpload);
$.support.xhrFormDataFileUpload)
);
},
_getFormData: function (options) {
@ -340,7 +362,7 @@
if ($.type(options.formData) === 'object') {
formData = [];
$.each(options.formData, function (name, value) {
formData.push({name: name, value: value});
formData.push({ name: name, value: value });
});
return formData;
}
@ -372,7 +394,7 @@
var prop;
if (obj._response) {
for (prop in obj._response) {
if (obj._response.hasOwnProperty(prop)) {
if (Object.prototype.hasOwnProperty.call(obj._response, prop)) {
delete obj._response[prop];
}
}
@ -383,20 +405,24 @@
_onProgress: function (e, data) {
if (e.lengthComputable) {
var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
var now = Date.now ? Date.now() : new Date().getTime(),
loaded;
if (data._time && data.progressInterval &&
(now - data._time < data.progressInterval) &&
e.loaded !== e.total) {
if (
data._time &&
data.progressInterval &&
now - data._time < data.progressInterval &&
e.loaded !== e.total
) {
return;
}
data._time = now;
loaded = Math.floor(
e.loaded / e.total * (data.chunkSize || data._progress.total)
loaded =
Math.floor(
(e.loaded / e.total) * (data.chunkSize || data._progress.total)
) + (data.uploadedBytes || 0);
// Add the difference from the previously loaded state
// to the global loaded counter:
this._progress.loaded += (loaded - data._progress.loaded);
this._progress.loaded += loaded - data._progress.loaded;
this._progress.bitrate = this._bitrateTimer.getBitrate(
now,
this._progress.loaded,
@ -413,14 +439,14 @@
// property calculated accordingly:
this._trigger(
'progress',
$.Event('progress', {delegatedEvent: e}),
$.Event('progress', { delegatedEvent: e }),
data
);
// Trigger a global progress event for all current file uploads,
// including ajax calls queued for sequential file uploads:
this._trigger(
'progressall',
$.Event('progressall', {delegatedEvent: e}),
$.Event('progressall', { delegatedEvent: e }),
this._progress
);
}
@ -432,7 +458,7 @@
// Accesss to the native XHR object is required to add event listeners
// for the upload progress event:
if (xhr.upload) {
$(xhr.upload).bind('progress', function (e) {
$(xhr.upload).on('progress', function (e) {
var oe = e.originalEvent;
// Make sure the progress event properties get copied over:
e.lengthComputable = oe.lengthComputable;
@ -449,7 +475,7 @@
_deinitProgressListener: function (options) {
var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
if (xhr.upload) {
$(xhr.upload).unbind('progress');
$(xhr.upload).off('progress');
}
},
@ -459,16 +485,19 @@
},
_getUniqueFilename: function (name, map) {
// eslint-disable-next-line no-param-reassign
name = String(name);
if (map[name]) {
name = name.replace(
/(?: \(([\d]+)\))?(\.[^.]+)?$/,
function (_, p1, p2) {
// eslint-disable-next-line no-param-reassign
name = name.replace(/(?: \(([\d]+)\))?(\.[^.]+)?$/, function (
_,
p1,
p2
) {
var index = p1 ? Number(p1) + 1 : 1;
var ext = p2 || '';
return ' (' + index + ')' + ext;
}
);
});
return this._getUniqueFilename(name, map);
}
map[name] = true;
@ -481,15 +510,19 @@
file = options.files[0],
// Ignore non-multipart setting if not supported:
multipart = options.multipart || !$.support.xhrFileUpload,
paramName = $.type(options.paramName) === 'array' ?
options.paramName[0] : options.paramName;
paramName =
$.type(options.paramName) === 'array'
? options.paramName[0]
: options.paramName;
options.headers = $.extend({}, options.headers);
if (options.contentRange) {
options.headers['Content-Range'] = options.contentRange;
}
if (!multipart || options.blob || !this._isInstanceOf('File', file)) {
options.headers['Content-Disposition'] = 'attachment; filename="' +
encodeURI(file.uploadName || file.name) + '"';
options.headers['Content-Disposition'] =
'attachment; filename="' +
encodeURI(file.uploadName || file.name) +
'"';
}
if (!multipart) {
options.contentType = file.type || 'application/octet-stream';
@ -509,8 +542,10 @@
} else {
$.each(options.files, function (index, file) {
formData.push({
name: ($.type(options.paramName) === 'array' &&
options.paramName[index]) || paramName,
name:
($.type(options.paramName) === 'array' &&
options.paramName[index]) ||
paramName,
value: file
});
});
@ -534,8 +569,10 @@
$.each(options.files, function (index, file) {
// This check allows the tests to run with
// dummy objects:
if (that._isInstanceOf('File', file) ||
that._isInstanceOf('Blob', file)) {
if (
that._isInstanceOf('File', file) ||
that._isInstanceOf('Blob', file)
) {
var fileName = file.uploadName || file.name;
if (options.uniqueFilenames) {
fileName = that._getUniqueFilename(
@ -545,7 +582,8 @@
}
formData.append(
($.type(options.paramName) === 'array' &&
options.paramName[index]) || paramName,
options.paramName[index]) ||
paramName,
file,
fileName
);
@ -631,12 +669,17 @@
options.url = options.form.prop('action') || location.href;
}
// The HTTP request method must be "POST" or "PUT":
options.type = (options.type ||
options.type = (
options.type ||
($.type(options.form.prop('method')) === 'string' &&
options.form.prop('method')) || ''
options.form.prop('method')) ||
''
).toUpperCase();
if (options.type !== 'POST' && options.type !== 'PUT' &&
options.type !== 'PATCH') {
if (
options.type !== 'POST' &&
options.type !== 'PUT' &&
options.type !== 'PATCH'
) {
options.type = 'POST';
}
if (!options.formAcceptCharset) {
@ -680,6 +723,7 @@
_getXHRPromise: function (resolveOrReject, context, args) {
var dfd = $.Deferred(),
promise = dfd.promise();
// eslint-disable-next-line no-param-reassign
context = context || this.options.context || promise;
if (resolveOrReject === true) {
dfd.resolveWith(context, args);
@ -698,27 +742,26 @@
};
data.process = function (resolveFunc, rejectFunc) {
if (resolveFunc || rejectFunc) {
data._processQueue = this._processQueue =
(this._processQueue || getPromise([this])).then(
function () {
data._processQueue = this._processQueue = (this._processQueue ||
getPromise([this]))
[that._promisePipe](function () {
if (data.errorThrown) {
return $.Deferred()
.rejectWith(that, [data]).promise();
return $.Deferred().rejectWith(that, [data]).promise();
}
return getPromise(arguments);
}
).then(resolveFunc, rejectFunc);
})
[that._promisePipe](resolveFunc, rejectFunc);
}
return this._processQueue || getPromise([this]);
};
data.submit = function () {
if (this.state() !== 'pending') {
data.jqXHR = this.jqXHR =
(that._trigger(
that._trigger(
'submit',
$.Event('submit', {delegatedEvent: e}),
$.Event('submit', { delegatedEvent: e }),
this
) !== false) && that._onSend(e, this);
) !== false && that._onSend(e, this);
}
return this.jqXHR || that._getXHRPromise();
};
@ -739,8 +782,11 @@
}
};
data.processing = function () {
return !this.jqXHR && this._processQueue && that
._getDeferredState(this._processQueue) === 'pending';
return (
!this.jqXHR &&
this._processQueue &&
that._getDeferredState(this._processQueue) === 'pending'
);
};
data.progress = function () {
return this._progress;
@ -755,8 +801,7 @@
_getUploadedBytes: function (jqXHR) {
var range = jqXHR.getResponseHeader('Range'),
parts = range && range.split('-'),
upperBytesPos = parts && parts.length > 1 &&
parseInt(parts[1], 10);
upperBytesPos = parts && parts.length > 1 && parseInt(parts[1], 10);
return upperBytesPos && upperBytesPos + 1;
},
@ -777,8 +822,14 @@
promise = dfd.promise(),
jqXHR,
upload;
if (!(this._isXHRUpload(options) && slice && (ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)) ||
options.data) {
if (
!(
this._isXHRUpload(options) &&
slice &&
(ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)
) ||
options.data
) {
return false;
}
if (testOnly) {
@ -786,11 +837,11 @@
}
if (ub >= fs) {
file.error = options.i18n('uploadedBytes');
return this._getXHRPromise(
false,
options.context,
[null, 'error', file.error]
);
return this._getXHRPromise(false, options.context, [
null,
'error',
file.error
]);
}
// The chunk upload method:
upload = function () {
@ -807,28 +858,32 @@
// will be dereferenced after data processing:
o.chunkSize = o.blob.size;
// Expose the chunk bytes position range:
o.contentRange = 'bytes ' + ub + '-' +
(ub + o.chunkSize - 1) + '/' + fs;
o.contentRange =
'bytes ' + ub + '-' + (ub + o.chunkSize - 1) + '/' + fs;
// Trigger chunkbeforesend to allow form data to be updated for this chunk
that._trigger('chunkbeforesend', null, o);
// Process the upload data (the blob and potential form data):
that._initXHRData(o);
// Add progress listeners for this chunk upload:
that._initProgressListener(o);
jqXHR = ((that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||
that._getXHRPromise(false, o.context))
jqXHR = (
(that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||
that._getXHRPromise(false, o.context)
)
.done(function (result, textStatus, jqXHR) {
ub = that._getUploadedBytes(jqXHR) ||
(ub + o.chunkSize);
ub = that._getUploadedBytes(jqXHR) || ub + o.chunkSize;
// Create a progress event if no final progress event
// with loaded equaling total has been triggered
// for this chunk:
if (currentLoaded + o.chunkSize - o._progress.loaded) {
that._onProgress($.Event('progress', {
that._onProgress(
$.Event('progress', {
lengthComputable: true,
loaded: ub - o.uploadedBytes,
total: ub - o.uploadedBytes
}), o);
}),
o
);
}
options.uploadedBytes = o.uploadedBytes = ub;
o.result = result;
@ -841,10 +896,7 @@
// continue with the next chunk:
upload();
} else {
dfd.resolveWith(
o.context,
[result, textStatus, jqXHR]
);
dfd.resolveWith(o.context, [result, textStatus, jqXHR]);
}
})
.fail(function (jqXHR, textStatus, errorThrown) {
@ -853,10 +905,7 @@
o.errorThrown = errorThrown;
that._trigger('chunkfail', null, o);
that._trigger('chunkalways', null, o);
dfd.rejectWith(
o.context,
[jqXHR, textStatus, errorThrown]
);
dfd.rejectWith(o.context, [jqXHR, textStatus, errorThrown]);
})
.always(function () {
that._deinitProgressListener(o);
@ -902,11 +951,14 @@
if (options._progress.loaded < total) {
// Create a progress event if no final progress event
// with loaded equaling total has been triggered:
this._onProgress($.Event('progress', {
this._onProgress(
$.Event('progress', {
lengthComputable: true,
loaded: total,
total: total
}), options);
}),
options
);
}
response.result = options.result = result;
response.textStatus = options.textStatus = textStatus;
@ -948,19 +1000,26 @@
that._sending += 1;
// Set timer for bitrate progress calculation:
options._bitrateTimer = new that._BitrateTimer();
jqXHR = jqXHR || (
((aborted || that._trigger(
jqXHR =
jqXHR ||
(
((aborted ||
that._trigger(
'send',
$.Event('send', {delegatedEvent: e}),
$.Event('send', { delegatedEvent: e }),
options
) === false) &&
that._getXHRPromise(false, options.context, aborted)) ||
that._chunkedUpload(options) || $.ajax(options)
).done(function (result, textStatus, jqXHR) {
that._chunkedUpload(options) ||
$.ajax(options)
)
.done(function (result, textStatus, jqXHR) {
that._onDone(result, textStatus, jqXHR, options);
}).fail(function (jqXHR, textStatus, errorThrown) {
})
.fail(function (jqXHR, textStatus, errorThrown) {
that._onFail(jqXHR, textStatus, errorThrown, options);
}).always(function (jqXHRorResult, textStatus, jqXHRorError) {
})
.always(function (jqXHRorResult, textStatus, jqXHRorError) {
that._deinitProgressListener(options);
that._onAlways(
jqXHRorResult,
@ -970,8 +1029,10 @@
);
that._sending -= 1;
that._active -= 1;
if (options.limitConcurrentUploads &&
options.limitConcurrentUploads > that._sending) {
if (
options.limitConcurrentUploads &&
options.limitConcurrentUploads > that._sending
) {
// Start the next queued upload,
// that has not been aborted:
var nextSlot = that._slots.shift();
@ -992,15 +1053,17 @@
return jqXHR;
};
this._beforeSend(e, options);
if (this.options.sequentialUploads ||
if (
this.options.sequentialUploads ||
(this.options.limitConcurrentUploads &&
this.options.limitConcurrentUploads <= this._sending)) {
this.options.limitConcurrentUploads <= this._sending)
) {
if (this.options.limitConcurrentUploads > 1) {
slot = $.Deferred();
this._slots.push(slot);
pipe = slot.then(send);
pipe = slot[that._promisePipe](send);
} else {
this._sequence = this._sequence.then(send, send);
this._sequence = this._sequence[that._promisePipe](send, send);
pipe = this._sequence;
}
// Return the piped Promise object, enhanced with an abort method,
@ -1043,8 +1106,10 @@
if (limitSize && files[0].size === undefined) {
limitSize = undefined;
}
if (!(options.singleFileUploads || limit || limitSize) ||
!this._isXHRUpload(options)) {
if (
!(options.singleFileUploads || limit || limitSize) ||
!this._isXHRUpload(options)
) {
fileSet = [files];
paramNameSet = [paramName];
} else if (!(options.singleFileUploads || limitSize) && limit) {
@ -1063,9 +1128,11 @@
paramNameSet = [];
for (i = 0; i < filesLength; i = i + 1) {
batchSize += files[i].size + overhead;
if (i + 1 === filesLength ||
((batchSize + files[i + 1].size + overhead) > limitSize) ||
(limit && i + 1 - j >= limit)) {
if (
i + 1 === filesLength ||
batchSize + files[i + 1].size + overhead > limitSize ||
(limit && i + 1 - j >= limit)
) {
fileSet.push(files.slice(j, i + 1));
paramNameSlice = paramName.slice(j, i + 1);
if (!paramNameSlice.length) {
@ -1089,7 +1156,7 @@
that._addConvenienceMethods(e, newData);
result = that._trigger(
'add',
$.Event('add', {delegatedEvent: e}),
$.Event('add', { delegatedEvent: e }),
newData
);
return result;
@ -1110,10 +1177,10 @@
// If the fileInput had focus before it was detached,
// restore focus to the inputClone.
if (restoreFocus) {
inputClone.focus();
inputClone.trigger('focus');
}
// Avoid memory leaks with the detached file input:
$.cleanData(input.unbind('remove'));
$.cleanData(input.off('remove'));
// Replace the original file input element in the fileInput
// elements set with the clone, which has been copied including
// event handlers:
@ -1146,12 +1213,12 @@
dfd.resolve([e]);
},
successHandler = function (entries) {
that._handleFileTreeEntries(
entries,
path + entry.name + '/'
).done(function (files) {
that
._handleFileTreeEntries(entries, path + entry.name + '/')
.done(function (files) {
dfd.resolve(files);
}).fail(errorHandler);
})
.fail(errorHandler);
},
readEntries = function () {
dirReader.readEntries(function (results) {
@ -1163,6 +1230,7 @@
}
}, errorHandler);
};
// eslint-disable-next-line no-param-reassign
path = path || '';
if (entry.isFile) {
if (entry._file) {
@ -1188,24 +1256,27 @@
_handleFileTreeEntries: function (entries, path) {
var that = this;
return $.when.apply(
return $.when
.apply(
$,
$.map(entries, function (entry) {
return that._handleFileTreeEntry(entry, path);
})
).then(function () {
return Array.prototype.concat.apply(
[],
arguments
);
)
[this._promisePipe](function () {
return Array.prototype.concat.apply([], arguments);
});
},
_getDroppedFiles: function (dataTransfer) {
// eslint-disable-next-line no-param-reassign
dataTransfer = dataTransfer || {};
var items = dataTransfer.items;
if (items && items.length && (items[0].webkitGetAsEntry ||
items[0].getAsEntry)) {
if (
items &&
items.length &&
(items[0].webkitGetAsEntry || items[0].getAsEntry)
) {
return this._handleFileTreeEntries(
$.map(items, function (item) {
var entry;
@ -1221,15 +1292,14 @@
})
);
}
return $.Deferred().resolve(
$.makeArray(dataTransfer.files)
).promise();
return $.Deferred().resolve($.makeArray(dataTransfer.files)).promise();
},
_getSingleFileInputFiles: function (fileInput) {
// eslint-disable-next-line no-param-reassign
fileInput = $(fileInput);
var entries = fileInput.prop('webkitEntries') ||
fileInput.prop('entries'),
var entries =
fileInput.prop('webkitEntries') || fileInput.prop('entries'),
files,
value;
if (entries && entries.length) {
@ -1244,7 +1314,7 @@
// If the files property is not available, the browser does not
// support the File API and we add a pseudo File object with
// the input value as name with path information removed:
files = [{name: value.replace(/^.*\\/, '')}];
files = [{ name: value.replace(/^.*\\/, '') }];
} else if (files[0].name === undefined && files[0].fileName) {
// File normalization for Safari 4 and Firefox 3:
$.each(files, function (index, file) {
@ -1259,14 +1329,10 @@
if (!(fileInput instanceof $) || fileInput.length === 1) {
return this._getSingleFileInputFiles(fileInput);
}
return $.when.apply(
$,
$.map(fileInput, this._getSingleFileInputFiles)
).then(function () {
return Array.prototype.concat.apply(
[],
arguments
);
return $.when
.apply($, $.map(fileInput, this._getSingleFileInputFiles))
[this._promisePipe](function () {
return Array.prototype.concat.apply([], arguments);
});
},
@ -1281,20 +1347,24 @@
if (that.options.replaceFileInput) {
that._replaceFileInput(data);
}
if (that._trigger(
if (
that._trigger(
'change',
$.Event('change', {delegatedEvent: e}),
$.Event('change', { delegatedEvent: e }),
data
) !== false) {
) !== false
) {
that._onAdd(e, data);
}
});
},
_onPaste: function (e) {
var items = e.originalEvent && e.originalEvent.clipboardData &&
var items =
e.originalEvent &&
e.originalEvent.clipboardData &&
e.originalEvent.clipboardData.items,
data = {files: []};
data = { files: [] };
if (items && items.length) {
$.each(items, function (index, item) {
var file = item.getAsFile && item.getAsFile();
@ -1302,11 +1372,13 @@
data.files.push(file);
}
});
if (this._trigger(
if (
this._trigger(
'paste',
$.Event('paste', {delegatedEvent: e}),
$.Event('paste', { delegatedEvent: e }),
data
) !== false) {
) !== false
) {
this._onAdd(e, data);
}
}
@ -1321,11 +1393,13 @@
e.preventDefault();
this._getDroppedFiles(dataTransfer).always(function (files) {
data.files = files;
if (that._trigger(
if (
that._trigger(
'drop',
$.Event('drop', {delegatedEvent: e}),
$.Event('drop', { delegatedEvent: e }),
data
) !== false) {
) !== false
) {
that._onAdd(e, data);
}
});
@ -1384,8 +1458,9 @@
_initSpecialOptions: function () {
var options = this.options;
if (options.fileInput === undefined) {
options.fileInput = this.element.is('input[type="file"]') ?
this.element : this.element.find('input[type="file"]');
options.fileInput = this.element.is('input[type="file"]')
? this.element
: this.element.find('input[type="file"]');
} else if (!(options.fileInput instanceof $)) {
options.fileInput = $(options.fileInput);
}
@ -1405,8 +1480,11 @@
},
_isRegExpOption: function (key, value) {
return key !== 'url' && $.type(value) === 'string' &&
/^\/.*\/[igm]{0,3}$/.test(value);
return (
key !== 'url' &&
$.type(value) === 'string' &&
/^\/.*\/[igm]{0,3}$/.test(value)
);
},
_initDataAttributes: function () {
@ -1414,9 +1492,7 @@
options = this.options,
data = this.element.data();
// Initialize options set via HTML5 data-attributes:
$.each(
this.element[0].attributes,
function (index, attr) {
$.each(this.element[0].attributes, function (index, attr) {
var key = attr.name.toLowerCase(),
value;
if (/^data-/.test(key)) {
@ -1430,8 +1506,7 @@
}
options[key] = value;
}
}
);
});
},
_create: function () {
@ -1499,8 +1574,7 @@
dfd.reject(null, 'abort', 'abort');
return promise;
};
this._getFileInputFiles(data.fileInput).always(
function (files) {
this._getFileInputFiles(data.fileInput).always(function (files) {
if (aborted) {
return;
}
@ -1518,8 +1592,7 @@
dfd.reject(jqXHR, textStatus, errorThrown);
}
);
}
);
});
return this._enhancePromise(promise);
}
data.files = $.makeArray(data.files);
@ -1529,7 +1602,5 @@
}
return this._getXHRPromise(false, data && data.context);
}
});
}));
});

View file

@ -9,9 +9,9 @@
* https://opensource.org/licenses/MIT
*/
/* global define, require, window, document, JSON */
/* global define, require */
;(function (factory) {
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
@ -23,7 +23,7 @@
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
})(function ($) {
'use strict';
// Helper variable to create unique names for the transport iframes:
@ -50,9 +50,8 @@
if (options.async) {
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6:
/*jshint scripturl: true */
// eslint-disable-next-line no-script-url
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
/*jshint scripturl: false */
form,
iframe,
addParamChar;
@ -77,15 +76,17 @@
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="' + initialIframeSrc +
'" name="iframe-transport-' + counter + '"></iframe>'
).bind('load', function () {
'<iframe src="' +
initialIframeSrc +
'" name="iframe-transport-' +
counter +
'"></iframe>'
).on('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
paramNames = $.isArray(options.paramName)
? options.paramName
: [options.paramName];
iframe.off('load').on('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
@ -102,15 +103,12 @@
}
// The complete callback returns the
// iframe content document as response object:
completeCallback(
200,
'success',
{'iframe': response}
);
completeCallback(200, 'success', { iframe: response });
// Fix for IE endless progress bar activity bug
// (happens on form submits to iframe targets):
$('<iframe src="' + initialIframeSrc + '"></iframe>')
.appendTo(form);
$('<iframe src="' + initialIframeSrc + '"></iframe>').appendTo(
form
);
window.setTimeout(function () {
// Removing the form in a setTimeout call
// allows Chrome's developer tools to display
@ -130,8 +128,11 @@
.appendTo(form);
});
}
if (options.fileInput && options.fileInput.length &&
options.type === 'POST') {
if (
options.fileInput &&
options.fileInput.length &&
options.type === 'POST'
) {
fileInputClones = options.fileInput.clone();
// Insert a clone for each file input field:
options.fileInput.after(function (index) {
@ -139,10 +140,7 @@
});
if (options.paramName) {
options.fileInput.each(function (index) {
$(this).prop(
'name',
paramNames[index] || options.paramName
);
$(this).prop('name', paramNames[index] || options.paramName);
});
}
// Appending the file input fields to the hidden form
@ -155,6 +153,11 @@
// Remove the HTML5 form attribute from the input(s):
options.fileInput.removeAttr('form');
}
window.setTimeout(function () {
// Submitting the form in a setTimeout call fixes an issue with
// Safari 13 not triggering the iframe load event after resetting
// the load event handler, see also:
// https://github.com/blueimp/jQuery-File-Upload/issues/3633
form.submit();
// Insert the file input fields at their original location
// by replacing the clones with the originals:
@ -168,6 +171,7 @@
clone.replaceWith(input);
});
}
}, 0);
});
form.append(iframe).appendTo(document.body);
},
@ -175,10 +179,7 @@
if (iframe) {
// javascript:false as iframe src aborts the request
// and prevents warning popups on HTTPS in IE6.
// concat is used to avoid the "Script URL" JSLint error:
iframe
.unbind('load')
.prop('src', initialIframeSrc);
iframe.off('load').prop('src', initialIframeSrc);
}
if (form) {
form.remove();
@ -211,14 +212,16 @@
},
'iframe xml': function (iframe) {
var xmlDoc = iframe && iframe[0];
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html());
return xmlDoc && $.isXMLDoc(xmlDoc)
? xmlDoc
: $.parseXML(
(xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html()
);
},
'iframe script': function (iframe) {
return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
}));
});

View file

@ -1,75 +0,0 @@
/*
* jQuery File Upload Plugin JS Example
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global $, window */
$(function () {
'use strict';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: 'server/php/'
});
// Enable iframe cross-domain access via redirect option:
$('#fileupload').fileupload(
'option',
'redirect',
window.location.href.replace(
/\/[^\/]*$/,
'/cors/result.html?%s'
)
);
if (window.location.hostname === 'blueimp.github.io') {
// Demo settings:
$('#fileupload').fileupload('option', {
url: '//jquery-file-upload.appspot.com/',
// Enable image resizing, except for Android and Opera,
// which actually support image resizing, but fail to
// send Blob objects via XHR requests:
disableImageResize: /Android(?!.*Chrome)|Opera/
.test(window.navigator.userAgent),
maxFileSize: 999000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i
});
// Upload server status check for browsers with CORS support:
if ($.support.cors) {
$.ajax({
url: '//jquery-file-upload.appspot.com/',
type: 'HEAD'
}).fail(function () {
$('<div class="alert alert-danger"/>')
.text('Upload server currently unavailable - ' +
new Date())
.appendTo('#fileupload');
});
}
} else {
// Load existing files:
$('#fileupload').addClass('fileupload-processing');
$.ajax({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: $('#fileupload').fileupload('option', 'url'),
dataType: 'json',
context: $('#fileupload')[0]
}).always(function () {
$(this).removeClass('fileupload-processing');
}).done(function (result) {
$(this).fileupload('option', 'done')
.call(this, $.Event('done'), {result: result});
});
}
});

File diff suppressed because it is too large Load diff

2862
vendor/blueimp/jquery-file-upload/package-lock.json generated vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "blueimp-file-upload",
"version": "9.34.0",
"version": "10.31.0",
"title": "jQuery File Upload",
"description": "File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.",
"keywords": [
@ -34,22 +34,83 @@
"url": "git://github.com/blueimp/jQuery-File-Upload.git"
},
"license": "MIT",
"peerDependencies": {
"jquery": ">=1.7"
},
"optionalDependencies": {
"blueimp-canvas-to-blob": "3.5.0",
"blueimp-load-image": "2.12.2",
"blueimp-tmpl": "3.6.0"
"blueimp-canvas-to-blob": "3",
"blueimp-load-image": "5",
"blueimp-tmpl": "3"
},
"devDependencies": {
"bower-json": "0.8.1",
"jshint": "2.9.3"
"eslint": "7",
"eslint-config-blueimp": "2",
"eslint-config-prettier": "6",
"eslint-plugin-jsdoc": "29",
"eslint-plugin-prettier": "3",
"prettier": "2",
"stylelint": "13",
"stylelint-config-prettier": "8",
"stylelint-config-recommended": "3"
},
"stylelint": {
"extends": [
"stylelint-config-recommended",
"stylelint-config-prettier"
],
"ignoreFiles": [
"css/*.min.css",
"css/vendor/*",
"test/vendor/*"
]
},
"eslintConfig": {
"extends": [
"blueimp",
"plugin:jsdoc/recommended",
"plugin:prettier/recommended"
],
"env": {
"browser": true
}
},
"eslintIgnore": [
"js/*.min.js",
"test/vendor"
],
"prettier": {
"arrowParens": "avoid",
"proseWrap": "always",
"singleQuote": true,
"trailingComma": "none"
},
"scripts": {
"bower-version-update": "./bower-version-update.js",
"lint": "jshint *.js js/*.js js/cors/*.js",
"test": "npm run lint",
"lint": "stylelint '**/*.css' && eslint .",
"unit": "docker-compose run --rm mocha",
"wdio": "docker-compose run --rm wdio",
"test": "npm run lint && npm run unit && npm run wdio && npm run wdio -- conf/firefox.js",
"posttest": "docker-compose down -v",
"preversion": "npm test",
"version": "npm run bower-version-update && git add bower.json",
"postversion": "git push --tags origin master && npm publish"
},
"files": [
"css/jquery.fileupload-noscript.css",
"css/jquery.fileupload-ui-noscript.css",
"css/jquery.fileupload-ui.css",
"css/jquery.fileupload.css",
"img/loading.gif",
"img/progressbar.gif",
"js/cors/jquery.postmessage-transport.js",
"js/cors/jquery.xdr-transport.js",
"js/vendor/jquery.ui.widget.js",
"js/jquery.fileupload-audio.js",
"js/jquery.fileupload-image.js",
"js/jquery.fileupload-process.js",
"js/jquery.fileupload-ui.js",
"js/jquery.fileupload-validate.js",
"js/jquery.fileupload-video.js",
"js/jquery.fileupload.js",
"js/jquery.iframe-transport.js"
],
"main": "js/jquery.fileupload.js"
}

View file

@ -0,0 +1,2 @@
*
!php.ini

View file

@ -1,4 +1,4 @@
FROM php:7-apache
FROM php:7.4-apache
# Enable the Apache Headers module:
RUN ln -s /etc/apache2/mods-available/headers.load \
@ -20,7 +20,7 @@ RUN DEBIAN_FRONTEND=noninteractive \
&& docker-php-ext-enable \
imagick \
&& docker-php-ext-configure \
gd --with-jpeg-dir=/usr/include/ \
gd --with-jpeg=/usr/include/ \
&& docker-php-ext-install \
gd \
# Uninstall obsolete packages:
@ -36,3 +36,9 @@ RUN DEBIAN_FRONTEND=noninteractive \
/var/cache/* \
/var/lib/apt/lists/* \
/var/tmp/*
# Use the default development configuration:
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
# Add a custom configuration file:
COPY php.ini "$PHP_INI_DIR/conf.d/"

View file

@ -16,7 +16,7 @@ class UploadHandler
protected $options;
// PHP File Upload error message codes:
// http://php.net/manual/en/features.file-upload.errors.php
// https://php.net/manual/en/features.file-upload.errors.php
protected $error_messages = array(
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
@ -30,6 +30,7 @@ class UploadHandler
'min_file_size' => 'File is too small',
'accept_file_types' => 'Filetype not allowed',
'max_number_of_files' => 'Maximum number of files exceeded',
'invalid_file_type' => 'Invalid file type',
'max_width' => 'Image exceeds maximum width',
'min_width' => 'Image requires a minimum width',
'max_height' => 'Image exceeds maximum height',
@ -38,9 +39,9 @@ class UploadHandler
'image_resize' => 'Failed to resize image'
);
const IMAGETYPE_GIF = 1;
const IMAGETYPE_JPEG = 2;
const IMAGETYPE_PNG = 3;
const IMAGETYPE_GIF = 'image/gif';
const IMAGETYPE_JPEG = 'image/jpeg';
const IMAGETYPE_PNG = 'image/png';
protected $image_objects = array();
protected $response = array();
@ -324,7 +325,7 @@ class UploadHandler
protected function is_valid_file_object($file_name) {
$file_path = $this->get_upload_path($file_name);
if (is_file($file_path) && $file_name[0] !== '.') {
if (strlen($file_name) > 0 && $file_name[0] !== '.' && is_file($file_path)) {
return true;
}
return false;
@ -393,7 +394,53 @@ class UploadHandler
return $this->fix_integer_overflow($val);
}
protected function validate($uploaded_file, $file, $error, $index) {
protected function validate_image_file($uploaded_file, $file, $error, $index) {
if ($this->imagetype($uploaded_file) !== $this->get_file_type($file->name)) {
$file->error = $this->get_error_message('invalid_file_type');
return false;
}
$max_width = @$this->options['max_width'];
$max_height = @$this->options['max_height'];
$min_width = @$this->options['min_width'];
$min_height = @$this->options['min_height'];
if ($max_width || $max_height || $min_width || $min_height) {
list($img_width, $img_height) = $this->get_image_size($uploaded_file);
// If we are auto rotating the image by default, do the checks on
// the correct orientation
if (
@$this->options['image_versions']['']['auto_orient'] &&
function_exists('exif_read_data') &&
($exif = @exif_read_data($uploaded_file)) &&
(((int) @$exif['Orientation']) >= 5)
) {
$tmp = $img_width;
$img_width = $img_height;
$img_height = $tmp;
unset($tmp);
}
if (!empty($img_width) && !empty($img_height)) {
if ($max_width && $img_width > $max_width) {
$file->error = $this->get_error_message('max_width');
return false;
}
if ($max_height && $img_height > $max_height) {
$file->error = $this->get_error_message('max_height');
return false;
}
if ($min_width && $img_width < $min_width) {
$file->error = $this->get_error_message('min_width');
return false;
}
if ($min_height && $img_height < $min_height) {
$file->error = $this->get_error_message('min_height');
return false;
}
}
}
return true;
}
protected function validate($uploaded_file, $file, $error, $index, $content_range) {
if ($error) {
$file->error = $this->get_error_message($error);
return false;
@ -434,44 +481,8 @@ class UploadHandler
$file->error = $this->get_error_message('max_number_of_files');
return false;
}
$max_width = @$this->options['max_width'];
$max_height = @$this->options['max_height'];
$min_width = @$this->options['min_width'];
$min_height = @$this->options['min_height'];
if (($max_width || $max_height || $min_width || $min_height)
&& $this->is_valid_image_file($uploaded_file)) {
list($img_width, $img_height) = $this->get_image_size($uploaded_file);
// If we are auto rotating the image by default, do the checks on
// the correct orientation
if (
@$this->options['image_versions']['']['auto_orient'] &&
function_exists('exif_read_data') &&
($exif = @exif_read_data($uploaded_file)) &&
(((int) @$exif['Orientation']) >= 5)
) {
$tmp = $img_width;
$img_width = $img_height;
$img_height = $tmp;
unset($tmp);
}
}
if (!empty($img_width) && !empty($img_height)) {
if ($max_width && $img_width > $max_width) {
$file->error = $this->get_error_message('max_width');
return false;
}
if ($max_height && $img_height > $max_height) {
$file->error = $this->get_error_message('max_height');
return false;
}
if ($min_width && $img_width < $min_width) {
$file->error = $this->get_error_message('min_width');
return false;
}
if ($min_height && $img_height < $min_height) {
$file->error = $this->get_error_message('min_height');
return false;
}
if (!$content_range && $this->has_image_file_extension($file->name)) {
return $this->validate_image_file($uploaded_file, $file, $error, $index);
}
return true;
}
@ -497,7 +508,7 @@ class UploadHandler
$name = $this->upcount_name($name);
}
// Keep an existing filename if this is part of a chunked upload:
$uploaded_bytes = $this->fix_integer_overflow((int)$content_range[1]);
$uploaded_bytes = $this->fix_integer_overflow((int)@$content_range[1]);
while (is_file($this->get_upload_path($name))) {
if ($uploaded_bytes === $this->get_file_size(
$this->get_upload_path($name))) {
@ -508,6 +519,17 @@ class UploadHandler
return $name;
}
protected function get_valid_image_extensions($file_path) {
switch ($this->imagetype($file_path)) {
case self::IMAGETYPE_JPEG:
return array('jpg', 'jpeg');
case self::IMAGETYPE_PNG:
return array('png');
case self::IMAGETYPE_GIF:
return array('gif');
}
}
protected function fix_file_extension($file_path, $name, $size, $type, $error,
$index, $content_range) {
// Add missing file extension for known image types:
@ -516,17 +538,7 @@ class UploadHandler
$name .= '.'.$matches[1];
}
if ($this->options['correct_image_extensions']) {
switch ($this->imagetype($file_path)) {
case self::IMAGETYPE_JPEG:
$extensions = array('jpg', 'jpeg');
break;
case self::IMAGETYPE_PNG:
$extensions = array('png');
break;
case self::IMAGETYPE_GIF:
$extensions = array('gif');
break;
}
$extensions = $this->get_valid_image_extensions($file_path);
// Adjust incorrect image file extensions:
if (!empty($extensions)) {
$parts = explode('.', $name);
@ -1094,12 +1106,13 @@ class UploadHandler
}
protected function is_valid_image_file($file_path) {
if (!preg_match('/\.(gif|jpe?g|png)$/i', $file_path)) {
return false;
}
return !!$this->imagetype($file_path);
}
protected function has_image_file_extension($file_path) {
return !!preg_match('/\.(gif|jpe?g|png)$/i', $file_path);
}
protected function handle_image_file($file_path, $file) {
$failed_versions = array();
foreach ($this->options['image_versions'] as $version => $options) {
@ -1118,7 +1131,7 @@ class UploadHandler
}
if (count($failed_versions)) {
$file->error = $this->get_error_message('image_resize')
.' ('.implode($failed_versions, ', ').')';
.' ('.implode(', ', $failed_versions).')';
}
// Free memory:
$this->destroy_image_object($file_path);
@ -1131,7 +1144,7 @@ class UploadHandler
$index, $content_range);
$file->size = $this->fix_integer_overflow((int)$size);
$file->type = $type;
if ($this->validate($uploaded_file, $file, $error, $index)) {
if ($this->validate($uploaded_file, $file, $error, $index, $content_range)) {
$this->handle_form_data($file, $index);
$upload_dir = $this->get_upload_path();
if (!is_dir($upload_dir)) {
@ -1162,9 +1175,13 @@ class UploadHandler
$file_size = $this->get_file_size($file_path, $append_file);
if ($file_size === $file->size) {
$file->url = $this->get_download_url($file->name);
if ($this->is_valid_image_file($file_path)) {
if ($this->has_image_file_extension($file->name)) {
if ($content_range && !$this->validate_image_file($file_path, $file, $error, $index)) {
unlink($file_path);
} else {
$this->handle_image_file($file_path, $file);
}
}
} else {
$file->size = $file_size;
if (!$content_range && $this->options['discard_aborted_uploads']) {
@ -1249,11 +1266,11 @@ class UploadHandler
switch (strtolower(pathinfo($file_path, PATHINFO_EXTENSION))) {
case 'jpeg':
case 'jpg':
return 'image/jpeg';
return self::IMAGETYPE_JPEG;
case 'png':
return 'image/png';
return self::IMAGETYPE_PNG;
case 'gif':
return 'image/gif';
return self::IMAGETYPE_GIF;
default:
return '';
}
@ -1394,7 +1411,7 @@ class UploadHandler
$content_range_header = $this->get_server_var('HTTP_CONTENT_RANGE');
$content_range = $content_range_header ?
preg_split('/[^0-9]+/', $content_range_header) : null;
$size = $content_range ? $content_range[3] : null;
$size = @$content_range[3];
$files = array();
if ($upload) {
if (is_array($upload['tmp_name'])) {
@ -1440,7 +1457,7 @@ class UploadHandler
$response = array();
foreach ($file_names as $file_name) {
$file_path = $this->get_upload_path($file_name);
$success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);
$success = strlen($file_name) > 0 && $file_name[0] !== '.' && is_file($file_path) && unlink($file_path);
if ($success) {
foreach ($this->options['image_versions'] as $version => $options) {
if (!empty($version)) {

View file

@ -1,9 +0,0 @@
version: '2.3'
services:
apache:
build: ./
network_mode: bridge
ports:
- "80:80"
volumes:
- "../../:/var/www/html"

View file

@ -1,25 +1,49 @@
# To enable the Headers module, execute the following command and reload Apache:
# If you have not done so already, please first read SECURITY.md in the root
# directory of this project or online:
# https://github.com/blueimp/jQuery-File-Upload/blob/master/SECURITY.md
#
# The settings in this file require Apache to support configuration overrides
# in .htaccess files, which is disabled by default since Apache v2.3.9 and needs
# to be enabled for the directives in this file to have any effect, see also:
# https://httpd.apache.org/docs/current/mod/core.html#allowoverride
#
# If you have full control over the web server, it is preferrable to define the
# settings in the Apache configuration (e.g. /etc/apache2/apache2.conf) itself.
#
# Some of the directives require the Apache Headers module. If it is not
# already enabled, please execute the following command and reload Apache:
# sudo a2enmod headers
#
# Please note that the order of directives across configuration files matters,
# see also:
# https://httpd.apache.org/docs/current/sections.html#merging
# The following directives prevent the execution of script files
# in the context of the website.
# They also force the content-type application/octet-stream and
# force browsers to display a download dialog for non-image files.
SetHandler default-handler
ForceType application/octet-stream
Header set Content-Disposition attachment
# The following directive matches all files and forces them to be handled as
# static content, which prevents the server from parsing and executing files
# that are associated with a dynamic runtime, e.g. PHP files.
# It also forces their Content-Type header to "application/octet-stream" and
# adds a "Content-Disposition: attachment" header to force a download dialog,
# which prevents browsers from interpreting files in the context of the
# web server, e.g. HTML files containing JavaScript.
# Lastly it also prevents browsers from MIME-sniffing the Content-Type,
# preventing them from interpreting a file as a different Content-Type than
# the one sent by the webserver.
<FilesMatch ".*">
SetHandler default-handler
ForceType application/octet-stream
Header set Content-Disposition attachment
Header set X-Content-Type-Options nosniff
</FilesMatch>
# The following unsets the forced type and Content-Disposition headers
# for known image files:
<FilesMatch "(?i)\.(gif|jpe?g|png)$">
# The following directive matches known image files and unsets the forced
# Content-Type so they can be served with their original mime type.
# It also unsets the Content-Disposition header to allow displaying them
# inline in the browser.
<FilesMatch ".+\.(?i:(gif|jpe?g|png))$">
ForceType none
Header unset Content-Disposition
</FilesMatch>
# The following directive prevents browsers from MIME-sniffing the content-type.
# This is an important complement to the ForceType directive above:
Header set X-Content-Type-Options nosniff
# Uncomment the following lines to prevent unauthorized download of files:
#AuthName "Authorization required"
#AuthType Basic

View file

@ -0,0 +1,5 @@
max_execution_time = 300
memory_limit = 500M
post_max_size = 4G
upload_max_filesize = 4G
max_file_uploads = 50

View file

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<!DOCTYPE html>
<!--
/*
* jQuery File Upload Plugin Test
* jQuery File Upload Test
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
@ -12,161 +12,38 @@
*/
-->
<html lang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<![endif]-->
<meta charset="utf-8">
<title>jQuery File Upload Plugin Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.23.1.css" integrity="sha384-RW07PgMHO3eNYL7ddFK/okEi1rjvSeJ3Ck/TxGUHkmzSlGmw4R9/KGJYUD3OicMd" crossorigin="anonymous">
</head>
<body>
<h1 id="qunit-header">jQuery File Upload Plugin Test</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">
<!-- The file upload form used as target for the file upload widget -->
<form id="fileupload" action="../server/php/" method="POST" enctype="multipart/form-data">
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="col-lg-7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
<span>Start upload</span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="icon-ban-circle icon-white"></i>
<span>Cancel upload</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="icon-trash icon-white"></i>
<span>Delete</span>
</button>
<input type="checkbox" class="toggle">
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="col-lg-5 fileupload-progress">
<!-- The global progress bar -->
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-success" style="width:0%;"></div>
</div>
<!-- The extended global progress state -->
<div class="progress-extended">&nbsp;</div>
</div>
</div>
<!-- The table listing the files available for upload/download -->
<table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
</form>
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload">
<td>
<span class="preview"></span>
</td>
<td>
<p class="name">{%=file.name%}</p>
<strong class="error text-danger"></strong>
</td>
<td>
<p class="size">Processing...</p>
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
</td>
<td>
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-primary start" disabled>
<i class="glyphicon glyphicon-upload"></i>
<span>Start</span>
</button>
{% } %}
{% if (!i) { %}
<button class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download">
<td>
<span class="preview">
{% if (file.thumbnailUrl) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
{% } %}
</span>
</td>
<td>
<p class="name">
{% if (file.url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
{% } else { %}
<span>{%=file.name%}</span>
{% } %}
</p>
{% if (file.error) { %}
<div><span class="label label-danger">Error</span> {%=file.error%}</div>
{% } %}
</td>
<td>
<span class="size">{%=o.formatFileSize(file.size)%}</span>
</td>
<td>
{% if (file.deleteUrl) { %}
<button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
<input type="checkbox" name="delete" value="1" class="toggle">
{% } else { %}
<button class="btn btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script src="../js/vendor/jquery.ui.widget.js"></script>
<script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
<script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<script src="../js/jquery.iframe-transport.js"></script>
<script src="../js/jquery.fileupload.js"></script>
<script>
/* global window, $ */
window.testBasicWidget = $.blueimp.fileupload;
</script>
<script src="../js/jquery.fileupload-process.js"></script>
<script src="../js/jquery.fileupload-image.js"></script>
<script src="../js/jquery.fileupload-audio.js"></script>
<script src="../js/jquery.fileupload-video.js"></script>
<script src="../js/jquery.fileupload-validate.js"></script>
<script src="../js/jquery.fileupload-ui.js"></script>
<script>
/* global window, $ */
window.testUIWidget = $.blueimp.fileupload;
</script>
<script src="https://code.jquery.com/qunit/qunit-1.23.1.js" integrity="sha384-FJbPWND3tHbuhP8PhCp3Kn0bEtCxaIq+sfkmiJ+Su0jchKFnVbPQTTyPiuwqbkXa" crossorigin="anonymous"></script>
<script src="test.js"></script>
</body>
<head>
<meta charset="utf-8" />
<title>jQuery File Upload Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="vendor/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<script src="vendor/mocha.js"></script>
<script src="vendor/chai.js"></script>
<script>
mocha.setup('bdd');
</script>
<script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
<script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"
integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
crossorigin="anonymous"
></script>
<script src="../js/vendor/jquery.ui.widget.js"></script>
<script src="../js/jquery.iframe-transport.js"></script>
<script src="../js/jquery.fileupload.js"></script>
<script src="../js/jquery.fileupload-process.js"></script>
<script src="../js/jquery.fileupload-image.js"></script>
<script src="../js/jquery.fileupload-audio.js"></script>
<script src="../js/jquery.fileupload-video.js"></script>
<script src="../js/jquery.fileupload-validate.js"></script>
<script src="unit.js"></script>
<script>
mocha.checkLeaks();
mocha.run();
</script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,989 @@
/*
* jQuery File Upload Test
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*/
/* global beforeEach, afterEach, describe, it */
/* eslint-disable new-cap */
(function (expect, $) {
'use strict';
var canCreateBlob = !!window.dataURLtoBlob;
// 80x60px GIF image (color black, base64 data):
var b64DataGIF =
'R0lGODdhUAA8AIABAAAAAP///ywAAAAAUAA8AAACS4SPqcvtD6' +
'OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofE' +
'ovGITCqXzKbzCY1Kp9Sq9YrNarfcrvcLDovH5PKsAAA7';
var imageUrlGIF = 'data:image/gif;base64,' + b64DataGIF;
var blobGIF = canCreateBlob && window.dataURLtoBlob(imageUrlGIF);
// 2x1px JPEG (color white, with the Exif orientation flag set to 6 and the
// IPTC ObjectName (2:5) set to 'objectname'):
var b64DataJPEG =
'/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAASUkqAAgAAAABABIBAwABAAAA' +
'BgASAAAAAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAA8cAgUACm9iamVj' +
'dG5hbWUA/9sAQwABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB' +
'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB/9sAQwEBAQEBAQEBAQEBAQEBAQEB' +
'AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB' +
'/8AAEQgAAQACAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYH' +
'CAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGh' +
'CCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldY' +
'WVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1' +
'tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8B' +
'AAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAEC' +
'dwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBka' +
'JicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWG' +
'h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ' +
'2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8A/v4ooooA/9k=';
var imageUrlJPEG = 'data:image/jpeg;base64,' + b64DataJPEG;
var blobJPEG = canCreateBlob && window.dataURLtoBlob(imageUrlJPEG);
var fileGIF, fileJPEG, files, items, eventObject;
var uploadURL = '../server/php/';
/**
* Creates a fileupload form and adds it to the DOM
*
* @returns {object} jQuery node
*/
function createFileuploadForm() {
return $('<form><input type="file" name="files[]" multiple></form>')
.prop({
action: uploadURL,
method: 'POST',
enctype: 'multipart/form-data'
})
.css({ display: 'none' })
.appendTo(document.body);
}
/**
* Deletes all files from the upload server
*
* @param {Array} files Response files list
* @param {Function} callback Callback function
*/
function deleteFiles(files, callback) {
$.when(
files.map(function (file) {
return $.ajax({
type: file.deleteType,
url: file.deleteUrl
});
})
).always(function () {
callback();
});
}
beforeEach(function () {
fileGIF = new File([blobGIF], 'example.gif', { type: 'image/gif' });
fileJPEG = new File([blobJPEG], 'example.jpg', { type: 'image/jpeg' });
files = [fileGIF, fileJPEG];
items = [
{
getAsFile: function () {
return files[0];
}
},
{
getAsFile: function () {
return files[1];
}
}
];
eventObject = {
originalEvent: {
dataTransfer: { files: files, types: ['Files'] },
clipboardData: { items: items }
}
};
});
afterEach(function (done) {
$.getJSON(uploadURL).then(function (result) {
deleteFiles(result.files, done);
});
});
describe('Initialization', function () {
var form;
beforeEach(function () {
form = createFileuploadForm();
});
afterEach(function () {
form.remove();
});
it('widget', function () {
form.fileupload();
expect(form.data('blueimp-fileupload')).to.be.an('object');
});
it('file input', function () {
form.fileupload();
expect(form.fileupload('option', 'fileInput').length).to.equal(1);
});
it('drop zone', function () {
form.fileupload();
expect(form.fileupload('option', 'dropZone').length).to.equal(1);
});
it('paste zone', function () {
form.fileupload({ pasteZone: document });
expect(form.fileupload('option', 'pasteZone').length).to.equal(1);
});
it('data attributes', function () {
form.attr('data-url', 'https://example.org');
form.fileupload();
expect(form.fileupload('option', 'url')).to.equal('https://example.org');
expect(form.data('blueimp-fileupload')).to.be.an('object');
});
it('event listeners', function () {
var eventsData = {};
form.fileupload({
autoUpload: false,
pasteZone: document,
dragover: function () {
eventsData.dragover = true;
},
dragenter: function () {
eventsData.dragenter = true;
},
dragleave: function () {
eventsData.dragleave = true;
},
drop: function (e, data) {
eventsData.drop = data;
},
paste: function (e, data) {
eventsData.paste = data;
},
change: function () {
eventsData.change = true;
}
});
form
.fileupload('option', 'fileInput')
.trigger($.Event('change', eventObject));
expect(eventsData.change).to.equal(true);
form
.fileupload('option', 'dropZone')
.trigger($.Event('dragover', eventObject))
.trigger($.Event('dragenter', eventObject))
.trigger($.Event('dragleave', eventObject))
.trigger($.Event('drop', eventObject));
expect(eventsData.dragover).to.equal(true);
expect(eventsData.dragenter).to.equal(true);
expect(eventsData.dragleave).to.equal(true);
expect(eventsData.drop.files).to.deep.equal(files);
form
.fileupload('option', 'pasteZone')
.trigger($.Event('paste', eventObject));
expect(eventsData.paste.files).to.deep.equal(files);
});
});
describe('API', function () {
var form;
beforeEach(function () {
form = createFileuploadForm().fileupload({
dataType: 'json',
autoUpload: false
});
});
afterEach(function () {
form.remove();
});
it('destroy', function () {
var eventsData = {};
form.fileupload('option', {
pasteZone: document,
dragover: function () {
eventsData.dragover = true;
},
dragenter: function () {
eventsData.dragenter = true;
},
dragleave: function () {
eventsData.dragleave = true;
},
drop: function (e, data) {
eventsData.drop = data;
},
paste: function (e, data) {
eventsData.paste = data;
},
change: function () {
eventsData.change = true;
}
});
var fileInput = form.fileupload('option', 'fileInput');
var dropZone = form.fileupload('option', 'dropZone');
var pasteZone = form.fileupload('option', 'pasteZone');
form.fileupload('destroy');
expect(form.data('blueimp-fileupload')).to.equal();
fileInput.trigger($.Event('change', eventObject));
expect(eventsData.change).to.equal();
dropZone
.trigger($.Event('dragover', eventObject))
.trigger($.Event('dragenter', eventObject))
.trigger($.Event('dragleave', eventObject))
.trigger($.Event('drop', eventObject));
expect(eventsData.dragover).to.equal();
expect(eventsData.dragenter).to.equal();
expect(eventsData.dragleave).to.equal();
expect(eventsData.drop).to.equal();
pasteZone.trigger($.Event('paste', eventObject));
expect(eventsData.paste).to.equal();
});
it('disable', function () {
var eventsData = {};
form.fileupload('option', {
pasteZone: document,
dragover: function () {
eventsData.dragover = true;
},
dragenter: function () {
eventsData.dragenter = true;
},
dragleave: function () {
eventsData.dragleave = true;
},
drop: function (e, data) {
eventsData.drop = data;
},
paste: function (e, data) {
eventsData.paste = data;
},
change: function () {
eventsData.change = true;
}
});
form.fileupload('disable');
form
.fileupload('option', 'fileInput')
.trigger($.Event('change', eventObject));
expect(eventsData.change).to.equal();
form
.fileupload('option', 'dropZone')
.trigger($.Event('dragover', eventObject))
.trigger($.Event('dragenter', eventObject))
.trigger($.Event('dragleave', eventObject))
.trigger($.Event('drop', eventObject));
expect(eventsData.dragover).to.equal();
expect(eventsData.dragenter).to.equal();
expect(eventsData.dragleave).to.equal();
expect(eventsData.drop).to.equal();
form
.fileupload('option', 'pasteZone')
.trigger($.Event('paste', eventObject));
expect(eventsData.paste).to.equal();
});
it('enable', function () {
var eventsData = {};
form.fileupload('option', {
pasteZone: document,
dragover: function () {
eventsData.dragover = true;
},
dragenter: function () {
eventsData.dragenter = true;
},
dragleave: function () {
eventsData.dragleave = true;
},
drop: function (e, data) {
eventsData.drop = data;
},
paste: function (e, data) {
eventsData.paste = data;
},
change: function () {
eventsData.change = true;
}
});
form.fileupload('disable');
form.fileupload('enable');
form
.fileupload('option', 'fileInput')
.trigger($.Event('change', eventObject));
expect(eventsData.change).to.equal(true);
form
.fileupload('option', 'dropZone')
.trigger($.Event('dragover', eventObject))
.trigger($.Event('dragenter', eventObject))
.trigger($.Event('dragleave', eventObject))
.trigger($.Event('drop', eventObject));
expect(eventsData.dragover).to.equal(true);
expect(eventsData.dragenter).to.equal(true);
expect(eventsData.dragleave).to.equal(true);
expect(eventsData.drop.files).to.deep.equal(files);
form
.fileupload('option', 'pasteZone')
.trigger($.Event('paste', eventObject));
expect(eventsData.paste.files).to.deep.equal(files);
});
it('option', function () {
var eventsData = {};
form.fileupload('option', 'drop', function (e, data) {
eventsData.drop = data;
});
var dropZone = form
.fileupload('option', 'dropZone')
.trigger($.Event('drop', eventObject));
expect(eventsData.drop.files).to.deep.equal(files);
delete eventsData.drop;
form.fileupload('option', 'dropZone', null);
dropZone.trigger($.Event('drop', eventObject));
expect(eventsData.drop).to.equal();
form.fileupload('option', {
dropZone: dropZone
});
dropZone.trigger($.Event('drop', eventObject));
expect(eventsData.drop.files).to.deep.equal(files);
});
it('add', function () {
var eventData = [];
form.fileupload('option', 'add', function (e, data) {
eventData.push(data);
});
form.fileupload('add', { files: files });
expect(eventData.length).to.equal(2);
expect(eventData[0].files[0]).to.equal(files[0]);
expect(eventData[1].files[0]).to.equal(files[1]);
});
it('send', function (done) {
this.slow(200);
form.fileupload('send', { files: files }).complete(function (result) {
var uploadedFiles = result.responseJSON.files;
expect(uploadedFiles.length).to.equal(2);
expect(uploadedFiles[0].type).to.equal(files[0].type);
expect(uploadedFiles[0].error).to.equal();
expect(uploadedFiles[1].type).to.equal(files[1].type);
expect(uploadedFiles[1].error).to.equal();
done();
});
});
});
describe('Callbacks', function () {
var form;
beforeEach(function () {
form = createFileuploadForm().fileupload({ dataType: 'json' });
});
afterEach(function () {
form.remove();
});
it('add', function () {
var eventData = [];
form.fileupload('option', 'add', function (e, data) {
eventData.push(data);
});
form.fileupload('add', { files: files });
expect(eventData.length).to.equal(2);
expect(eventData[0].files[0]).to.equal(files[0]);
expect(eventData[1].files[0]).to.equal(files[1]);
});
it('submit', function (done) {
this.slow(200);
var eventData = [];
form.fileupload('option', {
submit: function (e, data) {
eventData.push(data);
},
stop: function () {
if (eventData.length < 2) return;
expect(eventData[0].files[0]).to.equal(files[0]);
expect(eventData[1].files[0]).to.equal(files[1]);
done();
}
});
form.fileupload('add', { files: files });
});
it('send', function (done) {
this.slow(200);
var eventData = [];
form.fileupload('option', {
send: function (e, data) {
eventData.push(data);
},
stop: function () {
expect(eventData.length).to.equal(1);
expect(eventData[0].files).to.deep.equal(files);
done();
}
});
form.fileupload('send', { files: files });
});
it('done', function (done) {
this.slow(200);
var eventData = [];
form.fileupload('option', {
done: function (e, data) {
eventData.push(data);
},
stop: function () {
if (eventData.length < 2) return;
expect(eventData[0].result.files.length).to.equal(1);
expect(eventData[1].result.files.length).to.equal(1);
done();
}
});
form.fileupload('add', { files: files });
});
it('fail', function (done) {
this.slow(200);
var eventData = [];
form.fileupload('option', {
url: uploadURL + '404',
fail: function (e, data) {
eventData.push(data);
},
stop: function () {
if (eventData.length < 2) return;
expect(eventData[0].result).to.equal();
expect(eventData[1].result).to.equal();
done();
}
});
form.fileupload('add', { files: files });
});
it('always', function (done) {
this.slow(200);
var eventData = [];
form.fileupload('option', {
always: function (e, data) {
eventData.push(data);
},
stop: function () {
if (eventData.length < 2) {
expect(eventData[0].result).to.equal();
form.fileupload('add', { files: [fileGIF] });
return;
}
expect(eventData[1].result.files.length).to.equal(1);
done();
}
});
form.fileupload('add', { files: [fileGIF], url: uploadURL + '404' });
});
it('progress', function (done) {
this.slow(200);
var loaded;
var total;
form.fileupload('option', {
progress: function (e, data) {
loaded = data.loaded;
total = data.total;
expect(loaded).to.be.at.most(total);
},
stop: function () {
expect(loaded).to.equal(total);
done();
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('progressall', function (done) {
this.slow(200);
var loaded;
var total;
var completed = 0;
form.fileupload('option', {
progressall: function (e, data) {
loaded = data.loaded;
total = data.total;
expect(loaded).to.be.at.most(total);
},
always: function () {
completed++;
},
stop: function () {
if (completed < 2) return;
expect(loaded).to.equal(total);
done();
}
});
form.fileupload('add', { files: files });
});
it('start', function (done) {
this.slow(200);
var started;
form.fileupload('option', {
start: function () {
started = true;
},
stop: function () {
expect(started).to.equal(true);
done();
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('stop', function (done) {
this.slow(200);
form.fileupload('option', {
stop: function () {
done();
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('dragover', function () {
var eventsData = {};
form.fileupload('option', {
autoUpload: false,
dragover: function () {
eventsData.dragover = true;
}
});
form
.fileupload('option', 'dropZone')
.trigger($.Event('dragover', eventObject));
expect(eventsData.dragover).to.equal(true);
});
it('dragenter', function () {
var eventsData = {};
form.fileupload('option', {
autoUpload: false,
dragenter: function () {
eventsData.dragenter = true;
}
});
form
.fileupload('option', 'dropZone')
.trigger($.Event('dragenter', eventObject));
expect(eventsData.dragenter).to.equal(true);
});
it('dragleave', function () {
var eventsData = {};
form.fileupload('option', {
autoUpload: false,
dragleave: function () {
eventsData.dragleave = true;
}
});
form
.fileupload('option', 'dropZone')
.trigger($.Event('dragleave', eventObject));
expect(eventsData.dragleave).to.equal(true);
});
it('drop', function () {
var eventsData = {};
form.fileupload('option', {
autoUpload: false,
drop: function (e, data) {
eventsData.drop = data;
}
});
form
.fileupload('option', 'dropZone')
.trigger($.Event('drop', eventObject));
expect(eventsData.drop.files).to.deep.equal(files);
});
it('paste', function () {
var eventsData = {};
form.fileupload('option', {
autoUpload: false,
pasteZone: document,
paste: function (e, data) {
eventsData.paste = data;
}
});
form
.fileupload('option', 'pasteZone')
.trigger($.Event('paste', eventObject));
expect(eventsData.paste.files).to.deep.equal(files);
});
it('change', function () {
var eventsData = {};
form.fileupload('option', {
autoUpload: false,
change: function () {
eventsData.change = true;
}
});
form
.fileupload('option', 'fileInput')
.trigger($.Event('change', eventObject));
expect(eventsData.change).to.equal(true);
});
});
describe('Options', function () {
var form;
beforeEach(function () {
form = createFileuploadForm();
});
afterEach(function () {
form.remove();
});
it('paramName', function (done) {
form.fileupload({
send: function (e, data) {
expect(data.paramName[0]).to.equal(
form.fileupload('option', 'fileInput').prop('name')
);
done();
return false;
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('url', function (done) {
form.fileupload({
send: function (e, data) {
expect(data.url).to.equal(form.prop('action'));
done();
return false;
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('type', function (done) {
form.fileupload({
type: 'PUT',
send: function (e, data) {
expect(data.type).to.equal('PUT');
done();
return false;
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('replaceFileInput', function () {
form.fileupload();
var fileInput = form.fileupload('option', 'fileInput');
fileInput.trigger($.Event('change', eventObject));
expect(form.fileupload('option', 'fileInput')[0]).to.not.equal(
fileInput[0]
);
form.fileupload('option', 'replaceFileInput', false);
fileInput = form.fileupload('option', 'fileInput');
fileInput.trigger($.Event('change', eventObject));
expect(form.fileupload('option', 'fileInput')[0]).to.equal(fileInput[0]);
});
it('forceIframeTransport', function (done) {
form.fileupload({
forceIframeTransport: 'PUT',
send: function (e, data) {
expect(data.dataType.substr(0, 6)).to.equal('iframe');
done();
return false;
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('singleFileUploads', function (done) {
form.fileupload({
singleFileUploads: false,
send: function (e, data) {
expect(data.files).to.deep.equal(files);
done();
return false;
}
});
form.fileupload('add', { files: files });
});
it('limitMultiFileUploads', function (done) {
var completed = 0;
form.fileupload({
singleFileUploads: false,
limitMultiFileUploads: 2,
send: function (e, data) {
expect(data.files).to.deep.equal(files);
completed++;
if (completed < 2) return;
done();
return false;
}
});
form.fileupload('add', { files: files.concat(files) });
});
it('limitMultiFileUploadSize', function (done) {
var completed = 0;
form.fileupload({
singleFileUploads: false,
limitMultiFileUploadSize: files[0].size + files[1].size,
limitMultiFileUploadSizeOverhead: 0,
send: function (e, data) {
expect(data.files).to.deep.equal(files);
completed++;
if (completed < 2) return;
done();
return false;
}
});
form.fileupload('add', { files: files.concat(files) });
});
it('sequentialUploads', function (done) {
this.slow(400);
var completed = 0;
var events = [];
form.fileupload({
sequentialUploads: true,
dataType: 'json',
send: function () {
events.push('send');
},
always: function () {
events.push('complete');
completed++;
},
stop: function () {
if (completed === 4) {
expect(events.join(',')).to.equal(
[
'send',
'complete',
'send',
'complete',
'send',
'complete',
'send',
'complete'
].join(',')
);
done();
}
}
});
form.fileupload('add', { files: files.concat(files) });
});
it('limitConcurrentUploads', function (done) {
this.slow(800);
var completed = 0;
var loadCount = 0;
form.fileupload({
limitConcurrentUploads: 2,
dataType: 'json',
send: function () {
loadCount++;
expect(loadCount).to.be.at.most(2);
},
always: function () {
completed++;
loadCount--;
},
stop: function () {
if (completed === 8) {
done();
}
}
});
form.fileupload('add', {
files: files.concat(files).concat(files).concat(files)
});
});
it('multipart', function (done) {
form.fileupload({
multipart: false,
send: function (e, data) {
expect(data.contentType).to.equal(fileGIF.type);
expect(data.headers['Content-Disposition']).to.equal(
'attachment; filename="' + fileGIF.name + '"'
);
done();
return false;
}
});
form.fileupload('add', { files: [fileGIF] });
});
it('uniqueFilenames', function (done) {
form.fileupload({
uniqueFilenames: {},
send: function (e, data) {
var formFiles = data.data.getAll('files[]');
expect(formFiles[0].name).to.equal(fileGIF.name);
expect(formFiles[1].name).to.equal(
fileGIF.name.replace('.gif', ' (1).gif')
);
expect(formFiles[2].name).to.equal(
fileGIF.name.replace('.gif', ' (2).gif')
);
done();
return false;
}
});
form.fileupload('send', { files: [fileGIF, fileGIF, fileGIF] });
});
it('maxChunkSize', function (done) {
this.slow(400);
var events = [];
form.fileupload({
maxChunkSize: 32,
dataType: 'json',
chunkbeforesend: function () {
events.push('chunkbeforesend');
},
chunksend: function () {
events.push('chunksend');
},
chunkdone: function () {
events.push('chunkdone');
},
done: function (e, data) {
var uploadedFile = data.result.files[0];
expect(uploadedFile.type).to.equal(fileGIF.type);
expect(uploadedFile.size).to.equal(fileGIF.size);
},
stop: function () {
expect(events.join(',')).to.equal(
[
'chunkbeforesend',
'chunksend',
'chunkdone',
'chunkbeforesend',
'chunksend',
'chunkdone',
'chunkbeforesend',
'chunksend',
'chunkdone',
'chunkbeforesend',
'chunksend',
'chunkdone'
].join(',')
);
done();
}
});
form.fileupload('send', { files: [fileGIF] });
});
it('acceptFileTypes', function (done) {
var processData;
form.fileupload({
acceptFileTypes: /^image\/gif$/,
singleFileUploads: false,
processalways: function (e, data) {
processData = data;
},
processstop: function () {
expect(processData.files[0].error).to.equal();
expect(processData.files[1].error).to.equal(
form.fileupload('option').i18n('acceptFileTypes')
);
done();
}
});
form.fileupload('add', { files: files });
});
it('maxFileSize', function (done) {
var processData;
form.fileupload({
maxFileSize: 200,
singleFileUploads: false,
processalways: function (e, data) {
processData = data;
},
processstop: function () {
expect(processData.files[0].error).to.equal();
expect(processData.files[1].error).to.equal(
form.fileupload('option').i18n('maxFileSize')
);
done();
}
});
form.fileupload('add', { files: files });
});
it('minFileSize', function (done) {
var processData;
form.fileupload({
minFileSize: 200,
singleFileUploads: false,
processalways: function (e, data) {
processData = data;
},
processstop: function () {
expect(processData.files[0].error).to.equal(
form.fileupload('option').i18n('minFileSize')
);
expect(processData.files[1].error).to.equal();
done();
}
});
form.fileupload('add', { files: files });
});
it('maxNumberOfFiles', function (done) {
var processData;
form.fileupload({
maxNumberOfFiles: 2,
getNumberOfFiles: function () {
return 2;
},
singleFileUploads: false,
processalways: function (e, data) {
processData = data;
},
processstop: function () {
expect(processData.files[0].error).to.equal(
form.fileupload('option').i18n('maxNumberOfFiles')
);
expect(processData.files[1].error).to.equal(
form.fileupload('option').i18n('maxNumberOfFiles')
);
done();
}
});
form.fileupload('add', { files: files });
});
});
})(this.chai.expect, this.jQuery);

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,325 @@
@charset "utf-8";
body {
margin:0;
}
#mocha {
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: 60px 50px;
}
#mocha ul,
#mocha li {
margin: 0;
padding: 0;
}
#mocha ul {
list-style: none;
}
#mocha h1,
#mocha h2 {
margin: 0;
}
#mocha h1 {
margin-top: 15px;
font-size: 1em;
font-weight: 200;
}
#mocha h1 a {
text-decoration: none;
color: inherit;
}
#mocha h1 a:hover {
text-decoration: underline;
}
#mocha .suite .suite h1 {
margin-top: 0;
font-size: .8em;
}
#mocha .hidden {
display: none;
}
#mocha h2 {
font-size: 12px;
font-weight: normal;
cursor: pointer;
}
#mocha .suite {
margin-left: 15px;
}
#mocha .test {
margin-left: 15px;
overflow: hidden;
}
#mocha .test.pending:hover h2::after {
content: '(pending)';
font-family: arial, sans-serif;
}
#mocha .test.pass.medium .duration {
background: #c09853;
}
#mocha .test.pass.slow .duration {
background: #b94a48;
}
#mocha .test.pass::before {
content: '✓';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #00d6b2;
}
#mocha .test.pass .duration {
font-size: 9px;
margin-left: 5px;
padding: 2px 5px;
color: #fff;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
#mocha .test.pass.fast .duration {
display: none;
}
#mocha .test.pending {
color: #0b97c4;
}
#mocha .test.pending::before {
content: '◦';
color: #0b97c4;
}
#mocha .test.fail {
color: #c00;
}
#mocha .test.fail pre {
color: black;
}
#mocha .test.fail::before {
content: '✖';
font-size: 12px;
display: block;
float: left;
margin-right: 5px;
color: #c00;
}
#mocha .test pre.error {
color: #c00;
max-height: 300px;
overflow: auto;
}
#mocha .test .html-error {
overflow: auto;
color: black;
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: -webkit-calc(100% - 42px);
max-width: -moz-calc(100% - 42px);
max-width: calc(100% - 42px); /*(2)*/
max-height: 300px;
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-box-shadow: 0 1px 3px #eee;
box-shadow: 0 1px 3px #eee;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#mocha .test .html-error pre.error {
border: none;
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0;
-webkit-box-shadow: 0;
-moz-box-shadow: 0;
box-shadow: 0;
padding: 0;
margin: 0;
margin-top: 18px;
max-height: none;
}
/**
* (1): approximate for browsers not supporting calc
* (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
* ^^ seriously
*/
#mocha .test pre {
display: block;
float: left;
clear: left;
font: 12px/1.5 monaco, monospace;
margin: 5px;
padding: 15px;
border: 1px solid #eee;
max-width: 85%; /*(1)*/
max-width: -webkit-calc(100% - 42px);
max-width: -moz-calc(100% - 42px);
max-width: calc(100% - 42px); /*(2)*/
word-wrap: break-word;
border-bottom-color: #ddd;
-webkit-box-shadow: 0 1px 3px #eee;
-moz-box-shadow: 0 1px 3px #eee;
box-shadow: 0 1px 3px #eee;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
#mocha .test h2 {
position: relative;
}
#mocha .test a.replay {
position: absolute;
top: 3px;
right: 0;
text-decoration: none;
vertical-align: middle;
display: block;
width: 15px;
height: 15px;
line-height: 15px;
text-align: center;
background: #eee;
font-size: 15px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-webkit-transition:opacity 200ms;
-moz-transition:opacity 200ms;
-o-transition:opacity 200ms;
transition: opacity 200ms;
opacity: 0.3;
color: #888;
}
#mocha .test:hover a.replay {
opacity: 1;
}
#mocha-report.pass .test.fail {
display: none;
}
#mocha-report.fail .test.pass {
display: none;
}
#mocha-report.pending .test.pass,
#mocha-report.pending .test.fail {
display: none;
}
#mocha-report.pending .test.pass.pending {
display: block;
}
#mocha-error {
color: #c00;
font-size: 1.5em;
font-weight: 100;
letter-spacing: 1px;
}
#mocha-stats {
position: fixed;
top: 15px;
right: 10px;
font-size: 12px;
margin: 0;
color: #888;
z-index: 1;
}
#mocha-stats .progress {
float: right;
padding-top: 0;
/**
* Set safe initial values, so mochas .progress does not inherit these
* properties from Bootstrap .progress (which causes .progress height to
* equal line height set in Bootstrap).
*/
height: auto;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
background-color: initial;
}
#mocha-stats em {
color: black;
}
#mocha-stats a {
text-decoration: none;
color: inherit;
}
#mocha-stats a:hover {
border-bottom: 1px solid #eee;
}
#mocha-stats li {
display: inline-block;
margin: 0 5px;
list-style: none;
padding-top: 11px;
}
#mocha-stats canvas {
width: 40px;
height: 40px;
}
#mocha code .comment { color: #ddd; }
#mocha code .init { color: #2f6fad; }
#mocha code .string { color: #5890ad; }
#mocha code .keyword { color: #8a6343; }
#mocha code .number { color: #2f6fad; }
@media screen and (max-device-width: 480px) {
#mocha {
margin: 60px 0px;
}
#mocha #stats {
position: absolute;
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,10 @@
'use strict'
module.exports = {
env: {
node: true
},
parserOptions: {
ecmaVersion: 2019
}
}

View file

@ -0,0 +1,9 @@
'use strict'
module.exports = {
arrowParens: 'avoid',
proseWrap: 'always',
semi: false,
singleQuote: true,
trailingComma: 'none'
}

View file

@ -0,0 +1,20 @@
MIT License
Copyright © 2019 Sebastian Tschan, https://blueimp.net
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

View file

@ -0,0 +1,85 @@
#!/bin/sh
#
# Adds TCP/UDP port forwarding rules to the pf firewall (MacOS/BSD).
#
# Adds rules for both TCP and UDP in addition to those from /etc/pf.conf.
# Requires an existing rdr-anchor entry in /etc/pf.conf.
# Only adds rules temporarily, without changing any files.
#
# Usage: ./forward-ports.sh [[nic:]port=[ip:]port [...]]
#
# If no network interface is given, forwards from all interfaces.
# If no IP is given, forwards to 127.0.0.1.
# If no port forwarding rule is given, resets to the rules from /etc/pf.conf.
#
# e.g. forwarding ports 80 and 443 on network interface en0 to ports 8080 and
# 8443 on localhost respectively:
# ./forward-ports.sh en0:80=8080 en0:443=8443
#
# Copyright 2019, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# https://opensource.org/licenses/MIT
#
set -e
RULES=
NEWLINE='
'
print_usage_exit() {
if [ -n "$RULES" ]; then
printf '\nError in custom rules:\n%s\n' "$RULES" >&2
fi
echo "Usage: $0 [[nic:]port=[ip:]port [...]]" >&2
exit 1
}
print_nat_rules() {
echo
echo 'Loaded NAT rules:'
sudo pfctl -s nat 2>/dev/null
echo
}
# Print usage and exit if option arguments like "-h" are used:
if [ "${1#-}" != "$1" ]; then print_usage_exit; fi
while test $# -gt 0; do
# Separate the from=to parts:
from=${1%=*}
to=${1#*=}
# If from part has a nic defined, extract it, else forward from all:
case "$from" in
*:*) nic="on ${from%:*}";;
*) nic=;;
esac
# Extract the port to forward from:
from_port=${from##*:}
# If to part has an IP defined, extract it, else forward to 127.0.0.1:
case "$to" in
*:*) to_ip=${to%:*};;
*) to_ip=127.0.0.1;;
esac
# Extract the port to forward to:
to_port=${to##*:}
# Create the packet filter (pf) forwarding rule for both TCP and UDP:
rule=$(
printf \
'rdr pass %s inet proto %s from any to any port %s -> %s port %s' \
"$nic" '{tcp udp}' "$from_port" "$to_ip" "$to_port"
)
# Add it to the list of rules:
RULES="$RULES$rule$NEWLINE"
shift
done
# Add the rules after the line matching "rdr-anchor" in /etc/pf.conf, print the
# combined rules to STDOUT and load the rules into pf from STDIN.
# Finally, display the loaded NAT rules or print the script usage on failure:
# shellcheck disable=SC2015
printf %s "$RULES" | sed -e '/rdr-anchor/r /dev/stdin' /etc/pf.conf |
sudo pfctl -Ef - 2>/dev/null && print_nat_rules || print_usage_exit

View file

@ -0,0 +1,43 @@
#!/bin/sh
if [ "$1" = -t ]; then
BIN='/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver'
shift
else
BIN=safaridriver
fi
SCREEN='Capture screen'
if [ -z "$1" ]; then
OUTPUT=$(ffmpeg -f avfoundation -list_devices true -i - 2>&1 | grep "$SCREEN")
if [ "$(echo "$OUTPUT" | grep -c ^)" -gt 1 ]; then
echo 'Please select the input device by entering its [index] number:' >&2
echo "$OUTPUT" >&2
read -r INDEX
fi
else
INDEX=$1
fi
echo 'Starting safaridriver on 127.0.0.1:4444 ...' >&2
"$BIN" -p 4444 & pid=$!
# shellcheck disable=SC2064
trap "kill $pid; exit" INT TERM
echo 'Starting mjpeg-server on 127.0.0.1:9000 ...' >&2
mjpeg-server -a 127.0.0.1:9000 -- ffmpeg \
-loglevel error \
-probesize 32 \
-fpsprobesize 0 \
-analyzeduration 0 \
-fflags nobuffer \
-f avfoundation \
-capture_cursor 1 \
-r "${FPS:-15}" \
-pixel_format yuyv422 \
-i "${INDEX:-$SCREEN}" \
-f mpjpeg \
-q "${QUALITY:-2}" \
-

View file

@ -0,0 +1,40 @@
'use strict'
/* eslint-disable jsdoc/valid-types */
/** @type WebdriverIO.Config */
const config = {
hostname: 'chromedriver',
path: '/',
capabilities: [
{
// Set maxInstances to 1 if screen recordings are enabled:
// maxInstances: 1,
browserName: 'chrome',
'goog:chromeOptions': {
// Disable headless mode if screen recordings are enabled:
args: ['--headless', '--window-size=1440,900']
}
}
],
logLevel: 'warn',
reporters: ['spec'],
framework: 'mocha',
mochaOpts: {
timeout: 60000
},
specs: ['test/specs/**/*.js'],
maximizeWindow: true,
screenshots: {
saveOnFail: true
},
videos: {
enabled: false,
resolution: '1440x900',
startDelay: 500,
stopDelay: 500
},
assetsDir: '/home/webdriver/assets/',
baseUrl: 'http://example'
}
exports.config = Object.assign({}, require('../hooks'), config)

View file

@ -0,0 +1,23 @@
'use strict'
/* eslint-disable jsdoc/valid-types */
/** @type WebdriverIO.Config */
const config = {
hostname: process.env.WINDOWS_HOST || 'host.docker.internal',
capabilities: [
{
// Set maxInstances to 1 if screen recordings are enabled:
// maxInstances: 1,
browserName: 'MicrosoftEdge'
}
],
videos: {
enabled: false,
inputFormat: 'mjpeg',
startDelay: 500,
stopDelay: 500
},
assetsDir: process.env.WINDOWS_ASSETS_DIR || process.env.MACOS_ASSETS_DIR
}
exports.config = Object.assign({}, require('./chrome').config, config)

View file

@ -0,0 +1,25 @@
'use strict'
/* eslint-disable jsdoc/valid-types */
/** @type WebdriverIO.Config */
const config = {
hostname: 'geckodriver',
capabilities: [
{
// geckodriver supports no parallel sessions:
maxInstances: 1,
browserName: 'firefox',
'moz:firefoxOptions': {
//args: ['-headless', '--window-size=1440,900']
}
}
],
videos: {
enabled: true,
resolution: '1440x900',
startDelay: 500,
stopDelay: 500
}
}
exports.config = Object.assign({}, require('./chrome').config, config)

View file

@ -0,0 +1,24 @@
'use strict'
/* eslint-disable jsdoc/valid-types */
/** @type WebdriverIO.Config */
const config = {
hostname: process.env.WINDOWS_HOST || 'host.docker.internal',
port: 4445,
capabilities: [
{
// IEDriverServer supports no parallel sessions:
maxInstances: 1,
browserName: 'internet explorer'
}
],
videos: {
enabled: true,
inputFormat: 'mjpeg',
startDelay: 500,
stopDelay: 500
},
assetsDir: process.env.WINDOWS_ASSETS_DIR
}
exports.config = Object.assign({}, require('./chrome').config, config)

View file

@ -0,0 +1,24 @@
'use strict'
/* eslint-disable jsdoc/valid-types */
/** @type WebdriverIO.Config */
const config = {
// Docker for Mac host address:
hostname: 'host.docker.internal',
capabilities: [
{
// safaridriver supports no parallel sessions:
maxInstances: 1,
browserName: 'safari'
}
],
videos: {
enabled: true,
inputFormat: 'mjpeg',
startDelay: 500,
stopDelay: 500
},
assetsDir: process.env.MACOS_ASSETS_DIR
}
exports.config = Object.assign({}, require('./chrome').config, config)

View file

@ -0,0 +1,26 @@
'use strict'
/* global browser, Promise */
const cmds = require('wdio-screen-commands')
/* eslint-disable jsdoc/valid-types */
/** @type WebdriverIO.HookFunctions */
const config = {
before: async () => {
browser.addCommand('saveScreenshotByName', cmds.saveScreenshotByName)
browser.addCommand('saveAndDiffScreenshot', cmds.saveAndDiffScreenshot)
if (browser.config.maximizeWindow) await browser.maximizeWindow()
},
beforeTest: async test => {
await cmds.startScreenRecording(test)
},
afterTest: async (test, context, result) => {
await Promise.all([
cmds.stopScreenRecording(test, result),
cmds.saveScreenshotByTest(test, result)
])
}
}
module.exports = config

View file

@ -0,0 +1,2 @@
*
!/.gitignore

View file

@ -0,0 +1,74 @@
'use strict'
/* global browser, $, $$ */
/* eslint-disable class-methods-use-this */
class FileUpload {
get fileinput() {
return $('.fileinput-button input')
}
get start() {
return $('.fileupload-buttonbar .start')
}
get toggle() {
return $('.fileupload-buttonbar .toggle')
}
get remove() {
return $('.fileupload-buttonbar .delete')
}
get processing() {
return $$('.files .processing')
}
get uploads() {
return $$('.files .template-upload')
}
get downloads() {
return $$('.files .template-download')
}
get checked() {
return $$('.files .toggle:checked')
}
/**
* Opens the file upload form.
*
* @param {number} [timeout] Wait timeout
* @returns {FileUpload} FileUpload object
*/
open(timeout) {
browser.url('/')
this.fileinput.waitForExist({ timeout })
return this
}
/**
* Uploads files.
*
* @param {Array<string>} files Files to upload
* @param {number} [timeout] Wait timeout
* @returns {FileUpload} FileUpload object
*/
upload(files, timeout) {
this.fileinput.addValue(files.join('\n'))
browser.waitUntil(() => !this.processing.length, { timeout })
this.start.click()
browser.waitUntil(() => !!this.downloads.length, { timeout })
browser.waitUntil(() => !this.uploads.length, { timeout })
return this
}
/**
* Deletes uploaded files.
*
* @param {number} [timeout] Wait timeout
* @returns {FileUpload} FileUpload object
*/
delete(timeout) {
this.toggle.click()
browser.waitUntil(() => this.downloads.length === this.checked.length, {
timeout
})
this.remove.click()
browser.waitUntil(() => !this.downloads.length, { timeout })
return this
}
}
module.exports = new FileUpload()

View file

@ -0,0 +1,23 @@
'use strict'
/* global browser, describe, it */
const FileUpload = require('../pages/file-upload')
const assetsDir = browser.config.assetsDir
describe('File Upload', () => {
if (!assetsDir) return
it('uploads files', () => {
FileUpload.open().upload([
assetsDir + 'black+white-60x40.gif',
assetsDir + 'black+white-3x2.jpg'
])
browser.saveAndDiffScreenshot('Files uploaded')
})
it('deletes files', () => {
FileUpload.open().delete()
browser.saveAndDiffScreenshot('Files deleted')
})
})

View file

@ -0,0 +1,4 @@
'use strict'
// Default to the Chrome config:
exports.config = require('./conf/chrome').config

View file

@ -619,9 +619,6 @@ return array(
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
'Ramsey\\Uuid\\BinaryUtils' => $vendorDir . '/ramsey/uuid/src/BinaryUtils.php',
'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php',
'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => $vendorDir . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php',
@ -1261,6 +1258,7 @@ return array(
'Zotlabs\\Daemon\\Cache_embeds' => $baseDir . '/Zotlabs/Daemon/Cache_embeds.php',
'Zotlabs\\Daemon\\Checksites' => $baseDir . '/Zotlabs/Daemon/Checksites.php',
'Zotlabs\\Daemon\\Cli_suggest' => $baseDir . '/Zotlabs/Daemon/Cli_suggest.php',
'Zotlabs\\Daemon\\Convo' => $baseDir . '/Zotlabs/Daemon/Convo.php',
'Zotlabs\\Daemon\\Cron' => $baseDir . '/Zotlabs/Daemon/Cron.php',
'Zotlabs\\Daemon\\Cron_daily' => $baseDir . '/Zotlabs/Daemon/Cron_daily.php',
'Zotlabs\\Daemon\\Cron_weekly' => $baseDir . '/Zotlabs/Daemon/Cron_weekly.php',
@ -1346,9 +1344,11 @@ return array(
'Zotlabs\\Module\\Admin\\Accounts' => $baseDir . '/Zotlabs/Module/Admin/Accounts.php',
'Zotlabs\\Module\\Admin\\Addons' => $baseDir . '/Zotlabs/Module/Admin/Addons.php',
'Zotlabs\\Module\\Admin\\Channels' => $baseDir . '/Zotlabs/Module/Admin/Channels.php',
'Zotlabs\\Module\\Admin\\Cover_photo' => $baseDir . '/Zotlabs/Module/Admin/Cover_photo.php',
'Zotlabs\\Module\\Admin\\Dbsync' => $baseDir . '/Zotlabs/Module/Admin/Dbsync.php',
'Zotlabs\\Module\\Admin\\Features' => $baseDir . '/Zotlabs/Module/Admin/Features.php',
'Zotlabs\\Module\\Admin\\Logs' => $baseDir . '/Zotlabs/Module/Admin/Logs.php',
'Zotlabs\\Module\\Admin\\Profile_photo' => $baseDir . '/Zotlabs/Module/Admin/Profile_photo.php',
'Zotlabs\\Module\\Admin\\Profs' => $baseDir . '/Zotlabs/Module/Admin/Profs.php',
'Zotlabs\\Module\\Admin\\Queue' => $baseDir . '/Zotlabs/Module/Admin/Queue.php',
'Zotlabs\\Module\\Admin\\Security' => $baseDir . '/Zotlabs/Module/Admin/Security.php',
@ -1444,6 +1444,7 @@ return array(
'Zotlabs\\Module\\Lostpass' => $baseDir . '/Zotlabs/Module/Lostpass.php',
'Zotlabs\\Module\\Magic' => $baseDir . '/Zotlabs/Module/Magic.php',
'Zotlabs\\Module\\Manage' => $baseDir . '/Zotlabs/Module/Manage.php',
'Zotlabs\\Module\\Markup' => $baseDir . '/Zotlabs/Module/Markup.php',
'Zotlabs\\Module\\Menu' => $baseDir . '/Zotlabs/Module/Menu.php',
'Zotlabs\\Module\\Mitem' => $baseDir . '/Zotlabs/Module/Mitem.php',
'Zotlabs\\Module\\Moderate' => $baseDir . '/Zotlabs/Module/Moderate.php',
@ -1478,7 +1479,6 @@ return array(
'Zotlabs\\Module\\Profile_photo' => $baseDir . '/Zotlabs/Module/Profile_photo.php',
'Zotlabs\\Module\\Profiles' => $baseDir . '/Zotlabs/Module/Profiles.php',
'Zotlabs\\Module\\Profperm' => $baseDir . '/Zotlabs/Module/Profperm.php',
'Zotlabs\\Module\\Pubsites' => $baseDir . '/Zotlabs/Module/Pubsites.php',
'Zotlabs\\Module\\Pubstream' => $baseDir . '/Zotlabs/Module/Pubstream.php',
'Zotlabs\\Module\\Q' => $baseDir . '/Zotlabs/Module/Q.php',
'Zotlabs\\Module\\Randprof' => $baseDir . '/Zotlabs/Module/Randprof.php',
@ -1512,6 +1512,7 @@ return array(
'Zotlabs\\Module\\Sharedwithme' => $baseDir . '/Zotlabs/Module/Sharedwithme.php',
'Zotlabs\\Module\\Siteinfo' => $baseDir . '/Zotlabs/Module/Siteinfo.php',
'Zotlabs\\Module\\Sitelist' => $baseDir . '/Zotlabs/Module/Sitelist.php',
'Zotlabs\\Module\\Sites' => $baseDir . '/Zotlabs/Module/Sites.php',
'Zotlabs\\Module\\Smilies' => $baseDir . '/Zotlabs/Module/Smilies.php',
'Zotlabs\\Module\\Sources' => $baseDir . '/Zotlabs/Module/Sources.php',
'Zotlabs\\Module\\Sslify' => $baseDir . '/Zotlabs/Module/Sslify.php',
@ -1533,6 +1534,7 @@ return array(
'Zotlabs\\Module\\View' => $baseDir . '/Zotlabs/Module/View.php',
'Zotlabs\\Module\\Viewconnections' => $baseDir . '/Zotlabs/Module/Viewconnections.php',
'Zotlabs\\Module\\Viewsrc' => $baseDir . '/Zotlabs/Module/Viewsrc.php',
'Zotlabs\\Module\\Vlists' => $baseDir . '/Zotlabs/Module/Vlists.php',
'Zotlabs\\Module\\Vote' => $baseDir . '/Zotlabs/Module/Vote.php',
'Zotlabs\\Module\\Wall_attach' => $baseDir . '/Zotlabs/Module/Wall_attach.php',
'Zotlabs\\Module\\Wall_upload' => $baseDir . '/Zotlabs/Module/Wall_upload.php',
@ -1540,6 +1542,7 @@ return array(
'Zotlabs\\Module\\Webpages' => $baseDir . '/Zotlabs/Module/Webpages.php',
'Zotlabs\\Module\\Well_known' => $baseDir . '/Zotlabs/Module/Well_known.php',
'Zotlabs\\Module\\Xchan' => $baseDir . '/Zotlabs/Module/Xchan.php',
'Zotlabs\\Module\\Xp' => $baseDir . '/Zotlabs/Module/Xp.php',
'Zotlabs\\Module\\Xref' => $baseDir . '/Zotlabs/Module/Xref.php',
'Zotlabs\\Module\\Zot' => $baseDir . '/Zotlabs/Module/Zot.php',
'Zotlabs\\Module\\Zot_probe' => $baseDir . '/Zotlabs/Module/Zot_probe.php',
@ -1809,6 +1812,8 @@ return array(
'Zotlabs\\Update\\_1239' => $baseDir . '/Zotlabs/Update/_1239.php',
'Zotlabs\\Update\\_1240' => $baseDir . '/Zotlabs/Update/_1240.php',
'Zotlabs\\Update\\_1241' => $baseDir . '/Zotlabs/Update/_1241.php',
'Zotlabs\\Update\\_1242' => $baseDir . '/Zotlabs/Update/_1242.php',
'Zotlabs\\Update\\_1243' => $baseDir . '/Zotlabs/Update/_1243.php',
'Zotlabs\\Web\\Controller' => $baseDir . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => $baseDir . '/Zotlabs/Web/HTTPHeaders.php',
'Zotlabs\\Web\\HTTPSig' => $baseDir . '/Zotlabs/Web/HTTPSig.php',
@ -1861,13 +1866,14 @@ return array(
'Zotlabs\\Widget\\Pinned' => $baseDir . '/Zotlabs/Widget/Pinned.php',
'Zotlabs\\Widget\\Portfolio' => $baseDir . '/Zotlabs/Widget/Portfolio.php',
'Zotlabs\\Widget\\Profile' => $baseDir . '/Zotlabs/Widget/Profile.php',
'Zotlabs\\Widget\\Pubsites' => $baseDir . '/Zotlabs/Widget/Pubsites.php',
'Zotlabs\\Widget\\Pubtagcloud' => $baseDir . '/Zotlabs/Widget/Pubtagcloud.php',
'Zotlabs\\Widget\\Random_block' => $baseDir . '/Zotlabs/Widget/Random_block.php',
'Zotlabs\\Widget\\Rating' => $baseDir . '/Zotlabs/Widget/Rating.php',
'Zotlabs\\Widget\\Savedsearch' => $baseDir . '/Zotlabs/Widget/Savedsearch.php',
'Zotlabs\\Widget\\Sblock' => $baseDir . '/Zotlabs/Widget/Sblock.php',
'Zotlabs\\Widget\\Settings_menu' => $baseDir . '/Zotlabs/Widget/Settings_menu.php',
'Zotlabs\\Widget\\Shortprofile' => $baseDir . '/Zotlabs/Widget/Shortprofile.php',
'Zotlabs\\Widget\\Site_projects' => $baseDir . '/Zotlabs/Widget/Site_projects.php',
'Zotlabs\\Widget\\Sitesearch' => $baseDir . '/Zotlabs/Widget/Sitesearch.php',
'Zotlabs\\Widget\\Stream_order' => $baseDir . '/Zotlabs/Widget/Stream_order.php',
'Zotlabs\\Widget\\Suggestedchats' => $baseDir . '/Zotlabs/Widget/Suggestedchats.php',

View file

@ -895,9 +895,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
'Ramsey\\Uuid\\BinaryUtils' => __DIR__ . '/..' . '/ramsey/uuid/src/BinaryUtils.php',
'Ramsey\\Uuid\\Builder\\DefaultUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DefaultUuidBuilder.php',
'Ramsey\\Uuid\\Builder\\DegradedUuidBuilder' => __DIR__ . '/..' . '/ramsey/uuid/src/Builder/DegradedUuidBuilder.php',
@ -1537,6 +1534,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Daemon\\Cache_embeds' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Cache_embeds.php',
'Zotlabs\\Daemon\\Checksites' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Checksites.php',
'Zotlabs\\Daemon\\Cli_suggest' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Cli_suggest.php',
'Zotlabs\\Daemon\\Convo' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Convo.php',
'Zotlabs\\Daemon\\Cron' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Cron.php',
'Zotlabs\\Daemon\\Cron_daily' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Cron_daily.php',
'Zotlabs\\Daemon\\Cron_weekly' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Cron_weekly.php',
@ -1622,9 +1620,11 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Admin\\Accounts' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Accounts.php',
'Zotlabs\\Module\\Admin\\Addons' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Addons.php',
'Zotlabs\\Module\\Admin\\Channels' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Channels.php',
'Zotlabs\\Module\\Admin\\Cover_photo' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Cover_photo.php',
'Zotlabs\\Module\\Admin\\Dbsync' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Dbsync.php',
'Zotlabs\\Module\\Admin\\Features' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Features.php',
'Zotlabs\\Module\\Admin\\Logs' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Logs.php',
'Zotlabs\\Module\\Admin\\Profile_photo' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Profile_photo.php',
'Zotlabs\\Module\\Admin\\Profs' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Profs.php',
'Zotlabs\\Module\\Admin\\Queue' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Queue.php',
'Zotlabs\\Module\\Admin\\Security' => __DIR__ . '/../..' . '/Zotlabs/Module/Admin/Security.php',
@ -1720,6 +1720,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Lostpass' => __DIR__ . '/../..' . '/Zotlabs/Module/Lostpass.php',
'Zotlabs\\Module\\Magic' => __DIR__ . '/../..' . '/Zotlabs/Module/Magic.php',
'Zotlabs\\Module\\Manage' => __DIR__ . '/../..' . '/Zotlabs/Module/Manage.php',
'Zotlabs\\Module\\Markup' => __DIR__ . '/../..' . '/Zotlabs/Module/Markup.php',
'Zotlabs\\Module\\Menu' => __DIR__ . '/../..' . '/Zotlabs/Module/Menu.php',
'Zotlabs\\Module\\Mitem' => __DIR__ . '/../..' . '/Zotlabs/Module/Mitem.php',
'Zotlabs\\Module\\Moderate' => __DIR__ . '/../..' . '/Zotlabs/Module/Moderate.php',
@ -1754,7 +1755,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Profile_photo' => __DIR__ . '/../..' . '/Zotlabs/Module/Profile_photo.php',
'Zotlabs\\Module\\Profiles' => __DIR__ . '/../..' . '/Zotlabs/Module/Profiles.php',
'Zotlabs\\Module\\Profperm' => __DIR__ . '/../..' . '/Zotlabs/Module/Profperm.php',
'Zotlabs\\Module\\Pubsites' => __DIR__ . '/../..' . '/Zotlabs/Module/Pubsites.php',
'Zotlabs\\Module\\Pubstream' => __DIR__ . '/../..' . '/Zotlabs/Module/Pubstream.php',
'Zotlabs\\Module\\Q' => __DIR__ . '/../..' . '/Zotlabs/Module/Q.php',
'Zotlabs\\Module\\Randprof' => __DIR__ . '/../..' . '/Zotlabs/Module/Randprof.php',
@ -1788,6 +1788,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Sharedwithme' => __DIR__ . '/../..' . '/Zotlabs/Module/Sharedwithme.php',
'Zotlabs\\Module\\Siteinfo' => __DIR__ . '/../..' . '/Zotlabs/Module/Siteinfo.php',
'Zotlabs\\Module\\Sitelist' => __DIR__ . '/../..' . '/Zotlabs/Module/Sitelist.php',
'Zotlabs\\Module\\Sites' => __DIR__ . '/../..' . '/Zotlabs/Module/Sites.php',
'Zotlabs\\Module\\Smilies' => __DIR__ . '/../..' . '/Zotlabs/Module/Smilies.php',
'Zotlabs\\Module\\Sources' => __DIR__ . '/../..' . '/Zotlabs/Module/Sources.php',
'Zotlabs\\Module\\Sslify' => __DIR__ . '/../..' . '/Zotlabs/Module/Sslify.php',
@ -1809,6 +1810,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\View' => __DIR__ . '/../..' . '/Zotlabs/Module/View.php',
'Zotlabs\\Module\\Viewconnections' => __DIR__ . '/../..' . '/Zotlabs/Module/Viewconnections.php',
'Zotlabs\\Module\\Viewsrc' => __DIR__ . '/../..' . '/Zotlabs/Module/Viewsrc.php',
'Zotlabs\\Module\\Vlists' => __DIR__ . '/../..' . '/Zotlabs/Module/Vlists.php',
'Zotlabs\\Module\\Vote' => __DIR__ . '/../..' . '/Zotlabs/Module/Vote.php',
'Zotlabs\\Module\\Wall_attach' => __DIR__ . '/../..' . '/Zotlabs/Module/Wall_attach.php',
'Zotlabs\\Module\\Wall_upload' => __DIR__ . '/../..' . '/Zotlabs/Module/Wall_upload.php',
@ -1816,6 +1818,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Webpages' => __DIR__ . '/../..' . '/Zotlabs/Module/Webpages.php',
'Zotlabs\\Module\\Well_known' => __DIR__ . '/../..' . '/Zotlabs/Module/Well_known.php',
'Zotlabs\\Module\\Xchan' => __DIR__ . '/../..' . '/Zotlabs/Module/Xchan.php',
'Zotlabs\\Module\\Xp' => __DIR__ . '/../..' . '/Zotlabs/Module/Xp.php',
'Zotlabs\\Module\\Xref' => __DIR__ . '/../..' . '/Zotlabs/Module/Xref.php',
'Zotlabs\\Module\\Zot' => __DIR__ . '/../..' . '/Zotlabs/Module/Zot.php',
'Zotlabs\\Module\\Zot_probe' => __DIR__ . '/../..' . '/Zotlabs/Module/Zot_probe.php',
@ -2085,6 +2088,8 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Update\\_1239' => __DIR__ . '/../..' . '/Zotlabs/Update/_1239.php',
'Zotlabs\\Update\\_1240' => __DIR__ . '/../..' . '/Zotlabs/Update/_1240.php',
'Zotlabs\\Update\\_1241' => __DIR__ . '/../..' . '/Zotlabs/Update/_1241.php',
'Zotlabs\\Update\\_1242' => __DIR__ . '/../..' . '/Zotlabs/Update/_1242.php',
'Zotlabs\\Update\\_1243' => __DIR__ . '/../..' . '/Zotlabs/Update/_1243.php',
'Zotlabs\\Web\\Controller' => __DIR__ . '/../..' . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPHeaders.php',
'Zotlabs\\Web\\HTTPSig' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPSig.php',
@ -2137,13 +2142,14 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Widget\\Pinned' => __DIR__ . '/../..' . '/Zotlabs/Widget/Pinned.php',
'Zotlabs\\Widget\\Portfolio' => __DIR__ . '/../..' . '/Zotlabs/Widget/Portfolio.php',
'Zotlabs\\Widget\\Profile' => __DIR__ . '/../..' . '/Zotlabs/Widget/Profile.php',
'Zotlabs\\Widget\\Pubsites' => __DIR__ . '/../..' . '/Zotlabs/Widget/Pubsites.php',
'Zotlabs\\Widget\\Pubtagcloud' => __DIR__ . '/../..' . '/Zotlabs/Widget/Pubtagcloud.php',
'Zotlabs\\Widget\\Random_block' => __DIR__ . '/../..' . '/Zotlabs/Widget/Random_block.php',
'Zotlabs\\Widget\\Rating' => __DIR__ . '/../..' . '/Zotlabs/Widget/Rating.php',
'Zotlabs\\Widget\\Savedsearch' => __DIR__ . '/../..' . '/Zotlabs/Widget/Savedsearch.php',
'Zotlabs\\Widget\\Sblock' => __DIR__ . '/../..' . '/Zotlabs/Widget/Sblock.php',
'Zotlabs\\Widget\\Settings_menu' => __DIR__ . '/../..' . '/Zotlabs/Widget/Settings_menu.php',
'Zotlabs\\Widget\\Shortprofile' => __DIR__ . '/../..' . '/Zotlabs/Widget/Shortprofile.php',
'Zotlabs\\Widget\\Site_projects' => __DIR__ . '/../..' . '/Zotlabs/Widget/Site_projects.php',
'Zotlabs\\Widget\\Sitesearch' => __DIR__ . '/../..' . '/Zotlabs/Widget/Sitesearch.php',
'Zotlabs\\Widget\\Stream_order' => __DIR__ . '/../..' . '/Zotlabs/Widget/Stream_order.php',
'Zotlabs\\Widget\\Suggestedchats' => __DIR__ . '/../..' . '/Zotlabs/Widget/Suggestedchats.php',

View file

@ -1,20 +1,20 @@
[
{
"name": "blueimp/jquery-file-upload",
"version": "v9.34.0",
"version_normalized": "9.34.0.0",
"version": "v10.31.0",
"version_normalized": "10.31.0.0",
"source": {
"type": "git",
"url": "https://github.com/vkhramtsov/jQuery-File-Upload.git",
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2"
"reference": "0740f81829698b84efe17e72501e0f420ea0d611"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"reference": "6d86a591f9a35bb811befb750dcd2c7da9ac05a2",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/0740f81829698b84efe17e72501e0f420ea0d611",
"reference": "0740f81829698b84efe17e72501e0f420ea0d611",
"shasum": ""
},
"time": "2019-07-22T13:10:51+00:00",
"time": "2020-07-13T05:42:06+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -54,6 +54,12 @@
"selection",
"upload",
"widget"
],
"funding": [
{
"url": "https://github.com/blueimp",
"type": "github"
}
]
},
{
@ -885,17 +891,17 @@
},
{
"name": "league/mime-type-detection",
"version": "1.4.0",
"version_normalized": "1.4.0.0",
"version": "1.5.0",
"version_normalized": "1.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/mime-type-detection.git",
"reference": "fda190b62b962d96a069fcc414d781db66d65b69"
"reference": "ea2fbfc988bade315acd5967e6d02274086d0f28"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/fda190b62b962d96a069fcc414d781db66d65b69",
"reference": "fda190b62b962d96a069fcc414d781db66d65b69",
"url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ea2fbfc988bade315acd5967e6d02274086d0f28",
"reference": "ea2fbfc988bade315acd5967e6d02274086d0f28",
"shasum": ""
},
"require": {
@ -906,7 +912,7 @@
"phpstan/phpstan": "^0.12.36",
"phpunit/phpunit": "^8.5.8"
},
"time": "2020-08-09T10:34:01+00:00",
"time": "2020-09-21T18:10:53+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -2377,27 +2383,27 @@
},
{
"name": "symfony/deprecation-contracts",
"version": "v2.1.3",
"version_normalized": "2.1.3.0",
"version": "v2.2.0",
"version_normalized": "2.2.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14"
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5e20b83385a77593259c9f8beb2c43cd03b2ac14",
"reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"time": "2020-06-06T08:49:21+00:00",
"time": "2020-09-07T11:33:47+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -2443,8 +2449,8 @@
},
{
"name": "symfony/options-resolver",
"version": "v5.1.3",
"version_normalized": "5.1.3.0",
"version": "v5.1.5",
"version_normalized": "5.1.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
@ -2999,8 +3005,8 @@
},
{
"name": "symfony/process",
"version": "v5.1.3",
"version_normalized": "5.1.3.0",
"version": "v5.1.5",
"version_normalized": "5.1.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",

View file

@ -181,6 +181,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap
'dart' => 'application/vnd.dart',
'dataless' => 'application/vnd.fdsn.seed',
'davmount' => 'application/davmount+xml',
'dbf' => 'application/vnd.dbf',
'dbk' => 'application/docbook+xml',
'dcr' => 'application/x-director',
'dcurl' => 'text/vnd.curl.dcurl',
@ -468,6 +469,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap
'ksp' => 'application/vnd.kde.kspread',
'ktr' => 'application/vnd.kahootz',
'ktx' => 'image/ktx',
'ktx2' => 'image/ktx2',
'ktz' => 'application/vnd.kahootz',
'kwd' => 'application/vnd.kde.kword',
'kwt' => 'application/vnd.kde.kword',

View file

@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "2.2-dev"
},
"thanks": {
"name": "symfony/contracts",

View file

@ -22,6 +22,6 @@ if (!function_exists('trigger_deprecation')) {
*/
function trigger_deprecation(string $package, string $version, string $message, ...$args): void
{
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), E_USER_DEPRECATED);
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
}
}