Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager - Version 2.6.5

Version Description

Import folders from HappyFiles (Happy Files) and Mediamatic + fixed some bugs

Download this release

Release Info

Developer galdub
Plugin Icon wp plugin Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager
Version 2.6.5
Comparing to
See all releases

Code changes from version 2.6.4 to 2.6.5

assets/css/design.css CHANGED
@@ -481,17 +481,21 @@ span.total-count {
481
  color: #ffffff !important;
482
  }
483
  .dynamic-menu {
484
- position: absolute;
485
  left: auto;
486
  right: 5px;
487
  background: #fff;
488
  width: 170px;
489
  padding: 0;
490
- z-index: 101;
491
  -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
492
  -moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
493
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25)
494
  }
 
 
 
 
495
  .sticky-folders .dynamic-menu {
496
  left: auto;
497
  right: 50px;
@@ -615,15 +619,15 @@ span.total-count {
615
  li.active-menu {
616
  z-index: 2 !important
617
  }
 
 
 
618
  .wp-list-table th.column-title {
619
- width: 22% !important;
620
  }
621
  .wp-list-table #wcp_move {
622
  width: 20px !important
623
  }
624
- body.woocommerce-page th#taxonomy-product_folder {
625
- width: 10% !important;
626
- }
627
  td.wcp_move.column-wcp_move {
628
  vertical-align: middle
629
  }
@@ -1629,7 +1633,9 @@ span.folder-count:empty {
1629
  margin: 45px auto 15px;
1630
  padding: 0 2px;
1631
  }
1632
-
 
 
1633
  .folder-grouptextarea {
1634
  resize: none;
1635
  }
@@ -1779,6 +1785,9 @@ span.create_new_folder {
1779
  #custom-menu .route.has-sub-tree.has-search > .nav-icon > .pfolder-arrow-down {
1780
  transform: rotate(0);
1781
  }
 
 
 
1782
  @media screen and (max-width: 960px) {
1783
  .wcp-content {
1784
  left: 36px
481
  color: #ffffff !important;
482
  }
483
  .dynamic-menu {
484
+ position: fixed;
485
  left: auto;
486
  right: 5px;
487
  background: #fff;
488
  width: 170px;
489
  padding: 0;
490
+ z-index: 1000001;
491
  -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
492
  -moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
493
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25)
494
  }
495
+ .dynamic-menu ul {
496
+ margin: 0;
497
+ padding: 0;
498
+ }
499
  .sticky-folders .dynamic-menu {
500
  left: auto;
501
  right: 50px;
619
  li.active-menu {
620
  z-index: 2 !important
621
  }
622
+ body.woocommerce-page th#taxonomy-product_folder {
623
+ width: 10% !important;
624
+ }
625
  .wp-list-table th.column-title {
626
+ width: 22% !important;
627
  }
628
  .wp-list-table #wcp_move {
629
  width: 20px !important
630
  }
 
 
 
631
  td.wcp_move.column-wcp_move {
632
  vertical-align: middle
633
  }
1633
  margin: 45px auto 15px;
1634
  padding: 0 2px;
1635
  }
1636
+ .add-folder-note {
1637
+ padding: 10px 0 0;
1638
+ }
1639
  .folder-grouptextarea {
1640
  resize: none;
1641
  }
1785
  #custom-menu .route.has-sub-tree.has-search > .nav-icon > .pfolder-arrow-down {
1786
  transform: rotate(0);
1787
  }
1788
+ body:not(.woocommerce-page) .wp-list-table th {
1789
+ width: auto;
1790
+ }
1791
  @media screen and (max-width: 960px) {
1792
  .wcp-content {
1793
  left: 36px
assets/css/design.min.css CHANGED
@@ -1 +1 @@
1
- .wcp-custom-menu{padding-left:0}.wcp-custom-menu a,.wcp-custom-menu a:focus{outline:0;box-shadow:none}.wcp-custom-menu{position:relative}.wcp-container ul{list-style:none}.wcp-container .route{position:relative;list-style-type:none;border:0;margin:0;padding:0;top:0;margin-top:0;max-height:100%!important;width:100%;border-radius:2px;z-index:-1;background:0 0}.wcp-container .route span{position:absolute;top:2px;left:0;z-index:10;width:20px;height:18px;text-indent:0;font-size:20px;background:no-repeat;text-align:center}.wcp-container .route .title{position:absolute;border:0;margin:0;padding:0;height:30px;width:200px;text-indent:28px;background:0 0;box-shadow:none;font-size:13px;line-height:26px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;overflow:hidden;font-weight:400}.wcp-container .first-title{margin-left:10px}.wcp-container .space{position:relative;list-style-type:none;border:0;margin:0 0 0 20px;padding:0 0 30px 0;width:40px;top:30px;height:100%;z-index:1}.wcp-container .first-space{margin-left:0;top:0;padding:0}i.fa-caret-right{transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}li.active>span>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}li.active>span>i.fa-folder:before{content:"\f07c"}.has-sub-tree>ul.ui-sortable li{display:none}.has-sub-tree.active>ul.ui-sortable>li{display:block}.nav-icon{display:none;left:-10px!important;cursor:pointer}.has-sub-tree>.nav-icon{display:block}.wcp-content{position:fixed!important;top:32px;left:160px;bottom:0;width:280px;box-sizing:border-box;z-index:1;direction:ltr;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] .wcp-content{left:auto;right:160px}body.folded .wcp-content{left:36px}html[dir=rtl] body.folded .wcp-content{left:auto;right:36px}body.wp-admin #wpcontent{padding-left:305px;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] body.wp-admin #wpcontent{padding-left:0;padding-right:305px}.wcp-container{padding:20px 20px 20px 16px}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.form-operations{border:solid 1px #e5e5e5;border-right:none;margin-bottom:20px}.form-operations ul{margin:0;padding:0}.form-operations li{display:block;float:left;width:20%;text-align:center;background:#fff;margin:0;padding:0}.form-operations li a{display:block;padding:10px 0;border-right:solid 1px #e5e5e5;font-size:16px;color:#727272}.clearfix{clear:both}.wcp-parent-data{position:relative}.wcp-parent{position:absolute;left:-21px;font-weight:700;font-size:14px}.wcp-parent .fa{font-size:18px;margin-right:8px}.wcp-form-data{background:#fff;border:solid 1px #f1f1f1;padding:15px;display:none;margin-bottom:20px}.wcp-form-title{color:#727272;font-size:14px;text-transform:uppercase;padding:0 0 10px 0}.wcp-form-data .form-field{padding:0 0 10px 0}.wcp-form-data .form-field input,.wcp-form-data .form-field select{width:100%}button#wcp-save-folder{float:right}.wcp-form-message span{display:block;padding:5px 10px;background:#ffabab;margin-bottom:10px;color:#000;border:solid 1px #8c0000;border-radius:4px}.wcp-container .route.active-item>h3.title{background:#008ec2;color:#fff;border-radius:4px}.wcp-container .route span.ui-icon{line-height:24px;font-size:18px;cursor:move;left:5px;top:2px;height:26px}.route.active-item>span.ui-icon{background:#008ec2;color:#fff}#custom-menu.active>ul>li.route{display:block}.wcp-parent.active>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.wcp-parent.active>i.fa-folder:before{content:"\f07c"}.wcp-container .route .title .folder-sticky-icon,.wcp-container .route .title .move-folder-icon{float:right;position:relative;top:0;left:auto;width:20px;height:30px;line-height:26px;display:none}.wcp-container .route.is-sticky .title .folder-sticky-icon{display:block}span.folder-sticky-icon i{font-size:14px!important}.mCS_no_scrollbar .mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden{overflow:visible}body:not(.no-hover-css) .wcp-container .route .title:hover{background:rgba(250,22,107,.08);cursor:pointer}body:not(.no-hover-css) .wcp-container .route .title:hover>.folder-sticky-icon,body:not(.no-hover-css) .wcp-container .route .title:hover>.star-icon{display:none!important}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .move-folder-icon,body:not(.no-hover-css) .wcp-container .route .title:hover .move-folder-icon{display:block}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .ui-icon .pfolder-folder-close:before,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon .pfolder-folder-close:before{content:"\e901"!important}#custom-menu .route.active>h3.title .pfolder-folder-close:before{content:"\e902"}.route.is-sticky>h3.title>.ui-icon>.folder-sticky-icon{display:block;width:100%;height:auto;margin:3px auto 0}.route.is-sticky.active-item>h3.title>.ui-icon>.folder-sticky-icon{filter:invert(100%);-webkit-filter:invert(100%)}.wcp-container .route .title.wcp-drop-hover img{filter:invert(100%);-webkit-filter:invert(100%)}.plugin-button{float:right}.plugin-button.d-block{float:none}.plugin-title{display:inline-block;vertical-align:middle}.add-new-folder{text-decoration:none;display:inline-block;font-size:14px;padding:4px 10px 4px 4px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:4px;line-height:24px;position:relative}.add-new-folder:focus,.add-new-folder:hover{color:#fff}.add-new-folder:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.add-new-folder span{display:block;float:left;line-height:24px;font-size:14px;margin-right:5px}.add-new-folder span.folder-icon-create_new_folder{font-size:20px}.form-options{background:#fff;padding:5px;margin:0 0;border-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.form-options .form-options{padding:0;background:0 0;box-shadow:none}.form-options ul{margin:0;padding:0}.form-options>ul>li{display:inline-block;margin:0 2px 0 0;vertical-align:top}.form-options>ul>li.last{margin:0}.form-options>ul>li>a{display:inline-block;text-decoration:none;padding:5px 5px;color:#000;vertical-align:middle;margin:0 0 5px 0;background:#f1f1f1;border-radius:4px}.form-options>ul>li.last>a{padding:3px}a#expand-collapse-list.all-open span{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.form-options>ul>li>a:hover{background:#404040;color:#fff}.form-options>ul>li>a:hover span.icon{color:#fff}.form-options>ul>li>a.expand-collapse{width:14px;text-align:center}.form-options a.expand-collapse span.icon{font-size:10px}.form-options span.icon{font-size:12px;display:inline-block;vertical-align:baseline;color:#a4c0d2}.un-categorised-items{border-radius:3px}.header-posts a,.un-categorised-items a{color:#444;padding:7px;display:block;text-decoration:none;font-size:14px;border-radius:4px;line-height:18px}.header-posts a:hover,.un-categorised-items.active-item,.un-categorised-items:hover{background:rgba(250,22,107,.08);border-radius:4px}.header-posts a.active-item,.un-categorised-items.active-item{background:#008ec2!important;color:#fff!important}.un-categorised-items.active-item a{color:#fff!important}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#fff!important}span.total-count{float:right;font-size:12px;line-height:16px}.wcp-icon{display:inline-block;font-size:16px;vertical-align:top;margin-right:3px}#custom-menu .wcp-icon{font-size:16px!important;line-height:24px}#custom-menu .route .nav-icon .wcp-icon{font-size:9px!important;color:#fa166b;font-weight:700;transform:rotate(-90deg);transition:all .25s linear}#custom-menu .route.active .nav-icon .wcp-icon{transform:rotate(0)}.route.active>.nav-icon>.folder-icon-arrow_right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.route.active>.ui-icon>.folder-icon-folder:before{content:"\e90c"}.wcp-container .route span.total-count{position:relative;font-size:10px;float:right;text-align:center;width:auto;display:block;margin:4px 8px 3px 3px;color:#23282d!important;line-height:16px;height:16px}.wcp-container .route.active-item>h3.title span.total-count{color:#fff!important}.dynamic-menu{position:absolute;left:auto;right:5px;background:#fff;width:170px;padding:0;z-index:101;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25)}.sticky-folders .dynamic-menu{left:auto;right:50px}.dynamic-menu li{position:relative;width:100%;display:block!important;padding:2px 0;margin:0}.dynamic-menu a{text-decoration:none;color:#333;position:relative;display:block;padding:5px 10px;line-height:18px;white-space:nowrap}.dynamic-menu ul>li>a>span,.dynamic-menu ul>li>a>span span{position:relative!important;display:inline-block;vertical-align:middle;margin-right:5px;top:auto!important;width:20px!important;height:20px!important;line-height:14px}#custom-menu .dynamic-menu ul>li>a .sticky-pin{line-height:20px}#custom-menu .dynamic-menu ul>li>a .sticky-pin i{font-size:16px!important}.dynamic-menu ul>li>a>span span{top:auto;height:auto;width:auto;margin:0;left:auto;vertical-align:baseline;display:inline}.dynamic-menu li.new-folder{border-bottom:solid 1px #d8d8d8}.dynamic-menu a.active,.dynamic-menu a:hover{background:#efefef;color:#000}.dynamic-menu ul li span{font-size:20px;vertical-align:middle}.dynamic-menu ul li span.sticky-folder-icon{width:20px}.dynamic-menu ul li span i{font-size:14px;line-height:16px;font-weight:400}.wcp-form-input{padding-left:35px;box-sizing:border-box;position:relative}.wcp-form-input input{width:100%}.wcp-form-btn{padding:4px 0 4px 2px}.wcp-form-input:before{content:"\e90d";font-family:folder-icon!important;speak:none;position:absolute;left:0;font-size:28px;top:5px}.add-new-folder-btn{margin-right:5px!important}.form-loader{width:100%;height:5px;margin:0 0 10px}.form-loader-count{width:0;height:5px;background:url(../images/form-loader.png);transition:all 2.5s linear;-webkit-transition:all 2s linear;-moz-transition:all 2.5s linear}.route.is-high>.ui-icon>i:before{content:"\e900"!important}.route.is-high.active>.ui-icon>i:before{content:"\e90c"!important;z-index:11;color:#444;font-size:20px}.route.is-high.active>.ui-icon>i:after{content:"\e907";margin-left:-1.2em;color:#444;font-size:11px;top:1px;position:absolute}.route.is-high.active.active-item>.ui-icon>i:after,.route.is-high.active.active-item>.ui-icon>i:before{color:#fff}li.active-menu{z-index:2!important}.wp-list-table th.column-title{width:22%!important}.wp-list-table #wcp_move{width:20px!important}body.woocommerce-page th#taxonomy-product_folder{width:10%!important}td.wcp_move.column-wcp_move{vertical-align:middle}.wp-list-table tr td .wcp-move-file{vertical-align:middle;opacity:0}.wp-list-table td.wcp_move.column-wcp_move.wcp-draggable,.wp-list-table tr:hover td .wcp-move-file{opacity:1}.wcp-drop-hover{background:#fa166b!important;z-index:2!important;color:#fff!important}.wcp-drop-hover i{color:#fff!important}.ui-draggable-dragging{z-index:1051!important}.wcp-hover-list{background:#fa166b!important;color:#fff;position:relative}.wcp-hover-list a{color:#fff}.wcp-hover-list span.total-count{color:#000}span.wcp-item{display:none}.wcp-move-file{cursor:move}.wcp-drop-hover-list a.folder-view{background:#008ec2;color:#fff;border:solid 1px #fff;position:relative}.wcp-drop-hover-list a.folder-view:before{width:100%;height:100%;content:"";position:absolute;top:-2px;left:-2px;border:solid 1px #008ec2;padding:1px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}.ui-draggable-dragging.wcp-move-file{z-index:5001;display:inline-block;border:solid 2px #0073aa;padding:5px 10px;border-radius:5px;background:#e4f6ff;position:fixed!important;max-width:230px;overflow:hidden;width:auto!important}.ui-draggable-dragging.wcp-move-file span{display:block;float:left}.ui-draggable-dragging.wcp-move-file span.wcp-move{margin-right:5px;display:block;float:left}.wcp-container .route span.title-text{position:relative;top:auto;left:auto;display:inline-block;font-size:16px;line-height:30px;height:30px;width:calc(100% - 100px);overflow:hidden;white-space:nowrap;text-align:left}.ui-resizable-handle.ui-resizable-e{position:absolute;top:0;height:100%;height:100vh;width:1px;right:0;border-right:1px solid #ccc;cursor:col-resize}.ui-resizable-handle.ui-resizable-e:before,.ui-resizable-handle.ui-resizable-w:before{content:"";top:25%;width:3px;height:30px;position:absolute;border-left:solid 1px #fa166b;border-right:solid 1px #fa166b;left:-1px}.ui-resizable-handle.ui-resizable-w{position:absolute;top:0;height:100%;height:100vh;width:1px;left:0;border-right:1px solid #ccc;cursor:col-resize}div#custom-menu{padding:0 10px 10px;background:#fff;box-shadow:0 4px 21px rgba(7,16,28,.1)}body:not(.no-hover-css) .sticky-folders li a:hover span.update-inline-record,body:not(.no-hover-css) .wcp-container .route h3:hover>span.update-inline-record{width:18px}.tree-structure li{display:block;width:auto;float:left;margin:0;padding:0}.tree-structure .folder-item{padding:4px;position:relative}.tree-structure .folder-view{display:block;border:none;color:#404040;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;position:relative;cursor:pointer;background:#f1f1f1;font-size:14px;line-height:16px}.tree-structure .folder-view span.item-name{display:block;padding:8px 15px 8px 30px;position:relative;width:100%;overflow:hidden;height:32px;font-size:14px;box-sizing:border-box}.folder-view span.item-name:before{content:"\e906";font-family:premio-folder!important;position:absolute;left:8px;font-size:16px;color:#a4c0d2}.folder-view.is-high span.item-name:before{content:"\e900"}.folder-view.is-post span.item-name:before{content:"\e901"}.tree-structure span.folder-option{position:absolute;right:0;font-family:folder-icon!important;top:0;font-size:20px;line-height:38px;z-index:1;cursor:pointer;display:none}.tree-structure .folder-view:hover span.folder-option{display:block}.tree-structure span.folder-option:hover{color:#f51366}.tree-structure span.folder-option:after{content:"\e90a"}.tree-structure li{position:relative}.tree-structure{margin-left:-8px;margin-right:-8px}.tree-structure .folder-view span.folder-title{width:100%;display:block}.swal2-popup .swal2-title{line-height:36px}.attachments-browser.ui-draggable-dragging .media-sidebar,.attachments-browser.ui-draggable-dragging .media-toolbar,.attachments-browser.ui-draggable-dragging .uploader-inline,.attachments-browser.ui-draggable-dragging ul.attachments{display:none}.attachments.ui-sortable.ui-draggable-dragging{z-index:5000}.selected-items{background:#0073aa;color:#fff;padding:10px 20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;margin-top:0;cursor:none;font-size:12px}.media-frame,.media-frame .attachments-browser,.media-frame-content{overflow:inherit}.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-3d.mCSB_scrollTools .mCSB_draggerRail{width:2px!important;background-color:transparent!important;box-shadow:none!important}.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:2px!important;background-color:#fa166b!important;margin:0 0 0 4px!important;padding:0!important}.mCSB_outside+.mCSB_scrollTools{right:-15px!important}body.upload-php.eml-grid #wpbody{position:relative!important;top:0!important;bottom:auto!important;left:auto!important;right:auto!important;height:auto}#footer-thankyou{display:none}span.upgrade-message{padding:0;background:#fff;display:inline-block;font-size:12px;color:#000}span.upgrade-message a.pink,span.upgrade-message span.pink{color:#ff5983;text-decoration:none;font-weight:700}.media-toolbar.sticky-media{position:fixed;top:32px;right:18px!important;left:auto}.media-position{width:1px;height:1px}.media-frame.mode-grid .media-toolbar{margin:0!important}.button-disabled{cursor:no-drop;pointer-events:none}.wcp-hide-show-buttons{position:absolute;top:25px;right:-20px;z-index:10001}html[dir=rtl] .wcp-hide-show-buttons{left:-20px;right:auto}.wcp-hide-show-buttons .toggle-buttons{background:#f51366;color:#fff;display:inline-block;margin:0;padding:0;float:left;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%;display:none;width:20px;height:20px;cursor:pointer;position:relative}.wcp-hide-show-buttons:hover .toggle-buttons:after{content:"";width:100%;height:100%;background:0 0;position:absolute;top:0;left:0;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-top-left-radius:50%;-webkit-border-bottom-left-radius:50%;-moz-border-radius-top-left:50%;-moz-border-radius-bottom-left:50%;border-top-left-radius:50%;border-bottom-left-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons span{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.hide-folders-area .wcp-content{width:0!important}.hide-folders-area .wcp-container{display:none}.wcp-hide-show-buttons .toggle-buttons.active{display:block}#wcp-content.no-transition .wcp-container{display:none}button.button.organize-button{vertical-align:middle;text-decoration:none;display:inline-block;font-size:14px;padding:4px 10px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:3px;line-height:14px;-webkit-box-shadow:0 3px 5px -3px #333;-moz-box-shadow:0 3px 5px -3px #333;box-shadow:0 3px 5px -3px #333;position:relative}button.button.organize-button:focus,button.button.organize-button:hover{color:#fff}button.button.organize-button:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.tree-structure-content ul{margin:0;padding:0}.tree-structure-content{padding:5px 10px;background:#fff;margin:10px 0 15px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border:solid 1px #ccc}.tree-structure-content .tree-structure{height:40px;overflow:hidden;transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}.tree-structure-content.active .tree-structure{height:auto}.folders-toggle-button{height:15px;text-align:center;position:relative}.folders-toggle-button span{background:#f51366;color:#fff;height:20px;width:30px;text-align:center;display:block;margin:0 auto;position:absolute;left:0;right:0;bottom:-10px;cursor:pointer;font-family:dashicons;font-size:20px;line-height:20px}.folders-toggle-button span:after{content:"\f347"}.tree-structure-content.active .folders-toggle-button span:after{content:"\f343"}span.media-info-message{vertical-align:middle;line-height:20px;font-weight:700;color:#f51366;padding:0 0 10px 0;display:none!important}span.media-info-message.active{display:block!important}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none}.folder-popup-form.disabled{pointer-events:none}.popup-form-content{background:#fff;min-height:100px;width:400px;text-align:center;margin:0 auto;position:absolute;left:0;right:0;top:50%;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-o-transform:translate(0,-50%);-ms-transform:translate(0,-50%);padding:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#484848}.folder-form-buttons a,.folder-form-buttons button{display:inline-flex;padding:0;text-decoration:none;margin:10px 3px;border-radius:4px;border:solid 1px #1da1f4;line-height:34px;font-weight:700;font-size:14px;box-sizing:border-box;height:36px;cursor:pointer;flex:1;justify-content:center}.folder-form-buttons a span,.folder-form-buttons button span{-webkit-animation:fa-spin .75s infinite linear;animation:fa-spin .75s infinite linear;padding:7px}.wcp-container .folder-tooltip{position:relative}.wcp-container .folder-tooltip::after,.wcp-container .folder-tooltip::before{text-transform:none;font-size:.9em;line-height:1;user-select:none;pointer-events:none;position:absolute;display:none;opacity:0}.wcp-container .folder-tooltip::before{content:'';border:5px solid transparent;z-index:1001}.wcp-container .folder-tooltip::after{content:attr(data-folder-tooltip);font-family:Helvetica,sans-serif;text-align:center;min-width:3em;max-width:21em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:1ch 1.5ch;border-radius:.3ch;box-shadow:0 1em 2em -.5em rgba(0,0,0,.35);background:#333;color:#fff;z-index:1000}.wcp-container .folder-tooltip:hover::after,.wcp-container .folder-tooltip:hover::before{display:block;opacity:1}.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::before{bottom:100%;border-bottom-width:0;border-top-color:#333}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip[flow^=up]::after{bottom:calc(100% + 5px)}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::after,.wcp-container .folder-tooltip[flow^=up]::before{left:50%;transform:translate(-50%,-.5em)}.wp-core-ui .button-primary.select-all-item-btn{margin:11px 11px 11px 0;display:none!important}.wp-core-ui .button-primary.select-all-item-btn.active{display:inline-block!important}.form-options>ul>li.last.folder-checkbox{padding:5px 0 0}#custom-menu input.checkbox{display:none}#custom-menu.show-folder-checkbox input.checkbox{display:block;margin:5px 0 0 0}#custom-menu.show-folder-checkbox h3.title>.ui-icon>i,#custom-menu.show-folder-checkbox h3.title>.ui-icon>img{display:none!important}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.folder-form-buttons a:focus,.folder-form-buttons a:hover,.folder-form-buttons button:focus,.folder-form-buttons button:hover{color:#fff;outline:0}.folder-form-buttons a:focus{outline:0;outline:0}.form-cancel-btn,a.form-cancel-btn:hover{background-color:#fff;color:#3085d6;outline:0}.form-submit-btn{background-color:#3085d6;color:#fff;outline:0}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;text-align:center;text-transform:none;word-wrap:break-word;font-weight:700;font-size:22px;line-height:26px}.folder-form-message{font-size:15px;line-height:18px;color:#484848;padding:25px 70px}.folder-form-errors{margin:0 0 10px 0;padding:8px 0;background:#ffe4e4;color:#a20000;display:none}.folder-form-errors.active{display:block}span.folder-loader-ajax{margin:0;line-height:30px;display:none;vertical-align:middle}.folder-loader-ajax.active{display:inline-block}@-webkit-keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@-webkit-keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}#successAnimationCircle{stroke-dasharray:151px 151px;stroke:#2ce0a7}#successAnimationCheck{stroke-dasharray:36px 36px;stroke:#2ce0a7}#successAnimationResult{fill:#2ce0a7;opacity:0}svg#successAnimation{width:30px;height:34px;padding:0;display:none;float:left}#successAnimation.active{display:inline-block}.folder-loader-ajax img{display:none}.folder-loader-ajax img.active{display:inline-block}#successAnimation.animated{-webkit-animation:1s ease-out 0s 1 both scaleAnimation;animation:1s ease-out 0s 1 both scaleAnimation}#successAnimation.animated #successAnimationCircle{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationCheck{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationResult{-webkit-animation:.3s linear .9s both fadeIn;animation:.3s linear .9s both fadeIn}.mCSB_scrollTools a+.mCSB_draggerContainer{margin:10px 0!important}.popup-folder-title{font-weight:700;font-size:24px;padding:0 0 20px 0}.select-box{padding:20px 0 10px 0}.select-box select{width:100%;max-width:300px}.actions #media_folder,select.media-select-folder{width:132px}select#media-attachment-taxonomy-filter{width:132px}.custom-media-select{float:right;padding:10px 0 0 0;display:none}.custom-media-select.active{display:block}.folder-progress{background:#b4b9be;border-radius:4px;margin:5px 0 0 0;position:relative}.folder-meter{height:20px;position:relative;background:#f1f1f1;padding:0;width:0%;border-radius:4px;-webkit-transition:all .2s linear;transition:all .2s linear}.folder-meter>span{display:block;height:100%;-webkit-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);-moz-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);position:relative;overflow:hidden;border-radius:4px}.folder-animate>span>span,.folder-meter>span:after,.folder-progress:after{content:"";position:absolute;border-radius:4px;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:50px 50px;-moz-background-size:50px 50px;-webkit-animation:move 2s linear infinite;overflow:hidden}.folder-animate>span:after{display:none}@-webkit-keyframes move{0%{background-position:0 0}100%{background-position:50px 50px}}.media-folder-loader{padding:10px 0 15px;display:none}.media-folder-loader>span{font-weight:700}.sticky-folders{display:none;padding:0;margin:10px 0 5px;border-top:solid 1px #e9e5e5}.top-settings{background:#fff;padding:10px 10px 5px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.sticky-folders.active{display:block}.sticky-folders ul{margin:0;padding:0}.sticky-folders>ul>li{display:block;margin:0;padding:0}.sticky-folders>ul>li>a{display:block;color:#333;padding:0 0 0 10px;border-radius:3px;text-decoration:none;font-size:14px;line-height:30px;position:relative}.sticky-folders ul li a.active,body:not(.no-hover-css) .sticky-folders ul li a:hover{background:#dfdfdf;border-radius:3px}.sticky-folders ul li a.active-item{background-color:#008ec2!important;color:#fff}.sticky-folders ul li a.active-item img{filter:invert(100%);-webkit-filter:invert(100%)}.sticky-folders>ul>li>a>span{display:inline-block;vertical-align:middle;line-height:30px}.sticky-folders ul li a span.update-inline-record{line-height:30px;padding:0 0 0 5px;height:30px}.sticky-folders ul li a span.folder-count{padding:0 8px 0 3px}.sticky-wcp-custom-form a:focus{box-shadow:none;outline:0}span.folder-count{float:right;background:0 0;padding:0;font-size:10px;line-height:16px;border-radius:2px}span.folder-count:empty{display:none}.sticky-title{font-size:16px;font-weight:700;padding:7px}.sticky-title img{display:inline-block;vertical-align:middle;height:20px;width:20px}.sticky-folder-icon img{width:100%;filter:invert(50%);-webkit-filter:invert(50%)}.dynamic-menu .sticky-folder:hover img{filter:invert(0);-webkit-filter:invert(0)}.form-options>ul>li.last>a.sort-folder-order{width:28px;padding:5px;text-align:center;display:inline-block;box-sizing:border-box}.sort-folder-order svg{width:100%;height:100%;fill:#000}.sort-folder-order:hover svg{fill:#fff}.folder-order{position:relative}.folder-sort-menu{position:absolute;right:0;width:120px;z-index:101;background:#fff;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25);display:none}.folder-order.active .folder-sort-menu{display:block}.folder-order.active .sort-folder-order{background:#404040;color:#fff}.folder-order.active .sort-folder-order svg{fill:#fff}.folder-sort-menu li{display:block;margin:0;padding:0;background:0 0}.folder-sort-menu li a{display:block;margin:0;padding:3px 5px;background:0 0;color:#848484;text-decoration:none;font-size:14px}.folder-sort-menu li a.active,.folder-sort-menu li a:hover{background:#efefef;color:#000}.dynamic-menu.bottom-fix{bottom:0}.folder-form-buttons{display:flex}.folder-group{position:relative;margin:45px auto 15px;padding:0 2px}.folder-grouptextarea{resize:none}.folder-group input,.folder-group textarea{background:0 0;font-size:14px;padding:0 0 0 15px;display:block;width:100%;border-radius:4px;border:1px solid #484848;height:34px;line-height:34px;color:#484848}.folder-group input:focus,.folder-group textarea:focus{outline:0}.folder-group input:focus~label,.folder-group input:valid~label,.folder-group textarea:focus~label,.folder-group textarea:valid~label{top:-9px;background:#fff;padding:0 5px;font-weight:400;font-size:12px;line-height:14px;color:#aeaeae}.folder-group input:focus~.bar:before,.folder-group textarea:focus~.bar:before{width:320px}.folder-group input[type=password]{letter-spacing:.3em}.folder-group label{font-size:14px;font-weight:500;position:absolute;pointer-events:none;left:20px;top:10px;-webkit-transition:.3s ease all;transition:.3s ease all;color:#484848}.folder-group .folder-bar{position:relative;display:block;width:320px}.folder-group .folder-bar:before{content:'';height:2px;width:0;bottom:0;position:absolute;background:#2196f3;-webkit-transition:.3s ease all;transition:.3s ease all;left:0}#custom-menu [class*=" pfolder-"],#custom-menu [class^=pfolder-],.sticky-folders i{font-size:12px}span.create_new_folder{width:26px;height:26px;line-height:26px;font-size:14px;background:rgba(255,255,255,.4);backdrop-filter:blur(16px);border-radius:4px;text-align:center;margin:0 15px 0 0}.folder-search-form{padding:0 0 10px 0;position:relative}.folder-search-form input{background:#fff;border:1px solid #dbdbdb;box-sizing:border-box;border-radius:4px;height:32px;line-height:32px;box-sizing:border-box;padding:0 5px;width:100%;outline:0;box-shadow:none!important}.folder-search-form span{position:absolute;color:#aeaeae;right:0;top:0;height:32px;line-height:32px;width:32px;text-align:center}.folder-separator{padding:0 10px;height:1px;background:#e9e5e5;margin:0 0 10px 0}#custom-menu.has-filter li.route{display:none!important}#custom-menu.has-filter li.route.has-search{display:block!important}#custom-menu.has-filter h3 span.title-text.has-search-text{font-weight:700}.hide-folders-area .ui-resizable-handle.ui-resizable-e{display:none!important}.pull-right{float:right;display:block;line-height:22px}.folder-separator-2{padding:0;height:1px;background:#e9e5e5;margin:0 0 5px 0}.mCSB_scrollTools{width:10px!important}.mCSB_inside>.mCSB_container{margin-right:0!important}#custom-menu .route.has-sub-tree.has-search>.nav-icon>.pfolder-arrow-down{transform:rotate(0)}@media screen and (max-width:960px){.wcp-content{left:36px}html[dir=rtl] .wcp-content{right:36px;left:auto}}@media screen and (max-width:780px){.wcp-content{left:0}html[dir=rtl] .wcp-content{right:0}}@media screen and (max-width:640px){.wcp-content{left:0;position:relative!important;width:100%!important;padding-bottom:100px;top:0;right:0;display:block}.ui-resizable-handle.ui-resizable-e{display:none!important}.hide-folders-area .wcp-container{display:block}.wcp-hide-show-buttons{display:none}.hide-folders-area .wcp-content{width:100%!important}body.wp-admin #wpcontent{padding:0!important}#wpbody-content{padding-bottom:30px}}
1
+ .wcp-custom-menu{padding-left:0}.wcp-custom-menu a,.wcp-custom-menu a:focus{outline:0;box-shadow:none}.wcp-custom-menu{position:relative}.wcp-container ul{list-style:none}.wcp-container .route{position:relative;list-style-type:none;border:0;margin:0;padding:0;top:0;margin-top:0;max-height:100%!important;width:100%;border-radius:2px;z-index:-1;background:0 0}.wcp-container .route span{position:absolute;top:2px;left:0;z-index:10;width:20px;height:18px;text-indent:0;font-size:20px;background:no-repeat;text-align:center}.wcp-container .route .title{position:absolute;border:0;margin:0;padding:0;height:30px;width:200px;text-indent:28px;background:0 0;box-shadow:none;font-size:13px;line-height:26px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;overflow:hidden;font-weight:400}.wcp-container .first-title{margin-left:10px}.wcp-container .space{position:relative;list-style-type:none;border:0;margin:0 0 0 20px;padding:0 0 30px 0;width:40px;top:30px;height:100%;z-index:1}.wcp-container .first-space{margin-left:0;top:0;padding:0}i.fa-caret-right{transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}li.active>span>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}li.active>span>i.fa-folder:before{content:"\f07c"}.has-sub-tree>ul.ui-sortable li{display:none}.has-sub-tree.active>ul.ui-sortable>li{display:block}.nav-icon{display:none;left:-10px!important;cursor:pointer}.has-sub-tree>.nav-icon{display:block}.wcp-content{position:fixed!important;top:32px;left:160px;bottom:0;width:280px;box-sizing:border-box;z-index:1;direction:ltr;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] .wcp-content{left:auto;right:160px}body.folded .wcp-content{left:36px}html[dir=rtl] body.folded .wcp-content{left:auto;right:36px}body.wp-admin #wpcontent{padding-left:305px;transition:all .15s linear;-webkit-transition:all .15s linear;-moz-transition:all .15s linear}html[dir=rtl] body.wp-admin #wpcontent{padding-left:0;padding-right:305px}.wcp-container{padding:20px 20px 20px 16px}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.form-operations{border:solid 1px #e5e5e5;border-right:none;margin-bottom:20px}.form-operations ul{margin:0;padding:0}.form-operations li{display:block;float:left;width:20%;text-align:center;background:#fff;margin:0;padding:0}.form-operations li a{display:block;padding:10px 0;border-right:solid 1px #e5e5e5;font-size:16px;color:#727272}.clearfix{clear:both}.wcp-parent-data{position:relative}.wcp-parent{position:absolute;left:-21px;font-weight:700;font-size:14px}.wcp-parent .fa{font-size:18px;margin-right:8px}.wcp-form-data{background:#fff;border:solid 1px #f1f1f1;padding:15px;display:none;margin-bottom:20px}.wcp-form-title{color:#727272;font-size:14px;text-transform:uppercase;padding:0 0 10px 0}.wcp-form-data .form-field{padding:0 0 10px 0}.wcp-form-data .form-field input,.wcp-form-data .form-field select{width:100%}button#wcp-save-folder{float:right}.wcp-form-message span{display:block;padding:5px 10px;background:#ffabab;margin-bottom:10px;color:#000;border:solid 1px #8c0000;border-radius:4px}.wcp-container .route.active-item>h3.title{background:#008ec2;color:#fff;border-radius:4px}.wcp-container .route span.ui-icon{line-height:24px;font-size:18px;cursor:move;left:5px;top:2px;height:26px}.route.active-item>span.ui-icon{background:#008ec2;color:#fff}#custom-menu.active>ul>li.route{display:block}.wcp-parent.active>i.fa-caret-right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.wcp-parent.active>i.fa-folder:before{content:"\f07c"}.wcp-container .route .title .folder-sticky-icon,.wcp-container .route .title .move-folder-icon{float:right;position:relative;top:0;left:auto;width:20px;height:30px;line-height:26px;display:none}.wcp-container .route.is-sticky .title .folder-sticky-icon{display:block}span.folder-sticky-icon i{font-size:14px!important}.mCS_no_scrollbar .mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden{overflow:visible}body:not(.no-hover-css) .wcp-container .route .title:hover{background:rgba(250,22,107,.08);cursor:pointer}body:not(.no-hover-css) .wcp-container .route .title:hover>.folder-sticky-icon,body:not(.no-hover-css) .wcp-container .route .title:hover>.star-icon{display:none!important}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .move-folder-icon,body:not(.no-hover-css) .wcp-container .route .title:hover .move-folder-icon{display:block}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .ui-icon .pfolder-folder-close:before,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon .pfolder-folder-close:before{content:"\e901"!important}#custom-menu .route.active>h3.title .pfolder-folder-close:before{content:"\e902"}.route.is-sticky>h3.title>.ui-icon>.folder-sticky-icon{display:block;width:100%;height:auto;margin:3px auto 0}.route.is-sticky.active-item>h3.title>.ui-icon>.folder-sticky-icon{filter:invert(100%);-webkit-filter:invert(100%)}.wcp-container .route .title.wcp-drop-hover img{filter:invert(100%);-webkit-filter:invert(100%)}.plugin-button{float:right}.plugin-button.d-block{float:none}.plugin-title{display:inline-block;vertical-align:middle}.add-new-folder{text-decoration:none;display:inline-block;font-size:14px;padding:4px 10px 4px 4px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:4px;line-height:24px;position:relative}.add-new-folder:focus,.add-new-folder:hover{color:#fff}.add-new-folder:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.add-new-folder span{display:block;float:left;line-height:24px;font-size:14px;margin-right:5px}.add-new-folder span.folder-icon-create_new_folder{font-size:20px}.form-options{background:#fff;padding:5px;margin:0 0;border-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.form-options .form-options{padding:0;background:0 0;box-shadow:none}.form-options ul{margin:0;padding:0}.form-options>ul>li{display:inline-block;margin:0 2px 0 0;vertical-align:top}.form-options>ul>li.last{margin:0}.form-options>ul>li>a{display:inline-block;text-decoration:none;padding:5px 5px;color:#000;vertical-align:middle;margin:0 0 5px 0;background:#f1f1f1;border-radius:4px}.form-options>ul>li.last>a{padding:3px}a#expand-collapse-list.all-open span{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.form-options>ul>li>a:hover{background:#404040;color:#fff}.form-options>ul>li>a:hover span.icon{color:#fff}.form-options>ul>li>a.expand-collapse{width:14px;text-align:center}.form-options a.expand-collapse span.icon{font-size:10px}.form-options span.icon{font-size:12px;display:inline-block;vertical-align:baseline;color:#a4c0d2}.un-categorised-items{border-radius:3px}.header-posts a,.un-categorised-items a{color:#444;padding:7px;display:block;text-decoration:none;font-size:14px;border-radius:4px;line-height:18px}.header-posts a:hover,.un-categorised-items.active-item,.un-categorised-items:hover{background:rgba(250,22,107,.08);border-radius:4px}.header-posts a.active-item,.un-categorised-items.active-item{background:#008ec2!important;color:#fff!important}.un-categorised-items.active-item a{color:#fff!important}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#fff!important}span.total-count{float:right;font-size:12px;line-height:16px}.wcp-icon{display:inline-block;font-size:16px;vertical-align:top;margin-right:3px}#custom-menu .wcp-icon{font-size:16px!important;line-height:24px}#custom-menu .route .nav-icon .wcp-icon{font-size:9px!important;color:#fa166b;font-weight:700;transform:rotate(-90deg);transition:all .25s linear}#custom-menu .route.active .nav-icon .wcp-icon{transform:rotate(0)}.route.active>.nav-icon>.folder-icon-arrow_right{transform:rotate(90deg);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg)}.route.active>.ui-icon>.folder-icon-folder:before{content:"\e90c"}.wcp-container .route span.total-count{position:relative;font-size:10px;float:right;text-align:center;width:auto;display:block;margin:4px 8px 3px 3px;color:#23282d!important;line-height:16px;height:16px}.wcp-container .route.active-item>h3.title span.total-count{color:#fff!important}.dynamic-menu{position:fixed;left:auto;right:5px;background:#fff;width:170px;padding:0;z-index:1000001;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25)}.dynamic-menu ul{margin:0;padding:0}.sticky-folders .dynamic-menu{left:auto;right:50px}.dynamic-menu li{position:relative;width:100%;display:block!important;padding:2px 0;margin:0}.dynamic-menu a{text-decoration:none;color:#333;position:relative;display:block;padding:5px 10px;line-height:18px;white-space:nowrap}.dynamic-menu ul>li>a>span,.dynamic-menu ul>li>a>span span{position:relative!important;display:inline-block;vertical-align:middle;margin-right:5px;top:auto!important;width:20px!important;height:20px!important;line-height:14px}#custom-menu .dynamic-menu ul>li>a .sticky-pin{line-height:20px}#custom-menu .dynamic-menu ul>li>a .sticky-pin i{font-size:16px!important}.dynamic-menu ul>li>a>span span{top:auto;height:auto;width:auto;margin:0;left:auto;vertical-align:baseline;display:inline}.dynamic-menu li.new-folder{border-bottom:solid 1px #d8d8d8}.dynamic-menu a.active,.dynamic-menu a:hover{background:#efefef;color:#000}.dynamic-menu ul li span{font-size:20px;vertical-align:middle}.dynamic-menu ul li span.sticky-folder-icon{width:20px}.dynamic-menu ul li span i{font-size:14px;line-height:16px;font-weight:400}.wcp-form-input{padding-left:35px;box-sizing:border-box;position:relative}.wcp-form-input input{width:100%}.wcp-form-btn{padding:4px 0 4px 2px}.wcp-form-input:before{content:"\e90d";font-family:folder-icon!important;speak:none;position:absolute;left:0;font-size:28px;top:5px}.add-new-folder-btn{margin-right:5px!important}.form-loader{width:100%;height:5px;margin:0 0 10px}.form-loader-count{width:0;height:5px;background:url(../images/form-loader.png);transition:all 2.5s linear;-webkit-transition:all 2s linear;-moz-transition:all 2.5s linear}.route.is-high>.ui-icon>i:before{content:"\e900"!important}.route.is-high.active>.ui-icon>i:before{content:"\e90c"!important;z-index:11;color:#444;font-size:20px}.route.is-high.active>.ui-icon>i:after{content:"\e907";margin-left:-1.2em;color:#444;font-size:11px;top:1px;position:absolute}.route.is-high.active.active-item>.ui-icon>i:after,.route.is-high.active.active-item>.ui-icon>i:before{color:#fff}li.active-menu{z-index:2!important}body.woocommerce-page th#taxonomy-product_folder{width:10%!important}.wp-list-table th.column-title{width:22%!important}.wp-list-table #wcp_move{width:20px!important}td.wcp_move.column-wcp_move{vertical-align:middle}.wp-list-table tr td .wcp-move-file{vertical-align:middle;opacity:0}.wp-list-table td.wcp_move.column-wcp_move.wcp-draggable,.wp-list-table tr:hover td .wcp-move-file{opacity:1}.wcp-drop-hover{background:#fa166b!important;z-index:2!important;color:#fff!important}.wcp-drop-hover i{color:#fff!important}.ui-draggable-dragging{z-index:1051!important}.wcp-hover-list{background:#fa166b!important;color:#fff;position:relative}.wcp-hover-list a{color:#fff}.wcp-hover-list span.total-count{color:#000}span.wcp-item{display:none}.wcp-move-file{cursor:move}.wcp-drop-hover-list a.folder-view{background:#008ec2;color:#fff;border:solid 1px #fff;position:relative}.wcp-drop-hover-list a.folder-view:before{width:100%;height:100%;content:"";position:absolute;top:-2px;left:-2px;border:solid 1px #008ec2;padding:1px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}.ui-draggable-dragging.wcp-move-file{z-index:5001;display:inline-block;border:solid 2px #0073aa;padding:5px 10px;border-radius:5px;background:#e4f6ff;position:fixed!important;max-width:230px;overflow:hidden;width:auto!important}.ui-draggable-dragging.wcp-move-file span{display:block;float:left}.ui-draggable-dragging.wcp-move-file span.wcp-move{margin-right:5px;display:block;float:left}.wcp-container .route span.title-text{position:relative;top:auto;left:auto;display:inline-block;font-size:16px;line-height:30px;height:30px;width:calc(100% - 100px);overflow:hidden;white-space:nowrap;text-align:left}.ui-resizable-handle.ui-resizable-e{position:absolute;top:0;height:100%;height:100vh;width:1px;right:0;border-right:1px solid #ccc;cursor:col-resize}.ui-resizable-handle.ui-resizable-e:before,.ui-resizable-handle.ui-resizable-w:before{content:"";top:25%;width:3px;height:30px;position:absolute;border-left:solid 1px #fa166b;border-right:solid 1px #fa166b;left:-1px}.ui-resizable-handle.ui-resizable-w{position:absolute;top:0;height:100%;height:100vh;width:1px;left:0;border-right:1px solid #ccc;cursor:col-resize}div#custom-menu{padding:0 10px 10px;background:#fff;box-shadow:0 4px 21px rgba(7,16,28,.1)}body:not(.no-hover-css) .sticky-folders li a:hover span.update-inline-record,body:not(.no-hover-css) .wcp-container .route h3:hover>span.update-inline-record{width:18px}.tree-structure li{display:block;width:auto;float:left;margin:0;padding:0}.tree-structure .folder-item{padding:4px;position:relative}.tree-structure .folder-view{display:block;border:none;color:#404040;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;position:relative;cursor:pointer;background:#f1f1f1;font-size:14px;line-height:16px}.tree-structure .folder-view span.item-name{display:block;padding:8px 15px 8px 30px;position:relative;width:100%;overflow:hidden;height:32px;font-size:14px;box-sizing:border-box}.folder-view span.item-name:before{content:"\e906";font-family:premio-folder!important;position:absolute;left:8px;font-size:16px;color:#a4c0d2}.folder-view.is-high span.item-name:before{content:"\e900"}.folder-view.is-post span.item-name:before{content:"\e901"}.tree-structure span.folder-option{position:absolute;right:0;font-family:folder-icon!important;top:0;font-size:20px;line-height:38px;z-index:1;cursor:pointer;display:none}.tree-structure .folder-view:hover span.folder-option{display:block}.tree-structure span.folder-option:hover{color:#f51366}.tree-structure span.folder-option:after{content:"\e90a"}.tree-structure li{position:relative}.tree-structure{margin-left:-8px;margin-right:-8px}.tree-structure .folder-view span.folder-title{width:100%;display:block}.swal2-popup .swal2-title{line-height:36px}.attachments-browser.ui-draggable-dragging .media-sidebar,.attachments-browser.ui-draggable-dragging .media-toolbar,.attachments-browser.ui-draggable-dragging .uploader-inline,.attachments-browser.ui-draggable-dragging ul.attachments{display:none}.attachments.ui-sortable.ui-draggable-dragging{z-index:5000}.selected-items{background:#0073aa;color:#fff;padding:10px 20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;margin-top:0;cursor:none;font-size:12px}.media-frame,.media-frame .attachments-browser,.media-frame-content{overflow:inherit}.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail,.mCS-3d.mCSB_scrollTools .mCSB_draggerRail{width:2px!important;background-color:transparent!important;box-shadow:none!important}.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{width:2px!important;background-color:#fa166b!important;margin:0 0 0 4px!important;padding:0!important}.mCSB_outside+.mCSB_scrollTools{right:-15px!important}body.upload-php.eml-grid #wpbody{position:relative!important;top:0!important;bottom:auto!important;left:auto!important;right:auto!important;height:auto}#footer-thankyou{display:none}span.upgrade-message{padding:0;background:#fff;display:inline-block;font-size:12px;color:#000}span.upgrade-message a.pink,span.upgrade-message span.pink{color:#ff5983;text-decoration:none;font-weight:700}.media-toolbar.sticky-media{position:fixed;top:32px;right:18px!important;left:auto}.media-position{width:1px;height:1px}.media-frame.mode-grid .media-toolbar{margin:0!important}.button-disabled{cursor:no-drop;pointer-events:none}.wcp-hide-show-buttons{position:absolute;top:25px;right:-20px;z-index:10001}html[dir=rtl] .wcp-hide-show-buttons{left:-20px;right:auto}.wcp-hide-show-buttons .toggle-buttons{background:#f51366;color:#fff;display:inline-block;margin:0;padding:0;float:left;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%;display:none;width:20px;height:20px;cursor:pointer;position:relative}.wcp-hide-show-buttons:hover .toggle-buttons:after{content:"";width:100%;height:100%;background:0 0;position:absolute;top:0;left:0;-webkit-border-top-right-radius:50%;-webkit-border-bottom-right-radius:50%;-moz-border-radius-topright:50%;-moz-border-radius-bottomright:50%;border-top-right-radius:50%;border-bottom-right-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-top-left-radius:50%;-webkit-border-bottom-left-radius:50%;-moz-border-radius-top-left:50%;-moz-border-radius-bottom-left:50%;border-top-left-radius:50%;border-bottom-left-radius:50%}html[dir=rtl] .wcp-hide-show-buttons .toggle-buttons span{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.hide-folders-area .wcp-content{width:0!important}.hide-folders-area .wcp-container{display:none}.wcp-hide-show-buttons .toggle-buttons.active{display:block}#wcp-content.no-transition .wcp-container{display:none}button.button.organize-button{vertical-align:middle;text-decoration:none;display:inline-block;font-size:14px;padding:4px 10px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:3px;line-height:14px;-webkit-box-shadow:0 3px 5px -3px #333;-moz-box-shadow:0 3px 5px -3px #333;box-shadow:0 3px 5px -3px #333;position:relative}button.button.organize-button:focus,button.button.organize-button:hover{color:#fff}button.button.organize-button:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.tree-structure-content ul{margin:0;padding:0}.tree-structure-content{padding:5px 10px;background:#fff;margin:10px 0 15px;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border:solid 1px #ccc}.tree-structure-content .tree-structure{height:40px;overflow:hidden;transition:.1s;-webkit-transition:.1s;-moz-transition:.1s}.tree-structure-content.active .tree-structure{height:auto}.folders-toggle-button{height:15px;text-align:center;position:relative}.folders-toggle-button span{background:#f51366;color:#fff;height:20px;width:30px;text-align:center;display:block;margin:0 auto;position:absolute;left:0;right:0;bottom:-10px;cursor:pointer;font-family:dashicons;font-size:20px;line-height:20px}.folders-toggle-button span:after{content:"\f347"}.tree-structure-content.active .folders-toggle-button span:after{content:"\f343"}span.media-info-message{vertical-align:middle;line-height:20px;font-weight:700;color:#f51366;padding:0 0 10px 0;display:none!important}span.media-info-message.active{display:block!important}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none}.folder-popup-form.disabled{pointer-events:none}.popup-form-content{background:#fff;min-height:100px;width:400px;text-align:center;margin:0 auto;position:absolute;left:0;right:0;top:50%;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-o-transform:translate(0,-50%);-ms-transform:translate(0,-50%);padding:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#484848}.folder-form-buttons a,.folder-form-buttons button{display:inline-flex;padding:0;text-decoration:none;margin:10px 3px;border-radius:4px;border:solid 1px #1da1f4;line-height:34px;font-weight:700;font-size:14px;box-sizing:border-box;height:36px;cursor:pointer;flex:1;justify-content:center}.folder-form-buttons a span,.folder-form-buttons button span{-webkit-animation:fa-spin .75s infinite linear;animation:fa-spin .75s infinite linear;padding:7px}.wcp-container .folder-tooltip{position:relative}.wcp-container .folder-tooltip::after,.wcp-container .folder-tooltip::before{text-transform:none;font-size:.9em;line-height:1;user-select:none;pointer-events:none;position:absolute;display:none;opacity:0}.wcp-container .folder-tooltip::before{content:'';border:5px solid transparent;z-index:1001}.wcp-container .folder-tooltip::after{content:attr(data-folder-tooltip);font-family:Helvetica,sans-serif;text-align:center;min-width:3em;max-width:21em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:1ch 1.5ch;border-radius:.3ch;box-shadow:0 1em 2em -.5em rgba(0,0,0,.35);background:#333;color:#fff;z-index:1000}.wcp-container .folder-tooltip:hover::after,.wcp-container .folder-tooltip:hover::before{display:block;opacity:1}.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::before{bottom:100%;border-bottom-width:0;border-top-color:#333}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip[flow^=up]::after{bottom:calc(100% + 5px)}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::after,.wcp-container .folder-tooltip[flow^=up]::before{left:50%;transform:translate(-50%,-.5em)}.wp-core-ui .button-primary.select-all-item-btn{margin:11px 11px 11px 0;display:none!important}.wp-core-ui .button-primary.select-all-item-btn.active{display:inline-block!important}.form-options>ul>li.last.folder-checkbox{padding:5px 0 0}#custom-menu input.checkbox{display:none}#custom-menu.show-folder-checkbox input.checkbox{display:block;margin:5px 0 0 0}#custom-menu.show-folder-checkbox h3.title>.ui-icon>i,#custom-menu.show-folder-checkbox h3.title>.ui-icon>img{display:none!important}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.folder-form-buttons a:focus,.folder-form-buttons a:hover,.folder-form-buttons button:focus,.folder-form-buttons button:hover{color:#fff;outline:0}.folder-form-buttons a:focus{outline:0;outline:0}.form-cancel-btn,a.form-cancel-btn:hover{background-color:#fff;color:#3085d6;outline:0}.form-submit-btn{background-color:#3085d6;color:#fff;outline:0}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;text-align:center;text-transform:none;word-wrap:break-word;font-weight:700;font-size:22px;line-height:26px}.folder-form-message{font-size:15px;line-height:18px;color:#484848;padding:25px 70px}.folder-form-errors{margin:0 0 10px 0;padding:8px 0;background:#ffe4e4;color:#a20000;display:none}.folder-form-errors.active{display:block}span.folder-loader-ajax{margin:0;line-height:30px;display:none;vertical-align:middle}.folder-loader-ajax.active{display:inline-block}@-webkit-keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@-webkit-keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}#successAnimationCircle{stroke-dasharray:151px 151px;stroke:#2ce0a7}#successAnimationCheck{stroke-dasharray:36px 36px;stroke:#2ce0a7}#successAnimationResult{fill:#2ce0a7;opacity:0}svg#successAnimation{width:30px;height:34px;padding:0;display:none;float:left}#successAnimation.active{display:inline-block}.folder-loader-ajax img{display:none}.folder-loader-ajax img.active{display:inline-block}#successAnimation.animated{-webkit-animation:1s ease-out 0s 1 both scaleAnimation;animation:1s ease-out 0s 1 both scaleAnimation}#successAnimation.animated #successAnimationCircle{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationCheck{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationResult{-webkit-animation:.3s linear .9s both fadeIn;animation:.3s linear .9s both fadeIn}.mCSB_scrollTools a+.mCSB_draggerContainer{margin:10px 0!important}.popup-folder-title{font-weight:700;font-size:24px;padding:0 0 20px 0}.select-box{padding:20px 0 10px 0}.select-box select{width:100%;max-width:300px}.actions #media_folder,select.media-select-folder{width:132px}select#media-attachment-taxonomy-filter{width:132px}.custom-media-select{float:right;padding:10px 0 0 0;display:none}.custom-media-select.active{display:block}.folder-progress{background:#b4b9be;border-radius:4px;margin:5px 0 0 0;position:relative}.folder-meter{height:20px;position:relative;background:#f1f1f1;padding:0;width:0%;border-radius:4px;-webkit-transition:all .2s linear;transition:all .2s linear}.folder-meter>span{display:block;height:100%;-webkit-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);-moz-box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);box-shadow:inset 0 2px 9px rgba(255,255,255,.3),inset 0 -2px 6px rgba(0,0,0,.4);position:relative;overflow:hidden;border-radius:4px}.folder-animate>span>span,.folder-meter>span:after,.folder-progress:after{content:"";position:absolute;border-radius:4px;top:0;left:0;bottom:0;right:0;background-image:-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,rgba(255,255,255,.2)),color-stop(.25,transparent),color-stop(.5,transparent),color-stop(.5,rgba(255,255,255,.2)),color-stop(.75,rgba(255,255,255,.2)),color-stop(.75,transparent),to(transparent));background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.2) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.2) 50%,rgba(255,255,255,.2) 75%,transparent 75%,transparent);z-index:1;-webkit-background-size:50px 50px;-moz-background-size:50px 50px;-webkit-animation:move 2s linear infinite;overflow:hidden}.folder-animate>span:after{display:none}@-webkit-keyframes move{0%{background-position:0 0}100%{background-position:50px 50px}}.media-folder-loader{padding:10px 0 15px;display:none}.media-folder-loader>span{font-weight:700}.sticky-folders{display:none;padding:0;margin:10px 0 5px;border-top:solid 1px #e9e5e5}.top-settings{background:#fff;padding:10px 10px 5px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.sticky-folders.active{display:block}.sticky-folders ul{margin:0;padding:0}.sticky-folders>ul>li{display:block;margin:0;padding:0}.sticky-folders>ul>li>a{display:block;color:#333;padding:0 0 0 10px;border-radius:3px;text-decoration:none;font-size:14px;line-height:30px;position:relative}.sticky-folders ul li a.active,body:not(.no-hover-css) .sticky-folders ul li a:hover{background:#dfdfdf;border-radius:3px}.sticky-folders ul li a.active-item{background-color:#008ec2!important;color:#fff}.sticky-folders ul li a.active-item img{filter:invert(100%);-webkit-filter:invert(100%)}.sticky-folders>ul>li>a>span{display:inline-block;vertical-align:middle;line-height:30px}.sticky-folders ul li a span.update-inline-record{line-height:30px;padding:0 0 0 5px;height:30px}.sticky-folders ul li a span.folder-count{padding:0 8px 0 3px}.sticky-wcp-custom-form a:focus{box-shadow:none;outline:0}span.folder-count{float:right;background:0 0;padding:0;font-size:10px;line-height:16px;border-radius:2px}span.folder-count:empty{display:none}.sticky-title{font-size:16px;font-weight:700;padding:7px}.sticky-title img{display:inline-block;vertical-align:middle;height:20px;width:20px}.sticky-folder-icon img{width:100%;filter:invert(50%);-webkit-filter:invert(50%)}.dynamic-menu .sticky-folder:hover img{filter:invert(0);-webkit-filter:invert(0)}.form-options>ul>li.last>a.sort-folder-order{width:28px;padding:5px;text-align:center;display:inline-block;box-sizing:border-box}.sort-folder-order svg{width:100%;height:100%;fill:#000}.sort-folder-order:hover svg{fill:#fff}.folder-order{position:relative}.folder-sort-menu{position:absolute;right:0;width:120px;z-index:101;background:#fff;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25);display:none}.folder-order.active .folder-sort-menu{display:block}.folder-order.active .sort-folder-order{background:#404040;color:#fff}.folder-order.active .sort-folder-order svg{fill:#fff}.folder-sort-menu li{display:block;margin:0;padding:0;background:0 0}.folder-sort-menu li a{display:block;margin:0;padding:3px 5px;background:0 0;color:#848484;text-decoration:none;font-size:14px}.folder-sort-menu li a.active,.folder-sort-menu li a:hover{background:#efefef;color:#000}.dynamic-menu.bottom-fix{bottom:0}.folder-form-buttons{display:flex}.folder-group{position:relative;margin:45px auto 15px;padding:0 2px}.add-folder-note{padding:10px 0 0}.folder-grouptextarea{resize:none}.folder-group input,.folder-group textarea{background:0 0;font-size:14px;padding:0 0 0 15px;display:block;width:100%;border-radius:4px;border:1px solid #484848;height:34px;line-height:34px;color:#484848}.folder-group input:focus,.folder-group textarea:focus{outline:0}.folder-group input:focus~label,.folder-group input:valid~label,.folder-group textarea:focus~label,.folder-group textarea:valid~label{top:-9px;background:#fff;padding:0 5px;font-weight:400;font-size:12px;line-height:14px;color:#aeaeae}.folder-group input:focus~.bar:before,.folder-group textarea:focus~.bar:before{width:320px}.folder-group input[type=password]{letter-spacing:.3em}.folder-group label{font-size:14px;font-weight:500;position:absolute;pointer-events:none;left:20px;top:10px;-webkit-transition:.3s ease all;transition:.3s ease all;color:#484848}.folder-group .folder-bar{position:relative;display:block;width:320px}.folder-group .folder-bar:before{content:'';height:2px;width:0;bottom:0;position:absolute;background:#2196f3;-webkit-transition:.3s ease all;transition:.3s ease all;left:0}#custom-menu [class*=" pfolder-"],#custom-menu [class^=pfolder-],.sticky-folders i{font-size:12px}span.create_new_folder{width:26px;height:26px;line-height:26px;font-size:14px;background:rgba(255,255,255,.4);backdrop-filter:blur(16px);border-radius:4px;text-align:center;margin:0 15px 0 0}.folder-search-form{padding:0 0 10px 0;position:relative}.folder-search-form input{background:#fff;border:1px solid #dbdbdb;box-sizing:border-box;border-radius:4px;height:32px;line-height:32px;box-sizing:border-box;padding:0 5px;width:100%;outline:0;box-shadow:none!important}.folder-search-form span{position:absolute;color:#aeaeae;right:0;top:0;height:32px;line-height:32px;width:32px;text-align:center}.folder-separator{padding:0 10px;height:1px;background:#e9e5e5;margin:0 0 10px 0}#custom-menu.has-filter li.route{display:none!important}#custom-menu.has-filter li.route.has-search{display:block!important}#custom-menu.has-filter h3 span.title-text.has-search-text{font-weight:700}.hide-folders-area .ui-resizable-handle.ui-resizable-e{display:none!important}.pull-right{float:right;display:block;line-height:22px}.folder-separator-2{padding:0;height:1px;background:#e9e5e5;margin:0 0 5px 0}.mCSB_scrollTools{width:10px!important}.mCSB_inside>.mCSB_container{margin-right:0!important}#custom-menu .route.has-sub-tree.has-search>.nav-icon>.pfolder-arrow-down{transform:rotate(0)}body:not(.woocommerce-page) .wp-list-table th{width:auto}@media screen and (max-width:960px){.wcp-content{left:36px}html[dir=rtl] .wcp-content{right:36px;left:auto}}@media screen and (max-width:780px){.wcp-content{left:0}html[dir=rtl] .wcp-content{right:0}}@media screen and (max-width:640px){.wcp-content{left:0;position:relative!important;width:100%!important;padding-bottom:100px;top:0;right:0;display:block}.ui-resizable-handle.ui-resizable-e{display:none!important}.hide-folders-area .wcp-container{display:block}.wcp-hide-show-buttons{display:none}.hide-folders-area .wcp-content{width:100%!important}body.wp-admin #wpcontent{padding:0!important}#wpbody-content{padding-bottom:30px}}
assets/css/page-post-media.css CHANGED
@@ -599,16 +599,20 @@ body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon .pfolder-fol
599
  }
600
 
601
  .dynamic-menu {
602
- position: absolute;
603
  left: 50px;
604
  background: #fff;
605
  width: 170px;
606
  padding: 0;
607
- z-index: 101;
608
  -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
609
  -moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
610
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25)
611
  }
 
 
 
 
612
 
613
  .dynamic-menu li {
614
  position: relative;
599
  }
600
 
601
  .dynamic-menu {
602
+ position: fixed;
603
  left: 50px;
604
  background: #fff;
605
  width: 170px;
606
  padding: 0;
607
+ z-index: 1000001;
608
  -webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
609
  -moz-box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25);
610
  box-shadow: 0 0 5px 0 rgba(0, 0, 0, .25)
611
  }
612
+ .dynamic-menu ul {
613
+ margin: 0;
614
+ padding: 0;
615
+ }
616
 
617
  .dynamic-menu li {
618
  position: relative;
assets/css/page-post-media.min.css CHANGED
@@ -1 +1 @@
1
- .folder-custom-menu{width:275px;z-index:10001;position:absolute;height:100%;border-right:solid 1px #ddd;background:#f1f1f1;direction:ltr}.folder-modal .media-frame .media-frame-content,.folder-modal .media-frame .media-frame-router,.folder-modal .media-frame .media-frame-title,.folder-modal .media-frame .media-frame-toolbar{left:275px}.wcp-container{padding:20px 20px 20px 16px}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.media-frame a.add-new-folder{text-decoration:none;display:block;float:right;font-size:14px;padding:4px 10px 4px 4px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:4px;line-height:24px;position:relative}.add-new-folder span{display:block;float:left;line-height:24px;font-size:14px;margin-right:5px}span.create_new_folder{width:26px;height:26px;line-height:26px;font-size:14px;background:rgba(255,255,255,.4);backdrop-filter:blur(16px);border-radius:4px;text-align:center;margin:0 15px 0 0}span.folder-loader-ajax{float:right;margin:0;line-height:30px;display:none}.folder-loader-ajax.active{display:inline-block}@-webkit-keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@-webkit-keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}#successAnimationCircle{stroke-dasharray:151px 151px;stroke:#2ce0a7}#successAnimationCheck{stroke-dasharray:36px 36px;stroke:#2ce0a7}#successAnimationResult{fill:#2ce0a7;opacity:0}svg#successAnimation{width:30px;height:34px;padding:0;display:none;float:left}#successAnimation.active{display:inline-block}.folder-loader-ajax img{display:none}#successAnimation.animated{-webkit-animation:1s ease-out 0s 1 both scaleAnimation;animation:1s ease-out 0s 1 both scaleAnimation}#successAnimation.animated #successAnimationCircle{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationCheck{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationResult{-webkit-animation:.3s linear .9s both fadeIn;animation:.3s linear .9s both fadeIn}.form-options{background:#fff;padding:5px;margin:0 0;border-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.wcp-container ul{list-style:none}.form-options ul{margin:0;padding:0}.form-options>ul>li{display:inline-block;margin:0 2px 0 0;vertical-align:top}.form-options>ul>li.last{margin:0}.form-options>ul>li.last.folder-checkbox{padding:5px 0 0}.form-options>ul>li>a{display:inline-block;text-decoration:none;padding:5px 5px;color:#000;vertical-align:middle;margin:0 0 5px 0;background:#f1f1f1;border-radius:4px}.form-options span.icon{font-size:12px;display:inline-block;vertical-align:baseline;color:#a4c0d2}.media-frame .wcp-hide-show-buttons{display:none}.folder-order{position:relative}.form-options>ul>li.last>a.sort-folder-order{width:28px;padding:5px;text-align:center;display:inline-block;box-sizing:border-box}.folder-sort-menu{position:absolute;right:0;width:120px;z-index:101;background:#fff;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25);display:none}.folder-sort-menu li{display:block;margin:0;padding:0;background:0 0}.folder-sort-menu li a{display:block;margin:0;padding:3px 5px;background:0 0;color:#848484;text-decoration:none;font-size:14px}span.upgrade-message{padding:0;background:#fff;display:inline-block;font-size:12px;color:#000}span.upgrade-message a.pink,span.upgrade-message span.pink{color:#ff5983;text-decoration:none;font-weight:700}.form-loader{width:100%;height:5px;margin:0 0 10px}.form-loader-count{width:0;height:5px;background:url(../images/form-loader.png);transition:all 2.5s linear;-webkit-transition:all 2s linear;-moz-transition:all 2.5s linear}.top-settings{background:#fff;padding:10px 10px 5px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.header-posts a,.un-categorised-items a{color:#444;padding:7px;display:block;text-decoration:none;font-size:14px;border-radius:4px;line-height:18px}.header-posts a.active-item,.orange-bg>span,.un-categorised-items.active-item,.wcp-container .route.active-item>h3.title{background-color:#fa166b!important;color:#fff}.header-posts a.active-item span.total-count,.un-categorised-items.active-item span.total-count,.wcp-container .route.active-item>h3.title span.total-count{color:#fff!important}.wcp-icon{display:inline-block;font-size:16px;vertical-align:top;margin-right:3px}span.total-count{float:right;font-size:12px;line-height:16px}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#fff!important}.header-posts a:hover,.un-categorised-items.active-item,.un-categorised-items:hover{background:rgba(250,22,107,.08);border-radius:4px;color:#444}.un-categorised-items.active-item a,.un-categorised-items.active-item a:hover{color:#fff}.un-categorised-items a:hover,.un-categorised-items:hover a{color:#444}.media-frame .folder-custom-menu a:focus{outline:0;box-shadow:none}.sticky-title{font-size:16px;font-weight:700;padding:7px}div#custom-menu{padding:10px;background:#fff;box-shadow:0 4px 21px rgba(7,16,28,.1)}.wcp-container .space{position:relative;list-style-type:none;border:0;margin:0 0 0 20px;padding:0 0 30px 0;width:40px;top:30px;height:100%;z-index:1}.wcp-container .first-space{margin-left:0;top:0;padding:0}.wcp-container .route{position:relative;list-style-type:none;border:0;margin:0;padding:0;top:0;max-height:100%!important;width:100%;border-radius:2px;z-index:-1;background:0 0}.wcp-container .route .title{position:absolute;border:0;margin:0;padding:0;height:30px;width:200px;text-indent:28px;background:0 0;box-shadow:none;font-size:13px;line-height:26px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;overflow:hidden;font-weight:400}.wcp-container .route span{position:absolute;top:2px;left:0;z-index:10;width:20px;height:18px;text-indent:0;font-size:20px;background:no-repeat;text-align:center}.wcp-container .route span.ui-icon{line-height:24px;font-size:18px;cursor:move;left:5px;top:2px;height:26px}#custom-menu .wcp-icon{font-size:16px!important;line-height:24px}#custom-menu input.checkbox{display:none}.wcp-container .route span.title-text{position:relative;top:auto;left:auto;display:inline-block;font-size:16px;line-height:30px;height:30px;width:calc(100% - 100px);overflow:hidden;white-space:nowrap;text-align:left}#custom-menu [class*=" pfolder-"],#custom-menu [class^=pfolder-]{font-size:12px}.wcp-container .route .title .folder-sticky-icon,.wcp-container .route .title .move-folder-icon{float:right;position:relative;top:0;left:auto;width:20px;height:30px;line-height:26px;display:none}.wcp-container .route.is-sticky>h3.title .folder-sticky-icon,.wcp-container .route.is-sticky>h3.title .move-folder-icon{display:block}.nav-icon{display:none;left:-10px!important;cursor:pointer}#custom-menu .route .nav-icon .wcp-icon{font-size:9px!important;color:#fa166b;font-weight:700;transform:rotate(-90deg);transition:all .25s linear}.header-posts a,.un-categorised-items a,.wcp-container .route span.title-text{font-size:12px}.wcp-container .route span.total-count{position:relative;font-size:10px;float:right;text-align:center;width:auto;display:block;margin:4px 8px 3px 3px;color:#23282d!important;line-height:16px;height:16px}.has-sub-tree>.nav-icon{display:block}.has-sub-tree>ul.ui-sortable li{display:none}.has-sub-tree.active>ul.ui-sortable>li{display:block}body:not(.no-hover-css) .wcp-container .route .title:hover{background:rgba(250,22,107,.08);cursor:pointer}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .move-folder-icon,body:not(.no-hover-css) .wcp-container .route .title:hover .move-folder-icon{display:block}body:not(.no-hover-css) .wcp-container .route .title:hover>.folder-sticky-icon,body:not(.no-hover-css) .wcp-container .route .title:hover>.star-icon{display:none!important}body:not(.no-hover-css) .sticky-folders li a:hover span.update-inline-record,body:not(.no-hover-css) .wcp-container .route h3:hover>span.update-inline-record{width:18px}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .ui-icon .pfolder-folder-close:before,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon .pfolder-folder-close:before{content:"\e901"!important}.sticky-folders li.is-high a span.star-icon,.wcp-container .route.is-high>h3>span.star-icon{display:block}.dynamic-menu{position:absolute;left:50px;background:#fff;width:170px;padding:0;z-index:101;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25)}.dynamic-menu li{position:relative;width:100%;display:block!important;padding:2px 0;margin:0}.dynamic-menu li.new-folder{border-bottom:solid 1px #d8d8d8}.dynamic-menu a{text-decoration:none;color:#848484;position:relative;display:block;padding:5px 10px;line-height:18px;white-space:nowrap}.dynamic-menu ul>li>a>span,.dynamic-menu ul>li>a>span span{position:relative!important;display:inline-block;vertical-align:middle;margin-right:5px;top:auto!important;width:20px!important;height:20px!important;line-height:14px}#custom-menu .dynamic-menu ul>li>a .sticky-pin{line-height:20px}#custom-menu .dynamic-menu ul>li>a .sticky-pin i{font-size:16px!important}li.active-menu{z-index:2!important}.dynamic-menu a.active,.dynamic-menu a:hover{background:#efefef;color:#000}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none}.popup-form-content{background:#fff;min-height:100px;width:400px;text-align:center;margin:0 auto;position:absolute;left:0;right:0;top:50%;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-o-transform:translate(0,-50%);-ms-transform:translate(0,-50%);padding:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#484848}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;text-align:center;text-transform:none;word-wrap:break-word;font-weight:700;font-size:22px;line-height:26px}.folder-group{position:relative;margin:45px auto 15px;padding:0 2px}.folder-group input,.folder-group textarea{background:0 0;font-size:14px;padding:0 0 0 15px;display:block;width:100%;border-radius:4px;border:1px solid #484848;height:34px;line-height:34px;color:#484848;outline:0}.highlight{background-color:#e4f2fd;color:#000}.folder-group .folder-bar{position:relative;display:block;width:320px}.folder-group label{font-size:14px;font-weight:500;position:absolute;pointer-events:none;left:20px;top:10px;-webkit-transition:.3s ease all;transition:.3s ease all;color:#484848}.folder-form-errors{margin:0 0 10px 0;padding:8px 0;background:#ffe4e4;color:#a20000;display:none}.folder-form-buttons{display:flex}.folder-form-buttons a,.folder-form-buttons button{display:inline-flex;padding:0;text-decoration:none;margin:10px 3px;border-radius:4px;border:solid 1px #1da1f4;line-height:34px;font-weight:700;font-size:14px;box-sizing:border-box;height:36px;cursor:pointer;flex:1;justify-content:center;outline:0;color:#fff}.folder-form-buttons .form-cancel-btn,.folder-form-buttons a.form-cancel-btn:hover{background-color:#fff;color:#3085d6;outline:0}.form-submit-btn,.form-submit-btn:hover{background-color:#3085d6;color:#fff!important;outline:0}.folder-group input:focus~label,.folder-group input:valid~label,.folder-group textarea:focus~label,.folder-group textarea:valid~label{top:-9px;background:#fff;padding:0 5px;font-weight:400;font-size:12px;line-height:14px;color:#aeaeae}#no-more-folder-credit .folder-form-message{margin:20px 80px;font-size:14px}.folder-form-message{margin:25px auto;font-size:15px;line-height:18px;color:#484848;width:310px}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.folder-form-buttons a span,.folder-form-buttons button span{-webkit-animation:fa-spin .75s infinite linear;animation:fa-spin .75s infinite linear;padding:7px}.wcp-container .folder-tooltip{position:relative}.wcp-container .folder-tooltip::after,.wcp-container .folder-tooltip::before{text-transform:none;font-size:.9em;line-height:1;user-select:none;pointer-events:none;position:absolute;display:none;opacity:0}.wcp-container .folder-tooltip::before{content:'';border:5px solid transparent;z-index:1001}.wcp-container .folder-tooltip::after{content:attr(data-folder-tooltip);font-family:Helvetica,sans-serif;text-align:center;min-width:3em;max-width:21em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:1ch 1.5ch;border-radius:.3ch;box-shadow:0 1em 2em -.5em rgba(0,0,0,.35);background:#333;color:#fff;z-index:1000}.wcp-container .folder-tooltip:hover::after,.wcp-container .folder-tooltip:hover::before{display:block;opacity:1}.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::before{bottom:100%;border-bottom-width:0;border-top-color:#333}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip[flow^=up]::after{bottom:calc(100% + 5px)}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::after,.wcp-container .folder-tooltip[flow^=up]::before{left:50%;transform:translate(-50%,-.5em)}.folder-order.active .folder-sort-menu{display:block}.folder-sort-menu li a.active,.folder-sort-menu li a:hover{background:#efefef;color:#000}.media-toolbar-secondary select{width:30%!important;width:calc(30% - 10px)!important;margin:32px 10px 0 0!important}.media-frame .uploader-inline{z-index:1}.wcp-drop-hover{background:#fa166b!important;z-index:2!important;color:#fff!important}.wcp-drop-hover i{color:#fff!important}.selected-items{background:#0073aa;color:#fff;padding:10px 20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;margin-top:0;cursor:none;font-size:12px;z-index:10001!important}.media-frame,.media-frame .attachments-browser,.media-frame-content{overflow:inherit}#custom-menu .route.active .nav-icon .wcp-icon{transform:rotate(0);-webkit-transform:rotate(0)}.expand-collapse.all-open span.icon{transform:rotate(180deg);-webkit-transform:rotate(180deg)}.folder-search-form{padding:0 0 10px 0;position:relative}.folder-search-form input{background:#fff;border:1px solid #dbdbdb!important;box-sizing:border-box;border-radius:4px;height:32px;line-height:32px;box-sizing:border-box;padding:0 5px!important;width:100%!important;box-shadow:none!important;outline:0}.folder-search-form span{position:absolute;color:#aeaeae;right:0;top:0;height:32px;line-height:32px;width:32px;text-align:center}.folder-separator{padding:0 10px;height:1px;background:#e9e5e5;margin:0 0 10px 0}.wcp-drop-hover i{color:#fff!important}.ui-draggable-dragging{z-index:10051!important}.attachments.ui-sortable.ui-draggable-dragging{z-index:10001!important}#custom-menu.has-filter li.route{display:none!important}#custom-menu.has-filter li.route.has-search{display:block!important}#custom-menu.has-filter h3 span.title-text.has-search-text{font-weight:700}.form-options>ul>li>a:hover{background:#404040;color:#fff}#custom-menu.show-folder-checkbox input.checkbox{display:block;margin:5px 0 0 0}#custom-menu.show-folder-checkbox h3.title>.ui-icon>i,#custom-menu.show-folder-checkbox h3.title>.ui-icon>img{display:none!important}.plugin-button{float:right}.plugin-button.d-block{float:none}.plugin-title{display:inline-block}.form-options .form-options{background:0 0;padding:0;box-shadow:none}.attachments-browser .media-toolbar-secondary{width:78%;max-width:inherit}.media-toolbar-primary.search-form{width:20%;max-width:inherit}body .media-frame.hide-menu .media-frame-menu{display:block}.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-content,.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-router,.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-title,.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-toolbar{left:275px}.media-frame-menu.has-folder-menu{width:275px}.media-frame-menu.has-folder-menu .folder-custom-menu{position:relative;border:none;width:100%}.media-frame.mode-select.hide-router .media-frame-content,.media-frame.mode-select.hide-router .media-frame-router,.media-frame.mode-select.hide-router .media-frame-title,.media-frame.mode-select.hide-router .media-frame-toolbar{left:275px}.media-frame.mode-select.hide-router select#media-attachment-taxonomy-filter{display:none}.media-frame.mode-select.hide-router .folder-custom-menu{display:none}html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-content,html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-router,html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-title,html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-toolbar{left:0;right:275px}html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-content,html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-router,html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-title,html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-toolbar{left:0;right:275px}html[dir=rtl] .media-frame.hide-menu .media-frame-content,html[dir=rtl] .media-frame.hide-menu .media-frame-router,html[dir=rtl] .media-frame.hide-menu .media-frame-title,html[dir=rtl] .media-frame.hide-menu .media-frame-toolbar{left:0;right:275px}html[dir=rtl] .folder-modal .media-frame .media-frame-router,html[dir=rtl] .folder-modal .media-frame .media-frame-title,html[dir=rtl] .folder-modal .media-frame .media-frame-toolbar,html[dir=rtl] .media-frame .folder-modal .media-frame-content{left:0;right:275px}.sticky-folders>ul>li{position:relative}#vakata-dnd{z-index:10000000!important}.add-folder-note{font-size:13px}
1
+ .folder-custom-menu{width:275px;z-index:10001;position:absolute;height:100%;border-right:solid 1px #ddd;background:#f1f1f1;direction:ltr}.folder-modal .media-frame .media-frame-content,.folder-modal .media-frame .media-frame-router,.folder-modal .media-frame .media-frame-title,.folder-modal .media-frame .media-frame-toolbar{left:275px}.wcp-container{padding:20px 20px 20px 16px}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.media-frame a.add-new-folder{text-decoration:none;display:block;float:right;font-size:14px;padding:4px 10px 4px 4px;background:#f51366;color:#fff;border:solid 1px #f51366;border-radius:4px;line-height:24px;position:relative}.add-new-folder span{display:block;float:left;line-height:24px;font-size:14px;margin-right:5px}span.create_new_folder{width:26px;height:26px;line-height:26px;font-size:14px;background:rgba(255,255,255,.4);backdrop-filter:blur(16px);border-radius:4px;text-align:center;margin:0 15px 0 0}span.folder-loader-ajax{float:right;margin:0;line-height:30px;display:none}.folder-loader-ajax.active{display:inline-block}@-webkit-keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scaleAnimation{0%{opacity:0;-webkit-transform:scale(1.5);transform:scale(1.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@keyframes drawCircle{0%{stroke-dashoffset:151px}100%{stroke-dashoffset:0}}@-webkit-keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@keyframes drawCheck{0%{stroke-dashoffset:36px}100%{stroke-dashoffset:0}}@-webkit-keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}#successAnimationCircle{stroke-dasharray:151px 151px;stroke:#2ce0a7}#successAnimationCheck{stroke-dasharray:36px 36px;stroke:#2ce0a7}#successAnimationResult{fill:#2ce0a7;opacity:0}svg#successAnimation{width:30px;height:34px;padding:0;display:none;float:left}#successAnimation.active{display:inline-block}.folder-loader-ajax img{display:none}#successAnimation.animated{-webkit-animation:1s ease-out 0s 1 both scaleAnimation;animation:1s ease-out 0s 1 both scaleAnimation}#successAnimation.animated #successAnimationCircle{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCircle,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationCheck{-webkit-animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut;animation:1s cubic-bezier(.77,0,.175,1) 0s 1 both drawCheck,.3s linear .9s 1 both fadeOut}#successAnimation.animated #successAnimationResult{-webkit-animation:.3s linear .9s both fadeIn;animation:.3s linear .9s both fadeIn}.form-options{background:#fff;padding:5px;margin:0 0;border-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.wcp-container ul{list-style:none}.form-options ul{margin:0;padding:0}.form-options>ul>li{display:inline-block;margin:0 2px 0 0;vertical-align:top}.form-options>ul>li.last{margin:0}.form-options>ul>li.last.folder-checkbox{padding:5px 0 0}.form-options>ul>li>a{display:inline-block;text-decoration:none;padding:5px 5px;color:#000;vertical-align:middle;margin:0 0 5px 0;background:#f1f1f1;border-radius:4px}.form-options span.icon{font-size:12px;display:inline-block;vertical-align:baseline;color:#a4c0d2}.media-frame .wcp-hide-show-buttons{display:none}.folder-order{position:relative}.form-options>ul>li.last>a.sort-folder-order{width:28px;padding:5px;text-align:center;display:inline-block;box-sizing:border-box}.folder-sort-menu{position:absolute;right:0;width:120px;z-index:101;background:#fff;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25);display:none}.folder-sort-menu li{display:block;margin:0;padding:0;background:0 0}.folder-sort-menu li a{display:block;margin:0;padding:3px 5px;background:0 0;color:#848484;text-decoration:none;font-size:14px}span.upgrade-message{padding:0;background:#fff;display:inline-block;font-size:12px;color:#000}span.upgrade-message a.pink,span.upgrade-message span.pink{color:#ff5983;text-decoration:none;font-weight:700}.form-loader{width:100%;height:5px;margin:0 0 10px}.form-loader-count{width:0;height:5px;background:url(../images/form-loader.png);transition:all 2.5s linear;-webkit-transition:all 2s linear;-moz-transition:all 2.5s linear}.top-settings{background:#fff;padding:10px 10px 5px;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;border-top-left-radius:4px;border-top-right-radius:4px;box-shadow:0 4px 21px rgba(7,16,28,.1)}.header-posts a,.un-categorised-items a{color:#444;padding:7px;display:block;text-decoration:none;font-size:14px;border-radius:4px;line-height:18px}.header-posts a.active-item,.orange-bg>span,.un-categorised-items.active-item,.wcp-container .route.active-item>h3.title{background-color:#fa166b!important;color:#fff}.header-posts a.active-item span.total-count,.un-categorised-items.active-item span.total-count,.wcp-container .route.active-item>h3.title span.total-count{color:#fff!important}.wcp-icon{display:inline-block;font-size:16px;vertical-align:top;margin-right:3px}span.total-count{float:right;font-size:12px;line-height:16px}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#fff!important}.header-posts a:hover,.un-categorised-items.active-item,.un-categorised-items:hover{background:rgba(250,22,107,.08);border-radius:4px;color:#444}.un-categorised-items.active-item a,.un-categorised-items.active-item a:hover{color:#fff}.un-categorised-items a:hover,.un-categorised-items:hover a{color:#444}.media-frame .folder-custom-menu a:focus{outline:0;box-shadow:none}.sticky-title{font-size:16px;font-weight:700;padding:7px}div#custom-menu{padding:10px;background:#fff;box-shadow:0 4px 21px rgba(7,16,28,.1)}.wcp-container .space{position:relative;list-style-type:none;border:0;margin:0 0 0 20px;padding:0 0 30px 0;width:40px;top:30px;height:100%;z-index:1}.wcp-container .first-space{margin-left:0;top:0;padding:0}.wcp-container .route{position:relative;list-style-type:none;border:0;margin:0;padding:0;top:0;max-height:100%!important;width:100%;border-radius:2px;z-index:-1;background:0 0}.wcp-container .route .title{position:absolute;border:0;margin:0;padding:0;height:30px;width:200px;text-indent:28px;background:0 0;box-shadow:none;font-size:13px;line-height:26px;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;overflow:hidden;font-weight:400}.wcp-container .route span{position:absolute;top:2px;left:0;z-index:10;width:20px;height:18px;text-indent:0;font-size:20px;background:no-repeat;text-align:center}.wcp-container .route span.ui-icon{line-height:24px;font-size:18px;cursor:move;left:5px;top:2px;height:26px}#custom-menu .wcp-icon{font-size:16px!important;line-height:24px}#custom-menu input.checkbox{display:none}.wcp-container .route span.title-text{position:relative;top:auto;left:auto;display:inline-block;font-size:16px;line-height:30px;height:30px;width:calc(100% - 100px);overflow:hidden;white-space:nowrap;text-align:left}#custom-menu [class*=" pfolder-"],#custom-menu [class^=pfolder-]{font-size:12px}.wcp-container .route .title .folder-sticky-icon,.wcp-container .route .title .move-folder-icon{float:right;position:relative;top:0;left:auto;width:20px;height:30px;line-height:26px;display:none}.wcp-container .route.is-sticky>h3.title .folder-sticky-icon,.wcp-container .route.is-sticky>h3.title .move-folder-icon{display:block}.nav-icon{display:none;left:-10px!important;cursor:pointer}#custom-menu .route .nav-icon .wcp-icon{font-size:9px!important;color:#fa166b;font-weight:700;transform:rotate(-90deg);transition:all .25s linear}.header-posts a,.un-categorised-items a,.wcp-container .route span.title-text{font-size:12px}.wcp-container .route span.total-count{position:relative;font-size:10px;float:right;text-align:center;width:auto;display:block;margin:4px 8px 3px 3px;color:#23282d!important;line-height:16px;height:16px}.has-sub-tree>.nav-icon{display:block}.has-sub-tree>ul.ui-sortable li{display:none}.has-sub-tree.active>ul.ui-sortable>li{display:block}body:not(.no-hover-css) .wcp-container .route .title:hover{background:rgba(250,22,107,.08);cursor:pointer}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .move-folder-icon,body:not(.no-hover-css) .wcp-container .route .title:hover .move-folder-icon{display:block}body:not(.no-hover-css) .wcp-container .route .title:hover>.folder-sticky-icon,body:not(.no-hover-css) .wcp-container .route .title:hover>.star-icon{display:none!important}body:not(.no-hover-css) .sticky-folders li a:hover span.update-inline-record,body:not(.no-hover-css) .wcp-container .route h3:hover>span.update-inline-record{width:18px}body:not(.no-hover-css) .wcp-container .route .title.wcp-drop-hover .ui-icon .pfolder-folder-close:before,body:not(.no-hover-css) .wcp-container .route .title:hover .ui-icon .pfolder-folder-close:before{content:"\e901"!important}.sticky-folders li.is-high a span.star-icon,.wcp-container .route.is-high>h3>span.star-icon{display:block}.dynamic-menu{position:fixed;left:50px;background:#fff;width:170px;padding:0;z-index:1000001;-webkit-box-shadow:0 0 5px 0 rgba(0,0,0,.25);-moz-box-shadow:0 0 5px 0 rgba(0,0,0,.25);box-shadow:0 0 5px 0 rgba(0,0,0,.25)}.dynamic-menu ul{margin:0;padding:0}.dynamic-menu li{position:relative;width:100%;display:block!important;padding:2px 0;margin:0}.dynamic-menu li.new-folder{border-bottom:solid 1px #d8d8d8}.dynamic-menu a{text-decoration:none;color:#848484;position:relative;display:block;padding:5px 10px;line-height:18px;white-space:nowrap}.dynamic-menu ul>li>a>span,.dynamic-menu ul>li>a>span span{position:relative!important;display:inline-block;vertical-align:middle;margin-right:5px;top:auto!important;width:20px!important;height:20px!important;line-height:14px}#custom-menu .dynamic-menu ul>li>a .sticky-pin{line-height:20px}#custom-menu .dynamic-menu ul>li>a .sticky-pin i{font-size:16px!important}li.active-menu{z-index:2!important}.dynamic-menu a.active,.dynamic-menu a:hover{background:#efefef;color:#000}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none}.popup-form-content{background:#fff;min-height:100px;width:400px;text-align:center;margin:0 auto;position:absolute;left:0;right:0;top:50%;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);-o-transform:translate(0,-50%);-ms-transform:translate(0,-50%);padding:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#484848}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;text-align:center;text-transform:none;word-wrap:break-word;font-weight:700;font-size:22px;line-height:26px}.folder-group{position:relative;margin:45px auto 15px;padding:0 2px}.folder-group input,.folder-group textarea{background:0 0;font-size:14px;padding:0 0 0 15px;display:block;width:100%;border-radius:4px;border:1px solid #484848;height:34px;line-height:34px;color:#484848;outline:0}.highlight{background-color:#e4f2fd;color:#000}.folder-group .folder-bar{position:relative;display:block;width:320px}.folder-group label{font-size:14px;font-weight:500;position:absolute;pointer-events:none;left:20px;top:10px;-webkit-transition:.3s ease all;transition:.3s ease all;color:#484848}.folder-form-errors{margin:0 0 10px 0;padding:8px 0;background:#ffe4e4;color:#a20000;display:none}.folder-form-buttons{display:flex}.folder-form-buttons a,.folder-form-buttons button{display:inline-flex;padding:0;text-decoration:none;margin:10px 3px;border-radius:4px;border:solid 1px #1da1f4;line-height:34px;font-weight:700;font-size:14px;box-sizing:border-box;height:36px;cursor:pointer;flex:1;justify-content:center;outline:0;color:#fff}.folder-form-buttons .form-cancel-btn,.folder-form-buttons a.form-cancel-btn:hover{background-color:#fff;color:#3085d6;outline:0}.form-submit-btn,.form-submit-btn:hover{background-color:#3085d6;color:#fff!important;outline:0}.folder-group input:focus~label,.folder-group input:valid~label,.folder-group textarea:focus~label,.folder-group textarea:valid~label{top:-9px;background:#fff;padding:0 5px;font-weight:400;font-size:12px;line-height:14px;color:#aeaeae}#no-more-folder-credit .folder-form-message{margin:20px 80px;font-size:14px}.folder-form-message{margin:25px auto;font-size:15px;line-height:18px;color:#484848;width:310px}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.folder-form-buttons a span,.folder-form-buttons button span{-webkit-animation:fa-spin .75s infinite linear;animation:fa-spin .75s infinite linear;padding:7px}.wcp-container .folder-tooltip{position:relative}.wcp-container .folder-tooltip::after,.wcp-container .folder-tooltip::before{text-transform:none;font-size:.9em;line-height:1;user-select:none;pointer-events:none;position:absolute;display:none;opacity:0}.wcp-container .folder-tooltip::before{content:'';border:5px solid transparent;z-index:1001}.wcp-container .folder-tooltip::after{content:attr(data-folder-tooltip);font-family:Helvetica,sans-serif;text-align:center;min-width:3em;max-width:21em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:1ch 1.5ch;border-radius:.3ch;box-shadow:0 1em 2em -.5em rgba(0,0,0,.35);background:#333;color:#fff;z-index:1000}.wcp-container .folder-tooltip:hover::after,.wcp-container .folder-tooltip:hover::before{display:block;opacity:1}.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::before{bottom:100%;border-bottom-width:0;border-top-color:#333}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip[flow^=up]::after{bottom:calc(100% + 5px)}.wcp-container .folder-tooltip:not([flow])::after,.wcp-container .folder-tooltip:not([flow])::before,.wcp-container .folder-tooltip[flow^=up]::after,.wcp-container .folder-tooltip[flow^=up]::before{left:50%;transform:translate(-50%,-.5em)}.folder-order.active .folder-sort-menu{display:block}.folder-sort-menu li a.active,.folder-sort-menu li a:hover{background:#efefef;color:#000}.media-toolbar-secondary select{width:30%!important;width:calc(30% - 10px)!important;margin:32px 10px 0 0!important}.media-frame .uploader-inline{z-index:1}.wcp-drop-hover{background:#fa166b!important;z-index:2!important;color:#fff!important}.wcp-drop-hover i{color:#fff!important}.selected-items{background:#0073aa;color:#fff;padding:10px 20px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;margin-top:0;cursor:none;font-size:12px;z-index:10001!important}.media-frame,.media-frame .attachments-browser,.media-frame-content{overflow:inherit}#custom-menu .route.active .nav-icon .wcp-icon{transform:rotate(0);-webkit-transform:rotate(0)}.expand-collapse.all-open span.icon{transform:rotate(180deg);-webkit-transform:rotate(180deg)}.folder-search-form{padding:0 0 10px 0;position:relative}.folder-search-form input{background:#fff;border:1px solid #dbdbdb!important;box-sizing:border-box;border-radius:4px;height:32px;line-height:32px;box-sizing:border-box;padding:0 5px!important;width:100%!important;box-shadow:none!important;outline:0}.folder-search-form span{position:absolute;color:#aeaeae;right:0;top:0;height:32px;line-height:32px;width:32px;text-align:center}.folder-separator{padding:0 10px;height:1px;background:#e9e5e5;margin:0 0 10px 0}.wcp-drop-hover i{color:#fff!important}.ui-draggable-dragging{z-index:10051!important}.attachments.ui-sortable.ui-draggable-dragging{z-index:10001!important}#custom-menu.has-filter li.route{display:none!important}#custom-menu.has-filter li.route.has-search{display:block!important}#custom-menu.has-filter h3 span.title-text.has-search-text{font-weight:700}.form-options>ul>li>a:hover{background:#404040;color:#fff}#custom-menu.show-folder-checkbox input.checkbox{display:block;margin:5px 0 0 0}#custom-menu.show-folder-checkbox h3.title>.ui-icon>i,#custom-menu.show-folder-checkbox h3.title>.ui-icon>img{display:none!important}.plugin-button{float:right}.plugin-button.d-block{float:none}.plugin-title{display:inline-block}.form-options .form-options{background:0 0;padding:0;box-shadow:none}.attachments-browser .media-toolbar-secondary{width:78%;max-width:inherit}.media-toolbar-primary.search-form{width:20%;max-width:inherit}body .media-frame.hide-menu .media-frame-menu{display:block}.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-content,.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-router,.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-title,.folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-toolbar{left:275px}.media-frame-menu.has-folder-menu{width:275px}.media-frame-menu.has-folder-menu .folder-custom-menu{position:relative;border:none;width:100%}.media-frame.mode-select.hide-router .media-frame-content,.media-frame.mode-select.hide-router .media-frame-router,.media-frame.mode-select.hide-router .media-frame-title,.media-frame.mode-select.hide-router .media-frame-toolbar{left:275px}.media-frame.mode-select.hide-router select#media-attachment-taxonomy-filter{display:none}.media-frame.mode-select.hide-router .folder-custom-menu{display:none}html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-content,html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-router,html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-title,html[dir=rtl] .folder-modal .media-frame:not(.hide-menu):not(.hide-router) .media-frame-toolbar{left:0;right:275px}html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-content,html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-router,html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-title,html[dir=rtl] .media-frame.mode-select.hide-router .media-frame-toolbar{left:0;right:275px}html[dir=rtl] .media-frame.hide-menu .media-frame-content,html[dir=rtl] .media-frame.hide-menu .media-frame-router,html[dir=rtl] .media-frame.hide-menu .media-frame-title,html[dir=rtl] .media-frame.hide-menu .media-frame-toolbar{left:0;right:275px}html[dir=rtl] .folder-modal .media-frame .media-frame-router,html[dir=rtl] .folder-modal .media-frame .media-frame-title,html[dir=rtl] .folder-modal .media-frame .media-frame-toolbar,html[dir=rtl] .media-frame .folder-modal .media-frame-content{left:0;right:275px}.sticky-folders>ul>li{position:relative}#vakata-dnd{z-index:10000000!important}.add-folder-note{font-size:13px}
assets/js/folders.js CHANGED
@@ -35,6 +35,8 @@
35
  "</a>" +
36
  "</div>" +
37
  "</li>";
 
 
38
  $(document).ready(function(){
39
 
40
  foldersArray = wcp_settings.taxonomies;
@@ -178,6 +180,8 @@
178
  });
179
 
180
  $(document).on("contextmenu", ".jstree-anchor", function(e){
 
 
181
  $(this).find("span.folder-inline-edit").trigger("click");
182
  return false;
183
  });
@@ -193,7 +197,7 @@
193
  isStickyClass = (isSticky)?true:false;
194
  $(".dynamic-menu").remove();
195
  $(".active-menu").removeClass("active-menu");
196
- menuHtml = "<div class='dynamic-menu'><ul>" +
197
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
198
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
199
  "<li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span> Sticky Folder (Pro)</a></li>" +
@@ -206,14 +210,29 @@
206
  }
207
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
208
  "</ul></div>";
209
- $(this).closest("a.jstree-anchor").after(menuHtml);
 
 
 
 
 
 
 
 
 
 
 
210
  $(this).parents("li.jstree-node").addClass("active-menu");
211
- if(($(this).offset().top + $(".dynamic-menu").height()) > ($(window).height() - 20)) {
212
- $(".dynamic-menu").addClass("bottom-fix");
 
 
 
 
 
213
 
214
- if($(".dynamic-menu.bottom-fix").offset().top < $("#custom-scroll-menu").offset().top) {
215
- $(".dynamic-menu").removeClass("bottom-fix");
216
- }
217
  }
218
  });
219
 
@@ -259,7 +278,7 @@
259
  isStickyClass = (isSticky)?true:false;
260
  $(".dynamic-menu").remove();
261
  $(".active-menu").removeClass("active-menu");
262
- menuHtml = "<div class='dynamic-menu'><ul>" +
263
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
264
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
265
  "<li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li>" +
@@ -272,13 +291,21 @@
272
  }
273
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
274
  "</ul></div>";
275
- $(this).closest("li").append(menuHtml);
276
- if(($(this).offset().top + $(".dynamic-menu").height()) > ($(window).height() - 20)) {
277
- $(".dynamic-menu").addClass("bottom-fix");
278
 
279
- if($(".dynamic-menu.bottom-fix").offset().top < $("#custom-scroll-menu").offset().top) {
280
- $(".dynamic-menu").removeClass("bottom-fix");
281
- }
 
 
 
 
 
 
 
 
 
 
282
  }
283
  });
284
 
@@ -953,6 +980,8 @@
953
  setHeight: contentHeight,
954
  theme:"3d",
955
  scrollbarPosition:"inside",
 
 
956
  });
957
  if(scrollTop != 0) {
958
  $("#custom-scroll-menu").mCustomScrollbar("scrollTo", scrollTop+"px",{scrollInertia:0});
@@ -972,22 +1001,14 @@
972
  });
973
 
974
  $(document).on("click", ".new-folder", function(){
975
- if($(this).closest("li.jstree-node").length) {
976
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
977
- } else {
978
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
979
- }
980
  isItFromMedia = false;
981
  addFolder();
982
  });
983
 
984
  $(document).on("click", ".duplicate-folder", function(e){
985
  e.stopPropagation();
986
- if($(this).closest("li.jstree-node").length) {
987
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
988
- } else {
989
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
990
- }
991
  $(".dynamic-menu").remove();
992
  isItFromMedia = false;
993
  isDuplicate = true;
@@ -1095,7 +1116,7 @@
1095
  return false;
1096
  }
1097
 
1098
- $("#add-update-folder-title").text("Add new folder");
1099
  $("#save-folder-data").text("Submit");
1100
  $(".folder-form-errors").removeClass("active");
1101
  $("#add-update-folder-name").val("");
@@ -1127,16 +1148,12 @@
1127
 
1128
  $(document).on("click", ".rename-folder", function(e){
1129
  e.stopPropagation();
1130
- if($(this).closest("li.jstree-node").length) {
1131
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
1132
- } else {
1133
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
1134
- }
1135
  updateFolder();
1136
  $(".dynamic-menu").remove();
1137
  });
1138
 
1139
-
1140
  $(document).on("click", ".form-cancel-btn", function(){
1141
  $(".folder-popup-form").hide();
1142
  });
@@ -1256,11 +1273,7 @@
1256
 
1257
  $(document).on("click", ".remove-folder", function(){
1258
  folderID = $(this).closest("li.jstree-node").data("id");
1259
- if($(this).closest("li.jstree-node").length) {
1260
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
1261
- } else {
1262
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
1263
- }
1264
  removeFolderFromID(0);
1265
  $(".dynamic-menu").remove();
1266
  $(".active-menu").removeClass("active-menu");
@@ -1409,11 +1422,7 @@
1409
  $(document).ready(function(){
1410
  $(document).on("click", ".mark-folder", function(e){
1411
  e.stopPropagation();
1412
- if($(this).closest("li.jstree-node").length) {
1413
- folderID = $(this).closest("li.jstree-node").attr("id");
1414
- } else {
1415
- folderID = $(this).closest("li.sticky-fldr").data("folder-id");
1416
- }
1417
  nonce = getSettingForPost(folderID, 'nonce');
1418
  $(".form-loader-count").css("width","100%");
1419
  $(".dynamic-menu").remove();
@@ -1515,7 +1524,7 @@
1515
  history.pushState(obj, obj.Title, obj.Url);
1516
  set_default_folders(folderSlug);
1517
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1518
- $(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1519
  }
1520
  triggerInlineUpdate();
1521
  });
@@ -1525,7 +1534,7 @@
1525
  history.pushState(obj, obj.Title, obj.Url);
1526
  set_default_folders(folderSlug);
1527
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1528
- $(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1529
  }
1530
  triggerInlineUpdate();
1531
  });
@@ -1561,7 +1570,7 @@
1561
  history.pushState(obj, obj.Title, obj.Url);
1562
  set_default_folders("all");
1563
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1564
- $(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1565
  }
1566
  add_active_item_to_list();
1567
  triggerInlineUpdate();
@@ -1572,7 +1581,7 @@
1572
  history.pushState(obj, obj.Title, obj.Url);
1573
  set_default_folders("all");
1574
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1575
- $(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1576
  }
1577
  add_active_item_to_list();
1578
  triggerInlineUpdate();
@@ -1605,7 +1614,7 @@
1605
  history.pushState(obj, obj.Title, obj.Url);
1606
  set_default_folders("-1");
1607
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1608
- $(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1609
  }
1610
  add_active_item_to_list();
1611
  triggerInlineUpdate();
@@ -1616,7 +1625,7 @@
1616
  history.pushState(obj, obj.Title, obj.Url);
1617
  set_default_folders("-1");
1618
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1619
- $(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>');
1620
  }
1621
  add_active_item_to_list();
1622
  triggerInlineUpdate();
@@ -2100,10 +2109,6 @@
2100
  setMediaBoxWidth();
2101
  });
2102
 
2103
- $(document).ready(function(){
2104
-
2105
- });
2106
-
2107
  $(document).on("click", ".button.organize-button", function(){
2108
  if(!$(".media-frame").hasClass("mode-select")) {
2109
  setCookie("media-select-mode", "on", 7);
35
  "</a>" +
36
  "</div>" +
37
  "</li>";
38
+ var contextOffsetX = null;
39
+ var contextOffsetY = null;
40
  $(document).ready(function(){
41
 
42
  foldersArray = wcp_settings.taxonomies;
180
  });
181
 
182
  $(document).on("contextmenu", ".jstree-anchor", function(e){
183
+ contextOffsetX = e.pageX;
184
+ contextOffsetY = e.pageY;
185
  $(this).find("span.folder-inline-edit").trigger("click");
186
  return false;
187
  });
197
  isStickyClass = (isSticky)?true:false;
198
  $(".dynamic-menu").remove();
199
  $(".active-menu").removeClass("active-menu");
200
+ menuHtml = "<div class='dynamic-menu' data-id='"+$(this).closest("li").prop("id")+"'><ul>" +
201
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
202
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
203
  "<li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span> Sticky Folder (Pro)</a></li>" +
210
  }
211
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
212
  "</ul></div>";
213
+ $("body").append(menuHtml);
214
+ var yPosition;
215
+ if(e.pageX == undefined || e.pageY == undefined) {
216
+ $(".dynamic-menu").css("left", (contextOffsetX));
217
+ $(".dynamic-menu").css("top", (contextOffsetY - 10));
218
+ yPosition = contextOffsetY;
219
+ } else {
220
+ $(".dynamic-menu").css("left", (e.pageX));
221
+ $(".dynamic-menu").css("top", (e.pageY));
222
+ yPosition = e.pageY;
223
+ }
224
+
225
  $(this).parents("li.jstree-node").addClass("active-menu");
226
+ // if(($(this).offset().top + $(".dynamic-menu").height()) > ($(window).height() - 20)) {
227
+ // $(".dynamic-menu").addClass("bottom-fix");
228
+ //
229
+ // if($(".dynamic-menu.bottom-fix").offset().top < $("#custom-scroll-menu").offset().top) {
230
+ // $(".dynamic-menu").removeClass("bottom-fix");
231
+ // }
232
+ // }
233
 
234
+ if((yPosition + $(".dynamic-menu").height()) > $(window).height()) {
235
+ $(".dynamic-menu").css("margin-top", $(window).height() - (yPosition + $(".dynamic-menu").height()));
 
236
  }
237
  });
238
 
278
  isStickyClass = (isSticky)?true:false;
279
  $(".dynamic-menu").remove();
280
  $(".active-menu").removeClass("active-menu");
281
+ menuHtml = "<div class='dynamic-menu' data-id='"+$(this).closest("li").data("folder-id")+"'><ul>" +
282
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
283
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
284
  "<li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li>" +
291
  }
292
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
293
  "</ul></div>";
294
+ $("body").append(menuHtml);
 
 
295
 
296
+ var yPosition;
297
+ if(e.pageX == undefined || e.pageY == undefined) {
298
+ $(".dynamic-menu").css("left", (contextOffsetX));
299
+ $(".dynamic-menu").css("top", (contextOffsetY - 10));
300
+ yPosition = contextOffsetY;
301
+ } else {
302
+ $(".dynamic-menu").css("left", (e.pageX));
303
+ $(".dynamic-menu").css("top", (e.pageY));
304
+ yPosition = e.pageY;
305
+ }
306
+
307
+ if((yPosition + $(".dynamic-menu").height()) > $(window).height()) {
308
+ $(".dynamic-menu").css("margin-top", $(window).height() - (yPosition + $(".dynamic-menu").height()));
309
  }
310
  });
311
 
980
  setHeight: contentHeight,
981
  theme:"3d",
982
  scrollbarPosition:"inside",
983
+ scrollInertia: 500,
984
+ mouseWheelPixels: 60
985
  });
986
  if(scrollTop != 0) {
987
  $("#custom-scroll-menu").mCustomScrollbar("scrollTo", scrollTop+"px",{scrollInertia:0});
1001
  });
1002
 
1003
  $(document).on("click", ".new-folder", function(){
1004
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
1005
  isItFromMedia = false;
1006
  addFolder();
1007
  });
1008
 
1009
  $(document).on("click", ".duplicate-folder", function(e){
1010
  e.stopPropagation();
1011
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
1012
  $(".dynamic-menu").remove();
1013
  isItFromMedia = false;
1014
  isDuplicate = true;
1116
  return false;
1117
  }
1118
 
1119
+ $("#add-update-folder-title").text("Add a new folder");
1120
  $("#save-folder-data").text("Submit");
1121
  $(".folder-form-errors").removeClass("active");
1122
  $("#add-update-folder-name").val("");
1148
 
1149
  $(document).on("click", ".rename-folder", function(e){
1150
  e.stopPropagation();
1151
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
1152
  updateFolder();
1153
  $(".dynamic-menu").remove();
1154
  });
1155
 
1156
+
1157
  $(document).on("click", ".form-cancel-btn", function(){
1158
  $(".folder-popup-form").hide();
1159
  });
1273
 
1274
  $(document).on("click", ".remove-folder", function(){
1275
  folderID = $(this).closest("li.jstree-node").data("id");
1276
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
1277
  removeFolderFromID(0);
1278
  $(".dynamic-menu").remove();
1279
  $(".active-menu").removeClass("active-menu");
1422
  $(document).ready(function(){
1423
  $(document).on("click", ".mark-folder", function(e){
1424
  e.stopPropagation();
1425
+ folderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
1426
  nonce = getSettingForPost(folderID, 'nonce');
1427
  $(".form-loader-count").css("width","100%");
1428
  $(".dynamic-menu").remove();
1524
  history.pushState(obj, obj.Title, obj.Url);
1525
  set_default_folders(folderSlug);
1526
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1527
+ $(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>');
1528
  }
1529
  triggerInlineUpdate();
1530
  });
1534
  history.pushState(obj, obj.Title, obj.Url);
1535
  set_default_folders(folderSlug);
1536
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1537
+ $(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>');
1538
  }
1539
  triggerInlineUpdate();
1540
  });
1570
  history.pushState(obj, obj.Title, obj.Url);
1571
  set_default_folders("all");
1572
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1573
+ $(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>');
1574
  }
1575
  add_active_item_to_list();
1576
  triggerInlineUpdate();
1581
  history.pushState(obj, obj.Title, obj.Url);
1582
  set_default_folders("all");
1583
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1584
+ $(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>');
1585
  }
1586
  add_active_item_to_list();
1587
  triggerInlineUpdate();
1614
  history.pushState(obj, obj.Title, obj.Url);
1615
  set_default_folders("-1");
1616
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1617
+ $(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>');
1618
  }
1619
  add_active_item_to_list();
1620
  triggerInlineUpdate();
1625
  history.pushState(obj, obj.Title, obj.Url);
1626
  set_default_folders("-1");
1627
  if (wcp_settings.show_in_page == "show" && !$(".tree-structure").length) {
1628
+ $(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>');
1629
  }
1630
  add_active_item_to_list();
1631
  triggerInlineUpdate();
2109
  setMediaBoxWidth();
2110
  });
2111
 
 
 
 
 
2112
  $(document).on("click", ".button.organize-button", function(){
2113
  if(!$(".media-frame").hasClass("mode-select")) {
2114
  setCookie("media-select-mode", "on", 7);
assets/js/folders.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e,t){var s,o,a,r,l="#js-tree-menu",n="",d=!1,c=!1,p=0,u=0,m=0,f=!1,h="",g=[],_=wcp_settings.page_url,v=[],w="<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'><div class='folder-item is-folder' data-id='__folder_id__'><a title='__folder_name__' id='folder_view___folder_id__'class='folder-view __append_class__ has-new-folder'data-id='__folder_id__'><span class='folder item-name'><span id='wcp_folder_text___folder_id__'class='folder-title'>__folder_name__</span></span></a></div></li>";function j(){e(".wcp-move-file:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:"clone",cursor:"move",start:function(t,s){e(this).closest("td").addClass("wcp-draggable"),e("body").addClass("no-hover-css")},stop:function(t,s){e(this).closest("td").removeClass("wcp-draggable"),e("body").removeClass("no-hover-css")}}),e(".wcp-move-multiple:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,s){return e(".selected-items").remove(),selectedItems=e("#the-list th input:checked").length,selectedItems>0?(selectedItems=0==selectedItems||1==selectedItems?"1 Item":selectedItems+" Items",e("<div class='selected-items'><span class='total-post-count'>"+selectedItems+" Selected</span></div>")):e("<div class='selected-items'><span class='total-post-count'>Select Items to move</span></div>")},start:function(t,s){e("body").addClass("no-hover-css")},cursor:"move",cursorAt:{left:0,top:0},stop:function(t,s){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}}),e(".jstree-anchor:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){folderID=e(this).closest("li.jstree-node").attr("id"),o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),s=y(folderID,"nonce"),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?k():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=y(folderID,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?k():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=y(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),h=chkStr,e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k()}}))}}),e(".un-categorised-items:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){folderID=-1,s=wcp_settings.nonce,o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k()}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,chkStr=postID+",",e(".wp-list-table input:checked").each(function(){postID!=e(this).val()&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),h=chkStr,e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k()}}))}}),e(".attachments-browser li.attachment:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,s){return e(".selected-items").remove(),selectedItems=e(".attachments-browser li.attachment.selected").length,selectedItems=0==selectedItems||1==selectedItems?"1 Item":selectedItems+" Items",e("<div class='selected-items'><span class='total-post-count'>"+selectedItems+" Selected</span></div>")},start:function(t,s){e("body").addClass("no-hover-css")},cursor:"move",cursorAt:{left:0,top:0},stop:function(t,s){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}}),e(".tree-structure .folder-item:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){e("body").removeClass("no-hover-css"),folderID=e(this).data("id"),o.draggable.hasClass("wcp-move-multiple")?(s=y(folderID,"nonce"),e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k(),z()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=y(folderID,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k(),z()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=y(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k(),z()}}))}}),e(".sticky-folders li a:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){folderID=e(this).closest("li").data("folder-id"),o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),s=y(folderID,"nonce"),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(k(),z()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=y(folderID,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(k(),z()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=y(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),h=chkStr,e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(e){k(),z()}}))}}),R()}function y(e,t){if(g.length>0)for(i=0;i<g.length;i++)if(parseInt(g[i].folder_id)==parseInt(e))return g[i][t];return""}function b(e){if(g.length>0)for(i=0;i<g.length;i++)if(parseInt(g[i].folder_id)==parseInt(e))return i;return null}function k(){if(e(".media-toolbar").hasClass("media-toolbar-mode-select")&&e("ul.attachments li.selected").length&&(e("ul.attachments li.selected").trigger("click"),e(".select-mode-toggle-button").trigger("click")),""!=h&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==n)){if(e("#media-attachment-taxonomy-filter").length){h=h.split(",");for(var t=0;t<h.length;t++)""!=h[t]&&e(".attachments-browser li[data-id='"+h[t]+"']").remove()}h=""}e("#media-attachment-taxonomy-filter").length?M(0):(e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=get_folders_default_list",method:"post",success:function(t){t=e.parseJSON(t),e(".header-posts .total-count").text(t.total_items),e(".un-categorised-items .total-count").text(t.empty_items),v=t.taxonomies,R()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),C(),x()}):e("#wpbody").load(_+" #wpbody-content",!1,function(t){var s={Title:"",Url:_};history.pushState(s,s.Title,s.Url),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),C()}))}function x(){C(),e(".form-loader-count").css("width","0"),"object"==typeof inlineEditPost&&(inlineEditPost.init(),e("#the-list").on("click",".editinline",function(){e(this).attr("aria-expanded","true"),inlineEditPost.edit(this)}),e(document).on("click",".inline-edit-save .save",function(){var t=e(this).closest("tr").attr("id");t=(t=t.replace("edit-","")).replace("post-",""),inlineEditPost.save(t)}),e(document).on("click",".inline-edit-save .cancel",function(){var t=e(this).closest("tr").attr("id");t=(t=t.replace("edit-","")).replace("post-",""),inlineEditPost.revert(t)})),"attachment"==wcp_settings.post_type&&(e(".move-to-folder-top").length||e("#bulk-action-selector-top").append("<option class='move-to-folder-top' value='move_to_folder'>Move to Folder</option>"),e(".move-to-folder-bottom").length||e("#bulk-action-selector-bottom").append("<option class='move-to-folder-bottom' value='move_to_folder'>Move to Folder</option>"))}function C(){if(g.length&&e("li.jstree-node").each(function(){folderPostId=b(e(this).attr("id")),null!=folderPostId&&(1==g[folderPostId].is_high?e(this).addClass("is-high"):e(this).removeClass("is-high"),1==g[folderPostId].is_sticky?e(this).addClass("is-sticky"):e(this).removeClass("is-sticky"))}),folderId=0,e(".tree-structure ul").html(""),folderStatus=!0,e(".jstree-clicked").length&&(folderID=e(".jstree-clicked").closest(".jstree-node").attr("id"),e(".jstree-node[id='"+folderID+"'] > ul.jstree-children > li.jstree-node").length?(folderStatus=!1,e(".jstree-node[id='"+folderID+"'] > ul.jstree-children > li.jstree-node").each(function(){fID=e(this).attr("id"),fName=e.trim(e("#js-tree-menu").jstree(!0).get_node(fID).text),liHtml=w.replace(/__folder_id__/g,fID),liHtml=liHtml.replace(/__folder_name__/g,fName),selectedClass=e(this).hasClass("is-high")?"is-high":"",liHtml=liHtml.replace(/__append_class__/g,selectedClass),e(".tree-structure ul").append(liHtml)})):e(".jstree-node[id='"+folderID+"']").closest("ul").hasClass("jstree-container-ul")||(folderStatus=!1)),folderStatus&&e("#js-tree-menu > ul > li.jstree-node").each(function(){fID=e(this).attr("id"),fName=e.trim(e("#js-tree-menu").jstree(!0).get_node(fID).text),liHtml=w.replace(/__folder_id__/g,fID),liHtml=liHtml.replace(/__folder_name__/g,fName),selectedClass=e(this).hasClass("is-high")?"is-high":"",liHtml=liHtml.replace(/__append_class__/g,selectedClass),e(".tree-structure ul").append(liHtml)}),O(),"attachment"==wcp_settings.post_type&&(e(".move-to-folder-top").length||e("#bulk-action-selector-top").append("<option class='move-to-folder-top' value='move_to_folder'>Move to Folder</option>"),e(".move-to-folder-bottom").length||e("#bulk-action-selector-bottom").append("<option class='move-to-folder-bottom' value='move_to_folder'>Move to Folder</option>")),e(".sticky-folders .active-item").removeClass("active-item"),e("#js-tree-menu li.jstree-node.active-item").length){var t=e("#js-tree-menu li.jstree-node.active-item").data("folder-id");e(".sticky-folders .sticky-folder-"+t+" a").addClass("active-item")}j()}function I(){C()}function S(){if(0==o&&a>=10)return e("#folder-limitation-message").html("You've reached the 10 folder limitation!"),e("#no-more-folder-credit").show(),!1;e("#add-update-folder-title").text("Add new folder"),e("#save-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#add-update-folder-name").val(""),c&&(p=u,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(u).text)+" #2"),u=e("#"+u+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+u+"_anchor").closest(".jstree-node").parent().parent().attr("id"):0),e("#add-update-folder").removeClass("disabled"),e("#add-update-folder").show(),e("#add-update-folder-name").focus(),e(".dynamic-menu").remove()}function D(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(u).text),parentID=e("#wcp_folder_"+u).closest("li.jstree-node").data("folder-id"),parentID==t&&(parentID=0),e("#update-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#update-folder-item-name").val(folderName),e("#update-folder-item").removeClass("disabled"),e("#update-folder-item").show(),e("#update-folder-item-name").focus(),e(".dynamic-menu").remove()}function P(t){var s="Are you sure you want to delete the selected folder?",o="Items in the folder will not be deleted.";if(f=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(f=!0,0==e("#js-tree-menu input.checkbox:checked").length)return e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html("Please select at least one folder to delete"),void e("#error-folder-popup").show();e("#js-tree-menu input.checkbox:checked").length>1&&(s="Are you sure you want to delete the selected folders?",o="Items in the selected folders will not be deleted.")}e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#remove-folder-item").text("Yes, Delete it!"),e("#remove-folder-message").text(s),e("#remove-folder-notice").text(o),e("#confirm-remove-folder").show(),e("#remove-folder-item").focus()}function T(){e(l).jstree({core:{cache:!1,animation:0,check_callback:function(t,s,o,a,r){if(e("*").removeClass("drag-bot").removeClass("drag-in").removeClass("drag-up"),("move_node"===t||"copy_node"===t)&&r&&r.dnd)switch(r.pos){case"a":r.origin.get_node(r.ref,!0).addClass("drag-bot"),nodeId=e(".drag-bot").attr("id"),e("#jstree-dnd").text("Below "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"i":r.origin.get_node(r.ref,!0).addClass("drag-in"),nodeId=e(".drag-in").attr("id"),e("#jstree-dnd").text("Inside "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"b":r.origin.get_node(r.ref,!0).addClass("drag-up"),nodeId=e(".drag-up").attr("id"),e("#jstree-dnd").text("Above "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;default:e("#jstree-dnd").text(e("#jstree-dnd").data("txt"))}return!0}},data:{cache:!1},select_node:!1,search:{show_only_matches:!0,case_sensitive:!1,fuzzy:!1},plugins:["dnd","search","contextmenu"],contextmenu:{select_node:0,show_at_node:0,items:function(){return{}}}}).bind("ready.jstree",function(){e("#js-tree-menu .jstree-node").each(function(){var t=parseInt(e(this).data("count"));t>0&&e(".jstree-node[id='"+e(this).attr("id")+"'] > a span.premio-folder-count").text(t)}),""!=n&&0!=n&&e(".jstree-node[id='"+n+"']").length&&(e("#js-tree-menu").jstree("select_node",n),e(".sticky-folders .sticky-folder-"+n+" a").length&&e(".sticky-folders .sticky-folder-"+n+" a").addClass("active-item")),e(".ajax-preloader").hide(),e(".js-tree-data").show(),J(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active"),C(),j()}).bind("after_open.jstree",function(){j()}).bind("open_all.jstree",function(){j()}).bind("create_node.jstree",function(){j()}).bind("delete_node.jstree",function(){j()}).bind("close_all.jstree",function(){j()}).bind("after_close.jstree",function(){j()}).bind("move_node.jstree",function(t,s){folderMoveId=s.node.id,orderString="",e(".jstree-node[id='"+folderMoveId+"']").closest("ul").children().each(function(){"undefined"!=e(this).attr("id")&&(orderString+=e(this).attr("id")+",")}),e("#"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?parentID=e("#"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().attr("id"):parentID=0,""!=orderString&&(e(".form-loader-count").css("width","100%"),e.ajax({url:wcp_settings.ajax_url,data:"term_ids="+orderString+"&action=wcp_save_folder_order&type="+wcp_settings.post_type+"&nonce="+wcp_settings.nonce+"&term_id="+folderMoveId+"&parent_id="+parentID,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#wcp_folder_parent").html(t.options),e(".form-loader-count").css("width","0"),k(),z(),R(),j()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))})}function N(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function H(t){e.ajax({url:wcp_settings.ajax_url,type:"post",data:"action=save_folder_last_status&post_type="+wcp_settings.post_type+"&post_id="+t+"&nonce="+wcp_settings.nonce,cache:!1,async:!1,success:function(){}})}function U(){setTimeout(function(){if(currentStatus=!0,e("#js-tree-menu .jstree-node.jstree-leaf").length==e("#js-tree-menu .jstree-node").length)e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand");else{var t=e("#js-tree-menu .jstree-node.jstree-closed").length+e("#js-tree-menu .jstree-node.jstree-open").length;e("#js-tree-menu .jstree-node.jstree-closed").length==t?(e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand")):(e("#expand-collapse-list").addClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Collapse"))}},500),j()}function O(){0==e(".tree-structure-content .tree-structure li").length?e(".tree-structure-content").hide():(e(".tree-structure-content").show(),oldHeight=e(".tree-structure-content .tree-structure").height(),e(".tree-structure-content .tree-structure").height("auto"),e(".tree-structure-content .tree-structure").height()>56?e(".folders-toggle-button").show():e(".folders-toggle-button").hide(),newHeight=e(".tree-structure-content .tree-structure").height(),e(".tree-structure-content .tree-structure").attr("data-height",newHeight),e(".tree-structure-content").hasClass("active")?(e(".tree-structure-content .tree-structure").height(newHeight),e(".tree-structure-content .tree-structure").attr("data-height",newHeight)):e(".tree-structure-content .tree-structure").height(oldHeight))}function z(){e(".folder-loader-ajax").addClass("active"),e(".folder-loader-ajax img").removeClass("active"),e(".folder-loader-ajax svg#successAnimation").addClass("active").addClass("animated"),setTimeout(function(){e(".folder-loader-ajax").removeClass("active"),e(".folder-loader-ajax img").addClass("active"),e(".folder-loader-ajax svg#successAnimation").removeClass("active").removeClass("animated")},2e3)}function J(){e(".sticky-folders > ul").html("");var t="";if(e("#js-tree-menu li.jstree-node.is-sticky").each(function(){var s=e(this).attr("id"),o=e.trim(e("#js-tree-menu").jstree(!0).get_node(s).text),a=e("li.jstree-node[id='"+s+"'] > a span.premio-folder-count").text(),r=e("li.jstree-node[id='"+s+"']").hasClass("is-high")?" is-high ":"";t+="<li data-folder-id='"+s+"' class='sticky-fldr "+r+" sticky-folder-"+s+"'><a href='javascript:;'><span class='folder-title'>"+o+"</span><span class='folder-actions'><span class='update-inline-record'><i class='pfolder-edit-folder'></i></span><span class='star-icon'><i class='pfolder-star'></i></span><span class='premio-folder-count'>"+a+"</span></span></a></li>"}),e(".sticky-folders > ul").html(t),e(".jstree-anchor.jstree-clicked").length){var s=e(".jstree-anchor.jstree-clicked").closest("li.jstree-node").attr("id");e(".sticky-folders .sticky-folder-"+s+" a").addClass("active-item")}e(".sticky-folders > ul > li").length>0?e(".sticky-folders").addClass("active"):e(".sticky-folders").removeClass("active")}function R(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){folders_media_options.terms=v;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),lastFolderData=v;for(var s=0;s<v.length;s++)t.append("<option value='"+v[s].term_id+"'>"+v[s].name+" ("+v[s].trash_count+")</option>");t.val(currentDDVal).trigger("change")}),e("select.folder_for_media").length)){var t=e("select.folder_for_media").val();e("select.folder_for_media option:not(:first-child):not(:last-child)").remove();for(var s=0;s<v.length;s++)e("select.folder_for_media option:last-child").before("<option value='"+v[s].term_id+"'>"+v[s].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),s=0;s<v.length;s++)0!=parseInt(v[s].trash_count)&&(e(".jstree-node[id='"+v[s].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(v[s].trash_count),e(".sticky-folder-"+v[s].term_id+" .premio-folder-count").text(v[s].trash_count));if(e(".media-select-folder").length){for(e(".media-select-folder").html("<option value=''>Select Folder</option><option value='-1'>(Unassigned)</option>"),s=0;s<v.length;s++)e(".media-select-folder").append("<option value='"+v[s].term_id+"'>"+v[s].name+" ("+v[s].trash_count+")</option>");e(".media-select-folder").val("")}""!=n&&e("#wcp_folder_"+n).addClass("active-item"),d&&(e("#title_"+u).trigger("click"),d=!1)}if(e(document).ready(function(){v=wcp_settings.taxonomies,o=parseInt(wcp_settings.is_key_active),a=parseInt(wcp_settings.folders),n=parseInt(wcp_settings.selected_taxonomy),g=wcp_settings.folder_settings,T();var r="1"==wcp_settings.isRTL||1==wcp_settings.isRTL?"w":"e";e(".wcp-content").resizable({resizeHeight:!1,handles:r,minWidth:100,maxWidth:500,resize:function(t,s){var o=s.size.width;for(o<=275?e(".plugin-button").addClass("d-block"):e(".plugin-button").removeClass("d-block"),o<=225&&(o=225),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",o+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",o+20+"px"),newWidth=o-40,cssString="",classString="",i=0;i<=15;i++)classString+=" .space > .jstree-node >",currentWidth=newWidth-(13+20*i),cssString+="#js-tree-menu > "+classString+" .title { width: "+currentWidth+"px !important; } ",cssString+="#js-tree-menu > "+classString+" .dynamic-menu { left: "+(currentWidth-190)+"px !important; } ";e("#wcp-custom-style").html("<style>"+cssString+"</style>"),s.size.width<=185?(folderStatus="hide",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").addClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").removeClass("active"),e("#wcp-content").addClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right","20px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left","20px")):e("#wcp-content").hasClass("hide-folders-area")&&(folderStatus="show",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").removeClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").addClass("active"),e("#wcp-content").addClass("no-transition"),e("#wcp-content").removeClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",parseInt(wcp_settings.folder_width)+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",parseInt(wcp_settings.folder_width)+20+"px"),setTimeout(function(){e("#wcp-content").removeClass("no-transition")},250))},stop:function(t,o){var a=o.size.width;o.size.width<=275?e(".plugin-button").addClass("d-block"):e(".plugin-button").removeClass("d-block"),a<=225&&(a=225),o.size.width<=185?(folderStatus="hide",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").addClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").removeClass("active"),e("#wcp-content").addClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right","20px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left","20px"),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_folder_display_status&status="+folderStatus+"&nonce="+s,method:"post",success:function(e){}})):e("#wcp-content").hasClass("hide-folders-area")&&(folderStatus="show",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").removeClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").addClass("active"),e("#wcp-content").addClass("no-transition"),e("#wcp-content").removeClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",parseInt(wcp_settings.folder_width)+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",parseInt(wcp_settings.folder_width)+20+"px"),setTimeout(function(){e("#wcp-content").removeClass("no-transition")},250)),s=wcp_settings.nonce,wcp_settings.folder_width=o.size.width,e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_post_width&width="+a+"&nonce="+s,method:"post",success:function(e){}}),o.size.width<=225&&(e(".wcp-content").width(225),wcp_settings.folder_width=225)}}),e(document).on("contextmenu",".jstree-anchor",function(t){return e(this).find("span.folder-inline-edit").trigger("click"),!1}),e(document).on("click",".folder-actions span.folder-inline-edit",function(t){t.stopImmediatePropagation(),t.stopPropagation(),0!=wcp_settings.can_manage_folder&&(isHigh=e(this).closest("li.jstree-node").hasClass("is-high"),isSticky=e(this).closest("li.jstree-node").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span> Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("a.jstree-anchor").find(".premio-folder-count").text()),"attachment"==wcp_settings.post_type&&hasPosts&&(menuHtml+="<li target='_blank' class='download-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e(this).closest("a.jstree-anchor").after(menuHtml),e(this).parents("li.jstree-node").addClass("active-menu"),e(this).offset().top+e(".dynamic-menu").height()>e(window).height()-20&&(e(".dynamic-menu").addClass("bottom-fix"),e(".dynamic-menu.bottom-fix").offset().top<e("#custom-scroll-menu").offset().top&&e(".dynamic-menu").removeClass("bottom-fix")))}),e(document).on("click",".sticky-folders .sticky-fldr > a",function(t){t.stopPropagation();var s=e(this).closest("li").data("folder-id");e(".jstree-node[id='"+s+"']").length&&(e(".jstree-clicked").removeClass("jstree-clicked"),e(".active-item").removeClass("active-item"),e("#js-tree-menu").jstree("select_node",n),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").trigger("click"),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").addClass("jstree-clicked"),e(".sticky-folders .sticky-folder-"+s+" a").addClass("active-item"))}),e(document).on("contextmenu",".sticky-folders li .sticky-fldr > a",function(t){return e(this).find("span.update-inline-record").trigger("click"),!1}),e(document).on("click",".tree-structure a",function(t){t.stopPropagation();var s=e(this).data("id");e(".jstree-node[id='"+s+"']").length&&(e(".jstree-clicked").removeClass("jstree-clicked"),e(".active-item").removeClass("active-item"),e("#js-tree-menu").jstree("select_node",n),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").trigger("click"),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").addClass("jstree-clicked"),e(".sticky-folders .sticky-folder-"+s+" a").addClass("active-item"))}),e(document).on("click",".update-inline-record",function(t){t.stopImmediatePropagation(),t.stopPropagation(),0!=wcp_settings.can_manage_folder&&(isHigh=e(this).closest("li.sticky-fldr").hasClass("is-high"),isSticky=e(this).closest("li.sticky-fldr").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("li.jstree-node").find("h3.title:first > .total-count").text()),"attachment"==wcp_settings.post_type&&hasPosts&&(menuHtml+="<li class='download-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e(this).closest("li").append(menuHtml),e(this).offset().top+e(".dynamic-menu").height()>e(window).height()-20&&(e(".dynamic-menu").addClass("bottom-fix"),e(".dynamic-menu.bottom-fix").offset().top<e("#custom-scroll-menu").offset().top&&e(".dynamic-menu").removeClass("bottom-fix")))}),e(document).on("click",".dynamic-menu",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click","body, html",function(){e(".dynamic-menu").remove()}),e(".wcp-hide-show-buttons .toggle-buttons").click(function(){var t="show";e(this).hasClass("hide-folders")&&(t="hide"),e(".wcp-hide-show-buttons .toggle-buttons").toggleClass("active"),s=wcp_settings.nonce,"show"==t?(e("#wcp-content").addClass("no-transition"),e("#wcp-content").removeClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",parseInt(wcp_settings.folder_width)+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",parseInt(wcp_settings.folder_width)+20+"px"),setTimeout(function(){e("#wcp-content").removeClass("no-transition")},250)):(e("#wcp-content").addClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right","20px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left","20px")),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_folder_display_status&status="+t+"&nonce="+s,method:"post",success:function(e){}})}),j(),e(document).ajaxComplete(function(e,s,o){o.data!=t&&""!=o.data&&-1!=o.data.indexOf("action=query-attachments")&&j()})}),e(window).on("resize",function(){}),e(window).scroll(function(){}),e(document).ready(function(){e(document).on("click","#add-new-folder",function(){u=e("#js-tree-menu a.jstree-clicked").length?e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"):0,d=!1,S()}),e(document).on("click",".new-folder",function(){u=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),d=!1,S()}),e(document).on("click",".duplicate-folder",function(t){t.stopPropagation(),u=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),e(".dynamic-menu").remove(),d=!1,c=!0,S(),I()}),e(document).on("submit","#save-folder-form",function(t){if(t.stopPropagation(),t.preventDefault(),folderNameDynamic=e.trim(e("#add-update-folder-name").val()),""==e.trim(folderNameDynamic))e(".folder-form-errors").addClass("active"),e("#add-update-folder-name").focus();else{e("#save-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#add-update-folder").addClass("disabled");var s=u;d&&(s=0),m=0==s?e("#js-tree-menu > ul > li.jstree-node").length:e("#js-tree-menu > ul > li.jstree-node[id='"+s+"'] > ul.jstree-children > li").length+1,e.ajax({url:wcp_settings.ajax_url,data:{parent_id:s,type:wcp_settings.post_type,action:"wcp_add_new_folder",nonce:wcp_settings.nonce,term_id:s,order:m,name:folderNameDynamic,is_duplicate:c,duplicate_from:p},method:"post",success:function(t){if(result=e.parseJSON(t),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),-1==result.status)e("#no-more-folder-credit").show();else if("1"==result.status){if(o=parseInt(result.is_key_active),a=parseInt(result.folders),e("#current-folder").text(a),e("#ttl-fldr").text(10),U(),I(),result.data.length)for(var s=0;s<result.data.length;s++){var r={folder_id:result.data[s].term_id,folder_count:0,is_sticky:result.data[s].is_sticky,is_high:result.data[s].is_high,nonce:result.data[s].nonce,slug:result.data[s].slug,is_deleted:0};g.push(r),e("#js-tree-menu").jstree().create_node(result.parent_id,{id:result.data[s].term_id,text:" "+result.data[s].title},"last",function(){e(".jstree-node[id='"+result.data[s].term_id+"']").attr("data-nonce",result.data[s].nonce),e(".jstree-node[id='"+result.data[s].term_id+"']").attr("data-slug",result.data[s].slug)})}z(),J(),e("#media-attachment-taxonomy-filter").length&&(u=result.term_id,M(0))}else e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show()}})}return!1})}),e(document).ready(function(){e("#inline-update").click(function(){e("#js-tree-menu a.jstree-clicked").length&&(u=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),D())}),e(document).on("click",".rename-folder",function(t){t.stopPropagation(),u=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),D(),e(".dynamic-menu").remove()}),e(document).on("click",".form-cancel-btn",function(){e(".folder-popup-form").hide()}),e(document).on("click",".folder-popup-form",function(t){e(".folder-popup-form").hide()}),e(document).on("click",".popup-form-content",function(e){e.stopPropagation()}),e(document).on("submit","#update-folder-form",function(o){return o.stopPropagation(),o.preventDefault(),folderNameDynamic=e("#update-folder-item-name").val(),""==e.trim(folderNameDynamic)?(e(".folder-form-errors").addClass("active"),e("#update-folder-item-name").focus()):(e("#update-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#update-folder-item").addClass("disabled"),s=y(u,"nonce"),parentID=e(".jstree-node[id='"+u+"']").closest("li.jstree-node").attr("id"),parentID==t&&(parentID=0),e.ajax({url:wcp_settings.ajax_url,data:{parent_id:parentID,type:wcp_settings.post_type,action:"wcp_update_folder",nonce:s,term_id:u,order:m,name:folderNameDynamic},method:"post",success:function(t){result=e.parseJSON(t),"1"==result.status?(e("#js-tree-menu").jstree("rename_node",result.id," "+result.term_title),folderPostId=b(result.id),null!=folderPostId&&(g[folderPostId].nonce=result.nonce,g[folderPostId].slug=result.slug),I(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),z(),e("#media-attachment-taxonomy-filter").length&&M(0)):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show())}})),!1})}),e(document).ready(function(){e("#inline-remove").click(function(){e("#js-tree-menu a.jstree-clicked").length?(u=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),P(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),P(1))}),e(document).on("click","#folder-hide-show-checkbox",function(){e(this).is(":checked")?e("#js-tree-menu").addClass("show-folder-checkbox"):(e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox"))}),e(document).on("click",".folder-checkbox, .input-checkbox",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click",".remove-folder",function(){folderID=e(this).closest("li.jstree-node").data("id"),u=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),P(0),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")}),e(document).on("click","#remove-folder-item",function(t){t.stopPropagation(),e(".folder-popup-form").addClass("disabled"),e("#remove-folder-item").html('<span class="dashicons dashicons-update"></span>'),s=y(u,"nonce"),f?function(){if(e("#folder-hide-show-checkbox").is(":checked")&&e("#js-tree-menu input.checkbox:checked").length>0){var t="";e("#js-tree-menu input.checkbox:checked").each(function(){t+=e(this).closest("li.jstree-node").attr("id")+",",e(this).closest("li.jstree-node").hasClass("jstree-clicked")&&!0}),e(".form-loader-count").css("width","100%"),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_remove_muliple_folder&term_id="+t+"&nonce="+wcp_settings.nonce,method:"post",success:function(t){if(t=e.parseJSON(t),e(".form-loader-count").css("width","0px"),"1"==t.status){for(o=parseInt(t.is_key_active),a=parseInt(t.folders),e("#current-folder").text(a),i=0;i<t.term_ids.length;i++)e("#js-tree-menu").jstree().delete_node(t.term_ids[i]);e("#ttl-fldr").text(10),z(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),k(),J(),z(),e("#js-tree-menu li.jstree-node").removeClass("has-sub-tree"),e("#js-tree-menu li.jstree-node").each(function(){e(this).find("ul.ui-sortable li").length?e(this).addClass("has-sub-tree"):e(this).removeClass("active")}),e("#wcp_folder_"+n).length||(e(".header-posts a").trigger("click"),n=0)}else window.location.reload();e("#folder-hide-show-checkbox").attr("checked",!1),e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox")}})}}():e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_remove_folder&term_id="+u+"&nonce="+s,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(u),o=parseInt(t.is_key_active),a=parseInt(t.folders),e("#current-folder").text(a),e("#ttl-fldr").text(10),e(".sticky-folders .sticky-folder-"+u).remove(),I(),z(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),k(),J(),n==u&&e(".header-posts").trigger("click")):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})})}),e(document).ready(function(){e(document).on("click",".mark-folder",function(t){t.stopPropagation(),e(this).closest("li.jstree-node").length?folderID=e(this).closest("li.jstree-node").attr("id"):folderID=e(this).closest("li.sticky-fldr").data("folder-id"),s=y(folderID,"nonce"),e(".form-loader-count").css("width","100%"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),e.ajax({url:wcp_settings.ajax_url,data:"term_id="+folderID+"&type="+wcp_settings.post_type+"&action=wcp_mark_un_mark_folder&nonce="+s,method:"post",cache:!1,success:function(t){t=e.parseJSON(t),e(".form-loader-count").css("width","0%"),"1"==t.status?(folderPostId=b(t.id),"1"==t.marked?(e("li.jstree-node[id='"+t.id+"']").addClass("is-high"),e(".sticky-folder-"+t.id).addClass("is-high"),null!=folderPostId&&(g[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(g[folderPostId].is_high=0)),I(),z()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})})}),e(document).ready(function(){e(document).on("click",".jstree-node .jstree-icon",function(){folderID=e(this).closest("li.jstree-node").attr("id"),e("li.jstree-node[id='"+folderID+"']").hasClass("jstree-open")?folderStatus=0:folderStatus=1,e(".form-loader-count").css("width","100%"),s=y(folderID,"nonce"),U(),e.ajax({url:wcp_settings.ajax_url,data:"is_active="+folderStatus+"&action=save_wcp_folder_state&term_id="+folderID+"&nonce="+s,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status||(e("#wcp_folder_"+folderID).hasClass("active")?(e("#wcp_folder_"+folderID).removeClass("active"),e("#wcp_folder_"+folderID).find("ul.ui-sortable:first-child > li").slideUp(),folderStatus=0):(e("#wcp_folder_"+folderID).addClass("active"),e("#wcp_folder_"+folderID).find("ul.ui-sortable:first-child > li").slideDown(),folderStatus=1),z())}})})}),e(document).ready(function(){e(document).on("click","a.jstree-anchor",function(t){if(t.stopPropagation(),e(".un-categorised-items").removeClass("active-item"),e(".header-posts a").removeClass("active-item"),e("active-item").removeClass("active-item"),n=e(this).closest("li.jstree-node").attr("id"),u=e(this).closest("li.jstree-node").attr("id"),e(".sticky-folders .sticky-folder-"+n+" a").addClass("active-item"),e("#media-attachment-taxonomy-filter").length){var s=e(this).closest("li.jstree-node").attr("id");e("#media-attachment-taxonomy-filter").val(s),e("#media-attachment-taxonomy-filter").trigger("change"),thisSlug=y(s,"slug"),_=wcp_settings.page_url+thisSlug;var o={Title:thisSlug,Url:_};history.pushState(o,o.Title,o.Url),H(thisSlug),e(".custom-media-select").removeClass("active")}else{var a=y(n,"slug");_=wcp_settings.page_url+a,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:a,Url:_};history.pushState(t,t.Title,t.Url),H(a),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>'),x()}):e("#wpbody").load(_+" #wpbody-content",function(){var t={Title:a,Url:_};history.pushState(t,t.Title,t.Url),H(a),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>'),x()})}C(),e(".sticky-folders .sticky-folder-"+n+" a").addClass("active-item")}),e(".header-posts").click(function(){if(n="",e(".wcp-container .route").removeClass("active-item"),e(".un-categorised-items").removeClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(".header-posts a").addClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e("#media-attachment-taxonomy-filter").length){n="",e("#media-attachment-taxonomy-filter").val("all"),e("#media-attachment-taxonomy-filter").trigger("change");var t={Title:"",Url:wcp_settings.page_url};history.pushState(t,t.Title,t.Url),H("all"),C()}else _=wcp_settings.page_url,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),H("all"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>'),C(),x()}):e("#wpbody").load(_+" #wpbody-content",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),H("all"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>'),C(),x()})}),e(".un-categorised-items").click(function(){if(n="-1",e(".wcp-container .route").removeClass("active-item"),e(".header-posts a").removeClass("active-item"),e(".un-categorised-items").addClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e("#media-attachment-taxonomy-filter").length){e("#media-attachment-taxonomy-filter").val("unassigned"),e("#media-attachment-taxonomy-filter").trigger("change");var t={Title:"",Url:wcp_settings.page_url+"-1"};history.pushState(t,t.Title,t.Url),H("-1"),C()}else _=wcp_settings.page_url+"-1",e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),H("-1"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>'),C(),x()}):e("#wpbody").load(_+" #wpbody-content",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),H("-1"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div>'),C(),x()})}),e("#expand-collapse-list").click(function(t){t.stopPropagation(),statusType=0,e(this).hasClass("all-open")?(e(this).removeClass("all-open"),statusType=0,e(this).attr("data-folder-tooltip","Expand"),e("#js-tree-menu").jstree("close_all")):(e(this).addClass("all-open"),statusType=1,e(this).attr("data-folder-tooltip","Collapse"),e("#js-tree-menu").jstree("open_all")),h="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){h+=e(this).attr("id")+","}),""!=h&&(e(".form-loader-count").css("width","100%"),s=wcp_settings.nonce,e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_all_status&status="+statusType+"&folders="+h+"&nonce="+s,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status&&(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))}),U()}),e(document).ready(function(){e(document).on("click","body, html",function(){e(".folder-order").removeClass("active")}),e(document).on("click","#sort-order-list",function(t){t.stopPropagation(),e(".folder-order").toggleClass("active")}),e(document).on("click",".folder-sort-menu a",function(t){t.stopPropagation(),t.preventDefault(),e(".form-loader-count").css("width","100%"),e(".folder-order").removeClass("active"),lastOrderStatus=e(this).attr("data-sort"),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_folders_by_order&nonce="+wcp_settings.nonce+"&order="+e(this).attr("data-sort"),method:"post",success:function(t){1==(t=e.parseJSON(t)).status&&(e("#js-tree-menu").jstree().destroy(),e("#js-tree-menu").append("<ul></ul>"),e("#js-tree-menu ul").html(t.data),T(),v=t.terms,R()),e(".form-loader-count").css("width","0"),C()}})})}),e(document).ready(function(){e(document).on("keyup","#folder-search",function(){N()}),e(document).on("change","#folder-search",function(){N()}),e(document).on("blur","#folder-search",function(){N()})}),e(document).ready(function(){e(document).on("click",".folders-toggle-button",function(){dbStatus="show",e(".tree-structure-content").hasClass("active")?(e(".tree-structure-content .tree-structure").animate({height:"40px"},100,function(){e(".tree-structure-content").removeClass("active")}),dbStatus="hide"):(newHeight=parseInt(e(".tree-structure-content .tree-structure").attr("data-height")),e(".tree-structure-content .tree-structure").animate({height:newHeight},100,function(){e(".tree-structure-content").addClass("active")})),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_hide_folders&status="+dbStatus+"&nonce="+wcp_settings.nonce,method:"post",success:function(e){}})})}),"attachment"==wcp_settings.post_type){e(document).ready(function(){"show"==wcp_settings.show_in_page&&e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div><div class="folders-toggle-button"><span></span></div></div>'),I(),O()});var A=null;function M(s){A=e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_get_default_list&active_id="+n,method:"post",beforeSend:function(){null!=A&&A.abort()},success:function(o){if(o=e.parseJSON(o),e(".header-posts .total-count").text(o.total_items),e(".un-categorised-items .total-count").text(o.empty_items),selectedVal=e("#media-attachment-taxonomy-filter").val(),"all"!=selectedVal&&1==s){var a=parent.wp;a.media!=t&&(a.media.frame.setState("insert"),null!==a.media.frame.content.get()?(a.media.frame.content.get().collection.props.set({ignore:+new Date}),a.media.frame.content.get().options.selection.reset()):a.media.frame.library.props.set({ignore:+new Date}))}v=o.taxonomies,R(),""!=n&&e("#wcp_folder_"+n).addClass("active-item"),d&&(e("#title_"+u).trigger("click"),d=!1)}})}function V(){e(".media-frame-content .media-toolbar").width(e(".media-frame-content").width()-20)}function F(e,t,s){var o="";if(s){var a=new Date;a.setTime(a.getTime()+24*s*60*60*1e3),o="; expires="+a.toUTCString()}document.cookie=e+"="+(t||"")+o+"; path=/"}function L(e){document.cookie=e+"=; Max-Age=-99999999;"}V(),e(window).resize(function(){V()}),e(document).ready(function(){}),e(document).on("click",".button.organize-button",function(){e(".media-frame").hasClass("mode-select")?L("media-select-mode"):F("media-select-mode","on",7),e("button.button.media-button.select-mode-toggle-button").trigger("click"),e(".media-frame").hasClass("mode-select")?(e(".media-info-message").addClass("active"),e(".select-all-item-btn").addClass("active")):(e(".media-info-message, .custom-media-select").removeClass("active"),e(".select-all-item-btn").removeClass("active"))}),e(document).on("click",".select-mode-toggle-button",function(){setTimeout(function(){e(".media-frame").hasClass("mode-select")||F("media-select-mode","off",-1),e(".media-frame").hasClass("mode-select")?(e(".media-info-message").addClass("active"),e(".select-all-item-btn").addClass("active")):(e(".media-info-message, .custom-media-select").removeClass("active"),e(".select-all-item-btn").removeClass("active"))},10)}),e(document).on("click",".select-all-item-btn",function(){e("ul.attachments li:not(.selected)").trigger("click")}),e(document).on("change",".folder_for_media",function(){"add-folder"==e(this).val()&&(u=0,d=!0,S())}),e(window).scroll(function(){})}else;function E(){e("button.button.media-button.select-mode-toggle-button").length&&(clearInterval(r),e("button.button.media-button.select-mode-toggle-button").after("<button class='button organize-button'>Bulk Organize</button>"),e(".media-toolbar-secondary").append("<span class='media-info-message'>Drag and drop your media files to the relevant folders</span>"),e(".delete-selected-button").before("<button type='button' class='button button-primary select-all-item-btn'>Select All</button>"),e(".media-toolbar-secondary").after("<div class='custom-media-select'>Move Selected files to: <select class='media-select-folder'></select></div>"),e(".media-toolbar").append("<div style='clear:both;'></div><div class='media-folder-loader'><span>Uploading files</span> <span id='current_upload_files'></span>/<span id='total_upload_files'></span><div class='folder-progress'><div class='folder-meter orange-bg'><span></span></div></div></div>"),e(".wcp-custom-form").length&&(wp.Uploader!==t&&wp.Uploader.queue.on("reset",function(){M(1)}),e(document).ajaxComplete(function(e,t,s){actionName=s.data,"undefined"!=typeof actionName&&actionName.length&&0==actionName.indexOf("action=delete-post&id=")&&M(0)})),setTimeout(function(){docReferrar=document.referrer,-1!=docReferrar.indexOf("wp-admin/upload.php")?(mediaMode=function(e){for(var t=e+"=",s=document.cookie.split(";"),o=0;o<s.length;o++){for(var a=s[o];" "==a.charAt(0);)a=a.substring(1,a.length);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return null}("media-select-mode"),"on"==mediaMode&&(e("button.button.media-button.select-mode-toggle-button").trigger("click"),e(".media-frame").hasClass("mode-select")?e(".media-info-message").addClass("active"):e(".media-info-message, .custom-media-select").removeClass("active"))):L("media-select-mode"),M(1)},1e3))}e(document).ready(function(){"attachment"==wcp_settings.post_type&&jQuery("#tmpl-media-frame").length&&(r=setInterval(function(){E()},1e3)),e(document).on("click",".attachments-browser ul.attachments .thumbnail",function(){"attachment"==wcp_settings.post_type&&e(".media-toolbar").hasClass("media-toolbar-mode-select")&&(0==e("ul.attachments li.selected").length?e(".custom-media-select").removeClass("active"):e(".custom-media-select").addClass("active"))}),e(document).on("change",".media-select-folder",function(){if("attachment"==wcp_settings.post_type&&""!=e(this).val()){var t="";e(".attachments-browser li.attachment.selected").each(function(){t+=e(this).attr("data-id")+","}),"-1"==e(this).val()?e.ajax({url:wcp_settings.ajax_url,data:"post_id="+t+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+e(this).val()+"&nonce="+wcp_settings.nonce+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(t){0!=u&&u!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),k(),z()}}):(s=y(e(this).val(),"nonce"),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+t+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+e(this).val()+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+n,method:"post",success:function(t){t=e.parseJSON(t),e("#bulk-move-folder").hide(),"1"==t.status?(0!=u&&u!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),k(),z()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}}))}})})});
1
+ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e,t){var s,o,a,r,n="#js-tree-menu",l="",d=!1,c=!1,p=0,u=0,m=0,f=!1,h="",g=[],_=wcp_settings.page_url,v=[],w="<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'><div class='folder-item is-folder' data-id='__folder_id__'><a title='__folder_name__' id='folder_view___folder_id__'class='folder-view __append_class__ has-new-folder'data-id='__folder_id__'><span class='folder item-name'><span id='wcp_folder_text___folder_id__'class='folder-title'>__folder_name__</span></span></a></div></li>",y=null,j=null;function b(){e(".wcp-move-file:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:"clone",cursor:"move",start:function(t,s){e(this).closest("td").addClass("wcp-draggable"),e("body").addClass("no-hover-css")},stop:function(t,s){e(this).closest("td").removeClass("wcp-draggable"),e("body").removeClass("no-hover-css")}}),e(".wcp-move-multiple:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,s){return e(".selected-items").remove(),selectedItems=e("#the-list th input:checked").length,selectedItems>0?(selectedItems=0==selectedItems||1==selectedItems?"1 Item":selectedItems+" Items",e("<div class='selected-items'><span class='total-post-count'>"+selectedItems+" Selected</span></div>")):e("<div class='selected-items'><span class='total-post-count'>Select Items to move</span></div>")},start:function(t,s){e("body").addClass("no-hover-css")},cursor:"move",cursorAt:{left:0,top:0},stop:function(t,s){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}}),e(".jstree-anchor:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){folderID=e(this).closest("li.jstree-node").attr("id"),o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),s=k(folderID,"nonce"),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?C():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=k(folderID,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?C():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=k(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),h=chkStr,e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C()}}))}}),e(".un-categorised-items:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){folderID=-1,s=wcp_settings.nonce,o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C()}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,chkStr=postID+",",e(".wp-list-table input:checked").each(function(){postID!=e(this).val()&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),h=chkStr,e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C()}}))}}),e(".attachments-browser li.attachment:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,s){return e(".selected-items").remove(),selectedItems=e(".attachments-browser li.attachment.selected").length,selectedItems=0==selectedItems||1==selectedItems?"1 Item":selectedItems+" Items",e("<div class='selected-items'><span class='total-post-count'>"+selectedItems+" Selected</span></div>")},start:function(t,s){e("body").addClass("no-hover-css")},cursor:"move",cursorAt:{left:0,top:0},stop:function(t,s){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}}),e(".tree-structure .folder-item:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){e("body").removeClass("no-hover-css"),folderID=e(this).data("id"),o.draggable.hasClass("wcp-move-multiple")?(s=k(folderID,"nonce"),e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C(),R()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=k(folderID,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C(),R()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=k(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C(),R()}}))}}),e(".sticky-folders li a:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){folderID=e(this).closest("li").data("folder-id"),o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),s=k(folderID,"nonce"),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(C(),R()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=k(folderID,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(C(),R()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=k(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),h=chkStr,e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+chkStr+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+folderID+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(e){C(),R()}}))}}),M()}function k(e,t){if(g.length>0)for(i=0;i<g.length;i++)if(parseInt(g[i].folder_id)==parseInt(e))return g[i][t];return""}function x(e){if(g.length>0)for(i=0;i<g.length;i++)if(parseInt(g[i].folder_id)==parseInt(e))return i;return null}function C(){if(e(".media-toolbar").hasClass("media-toolbar-mode-select")&&e("ul.attachments li.selected").length&&(e("ul.attachments li.selected").trigger("click"),e(".select-mode-toggle-button").trigger("click")),""!=h&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==l)){if(e("#media-attachment-taxonomy-filter").length){h=h.split(",");for(var t=0;t<h.length;t++)""!=h[t]&&e(".attachments-browser li[data-id='"+h[t]+"']").remove()}h=""}e("#media-attachment-taxonomy-filter").length?F(0):(e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=get_folders_default_list",method:"post",success:function(t){t=e.parseJSON(t),e(".header-posts .total-count").text(t.total_items),e(".un-categorised-items .total-count").text(t.empty_items),v=t.taxonomies,M()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),S(),I()}):e("#wpbody").load(_+" #wpbody-content",!1,function(t){var s={Title:"",Url:_};history.pushState(s,s.Title,s.Url),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),S()}))}function I(){S(),e(".form-loader-count").css("width","0"),"object"==typeof inlineEditPost&&(inlineEditPost.init(),e("#the-list").on("click",".editinline",function(){e(this).attr("aria-expanded","true"),inlineEditPost.edit(this)}),e(document).on("click",".inline-edit-save .save",function(){var t=e(this).closest("tr").attr("id");t=(t=t.replace("edit-","")).replace("post-",""),inlineEditPost.save(t)}),e(document).on("click",".inline-edit-save .cancel",function(){var t=e(this).closest("tr").attr("id");t=(t=t.replace("edit-","")).replace("post-",""),inlineEditPost.revert(t)})),"attachment"==wcp_settings.post_type&&(e(".move-to-folder-top").length||e("#bulk-action-selector-top").append("<option class='move-to-folder-top' value='move_to_folder'>Move to Folder</option>"),e(".move-to-folder-bottom").length||e("#bulk-action-selector-bottom").append("<option class='move-to-folder-bottom' value='move_to_folder'>Move to Folder</option>"))}function S(){if(g.length&&e("li.jstree-node").each(function(){folderPostId=x(e(this).attr("id")),null!=folderPostId&&(1==g[folderPostId].is_high?e(this).addClass("is-high"):e(this).removeClass("is-high"),1==g[folderPostId].is_sticky?e(this).addClass("is-sticky"):e(this).removeClass("is-sticky"))}),folderId=0,e(".tree-structure ul").html(""),folderStatus=!0,e(".jstree-clicked").length&&(folderID=e(".jstree-clicked").closest(".jstree-node").attr("id"),e(".jstree-node[id='"+folderID+"'] > ul.jstree-children > li.jstree-node").length?(folderStatus=!1,e(".jstree-node[id='"+folderID+"'] > ul.jstree-children > li.jstree-node").each(function(){fID=e(this).attr("id"),fName=e.trim(e("#js-tree-menu").jstree(!0).get_node(fID).text),liHtml=w.replace(/__folder_id__/g,fID),liHtml=liHtml.replace(/__folder_name__/g,fName),selectedClass=e(this).hasClass("is-high")?"is-high":"",liHtml=liHtml.replace(/__append_class__/g,selectedClass),e(".tree-structure ul").append(liHtml)})):e(".jstree-node[id='"+folderID+"']").closest("ul").hasClass("jstree-container-ul")||(folderStatus=!1)),folderStatus&&e("#js-tree-menu > ul > li.jstree-node").each(function(){fID=e(this).attr("id"),fName=e.trim(e("#js-tree-menu").jstree(!0).get_node(fID).text),liHtml=w.replace(/__folder_id__/g,fID),liHtml=liHtml.replace(/__folder_name__/g,fName),selectedClass=e(this).hasClass("is-high")?"is-high":"",liHtml=liHtml.replace(/__append_class__/g,selectedClass),e(".tree-structure ul").append(liHtml)}),J(),"attachment"==wcp_settings.post_type&&(e(".move-to-folder-top").length||e("#bulk-action-selector-top").append("<option class='move-to-folder-top' value='move_to_folder'>Move to Folder</option>"),e(".move-to-folder-bottom").length||e("#bulk-action-selector-bottom").append("<option class='move-to-folder-bottom' value='move_to_folder'>Move to Folder</option>")),e(".sticky-folders .active-item").removeClass("active-item"),e("#js-tree-menu li.jstree-node.active-item").length){var t=e("#js-tree-menu li.jstree-node.active-item").data("folder-id");e(".sticky-folders .sticky-folder-"+t+" a").addClass("active-item")}b()}function D(){S()}function P(){if(0==o&&a>=10)return e("#folder-limitation-message").html("You've reached the 10 folder limitation!"),e("#no-more-folder-credit").show(),!1;e("#add-update-folder-title").text("Add a new folder"),e("#save-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#add-update-folder-name").val(""),c&&(p=u,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(u).text)+" #2"),u=e("#"+u+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+u+"_anchor").closest(".jstree-node").parent().parent().attr("id"):0),e("#add-update-folder").removeClass("disabled"),e("#add-update-folder").show(),e("#add-update-folder-name").focus(),e(".dynamic-menu").remove()}function T(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(u).text),parentID=e("#wcp_folder_"+u).closest("li.jstree-node").data("folder-id"),parentID==t&&(parentID=0),e("#update-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#update-folder-item-name").val(folderName),e("#update-folder-item").removeClass("disabled"),e("#update-folder-item").show(),e("#update-folder-item-name").focus(),e(".dynamic-menu").remove()}function N(t){var s="Are you sure you want to delete the selected folder?",o="Items in the folder will not be deleted.";if(f=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(f=!0,0==e("#js-tree-menu input.checkbox:checked").length)return e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html("Please select at least one folder to delete"),void e("#error-folder-popup").show();e("#js-tree-menu input.checkbox:checked").length>1&&(s="Are you sure you want to delete the selected folders?",o="Items in the selected folders will not be deleted.")}e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#remove-folder-item").text("Yes, Delete it!"),e("#remove-folder-message").text(s),e("#remove-folder-notice").text(o),e("#confirm-remove-folder").show(),e("#remove-folder-item").focus()}function H(){e(n).jstree({core:{cache:!1,animation:0,check_callback:function(t,s,o,a,r){if(e("*").removeClass("drag-bot").removeClass("drag-in").removeClass("drag-up"),("move_node"===t||"copy_node"===t)&&r&&r.dnd)switch(r.pos){case"a":r.origin.get_node(r.ref,!0).addClass("drag-bot"),nodeId=e(".drag-bot").attr("id"),e("#jstree-dnd").text("Below "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"i":r.origin.get_node(r.ref,!0).addClass("drag-in"),nodeId=e(".drag-in").attr("id"),e("#jstree-dnd").text("Inside "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"b":r.origin.get_node(r.ref,!0).addClass("drag-up"),nodeId=e(".drag-up").attr("id"),e("#jstree-dnd").text("Above "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;default:e("#jstree-dnd").text(e("#jstree-dnd").data("txt"))}return!0}},data:{cache:!1},select_node:!1,search:{show_only_matches:!0,case_sensitive:!1,fuzzy:!1},plugins:["dnd","search","contextmenu"],contextmenu:{select_node:0,show_at_node:0,items:function(){return{}}}}).bind("ready.jstree",function(){e("#js-tree-menu .jstree-node").each(function(){var t=parseInt(e(this).data("count"));t>0&&e(".jstree-node[id='"+e(this).attr("id")+"'] > a span.premio-folder-count").text(t)}),""!=l&&0!=l&&e(".jstree-node[id='"+l+"']").length&&(e("#js-tree-menu").jstree("select_node",l),e(".sticky-folders .sticky-folder-"+l+" a").length&&e(".sticky-folders .sticky-folder-"+l+" a").addClass("active-item")),e(".ajax-preloader").hide(),e(".js-tree-data").show(),A(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active"),S(),b()}).bind("after_open.jstree",function(){b()}).bind("open_all.jstree",function(){b()}).bind("create_node.jstree",function(){b()}).bind("delete_node.jstree",function(){b()}).bind("close_all.jstree",function(){b()}).bind("after_close.jstree",function(){b()}).bind("move_node.jstree",function(t,s){folderMoveId=s.node.id,orderString="",e(".jstree-node[id='"+folderMoveId+"']").closest("ul").children().each(function(){"undefined"!=e(this).attr("id")&&(orderString+=e(this).attr("id")+",")}),e("#"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?parentID=e("#"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().attr("id"):parentID=0,""!=orderString&&(e(".form-loader-count").css("width","100%"),e.ajax({url:wcp_settings.ajax_url,data:"term_ids="+orderString+"&action=wcp_save_folder_order&type="+wcp_settings.post_type+"&nonce="+wcp_settings.nonce+"&term_id="+folderMoveId+"&parent_id="+parentID,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#wcp_folder_parent").html(t.options),e(".form-loader-count").css("width","0"),C(),R(),M(),b()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))})}function U(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function O(t){e.ajax({url:wcp_settings.ajax_url,type:"post",data:"action=save_folder_last_status&post_type="+wcp_settings.post_type+"&post_id="+t+"&nonce="+wcp_settings.nonce,cache:!1,async:!1,success:function(){}})}function z(){setTimeout(function(){if(currentStatus=!0,e("#js-tree-menu .jstree-node.jstree-leaf").length==e("#js-tree-menu .jstree-node").length)e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand");else{var t=e("#js-tree-menu .jstree-node.jstree-closed").length+e("#js-tree-menu .jstree-node.jstree-open").length;e("#js-tree-menu .jstree-node.jstree-closed").length==t?(e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand")):(e("#expand-collapse-list").addClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Collapse"))}},500),b()}function J(){0==e(".tree-structure-content .tree-structure li").length?e(".tree-structure-content").hide():(e(".tree-structure-content").show(),oldHeight=e(".tree-structure-content .tree-structure").height(),e(".tree-structure-content .tree-structure").height("auto"),e(".tree-structure-content .tree-structure").height()>56?e(".folders-toggle-button").show():e(".folders-toggle-button").hide(),newHeight=e(".tree-structure-content .tree-structure").height(),e(".tree-structure-content .tree-structure").attr("data-height",newHeight),e(".tree-structure-content").hasClass("active")?(e(".tree-structure-content .tree-structure").height(newHeight),e(".tree-structure-content .tree-structure").attr("data-height",newHeight)):e(".tree-structure-content .tree-structure").height(oldHeight))}function R(){e(".folder-loader-ajax").addClass("active"),e(".folder-loader-ajax img").removeClass("active"),e(".folder-loader-ajax svg#successAnimation").addClass("active").addClass("animated"),setTimeout(function(){e(".folder-loader-ajax").removeClass("active"),e(".folder-loader-ajax img").addClass("active"),e(".folder-loader-ajax svg#successAnimation").removeClass("active").removeClass("animated")},2e3)}function A(){e(".sticky-folders > ul").html("");var t="";if(e("#js-tree-menu li.jstree-node.is-sticky").each(function(){var s=e(this).attr("id"),o=e.trim(e("#js-tree-menu").jstree(!0).get_node(s).text),a=e("li.jstree-node[id='"+s+"'] > a span.premio-folder-count").text(),r=e("li.jstree-node[id='"+s+"']").hasClass("is-high")?" is-high ":"";t+="<li data-folder-id='"+s+"' class='sticky-fldr "+r+" sticky-folder-"+s+"'><a href='javascript:;'><span class='folder-title'>"+o+"</span><span class='folder-actions'><span class='update-inline-record'><i class='pfolder-edit-folder'></i></span><span class='star-icon'><i class='pfolder-star'></i></span><span class='premio-folder-count'>"+a+"</span></span></a></li>"}),e(".sticky-folders > ul").html(t),e(".jstree-anchor.jstree-clicked").length){var s=e(".jstree-anchor.jstree-clicked").closest("li.jstree-node").attr("id");e(".sticky-folders .sticky-folder-"+s+" a").addClass("active-item")}e(".sticky-folders > ul > li").length>0?e(".sticky-folders").addClass("active"):e(".sticky-folders").removeClass("active")}function M(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){folders_media_options.terms=v;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),lastFolderData=v;for(var s=0;s<v.length;s++)t.append("<option value='"+v[s].term_id+"'>"+v[s].name+" ("+v[s].trash_count+")</option>");t.val(currentDDVal).trigger("change")}),e("select.folder_for_media").length)){var t=e("select.folder_for_media").val();e("select.folder_for_media option:not(:first-child):not(:last-child)").remove();for(var s=0;s<v.length;s++)e("select.folder_for_media option:last-child").before("<option value='"+v[s].term_id+"'>"+v[s].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),s=0;s<v.length;s++)0!=parseInt(v[s].trash_count)&&(e(".jstree-node[id='"+v[s].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(v[s].trash_count),e(".sticky-folder-"+v[s].term_id+" .premio-folder-count").text(v[s].trash_count));if(e(".media-select-folder").length){for(e(".media-select-folder").html("<option value=''>Select Folder</option><option value='-1'>(Unassigned)</option>"),s=0;s<v.length;s++)e(".media-select-folder").append("<option value='"+v[s].term_id+"'>"+v[s].name+" ("+v[s].trash_count+")</option>");e(".media-select-folder").val("")}""!=l&&e("#wcp_folder_"+l).addClass("active-item"),d&&(e("#title_"+u).trigger("click"),d=!1)}if(e(document).ready(function(){v=wcp_settings.taxonomies,o=parseInt(wcp_settings.is_key_active),a=parseInt(wcp_settings.folders),l=parseInt(wcp_settings.selected_taxonomy),g=wcp_settings.folder_settings,H();var r="1"==wcp_settings.isRTL||1==wcp_settings.isRTL?"w":"e";e(".wcp-content").resizable({resizeHeight:!1,handles:r,minWidth:100,maxWidth:500,resize:function(t,s){var o=s.size.width;for(o<=275?e(".plugin-button").addClass("d-block"):e(".plugin-button").removeClass("d-block"),o<=225&&(o=225),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",o+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",o+20+"px"),newWidth=o-40,cssString="",classString="",i=0;i<=15;i++)classString+=" .space > .jstree-node >",currentWidth=newWidth-(13+20*i),cssString+="#js-tree-menu > "+classString+" .title { width: "+currentWidth+"px !important; } ",cssString+="#js-tree-menu > "+classString+" .dynamic-menu { left: "+(currentWidth-190)+"px !important; } ";e("#wcp-custom-style").html("<style>"+cssString+"</style>"),s.size.width<=185?(folderStatus="hide",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").addClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").removeClass("active"),e("#wcp-content").addClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right","20px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left","20px")):e("#wcp-content").hasClass("hide-folders-area")&&(folderStatus="show",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").removeClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").addClass("active"),e("#wcp-content").addClass("no-transition"),e("#wcp-content").removeClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",parseInt(wcp_settings.folder_width)+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",parseInt(wcp_settings.folder_width)+20+"px"),setTimeout(function(){e("#wcp-content").removeClass("no-transition")},250))},stop:function(t,o){var a=o.size.width;o.size.width<=275?e(".plugin-button").addClass("d-block"):e(".plugin-button").removeClass("d-block"),a<=225&&(a=225),o.size.width<=185?(folderStatus="hide",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").addClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").removeClass("active"),e("#wcp-content").addClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right","20px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left","20px"),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_folder_display_status&status="+folderStatus+"&nonce="+s,method:"post",success:function(e){}})):e("#wcp-content").hasClass("hide-folders-area")&&(folderStatus="show",e(".wcp-hide-show-buttons .toggle-buttons.show-folders").removeClass("active"),e(".wcp-hide-show-buttons .toggle-buttons.hide-folders").addClass("active"),e("#wcp-content").addClass("no-transition"),e("#wcp-content").removeClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",parseInt(wcp_settings.folder_width)+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",parseInt(wcp_settings.folder_width)+20+"px"),setTimeout(function(){e("#wcp-content").removeClass("no-transition")},250)),s=wcp_settings.nonce,wcp_settings.folder_width=o.size.width,e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_post_width&width="+a+"&nonce="+s,method:"post",success:function(e){}}),o.size.width<=225&&(e(".wcp-content").width(225),wcp_settings.folder_width=225)}}),e(document).on("contextmenu",".jstree-anchor",function(t){return y=t.pageX,j=t.pageY,e(this).find("span.folder-inline-edit").trigger("click"),!1}),e(document).on("click",".folder-actions span.folder-inline-edit",function(s){var o;(s.stopImmediatePropagation(),s.stopPropagation(),0!=wcp_settings.can_manage_folder)&&(isHigh=e(this).closest("li.jstree-node").hasClass("is-high"),isSticky=e(this).closest("li.jstree-node").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu' data-id='"+e(this).closest("li").prop("id")+"'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span> Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("a.jstree-anchor").find(".premio-folder-count").text()),"attachment"==wcp_settings.post_type&&hasPosts&&(menuHtml+="<li target='_blank' class='download-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e("body").append(menuHtml),s.pageX==t||s.pageY==t?(e(".dynamic-menu").css("left",y),e(".dynamic-menu").css("top",j-10),o=j):(e(".dynamic-menu").css("left",s.pageX),e(".dynamic-menu").css("top",s.pageY),o=s.pageY),e(this).parents("li.jstree-node").addClass("active-menu"),o+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(o+e(".dynamic-menu").height())))}),e(document).on("click",".sticky-folders .sticky-fldr > a",function(t){t.stopPropagation();var s=e(this).closest("li").data("folder-id");e(".jstree-node[id='"+s+"']").length&&(e(".jstree-clicked").removeClass("jstree-clicked"),e(".active-item").removeClass("active-item"),e("#js-tree-menu").jstree("select_node",l),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").trigger("click"),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").addClass("jstree-clicked"),e(".sticky-folders .sticky-folder-"+s+" a").addClass("active-item"))}),e(document).on("contextmenu",".sticky-folders li .sticky-fldr > a",function(t){return e(this).find("span.update-inline-record").trigger("click"),!1}),e(document).on("click",".tree-structure a",function(t){t.stopPropagation();var s=e(this).data("id");e(".jstree-node[id='"+s+"']").length&&(e(".jstree-clicked").removeClass("jstree-clicked"),e(".active-item").removeClass("active-item"),e("#js-tree-menu").jstree("select_node",l),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").trigger("click"),e(".jstree-node[id='"+s+"'] > a.jstree-anchor").addClass("jstree-clicked"),e(".sticky-folders .sticky-folder-"+s+" a").addClass("active-item"))}),e(document).on("click",".update-inline-record",function(s){var o;(s.stopImmediatePropagation(),s.stopPropagation(),0!=wcp_settings.can_manage_folder)&&(isHigh=e(this).closest("li.sticky-fldr").hasClass("is-high"),isSticky=e(this).closest("li.sticky-fldr").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu' data-id='"+e(this).closest("li").data("folder-id")+"'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("li.jstree-node").find("h3.title:first > .total-count").text()),"attachment"==wcp_settings.post_type&&hasPosts&&(menuHtml+="<li class='download-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e("body").append(menuHtml),s.pageX==t||s.pageY==t?(e(".dynamic-menu").css("left",y),e(".dynamic-menu").css("top",j-10),o=j):(e(".dynamic-menu").css("left",s.pageX),e(".dynamic-menu").css("top",s.pageY),o=s.pageY),o+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(o+e(".dynamic-menu").height())))}),e(document).on("click",".dynamic-menu",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click","body, html",function(){e(".dynamic-menu").remove()}),e(".wcp-hide-show-buttons .toggle-buttons").click(function(){var t="show";e(this).hasClass("hide-folders")&&(t="hide"),e(".wcp-hide-show-buttons .toggle-buttons").toggleClass("active"),s=wcp_settings.nonce,"show"==t?(e("#wcp-content").addClass("no-transition"),e("#wcp-content").removeClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right",parseInt(wcp_settings.folder_width)+20+"px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left",parseInt(wcp_settings.folder_width)+20+"px"),setTimeout(function(){e("#wcp-content").removeClass("no-transition")},250)):(e("#wcp-content").addClass("hide-folders-area"),"1"==wcp_settings.isRTL?(e("#wpcontent").css("padding-right","20px"),e("#wpcontent").css("padding-left","0px")):e("#wpcontent").css("padding-left","20px")),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_folder_display_status&status="+t+"&nonce="+s,method:"post",success:function(e){}})}),b(),e(document).ajaxComplete(function(e,s,o){o.data!=t&&""!=o.data&&-1!=o.data.indexOf("action=query-attachments")&&b()})}),e(window).on("resize",function(){}),e(window).scroll(function(){}),e(document).ready(function(){e(document).on("click","#add-new-folder",function(){u=e("#js-tree-menu a.jstree-clicked").length?e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"):0,d=!1,P()}),e(document).on("click",".new-folder",function(){u=e(this).closest(".dynamic-menu").data("id"),d=!1,P()}),e(document).on("click",".duplicate-folder",function(t){t.stopPropagation(),u=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),d=!1,c=!0,P(),D()}),e(document).on("submit","#save-folder-form",function(t){if(t.stopPropagation(),t.preventDefault(),folderNameDynamic=e.trim(e("#add-update-folder-name").val()),""==e.trim(folderNameDynamic))e(".folder-form-errors").addClass("active"),e("#add-update-folder-name").focus();else{e("#save-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#add-update-folder").addClass("disabled");var s=u;d&&(s=0),m=0==s?e("#js-tree-menu > ul > li.jstree-node").length:e("#js-tree-menu > ul > li.jstree-node[id='"+s+"'] > ul.jstree-children > li").length+1,e.ajax({url:wcp_settings.ajax_url,data:{parent_id:s,type:wcp_settings.post_type,action:"wcp_add_new_folder",nonce:wcp_settings.nonce,term_id:s,order:m,name:folderNameDynamic,is_duplicate:c,duplicate_from:p},method:"post",success:function(t){if(result=e.parseJSON(t),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),-1==result.status)e("#no-more-folder-credit").show();else if("1"==result.status){if(o=parseInt(result.is_key_active),a=parseInt(result.folders),e("#current-folder").text(a),e("#ttl-fldr").text(10),z(),D(),result.data.length)for(var s=0;s<result.data.length;s++){var r={folder_id:result.data[s].term_id,folder_count:0,is_sticky:result.data[s].is_sticky,is_high:result.data[s].is_high,nonce:result.data[s].nonce,slug:result.data[s].slug,is_deleted:0};g.push(r),e("#js-tree-menu").jstree().create_node(result.parent_id,{id:result.data[s].term_id,text:" "+result.data[s].title},"last",function(){e(".jstree-node[id='"+result.data[s].term_id+"']").attr("data-nonce",result.data[s].nonce),e(".jstree-node[id='"+result.data[s].term_id+"']").attr("data-slug",result.data[s].slug)})}R(),A(),e("#media-attachment-taxonomy-filter").length&&(u=result.term_id,F(0))}else e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show()}})}return!1})}),e(document).ready(function(){e("#inline-update").click(function(){e("#js-tree-menu a.jstree-clicked").length&&(u=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),T())}),e(document).on("click",".rename-folder",function(t){t.stopPropagation(),u=e(this).closest(".dynamic-menu").data("id"),T(),e(".dynamic-menu").remove()}),e(document).on("click",".form-cancel-btn",function(){e(".folder-popup-form").hide()}),e(document).on("click",".folder-popup-form",function(t){e(".folder-popup-form").hide()}),e(document).on("click",".popup-form-content",function(e){e.stopPropagation()}),e(document).on("submit","#update-folder-form",function(o){return o.stopPropagation(),o.preventDefault(),folderNameDynamic=e("#update-folder-item-name").val(),""==e.trim(folderNameDynamic)?(e(".folder-form-errors").addClass("active"),e("#update-folder-item-name").focus()):(e("#update-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#update-folder-item").addClass("disabled"),s=k(u,"nonce"),parentID=e(".jstree-node[id='"+u+"']").closest("li.jstree-node").attr("id"),parentID==t&&(parentID=0),e.ajax({url:wcp_settings.ajax_url,data:{parent_id:parentID,type:wcp_settings.post_type,action:"wcp_update_folder",nonce:s,term_id:u,order:m,name:folderNameDynamic},method:"post",success:function(t){result=e.parseJSON(t),"1"==result.status?(e("#js-tree-menu").jstree("rename_node",result.id," "+result.term_title),folderPostId=x(result.id),null!=folderPostId&&(g[folderPostId].nonce=result.nonce,g[folderPostId].slug=result.slug),D(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),R(),e("#media-attachment-taxonomy-filter").length&&F(0)):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show())}})),!1})}),e(document).ready(function(){e("#inline-remove").click(function(){e("#js-tree-menu a.jstree-clicked").length?(u=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),N(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),N(1))}),e(document).on("click","#folder-hide-show-checkbox",function(){e(this).is(":checked")?e("#js-tree-menu").addClass("show-folder-checkbox"):(e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox"))}),e(document).on("click",".folder-checkbox, .input-checkbox",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click",".remove-folder",function(){folderID=e(this).closest("li.jstree-node").data("id"),u=e(this).closest(".dynamic-menu").data("id"),N(0),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")}),e(document).on("click","#remove-folder-item",function(t){t.stopPropagation(),e(".folder-popup-form").addClass("disabled"),e("#remove-folder-item").html('<span class="dashicons dashicons-update"></span>'),s=k(u,"nonce"),f?function(){if(e("#folder-hide-show-checkbox").is(":checked")&&e("#js-tree-menu input.checkbox:checked").length>0){var t="";e("#js-tree-menu input.checkbox:checked").each(function(){t+=e(this).closest("li.jstree-node").attr("id")+",",e(this).closest("li.jstree-node").hasClass("jstree-clicked")&&!0}),e(".form-loader-count").css("width","100%"),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_remove_muliple_folder&term_id="+t+"&nonce="+wcp_settings.nonce,method:"post",success:function(t){if(t=e.parseJSON(t),e(".form-loader-count").css("width","0px"),"1"==t.status){for(o=parseInt(t.is_key_active),a=parseInt(t.folders),e("#current-folder").text(a),i=0;i<t.term_ids.length;i++)e("#js-tree-menu").jstree().delete_node(t.term_ids[i]);e("#ttl-fldr").text(10),R(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),C(),A(),R(),e("#js-tree-menu li.jstree-node").removeClass("has-sub-tree"),e("#js-tree-menu li.jstree-node").each(function(){e(this).find("ul.ui-sortable li").length?e(this).addClass("has-sub-tree"):e(this).removeClass("active")}),e("#wcp_folder_"+l).length||(e(".header-posts a").trigger("click"),l=0)}else window.location.reload();e("#folder-hide-show-checkbox").attr("checked",!1),e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox")}})}}():e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_remove_folder&term_id="+u+"&nonce="+s,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(u),o=parseInt(t.is_key_active),a=parseInt(t.folders),e("#current-folder").text(a),e("#ttl-fldr").text(10),e(".sticky-folders .sticky-folder-"+u).remove(),D(),R(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),C(),A(),l==u&&e(".header-posts").trigger("click")):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})})}),e(document).ready(function(){e(document).on("click",".mark-folder",function(t){t.stopPropagation(),folderID=e(this).closest(".dynamic-menu").data("id"),s=k(folderID,"nonce"),e(".form-loader-count").css("width","100%"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),e.ajax({url:wcp_settings.ajax_url,data:"term_id="+folderID+"&type="+wcp_settings.post_type+"&action=wcp_mark_un_mark_folder&nonce="+s,method:"post",cache:!1,success:function(t){t=e.parseJSON(t),e(".form-loader-count").css("width","0%"),"1"==t.status?(folderPostId=x(t.id),"1"==t.marked?(e("li.jstree-node[id='"+t.id+"']").addClass("is-high"),e(".sticky-folder-"+t.id).addClass("is-high"),null!=folderPostId&&(g[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(g[folderPostId].is_high=0)),D(),R()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})})}),e(document).ready(function(){e(document).on("click",".jstree-node .jstree-icon",function(){folderID=e(this).closest("li.jstree-node").attr("id"),e("li.jstree-node[id='"+folderID+"']").hasClass("jstree-open")?folderStatus=0:folderStatus=1,e(".form-loader-count").css("width","100%"),s=k(folderID,"nonce"),z(),e.ajax({url:wcp_settings.ajax_url,data:"is_active="+folderStatus+"&action=save_wcp_folder_state&term_id="+folderID+"&nonce="+s,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status||(e("#wcp_folder_"+folderID).hasClass("active")?(e("#wcp_folder_"+folderID).removeClass("active"),e("#wcp_folder_"+folderID).find("ul.ui-sortable:first-child > li").slideUp(),folderStatus=0):(e("#wcp_folder_"+folderID).addClass("active"),e("#wcp_folder_"+folderID).find("ul.ui-sortable:first-child > li").slideDown(),folderStatus=1),R())}})})}),e(document).ready(function(){e(document).on("click","a.jstree-anchor",function(t){if(t.stopPropagation(),e(".un-categorised-items").removeClass("active-item"),e(".header-posts a").removeClass("active-item"),e("active-item").removeClass("active-item"),l=e(this).closest("li.jstree-node").attr("id"),u=e(this).closest("li.jstree-node").attr("id"),e(".sticky-folders .sticky-folder-"+l+" a").addClass("active-item"),e("#media-attachment-taxonomy-filter").length){var s=e(this).closest("li.jstree-node").attr("id");e("#media-attachment-taxonomy-filter").val(s),e("#media-attachment-taxonomy-filter").trigger("change"),thisSlug=k(s,"slug"),_=wcp_settings.page_url+thisSlug;var o={Title:thisSlug,Url:_};history.pushState(o,o.Title,o.Url),O(thisSlug),e(".custom-media-select").removeClass("active")}else{var a=k(l,"slug");_=wcp_settings.page_url+a,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:a,Url:_};history.pushState(t,t.Title,t.Url),O(a),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),I()}):e("#wpbody").load(_+" #wpbody-content",function(){var t={Title:a,Url:_};history.pushState(t,t.Title,t.Url),O(a),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),I()})}S(),e(".sticky-folders .sticky-folder-"+l+" a").addClass("active-item")}),e(".header-posts").click(function(){if(l="",e(".wcp-container .route").removeClass("active-item"),e(".un-categorised-items").removeClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(".header-posts a").addClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e("#media-attachment-taxonomy-filter").length){l="",e("#media-attachment-taxonomy-filter").val("all"),e("#media-attachment-taxonomy-filter").trigger("change");var t={Title:"",Url:wcp_settings.page_url};history.pushState(t,t.Title,t.Url),O("all"),S()}else _=wcp_settings.page_url,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),O("all"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),S(),I()}):e("#wpbody").load(_+" #wpbody-content",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),O("all"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),S(),I()})}),e(".un-categorised-items").click(function(){if(l="-1",e(".wcp-container .route").removeClass("active-item"),e(".header-posts a").removeClass("active-item"),e(".un-categorised-items").addClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e("#media-attachment-taxonomy-filter").length){e("#media-attachment-taxonomy-filter").val("unassigned"),e("#media-attachment-taxonomy-filter").trigger("change");var t={Title:"",Url:wcp_settings.page_url+"-1"};history.pushState(t,t.Title,t.Url),O("-1"),S()}else _=wcp_settings.page_url+"-1",e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(_+" #posts-filter",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),O("-1"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),S(),I()}):e("#wpbody").load(_+" #wpbody-content",function(){var t={Title:"",Url:_};history.pushState(t,t.Title,t.Url),O("-1"),"show"!=wcp_settings.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),S(),I()})}),e("#expand-collapse-list").click(function(t){t.stopPropagation(),statusType=0,e(this).hasClass("all-open")?(e(this).removeClass("all-open"),statusType=0,e(this).attr("data-folder-tooltip","Expand"),e("#js-tree-menu").jstree("close_all")):(e(this).addClass("all-open"),statusType=1,e(this).attr("data-folder-tooltip","Collapse"),e("#js-tree-menu").jstree("open_all")),h="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){h+=e(this).attr("id")+","}),""!=h&&(e(".form-loader-count").css("width","100%"),s=wcp_settings.nonce,e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_change_all_status&status="+statusType+"&folders="+h+"&nonce="+s,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status&&(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))}),z()}),e(document).ready(function(){e(document).on("click","body, html",function(){e(".folder-order").removeClass("active")}),e(document).on("click","#sort-order-list",function(t){t.stopPropagation(),e(".folder-order").toggleClass("active")}),e(document).on("click",".folder-sort-menu a",function(t){t.stopPropagation(),t.preventDefault(),e(".form-loader-count").css("width","100%"),e(".folder-order").removeClass("active"),lastOrderStatus=e(this).attr("data-sort"),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_folders_by_order&nonce="+wcp_settings.nonce+"&order="+e(this).attr("data-sort"),method:"post",success:function(t){1==(t=e.parseJSON(t)).status&&(e("#js-tree-menu").jstree().destroy(),e("#js-tree-menu").append("<ul></ul>"),e("#js-tree-menu ul").html(t.data),H(),v=t.terms,M()),e(".form-loader-count").css("width","0"),S()}})})}),e(document).ready(function(){e(document).on("keyup","#folder-search",function(){U()}),e(document).on("change","#folder-search",function(){U()}),e(document).on("blur","#folder-search",function(){U()})}),e(document).ready(function(){e(document).on("click",".folders-toggle-button",function(){dbStatus="show",e(".tree-structure-content").hasClass("active")?(e(".tree-structure-content .tree-structure").animate({height:"40px"},100,function(){e(".tree-structure-content").removeClass("active")}),dbStatus="hide"):(newHeight=parseInt(e(".tree-structure-content .tree-structure").attr("data-height")),e(".tree-structure-content .tree-structure").animate({height:newHeight},100,function(){e(".tree-structure-content").addClass("active")})),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_hide_folders&status="+dbStatus+"&nonce="+wcp_settings.nonce,method:"post",success:function(e){}})})}),"attachment"==wcp_settings.post_type){e(document).ready(function(){"show"==wcp_settings.show_in_page&&e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div><div class="folders-toggle-button"><span></span></div></div>'),D(),J()});var V=null;function F(s){V=e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_get_default_list&active_id="+l,method:"post",beforeSend:function(){null!=V&&V.abort()},success:function(o){if(o=e.parseJSON(o),e(".header-posts .total-count").text(o.total_items),e(".un-categorised-items .total-count").text(o.empty_items),selectedVal=e("#media-attachment-taxonomy-filter").val(),"all"!=selectedVal&&1==s){var a=parent.wp;a.media!=t&&(a.media.frame.setState("insert"),null!==a.media.frame.content.get()?(a.media.frame.content.get().collection.props.set({ignore:+new Date}),a.media.frame.content.get().options.selection.reset()):a.media.frame.library.props.set({ignore:+new Date}))}v=o.taxonomies,M(),""!=l&&e("#wcp_folder_"+l).addClass("active-item"),d&&(e("#title_"+u).trigger("click"),d=!1)}})}function L(){e(".media-frame-content .media-toolbar").width(e(".media-frame-content").width()-20)}function Y(e,t,s){var o="";if(s){var a=new Date;a.setTime(a.getTime()+24*s*60*60*1e3),o="; expires="+a.toUTCString()}document.cookie=e+"="+(t||"")+o+"; path=/"}function E(e){document.cookie=e+"=; Max-Age=-99999999;"}L(),e(window).resize(function(){L()}),e(document).on("click",".button.organize-button",function(){e(".media-frame").hasClass("mode-select")?E("media-select-mode"):Y("media-select-mode","on",7),e("button.button.media-button.select-mode-toggle-button").trigger("click"),e(".media-frame").hasClass("mode-select")?(e(".media-info-message").addClass("active"),e(".select-all-item-btn").addClass("active")):(e(".media-info-message, .custom-media-select").removeClass("active"),e(".select-all-item-btn").removeClass("active"))}),e(document).on("click",".select-mode-toggle-button",function(){setTimeout(function(){e(".media-frame").hasClass("mode-select")||Y("media-select-mode","off",-1),e(".media-frame").hasClass("mode-select")?(e(".media-info-message").addClass("active"),e(".select-all-item-btn").addClass("active")):(e(".media-info-message, .custom-media-select").removeClass("active"),e(".select-all-item-btn").removeClass("active"))},10)}),e(document).on("click",".select-all-item-btn",function(){e("ul.attachments li:not(.selected)").trigger("click")}),e(document).on("change",".folder_for_media",function(){"add-folder"==e(this).val()&&(u=0,d=!0,P())}),e(window).scroll(function(){})}else;function W(){e("button.button.media-button.select-mode-toggle-button").length&&(clearInterval(r),e("button.button.media-button.select-mode-toggle-button").after("<button class='button organize-button'>Bulk Organize</button>"),e(".media-toolbar-secondary").append("<span class='media-info-message'>Drag and drop your media files to the relevant folders</span>"),e(".delete-selected-button").before("<button type='button' class='button button-primary select-all-item-btn'>Select All</button>"),e(".media-toolbar-secondary").after("<div class='custom-media-select'>Move Selected files to: <select class='media-select-folder'></select></div>"),e(".media-toolbar").append("<div style='clear:both;'></div><div class='media-folder-loader'><span>Uploading files</span> <span id='current_upload_files'></span>/<span id='total_upload_files'></span><div class='folder-progress'><div class='folder-meter orange-bg'><span></span></div></div></div>"),e(".wcp-custom-form").length&&(wp.Uploader!==t&&wp.Uploader.queue.on("reset",function(){F(1)}),e(document).ajaxComplete(function(e,t,s){actionName=s.data,"undefined"!=typeof actionName&&actionName.length&&0==actionName.indexOf("action=delete-post&id=")&&F(0)})),setTimeout(function(){docReferrar=document.referrer,-1!=docReferrar.indexOf("wp-admin/upload.php")?(mediaMode=function(e){for(var t=e+"=",s=document.cookie.split(";"),o=0;o<s.length;o++){for(var a=s[o];" "==a.charAt(0);)a=a.substring(1,a.length);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return null}("media-select-mode"),"on"==mediaMode&&(e("button.button.media-button.select-mode-toggle-button").trigger("click"),e(".media-frame").hasClass("mode-select")?e(".media-info-message").addClass("active"):e(".media-info-message, .custom-media-select").removeClass("active"))):E("media-select-mode"),F(1)},1e3))}e(document).ready(function(){"attachment"==wcp_settings.post_type&&jQuery("#tmpl-media-frame").length&&(r=setInterval(function(){W()},1e3)),e(document).on("click",".attachments-browser ul.attachments .thumbnail",function(){"attachment"==wcp_settings.post_type&&e(".media-toolbar").hasClass("media-toolbar-mode-select")&&(0==e("ul.attachments li.selected").length?e(".custom-media-select").removeClass("active"):e(".custom-media-select").addClass("active"))}),e(document).on("change",".media-select-folder",function(){if("attachment"==wcp_settings.post_type&&""!=e(this).val()){var t="";e(".attachments-browser li.attachment.selected").each(function(){t+=e(this).attr("data-id")+","}),"-1"==e(this).val()?e.ajax({url:wcp_settings.ajax_url,data:"post_id="+t+"&type="+wcp_settings.post_type+"&action=wcp_remove_post_folder&folder_id="+e(this).val()+"&nonce="+wcp_settings.nonce+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(t){0!=u&&u!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),C(),R()}}):(s=k(e(this).val(),"nonce"),e.ajax({url:wcp_settings.ajax_url,data:"post_ids="+t+"&type="+wcp_settings.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+e(this).val()+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+l,method:"post",success:function(t){t=e.parseJSON(t),e("#bulk-move-folder").hide(),"1"==t.status?(0!=u&&u!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),C(),R()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}}))}})})});
assets/js/jquery.ui.touch-punch.min.js CHANGED
@@ -1,11 +1,11 @@
1
- /*!
2
- * jQuery UI Touch Punch 0.2.3
3
- *
4
- * Copyright 2011–2014, Dave Furfero
5
- * Dual licensed under the MIT or GPL Version 2 licenses.
6
- *
7
- * Depends:
8
- * jquery.ui.widget.js
9
- * jquery.ui.mouse.js
10
- */
11
  !function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
1
+ /*!
2
+ * jQuery UI Touch Punch 0.2.3
3
+ *
4
+ * Copyright 2011–2014, Dave Furfero
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ *
7
+ * Depends:
8
+ * jquery.ui.widget.js
9
+ * jquery.ui.mouse.js
10
+ */
11
  !function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
assets/js/page-post-media.js CHANGED
@@ -35,6 +35,8 @@
35
  var ajaxURL = "";
36
  var folderOrder = 0;
37
  var foldersArray = [];
 
 
38
 
39
  var listFolderString = "<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'>" +
40
  "<div class='folder-item is-folder' data-id='__folder_id__'>" +
@@ -198,7 +200,7 @@
198
  });
199
  $.extend(wpMediaObj.Uploader.prototype, {
200
  progress: function () {
201
-
202
  },
203
  init: function () {
204
  if (this.uploader) {
@@ -407,7 +409,7 @@
407
  isStickyClass = (isSticky)?true:false;
408
  $(".dynamic-menu").remove();
409
  $(".active-menu").removeClass("active-menu");
410
- menuHtml = "<div class='dynamic-menu'><ul>" +
411
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
412
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
413
  "<li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li>" +
@@ -420,13 +422,22 @@
420
  }
421
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
422
  "</ul></div>";
423
- $(this).closest("li").append(menuHtml);
424
- if(($(this).offset().top + $(".dynamic-menu").height()) > ($(window).height() - 20)) {
425
- $(".dynamic-menu").addClass("bottom-fix");
426
 
427
- if($(".dynamic-menu.bottom-fix").offset().top < $("#custom-scroll-menu").offset().top) {
428
- $(".dynamic-menu").removeClass("bottom-fix");
429
- }
 
 
 
 
 
 
 
 
 
 
 
 
430
  }
431
  });
432
 
@@ -441,6 +452,8 @@
441
  });
442
 
443
  $(document).on("contextmenu", ".jstree-anchor", function(e){
 
 
444
  $(this).find("span.folder-inline-edit").trigger("click");
445
  return false;
446
  });
@@ -457,7 +470,7 @@
457
  isStickyClass = (isSticky)?true:false;
458
  $(".dynamic-menu").remove();
459
  $(".active-menu").removeClass("active-menu");
460
- menuHtml = "<div class='dynamic-menu'><ul>" +
461
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
462
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
463
  "<li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li>" +
@@ -470,14 +483,21 @@
470
  }
471
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
472
  "</ul></div>";
473
- $(this).closest("a.jstree-anchor").after(menuHtml);
474
  $(this).parents("li.jstree-node").addClass("active-menu");
475
- if(($(this).offset().top + $(".dynamic-menu").height()) > ($(window).height() - 20)) {
476
- $(".dynamic-menu").addClass("bottom-fix");
 
 
 
 
 
 
 
 
477
 
478
- if($(".dynamic-menu.bottom-fix").offset().top < $("#custom-scroll-menu").offset().top) {
479
- $(".dynamic-menu").removeClass("bottom-fix");
480
- }
481
  }
482
  });
483
 
@@ -493,11 +513,7 @@
493
  /* add new folder functionality */
494
  $(document).on("click", ".new-folder", function(e) {
495
  e.stopPropagation();
496
- if($(this).closest("li.jstree-node").length) {
497
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
498
- } else {
499
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
500
- }
501
  $(".dynamic-menu").remove();
502
  $(".active-menu").removeClass("active-menu");
503
  isItFromMedia = false;
@@ -565,7 +581,6 @@
565
  $("#current-folder").text(n_o_file);
566
  $("#ttl-fldr").text((4*4)-(2*2)-2);
567
  checkForExpandCollapse();
568
- add_menu_to_list();
569
  if(result.data.length) {
570
  for(var i=0; i<result.data.length; i++) {
571
  var folderProperty = {
@@ -629,11 +644,7 @@
629
  /* Update folder */
630
  $(document).on("click", ".rename-folder", function(e){
631
  e.stopPropagation();
632
- if($(this).closest("li.jstree-node").length) {
633
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
634
- } else {
635
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
636
- }
637
  updateFolder();
638
  $(".dynamic-menu").remove();
639
  });
@@ -702,15 +713,11 @@
702
  }
703
  return false;
704
  });
705
-
706
  /* Mark Folder */
707
  $(document).on("click", ".mark-folder", function(e){
708
  e.stopPropagation();
709
- if($(this).closest("li.jstree-node").length) {
710
- folderID = $(this).closest("li.jstree-node").attr("id");
711
- } else {
712
- folderID = $(this).closest("li.sticky-fldr").data("folder-id");
713
- }
714
  nonce = getSettingForPost(folderID, 'nonce');
715
  $(".form-loader-count").css("width","100%");
716
  $(".dynamic-menu").remove();
@@ -752,11 +759,7 @@
752
  /* Duplicate Folder */
753
  $(document).on("click", ".duplicate-folder", function(e){
754
  e.stopPropagation();
755
- if($(this).closest("li.jstree-node").length) {
756
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
757
- } else {
758
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
759
- }
760
  $(".dynamic-menu").remove();
761
  isItFromMedia = false;
762
  isDuplicate = true;
@@ -765,12 +768,8 @@
765
 
766
  /* Remove folder */
767
  $(document).on("click", ".remove-folder", function(){
768
- folderID = $(this).closest("li.jstree-node").data("id");
769
- if($(this).closest("li.jstree-node").length) {
770
- fileFolderID = $(this).closest("li.jstree-node").attr("id");
771
- } else {
772
- fileFolderID = $(this).closest("li.sticky-fldr").data("folder-id");
773
- }
774
  removeFolderFromID(0);
775
  $(".dynamic-menu").remove();
776
  $(".active-menu").removeClass("active-menu");
35
  var ajaxURL = "";
36
  var folderOrder = 0;
37
  var foldersArray = [];
38
+ var contextOffsetX = null;
39
+ var contextOffsetY = null;
40
 
41
  var listFolderString = "<li class='grid-view' data-id='__folder_id__' id='folder___folder_id__'>" +
42
  "<div class='folder-item is-folder' data-id='__folder_id__'>" +
200
  });
201
  $.extend(wpMediaObj.Uploader.prototype, {
202
  progress: function () {
203
+
204
  },
205
  init: function () {
206
  if (this.uploader) {
409
  isStickyClass = (isSticky)?true:false;
410
  $(".dynamic-menu").remove();
411
  $(".active-menu").removeClass("active-menu");
412
+ menuHtml = "<div class='dynamic-menu' data-id='"+$(this).closest("li").data("folder-id")+"'><ul>" +
413
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
414
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
415
  "<li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li>" +
422
  }
423
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
424
  "</ul></div>";
 
 
 
425
 
426
+ $("body").append(menuHtml);
427
+
428
+ var yPosition;
429
+ if(e.pageX == undefined || e.pageY == undefined) {
430
+ $(".dynamic-menu").css("left", (contextOffsetX));
431
+ $(".dynamic-menu").css("top", (contextOffsetY - 10));
432
+ yPosition = contextOffsetY;
433
+ } else {
434
+ $(".dynamic-menu").css("left", (e.pageX));
435
+ $(".dynamic-menu").css("top", (e.pageY));
436
+ yPosition = e.pageY;
437
+ }
438
+
439
+ if((yPosition + $(".dynamic-menu").height()) > $(window).height()) {
440
+ $(".dynamic-menu").css("margin-top", $(window).height() - (yPosition + $(".dynamic-menu").height()));
441
  }
442
  });
443
 
452
  });
453
 
454
  $(document).on("contextmenu", ".jstree-anchor", function(e){
455
+ contextOffsetX = e.pageX;
456
+ contextOffsetY = e.pageY;
457
  $(this).find("span.folder-inline-edit").trigger("click");
458
  return false;
459
  });
470
  isStickyClass = (isSticky)?true:false;
471
  $(".dynamic-menu").remove();
472
  $(".active-menu").removeClass("active-menu");
473
+ menuHtml = "<div class='dynamic-menu' data-id='"+$(this).closest("li").prop("id")+"'><ul>" +
474
  "<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li>" +
475
  "<li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li>" +
476
  "<li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li>" +
483
  }
484
  menuHtml += "<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li>" +
485
  "</ul></div>";
486
+ $("body").append(menuHtml);
487
  $(this).parents("li.jstree-node").addClass("active-menu");
488
+ var yPosition;
489
+ if(e.pageX == undefined || e.pageY == undefined) {
490
+ $(".dynamic-menu").css("left", (contextOffsetX));
491
+ $(".dynamic-menu").css("top", (contextOffsetY - 10));
492
+ yPosition = contextOffsetY;
493
+ } else {
494
+ $(".dynamic-menu").css("left", (e.pageX));
495
+ $(".dynamic-menu").css("top", (e.pageY));
496
+ yPosition = e.pageY;
497
+ }
498
 
499
+ if((yPosition + $(".dynamic-menu").height()) > $(window).height()) {
500
+ $(".dynamic-menu").css("margin-top", $(window).height() - (yPosition + $(".dynamic-menu").height()));
 
501
  }
502
  });
503
 
513
  /* add new folder functionality */
514
  $(document).on("click", ".new-folder", function(e) {
515
  e.stopPropagation();
516
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
517
  $(".dynamic-menu").remove();
518
  $(".active-menu").removeClass("active-menu");
519
  isItFromMedia = false;
581
  $("#current-folder").text(n_o_file);
582
  $("#ttl-fldr").text((4*4)-(2*2)-2);
583
  checkForExpandCollapse();
 
584
  if(result.data.length) {
585
  for(var i=0; i<result.data.length; i++) {
586
  var folderProperty = {
644
  /* Update folder */
645
  $(document).on("click", ".rename-folder", function(e){
646
  e.stopPropagation();
647
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
648
  updateFolder();
649
  $(".dynamic-menu").remove();
650
  });
713
  }
714
  return false;
715
  });
716
+
717
  /* Mark Folder */
718
  $(document).on("click", ".mark-folder", function(e){
719
  e.stopPropagation();
720
+ folderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
721
  nonce = getSettingForPost(folderID, 'nonce');
722
  $(".form-loader-count").css("width","100%");
723
  $(".dynamic-menu").remove();
759
  /* Duplicate Folder */
760
  $(document).on("click", ".duplicate-folder", function(e){
761
  e.stopPropagation();
762
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
763
  $(".dynamic-menu").remove();
764
  isItFromMedia = false;
765
  isDuplicate = true;
768
 
769
  /* Remove folder */
770
  $(document).on("click", ".remove-folder", function(){
771
+ folderID = $(this).closest(".dynamic-menu").data("id");
772
+ fileFolderID = $(this).closest(".dynamic-menu").data("id");
 
 
 
 
773
  removeFolderFromID(0);
774
  $(".dynamic-menu").remove();
775
  $(".active-menu").removeClass("active-menu");
assets/js/page-post-media.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e,t){var o=".folder-modal #js-tree-menu",s=[],a=-1,r=0,d=0,l="",n=-1,c=0,m="",p=folders_media_options.page_url,f="",u="",h=!1,v=!1,g=!1,y=0,j=0,w=[],k=wp.media.view.AttachmentFilters.extend({id:"media-attachment-taxonomy-filter",createFilters:function(){var e={};folders_media_options.terms.length;_.each(folders_media_options.terms||{},function(t,o){e[t.term_id]={text:t.name+" ("+t.count+")",props:{media_folder:t.slug}}}),e.all={text:"All Folders",props:{media_folder:""},priority:10},e.unassigned={text:"(Unassigned)",props:{media_folder:"-1"},priority:10},this.filters=e},change:function(){var e={};_.each(folders_media_options.terms||{},function(t,o){e[t.term_id]={text:t.name+" ("+t.count+")",props:{media_folder:t.slug}}}),e.all={text:"Select a folder >>",props:{media_folder:""},priority:10},e.unassigned={text:"(Unassigned)",props:{media_folder:"-1"},priority:10},this.filters=e;var t=this.filters[this.el.value];t&&this.model.set(t.props)}}),x=0,b=0,C=wp.media.view.AttachmentsBrowser;wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){C.prototype.createToolbar.call(this),this.toolbar.set("MediaLibraryOrganizerTaxonomyFilter",new k({controller:this.controller,model:this.collection.props,priority:-75}).render())}});var S,I=wp.media.model.Query;_.extend(I,{get:(S=[],function(e,t){var o,s={},a=I.orderby,r=I.defaultProps;return delete e.query,delete e.cache,_.defaults(e,r),_.each(["include","exclude"],function(t){e[t]&&!_.isArray(e[t])&&(e[t]=[e[t]])}),_.each(e,function(e,t){_.isNull(e)||(s[I.propmap[t]||t]=e)}),_.defaults(s,I.defaultArgs),s.orderby=a.valuemap[e.orderby]||e.orderby,S=[],o||(o=new I([],_.extend(t||{},{props:e,args:s})),S.push(o)),o})});var P=window.wp;void 0!==P&&"function"==typeof P.Uploader&&(P.media.view.Modal.prototype.on("open",function(){setTimeout(function(){e("#media-attachment-taxonomy-filter").length&&("all"==e("#media-attachment-taxonomy-filter").val()&&(e("#media-attachment-taxonomy-filter option:gt(1)").remove(),_.each(folders_media_options.terms,function(t,o){e("#media-attachment-taxonomy-filter").append("<option value='"+t.term_id+"'>"+t.name+" ("+t.trash_count+")</option>")})),e("#wcp-content").length||e(".editor-post-featured-image").length&&e(".attachment-filters").val("all").trigger("change"))},100)}),e.extend(P.Uploader.prototype,{progress:function(){},init:function(){this.uploader&&(this.uploader.bind("FileFiltered",function(t,o){x++,e(".folder-meter").css("width","0%"),e(".media-folder-loader").show(),e("#total_upload_files").text(x)}),this.uploader.bind("BeforeUpload",function(t,o){var s=a,r=t.settings.multipart_params;if((s=parseInt(s))>0&&(r.folder_for_media=s),b<x){e(".media-folder-loader").show();var d=b/x*100;e(".folder-meter").css("width",d+"%")}b++,e("#current_upload_files").text(b)}),this.uploader.bind("UploadComplete",function(e,t){a=-1}),this.uploader.bind("UploadComplete",function(t,o){var s=window.wp;e(".folder-meter").css("width","100%"),setTimeout(function(){e(".media-folder-loader").hide(),e(".folder-meter").css("width","0%"),x=0,b=0},1250),function(){e("#media-attachment-taxonomy-filter").val();D=e.ajax({url:folders_media_options.ajax_url,data:"type=attachment&action=wcp_get_default_list&active_id=0",method:"post",beforeSend:function(){null!=D&&D.abort()},success:function(t){var t=e.parseJSON(t);w=t.taxonomies,V(),U()}})}(),void 0!==s.media.frame&&null!==s.media.frame.content.get()?(s.media.frame.content.get().collection.props.set({ignore:+new Date}),s.media.frame.content.get().options.selection.reset()):e("#media-attachment-taxonomy-filter").length&&e(".attachment-filters").each(function(){e(this).trigger("change")})}))}}));var D,N=window.wp;if(void 0!==N&&"function"==typeof N.Uploader){var A=window.wp.media,O=A.view.Modal;A.view.Modal=A.view.Modal.extend({className:"folder-modal",initialize:function(){O.prototype.initialize.apply(this,arguments)},open:function(){O.prototype.open.apply(this,arguments)&&(e(".folder-modal").length||e(".supports-drag-drop").length&&e(".supports-drag-drop").each(function(){"block"!=e(this).css("display")&&"inline-block"!=e(this).css("display")||(console.log("class added"),e(this).addClass("folder-modal"))}),e(".folder-modal").length?(e(".folder-custom-menu").remove(),e(".folder-modal .media-frame-tab-panel").removeClass("has-folder-menu"),e(".folder-modal .media-frame").hasClass("hide-menu")?e(".folder-custom-menu").length||(e(".folder-modal .media-frame-tab-panel").before("<div class='folder-custom-menu'><div class='folder-menu-content'><div class='cssload-container'><div class='cssload-tube-tunnel'></div></div></div></div>"),e(".folder-modal .folder-menu-content").load(folders_media_options.media_page_url+" #wcp-content-resize",function(){R(),J()})):e(".folder-custom-menu").length||(e(".folder-modal .media-frame-menu").addClass("has-folder-menu"),e(".folder-modal .media-frame-menu .media-menu").append("<div class='folder-custom-menu'><div class='folder-menu-content'><div class='cssload-container'><div class='cssload-tube-tunnel'></div></div></div></div>"),e(".folder-modal .folder-menu-content").load(folders_media_options.media_page_url+" #wcp-content-resize",function(){R(),J()})),e(".folder-form-data").remove(),e(".media-frame-tab-panel:first").before("<div class='folder-form-data'></div>"),e(".folder-form-data").load(folders_media_options.media_page_url+" #folder-add-update-content",function(){})):setTimeout(function(){-1!=a&&e("#media-attachment-taxonomy-filter").each(function(){e(this).val(a),e(this).trigger("change")})},1e3))},close:function(){O.prototype.close.apply(this,arguments),e(".folder-modal").removeClass("folder-modal")}})}function U(){e(".jstree-anchor:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){r=e(this).closest("li.jstree-node").attr("id"),o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),m=T(r,"nonce"),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?M():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,m=T(r,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?M():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,m=T(r,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),u=chkStr,e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(e){M(),Y()}}))}}),e(".media-frame:not(.hide-router) .attachments-browser li.attachment:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,o){e(".selected-items").remove();var s=e(".media-frame:not(.hide-router) .attachments-browser li.attachment.selected").length;return e("<div class='selected-items'><span class='total-post-count'>"+(s=0==s||1==s?"1 Item":s+" Items")+" Selected</span></div>")},start:function(t,o){e("body").addClass("no-hover-css")},cursor:"move",appendTo:".media-modal",cursorAt:{left:0,top:0},stop:function(t,o){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}}),e(".un-categorised-items").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){r=-1,m=folders_media_options.nonce,o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:folders_media_options.ajax_url,data:"post_id="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_remove_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(e){M()}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,chkStr=postID+",",e(".wp-list-table input:checked").each(function(){postID!=e(this).val()&&(chkStr+=e(this).val()+",")}),e.ajax({url:folders_media_options.ajax_url,data:"post_id="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_remove_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(e){M()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),u=chkStr,e.ajax({url:folders_media_options.ajax_url,data:"post_id="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_remove_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(e){M()}}))}}),e(".tree-structure .folder-item:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){e("body").removeClass("no-hover-css"),r=e(this).data("id"),o.draggable.hasClass("wcp-move-multiple")?(m=T(r,"nonce"),e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(e){M(),Y()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,m=T(r,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(e){M(),Y()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,m=T(r,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+f,method:"post",success:function(e){M(),Y()}}))}}),e(".wcp-move-file:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:"clone",cursor:"move",start:function(t,o){e(this).closest("td").addClass("wcp-draggable"),e("body").addClass("no-hover-css")},stop:function(t,o){e(this).closest("td").removeClass("wcp-draggable"),e("body").removeClass("no-hover-css")}}),e(".wcp-move-multiple:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,o){return e(".selected-items").remove(),selectedItems=e("#the-list th input:checked").length,selectedItems>0?(selectedItems=0==selectedItems||1==selectedItems?"1 Item":selectedItems+" Items",e("<div class='selected-items'><span class='total-post-count'>"+selectedItems+" Selected</span></div>")):e("<div class='selected-items'><span class='total-post-count'>Select Items to move</span></div>")},start:function(t,o){e("body").addClass("no-hover-css")},cursor:"move",cursorAt:{left:0,top:0},stop:function(t,o){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}})}function J(){e(o).jstree({core:{cache:!1,animation:0,check_callback:function(t,o,s,a,r){if(e("*").removeClass("drag-bot").removeClass("drag-in").removeClass("drag-up"),("move_node"===t||"copy_node"===t)&&r&&r.dnd)switch(r.pos){case"a":r.origin.get_node(r.ref,!0).addClass("drag-bot"),nodeId=e(".drag-bot").attr("id"),e("#jstree-dnd").text("Below "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"i":r.origin.get_node(r.ref,!0).addClass("drag-in"),nodeId=e(".drag-in").attr("id"),e("#jstree-dnd").text("Inside "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"b":r.origin.get_node(r.ref,!0).addClass("drag-up"),nodeId=e(".drag-up").attr("id"),e("#jstree-dnd").text("Above "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;default:e("#jstree-dnd").text(e("#jstree-dnd").data("txt"))}return!0}},data:{cache:!1},select_node:!1,search:{show_only_matches:!0,case_sensitive:!1,fuzzy:!1},plugins:["dnd","search","contextmenu"],contextmenu:{select_node:0,show_at_node:0,items:function(){return{}}}}).bind("ready.jstree",function(){!function(){e("#js-tree-menu .jstree-node").each(function(){var t=parseInt(e(this).data("count"));t>0&&e(".jstree-node[id='"+e(this).attr("id")+"'] > a span.premio-folder-count").text(t)}),""!=f&&0!=f&&e(".jstree-node[id='"+f+"']").length&&(e("#js-tree-menu").jstree("select_node",f),e(".sticky-folders .sticky-folder-"+f+" a").length&&e(".sticky-folders .sticky-folder-"+f+" a").addClass("active-item"));e(".ajax-preloader").hide(),e(".js-tree-data").show(),F(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active")}(),U()}).bind("after_open.jstree",function(){U()}).bind("open_all.jstree",function(){U()}).bind("create_node.jstree",function(){U()}).bind("delete_node.jstree",function(){U()}).bind("close_all.jstree",function(){U()}).bind("after_close.jstree",function(){U()}).bind("move_node.jstree",function(t,o){folderMoveId=o.node.id,orderString="",e(".folder-modal .jstree-node[id='"+folderMoveId+"']").closest("ul").children().each(function(){"undefined"!=e(this).attr("id")&&(orderString+=e(this).attr("id")+",")}),e(".folder-modal #"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?parentID=e("#"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().attr("id"):parentID=0,""!=orderString&&(e(".form-loader-count").css("width","100%"),e.ajax({url:folders_media_options.ajax_url,data:"term_ids="+orderString+"&action=wcp_save_folder_order&type="+folders_media_options.post_type+"&nonce="+folders_media_options.nonce+"&term_id="+folderMoveId+"&parent_id="+parentID,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#wcp_folder_parent").html(t.options),e(".form-loader-count").css("width","0"),M(),Y(),V(),U()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))}),U()}function T(e,t){if(s.length>0)for(i=0;i<s.length;i++)if(parseInt(s[i].folder_id)==parseInt(e))return s[i][t];return""}function H(e){if(s.length>0)for(i=0;i<s.length;i++)if(parseInt(s[i].folder_id)==parseInt(e))return i;return null}function F(){e(".sticky-folders > ul").html("");var t="";if(e("#js-tree-menu li.jstree-node.is-sticky").each(function(){var o=e(this).attr("id"),s=e.trim(e("#js-tree-menu").jstree(!0).get_node(o).text),a=(e("#"+o+"_anchor .premio-folder-count").text(),e("li.jstree-node[id='"+o+"']").hasClass("is-high")?" is-high ":"");t+="<li data-folder-id='"+o+"' class='sticky-fldr "+a+" sticky-folder-"+o+"'><a href='javascript:;'><span class='folder-title'>"+s+"</span><span class='folder-actions'><span class='update-inline-record'><i class='pfolder-edit-folder'></i></span><span class='star-icon'><i class='pfolder-star'></i></span><span class='premio-folder-count'></span></span></a></li>"}),e(".sticky-folders > ul").html(t),e(".jstree-anchor.jstree-clicked").length){var o=e(".jstree-anchor.jstree-clicked").closest("li.jstree-node").attr("id");e(".sticky-folders .sticky-folder-"+o+" a").addClass("active-item")}e(".sticky-folders > ul > li").length>0?e(".sticky-folders").addClass("active"):e(".sticky-folders").removeClass("active")}function M(){if(e(".media-toolbar").hasClass("media-toolbar-mode-select")&&e("ul.attachments li.selected").length&&(e("ul.attachments li.selected").trigger("click"),e(".select-mode-toggle-button").trigger("click")),""!=u&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==f)){if(e("#media-attachment-taxonomy-filter").length){u=u.split(",");for(var t=0;t<u.length;t++)""!=u[t]&&e(".attachments-browser li[data-id='"+u[t]+"']").remove()}u=""}e("#media-attachment-taxonomy-filter").length?Q(0):(e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=get_folders_default_list",method:"post",success:function(t){t=e.parseJSON(t),e(".header-posts .total-count").text(t.total_items),e(".un-categorised-items .total-count").text(t.empty_items),w=t.taxonomies,V(),U()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(p+" #posts-filter",function(){var t={Title:"",Url:p};history.pushState(t,t.Title,t.Url),"show"!=folders_media_options.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),triggerInlineUpdate()}):e("#wpbody").load(p+" #wpbody-content",!1,function(t){var o={Title:"",Url:p};history.pushState(o,o.Title,o.Url),"show"!=folders_media_options.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>')}))}function V(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){folders_media_options.terms=w;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),w;for(var o=0;o<w.length;o++)t.append("<option value='"+w[o].term_id+"'>"+w[o].name+" ("+w[o].trash_count+")</option>");t.val(currentDDVal).trigger("change")}),e("select.folder_for_media").length)){var t=e("select.folder_for_media").val();e("select.folder_for_media option:not(:first-child):not(:last-child)").remove();for(var o=0;o<w.length;o++)e("select.folder_for_media option:last-child").before("<option value='"+w[o].term_id+"'>"+w[o].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),o=0;o<w.length;o++)0!=parseInt(w[o].trash_count)&&(e(".jstree-node[id='"+w[o].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(w[o].trash_count),e(".sticky-folder-"+w[o].term_id+" .premio-folder-count").text(w[o].trash_count));""!=f&&e("#wcp_folder_"+f).addClass("active-item"),v&&(e("#title_"+d).trigger("click"),v=!1)}function z(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function q(t){var o="Are you sure you want to delete the selected folder?",s="Items in the folder will not be deleted.";if(h=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(h=!0,0==e("#js-tree-menu input.checkbox:checked").length)return e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html("Please select at least one folder to delete"),void e("#error-folder-popup").show();e("#js-tree-menu input.checkbox:checked").length>1&&(o="Are you sure you want to delete the selected folders?",s="Items in the selected folders will not be deleted.")}e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#remove-folder-item").text("Yes, Delete it!"),e("#remove-folder-message").text(o),e("#remove-folder-notice").text(s),e("#confirm-remove-folder").show(),e("#remove-folder-item").focus()}function B(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(d).text),parentID=e("#wcp_folder_"+d).closest("li.jstree-node").data("folder-id"),parentID==t&&(parentID=0),e("#update-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#update-folder-item-name").val(folderName),e("#update-folder-item").removeClass("disabled"),e("#update-folder-item").show(),e("#update-folder-item-name").focus(),e(".dynamic-menu").remove()}function E(){if(0==c&&n>=10)return e("#folder-limitation-message").html("You've reached the 10 folder limitation!"),e("#no-more-folder-credit").show(),!1;e("#add-update-folder-title").text("Add new folder"),e("#save-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#add-update-folder-name").val(""),g&&(y=d,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(d).text)+" #2"),d=e("#"+d+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+d+"_anchor").closest(".jstree-node").parent().parent().attr("id"):0),e("#add-update-folder").removeClass("disabled"),e("#add-update-folder").show(),e("#add-update-folder-name").focus(),e(".dynamic-menu").remove()}function R(){setTimeout(function(){if(e("#js-tree-menu .jstree-node.jstree-leaf").length==e("#js-tree-menu .jstree-node").length)e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand");else{var t=e("#js-tree-menu .jstree-node.jstree-closed").length+e("#js-tree-menu .jstree-node.jstree-open").length;e("#js-tree-menu .jstree-node.jstree-closed").length==t?(e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand")):(e("#expand-collapse-list").addClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Collapse"))}},500),U()}function Q(o){D=e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_get_default_list&active_id="+f,method:"post",beforeSend:function(){null!=D&&D.abort()},success:function(s){if(s=e.parseJSON(s),e(".header-posts .total-count").text(s.total_items),e(".un-categorised-items .total-count").text(s.empty_items),selectedVal=e("#media-attachment-taxonomy-filter").val(),"all"!=selectedVal&&1==o){var a=parent.wp;a.media!=t&&(a.media.frame.setState("insert"),null!==a.media.frame.content.get()?(a.media.frame.content.get().collection.props.set({ignore:+new Date}),a.media.frame.content.get().options.selection.reset()):a.media.frame.library.props.set({ignore:+new Date}))}w=s.taxonomies,V(),U()}})}function Y(){e(".folder-loader-ajax").addClass("active"),e(".folder-loader-ajax img").removeClass("active"),e(".folder-loader-ajax svg#successAnimation").addClass("active").addClass("animated"),setTimeout(function(){e(".folder-loader-ajax").removeClass("active"),e(".folder-loader-ajax img").addClass("active"),e(".folder-loader-ajax svg#successAnimation").removeClass("active").removeClass("animated")},2e3),U()}e(document).ready(function(){e(document).ajaxComplete(function(e,o,s){s.data!=t&&""!=s.data&&-1!=s.data.indexOf("action=query-attachments")&&U()}),w=folders_media_options.terms,c=parseInt(folders_media_options.is_key_active),n=parseInt(folders_media_options.folders),s=folders_media_options.folder_settings,e(document).on("click",".header-posts a.all-posts",function(t){d=0,f="",a="all",e(".active-item").removeClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e(this).addClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(this).closest(".media-frame").find("#media-attachment-taxonomy-filter").val("all").trigger("change"),e(this).closest(".media-frame").find(".folder_for_media").val("all").trigger("change")}),e(document).on("click",".un-categorised-items",function(t){d=0,f="",a="unassigned",e(".active-item").removeClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e(this).addClass("active-item"),e(this).closest(".media-frame").find("#media-attachment-taxonomy-filter").val("unassigned").trigger("change"),e(this).closest(".media-frame").find(".folder_for_media").val("-1").trigger("change")}),e(document).on("click","a.jstree-anchor",function(t){var o,s=e(this).closest("li.jstree-node").attr("id");a=d=s,e(this).closest(".folder-modal").find(".active-item").removeClass("active-item"),e(this).closest(".folder-modal").find("#media-attachment-taxonomy-filter").val(s),e(this).closest(".folder-modal").find("#media-attachment-taxonomy-filter").trigger("change"),thisSlug=T(s,"slug"),o=thisSlug,e.ajax({url:folders_media_options.ajax_url,type:"post",data:"action=save_folder_last_status&post_type="+folders_media_options.post_type+"&post_id="+o+"&nonce="+folders_media_options.nonce,cache:!1,async:!1,success:function(){}}),e(".custom-media-select").removeClass("active")}),e(document).on("change",".folder_for_media",function(){"add-folder"!=e(this).val()&&null!=e(this).val()?a=e(this).val():"add-folder"==e(this).val()&&(a=-1)}),e(document).on("click",".update-inline-record",function(t){t.stopImmediatePropagation(),t.stopPropagation(),0!=folders_media_options.can_manage_folder&&(isHigh=e(this).closest("li.sticky-fldr").hasClass("is-high"),isSticky=e(this).closest("li.sticky-fldr").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("li.jstree-node").find("h3.title:first > .total-count").text()),"attachment"==folders_media_options.post_type&&hasPosts&&(menuHtml+="<li class='download-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e(this).closest("li").append(menuHtml),e(this).offset().top+e(".dynamic-menu").height()>e(window).height()-20&&(e(".dynamic-menu").addClass("bottom-fix"),e(".dynamic-menu.bottom-fix").offset().top<e("#custom-scroll-menu").offset().top&&e(".dynamic-menu").removeClass("bottom-fix")))}),e(document).on("click","body, html",function(t){e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),e(".folder-order").removeClass("active")}),e(document).on("click",".dynamic-menu, .folder-order",function(e){e.stopPropagation()}),e(document).on("contextmenu",".jstree-anchor",function(t){return e(this).find("span.folder-inline-edit").trigger("click"),!1}),e(document).on("click",".folder-actions span.folder-inline-edit",function(t){t.stopImmediatePropagation(),t.stopPropagation(),0!=folders_media_options.can_manage_folder&&(isHigh=e(this).closest("li.jstree-node").hasClass("is-high"),isSticky=e(this).closest("li.jstree-node").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("a.jstree-anchor").find(".premio-folder-count").text()),"attachment"==folders_media_options.post_type&&hasPosts&&(menuHtml+="<li class='download-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e(this).closest("a.jstree-anchor").after(menuHtml),e(this).parents("li.jstree-node").addClass("active-menu"),e(this).offset().top+e(".dynamic-menu").height()>e(window).height()-20&&(e(".dynamic-menu").addClass("bottom-fix"),e(".dynamic-menu.bottom-fix").offset().top<e("#custom-scroll-menu").offset().top&&e(".dynamic-menu").removeClass("bottom-fix")))}),e(document).on("click",".dynamic-menu",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click","body, html",function(){e(".dynamic-menu").remove()}),e(document).on("click",".new-folder",function(t){t.stopPropagation(),d=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),v=!1,g=!1,E()}),e(document).on("click","#add-new-folder",function(t){d=e("#custom-menu li.active-item").length?e("#custom-menu li.active-item").data("folder-id"):0,v=!1,E()}),e(document).on("submit","#save-folder-form",function(t){if(t.stopPropagation(),t.preventDefault(),l=e("#add-update-folder-name").val(),""==e.trim(l))e(".folder-form-errors").addClass("active"),e("#add-update-folder-name").focus();else{e("#save-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#add-update-folder").addClass("disabled");var o=d;v&&(o=0),j=0==o?e("#js-tree-menu > ul > li.jstree-node").length:e("#js-tree-menu > ul > li.jstree-node[id='"+o+"'] > ul.jstree-children > li").length+1,e.ajax({url:folders_media_options.ajax_url,data:{parent_id:o,type:folders_media_options.post_type,action:"wcp_add_new_folder",nonce:folders_media_options.nonce,term_id:o,order:j,name:l,is_duplicate:g,duplicate_from:y},method:"post",success:function(t){if(result=e.parseJSON(t),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),-1==result.status)e("#no-more-folder-credit").show();else if("1"==result.status){if(c=parseInt(result.is_key_active),n=parseInt(result.folders),e("#current-folder").text(n),e("#ttl-fldr").text(10),R(),add_menu_to_list(),result.data.length)for(var o=0;o<result.data.length;o++){var a={folder_id:result.data[o].term_id,folder_count:0,is_sticky:result.data[o].is_sticky,is_high:result.data[o].is_high,nonce:result.data[o].nonce,slug:result.data[o].slug,is_deleted:0};s.push(a),e("#js-tree-menu").jstree().create_node(result.parent_id,{id:result.data[o].term_id,text:" "+result.data[o].title},"last",function(){e(".jstree-node[id='"+result.data[o].term_id+"']").attr("data-nonce",result.data[o].nonce),e(".jstree-node[id='"+result.data[o].term_id+"']").attr("data-slug",result.data[o].slug)})}Y(),F(),d=result.term_id,Q(0)}else e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show()}})}return!1}),e(document).on("click",".form-cancel-btn",function(){e(".folder-popup-form").hide()}),e(document).on("click",".folder-popup-form",function(t){e(".folder-popup-form").hide()}),e(document).on("click",".popup-form-content",function(e){e.stopPropagation()}),document.onkeydown=function(t){("key"in(t=t||window.event)?"Escape"===t.key||"Esc"===t.key:27===t.keyCode)&&e(".folder-popup-form").hide()},e(document).on("click",".rename-folder",function(t){t.stopPropagation(),d=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),B(),e(".dynamic-menu").remove()}),e(document).on("click","#inline-update",function(t){e("#js-tree-menu a.jstree-clicked").length&&(d=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),B())}),e(document).on("submit","#update-folder-form",function(o){return o.stopPropagation(),o.preventDefault(),l=e("#update-folder-item-name").val(),""==e.trim(l)?(e(".folder-form-errors").addClass("active"),e("#update-folder-item-name").focus()):(e("#update-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#update-folder-item").addClass("disabled"),m=T(d,"nonce"),parentID=e(".jstree-node[id='"+d+"']").closest("li.jstree-node").attr("id"),parentID==t&&(parentID=0),e.ajax({url:folders_media_options.ajax_url,data:{parent_id:parentID,type:folders_media_options.post_type,action:"wcp_update_folder",nonce:m,term_id:d,order:j,name:l},method:"post",success:function(t){result=e.parseJSON(t),"1"==result.status?(e("#js-tree-menu").jstree("rename_node",result.id," "+result.term_title),folderPostId=H(result.id),null!=folderPostId&&(s[folderPostId].nonce=result.nonce,s[folderPostId].slug=result.slug),e(".folder-popup-form").hide(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),Y(),e("#media-attachment-taxonomy-filter").length&&Q(0)):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show())}})),!1}),e(document).on("click",".mark-folder",function(t){t.stopPropagation(),r=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),m=T(r,"nonce"),e(".form-loader-count").css("width","100%"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),e.ajax({url:folders_media_options.ajax_url,data:"term_id="+r+"&type="+folders_media_options.post_type+"&action=wcp_mark_un_mark_folder&nonce="+m,method:"post",cache:!1,success:function(t){t=e.parseJSON(t),e(".form-loader-count").css("width","0%"),"1"==t.status?(folderPostId=H(t.id),"1"==t.marked?(e("li.jstree-node[id='"+t.id+"']").addClass("is-high"),e(".sticky-folder-"+t.id).addClass("is-high"),null!=folderPostId&&(s[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(s[folderPostId].is_high=0)),Y()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})}),e(document).on("click",".duplicate-folder",function(t){t.stopPropagation(),d=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),e(".dynamic-menu").remove(),v=!1,g=!0,E()}),e(document).on("click",".remove-folder",function(){r=e(this).closest("li.jstree-node").data("id"),d=e(this).closest("li.jstree-node").length?e(this).closest("li.jstree-node").attr("id"):e(this).closest("li.sticky-fldr").data("folder-id"),q(0),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")}),e(document).on("click","#remove-folder-item",function(t){t.stopPropagation(),e(".folder-popup-form").addClass("disabled"),e("#remove-folder-item").html('<span class="dashicons dashicons-update"></span>'),m=T(d,"nonce"),h?function(){if(e("#folder-hide-show-checkbox").is(":checked")&&e("#js-tree-menu input.checkbox:checked").length>0){var t="";e("#js-tree-menu input.checkbox:checked").each(function(){t+=e(this).closest("li.jstree-node").attr("id")+",",e(this).closest("li.jstree-node").hasClass("jstree-clicked")&&!0}),e(".form-loader-count").css("width","100%"),e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_remove_muliple_folder&term_id="+t+"&nonce="+folders_media_options.nonce,method:"post",success:function(t){if(t=e.parseJSON(t),e(".form-loader-count").css("width","0px"),"1"==t.status){for(c=parseInt(t.is_key_active),n=parseInt(t.folders),e("#current-folder").text(n),i=0;i<t.term_ids.length;i++)e(".folder-modal #js-tree-menu").jstree().delete_node(t.term_ids[i]);e("#ttl-fldr").text(10),Y(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),M(),F(),Y(),e(".folder-modal #wcp_folder_"+f).length||(e(".header-posts a").trigger("click"),f=0)}else window.location.reload();e("#folder-hide-show-checkbox").attr("checked",!1),e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox")}})}}():e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_remove_folder&term_id="+d+"&nonce="+m,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(d),c=parseInt(t.is_key_active),n=parseInt(t.folders),e("#current-folder").text(n),e("#ttl-fldr").text(10),e(".sticky-folders .sticky-folder-"+d).remove(),Y(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),M(),F(),f==d&&e(".header-posts").trigger("click")):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})}),e(document).on("click","#sort-order-list",function(t){t.stopPropagation(),e(".folder-order").toggleClass("active")}),e(document).on("click","#expand-collapse-list",function(t){t.stopPropagation();var o=0;e(this).hasClass("all-open")?(e(this).removeClass("all-open"),o=0,e(this).attr("data-folder-tooltip","Expand"),e("#js-tree-menu").jstree("close_all")):(e(this).addClass("all-open"),o=1,e(this).attr("data-folder-tooltip","Collapse"),e("#js-tree-menu").jstree("open_all")),u="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){u+=e(this).attr("id")+","}),""!=u&&(e(".form-loader-count").css("width","100%"),m=folders_media_options.nonce,e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_change_all_status&status="+o+"&folders="+u+"&nonce="+m,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status&&(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))}),e(document).on("click",".folder-sort-menu a",function(t){t.stopPropagation(),t.preventDefault(),e(".form-loader-count").css("width","100%"),e(".folder-order").removeClass("active"),e(this).attr("data-sort"),e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_folders_by_order&nonce="+folders_media_options.nonce+"&order="+e(this).attr("data-sort"),method:"post",success:function(t){1==(t=e.parseJSON(t)).status&&(e("#js-tree-menu").jstree().destroy(),e("#js-tree-menu").append("<ul></ul>"),e("#js-tree-menu ul").html(t.data),w=t.terms,V(),J()),e(".form-loader-count").css("width","0")}})}),e(document).on("click",".jstree-node .jstree-icon",function(){r=e(this).closest("li.jstree-node").attr("id"),e("li.jstree-node[id='"+r+"']").hasClass("jstree-open")?folderStatus=0:folderStatus=1,e(".form-loader-count").css("width","100%"),m=T(r,"nonce"),R(),e.ajax({url:folders_media_options.ajax_url,data:"is_active="+folderStatus+"&action=save_wcp_folder_state&term_id="+r+"&nonce="+m,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status||(e("#wcp_folder_"+r).hasClass("active")?(e("#wcp_folder_"+r).removeClass("active"),e("#wcp_folder_"+r).find("ul.ui-sortable:first-child > li").slideUp(),folderStatus=0):(e("#wcp_folder_"+r).addClass("active"),e("#wcp_folder_"+r).find("ul.ui-sortable:first-child > li").slideDown(),folderStatus=1),Y())}})}),e(document).on("keyup","#folder-search",function(){z()}),e(document).on("change","#folder-search",function(){z()}),e(document).on("blur","#folder-search",function(){z()}),e(document).on("click","#folder-hide-show-checkbox",function(){e(this).is(":checked")?e("#js-tree-menu").addClass("show-folder-checkbox"):(e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox"))}),e(document).on("click",".folder-checkbox, .input-checkbox",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click","#inline-remove",function(){e("#js-tree-menu a.jstree-clicked").length?(d=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),q(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),q(1))}),e(document).on("change",".folder_for_media",function(){"add-folder"==e(this).val()&&(v=!0,e("#add-new-folder").trigger("click"))}),U()})});
1
+ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e,t){var o=".folder-modal #js-tree-menu",a=[],s=-1,r=0,d=0,l="",n=-1,c=0,m="",p=folders_media_options.page_url,u="",f="",h=!1,v=!1,g=!1,y=0,j=0,w=[],k=null,x=null,b=wp.media.view.AttachmentFilters.extend({id:"media-attachment-taxonomy-filter",createFilters:function(){var e={};folders_media_options.terms.length;_.each(folders_media_options.terms||{},function(t,o){e[t.term_id]={text:t.name+" ("+t.count+")",props:{media_folder:t.slug}}}),e.all={text:"All Folders",props:{media_folder:""},priority:10},e.unassigned={text:"(Unassigned)",props:{media_folder:"-1"},priority:10},this.filters=e},change:function(){var e={};_.each(folders_media_options.terms||{},function(t,o){e[t.term_id]={text:t.name+" ("+t.count+")",props:{media_folder:t.slug}}}),e.all={text:"Select a folder >>",props:{media_folder:""},priority:10},e.unassigned={text:"(Unassigned)",props:{media_folder:"-1"},priority:10},this.filters=e;var t=this.filters[this.el.value];t&&this.model.set(t.props)}}),C=0,S=0,I=wp.media.view.AttachmentsBrowser;wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){I.prototype.createToolbar.call(this),this.toolbar.set("MediaLibraryOrganizerTaxonomyFilter",new b({controller:this.controller,model:this.collection.props,priority:-75}).render())}});var P,D=wp.media.model.Query;_.extend(D,{get:(P=[],function(e,t){var o,a={},s=D.orderby,r=D.defaultProps;return delete e.query,delete e.cache,_.defaults(e,r),_.each(["include","exclude"],function(t){e[t]&&!_.isArray(e[t])&&(e[t]=[e[t]])}),_.each(e,function(e,t){_.isNull(e)||(a[D.propmap[t]||t]=e)}),_.defaults(a,D.defaultArgs),a.orderby=s.valuemap[e.orderby]||e.orderby,P=[],o||(o=new D([],_.extend(t||{},{props:e,args:a})),P.push(o)),o})});var N=window.wp;void 0!==N&&"function"==typeof N.Uploader&&(N.media.view.Modal.prototype.on("open",function(){setTimeout(function(){e("#media-attachment-taxonomy-filter").length&&("all"==e("#media-attachment-taxonomy-filter").val()&&(e("#media-attachment-taxonomy-filter option:gt(1)").remove(),_.each(folders_media_options.terms,function(t,o){e("#media-attachment-taxonomy-filter").append("<option value='"+t.term_id+"'>"+t.name+" ("+t.trash_count+")</option>")})),e("#wcp-content").length||e(".editor-post-featured-image").length&&e(".attachment-filters").val("all").trigger("change"))},100)}),e.extend(N.Uploader.prototype,{progress:function(){},init:function(){this.uploader&&(this.uploader.bind("FileFiltered",function(t,o){C++,e(".folder-meter").css("width","0%"),e(".media-folder-loader").show(),e("#total_upload_files").text(C)}),this.uploader.bind("BeforeUpload",function(t,o){var a=s,r=t.settings.multipart_params;if((a=parseInt(a))>0&&(r.folder_for_media=a),S<C){e(".media-folder-loader").show();var d=S/C*100;e(".folder-meter").css("width",d+"%")}S++,e("#current_upload_files").text(S)}),this.uploader.bind("UploadComplete",function(e,t){s=-1}),this.uploader.bind("UploadComplete",function(t,o){var a=window.wp;e(".folder-meter").css("width","100%"),setTimeout(function(){e(".media-folder-loader").hide(),e(".folder-meter").css("width","0%"),C=0,S=0},1250),function(){e("#media-attachment-taxonomy-filter").val();A=e.ajax({url:folders_media_options.ajax_url,data:"type=attachment&action=wcp_get_default_list&active_id=0",method:"post",beforeSend:function(){null!=A&&A.abort()},success:function(t){var t=e.parseJSON(t);w=t.taxonomies,Y(),T()}})}(),void 0!==a.media.frame&&null!==a.media.frame.content.get()?(a.media.frame.content.get().collection.props.set({ignore:+new Date}),a.media.frame.content.get().options.selection.reset()):e("#media-attachment-taxonomy-filter").length&&e(".attachment-filters").each(function(){e(this).trigger("change")})}))}}));var A,O=window.wp;if(void 0!==O&&"function"==typeof O.Uploader){var U=window.wp.media,J=U.view.Modal;U.view.Modal=U.view.Modal.extend({className:"folder-modal",initialize:function(){J.prototype.initialize.apply(this,arguments)},open:function(){J.prototype.open.apply(this,arguments)&&(e(".folder-modal").length||e(".supports-drag-drop").length&&e(".supports-drag-drop").each(function(){"block"!=e(this).css("display")&&"inline-block"!=e(this).css("display")||(console.log("class added"),e(this).addClass("folder-modal"))}),e(".folder-modal").length?(e(".folder-custom-menu").remove(),e(".folder-modal .media-frame-tab-panel").removeClass("has-folder-menu"),e(".folder-modal .media-frame").hasClass("hide-menu")?e(".folder-custom-menu").length||(e(".folder-modal .media-frame-tab-panel").before("<div class='folder-custom-menu'><div class='folder-menu-content'><div class='cssload-container'><div class='cssload-tube-tunnel'></div></div></div></div>"),e(".folder-modal .folder-menu-content").load(folders_media_options.media_page_url+" #wcp-content-resize",function(){R(),H()})):e(".folder-custom-menu").length||(e(".folder-modal .media-frame-menu").addClass("has-folder-menu"),e(".folder-modal .media-frame-menu .media-menu").append("<div class='folder-custom-menu'><div class='folder-menu-content'><div class='cssload-container'><div class='cssload-tube-tunnel'></div></div></div></div>"),e(".folder-modal .folder-menu-content").load(folders_media_options.media_page_url+" #wcp-content-resize",function(){R(),H()})),e(".folder-form-data").remove(),e(".media-frame-tab-panel:first").before("<div class='folder-form-data'></div>"),e(".folder-form-data").load(folders_media_options.media_page_url+" #folder-add-update-content",function(){})):setTimeout(function(){-1!=s&&e("#media-attachment-taxonomy-filter").each(function(){e(this).val(s),e(this).trigger("change")})},1e3))},close:function(){J.prototype.close.apply(this,arguments),e(".folder-modal").removeClass("folder-modal")}})}function T(){e(".jstree-anchor:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){r=e(this).closest("li.jstree-node").attr("id"),o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),m=F(r,"nonce"),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?z():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,m=F(r,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?z():(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,m=F(r,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),f=chkStr,e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(e){z(),Z()}}))}}),e(".media-frame:not(.hide-router) .attachments-browser li.attachment:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,o){e(".selected-items").remove();var a=e(".media-frame:not(.hide-router) .attachments-browser li.attachment.selected").length;return e("<div class='selected-items'><span class='total-post-count'>"+(a=0==a||1==a?"1 Item":a+" Items")+" Selected</span></div>")},start:function(t,o){e("body").addClass("no-hover-css")},cursor:"move",appendTo:".media-modal",cursorAt:{left:0,top:0},stop:function(t,o){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}}),e(".un-categorised-items").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){r=-1,m=folders_media_options.nonce,o.draggable.hasClass("wcp-move-multiple")?e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:folders_media_options.ajax_url,data:"post_id="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_remove_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(e){z()}})):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,chkStr=postID+",",e(".wp-list-table input:checked").each(function(){postID!=e(this).val()&&(chkStr+=e(this).val()+",")}),e.ajax({url:folders_media_options.ajax_url,data:"post_id="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_remove_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(e){z()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),f=chkStr,e.ajax({url:folders_media_options.ajax_url,data:"post_id="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_remove_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(e){z()}}))}}),e(".tree-structure .folder-item:not(.ui-droppable)").droppable({accept:".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",hoverClass:"wcp-drop-hover-list",classes:{"ui-droppable-active":"ui-state-highlight"},drop:function(t,o){e("body").removeClass("no-hover-css"),r=e(this).data("id"),o.draggable.hasClass("wcp-move-multiple")?(m=F(r,"nonce"),e(".wp-list-table input:checked").length&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(e){z(),Z()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,m=F(r,"nonce"),chkStr=postID+",",e(".wp-list-table input:checked").each(function(){e(this).val()!=postID&&(chkStr+=e(this).val()+",")}),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(e){z(),Z()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,m=F(r,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),e.ajax({url:folders_media_options.ajax_url,data:"post_ids="+chkStr+"&type="+folders_media_options.post_type+"&action=wcp_change_multiple_post_folder&folder_id="+r+"&nonce="+m+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+u,method:"post",success:function(e){z(),Z()}}))}}),e(".wcp-move-file:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:"clone",cursor:"move",start:function(t,o){e(this).closest("td").addClass("wcp-draggable"),e("body").addClass("no-hover-css")},stop:function(t,o){e(this).closest("td").removeClass("wcp-draggable"),e("body").removeClass("no-hover-css")}}),e(".wcp-move-multiple:not(.ui-draggable)").draggable({revert:"invalid",containment:"document",helper:function(t,o){return e(".selected-items").remove(),selectedItems=e("#the-list th input:checked").length,selectedItems>0?(selectedItems=0==selectedItems||1==selectedItems?"1 Item":selectedItems+" Items",e("<div class='selected-items'><span class='total-post-count'>"+selectedItems+" Selected</span></div>")):e("<div class='selected-items'><span class='total-post-count'>Select Items to move</span></div>")},start:function(t,o){e("body").addClass("no-hover-css")},cursor:"move",cursorAt:{left:0,top:0},stop:function(t,o){e(".selected-items").remove(),e("body").removeClass("no-hover-css")}})}function H(){e(o).jstree({core:{cache:!1,animation:0,check_callback:function(t,o,a,s,r){if(e("*").removeClass("drag-bot").removeClass("drag-in").removeClass("drag-up"),("move_node"===t||"copy_node"===t)&&r&&r.dnd)switch(r.pos){case"a":r.origin.get_node(r.ref,!0).addClass("drag-bot"),nodeId=e(".drag-bot").attr("id"),e("#jstree-dnd").text("Below "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"i":r.origin.get_node(r.ref,!0).addClass("drag-in"),nodeId=e(".drag-in").attr("id"),e("#jstree-dnd").text("Inside "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;case"b":r.origin.get_node(r.ref,!0).addClass("drag-up"),nodeId=e(".drag-up").attr("id"),e("#jstree-dnd").text("Above "+e.trim(e("#js-tree-menu").jstree(!0).get_node(nodeId).text));break;default:e("#jstree-dnd").text(e("#jstree-dnd").data("txt"))}return!0}},data:{cache:!1},select_node:!1,search:{show_only_matches:!0,case_sensitive:!1,fuzzy:!1},plugins:["dnd","search","contextmenu"],contextmenu:{select_node:0,show_at_node:0,items:function(){return{}}}}).bind("ready.jstree",function(){!function(){e("#js-tree-menu .jstree-node").each(function(){var t=parseInt(e(this).data("count"));t>0&&e(".jstree-node[id='"+e(this).attr("id")+"'] > a span.premio-folder-count").text(t)}),""!=u&&0!=u&&e(".jstree-node[id='"+u+"']").length&&(e("#js-tree-menu").jstree("select_node",u),e(".sticky-folders .sticky-folder-"+u+" a").length&&e(".sticky-folders .sticky-folder-"+u+" a").addClass("active-item"));e(".ajax-preloader").hide(),e(".js-tree-data").show(),V(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active")}(),T()}).bind("after_open.jstree",function(){T()}).bind("open_all.jstree",function(){T()}).bind("create_node.jstree",function(){T()}).bind("delete_node.jstree",function(){T()}).bind("close_all.jstree",function(){T()}).bind("after_close.jstree",function(){T()}).bind("move_node.jstree",function(t,o){folderMoveId=o.node.id,orderString="",e(".folder-modal .jstree-node[id='"+folderMoveId+"']").closest("ul").children().each(function(){"undefined"!=e(this).attr("id")&&(orderString+=e(this).attr("id")+",")}),e(".folder-modal #"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?parentID=e("#"+folderMoveId+"_anchor").closest(".jstree-node").parent().parent().attr("id"):parentID=0,""!=orderString&&(e(".form-loader-count").css("width","100%"),e.ajax({url:folders_media_options.ajax_url,data:"term_ids="+orderString+"&action=wcp_save_folder_order&type="+folders_media_options.post_type+"&nonce="+folders_media_options.nonce+"&term_id="+folderMoveId+"&parent_id="+parentID,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#wcp_folder_parent").html(t.options),e(".form-loader-count").css("width","0"),z(),Z(),Y(),T()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))}),T()}function F(e,t){if(a.length>0)for(i=0;i<a.length;i++)if(parseInt(a[i].folder_id)==parseInt(e))return a[i][t];return""}function M(e){if(a.length>0)for(i=0;i<a.length;i++)if(parseInt(a[i].folder_id)==parseInt(e))return i;return null}function V(){e(".sticky-folders > ul").html("");var t="";if(e("#js-tree-menu li.jstree-node.is-sticky").each(function(){var o=e(this).attr("id"),a=e.trim(e("#js-tree-menu").jstree(!0).get_node(o).text),s=(e("#"+o+"_anchor .premio-folder-count").text(),e("li.jstree-node[id='"+o+"']").hasClass("is-high")?" is-high ":"");t+="<li data-folder-id='"+o+"' class='sticky-fldr "+s+" sticky-folder-"+o+"'><a href='javascript:;'><span class='folder-title'>"+a+"</span><span class='folder-actions'><span class='update-inline-record'><i class='pfolder-edit-folder'></i></span><span class='star-icon'><i class='pfolder-star'></i></span><span class='premio-folder-count'></span></span></a></li>"}),e(".sticky-folders > ul").html(t),e(".jstree-anchor.jstree-clicked").length){var o=e(".jstree-anchor.jstree-clicked").closest("li.jstree-node").attr("id");e(".sticky-folders .sticky-folder-"+o+" a").addClass("active-item")}e(".sticky-folders > ul > li").length>0?e(".sticky-folders").addClass("active"):e(".sticky-folders").removeClass("active")}function z(){if(e(".media-toolbar").hasClass("media-toolbar-mode-select")&&e("ul.attachments li.selected").length&&(e("ul.attachments li.selected").trigger("click"),e(".select-mode-toggle-button").trigger("click")),""!=f&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==u)){if(e("#media-attachment-taxonomy-filter").length){f=f.split(",");for(var t=0;t<f.length;t++)""!=f[t]&&e(".attachments-browser li[data-id='"+f[t]+"']").remove()}f=""}e("#media-attachment-taxonomy-filter").length?Q(0):(e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=get_folders_default_list",method:"post",success:function(t){t=e.parseJSON(t),e(".header-posts .total-count").text(t.total_items),e(".un-categorised-items .total-count").text(t.empty_items),w=t.taxonomies,Y(),T()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(p+" #posts-filter",function(){var t={Title:"",Url:p};history.pushState(t,t.Title,t.Url),"show"!=folders_media_options.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>'),triggerInlineUpdate()}):e("#wpbody").load(p+" #wpbody-content",!1,function(t){var o={Title:"",Url:p};history.pushState(o,o.Title,o.Url),"show"!=folders_media_options.show_in_page||e(".tree-structure").length||e(".wp-header-end").before('<div class="tree-structure-content"><div class="tree-structure"><ul></ul><div class="clear clearfix"></div></div></div>')}))}function Y(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){folders_media_options.terms=w;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),w;for(var o=0;o<w.length;o++)t.append("<option value='"+w[o].term_id+"'>"+w[o].name+" ("+w[o].trash_count+")</option>");t.val(currentDDVal).trigger("change")}),e("select.folder_for_media").length)){var t=e("select.folder_for_media").val();e("select.folder_for_media option:not(:first-child):not(:last-child)").remove();for(var o=0;o<w.length;o++)e("select.folder_for_media option:last-child").before("<option value='"+w[o].term_id+"'>"+w[o].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),o=0;o<w.length;o++)0!=parseInt(w[o].trash_count)&&(e(".jstree-node[id='"+w[o].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(w[o].trash_count),e(".sticky-folder-"+w[o].term_id+" .premio-folder-count").text(w[o].trash_count));""!=u&&e("#wcp_folder_"+u).addClass("active-item"),v&&(e("#title_"+d).trigger("click"),v=!1)}function q(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function B(t){var o="Are you sure you want to delete the selected folder?",a="Items in the folder will not be deleted.";if(h=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(h=!0,0==e("#js-tree-menu input.checkbox:checked").length)return e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html("Please select at least one folder to delete"),void e("#error-folder-popup").show();e("#js-tree-menu input.checkbox:checked").length>1&&(o="Are you sure you want to delete the selected folders?",a="Items in the selected folders will not be deleted.")}e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#remove-folder-item").text("Yes, Delete it!"),e("#remove-folder-message").text(o),e("#remove-folder-notice").text(a),e("#confirm-remove-folder").show(),e("#remove-folder-item").focus()}function E(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(d).text),parentID=e("#wcp_folder_"+d).closest("li.jstree-node").data("folder-id"),parentID==t&&(parentID=0),e("#update-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#update-folder-item-name").val(folderName),e("#update-folder-item").removeClass("disabled"),e("#update-folder-item").show(),e("#update-folder-item-name").focus(),e(".dynamic-menu").remove()}function X(){if(0==c&&n>=10)return e("#folder-limitation-message").html("You've reached the 10 folder limitation!"),e("#no-more-folder-credit").show(),!1;e("#add-update-folder-title").text("Add new folder"),e("#save-folder-data").text("Submit"),e(".folder-form-errors").removeClass("active"),e("#add-update-folder-name").val(""),g&&(y=d,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(d).text)+" #2"),d=e("#"+d+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+d+"_anchor").closest(".jstree-node").parent().parent().attr("id"):0),e("#add-update-folder").removeClass("disabled"),e("#add-update-folder").show(),e("#add-update-folder-name").focus(),e(".dynamic-menu").remove()}function R(){setTimeout(function(){if(e("#js-tree-menu .jstree-node.jstree-leaf").length==e("#js-tree-menu .jstree-node").length)e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand");else{var t=e("#js-tree-menu .jstree-node.jstree-closed").length+e("#js-tree-menu .jstree-node.jstree-open").length;e("#js-tree-menu .jstree-node.jstree-closed").length==t?(e("#expand-collapse-list").removeClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Expand")):(e("#expand-collapse-list").addClass("all-open"),e("#expand-collapse-list").attr("data-folder-tooltip","Collapse"))}},500),T()}function Q(o){A=e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_get_default_list&active_id="+u,method:"post",beforeSend:function(){null!=A&&A.abort()},success:function(a){if(a=e.parseJSON(a),e(".header-posts .total-count").text(a.total_items),e(".un-categorised-items .total-count").text(a.empty_items),selectedVal=e("#media-attachment-taxonomy-filter").val(),"all"!=selectedVal&&1==o){var s=parent.wp;s.media!=t&&(s.media.frame.setState("insert"),null!==s.media.frame.content.get()?(s.media.frame.content.get().collection.props.set({ignore:+new Date}),s.media.frame.content.get().options.selection.reset()):s.media.frame.library.props.set({ignore:+new Date}))}w=a.taxonomies,Y(),T()}})}function Z(){e(".folder-loader-ajax").addClass("active"),e(".folder-loader-ajax img").removeClass("active"),e(".folder-loader-ajax svg#successAnimation").addClass("active").addClass("animated"),setTimeout(function(){e(".folder-loader-ajax").removeClass("active"),e(".folder-loader-ajax img").addClass("active"),e(".folder-loader-ajax svg#successAnimation").removeClass("active").removeClass("animated")},2e3),T()}e(document).ready(function(){e(document).ajaxComplete(function(e,o,a){a.data!=t&&""!=a.data&&-1!=a.data.indexOf("action=query-attachments")&&T()}),w=folders_media_options.terms,c=parseInt(folders_media_options.is_key_active),n=parseInt(folders_media_options.folders),a=folders_media_options.folder_settings,e(document).on("click",".header-posts a.all-posts",function(t){d=0,u="",s="all",e(".active-item").removeClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e(this).addClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(this).closest(".media-frame").find("#media-attachment-taxonomy-filter").val("all").trigger("change"),e(this).closest(".media-frame").find(".folder_for_media").val("all").trigger("change")}),e(document).on("click",".un-categorised-items",function(t){d=0,u="",s="unassigned",e(".active-item").removeClass("active-item"),e(".sticky-folders .active-item").removeClass("active-item"),e(".jstree-clicked").removeClass("jstree-clicked"),e(this).addClass("active-item"),e(this).closest(".media-frame").find("#media-attachment-taxonomy-filter").val("unassigned").trigger("change"),e(this).closest(".media-frame").find(".folder_for_media").val("-1").trigger("change")}),e(document).on("click","a.jstree-anchor",function(t){var o,a=e(this).closest("li.jstree-node").attr("id");s=d=a,e(this).closest(".folder-modal").find(".active-item").removeClass("active-item"),e(this).closest(".folder-modal").find("#media-attachment-taxonomy-filter").val(a),e(this).closest(".folder-modal").find("#media-attachment-taxonomy-filter").trigger("change"),thisSlug=F(a,"slug"),o=thisSlug,e.ajax({url:folders_media_options.ajax_url,type:"post",data:"action=save_folder_last_status&post_type="+folders_media_options.post_type+"&post_id="+o+"&nonce="+folders_media_options.nonce,cache:!1,async:!1,success:function(){}}),e(".custom-media-select").removeClass("active")}),e(document).on("change",".folder_for_media",function(){"add-folder"!=e(this).val()&&null!=e(this).val()?s=e(this).val():"add-folder"==e(this).val()&&(s=-1)}),e(document).on("click",".update-inline-record",function(o){var a;(o.stopImmediatePropagation(),o.stopPropagation(),0!=folders_media_options.can_manage_folder)&&(isHigh=e(this).closest("li.sticky-fldr").hasClass("is-high"),isSticky=e(this).closest("li.sticky-fldr").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu' data-id='"+e(this).closest("li").data("folder-id")+"'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("li.jstree-node").find("h3.title:first > .total-count").text()),"attachment"==folders_media_options.post_type&&hasPosts&&(menuHtml+="<li class='download-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e("body").append(menuHtml),o.pageX==t||o.pageY==t?(e(".dynamic-menu").css("left",k),e(".dynamic-menu").css("top",x-10),a=x):(e(".dynamic-menu").css("left",o.pageX),e(".dynamic-menu").css("top",o.pageY),a=o.pageY),a+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(a+e(".dynamic-menu").height())))}),e(document).on("click","body, html",function(t){e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),e(".folder-order").removeClass("active")}),e(document).on("click",".dynamic-menu, .folder-order",function(e){e.stopPropagation()}),e(document).on("contextmenu",".jstree-anchor",function(t){return k=t.pageX,x=t.pageY,e(this).find("span.folder-inline-edit").trigger("click"),!1}),e(document).on("click",".folder-actions span.folder-inline-edit",function(o){var a;(o.stopImmediatePropagation(),o.stopPropagation(),0!=folders_media_options.can_manage_folder)&&(isHigh=e(this).closest("li.jstree-node").hasClass("is-high"),isSticky=e(this).closest("li.jstree-node").hasClass("is-sticky"),isStickyClass=!!isSticky,e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),menuHtml="<div class='dynamic-menu' data-id='"+e(this).closest("li").prop("id")+"'><ul><li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span> New Folder</a></li><li class='rename-folder'><a href='javascript:;'><span class=''><i class='pfolder-edit'></i></span> Rename</a></li><li class='sticky-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='sticky-pin'><i class='pfolder-pin'></i></span>Sticky Folder (Pro)</a></li><li class='mark-folder'><a href='javascript:;'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?" Remove Star":"Add a Star")+"</a></li><li class='duplicate-folder'><a href='javascript:;'><span class=''><i class='pfolder-clone'></i></span> Duplicate folder</a></li>",hasPosts=parseInt(e(this).closest("a.jstree-anchor").find(".premio-folder-count").text()),"attachment"==folders_media_options.post_type&&hasPosts&&(menuHtml+="<li class='download-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-zip-file'></i></span> Download Zip (Pro)</a></li>"),menuHtml+="<li class='remove-folder'><a href='javascript:;'><span class=''><i class='pfolder-remove'></i></span> Delete</a></li></ul></div>",e("body").append(menuHtml),e(this).parents("li.jstree-node").addClass("active-menu"),o.pageX==t||o.pageY==t?(e(".dynamic-menu").css("left",k),e(".dynamic-menu").css("top",x-10),a=x):(e(".dynamic-menu").css("left",o.pageX),e(".dynamic-menu").css("top",o.pageY),a=o.pageY),a+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(a+e(".dynamic-menu").height())))}),e(document).on("click",".dynamic-menu",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click","body, html",function(){e(".dynamic-menu").remove()}),e(document).on("click",".new-folder",function(t){t.stopPropagation(),d=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),v=!1,g=!1,X()}),e(document).on("click","#add-new-folder",function(t){d=e("#custom-menu li.active-item").length?e("#custom-menu li.active-item").data("folder-id"):0,v=!1,X()}),e(document).on("submit","#save-folder-form",function(t){if(t.stopPropagation(),t.preventDefault(),l=e("#add-update-folder-name").val(),""==e.trim(l))e(".folder-form-errors").addClass("active"),e("#add-update-folder-name").focus();else{e("#save-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#add-update-folder").addClass("disabled");var o=d;v&&(o=0),j=0==o?e("#js-tree-menu > ul > li.jstree-node").length:e("#js-tree-menu > ul > li.jstree-node[id='"+o+"'] > ul.jstree-children > li").length+1,e.ajax({url:folders_media_options.ajax_url,data:{parent_id:o,type:folders_media_options.post_type,action:"wcp_add_new_folder",nonce:folders_media_options.nonce,term_id:o,order:j,name:l,is_duplicate:g,duplicate_from:y},method:"post",success:function(t){if(result=e.parseJSON(t),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),-1==result.status)e("#no-more-folder-credit").show();else if("1"==result.status){if(c=parseInt(result.is_key_active),n=parseInt(result.folders),e("#current-folder").text(n),e("#ttl-fldr").text(10),R(),result.data.length)for(var o=0;o<result.data.length;o++){var s={folder_id:result.data[o].term_id,folder_count:0,is_sticky:result.data[o].is_sticky,is_high:result.data[o].is_high,nonce:result.data[o].nonce,slug:result.data[o].slug,is_deleted:0};a.push(s),e("#js-tree-menu").jstree().create_node(result.parent_id,{id:result.data[o].term_id,text:" "+result.data[o].title},"last",function(){e(".jstree-node[id='"+result.data[o].term_id+"']").attr("data-nonce",result.data[o].nonce),e(".jstree-node[id='"+result.data[o].term_id+"']").attr("data-slug",result.data[o].slug)})}Z(),V(),d=result.term_id,Q(0)}else e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show()}})}return!1}),e(document).on("click",".form-cancel-btn",function(){e(".folder-popup-form").hide()}),e(document).on("click",".folder-popup-form",function(t){e(".folder-popup-form").hide()}),e(document).on("click",".popup-form-content",function(e){e.stopPropagation()}),document.onkeydown=function(t){("key"in(t=t||window.event)?"Escape"===t.key||"Esc"===t.key:27===t.keyCode)&&e(".folder-popup-form").hide()},e(document).on("click",".rename-folder",function(t){t.stopPropagation(),d=e(this).closest(".dynamic-menu").data("id"),E(),e(".dynamic-menu").remove()}),e(document).on("click","#inline-update",function(t){e("#js-tree-menu a.jstree-clicked").length&&(d=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),E())}),e(document).on("submit","#update-folder-form",function(o){return o.stopPropagation(),o.preventDefault(),l=e("#update-folder-item-name").val(),""==e.trim(l)?(e(".folder-form-errors").addClass("active"),e("#update-folder-item-name").focus()):(e("#update-folder-data").html('<span class="dashicons dashicons-update"></span>'),e("#update-folder-item").addClass("disabled"),m=F(d,"nonce"),parentID=e(".jstree-node[id='"+d+"']").closest("li.jstree-node").attr("id"),parentID==t&&(parentID=0),e.ajax({url:folders_media_options.ajax_url,data:{parent_id:parentID,type:folders_media_options.post_type,action:"wcp_update_folder",nonce:m,term_id:d,order:j,name:l},method:"post",success:function(t){result=e.parseJSON(t),"1"==result.status?(e("#js-tree-menu").jstree("rename_node",result.id," "+result.term_title),folderPostId=M(result.id),null!=folderPostId&&(a[folderPostId].nonce=result.nonce,a[folderPostId].slug=result.slug),e(".folder-popup-form").hide(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),Z(),e("#media-attachment-taxonomy-filter").length&&Q(0)):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(result.message),e("#error-folder-popup").show())}})),!1}),e(document).on("click",".mark-folder",function(t){t.stopPropagation(),r=e(this).closest(".dynamic-menu").data("id"),m=F(r,"nonce"),e(".form-loader-count").css("width","100%"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),e.ajax({url:folders_media_options.ajax_url,data:"term_id="+r+"&type="+folders_media_options.post_type+"&action=wcp_mark_un_mark_folder&nonce="+m,method:"post",cache:!1,success:function(t){t=e.parseJSON(t),e(".form-loader-count").css("width","0%"),"1"==t.status?(folderPostId=M(t.id),"1"==t.marked?(e("li.jstree-node[id='"+t.id+"']").addClass("is-high"),e(".sticky-folder-"+t.id).addClass("is-high"),null!=folderPostId&&(a[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(a[folderPostId].is_high=0)),Z()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})}),e(document).on("click",".duplicate-folder",function(t){t.stopPropagation(),d=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),v=!1,g=!0,X()}),e(document).on("click",".remove-folder",function(){r=e(this).closest(".dynamic-menu").data("id"),d=e(this).closest(".dynamic-menu").data("id"),B(0),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")}),e(document).on("click","#remove-folder-item",function(t){t.stopPropagation(),e(".folder-popup-form").addClass("disabled"),e("#remove-folder-item").html('<span class="dashicons dashicons-update"></span>'),m=F(d,"nonce"),h?function(){if(e("#folder-hide-show-checkbox").is(":checked")&&e("#js-tree-menu input.checkbox:checked").length>0){var t="";e("#js-tree-menu input.checkbox:checked").each(function(){t+=e(this).closest("li.jstree-node").attr("id")+",",e(this).closest("li.jstree-node").hasClass("jstree-clicked")&&!0}),e(".form-loader-count").css("width","100%"),e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_remove_muliple_folder&term_id="+t+"&nonce="+folders_media_options.nonce,method:"post",success:function(t){if(t=e.parseJSON(t),e(".form-loader-count").css("width","0px"),"1"==t.status){for(c=parseInt(t.is_key_active),n=parseInt(t.folders),e("#current-folder").text(n),i=0;i<t.term_ids.length;i++)e(".folder-modal #js-tree-menu").jstree().delete_node(t.term_ids[i]);e("#ttl-fldr").text(10),Z(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),z(),V(),Z(),e(".folder-modal #wcp_folder_"+u).length||(e(".header-posts a").trigger("click"),u=0)}else window.location.reload();e("#folder-hide-show-checkbox").attr("checked",!1),e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox")}})}}():e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_remove_folder&term_id="+d+"&nonce="+m,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(d),c=parseInt(t.is_key_active),n=parseInt(t.folders),e("#current-folder").text(n),e("#ttl-fldr").text(10),e(".sticky-folders .sticky-folder-"+d).remove(),Z(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),z(),V(),u==d&&e(".header-posts").trigger("click")):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}})}),e(document).on("click","#sort-order-list",function(t){t.stopPropagation(),e(".folder-order").toggleClass("active")}),e(document).on("click","#expand-collapse-list",function(t){t.stopPropagation();var o=0;e(this).hasClass("all-open")?(e(this).removeClass("all-open"),o=0,e(this).attr("data-folder-tooltip","Expand"),e("#js-tree-menu").jstree("close_all")):(e(this).addClass("all-open"),o=1,e(this).attr("data-folder-tooltip","Collapse"),e("#js-tree-menu").jstree("open_all")),f="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){f+=e(this).attr("id")+","}),""!=f&&(e(".form-loader-count").css("width","100%"),m=folders_media_options.nonce,e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_change_all_status&status="+o+"&folders="+f+"&nonce="+m,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status&&(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show(),window.location.reload(!0))}}))}),e(document).on("click",".folder-sort-menu a",function(t){t.stopPropagation(),t.preventDefault(),e(".form-loader-count").css("width","100%"),e(".folder-order").removeClass("active"),e(this).attr("data-sort"),e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_folders_by_order&nonce="+folders_media_options.nonce+"&order="+e(this).attr("data-sort"),method:"post",success:function(t){1==(t=e.parseJSON(t)).status&&(e("#js-tree-menu").jstree().destroy(),e("#js-tree-menu").append("<ul></ul>"),e("#js-tree-menu ul").html(t.data),w=t.terms,Y(),H()),e(".form-loader-count").css("width","0")}})}),e(document).on("click",".jstree-node .jstree-icon",function(){r=e(this).closest("li.jstree-node").attr("id"),e("li.jstree-node[id='"+r+"']").hasClass("jstree-open")?folderStatus=0:folderStatus=1,e(".form-loader-count").css("width","100%"),m=F(r,"nonce"),R(),e.ajax({url:folders_media_options.ajax_url,data:"is_active="+folderStatus+"&action=save_wcp_folder_state&term_id="+r+"&nonce="+m,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status||(e("#wcp_folder_"+r).hasClass("active")?(e("#wcp_folder_"+r).removeClass("active"),e("#wcp_folder_"+r).find("ul.ui-sortable:first-child > li").slideUp(),folderStatus=0):(e("#wcp_folder_"+r).addClass("active"),e("#wcp_folder_"+r).find("ul.ui-sortable:first-child > li").slideDown(),folderStatus=1),Z())}})}),e(document).on("keyup","#folder-search",function(){q()}),e(document).on("change","#folder-search",function(){q()}),e(document).on("blur","#folder-search",function(){q()}),e(document).on("click","#folder-hide-show-checkbox",function(){e(this).is(":checked")?e("#js-tree-menu").addClass("show-folder-checkbox"):(e("#js-tree-menu input.checkbox").attr("checked",!1),e("#js-tree-menu").removeClass("show-folder-checkbox"))}),e(document).on("click",".folder-checkbox, .input-checkbox",function(e){e.stopImmediatePropagation(),e.stopPropagation()}),e(document).on("click","#inline-remove",function(){e("#js-tree-menu a.jstree-clicked").length?(d=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),B(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),B(1))}),e(document).on("change",".folder_for_media",function(){"add-folder"==e(this).val()&&(v=!0,e("#add-new-folder").trigger("click"))}),T()})});
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.6.4
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  * Text Domain: folders
@@ -30,7 +30,7 @@ if(!defined("WCP_FOLDER_URL")) {
30
  define('WCP_FOLDER_URL', plugin_dir_url(__FILE__));
31
  }
32
  if(!defined("WCP_FOLDER_VERSION")) {
33
- define('WCP_FOLDER_VERSION', "2.6.4");
34
  }
35
 
36
 
2
  /**
3
  * Plugin Name: Folders
4
  * Description: Arrange media, pages, custom post types and posts into folders
5
+ * Version: 2.6.5
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  * Text Domain: folders
30
  define('WCP_FOLDER_URL', plugin_dir_url(__FILE__));
31
  }
32
  if(!defined("WCP_FOLDER_VERSION")) {
33
+ define('WCP_FOLDER_VERSION', "2.6.5");
34
  }
35
 
36
 
includes/folders.class.php CHANGED
@@ -1003,7 +1003,7 @@ class WCP_Folders
1003
  'nonce' => wp_create_nonce('wcp_folder_nonce_attachment'),
1004
  'is_key_active' => $is_active,
1005
  'folders' => $folders,
1006
- 'upgrade_url' => admin_url('admin.php?page=wcp_folders_upgrade'),
1007
  'post_type' => 'attachment',
1008
  'page_url' => $admin_url,
1009
  'current_url' => "",
@@ -2895,6 +2895,7 @@ class WCP_Folders
2895
  $selected_taxonomy = $term->term_id;
2896
  } else {
2897
  $selected_taxonomy = "";
 
2898
  }
2899
  }
2900
  $customize_folders = get_option('customize_folders');
@@ -2922,7 +2923,7 @@ class WCP_Folders
2922
  $response['terms'] = $taxonomies;
2923
  wp_localize_script('wcp-folders-custom', 'wcp_settings', array(
2924
  'ajax_url' => admin_url('admin-ajax.php'),
2925
- 'upgrade_url' => admin_url('admin.php?page=wcp_folders_upgrade'),
2926
  'post_type' => $typenow,
2927
  'page_url' => $admin_url,
2928
  'current_url' => $current_url,
@@ -3055,7 +3056,7 @@ class WCP_Folders
3055
  if(isset($customize_folders['show_folder_in_settings']) && $customize_folders['show_folder_in_settings'] == "yes") {
3056
  return admin_url("options-general.php?page=wcp_folders_settings&setting_page=upgrade-to-pro");
3057
  } else {
3058
- return admin_url("admin.php?page=wcp_folders_settings");
3059
  }
3060
  }
3061
 
1003
  'nonce' => wp_create_nonce('wcp_folder_nonce_attachment'),
1004
  'is_key_active' => $is_active,
1005
  'folders' => $folders,
1006
+ 'upgrade_url' => $this->getFoldersUpgradeURL(),
1007
  'post_type' => 'attachment',
1008
  'page_url' => $admin_url,
1009
  'current_url' => "",
2895
  $selected_taxonomy = $term->term_id;
2896
  } else {
2897
  $selected_taxonomy = "";
2898
+ $selected_taxonomy = "";
2899
  }
2900
  }
2901
  $customize_folders = get_option('customize_folders');
2923
  $response['terms'] = $taxonomies;
2924
  wp_localize_script('wcp-folders-custom', 'wcp_settings', array(
2925
  'ajax_url' => admin_url('admin-ajax.php'),
2926
+ 'upgrade_url' => $this->getFoldersUpgradeURL(),
2927
  'post_type' => $typenow,
2928
  'page_url' => $admin_url,
2929
  'current_url' => $current_url,
3056
  if(isset($customize_folders['show_folder_in_settings']) && $customize_folders['show_folder_in_settings'] == "yes") {
3057
  return admin_url("options-general.php?page=wcp_folders_settings&setting_page=upgrade-to-pro");
3058
  } else {
3059
+ return admin_url("admin.php?page=folders-upgrade-to-pro");
3060
  }
3061
  }
3062
 
includes/media.replace.php CHANGED
@@ -202,7 +202,7 @@ class folders_replace_media {
202
  mkdir($upload_path, 755, true);
203
  }
204
  if (is_dir($upload_path)) {
205
- $file_name = uniqid()."-".$file['name'];
206
  $upload_file = $upload_path . DIRECTORY_SEPARATOR . $file_name;
207
  $status = move_uploaded_file($new_file, $upload_file);
208
 
@@ -251,6 +251,19 @@ class folders_replace_media {
251
  }
252
  }
253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
  public $replace_items = array();
255
 
256
  public function removeThumbImages() {
202
  mkdir($upload_path, 755, true);
203
  }
204
  if (is_dir($upload_path)) {
205
+ $file_name = $this->checkForFileName($file['name'], $upload_path.DIRECTORY_SEPARATOR);
206
  $upload_file = $upload_path . DIRECTORY_SEPARATOR . $file_name;
207
  $status = move_uploaded_file($new_file, $upload_file);
208
 
251
  }
252
  }
253
 
254
+ public function checkForFileName($fileName, $filePath, $postFix = 0) {
255
+ $new_file_name = $fileName;
256
+ if(!empty($postFix)) {
257
+ $file_array = explode(".", $fileName);
258
+ $file_ext = array_pop($file_array);
259
+ $new_file_name = implode(".", $file_array)."-".$postFix.".".$file_ext;
260
+ }
261
+ if(!file_exists($filePath.$new_file_name)) {
262
+ return $new_file_name;
263
+ }
264
+ return $this->checkForFileName($fileName, $filePath, ($postFix+1));
265
+ }
266
+
267
  public $replace_items = array();
268
 
269
  public function removeThumbImages() {
includes/plugins.class.php CHANGED
@@ -1,529 +1,564 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- /* Free/Pro Class name change */
4
- class WCP_Folder_Plugins {
5
-
6
- public $plugins = array();
7
- public $post_types = array();
8
- public $is_exists = 0;
9
-
10
- public function __construct() {
11
-
12
- /* Import plugin data */
13
- add_action( 'wp_ajax_wcp_import_plugin_folders_data', array($this, 'import_plugin_folders_data'));
14
- add_action( 'wp_ajax_wcp_remove_plugin_folders_data', array($this, 'remove_plugin_folders_data'));
15
- }
16
-
17
-
18
- public function remove_plugin_folders_data(){
19
- global $wpdb;
20
- $postData = filter_input_array(INPUT_POST);
21
-
22
- $plugin = isset($postData['plugin']) ? $postData['plugin'] : "";
23
- $nonce = isset($postData['nonce']) ? $postData['nonce'] : "";
24
- $response = array();
25
- $response['status'] = 0;
26
- $response['message'] = esc_html__("Invalid request", "folders");
27
- $response['data'] = array();
28
- $response['data']['plugin'] = $plugin;
29
- if (wp_verify_nonce($nonce, "import_data_from_" . $plugin)) {
30
- $this->get_plugin_information();
31
- $folders = isset($this->plugins[$plugin]['folders']) ? $this->plugins[$plugin]['folders'] : array();
32
- $attachments = isset($this->plugins[$plugin]['attachments']) ? $this->plugins[$plugin]['attachments'] : array();
33
-
34
- if($plugin != 'filebird' && $plugin != 'real-media-library') {
35
- $deleted = [];
36
-
37
- foreach ( $folders as $folder ) {
38
- $term_id = intval( $folder->term_id );
39
-
40
- if ( $term_id ) {
41
- $deleted[$term_id]['term_relationships'] = $wpdb->delete( $wpdb->prefix . 'term_relationships', ['term_taxonomy_id' => $term_id] );
42
- $deleted[$term_id]['term_taxonomy'] = $wpdb->delete( $wpdb->prefix . 'term_taxonomy', ['term_id' => $term_id] );
43
- $deleted[$term_id]['terms'] = $wpdb->delete( $wpdb->prefix . 'terms', ['term_id' => $term_id] );
44
-
45
- if ( $plugin === 'folders' ) {
46
- $deleted[$term_id]['termmeta'] = $wpdb->delete( $wpdb->prefix . 'termmeta', ['term_id' => $term_id] );
47
- }
48
- }
49
- }
50
- } else {
51
-
52
- if ( count( $folders ) ) {
53
- if ( $plugin === 'filebird' ) {
54
- $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'fbv' );
55
- }
56
-
57
- if ( $plugin === 'real-media-library' ) {
58
- $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'realmedialibrary' );
59
-
60
- $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'realmedialibrary_meta' );
61
- }
62
- }
63
-
64
- if ( count( $attachments ) ) {
65
- if ( $plugin === 'filebird' ) {
66
- $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'fbv_attachment_folder' );
67
- }
68
-
69
- if ( $plugin === 'real-media-library' ) {
70
- $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'realmedialibrary_posts' );
71
- }
72
- }
73
- }
74
- $response['status'] = 1;
75
-
76
- }
77
- echo json_encode($response);
78
- exit;
79
- }
80
-
81
- public function checkForLimit($folders) {
82
- $response = array();
83
- $response['status'] = 0;
84
- $response['message'] = esc_html__("Invalid request", "folders");
85
- $response['data'] = array();
86
- $response['data']['plugin'] = array();
87
- if($folders >= 10) {
88
- $response['status'] = -1;
89
- echo json_encode($response);
90
- exit;
91
- }
92
- }
93
-
94
- public function import_plugin_folders_data() {
95
- $postData = filter_input_array(INPUT_POST);
96
-
97
- $plugin = isset($postData['plugin']) ?$postData['plugin']:"";
98
- $nonce = isset($postData['nonce']) ?$postData['nonce']:"";
99
- $response = array();
100
- $response['status'] = 0;
101
- $response['message'] = esc_html__("Invalid request", "folders");
102
- $response['data'] = array();
103
- $response['data']['plugin'] = $plugin;
104
- if(wp_verify_nonce($nonce, "import_data_from_".$plugin)) {
105
- $this->get_plugin_information();
106
- $folders = isset($this->plugins[$plugin]['folders']) ? $this->plugins[$plugin]['folders'] : array();
107
- $attachments = isset($this->plugins[$plugin]['attachments']) ? $this->plugins[$plugin]['attachments'] : array();
108
-
109
- $categoryByID = array();
110
- $foldersImported = array();
111
- $attachmentsImported = array();
112
-
113
- $total_folders = WCP_Folders::get_ttl_fldrs();
114
-
115
- $this->checkForLimit($total_folders);
116
-
117
- if($plugin != 'filebird' && $plugin != 'real-media-library') {
118
-
119
- foreach ($folders as $folder) {
120
- $folder_id = $folder->term_id;
121
- $parent = intval($folder->parent);
122
-
123
- $taxonomy = 'media_folder';
124
-
125
- foreach ($this->post_types as $post_type) {
126
- if (strpos($folder->taxonomy, $post_type) !== false) {
127
- if ($post_type == "post") {
128
- $taxonomy = "post_folder";
129
- } else if ($post_type == "page") {
130
- $taxonomy = "folder";
131
- } else if ($post_type == "attachment") {
132
- $taxonomy = "media_folder";
133
- } else {
134
- $taxonomy = $post_type . '_folder';
135
- }
136
- }
137
- }
138
-
139
- if ($parent && isset($categoryByID[$parent]['term_id'])) {
140
- $parent = intval($categoryByID[$parent]['term_id']);
141
- }
142
-
143
- $new_term = wp_insert_term($folder->name, $taxonomy, ['parent' => $parent]);
144
-
145
- if (is_wp_error($new_term)) {
146
- continue;
147
- }
148
-
149
- $total_folders++;
150
- $this->checkForLimit($total_folders);
151
-
152
- $arg = array(
153
- 'hide_empty' => false,
154
- 'parent' => $parent,
155
- 'hierarchical' => false,
156
- 'update_count_callback' => '_update_generic_term_count',
157
- );
158
- $terms = get_terms( $taxonomy, $arg);
159
- $position = count($terms);
160
-
161
- update_term_meta($new_term['term_id'], 'wcp_custom_order', $position);
162
-
163
- $foldersImported[] = $new_term;
164
-
165
- $categoryByID[$folder_id] = [
166
- 'term_id' => $new_term['term_id'],
167
- 'parent' => $parent,
168
- 'name' => $folder->name,
169
- ];
170
- }
171
-
172
- // STEP: Assign plugin categories to HF categories
173
- foreach ($attachments as $attachment) {
174
- $hf_category_id = isset($categoryByID[$attachment->term_taxonomy_id]['term_id']) ? intval($categoryByID[$attachment->term_taxonomy_id]['term_id']) : 0;
175
- $attachment_id = isset($attachment->object_id) ? intval($attachment->object_id) : 0;
176
-
177
- if (!$hf_category_id || !$attachment_id) {
178
- continue;
179
- }
180
-
181
- // Get attachment taxonomy by post type
182
- $post_type = get_post_type($attachment_id);
183
- if ($post_type == "post") {
184
- $taxonomy = "post_folder";
185
- } else if ($post_type == "page") {
186
- $taxonomy = "folder";
187
- } else if ($post_type == "attachment") {
188
- $taxonomy = "media_folder";
189
- } else {
190
- $taxonomy = $post_type . '_folder';
191
- }
192
-
193
- $term_ids = wp_get_object_terms($attachment_id, $taxonomy, ['fields' => 'ids']);
194
- $term_ids[] = $hf_category_id;
195
-
196
- $term_set = wp_set_object_terms($attachment_id, $term_ids, $taxonomy);
197
-
198
- if (is_wp_error($term_set)) {
199
- continue;
200
- }
201
-
202
- $attachmentsImported[] = [
203
- 'cat_id' => $hf_category_id,
204
- 'term_ids' => $term_ids,
205
- 'set' => $term_set,
206
- ];
207
- }
208
- } else {
209
- foreach ( $folders as $folder ) {
210
- $parent = intval( $folder->parent );
211
- $parentID = 0;
212
-
213
- if ( $parent && isset( $categoryByID[$parent]['term_id'] ) ) {
214
- $parentID = $categoryByID[$parent]['term_id'];
215
- }
216
-
217
- $new_term = wp_insert_term( $folder->name, "media_folder", ['parent' => $parentID] );
218
-
219
- if ( is_wp_error( $new_term ) ) {
220
- continue;
221
- }
222
-
223
- $total_folders++;
224
- $this->checkForLimit($total_folders);
225
-
226
- $taxonomy = 'media_folder';
227
-
228
- $arg = array(
229
- 'hide_empty' => false,
230
- 'parent' => $parentID,
231
- 'hierarchical' => false,
232
- 'update_count_callback' => '_update_generic_term_count',
233
- );
234
- $terms = get_terms( $taxonomy, $arg);
235
- $position = count($terms);
236
-
237
-
238
- update_term_meta( $new_term['term_id'], 'wcp_custom_order', intval( $position ) );
239
-
240
- $foldersImported[] = $new_term;
241
-
242
- $categoryByID[$folder->id] = [
243
- 'name' => $folder->name,
244
- 'parent' => $parent,
245
- 'term_id' => $new_term['term_id'],
246
- ];
247
- }
248
-
249
- foreach ( $attachments as $attachment ) {
250
- $hf_category_id = isset( $categoryByID[$attachment->folder_id]['term_id'] ) ? intval( $categoryByID[$attachment->folder_id]['term_id'] ) : 0;
251
- $attachment_id = isset( $attachment->attachment_id ) ? intval( $attachment->attachment_id ) : 0;
252
-
253
- if ( ! $hf_category_id || ! $attachment_id ) {
254
- continue;
255
- }
256
-
257
- $term_ids = wp_get_object_terms( $attachment_id, "media_folder", ['fields' => 'ids'] );
258
- $term_ids[] = $hf_category_id;
259
-
260
- $term_set = wp_set_object_terms( $attachment_id, $term_ids, "media_folder" );
261
-
262
- if ( is_wp_error( $term_set ) ) {
263
- continue;
264
- }
265
-
266
- $attachmentsImported[] = [
267
- 'cat_id' => $hf_category_id,
268
- 'term_ids' => $term_ids,
269
- 'set' => $term_set,
270
- ];
271
- }
272
- }
273
-
274
- $response['status'] = 1;
275
- $response['data']['imported'] = count($foldersImported);
276
- $response['data']['attachments'] = count($attachmentsImported);
277
- $response['data']['plugin'] = $plugin;
278
- $response['message'] = sprintf(esc_html__( '%s folders imported and %s attachments categorized.', 'folders'), count($foldersImported), count($attachmentsImported));
279
- }
280
- echo json_encode($response);
281
- exit;
282
- }
283
-
284
- public function get_plugin_information() {
285
- $this->get_other_plugins_data();
286
- return $this->plugins;
287
- }
288
-
289
- public function get_other_plugins_data() {
290
- if(!empty($this->plugins)) {
291
- return $this->plugins;
292
- }
293
- $this->plugins = array(
294
- // FileBird
295
- 'filebird' => array(
296
- 'name' => 'FileBird (v4)',
297
- 'taxonomy' => 'filebird', // has custom DB table
298
- 'folders' => array(),
299
- 'attachments' => array(),
300
- 'total_folders' => 0,
301
- 'total_attachments' => 0,
302
- 'is_exists' => 0
303
- ),
304
- 'enhanced-media-library' => array(
305
- // Enhanced Media Library
306
- 'name' => 'Enhanced Media Library',
307
- 'taxonomy' => 'media_category',
308
- 'folders' => array(),
309
- 'attachments' => array(),
310
- 'total_folders' => 0,
311
- 'total_attachments' => 0,
312
- 'is_exists' => 0
313
- ),
314
- 'wicked-folders' => array(
315
- // Enhanced Media Library
316
- 'name' => 'Wicked Folders',
317
- 'taxonomy' => 'wf_attachment_folders',
318
- 'folders' => array(),
319
- 'attachments' => array(),
320
- 'total_folders' => 0,
321
- 'total_attachments' => 0,
322
- 'is_exists' => 0
323
- ),
324
- 'real-media-library' => array(
325
- // Real Media Library
326
- 'name' => 'Real Media Library (by DevOwl)',
327
- 'taxonomy' => 'rml', // has custom DB table
328
- 'folders' => array(),
329
- 'attachments' => array(),
330
- 'total_folders' => 0,
331
- 'total_attachments' => 0,
332
- 'is_exists' => 0
333
- ),
334
- 'wp-media-folder' => array(
335
- // Real Media Library
336
- 'name' => 'WP Media Folder (by JoomUnited)',
337
- 'taxonomy' => 'wpmf-category',
338
- 'folders' => array(),
339
- 'attachments' => array(),
340
- 'total_folders' => 0,
341
- 'total_attachments' => 0,
342
- 'is_exists' => 0
343
- )
344
- );
345
- $post_types = get_post_types(array());
346
- $this->post_types = array_keys($post_types);
347
-
348
- foreach ($this->plugins as $slug => $plugin_data ) {
349
- $taxonomy = $plugin_data['taxonomy'];
350
-
351
- if ( $slug === 'wicked-folders' ) {
352
- // Run for all registered post types
353
- $folders = [];
354
-
355
- foreach ( $this->post_types as $post_type ) {
356
- $wicked_folders = $this->get_plugin_folders( 'wf_' . $post_type . '_folders', $slug );
357
-
358
- if ( is_array( $wicked_folders ) ) {
359
- $folders = array_merge( $folders, $wicked_folders );
360
- }
361
- }
362
- }
363
-
364
- else {
365
- $folders = $this->get_plugin_folders( $taxonomy, $slug );
366
- }
367
-
368
- if ( in_array( $taxonomy, ['filebird', 'rml'] ) ) {
369
- $folders = is_array( $folders ) && count( $folders ) ? $this->map_plugin_folders( $taxonomy, $folders ) : [];
370
- }
371
-
372
- $this->plugins[$slug]['folders'] = $folders;
373
-
374
- $attachments = is_array( $folders ) && count( $folders ) ? $this->get_plugin_attachments( $taxonomy, $folders ) : [];
375
-
376
- if ( in_array( $taxonomy, ['filebird', 'rml'] ) ) {
377
- $attachments = $this->map_plugin_attachments( $taxonomy, $attachments );
378
- }
379
-
380
- $this->plugins[$slug]['attachments'] = $attachments;
381
- }
382
-
383
- foreach ($this->plugins as $key=>$plugin) {
384
- $folders = isset($plugin['folders'])&&is_array($plugin['folders'])?$plugin['folders']:array();
385
- $this->plugins[$key]['total_folders'] = count($folders);
386
-
387
- $attachments = isset($plugin['attachments'])&&is_array($plugin['attachments'])?$plugin['attachments']:array();
388
- $this->plugins[$key]['total_attachments'] = count($attachments);
389
-
390
- if(count($folders) > 0 || count($attachments)>0) {
391
- $this->plugins[$key]['is_exists'] = 1;
392
- $this->is_exists = 1;
393
- }
394
- }
395
- }
396
-
397
- public function get_plugin_folders( $taxonomy, $slug ) {
398
- global $wpdb;
399
-
400
- // FileBird has its own db table
401
- if ( $taxonomy === 'filebird' ) {
402
- $filebird_folders_table = $wpdb->prefix . 'fbv';
403
-
404
- // Get FileBird folders (order by 'parent' to create parent categories first)
405
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$filebird_folders_table'") == $filebird_folders_table ) {
406
- return $wpdb->get_results( "SELECT * FROM $filebird_folders_table ORDER BY parent ASC" );
407
- }
408
- }
409
-
410
- // Real Media Library has its own db table
411
- else if ( $taxonomy === 'rml' ) {
412
- $rml_folders_table = $wpdb->prefix . 'realmedialibrary';
413
-
414
- // Get FileBird folders (order by 'parent' to create parent categories first)
415
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$rml_folders_table'") == $rml_folders_table ) {
416
- return $wpdb->get_results( "SELECT * FROM $rml_folders_table ORDER BY parent ASC" );
417
- }
418
- }
419
-
420
- // Default: Plugins with custom taxonomy terms
421
- else {
422
- $folders = $wpdb->get_results(
423
- "SELECT * FROM " . $wpdb->term_taxonomy . "
424
- LEFT JOIN " . $wpdb->terms . "
425
- ON " . $wpdb->term_taxonomy . ".term_id = " . $wpdb->terms . ".term_id
426
- WHERE " . $wpdb->term_taxonomy . ".taxonomy = '" . $taxonomy . "'
427
- ORDER BY parent ASC"
428
- );
429
-
430
- // WP Media Folder (JoomUnited): Remove root folder
431
- if ( $slug === 'wp-media-folder' ) {
432
- foreach ( $folders as $index => $folder ) {
433
- if ( $folder->slug === 'wp-media-folder-root' ) {
434
- unset( $folders[$index] );
435
- }
436
- }
437
- }
438
-
439
- return array_values( $folders );
440
- }
441
- }
442
-
443
- public function map_plugin_folders( $taxonomy, $folders ) {
444
- $mapped_folders = [];
445
-
446
- foreach ( $folders as $folder ) {
447
-
448
- // FileBird, Real Media Library
449
- if ( $taxonomy === 'filebird' || $taxonomy === 'rml' ) {
450
- $folder_object = new \stdClass();
451
-
452
- $folder_object->name = $folder->name;
453
- $folder_object->id = intval( $folder->id );
454
- $folder_object->parent = intval( $folder->parent );
455
- $folder_object->position = intval( $folder->ord );
456
-
457
- $mapped_folders[] = $folder_object;
458
- }
459
-
460
- }
461
-
462
- return $mapped_folders;
463
- }
464
-
465
- public function map_plugin_attachments( $taxonomy, $attachments ) {
466
- $mapped_attachments = [];
467
-
468
- foreach ( $attachments as $folder ) {
469
-
470
- // FileBird
471
- if ( $taxonomy === 'filebird' ) {
472
- $folder_object = new \stdClass();
473
-
474
- $folder_object->folder_id = intval( $folder->folder_id );
475
- $folder_object->attachment_id = intval( $folder->attachment_id );
476
-
477
- $mapped_attachments[] = $folder_object;
478
- }
479
-
480
- // Real Media Library
481
- if ( $taxonomy === 'rml' ) {
482
- $folder_object = new \stdClass();
483
-
484
- $folder_object->folder_id = intval( $folder->fid );
485
- $folder_object->attachment_id = intval( $folder->attachment );
486
-
487
- $mapped_attachments[] = $folder_object;
488
- }
489
-
490
- }
491
-
492
- return $mapped_attachments;
493
- }
494
-
495
- public function get_plugin_attachments( $taxonomy, $folders ) {
496
- global $wpdb;
497
-
498
- // FileBird has its own db table
499
- if ( $taxonomy === 'filebird' ) {
500
- $filebird_attachments_table = $wpdb->prefix . 'fbv_attachment_folder';
501
-
502
- // Get FileBird attachments (order by 'folder_id')
503
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$filebird_attachments_table'") == $filebird_attachments_table ) {
504
- return $wpdb->get_results( "SELECT * FROM $filebird_attachments_table ORDER BY folder_id ASC" );
505
- }
506
- }
507
-
508
- // Real Media Library has its own db table
509
- else if ( $taxonomy === 'rml' ) {
510
- $rml_attachments_table = $wpdb->prefix . 'realmedialibrary_posts';
511
-
512
- // Get FileBird folders (order by 'parent' to create parent categories first)
513
- if ( $wpdb->get_var( "SHOW TABLES LIKE '$rml_attachments_table'") == $rml_attachments_table ) {
514
- return $wpdb->get_results( "SELECT * FROM $rml_attachments_table ORDER BY fid ASC" );
515
- }
516
- }
517
-
518
- // Default: Plugins with custom taxonomy terms
519
- else {
520
- return $wpdb->get_results(
521
- "SELECT " . $wpdb->term_relationships . ".object_id,
522
- " . $wpdb->term_relationships . ".term_taxonomy_id
523
- FROM " . $wpdb->term_relationships . "
524
- WHERE " . $wpdb->term_relationships . ".term_taxonomy_id IN (" . implode( ',', array_column( $folders, 'term_id' ) ) . ")"
525
- );
526
- }
527
- }
528
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  $WCP_Folder_Plugins = new WCP_Folder_Plugins();
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ /* Free/Pro Class name change */
4
+ class WCP_Folder_Plugins {
5
+
6
+ public $plugins = array();
7
+ public $post_types = array();
8
+ public $is_exists = 0;
9
+
10
+ public function __construct() {
11
+
12
+ /* Import plugin data */
13
+ add_action( 'wp_ajax_wcp_import_plugin_folders_data', array($this, 'import_plugin_folders_data'));
14
+ add_action( 'wp_ajax_wcp_remove_plugin_folders_data', array($this, 'remove_plugin_folders_data'));
15
+ }
16
+
17
+
18
+ public function remove_plugin_folders_data(){
19
+ global $wpdb;
20
+ $postData = filter_input_array(INPUT_POST);
21
+
22
+ $plugin = isset($postData['plugin']) ? $postData['plugin'] : "";
23
+ $nonce = isset($postData['nonce']) ? $postData['nonce'] : "";
24
+ $response = array();
25
+ $response['status'] = 0;
26
+ $response['message'] = esc_html__("Invalid request", "folders");
27
+ $response['data'] = array();
28
+ $response['data']['plugin'] = $plugin;
29
+ if (wp_verify_nonce($nonce, "import_data_from_" . $plugin)) {
30
+ $this->get_plugin_information();
31
+ $folders = isset($this->plugins[$plugin]['folders']) ? $this->plugins[$plugin]['folders'] : array();
32
+ $attachments = isset($this->plugins[$plugin]['attachments']) ? $this->plugins[$plugin]['attachments'] : array();
33
+
34
+ if($plugin != 'filebird' && $plugin != 'real-media-library') {
35
+ $deleted = [];
36
+
37
+ foreach ( $folders as $folder ) {
38
+ $term_id = intval( $folder->term_id );
39
+
40
+ if ( $term_id ) {
41
+ $deleted[$term_id]['term_relationships'] = $wpdb->delete( $wpdb->prefix . 'term_relationships', ['term_taxonomy_id' => $term_id] );
42
+ $deleted[$term_id]['term_taxonomy'] = $wpdb->delete( $wpdb->prefix . 'term_taxonomy', ['term_id' => $term_id] );
43
+ $deleted[$term_id]['terms'] = $wpdb->delete( $wpdb->prefix . 'terms', ['term_id' => $term_id] );
44
+
45
+ if ( $plugin === 'folders' ) {
46
+ $deleted[$term_id]['termmeta'] = $wpdb->delete( $wpdb->prefix . 'termmeta', ['term_id' => $term_id] );
47
+ }
48
+ }
49
+ }
50
+ } else {
51
+
52
+ if ( count( $folders ) ) {
53
+ if ( $plugin === 'filebird' ) {
54
+ $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'fbv' );
55
+ }
56
+
57
+ if ( $plugin === 'real-media-library' ) {
58
+ $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'realmedialibrary' );
59
+
60
+ $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'realmedialibrary_meta' );
61
+ }
62
+ }
63
+
64
+ if ( count( $attachments ) ) {
65
+ if ( $plugin === 'filebird' ) {
66
+ $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'fbv_attachment_folder' );
67
+ }
68
+
69
+ if ( $plugin === 'real-media-library' ) {
70
+ $wpdb->query( 'DELETE FROM ' . $wpdb->prefix . 'realmedialibrary_posts' );
71
+ }
72
+ }
73
+ }
74
+ $response['status'] = 1;
75
+
76
+ }
77
+ echo json_encode($response);
78
+ exit;
79
+ }
80
+
81
+ public function checkForLimit($folders) {
82
+ $response = array();
83
+ $response['status'] = 0;
84
+ $response['message'] = esc_html__("Invalid request", "folders");
85
+ $response['data'] = array();
86
+ $response['data']['plugin'] = array();
87
+ if($folders >= 10) {
88
+ $response['status'] = -1;
89
+ echo json_encode($response);
90
+ exit;
91
+ }
92
+ }
93
+
94
+ public function import_plugin_folders_data() {
95
+ $postData = filter_input_array(INPUT_POST);
96
+
97
+ $plugin = isset($postData['plugin']) ?$postData['plugin']:"";
98
+ $nonce = isset($postData['nonce']) ?$postData['nonce']:"";
99
+ $response = array();
100
+ $response['status'] = 0;
101
+ $response['message'] = esc_html__("Invalid request", "folders");
102
+ $response['data'] = array();
103
+ $response['data']['plugin'] = $plugin;
104
+ if(wp_verify_nonce($nonce, "import_data_from_".$plugin)) {
105
+ $this->get_plugin_information();
106
+ $folders = isset($this->plugins[$plugin]['folders']) ? $this->plugins[$plugin]['folders'] : array();
107
+ $attachments = isset($this->plugins[$plugin]['attachments']) ? $this->plugins[$plugin]['attachments'] : array();
108
+
109
+ $categoryByID = array();
110
+ $foldersImported = array();
111
+ $attachmentsImported = array();
112
+
113
+ $total_folders = WCP_Folders::get_ttl_fldrs();
114
+
115
+ $this->checkForLimit($total_folders);
116
+
117
+ if($plugin != 'filebird' && $plugin != 'real-media-library') {
118
+
119
+ foreach ($folders as $folder) {
120
+ $folder_id = $folder->term_id;
121
+ $parent = intval($folder->parent);
122
+
123
+ $taxonomy = 'media_folder';
124
+
125
+ foreach ($this->post_types as $post_type) {
126
+ if (strpos($folder->taxonomy, $post_type) !== false) {
127
+ if ($post_type == "post") {
128
+ $taxonomy = "post_folder";
129
+ } else if ($post_type == "page") {
130
+ $taxonomy = "folder";
131
+ } else if ($post_type == "attachment") {
132
+ $taxonomy = "media_folder";
133
+ } else {
134
+ $taxonomy = $post_type . '_folder';
135
+ }
136
+ }
137
+ }
138
+
139
+ if ($parent && isset($categoryByID[$parent]['term_id'])) {
140
+ $parent = intval($categoryByID[$parent]['term_id']);
141
+ }
142
+
143
+ $new_term = wp_insert_term($folder->name, $taxonomy, ['parent' => $parent]);
144
+
145
+ if (is_wp_error($new_term)) {
146
+ continue;
147
+ }
148
+
149
+ $total_folders++;
150
+ $this->checkForLimit($total_folders);
151
+
152
+ $arg = array(
153
+ 'hide_empty' => false,
154
+ 'parent' => $parent,
155
+ 'hierarchical' => false,
156
+ 'update_count_callback' => '_update_generic_term_count',
157
+ );
158
+ $terms = get_terms( $taxonomy, $arg);
159
+ $position = count($terms);
160
+
161
+ if($plugin == 'mediamatic' || $plugin == 'happyfiles') {
162
+ $meta_key = "";
163
+ if($plugin == 'mediamatic') {
164
+ $meta_key = "folder_position";
165
+ } else if($plugin == 'happyfiles') {
166
+ $meta_key = "happyfiles_position";
167
+ }
168
+ if(!empty($meta_key)) {
169
+ $folder_position = get_term_meta($new_term['term_id'], $meta_key, true);
170
+ if(empty($folder_position)) {
171
+ $position = intval($folder_position);
172
+ }
173
+ }
174
+ }
175
+
176
+ update_term_meta($new_term['term_id'], 'wcp_custom_order', $position);
177
+
178
+ $foldersImported[] = $new_term;
179
+
180
+ $categoryByID[$folder_id] = [
181
+ 'term_id' => $new_term['term_id'],
182
+ 'parent' => $parent,
183
+ 'name' => $folder->name,
184
+ ];
185
+ }
186
+
187
+ // STEP: Assign plugin categories to HF categories
188
+ foreach ($attachments as $attachment) {
189
+ $hf_category_id = isset($categoryByID[$attachment->term_taxonomy_id]['term_id']) ? intval($categoryByID[$attachment->term_taxonomy_id]['term_id']) : 0;
190
+ $attachment_id = isset($attachment->object_id) ? intval($attachment->object_id) : 0;
191
+
192
+ if (!$hf_category_id || !$attachment_id) {
193
+ continue;
194
+ }
195
+
196
+ // Get attachment taxonomy by post type
197
+ $post_type = get_post_type($attachment_id);
198
+ if ($post_type == "post") {
199
+ $taxonomy = "post_folder";
200
+ } else if ($post_type == "page") {
201
+ $taxonomy = "folder";
202
+ } else if ($post_type == "attachment") {
203
+ $taxonomy = "media_folder";
204
+ } else {
205
+ $taxonomy = $post_type . '_folder';
206
+ }
207
+
208
+ $term_ids = wp_get_object_terms($attachment_id, $taxonomy, ['fields' => 'ids']);
209
+ $term_ids[] = $hf_category_id;
210
+
211
+ $term_set = wp_set_object_terms($attachment_id, $term_ids, $taxonomy);
212
+
213
+ if (is_wp_error($term_set)) {
214
+ continue;
215
+ }
216
+
217
+ $attachmentsImported[] = [
218
+ 'cat_id' => $hf_category_id,
219
+ 'term_ids' => $term_ids,
220
+ 'set' => $term_set,
221
+ ];
222
+ }
223
+ } else {
224
+ foreach ( $folders as $folder ) {
225
+ $parent = intval( $folder->parent );
226
+ $parentID = 0;
227
+
228
+ if ( $parent && isset( $categoryByID[$parent]['term_id'] ) ) {
229
+ $parentID = $categoryByID[$parent]['term_id'];
230
+ }
231
+
232
+ $new_term = wp_insert_term( $folder->name, "media_folder", ['parent' => $parentID] );
233
+
234
+ if ( is_wp_error( $new_term ) ) {
235
+ continue;
236
+ }
237
+
238
+ $total_folders++;
239
+ $this->checkForLimit($total_folders);
240
+
241
+ $taxonomy = 'media_folder';
242
+
243
+ $arg = array(
244
+ 'hide_empty' => false,
245
+ 'parent' => $parentID,
246
+ 'hierarchical' => false,
247
+ 'update_count_callback' => '_update_generic_term_count',
248
+ );
249
+ $terms = get_terms( $taxonomy, $arg);
250
+ $position = count($terms);
251
+
252
+
253
+ update_term_meta( $new_term['term_id'], 'wcp_custom_order', intval( $position ) );
254
+
255
+ $foldersImported[] = $new_term;
256
+
257
+ $categoryByID[$folder->id] = [
258
+ 'name' => $folder->name,
259
+ 'parent' => $parent,
260
+ 'term_id' => $new_term['term_id'],
261
+ ];
262
+ }
263
+
264
+ foreach ( $attachments as $attachment ) {
265
+ $hf_category_id = isset( $categoryByID[$attachment->folder_id]['term_id'] ) ? intval( $categoryByID[$attachment->folder_id]['term_id'] ) : 0;
266
+ $attachment_id = isset( $attachment->attachment_id ) ? intval( $attachment->attachment_id ) : 0;
267
+
268
+ if ( ! $hf_category_id || ! $attachment_id ) {
269
+ continue;
270
+ }
271
+
272
+ $term_ids = wp_get_object_terms( $attachment_id, "media_folder", ['fields' => 'ids'] );
273
+ $term_ids[] = $hf_category_id;
274
+
275
+ $term_set = wp_set_object_terms( $attachment_id, $term_ids, "media_folder" );
276
+
277
+ if ( is_wp_error( $term_set ) ) {
278
+ continue;
279
+ }
280
+
281
+ $attachmentsImported[] = [
282
+ 'cat_id' => $hf_category_id,
283
+ 'term_ids' => $term_ids,
284
+ 'set' => $term_set,
285
+ ];
286
+ }
287
+ }
288
+
289
+ $response['status'] = 1;
290
+ $response['data']['imported'] = count($foldersImported);
291
+ $response['data']['attachments'] = count($attachmentsImported);
292
+ $response['data']['plugin'] = $plugin;
293
+ $response['message'] = sprintf(esc_html__( '%s folders imported and %s attachments categorized.', 'folders'), count($foldersImported), count($attachmentsImported));
294
+ }
295
+ echo json_encode($response);
296
+ exit;
297
+ }
298
+
299
+ public function get_plugin_information() {
300
+ $this->get_other_plugins_data();
301
+ return $this->plugins;
302
+ }
303
+
304
+ public function get_other_plugins_data() {
305
+ if(!empty($this->plugins)) {
306
+ return $this->plugins;
307
+ }
308
+ $this->plugins = array(
309
+ // FileBird
310
+ 'filebird' => array(
311
+ 'name' => 'FileBird (v4)',
312
+ 'taxonomy' => 'filebird', // has custom DB table
313
+ 'folders' => array(),
314
+ 'attachments' => array(),
315
+ 'total_folders' => 0,
316
+ 'total_attachments' => 0,
317
+ 'is_exists' => 0
318
+ ),
319
+ 'enhanced-media-library' => array(
320
+ // Enhanced Media Library
321
+ 'name' => 'Enhanced Media Library',
322
+ 'taxonomy' => 'media_category',
323
+ 'folders' => array(),
324
+ 'attachments' => array(),
325
+ 'total_folders' => 0,
326
+ 'total_attachments' => 0,
327
+ 'is_exists' => 0
328
+ ),
329
+ 'wicked-folders' => array(
330
+ // Enhanced Media Library
331
+ 'name' => 'Wicked Folders',
332
+ 'taxonomy' => 'wf_attachment_folders',
333
+ 'folders' => array(),
334
+ 'attachments' => array(),
335
+ 'total_folders' => 0,
336
+ 'total_attachments' => 0,
337
+ 'is_exists' => 0
338
+ ),
339
+ 'real-media-library' => array(
340
+ // Real Media Library
341
+ 'name' => 'Real Media Library (by DevOwl)',
342
+ 'taxonomy' => 'rml', // has custom DB table
343
+ 'folders' => array(),
344
+ 'attachments' => array(),
345
+ 'total_folders' => 0,
346
+ 'total_attachments' => 0,
347
+ 'is_exists' => 0
348
+ ),
349
+ 'wp-media-folder' => array(
350
+ // Real Media Library
351
+ 'name' => 'WP Media Folder (by JoomUnited)',
352
+ 'taxonomy' => 'wpmf-category',
353
+ 'folders' => array(),
354
+ 'attachments' => array(),
355
+ 'total_folders' => 0,
356
+ 'total_attachments' => 0,
357
+ 'is_exists' => 0
358
+ ),
359
+ 'mediamatic' => array(
360
+ // Mediamatic
361
+ 'name' => 'WordPress Media Library Folders | Mediamatic',
362
+ 'taxonomy' => 'mediamatic_wpfolder',
363
+ 'folders' => array(),
364
+ 'attachments' => array(),
365
+ 'total_folders' => 0,
366
+ 'total_attachments' => 0,
367
+ 'is_exists' => 0
368
+ ),
369
+ 'happyfiles' => array(
370
+ // HappyFiles
371
+ 'name' => 'HappyFiles',
372
+ 'taxonomy' => 'happyfiles_category',
373
+ 'folders' => array(),
374
+ 'attachments' => array(),
375
+ 'total_folders' => 0,
376
+ 'total_attachments' => 0,
377
+ 'is_exists' => 0
378
+ )
379
+ );
380
+ $post_types = get_post_types(array());
381
+ $this->post_types = array_keys($post_types);
382
+
383
+ foreach ($this->plugins as $slug => $plugin_data ) {
384
+ $taxonomy = $plugin_data['taxonomy'];
385
+
386
+ if ( $slug === 'wicked-folders' ) {
387
+ // Run for all registered post types
388
+ $folders = [];
389
+
390
+ foreach ( $this->post_types as $post_type ) {
391
+ $wicked_folders = $this->get_plugin_folders( 'wf_' . $post_type . '_folders', $slug );
392
+
393
+ if ( is_array( $wicked_folders ) ) {
394
+ $folders = array_merge( $folders, $wicked_folders );
395
+ }
396
+ }
397
+ }
398
+
399
+ else {
400
+ $folders = $this->get_plugin_folders( $taxonomy, $slug );
401
+ }
402
+
403
+ if ( in_array( $taxonomy, ['filebird', 'rml'] ) ) {
404
+ $folders = is_array( $folders ) && count( $folders ) ? $this->map_plugin_folders( $taxonomy, $folders ) : [];
405
+ }
406
+
407
+ $this->plugins[$slug]['folders'] = $folders;
408
+
409
+ $attachments = is_array( $folders ) && count( $folders ) ? $this->get_plugin_attachments( $taxonomy, $folders ) : [];
410
+
411
+ if ( in_array( $taxonomy, ['filebird', 'rml'] ) ) {
412
+ $attachments = $this->map_plugin_attachments( $taxonomy, $attachments );
413
+ }
414
+
415
+ $this->plugins[$slug]['attachments'] = $attachments;
416
+ }
417
+
418
+ foreach ($this->plugins as $key=>$plugin) {
419
+ $folders = isset($plugin['folders'])&&is_array($plugin['folders'])?$plugin['folders']:array();
420
+ $this->plugins[$key]['total_folders'] = count($folders);
421
+
422
+ $attachments = isset($plugin['attachments'])&&is_array($plugin['attachments'])?$plugin['attachments']:array();
423
+ $this->plugins[$key]['total_attachments'] = count($attachments);
424
+
425
+ if(count($folders) > 0 || count($attachments)>0) {
426
+ $this->plugins[$key]['is_exists'] = 1;
427
+ $this->is_exists = 1;
428
+ }
429
+ }
430
+ }
431
+
432
+ public function get_plugin_folders( $taxonomy, $slug ) {
433
+ global $wpdb;
434
+
435
+ // FileBird has its own db table
436
+ if ( $taxonomy === 'filebird' ) {
437
+ $filebird_folders_table = $wpdb->prefix . 'fbv';
438
+
439
+ // Get FileBird folders (order by 'parent' to create parent categories first)
440
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '$filebird_folders_table'") == $filebird_folders_table ) {
441
+ return $wpdb->get_results( "SELECT * FROM $filebird_folders_table ORDER BY parent ASC" );
442
+ }
443
+ }
444
+
445
+ // Real Media Library has its own db table
446
+ else if ( $taxonomy === 'rml' ) {
447
+ $rml_folders_table = $wpdb->prefix . 'realmedialibrary';
448
+
449
+ // Get FileBird folders (order by 'parent' to create parent categories first)
450
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '$rml_folders_table'") == $rml_folders_table ) {
451
+ return $wpdb->get_results( "SELECT * FROM $rml_folders_table ORDER BY parent ASC" );
452
+ }
453
+ }
454
+
455
+ // Default: Plugins with custom taxonomy terms
456
+ else {
457
+ $folders = $wpdb->get_results(
458
+ "SELECT * FROM " . $wpdb->term_taxonomy . "
459
+ LEFT JOIN " . $wpdb->terms . "
460
+ ON " . $wpdb->term_taxonomy . ".term_id = " . $wpdb->terms . ".term_id
461
+ WHERE " . $wpdb->term_taxonomy . ".taxonomy = '" . $taxonomy . "'
462
+ ORDER BY parent ASC"
463
+ );
464
+
465
+ // WP Media Folder (JoomUnited): Remove root folder
466
+ if ( $slug === 'wp-media-folder' ) {
467
+ foreach ( $folders as $index => $folder ) {
468
+ if ( $folder->slug === 'wp-media-folder-root' ) {
469
+ unset( $folders[$index] );
470
+ }
471
+ }
472
+ }
473
+
474
+ return array_values( $folders );
475
+ }
476
+ }
477
+
478
+ public function map_plugin_folders( $taxonomy, $folders ) {
479
+ $mapped_folders = [];
480
+
481
+ foreach ( $folders as $folder ) {
482
+
483
+ // FileBird, Real Media Library
484
+ if ( $taxonomy === 'filebird' || $taxonomy === 'rml' ) {
485
+ $folder_object = new \stdClass();
486
+
487
+ $folder_object->name = $folder->name;
488
+ $folder_object->id = intval( $folder->id );
489
+ $folder_object->parent = intval( $folder->parent );
490
+ $folder_object->position = intval( $folder->ord );
491
+
492
+ $mapped_folders[] = $folder_object;
493
+ }
494
+
495
+ }
496
+
497
+ return $mapped_folders;
498
+ }
499
+
500
+ public function map_plugin_attachments( $taxonomy, $attachments ) {
501
+ $mapped_attachments = [];
502
+
503
+ foreach ( $attachments as $folder ) {
504
+
505
+ // FileBird
506
+ if ( $taxonomy === 'filebird' ) {
507
+ $folder_object = new \stdClass();
508
+
509
+ $folder_object->folder_id = intval( $folder->folder_id );
510
+ $folder_object->attachment_id = intval( $folder->attachment_id );
511
+
512
+ $mapped_attachments[] = $folder_object;
513
+ }
514
+
515
+ // Real Media Library
516
+ if ( $taxonomy === 'rml' ) {
517
+ $folder_object = new \stdClass();
518
+
519
+ $folder_object->folder_id = intval( $folder->fid );
520
+ $folder_object->attachment_id = intval( $folder->attachment );
521
+
522
+ $mapped_attachments[] = $folder_object;
523
+ }
524
+
525
+ }
526
+
527
+ return $mapped_attachments;
528
+ }
529
+
530
+ public function get_plugin_attachments( $taxonomy, $folders ) {
531
+ global $wpdb;
532
+
533
+ // FileBird has its own db table
534
+ if ( $taxonomy === 'filebird' ) {
535
+ $filebird_attachments_table = $wpdb->prefix . 'fbv_attachment_folder';
536
+
537
+ // Get FileBird attachments (order by 'folder_id')
538
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '$filebird_attachments_table'") == $filebird_attachments_table ) {
539
+ return $wpdb->get_results( "SELECT * FROM $filebird_attachments_table ORDER BY folder_id ASC" );
540
+ }
541
+ }
542
+
543
+ // Real Media Library has its own db table
544
+ else if ( $taxonomy === 'rml' ) {
545
+ $rml_attachments_table = $wpdb->prefix . 'realmedialibrary_posts';
546
+
547
+ // Get FileBird folders (order by 'parent' to create parent categories first)
548
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '$rml_attachments_table'") == $rml_attachments_table ) {
549
+ return $wpdb->get_results( "SELECT * FROM $rml_attachments_table ORDER BY fid ASC" );
550
+ }
551
+ }
552
+
553
+ // Default: Plugins with custom taxonomy terms
554
+ else {
555
+ return $wpdb->get_results(
556
+ "SELECT " . $wpdb->term_relationships . ".object_id,
557
+ " . $wpdb->term_relationships . ".term_taxonomy_id
558
+ FROM " . $wpdb->term_relationships . "
559
+ WHERE " . $wpdb->term_relationships . ".term_taxonomy_id IN (" . implode( ',', array_column( $folders, 'term_id' ) ) . ")"
560
+ );
561
+ }
562
+ }
563
+ }
564
  $WCP_Folder_Plugins = new WCP_Folder_Plugins();
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: galdub, tomeraharon, premio
3
  Tags: folder, folders, replace media, pages folders, media library, posts folders, media folders, media replace, file manager, directories, media library folders, media library folder
4
  Requires at least: 3.0.0
5
  Tested up to: 5.6
6
- Stable tag: 2.6.4
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly organize and manage your Media Library files, Pages, Posts, and Custom Posts in folders
@@ -82,7 +82,7 @@ With Folders plugin, you can replace media library files with other files. This
82
  [youtube https://www.youtube.com/watch?v=16MrxVo2EC4]
83
 
84
  = Import folders =
85
- You can import folders data from FileBird, Enhanced Media Library, Wicked Folders, Real Media Library, and WP Media Folder
86
 
87
  = Here Are Some Use Cases =
88
 
@@ -148,7 +148,7 @@ Step 3: Create new folders and drag & drop elements into your new folders
148
  No. you can use the free plan as long as you want.
149
 
150
  = Can I import folders form other plugins? =
151
- Yes you can! Currently, we support FileBird, Enhanced Media Library, Wicked Folders, Real Media Library, and WP Media Folder
152
 
153
  = Does Folders change the URL of my images/posts/pages? =
154
  No. adding a page/post/image into a folder will not change its URL
@@ -180,6 +180,9 @@ A live demo for the Folders plugin is available at <a href="https://demo.premio.
180
 
181
  == Changelog ==
182
 
 
 
 
183
  = 2.6.4 =
184
  iPad bugs fixed
185
 
3
  Tags: folder, folders, replace media, pages folders, media library, posts folders, media folders, media replace, file manager, directories, media library folders, media library folder
4
  Requires at least: 3.0.0
5
  Tested up to: 5.6
6
+ Stable tag: 2.6.5
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly organize and manage your Media Library files, Pages, Posts, and Custom Posts in folders
82
  [youtube https://www.youtube.com/watch?v=16MrxVo2EC4]
83
 
84
  = Import folders =
85
+ You can import folders data from FileBird, Enhanced Media Library, Wicked Folders, Real Media Library, WP Media Folder, HappyFiles (Happy Files), and Mediamatic
86
 
87
  = Here Are Some Use Cases =
88
 
148
  No. you can use the free plan as long as you want.
149
 
150
  = Can I import folders form other plugins? =
151
+ Yes you can! Currently, we support FileBird, Enhanced Media Library, Wicked Folders, Real Media Library, WP Media Folder, HappyFiles (Happy Files) and Mediamatic
152
 
153
  = Does Folders change the URL of my images/posts/pages? =
154
  No. adding a page/post/image into a folder will not change its URL
180
 
181
  == Changelog ==
182
 
183
+ = 2.6.5 =
184
+ Import folders from HappyFiles (Happy Files) and Mediamatic + fixed some bugs
185
+
186
  = 2.6.4 =
187
  iPad bugs fixed
188
 
templates/admin/general-settings.php CHANGED
@@ -310,10 +310,10 @@ if ( ! defined( 'ABSPATH' ) ) exit;
310
  <tr>
311
  <td class="no-padding">
312
  <input type="hidden" name="customize_folders[show_folder_in_settings]" value="no">
313
- <div class="custom-checkbox">
314
  <input id="show_folder_in_settings" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[show_folder_in_settings]" value="yes">
315
  <span></span>
316
- </div>
317
  </td>
318
  <td colspan="3">
319
  <label for="show_folder_in_settings" ><?php esc_html_e( 'Place the Folders settings page nested under "Settings"', WCP_FOLDER ); ?></label>
310
  <tr>
311
  <td class="no-padding">
312
  <input type="hidden" name="customize_folders[show_folder_in_settings]" value="no">
313
+ <label for="show_folder_in_settings" class="custom-checkbox">
314
  <input id="show_folder_in_settings" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[show_folder_in_settings]" value="yes">
315
  <span></span>
316
+ </label>
317
  </td>
318
  <td colspan="3">
319
  <label for="show_folder_in_settings" ><?php esc_html_e( 'Place the Folders settings page nested under "Settings"', WCP_FOLDER ); ?></label>
templates/admin/media-replace.php CHANGED
@@ -32,7 +32,7 @@ $file_parts = pathinfo($attachment->guid);
32
  $file_name = $file_parts['basename'];
33
  ?>
34
  <div class="wrap">
35
- <h2><?php esc_html_e("Replace Media"); ?></h2>
36
  <div class="file-type warning replace-message">
37
  <?php esc_html_e("Replacement file is not the same filetype. This might cause unexpected issues", "folders"); ?>
38
  </div>
@@ -73,7 +73,7 @@ $file_name = $file_parts['basename'];
73
  <!-- Drag and Drop container-->
74
  <div class="upload-area" id="upload-file">
75
  <div class="drag-and-drop-title">
76
- <span>Click here to upload file</span>
77
  </div>
78
  </div>
79
  </div>
@@ -84,8 +84,8 @@ $file_name = $file_parts['basename'];
84
  <div class="clearfix"></div>
85
  </div>
86
  <div class="replace-media-buttons">
87
- <button type="submit" class="button button-primary" disabled><?php echo esc_html_e("Change File", "bolders") ?></button>
88
- <button type="button" class="button button-secondary" onclick="history.back();"><?php echo esc_html_e("Cancel", "bolders") ?></button>
89
  </div>
90
  </div>
91
  </form>
32
  $file_name = $file_parts['basename'];
33
  ?>
34
  <div class="wrap">
35
+ <h2><?php esc_html_e("Replace Media", "folders"); ?></h2>
36
  <div class="file-type warning replace-message">
37
  <?php esc_html_e("Replacement file is not the same filetype. This might cause unexpected issues", "folders"); ?>
38
  </div>
73
  <!-- Drag and Drop container-->
74
  <div class="upload-area" id="upload-file">
75
  <div class="drag-and-drop-title">
76
+ <span><?php echo esc_html_e("Click here to upload file", "folders") ?></span>
77
  </div>
78
  </div>
79
  </div>
84
  <div class="clearfix"></div>
85
  </div>
86
  <div class="replace-media-buttons">
87
+ <button type="submit" class="button button-primary" disabled><?php echo esc_html_e("Replace File", "folders") ?></button>
88
+ <button type="button" class="button button-secondary" onclick="history.back();"><?php echo esc_html_e("Cancel", "folders") ?></button>
89
  </div>
90
  </div>
91
  </form>