├── .gitignore
├── LICENSE
├── README.md
├── composer.json
├── composer.lock
└── src
├── Config
└── midia.php
├── Controller
└── MidiaController.php
├── Helpers.php
├── MidiaServiceProvider.php
├── Public
├── clipboard.js
├── dropzone.css
├── dropzone.js
├── jquery.js
├── lang
│ ├── midia-lang-en.js
│ └── midia-lang-tr.js
├── midia.css
├── midia.js
└── spinner.svg
├── Route
└── web.php
└── View
├── app.blade.php
└── list.blade.php
/.gitignore:
--------------------------------------------------------------------------------
1 | vendor/
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Muhamad Nauval Azhar
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Midia   
2 | Simple media manager for your Laravel project. This package lets you open your files as inline modal. All directories in the folder will be ignored. In other words, can only read the file.
3 |
4 | 
5 |
6 | # Features
7 | - Fully responsive
8 | - Read, rename, delete file
9 | - Infinite scroll
10 | - Search
11 | - Upload multiple
12 | - Multiple thumbnail sizes
13 | - Multiple directories
14 | - Multiple instance
15 | - Configurable
16 | - More ...
17 |
18 | # Todo List
19 | - [ ] Multiple images selection
20 | - [ ] Multi language
21 | - [ ] Multi user
22 | - [ ] UI improvement
23 | - [x] Thumbnail
24 |
25 | # Requirements
26 | - PHP >= 5.6.4
27 | - jQuery >= 1.12 (Recommended: 1.12)
28 | - intervention/image
29 | - Dropzone.js
30 | - Laravel 5
31 |
32 | # Tested
33 | - [x] Laravel 5.7
34 | - [ ] Laravel 5.6
35 | - [x] Laravel 5.5
36 | - [x] Laravel 5.4
37 | - [ ] Laravel 5.3
38 | - [ ] Laravel 5.2
39 | - [ ] Laravel 5.1
40 | - [ ] Laravel 5.0
41 |
42 | # Installation
43 | Now, this package is available for production. You can install this package using these steps.
44 |
45 | 1. Install through Composer
46 | ```
47 | composer require itskodinger/midia
48 | ```
49 |
50 | If you're using Laravel 5.6 you can skip this step, since it will be auto discovered by Laravel.
51 |
52 | 2. Put this line into `config/app.php` in the `providers` key
53 | ```php
54 | Itskodinger\Midia\MidiaServiceProvider::class,
55 | ```
56 | 3. Done!
57 |
58 | # Usage
59 | 1. Publish required assets.
60 |
61 | ```
62 | php artisan vendor:publish --tag=midia
63 | ```
64 |
65 | 2. Put this code in the `
` tag
66 |
67 | ```html
68 |
69 | ```
70 | 3. Add these lines before the `` tag
71 | ```html
72 |
73 |
74 |
75 | // or using helpers
76 |
77 | {!! midia_css() !!}
78 |
79 | ```
80 | 4. Make sure you've included jQuery before and put these lines after jQuery
81 | ```html
82 |
83 |
84 |
85 | // or using helpers
86 |
87 | {!! midia_js() !!}
88 | ```
89 |
90 | **Note:** Default, all files that are read and uploaded will be stored in the `storage/media` folder, so create a folder named `media` in the `storage` folder if you have not already created it or you can change the location of the folders you want in `config/midia.php`.
91 |
92 | # Integration
93 | Here we have documented how to use it with TinyMCE 4 and as a stand-alone button. But, you can also try it yourself to be integrated with other editors like: CKEditor, Summernote, etc.
94 |
95 | If you successfully integrate with other editors, then you can either create `issue` or change the `readme.md` file to document how you do it.
96 |
97 | ### TinyMCE 4
98 | ```html
99 |
100 |
131 | ```
132 | ### Summernote
133 | ```html
134 |
135 |
170 | ```
171 | ### Standalone Button
172 | #### Popup
173 | ```html
174 |
175 | Select File
176 |
177 |
182 | ```
183 | #### Inline
184 | ```html
185 |
186 |
187 |
193 | ```
194 | #### Multiple Instance With Different Directories
195 | ```html
196 |
197 |
198 |
199 |
212 | ```
213 | You can also use the configuration in `.midia()`. The following is the default configuration:
214 | ```javascript
215 | {
216 | title: 'Midia',
217 | identifier: 'fullname', // file attribute that used as identifier
218 | inline: false, // if you want to open the media manager as an inline element
219 | locale: 'en', // locale for the plugin (note: `lang/midia-lang-[locale].js` file should exist)
220 | base_url: '', // base url of your project
221 | file_name: '', // set to 'url' if you want to give full URL when choosing file,
222 | directory_name = '', // set with the existing key in the `config/midia.php` file in the 'directories' key. For example: 'mydocuments'
223 | data_target: 'input', // selector attribute for target file input
224 | data_preview: 'preview', // selector attribute for target file preview
225 | initial_value: null, // fill with your initial value for midia,
226 | initial_preview: null, // fill with your initial preview for media,
227 | csrf_field: $("meta[name='csrf-token']").attr('content'), // your CSRF field
228 | dropzone: {}, // you can provide other dropzone options
229 | onOpen: function() {}, // method when the media manager will be opened
230 | onOpened: function() {}, // method when the media manager is opened
231 | onClose: function() {}, // method when the media manager is closed
232 | onChoose: function() {} // method when the media manager choose File
233 | actions: ['copy_url', 'download', 'rename', 'delete'], // pick actions you want available in selected file
234 | can_choose: true, // if you want to hide 'pick' button, set it false,
235 | customLoadUrl: null, // if you want to use your custom url to load the files => function (limit, key) { ... }
236 | customUploadUrl: null, // if you want to use your custom url to upload the files => function () { ... }
237 | customRenameUrl: null, // if you want to use your custom url to rename the file => function (file) { ... }
238 | customDeleteUrl: null, // if you want to use your custom url to delete the file => function (file) { ... }
239 | load_ajax_type: 'get', // default ajax type to fetch files is 'get', you can change with 'post' http method
240 | }
241 | ```
242 | or you can use data-attributes to change the settings, use `data-midia` followed by your setting attributes, i.e. `data-midia-your_setting_want_to_change`:
243 | ```html
244 |
245 | ```
246 |
247 | # Override Default Settings
248 | You can override default settings for all instances by add following code before creating instance:
249 | ```javascript
250 | $.fn.midia.defaultSettings.name_of_setting = 'new value';
251 |
252 | // Example:
253 | $.fn.midia.defaultSettings.title = 'Midia Manager';
254 | $.fn.midia.defaultSettings.base_url = '/';
255 | ```
256 |
257 | # Setter
258 | You can also change to settings on the fly but you have to refresh after that:
259 | ```javascript
260 | var midiaObj = $(".midia-toggle").midia();
261 | midiaObj.midia('title', 'New Title').midia('refresh');
262 | // or
263 | midiaObj.midia({title: 'New Title'}).midia('refresh');
264 | ```
265 |
266 | # Getter
267 | You can get the the value from this following Midia Attributes:
268 | - el: get the dom elements
269 | - settings: get the settings
270 | - value: get the value, after you pick a file
271 |
272 | with this way:
273 | ```javascript
274 | var midiaObj = $(".midia-toggle").midia();
275 | midiaObj.midia('el');
276 | midiaObj.midia('settings');
277 | midiaObj.midia('value');
278 | ```
279 |
280 | # Methods
281 | Midia has this following methods:
282 | - refresh: refresh your midia, including empty the value, and implement the settings you change before.
283 | - open: open the midia dialog modal
284 | - close: close the midia dialog modal
285 |
286 | with this way:
287 | ```javascript
288 | var midiaObj = $(".midia-toggle").midia();
289 | midiaObj.midia('refresh');
290 | midiaObj.midia('open');
291 | midiaObj.midia('close');
292 | ```
293 |
294 | # Open The File
295 | To open a file in the browser, you can do it easily like this:
296 | ```
297 | http://yourdomain.com/media/filename.extension
298 | ```
299 | For example:
300 | ```
301 | http://yourdomain.com/media/image.png
302 | ```
303 | **Note:** You can change the `media` prefix in the `config/midia.php` file
304 |
305 | # Resize Image On The Fly
306 | You can quickly resize an image, set the `width` parameters to the size you want (in pixels) and set the `height` parameters to the size you want. If the `width` parameter is not set, it will be set equal to the `height` parameter and If the `height` parameter is not set, it will be set equal to the `width` parameter.
307 | ```
308 | For 100px * 300px image:
309 | http://yourdomain.com/media/image.png?width=100&height=300
310 | For 100px * 100px image:
311 | http://yourdomain.com/media/image.png?width=100
312 | ```
313 | **Note:** Resizing an image over its original size may make the image blurry
314 |
315 | # Configuration
316 | You can change the default configuration in the `config/midia.php` file.
317 | ```php
318 | storage_path('media'),
322 | // For URL (e.g: http://base/media/filename.ext)
323 | 'directory_name' => 'media',
324 | 'url_prefix' => 'media',
325 | 'prefix' => 'midia',
326 |
327 | // 404
328 | '404' => function() {
329 | return abort(404);
330 | },
331 |
332 | // Multiple target directories
333 | 'directories' => [
334 | // Examples:
335 | // ---------
336 | // 'home' => [
337 | // 'path' => storage_path('media/home'),
338 | // 'name' => 'media/home' // as url prefix
339 | // ],
340 | 'mydocuments' => [
341 | 'path' => storage_path('mydocuments'),
342 | 'name' => 'mydocuments' // as url prefix
343 | ],
344 | ],
345 |
346 | // Thumbnail size will be generated
347 | 'thumbs' => [100/*, 80, 100*/],
348 | ];
349 | ```
350 |
351 | # Authors
352 | This package was first initialized by [@nauvalazhar](https://github.com/nauvalazhar) and maintained by [@itskodinger](https://github.com/itskodinger). Then, it became extraordinary by all contributors: [@rizalfakhri12](https://github.com/rizalfakhri12) [@mrofi](https://github.com/mrofi) [@captainspain](https://github.com/captainspain) [@zeroseed](https://github.com/zeroseed) [@tpaksu](https://github.com/tpaksu)
353 |
354 | # License
355 | [MIT License](https://github.com/itskodinger/midia/blob/master/LICENSE)
356 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "itskodinger/midia",
3 | "description": "Simple Media manager for your Laravel project",
4 | "type": "library",
5 | "license": "MIT",
6 | "keywords": [
7 | "laravel",
8 | "filemanager",
9 | "dropzone",
10 | "upload",
11 | "file",
12 | "manager",
13 | "image",
14 | "ckeditor",
15 | "tinymce",
16 | "summernote"
17 | ],
18 | "authors": [
19 | {
20 | "name": "Muhamad Nauval Azhar",
21 | "email": "nauvalazhar2@gmail.com"
22 | },
23 | {
24 | "name": "Multinity",
25 | "email": "hi@multinity.com"
26 | },
27 | {
28 | "name": "Kodinger",
29 | "email": "itskodinger@gmail.com"
30 | },
31 | {
32 | "name": "Rizal Fakhri",
33 | "email": "rizal@codehub.id"
34 | }
35 | ],
36 | "require": {
37 | "php": ">=5.6.0",
38 | "intervention/image": "2.*"
39 | },
40 | "autoload": {
41 | "classmap": [
42 | "src"
43 | ],
44 | "psr-4": {
45 | "Itskodinger\\Midia\\": "src/"
46 | }
47 | },
48 | "extra": {
49 | "laravel": {
50 | "providers": [
51 | "Itskodinger\\Midia\\MidiaServiceProvider"
52 | ]
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 | "This file is @generated automatically"
6 | ],
7 | "content-hash": "b1a59df38dda050fa646d934d2033dfe",
8 | "packages": [
9 | {
10 | "name": "guzzlehttp/psr7",
11 | "version": "1.5.2",
12 | "source": {
13 | "type": "git",
14 | "url": "https://github.com/guzzle/psr7.git",
15 | "reference": "9f83dded91781a01c63574e387eaa769be769115"
16 | },
17 | "dist": {
18 | "type": "zip",
19 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
20 | "reference": "9f83dded91781a01c63574e387eaa769be769115",
21 | "shasum": ""
22 | },
23 | "require": {
24 | "php": ">=5.4.0",
25 | "psr/http-message": "~1.0",
26 | "ralouphie/getallheaders": "^2.0.5"
27 | },
28 | "provide": {
29 | "psr/http-message-implementation": "1.0"
30 | },
31 | "require-dev": {
32 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
33 | },
34 | "type": "library",
35 | "extra": {
36 | "branch-alias": {
37 | "dev-master": "1.5-dev"
38 | }
39 | },
40 | "autoload": {
41 | "psr-4": {
42 | "GuzzleHttp\\Psr7\\": "src/"
43 | },
44 | "files": [
45 | "src/functions_include.php"
46 | ]
47 | },
48 | "notification-url": "https://packagist.org/downloads/",
49 | "license": [
50 | "MIT"
51 | ],
52 | "authors": [
53 | {
54 | "name": "Michael Dowling",
55 | "email": "mtdowling@gmail.com",
56 | "homepage": "https://github.com/mtdowling"
57 | },
58 | {
59 | "name": "Tobias Schultze",
60 | "homepage": "https://github.com/Tobion"
61 | }
62 | ],
63 | "description": "PSR-7 message implementation that also provides common utility methods",
64 | "keywords": [
65 | "http",
66 | "message",
67 | "psr-7",
68 | "request",
69 | "response",
70 | "stream",
71 | "uri",
72 | "url"
73 | ],
74 | "time": "2018-12-04T20:46:45+00:00"
75 | },
76 | {
77 | "name": "intervention/image",
78 | "version": "2.4.2",
79 | "source": {
80 | "type": "git",
81 | "url": "https://github.com/Intervention/image.git",
82 | "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb"
83 | },
84 | "dist": {
85 | "type": "zip",
86 | "url": "https://api.github.com/repos/Intervention/image/zipball/e82d274f786e3d4b866a59b173f42e716f0783eb",
87 | "reference": "e82d274f786e3d4b866a59b173f42e716f0783eb",
88 | "shasum": ""
89 | },
90 | "require": {
91 | "ext-fileinfo": "*",
92 | "guzzlehttp/psr7": "~1.1",
93 | "php": ">=5.4.0"
94 | },
95 | "require-dev": {
96 | "mockery/mockery": "~0.9.2",
97 | "phpunit/phpunit": "^4.8 || ^5.7"
98 | },
99 | "suggest": {
100 | "ext-gd": "to use GD library based image processing.",
101 | "ext-imagick": "to use Imagick based image processing.",
102 | "intervention/imagecache": "Caching extension for the Intervention Image library"
103 | },
104 | "type": "library",
105 | "extra": {
106 | "branch-alias": {
107 | "dev-master": "2.4-dev"
108 | },
109 | "laravel": {
110 | "providers": [
111 | "Intervention\\Image\\ImageServiceProvider"
112 | ],
113 | "aliases": {
114 | "Image": "Intervention\\Image\\Facades\\Image"
115 | }
116 | }
117 | },
118 | "autoload": {
119 | "psr-4": {
120 | "Intervention\\Image\\": "src/Intervention/Image"
121 | }
122 | },
123 | "notification-url": "https://packagist.org/downloads/",
124 | "license": [
125 | "MIT"
126 | ],
127 | "authors": [
128 | {
129 | "name": "Oliver Vogel",
130 | "email": "oliver@olivervogel.com",
131 | "homepage": "http://olivervogel.com/"
132 | }
133 | ],
134 | "description": "Image handling and manipulation library with support for Laravel integration",
135 | "homepage": "http://image.intervention.io/",
136 | "keywords": [
137 | "gd",
138 | "image",
139 | "imagick",
140 | "laravel",
141 | "thumbnail",
142 | "watermark"
143 | ],
144 | "time": "2018-05-29T14:19:03+00:00"
145 | },
146 | {
147 | "name": "psr/http-message",
148 | "version": "1.0.1",
149 | "source": {
150 | "type": "git",
151 | "url": "https://github.com/php-fig/http-message.git",
152 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
153 | },
154 | "dist": {
155 | "type": "zip",
156 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
157 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
158 | "shasum": ""
159 | },
160 | "require": {
161 | "php": ">=5.3.0"
162 | },
163 | "type": "library",
164 | "extra": {
165 | "branch-alias": {
166 | "dev-master": "1.0.x-dev"
167 | }
168 | },
169 | "autoload": {
170 | "psr-4": {
171 | "Psr\\Http\\Message\\": "src/"
172 | }
173 | },
174 | "notification-url": "https://packagist.org/downloads/",
175 | "license": [
176 | "MIT"
177 | ],
178 | "authors": [
179 | {
180 | "name": "PHP-FIG",
181 | "homepage": "http://www.php-fig.org/"
182 | }
183 | ],
184 | "description": "Common interface for HTTP messages",
185 | "homepage": "https://github.com/php-fig/http-message",
186 | "keywords": [
187 | "http",
188 | "http-message",
189 | "psr",
190 | "psr-7",
191 | "request",
192 | "response"
193 | ],
194 | "time": "2016-08-06T14:39:51+00:00"
195 | },
196 | {
197 | "name": "ralouphie/getallheaders",
198 | "version": "2.0.5",
199 | "source": {
200 | "type": "git",
201 | "url": "https://github.com/ralouphie/getallheaders.git",
202 | "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
203 | },
204 | "dist": {
205 | "type": "zip",
206 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
207 | "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
208 | "shasum": ""
209 | },
210 | "require": {
211 | "php": ">=5.3"
212 | },
213 | "require-dev": {
214 | "phpunit/phpunit": "~3.7.0",
215 | "satooshi/php-coveralls": ">=1.0"
216 | },
217 | "type": "library",
218 | "autoload": {
219 | "files": [
220 | "src/getallheaders.php"
221 | ]
222 | },
223 | "notification-url": "https://packagist.org/downloads/",
224 | "license": [
225 | "MIT"
226 | ],
227 | "authors": [
228 | {
229 | "name": "Ralph Khattar",
230 | "email": "ralph.khattar@gmail.com"
231 | }
232 | ],
233 | "description": "A polyfill for getallheaders.",
234 | "time": "2016-02-11T07:05:27+00:00"
235 | }
236 | ],
237 | "packages-dev": [],
238 | "aliases": [],
239 | "minimum-stability": "stable",
240 | "stability-flags": [],
241 | "prefer-stable": false,
242 | "prefer-lowest": false,
243 | "platform": {
244 | "php": ">=5.6.0"
245 | },
246 | "platform-dev": []
247 | }
248 |
--------------------------------------------------------------------------------
/src/Config/midia.php:
--------------------------------------------------------------------------------
1 | storage_path('media'),
5 | // For URL (e.g: http://base/media/filename.ext)
6 | 'directory_name' => 'media',
7 | 'url_prefix' => 'media',
8 | 'prefix' => 'midia',
9 | // Multiple target directories
10 | 'directories' => [
11 | // Examples:
12 | // ---------
13 | // 'home' => [
14 | // 'path' => storage_path('media/home'),
15 | // 'name' => 'media/home' // as url prefix
16 | // ],
17 | 'mydocuments' => [
18 | 'path' => storage_path('mydocuments'),
19 | 'name' => 'mydocuments' // as url prefix
20 | ],
21 | ],
22 |
23 | // Thumbnail size will be generated
24 | 'thumbs' => [100/*, 80, 100*/],
25 | ];
26 |
--------------------------------------------------------------------------------
/src/Controller/MidiaController.php:
--------------------------------------------------------------------------------
1 | url_prefix = config('midia.url_prefix');
18 |
19 | if (request()->has('directory_name')) {
20 | $directoryName = request()->get('directory_name', null);
21 | }
22 |
23 | if(isset($directoryName)) {
24 | $currentDirectory = config('midia.directories.' . $directoryName, null);
25 |
26 | if($currentDirectory == null) {
27 | $this->directory = $directoryName;
28 | }else{
29 | $this->directory = $currentDirectory['path'];
30 | $this->directory_name = $currentDirectory['name'];
31 | }
32 | }else{
33 | $this->directory = config('midia.directory');
34 | $this->directory_name = config('midia.directory_name');
35 | }
36 |
37 | if($this->url_prefix == $this->directory_name) {
38 | $this->url_prefix = '';
39 | }
40 |
41 | $this->url_prefix .= '/';
42 |
43 | // thumbnail
44 | $this->thumbs = config('midia.thumbs');
45 | if(!in_array(250, $this->thumbs)) $this->thumbs[count($this->thumbs)] = 250;
46 |
47 | $this->default_thumb = 'thumbs-250';
48 |
49 | $this->imageTypes = [
50 | 'image/jpg',
51 | 'image/jpeg',
52 | 'image/pjpeg',
53 | 'image/png',
54 | 'image/x-png',
55 | 'image/gif',
56 | 'image/webp',
57 | 'image/x-webp'
58 | ];
59 | }
60 |
61 | public function url($path='') {
62 | return url($this->url_prefix . $path);
63 | }
64 |
65 | public function index($limit) {
66 | $dir = $this->directory;
67 | $q = request()->key;
68 |
69 | if(!is_dir($dir)) {
70 | // create directory if not found
71 | mkdir($dir);
72 | }
73 |
74 | $exec = scandir($dir);
75 | $exec = array_splice($exec, 2);
76 |
77 | $files = [];
78 | foreach($exec as $file) {
79 | $files[$file] = filemtime($dir . '/' . $file);
80 | }
81 |
82 | arsort($files);
83 | $files = array_keys($files);
84 | $exec = $files;
85 |
86 | $thumbs = $this->thumbs;
87 | foreach($thumbs as $i => $t) {
88 | $thumbs[$i] = 'thumbs-' . $t;
89 | }
90 |
91 | $_files = [];
92 | foreach($exec as $i => $item) {
93 | if(!is_dir($this->directory . '/' . $item)) {
94 | if(in_array(mime_content_type($this->directory . '/' . $item), $this->imageTypes))
95 | $this->_resize($item);
96 |
97 | $_files[$i]['fullname'] = $item;
98 | $_files[$i]['name'] = pathinfo($item, PATHINFO_FILENAME);
99 | $_files[$i]['url'] = $this->url($this->directory_name . '/' . $item);
100 | $_files[$i]['thumbnail'] = $this->url($this->directory_name . '/' . $this->default_thumb . '/' . $item);
101 | $_files[$i]['extension'] = strtolower(pathinfo($item,PATHINFO_EXTENSION));
102 | $_files[$i]['size'] = $this->toMb(filesize($this->directory . '/' . $item));
103 | $_files[$i]['filetime'] = midia_time_elapsed(filemtime($this->directory . '/' . $item));
104 | }
105 | }
106 |
107 | $total_all = count($_files);
108 |
109 | if(isset($q) && trim($q) !== '') {
110 | $_search = [];
111 | foreach($_files as $key => $file) {
112 | if(strpos($file['fullname'], $q) !== false) {
113 | $_search[$key] = $file;
114 | }
115 | }
116 | $_files = $_search;
117 | }
118 |
119 | $page = $limit;
120 | $perPage = 20;
121 | $offset = ($page * $perPage) - $perPage;
122 |
123 | $exec = array_slice($_files, $offset, $perPage);
124 | $dir = json_encode(["files" => $exec, "total" => count($_files), "total_all" => $total_all]);
125 |
126 | return response($dir, 200)
127 | ->header('Content-Type', 'application/json');
128 | }
129 |
130 | public function toMb($bytes) {
131 | for ($i=0;$bytes>=1024&&$i<5;$i++)
132 | $bytes/=1024;
133 |
134 | return round($bytes,2).[' B',' KB',' MB',' GB',' TB',' PB'][$i];
135 | }
136 |
137 | public function open($editor) {
138 | return view('midia::app', compact('editor'));
139 | }
140 |
141 | public function delete($file) {
142 | unlink($this->directory . '/' . $file);
143 | return response(['data' => 'ok'], 200)
144 | ->header('Content-Type', 'application/json');
145 | }
146 |
147 | public function upload(Request $request) {
148 | $file = $request->file('file');
149 | $fileName = $file->getClientOriginalName();
150 | $wo_extension = basename($fileName, "." . $file->getClientOriginalExtension());
151 |
152 | $inc = 1;
153 | while(file_exists($this->directory . '/' . $fileName)) {
154 | $name = $wo_extension . '-' . $inc;
155 | $fileName = $name . '.' . $file->getClientOriginalExtension();
156 | $inc++;
157 | }
158 | $file->move($this->directory, $fileName);
159 |
160 | // Resize
161 | if(in_array(mime_content_type($this->directory . '/' . $fileName), $this->imageTypes)) {
162 | $this->_resize($fileName);
163 | }
164 |
165 | return response()->json(['success'=>$fileName]);
166 | }
167 |
168 | public function _resize($fileName) {
169 | $thumbs = $this->thumbs;
170 | foreach($thumbs as $thumb) {
171 | $thumb_folder = 'thumbs-' . $thumb;
172 |
173 | if(!is_dir($this->directory . '/' . $thumb_folder))
174 | mkdir($this->directory . '/' . $thumb_folder);
175 |
176 | $file = $this->directory . '/' . $fileName;
177 | $thumb_file = $this->directory . '/' . $thumb_folder . '/' . $fileName;
178 |
179 | if(file_exists($thumb_file)) continue;
180 |
181 | $image = Image::make($file);
182 | $image->fit($thumb);
183 | $image->save($thumb_file);
184 | }
185 | }
186 |
187 | public function rename(Request $request, $file) {
188 | $fileName = $request->newName;
189 | $wo_extension = pathinfo($fileName, PATHINFO_FILENAME);
190 | $_extension = explode(".", $fileName);
191 | $extension = end($_extension);
192 |
193 | $inc = 1;
194 | while(file_exists($this->directory . '/' . $fileName)) {
195 | $name = $wo_extension . '-' . $inc;
196 | $fileName = $name . '.' . $extension;
197 | $inc++;
198 | }
199 |
200 | rename($this->directory . '/' . $file, $this->directory . '/' . $fileName);
201 | $thumbs = $this->thumbs;
202 | foreach($thumbs as $thumb) {
203 | $thumb_folder = 'thumbs-' . $thumb;
204 | rename($this->directory . '/' . $thumb_folder . '/' . $file, $this->directory . '/' . $thumb_folder . '/' . $fileName);
205 | }
206 |
207 | $new_data = [];
208 | $new_data['fullname'] = $fileName;
209 | $new_data['name'] = pathinfo($fileName, PATHINFO_FILENAME);
210 | $new_data['url'] = $this->url($this->directory_name . '/' . $fileName);
211 | $new_data['thumbnail'] = $this->url($this->directory_name . '/' . $this->default_thumb . '/' . $fileName);
212 |
213 | return response()->json(['success'=>$new_data]);
214 | }
215 | }
--------------------------------------------------------------------------------
/src/Helpers.php:
--------------------------------------------------------------------------------
1 | ';
13 | }
14 | }
15 |
16 | if (!function_exists('midia_js')) {
17 |
18 | /**
19 | * Midia JS HTML Tags.
20 | *
21 | * @return string
22 | */
23 | function midia_js()
24 | {
25 | return '';
26 | }
27 | }
28 |
29 | if (!function_exists('midia_time_elapsed')) {
30 |
31 | /**
32 | * Midia Human-readable Time
33 | *
34 | * @param string $datetime
35 | * @param boolean $full
36 | * @return string
37 | */
38 | function midia_time_elapsed($datetime, $full=false)
39 | {
40 | $datetime = date('Y-m-d h:i:s', $datetime);
41 | $now = new DateTime;
42 | $ago = new DateTime($datetime);
43 | $diff = $now->diff($ago);
44 |
45 | $diff->w = floor($diff->d / 7);
46 | $diff->d -= $diff->w * 7;
47 |
48 | $string = array(
49 | 'y' => 'year',
50 | 'm' => 'month',
51 | 'w' => 'week',
52 | 'd' => 'day',
53 | 'h' => 'hour',
54 | 'i' => 'minute',
55 | 's' => 'second',
56 | );
57 | foreach ($string as $k => &$v) {
58 | if ($diff->$k) {
59 | $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');
60 | } else {
61 | unset($string[$k]);
62 | }
63 | }
64 |
65 | if (!$full) $string = array_slice($string, 0, 1);
66 | return $string ? implode(', ', $string) : 'just now';
67 | }
68 | }
69 |
70 | if(!function_exists('midia_get_thumbnail')) {
71 | /**
72 | * Midia get thumbnails of given image URL
73 | *
74 | * @param string $url
75 | * @param int $size
76 | * @return string
77 | */
78 | function midia_get_thumbnail($url, $size)
79 | {
80 | // check if url is on our configured paths
81 | $directory = str_replace(storage_path().DIRECTORY_SEPARATOR, url("/")."/", config("midia.directory"));
82 | if(!starts_with($url, $directory)){
83 | return $url;
84 | }
85 |
86 | // check if url already contains a thumbnail size
87 | $parts = explode("/", $url);
88 |
89 | // we are sure that part count always is more than 2 because it starts with public url, so we can skip the check.
90 |
91 | // buffer the image protocol
92 | $protocol = $parts[0];
93 |
94 | // remove protocol and double slash
95 | $parts[0] = false; // remove http;
96 | $parts[1] = false; // remove double slash;
97 |
98 | // if the URL already has a thumbnail size, remove it also
99 | if(starts_with($parts[count($parts)-2], "thumbs-")){
100 | $parts[count($parts) - 2] = false;
101 | }
102 |
103 | // remove the deleted values
104 | $parts = array_values(array_filter($parts));
105 |
106 | // insert the new thumbnail path part
107 | array_splice($parts, -1, 0, "thumbs-".$size);
108 |
109 | // create a new URL and return it.
110 | $url = $protocol . "//" . implode("/", $parts);
111 | return $url;
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/src/MidiaServiceProvider.php:
--------------------------------------------------------------------------------
1 | loadRoutesFrom(__DIR__ . '/Route/web.php');
19 | $this->loadViewsFrom(__DIR__ . '/View', 'midia');
20 |
21 | $this->publishes([
22 | __DIR__ . '/Config/midia.php' => config_path('midia.php'),
23 | __DIR__ . '/Public/lang' => public_path('vendor/midia/lang'),
24 | __DIR__ . '/Public/clipboard.js' => public_path('vendor/midia/clipboard.js'),
25 | __DIR__ . '/Public/midia.js' => public_path('vendor/midia/midia.js'),
26 | __DIR__ . '/Public/midia.css' => public_path('vendor/midia/midia.css'),
27 | __DIR__ . '/Public/dropzone.js' => public_path('vendor/midia/dropzone.js'),
28 | __DIR__ . '/Public/jquery.js' => public_path('vendor/midia/jquery.js'),
29 | __DIR__ . '/Public/dropzone.css' => public_path('vendor/midia/dropzone.css'),
30 | __DIR__ . '/Public/spinner.svg' => public_path('vendor/midia/spinner.svg')
31 | ], 'midia');
32 | }
33 |
34 | /**
35 | * Register the application services.
36 | *
37 | * @return void
38 | */
39 | public function register()
40 | {
41 | $this->mergeConfigFrom(__DIR__ . '/Config/midia.php', config_path('midia.php'));
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Public/clipboard.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * clipboard.js v2.0.0
3 | * https://zenorocha.github.io/clipboard.js
4 | *
5 | * Licensed MIT © Zeno Rocha
6 | */
7 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){var o,r,i;!function(a,c){r=[t,n(7)],o=c,void 0!==(i="function"==typeof o?o.apply(e,r):o)&&(t.exports=i)}(0,function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(t){return t&&t.__esModule?t:{default:t}}(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=a})},function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return r(t,e,n);if(c.nodeList(t))return i(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function r(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function i(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return u(document.body,t,e,n)}var c=n(6),u=n(5);t.exports=o},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){r.off(t,o),e.apply(n,arguments)}var r=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;for(o;o0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===d(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,f.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),e}(s.default);t.exports=p})},function(t,e){function n(t,e){for(;t&&t.nodeType!==o;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var o=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}t.exports=n},function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function r(t,e,n,r,i){return"function"==typeof t.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return o(t,e,n,r,i)}))}function i(t,e,n,o){return function(n){n.delegateTarget=a(n.target,e),n.delegateTarget&&o.call(t,n)}}var a=n(4);t.exports=r},function(t,e){e.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},e.nodeList=function(t){var n=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in t&&(0===t.length||e.node(t[0]))},e.string=function(t){return"string"==typeof t||t instanceof String},e.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e){function n(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}t.exports=n}])});
--------------------------------------------------------------------------------
/src/Public/dropzone.css:
--------------------------------------------------------------------------------
1 | /*
2 | * The MIT License
3 | * Copyright (c) 2012 Matias Meno
4 | */
5 | @-webkit-keyframes passing-through {
6 | 0% {
7 | opacity: 0;
8 | -webkit-transform: translateY(40px);
9 | -moz-transform: translateY(40px);
10 | -ms-transform: translateY(40px);
11 | -o-transform: translateY(40px);
12 | transform: translateY(40px); }
13 | 30%, 70% {
14 | opacity: 1;
15 | -webkit-transform: translateY(0px);
16 | -moz-transform: translateY(0px);
17 | -ms-transform: translateY(0px);
18 | -o-transform: translateY(0px);
19 | transform: translateY(0px); }
20 | 100% {
21 | opacity: 0;
22 | -webkit-transform: translateY(-40px);
23 | -moz-transform: translateY(-40px);
24 | -ms-transform: translateY(-40px);
25 | -o-transform: translateY(-40px);
26 | transform: translateY(-40px); } }
27 | @-moz-keyframes passing-through {
28 | 0% {
29 | opacity: 0;
30 | -webkit-transform: translateY(40px);
31 | -moz-transform: translateY(40px);
32 | -ms-transform: translateY(40px);
33 | -o-transform: translateY(40px);
34 | transform: translateY(40px); }
35 | 30%, 70% {
36 | opacity: 1;
37 | -webkit-transform: translateY(0px);
38 | -moz-transform: translateY(0px);
39 | -ms-transform: translateY(0px);
40 | -o-transform: translateY(0px);
41 | transform: translateY(0px); }
42 | 100% {
43 | opacity: 0;
44 | -webkit-transform: translateY(-40px);
45 | -moz-transform: translateY(-40px);
46 | -ms-transform: translateY(-40px);
47 | -o-transform: translateY(-40px);
48 | transform: translateY(-40px); } }
49 | @keyframes passing-through {
50 | 0% {
51 | opacity: 0;
52 | -webkit-transform: translateY(40px);
53 | -moz-transform: translateY(40px);
54 | -ms-transform: translateY(40px);
55 | -o-transform: translateY(40px);
56 | transform: translateY(40px); }
57 | 30%, 70% {
58 | opacity: 1;
59 | -webkit-transform: translateY(0px);
60 | -moz-transform: translateY(0px);
61 | -ms-transform: translateY(0px);
62 | -o-transform: translateY(0px);
63 | transform: translateY(0px); }
64 | 100% {
65 | opacity: 0;
66 | -webkit-transform: translateY(-40px);
67 | -moz-transform: translateY(-40px);
68 | -ms-transform: translateY(-40px);
69 | -o-transform: translateY(-40px);
70 | transform: translateY(-40px); } }
71 | @-webkit-keyframes slide-in {
72 | 0% {
73 | opacity: 0;
74 | -webkit-transform: translateY(40px);
75 | -moz-transform: translateY(40px);
76 | -ms-transform: translateY(40px);
77 | -o-transform: translateY(40px);
78 | transform: translateY(40px); }
79 | 30% {
80 | opacity: 1;
81 | -webkit-transform: translateY(0px);
82 | -moz-transform: translateY(0px);
83 | -ms-transform: translateY(0px);
84 | -o-transform: translateY(0px);
85 | transform: translateY(0px); } }
86 | @-moz-keyframes slide-in {
87 | 0% {
88 | opacity: 0;
89 | -webkit-transform: translateY(40px);
90 | -moz-transform: translateY(40px);
91 | -ms-transform: translateY(40px);
92 | -o-transform: translateY(40px);
93 | transform: translateY(40px); }
94 | 30% {
95 | opacity: 1;
96 | -webkit-transform: translateY(0px);
97 | -moz-transform: translateY(0px);
98 | -ms-transform: translateY(0px);
99 | -o-transform: translateY(0px);
100 | transform: translateY(0px); } }
101 | @keyframes slide-in {
102 | 0% {
103 | opacity: 0;
104 | -webkit-transform: translateY(40px);
105 | -moz-transform: translateY(40px);
106 | -ms-transform: translateY(40px);
107 | -o-transform: translateY(40px);
108 | transform: translateY(40px); }
109 | 30% {
110 | opacity: 1;
111 | -webkit-transform: translateY(0px);
112 | -moz-transform: translateY(0px);
113 | -ms-transform: translateY(0px);
114 | -o-transform: translateY(0px);
115 | transform: translateY(0px); } }
116 | @-webkit-keyframes pulse {
117 | 0% {
118 | -webkit-transform: scale(1);
119 | -moz-transform: scale(1);
120 | -ms-transform: scale(1);
121 | -o-transform: scale(1);
122 | transform: scale(1); }
123 | 10% {
124 | -webkit-transform: scale(1.1);
125 | -moz-transform: scale(1.1);
126 | -ms-transform: scale(1.1);
127 | -o-transform: scale(1.1);
128 | transform: scale(1.1); }
129 | 20% {
130 | -webkit-transform: scale(1);
131 | -moz-transform: scale(1);
132 | -ms-transform: scale(1);
133 | -o-transform: scale(1);
134 | transform: scale(1); } }
135 | @-moz-keyframes pulse {
136 | 0% {
137 | -webkit-transform: scale(1);
138 | -moz-transform: scale(1);
139 | -ms-transform: scale(1);
140 | -o-transform: scale(1);
141 | transform: scale(1); }
142 | 10% {
143 | -webkit-transform: scale(1.1);
144 | -moz-transform: scale(1.1);
145 | -ms-transform: scale(1.1);
146 | -o-transform: scale(1.1);
147 | transform: scale(1.1); }
148 | 20% {
149 | -webkit-transform: scale(1);
150 | -moz-transform: scale(1);
151 | -ms-transform: scale(1);
152 | -o-transform: scale(1);
153 | transform: scale(1); } }
154 | @keyframes pulse {
155 | 0% {
156 | -webkit-transform: scale(1);
157 | -moz-transform: scale(1);
158 | -ms-transform: scale(1);
159 | -o-transform: scale(1);
160 | transform: scale(1); }
161 | 10% {
162 | -webkit-transform: scale(1.1);
163 | -moz-transform: scale(1.1);
164 | -ms-transform: scale(1.1);
165 | -o-transform: scale(1.1);
166 | transform: scale(1.1); }
167 | 20% {
168 | -webkit-transform: scale(1);
169 | -moz-transform: scale(1);
170 | -ms-transform: scale(1);
171 | -o-transform: scale(1);
172 | transform: scale(1); } }
173 | .dropzone, .dropzone * {
174 | box-sizing: border-box; }
175 |
176 | .dropzone {
177 | min-height: 150px;
178 | border: 2px solid rgba(0, 0, 0, 0.3);
179 | background: white;
180 | padding: 20px 20px; }
181 | .dropzone.dz-clickable {
182 | cursor: pointer; }
183 | .dropzone.dz-clickable * {
184 | cursor: default; }
185 | .dropzone.dz-clickable .dz-message, .dropzone.dz-clickable .dz-message * {
186 | cursor: pointer; }
187 | .dropzone.dz-started .dz-message {
188 | display: none; }
189 | .dropzone.dz-drag-hover {
190 | border-style: solid; }
191 | .dropzone.dz-drag-hover .dz-message {
192 | opacity: 0.5; }
193 | .dropzone .dz-message {
194 | text-align: center;
195 | margin: 2em 0; }
196 | .dropzone .dz-preview {
197 | position: relative;
198 | display: inline-block;
199 | vertical-align: top;
200 | margin: 16px;
201 | min-height: 100px; }
202 | .dropzone .dz-preview:hover {
203 | z-index: 1000; }
204 | .dropzone .dz-preview:hover .dz-details {
205 | opacity: 1; }
206 | .dropzone .dz-preview.dz-file-preview .dz-image {
207 | border-radius: 20px;
208 | background: #999;
209 | background: linear-gradient(to bottom, #eee, #ddd); }
210 | .dropzone .dz-preview.dz-file-preview .dz-details {
211 | opacity: 1; }
212 | .dropzone .dz-preview.dz-image-preview {
213 | background: white; }
214 | .dropzone .dz-preview.dz-image-preview .dz-details {
215 | -webkit-transition: opacity 0.2s linear;
216 | -moz-transition: opacity 0.2s linear;
217 | -ms-transition: opacity 0.2s linear;
218 | -o-transition: opacity 0.2s linear;
219 | transition: opacity 0.2s linear; }
220 | .dropzone .dz-preview .dz-remove {
221 | font-size: 14px;
222 | text-align: center;
223 | display: block;
224 | cursor: pointer;
225 | border: none; }
226 | .dropzone .dz-preview .dz-remove:hover {
227 | text-decoration: underline; }
228 | .dropzone .dz-preview:hover .dz-details {
229 | opacity: 1; }
230 | .dropzone .dz-preview .dz-details {
231 | z-index: 20;
232 | position: absolute;
233 | top: 0;
234 | left: 0;
235 | opacity: 0;
236 | font-size: 13px;
237 | min-width: 100%;
238 | max-width: 100%;
239 | padding: 2em 1em;
240 | text-align: center;
241 | color: rgba(0, 0, 0, 0.9);
242 | line-height: 150%; }
243 | .dropzone .dz-preview .dz-details .dz-size {
244 | margin-bottom: 1em;
245 | font-size: 16px; }
246 | .dropzone .dz-preview .dz-details .dz-filename {
247 | white-space: nowrap; }
248 | .dropzone .dz-preview .dz-details .dz-filename:hover span {
249 | border: 1px solid rgba(200, 200, 200, 0.8);
250 | background-color: rgba(255, 255, 255, 0.8); }
251 | .dropzone .dz-preview .dz-details .dz-filename:not(:hover) {
252 | overflow: hidden;
253 | text-overflow: ellipsis; }
254 | .dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {
255 | border: 1px solid transparent; }
256 | .dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span {
257 | background-color: rgba(255, 255, 255, 0.4);
258 | padding: 0 0.4em;
259 | border-radius: 3px; }
260 | .dropzone .dz-preview:hover .dz-image img {
261 | -webkit-transform: scale(1.05, 1.05);
262 | -moz-transform: scale(1.05, 1.05);
263 | -ms-transform: scale(1.05, 1.05);
264 | -o-transform: scale(1.05, 1.05);
265 | transform: scale(1.05, 1.05);
266 | -webkit-filter: blur(8px);
267 | filter: blur(8px); }
268 | .dropzone .dz-preview .dz-image {
269 | border-radius: 20px;
270 | overflow: hidden;
271 | width: 120px;
272 | height: 120px;
273 | position: relative;
274 | display: block;
275 | z-index: 10; }
276 | .dropzone .dz-preview .dz-image img {
277 | display: block; }
278 | .dropzone .dz-preview.dz-success .dz-success-mark {
279 | -webkit-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
280 | -moz-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
281 | -ms-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
282 | -o-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
283 | animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); }
284 | .dropzone .dz-preview.dz-error .dz-error-mark {
285 | opacity: 1;
286 | -webkit-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
287 | -moz-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
288 | -ms-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
289 | -o-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
290 | animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); }
291 | .dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark {
292 | pointer-events: none;
293 | opacity: 0;
294 | z-index: 500;
295 | position: absolute;
296 | display: block;
297 | top: 50%;
298 | left: 50%;
299 | margin-left: -27px;
300 | margin-top: -27px; }
301 | .dropzone .dz-preview .dz-success-mark svg, .dropzone .dz-preview .dz-error-mark svg {
302 | display: block;
303 | width: 54px;
304 | height: 54px; }
305 | .dropzone .dz-preview.dz-processing .dz-progress {
306 | opacity: 1;
307 | -webkit-transition: all 0.2s linear;
308 | -moz-transition: all 0.2s linear;
309 | -ms-transition: all 0.2s linear;
310 | -o-transition: all 0.2s linear;
311 | transition: all 0.2s linear; }
312 | .dropzone .dz-preview.dz-complete .dz-progress {
313 | opacity: 0;
314 | -webkit-transition: opacity 0.4s ease-in;
315 | -moz-transition: opacity 0.4s ease-in;
316 | -ms-transition: opacity 0.4s ease-in;
317 | -o-transition: opacity 0.4s ease-in;
318 | transition: opacity 0.4s ease-in; }
319 | .dropzone .dz-preview:not(.dz-processing) .dz-progress {
320 | -webkit-animation: pulse 6s ease infinite;
321 | -moz-animation: pulse 6s ease infinite;
322 | -ms-animation: pulse 6s ease infinite;
323 | -o-animation: pulse 6s ease infinite;
324 | animation: pulse 6s ease infinite; }
325 | .dropzone .dz-preview .dz-progress {
326 | opacity: 1;
327 | z-index: 1000;
328 | pointer-events: none;
329 | position: absolute;
330 | height: 16px;
331 | left: 50%;
332 | top: 50%;
333 | margin-top: -8px;
334 | width: 80px;
335 | margin-left: -40px;
336 | background: rgba(255, 255, 255, 0.9);
337 | -webkit-transform: scale(1);
338 | border-radius: 8px;
339 | overflow: hidden; }
340 | .dropzone .dz-preview .dz-progress .dz-upload {
341 | background: #333;
342 | background: linear-gradient(to bottom, #666, #444);
343 | position: absolute;
344 | top: 0;
345 | left: 0;
346 | bottom: 0;
347 | width: 0;
348 | -webkit-transition: width 300ms ease-in-out;
349 | -moz-transition: width 300ms ease-in-out;
350 | -ms-transition: width 300ms ease-in-out;
351 | -o-transition: width 300ms ease-in-out;
352 | transition: width 300ms ease-in-out; }
353 | .dropzone .dz-preview.dz-error .dz-error-message {
354 | display: block; }
355 | .dropzone .dz-preview.dz-error:hover .dz-error-message {
356 | opacity: 1;
357 | pointer-events: auto; }
358 | .dropzone .dz-preview .dz-error-message {
359 | pointer-events: none;
360 | z-index: 1000;
361 | position: absolute;
362 | display: block;
363 | display: none;
364 | opacity: 0;
365 | -webkit-transition: opacity 0.3s ease;
366 | -moz-transition: opacity 0.3s ease;
367 | -ms-transition: opacity 0.3s ease;
368 | -o-transition: opacity 0.3s ease;
369 | transition: opacity 0.3s ease;
370 | border-radius: 8px;
371 | font-size: 13px;
372 | top: 130px;
373 | left: -10px;
374 | width: 140px;
375 | background: #be2626;
376 | background: linear-gradient(to bottom, #be2626, #a92222);
377 | padding: 0.5em 1.2em;
378 | color: white; }
379 | .dropzone .dz-preview .dz-error-message:after {
380 | content: '';
381 | position: absolute;
382 | top: -6px;
383 | left: 64px;
384 | width: 0;
385 | height: 0;
386 | border-left: 6px solid transparent;
387 | border-right: 6px solid transparent;
388 | border-bottom: 6px solid #be2626; }
--------------------------------------------------------------------------------
/src/Public/jquery.js:
--------------------------------------------------------------------------------
1 | /*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
2 | !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML=" ",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML=" ","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML=" ",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0;
3 | }return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),"object"!=typeof b&&"function"!=typeof b||(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" a ",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,""," "],legend:[1,""," "],area:[1,""," "],param:[1,""," "],thead:[1,""],tr:[2,""],col:[2,""],td:[3,""],_default:l.htmlSerialize?[0,"",""]:[1,"X","
"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|?\w+;/,ha=/r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?""!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h ]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/
15 |
16 |
17 |
18 |
43 |