Version Description
- Now you can see all the unassinged media folder files, pages, posts and custom posts
Download this release
Release Info
Developer | galdub |
Plugin | Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- assets/css/design.css +13 -2
- assets/css/media.css +13 -1
- assets/fonts/folder-icon.svg +45 -45
- assets/js/custom.js +1100 -1037
- assets/js/media.js +1 -1
- assets/js/sweetalert.all.min.js +10 -10
- folders.php +2 -2
- includes/folders.class.php +115 -1
- includes/plugin.updates.php +566 -566
- readme.txt +11 -1
- templates/admin/admin-content.php +3 -0
assets/css/design.css
CHANGED
@@ -327,7 +327,7 @@ a#expand-collapse-list.all-open span:before {
|
|
327 |
display: inline-block;
|
328 |
vertical-align: top;
|
329 |
}
|
330 |
-
.header-posts a {
|
331 |
color: #444444;
|
332 |
padding: 7px;
|
333 |
border-radius: 3px;
|
@@ -336,7 +336,7 @@ a#expand-collapse-list.all-open span:before {
|
|
336 |
font-size: 14px;
|
337 |
line-height: 18px;
|
338 |
}
|
339 |
-
.header-posts a:hover {
|
340 |
background: #dfdfdf;
|
341 |
}
|
342 |
span.total-count {
|
@@ -519,6 +519,17 @@ span.wcp-item {
|
|
519 |
border: solid 1px #fff;
|
520 |
position: relative;
|
521 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
.tree-structure .folder-view {
|
523 |
display: block;
|
524 |
border: 1px solid #dadce0;
|
327 |
display: inline-block;
|
328 |
vertical-align: top;
|
329 |
}
|
330 |
+
.header-posts a, .un-categorised-items a {
|
331 |
color: #444444;
|
332 |
padding: 7px;
|
333 |
border-radius: 3px;
|
336 |
font-size: 14px;
|
337 |
line-height: 18px;
|
338 |
}
|
339 |
+
.header-posts a:hover, .un-categorised-items:hover {
|
340 |
background: #dfdfdf;
|
341 |
}
|
342 |
span.total-count {
|
519 |
border: solid 1px #fff;
|
520 |
position: relative;
|
521 |
}
|
522 |
+
.wcp-hover-list {
|
523 |
+
background: #008ec2 !important;
|
524 |
+
color: #fff;
|
525 |
+
position: relative;
|
526 |
+
}
|
527 |
+
.wcp-hover-list a {
|
528 |
+
color: #fff;
|
529 |
+
}
|
530 |
+
.wcp-hover-list span.total-count {
|
531 |
+
color: #000;
|
532 |
+
}
|
533 |
.tree-structure .folder-view {
|
534 |
display: block;
|
535 |
border: 1px solid #dadce0;
|
assets/css/media.css
CHANGED
@@ -4,5 +4,17 @@
|
|
4 |
}
|
5 |
.media-modal-content .media-frame select.attachment-filters {
|
6 |
width: auto;
|
7 |
-
max-width:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
4 |
}
|
5 |
.media-modal-content .media-frame select.attachment-filters {
|
6 |
width: auto;
|
7 |
+
max-width: 135px;
|
8 |
+
}
|
9 |
+
#media-attachment-taxonomy-filter {
|
10 |
+
border: solid 1px #FF5983;
|
11 |
+
color: #FF5983;
|
12 |
+
font-weight: bold;
|
13 |
+
}
|
14 |
+
#media-attachment-taxonomy-filter option {
|
15 |
+
color: #000000;
|
16 |
+
}
|
17 |
+
#media-attachment-taxonomy-filter option:first-child {
|
18 |
+
color: #FF5983;
|
19 |
+
font-weight: bold;
|
20 |
}
|
assets/fonts/folder-icon.svg
CHANGED
@@ -1,46 +1,46 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
-
<metadata>
|
5 |
-
<json>
|
6 |
-
<![CDATA[
|
7 |
-
{
|
8 |
-
"fontFamily": "folder-icon",
|
9 |
-
"majorVersion": 1,
|
10 |
-
"minorVersion": 0,
|
11 |
-
"version": "Version 1.0",
|
12 |
-
"fontId": "folder-icon",
|
13 |
-
"psName": "folder-icon",
|
14 |
-
"subFamily": "Regular",
|
15 |
-
"fullName": "folder-icon",
|
16 |
-
"description": "Font generated by IcoMoon."
|
17 |
-
}
|
18 |
-
]]>
|
19 |
-
</json>
|
20 |
-
</metadata>
|
21 |
-
<defs>
|
22 |
-
<font id="folder-icon" horiz-adv-x="1024">
|
23 |
-
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
24 |
-
<missing-glyph horiz-adv-x="1024" />
|
25 |
-
<glyph unicode=" " horiz-adv-x="512" d="" />
|
26 |
-
<glyph unicode="" glyph-name="folder_special" data-tags="folder_special" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-85.333-38.4-85.333-85.333v-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM722.773 259.84l-82.773 48.213-82.773-48.213c-16.213-9.387-35.84 5.12-31.573 23.467l21.76 93.867-72.107 62.293c-14.080 12.373-6.827 35.84 11.947 37.547l95.147 8.107 37.547 87.893c7.253 17.067 32 17.067 39.253 0l37.547-87.893 95.147-8.107c18.773-1.707 26.453-25.173 11.947-37.547l-72.107-62.293 21.76-93.867c4.693-18.347-14.933-32.853-30.72-23.467z" />
|
27 |
-
<glyph unicode="" glyph-name="insert_drive_file" data-tags="insert_drive_file" d="M256 874.667c-46.933 0-84.907-38.4-84.907-85.333l-0.427-682.667c0-46.933 37.973-85.333 84.907-85.333h512.427c46.933 0 85.333 38.4 85.333 85.333v512l-256 256h-341.333zM554.667 576v234.667l234.667-234.667h-234.667z" />
|
28 |
-
<glyph unicode="" d="M757.333 661.333l-160 160-426.667-426.667v-160h160l426.667 426.667zM883.627 787.627c16.64 16.64 16.64 43.52 0 60.16l-99.84 99.84c-16.64 16.64-43.52 16.64-60.16 0l-83.627-83.627 160-160 83.627 83.627z" />
|
29 |
-
<glyph unicode="" d="M0 106.667h1024v-170.667h-1024z" />
|
30 |
-
<glyph unicode="" glyph-name="file_copy" data-tags="file_copy" d="M682.667 917.333h-512c-46.933 0-85.333-38.4-85.333-85.333v-597.333h85.333v597.333h512v85.333zM640 746.667l256-256v-426.667c0-46.933-38.4-85.333-85.333-85.333h-469.76c-46.933 0-84.907 38.4-84.907 85.333l0.427 597.333c0 46.933 37.973 85.333 84.907 85.333h298.667zM597.333 448h234.667l-234.667 234.667v-234.667z" />
|
31 |
-
<glyph unicode="" glyph-name="all_inbox" data-tags="all_inbox" d="M810.667 832h-597.333c-46.933 0-85.333-38.4-85.333-85.333v-298.667c0-46.933 38.4-85.333 85.333-85.333h597.333c46.933 0 85.333 38.4 85.333 85.333v298.667c0 46.933-38.4 85.333-85.333 85.333zM810.667 576h-170.667c0-69.12-58.88-128-128-128s-128 58.88-128 128h-170.667v170.667h597.333v-170.667zM640 277.333h256v-128c0-46.933-38.4-85.333-85.333-85.333h-597.333c-46.933 0-85.333 38.4-85.333 85.333v128h256c0-70.827 57.173-128 128-128s128 57.173 128 128z" />
|
32 |
-
<glyph unicode="" glyph-name="delete" data-tags="delete" d="M256 149.333c0-46.933 38.4-85.333 85.333-85.333h341.333c46.933 0 85.333 38.4 85.333 85.333v512h-512v-512zM810.667 789.333h-149.333l-42.667 42.667h-213.333l-42.667-42.667h-149.333v-85.333h597.333v85.333z" />
|
33 |
-
<glyph unicode="" glyph-name="star_rate" data-tags="star_rate" d="M512 317.156l211.058-153.6-80.782 248.036 211.058 150.187h-258.844l-82.489 256-82.489-256h-258.844l211.058-150.187-80.782-248.036z" />
|
34 |
-
<glyph unicode="" glyph-name="arrow_drop_down" data-tags="arrow_drop_down" d="M298.667 533.333l213.333-213.333 213.333 213.333z" />
|
35 |
-
<glyph unicode="" glyph-name="arrow_right" data-tags="arrow_right" d="M426.667 234.667l213.333 213.333-213.333 213.333v-426.667z" />
|
36 |
-
<glyph unicode="" glyph-name="more_vert" data-tags="more_vert" d="M512 618.667c46.933 0 85.333 38.4 85.333 85.333s-38.4 85.333-85.333 85.333-85.333-38.4-85.333-85.333 38.4-85.333 85.333-85.333zM512 533.333c-46.933 0-85.333-38.4-85.333-85.333s38.4-85.333 85.333-85.333 85.333 38.4 85.333 85.333-38.4 85.333-85.333 85.333zM512 277.333c-46.933 0-85.333-38.4-85.333-85.333s38.4-85.333 85.333-85.333 85.333 38.4 85.333 85.333-38.4 85.333-85.333 85.333z" />
|
37 |
-
<glyph unicode="" glyph-name="folder_shared" data-tags="folder_shared" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-84.907-38.4-84.907-85.333l-0.427-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM640 576c46.933 0 85.333-38.4 85.333-85.333s-38.4-85.333-85.333-85.333-85.333 38.4-85.333 85.333 38.4 85.333 85.333 85.333zM810.667 234.667h-341.333v42.667c0 56.747 113.92 85.333 170.667 85.333s170.667-28.587 170.667-85.333v-42.667z" />
|
38 |
-
<glyph unicode="" glyph-name="folder_open" data-tags="folder_open" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-84.907-38.4-84.907-85.333l-0.427-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM810.667 192h-597.333c-23.467 0-42.667 19.2-42.667 42.667v341.333c0 23.467 19.2 42.667 42.667 42.667h597.333c23.467 0 42.667-19.2 42.667-42.667v-341.333c0-23.467-19.2-42.667-42.667-42.667z" />
|
39 |
-
<glyph unicode="" glyph-name="folder" data-tags="folder" d="M451.84 764.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-84.907-38.4-84.907-85.333l-0.427-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333h-341.333l-60.16 60.16z" />
|
40 |
-
<glyph unicode="" glyph-name="create_new_folder" data-tags="create_new_folder" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-47.36 0-84.907-37.973-84.907-85.333l-0.427-512c0-47.36 37.973-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM768 362.667h-85.333v-85.333c0-23.467-19.2-42.667-42.667-42.667s-42.667 19.2-42.667 42.667v85.333h-85.333c-23.467 0-42.667 19.2-42.667 42.667s19.2 42.667 42.667 42.667h85.333v85.333c0 23.467 19.2 42.667 42.667 42.667s42.667-19.2 42.667-42.667v-85.333h85.333c23.467 0 42.667-19.2 42.667-42.667s-19.2-42.667-42.667-42.667z" />
|
41 |
-
<glyph unicode="" glyph-name="expand_more" data-tags="expand_more" d="M677.547 563.627l-165.547-165.547-165.547 165.547c-16.64 16.64-43.52 16.64-60.16 0s-16.64-43.52 0-60.16l195.84-195.84c16.64-16.64 43.52-16.64 60.16 0l195.84 195.84c16.64 16.64 16.64 43.52 0 60.16-16.64 16.213-43.947 16.64-60.587 0z" />
|
42 |
-
<glyph unicode="" glyph-name="edit" data-tags="edit" d="M128 224v-160h160l471.893 471.893-160 160-471.893-471.893zM883.627 659.627c16.64 16.64 16.64 43.52 0 60.16l-99.84 99.84c-16.64 16.64-43.52 16.64-60.16 0l-78.080-78.080 160-160 78.080 78.080z" />
|
43 |
-
<glyph unicode="" glyph-name="expand_less" data-tags="expand_less" d="M481.707 588.373l-195.84-195.84c-16.64-16.64-16.64-43.52 0-60.16s43.52-16.64 60.16 0l165.973 165.547 165.547-165.547c16.64-16.64 43.52-16.64 60.16 0s16.64 43.52 0 60.16l-195.84 195.84c-16.213 16.64-43.52 16.64-60.16 0z" />
|
44 |
-
<glyph unicode="" d="M396.8 618.667h452.267v-422.4h-452.267v422.4z" />
|
45 |
-
<glyph unicode="" d="M853.333 704h-341.333l-59.733 59.733c-17.067 17.067-38.4 25.6-59.733 25.6h-221.867c-46.933 0-85.333-38.4-85.333-85.333v-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM721.067 260.267l-81.067 46.933-81.067-46.933c-17.067-8.533-34.133 4.267-29.867 25.6l21.333 93.867-72.533 64c-12.8 12.8-8.533 34.133 12.8 38.4l93.867 8.533 38.4 89.6c8.533 17.067 34.133 17.067 38.4 0l38.4-89.6 93.867-8.533c17.067 0 25.6-25.6 12.8-38.4l-72.533-64 21.333-93.867c4.267-21.333-17.067-34.133-34.133-25.6z" />
|
46 |
</font></defs></svg>
|
1 |
+
<?xml version="1.0" standalone="no"?>
|
2 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
+
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
+
<metadata>
|
5 |
+
<json>
|
6 |
+
<![CDATA[
|
7 |
+
{
|
8 |
+
"fontFamily": "folder-icon",
|
9 |
+
"majorVersion": 1,
|
10 |
+
"minorVersion": 0,
|
11 |
+
"version": "Version 1.0",
|
12 |
+
"fontId": "folder-icon",
|
13 |
+
"psName": "folder-icon",
|
14 |
+
"subFamily": "Regular",
|
15 |
+
"fullName": "folder-icon",
|
16 |
+
"description": "Font generated by IcoMoon."
|
17 |
+
}
|
18 |
+
]]>
|
19 |
+
</json>
|
20 |
+
</metadata>
|
21 |
+
<defs>
|
22 |
+
<font id="folder-icon" horiz-adv-x="1024">
|
23 |
+
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
24 |
+
<missing-glyph horiz-adv-x="1024" />
|
25 |
+
<glyph unicode=" " horiz-adv-x="512" d="" />
|
26 |
+
<glyph unicode="" glyph-name="folder_special" data-tags="folder_special" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-85.333-38.4-85.333-85.333v-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM722.773 259.84l-82.773 48.213-82.773-48.213c-16.213-9.387-35.84 5.12-31.573 23.467l21.76 93.867-72.107 62.293c-14.080 12.373-6.827 35.84 11.947 37.547l95.147 8.107 37.547 87.893c7.253 17.067 32 17.067 39.253 0l37.547-87.893 95.147-8.107c18.773-1.707 26.453-25.173 11.947-37.547l-72.107-62.293 21.76-93.867c4.693-18.347-14.933-32.853-30.72-23.467z" />
|
27 |
+
<glyph unicode="" glyph-name="insert_drive_file" data-tags="insert_drive_file" d="M256 874.667c-46.933 0-84.907-38.4-84.907-85.333l-0.427-682.667c0-46.933 37.973-85.333 84.907-85.333h512.427c46.933 0 85.333 38.4 85.333 85.333v512l-256 256h-341.333zM554.667 576v234.667l234.667-234.667h-234.667z" />
|
28 |
+
<glyph unicode="" d="M757.333 661.333l-160 160-426.667-426.667v-160h160l426.667 426.667zM883.627 787.627c16.64 16.64 16.64 43.52 0 60.16l-99.84 99.84c-16.64 16.64-43.52 16.64-60.16 0l-83.627-83.627 160-160 83.627 83.627z" />
|
29 |
+
<glyph unicode="" d="M0 106.667h1024v-170.667h-1024z" />
|
30 |
+
<glyph unicode="" glyph-name="file_copy" data-tags="file_copy" d="M682.667 917.333h-512c-46.933 0-85.333-38.4-85.333-85.333v-597.333h85.333v597.333h512v85.333zM640 746.667l256-256v-426.667c0-46.933-38.4-85.333-85.333-85.333h-469.76c-46.933 0-84.907 38.4-84.907 85.333l0.427 597.333c0 46.933 37.973 85.333 84.907 85.333h298.667zM597.333 448h234.667l-234.667 234.667v-234.667z" />
|
31 |
+
<glyph unicode="" glyph-name="all_inbox" data-tags="all_inbox" d="M810.667 832h-597.333c-46.933 0-85.333-38.4-85.333-85.333v-298.667c0-46.933 38.4-85.333 85.333-85.333h597.333c46.933 0 85.333 38.4 85.333 85.333v298.667c0 46.933-38.4 85.333-85.333 85.333zM810.667 576h-170.667c0-69.12-58.88-128-128-128s-128 58.88-128 128h-170.667v170.667h597.333v-170.667zM640 277.333h256v-128c0-46.933-38.4-85.333-85.333-85.333h-597.333c-46.933 0-85.333 38.4-85.333 85.333v128h256c0-70.827 57.173-128 128-128s128 57.173 128 128z" />
|
32 |
+
<glyph unicode="" glyph-name="delete" data-tags="delete" d="M256 149.333c0-46.933 38.4-85.333 85.333-85.333h341.333c46.933 0 85.333 38.4 85.333 85.333v512h-512v-512zM810.667 789.333h-149.333l-42.667 42.667h-213.333l-42.667-42.667h-149.333v-85.333h597.333v85.333z" />
|
33 |
+
<glyph unicode="" glyph-name="star_rate" data-tags="star_rate" d="M512 317.156l211.058-153.6-80.782 248.036 211.058 150.187h-258.844l-82.489 256-82.489-256h-258.844l211.058-150.187-80.782-248.036z" />
|
34 |
+
<glyph unicode="" glyph-name="arrow_drop_down" data-tags="arrow_drop_down" d="M298.667 533.333l213.333-213.333 213.333 213.333z" />
|
35 |
+
<glyph unicode="" glyph-name="arrow_right" data-tags="arrow_right" d="M426.667 234.667l213.333 213.333-213.333 213.333v-426.667z" />
|
36 |
+
<glyph unicode="" glyph-name="more_vert" data-tags="more_vert" d="M512 618.667c46.933 0 85.333 38.4 85.333 85.333s-38.4 85.333-85.333 85.333-85.333-38.4-85.333-85.333 38.4-85.333 85.333-85.333zM512 533.333c-46.933 0-85.333-38.4-85.333-85.333s38.4-85.333 85.333-85.333 85.333 38.4 85.333 85.333-38.4 85.333-85.333 85.333zM512 277.333c-46.933 0-85.333-38.4-85.333-85.333s38.4-85.333 85.333-85.333 85.333 38.4 85.333 85.333-38.4 85.333-85.333 85.333z" />
|
37 |
+
<glyph unicode="" glyph-name="folder_shared" data-tags="folder_shared" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-84.907-38.4-84.907-85.333l-0.427-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM640 576c46.933 0 85.333-38.4 85.333-85.333s-38.4-85.333-85.333-85.333-85.333 38.4-85.333 85.333 38.4 85.333 85.333 85.333zM810.667 234.667h-341.333v42.667c0 56.747 113.92 85.333 170.667 85.333s170.667-28.587 170.667-85.333v-42.667z" />
|
38 |
+
<glyph unicode="" glyph-name="folder_open" data-tags="folder_open" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-84.907-38.4-84.907-85.333l-0.427-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM810.667 192h-597.333c-23.467 0-42.667 19.2-42.667 42.667v341.333c0 23.467 19.2 42.667 42.667 42.667h597.333c23.467 0 42.667-19.2 42.667-42.667v-341.333c0-23.467-19.2-42.667-42.667-42.667z" />
|
39 |
+
<glyph unicode="" glyph-name="folder" data-tags="folder" d="M451.84 764.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-46.933 0-84.907-38.4-84.907-85.333l-0.427-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333h-341.333l-60.16 60.16z" />
|
40 |
+
<glyph unicode="" glyph-name="create_new_folder" data-tags="create_new_folder" d="M853.333 704h-341.333l-60.16 60.16c-16.213 16.213-37.973 25.173-60.587 25.173h-220.587c-47.36 0-84.907-37.973-84.907-85.333l-0.427-512c0-47.36 37.973-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM768 362.667h-85.333v-85.333c0-23.467-19.2-42.667-42.667-42.667s-42.667 19.2-42.667 42.667v85.333h-85.333c-23.467 0-42.667 19.2-42.667 42.667s19.2 42.667 42.667 42.667h85.333v85.333c0 23.467 19.2 42.667 42.667 42.667s42.667-19.2 42.667-42.667v-85.333h85.333c23.467 0 42.667-19.2 42.667-42.667s-19.2-42.667-42.667-42.667z" />
|
41 |
+
<glyph unicode="" glyph-name="expand_more" data-tags="expand_more" d="M677.547 563.627l-165.547-165.547-165.547 165.547c-16.64 16.64-43.52 16.64-60.16 0s-16.64-43.52 0-60.16l195.84-195.84c16.64-16.64 43.52-16.64 60.16 0l195.84 195.84c16.64 16.64 16.64 43.52 0 60.16-16.64 16.213-43.947 16.64-60.587 0z" />
|
42 |
+
<glyph unicode="" glyph-name="edit" data-tags="edit" d="M128 224v-160h160l471.893 471.893-160 160-471.893-471.893zM883.627 659.627c16.64 16.64 16.64 43.52 0 60.16l-99.84 99.84c-16.64 16.64-43.52 16.64-60.16 0l-78.080-78.080 160-160 78.080 78.080z" />
|
43 |
+
<glyph unicode="" glyph-name="expand_less" data-tags="expand_less" d="M481.707 588.373l-195.84-195.84c-16.64-16.64-16.64-43.52 0-60.16s43.52-16.64 60.16 0l165.973 165.547 165.547-165.547c16.64-16.64 43.52-16.64 60.16 0s16.64 43.52 0 60.16l-195.84 195.84c-16.213 16.64-43.52 16.64-60.16 0z" />
|
44 |
+
<glyph unicode="" d="M396.8 618.667h452.267v-422.4h-452.267v422.4z" />
|
45 |
+
<glyph unicode="" d="M853.333 704h-341.333l-59.733 59.733c-17.067 17.067-38.4 25.6-59.733 25.6h-221.867c-46.933 0-85.333-38.4-85.333-85.333v-512c0-46.933 38.4-85.333 85.333-85.333h682.667c46.933 0 85.333 38.4 85.333 85.333v426.667c0 46.933-38.4 85.333-85.333 85.333zM721.067 260.267l-81.067 46.933-81.067-46.933c-17.067-8.533-34.133 4.267-29.867 25.6l21.333 93.867-72.533 64c-12.8 12.8-8.533 34.133 12.8 38.4l93.867 8.533 38.4 89.6c8.533 17.067 34.133 17.067 38.4 0l38.4-89.6 93.867-8.533c17.067 0 25.6-25.6 12.8-38.4l-72.533-64 21.333-93.867c4.267-21.333-17.067-34.133-34.133-25.6z" />
|
46 |
</font></defs></svg>
|
assets/js/custom.js
CHANGED
@@ -1,1038 +1,1101 @@
|
|
1 |
-
var defaultFolderHtml;
|
2 |
-
var folderID = 0;
|
3 |
-
var fileAddUpdateStatus = "add";
|
4 |
-
var fileFolderID = 0;
|
5 |
-
var folderNameDynamic = '';
|
6 |
-
var totalFolders = -1;
|
7 |
-
var isKeyActive = 0;
|
8 |
-
var folderLimitation = 10;
|
9 |
-
|
10 |
-
var listFolderString = "<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'>" +
|
11 |
-
"<div class='folder-item is-folder' data-id='__folder_id__'>" +
|
12 |
-
"<a title='__folder_name__' id='folder_view___folder_id__'" +
|
13 |
-
"class='folder-view __append_class__'" +
|
14 |
-
"data-id='__folder_id__'>" +
|
15 |
-
"<span class='folder item-name'><span id='wcp_folder_text___folder_id__'" +
|
16 |
-
"class='folder-title'>__folder_name__</span></span>" +
|
17 |
-
"</a>" +
|
18 |
-
"</div>" +
|
19 |
-
"</li>";
|
20 |
-
|
21 |
-
function addFolder() {
|
22 |
-
if(isKeyActive == 0 && totalFolders >= folderLimitation) {
|
23 |
-
Swal.fire({
|
24 |
-
title: "You've reached the "+totalFolders+" folder limitation!",
|
25 |
-
text: "Unlock unlimited amount of folders by upgrading to one of our pro plans.",
|
26 |
-
type: 'warning',
|
27 |
-
showCancelButton: true,
|
28 |
-
confirmButtonColor: '#3085d6',
|
29 |
-
cancelButtonColor: '#d33',
|
30 |
-
confirmButtonText: 'See Pro Plans'
|
31 |
-
}).then((result) => {
|
32 |
-
if (result.value) {
|
33 |
-
window.location = wcp_settings.register_url;
|
34 |
-
}
|
35 |
-
});
|
36 |
-
return false;
|
37 |
-
}
|
38 |
-
folderOrder = jQuery("#space_"+fileFolderID+" > li").length+1;
|
39 |
-
ajaxURL = wcp_settings.ajax_url+"?parent_id=" + fileFolderID + "&type=" + wcp_settings.post_type + "&action=wcp_add_new_folder&nonce=" + wcp_settings.nonce + "&term_id=" + fileFolderID + "&order=" + folderOrder+"&name=";
|
40 |
-
Swal({
|
41 |
-
title: 'Add Folder',
|
42 |
-
input: 'text',
|
43 |
-
inputAttributes: {
|
44 |
-
autocapitalize: 'off',
|
45 |
-
placeholder: "Folder name"
|
46 |
-
},
|
47 |
-
showCancelButton: true,
|
48 |
-
confirmButtonText: 'Submit',
|
49 |
-
showLoaderOnConfirm: true,
|
50 |
-
reverseButtons: true,
|
51 |
-
preConfirm: (folderName) => {
|
52 |
-
if(folderName == "") {
|
53 |
-
swal.showValidationError(
|
54 |
-
'Please enter folder name'
|
55 |
-
)
|
56 |
-
return false;
|
57 |
-
}
|
58 |
-
return fetch(ajaxURL+folderName)
|
59 |
-
.then(response => {
|
60 |
-
if (!response.ok) {
|
61 |
-
throw new Error(response.statusText);
|
62 |
-
}
|
63 |
-
return response.json();
|
64 |
-
}).catch(error => {
|
65 |
-
Swal.showValidationMessage(
|
66 |
-
"Request failed: "+error
|
67 |
-
)
|
68 |
-
});
|
69 |
-
},
|
70 |
-
allowOutsideClick: () => !Swal.isLoading()
|
71 |
-
}).then((result) => {
|
72 |
-
if(result.value.error == 1) {
|
73 |
-
Swal({
|
74 |
-
type: 'error',
|
75 |
-
title: 'Oops...',
|
76 |
-
text: result.value.message
|
77 |
-
});
|
78 |
-
} else if(result.value.status == 1) {
|
79 |
-
jQuery("#space_"+result.value.parent_id).append(result.value.term_data);
|
80 |
-
jQuery("#wcp_folder_"+result.value.parent_id).addClass("active has-sub-tree");
|
81 |
-
isKeyActive = parseInt(result.value.is_key_active);
|
82 |
-
totalFolders = parseInt(result.value.folders);
|
83 |
-
jQuery("#current-folder").text(totalFolders);
|
84 |
-
if(totalFolders > folderLimitation) {
|
85 |
-
folderLimitation = totalFolders;
|
86 |
-
}
|
87 |
-
jQuery("#total-folder").text(folderLimitation);
|
88 |
-
checkForExpandCollapse();
|
89 |
-
add_menu_to_list();
|
90 |
-
}
|
91 |
-
});
|
92 |
-
}
|
93 |
-
|
94 |
-
|
95 |
-
function updateFolder() {
|
96 |
-
folderName = jQuery.trim(jQuery("#wcp_folder_"+fileFolderID+" > h3").text());
|
97 |
-
parentID = jQuery("#wcp_folder_"+fileFolderID).closest("li.route").data("folder-id");
|
98 |
-
if(parentID == undefined) {
|
99 |
-
parentID = 0;
|
100 |
-
}
|
101 |
-
nonce = jQuery.trim(jQuery("#wcp_folder_"+fileFolderID).data("rename"));
|
102 |
-
ajaxURL = wcp_settings.ajax_url+"?parent_id=" + parentID + "&nonce=" + nonce + "&type=" + wcp_settings.post_type + "&action=wcp_update_folder&term_id=" + fileFolderID + "&name=";
|
103 |
-
Swal({
|
104 |
-
title: 'Update Folder',
|
105 |
-
input: 'text',
|
106 |
-
inputValue: folderName,
|
107 |
-
inputAttributes: {
|
108 |
-
autocapitalize: 'off',
|
109 |
-
placeholder: "Folder name",
|
110 |
-
value: folderName
|
111 |
-
},
|
112 |
-
showCancelButton: true,
|
113 |
-
confirmButtonText: 'Submit',
|
114 |
-
showLoaderOnConfirm: true,
|
115 |
-
reverseButtons: true,
|
116 |
-
preConfirm: (folderName) => {
|
117 |
-
if(folderName == "") {
|
118 |
-
swal.showValidationError(
|
119 |
-
'Please enter folder name'
|
120 |
-
)
|
121 |
-
return false;
|
122 |
-
}
|
123 |
-
return fetch(ajaxURL+folderName)
|
124 |
-
.then(response => {
|
125 |
-
if (!response.ok) {
|
126 |
-
throw new Error(response.statusText);
|
127 |
-
}
|
128 |
-
return response.json();
|
129 |
-
}).catch(error => {
|
130 |
-
Swal.showValidationMessage(
|
131 |
-
"Request failed: "+error
|
132 |
-
)
|
133 |
-
});
|
134 |
-
},
|
135 |
-
allowOutsideClick: () => !Swal.isLoading()
|
136 |
-
}).then((result) => {
|
137 |
-
if(result.value.error == 1) {
|
138 |
-
Swal({
|
139 |
-
type: 'error',
|
140 |
-
title: 'Oops...',
|
141 |
-
text: result.value.message
|
142 |
-
});
|
143 |
-
} else if(result.value.status == 1) {
|
144 |
-
jQuery("#wcp_folder_"+result.value.id+" > h3 > .title-text").text(result.value.term_title);
|
145 |
-
jQuery("#wcp_folder_"+result.value.id+" > h3").attr("title",result.value.term_title);
|
146 |
-
add_menu_to_list();
|
147 |
-
}
|
148 |
-
});
|
149 |
-
}
|
150 |
-
|
151 |
-
function add_menu_to_list() {
|
152 |
-
folderId = 0;
|
153 |
-
if(jQuery(".active-term").length) {
|
154 |
-
folderId = jQuery(".active-term").data("folder-id");
|
155 |
-
}
|
156 |
-
jQuery(".tree-structure ul").html("");
|
157 |
-
jQuery("#space_"+folderId).children().each(function(){
|
158 |
-
fID = jQuery(this).data("folder-id");
|
159 |
-
fName = jQuery(this).find("h3.title:first .title-text").text()
|
160 |
-
liHtml = listFolderString.replace(/__folder_id__/g,fID);
|
161 |
-
liHtml = liHtml.replace(/__folder_name__/g,fName);
|
162 |
-
selectedClass = jQuery(this).hasClass("is-high")?"is-high":"";
|
163 |
-
liHtml = liHtml.replace(/__append_class__/g,selectedClass);
|
164 |
-
jQuery(".tree-structure ul").append(liHtml);
|
165 |
-
});
|
166 |
-
}
|
167 |
-
|
168 |
-
jQuery(document).ready(function(){
|
169 |
-
|
170 |
-
if(wcp_settings.can_manage_folder == "0") {
|
171 |
-
jQuery(".wcp-custom-form a:not(.pink)").addClass("button-disabled");
|
172 |
-
}
|
173 |
-
|
174 |
-
isKeyActive = parseInt(wcp_settings.is_key_active);
|
175 |
-
totalFolders = parseInt(wcp_settings.folders);
|
176 |
-
|
177 |
-
if(wcp_settings.post_type == "attachment") {
|
178 |
-
jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
|
179 |
-
|
180 |
-
add_menu_to_list();
|
181 |
-
}
|
182 |
-
|
183 |
-
calcWidth(jQuery('#title_0'));
|
184 |
-
|
185 |
-
jQuery("#cancel-button").click(function(){
|
186 |
-
jQuery(".wcp-form-data").hide();
|
187 |
-
});
|
188 |
-
|
189 |
-
|
190 |
-
jQuery(document).on("click", "h3.title", function(e) {
|
191 |
-
e.stopPropagation();
|
192 |
-
window.location = wcp_settings.page_url+jQuery(this).closest("li.route").data("slug");
|
193 |
-
});
|
194 |
-
|
195 |
-
jQuery(".tree-structure a").livequery(function(){
|
196 |
-
jQuery(this).click(function(){
|
197 |
-
fID = jQuery(this).data("id");
|
198 |
-
jQuery("#title_"+fID).trigger("click");
|
199 |
-
});
|
200 |
-
});
|
201 |
-
|
202 |
-
jQuery(".wcp-parent > span").click(function(){
|
203 |
-
window.location = wcp_settings.page_url
|
204 |
-
});
|
205 |
-
jQuery("h3.title").livequery(function () {
|
206 |
-
jQuery(this).droppable({
|
207 |
-
accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
|
208 |
-
hoverClass: 'wcp-drop-hover',
|
209 |
-
classes: {
|
210 |
-
"ui-droppable-active": "ui-state-highlight"
|
211 |
-
},
|
212 |
-
drop: function (event, ui) {
|
213 |
-
folderID = jQuery(this).closest("li.route").data('folder-id');
|
214 |
-
if (ui.draggable.hasClass('wcp-move-multiple')) {
|
215 |
-
if (jQuery(".wp-list-table input:checked").length) {
|
216 |
-
chkStr = "";
|
217 |
-
jQuery(".wp-list-table input:checked").each(function () {
|
218 |
-
chkStr += jQuery(this).val() + ",";
|
219 |
-
});
|
220 |
-
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
221 |
-
jQuery.ajax({
|
222 |
-
url: wcp_settings.ajax_url,
|
223 |
-
data: "post_ids=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
224 |
-
method: 'post',
|
225 |
-
success: function (res) {
|
226 |
-
res = jQuery.parseJSON(res);
|
227 |
-
if (res.status == "1") {
|
228 |
-
window.location.reload();
|
229 |
-
} else {
|
230 |
-
Swal.fire(
|
231 |
-
'',
|
232 |
-
res.message,
|
233 |
-
'error'
|
234 |
-
);
|
235 |
-
}
|
236 |
-
}
|
237 |
-
});
|
238 |
-
}
|
239 |
-
} else if (ui.draggable.hasClass('wcp-move-file')) {
|
240 |
-
postID = ui.draggable[0].attributes['data-id'].nodeValue;
|
241 |
-
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
242 |
-
jQuery.ajax({
|
243 |
-
url: wcp_settings.ajax_url,
|
244 |
-
data: "post_id=" + postID + "&type=" + wcp_settings.post_type + "&action=wcp_change_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
245 |
-
method: 'post',
|
246 |
-
success: function (res) {
|
247 |
-
res = jQuery.parseJSON(res);
|
248 |
-
if (res.status == "1") {
|
249 |
-
window.location.reload();
|
250 |
-
} else {
|
251 |
-
Swal.fire(
|
252 |
-
'',
|
253 |
-
res.message,
|
254 |
-
'error'
|
255 |
-
);
|
256 |
-
}
|
257 |
-
}
|
258 |
-
});
|
259 |
-
} else if (ui.draggable.hasClass('attachment')) {
|
260 |
-
chkStr = ui.draggable[0].attributes['data-id'].nodeValue;
|
261 |
-
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
262 |
-
if (jQuery(".attachments-browser li.attachment.selected").length > 1) {
|
263 |
-
chkStr = "";
|
264 |
-
jQuery(".attachments-browser li.attachment.selected").each(function () {
|
265 |
-
chkStr += jQuery(this).data("id") + ",";
|
266 |
-
});
|
267 |
-
}
|
268 |
-
jQuery.ajax({
|
269 |
-
url: wcp_settings.ajax_url,
|
270 |
-
data: "post_ids=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
271 |
-
method: 'post',
|
272 |
-
success: function (res) {
|
273 |
-
window.location.reload();
|
274 |
-
}
|
275 |
-
});
|
276 |
-
}
|
277 |
-
}
|
278 |
-
});
|
279 |
-
});
|
280 |
-
|
281 |
-
jQuery(".attachments-browser li.attachment").livequery(function () {
|
282 |
-
jQuery(this).draggable({
|
283 |
-
revert: "invalid",
|
284 |
-
containment: "document",
|
285 |
-
helper: function (event, ui) {
|
286 |
-
jQuery(".selected-items").remove();
|
287 |
-
selectedItems = jQuery(".attachments-browser li.attachment.selected").length;
|
288 |
-
selectedItems = (selectedItems == 0 || selectedItems == 1) ? "1 Item" : selectedItems + " Items";
|
289 |
-
return jQuery("<div class='selected-items'><span class='total-post-count'>" + selectedItems + " Selected</span></div>");
|
290 |
-
},
|
291 |
-
start: function (event, ui) {
|
292 |
-
|
293 |
-
},
|
294 |
-
cursor: "move",
|
295 |
-
cursorAt: {
|
296 |
-
left: 0,
|
297 |
-
top: 0
|
298 |
-
},
|
299 |
-
stop: function (event, ui) {
|
300 |
-
jQuery(".selected-items").remove();
|
301 |
-
}
|
302 |
-
});
|
303 |
-
jQuery(this).draggable("disable");
|
304 |
-
});
|
305 |
-
|
306 |
-
jQuery(".media-button").livequery(function () {
|
307 |
-
jQuery(this).click(function () {
|
308 |
-
if (jQuery(".delete-selected-button").hasClass("hidden")) {
|
309 |
-
jQuery(".attachments-browser li.attachment").draggable("disable");
|
310 |
-
} else {
|
311 |
-
jQuery(".attachments-browser li.attachment").draggable("enable");
|
312 |
-
}
|
313 |
-
});
|
314 |
-
});
|
315 |
-
|
316 |
-
jQuery(".header-posts").click(function(){
|
317 |
-
window.location = wcp_settings.page_url;
|
318 |
-
});
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
}
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
}
|
374 |
-
}
|
375 |
-
}
|
376 |
-
}
|
377 |
-
});
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
jQuery(this).
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
jQuery.
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
jQuery(
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
jQuery("
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
}
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
}
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
}
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
}
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
}
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
if(
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
}
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1038 |
}
|
1 |
+
var defaultFolderHtml;
|
2 |
+
var folderID = 0;
|
3 |
+
var fileAddUpdateStatus = "add";
|
4 |
+
var fileFolderID = 0;
|
5 |
+
var folderNameDynamic = '';
|
6 |
+
var totalFolders = -1;
|
7 |
+
var isKeyActive = 0;
|
8 |
+
var folderLimitation = 10;
|
9 |
+
|
10 |
+
var listFolderString = "<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'>" +
|
11 |
+
"<div class='folder-item is-folder' data-id='__folder_id__'>" +
|
12 |
+
"<a title='__folder_name__' id='folder_view___folder_id__'" +
|
13 |
+
"class='folder-view __append_class__'" +
|
14 |
+
"data-id='__folder_id__'>" +
|
15 |
+
"<span class='folder item-name'><span id='wcp_folder_text___folder_id__'" +
|
16 |
+
"class='folder-title'>__folder_name__</span></span>" +
|
17 |
+
"</a>" +
|
18 |
+
"</div>" +
|
19 |
+
"</li>";
|
20 |
+
|
21 |
+
function addFolder() {
|
22 |
+
if(isKeyActive == 0 && totalFolders >= folderLimitation) {
|
23 |
+
Swal.fire({
|
24 |
+
title: "You've reached the "+totalFolders+" folder limitation!",
|
25 |
+
text: "Unlock unlimited amount of folders by upgrading to one of our pro plans.",
|
26 |
+
type: 'warning',
|
27 |
+
showCancelButton: true,
|
28 |
+
confirmButtonColor: '#3085d6',
|
29 |
+
cancelButtonColor: '#d33',
|
30 |
+
confirmButtonText: 'See Pro Plans'
|
31 |
+
}).then((result) => {
|
32 |
+
if (result.value) {
|
33 |
+
window.location = wcp_settings.register_url;
|
34 |
+
}
|
35 |
+
});
|
36 |
+
return false;
|
37 |
+
}
|
38 |
+
folderOrder = jQuery("#space_"+fileFolderID+" > li").length+1;
|
39 |
+
ajaxURL = wcp_settings.ajax_url+"?parent_id=" + fileFolderID + "&type=" + wcp_settings.post_type + "&action=wcp_add_new_folder&nonce=" + wcp_settings.nonce + "&term_id=" + fileFolderID + "&order=" + folderOrder+"&name=";
|
40 |
+
Swal({
|
41 |
+
title: 'Add Folder',
|
42 |
+
input: 'text',
|
43 |
+
inputAttributes: {
|
44 |
+
autocapitalize: 'off',
|
45 |
+
placeholder: "Folder name"
|
46 |
+
},
|
47 |
+
showCancelButton: true,
|
48 |
+
confirmButtonText: 'Submit',
|
49 |
+
showLoaderOnConfirm: true,
|
50 |
+
reverseButtons: true,
|
51 |
+
preConfirm: (folderName) => {
|
52 |
+
if(folderName == "") {
|
53 |
+
swal.showValidationError(
|
54 |
+
'Please enter folder name'
|
55 |
+
)
|
56 |
+
return false;
|
57 |
+
}
|
58 |
+
return fetch(ajaxURL+folderName)
|
59 |
+
.then(response => {
|
60 |
+
if (!response.ok) {
|
61 |
+
throw new Error(response.statusText);
|
62 |
+
}
|
63 |
+
return response.json();
|
64 |
+
}).catch(error => {
|
65 |
+
Swal.showValidationMessage(
|
66 |
+
"Request failed: "+error
|
67 |
+
)
|
68 |
+
});
|
69 |
+
},
|
70 |
+
allowOutsideClick: () => !Swal.isLoading()
|
71 |
+
}).then((result) => {
|
72 |
+
if(result.value.error == 1) {
|
73 |
+
Swal({
|
74 |
+
type: 'error',
|
75 |
+
title: 'Oops...',
|
76 |
+
text: result.value.message
|
77 |
+
});
|
78 |
+
} else if(result.value.status == 1) {
|
79 |
+
jQuery("#space_"+result.value.parent_id).append(result.value.term_data);
|
80 |
+
jQuery("#wcp_folder_"+result.value.parent_id).addClass("active has-sub-tree");
|
81 |
+
isKeyActive = parseInt(result.value.is_key_active);
|
82 |
+
totalFolders = parseInt(result.value.folders);
|
83 |
+
jQuery("#current-folder").text(totalFolders);
|
84 |
+
if(totalFolders > folderLimitation) {
|
85 |
+
folderLimitation = totalFolders;
|
86 |
+
}
|
87 |
+
jQuery("#total-folder").text(folderLimitation);
|
88 |
+
checkForExpandCollapse();
|
89 |
+
add_menu_to_list();
|
90 |
+
}
|
91 |
+
});
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
function updateFolder() {
|
96 |
+
folderName = jQuery.trim(jQuery("#wcp_folder_"+fileFolderID+" > h3").text());
|
97 |
+
parentID = jQuery("#wcp_folder_"+fileFolderID).closest("li.route").data("folder-id");
|
98 |
+
if(parentID == undefined) {
|
99 |
+
parentID = 0;
|
100 |
+
}
|
101 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_"+fileFolderID).data("rename"));
|
102 |
+
ajaxURL = wcp_settings.ajax_url+"?parent_id=" + parentID + "&nonce=" + nonce + "&type=" + wcp_settings.post_type + "&action=wcp_update_folder&term_id=" + fileFolderID + "&name=";
|
103 |
+
Swal({
|
104 |
+
title: 'Update Folder',
|
105 |
+
input: 'text',
|
106 |
+
inputValue: folderName,
|
107 |
+
inputAttributes: {
|
108 |
+
autocapitalize: 'off',
|
109 |
+
placeholder: "Folder name",
|
110 |
+
value: folderName
|
111 |
+
},
|
112 |
+
showCancelButton: true,
|
113 |
+
confirmButtonText: 'Submit',
|
114 |
+
showLoaderOnConfirm: true,
|
115 |
+
reverseButtons: true,
|
116 |
+
preConfirm: (folderName) => {
|
117 |
+
if(folderName == "") {
|
118 |
+
swal.showValidationError(
|
119 |
+
'Please enter folder name'
|
120 |
+
)
|
121 |
+
return false;
|
122 |
+
}
|
123 |
+
return fetch(ajaxURL+folderName)
|
124 |
+
.then(response => {
|
125 |
+
if (!response.ok) {
|
126 |
+
throw new Error(response.statusText);
|
127 |
+
}
|
128 |
+
return response.json();
|
129 |
+
}).catch(error => {
|
130 |
+
Swal.showValidationMessage(
|
131 |
+
"Request failed: "+error
|
132 |
+
)
|
133 |
+
});
|
134 |
+
},
|
135 |
+
allowOutsideClick: () => !Swal.isLoading()
|
136 |
+
}).then((result) => {
|
137 |
+
if(result.value.error == 1) {
|
138 |
+
Swal({
|
139 |
+
type: 'error',
|
140 |
+
title: 'Oops...',
|
141 |
+
text: result.value.message
|
142 |
+
});
|
143 |
+
} else if(result.value.status == 1) {
|
144 |
+
jQuery("#wcp_folder_"+result.value.id+" > h3 > .title-text").text(result.value.term_title);
|
145 |
+
jQuery("#wcp_folder_"+result.value.id+" > h3").attr("title",result.value.term_title);
|
146 |
+
add_menu_to_list();
|
147 |
+
}
|
148 |
+
});
|
149 |
+
}
|
150 |
+
|
151 |
+
function add_menu_to_list() {
|
152 |
+
folderId = 0;
|
153 |
+
if(jQuery(".active-term").length) {
|
154 |
+
folderId = jQuery(".active-term").data("folder-id");
|
155 |
+
}
|
156 |
+
jQuery(".tree-structure ul").html("");
|
157 |
+
jQuery("#space_"+folderId).children().each(function(){
|
158 |
+
fID = jQuery(this).data("folder-id");
|
159 |
+
fName = jQuery(this).find("h3.title:first .title-text").text()
|
160 |
+
liHtml = listFolderString.replace(/__folder_id__/g,fID);
|
161 |
+
liHtml = liHtml.replace(/__folder_name__/g,fName);
|
162 |
+
selectedClass = jQuery(this).hasClass("is-high")?"is-high":"";
|
163 |
+
liHtml = liHtml.replace(/__append_class__/g,selectedClass);
|
164 |
+
jQuery(".tree-structure ul").append(liHtml);
|
165 |
+
});
|
166 |
+
}
|
167 |
+
|
168 |
+
jQuery(document).ready(function(){
|
169 |
+
|
170 |
+
if(wcp_settings.can_manage_folder == "0") {
|
171 |
+
jQuery(".wcp-custom-form a:not(.pink)").addClass("button-disabled");
|
172 |
+
}
|
173 |
+
|
174 |
+
isKeyActive = parseInt(wcp_settings.is_key_active);
|
175 |
+
totalFolders = parseInt(wcp_settings.folders);
|
176 |
+
|
177 |
+
if(wcp_settings.post_type == "attachment") {
|
178 |
+
jQuery(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
|
179 |
+
|
180 |
+
add_menu_to_list();
|
181 |
+
}
|
182 |
+
|
183 |
+
calcWidth(jQuery('#title_0'));
|
184 |
+
|
185 |
+
jQuery("#cancel-button").click(function(){
|
186 |
+
jQuery(".wcp-form-data").hide();
|
187 |
+
});
|
188 |
+
|
189 |
+
|
190 |
+
jQuery(document).on("click", "h3.title", function(e) {
|
191 |
+
e.stopPropagation();
|
192 |
+
window.location = wcp_settings.page_url+jQuery(this).closest("li.route").data("slug");
|
193 |
+
});
|
194 |
+
|
195 |
+
jQuery(".tree-structure a").livequery(function(){
|
196 |
+
jQuery(this).click(function(){
|
197 |
+
fID = jQuery(this).data("id");
|
198 |
+
jQuery("#title_"+fID).trigger("click");
|
199 |
+
});
|
200 |
+
});
|
201 |
+
|
202 |
+
jQuery(".wcp-parent > span").click(function(){
|
203 |
+
window.location = wcp_settings.page_url
|
204 |
+
});
|
205 |
+
jQuery("h3.title").livequery(function () {
|
206 |
+
jQuery(this).droppable({
|
207 |
+
accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
|
208 |
+
hoverClass: 'wcp-drop-hover',
|
209 |
+
classes: {
|
210 |
+
"ui-droppable-active": "ui-state-highlight"
|
211 |
+
},
|
212 |
+
drop: function (event, ui) {
|
213 |
+
folderID = jQuery(this).closest("li.route").data('folder-id');
|
214 |
+
if (ui.draggable.hasClass('wcp-move-multiple')) {
|
215 |
+
if (jQuery(".wp-list-table input:checked").length) {
|
216 |
+
chkStr = "";
|
217 |
+
jQuery(".wp-list-table input:checked").each(function () {
|
218 |
+
chkStr += jQuery(this).val() + ",";
|
219 |
+
});
|
220 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
221 |
+
jQuery.ajax({
|
222 |
+
url: wcp_settings.ajax_url,
|
223 |
+
data: "post_ids=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
224 |
+
method: 'post',
|
225 |
+
success: function (res) {
|
226 |
+
res = jQuery.parseJSON(res);
|
227 |
+
if (res.status == "1") {
|
228 |
+
window.location.reload();
|
229 |
+
} else {
|
230 |
+
Swal.fire(
|
231 |
+
'',
|
232 |
+
res.message,
|
233 |
+
'error'
|
234 |
+
);
|
235 |
+
}
|
236 |
+
}
|
237 |
+
});
|
238 |
+
}
|
239 |
+
} else if (ui.draggable.hasClass('wcp-move-file')) {
|
240 |
+
postID = ui.draggable[0].attributes['data-id'].nodeValue;
|
241 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
242 |
+
jQuery.ajax({
|
243 |
+
url: wcp_settings.ajax_url,
|
244 |
+
data: "post_id=" + postID + "&type=" + wcp_settings.post_type + "&action=wcp_change_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
245 |
+
method: 'post',
|
246 |
+
success: function (res) {
|
247 |
+
res = jQuery.parseJSON(res);
|
248 |
+
if (res.status == "1") {
|
249 |
+
window.location.reload();
|
250 |
+
} else {
|
251 |
+
Swal.fire(
|
252 |
+
'',
|
253 |
+
res.message,
|
254 |
+
'error'
|
255 |
+
);
|
256 |
+
}
|
257 |
+
}
|
258 |
+
});
|
259 |
+
} else if (ui.draggable.hasClass('attachment')) {
|
260 |
+
chkStr = ui.draggable[0].attributes['data-id'].nodeValue;
|
261 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
262 |
+
if (jQuery(".attachments-browser li.attachment.selected").length > 1) {
|
263 |
+
chkStr = "";
|
264 |
+
jQuery(".attachments-browser li.attachment.selected").each(function () {
|
265 |
+
chkStr += jQuery(this).data("id") + ",";
|
266 |
+
});
|
267 |
+
}
|
268 |
+
jQuery.ajax({
|
269 |
+
url: wcp_settings.ajax_url,
|
270 |
+
data: "post_ids=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
271 |
+
method: 'post',
|
272 |
+
success: function (res) {
|
273 |
+
window.location.reload();
|
274 |
+
}
|
275 |
+
});
|
276 |
+
}
|
277 |
+
}
|
278 |
+
});
|
279 |
+
});
|
280 |
+
|
281 |
+
jQuery(".attachments-browser li.attachment").livequery(function () {
|
282 |
+
jQuery(this).draggable({
|
283 |
+
revert: "invalid",
|
284 |
+
containment: "document",
|
285 |
+
helper: function (event, ui) {
|
286 |
+
jQuery(".selected-items").remove();
|
287 |
+
selectedItems = jQuery(".attachments-browser li.attachment.selected").length;
|
288 |
+
selectedItems = (selectedItems == 0 || selectedItems == 1) ? "1 Item" : selectedItems + " Items";
|
289 |
+
return jQuery("<div class='selected-items'><span class='total-post-count'>" + selectedItems + " Selected</span></div>");
|
290 |
+
},
|
291 |
+
start: function (event, ui) {
|
292 |
+
|
293 |
+
},
|
294 |
+
cursor: "move",
|
295 |
+
cursorAt: {
|
296 |
+
left: 0,
|
297 |
+
top: 0
|
298 |
+
},
|
299 |
+
stop: function (event, ui) {
|
300 |
+
jQuery(".selected-items").remove();
|
301 |
+
}
|
302 |
+
});
|
303 |
+
jQuery(this).draggable("disable");
|
304 |
+
});
|
305 |
+
|
306 |
+
jQuery(".media-button").livequery(function () {
|
307 |
+
jQuery(this).click(function () {
|
308 |
+
if (jQuery(".delete-selected-button").hasClass("hidden")) {
|
309 |
+
jQuery(".attachments-browser li.attachment").draggable("disable");
|
310 |
+
} else {
|
311 |
+
jQuery(".attachments-browser li.attachment").draggable("enable");
|
312 |
+
}
|
313 |
+
});
|
314 |
+
});
|
315 |
+
|
316 |
+
jQuery(".header-posts").click(function(){
|
317 |
+
window.location = wcp_settings.page_url;
|
318 |
+
});
|
319 |
+
|
320 |
+
jQuery(".un-categorised-items").click(function(){
|
321 |
+
window.location = wcp_settings.page_url+"-1";
|
322 |
+
});
|
323 |
+
|
324 |
+
jQuery(".un-categorised-items").livequery(function () {
|
325 |
+
jQuery(this).droppable({
|
326 |
+
accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
|
327 |
+
hoverClass: 'wcp-hover-list',
|
328 |
+
classes: {
|
329 |
+
"ui-droppable-active": "ui-state-highlight"
|
330 |
+
},
|
331 |
+
drop: function (event, ui) {
|
332 |
+
folderID = -1;
|
333 |
+
nonce = wcp_settings.nonce;
|
334 |
+
if (ui.draggable.hasClass('wcp-move-multiple')) {
|
335 |
+
if (jQuery(".wp-list-table input:checked").length) {
|
336 |
+
chkStr = "";
|
337 |
+
jQuery(".wp-list-table input:checked").each(function () {
|
338 |
+
chkStr += jQuery(this).val() + ",";
|
339 |
+
});
|
340 |
+
jQuery.ajax({
|
341 |
+
url: wcp_settings.ajax_url,
|
342 |
+
data: "post_id=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_remove_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
343 |
+
method: 'post',
|
344 |
+
success: function (res) {
|
345 |
+
window.location.reload();
|
346 |
+
}
|
347 |
+
});
|
348 |
+
}
|
349 |
+
} else if (ui.draggable.hasClass('wcp-move-file')) {
|
350 |
+
postID = ui.draggable[0].attributes['data-id'].nodeValue;
|
351 |
+
jQuery.ajax({
|
352 |
+
url: wcp_settings.ajax_url,
|
353 |
+
data: "post_id=" + postID + "&type=" + wcp_settings.post_type + "&action=wcp_remove_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
354 |
+
method: 'post',
|
355 |
+
success: function (res) {
|
356 |
+
window.location.reload();
|
357 |
+
}
|
358 |
+
});
|
359 |
+
} else if (ui.draggable.hasClass('attachment')) {
|
360 |
+
chkStr = ui.draggable[0].attributes['data-id'].nodeValue;
|
361 |
+
if (jQuery(".attachments-browser li.attachment.selected").length > 1) {
|
362 |
+
chkStr = "";
|
363 |
+
jQuery(".attachments-browser li.attachment.selected").each(function () {
|
364 |
+
chkStr += jQuery(this).data("id") + ",";
|
365 |
+
});
|
366 |
+
}
|
367 |
+
jQuery.ajax({
|
368 |
+
url: wcp_settings.ajax_url,
|
369 |
+
data: "post_id=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_remove_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
370 |
+
method: 'post',
|
371 |
+
success: function (res) {
|
372 |
+
window.location.reload();
|
373 |
+
}
|
374 |
+
});
|
375 |
+
}
|
376 |
+
}
|
377 |
+
});
|
378 |
+
});
|
379 |
+
|
380 |
+
|
381 |
+
|
382 |
+
//if(wcp_settings.can_manage_folder == "1") {
|
383 |
+
jQuery(".tree-structure .folder-item").livequery(function () {
|
384 |
+
jQuery(this).droppable({
|
385 |
+
accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
|
386 |
+
hoverClass: 'wcp-drop-hover-list',
|
387 |
+
classes: {
|
388 |
+
"ui-droppable-active": "ui-state-highlight"
|
389 |
+
},
|
390 |
+
drop: function (event, ui) {
|
391 |
+
folderID = jQuery(this).data('id');
|
392 |
+
if (ui.draggable.hasClass('wcp-move-multiple')) {
|
393 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
394 |
+
if (jQuery(".wp-list-table input:checked").length) {
|
395 |
+
chkStr = "";
|
396 |
+
jQuery(".wp-list-table input:checked").each(function () {
|
397 |
+
chkStr += jQuery(this).val() + ",";
|
398 |
+
});
|
399 |
+
jQuery.ajax({
|
400 |
+
url: wcp_settings.ajax_url,
|
401 |
+
data: "post_ids=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
402 |
+
method: 'post',
|
403 |
+
success: function (res) {
|
404 |
+
window.location.reload();
|
405 |
+
}
|
406 |
+
});
|
407 |
+
}
|
408 |
+
} else if (ui.draggable.hasClass('wcp-move-file')) {
|
409 |
+
postID = ui.draggable[0].attributes['data-id'].nodeValue;
|
410 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
411 |
+
jQuery.ajax({
|
412 |
+
url: wcp_settings.ajax_url,
|
413 |
+
data: "post_id=" + postID + "&type=" + wcp_settings.post_type + "&action=wcp_change_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
414 |
+
method: 'post',
|
415 |
+
success: function (res) {
|
416 |
+
window.location.reload();
|
417 |
+
}
|
418 |
+
});
|
419 |
+
} else if (ui.draggable.hasClass('attachment')) {
|
420 |
+
chkStr = ui.draggable[0].attributes['data-id'].nodeValue;
|
421 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_" + folderID).data("nonce"));
|
422 |
+
if (jQuery(".attachments-browser li.attachment.selected").length > 1) {
|
423 |
+
chkStr = "";
|
424 |
+
jQuery(".attachments-browser li.attachment.selected").each(function () {
|
425 |
+
chkStr += jQuery(this).data("id") + ",";
|
426 |
+
});
|
427 |
+
}
|
428 |
+
jQuery.ajax({
|
429 |
+
url: wcp_settings.ajax_url,
|
430 |
+
data: "post_ids=" + chkStr + "&type=" + wcp_settings.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce=" + nonce,
|
431 |
+
method: 'post',
|
432 |
+
success: function (res) {
|
433 |
+
window.location.reload();
|
434 |
+
}
|
435 |
+
});
|
436 |
+
}
|
437 |
+
}
|
438 |
+
});
|
439 |
+
});
|
440 |
+
//}
|
441 |
+
|
442 |
+
jQuery("#expand-collapse-list").click(function(e){
|
443 |
+
e.stopPropagation();
|
444 |
+
statusType = 0;
|
445 |
+
if(jQuery(this).hasClass("all-open")) {
|
446 |
+
jQuery(this).removeClass("all-open");
|
447 |
+
jQuery(".has-sub-tree").removeClass("active");
|
448 |
+
statusType = 0;
|
449 |
+
} else {
|
450 |
+
jQuery(this).addClass("all-open");
|
451 |
+
statusType = 1;
|
452 |
+
jQuery(".has-sub-tree").addClass("active");
|
453 |
+
}
|
454 |
+
folderIDs = "";
|
455 |
+
jQuery(".has-sub-tree").each(function(){
|
456 |
+
folderIDs += jQuery(this).data("folder-id")+",";
|
457 |
+
});
|
458 |
+
if(folderIDs != "") {
|
459 |
+
jQuery(".form-loader-count").css("width","100%");
|
460 |
+
nonce = wcp_settings.nonce;
|
461 |
+
jQuery.ajax({
|
462 |
+
url: wcp_settings.ajax_url,
|
463 |
+
data: "type=" + wcp_settings.post_type + "&action=wcp_change_all_status&status=" + statusType + "&folders="+folderIDs+"&nonce="+nonce,
|
464 |
+
method: 'post',
|
465 |
+
success: function (res) {
|
466 |
+
jQuery(".form-loader-count").css("width","0");
|
467 |
+
add_menu_to_list();
|
468 |
+
res = jQuery.parseJSON(res);
|
469 |
+
if(res.status == "0") {
|
470 |
+
Swal.fire(
|
471 |
+
'',
|
472 |
+
res.message,
|
473 |
+
'error'
|
474 |
+
);
|
475 |
+
window.location.reload(true);
|
476 |
+
}
|
477 |
+
}
|
478 |
+
});
|
479 |
+
}
|
480 |
+
});
|
481 |
+
|
482 |
+
resizeDirection = (wcp_settings.isRTL == "1" || wcp_settings.isRTL == 1)?"w":"e";
|
483 |
+
jQuery(".wcp-content").resizable( {
|
484 |
+
resizeHeight: false,
|
485 |
+
handles: resizeDirection,
|
486 |
+
minWidth: 305,
|
487 |
+
maxWidth: 500,
|
488 |
+
resize: function( e, ui ) {
|
489 |
+
if(wcp_settings.isRTL == "1") {
|
490 |
+
jQuery("#wpcontent").css("padding-right", (ui.size.width + 20) + "px");
|
491 |
+
jQuery("#wpcontent").css("padding-left", "0px");
|
492 |
+
} else {
|
493 |
+
jQuery("#wpcontent").css("padding-left", (ui.size.width + 20) + "px");
|
494 |
+
}
|
495 |
+
newWidth = ui.size.width - 40;
|
496 |
+
cssString = "";
|
497 |
+
classString = "";
|
498 |
+
for(i=0; i<=15; i++) {
|
499 |
+
classString += " .space > .route >";
|
500 |
+
currentWidth = newWidth - (13+(20*i));
|
501 |
+
cssString += "#custom-menu > "+classString+" .title { width: "+currentWidth+"px !important; } ";
|
502 |
+
setStickyHeaderForMedia();
|
503 |
+
}
|
504 |
+
jQuery("#wcp-custom-style").html("<style>"+cssString+"</style>");
|
505 |
+
},
|
506 |
+
stop: function( e, ui ) {
|
507 |
+
nonce = wcp_settings.nonce;
|
508 |
+
jQuery.ajax({
|
509 |
+
url: wcp_settings.ajax_url,
|
510 |
+
data: "type=" + wcp_settings.post_type + "&action=wcp_change_post_width&width=" + ui.size.width+"&nonce="+nonce,
|
511 |
+
method: 'post',
|
512 |
+
success: function (res) {
|
513 |
+
setStickyHeaderForMedia();
|
514 |
+
}
|
515 |
+
});
|
516 |
+
}
|
517 |
+
});
|
518 |
+
|
519 |
+
jQuery(".wcp-move-file").draggable({
|
520 |
+
/*cancel: "a.ui-icon",*/
|
521 |
+
revert: "invalid",
|
522 |
+
containment: "document",
|
523 |
+
helper: "clone",
|
524 |
+
cursor: "move",
|
525 |
+
start: function( event, ui){
|
526 |
+
jQuery(this).closest("td").addClass("wcp-draggable");
|
527 |
+
},
|
528 |
+
stop: function( event, ui ) {
|
529 |
+
jQuery(this).closest("td").removeClass("wcp-draggable");
|
530 |
+
}
|
531 |
+
});
|
532 |
+
|
533 |
+
jQuery(".wcp-move-multiple").draggable({
|
534 |
+
/*cancel: "a.ui-icon",*/
|
535 |
+
revert: "invalid",
|
536 |
+
containment: "document",
|
537 |
+
helper: "clone",
|
538 |
+
cursor: "move"
|
539 |
+
});
|
540 |
+
|
541 |
+
jQuery("h3.title").livequery(function(){
|
542 |
+
jQuery(this).on("contextmenu",function(e) {
|
543 |
+
e.preventDefault();
|
544 |
+
if(wcp_settings.can_manage_folder == 0) {
|
545 |
+
return;
|
546 |
+
}
|
547 |
+
isHigh = jQuery(this).closest("li.route").hasClass("is-high");
|
548 |
+
jQuery(".dynamic-menu").remove();
|
549 |
+
jQuery(".active-menu").removeClass("active-menu");
|
550 |
+
menuHtml = "<div class='dynamic-menu'><ul>" +
|
551 |
+
"<li class='new-folder'><a href='javascript:;'><span class='folder-icon-create_new_folder'></span> New Folder</a></li>" +
|
552 |
+
"<li class='rename-folder'><a href='javascript:;'><span class='folder-icon-border_color'><span class='path1'></span><span class='path2'></span></span> Rename</a></li>" +
|
553 |
+
"<li class='mark-folder'><a href='javascript:;'><span class='folder-icon-star_rate'></span>" + ((isHigh) ? " Remove Star" : "Add a Star") + "</a></li>" +
|
554 |
+
"<li class='remove-folder'><a href='javascript:;'><span class='folder-icon-delete'></span> Delete</a></li>" +
|
555 |
+
"</ul></div>";
|
556 |
+
jQuery(this).after(menuHtml);
|
557 |
+
jQuery(this).parents("li.route").addClass("active-menu");
|
558 |
+
return false;
|
559 |
+
});
|
560 |
+
});
|
561 |
+
|
562 |
+
jQuery("body").click(function(){
|
563 |
+
jQuery(".dynamic-menu").remove();
|
564 |
+
jQuery(".active-menu").removeClass("active-menu");
|
565 |
+
});
|
566 |
+
|
567 |
+
jQuery(".dynamic-menu").livequery(function(){
|
568 |
+
jQuery(this).click(function(e){
|
569 |
+
e.stopPropagation();
|
570 |
+
});
|
571 |
+
});
|
572 |
+
|
573 |
+
jQuery(".rename-folder").livequery(function(){
|
574 |
+
jQuery(this).click(function(e){
|
575 |
+
e.stopPropagation();
|
576 |
+
fileFolderID = jQuery(this).closest("li.route").data("folder-id");
|
577 |
+
updateFolder();
|
578 |
+
add_menu_to_list();
|
579 |
+
});
|
580 |
+
});
|
581 |
+
|
582 |
+
jQuery(".mark-folder").livequery(function(){
|
583 |
+
jQuery(this).click(function(e){
|
584 |
+
e.stopPropagation();
|
585 |
+
folderID = jQuery(this).closest("li.route").data("folder-id");
|
586 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_"+folderID).data("star"));
|
587 |
+
jQuery(".form-loader-count").css("width","100%");
|
588 |
+
jQuery(".dynamic-menu").remove();
|
589 |
+
jQuery(".active-menu").removeClass("active-menu");
|
590 |
+
jQuery.ajax({
|
591 |
+
url: wcp_settings.ajax_url,
|
592 |
+
data: "term_id=" + folderID + "&type=" + wcp_settings.post_type + "&action=wcp_mark_un_mark_folder&nonce="+nonce,
|
593 |
+
method: 'post',
|
594 |
+
cache: false,
|
595 |
+
success: function (res) {
|
596 |
+
res = jQuery.parseJSON(res);
|
597 |
+
jQuery(".form-loader-count").css("width","0%");
|
598 |
+
if (res.status == '1') {
|
599 |
+
if(res.marked == '1') {
|
600 |
+
jQuery("#wcp_folder_"+res.id).addClass("is-high");
|
601 |
+
} else {
|
602 |
+
jQuery("#wcp_folder_"+res.id).removeClass("is-high");
|
603 |
+
}
|
604 |
+
add_menu_to_list();
|
605 |
+
} else {
|
606 |
+
Swal.fire(
|
607 |
+
'',
|
608 |
+
res.message,
|
609 |
+
'error'
|
610 |
+
);
|
611 |
+
}
|
612 |
+
}
|
613 |
+
});
|
614 |
+
});
|
615 |
+
});
|
616 |
+
|
617 |
+
/* Add new folder */
|
618 |
+
jQuery(".new-folder").livequery(function(){
|
619 |
+
jQuery(this).click(function(e) {
|
620 |
+
e.stopPropagation();
|
621 |
+
jQuery(".active-menu").removeClass("active-menu");
|
622 |
+
fileFolderID = jQuery(this).closest("li.route").data("folder-id");
|
623 |
+
jQuery(".dynamic-menu").remove();
|
624 |
+
jQuery(".active-menu").removeClass("active-menu");
|
625 |
+
addFolder();
|
626 |
+
add_menu_to_list();
|
627 |
+
});
|
628 |
+
});
|
629 |
+
|
630 |
+
jQuery(".cancel-button").livequery(function(){
|
631 |
+
jQuery(this).click(function(e){
|
632 |
+
e.stopPropagation();
|
633 |
+
jQuery(".form-li").remove();
|
634 |
+
});
|
635 |
+
});
|
636 |
+
|
637 |
+
|
638 |
+
|
639 |
+
jQuery("#add-new-folder").livequery(function(){
|
640 |
+
jQuery(this).click(function() {
|
641 |
+
if(jQuery("#custom-menu li.active-item").length) {
|
642 |
+
fileFolderID = jQuery("#custom-menu li.active-item").data("folder-id");
|
643 |
+
} else {
|
644 |
+
fileFolderID = 0;
|
645 |
+
}
|
646 |
+
addFolder();
|
647 |
+
add_menu_to_list();
|
648 |
+
});
|
649 |
+
});
|
650 |
+
|
651 |
+
jQuery("#inline-update").click(function(){
|
652 |
+
if(jQuery("#custom-menu li.active-item").length) {
|
653 |
+
fileFolderID = jQuery("#custom-menu li.active-item").data("folder-id");
|
654 |
+
updateFolder();
|
655 |
+
add_menu_to_list();
|
656 |
+
}
|
657 |
+
});
|
658 |
+
|
659 |
+
jQuery("#inline-remove").click(function(){
|
660 |
+
if(jQuery("#custom-menu li.active-item").length) {
|
661 |
+
fileFolderID = jQuery("#custom-menu li.active-item").data("folder-id");
|
662 |
+
jQuery(".dynamic-menu").remove();
|
663 |
+
jQuery(".active-menu").removeClass("active-menu");
|
664 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_"+fileFolderID).data("delete"));
|
665 |
+
Swal.fire({
|
666 |
+
url: wcp_settings.ajax_url,
|
667 |
+
title: 'Are you sure you want to delete the selected folder?',
|
668 |
+
text: 'Items in the folder will not be deleted.',
|
669 |
+
type: 'warning',
|
670 |
+
showCancelButton: true,
|
671 |
+
confirmButtonText: 'Yes, delete it!',
|
672 |
+
cancelButtonText: 'No, keep it',
|
673 |
+
}).then((result) => {
|
674 |
+
if (result.value) {
|
675 |
+
Swal({
|
676 |
+
title: 'Please wait..',
|
677 |
+
imageUrl: wcp_settings.ajax_image,
|
678 |
+
imageAlt: 'The uploaded picture',
|
679 |
+
showConfirmButton: false
|
680 |
+
});
|
681 |
+
jQuery.ajax({
|
682 |
+
url: wcp_settings.ajax_url,
|
683 |
+
data: "type=" + wcp_settings.post_type + "&action=wcp_remove_folder&term_id=" + fileFolderID+"&nonce="+nonce,
|
684 |
+
method: 'post',
|
685 |
+
success: function (res) {
|
686 |
+
res = jQuery.parseJSON(res);
|
687 |
+
if (res.status == '1') {
|
688 |
+
Swal.fire(
|
689 |
+
'Deleted!',
|
690 |
+
'Your folder has been deleted.',
|
691 |
+
'success'
|
692 |
+
);
|
693 |
+
jQuery("#wcp_folder_"+fileFolderID).remove();
|
694 |
+
jQuery("#folder_"+fileFolderID).remove();
|
695 |
+
isKeyActive = parseInt(res.is_key_active);
|
696 |
+
totalFolders = parseInt(res.folders);
|
697 |
+
jQuery("#current-folder").text(totalFolders);
|
698 |
+
if(totalFolders > folderLimitation) {
|
699 |
+
folderLimitation = totalFolders;
|
700 |
+
}
|
701 |
+
jQuery("#total-folder").text(folderLimitation);
|
702 |
+
add_menu_to_list();
|
703 |
+
} else {
|
704 |
+
Swal.fire(
|
705 |
+
'',
|
706 |
+
res.message,
|
707 |
+
'error'
|
708 |
+
);
|
709 |
+
}
|
710 |
+
}
|
711 |
+
});
|
712 |
+
}
|
713 |
+
});
|
714 |
+
}
|
715 |
+
});
|
716 |
+
|
717 |
+
if(wcp_settings.can_manage_folder == "1") {
|
718 |
+
jQuery('.space').livequery(function () {
|
719 |
+
jQuery(this).sortable({
|
720 |
+
placeholder: "ui-state-highlight",
|
721 |
+
connectWith: '.space',
|
722 |
+
tolerance: 'intersect',
|
723 |
+
over: function (event, ui) {
|
724 |
+
|
725 |
+
},
|
726 |
+
update: function (event, ui) {
|
727 |
+
thisId = ui.item.context.attributes['data-folder-id'].nodeValue;
|
728 |
+
orderString = "";
|
729 |
+
jQuery(this).children().each(function () {
|
730 |
+
if (jQuery(this).hasClass("route")) {
|
731 |
+
orderString += jQuery(this).data("folder-id") + ",";
|
732 |
+
}
|
733 |
+
});
|
734 |
+
if (orderString != "") {
|
735 |
+
jQuery(".form-loader-count").css("width", "100%");
|
736 |
+
jQuery.ajax({
|
737 |
+
url: wcp_settings.ajax_url,
|
738 |
+
data: "term_ids=" + orderString + "&action=wcp_save_folder_order&type=" + wcp_settings.post_type + "&nonce=" + wcp_settings.nonce,
|
739 |
+
method: 'post',
|
740 |
+
success: function (res) {
|
741 |
+
res = jQuery.parseJSON(res);
|
742 |
+
if (res.status == '1') {
|
743 |
+
jQuery("#wcp_folder_parent").html(res.options);
|
744 |
+
jQuery(".form-loader-count").css("width", "0");
|
745 |
+
add_menu_to_list();
|
746 |
+
} else {
|
747 |
+
Swal.fire(
|
748 |
+
'',
|
749 |
+
res.message,
|
750 |
+
'error'
|
751 |
+
);
|
752 |
+
window.location.reload(true);
|
753 |
+
}
|
754 |
+
}
|
755 |
+
});
|
756 |
+
}
|
757 |
+
},
|
758 |
+
receive: function (event, ui) {
|
759 |
+
calcWidth(jQuery(this).siblings('.title'));
|
760 |
+
check_for_sub_menu();
|
761 |
+
jQuery(this).closest("li.route").addClass("active");
|
762 |
+
jQuery(this).closest("li.route").find("ul.ui-sortable:first-child > li").slideDown();
|
763 |
+
parentId = jQuery(this).closest("li.route").data("folder-id");
|
764 |
+
thisId = ui.item.context.attributes['data-folder-id'].nodeValue;
|
765 |
+
if (parentId == undefined) {
|
766 |
+
parentId = 0;
|
767 |
+
}
|
768 |
+
orderString = "";
|
769 |
+
if (jQuery("#wcp_folder_" + parentId + " .ui-sortable li").length) {
|
770 |
+
jQuery("#wcp_folder_" + parentId + " .ui-sortable li").each(function () {
|
771 |
+
orderString += jQuery(this).data("folder-id") + ",";
|
772 |
+
});
|
773 |
+
} else if (parentId == 0) {
|
774 |
+
jQuery("#custom-menu > ul.space > li").each(function () {
|
775 |
+
orderString += jQuery(this).data("folder-id") + ",";
|
776 |
+
});
|
777 |
+
}
|
778 |
+
jQuery(".form-loader-count").css("width", "100%");
|
779 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_" + thisId).data("nonce"));
|
780 |
+
jQuery.ajax({
|
781 |
+
url: wcp_settings.ajax_url,
|
782 |
+
data: "term_id=" + thisId + "&action=wcp_update_parent_information&parent_id=" + parentId + "&type=" + wcp_settings.post_type + "&nonce=" + nonce,
|
783 |
+
method: 'post',
|
784 |
+
success: function (res) {
|
785 |
+
jQuery(".form-loader-count").css("width", "0%");
|
786 |
+
res = jQuery.parseJSON(res);
|
787 |
+
if (res.status == 0) {
|
788 |
+
Swal.fire(
|
789 |
+
'',
|
790 |
+
res.message,
|
791 |
+
'error'
|
792 |
+
);
|
793 |
+
} else {
|
794 |
+
add_menu_to_list();
|
795 |
+
}
|
796 |
+
}
|
797 |
+
});
|
798 |
+
}
|
799 |
+
});
|
800 |
+
jQuery(this).disableSelection();
|
801 |
+
});
|
802 |
+
}
|
803 |
+
jQuery(".update-inline-record").livequery(function(){
|
804 |
+
jQuery(this).click(function(e){
|
805 |
+
e.stopPropagation();
|
806 |
+
isHigh = jQuery(this).closest("li.route").hasClass("is-high");
|
807 |
+
jQuery(".dynamic-menu").remove();
|
808 |
+
jQuery(".active-menu").removeClass("active-menu");
|
809 |
+
menuHtml = "<div class='dynamic-menu'><ul>" +
|
810 |
+
"<li class='new-folder'><a href='javascript:;'><span class='folder-icon-create_new_folder'></span> New Folder</a></li>" +
|
811 |
+
"<li class='rename-folder'><a href='javascript:;'><span class='folder-icon-border_color'><span class='path1'></span><span class='path2'></span></span> Rename</a></li>" +
|
812 |
+
"<li class='mark-folder'><a href='javascript:;'><span class='folder-icon-star_rate'></span>" + ((isHigh) ? " Remove Star" : "Add a Star") + "</a></li>" +
|
813 |
+
"<li class='remove-folder'><a href='javascript:;'><span class='folder-icon-delete'></span> Delete</a></li>" +
|
814 |
+
"</ul></div>";
|
815 |
+
jQuery(this).closest("h3.title").after(menuHtml);
|
816 |
+
jQuery(this).parents("li.route").addClass("active-menu");
|
817 |
+
});
|
818 |
+
});
|
819 |
+
//check_for_sub_menu();
|
820 |
+
//jQuery(".has-sub-tree:first").addClass("active");
|
821 |
+
jQuery(".nav-icon").livequery(function(){
|
822 |
+
jQuery(this).click(function(){
|
823 |
+
folderID = jQuery(this).closest("li.route").data("folder-id");
|
824 |
+
if(jQuery("#wcp_folder_"+folderID).hasClass("active")) {
|
825 |
+
folderStatus = 0;
|
826 |
+
} else {
|
827 |
+
folderStatus = 1;
|
828 |
+
}
|
829 |
+
jQuery(".form-loader-count").css("width","100%");
|
830 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_"+folderID).data("nonce"));
|
831 |
+
checkForExpandCollapse();
|
832 |
+
jQuery.ajax({
|
833 |
+
url: wcp_settings.ajax_url,
|
834 |
+
data: "is_active=" + folderStatus + "&action=save_wcp_folder_state&term_id=" + folderID+"&nonce="+nonce,
|
835 |
+
method: 'post',
|
836 |
+
success: function (res) {
|
837 |
+
jQuery(".form-loader-count").css("width","0");
|
838 |
+
res = jQuery.parseJSON(res);
|
839 |
+
if(res.status == "0") {
|
840 |
+
Swal.fire(
|
841 |
+
'',
|
842 |
+
res.message,
|
843 |
+
'error'
|
844 |
+
);
|
845 |
+
} else {
|
846 |
+
if(jQuery("#wcp_folder_"+folderID).hasClass("active")) {
|
847 |
+
jQuery("#wcp_folder_"+folderID).removeClass("active");
|
848 |
+
jQuery("#wcp_folder_"+folderID).find("ul.ui-sortable:first-child > li").slideUp();
|
849 |
+
folderStatus = 0;
|
850 |
+
} else {
|
851 |
+
jQuery("#wcp_folder_"+folderID).addClass("active");
|
852 |
+
jQuery("#wcp_folder_"+folderID).find("ul.ui-sortable:first-child > li").slideDown();
|
853 |
+
folderStatus = 1;
|
854 |
+
}
|
855 |
+
add_menu_to_list();
|
856 |
+
}
|
857 |
+
}
|
858 |
+
});
|
859 |
+
});
|
860 |
+
});
|
861 |
+
jQuery("#custom-menu .ui-icon, #custom-menu h3").livequery(function(){
|
862 |
+
jQuery(this).click(function(){
|
863 |
+
jQuery("#custom-menu .active-item").removeClass("active-item");
|
864 |
+
jQuery(this).closest(".route").addClass("active-item");
|
865 |
+
add_menu_to_list();
|
866 |
+
});
|
867 |
+
});
|
868 |
+
jQuery(".remove-folder").livequery(function(){
|
869 |
+
jQuery(this).click(function() {
|
870 |
+
folderID = jQuery(this).closest("li.route").data("folder-id");
|
871 |
+
fileFolderID = folderID;
|
872 |
+
jQuery(".dynamic-menu").remove();
|
873 |
+
jQuery(".active-menu").removeClass("active-menu");
|
874 |
+
nonce = jQuery.trim(jQuery("#wcp_folder_"+fileFolderID).data("delete"));
|
875 |
+
Swal.fire({
|
876 |
+
url: wcp_settings.ajax_url,
|
877 |
+
title: 'Are you sure you want to delete the selected folder?',
|
878 |
+
text: 'Items in the folder will not be deleted.',
|
879 |
+
type: 'warning',
|
880 |
+
showCancelButton: true,
|
881 |
+
confirmButtonText: 'Yes, delete it!',
|
882 |
+
cancelButtonText: 'No, keep it',
|
883 |
+
}).then((result) => {
|
884 |
+
if (result.value) {
|
885 |
+
Swal({
|
886 |
+
title: 'Please wait..',
|
887 |
+
imageUrl: wcp_settings.ajax_image,
|
888 |
+
imageAlt: 'The uploaded picture',
|
889 |
+
showConfirmButton: false
|
890 |
+
});
|
891 |
+
jQuery.ajax({
|
892 |
+
url: wcp_settings.ajax_url,
|
893 |
+
data: "type=" + wcp_settings.post_type + "&action=wcp_remove_folder&term_id=" + folderID+"&nonce="+nonce,
|
894 |
+
method: 'post',
|
895 |
+
success: function (res) {
|
896 |
+
res = jQuery.parseJSON(res);
|
897 |
+
if (res.status == '1') {
|
898 |
+
Swal.fire(
|
899 |
+
'Deleted!',
|
900 |
+
'Your folder has been deleted.',
|
901 |
+
'success'
|
902 |
+
);
|
903 |
+
jQuery("#wcp_folder_"+fileFolderID).remove();
|
904 |
+
jQuery("#folder_"+fileFolderID).remove();
|
905 |
+
isKeyActive = parseInt(res.is_key_active);
|
906 |
+
totalFolders = parseInt(res.folders);
|
907 |
+
jQuery("#current-folder").text(totalFolders);
|
908 |
+
if(totalFolders > folderLimitation) {
|
909 |
+
folderLimitation = totalFolders;
|
910 |
+
}
|
911 |
+
jQuery("#total-folder").text(folderLimitation);
|
912 |
+
add_menu_to_list();
|
913 |
+
} else {
|
914 |
+
Swal.fire(
|
915 |
+
'',
|
916 |
+
res.message,
|
917 |
+
'error'
|
918 |
+
);
|
919 |
+
}
|
920 |
+
}
|
921 |
+
});
|
922 |
+
}
|
923 |
+
});
|
924 |
+
});
|
925 |
+
});
|
926 |
+
jQuery(".wcp-parent .fa-caret-right").livequery(function(){
|
927 |
+
jQuery(this).click(function() {
|
928 |
+
autoStatus = 1;
|
929 |
+
if (jQuery(this).closest(".wcp-parent").hasClass("active")) {
|
930 |
+
jQuery(this).closest(".wcp-parent").removeClass("active");
|
931 |
+
jQuery("#custom-menu").removeClass("active");
|
932 |
+
autoStatus = 0;
|
933 |
+
} else {
|
934 |
+
jQuery(this).closest(".wcp-parent").addClass("active");
|
935 |
+
jQuery("#custom-menu").addClass("active");
|
936 |
+
}
|
937 |
+
jQuery(".form-loader-count").css("width","100%");
|
938 |
+
add_menu_to_list();
|
939 |
+
jQuery.ajax({
|
940 |
+
url: wcp_settings.ajax_url,
|
941 |
+
data: "type=" + wcp_settings.post_type + "&action=wcp_save_parent_data&is_active=" + autoStatus+"&nonce="+wcp_settings.nonce,
|
942 |
+
method: 'post',
|
943 |
+
success: function (res) {
|
944 |
+
jQuery(".form-loader-count").css("width","0%");
|
945 |
+
res = jQuery.parseJSON(res);
|
946 |
+
if (res.status == '1') {
|
947 |
+
Swal.fire(
|
948 |
+
'',
|
949 |
+
res.message,
|
950 |
+
'error'
|
951 |
+
);
|
952 |
+
}
|
953 |
+
}
|
954 |
+
});
|
955 |
+
});
|
956 |
+
});
|
957 |
+
|
958 |
+
checkForExpandCollapse();
|
959 |
+
})
|
960 |
+
|
961 |
+
function checkForExpandCollapse() {
|
962 |
+
add_menu_to_list();
|
963 |
+
currentStatus = true;
|
964 |
+
if((jQuery("#custom-menu .has-sub-tree").length == jQuery("#custom-menu .has-sub-tree.active").length) && jQuery("#custom-menu .has-sub-tree").length) {
|
965 |
+
jQuery("#expand-collapse-list").addClass("all-open");
|
966 |
+
} else {
|
967 |
+
jQuery("#expand-collapse-list").removeClass("all-open");
|
968 |
+
}
|
969 |
+
}
|
970 |
+
|
971 |
+
function check_for_sub_menu() {
|
972 |
+
jQuery("#custom-menu li.route").removeClass("has-sub-tree");
|
973 |
+
jQuery("#custom-menu li.route").each(function(){
|
974 |
+
if(jQuery(this).find("ul.ui-sortable li").length) {
|
975 |
+
jQuery(this).addClass("has-sub-tree");
|
976 |
+
if(jQuery(this).find("ul.ui-sortable:first").is(":hidden")) {
|
977 |
+
jQuery(this).removeClass("is-hidden");
|
978 |
+
} else {
|
979 |
+
jQuery(this).addClass("is-hidden")
|
980 |
+
}
|
981 |
+
} else {
|
982 |
+
jQuery(this).removeClass("active");
|
983 |
+
}
|
984 |
+
});
|
985 |
+
}
|
986 |
+
|
987 |
+
//recursively calculate the Width all titles
|
988 |
+
function calcWidth(obj){
|
989 |
+
var titles =
|
990 |
+
jQuery(obj).siblings('.space').children('.route').children('.title');
|
991 |
+
jQuery(titles).each(function(index, element){
|
992 |
+
var pTitleWidth = parseInt(jQuery(obj).css('width'));
|
993 |
+
var leftOffset = parseInt(jQuery(obj).siblings('.space').css('margin-left'));
|
994 |
+
var newWidth = pTitleWidth - leftOffset;
|
995 |
+
if (jQuery(obj).attr('id') == 'title_0'){
|
996 |
+
newWidth = newWidth - 10;
|
997 |
+
}
|
998 |
+
jQuery(element).css({
|
999 |
+
'width': newWidth
|
1000 |
+
});
|
1001 |
+
calcWidth(element);
|
1002 |
+
});
|
1003 |
+
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
|
1007 |
+
/* code for sticky menu for media screen*/
|
1008 |
+
|
1009 |
+
if(wcp_settings.post_type == "attachment") {
|
1010 |
+
|
1011 |
+
|
1012 |
+
|
1013 |
+
jQuery(window).load(function() {
|
1014 |
+
jQuery("button.button.media-button.select-mode-toggle-button").after("<button class='button organize-button'>Organize</button>");
|
1015 |
+
if(jQuery(".wcp-custom-form").length) {
|
1016 |
+
if (wp.Uploader !== undefined) {
|
1017 |
+
wp.Uploader.queue.on('reset', function () {
|
1018 |
+
resetMediaData(1);
|
1019 |
+
});
|
1020 |
+
}
|
1021 |
+
jQuery(document).ajaxComplete(function(ev, jqXHR, settings) {
|
1022 |
+
actionName = settings.data;
|
1023 |
+
if(actionName.indexOf("action=delete-post&id=") == 0) {
|
1024 |
+
resetMediaData(0);
|
1025 |
+
}
|
1026 |
+
});
|
1027 |
+
}
|
1028 |
+
});
|
1029 |
+
|
1030 |
+
function resetMediaData(loadData) {
|
1031 |
+
jQuery.ajax({
|
1032 |
+
url: wcp_settings.ajax_url,
|
1033 |
+
data: "type=" + wcp_settings.post_type + "&action=wcp_get_default_list",
|
1034 |
+
method: 'post',
|
1035 |
+
success: function (res) {
|
1036 |
+
res = jQuery.parseJSON(res);
|
1037 |
+
jQuery("#custom-menu > ul#space_0").html(res.data);
|
1038 |
+
jQuery(".header-posts .total-count").text(res.total_items);
|
1039 |
+
jQuery(".un-categorised-items .total-count").text(res.empty_items);
|
1040 |
+
selectedVal = jQuery("#media-attachment-taxonomy-filter").val();
|
1041 |
+
if(selectedVal != "all" && loadData == 1) {
|
1042 |
+
var wp1 = parent.wp;
|
1043 |
+
wp1.media.frame.setState('insert');
|
1044 |
+
if (wp1.media.frame.content.get() !== null) {
|
1045 |
+
wp1.media.frame.content.get().collection.props.set({ignore: (+new Date())});
|
1046 |
+
wp1.media.frame.content.get().options.selection.reset();
|
1047 |
+
} else {
|
1048 |
+
wp1.media.frame.library.props.set({ignore: (+new Date())});
|
1049 |
+
}
|
1050 |
+
}
|
1051 |
+
if(res.taxonomies.length) {
|
1052 |
+
var selectedDD = jQuery("#media-attachment-taxonomy-filter");
|
1053 |
+
selectedDD.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>");
|
1054 |
+
for(i=0; i<res.taxonomies.length; i++) {
|
1055 |
+
selectedDD.append("<option value='"+i+"'>"+res.taxonomies[i].name+" ("+res.taxonomies[i].count+")</option>");
|
1056 |
+
}
|
1057 |
+
selectedDD.val(selectedVal);
|
1058 |
+
}
|
1059 |
+
}
|
1060 |
+
});
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
function setMediaBoxWidth() {
|
1064 |
+
jQuery(".media-frame-content .media-toolbar").width(jQuery(".media-frame-content").width() - 20);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
setMediaBoxWidth();
|
1068 |
+
|
1069 |
+
jQuery(window).resize(function(){
|
1070 |
+
setMediaBoxWidth();
|
1071 |
+
});
|
1072 |
+
|
1073 |
+
jQuery(document).on("click", ".button.organize-button", function(){
|
1074 |
+
jQuery("button.button.media-button.select-mode-toggle-button").trigger("click");
|
1075 |
+
});
|
1076 |
+
|
1077 |
+
function setStickyHeaderForMedia() {
|
1078 |
+
if(!jQuery(".media-position").length) {
|
1079 |
+
jQuery(".media-frame-content .media-toolbar").before("<div class='media-position'></div>")
|
1080 |
+
}
|
1081 |
+
|
1082 |
+
if(jQuery(".media-position").length) {
|
1083 |
+
setMediaBoxWidth();
|
1084 |
+
|
1085 |
+
thisPosition = jQuery(".media-position").offset().top - jQuery(window).scrollTop();
|
1086 |
+
if(thisPosition <= 32) {
|
1087 |
+
jQuery(".media-frame-content .media-toolbar").addClass("sticky-media");
|
1088 |
+
jQuery(".media-position").height(jQuery(".media-frame-content .media-toolbar").outerHeight());
|
1089 |
+
} else {
|
1090 |
+
jQuery(".media-frame-content .media-toolbar").removeClass("sticky-media");
|
1091 |
+
jQuery(".media-position").height(1);
|
1092 |
+
}
|
1093 |
+
}
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
jQuery(window).scroll(function(){
|
1097 |
+
setStickyHeaderForMedia()
|
1098 |
+
});
|
1099 |
+
} else {
|
1100 |
+
function setStickyHeaderForMedia() {}
|
1101 |
}
|
assets/js/media.js
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
};
|
13 |
});
|
14 |
filters.all = {
|
15 |
-
text: '
|
16 |
props: {
|
17 |
'media_folder': ''
|
18 |
},
|
12 |
};
|
13 |
});
|
14 |
filters.all = {
|
15 |
+
text: 'Select a folder >>',
|
16 |
props: {
|
17 |
'media_folder': ''
|
18 |
},
|
assets/js/sweetalert.all.min.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Sweetalert2=t()}(this,function(){"use strict";function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return(l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&u(i,n.prototype),i}).apply(null,arguments)}function d(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t,n){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var t="SweetAlert2:",f=function(e){return Array.prototype.slice.call(e)},R=function(e){console.warn("".concat(t," ").concat(e))},I=function(e){console.error("".concat(t," ").concat(e))},n=[],m=function(e){-1===n.indexOf(e)&&(n.push(e),R(e))},H=function(e){return"function"==typeof e?e():e},D=function(e){return e&&Promise.resolve(e)===e},e=Object.freeze({cancel:"cancel",backdrop:"overlay",close:"close",esc:"esc",timer:"timer"}),h=function(e){var t={};for(var n in e)t[e[n]]="swal2-"+e[n];return t},_=h(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","toast","toast-shown","toast-column","fade","show","hide","noanimation","close","title","header","content","actions","confirm","cancel","footer","icon","icon-text","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","validation-message","progresssteps","activeprogressstep","progresscircle","progressline","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl"]),g=h(["success","warning","info","question","error"]),b={previousBodyPadding:null},v=function(e,t){return e.classList.contains(t)},N=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},y=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(function(t){e.forEach?e.forEach(function(e){n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)}))},z=function(e,t){y(e,t,!0)},W=function(e,t){y(e,t,!1)},U=function(e,t){for(var n=0;n<e.childNodes.length;n++)if(v(e.childNodes[n],t))return e.childNodes[n]},K=function(e){e.style.opacity="",e.style.display=e.id===_.content?"block":"flex"},F=function(e){e.style.opacity="",e.style.display="none"},Z=function(e){return e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w=function(){return document.body.querySelector("."+_.container)},C=function(e){var t=w();return t?t.querySelector("."+e):null},k=function(){return C(_.popup)},x=function(){var e=k();return f(e.querySelectorAll("."+_.icon))},A=function(){return C(_.title)},B=function(){return C(_.content)},S=function(){return C(_.image)},P=function(){return C(_.progresssteps)},E=function(){return C(_["validation-message"])},L=function(){return C(_.confirm)},O=function(){return C(_.cancel)},Q=function(){return C(_.actions)},Y=function(){return C(_.footer)},$=function(){return C(_.close)},J=function(){var e=f(k().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(e,t){return e=parseInt(e.getAttribute("tabindex")),(t=parseInt(t.getAttribute("tabindex")))<e?1:e<t?-1:0}),t=f(k().querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls]')).filter(function(e){return"-1"!==e.getAttribute("tabindex")});return function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(e.concat(t)).filter(function(e){return Z(e)})},T=function(){return!M()&&!document.body.classList.contains(_["no-backdrop"])},M=function(){return document.body.classList.contains(_["toast-shown"])},j=function(){return"undefined"==typeof window||"undefined"==typeof document},V='\n <div aria-labelledby="'.concat(_.title,'" aria-describedby="').concat(_.content,'" class="').concat(_.popup,'" tabindex="-1">\n <div class="').concat(_.header,'">\n <ul class="').concat(_.progresssteps,'"></ul>\n <div class="').concat(_.icon," ").concat(g.error,'">\n <span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>\n </div>\n <div class="').concat(_.icon," ").concat(g.question,'">\n <span class="').concat(_["icon-text"],'">?</span>\n </div>\n <div class="').concat(_.icon," ").concat(g.warning,'">\n <span class="').concat(_["icon-text"],'">!</span>\n </div>\n <div class="').concat(_.icon," ").concat(g.info,'">\n <span class="').concat(_["icon-text"],'">i</span>\n </div>\n <div class="').concat(_.icon," ").concat(g.success,'">\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n </div>\n <img class="').concat(_.image,'" />\n <h2 class="').concat(_.title,'" id="').concat(_.title,'"></h2>\n <button type="button" class="').concat(_.close,'">×</button>\n </div>\n <div class="').concat(_.content,'">\n <div id="').concat(_.content,'"></div>\n <input class="').concat(_.input,'" />\n <input type="file" class="').concat(_.file,'" />\n <div class="').concat(_.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(_.select,'"></select>\n <div class="').concat(_.radio,'"></div>\n <label for="').concat(_.checkbox,'" class="').concat(_.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(_.label,'"></span>\n </label>\n <textarea class="').concat(_.textarea,'"></textarea>\n <div class="').concat(_["validation-message"],'" id="').concat(_["validation-message"],'"></div>\n </div>\n <div class="').concat(_.actions,'">\n <button type="button" class="').concat(_.confirm,'">OK</button>\n <button type="button" class="').concat(_.cancel,'">Cancel</button>\n </div>\n <div class="').concat(_.footer,'">\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),X=function(e){var t=w();if(t&&(t.parentNode.removeChild(t),W([document.documentElement,document.body],[_["no-backdrop"],_["toast-shown"],_["has-column"]])),!j()){var n=document.createElement("div");n.className=_.container,n.innerHTML=V;var o="string"==typeof e.target?document.querySelector(e.target):e.target;o.appendChild(n);var i,r=k(),a=B(),s=U(a,_.input),c=U(a,_.file),u=a.querySelector(".".concat(_.range," input")),l=a.querySelector(".".concat(_.range," output")),d=U(a,_.select),p=a.querySelector(".".concat(_.checkbox," input")),f=U(a,_.textarea);r.setAttribute("role",e.toast?"alert":"dialog"),r.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||r.setAttribute("aria-modal","true"),"rtl"===window.getComputedStyle(o).direction&&z(w(),_.rtl);var m=function(e){De.isVisible()&&i!==e.target.value&&De.resetValidationMessage(),i=e.target.value};return s.oninput=m,c.onchange=m,d.onchange=m,p.onchange=m,f.oninput=m,u.oninput=function(e){m(e),l.value=u.value},u.onchange=function(e){m(e),u.nextSibling.value=u.value},r}I("SweetAlert2 requires document to initialize")},G=function(e,t){if(!e)return F(t);if(e instanceof HTMLElement)t.appendChild(e);else if("object"===q(e))if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0));else e&&(t.innerHTML=e);K(t)},ee=function(){if(j())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in t)if(t.hasOwnProperty(n)&&void 0!==e.style[n])return t[n];return!1}(),te=function(e){var t=Q(),n=L(),o=O();if(e.showConfirmButton||e.showCancelButton?K(t):F(t),e.showCancelButton?o.style.display="inline-block":F(o),e.showConfirmButton?n.style.removeProperty("display"):F(n),n.innerHTML=e.confirmButtonText,o.innerHTML=e.cancelButtonText,n.setAttribute("aria-label",e.confirmButtonAriaLabel),o.setAttribute("aria-label",e.cancelButtonAriaLabel),n.className=_.confirm,z(n,e.confirmButtonClass),o.className=_.cancel,z(o,e.cancelButtonClass),e.buttonsStyling){z([n,o],_.styled),e.confirmButtonColor&&(n.style.backgroundColor=e.confirmButtonColor),e.cancelButtonColor&&(o.style.backgroundColor=e.cancelButtonColor);var i=window.getComputedStyle(n).getPropertyValue("background-color");n.style.borderLeftColor=i,n.style.borderRightColor=i}else W([n,o],_.styled),n.style.backgroundColor=n.style.borderLeftColor=n.style.borderRightColor="",o.style.backgroundColor=o.style.borderLeftColor=o.style.borderRightColor=""},ne=function(e){var t=B().querySelector("#"+_.content);e.html?G(e.html,t):e.text?(t.textContent=e.text,K(t)):F(t)},oe=function(e){for(var t=x(),n=0;n<t.length;n++)F(t[n]);if(e.type)if(-1!==Object.keys(g).indexOf(e.type)){var o=De.getPopup().querySelector(".".concat(_.icon,".").concat(g[e.type]));K(o),e.animation&&z(o,"swal2-animate-".concat(e.type,"-icon"))}else I('Unknown type! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.type,'"'))},ie=function(e){var t=S();e.imageUrl?(t.setAttribute("src",e.imageUrl),t.setAttribute("alt",e.imageAlt),K(t),e.imageWidth?t.setAttribute("width",e.imageWidth):t.removeAttribute("width"),e.imageHeight?t.setAttribute("height",e.imageHeight):t.removeAttribute("height"),t.className=_.image,e.imageClass&&z(t,e.imageClass)):F(t)},re=function(i){var r=P(),a=parseInt(null===i.currentProgressStep?De.getQueueStep():i.currentProgressStep,10);i.progressSteps&&i.progressSteps.length?(K(r),r.innerHTML="",a>=i.progressSteps.length&&R("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),i.progressSteps.forEach(function(e,t){var n=document.createElement("li");if(z(n,_.progresscircle),n.innerHTML=e,t===a&&z(n,_.activeprogressstep),r.appendChild(n),t!==i.progressSteps.length-1){var o=document.createElement("li");z(o,_.progressline),i.progressStepsDistance&&(o.style.width=i.progressStepsDistance),r.appendChild(o)}})):F(r)},ae=function(e){var t=A();e.titleText?t.innerText=e.titleText:e.title&&("string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),G(e.title,t))},se=function(){null===b.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(b.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=b.previousBodyPadding+function(){if("ontouchstart"in window||navigator.msMaxTouchPoints)return 0;var e=document.createElement("div");e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}()+"px")},ce=function(){return!!window.MSInputMethodContext&&!!document.documentMode},ue=function(){var e=w(),t=k();e.style.removeProperty("align-items"),t.offsetTop<0&&(e.style.alignItems="flex-start")},le={},de=function(e,t){var n=w(),o=k();if(o){null!==e&&"function"==typeof e&&e(o),W(o,_.show),z(o,_.hide);var i=function(){M()?pe(t):(new Promise(function(e){var t=window.scrollX,n=window.scrollY;le.restoreFocusTimeout=setTimeout(function(){le.previousActiveElement&&le.previousActiveElement.focus?(le.previousActiveElement.focus(),le.previousActiveElement=null):document.body&&document.body.focus(),e()},100),void 0!==t&&void 0!==n&&window.scrollTo(t,n)}).then(function(){return pe(t)}),le.keydownTarget.removeEventListener("keydown",le.keydownHandler,{capture:le.keydownListenerCapture}),le.keydownHandlerAdded=!1),n.parentNode&&n.parentNode.removeChild(n),W([document.documentElement,document.body],[_.shown,_["height-auto"],_["no-backdrop"],_["toast-shown"],_["toast-column"]]),T()&&(null!==b.previousBodyPadding&&(document.body.style.paddingRight=b.previousBodyPadding,b.previousBodyPadding=null),function(){if(v(document.body,_.iosfix)){var e=parseInt(document.body.style.top,10);W(document.body,_.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}}(),"undefined"!=typeof window&&ce()&&window.removeEventListener("resize",ue),f(document.body.children).forEach(function(e){e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))};ee&&!v(o,_.noanimation)?o.addEventListener(ee,function e(){o.removeEventListener(ee,e),v(o,_.hide)&&i()}):i()}},pe=function(e){null!==e&&"function"==typeof e&&setTimeout(function(){e()})};function fe(e){var t=function e(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];if(!(this instanceof e))return l(e,n);Object.getPrototypeOf(e).apply(this,n)};return t.prototype=r(Object.create(e.prototype),{constructor:t}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var me={title:"",titleText:"",text:"",html:"",footer:"",type:null,toast:!1,customClass:"",customContainerClass:"",target:"body",backdrop:!0,animation:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:null,confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:null,cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:null,timer:null,width:null,padding:null,background:null,input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,validationMessage:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:null,onBeforeOpen:null,onAfterClose:null,onOpen:null,onClose:null,useRejections:!1,expectRejections:!1},he=["useRejections","expectRejections","extraParams"],ge=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],be=function(e){return me.hasOwnProperty(e)||"extraParams"===e},ve=function(e){return-1!==he.indexOf(e)},ye=function(e){for(var t in e)be(t)||R('Unknown parameter "'.concat(t,'"')),e.toast&&-1!==ge.indexOf(t)&&R('The parameter "'.concat(t,'" is incompatible with toasts')),ve(t)&&m('The parameter "'.concat(t,'" is deprecated and will be removed in the next major release.'))},we='"setDefaults" & "resetDefaults" methods are deprecated in favor of "mixin" method and will be removed in the next major release. For new projects, use "mixin". For past projects already using "setDefaults", support will be provided through an additional package.',Ce={};var ke=[],xe=function(){var e=k();e||De(""),e=k();var t=Q(),n=L(),o=O();K(t),K(n),z([e,t],_.loading),n.disabled=!0,o.disabled=!0,e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},Ae=Object.freeze({isValidParameter:be,isDeprecatedParameter:ve,argsToParams:function(n){var o={};switch(q(n[0])){case"object":r(o,n[0]);break;default:["title","html","type"].forEach(function(e,t){switch(q(n[t])){case"string":o[e]=n[t];break;case"undefined":break;default:I("Unexpected type of ".concat(e,'! Expected "string", got ').concat(q(n[t])))}})}return o},adaptInputValidator:function(n){return function(e,t){return n.call(this,e,t).then(function(){},function(e){return e})}},close:de,closePopup:de,closeModal:de,closeToast:de,isVisible:function(){return!!k()},clickConfirm:function(){return L().click()},clickCancel:function(){return O().click()},getContainer:w,getPopup:k,getTitle:A,getContent:B,getImage:S,getIcons:x,getCloseButton:$,getButtonsWrapper:function(){return m("swal.getButtonsWrapper() is deprecated and will be removed in the next major release, use swal.getActions() instead"),C(_.actions)},getActions:Q,getConfirmButton:L,getCancelButton:O,getFooter:Y,getFocusableElements:J,getValidationMessage:E,isLoading:function(){return k().hasAttribute("data-loading")},fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l(this,t)},mixin:function(n){return fe(function(e){function t(){return a(this,t),d(this,c(t).apply(this,arguments))}return s(t,e),i(t,[{key:"_main",value:function(e){return p(c(t.prototype),"_main",this).call(this,r({},n,e))}}]),t}(this))},queue:function(e){var r=this;ke=e;var a=function(){ke=[],document.body.removeAttribute("data-swal2-queue-step")},s=[];return new Promise(function(i){!function t(n,o){n<ke.length?(document.body.setAttribute("data-swal2-queue-step",n),r(ke[n]).then(function(e){void 0!==e.value?(s.push(e.value),t(n+1,o)):(a(),i({dismiss:e.dismiss}))})):(a(),i({value:s}))}(0)})},getQueueStep:function(){return document.body.getAttribute("data-swal2-queue-step")},insertQueueStep:function(e,t){return t&&t<ke.length?ke.splice(t,0,e):ke.push(e)},deleteQueueStep:function(e){void 0!==ke[e]&&ke.splice(e,1)},showLoading:xe,enableLoading:xe,getTimerLeft:function(){return le.timeout&&le.timeout.getTimerLeft()},stopTimer:function(){return le.timeout&&le.timeout.stop()},resumeTimer:function(){return le.timeout&&le.timeout.start()},toggleTimer:function(){var e=le.timeout;return e&&(e.running?e.stop():e.start())},increaseTimer:function(e){return le.timeout&&le.timeout.increase(e)},isTimerRunning:function(){return le.timeout&&le.timeout.isRunning()}}),Be="function"==typeof Symbol?Symbol:function(){var t=0;function e(e){return"__"+e+"_"+Math.floor(1e9*Math.random())+"_"+ ++t+"__"}return e.iterator=e("Symbol.iterator"),e}(),Se="function"==typeof WeakMap?WeakMap:function(n,o,t){function e(){o(this,n,{value:Be("WeakMap")})}return e.prototype={delete:function(e){delete e[this[n]]},get:function(e){return e[this[n]]},has:function(e){return t.call(e,this[n])},set:function(e,t){o(e,this[n],{configurable:!0,value:t})}},e}(Be("WeakMap"),Object.defineProperty,{}.hasOwnProperty),Pe={promise:new Se,innerParams:new Se,domCache:new Se};function Ee(){var e=Pe.innerParams.get(this),t=Pe.domCache.get(this);e.showConfirmButton||(F(t.confirmButton),e.showCancelButton||F(t.actions)),W([t.popup,t.actions],_.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.cancelButton.disabled=!1}function Le(e){var t=Pe.domCache.get(this);t.validationMessage.innerHTML=e;var n=window.getComputedStyle(t.popup);t.validationMessage.style.marginLeft="-".concat(n.getPropertyValue("padding-left")),t.validationMessage.style.marginRight="-".concat(n.getPropertyValue("padding-right")),K(t.validationMessage);var o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedBy",_["validation-message"]),N(o),z(o,_.inputerror))}function Oe(){var e=Pe.domCache.get(this);e.validationMessage&&F(e.validationMessage);var t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedBy"),W(t,_.inputerror))}var Te=function e(t,n){a(this,e);var o,i,r=n;this.running=!1,this.start=function(){return this.running||(this.running=!0,i=new Date,o=setTimeout(t,r)),r},this.stop=function(){return this.running&&(this.running=!1,clearTimeout(o),r-=new Date-i),r},this.increase=function(e){var t=this.running;return t&&this.stop(),r+=e,t&&this.start(),r},this.getTimerLeft=function(){return this.running&&(this.stop(),this.start()),r},this.isRunning=function(){return this.running},this.start()},Me={email:function(e,t){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.reject(t&&t.validationMessage?t.validationMessage:"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/.test(e)?Promise.resolve():Promise.reject(t&&t.validationMessage?t.validationMessage:"Invalid URL")}};var je=function(e){var t=w(),n=k();null!==e.onBeforeOpen&&"function"==typeof e.onBeforeOpen&&e.onBeforeOpen(n),e.animation?(z(n,_.show),z(t,_.fade),W(n,_.hide)):W(n,_.fade),K(n),t.style.overflowY="hidden",ee&&!v(n,_.noanimation)?n.addEventListener(ee,function e(){n.removeEventListener(ee,e),t.style.overflowY="auto"}):t.style.overflowY="auto",z([document.documentElement,document.body,t],_.shown),e.heightAuto&&e.backdrop&&!e.toast&&z([document.documentElement,document.body],_["height-auto"]),T()&&(se(),function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&!v(document.body,_.iosfix)){var e=document.body.scrollTop;document.body.style.top=-1*e+"px",z(document.body,_.iosfix)}}(),"undefined"!=typeof window&&ce()&&(ue(),window.addEventListener("resize",ue)),f(document.body.children).forEach(function(e){e===w()||function(e,t){if("function"==typeof e.contains)return e.contains(t)}(e,w())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),setTimeout(function(){t.scrollTop=0})),M()||le.previousActiveElement||(le.previousActiveElement=document.activeElement),null!==e.onOpen&&"function"==typeof e.onOpen&&setTimeout(function(){e.onOpen(n)})};var Ve,qe=Object.freeze({hideLoading:Ee,disableLoading:Ee,getInput:function(e){var t=Pe.innerParams.get(this),n=Pe.domCache.get(this);if(!(e=e||t.input))return null;switch(e){case"select":case"textarea":case"file":return U(n.content,_[e]);case"checkbox":return n.popup.querySelector(".".concat(_.checkbox," input"));case"radio":return n.popup.querySelector(".".concat(_.radio," input:checked"))||n.popup.querySelector(".".concat(_.radio," input:first-child"));case"range":return n.popup.querySelector(".".concat(_.range," input"));default:return U(n.content,_.input)}},enableButtons:function(){var e=Pe.domCache.get(this);e.confirmButton.disabled=!1,e.cancelButton.disabled=!1},disableButtons:function(){var e=Pe.domCache.get(this);e.confirmButton.disabled=!0,e.cancelButton.disabled=!0},enableConfirmButton:function(){Pe.domCache.get(this).confirmButton.disabled=!1},disableConfirmButton:function(){Pe.domCache.get(this).confirmButton.disabled=!0},enableInput:function(){var e=this.getInput();if(!e)return!1;if("radio"===e.type)for(var t=e.parentNode.parentNode.querySelectorAll("input"),n=0;n<t.length;n++)t[n].disabled=!1;else e.disabled=!1},disableInput:function(){var e=this.getInput();if(!e)return!1;if(e&&"radio"===e.type)for(var t=e.parentNode.parentNode.querySelectorAll("input"),n=0;n<t.length;n++)t[n].disabled=!0;else e.disabled=!0},showValidationMessage:Le,resetValidationMessage:Oe,resetValidationError:function(){m("Swal.resetValidationError() is deprecated and will be removed in the next major release, use Swal.resetValidationMessage() instead"),Oe.bind(this)()},showValidationError:function(e){m("Swal.showValidationError() is deprecated and will be removed in the next major release, use Swal.showValidationMessage() instead"),Le.bind(this)(e)},getProgressSteps:function(){return Pe.innerParams.get(this).progressSteps},setProgressSteps:function(e){var t=r({},Pe.innerParams.get(this),{progressSteps:e});Pe.innerParams.set(this,t),re(t)},showProgressSteps:function(){var e=Pe.domCache.get(this);K(e.progressSteps)},hideProgressSteps:function(){var e=Pe.domCache.get(this);F(e.progressSteps)},_main:function(e){var T=this;ye(e);var M=r({},me,e);!function(t){var e;t.inputValidator||Object.keys(Me).forEach(function(e){t.input===e&&(t.inputValidator=t.expectRejections?Me[e]:De.adaptInputValidator(Me[e]))}),t.validationMessage&&("object"!==q(t.extraParams)&&(t.extraParams={}),t.extraParams.validationMessage=t.validationMessage),(!t.target||"string"==typeof t.target&&!document.querySelector(t.target)||"string"!=typeof t.target&&!t.target.appendChild)&&(R('Target parameter is not valid, defaulting to "body"'),t.target="body"),"function"==typeof t.animation&&(t.animation=t.animation.call());var n=k(),o="string"==typeof t.target?document.querySelector(t.target):t.target;e=n&&o&&n.parentNode!==o.parentNode?X(t):n||X(t),t.width&&(e.style.width="number"==typeof t.width?t.width+"px":t.width),t.padding&&(e.style.padding="number"==typeof t.padding?t.padding+"px":t.padding),t.background&&(e.style.background=t.background);for(var i=window.getComputedStyle(e).getPropertyValue("background-color"),r=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),a=0;a<r.length;a++)r[a].style.backgroundColor=i;var s=w(),c=$(),u=Y();if(ae(t),ne(t),"string"==typeof t.backdrop?w().style.background=t.backdrop:t.backdrop||z([document.documentElement,document.body],_["no-backdrop"]),!t.backdrop&&t.allowOutsideClick&&R('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),t.position in _?z(s,_[t.position]):(R('The "position" parameter is not valid, defaulting to "center"'),z(s,_.center)),t.grow&&"string"==typeof t.grow){var l="grow-"+t.grow;l in _&&z(s,_[l])}t.showCloseButton?(c.setAttribute("aria-label",t.closeButtonAriaLabel),K(c)):F(c),e.className=_.popup,t.toast?(z([document.documentElement,document.body],_["toast-shown"]),z(e,_.toast)):z(e,_.modal),t.customClass&&z(e,t.customClass),t.customContainerClass&&z(s,t.customContainerClass),re(t),oe(t),ie(t),te(t),G(t.footer,u),!0===t.animation?W(e,_.noanimation):z(e,_.noanimation),t.showLoaderOnConfirm&&!t.preConfirm&&R("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request")}(M),Object.freeze(M),Pe.innerParams.set(this,M),le.timeout&&(le.timeout.stop(),delete le.timeout),clearTimeout(le.restoreFocusTimeout);var j={popup:k(),container:w(),content:B(),actions:Q(),confirmButton:L(),cancelButton:O(),closeButton:$(),validationMessage:E(),progressSteps:P()};Pe.domCache.set(this,j);var V=this.constructor;return new Promise(function(t,n){var o=function(e){V.closePopup(M.onClose,M.onAfterClose),M.useRejections?t(e):t({value:e})},c=function(e){V.closePopup(M.onClose,M.onAfterClose),M.useRejections?n(e):t({dismiss:e})},u=function(e){V.closePopup(M.onClose,M.onAfterClose),n(e)};M.timer&&(le.timeout=new Te(function(){c("timer"),delete le.timeout},M.timer)),M.input&&setTimeout(function(){var e=T.getInput();e&&N(e)},0);for(var l=function(t){if(M.showLoaderOnConfirm&&V.showLoading(),M.preConfirm){T.resetValidationMessage();var e=Promise.resolve().then(function(){return M.preConfirm(t,M.extraParams)});M.expectRejections?e.then(function(e){return o(e||t)},function(e){T.hideLoading(),e&&T.showValidationMessage(e)}):e.then(function(e){Z(j.validationMessage)||!1===e?T.hideLoading():o(e||t)},function(e){return u(e)})}else o(t)},e=function(e){var t=e.target,n=j.confirmButton,o=j.cancelButton,i=n&&(n===t||n.contains(t)),r=o&&(o===t||o.contains(t));switch(e.type){case"click":if(i&&V.isVisible())if(T.disableButtons(),M.input){var a=function(){var e=T.getInput();if(!e)return null;switch(M.input){case"checkbox":return e.checked?1:0;case"radio":return e.checked?e.value:null;case"file":return e.files.length?e.files[0]:null;default:return M.inputAutoTrim?e.value.trim():e.value}}();if(M.inputValidator){T.disableInput();var s=Promise.resolve().then(function(){return M.inputValidator(a,M.extraParams)});M.expectRejections?s.then(function(){T.enableButtons(),T.enableInput(),l(a)},function(e){T.enableButtons(),T.enableInput(),e&&T.showValidationMessage(e)}):s.then(function(e){T.enableButtons(),T.enableInput(),e?T.showValidationMessage(e):l(a)},function(e){return u(e)})}else T.getInput().checkValidity()?l(a):(T.enableButtons(),T.showValidationMessage(M.validationMessage))}else l(!0);else r&&V.isVisible()&&(T.disableButtons(),c(V.DismissReason.cancel))}},i=j.popup.querySelectorAll("button"),r=0;r<i.length;r++)i[r].onclick=e,i[r].onmouseover=e,i[r].onmouseout=e,i[r].onmousedown=e;if(j.closeButton.onclick=function(){c(V.DismissReason.close)},M.toast)j.popup.onclick=function(){M.showConfirmButton||M.showCancelButton||M.showCloseButton||M.input||c(V.DismissReason.close)};else{var a=!1;j.popup.onmousedown=function(){j.container.onmouseup=function(e){j.container.onmouseup=void 0,e.target===j.container&&(a=!0)}},j.container.onmousedown=function(){j.popup.onmouseup=function(e){j.popup.onmouseup=void 0,(e.target===j.popup||j.popup.contains(e.target))&&(a=!0)}},j.container.onclick=function(e){a?a=!1:e.target===j.container&&H(M.allowOutsideClick)&&c(V.DismissReason.backdrop)}}M.reverseButtons?j.confirmButton.parentNode.insertBefore(j.cancelButton,j.confirmButton):j.confirmButton.parentNode.insertBefore(j.confirmButton,j.cancelButton);var s=function(e,t){for(var n=J(M.focusCancel),o=0;o<n.length;o++)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),n[e].focus();j.popup.focus()};le.keydownHandlerAdded&&(le.keydownTarget.removeEventListener("keydown",le.keydownHandler,{capture:le.keydownListenerCapture}),le.keydownHandlerAdded=!1),M.toast||(le.keydownHandler=function(e){return function(e,t){if(t.stopKeydownPropagation&&e.stopPropagation(),"Enter"!==e.key||e.isComposing)if("Tab"===e.key){for(var n=e.target,o=J(t.focusCancel),i=-1,r=0;r<o.length;r++)if(n===o[r]){i=r;break}e.shiftKey?s(i,-1):s(i,1),e.stopPropagation(),e.preventDefault()}else-1!==["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Left","Right","Up","Down"].indexOf(e.key)?document.activeElement===j.confirmButton&&Z(j.cancelButton)?j.cancelButton.focus():document.activeElement===j.cancelButton&&Z(j.confirmButton)&&j.confirmButton.focus():"Escape"!==e.key&&"Esc"!==e.key||!0!==H(t.allowEscapeKey)||(e.preventDefault(),c(V.DismissReason.esc));else if(e.target&&T.getInput()&&e.target.outerHTML===T.getInput().outerHTML){if(-1!==["textarea","file"].indexOf(t.input))return;V.clickConfirm(),e.preventDefault()}}(e,M)},le.keydownTarget=M.keydownListenerCapture?window:j.popup,le.keydownListenerCapture=M.keydownListenerCapture,le.keydownTarget.addEventListener("keydown",le.keydownHandler,{capture:le.keydownListenerCapture}),le.keydownHandlerAdded=!0),T.enableButtons(),T.hideLoading(),T.resetValidationMessage(),M.toast&&(M.input||M.footer||M.showCloseButton)?z(document.body,_["toast-column"]):W(document.body,_["toast-column"]);for(var d,p,f=["input","file","range","select","radio","checkbox","textarea"],m=function(e){e.placeholder&&!M.inputPlaceholder||(e.placeholder=M.inputPlaceholder)},h=0;h<f.length;h++){var g=_[f[h]],b=U(j.content,g);if(d=T.getInput(f[h])){for(var v in d.attributes)if(d.attributes.hasOwnProperty(v)){var y=d.attributes[v].name;"type"!==y&&"value"!==y&&d.removeAttribute(y)}for(var w in M.inputAttributes)"range"===f[h]&&"placeholder"===w||d.setAttribute(w,M.inputAttributes[w])}b.className=g,M.inputClass&&z(b,M.inputClass),F(b)}switch(M.input){case"text":case"email":case"password":case"number":case"tel":case"url":d=U(j.content,_.input),"string"==typeof M.inputValue||"number"==typeof M.inputValue?d.value=M.inputValue:D(M.inputValue)||R('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(q(M.inputValue),'"')),m(d),d.type=M.input,K(d);break;case"file":m(d=U(j.content,_.file)),d.type=M.input,K(d);break;case"range":var C=U(j.content,_.range),k=C.querySelector("input"),x=C.querySelector("output");k.value=M.inputValue,k.type=M.input,x.value=M.inputValue,K(C);break;case"select":var A=U(j.content,_.select);if(A.innerHTML="",M.inputPlaceholder){var B=document.createElement("option");B.innerHTML=M.inputPlaceholder,B.value="",B.disabled=!0,B.selected=!0,A.appendChild(B)}p=function(e){e.forEach(function(e){var t=e[0],n=e[1],o=document.createElement("option");o.value=t,o.innerHTML=n,M.inputValue.toString()===t.toString()&&(o.selected=!0),A.appendChild(o)}),K(A),A.focus()};break;case"radio":var S=U(j.content,_.radio);S.innerHTML="",p=function(e){e.forEach(function(e){var t=e[0],n=e[1],o=document.createElement("input"),i=document.createElement("label");o.type="radio",o.name=_.radio,o.value=t,M.inputValue.toString()===t.toString()&&(o.checked=!0);var r=document.createElement("span");r.innerHTML=n,r.className=_.label,i.appendChild(o),i.appendChild(r),S.appendChild(i)}),K(S);var t=S.querySelectorAll("input");t.length&&t[0].focus()};break;case"checkbox":var P=U(j.content,_.checkbox),E=T.getInput("checkbox");E.type="checkbox",E.value=1,E.id=_.checkbox,E.checked=Boolean(M.inputValue),P.querySelector("span").innerHTML=M.inputPlaceholder,K(P);break;case"textarea":var L=U(j.content,_.textarea);L.value=M.inputValue,m(L),K(L);break;case null:break;default:I('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(M.input,'"'))}if("select"===M.input||"radio"===M.input){var O=function(e){return p((t=e,n=[],"undefined"!=typeof Map&&t instanceof Map?t.forEach(function(e,t){n.push([t,e])}):Object.keys(t).forEach(function(e){n.push([e,t[e]])}),n));var t,n};D(M.inputOptions)?(V.showLoading(),M.inputOptions.then(function(e){T.hideLoading(),O(e)})):"object"===q(M.inputOptions)?O(M.inputOptions):I("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(q(M.inputOptions)))}else-1!==["text","email","number","tel","textarea"].indexOf(M.input)&&D(M.inputValue)&&(V.showLoading(),F(d),M.inputValue.then(function(e){d.value="number"===M.input?parseFloat(e)||0:e+"",K(d),d.focus(),T.hideLoading()}).catch(function(e){I("Error in inputValue promise: "+e),d.value="",K(d),d.focus(),T.hideLoading()}));je(M),M.toast||(H(M.allowEnterKey)?M.focusCancel&&Z(j.cancelButton)?j.cancelButton.focus():M.focusConfirm&&Z(j.confirmButton)?j.confirmButton.focus():s(-1,1):document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()),j.container.scrollTop=0})}});function Re(){if("undefined"!=typeof window){"undefined"==typeof Promise&&I("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)"),Ve=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0}});var i=this._main(this.params);Pe.promise.set(this,i)}}Re.prototype.then=function(e,t){return Pe.promise.get(this).then(e,t)},Re.prototype.catch=function(e){return Pe.promise.get(this).catch(e)},Re.prototype.finally=function(e){return Pe.promise.get(this).finally(e)},r(Re.prototype,qe),r(Re,Ae),Object.keys(qe).forEach(function(t){Re[t]=function(){var e;if(Ve)return(e=Ve)[t].apply(e,arguments)}}),Re.DismissReason=e,Re.noop=function(){};var Ie,He,De=fe((Ie=Re,He=function(e){function t(){return a(this,t),d(this,c(t).apply(this,arguments))}return s(t,Ie),i(t,[{key:"_main",value:function(e){return p(c(t.prototype),"_main",this).call(this,r({},Ce,e))}}],[{key:"setDefaults",value:function(t){if(m(we),!t||"object"!==q(t))throw new TypeError("SweetAlert2: The argument for setDefaults() is required and has to be a object");ye(t),Object.keys(t).forEach(function(e){Ie.isValidParameter(e)&&(Ce[e]=t[e])})}},{key:"resetDefaults",value:function(){m(we),Ce={}}}]),t}(),"undefined"!=typeof window&&"object"===q(window._swalDefaults)&&He.setDefaults(window._swalDefaults),He));return De.default=De}),"undefined"!=typeof window&&window.Sweetalert2&&(window.Sweetalert2.version="7.33.1",window.swal=window.sweetAlert=window.Swal=window.SweetAlert=window.Sweetalert2);
|
2 |
-
"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,"@-webkit-keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-shown{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;box-shadow:0 0 .625em #d9d9d9;overflow-y:hidden}.swal2-popup.swal2-toast .swal2-header{flex-direction:row}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:initial;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon-text{font-size:2em;font-weight:700;line-height:1em}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 .0625em #fff,0 0 0 .125em rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:2em;height:2.8125em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.25em;left:-.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:2em 2em;transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;-webkit-transform-origin:0 2em;transform-origin:0 2em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:showSweetToast .5s;animation:showSweetToast .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:hideSweetToast .2s forwards;animation:hideSweetToast .2s forwards}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:animate-toast-success-tip .75s;animation:animate-toast-success-tip .75s}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:animate-toast-success-long .75s;animation:animate-toast-success-long .75s}@-webkit-keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@-webkit-keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-shown{top:auto;right:auto;bottom:auto;left:auto;background-color:transparent}body.swal2-no-backdrop .swal2-shown>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-shown.swal2-top{top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-top-left,body.swal2-no-backdrop .swal2-shown.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-top-end,body.swal2-no-backdrop .swal2-shown.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-shown.swal2-center{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-left,body.swal2-no-backdrop .swal2-shown.swal2-center-start{top:50%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-end,body.swal2-no-backdrop .swal2-shown.swal2-center-right{top:50%;right:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom-left,body.swal2-no-backdrop .swal2-shown.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-bottom-end,body.swal2-no-backdrop .swal2-shown.swal2-bottom-right{right:0;bottom:0}.swal2-container{display:flex;position:fixed;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:10px;background-color:transparent;z-index:1060;overflow-x:hidden;-webkit-overflow-scrolling:touch}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-container.swal2-fade{transition:background-color .1s}.swal2-container.swal2-shown{background-color:rgba(0,0,0,.4)}.swal2-popup{display:none;position:relative;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem;box-sizing:border-box}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-popup .swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-popup .swal2-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-popup .swal2-actions{flex-wrap:wrap;align-items:center;justify-content:center;margin:1.25em auto 0;z-index:1}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-confirm{width:2.5em;height:2.5em;margin:.46875em;padding:0;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;box-sizing:border-box;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-popup .swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{display:inline-block;width:15px;height:15px;margin-left:5px;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff;content:'';-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal}.swal2-popup .swal2-styled{margin:.3125em;padding:.625em 2em;font-weight:500;box-shadow:none}.swal2-popup .swal2-styled:not([disabled]){cursor:pointer}.swal2-popup .swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.swal2-popup .swal2-styled::-moz-focus-inner{border:0}.swal2-popup .swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-popup .swal2-image{max-width:100%;margin:1.25em auto}.swal2-popup .swal2-close{position:absolute;top:0;right:0;justify-content:center;width:1.2em;height:1.2em;padding:0;transition:color .1s ease-out;border:none;border-radius:0;outline:initial;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer;overflow:hidden}.swal2-popup .swal2-close:hover{-webkit-transform:none;transform:none;color:#f27474}.swal2-popup>.swal2-checkbox,.swal2-popup>.swal2-file,.swal2-popup>.swal2-input,.swal2-popup>.swal2-radio,.swal2-popup>.swal2-select,.swal2-popup>.swal2-textarea{display:none}.swal2-popup .swal2-content{justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:300;line-height:normal;z-index:1;word-wrap:break-word}.swal2-popup #swal2-content{text-align:center}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-radio,.swal2-popup .swal2-select,.swal2-popup .swal2-textarea{margin:1em auto}.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-textarea{width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;font-size:1.125em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);box-sizing:border-box}.swal2-popup .swal2-file.swal2-inputerror,.swal2-popup .swal2-input.swal2-inputerror,.swal2-popup .swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-popup .swal2-file:focus,.swal2-popup .swal2-input:focus,.swal2-popup .swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-popup .swal2-file::-webkit-input-placeholder,.swal2-popup .swal2-input::-webkit-input-placeholder,.swal2-popup .swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-popup .swal2-file:-ms-input-placeholder,.swal2-popup .swal2-input:-ms-input-placeholder,.swal2-popup .swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::-ms-input-placeholder,.swal2-popup .swal2-input::-ms-input-placeholder,.swal2-popup .swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::placeholder,.swal2-popup .swal2-input::placeholder,.swal2-popup .swal2-textarea::placeholder{color:#ccc}.swal2-popup .swal2-range input{width:80%}.swal2-popup .swal2-range output{width:20%;font-weight:600;text-align:center}.swal2-popup .swal2-range input,.swal2-popup .swal2-range output{height:2.625em;margin:1em auto;padding:0;font-size:1.125em;line-height:2.625em}.swal2-popup .swal2-input{height:2.625em;padding:0 .75em}.swal2-popup .swal2-input[type=number]{max-width:10em}.swal2-popup .swal2-file{font-size:1.125em}.swal2-popup .swal2-textarea{height:6.75em;padding:.75em}.swal2-popup .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;color:#545454;font-size:1.125em}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-radio{align-items:center;justify-content:center}.swal2-popup .swal2-checkbox label,.swal2-popup .swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-popup .swal2-checkbox input,.swal2-popup .swal2-radio input{margin:0 .4em}.swal2-popup .swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;overflow:hidden}.swal2-popup .swal2-validation-message::before{display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center;content:'!';zoom:normal}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}.swal2-icon{position:relative;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;line-height:5em;cursor:default;box-sizing:content-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;zoom:normal}.swal2-icon-text{font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:3.75em 3.75em;transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:0 3.75em;transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;top:-.25em;left:-.25em;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%;z-index:2;box-sizing:content-box}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;top:.5em;left:1.625em;width:.4375em;height:5.625em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);z-index:1}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;height:.3125em;border-radius:.125em;background-color:#a5dc86;z-index:2}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.875em;width:1.5625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-progresssteps{align-items:center;margin:0 0 1.25em;padding:0;font-weight:600}.swal2-progresssteps li{display:inline-block;position:relative}.swal2-progresssteps .swal2-progresscircle{width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center;z-index:20}.swal2-progresssteps .swal2-progresscircle:first-child{margin-left:0}.swal2-progresssteps .swal2-progresscircle:last-child{margin-right:0}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep{background:#3085d6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progresscircle{background:#add8e6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progressline{background:#add8e6}.swal2-progresssteps .swal2-progressline{width:2.5em;height:.4em;margin:0 -1px;background:#3085d6;z-index:10}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-show.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-hide.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-animate-success-icon .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-animate-error-icon{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-animate-error-icon .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}@-webkit-keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:initial!important}}");
|
3 |
-
/*! jquery.livequery - v1.3.6 - 2013-08-26
|
4 |
-
* Copyright (c)
|
5 |
-
* (c) 2010, Brandon Aaron (http://brandonaaron.net)
|
6 |
-
* (c) 2012 - 2013, Alexander Zaytsev (http://hazzik.ru/en)
|
7 |
-
* Dual licensed under the MIT (MIT_LICENSE.txt)
|
8 |
-
* and GPL Version 2 (GPL_LICENSE.txt) licenses.
|
9 |
-
*/
|
10 |
-
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a,b){function c(a,b,c,d){return!(a.selector!=b.selector||a.context!=b.context||c&&c.$lqguid!=b.fn.$lqguid||d&&d.$lqguid!=b.fn2.$lqguid)}a.extend(a.fn,{livequery:function(b,e){var f,g=this;return a.each(d.queries,function(a,d){return c(g,d,b,e)?(f=d)&&!1:void 0}),f=f||new d(g.selector,g.context,b,e),f.stopped=!1,f.run(),g},expire:function(b,e){var f=this;return a.each(d.queries,function(a,g){c(f,g,b,e)&&!f.stopped&&d.stop(g.id)}),f}});var d=a.livequery=function(b,c,e,f){var g=this;return g.selector=b,g.context=c,g.fn=e,g.fn2=f,g.elements=a([]),g.stopped=!1,g.id=d.queries.push(g)-1,e.$lqguid=e.$lqguid||d.guid++,f&&(f.$lqguid=f.$lqguid||d.guid++),g};d.prototype={stop:function(){var b=this;b.stopped||(b.fn2&&b.elements.each(b.fn2),b.elements=a([]),b.stopped=!0)},run:function(){var b=this;if(!b.stopped){var c=b.elements,d=a(b.selector,b.context),e=d.not(c),f=c.not(d);b.elements=d,e.each(b.fn),b.fn2&&f.each(b.fn2)}}},a.extend(d,{guid:0,queries:[],queue:[],running:!1,timeout:null,registered:[],checkQueue:function(){if(d.running&&d.queue.length)for(var a=d.queue.length;a--;)d.queries[d.queue.shift()].run()},pause:function(){d.running=!1},play:function(){d.running=!0,d.run()},registerPlugin:function(){a.each(arguments,function(b,c){if(a.fn[c]&&!(a.inArray(c,d.registered)>0)){var e=a.fn[c];a.fn[c]=function(){var a=e.apply(this,arguments);return d.run(),a},d.registered.push(c)}})},run:function(c){c!==b?a.inArray(c,d.queue)<0&&d.queue.push(c):a.each(d.queries,function(b){a.inArray(b,d.queue)<0&&d.queue.push(b)}),d.timeout&&clearTimeout(d.timeout),d.timeout=setTimeout(d.checkQueue,20)},stop:function(c){c!==b?d.queries[c].stop():a.each(d.queries,d.prototype.stop)}}),d.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html","prop","removeProp"),a(function(){d.play()})});
|
1 |
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Sweetalert2=t()}(this,function(){"use strict";function q(e){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t,n){return(l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&u(i,n.prototype),i}).apply(null,arguments)}function d(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t,n){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var o=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}var t="SweetAlert2:",f=function(e){return Array.prototype.slice.call(e)},R=function(e){console.warn("".concat(t," ").concat(e))},I=function(e){console.error("".concat(t," ").concat(e))},n=[],m=function(e){-1===n.indexOf(e)&&(n.push(e),R(e))},H=function(e){return"function"==typeof e?e():e},D=function(e){return e&&Promise.resolve(e)===e},e=Object.freeze({cancel:"cancel",backdrop:"overlay",close:"close",esc:"esc",timer:"timer"}),h=function(e){var t={};for(var n in e)t[e[n]]="swal2-"+e[n];return t},_=h(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","toast","toast-shown","toast-column","fade","show","hide","noanimation","close","title","header","content","actions","confirm","cancel","footer","icon","icon-text","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","validation-message","progresssteps","activeprogressstep","progresscircle","progressline","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl"]),g=h(["success","warning","info","question","error"]),b={previousBodyPadding:null},v=function(e,t){return e.classList.contains(t)},N=function(e){if(e.focus(),"file"!==e.type){var t=e.value;e.value="",e.value=t}},y=function(e,t,n){e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(function(t){e.forEach?e.forEach(function(e){n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)}))},z=function(e,t){y(e,t,!0)},W=function(e,t){y(e,t,!1)},U=function(e,t){for(var n=0;n<e.childNodes.length;n++)if(v(e.childNodes[n],t))return e.childNodes[n]},K=function(e){e.style.opacity="",e.style.display=e.id===_.content?"block":"flex"},F=function(e){e.style.opacity="",e.style.display="none"},Z=function(e){return e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w=function(){return document.body.querySelector("."+_.container)},C=function(e){var t=w();return t?t.querySelector("."+e):null},k=function(){return C(_.popup)},x=function(){var e=k();return f(e.querySelectorAll("."+_.icon))},A=function(){return C(_.title)},B=function(){return C(_.content)},S=function(){return C(_.image)},P=function(){return C(_.progresssteps)},E=function(){return C(_["validation-message"])},L=function(){return C(_.confirm)},O=function(){return C(_.cancel)},Q=function(){return C(_.actions)},Y=function(){return C(_.footer)},$=function(){return C(_.close)},J=function(){var e=f(k().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(e,t){return e=parseInt(e.getAttribute("tabindex")),(t=parseInt(t.getAttribute("tabindex")))<e?1:e<t?-1:0}),t=f(k().querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls]')).filter(function(e){return"-1"!==e.getAttribute("tabindex")});return function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(e.concat(t)).filter(function(e){return Z(e)})},T=function(){return!M()&&!document.body.classList.contains(_["no-backdrop"])},M=function(){return document.body.classList.contains(_["toast-shown"])},j=function(){return"undefined"==typeof window||"undefined"==typeof document},V='\n <div aria-labelledby="'.concat(_.title,'" aria-describedby="').concat(_.content,'" class="').concat(_.popup,'" tabindex="-1">\n <div class="').concat(_.header,'">\n <ul class="').concat(_.progresssteps,'"></ul>\n <div class="').concat(_.icon," ").concat(g.error,'">\n <span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>\n </div>\n <div class="').concat(_.icon," ").concat(g.question,'">\n <span class="').concat(_["icon-text"],'">?</span>\n </div>\n <div class="').concat(_.icon," ").concat(g.warning,'">\n <span class="').concat(_["icon-text"],'">!</span>\n </div>\n <div class="').concat(_.icon," ").concat(g.info,'">\n <span class="').concat(_["icon-text"],'">i</span>\n </div>\n <div class="').concat(_.icon," ").concat(g.success,'">\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n </div>\n <img class="').concat(_.image,'" />\n <h2 class="').concat(_.title,'" id="').concat(_.title,'"></h2>\n <button type="button" class="').concat(_.close,'">×</button>\n </div>\n <div class="').concat(_.content,'">\n <div id="').concat(_.content,'"></div>\n <input class="').concat(_.input,'" />\n <input type="file" class="').concat(_.file,'" />\n <div class="').concat(_.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(_.select,'"></select>\n <div class="').concat(_.radio,'"></div>\n <label for="').concat(_.checkbox,'" class="').concat(_.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(_.label,'"></span>\n </label>\n <textarea class="').concat(_.textarea,'"></textarea>\n <div class="').concat(_["validation-message"],'" id="').concat(_["validation-message"],'"></div>\n </div>\n <div class="').concat(_.actions,'">\n <button type="button" class="').concat(_.confirm,'">OK</button>\n <button type="button" class="').concat(_.cancel,'">Cancel</button>\n </div>\n <div class="').concat(_.footer,'">\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),X=function(e){var t=w();if(t&&(t.parentNode.removeChild(t),W([document.documentElement,document.body],[_["no-backdrop"],_["toast-shown"],_["has-column"]])),!j()){var n=document.createElement("div");n.className=_.container,n.innerHTML=V;var o="string"==typeof e.target?document.querySelector(e.target):e.target;o.appendChild(n);var i,r=k(),a=B(),s=U(a,_.input),c=U(a,_.file),u=a.querySelector(".".concat(_.range," input")),l=a.querySelector(".".concat(_.range," output")),d=U(a,_.select),p=a.querySelector(".".concat(_.checkbox," input")),f=U(a,_.textarea);r.setAttribute("role",e.toast?"alert":"dialog"),r.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||r.setAttribute("aria-modal","true"),"rtl"===window.getComputedStyle(o).direction&&z(w(),_.rtl);var m=function(e){De.isVisible()&&i!==e.target.value&&De.resetValidationMessage(),i=e.target.value};return s.oninput=m,c.onchange=m,d.onchange=m,p.onchange=m,f.oninput=m,u.oninput=function(e){m(e),l.value=u.value},u.onchange=function(e){m(e),u.nextSibling.value=u.value},r}I("SweetAlert2 requires document to initialize")},G=function(e,t){if(!e)return F(t);if(e instanceof HTMLElement)t.appendChild(e);else if("object"===q(e))if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0));else e&&(t.innerHTML=e);K(t)},ee=function(){if(j())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in t)if(t.hasOwnProperty(n)&&void 0!==e.style[n])return t[n];return!1}(),te=function(e){var t=Q(),n=L(),o=O();if(e.showConfirmButton||e.showCancelButton?K(t):F(t),e.showCancelButton?o.style.display="inline-block":F(o),e.showConfirmButton?n.style.removeProperty("display"):F(n),n.innerHTML=e.confirmButtonText,o.innerHTML=e.cancelButtonText,n.setAttribute("aria-label",e.confirmButtonAriaLabel),o.setAttribute("aria-label",e.cancelButtonAriaLabel),n.className=_.confirm,z(n,e.confirmButtonClass),o.className=_.cancel,z(o,e.cancelButtonClass),e.buttonsStyling){z([n,o],_.styled),e.confirmButtonColor&&(n.style.backgroundColor=e.confirmButtonColor),e.cancelButtonColor&&(o.style.backgroundColor=e.cancelButtonColor);var i=window.getComputedStyle(n).getPropertyValue("background-color");n.style.borderLeftColor=i,n.style.borderRightColor=i}else W([n,o],_.styled),n.style.backgroundColor=n.style.borderLeftColor=n.style.borderRightColor="",o.style.backgroundColor=o.style.borderLeftColor=o.style.borderRightColor=""},ne=function(e){var t=B().querySelector("#"+_.content);e.html?G(e.html,t):e.text?(t.textContent=e.text,K(t)):F(t)},oe=function(e){for(var t=x(),n=0;n<t.length;n++)F(t[n]);if(e.type)if(-1!==Object.keys(g).indexOf(e.type)){var o=De.getPopup().querySelector(".".concat(_.icon,".").concat(g[e.type]));K(o),e.animation&&z(o,"swal2-animate-".concat(e.type,"-icon"))}else I('Unknown type! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.type,'"'))},ie=function(e){var t=S();e.imageUrl?(t.setAttribute("src",e.imageUrl),t.setAttribute("alt",e.imageAlt),K(t),e.imageWidth?t.setAttribute("width",e.imageWidth):t.removeAttribute("width"),e.imageHeight?t.setAttribute("height",e.imageHeight):t.removeAttribute("height"),t.className=_.image,e.imageClass&&z(t,e.imageClass)):F(t)},re=function(i){var r=P(),a=parseInt(null===i.currentProgressStep?De.getQueueStep():i.currentProgressStep,10);i.progressSteps&&i.progressSteps.length?(K(r),r.innerHTML="",a>=i.progressSteps.length&&R("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),i.progressSteps.forEach(function(e,t){var n=document.createElement("li");if(z(n,_.progresscircle),n.innerHTML=e,t===a&&z(n,_.activeprogressstep),r.appendChild(n),t!==i.progressSteps.length-1){var o=document.createElement("li");z(o,_.progressline),i.progressStepsDistance&&(o.style.width=i.progressStepsDistance),r.appendChild(o)}})):F(r)},ae=function(e){var t=A();e.titleText?t.innerText=e.titleText:e.title&&("string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),G(e.title,t))},se=function(){null===b.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(b.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=b.previousBodyPadding+function(){if("ontouchstart"in window||navigator.msMaxTouchPoints)return 0;var e=document.createElement("div");e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}()+"px")},ce=function(){return!!window.MSInputMethodContext&&!!document.documentMode},ue=function(){var e=w(),t=k();e.style.removeProperty("align-items"),t.offsetTop<0&&(e.style.alignItems="flex-start")},le={},de=function(e,t){var n=w(),o=k();if(o){null!==e&&"function"==typeof e&&e(o),W(o,_.show),z(o,_.hide);var i=function(){M()?pe(t):(new Promise(function(e){var t=window.scrollX,n=window.scrollY;le.restoreFocusTimeout=setTimeout(function(){le.previousActiveElement&&le.previousActiveElement.focus?(le.previousActiveElement.focus(),le.previousActiveElement=null):document.body&&document.body.focus(),e()},100),void 0!==t&&void 0!==n&&window.scrollTo(t,n)}).then(function(){return pe(t)}),le.keydownTarget.removeEventListener("keydown",le.keydownHandler,{capture:le.keydownListenerCapture}),le.keydownHandlerAdded=!1),n.parentNode&&n.parentNode.removeChild(n),W([document.documentElement,document.body],[_.shown,_["height-auto"],_["no-backdrop"],_["toast-shown"],_["toast-column"]]),T()&&(null!==b.previousBodyPadding&&(document.body.style.paddingRight=b.previousBodyPadding,b.previousBodyPadding=null),function(){if(v(document.body,_.iosfix)){var e=parseInt(document.body.style.top,10);W(document.body,_.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}}(),"undefined"!=typeof window&&ce()&&window.removeEventListener("resize",ue),f(document.body.children).forEach(function(e){e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))};ee&&!v(o,_.noanimation)?o.addEventListener(ee,function e(){o.removeEventListener(ee,e),v(o,_.hide)&&i()}):i()}},pe=function(e){null!==e&&"function"==typeof e&&setTimeout(function(){e()})};function fe(e){var t=function e(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];if(!(this instanceof e))return l(e,n);Object.getPrototypeOf(e).apply(this,n)};return t.prototype=r(Object.create(e.prototype),{constructor:t}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var me={title:"",titleText:"",text:"",html:"",footer:"",type:null,toast:!1,customClass:"",customContainerClass:"",target:"body",backdrop:!0,animation:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:null,confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:null,cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:null,timer:null,width:null,padding:null,background:null,input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,validationMessage:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:null,onBeforeOpen:null,onAfterClose:null,onOpen:null,onClose:null,useRejections:!1,expectRejections:!1},he=["useRejections","expectRejections","extraParams"],ge=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],be=function(e){return me.hasOwnProperty(e)||"extraParams"===e},ve=function(e){return-1!==he.indexOf(e)},ye=function(e){for(var t in e)be(t)||R('Unknown parameter "'.concat(t,'"')),e.toast&&-1!==ge.indexOf(t)&&R('The parameter "'.concat(t,'" is incompatible with toasts')),ve(t)&&m('The parameter "'.concat(t,'" is deprecated and will be removed in the next major release.'))},we='"setDefaults" & "resetDefaults" methods are deprecated in favor of "mixin" method and will be removed in the next major release. For new projects, use "mixin". For past projects already using "setDefaults", support will be provided through an additional package.',Ce={};var ke=[],xe=function(){var e=k();e||De(""),e=k();var t=Q(),n=L(),o=O();K(t),K(n),z([e,t],_.loading),n.disabled=!0,o.disabled=!0,e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},Ae=Object.freeze({isValidParameter:be,isDeprecatedParameter:ve,argsToParams:function(n){var o={};switch(q(n[0])){case"object":r(o,n[0]);break;default:["title","html","type"].forEach(function(e,t){switch(q(n[t])){case"string":o[e]=n[t];break;case"undefined":break;default:I("Unexpected type of ".concat(e,'! Expected "string", got ').concat(q(n[t])))}})}return o},adaptInputValidator:function(n){return function(e,t){return n.call(this,e,t).then(function(){},function(e){return e})}},close:de,closePopup:de,closeModal:de,closeToast:de,isVisible:function(){return!!k()},clickConfirm:function(){return L().click()},clickCancel:function(){return O().click()},getContainer:w,getPopup:k,getTitle:A,getContent:B,getImage:S,getIcons:x,getCloseButton:$,getButtonsWrapper:function(){return m("swal.getButtonsWrapper() is deprecated and will be removed in the next major release, use swal.getActions() instead"),C(_.actions)},getActions:Q,getConfirmButton:L,getCancelButton:O,getFooter:Y,getFocusableElements:J,getValidationMessage:E,isLoading:function(){return k().hasAttribute("data-loading")},fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l(this,t)},mixin:function(n){return fe(function(e){function t(){return a(this,t),d(this,c(t).apply(this,arguments))}return s(t,e),i(t,[{key:"_main",value:function(e){return p(c(t.prototype),"_main",this).call(this,r({},n,e))}}]),t}(this))},queue:function(e){var r=this;ke=e;var a=function(){ke=[],document.body.removeAttribute("data-swal2-queue-step")},s=[];return new Promise(function(i){!function t(n,o){n<ke.length?(document.body.setAttribute("data-swal2-queue-step",n),r(ke[n]).then(function(e){void 0!==e.value?(s.push(e.value),t(n+1,o)):(a(),i({dismiss:e.dismiss}))})):(a(),i({value:s}))}(0)})},getQueueStep:function(){return document.body.getAttribute("data-swal2-queue-step")},insertQueueStep:function(e,t){return t&&t<ke.length?ke.splice(t,0,e):ke.push(e)},deleteQueueStep:function(e){void 0!==ke[e]&&ke.splice(e,1)},showLoading:xe,enableLoading:xe,getTimerLeft:function(){return le.timeout&&le.timeout.getTimerLeft()},stopTimer:function(){return le.timeout&&le.timeout.stop()},resumeTimer:function(){return le.timeout&&le.timeout.start()},toggleTimer:function(){var e=le.timeout;return e&&(e.running?e.stop():e.start())},increaseTimer:function(e){return le.timeout&&le.timeout.increase(e)},isTimerRunning:function(){return le.timeout&&le.timeout.isRunning()}}),Be="function"==typeof Symbol?Symbol:function(){var t=0;function e(e){return"__"+e+"_"+Math.floor(1e9*Math.random())+"_"+ ++t+"__"}return e.iterator=e("Symbol.iterator"),e}(),Se="function"==typeof WeakMap?WeakMap:function(n,o,t){function e(){o(this,n,{value:Be("WeakMap")})}return e.prototype={delete:function(e){delete e[this[n]]},get:function(e){return e[this[n]]},has:function(e){return t.call(e,this[n])},set:function(e,t){o(e,this[n],{configurable:!0,value:t})}},e}(Be("WeakMap"),Object.defineProperty,{}.hasOwnProperty),Pe={promise:new Se,innerParams:new Se,domCache:new Se};function Ee(){var e=Pe.innerParams.get(this),t=Pe.domCache.get(this);e.showConfirmButton||(F(t.confirmButton),e.showCancelButton||F(t.actions)),W([t.popup,t.actions],_.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.cancelButton.disabled=!1}function Le(e){var t=Pe.domCache.get(this);t.validationMessage.innerHTML=e;var n=window.getComputedStyle(t.popup);t.validationMessage.style.marginLeft="-".concat(n.getPropertyValue("padding-left")),t.validationMessage.style.marginRight="-".concat(n.getPropertyValue("padding-right")),K(t.validationMessage);var o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedBy",_["validation-message"]),N(o),z(o,_.inputerror))}function Oe(){var e=Pe.domCache.get(this);e.validationMessage&&F(e.validationMessage);var t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedBy"),W(t,_.inputerror))}var Te=function e(t,n){a(this,e);var o,i,r=n;this.running=!1,this.start=function(){return this.running||(this.running=!0,i=new Date,o=setTimeout(t,r)),r},this.stop=function(){return this.running&&(this.running=!1,clearTimeout(o),r-=new Date-i),r},this.increase=function(e){var t=this.running;return t&&this.stop(),r+=e,t&&this.start(),r},this.getTimerLeft=function(){return this.running&&(this.stop(),this.start()),r},this.isRunning=function(){return this.running},this.start()},Me={email:function(e,t){return/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.reject(t&&t.validationMessage?t.validationMessage:"Invalid email address")},url:function(e,t){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/.test(e)?Promise.resolve():Promise.reject(t&&t.validationMessage?t.validationMessage:"Invalid URL")}};var je=function(e){var t=w(),n=k();null!==e.onBeforeOpen&&"function"==typeof e.onBeforeOpen&&e.onBeforeOpen(n),e.animation?(z(n,_.show),z(t,_.fade),W(n,_.hide)):W(n,_.fade),K(n),t.style.overflowY="hidden",ee&&!v(n,_.noanimation)?n.addEventListener(ee,function e(){n.removeEventListener(ee,e),t.style.overflowY="auto"}):t.style.overflowY="auto",z([document.documentElement,document.body,t],_.shown),e.heightAuto&&e.backdrop&&!e.toast&&z([document.documentElement,document.body],_["height-auto"]),T()&&(se(),function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&!v(document.body,_.iosfix)){var e=document.body.scrollTop;document.body.style.top=-1*e+"px",z(document.body,_.iosfix)}}(),"undefined"!=typeof window&&ce()&&(ue(),window.addEventListener("resize",ue)),f(document.body.children).forEach(function(e){e===w()||function(e,t){if("function"==typeof e.contains)return e.contains(t)}(e,w())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}),setTimeout(function(){t.scrollTop=0})),M()||le.previousActiveElement||(le.previousActiveElement=document.activeElement),null!==e.onOpen&&"function"==typeof e.onOpen&&setTimeout(function(){e.onOpen(n)})};var Ve,qe=Object.freeze({hideLoading:Ee,disableLoading:Ee,getInput:function(e){var t=Pe.innerParams.get(this),n=Pe.domCache.get(this);if(!(e=e||t.input))return null;switch(e){case"select":case"textarea":case"file":return U(n.content,_[e]);case"checkbox":return n.popup.querySelector(".".concat(_.checkbox," input"));case"radio":return n.popup.querySelector(".".concat(_.radio," input:checked"))||n.popup.querySelector(".".concat(_.radio," input:first-child"));case"range":return n.popup.querySelector(".".concat(_.range," input"));default:return U(n.content,_.input)}},enableButtons:function(){var e=Pe.domCache.get(this);e.confirmButton.disabled=!1,e.cancelButton.disabled=!1},disableButtons:function(){var e=Pe.domCache.get(this);e.confirmButton.disabled=!0,e.cancelButton.disabled=!0},enableConfirmButton:function(){Pe.domCache.get(this).confirmButton.disabled=!1},disableConfirmButton:function(){Pe.domCache.get(this).confirmButton.disabled=!0},enableInput:function(){var e=this.getInput();if(!e)return!1;if("radio"===e.type)for(var t=e.parentNode.parentNode.querySelectorAll("input"),n=0;n<t.length;n++)t[n].disabled=!1;else e.disabled=!1},disableInput:function(){var e=this.getInput();if(!e)return!1;if(e&&"radio"===e.type)for(var t=e.parentNode.parentNode.querySelectorAll("input"),n=0;n<t.length;n++)t[n].disabled=!0;else e.disabled=!0},showValidationMessage:Le,resetValidationMessage:Oe,resetValidationError:function(){m("Swal.resetValidationError() is deprecated and will be removed in the next major release, use Swal.resetValidationMessage() instead"),Oe.bind(this)()},showValidationError:function(e){m("Swal.showValidationError() is deprecated and will be removed in the next major release, use Swal.showValidationMessage() instead"),Le.bind(this)(e)},getProgressSteps:function(){return Pe.innerParams.get(this).progressSteps},setProgressSteps:function(e){var t=r({},Pe.innerParams.get(this),{progressSteps:e});Pe.innerParams.set(this,t),re(t)},showProgressSteps:function(){var e=Pe.domCache.get(this);K(e.progressSteps)},hideProgressSteps:function(){var e=Pe.domCache.get(this);F(e.progressSteps)},_main:function(e){var T=this;ye(e);var M=r({},me,e);!function(t){var e;t.inputValidator||Object.keys(Me).forEach(function(e){t.input===e&&(t.inputValidator=t.expectRejections?Me[e]:De.adaptInputValidator(Me[e]))}),t.validationMessage&&("object"!==q(t.extraParams)&&(t.extraParams={}),t.extraParams.validationMessage=t.validationMessage),(!t.target||"string"==typeof t.target&&!document.querySelector(t.target)||"string"!=typeof t.target&&!t.target.appendChild)&&(R('Target parameter is not valid, defaulting to "body"'),t.target="body"),"function"==typeof t.animation&&(t.animation=t.animation.call());var n=k(),o="string"==typeof t.target?document.querySelector(t.target):t.target;e=n&&o&&n.parentNode!==o.parentNode?X(t):n||X(t),t.width&&(e.style.width="number"==typeof t.width?t.width+"px":t.width),t.padding&&(e.style.padding="number"==typeof t.padding?t.padding+"px":t.padding),t.background&&(e.style.background=t.background);for(var i=window.getComputedStyle(e).getPropertyValue("background-color"),r=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"),a=0;a<r.length;a++)r[a].style.backgroundColor=i;var s=w(),c=$(),u=Y();if(ae(t),ne(t),"string"==typeof t.backdrop?w().style.background=t.backdrop:t.backdrop||z([document.documentElement,document.body],_["no-backdrop"]),!t.backdrop&&t.allowOutsideClick&&R('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),t.position in _?z(s,_[t.position]):(R('The "position" parameter is not valid, defaulting to "center"'),z(s,_.center)),t.grow&&"string"==typeof t.grow){var l="grow-"+t.grow;l in _&&z(s,_[l])}t.showCloseButton?(c.setAttribute("aria-label",t.closeButtonAriaLabel),K(c)):F(c),e.className=_.popup,t.toast?(z([document.documentElement,document.body],_["toast-shown"]),z(e,_.toast)):z(e,_.modal),t.customClass&&z(e,t.customClass),t.customContainerClass&&z(s,t.customContainerClass),re(t),oe(t),ie(t),te(t),G(t.footer,u),!0===t.animation?W(e,_.noanimation):z(e,_.noanimation),t.showLoaderOnConfirm&&!t.preConfirm&&R("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request")}(M),Object.freeze(M),Pe.innerParams.set(this,M),le.timeout&&(le.timeout.stop(),delete le.timeout),clearTimeout(le.restoreFocusTimeout);var j={popup:k(),container:w(),content:B(),actions:Q(),confirmButton:L(),cancelButton:O(),closeButton:$(),validationMessage:E(),progressSteps:P()};Pe.domCache.set(this,j);var V=this.constructor;return new Promise(function(t,n){var o=function(e){V.closePopup(M.onClose,M.onAfterClose),M.useRejections?t(e):t({value:e})},c=function(e){V.closePopup(M.onClose,M.onAfterClose),M.useRejections?n(e):t({dismiss:e})},u=function(e){V.closePopup(M.onClose,M.onAfterClose),n(e)};M.timer&&(le.timeout=new Te(function(){c("timer"),delete le.timeout},M.timer)),M.input&&setTimeout(function(){var e=T.getInput();e&&N(e)},0);for(var l=function(t){if(M.showLoaderOnConfirm&&V.showLoading(),M.preConfirm){T.resetValidationMessage();var e=Promise.resolve().then(function(){return M.preConfirm(t,M.extraParams)});M.expectRejections?e.then(function(e){return o(e||t)},function(e){T.hideLoading(),e&&T.showValidationMessage(e)}):e.then(function(e){Z(j.validationMessage)||!1===e?T.hideLoading():o(e||t)},function(e){return u(e)})}else o(t)},e=function(e){var t=e.target,n=j.confirmButton,o=j.cancelButton,i=n&&(n===t||n.contains(t)),r=o&&(o===t||o.contains(t));switch(e.type){case"click":if(i&&V.isVisible())if(T.disableButtons(),M.input){var a=function(){var e=T.getInput();if(!e)return null;switch(M.input){case"checkbox":return e.checked?1:0;case"radio":return e.checked?e.value:null;case"file":return e.files.length?e.files[0]:null;default:return M.inputAutoTrim?e.value.trim():e.value}}();if(M.inputValidator){T.disableInput();var s=Promise.resolve().then(function(){return M.inputValidator(a,M.extraParams)});M.expectRejections?s.then(function(){T.enableButtons(),T.enableInput(),l(a)},function(e){T.enableButtons(),T.enableInput(),e&&T.showValidationMessage(e)}):s.then(function(e){T.enableButtons(),T.enableInput(),e?T.showValidationMessage(e):l(a)},function(e){return u(e)})}else T.getInput().checkValidity()?l(a):(T.enableButtons(),T.showValidationMessage(M.validationMessage))}else l(!0);else r&&V.isVisible()&&(T.disableButtons(),c(V.DismissReason.cancel))}},i=j.popup.querySelectorAll("button"),r=0;r<i.length;r++)i[r].onclick=e,i[r].onmouseover=e,i[r].onmouseout=e,i[r].onmousedown=e;if(j.closeButton.onclick=function(){c(V.DismissReason.close)},M.toast)j.popup.onclick=function(){M.showConfirmButton||M.showCancelButton||M.showCloseButton||M.input||c(V.DismissReason.close)};else{var a=!1;j.popup.onmousedown=function(){j.container.onmouseup=function(e){j.container.onmouseup=void 0,e.target===j.container&&(a=!0)}},j.container.onmousedown=function(){j.popup.onmouseup=function(e){j.popup.onmouseup=void 0,(e.target===j.popup||j.popup.contains(e.target))&&(a=!0)}},j.container.onclick=function(e){a?a=!1:e.target===j.container&&H(M.allowOutsideClick)&&c(V.DismissReason.backdrop)}}M.reverseButtons?j.confirmButton.parentNode.insertBefore(j.cancelButton,j.confirmButton):j.confirmButton.parentNode.insertBefore(j.confirmButton,j.cancelButton);var s=function(e,t){for(var n=J(M.focusCancel),o=0;o<n.length;o++)return(e+=t)===n.length?e=0:-1===e&&(e=n.length-1),n[e].focus();j.popup.focus()};le.keydownHandlerAdded&&(le.keydownTarget.removeEventListener("keydown",le.keydownHandler,{capture:le.keydownListenerCapture}),le.keydownHandlerAdded=!1),M.toast||(le.keydownHandler=function(e){return function(e,t){if(t.stopKeydownPropagation&&e.stopPropagation(),"Enter"!==e.key||e.isComposing)if("Tab"===e.key){for(var n=e.target,o=J(t.focusCancel),i=-1,r=0;r<o.length;r++)if(n===o[r]){i=r;break}e.shiftKey?s(i,-1):s(i,1),e.stopPropagation(),e.preventDefault()}else-1!==["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Left","Right","Up","Down"].indexOf(e.key)?document.activeElement===j.confirmButton&&Z(j.cancelButton)?j.cancelButton.focus():document.activeElement===j.cancelButton&&Z(j.confirmButton)&&j.confirmButton.focus():"Escape"!==e.key&&"Esc"!==e.key||!0!==H(t.allowEscapeKey)||(e.preventDefault(),c(V.DismissReason.esc));else if(e.target&&T.getInput()&&e.target.outerHTML===T.getInput().outerHTML){if(-1!==["textarea","file"].indexOf(t.input))return;V.clickConfirm(),e.preventDefault()}}(e,M)},le.keydownTarget=M.keydownListenerCapture?window:j.popup,le.keydownListenerCapture=M.keydownListenerCapture,le.keydownTarget.addEventListener("keydown",le.keydownHandler,{capture:le.keydownListenerCapture}),le.keydownHandlerAdded=!0),T.enableButtons(),T.hideLoading(),T.resetValidationMessage(),M.toast&&(M.input||M.footer||M.showCloseButton)?z(document.body,_["toast-column"]):W(document.body,_["toast-column"]);for(var d,p,f=["input","file","range","select","radio","checkbox","textarea"],m=function(e){e.placeholder&&!M.inputPlaceholder||(e.placeholder=M.inputPlaceholder)},h=0;h<f.length;h++){var g=_[f[h]],b=U(j.content,g);if(d=T.getInput(f[h])){for(var v in d.attributes)if(d.attributes.hasOwnProperty(v)){var y=d.attributes[v].name;"type"!==y&&"value"!==y&&d.removeAttribute(y)}for(var w in M.inputAttributes)"range"===f[h]&&"placeholder"===w||d.setAttribute(w,M.inputAttributes[w])}b.className=g,M.inputClass&&z(b,M.inputClass),F(b)}switch(M.input){case"text":case"email":case"password":case"number":case"tel":case"url":d=U(j.content,_.input),"string"==typeof M.inputValue||"number"==typeof M.inputValue?d.value=M.inputValue:D(M.inputValue)||R('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(q(M.inputValue),'"')),m(d),d.type=M.input,K(d);break;case"file":m(d=U(j.content,_.file)),d.type=M.input,K(d);break;case"range":var C=U(j.content,_.range),k=C.querySelector("input"),x=C.querySelector("output");k.value=M.inputValue,k.type=M.input,x.value=M.inputValue,K(C);break;case"select":var A=U(j.content,_.select);if(A.innerHTML="",M.inputPlaceholder){var B=document.createElement("option");B.innerHTML=M.inputPlaceholder,B.value="",B.disabled=!0,B.selected=!0,A.appendChild(B)}p=function(e){e.forEach(function(e){var t=e[0],n=e[1],o=document.createElement("option");o.value=t,o.innerHTML=n,M.inputValue.toString()===t.toString()&&(o.selected=!0),A.appendChild(o)}),K(A),A.focus()};break;case"radio":var S=U(j.content,_.radio);S.innerHTML="",p=function(e){e.forEach(function(e){var t=e[0],n=e[1],o=document.createElement("input"),i=document.createElement("label");o.type="radio",o.name=_.radio,o.value=t,M.inputValue.toString()===t.toString()&&(o.checked=!0);var r=document.createElement("span");r.innerHTML=n,r.className=_.label,i.appendChild(o),i.appendChild(r),S.appendChild(i)}),K(S);var t=S.querySelectorAll("input");t.length&&t[0].focus()};break;case"checkbox":var P=U(j.content,_.checkbox),E=T.getInput("checkbox");E.type="checkbox",E.value=1,E.id=_.checkbox,E.checked=Boolean(M.inputValue),P.querySelector("span").innerHTML=M.inputPlaceholder,K(P);break;case"textarea":var L=U(j.content,_.textarea);L.value=M.inputValue,m(L),K(L);break;case null:break;default:I('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(M.input,'"'))}if("select"===M.input||"radio"===M.input){var O=function(e){return p((t=e,n=[],"undefined"!=typeof Map&&t instanceof Map?t.forEach(function(e,t){n.push([t,e])}):Object.keys(t).forEach(function(e){n.push([e,t[e]])}),n));var t,n};D(M.inputOptions)?(V.showLoading(),M.inputOptions.then(function(e){T.hideLoading(),O(e)})):"object"===q(M.inputOptions)?O(M.inputOptions):I("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(q(M.inputOptions)))}else-1!==["text","email","number","tel","textarea"].indexOf(M.input)&&D(M.inputValue)&&(V.showLoading(),F(d),M.inputValue.then(function(e){d.value="number"===M.input?parseFloat(e)||0:e+"",K(d),d.focus(),T.hideLoading()}).catch(function(e){I("Error in inputValue promise: "+e),d.value="",K(d),d.focus(),T.hideLoading()}));je(M),M.toast||(H(M.allowEnterKey)?M.focusCancel&&Z(j.cancelButton)?j.cancelButton.focus():M.focusConfirm&&Z(j.confirmButton)?j.confirmButton.focus():s(-1,1):document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()),j.container.scrollTop=0})}});function Re(){if("undefined"!=typeof window){"undefined"==typeof Promise&&I("This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)"),Ve=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0}});var i=this._main(this.params);Pe.promise.set(this,i)}}Re.prototype.then=function(e,t){return Pe.promise.get(this).then(e,t)},Re.prototype.catch=function(e){return Pe.promise.get(this).catch(e)},Re.prototype.finally=function(e){return Pe.promise.get(this).finally(e)},r(Re.prototype,qe),r(Re,Ae),Object.keys(qe).forEach(function(t){Re[t]=function(){var e;if(Ve)return(e=Ve)[t].apply(e,arguments)}}),Re.DismissReason=e,Re.noop=function(){};var Ie,He,De=fe((Ie=Re,He=function(e){function t(){return a(this,t),d(this,c(t).apply(this,arguments))}return s(t,Ie),i(t,[{key:"_main",value:function(e){return p(c(t.prototype),"_main",this).call(this,r({},Ce,e))}}],[{key:"setDefaults",value:function(t){if(m(we),!t||"object"!==q(t))throw new TypeError("SweetAlert2: The argument for setDefaults() is required and has to be a object");ye(t),Object.keys(t).forEach(function(e){Ie.isValidParameter(e)&&(Ce[e]=t[e])})}},{key:"resetDefaults",value:function(){m(we),Ce={}}}]),t}(),"undefined"!=typeof window&&"object"===q(window._swalDefaults)&&He.setDefaults(window._swalDefaults),He));return De.default=De}),"undefined"!=typeof window&&window.Sweetalert2&&(window.Sweetalert2.version="7.33.1",window.swal=window.sweetAlert=window.Swal=window.SweetAlert=window.Sweetalert2);
|
2 |
+
"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,"@-webkit-keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes swal2-show{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}50%{margin-top:1.625em;-webkit-transform:scale(.4);transform:scale(.4);opacity:0}80%{margin-top:-.375em;-webkit-transform:scale(1.15);transform:scale(1.15)}100%{margin-top:0;-webkit-transform:scale(1);transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-shown{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;box-shadow:0 0 .625em #d9d9d9;overflow-y:hidden}.swal2-popup.swal2-toast .swal2-header{flex-direction:row}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:initial;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon-text{font-size:2em;font-weight:700;line-height:1em}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 .0625em #fff,0 0 0 .125em rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:2em;height:2.8125em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.25em;left:-.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:2em 2em;transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;-webkit-transform-origin:0 2em;transform-origin:0 2em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:showSweetToast .5s;animation:showSweetToast .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:hideSweetToast .2s forwards;animation:hideSweetToast .2s forwards}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:animate-toast-success-tip .75s;animation:animate-toast-success-tip .75s}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:animate-toast-success-long .75s;animation:animate-toast-success-long .75s}@-webkit-keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@keyframes showSweetToast{0%{-webkit-transform:translateY(-.625em) rotateZ(2deg);transform:translateY(-.625em) rotateZ(2deg);opacity:0}33%{-webkit-transform:translateY(0) rotateZ(-2deg);transform:translateY(0) rotateZ(-2deg);opacity:.5}66%{-webkit-transform:translateY(.3125em) rotateZ(2deg);transform:translateY(.3125em) rotateZ(2deg);opacity:.7}100%{-webkit-transform:translateY(0) rotateZ(0);transform:translateY(0) rotateZ(0);opacity:1}}@-webkit-keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@keyframes hideSweetToast{0%{opacity:1}33%{opacity:.5}100%{-webkit-transform:rotateZ(1deg);transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes animate-toast-success-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes animate-toast-success-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-shown{top:auto;right:auto;bottom:auto;left:auto;background-color:transparent}body.swal2-no-backdrop .swal2-shown>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-shown.swal2-top{top:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-top-left,body.swal2-no-backdrop .swal2-shown.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-top-end,body.swal2-no-backdrop .swal2-shown.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-shown.swal2-center{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-left,body.swal2-no-backdrop .swal2-shown.swal2-center-start{top:50%;left:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-end,body.swal2-no-backdrop .swal2-shown.swal2-center-right{top:50%;right:0;-webkit-transform:translateY(-50%);transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom-left,body.swal2-no-backdrop .swal2-shown.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-bottom-end,body.swal2-no-backdrop .swal2-shown.swal2-bottom-right{right:0;bottom:0}.swal2-container{display:flex;position:fixed;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:10px;background-color:transparent;z-index:1060;overflow-x:hidden;-webkit-overflow-scrolling:touch}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-container.swal2-fade{transition:background-color .1s}.swal2-container.swal2-shown{background-color:rgba(0,0,0,.4)}.swal2-popup{display:none;position:relative;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem;box-sizing:border-box}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-popup .swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-popup .swal2-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-popup .swal2-actions{flex-wrap:wrap;align-items:center;justify-content:center;margin:1.25em auto 0;z-index:1}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-confirm{width:2.5em;height:2.5em;margin:.46875em;padding:0;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;box-sizing:border-box;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-popup .swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{display:inline-block;width:15px;height:15px;margin-left:5px;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff;content:'';-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal}.swal2-popup .swal2-styled{margin:.3125em;padding:.625em 2em;font-weight:500;box-shadow:none}.swal2-popup .swal2-styled:not([disabled]){cursor:pointer}.swal2-popup .swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-popup .swal2-styled:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.swal2-popup .swal2-styled::-moz-focus-inner{border:0}.swal2-popup .swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-popup .swal2-image{max-width:100%;margin:1.25em auto}.swal2-popup .swal2-close{position:absolute;top:0;right:0;justify-content:center;width:1.2em;height:1.2em;padding:0;transition:color .1s ease-out;border:none;border-radius:0;outline:initial;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer;overflow:hidden}.swal2-popup .swal2-close:hover{-webkit-transform:none;transform:none;color:#f27474}.swal2-popup>.swal2-checkbox,.swal2-popup>.swal2-file,.swal2-popup>.swal2-input,.swal2-popup>.swal2-radio,.swal2-popup>.swal2-select,.swal2-popup>.swal2-textarea{display:none}.swal2-popup .swal2-content{justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:300;line-height:normal;z-index:1;word-wrap:break-word}.swal2-popup #swal2-content{text-align:center}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-radio,.swal2-popup .swal2-select,.swal2-popup .swal2-textarea{margin:1em auto}.swal2-popup .swal2-file,.swal2-popup .swal2-input,.swal2-popup .swal2-textarea{width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;font-size:1.125em;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);box-sizing:border-box}.swal2-popup .swal2-file.swal2-inputerror,.swal2-popup .swal2-input.swal2-inputerror,.swal2-popup .swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-popup .swal2-file:focus,.swal2-popup .swal2-input:focus,.swal2-popup .swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-popup .swal2-file::-webkit-input-placeholder,.swal2-popup .swal2-input::-webkit-input-placeholder,.swal2-popup .swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-popup .swal2-file:-ms-input-placeholder,.swal2-popup .swal2-input:-ms-input-placeholder,.swal2-popup .swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::-ms-input-placeholder,.swal2-popup .swal2-input::-ms-input-placeholder,.swal2-popup .swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-popup .swal2-file::placeholder,.swal2-popup .swal2-input::placeholder,.swal2-popup .swal2-textarea::placeholder{color:#ccc}.swal2-popup .swal2-range input{width:80%}.swal2-popup .swal2-range output{width:20%;font-weight:600;text-align:center}.swal2-popup .swal2-range input,.swal2-popup .swal2-range output{height:2.625em;margin:1em auto;padding:0;font-size:1.125em;line-height:2.625em}.swal2-popup .swal2-input{height:2.625em;padding:0 .75em}.swal2-popup .swal2-input[type=number]{max-width:10em}.swal2-popup .swal2-file{font-size:1.125em}.swal2-popup .swal2-textarea{height:6.75em;padding:.75em}.swal2-popup .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;color:#545454;font-size:1.125em}.swal2-popup .swal2-checkbox,.swal2-popup .swal2-radio{align-items:center;justify-content:center}.swal2-popup .swal2-checkbox label,.swal2-popup .swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-popup .swal2-checkbox input,.swal2-popup .swal2-radio input{margin:0 .4em}.swal2-popup .swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;background:#f0f0f0;color:#666;font-size:1em;font-weight:300;overflow:hidden}.swal2-popup .swal2-validation-message::before{display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center;content:'!';zoom:normal}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}.swal2-icon{position:relative;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;line-height:5em;cursor:default;box-sizing:content-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;zoom:normal}.swal2-icon-text{font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:3.75em 3.75em;transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:0 3.75em;transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;top:-.25em;left:-.25em;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%;z-index:2;box-sizing:content-box}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;top:.5em;left:1.625em;width:.4375em;height:5.625em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);z-index:1}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;height:.3125em;border-radius:.125em;background-color:#a5dc86;z-index:2}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.875em;width:1.5625em;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-progresssteps{align-items:center;margin:0 0 1.25em;padding:0;font-weight:600}.swal2-progresssteps li{display:inline-block;position:relative}.swal2-progresssteps .swal2-progresscircle{width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center;z-index:20}.swal2-progresssteps .swal2-progresscircle:first-child{margin-left:0}.swal2-progresssteps .swal2-progresscircle:last-child{margin-right:0}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep{background:#3085d6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progresscircle{background:#add8e6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progressline{background:#add8e6}.swal2-progresssteps .swal2-progressline{width:2.5em;height:.4em;margin:0 -1px;background:#3085d6;z-index:10}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-show.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-hide.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-animate-success-icon .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-animate-error-icon{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-animate-error-icon .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}@-webkit-keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:initial!important}}");
|
3 |
+
/*! jquery.livequery - v1.3.6 - 2013-08-26
|
4 |
+
* Copyright (c)
|
5 |
+
* (c) 2010, Brandon Aaron (http://brandonaaron.net)
|
6 |
+
* (c) 2012 - 2013, Alexander Zaytsev (http://hazzik.ru/en)
|
7 |
+
* Dual licensed under the MIT (MIT_LICENSE.txt)
|
8 |
+
* and GPL Version 2 (GPL_LICENSE.txt) licenses.
|
9 |
+
*/
|
10 |
+
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a,b){function c(a,b,c,d){return!(a.selector!=b.selector||a.context!=b.context||c&&c.$lqguid!=b.fn.$lqguid||d&&d.$lqguid!=b.fn2.$lqguid)}a.extend(a.fn,{livequery:function(b,e){var f,g=this;return a.each(d.queries,function(a,d){return c(g,d,b,e)?(f=d)&&!1:void 0}),f=f||new d(g.selector,g.context,b,e),f.stopped=!1,f.run(),g},expire:function(b,e){var f=this;return a.each(d.queries,function(a,g){c(f,g,b,e)&&!f.stopped&&d.stop(g.id)}),f}});var d=a.livequery=function(b,c,e,f){var g=this;return g.selector=b,g.context=c,g.fn=e,g.fn2=f,g.elements=a([]),g.stopped=!1,g.id=d.queries.push(g)-1,e.$lqguid=e.$lqguid||d.guid++,f&&(f.$lqguid=f.$lqguid||d.guid++),g};d.prototype={stop:function(){var b=this;b.stopped||(b.fn2&&b.elements.each(b.fn2),b.elements=a([]),b.stopped=!0)},run:function(){var b=this;if(!b.stopped){var c=b.elements,d=a(b.selector,b.context),e=d.not(c),f=c.not(d);b.elements=d,e.each(b.fn),b.fn2&&f.each(b.fn2)}}},a.extend(d,{guid:0,queries:[],queue:[],running:!1,timeout:null,registered:[],checkQueue:function(){if(d.running&&d.queue.length)for(var a=d.queue.length;a--;)d.queries[d.queue.shift()].run()},pause:function(){d.running=!1},play:function(){d.running=!0,d.run()},registerPlugin:function(){a.each(arguments,function(b,c){if(a.fn[c]&&!(a.inArray(c,d.registered)>0)){var e=a.fn[c];a.fn[c]=function(){var a=e.apply(this,arguments);return d.run(),a},d.registered.push(c)}})},run:function(c){c!==b?a.inArray(c,d.queue)<0&&d.queue.push(c):a.each(d.queries,function(b){a.inArray(b,d.queue)<0&&d.queue.push(b)}),d.timeout&&clearTimeout(d.timeout),d.timeout=setTimeout(d.checkQueue,20)},stop:function(c){c!==b?d.queries[c].stop():a.each(d.queries,d.prototype.stop)}}),d.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove","html","prop","removeProp"),a(function(){d.play()})});
|
folders.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Folders
|
4 |
* Description: Arrange media, pages, custom post types and posts into folders
|
5 |
-
* Version: 2.1.
|
6 |
* Author: Premio
|
7 |
* Author URI: https://premio.io/downloads/folders/
|
8 |
*/
|
@@ -15,7 +15,7 @@ define('WCP_FOLDER', 'folders');
|
|
15 |
define('WCP_FOLDER_VAR', 'folders_settings');
|
16 |
define("WCP_DS", DIRECTORY_SEPARATOR);
|
17 |
define('WCP_FOLDER_URL',plugin_dir_url(__FILE__));
|
18 |
-
define('WCP_FOLDER_VERSION',"2.1.
|
19 |
|
20 |
include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
|
21 |
register_activation_hook( __FILE__, array( 'WCP_Folders', 'activate' ) );
|
2 |
/**
|
3 |
* Plugin Name: Folders
|
4 |
* Description: Arrange media, pages, custom post types and posts into folders
|
5 |
+
* Version: 2.1.2
|
6 |
* Author: Premio
|
7 |
* Author URI: https://premio.io/downloads/folders/
|
8 |
*/
|
15 |
define('WCP_FOLDER_VAR', 'folders_settings');
|
16 |
define("WCP_DS", DIRECTORY_SEPARATOR);
|
17 |
define('WCP_FOLDER_URL',plugin_dir_url(__FILE__));
|
18 |
+
define('WCP_FOLDER_VERSION',"2.1.2");
|
19 |
|
20 |
include_once plugin_dir_path(__FILE__)."includes/folders.class.php";
|
21 |
register_activation_hook( __FILE__, array( 'WCP_Folders', 'activate' ) );
|
includes/folders.class.php
CHANGED
@@ -55,6 +55,9 @@ class WCP_Folders
|
|
55 |
/* Update Parent Data */
|
56 |
add_action('wp_ajax_wcp_change_multiple_post_folder', array($this, 'wcp_change_multiple_post_folder'));
|
57 |
|
|
|
|
|
|
|
58 |
/* Update width Data */
|
59 |
add_action('wp_ajax_wcp_change_post_width', array($this, 'wcp_change_post_width'));
|
60 |
|
@@ -81,6 +84,51 @@ class WCP_Folders
|
|
81 |
add_action('wp_enqueue_media', array($this, 'output_backbone_view_filters'));
|
82 |
add_filter('ajax_query_attachments_args', array($this, 'filter_attachments_grid'));
|
83 |
add_filter('add_attachment', array($this, 'save_media_terms'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
|
86 |
public function wcp_get_default_list() {
|
@@ -88,6 +136,8 @@ class WCP_Folders
|
|
88 |
|
89 |
$total_posts = wp_count_posts($post_type)->inherit;;
|
90 |
|
|
|
|
|
91 |
$post_type = self::get_custom_post_type($post_type);
|
92 |
$terms_data = WCP_Tree::get_full_tree_data($post_type);
|
93 |
$taxonomies = self::get_terms_hierarchical('media_folder');
|
@@ -96,7 +146,8 @@ class WCP_Folders
|
|
96 |
'status' => 1,
|
97 |
'data' => $terms_data,
|
98 |
'total_items' => $total_posts,
|
99 |
-
'taxonomies' => $taxonomies
|
|
|
100 |
);
|
101 |
echo json_encode($response);
|
102 |
die;
|
@@ -140,6 +191,45 @@ class WCP_Folders
|
|
140 |
return $args;
|
141 |
}
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
public function output_backbone_view_filters() {
|
144 |
wp_enqueue_script( 'folders-media', WCP_FOLDER_URL.'assets/js/media.js', array( 'media-editor', 'media-views' ), false, true );
|
145 |
wp_localize_script( 'folders-media', 'folders_media_options', array(
|
@@ -1216,6 +1306,8 @@ class WCP_Folders
|
|
1216 |
|
1217 |
$total_posts = self::get_total_posts($typenow);
|
1218 |
|
|
|
|
|
1219 |
$folder_type = self::get_custom_post_type($typenow);
|
1220 |
$terms_data = WCP_Tree::get_full_tree_data($folder_type);
|
1221 |
$terms_html = WCP_Tree::get_option_data_for_select($folder_type);
|
@@ -1244,6 +1336,28 @@ class WCP_Folders
|
|
1244 |
}
|
1245 |
}
|
1246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1247 |
public function autoload()
|
1248 |
{
|
1249 |
$files = array(
|
55 |
/* Update Parent Data */
|
56 |
add_action('wp_ajax_wcp_change_multiple_post_folder', array($this, 'wcp_change_multiple_post_folder'));
|
57 |
|
58 |
+
/* Update Parent Data */
|
59 |
+
add_action('wp_ajax_wcp_remove_post_folder', array($this, 'wcp_remove_post_folder'));
|
60 |
+
|
61 |
/* Update width Data */
|
62 |
add_action('wp_ajax_wcp_change_post_width', array($this, 'wcp_change_post_width'));
|
63 |
|
84 |
add_action('wp_enqueue_media', array($this, 'output_backbone_view_filters'));
|
85 |
add_filter('ajax_query_attachments_args', array($this, 'filter_attachments_grid'));
|
86 |
add_filter('add_attachment', array($this, 'save_media_terms'));
|
87 |
+
|
88 |
+
/* to filter un assigned items*/
|
89 |
+
add_filter('pre_get_posts', array($this, 'filter_record_list'));
|
90 |
+
}
|
91 |
+
|
92 |
+
public function wcp_remove_post_folder() {
|
93 |
+
$response = array();
|
94 |
+
$response['status'] = 0;
|
95 |
+
$response['error'] = 0;
|
96 |
+
$response['data'] = array();
|
97 |
+
$response['message'] = "";
|
98 |
+
$postData = $_POST;
|
99 |
+
$errorCounter = 0;
|
100 |
+
if (!isset($postData['post_id']) || empty($postData['post_id'])) {
|
101 |
+
$response['message'] = __("Your request is not valid", WCP_FOLDER);
|
102 |
+
$errorCounter++;
|
103 |
+
} else if (!isset($postData['type']) || empty($postData['type'])) {
|
104 |
+
$response['message'] = __("Your request is not valid", WCP_FOLDER);
|
105 |
+
$errorCounter++;
|
106 |
+
} else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
|
107 |
+
$response['message'] = __("Your request is not valid", WCP_FOLDER);
|
108 |
+
$errorCounter++;
|
109 |
+
} else if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['type'])) {
|
110 |
+
$response['message'] = __("Your request is not valid", WCP_FOLDER);
|
111 |
+
$errorCounter++;
|
112 |
+
}
|
113 |
+
if ($errorCounter == 0) {
|
114 |
+
$type = self::sanitize_options($postData['type']);
|
115 |
+
$post_id = self::sanitize_options($postData['post_id']);
|
116 |
+
|
117 |
+
$post_id = explode(",", $post_id);
|
118 |
+
|
119 |
+
$taxonomy = self::get_custom_post_type($type);
|
120 |
+
|
121 |
+
foreach($post_id as $id) {
|
122 |
+
if(!empty($id) && is_numeric($id) && $id > 0) {
|
123 |
+
wp_delete_object_term_relationships($id, $taxonomy);
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
$response['status'] = 1;
|
128 |
+
}
|
129 |
+
echo json_encode($response);
|
130 |
+
die;
|
131 |
+
// wp_delete_object_term_relationships
|
132 |
}
|
133 |
|
134 |
public function wcp_get_default_list() {
|
136 |
|
137 |
$total_posts = wp_count_posts($post_type)->inherit;;
|
138 |
|
139 |
+
$empty_items = self::get_total_empty_posts('attachment');
|
140 |
+
|
141 |
$post_type = self::get_custom_post_type($post_type);
|
142 |
$terms_data = WCP_Tree::get_full_tree_data($post_type);
|
143 |
$taxonomies = self::get_terms_hierarchical('media_folder');
|
146 |
'status' => 1,
|
147 |
'data' => $terms_data,
|
148 |
'total_items' => $total_posts,
|
149 |
+
'taxonomies' => $taxonomies,
|
150 |
+
'empty_items' => $empty_items
|
151 |
);
|
152 |
echo json_encode($response);
|
153 |
die;
|
191 |
return $args;
|
192 |
}
|
193 |
|
194 |
+
public function filter_record_list($query) {
|
195 |
+
global $typenow;
|
196 |
+
|
197 |
+
if($typenow == "attachment") {
|
198 |
+
return;
|
199 |
+
}
|
200 |
+
|
201 |
+
if(!self::is_for_this_post_type($typenow)) {
|
202 |
+
return $query;
|
203 |
+
}
|
204 |
+
|
205 |
+
$taxonomy = self::get_custom_post_type($typenow);
|
206 |
+
|
207 |
+
if ( ! isset( $query->query['post_type'] ) ) {
|
208 |
+
return $query;
|
209 |
+
}
|
210 |
+
|
211 |
+
if ( ! isset( $_REQUEST[$taxonomy] ) ) {
|
212 |
+
return $query;
|
213 |
+
}
|
214 |
+
|
215 |
+
$term = sanitize_text_field( $_REQUEST[$taxonomy] );
|
216 |
+
if ( $term != "-1" ) {
|
217 |
+
return $query;
|
218 |
+
}
|
219 |
+
|
220 |
+
unset( $query->query_vars[$taxonomy] );
|
221 |
+
|
222 |
+
$tax_query = array(
|
223 |
+
'taxonomy' => $taxonomy,
|
224 |
+
'operator' => 'NOT EXISTS',
|
225 |
+
);
|
226 |
+
|
227 |
+
$query->set( 'tax_query', array( $tax_query ) );
|
228 |
+
$query->tax_query = new WP_Tax_Query( array( $tax_query ) );
|
229 |
+
|
230 |
+
return $query;
|
231 |
+
}
|
232 |
+
|
233 |
public function output_backbone_view_filters() {
|
234 |
wp_enqueue_script( 'folders-media', WCP_FOLDER_URL.'assets/js/media.js', array( 'media-editor', 'media-views' ), false, true );
|
235 |
wp_localize_script( 'folders-media', 'folders_media_options', array(
|
1306 |
|
1307 |
$total_posts = self::get_total_posts($typenow);
|
1308 |
|
1309 |
+
$total_empty = self::get_total_empty_posts($typenow);
|
1310 |
+
|
1311 |
$folder_type = self::get_custom_post_type($typenow);
|
1312 |
$terms_data = WCP_Tree::get_full_tree_data($folder_type);
|
1313 |
$terms_html = WCP_Tree::get_option_data_for_select($folder_type);
|
1336 |
}
|
1337 |
}
|
1338 |
|
1339 |
+
public function get_total_empty_posts($post_type = "")
|
1340 |
+
{
|
1341 |
+
$taxonomy = self::get_custom_post_type($post_type);
|
1342 |
+
$args = array(
|
1343 |
+
'posts_per_page' => -1,
|
1344 |
+
'post_type' => $post_type,
|
1345 |
+
'post_status' => 'inherit'
|
1346 |
+
);
|
1347 |
+
if ($post_type != "attachment") {
|
1348 |
+
$args['post_status'] = array('publish', 'draft', 'future', 'private');
|
1349 |
+
}
|
1350 |
+
$args['tax_query'] = array(
|
1351 |
+
array(
|
1352 |
+
'taxonomy' => $taxonomy,
|
1353 |
+
'operator' => 'NOT EXISTS',
|
1354 |
+
),
|
1355 |
+
);
|
1356 |
+
$result = get_posts($args);
|
1357 |
+
|
1358 |
+
return (count($result));
|
1359 |
+
}
|
1360 |
+
|
1361 |
public function autoload()
|
1362 |
{
|
1363 |
$files = array(
|
includes/plugin.updates.php
CHANGED
@@ -1,566 +1,566 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
defined('ABSPATH') or die('Nope, not accessing this');
|
4 |
-
|
5 |
-
// Exit if accessed directly
|
6 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Allows plugins to use their own update API.
|
10 |
-
*
|
11 |
-
* @author Easy Digital Downloads
|
12 |
-
* @version 1.6.17
|
13 |
-
*/
|
14 |
-
class Folder_Plugin_Updater {
|
15 |
-
|
16 |
-
private $api_url = '';
|
17 |
-
private $api_data = array();
|
18 |
-
private $name = '';
|
19 |
-
private $slug = '';
|
20 |
-
private $version = '';
|
21 |
-
private $wp_override = false;
|
22 |
-
private $cache_key = '';
|
23 |
-
|
24 |
-
private $health_check_timeout = 5;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Class constructor.
|
28 |
-
*
|
29 |
-
* @uses plugin_basename()
|
30 |
-
* @uses hook()
|
31 |
-
*
|
32 |
-
* @param string $_api_url The URL pointing to the custom API endpoint.
|
33 |
-
* @param string $_plugin_file Path to the plugin file.
|
34 |
-
* @param array $_api_data Optional data to send with API calls.
|
35 |
-
*/
|
36 |
-
public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
|
37 |
-
|
38 |
-
global $edd_plugin_data;
|
39 |
-
|
40 |
-
$this->api_url = trailingslashit( $_api_url );
|
41 |
-
$this->api_data = $_api_data;
|
42 |
-
$this->name = plugin_basename( $_plugin_file );
|
43 |
-
$this->slug = basename( $_plugin_file, '.php' );
|
44 |
-
$this->version = $_api_data['version'];
|
45 |
-
$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
|
46 |
-
$this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
|
47 |
-
$this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
|
48 |
-
|
49 |
-
$edd_plugin_data[ $this->slug ] = $this->api_data;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Fires after the $edd_plugin_data is setup.
|
53 |
-
*
|
54 |
-
* @since x.x.x
|
55 |
-
*
|
56 |
-
* @param array $edd_plugin_data Array of EDD SL plugin data.
|
57 |
-
*/
|
58 |
-
do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data );
|
59 |
-
|
60 |
-
// Set up hooks.
|
61 |
-
$this->init();
|
62 |
-
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Set up WordPress filters to hook into WP's update process.
|
67 |
-
*
|
68 |
-
* @uses add_filter()
|
69 |
-
*
|
70 |
-
* @return void
|
71 |
-
*/
|
72 |
-
public function init() {
|
73 |
-
|
74 |
-
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
|
75 |
-
add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
|
76 |
-
remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 );
|
77 |
-
add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
|
78 |
-
add_action( 'admin_init', array( $this, 'show_changelog' ) );
|
79 |
-
|
80 |
-
}
|
81 |
-
|
82 |
-
/**
|
83 |
-
* Check for Updates at the defined API endpoint and modify the update array.
|
84 |
-
*
|
85 |
-
* This function dives into the update API just when WordPress creates its update array,
|
86 |
-
* then adds a custom API call and injects the custom plugin data retrieved from the API.
|
87 |
-
* It is reassembled from parts of the native WordPress plugin update code.
|
88 |
-
* See wp-includes/update.php line 121 for the original wp_update_plugins() function.
|
89 |
-
*
|
90 |
-
* @uses api_request()
|
91 |
-
*
|
92 |
-
* @param array $_transient_data Update array build by WordPress.
|
93 |
-
* @return array Modified update array with custom plugin data.
|
94 |
-
*/
|
95 |
-
public function check_update( $_transient_data ) {
|
96 |
-
|
97 |
-
global $pagenow;
|
98 |
-
|
99 |
-
if ( ! is_object( $_transient_data ) ) {
|
100 |
-
$_transient_data = new stdClass;
|
101 |
-
}
|
102 |
-
|
103 |
-
if ( 'plugins.php' == $pagenow && is_multisite() ) {
|
104 |
-
return $_transient_data;
|
105 |
-
}
|
106 |
-
|
107 |
-
if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
|
108 |
-
return $_transient_data;
|
109 |
-
}
|
110 |
-
|
111 |
-
$version_info = $this->get_cached_version_info();
|
112 |
-
|
113 |
-
if ( false === $version_info ) {
|
114 |
-
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
|
115 |
-
|
116 |
-
$this->set_version_info_cache( $version_info );
|
117 |
-
|
118 |
-
}
|
119 |
-
|
120 |
-
if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
|
121 |
-
|
122 |
-
if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
123 |
-
|
124 |
-
$_transient_data->response[ $this->name ] = $version_info;
|
125 |
-
|
126 |
-
}
|
127 |
-
|
128 |
-
$_transient_data->last_checked = time();
|
129 |
-
$_transient_data->checked[ $this->name ] = $this->version;
|
130 |
-
|
131 |
-
}
|
132 |
-
|
133 |
-
return $_transient_data;
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
|
138 |
-
*
|
139 |
-
* @param string $file
|
140 |
-
* @param array $plugin
|
141 |
-
*/
|
142 |
-
public function show_update_notification( $file, $plugin ) {
|
143 |
-
|
144 |
-
if ( is_network_admin() ) {
|
145 |
-
return;
|
146 |
-
}
|
147 |
-
|
148 |
-
if( ! current_user_can( 'update_plugins' ) ) {
|
149 |
-
return;
|
150 |
-
}
|
151 |
-
|
152 |
-
if( ! is_multisite() ) {
|
153 |
-
return;
|
154 |
-
}
|
155 |
-
|
156 |
-
if ( $this->name != $file ) {
|
157 |
-
return;
|
158 |
-
}
|
159 |
-
|
160 |
-
// Remove our filter on the site transient
|
161 |
-
remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
|
162 |
-
|
163 |
-
$update_cache = get_site_transient( 'update_plugins' );
|
164 |
-
|
165 |
-
$update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
|
166 |
-
|
167 |
-
if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
|
168 |
-
|
169 |
-
$version_info = $this->get_cached_version_info();
|
170 |
-
|
171 |
-
if ( false === $version_info ) {
|
172 |
-
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
|
173 |
-
|
174 |
-
// Since we disabled our filter for the transient, we aren't running our object conversion on banners, sections, or icons. Do this now:
|
175 |
-
if ( isset( $version_info->banners ) && ! is_array( $version_info->banners ) ) {
|
176 |
-
$version_info->banners = $this->convert_object_to_array( $version_info->banners );
|
177 |
-
}
|
178 |
-
|
179 |
-
if ( isset( $version_info->sections ) && ! is_array( $version_info->sections ) ) {
|
180 |
-
$version_info->sections = $this->convert_object_to_array( $version_info->sections );
|
181 |
-
}
|
182 |
-
|
183 |
-
if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) {
|
184 |
-
$version_info->icons = $this->convert_object_to_array( $version_info->icons );
|
185 |
-
}
|
186 |
-
|
187 |
-
$this->set_version_info_cache( $version_info );
|
188 |
-
}
|
189 |
-
|
190 |
-
if ( ! is_object( $version_info ) ) {
|
191 |
-
return;
|
192 |
-
}
|
193 |
-
|
194 |
-
if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
195 |
-
|
196 |
-
$update_cache->response[ $this->name ] = $version_info;
|
197 |
-
|
198 |
-
}
|
199 |
-
|
200 |
-
$update_cache->last_checked = time();
|
201 |
-
$update_cache->checked[ $this->name ] = $this->version;
|
202 |
-
|
203 |
-
set_site_transient( 'update_plugins', $update_cache );
|
204 |
-
|
205 |
-
} else {
|
206 |
-
|
207 |
-
$version_info = $update_cache->response[ $this->name ];
|
208 |
-
|
209 |
-
}
|
210 |
-
|
211 |
-
// Restore our filter
|
212 |
-
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
|
213 |
-
|
214 |
-
if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
215 |
-
|
216 |
-
// build a plugin list row, with update notification
|
217 |
-
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
|
218 |
-
# <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
219 |
-
echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
|
220 |
-
echo '<td colspan="3" class="plugin-update colspanchange">';
|
221 |
-
echo '<div class="update-message notice inline notice-warning notice-alt">';
|
222 |
-
|
223 |
-
$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
|
224 |
-
|
225 |
-
if ( empty( $version_info->download_link ) ) {
|
226 |
-
printf(
|
227 |
-
__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
|
228 |
-
esc_html( $version_info->name ),
|
229 |
-
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
230 |
-
esc_html( $version_info->new_version ),
|
231 |
-
'</a>'
|
232 |
-
);
|
233 |
-
} else {
|
234 |
-
printf(
|
235 |
-
__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ),
|
236 |
-
esc_html( $version_info->name ),
|
237 |
-
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
238 |
-
esc_html( $version_info->new_version ),
|
239 |
-
'</a>',
|
240 |
-
'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
|
241 |
-
'</a>'
|
242 |
-
);
|
243 |
-
}
|
244 |
-
|
245 |
-
do_action( "in_plugin_update_message-{$file}", $plugin, $version_info );
|
246 |
-
|
247 |
-
echo '</div></td></tr>';
|
248 |
-
}
|
249 |
-
}
|
250 |
-
|
251 |
-
/**
|
252 |
-
* Updates information on the "View version x.x details" page with custom data.
|
253 |
-
*
|
254 |
-
* @uses api_request()
|
255 |
-
*
|
256 |
-
* @param mixed $_data
|
257 |
-
* @param string $_action
|
258 |
-
* @param object $_args
|
259 |
-
* @return object $_data
|
260 |
-
*/
|
261 |
-
public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
|
262 |
-
|
263 |
-
if ( $_action != 'plugin_information' ) {
|
264 |
-
|
265 |
-
return $_data;
|
266 |
-
|
267 |
-
}
|
268 |
-
|
269 |
-
if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
|
270 |
-
|
271 |
-
return $_data;
|
272 |
-
|
273 |
-
}
|
274 |
-
|
275 |
-
$to_send = array(
|
276 |
-
'slug' => $this->slug,
|
277 |
-
'is_ssl' => is_ssl(),
|
278 |
-
'fields' => array(
|
279 |
-
'banners' => array(),
|
280 |
-
'reviews' => false,
|
281 |
-
'icons' => array(),
|
282 |
-
)
|
283 |
-
);
|
284 |
-
|
285 |
-
$cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
|
286 |
-
|
287 |
-
// Get the transient where we store the api request for this plugin for 24 hours
|
288 |
-
$edd_api_request_transient = $this->get_cached_version_info( $cache_key );
|
289 |
-
|
290 |
-
//If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
|
291 |
-
if ( empty( $edd_api_request_transient ) ) {
|
292 |
-
|
293 |
-
$api_response = $this->api_request( 'plugin_information', $to_send );
|
294 |
-
|
295 |
-
// Expires in 3 hours
|
296 |
-
$this->set_version_info_cache( $api_response, $cache_key );
|
297 |
-
|
298 |
-
if ( false !== $api_response ) {
|
299 |
-
$_data = $api_response;
|
300 |
-
}
|
301 |
-
|
302 |
-
} else {
|
303 |
-
$_data = $edd_api_request_transient;
|
304 |
-
}
|
305 |
-
|
306 |
-
// Convert sections into an associative array, since we're getting an object, but Core expects an array.
|
307 |
-
if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
|
308 |
-
$_data->sections = $this->convert_object_to_array( $_data->sections );
|
309 |
-
}
|
310 |
-
|
311 |
-
// Convert banners into an associative array, since we're getting an object, but Core expects an array.
|
312 |
-
if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
|
313 |
-
$_data->banners = $this->convert_object_to_array( $_data->banners );
|
314 |
-
}
|
315 |
-
|
316 |
-
// Convert icons into an associative array, since we're getting an object, but Core expects an array.
|
317 |
-
if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) {
|
318 |
-
$_data->icons = $this->convert_object_to_array( $_data->icons );
|
319 |
-
}
|
320 |
-
|
321 |
-
return $_data;
|
322 |
-
}
|
323 |
-
|
324 |
-
/**
|
325 |
-
* Convert some objects to arrays when injecting data into the update API
|
326 |
-
*
|
327 |
-
* Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON
|
328 |
-
* decoding, they are objects. This method allows us to pass in the object and return an associative array.
|
329 |
-
*
|
330 |
-
* @since 3.6.5
|
331 |
-
*
|
332 |
-
* @param stdClass $data
|
333 |
-
*
|
334 |
-
* @return array
|
335 |
-
*/
|
336 |
-
private function convert_object_to_array( $data ) {
|
337 |
-
$new_data = array();
|
338 |
-
foreach ( $data as $key => $value ) {
|
339 |
-
$new_data[ $key ] = $value;
|
340 |
-
}
|
341 |
-
|
342 |
-
return $new_data;
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
* Disable SSL verification in order to prevent download update failures
|
347 |
-
*
|
348 |
-
* @param array $args
|
349 |
-
* @param string $url
|
350 |
-
* @return object $array
|
351 |
-
*/
|
352 |
-
public function http_request_args( $args, $url ) {
|
353 |
-
|
354 |
-
$verify_ssl = $this->verify_ssl();
|
355 |
-
if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
|
356 |
-
$args['sslverify'] = $verify_ssl;
|
357 |
-
}
|
358 |
-
return $args;
|
359 |
-
|
360 |
-
}
|
361 |
-
|
362 |
-
/**
|
363 |
-
* Calls the API and, if successfull, returns the object delivered by the API.
|
364 |
-
*
|
365 |
-
* @uses get_bloginfo()
|
366 |
-
* @uses wp_remote_post()
|
367 |
-
* @uses is_wp_error()
|
368 |
-
*
|
369 |
-
* @param string $_action The requested action.
|
370 |
-
* @param array $_data Parameters for the API action.
|
371 |
-
* @return false|object
|
372 |
-
*/
|
373 |
-
private function api_request( $_action, $_data ) {
|
374 |
-
|
375 |
-
global $wp_version, $edd_plugin_url_available;
|
376 |
-
|
377 |
-
// Do a quick status check on this domain if we haven't already checked it.
|
378 |
-
$store_hash = md5( $this->api_url );
|
379 |
-
if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
|
380 |
-
$test_url_parts = parse_url( $this->api_url );
|
381 |
-
|
382 |
-
$scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http';
|
383 |
-
$host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
|
384 |
-
$port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
|
385 |
-
|
386 |
-
if ( empty( $host ) ) {
|
387 |
-
$edd_plugin_url_available[ $store_hash ] = false;
|
388 |
-
} else {
|
389 |
-
$test_url = $scheme . '://' . $host . $port;
|
390 |
-
$response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => true ) );
|
391 |
-
$edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
|
392 |
-
}
|
393 |
-
}
|
394 |
-
|
395 |
-
if ( false === $edd_plugin_url_available[ $store_hash ] ) {
|
396 |
-
return;
|
397 |
-
}
|
398 |
-
|
399 |
-
$data = array_merge( $this->api_data, $_data );
|
400 |
-
|
401 |
-
if ( $data['slug'] != $this->slug ) {
|
402 |
-
return;
|
403 |
-
}
|
404 |
-
|
405 |
-
if( $this->api_url == trailingslashit ( home_url() ) ) {
|
406 |
-
return false; // Don't allow a plugin to ping itself
|
407 |
-
}
|
408 |
-
|
409 |
-
$api_params = array(
|
410 |
-
'edd_action' => 'get_version',
|
411 |
-
'license' => ! empty( $data['license'] ) ? $data['license'] : '',
|
412 |
-
'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
|
413 |
-
'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
|
414 |
-
'version' => isset( $data['version'] ) ? $data['version'] : false,
|
415 |
-
'slug' => $data['slug'],
|
416 |
-
'author' => $data['author'],
|
417 |
-
'url' => home_url(),
|
418 |
-
'beta' => ! empty( $data['beta'] ),
|
419 |
-
);
|
420 |
-
|
421 |
-
$verify_ssl = $this->verify_ssl();
|
422 |
-
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
|
423 |
-
|
424 |
-
if ( ! is_wp_error( $request ) ) {
|
425 |
-
$request = json_decode( wp_remote_retrieve_body( $request ) );
|
426 |
-
}
|
427 |
-
|
428 |
-
if ( $request && isset( $request->sections ) ) {
|
429 |
-
$request->sections = maybe_unserialize( $request->sections );
|
430 |
-
} else {
|
431 |
-
$request = false;
|
432 |
-
}
|
433 |
-
|
434 |
-
if ( $request && isset( $request->banners ) ) {
|
435 |
-
$request->banners = maybe_unserialize( $request->banners );
|
436 |
-
}
|
437 |
-
|
438 |
-
if ( $request && isset( $request->icons ) ) {
|
439 |
-
$request->icons = maybe_unserialize( $request->icons );
|
440 |
-
}
|
441 |
-
|
442 |
-
if( ! empty( $request->sections ) ) {
|
443 |
-
foreach( $request->sections as $key => $section ) {
|
444 |
-
$request->$key = (array) $section;
|
445 |
-
}
|
446 |
-
}
|
447 |
-
|
448 |
-
return $request;
|
449 |
-
}
|
450 |
-
|
451 |
-
public function show_changelog() {
|
452 |
-
|
453 |
-
global $edd_plugin_data;
|
454 |
-
|
455 |
-
if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
|
456 |
-
return;
|
457 |
-
}
|
458 |
-
|
459 |
-
if( empty( $_REQUEST['plugin'] ) ) {
|
460 |
-
return;
|
461 |
-
}
|
462 |
-
|
463 |
-
if( empty( $_REQUEST['slug'] ) ) {
|
464 |
-
return;
|
465 |
-
}
|
466 |
-
|
467 |
-
if( ! current_user_can( 'update_plugins' ) ) {
|
468 |
-
wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
|
469 |
-
}
|
470 |
-
|
471 |
-
$data = $edd_plugin_data[ $_REQUEST['slug'] ];
|
472 |
-
$beta = ! empty( $data['beta'] ) ? true : false;
|
473 |
-
$cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' );
|
474 |
-
$version_info = $this->get_cached_version_info( $cache_key );
|
475 |
-
|
476 |
-
if( false === $version_info ) {
|
477 |
-
|
478 |
-
$api_params = array(
|
479 |
-
'edd_action' => 'get_version',
|
480 |
-
'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
|
481 |
-
'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
|
482 |
-
'slug' => $_REQUEST['slug'],
|
483 |
-
'author' => $data['author'],
|
484 |
-
'url' => home_url(),
|
485 |
-
'beta' => ! empty( $data['beta'] )
|
486 |
-
);
|
487 |
-
|
488 |
-
$verify_ssl = $this->verify_ssl();
|
489 |
-
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
|
490 |
-
|
491 |
-
if ( ! is_wp_error( $request ) ) {
|
492 |
-
$version_info = json_decode( wp_remote_retrieve_body( $request ) );
|
493 |
-
}
|
494 |
-
|
495 |
-
|
496 |
-
if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
|
497 |
-
$version_info->sections = maybe_unserialize( $version_info->sections );
|
498 |
-
} else {
|
499 |
-
$version_info = false;
|
500 |
-
}
|
501 |
-
|
502 |
-
if( ! empty( $version_info ) ) {
|
503 |
-
foreach( $version_info->sections as $key => $section ) {
|
504 |
-
$version_info->$key = (array) $section;
|
505 |
-
}
|
506 |
-
}
|
507 |
-
|
508 |
-
$this->set_version_info_cache( $version_info, $cache_key );
|
509 |
-
|
510 |
-
}
|
511 |
-
|
512 |
-
if( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
|
513 |
-
echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
|
514 |
-
}
|
515 |
-
|
516 |
-
exit;
|
517 |
-
}
|
518 |
-
|
519 |
-
public function get_cached_version_info( $cache_key = '' ) {
|
520 |
-
|
521 |
-
if( empty( $cache_key ) ) {
|
522 |
-
$cache_key = $this->cache_key;
|
523 |
-
}
|
524 |
-
|
525 |
-
$cache = get_option( $cache_key );
|
526 |
-
|
527 |
-
if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
|
528 |
-
return false; // Cache is expired
|
529 |
-
}
|
530 |
-
|
531 |
-
// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
|
532 |
-
$cache['value'] = json_decode( $cache['value'] );
|
533 |
-
if ( ! empty( $cache['value']->icons ) ) {
|
534 |
-
$cache['value']->icons = (array) $cache['value']->icons;
|
535 |
-
}
|
536 |
-
|
537 |
-
return $cache['value'];
|
538 |
-
|
539 |
-
}
|
540 |
-
|
541 |
-
public function set_version_info_cache( $value = '', $cache_key = '' ) {
|
542 |
-
|
543 |
-
if( empty( $cache_key ) ) {
|
544 |
-
$cache_key = $this->cache_key;
|
545 |
-
}
|
546 |
-
|
547 |
-
$data = array(
|
548 |
-
'timeout' => strtotime( '+3 hours', time() ),
|
549 |
-
'value' => json_encode( $value )
|
550 |
-
);
|
551 |
-
|
552 |
-
update_option( $cache_key, $data, 'no' );
|
553 |
-
|
554 |
-
}
|
555 |
-
|
556 |
-
/**
|
557 |
-
* Returns if the SSL of the store should be verified.
|
558 |
-
*
|
559 |
-
* @since 1.6.13
|
560 |
-
* @return bool
|
561 |
-
*/
|
562 |
-
private function verify_ssl() {
|
563 |
-
return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
|
564 |
-
}
|
565 |
-
|
566 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined('ABSPATH') or die('Nope, not accessing this');
|
4 |
+
|
5 |
+
// Exit if accessed directly
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Allows plugins to use their own update API.
|
10 |
+
*
|
11 |
+
* @author Easy Digital Downloads
|
12 |
+
* @version 1.6.17
|
13 |
+
*/
|
14 |
+
class Folder_Plugin_Updater {
|
15 |
+
|
16 |
+
private $api_url = '';
|
17 |
+
private $api_data = array();
|
18 |
+
private $name = '';
|
19 |
+
private $slug = '';
|
20 |
+
private $version = '';
|
21 |
+
private $wp_override = false;
|
22 |
+
private $cache_key = '';
|
23 |
+
|
24 |
+
private $health_check_timeout = 5;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Class constructor.
|
28 |
+
*
|
29 |
+
* @uses plugin_basename()
|
30 |
+
* @uses hook()
|
31 |
+
*
|
32 |
+
* @param string $_api_url The URL pointing to the custom API endpoint.
|
33 |
+
* @param string $_plugin_file Path to the plugin file.
|
34 |
+
* @param array $_api_data Optional data to send with API calls.
|
35 |
+
*/
|
36 |
+
public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
|
37 |
+
|
38 |
+
global $edd_plugin_data;
|
39 |
+
|
40 |
+
$this->api_url = trailingslashit( $_api_url );
|
41 |
+
$this->api_data = $_api_data;
|
42 |
+
$this->name = plugin_basename( $_plugin_file );
|
43 |
+
$this->slug = basename( $_plugin_file, '.php' );
|
44 |
+
$this->version = $_api_data['version'];
|
45 |
+
$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
|
46 |
+
$this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
|
47 |
+
$this->cache_key = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
|
48 |
+
|
49 |
+
$edd_plugin_data[ $this->slug ] = $this->api_data;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Fires after the $edd_plugin_data is setup.
|
53 |
+
*
|
54 |
+
* @since x.x.x
|
55 |
+
*
|
56 |
+
* @param array $edd_plugin_data Array of EDD SL plugin data.
|
57 |
+
*/
|
58 |
+
do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data );
|
59 |
+
|
60 |
+
// Set up hooks.
|
61 |
+
$this->init();
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Set up WordPress filters to hook into WP's update process.
|
67 |
+
*
|
68 |
+
* @uses add_filter()
|
69 |
+
*
|
70 |
+
* @return void
|
71 |
+
*/
|
72 |
+
public function init() {
|
73 |
+
|
74 |
+
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
|
75 |
+
add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
|
76 |
+
remove_action( 'after_plugin_row_' . $this->name, 'wp_plugin_update_row', 10 );
|
77 |
+
add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
|
78 |
+
add_action( 'admin_init', array( $this, 'show_changelog' ) );
|
79 |
+
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Check for Updates at the defined API endpoint and modify the update array.
|
84 |
+
*
|
85 |
+
* This function dives into the update API just when WordPress creates its update array,
|
86 |
+
* then adds a custom API call and injects the custom plugin data retrieved from the API.
|
87 |
+
* It is reassembled from parts of the native WordPress plugin update code.
|
88 |
+
* See wp-includes/update.php line 121 for the original wp_update_plugins() function.
|
89 |
+
*
|
90 |
+
* @uses api_request()
|
91 |
+
*
|
92 |
+
* @param array $_transient_data Update array build by WordPress.
|
93 |
+
* @return array Modified update array with custom plugin data.
|
94 |
+
*/
|
95 |
+
public function check_update( $_transient_data ) {
|
96 |
+
|
97 |
+
global $pagenow;
|
98 |
+
|
99 |
+
if ( ! is_object( $_transient_data ) ) {
|
100 |
+
$_transient_data = new stdClass;
|
101 |
+
}
|
102 |
+
|
103 |
+
if ( 'plugins.php' == $pagenow && is_multisite() ) {
|
104 |
+
return $_transient_data;
|
105 |
+
}
|
106 |
+
|
107 |
+
if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
|
108 |
+
return $_transient_data;
|
109 |
+
}
|
110 |
+
|
111 |
+
$version_info = $this->get_cached_version_info();
|
112 |
+
|
113 |
+
if ( false === $version_info ) {
|
114 |
+
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
|
115 |
+
|
116 |
+
$this->set_version_info_cache( $version_info );
|
117 |
+
|
118 |
+
}
|
119 |
+
|
120 |
+
if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
|
121 |
+
|
122 |
+
if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
123 |
+
|
124 |
+
$_transient_data->response[ $this->name ] = $version_info;
|
125 |
+
|
126 |
+
}
|
127 |
+
|
128 |
+
$_transient_data->last_checked = time();
|
129 |
+
$_transient_data->checked[ $this->name ] = $this->version;
|
130 |
+
|
131 |
+
}
|
132 |
+
|
133 |
+
return $_transient_data;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
|
138 |
+
*
|
139 |
+
* @param string $file
|
140 |
+
* @param array $plugin
|
141 |
+
*/
|
142 |
+
public function show_update_notification( $file, $plugin ) {
|
143 |
+
|
144 |
+
if ( is_network_admin() ) {
|
145 |
+
return;
|
146 |
+
}
|
147 |
+
|
148 |
+
if( ! current_user_can( 'update_plugins' ) ) {
|
149 |
+
return;
|
150 |
+
}
|
151 |
+
|
152 |
+
if( ! is_multisite() ) {
|
153 |
+
return;
|
154 |
+
}
|
155 |
+
|
156 |
+
if ( $this->name != $file ) {
|
157 |
+
return;
|
158 |
+
}
|
159 |
+
|
160 |
+
// Remove our filter on the site transient
|
161 |
+
remove_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
|
162 |
+
|
163 |
+
$update_cache = get_site_transient( 'update_plugins' );
|
164 |
+
|
165 |
+
$update_cache = is_object( $update_cache ) ? $update_cache : new stdClass();
|
166 |
+
|
167 |
+
if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
|
168 |
+
|
169 |
+
$version_info = $this->get_cached_version_info();
|
170 |
+
|
171 |
+
if ( false === $version_info ) {
|
172 |
+
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
|
173 |
+
|
174 |
+
// Since we disabled our filter for the transient, we aren't running our object conversion on banners, sections, or icons. Do this now:
|
175 |
+
if ( isset( $version_info->banners ) && ! is_array( $version_info->banners ) ) {
|
176 |
+
$version_info->banners = $this->convert_object_to_array( $version_info->banners );
|
177 |
+
}
|
178 |
+
|
179 |
+
if ( isset( $version_info->sections ) && ! is_array( $version_info->sections ) ) {
|
180 |
+
$version_info->sections = $this->convert_object_to_array( $version_info->sections );
|
181 |
+
}
|
182 |
+
|
183 |
+
if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) {
|
184 |
+
$version_info->icons = $this->convert_object_to_array( $version_info->icons );
|
185 |
+
}
|
186 |
+
|
187 |
+
$this->set_version_info_cache( $version_info );
|
188 |
+
}
|
189 |
+
|
190 |
+
if ( ! is_object( $version_info ) ) {
|
191 |
+
return;
|
192 |
+
}
|
193 |
+
|
194 |
+
if ( version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
195 |
+
|
196 |
+
$update_cache->response[ $this->name ] = $version_info;
|
197 |
+
|
198 |
+
}
|
199 |
+
|
200 |
+
$update_cache->last_checked = time();
|
201 |
+
$update_cache->checked[ $this->name ] = $this->version;
|
202 |
+
|
203 |
+
set_site_transient( 'update_plugins', $update_cache );
|
204 |
+
|
205 |
+
} else {
|
206 |
+
|
207 |
+
$version_info = $update_cache->response[ $this->name ];
|
208 |
+
|
209 |
+
}
|
210 |
+
|
211 |
+
// Restore our filter
|
212 |
+
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
|
213 |
+
|
214 |
+
if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
215 |
+
|
216 |
+
// build a plugin list row, with update notification
|
217 |
+
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
|
218 |
+
# <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
219 |
+
echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
|
220 |
+
echo '<td colspan="3" class="plugin-update colspanchange">';
|
221 |
+
echo '<div class="update-message notice inline notice-warning notice-alt">';
|
222 |
+
|
223 |
+
$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
|
224 |
+
|
225 |
+
if ( empty( $version_info->download_link ) ) {
|
226 |
+
printf(
|
227 |
+
__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'easy-digital-downloads' ),
|
228 |
+
esc_html( $version_info->name ),
|
229 |
+
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
230 |
+
esc_html( $version_info->new_version ),
|
231 |
+
'</a>'
|
232 |
+
);
|
233 |
+
} else {
|
234 |
+
printf(
|
235 |
+
__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'easy-digital-downloads' ),
|
236 |
+
esc_html( $version_info->name ),
|
237 |
+
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
238 |
+
esc_html( $version_info->new_version ),
|
239 |
+
'</a>',
|
240 |
+
'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
|
241 |
+
'</a>'
|
242 |
+
);
|
243 |
+
}
|
244 |
+
|
245 |
+
do_action( "in_plugin_update_message-{$file}", $plugin, $version_info );
|
246 |
+
|
247 |
+
echo '</div></td></tr>';
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Updates information on the "View version x.x details" page with custom data.
|
253 |
+
*
|
254 |
+
* @uses api_request()
|
255 |
+
*
|
256 |
+
* @param mixed $_data
|
257 |
+
* @param string $_action
|
258 |
+
* @param object $_args
|
259 |
+
* @return object $_data
|
260 |
+
*/
|
261 |
+
public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
|
262 |
+
|
263 |
+
if ( $_action != 'plugin_information' ) {
|
264 |
+
|
265 |
+
return $_data;
|
266 |
+
|
267 |
+
}
|
268 |
+
|
269 |
+
if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
|
270 |
+
|
271 |
+
return $_data;
|
272 |
+
|
273 |
+
}
|
274 |
+
|
275 |
+
$to_send = array(
|
276 |
+
'slug' => $this->slug,
|
277 |
+
'is_ssl' => is_ssl(),
|
278 |
+
'fields' => array(
|
279 |
+
'banners' => array(),
|
280 |
+
'reviews' => false,
|
281 |
+
'icons' => array(),
|
282 |
+
)
|
283 |
+
);
|
284 |
+
|
285 |
+
$cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
|
286 |
+
|
287 |
+
// Get the transient where we store the api request for this plugin for 24 hours
|
288 |
+
$edd_api_request_transient = $this->get_cached_version_info( $cache_key );
|
289 |
+
|
290 |
+
//If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
|
291 |
+
if ( empty( $edd_api_request_transient ) ) {
|
292 |
+
|
293 |
+
$api_response = $this->api_request( 'plugin_information', $to_send );
|
294 |
+
|
295 |
+
// Expires in 3 hours
|
296 |
+
$this->set_version_info_cache( $api_response, $cache_key );
|
297 |
+
|
298 |
+
if ( false !== $api_response ) {
|
299 |
+
$_data = $api_response;
|
300 |
+
}
|
301 |
+
|
302 |
+
} else {
|
303 |
+
$_data = $edd_api_request_transient;
|
304 |
+
}
|
305 |
+
|
306 |
+
// Convert sections into an associative array, since we're getting an object, but Core expects an array.
|
307 |
+
if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) {
|
308 |
+
$_data->sections = $this->convert_object_to_array( $_data->sections );
|
309 |
+
}
|
310 |
+
|
311 |
+
// Convert banners into an associative array, since we're getting an object, but Core expects an array.
|
312 |
+
if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) {
|
313 |
+
$_data->banners = $this->convert_object_to_array( $_data->banners );
|
314 |
+
}
|
315 |
+
|
316 |
+
// Convert icons into an associative array, since we're getting an object, but Core expects an array.
|
317 |
+
if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) {
|
318 |
+
$_data->icons = $this->convert_object_to_array( $_data->icons );
|
319 |
+
}
|
320 |
+
|
321 |
+
return $_data;
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Convert some objects to arrays when injecting data into the update API
|
326 |
+
*
|
327 |
+
* Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON
|
328 |
+
* decoding, they are objects. This method allows us to pass in the object and return an associative array.
|
329 |
+
*
|
330 |
+
* @since 3.6.5
|
331 |
+
*
|
332 |
+
* @param stdClass $data
|
333 |
+
*
|
334 |
+
* @return array
|
335 |
+
*/
|
336 |
+
private function convert_object_to_array( $data ) {
|
337 |
+
$new_data = array();
|
338 |
+
foreach ( $data as $key => $value ) {
|
339 |
+
$new_data[ $key ] = $value;
|
340 |
+
}
|
341 |
+
|
342 |
+
return $new_data;
|
343 |
+
}
|
344 |
+
|
345 |
+
/**
|
346 |
+
* Disable SSL verification in order to prevent download update failures
|
347 |
+
*
|
348 |
+
* @param array $args
|
349 |
+
* @param string $url
|
350 |
+
* @return object $array
|
351 |
+
*/
|
352 |
+
public function http_request_args( $args, $url ) {
|
353 |
+
|
354 |
+
$verify_ssl = $this->verify_ssl();
|
355 |
+
if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
|
356 |
+
$args['sslverify'] = $verify_ssl;
|
357 |
+
}
|
358 |
+
return $args;
|
359 |
+
|
360 |
+
}
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Calls the API and, if successfull, returns the object delivered by the API.
|
364 |
+
*
|
365 |
+
* @uses get_bloginfo()
|
366 |
+
* @uses wp_remote_post()
|
367 |
+
* @uses is_wp_error()
|
368 |
+
*
|
369 |
+
* @param string $_action The requested action.
|
370 |
+
* @param array $_data Parameters for the API action.
|
371 |
+
* @return false|object
|
372 |
+
*/
|
373 |
+
private function api_request( $_action, $_data ) {
|
374 |
+
|
375 |
+
global $wp_version, $edd_plugin_url_available;
|
376 |
+
|
377 |
+
// Do a quick status check on this domain if we haven't already checked it.
|
378 |
+
$store_hash = md5( $this->api_url );
|
379 |
+
if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
|
380 |
+
$test_url_parts = parse_url( $this->api_url );
|
381 |
+
|
382 |
+
$scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http';
|
383 |
+
$host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
|
384 |
+
$port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
|
385 |
+
|
386 |
+
if ( empty( $host ) ) {
|
387 |
+
$edd_plugin_url_available[ $store_hash ] = false;
|
388 |
+
} else {
|
389 |
+
$test_url = $scheme . '://' . $host . $port;
|
390 |
+
$response = wp_remote_get( $test_url, array( 'timeout' => $this->health_check_timeout, 'sslverify' => true ) );
|
391 |
+
$edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
|
392 |
+
}
|
393 |
+
}
|
394 |
+
|
395 |
+
if ( false === $edd_plugin_url_available[ $store_hash ] ) {
|
396 |
+
return;
|
397 |
+
}
|
398 |
+
|
399 |
+
$data = array_merge( $this->api_data, $_data );
|
400 |
+
|
401 |
+
if ( $data['slug'] != $this->slug ) {
|
402 |
+
return;
|
403 |
+
}
|
404 |
+
|
405 |
+
if( $this->api_url == trailingslashit ( home_url() ) ) {
|
406 |
+
return false; // Don't allow a plugin to ping itself
|
407 |
+
}
|
408 |
+
|
409 |
+
$api_params = array(
|
410 |
+
'edd_action' => 'get_version',
|
411 |
+
'license' => ! empty( $data['license'] ) ? $data['license'] : '',
|
412 |
+
'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
|
413 |
+
'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
|
414 |
+
'version' => isset( $data['version'] ) ? $data['version'] : false,
|
415 |
+
'slug' => $data['slug'],
|
416 |
+
'author' => $data['author'],
|
417 |
+
'url' => home_url(),
|
418 |
+
'beta' => ! empty( $data['beta'] ),
|
419 |
+
);
|
420 |
+
|
421 |
+
$verify_ssl = $this->verify_ssl();
|
422 |
+
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
|
423 |
+
|
424 |
+
if ( ! is_wp_error( $request ) ) {
|
425 |
+
$request = json_decode( wp_remote_retrieve_body( $request ) );
|
426 |
+
}
|
427 |
+
|
428 |
+
if ( $request && isset( $request->sections ) ) {
|
429 |
+
$request->sections = maybe_unserialize( $request->sections );
|
430 |
+
} else {
|
431 |
+
$request = false;
|
432 |
+
}
|
433 |
+
|
434 |
+
if ( $request && isset( $request->banners ) ) {
|
435 |
+
$request->banners = maybe_unserialize( $request->banners );
|
436 |
+
}
|
437 |
+
|
438 |
+
if ( $request && isset( $request->icons ) ) {
|
439 |
+
$request->icons = maybe_unserialize( $request->icons );
|
440 |
+
}
|
441 |
+
|
442 |
+
if( ! empty( $request->sections ) ) {
|
443 |
+
foreach( $request->sections as $key => $section ) {
|
444 |
+
$request->$key = (array) $section;
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
return $request;
|
449 |
+
}
|
450 |
+
|
451 |
+
public function show_changelog() {
|
452 |
+
|
453 |
+
global $edd_plugin_data;
|
454 |
+
|
455 |
+
if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
|
456 |
+
return;
|
457 |
+
}
|
458 |
+
|
459 |
+
if( empty( $_REQUEST['plugin'] ) ) {
|
460 |
+
return;
|
461 |
+
}
|
462 |
+
|
463 |
+
if( empty( $_REQUEST['slug'] ) ) {
|
464 |
+
return;
|
465 |
+
}
|
466 |
+
|
467 |
+
if( ! current_user_can( 'update_plugins' ) ) {
|
468 |
+
wp_die( __( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), __( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) );
|
469 |
+
}
|
470 |
+
|
471 |
+
$data = $edd_plugin_data[ $_REQUEST['slug'] ];
|
472 |
+
$beta = ! empty( $data['beta'] ) ? true : false;
|
473 |
+
$cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' );
|
474 |
+
$version_info = $this->get_cached_version_info( $cache_key );
|
475 |
+
|
476 |
+
if( false === $version_info ) {
|
477 |
+
|
478 |
+
$api_params = array(
|
479 |
+
'edd_action' => 'get_version',
|
480 |
+
'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
|
481 |
+
'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
|
482 |
+
'slug' => $_REQUEST['slug'],
|
483 |
+
'author' => $data['author'],
|
484 |
+
'url' => home_url(),
|
485 |
+
'beta' => ! empty( $data['beta'] )
|
486 |
+
);
|
487 |
+
|
488 |
+
$verify_ssl = $this->verify_ssl();
|
489 |
+
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
|
490 |
+
|
491 |
+
if ( ! is_wp_error( $request ) ) {
|
492 |
+
$version_info = json_decode( wp_remote_retrieve_body( $request ) );
|
493 |
+
}
|
494 |
+
|
495 |
+
|
496 |
+
if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
|
497 |
+
$version_info->sections = maybe_unserialize( $version_info->sections );
|
498 |
+
} else {
|
499 |
+
$version_info = false;
|
500 |
+
}
|
501 |
+
|
502 |
+
if( ! empty( $version_info ) ) {
|
503 |
+
foreach( $version_info->sections as $key => $section ) {
|
504 |
+
$version_info->$key = (array) $section;
|
505 |
+
}
|
506 |
+
}
|
507 |
+
|
508 |
+
$this->set_version_info_cache( $version_info, $cache_key );
|
509 |
+
|
510 |
+
}
|
511 |
+
|
512 |
+
if( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
|
513 |
+
echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
|
514 |
+
}
|
515 |
+
|
516 |
+
exit;
|
517 |
+
}
|
518 |
+
|
519 |
+
public function get_cached_version_info( $cache_key = '' ) {
|
520 |
+
|
521 |
+
if( empty( $cache_key ) ) {
|
522 |
+
$cache_key = $this->cache_key;
|
523 |
+
}
|
524 |
+
|
525 |
+
$cache = get_option( $cache_key );
|
526 |
+
|
527 |
+
if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
|
528 |
+
return false; // Cache is expired
|
529 |
+
}
|
530 |
+
|
531 |
+
// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
|
532 |
+
$cache['value'] = json_decode( $cache['value'] );
|
533 |
+
if ( ! empty( $cache['value']->icons ) ) {
|
534 |
+
$cache['value']->icons = (array) $cache['value']->icons;
|
535 |
+
}
|
536 |
+
|
537 |
+
return $cache['value'];
|
538 |
+
|
539 |
+
}
|
540 |
+
|
541 |
+
public function set_version_info_cache( $value = '', $cache_key = '' ) {
|
542 |
+
|
543 |
+
if( empty( $cache_key ) ) {
|
544 |
+
$cache_key = $this->cache_key;
|
545 |
+
}
|
546 |
+
|
547 |
+
$data = array(
|
548 |
+
'timeout' => strtotime( '+3 hours', time() ),
|
549 |
+
'value' => json_encode( $value )
|
550 |
+
);
|
551 |
+
|
552 |
+
update_option( $cache_key, $data, 'no' );
|
553 |
+
|
554 |
+
}
|
555 |
+
|
556 |
+
/**
|
557 |
+
* Returns if the SSL of the store should be verified.
|
558 |
+
*
|
559 |
+
* @since 1.6.13
|
560 |
+
* @return bool
|
561 |
+
*/
|
562 |
+
private function verify_ssl() {
|
563 |
+
return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
|
564 |
+
}
|
565 |
+
|
566 |
+
}
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: galdub, tomeraharon, premio
|
|
3 |
Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
|
4 |
Requires at least: 3.0.0
|
5 |
Tested up to: 5.2
|
6 |
-
Stable tag: 2.1.
|
7 |
Plugin URI: https://premio.io/downloads/folders/
|
8 |
|
9 |
Folders is a FREE WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
|
@@ -24,6 +24,9 @@ There are several ways professionals are using the Folders file manager plugin t
|
|
24 |
|
25 |
<strong>Note:</strong> adding a page/post/image into a folder will not change its URL.
|
26 |
|
|
|
|
|
|
|
27 |
= So How Does it Work? =
|
28 |
|
29 |
It’s rather simple really – once you install the plugin, you can begin using it. If you’re a content creator, you can upload text, images, videos, and audio at the click of a button. Then you can organize everything you upload into neat subfolders. For instance, you can create a media folder, content folder, and image folder, then have them all organized by date. It has a drag and drop interface, making it user-friendly for everyone. It’s like having your own media library at your own disposal. You can create this media library for yourself or others – it’s perfect for website owners and content professionals!
|
@@ -47,6 +50,7 @@ E-Commerce businesses: Quickly upload new products and descriptions and then pla
|
|
47 |
* Drag and drop folders, change order, and hierarchy
|
48 |
* Bulk select images and media files and drag them to any folder
|
49 |
* Rename folders
|
|
|
50 |
* Sticky toolbar for the media library so you can navigate and organize your folders with ease
|
51 |
* Add stars to important directories
|
52 |
* Simultaneously assign and organize media, pages, posts, templates and custom posts while adding them to directories
|
@@ -107,8 +111,14 @@ Your Folders plugin and all your settings will continue to work as before; howev
|
|
107 |
= How do I activate my pro plan? =
|
108 |
Just follow our <a href="https://premio.io/wordpress-premio-pro-version-installation-guide/" target="_blank" title="WordPress installation guide">pro installation guide</a>.
|
109 |
|
|
|
|
|
|
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
112 |
= 2.1.1 =
|
113 |
* Some exciting updates including: select relevant folders when you add media, keep your media library toolbar sticky when you organize you media, we support custom posts now, security fixes, bug fixes and more!
|
114 |
|
3 |
Tags: folder, folders, organize, pages folders, media library, posts folders, media folders, subfolders, file manager, directories
|
4 |
Requires at least: 3.0.0
|
5 |
Tested up to: 5.2
|
6 |
+
Stable tag: 2.1.2
|
7 |
Plugin URI: https://premio.io/downloads/folders/
|
8 |
|
9 |
Folders is a FREE WordPress plugin that will help you quickly organize and manage all of your Pages, Posts and Media library files in folders.
|
24 |
|
25 |
<strong>Note:</strong> adding a page/post/image into a folder will not change its URL.
|
26 |
|
27 |
+
= Live Demo =
|
28 |
+
A live demo for the Folders plugin is available at <a href="https://demo.premio.io/folders/?utm_source=wordpressorg" target="_blank" title="Premio.io demo site">Premio's demo site</a>.
|
29 |
+
|
30 |
= So How Does it Work? =
|
31 |
|
32 |
It’s rather simple really – once you install the plugin, you can begin using it. If you’re a content creator, you can upload text, images, videos, and audio at the click of a button. Then you can organize everything you upload into neat subfolders. For instance, you can create a media folder, content folder, and image folder, then have them all organized by date. It has a drag and drop interface, making it user-friendly for everyone. It’s like having your own media library at your own disposal. You can create this media library for yourself or others – it’s perfect for website owners and content professionals!
|
50 |
* Drag and drop folders, change order, and hierarchy
|
51 |
* Bulk select images and media files and drag them to any folder
|
52 |
* Rename folders
|
53 |
+
* Monitor all the unassigned media library files, posts, pages, and custom posts so you can organize them easily to your folders
|
54 |
* Sticky toolbar for the media library so you can navigate and organize your folders with ease
|
55 |
* Add stars to important directories
|
56 |
* Simultaneously assign and organize media, pages, posts, templates and custom posts while adding them to directories
|
111 |
= How do I activate my pro plan? =
|
112 |
Just follow our <a href="https://premio.io/wordpress-premio-pro-version-installation-guide/" target="_blank" title="WordPress installation guide">pro installation guide</a>.
|
113 |
|
114 |
+
= Is there a live demo for Folders=
|
115 |
+
A live demo for the Folders plugin is available at <a href="https://demo.premio.io/folders/?utm_source=wordpressorg" target="_blank" title="Premio.io demo site">Premio's demo site</a>.
|
116 |
+
|
117 |
== Changelog ==
|
118 |
|
119 |
+
= 2.1.2 =
|
120 |
+
* Now you can see all the unassinged media folder files, pages, posts and custom posts
|
121 |
+
|
122 |
= 2.1.1 =
|
123 |
* Some exciting updates including: select relevant folders when you add media, keep your media library toolbar sticky when you organize you media, we support custom posts now, security fixes, bug fixes and more!
|
124 |
|
templates/admin/admin-content.php
CHANGED
@@ -54,6 +54,9 @@ defined('ABSPATH') or die('Nope, not accessing this');
|
|
54 |
<div class="header-posts">
|
55 |
<a href="javascript:;" class="all-posts"><span class="wcp-icon folder-icon-insert_drive_file"></span> <?php echo __("All ".$title, WCP_FOLDER) ?> <span class="total-count"><?php echo $total_posts ?></span></a>
|
56 |
</div>
|
|
|
|
|
|
|
57 |
<div id="custom-menu" class="wcp-custom-menu <?php echo ($status==1)?"active":"" ?>">
|
58 |
<!--<div class="wcp-parent" id="title0"><i class="fa fa-folder-o"></i> All Folders</div>-->
|
59 |
<ul class='space first-space' id='space_0'>
|
54 |
<div class="header-posts">
|
55 |
<a href="javascript:;" class="all-posts"><span class="wcp-icon folder-icon-insert_drive_file"></span> <?php echo __("All ".$title, WCP_FOLDER) ?> <span class="total-count"><?php echo $total_posts ?></span></a>
|
56 |
</div>
|
57 |
+
<div class="un-categorised-items">
|
58 |
+
<a href="javascript:;" class="un-categorized-posts"><?php echo __("Unassigned ".$title, WCP_FOLDER) ?> <span class="total-count total-empty"><?php echo $total_empty ?></span> </a>
|
59 |
+
</div>
|
60 |
<div id="custom-menu" class="wcp-custom-menu <?php echo ($status==1)?"active":"" ?>">
|
61 |
<!--<div class="wcp-parent" id="title0"><i class="fa fa-folder-o"></i> All Folders</div>-->
|
62 |
<ul class='space first-space' id='space_0'>
|