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

Version Description

Undo your last action and fixed some bugs and plugin conflicts

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.9
Comparing to
See all releases

Code changes from version 2.6.8 to 2.6.9

assets/css/admin-setting.css CHANGED
@@ -1 +1 @@
1
- @import url(https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap);*,:after,:before{box-sizing:border-box}#wpwrap{background:#6572db;background:-moz-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:-webkit-gradient(left top,right bottom,color-stop(0,#6572db),color-stop(67%,#ee86c6),color-stop(100%,#ee86c6));background:-webkit-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:-o-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:-ms-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:linear-gradient(135deg,#6572db 0,#ee86c6 67%,#ee86c6 100%)}.pricing-table{margin:0 0 45px;color:#28375a;font-size:16px;line-height:25px;font-family:Lato,sans-serif}.price-title{font-weight:700;font-size:24px;line-height:30px;color:#28375a;text-align:center}.price-table{background:#fff;box-sizing:border-box;border-radius:10px;position:relative}.price-table-top{padding:20px;position:relative;border-radius:10px}.price-table.basic-feature{box-shadow:0 12px 44px rgba(108,203,255,.2);border:2px solid #b9eafd}.price-table.basic-feature .price-table-top{background:url(../images/basic-price-bg.png) no-repeat left top}.price-table.plus-feature{border:2px solid #f9d9bd;box-shadow:0 12px 44px rgba(239,140,106,.2)}.price-table.plus-feature .price-table-top{background:url(../images/plus-price.png) no-repeat left top}.price-table.agency-feature{border:2px solid #cfd3fb;box-shadow:0 12px 44px rgba(96,93,236,.2)}.price-table.agency-feature .price-table-top{background:url(../images/agency-price.png) no-repeat left top}.price-tables{margin:30px 0 50px}.plan-name{font-size:30px;line-height:36px;font-weight:700;color:#28375a}.plan-price{position:absolute;right:18px;top:8px;font-weight:700;font-size:60px;line-height:72px;color:#42b9fa}.price-table.plus-feature .plan-price{color:#ef8c6a}.price-table.agency-feature .plan-price{color:#605dec}.price-table.agency-feature .plan-name{color:#fff}.price-head{line-height:72px;padding:5px 0 25px 0}.price-offer,.price-websites{line-height:18px;font-size:15px}.cus-tooltip{cursor:pointer;display:inline-block;position:relative}.cus-tooltip .tooltip__content{background-color:#1849ab;border-radius:4px;bottom:150%;color:#fff;left:0;margin-left:15px;opacity:0;padding:5px 10px;position:absolute;transition:opacity .25s;visibility:hidden;width:auto;z-index:1;text-align:left;margin-right:15px;font-size:14px;line-height:20px}.cus-tooltip .tooltip__content::after{border-width:5px;border-style:solid;border-color:#1849ab transparent transparent transparent;content:"";left:25px;margin-left:-5px;position:absolute;top:100%}.cus-tooltip:hover .tooltip__content{opacity:1;visibility:visible}.price-table-middle ul{list-style:none;margin:0;padding:0}.price-table-middle ul li{display:block;width:100%;border-bottom:solid 1px #e9e9e9;padding:15px 0;margin:0}.price-table-middle ul li a{padding:0 15px;color:#28375a;font-size:16px;line-height:19px;display:block;text-decoration:none}span.has-tooltip{color:#605dec}.price-table-bottom{padding:15px}.price-table.is-fixed{padding-bottom:140px;position:relative}.price-table.is-fixed .price-table-bottom{position:fixed;left:0;width:100%;border-top:solid 2px #e9e9e9;background:#fff}.bottom-position{position:absolute;left:0;bottom:0;height:1px;width:1px}.custom-dd-btn{background:#fff;border:1px solid #e9e9e9;border-radius:6px;height:40px;line-height:40px;width:100%;text-align:left;padding:0 15px}.custom-dd{margin-bottom:15px}.price-table-bottom a{background:#fff;border:1px solid #42b9fa;color:#42b9fa;border-radius:20px;height:40px;line-height:38px;padding:0 15px;display:block;text-align:center;transition:all .25s linear}.price-table-bottom a:hover{color:#fff;background:#42b9fa}.price-table.plus-feature .price-table-bottom a{background:#ef8c6a;border:1px solid #ef8c6a;color:#fff}.price-table.plus-feature .price-table-bottom a:hover{background:#fff;color:#ef8c6a}.price-table.agency-feature .price-table-bottom a{background:#fff;border:1px solid #605dec;color:#605dec}.price-table.agency-feature .price-table-bottom a:hover{background:#605dec;color:#fff}.container{max-width:1180px;width:100%;padding:30px;background:#fff;border-radius:15px;margin:50px auto}.row{margin-right:-15px;margin-left:-15px}.col-md-4{padding-right:15px;padding-left:15px;width:33.33333333%;float:left}.select2-container--default .select2-selection--single{background:#fff;border:1px solid #e9e9e9;border-radius:6px;height:40px;line-height:40px;width:100%;text-align:left;padding:0 15px;outline:0}span.select2.select2-container{width:100%!important}.website-package{padding:0 15px;line-height:18px}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.website-package .select2-container--default .select2-results>.select2-results__options{margin-top:5px}.custom-dd .select2-container--default .select2-selection--single .select2-selection__arrow{height:20px;top:10px;right:1px;width:20px}@media (min-width:768px){.col-sm-4{width:100%;float:none}}a,a:focus,a:hover{text-decoration:none}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:38px}.select2-results__option{user-select:none;-webkit-user-select:none;font-size:14px;padding:8px 25px;margin:0}.select2-dropdown{border:1px solid #e9e9e9}.price-after{padding:0;text-align:center;font-size:16px;line-height:25px;font-family:Lato,sans-serif}.price-after p,.price-after span{font-size:16px;line-height:25px;margin:0;padding:0}.clearfix{clear:both}.price-after span{display:inline-block;vertical-align:text-top;font-size:20px;color:#42b9fa}.payments{padding:20px 0 10px}.folder-testimonial-list{width:100%;margin:30px auto 0;font-family:Lato,sans-serif}.folder-testimonial{position:relative}.folder-testimonial .testimonial-image{position:absolute;height:60px;width:60px;top:50%;margin-top:-30px;z-index:1;overflow:hidden;border-radius:30px}.folder-testimonial .testimonial-image img{width:100%;height:auto}.folder-testimonial .testimonial-data{position:relative;margin-left:30px;font-size:16px;line-height:22px;padding:10px 10px 10px 40px;background:#f5f5f5;border-radius:4px}.testimonial-title{font-weight:700;font-size:18px;padding:0 0 5px}.testimonial-author{font-size:16px;font-style:italic;font-weight:500;padding:5px 0 0}.plan-price span{font-size:16px;color:#28375a}.price-table-middle{margin-top:21px}.agency-feature .price-table-middle{margin-top:0}.website-package .select2-container--default .select2-selection--single{border:1px solid #6156f6;box-shadow:0 12px 44px rgba(96,93,236,.2)}.website-package .select2-container--default .select2-selection--single .select2-selection__rendered{color:#6156f6}.website-package .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#6156f6 transparent transparent transparent}.website-package .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #6156f6 transparent;border-width:0 4px 5px 4px}.folders-tabs{max-width:inherit}.basic-feature .price-table-bottom .select2-container--default .select2-selection--single{border:1px solid #42b9fa;box-shadow:0 12px 44px rgba(66,182,250,.2)}.basic-feature .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#42b9fa transparent transparent transparent}.plus-feature .price-table-bottom .select2-container--default .select2-selection--single{border:1px solid #ef8c6a;box-shadow:0 12px 44px rgba(239,140,106,.2)}.plus-feature .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#ef8c6a transparent transparent transparent}.agency-feature .price-table-bottom .select2-container--default .select2-selection--single{border:1px solid #6156f6;box-shadow:0 12px 44px rgba(96,93,236,.2)}.agency-feature .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#6156f6 transparent transparent transparent}.basic-feature.price-table.is-fixed .price-table-bottom{border-color:#b9eafd}.plus-feature.price-table.is-fixed .price-table-bottom{border-color:#f9d9bd}.agency-feature.price-table.is-fixed .price-table-bottom{border-color:#cfd3fb}@media (max-width:1320px){.plan-price{font-size:50px;line-height:64px}}@media (max-width:1200px){.plan-price{font-size:40px;line-height:54px}}@media (max-width:1100px){.plan-name{font-size:24px;line-height:36px}}@media (max-width:1024px){.plan-price{font-size:30px;line-height:54px;top:15px}}@media (max-width:920px){.col-md-4{padding-left:5px;padding-right:5px}}@media (max-width:840px){.col-md-4{padding:0;width:auto;margin:0 auto 30px;float:none;padding-left:15px;padding-right:15px}.plan-price{font-size:50px;line-height:64px}.price-table.is-fixed{padding-bottom:15px;position:relative}.price-table.is-fixed .price-table-bottom{position:relative;left:0;width:100%;border-top:none;background:#fff;top:auto!important;left:auto!important;width:100%!important}}
1
+ @import url(https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap);*,:after,:before{box-sizing:border-box}#wpwrap{background:#6572db;background:-moz-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:-webkit-gradient(left top,right bottom,color-stop(0,#6572db),color-stop(67%,#ee86c6),color-stop(100%,#ee86c6));background:-webkit-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:-o-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:-ms-linear-gradient(-45deg,#6572db 0,#ee86c6 67%,#ee86c6 100%);background:linear-gradient(135deg,#6572db 0,#ee86c6 67%,#ee86c6 100%)}.pricing-table{margin:0 0 45px;color:#28375a;font-size:16px;line-height:25px;font-family:Lato,sans-serif}.price-title{font-weight:700;font-size:24px;line-height:30px;color:#28375a;text-align:center}.price-table{background:#fff;box-sizing:border-box;border-radius:10px;position:relative}.price-table-top{padding:20px;position:relative;border-radius:10px}.price-table.basic-feature{box-shadow:0 12px 44px rgba(108,203,255,.2);border:2px solid #b9eafd}.price-table.basic-feature .price-table-top{background:url(../images/basic-price-bg.png) no-repeat left top}.price-table.plus-feature{border:2px solid #f9d9bd;box-shadow:0 12px 44px rgba(239,140,106,.2)}.price-table.plus-feature .price-table-top{background:url(../images/plus-price.png) no-repeat left top}.price-table.agency-feature{border:2px solid #cfd3fb;box-shadow:0 12px 44px rgba(96,93,236,.2)}.price-table.agency-feature .price-table-top{background:url(../images/agency-price.png) no-repeat left top}.price-tables{margin:30px 0 50px}.plan-name{font-size:30px;line-height:36px;font-weight:700;color:#28375a}.plan-price{position:absolute;right:18px;top:8px;font-weight:700;font-size:60px;line-height:72px;color:#42b9fa}.price-table.plus-feature .plan-price{color:#ef8c6a}.price-table.agency-feature .plan-price{color:#605dec}.price-table.agency-feature .plan-name{color:#fff}.price-head{line-height:72px;padding:5px 0 25px 0}.price-offer,.price-websites{line-height:18px;font-size:15px}.cus-tooltip{cursor:pointer;display:inline-block;position:relative}.cus-tooltip .tooltip__content{background-color:#1849ab;border-radius:4px;bottom:150%;color:#fff;left:0;margin-left:15px;opacity:0;padding:5px 10px;position:absolute;transition:opacity .25s;visibility:hidden;width:auto;z-index:1;text-align:left;margin-right:15px;font-size:14px;line-height:20px}.cus-tooltip .tooltip__content::after{border-width:5px;border-style:solid;border-color:#1849ab transparent transparent transparent;content:"";left:25px;margin-left:-5px;position:absolute;top:100%}.cus-tooltip:hover .tooltip__content{opacity:1;visibility:visible}.price-table-middle ul{list-style:none;margin:0;padding:0}.price-table-middle ul li{display:block;width:100%;border-bottom:solid 1px #e9e9e9;padding:15px 0;margin:0}.price-table-middle ul li a{padding:0 15px;color:#28375a;font-size:16px;line-height:19px;display:block;text-decoration:none}span.has-tooltip{color:#605dec}.price-table-bottom{padding:15px}.price-table.is-fixed{padding-bottom:140px;position:relative}.price-table.is-fixed .price-table-bottom{position:fixed;left:0;width:100%;border-top:solid 2px #e9e9e9;background:#fff}.bottom-position{position:absolute;left:0;bottom:0;height:1px;width:1px}.custom-dd-btn{background:#fff;border:1px solid #e9e9e9;border-radius:6px;height:40px;line-height:40px;width:100%;text-align:left;padding:0 15px}.custom-dd{margin-bottom:15px}.price-table-bottom a{background:#fff;border:1px solid #42b9fa;color:#42b9fa;border-radius:20px;height:40px;line-height:38px;padding:0 15px;display:block;text-align:center;transition:all .25s linear}.price-table-bottom a:hover{color:#fff;background:#42b9fa}.price-table.plus-feature .price-table-bottom a{background:#ef8c6a;border:1px solid #ef8c6a;color:#fff}.price-table.plus-feature .price-table-bottom a:hover{background:#fff;color:#ef8c6a}.price-table.agency-feature .price-table-bottom a{background:#fff;border:1px solid #605dec;color:#605dec}.price-table.agency-feature .price-table-bottom a:hover{background:#605dec;color:#fff}.container{max-width:1180px;width:100%;padding:30px;background:#fff;border-radius:15px;margin:50px auto}.row{margin-right:-15px;margin-left:-15px}.col-md-4{padding-right:15px;padding-left:15px;width:33.33333333%;float:left}.select2-container--default .select2-selection--single{background:#fff;border:1px solid #e9e9e9;border-radius:6px;height:40px;line-height:40px;width:100%;text-align:left;padding:0 15px;outline:0}span.select2.select2-container{width:100%!important}.website-package{padding:0 15px;line-height:18px}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.website-package .select2-container--default .select2-results>.select2-results__options{margin-top:5px}.custom-dd .select2-container--default .select2-selection--single .select2-selection__arrow{height:20px;top:10px;right:1px;width:20px}@media (min-width:768px){.col-sm-4{width:100%;float:none}}a,a:focus,a:hover{text-decoration:none}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:38px}.select2-results__option{user-select:none;-webkit-user-select:none;font-size:14px;padding:8px 25px;margin:0}.select2-dropdown{border:1px solid #e9e9e9}.price-after{padding:0;text-align:center;font-size:16px;line-height:25px;font-family:Lato,sans-serif}.price-after p,.price-after span{font-size:16px;line-height:25px;margin:0;padding:0}.clearfix{clear:both}.price-after span{display:inline-block;vertical-align:text-top;font-size:20px;color:#42b9fa}.payments{padding:20px 0 10px}.folder-testimonial-list{width:100%;margin:30px auto 0;font-family:Lato,sans-serif}.folder-testimonial{position:relative}.folder-testimonial .testimonial-image{position:absolute;height:60px;width:60px;top:50%;margin-top:-30px;z-index:1;overflow:hidden;border-radius:30px}.folder-testimonial .testimonial-image img{width:100%;height:auto}.folder-testimonial .testimonial-data{position:relative;margin-left:30px;font-size:16px;line-height:22px;padding:10px 10px 10px 40px;background:#f5f5f5;border-radius:4px}.testimonial-title{font-weight:700;font-size:18px;padding:0 0 5px}.testimonial-author{font-size:16px;font-style:italic;font-weight:500;padding:5px 0 0}.plan-price span{font-size:16px;color:#28375a}.price-table-middle{margin-top:21px}.agency-feature .price-table-middle{margin-top:0}.website-package .select2-container--default .select2-selection--single{border:1px solid #6156f6;box-shadow:0 12px 44px rgba(96,93,236,.2)}.website-package .select2-container--default .select2-selection--single .select2-selection__rendered{color:#6156f6}.website-package .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#6156f6 transparent transparent transparent}.website-package .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #6156f6 transparent;border-width:0 4px 5px 4px}.folders-tabs{max-width:inherit}.basic-feature .price-table-bottom .select2-container--default .select2-selection--single{border:1px solid #42b9fa;box-shadow:0 12px 44px rgba(66,182,250,.2)}.basic-feature .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#42b9fa transparent transparent transparent}.plus-feature .price-table-bottom .select2-container--default .select2-selection--single{border:1px solid #ef8c6a;box-shadow:0 12px 44px rgba(239,140,106,.2)}.plus-feature .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#ef8c6a transparent transparent transparent}.agency-feature .price-table-bottom .select2-container--default .select2-selection--single{border:1px solid #6156f6;box-shadow:0 12px 44px rgba(96,93,236,.2)}.agency-feature .select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#6156f6 transparent transparent transparent}.basic-feature.price-table.is-fixed .price-table-bottom{border-color:#b9eafd}.plus-feature.price-table.is-fixed .price-table-bottom{border-color:#f9d9bd}.agency-feature.price-table.is-fixed .price-table-bottom{border-color:#cfd3fb}.html-tooltip{position:relative;display:inline-block;margin:0;padding:0;line-height:1;width:auto;height:20px;vertical-align:middle}.html-tooltip .tooltip-text{visibility:hidden;width:300px;background-color:#1849ab;color:#fff;text-align:center;border-radius:6px;padding:10px;position:absolute;z-index:1201;bottom:125%;left:50%;margin-left:-150px;opacity:0;transition:opacity .3s;font-size:12px;line-height:18px;top:100%;height:354px}.html-tooltip.side .tooltip-text{bottom:125%;left:100%;margin-left:0;top:5px;transform:translateY(-50%);-webkit-transform:translateY(-50%)}.html-tooltip.dynamic .tooltip-text{height:490px}.html-tooltip:hover .tooltip-text{visibility:visible;opacity:1}.html-tooltip .tooltip-text img{width:100%;height:auto;display:block;margin:10px 0 0 0}.html-tooltip.no-position .tooltip-text{height:auto}.html-tooltip .tooltip-text:after{content:"";position:absolute;top:-10px;left:50%;margin-left:-15px;border-width:5px;border-style:solid;border-color:#1849ab transparent transparent transparent;transform:rotate(180deg);-webkit-transform:rotate(180deg)}.html-tooltip.top .tooltip-text{top:auto;bottom:100%;margin-bottom:5px}.html-tooltip.top .tooltip-text:after{top:100%;transform:rotate(0);-webkit-transform:rotate(0)}.html-tooltip.side .tooltip-text:after{display:none}@media (max-width:1320px){.plan-price{font-size:50px;line-height:64px}}@media (max-width:1200px){.plan-price{font-size:40px;line-height:54px}}@media (max-width:1100px){.plan-name{font-size:24px;line-height:36px}}@media (max-width:1024px){.plan-price{font-size:30px;line-height:54px;top:15px}}@media (max-width:920px){.col-md-4{padding-left:5px;padding-right:5px}}@media (max-width:840px){.col-md-4{padding:0;width:auto;margin:0 auto 30px;float:none;padding-left:15px;padding-right:15px}.plan-price{font-size:50px;line-height:64px}.price-table.is-fixed{padding-bottom:15px;position:relative}.price-table.is-fixed .price-table-bottom{position:relative;left:0;width:100%;border-top:none;background:#fff;top:auto!important;left:auto!important;width:100%!important}}
assets/css/folders.css CHANGED
@@ -216,4 +216,84 @@ li.jstree-node .jstree-hovered .star-icon, li.jstree-node .jstree-hovered .stick
216
  }
217
  .popup-form-data {
218
  position: relative;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  }
216
  }
217
  .popup-form-data {
218
  position: relative;
219
+ }
220
+
221
+ .folders-undo-notification {
222
+ position: fixed;
223
+ right: -500px;
224
+ bottom: 25px;
225
+ width: 280px;
226
+ background: #fff;
227
+ padding: 15px;
228
+ -webkit-box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), 0 9px 28px 8px rgb(0 0 0 / 5%);
229
+ box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), 0 9px 28px 8px rgb(0 0 0 / 5%);
230
+ transition: all 0.25s linear;
231
+ z-index: 1001;
232
+ }
233
+ .folders-undo-notification.active {
234
+ right: 25px;
235
+ }
236
+ .folders-undo-header {
237
+ font-weight: 500;
238
+ font-size: 14px;
239
+ padding: 0 0 3px 0;
240
+ }
241
+ .folders-undo-body {
242
+ font-size: 13px;
243
+ padding: 0 0 5px 0;
244
+ }
245
+ .folders-undo-footer {
246
+ text-align: right;
247
+ padding: 5px 0 0 0;
248
+ }
249
+ .folders-undo-footer .undo-button {
250
+ background: #1da1f4;
251
+ border: none;
252
+ color: #fff;
253
+ padding: 3px 10px;
254
+ font-size: 12px;
255
+ border-radius: 2px;
256
+ cursor: pointer;
257
+ }
258
+ .folders-undo-body {
259
+ position: relative;
260
+ }
261
+ .close-undo-box {
262
+ position: absolute;
263
+ right: -10px;
264
+ top: 0;
265
+ width: 16px;
266
+ height: 16px;
267
+ transition: all 0.25s linear;
268
+ }
269
+ .close-undo-box:hover {
270
+ transform: rotate(180deg);
271
+ }
272
+ .close-undo-box span {
273
+ display: block;
274
+ position: relative;
275
+ width: 16px;
276
+ height: 16px;
277
+ transition: all .2s linear;
278
+ }
279
+ .close-undo-box span:after, .close-undo-box span:before {
280
+ content: "";
281
+ position: absolute;
282
+ width: 12px;
283
+ height: 2px;
284
+ background-color: #333;
285
+ display: block;
286
+ border-radius: 2px;
287
+ transform: rotate(45deg);
288
+ top: 7px;
289
+ left: 2px;
290
+ }
291
+ .close-undo-box span:after {
292
+ transform: rotate(-45deg);
293
+ }
294
+ body.mobile .jstree-anchor span.folder-inline-edit {
295
+ width: 20px;
296
+ }
297
+ body.mobile .wp-list-table tr td .wcp-move-file {
298
+ opacity: 1;
299
  }
assets/css/folders.min.css CHANGED
@@ -1 +1 @@
1
- #custom-scroll-menu a,#custom-scroll-menu a:focus,#custom-scroll-menu a:hover{text-decoration:none;color:#333;outline:0;box-shadow:none}#js-tree-menu{padding:10px 10px 10px 0;background:#fff;box-shadow:0 4px 21px rgba(7,16,28,.1)}.pfolder-folder-close{font-size:16px}.jstree-open>a>.pfolder-folder-close:before{content:"\e902"}span.folder-actions{position:absolute;right:4px}.folder-actions span i{font-size:10px;width:16px;text-align:center}.folder-actions span{width:0;overflow:hidden;height:30px;line-height:30px;transition:all .2s linear;display:inline-block;font-size:10px;text-align:center}.folder-actions span.premio-folder-count{width:auto}a.jstree-anchor:hover span.folder-inline-edit{width:20px}#jstree-dnd{background-color:#cecece;border-radius:3px;display:block;height:32px;line-height:32px;margin:0;opacity:.8;overflow:hidden;padding:0 10px 0 40px;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;width:260px}#jstree-dnd .jstree-icon{top:6px;background-position:50%;background-repeat:no-repeat;background-size:contain;height:20px;width:20px;display:none}#js-tree-menu .folder-checkbox{display:none}#js-tree-menu.show-folder-checkbox .folder-checkbox{display:inline-block}#js-tree-menu.show-folder-checkbox .pfolder-folder-close{display:none}li.jstree-node.is-high>a .star-icon{width:16px;text-align:center;color:#ffc90e}li.jstree-node.is-sticky>a .sticky-icon{width:16px;text-align:center}li.jstree-node.is-sticky>a .sticky-icon i{font-size:12px}li.jstree-node .jstree-hovered .star-icon,li.jstree-node .jstree-hovered .sticky-icon{width:0!important}.js-tree-data{display:none}.cssload-container{width:100%;height:49px;text-align:center}.cssload-tube-tunnel{width:49px;height:49px;margin:0 auto;border:4px solid;border-radius:50%;border-color:#ccc;animation:cssload-scale 1035ms infinite linear;-o-animation:cssload-scale 1035ms infinite linear;-ms-animation:cssload-scale 1035ms infinite linear;-webkit-animation:cssload-scale 1035ms infinite linear;-moz-animation:cssload-scale 1035ms infinite linear}.ajax-preloader{padding:50px 0}@keyframes cssload-scale{0%{transform:scale(0);transform:scale(0)}90%{transform:scale(.7);transform:scale(.7)}100%{transform:scale(1);transform:scale(1)}}@-o-keyframes cssload-scale{0%{-o-transform:scale(0);transform:scale(0)}90%{-o-transform:scale(.7);transform:scale(.7)}100%{-o-transform:scale(1);transform:scale(1)}}@-ms-keyframes cssload-scale{0%{-ms-transform:scale(0);transform:scale(0)}90%{-ms-transform:scale(.7);transform:scale(.7)}100%{-ms-transform:scale(1);transform:scale(1)}}@-webkit-keyframes cssload-scale{0%{-webkit-transform:scale(0);transform:scale(0)}90%{-webkit-transform:scale(.7);transform:scale(.7)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-moz-keyframes cssload-scale{0%{-moz-transform:scale(0);transform:scale(0)}90%{-moz-transform:scale(.7);transform:scale(.7)}100%{-moz-transform:scale(1);transform:scale(1)}}.sticky-folders>ul>li>a>span.folder-actions>span{transition:all .25s linear}.sticky-folders>ul>li>a:hover .star-icon{width:0!important}.sticky-folders>ul>li>a:hover .folder-inline-edit{width:16px!important;text-align:center}.sticky-folders li.is-high a span.star-icon{width:16px;text-align:center;color:#ffc90e}.folder-menu-content .cssload-container{margin:100px 0 0 0}.dynamic-menu ul>li>a>span.dashicons{font-size:18px;text-align:left}.close-popup-button{position:absolute;right:-10px;top:-10px;width:20px;height:20px}.close-popup-button a{display:block;position:relative;width:20px;height:20px;color:#333;padding:2px;box-sizing:border-box}.close-popup-button a span{display:block;position:relative;width:16px;height:16px;transition:all .2s linear}.close-popup-button a span:after,.close-popup-button a span:before{content:"";position:absolute;width:12px;height:2px;background-color:#333;display:block;border-radius:2px;transform:rotate(45deg);top:7px;left:2px}.close-popup-button a span:after{transform:rotate(-45deg)}.close-popup-button a:hover span{transform:rotate(180deg)}.popup-form-data{position:relative}
1
+ #custom-scroll-menu a,#custom-scroll-menu a:focus,#custom-scroll-menu a:hover{text-decoration:none;color:#333;outline:0;box-shadow:none}#js-tree-menu{padding:10px 10px 10px 0;background:#fff;box-shadow:0 4px 21px rgba(7,16,28,.1)}.pfolder-folder-close{font-size:16px}.jstree-open>a>.pfolder-folder-close:before{content:"\e902"}span.folder-actions{position:absolute;right:4px}.folder-actions span i{font-size:10px;width:16px;text-align:center}.folder-actions span{width:0;overflow:hidden;height:30px;line-height:30px;transition:all .2s linear;display:inline-block;font-size:10px;text-align:center}.folder-actions span.premio-folder-count{width:auto}a.jstree-anchor:hover span.folder-inline-edit{width:20px}#jstree-dnd{background-color:#cecece;border-radius:3px;display:block;height:32px;line-height:32px;margin:0;opacity:.8;overflow:hidden;padding:0 10px 0 40px;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;width:260px}#jstree-dnd .jstree-icon{top:6px;background-position:50%;background-repeat:no-repeat;background-size:contain;height:20px;width:20px;display:none}#js-tree-menu .folder-checkbox{display:none}#js-tree-menu.show-folder-checkbox .folder-checkbox{display:inline-block}#js-tree-menu.show-folder-checkbox .pfolder-folder-close{display:none}li.jstree-node.is-high>a .star-icon{width:16px;text-align:center;color:#ffc90e}li.jstree-node.is-sticky>a .sticky-icon{width:16px;text-align:center}li.jstree-node.is-sticky>a .sticky-icon i{font-size:12px}li.jstree-node .jstree-hovered .star-icon,li.jstree-node .jstree-hovered .sticky-icon{width:0!important}.js-tree-data{display:none}.cssload-container{width:100%;height:49px;text-align:center}.cssload-tube-tunnel{width:49px;height:49px;margin:0 auto;border:4px solid;border-radius:50%;border-color:#ccc;animation:cssload-scale 1035ms infinite linear;-o-animation:cssload-scale 1035ms infinite linear;-ms-animation:cssload-scale 1035ms infinite linear;-webkit-animation:cssload-scale 1035ms infinite linear;-moz-animation:cssload-scale 1035ms infinite linear}.ajax-preloader{padding:50px 0}@keyframes cssload-scale{0%{transform:scale(0);transform:scale(0)}90%{transform:scale(.7);transform:scale(.7)}100%{transform:scale(1);transform:scale(1)}}@-o-keyframes cssload-scale{0%{-o-transform:scale(0);transform:scale(0)}90%{-o-transform:scale(.7);transform:scale(.7)}100%{-o-transform:scale(1);transform:scale(1)}}@-ms-keyframes cssload-scale{0%{-ms-transform:scale(0);transform:scale(0)}90%{-ms-transform:scale(.7);transform:scale(.7)}100%{-ms-transform:scale(1);transform:scale(1)}}@-webkit-keyframes cssload-scale{0%{-webkit-transform:scale(0);transform:scale(0)}90%{-webkit-transform:scale(.7);transform:scale(.7)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-moz-keyframes cssload-scale{0%{-moz-transform:scale(0);transform:scale(0)}90%{-moz-transform:scale(.7);transform:scale(.7)}100%{-moz-transform:scale(1);transform:scale(1)}}.sticky-folders>ul>li>a>span.folder-actions>span{transition:all .25s linear}.sticky-folders>ul>li>a:hover .star-icon{width:0!important}.sticky-folders>ul>li>a:hover .folder-inline-edit{width:16px!important;text-align:center}.sticky-folders li.is-high a span.star-icon{width:16px;text-align:center;color:#ffc90e}.folder-menu-content .cssload-container{margin:100px 0 0 0}.dynamic-menu ul>li>a>span.dashicons{font-size:18px;text-align:left}.close-popup-button{position:absolute;right:-10px;top:-10px;width:20px;height:20px}.close-popup-button a{display:block;position:relative;width:20px;height:20px;color:#333;padding:2px;box-sizing:border-box}.close-popup-button a span{display:block;position:relative;width:16px;height:16px;transition:all .2s linear}.close-popup-button a span:after,.close-popup-button a span:before{content:"";position:absolute;width:12px;height:2px;background-color:#333;display:block;border-radius:2px;transform:rotate(45deg);top:7px;left:2px}.close-popup-button a span:after{transform:rotate(-45deg)}.close-popup-button a:hover span{transform:rotate(180deg)}.popup-form-data{position:relative}.folders-undo-notification{position:fixed;right:-500px;bottom:25px;width:280px;background:#fff;padding:15px;-webkit-box-shadow:0 3px 6px -4px rgb(0 0 0 / 12%),0 6px 16px 0 rgb(0 0 0 / 8%),0 9px 28px 8px rgb(0 0 0 / 5%);box-shadow:0 3px 6px -4px rgb(0 0 0 / 12%),0 6px 16px 0 rgb(0 0 0 / 8%),0 9px 28px 8px rgb(0 0 0 / 5%);transition:all .25s linear;z-index:1001}.folders-undo-notification.active{right:25px}.folders-undo-header{font-weight:500;font-size:14px;padding:0 0 3px 0}.folders-undo-body{font-size:13px;padding:0 0 5px 0}.folders-undo-footer{text-align:right;padding:5px 0 0 0}.folders-undo-footer .undo-button{background:#1da1f4;border:none;color:#fff;padding:3px 10px;font-size:12px;border-radius:2px;cursor:pointer}.folders-undo-body{position:relative}.close-undo-box{position:absolute;right:-10px;top:0;width:16px;height:16px;transition:all .25s linear}.close-undo-box:hover{transform:rotate(180deg)}.close-undo-box span{display:block;position:relative;width:16px;height:16px;transition:all .2s linear}.close-undo-box span:after,.close-undo-box span:before{content:"";position:absolute;width:12px;height:2px;background-color:#333;display:block;border-radius:2px;transform:rotate(45deg);top:7px;left:2px}.close-undo-box span:after{transform:rotate(-45deg)}body.mobile .jstree-anchor span.folder-inline-edit{width:20px}body.mobile .wp-list-table tr td .wcp-move-file{opacity:1}
assets/css/replace-media.css CHANGED
@@ -1 +1,297 @@
1
- .replace-media-page{padding:10px;background:#fff;margin:10px 0 0}.replace-media-page p{padding:0 0 10px 0;margin:0}.preview-box{width:250px;height:250px;background:#f1f1f1;text-align:center;position:relative}.current-image-box,.new-image-box{float:left;margin:0 25px 0 0;border:1px solid #ddd}.preview-box span.dashicons{font-size:80px;width:auto;height:auto;line-height:250px}.preview-box span.image-size{font-size:12px;line-height:25px;opacity:.7;position:absolute;color:#ccc;left:48%;top:50%;transform:translate(-50%,-50%);background-color:#333;padding:5px 10px}.preview-box img{width:100%;height:auto;max-height:250px;object-fit:cover}.clearfix{clear:both}.file-option,.file-size{text-align:center;padding:5px;height:20px;line-height:20px}.file-size.hide-it{display:none}.replace-message{display:none;background:#fff;padding:8px;margin:10px 0}.replace-message.active{display:block}.replace-message.warning{border-left:4px solid #ffb900}.replace-message.error{border-left:4px solid red}.replace-message.success{border-left:4px solid green}.upload-area .drag-and-drop-title{text-align:center;font-weight:400;width:250px;height:250px;position:relative;cursor:pointer}.upload-area .drag-and-drop-title span:not(.image-size){position:absolute;left:48%;top:50%;transform:translate(-50%,-50%);padding:5px 10px;width:140px}#media_file{display:none}.replacement-options{margin:20px 0 0;border-top:solid 1px #ddd}.replace-media-buttons{padding:14px 0 0}.replace-media-buttons button.button{margin:0 5px 0 0}.file-size a{color:#ff5983;text-decoration:none;font-weight:500}.upgrade-btn-box{display:none;font-size:12px;line-height:25px;position:absolute;color:#ccc;left:48%;top:50%;transform:translate(-50%,-50%)}#upload-file.active:hover .image-size{display:none}#upload-file.active:hover .upgrade-btn-box{display:block}.upgrade-btn-box a{padding:5px 10px;text-decoration:none;background:#ff5983;color:#fff;font-weight:500;border-radius:4px;text-align:center;display:inline-block;line-height:1.5;opacity:.8}.upgrade-btn-box a:hover{opacity:1}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .replace-media-page {
2
+ padding: 20px;
3
+ background: #fff;
4
+ margin: 10px 0 0;
5
+ max-width: 1024px
6
+ }
7
+
8
+ .replace-media-page p {
9
+ padding: 0 0 10px 0;
10
+ margin: 0
11
+ }
12
+
13
+ .preview-box {
14
+ width: 250px;
15
+ height: 250px;
16
+ background: #f1f1f1;
17
+ text-align: center;
18
+ position: relative
19
+ }
20
+
21
+ .current-image-box, .new-image-box {
22
+ float: left;
23
+ margin: 0 25px 0 0;
24
+ border: 1px solid #ddd
25
+ }
26
+
27
+ .preview-box span.dashicons {
28
+ font-size: 80px;
29
+ width: auto;
30
+ height: auto;
31
+ line-height: 250px
32
+ }
33
+
34
+ .preview-box span.image-size {
35
+ font-size: 12px;
36
+ line-height: 25px;
37
+ opacity: .7;
38
+ position: absolute;
39
+ color: #ccc;
40
+ left: 48%;
41
+ top: 50%;
42
+ transform: translate(-50%, -50%);
43
+ background-color: #333;
44
+ padding: 5px 10px
45
+ }
46
+
47
+ .preview-box img {
48
+ width: 100%;
49
+ height: auto;
50
+ max-height: 250px;
51
+ object-fit: cover
52
+ }
53
+
54
+ .clearfix {
55
+ clear: both
56
+ }
57
+
58
+ .file-option, .file-size {
59
+ text-align: center;
60
+ padding: 5px;
61
+ height: 20px;
62
+ line-height: 20px
63
+ }
64
+
65
+ .file-size.hide-it {
66
+ display: none
67
+ }
68
+
69
+ .replace-message {
70
+ display: none;
71
+ background: #fff;
72
+ padding: 8px;
73
+ margin: 15px 0
74
+ }
75
+
76
+ .replace-message.active {
77
+ display: block
78
+ }
79
+
80
+ .replace-message.warning {
81
+ border: solid 1px #ea580c;
82
+ border-left: 4px solid #ea580c;
83
+ margin: 15px 0;
84
+ color: #ea580c;
85
+ text-align: center;
86
+ font-size: 15px
87
+ }
88
+
89
+ .replace-message.warning span.dashicons.dashicons-warning {
90
+ color: #ea580c
91
+ }
92
+
93
+ .replace-message.error {
94
+ border-left: 4px solid red
95
+ }
96
+
97
+ .replace-message.success {
98
+ border-left: 4px solid green
99
+ }
100
+
101
+ .upload-area .drag-and-drop-title {
102
+ text-align: center;
103
+ font-weight: 400;
104
+ width: 250px;
105
+ height: 250px;
106
+ position: relative;
107
+ cursor: pointer
108
+ }
109
+
110
+ .upload-area .drag-and-drop-title span:not(.image-size) {
111
+ position: absolute;
112
+ left: 48%;
113
+ top: 50%;
114
+ transform: translate(-50%, -50%);
115
+ padding: 5px 10px;
116
+ width: 140px
117
+ }
118
+
119
+ #media_file {
120
+ display: none
121
+ }
122
+
123
+ .replacement-options {
124
+ margin: 20px 0 0;
125
+ border-top: solid 1px #ddd
126
+ }
127
+
128
+ .replace-media-buttons {
129
+ padding: 14px 0 0
130
+ }
131
+
132
+ .replace-media-buttons button.button {
133
+ margin: 0 5px 0 0
134
+ }
135
+
136
+ .file-size a {
137
+ color: #ff5983;
138
+ text-decoration: none;
139
+ font-weight: 500
140
+ }
141
+
142
+ .upgrade-btn-box {
143
+ display: none;
144
+ font-size: 12px;
145
+ line-height: 25px;
146
+ position: absolute;
147
+ color: #ccc;
148
+ left: 48%;
149
+ top: 50%;
150
+ transform: translate(-50%, -50%)
151
+ }
152
+
153
+ #upload-file.active:hover .image-size {
154
+ display: none
155
+ }
156
+
157
+ #upload-file.active:hover .upgrade-btn-box {
158
+ display: block
159
+ }
160
+
161
+ .upgrade-btn-box a {
162
+ padding: 5px 10px;
163
+ text-decoration: none;
164
+ background: #ff5983;
165
+ color: #fff;
166
+ font-weight: 500;
167
+ border-radius: 4px;
168
+ text-align: center;
169
+ display: inline-block;
170
+ line-height: 1.5;
171
+ opacity: .8
172
+ }
173
+
174
+ .upgrade-btn-box a:hover {
175
+ opacity: 1
176
+ }
177
+
178
+ .media-top-box {
179
+ padding: 15px;
180
+ border: solid 1px #ddd
181
+ }
182
+
183
+ .media-bottom-box {
184
+ margin: 20px 0 0 0
185
+ }
186
+
187
+ .media-bottom-box-left, .media-bottom-box-right {
188
+ width: 50%;
189
+ box-sizing: border-box;
190
+ padding: 0 0 0 8px;
191
+ float: left
192
+ }
193
+
194
+ .media-bottom-box-left {
195
+ padding: 0 8px 0 0
196
+ }
197
+
198
+ .media-setting {
199
+ padding: 15px;
200
+ border: solid 1px #ddd;
201
+ min-height: 241px
202
+ }
203
+
204
+ .clear {
205
+ clear: both
206
+ }
207
+
208
+ .media-title {
209
+ font-size: 16px;
210
+ border-bottom: 1px solid #ccc;
211
+ padding: 0 0 10px 0;
212
+ margin: 0 0 10px 0
213
+ }
214
+
215
+ .media-option label {
216
+ display: inline-block;
217
+ font-size: 1.2em;
218
+ vertical-align: middle;
219
+ line-height: 1.2
220
+ }
221
+
222
+ .media-note {
223
+ color: #666;
224
+ display: block;
225
+ font-size: 13px;
226
+ padding: 5px 0 10px 0
227
+ }
228
+
229
+ .media-form ul {
230
+ margin: 0
231
+ }
232
+
233
+ .custom-date label {
234
+ display: block;
235
+ padding: 5px 0 3px 0
236
+ }
237
+
238
+ input.media-date {
239
+ width: 120px
240
+ }
241
+
242
+ input.media-time {
243
+ width: 40px;
244
+ text-align: center
245
+ }
246
+
247
+ .inline, .inline-block {
248
+ display: inline-block;
249
+ vertical-align: middle
250
+ }
251
+
252
+ .inline-block {
253
+ padding: 0 2px
254
+ }
255
+
256
+ .custom-date {
257
+ padding: 0 0 10px 0;
258
+ display: none
259
+ }
260
+ .media-bottom-box.pro:hover .media-bottom-pro {
261
+ filter: blur(1.4px);
262
+ }
263
+ .media-bottom-box.pro {
264
+ position: relative;
265
+ }
266
+ .media-bottom-pro-button {
267
+ position: absolute;
268
+ top: 0;
269
+ left: 0;
270
+ width: 100%;
271
+ height: 100%;
272
+ background: rgba(0,0,0,0.4);
273
+ display: none;
274
+ }
275
+ .pro-button {
276
+ position: absolute;
277
+ top: 50%;
278
+ left: 0;
279
+ right: 0;
280
+ margin: 0 auto;
281
+ text-align: center;
282
+ transform: translate(0, -50%);
283
+ }
284
+ .pro-button a {
285
+ display: inline-block;
286
+ padding: 5px 10px;
287
+ text-decoration: none;
288
+ background: #ff5983;
289
+ color: #fff;
290
+ font-weight: 500;
291
+ border-radius: 4px;
292
+ text-align: center;
293
+ line-height: 1.5;
294
+ }
295
+ .media-bottom-box.pro:hover .media-bottom-pro-button {
296
+ display: block;
297
+ }
assets/css/settings.css CHANGED
@@ -1 +1 @@
1
- @import url(https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap);span.upgrade-message{padding:5px 10px;background:#fff;display:inline-block;font-size:14px;color:#000}a.pink,span.pink{color:#ff5983;text-decoration:none;font-weight:700}.form-table{margin:0}#setting-form{font-family:Roboto,sans-serif}.form-table th{width:220px;font-weight:400;vertical-align:middle}.form-table th.default-folder{width:100px}.premio-help{text-align:center}.premio-help a{display:block;float:right}.premio-help a img{width:auto;height:auto}.hide-option{display:none}.accordion{max-width:1024px;box-shadow:0 4px 21px rgba(7,16,28,.1);border-radius:4px;margin:0 0 20px 0}.accordion-header{background:#ebf1f4;padding:10px 15px;font-size:16px;cursor:pointer;border-radius:4px;color:#484848;font-weight:500}.accordion-header.active{border-radius:0;-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}.accordion-header.active span{transform:rotate(180deg)}select.hide-show-option{width:170px}.sp-replacer.sp-light{padding:0!important;margin:0!important;border:solid 2px #fff!important;box-shadow:0 3px 7px rgba(149,149,150,.3);border-radius:4px}.sp-dd{display:none!important}.sp-preview{width:18px!important;height:18px!important;margin:0!important;padding:0!important;border:none!important}.form-table select{width:268px;border-radius:6px}.accordion-header span{float:right;width:20px;height:20px;line-height:22px;font-size:14px;background:#fff;border-radius:10px}.accordion-header span:hover{background:#1da1f4;color:#fff}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.add-new-folder,button.organize-button{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:26px;font-size:14px;margin-right:5px}.add-new-folder span.folder-icon-create_new_folder{font-size:20px}.form-options{background:#fff;padding:10px 10px 0 10px;margin:0 0;box-shadow:0 4px 21px rgba(7,16,28,.1);border-radius:4px}.shadow-box{padding:10px;box-shadow:0 4px 21px rgba(7,16,28,.1);margin:20px 0 0 0}.accordion .separator{border-bottom:solid 1px #e9e5e5}.form-options ul{margin:0;padding:0}.form-options li{display:inline-block;margin:0;vertical-align:top}.form-options li a{display:inline-block;text-decoration:none;padding:5px 12px;color:#484848;vertical-align:middle;margin:0 0 10px 0;background:#f1f1f1;border-radius:4px;font-size:11px;line-height:20px}.form-options span.icon{font-size:14px;display:inline-block;vertical-align:top;line-height:20px;color:#a4c0d2}.form-options li.last{margin:0}.form-options li.last a{padding:5px 3px 3px;width:24px;text-align:center;height:22px;line-height:20px}.form-options li.last{font-size:28px;line-height:22px}.header-posts a,.un-categorised-items a{color:#444;padding:7px;border-radius:3px;display:block;text-decoration:none;font-size:14px;line-height:18px}.header-posts a.active-item,.un-categorised-items.active-item{background:#008ec2;color:#fff}span.total-count{float:right;font-size:12px!important;line-height:16px;border-radius:2px}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#fff!important}.media-buttons{padding:10px 0;background:#fff;text-align:center}.media-buttons button,.media-buttons select{width:48%;display:inline-block;margin:0 2% 0 0}.un-categorised-items{margin:0 0 10px 0}.header-posts{margin:10px 0 0 0}.add-new-folder:focus,.add-new-folder:hover,.organize-button:focus,.organize-button:hover{color:#fff}.add-new-folder:hover:after,.organize-button:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.folder-list li a{color:#333;text-decoration:none;margin:0 0 1px 0;border-radius:3px;font-size:20px;display:block;line-height:18px}.folder-list li a i{display:inline-block;vertical-align:middle;font-size:14px}.folder-list li a span{font-size:16px;display:inline-block;vertical-align:middle}.preview-inner-box{padding:15px;width:300px;max-width:100%;float:left;background:#fff;border:1px solid #dbdbdb;box-sizing:border-box;border-radius:4px}.accordion-left{width:calc(100% - 215px);float:left}.accordion-right{width:205px;float:right}#customize-folders .accordion-left{width:calc(100% - 310px)}#customize-folders .accordion-right{width:305px}.preview-text{font-size:20px;padding:0 0 10px}.preview-text-info{padding:10px 0 0;font-size:12px;line-height:12px}.media-select option{color:#000}.media-select option:first-child{font-weight:700}.folder-popup{position:fixed;width:100%;height:100%;top:0;left:0;z-index:100001;background:rgba(0,0,0,.75)}.folder-popup-box{padding:0;width:600px;max-width:100%;margin:auto;top:50%;position:absolute;left:0;right:0;border-radius:5px;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);text-align:center;background:#fcfcfc}.folder-popup-header{padding:15px;font-size:20px;border-bottom:solid 1px #e6e6e6}.folder-popup-content{background:#fff;padding:15px;font-size:14px;line-height:20px}.folder-popup-content iframe{margin:30px 0}.folder-popup-footer{padding:15px;border-top:solid 1px #e6e6e6}.folder-popup-footer button{border:none;padding:10px 20px;border-radius:4px;background:#00c478;color:#fff}.close-folder-popup{margin:0;padding:0;background:0 0;border:none;float:right;background:#000;border-radius:50%;color:#fff;text-align:center;width:24px;height:24px}.close-folder-popup span{line-height:24px}.wrap h1{margin:0 0 15px 0}.upgrade-btn{background:#fff;border:1px solid #1da1f4;box-sizing:border-box;border-radius:4px;height:34px;line-height:34px;padding:0 25px;display:inline-block;text-decoration:none;font-weight:700;color:#1da1f4}.upgrade-btn:hover{background:#1da1f4;color:#fff}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.custom-checkbox span{background:#fff;border:1px solid #dbdbdb;box-sizing:border-box;border-radius:4px;margin:0 auto;height:18px;width:18px;display:inline-block;vertical-align:middle;position:relative;color:#fff}.custom-checkbox input:disabled+span{background:#f0f0f0}.submit-button{padding:10px 0 0 0}.custom-checkbox input:checked+span{background:#1da1f4}.custom-checkbox input:checked+span:after{content:"\f147";font-family:dashicons;display:inline-block;line-height:1;font-weight:400;font-style:normal;text-decoration:inherit;font-size:14px}.custom-checkbox{display:inline-block}.form-table td.no-padding{padding:0}#folder-settings .form-table td.no-padding{width:20px}.custom-checkbox+label{display:inline-block;vertical-align:middle;font-size:14px;padding:0 5px 0 8px}ul.folder-list li{margin:0;line-height:32px;padding:0}ul.folder-list li a{padding:5px 10px}.un-categorised-items a:hover,ul.folder-list li a:hover{background:rgba(250,22,107,.08);border-radius:4px}.clear{clear:both}.form-options li .custom-checkbox{margin:5px 0 0 0}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}.premio-help-btn{width:180px;text-align:center;padding:15px;border:1px solid #ebf1f4;box-sizing:border-box;border-radius:4px;float:right}.need-help{font-style:normal;font-weight:500;font-size:15px;line-height:18px;color:#484848}.visit-our{font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;color:#484848}.knowledge-base{font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;color:#1da1f4;text-decoration:underline}.form-table td.default-folder{width:100px}.accordion-content.no-bp{padding-bottom:0!important}.folders-tabs{background:#fff;max-width:1024px;box-shadow:0 4px 21px rgba(7,16,28,.1);border-radius:4px;margin:0 0 20px 0}.folder-tab-menu{background:#ebf1f4;padding:5px 15px 0;font-size:16px;cursor:pointer;color:#484848;font-weight:500;-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}.folder-tab-menu ul{margin:0;padding:0}.folder-tab-menu ul li{display:inline-block;margin:0 1px 0 0}.folder-tab-menu ul li a{display:inline-block;padding:10px 15px;font-family:Roboto,sans-serif;text-decoration:none;font-size:16px;color:#484848;-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;outline:0;transition:all .2s ease-in-out}.folder-tab-menu ul li a.active,.folder-tab-menu ul li a:focus,.folder-tab-menu ul li a:hover{background:#fff;box-shadow:none;color:#000}.folder-tab-content{padding:15px}.folder-tab-content .tab-content{display:none;min-height:20vh}.folder-tab-content .tab-content.active{display:block}p.submit{margin:0;padding:0}.no-plugin-message p{font-size:14px;margin:0;padding:0}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none;font-family:Roboto,sans-serif}.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;max-width:80%}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0 20px;color:#595959;text-align:center;text-transform:none;word-wrap:break-word;font-weight:700;font-size:22px;line-height:26px}.add-folder-note{padding:10px 0 30px;min-height:35px}.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:0 3px!important;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;box-shadow:none}.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}.folder-form-buttons a.delete-button,.folder-form-buttons button.delete-button{border:solid 1px #860000;background-color:#d40000;color:#fff}.folder-form-buttons button:disabled{border:solid 1px #868686;background-color:#a5a5a5}.import-folder-table table{border-collapse:collapse;border:solid 1px silver}.import-folder-table td,.import-folder-table th{border:solid 1px silver;padding:10px 15px;text-align:left;font-size:14px;vertical-align:top}.import-folder-table th{width:220px}#import-third-party-plugin-data .import-folder-table th{width:120px}#import-third-party-plugin-data .import-folder-table td span.import-message{display:inline-block;margin:0 0 0 5px;line-height:30px}#import-third-party-plugin-data .popup-form-content{width:430px}.import-folder-table td span.import-message{display:block;margin:0 0 5px 0}.import-folder-table td button.button{margin:0 5px 0 0}.import-folder-table td button.button.remove-folder-data{background:0 0;border-color:transparent;color:#3c85f7}.import-folder-table td button.button.button-primary{background:#fff;color:#3c85f7;border:solid 1px #3c85f7}.import-folder-table td span.spinner{display:none}.import-folder-table td span.spinner.active{display:inline-block;visibility:visible;margin-right:0}.import-folder-table td span.import-message.success-import{background:#c6ffc6;padding:10px;color:green;margin:0 0 10px 0}.import-folder-table td span.import-message.error-import{background:#ffeded;padding:10px;color:red;margin:0 0 10px 0}.import-folder-title,.import-plugin-title,.remove-folder-title{font-size:16px;font-weight:700;padding:0 0 15px 0}.import-folder-note,.remove-folder-note{min-height:50px;padding:0 0 20px 0}button#remove-folder-button.delete-folder-plugin{color:#fff;background:#ca0000;border-color:#ca0000}.popup-content{position:relative}.close-popup-button{position:absolute;right:-10px;top:-2px;width:20px;height:20px}.close-popup-button a{display:block;position:relative;width:20px;height:20px;color:#333;padding:2px;box-sizing:border-box}.close-popup-button a:hover span{transform:rotate(180deg)}.close-popup-button a span{display:block;position:relative;width:16px;height:16px;transition:all .2s linear}.close-popup-button a span:after,.close-popup-button a span:before{content:"";position:absolute;width:12px;height:2px;background-color:#333;display:block;border-radius:2px;transform:rotate(45deg);top:7px;left:2px}.close-popup-button a span:after{transform:rotate(-45deg)}.import-plugin-note{padding:0 0 20px 0}.import-folder-table table{width:100%;margin:0 0 20px 0}.import-plugin-footer{padding:0 30px 15px}.input-field label{display:block;font-weight:700;padding-bottom:5px}.license-key-footer{font-weight:700;padding-bottom:15px;font-size:16px;line-height:30px}input.license-key{width:100%;max-width:250px}.submit{text-align:left;max-width:100%;margin-top:0;padding-top:10px}.folder-error-message,.folder-success-message{background:#fff;margin:10px 0 10px 0;padding:10px 10px 10px 10px;border-left:solid 3px #dd4b39}.folder-success-message{border-left:solid 3px #00a65a}.folder-tab-content .separator{border-bottom:solid 1px #e9e5e5;margin:20px 0 10px}.folder-form-message{padding:30px 50px 40px}.folder-switch{display:inline-block;height:24px;line-height:24px;position:relative;padding:0 0 0 60px!important}.folder-switch input{display:none}.folder-slider{background-color:#ababab;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:.4s;width:50px;height:24px}.folder-slider.round{border-radius:34px}.folder-slider:before{background-color:#fff;bottom:4px;content:"";height:16px;left:4px;position:absolute;transition:.2s;width:16px}.folder-slider.round:before{border-radius:50%}.folder-slider:after{content:"off";color:#fff;display:inline-block;padding:0 0 0 25px;font-size:14px;line-height:24px;position:absolute;left:0;top:0}input:checked+.folder-slider{background-color:#b91c1c}input:checked+.folder-slider:before{transform:translateX(26px)}input:checked+.folder-slider:after{padding:0 0 0 8px;content:"on"}.media-details{padding:5px 0 10px}.media-setting-box{margin:10px 0 0 0;display:none}.media-setting-box.active{display:block}.inline-checkbox+.inline-checkbox{padding:5px 0 0 0}.folder-danger-zone{max-width:610px;width:100%}.danzer-title{font-size:16px;font-weight:700;line-height:20px;color:#dc2626;margin:30px 0 0 0;display:block;padding:0}.danzer-title span{color:#dc2626}a.remove-folders-data{border:2px solid #b91c1c;box-sizing:border-box;border-radius:5px;display:block;text-align:center;line-height:30px;padding:0;text-decoration:none;color:#b91c1c;font-weight:500}.remove-folders-data a{color:#d40000;font-weight:700;display:inline-block;vertical-align:middle}.media-setting-box .select2-container{width:100%!important}.media-setting-box li{margin:0;padding:0}.media-setting-box .select2-container .select2-search--inline .select2-search__field{margin:6px 0 0 0;padding:0;min-height:20px;height:20px}.folder-tooltip{display:inline-block;position:relative;vertical-align:middle}.folder-tooltip:after,.folder-tooltip:before{position:absolute;opacity:0;pointer-events:none;left:50%;content:"";color:#fff}.folder-tooltip:before{top:-8px;transform:translateX(-50%);height:10px;width:0;border-width:10px 5px 0;border-style:solid;border-color:#333 transparent transparent}.folder-tooltip:after{text-align:center;content:"" attr(data-title) "";font-size:11px;top:0;transform:translate(-50%,calc(-100% - 6px));padding:6px 20px;min-width:90px;background-color:#333;box-shadow:0 2px 4px rgba(0,0,0,.15);border-radius:6px;width:250px;white-space:break-spaces;line-height:16px;z-index:10001}.folder-tooltip:hover:after,.folder-tooltip:hover:before{opacity:1;pointer-events:auto}.folder-notification-title{padding:5px 0 0 0;font-weight:500}.folder-notification-note{padding:0 0 5px 0}.text-left{text-align:left}.input-box input{width:100%}.delete-confirmation-message{font-weight:500;color:#d00;padding-top:2px;min-height:20px;line-height:20px}.input-box{padding:3px 0 0}span.danger-info{color:#7f1d1d;font-weight:500;font-size:16px;line-height:27px;display:block}.import-export-table{width:100%}.import-export-table tr td{padding:0 0 10px 0;vertical-align:middle}.import-export-table tr td.last-td{width:100px;text-align:center;padding:0 0 0 20px}.folder-text span{color:#3c85f7;font-weight:500}span.folder-info{display:block;line-height:24px;font-size:18px;font-weight:500;vertical-align:middle;padding:0 0 5px 0}a.import-folders-button{border:2px solid #3c85f7;box-sizing:border-box;border-radius:5px;display:block;text-align:center;line-height:30px;padding:0;text-decoration:none;color:#3c85f7;font-weight:500}a.contact-folders-button{border:2px solid #64748b;box-sizing:border-box;border-radius:5px;display:block;text-align:center;line-height:30px;padding:0;text-decoration:none;color:#64748b;font-weight:500}#import-folders-popup .popup-form-content{width:500px}#import-folders-popup th{width:auto}#import-folders-popup td{width:250px}.no-more-plugins{display:none}.no-more-plugins.active{display:table-row}button.upgrade-link{display:inline-block;vertical-align:middle;background:#a07bf4;color:#fff;text-decoration:none;padding:2px 6px;font-size:11px;margin:0 0 0 5px;border-radius:4px;border:none;cursor:pointer}.send-user-to-pro:hover .normal-box{filter:blur(1px)}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#fff!important;cursor:default}.send-user-to-pro,.send-user-to-pro .normal-box{position:relative}.send-user-to-pro .upgrade-box{position:absolute;left:0;top:0;width:100%;text-align:center;height:100%;cursor:pointer;display:block}.send-user-to-pro .upgrade-box button{background:#1a75ff;color:#fff;text-decoration:none;border-radius:4px;display:none;position:absolute;top:50%;left:0;right:0;margin:0 auto;width:120px;transform:translate(0,-50%);border:none;padding:5px 0;cursor:pointer}.send-user-to-pro:hover .upgrade-box button{display:inline-block}a.upgrade-box-link{text-decoration:none;color:#333;display:inline-block;position:relative}a.upgrade-box-link>label{padding:0 5px 0 0}a.upgrade-box-link:hover{color:#1da1f4}.html-tooltip{position:relative;display:inline-block}.html-tooltip .tooltip-text{visibility:hidden;width:300px;background-color:#333;color:#fff;text-align:center;border-radius:6px;padding:10px;position:absolute;z-index:1201;bottom:125%;left:50%;margin-left:-150px;opacity:0;transition:opacity .3s;font-size:12px;line-height:18px;top:100%;height:354px}.html-tooltip.no-position .tooltip-text{height:auto}.html-tooltip .tooltip-text:after{content:"";position:absolute;top:-10px;left:50%;margin-left:-15px;border-width:5px;border-style:solid;border-color:#333 transparent transparent transparent;transform:rotate(180deg);-webkit-transform:rotate(180deg)}.html-tooltip:hover .tooltip-text{visibility:visible;opacity:1}.html-tooltip .tooltip-text img{width:100%;height:auto;display:block;margin:10px 0 0 0}.html-tooltip.top .tooltip-text{top:auto;bottom:100%;margin-bottom:5px}.html-tooltip.top .tooltip-text:after{top:100%;transform:rotate(0);-webkit-transform:rotate(0)}.html-tooltip.side .tooltip-text{bottom:125%;left:100%;margin-left:0;top:5px;transform:translateY(-50%);-webkit-transform:translateY(-50%)}.html-tooltip.side .tooltip-text:after{top:50%;left:-5px;transform:rotate(180deg);-webkit-transform:rotate(90deg)}.html-tooltip.side .tooltip-text.hide-arrow:after{display:none}.color-box{display:inline-block;position:relative;padding:0 8px 0 0}.color-box-area{display:inline-block;line-height:27px}.color-box .gradient{background:linear-gradient(135deg,#c6ffdd 18.06%,#fbd786 51.57%,rgba(247,121,125,.91) 81.94%);width:18px;height:18px;display:inline-block;border-radius:9px;margin:4px 7px;vertical-align:middle;float:left}a.upgrade-box-link:hover .color-box{opacity:1;filter:blur(1px);-webkit-filter:blur(1px)}a.upgrade-box-link .upgrade-link{z-index:1;padding:0 10px;background:#1a75ff;color:#fff;position:absolute;border-radius:4px;transition:all .1s ease-in-out;left:100%;width:auto;white-space:nowrap;font-size:12px;line-height:25px;top:-4px;opacity:0;visibility:hidden;right:auto}.upgrade-box-link.d-block{height:26px;border:1px solid #155e75;margin:2px 0;border-radius:6px}.upgrade-box-link.d-block .upgrade-link{top:0;transform:translate(10px,0)}a.upgrade-box-link .upgrade-link:after{content:"";width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#1a75ff transparent transparent transparent;position:absolute;top:40%;left:-7px;transform:rotate(90deg)}a.upgrade-box-link:hover .upgrade-link{visibility:visible;opacity:1}.color-list{margin:0;padding:0}.color-list li{float:left;display:block;margin:0 10px 0 0}.color-checkbox{position:relative}.color-checkbox span{width:44px;height:28px;display:block;border-radius:6px;border:solid 2px #fff;position:relative}.color-checkbox:hover span{border:solid 2px #8ada3b}.color-checkbox input:checked+span{border:solid 2px #8ada3b}.color-checkbox.active input+span:after{background:#d7f5ea;border-radius:10px;position:absolute;top:-10px;left:-10px;width:20px;margin:0;text-align:center;padding:0;color:#014737;content:"\f15e";font-family:dashicons;display:inline-block;line-height:1;font-weight:700;font-size:16px}
1
+ @import url(https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap);span.upgrade-message{padding:5px 10px;background:#fff;display:inline-block;font-size:14px;color:#000}a.pink,span.pink{color:#ff5983;text-decoration:none;font-weight:700}.form-table{margin:0}#setting-form{font-family:Roboto,sans-serif}.form-table th{width:220px;font-weight:400;vertical-align:middle}.form-table th.default-folder{width:100px}.premio-help{text-align:center}.premio-help a{display:block;float:right}.premio-help a img{width:auto;height:auto}.hide-option{display:none}.accordion{max-width:1024px;box-shadow:0 4px 21px rgba(7,16,28,.1);border-radius:4px;margin:0 0 20px 0}.accordion-header{background:#ebf1f4;padding:10px 15px;font-size:16px;cursor:pointer;border-radius:4px;color:#484848;font-weight:500}.accordion-header.active{border-radius:0;-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}.accordion-header.active span{transform:rotate(180deg)}select.hide-show-option{width:170px}.sp-replacer.sp-light{padding:0!important;margin:0!important;border:solid 2px #fff!important;box-shadow:0 3px 7px rgba(149,149,150,.3);border-radius:4px}.sp-dd{display:none!important}.sp-preview{width:18px!important;height:18px!important;margin:0!important;padding:0!important;border:none!important}.form-table select{width:268px;border-radius:6px}.accordion-header span{float:right;width:20px;height:20px;line-height:22px;font-size:14px;background:#fff;border-radius:10px}.accordion-header span:hover{background:#1da1f4;color:#fff}.form-title{font-size:23px;font-weight:400;margin:0;padding:0 0 10px 0;line-height:29px;min-height:36px}.add-new-folder,button.organize-button{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:26px;font-size:14px;margin-right:5px}.add-new-folder span.folder-icon-create_new_folder{font-size:20px}.form-options{background:#fff;padding:10px 10px 0 10px;margin:0 0;box-shadow:0 4px 21px rgba(7,16,28,.1);border-radius:4px}.shadow-box{padding:10px;box-shadow:0 4px 21px rgba(7,16,28,.1);margin:20px 0 0 0}.accordion .separator{border-bottom:solid 1px #e9e5e5}.form-options ul{margin:0;padding:0}.form-options li{display:inline-block;margin:0;vertical-align:top}.form-options li a{display:inline-block;text-decoration:none;padding:5px 12px;color:#484848;vertical-align:middle;margin:0 0 10px 0;background:#f1f1f1;border-radius:4px;font-size:11px;line-height:20px}.form-options span.icon{font-size:14px;display:inline-block;vertical-align:top;line-height:20px;color:#a4c0d2}.form-options li.last{margin:0}.form-options li.last a{padding:5px 3px 3px;width:24px;text-align:center;height:22px;line-height:20px}.form-options li.last{font-size:28px;line-height:22px}.header-posts a,.un-categorised-items a{color:#444;padding:7px;border-radius:3px;display:block;text-decoration:none;font-size:14px;line-height:18px}.header-posts a.active-item,.un-categorised-items.active-item{background:#008ec2;color:#fff}span.total-count{float:right;font-size:12px!important;line-height:16px;border-radius:2px}.header-posts a.active-item span.total-count,.un-categorised-items.active-item a span{color:#fff!important}.media-buttons{padding:10px 0;background:#fff;text-align:center}.media-buttons button,.media-buttons select{width:48%;display:inline-block;margin:0 2% 0 0}.un-categorised-items{margin:0 0 10px 0}.header-posts{margin:10px 0 0 0}.add-new-folder:focus,.add-new-folder:hover,.organize-button:focus,.organize-button:hover{color:#fff}.add-new-folder:hover:after,.organize-button:hover:after{content:"";width:100%;height:100%;background:rgba(0,0,0,.1);position:absolute;top:0;left:0}.folder-list li a{color:#333;text-decoration:none;margin:0 0 1px 0;border-radius:3px;font-size:20px;display:block;line-height:18px}.folder-list li a i{display:inline-block;vertical-align:middle;font-size:14px}.folder-list li a span{font-size:16px;display:inline-block;vertical-align:middle}.preview-inner-box{padding:15px;width:300px;max-width:100%;float:left;background:#fff;border:1px solid #dbdbdb;box-sizing:border-box;border-radius:4px}.accordion-left{width:calc(100% - 215px);float:left}.accordion-right{width:205px;float:right}#customize-folders .accordion-left{width:calc(100% - 310px)}#customize-folders .accordion-right{width:305px}.preview-text{font-size:20px;padding:0 0 10px}.preview-text-info{padding:10px 0 0;font-size:12px;line-height:12px}.media-select option{color:#000}.media-select option:first-child{font-weight:700}.folder-popup{position:fixed;width:100%;height:100%;top:0;left:0;z-index:100001;background:rgba(0,0,0,.75)}.folder-popup-box{padding:0;width:600px;max-width:100%;margin:auto;top:50%;position:absolute;left:0;right:0;border-radius:5px;transform:translate(0,-50%);-webkit-transform:translate(0,-50%);-moz-transform:translate(0,-50%);text-align:center;background:#fcfcfc}.folder-popup-header{padding:15px;font-size:20px;border-bottom:solid 1px #e6e6e6}.folder-popup-content{background:#fff;padding:15px;font-size:14px;line-height:20px}.folder-popup-content iframe{margin:30px 0}.folder-popup-footer{padding:15px;border-top:solid 1px #e6e6e6}.folder-popup-footer button{border:none;padding:10px 20px;border-radius:4px;background:#00c478;color:#fff}.close-folder-popup{margin:0;padding:0;background:0 0;border:none;float:right;background:#000;border-radius:50%;color:#fff;text-align:center;width:24px;height:24px}.close-folder-popup span{line-height:24px}.wrap h1{margin:0 0 15px 0}.upgrade-btn{background:#fff;border:1px solid #1da1f4;box-sizing:border-box;border-radius:4px;height:34px;line-height:34px;padding:0 25px;display:inline-block;text-decoration:none;font-weight:700;color:#1da1f4}.upgrade-btn:hover{background:#1da1f4;color:#fff}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.custom-checkbox span{background:#fff;border:1px solid #dbdbdb;box-sizing:border-box;border-radius:4px;margin:0 auto;height:18px;width:18px;display:inline-block;vertical-align:middle;position:relative;color:#fff}.custom-checkbox input:disabled+span{background:#f0f0f0}.submit-button{padding:10px 0 0 0}.custom-checkbox input:checked+span{background:#1da1f4}.custom-checkbox input:checked+span:after{content:"\f147";font-family:dashicons;display:inline-block;line-height:1;font-weight:400;font-style:normal;text-decoration:inherit;font-size:14px}.custom-checkbox{display:inline-block}.form-table td.no-padding{padding:0}#folder-settings .form-table td.no-padding{width:20px}.form-table td{line-height:1}.custom-checkbox+label{display:inline-block;vertical-align:middle;font-size:14px;line-height:1;padding:0 5px 0 8px}ul.folder-list li{margin:0;line-height:32px;padding:0}ul.folder-list li a{padding:5px 10px}.un-categorised-items a:hover,ul.folder-list li a:hover{background:rgba(250,22,107,.08);border-radius:4px}.clear{clear:both}.form-options li .custom-checkbox{margin:5px 0 0 0}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}.premio-help-btn{width:180px;text-align:center;padding:15px;border:1px solid #ebf1f4;box-sizing:border-box;border-radius:4px;float:right}.need-help{font-style:normal;font-weight:500;font-size:15px;line-height:18px;color:#484848}.visit-our{font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;color:#484848}.knowledge-base{font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;color:#1da1f4;text-decoration:underline}.form-table td.default-folder{width:100px}.accordion-content.no-bp{padding-bottom:0!important}.folders-tabs{background:#fff;max-width:1024px;box-shadow:0 4px 21px rgba(7,16,28,.1);border-radius:4px;margin:0 0 20px 0}.folder-tab-menu{background:#ebf1f4;padding:5px 15px 0;font-size:16px;cursor:pointer;color:#484848;font-weight:500;-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}.folder-tab-menu ul{margin:0;padding:0}.folder-tab-menu ul li{display:inline-block;margin:0 1px 0 0}.folder-tab-menu ul li a{display:inline-block;padding:10px 15px;font-family:Roboto,sans-serif;text-decoration:none;font-size:16px;color:#484848;-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;outline:0;transition:all .2s ease-in-out}.folder-tab-menu ul li a.active,.folder-tab-menu ul li a:focus,.folder-tab-menu ul li a:hover{background:#fff;box-shadow:none;color:#000}.folder-tab-content{padding:15px}.folder-tab-content .tab-content{display:none;min-height:20vh}.folder-tab-content .tab-content.active{display:block}p.submit{margin:0;padding:0}.no-plugin-message p{font-size:14px;margin:0;padding:0}.folder-popup-form{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.5);top:0;left:0;z-index:10001;display:none;font-family:Roboto,sans-serif}.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;max-width:80%}.add-update-folder-title{display:block;position:relative;max-width:100%;margin:0 0 .4em;padding:0 20px;color:#595959;text-align:center;text-transform:none;word-wrap:break-word;font-weight:700;font-size:22px;line-height:26px}.add-folder-note{padding:10px 0 30px;min-height:35px}.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:0 3px!important;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;box-shadow:none}.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}.folder-form-buttons a.delete-button,.folder-form-buttons button.delete-button{border:solid 1px #860000;background-color:#d40000;color:#fff}.folder-form-buttons button:disabled{border:solid 1px #868686;background-color:#a5a5a5}.import-folder-table table{border-collapse:collapse;border:solid 1px silver}.import-folder-table td,.import-folder-table th{border:solid 1px silver;padding:10px 15px;text-align:left;font-size:14px;vertical-align:top}.import-folder-table th{width:220px}#import-third-party-plugin-data .import-folder-table th{width:120px}#import-third-party-plugin-data .import-folder-table td span.import-message{display:inline-block;margin:0 0 0 5px;line-height:30px}#import-third-party-plugin-data .popup-form-content{width:430px}.import-folder-table td span.import-message{display:block;margin:0 0 5px 0}.import-folder-table td button.button{margin:0 5px 0 0}.import-folder-table td button.button.remove-folder-data{background:0 0;border-color:transparent;color:#3c85f7}.import-folder-table td button.button.button-primary{background:#fff;color:#3c85f7;border:solid 1px #3c85f7}.import-folder-table td span.spinner{display:none}.import-folder-table td span.spinner.active{display:inline-block;visibility:visible;margin-right:0}.import-folder-table td span.import-message.success-import{background:#c6ffc6;padding:10px;color:green;margin:0 0 10px 0}.import-folder-table td span.import-message.error-import{background:#ffeded;padding:10px;color:red;margin:0 0 10px 0}.import-folder-title,.import-plugin-title,.remove-folder-title{font-size:16px;font-weight:700;padding:0 0 15px 0}.import-folder-note,.remove-folder-note{min-height:50px;padding:0 0 20px 0}button#remove-folder-button.delete-folder-plugin{color:#fff;background:#ca0000;border-color:#ca0000}.popup-content{position:relative}.close-popup-button{position:absolute;right:-10px;top:-2px;width:20px;height:20px}.close-popup-button a{display:block;position:relative;width:20px;height:20px;color:#333;padding:2px;box-sizing:border-box}.close-popup-button a:hover span{transform:rotate(180deg)}.close-popup-button a span{display:block;position:relative;width:16px;height:16px;transition:all .2s linear}.close-popup-button a span:after,.close-popup-button a span:before{content:"";position:absolute;width:12px;height:2px;background-color:#333;display:block;border-radius:2px;transform:rotate(45deg);top:7px;left:2px}.close-popup-button a span:after{transform:rotate(-45deg)}.import-plugin-note{padding:0 0 20px 0}.import-folder-table table{width:100%;margin:0 0 20px 0}.import-plugin-footer{padding:0 30px 15px}.input-field label{display:block;font-weight:700;padding-bottom:5px}.license-key-footer{font-weight:700;padding-bottom:15px;font-size:16px;line-height:30px}input.license-key{width:100%;max-width:250px}.submit{text-align:left;max-width:100%;margin-top:0;padding-top:10px}.folder-error-message,.folder-success-message{background:#fff;margin:10px 0 10px 0;padding:10px 10px 10px 10px;border-left:solid 3px #dd4b39}.folder-success-message{border-left:solid 3px #00a65a}.folder-tab-content .separator{border-bottom:solid 1px #e9e5e5;margin:20px 0 10px}.folder-form-message{padding:30px 50px 40px}.folder-switch{display:inline-block;height:24px;line-height:24px;position:relative;padding:0 0 0 60px!important}.folder-switch input{display:none}.folder-slider{background-color:#ababab;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:.4s;width:50px;height:24px}.folder-slider.round{border-radius:34px}.folder-slider:before{background-color:#fff;bottom:4px;content:"";height:16px;left:4px;position:absolute;transition:.2s;width:16px}.folder-slider.round:before{border-radius:50%}.folder-slider:after{content:"off";color:#fff;display:inline-block;padding:0 0 0 25px;font-size:14px;line-height:24px;position:absolute;left:0;top:0}input:checked+.folder-slider{background-color:#b91c1c}input:checked+.folder-slider:before{transform:translateX(26px)}input:checked+.folder-slider:after{padding:0 0 0 8px;content:"on"}.media-details{padding:5px 0 10px}.media-setting-box{margin:10px 0 0 0;display:none}.media-setting-box.active{display:block}.inline-checkbox+.inline-checkbox{padding:5px 0 0 0}.folder-danger-zone{max-width:610px;width:100%}.danzer-title{font-size:16px;font-weight:700;line-height:20px;color:#dc2626;margin:30px 0 0 0;display:block;padding:0}.danzer-title span{color:#dc2626}a.remove-folders-data{border:2px solid #b91c1c;box-sizing:border-box;border-radius:5px;display:block;text-align:center;line-height:30px;padding:0;text-decoration:none;color:#b91c1c;font-weight:500}.remove-folders-data a{color:#d40000;font-weight:700;display:inline-block;vertical-align:middle}.media-setting-box .select2-container{width:100%!important}.media-setting-box li{margin:0;padding:0}.media-setting-box .select2-container .select2-search--inline .select2-search__field{margin:6px 0 0 0;padding:0;min-height:20px;height:20px}.folder-tooltip{display:inline-block;position:relative;vertical-align:middle}.folder-tooltip:after,.folder-tooltip:before{position:absolute;opacity:0;pointer-events:none;left:50%;content:"";color:#fff}.folder-tooltip:before{top:-8px;transform:translateX(-50%);height:10px;width:0;border-width:10px 5px 0;border-style:solid;border-color:#333 transparent transparent}.folder-tooltip:after{text-align:center;content:"" attr(data-title) "";font-size:11px;top:0;transform:translate(-50%,calc(-100% - 6px));padding:6px 20px;min-width:90px;background-color:#333;box-shadow:0 2px 4px rgba(0,0,0,.15);border-radius:6px;width:250px;white-space:break-spaces;line-height:16px;z-index:10001}.folder-tooltip:hover:after,.folder-tooltip:hover:before{opacity:1;pointer-events:auto}.folder-notification-title{padding:5px 0 0 0;font-weight:500}.folder-notification-note{padding:0 0 5px 0}.text-left{text-align:left}.input-box input{width:100%}.delete-confirmation-message{font-weight:500;color:#d00;padding-top:2px;min-height:20px;line-height:20px}.input-box{padding:3px 0 0}span.danger-info{color:#7f1d1d;font-weight:500;font-size:16px;line-height:27px;display:block}.import-export-table{width:100%}.import-export-table tr td{padding:0 0 10px 0;vertical-align:middle}.import-export-table tr td.last-td{width:100px;text-align:center;padding:0 0 0 20px}.folder-text span{color:#3c85f7;font-weight:500}span.folder-info{display:block;line-height:24px;font-size:18px;font-weight:500;vertical-align:middle;padding:0 0 5px 0}a.import-folders-button{border:2px solid #3c85f7;box-sizing:border-box;border-radius:5px;display:block;text-align:center;line-height:30px;padding:0;text-decoration:none;color:#3c85f7;font-weight:500}a.contact-folders-button{border:2px solid #64748b;box-sizing:border-box;border-radius:5px;display:block;text-align:center;line-height:30px;padding:0;text-decoration:none;color:#64748b;font-weight:500}#import-folders-popup .popup-form-content{width:500px}#import-folders-popup th{width:auto}#import-folders-popup td{width:250px}.no-more-plugins{display:none}.no-more-plugins.active{display:table-row}button.upgrade-link{display:inline-block;vertical-align:middle;background:#a07bf4;color:#fff;text-decoration:none;padding:2px 6px;font-size:11px;margin:0 0 0 5px;border-radius:4px;border:none;cursor:pointer}.send-user-to-pro:hover .normal-box{filter:blur(1px)}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#fff!important;cursor:default}.send-user-to-pro,.send-user-to-pro .normal-box{position:relative}.send-user-to-pro .upgrade-box{position:absolute;left:0;top:0;width:100%;text-align:center;height:100%;cursor:pointer;display:block}.send-user-to-pro .upgrade-box button{background:#1a75ff;color:#fff;text-decoration:none;border-radius:4px;display:none;position:absolute;top:50%;left:0;right:0;margin:0 auto;width:120px;transform:translate(0,-50%);border:none;padding:5px 0;cursor:pointer}.send-user-to-pro:hover .upgrade-box button{display:inline-block}a.upgrade-box-link{text-decoration:none;color:#333;display:inline-block;position:relative}a.upgrade-box-link>label{padding:0 5px 0 0}a.upgrade-box-link:hover{color:#1da1f4}.html-tooltip{position:relative;display:inline-block;margin:0;padding:0;line-height:1;width:20px;height:20px;vertical-align:middle}.html-tooltip .tooltip-text{visibility:hidden;width:300px;background-color:#333;color:#fff;text-align:center;border-radius:6px;padding:10px;position:absolute;z-index:1201;bottom:125%;left:50%;margin-left:-150px;opacity:0;transition:opacity .3s;font-size:12px;line-height:18px;top:100%;height:354px}.html-tooltip.no-position .tooltip-text{height:auto}.html-tooltip .tooltip-text:after{content:"";position:absolute;top:-10px;left:50%;margin-left:-15px;border-width:5px;border-style:solid;border-color:#333 transparent transparent transparent;transform:rotate(180deg);-webkit-transform:rotate(180deg)}.html-tooltip:hover .tooltip-text{visibility:visible;opacity:1}.html-tooltip .tooltip-text img{width:100%;height:auto;display:block;margin:10px 0 0 0}.html-tooltip.top .tooltip-text{top:auto;bottom:100%;margin-bottom:5px}.html-tooltip.top .tooltip-text:after{top:100%;transform:rotate(0);-webkit-transform:rotate(0)}.html-tooltip.side .tooltip-text{bottom:125%;left:100%;margin-left:0;top:5px;transform:translateY(-50%);-webkit-transform:translateY(-50%)}.html-tooltip.side .tooltip-text:after{top:50%;left:-5px;transform:rotate(180deg);-webkit-transform:rotate(90deg)}.html-tooltip.side .tooltip-text.hide-arrow:after{display:none}.color-box{display:inline-block;position:relative;padding:0 8px 0 0}.color-box-area{display:inline-block;line-height:27px}.color-box .gradient{background:linear-gradient(135deg,#c6ffdd 18.06%,#fbd786 51.57%,rgba(247,121,125,.91) 81.94%);width:18px;height:18px;display:inline-block;border-radius:9px;margin:4px 7px;vertical-align:middle;float:left}a.upgrade-box-link:hover .color-box{opacity:1;filter:blur(1px);-webkit-filter:blur(1px)}a.upgrade-box-link .upgrade-link{z-index:1;padding:0 10px;background:#1a75ff;color:#fff;position:absolute;border-radius:4px;transition:all .1s ease-in-out;left:100%;width:auto;white-space:nowrap;font-size:12px;line-height:25px;top:-4px;opacity:0;visibility:hidden;right:auto}.upgrade-box-link.d-block{height:26px;border:1px solid #155e75;margin:2px 0;border-radius:6px}.upgrade-box-link.d-block .upgrade-link{top:0;transform:translate(10px,0)}a.upgrade-box-link .upgrade-link:after{content:"";width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#1a75ff transparent transparent transparent;position:absolute;top:40%;left:-7px;transform:rotate(90deg)}a.upgrade-box-link:hover .upgrade-link{visibility:visible;opacity:1}.color-list{margin:0;padding:0}.color-list li{float:left;display:block;margin:0 10px 0 0}.color-checkbox{position:relative}.color-checkbox>span{width:44px;height:28px;display:block;border-radius:6px;border:solid 2px #fff;position:relative}.color-checkbox:hover input+span{border:solid 2px #8ada3b}.color-checkbox input:checked+span{border:solid 2px #8ada3b}.color-checkbox input+.sp-replacer+span{position:absolute;left:0;top:0;width:60px;padding:0 0 0 30px;border:solid 1px #155e75;margin:1px 0 0 1px}.color-checkbox input:checked+.sp-replacer+span{border:solid 2px #8ada3b;margin:0}.custom-color-picker.color-checkbox input+.sp-replacer.sp-light{background:linear-gradient(135deg,#c6ffdd 18.06%,#fbd786 51.57%,rgba(247,121,125,.91) 81.94%);width:18px;height:18px;display:inline-block;border-radius:9px;margin:4px 7px;vertical-align:middle;border:none!important;position:absolute;top:7px;left:8px;z-index:1001}.custom-color-picker.color-checkbox input+.sp-replacer.sp-light .sp-preview{background:0 0}.custom-color-picker.color-checkbox input:not(:checked)+.sp-replacer.sp-light .sp-preview .sp-preview-inner{background:0 0!important}.color-checkbox.active input+span:after,.custom-color-picker.color-checkbox.active input+.sp-replacer+span:after{background:#d7f5ea;border-radius:10px;position:absolute;top:-10px;left:-10px;width:20px;margin:0;text-align:center;padding:0;color:#014737;content:"\f15e";font-family:dashicons;display:inline-block;line-height:1;font-weight:700;font-size:16px}.seconds-box{position:relative;display:inline-block;width:100px}.seconds-box input{width:100%}.seconds-box:after{content:"seconds";position:absolute;right:2px;top:3px;height:24px;background:#dbdbdb;line-height:24px;padding:0 5px;border-radius:2px}.timeout-settings{display:none}.timeout-settings.active{display:table-row}.html-tooltip.dynamic .tooltip-text{height:490px}span.recommanded{background:#7e3af2;display:inline-block;color:#fff;padding:3px 5px;border-radius:5px;font-size:12px;margin:0 0 0 5px;vertical-align:middle}.tooltip-text span.new{display:block;padding:5px 0 0 0}.tooltip-text span.new a{font-weight:700;color:#30a3ff}.enable-replace-media.show .html-tooltip .tooltip-text{visibility:visible;opacity:1}
assets/images/dynamic-folders.gif ADDED
Binary file
assets/js/folders.js CHANGED
@@ -399,7 +399,42 @@
399
  setDragAndDropElements();
400
  }
401
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
  });
 
 
 
 
 
 
 
 
403
 
404
  function setDragAndDropElements() {
405
  $(".wcp-move-file:not(.ui-draggable)").draggable({
@@ -466,6 +501,7 @@
466
  success: function (res) {
467
  res = $.parseJSON(res);
468
  if(res.status == "1") {
 
469
  resetMediaAndPosts();
470
  } else {
471
  $(".folder-popup-form").hide();
@@ -493,6 +529,7 @@
493
  res = $.parseJSON(res);
494
  if(res.status == "1") {
495
  // window.location.reload();
 
496
  resetMediaAndPosts();
497
  } else {
498
  $(".folder-popup-form").hide();
@@ -518,6 +555,7 @@
518
  method: 'post',
519
  success: function (res) {
520
  // window.location.reload();
 
521
  resetMediaAndPosts();
522
  }
523
  });
@@ -546,6 +584,7 @@
546
  method: 'post',
547
  success: function (res) {
548
  //window.location.reload();
 
549
  resetMediaAndPosts();
550
  }
551
  });
@@ -564,6 +603,7 @@
564
  method: 'post',
565
  success: function (res) {
566
  //window.location.reload();
 
567
  resetMediaAndPosts();
568
  }
569
  });
@@ -582,6 +622,7 @@
582
  method: 'post',
583
  success: function (res) {
584
  // window.location.reload();
 
585
  resetMediaAndPosts();
586
  }
587
  });
@@ -634,6 +675,7 @@
634
  method: 'post',
635
  success: function (res) {
636
  // window.location.reload();
 
637
  resetMediaAndPosts();
638
  ajaxAnimation();
639
  }
@@ -654,6 +696,7 @@
654
  method: 'post',
655
  success: function (res) {
656
  // window.location.reload();
 
657
  resetMediaAndPosts();
658
  ajaxAnimation();
659
  }
@@ -673,6 +716,7 @@
673
  method: 'post',
674
  success: function (res) {
675
  // window.location.reload();
 
676
  resetMediaAndPosts();
677
  ajaxAnimation();
678
  }
@@ -703,6 +747,7 @@
703
  success: function (res) {
704
  res = $.parseJSON(res);
705
  if(res.status == "1") {
 
706
  resetMediaAndPosts();
707
  ajaxAnimation();
708
  } else {
@@ -731,6 +776,7 @@
731
  res = $.parseJSON(res);
732
  if(res.status == "1") {
733
  // window.location.reload();
 
734
  resetMediaAndPosts();
735
  ajaxAnimation();
736
  } else {
@@ -757,6 +803,7 @@
757
  method: 'post',
758
  success: function (res) {
759
  // window.location.reload();
 
760
  resetMediaAndPosts();
761
  ajaxAnimation();
762
  }
399
  setDragAndDropElements();
400
  }
401
  });
402
+
403
+ $(document).on("click", ".undo-button", function(){
404
+ $("#do-undo").removeClass("active");
405
+ if(wcp_settings.useFolderUndo == "yes") {
406
+ $.ajax({
407
+ url: wcp_settings.ajax_url,
408
+ type: 'post',
409
+ data: {
410
+ post_type: wcp_settings.post_type,
411
+ nonce: wcp_settings.nonce,
412
+ action: 'wcp_undo_folder_changes'
413
+ },
414
+ success: function(res){
415
+ $("#undo-done").addClass("active");
416
+ setTimeout(function(){
417
+ $("#undo-done").removeClass("active");
418
+ }, 2500);
419
+ resetMediaAndPosts();
420
+ }
421
+ })
422
+ }
423
+ });
424
+
425
+ $(document).on("click", ".close-undo-box", function(e){
426
+ e.preventDefault();
427
+ $("#do-undo").removeClass("active");
428
+ });
429
  });
430
+ function checkForUndoFunctionality() {
431
+ if(wcp_settings.useFolderUndo == "yes") {
432
+ $("#do-undo").addClass("active");
433
+ setTimeout(function(){
434
+ $("#do-undo").removeClass("active");
435
+ }, parseInt(wcp_settings.defaultTimeout));
436
+ }
437
+ }
438
 
439
  function setDragAndDropElements() {
440
  $(".wcp-move-file:not(.ui-draggable)").draggable({
501
  success: function (res) {
502
  res = $.parseJSON(res);
503
  if(res.status == "1") {
504
+ checkForUndoFunctionality();
505
  resetMediaAndPosts();
506
  } else {
507
  $(".folder-popup-form").hide();
529
  res = $.parseJSON(res);
530
  if(res.status == "1") {
531
  // window.location.reload();
532
+ checkForUndoFunctionality();
533
  resetMediaAndPosts();
534
  } else {
535
  $(".folder-popup-form").hide();
555
  method: 'post',
556
  success: function (res) {
557
  // window.location.reload();
558
+ checkForUndoFunctionality();
559
  resetMediaAndPosts();
560
  }
561
  });
584
  method: 'post',
585
  success: function (res) {
586
  //window.location.reload();
587
+ checkForUndoFunctionality();
588
  resetMediaAndPosts();
589
  }
590
  });
603
  method: 'post',
604
  success: function (res) {
605
  //window.location.reload();
606
+ checkForUndoFunctionality();
607
  resetMediaAndPosts();
608
  }
609
  });
622
  method: 'post',
623
  success: function (res) {
624
  // window.location.reload();
625
+ checkForUndoFunctionality();
626
  resetMediaAndPosts();
627
  }
628
  });
675
  method: 'post',
676
  success: function (res) {
677
  // window.location.reload();
678
+ checkForUndoFunctionality();
679
  resetMediaAndPosts();
680
  ajaxAnimation();
681
  }
696
  method: 'post',
697
  success: function (res) {
698
  // window.location.reload();
699
+ checkForUndoFunctionality();
700
  resetMediaAndPosts();
701
  ajaxAnimation();
702
  }
716
  method: 'post',
717
  success: function (res) {
718
  // window.location.reload();
719
+ checkForUndoFunctionality();
720
  resetMediaAndPosts();
721
  ajaxAnimation();
722
  }
747
  success: function (res) {
748
  res = $.parseJSON(res);
749
  if(res.status == "1") {
750
+ checkForUndoFunctionality();
751
  resetMediaAndPosts();
752
  ajaxAnimation();
753
  } else {
776
  res = $.parseJSON(res);
777
  if(res.status == "1") {
778
  // window.location.reload();
779
+ checkForUndoFunctionality();
780
  resetMediaAndPosts();
781
  ajaxAnimation();
782
  } else {
803
  method: 'post',
804
  success: function (res) {
805
  // window.location.reload();
806
+ checkForUndoFunctionality();
807
  resetMediaAndPosts();
808
  ajaxAnimation();
809
  }
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,n,l,d="#js-tree-menu",c="",p=!1,u=!1,m=0,f=0,h=0,g=!1,_="",v=[],w=wcp_settings.page_url,b=[],y="<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>",k=null,j=null,x=1;function C(){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=I(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?D():(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=I(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?D():(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=I(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),_=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="+c,method:"post",success:function(e){D()}}))}}),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="+c,method:"post",success:function(e){D()}})):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="+c,method:"post",success:function(e){D()}})):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")+","})),_=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="+c,method:"post",success:function(e){D()}}))}}),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=I(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="+c,method:"post",success:function(e){D(),E()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=I(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="+c,method:"post",success:function(e){D(),E()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=I(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="+c,method:"post",success:function(e){D(),E()}}))}}),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=I(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(D(),E()):(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=I(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(D(),E()):(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=I(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),_=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="+c,method:"post",success:function(e){D(),E()}}))}}),V()}function I(e,t){if(v.length>0)for(i=0;i<v.length;i++)if(parseInt(v[i].folder_id)==parseInt(e))return v[i][t];return""}function S(e){if(v.length>0)for(i=0;i<v.length;i++)if(parseInt(v[i].folder_id)==parseInt(e))return i;return null}function D(){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")),""!=_&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==c)){if(e("#media-attachment-taxonomy-filter").length){_=_.split(",");for(var t=0;t<_.length;t++)""!=_[t]&&e(".attachments-browser li[data-id='"+_[t]+"']").remove()}_=""}e("#media-attachment-taxonomy-filter").length?B(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),b=t.taxonomies,V()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+"&paged="+x+" #posts-filter",function(){var t={Title:"",Url:w+"&paged="+x};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>'),H(),P()}):e("#wpbody").load(w+"&paged="+x+" #wpbody-content",!1,function(t){var s={Title:"",Url:w+"&paged="+x};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>'),H()}))}function P(){H(),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 H(){if(v.length&&e("li.jstree-node").each(function(){folderPostId=S(e(this).attr("id")),null!=folderPostId&&(1==v[folderPostId].is_high?e(this).addClass("is-high"):e(this).removeClass("is-high"),1==v[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=y.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=y.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)}),M(),"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")}C()}function T(){contentHeight=e(window).height()-e("#wpadminbar").height()-e(".sticky-wcp-custom-form").height()-30;var t=0;if(e("#custom-scroll-menu").hasClass("mCustomScrollbar")){var s=e("#custom-scroll-menu"),o=s.find(".mCSB_dragger"),a=s.find(".mCSB_container").height();t=o.position().top/(s.height()-o.height())*(a-s.height()),e("#custom-scroll-menu").mCustomScrollbar("destroy")}e("#custom-scroll-menu").mCustomScrollbar({axis:"y",scrollButtons:{enable:!1},setHeight:contentHeight,theme:"3d",scrollbarPosition:"inside",scrollInertia:500,mouseWheelPixels:60}),0!=t&&e("#custom-scroll-menu").mCustomScrollbar("scrollTo",t+"px",{scrollInertia:0})}function N(){H()}function U(){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(""),u&&(m=f,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(f).text)+" #2"),f=e("#"+f+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+f+"_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 O(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(f).text),parentID=e("#wcp_folder_"+f).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 z(t){var s="Are you sure you want to delete the selected folder?",o="Items in the folder will not be deleted.";if(g=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(g=!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 J(){e(d).jstree({core:{cache:!1,animation:0,max_depth:n?"-1":1,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":if(!n)return!1;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)}),""!=c&&0!=c&&e(".jstree-node[id='"+c+"']").length&&(e("#js-tree-menu").jstree("select_node",c),e(".sticky-folders .sticky-folder-"+c+" a").length&&e(".sticky-folders .sticky-folder-"+c+" a").addClass("active-item")),e(".ajax-preloader").hide(),e(".js-tree-data").show(),T(),L(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active"),H(),C()}).bind("after_open.jstree",function(){C()}).bind("open_all.jstree",function(){C()}).bind("create_node.jstree",function(){C()}).bind("delete_node.jstree",function(){C()}).bind("close_all.jstree",function(){C()}).bind("after_close.jstree",function(){C()}).bind("move_node.jstree",function(t,s){"#"!=s.node.parent&&jQuery("#js-tree-menu").jstree("open_node",s.node.parent),folderMoveId=s.node.id,orderString="",e("#js-tree-menu .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"),D(),E(),V(),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(),window.location.reload(!0))}}))})}function R(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function A(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 F(){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),C()}function M(){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 E(){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 L(){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"),T()}function V(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){wcp_settings.terms=b;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),lastFolderData=b;for(var s=0;s<b.length;s++)t.append("<option value='"+b[s].term_id+"'>"+b[s].name+" ("+b[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<b.length;s++)e("select.folder_for_media option:last-child").before("<option value='"+b[s].term_id+"'>"+b[s].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),s=0;s<b.length;s++)0!=parseInt(b[s].trash_count)&&(e(".jstree-node[id='"+b[s].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(b[s].trash_count),e(".sticky-folder-"+b[s].term_id+" .premio-folder-count").text(b[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<b.length;s++)e(".media-select-folder").append("<option value='"+b[s].term_id+"'>"+b[s].name+" ("+b[s].trash_count+")</option>");e(".media-select-folder").val("")}""!=c&&e("#wcp_folder_"+c).addClass("active-item"),p&&(e("#title_"+f).trigger("click"),p=!1)}function Y(){e("#bulk-action-selector-top, #bulk-action-selector-bottom").val("-1"),0==e(".wp-list-table tbody input[type='checkbox']:checked").length?alert("Please select items to move in folder"):(e("#bulk-move-folder").show(),e("#bulk-select").html("<option value=''>Loading...</option>"),e(".move-to-folder").attr("disabled",!0),e("#move-to-folder").prop("disabled",!0),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_get_default_list&active_id="+c,method:"post",success:function(t){if(t=e.parseJSON(t),e("#bulk-select").html("<option value=''>Select Folder</option><option value='-1'>(Unassigned)</option>"),e(".move-to-folder").prop("disabled",!1),e("#move-to-folder").prop("disabled",!1),1==t.status){var s=t.taxonomies;for(i=0;i<s.length;i++)e("#bulk-select").append("<option value='"+s[i].term_id+"'>"+s[i].name+"</option>")}}}))}if(e(document).ready(function(){b=wcp_settings.taxonomies,o=parseInt(wcp_settings.is_key_active),a=parseInt(wcp_settings.folders),c=parseInt(wcp_settings.selected_taxonomy),r=parseInt(wcp_settings.hasStars),n=parseInt(wcp_settings.hasChildren),x=parseInt(wcp_settings.currentPage),v=wcp_settings.folder_settings,J(),T();var l="1"==wcp_settings.isRTL||1==wcp_settings.isRTL?"w":"e";e(".wcp-content").resizable({resizeHeight:!1,handles:l,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 k=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>",menuHtml+=n?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a target='_blank' href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=r?"<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='mark-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</a></li><li class='duplicate-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-clone'></i></span>Duplicate folder (Pro)</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",k),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",c),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",c),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>",menuHtml+=n?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a target='_blank' href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=r?"<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='mark-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</a></li><li class='duplicate-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-clone'></i></span>Duplicate folder (Pro)</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",k),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",".new-folder-pro",function(t){t.preventDefault(),e(".dynamic-menu").remove(),e("#sub-folder-popup").show()}),e(document).on("click",".close-popup-button a",function(){e(".folder-popup-form").hide()}),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){}})}),C(),e(document).ajaxComplete(function(e,s,o){o.data!=t&&""!=o.data&&-1!=o.data.indexOf("action=query-attachments")&&C()})}),e(window).on("resize",function(){T()}),e(window).scroll(function(){}),e(document).ready(function(){e(document).on("click","#add-new-folder",function(){e("#js-tree-menu a.jstree-clicked").length?(f=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),n||e("#pro-notice").removeClass("hide-it")):(f=0,e("#pro-notice").addClass("hide-it")),p=!1,U()}),e(document).on("click",".new-folder",function(){f=e(this).closest(".dynamic-menu").data("id"),p=!1,U()}),e(document).on("click",".duplicate-folder",function(t){t.stopPropagation(),f=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),p=!1,u=!0,U(),N()}),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=f;p&&(s=0),n||(s=0),h=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:h,name:folderNameDynamic,is_duplicate:u,duplicate_from:m},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),F(),N(),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};v.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)})}E(),L(),e("#media-attachment-taxonomy-filter").length&&(f=result.term_id,B(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&&(f=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),O())}),e(document).on("click",".rename-folder",function(t){t.stopPropagation(),f=e(this).closest(".dynamic-menu").data("id"),O(),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=I(f,"nonce"),parentID=e(".jstree-node[id='"+f+"']").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:f,order:h,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=S(result.id),null!=folderPostId&&(v[folderPostId].nonce=result.nonce,v[folderPostId].slug=result.slug),N(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),E(),e("#media-attachment-taxonomy-filter").length&&B(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?(f=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),z(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),z(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"),f=e(this).closest(".dynamic-menu").data("id"),z(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=I(f,"nonce"),g?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),E(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),D(),L(),E(),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_"+c).length||(e(".header-posts a").trigger("click"),c=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="+f+"&nonce="+s,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(f),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-"+f).remove(),N(),E(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),D(),L(),c==f&&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=I(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=S(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&&(v[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(v[folderPostId].is_high=0)),N(),E()):(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=1:folderStatus=0,e(".form-loader-count").css("width","100%"),s=I(folderID,"nonce"),F(),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),E())}})})}),e(document).ready(function(){e(document).on("click","a.jstree-anchor",function(t){if(x=1,t.stopPropagation(),e(".un-categorised-items").removeClass("active-item"),e(".header-posts a").removeClass("active-item"),e("active-item").removeClass("active-item"),c=e(this).closest("li.jstree-node").attr("id"),f=e(this).closest("li.jstree-node").attr("id"),e(".sticky-folders .sticky-folder-"+c+" 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=I(s,"slug"),w=wcp_settings.page_url+thisSlug+"&paged="+x;var o={Title:thisSlug,Url:w};history.pushState(o,o.Title,o.Url),A(thisSlug),e(".custom-media-select").removeClass("active")}else{var a=I(c,"slug");w=wcp_settings.page_url+a+"&paged="+x,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+" #posts-filter",function(){var t={Title:a,Url:w};history.pushState(t,t.Title,t.Url),A(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>'),P()}):e("#wpbody").load(w+" #wpbody-content",function(){var t={Title:a,Url:w};history.pushState(t,t.Title,t.Url),A(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>'),P()})}H(),e(".sticky-folders .sticky-folder-"+c+" a").addClass("active-item")}),e(".header-posts").click(function(){if(c="",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){c="",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),A("all"),H()}else x=1,w=wcp_settings.page_url+"&paged="+x,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+" #posts-filter",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),A("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>'),H(),P()}):e("#wpbody").load(w+" #wpbody-content",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),A("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>'),H(),P()})}),e(".un-categorised-items").click(function(){if(c="-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),A("-1"),H()}else x=1,w=wcp_settings.page_url+"-1&paged="+x,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+" #posts-filter",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),A("-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>'),H(),P()}):e("#wpbody").load(w+" #wpbody-content",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),A("-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>'),H(),P()})}),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")),_="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){_+=e(this).attr("id")+","}),""!=_&&(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="+_+"&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))}}))}),F()}),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:not(.pro-feature)",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),J(),b=t.terms,V()),e(".form-loader-count").css("width","0"),H()}})})}),e(document).ready(function(){e(document).on("keyup","#folder-search",function(){R()}),e(document).on("change","#folder-search",function(){R()}),e(document).on("blur","#folder-search",function(){R()})}),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){}})})}),e(document).ready(function(){e(document).on("click",".thumbnail-hover-box a",function(t){return t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault(),window.open(e(this).prop("href"),"_blank"),wp.media.frame.close(),!1}),e(document).on("click","#doaction",function(t){return"move_to_folder"==e("#bulk-action-selector-top").val()?(Y(),!1):"edit"==e("#bulk-action-selector-top").val()&&"object"==typeof inlineEditPost?(inlineEditPost.setBulk(),!1):void 0}),e(document).on("click","#doaction2",function(t){return"move_to_folder"==e("#bulk-action-selector-bottom").val()?(Y(),!1):"edit"==e("#bulk-action-selector-bottom").val()&&"object"==typeof inlineEditPost?(inlineEditPost.setBulk(),!1):void 0}),e(document).on("submit","#bulk-folder-form",function(t){t.stopPropagation(),t.preventDefault(),""!=e("#bulk-select").val()&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),""!=e("#bulk-select").val()&&("-1"==e("#bulk-select").val()?e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&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="+c,method:"post",success:function(t){e("#bulk-move-folder").hide(),D(),E()}}):(s=I(e("#bulk-select").val(),"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="+e("#bulk-select").val()+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+c,method:"post",success:function(t){t=e.parseJSON(t),e("#bulk-move-folder").hide(),"1"==t.status?(D(),E()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}}))))})}),"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>'),N(),M()});var W=null;function B(s){W=e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_get_default_list&active_id="+c,method:"post",beforeSend:function(){null!=W&&W.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}))}b=o.taxonomies,V(),""!=c&&e("#wcp_folder_"+c).addClass("active-item"),p&&(e("#title_"+f).trigger("click"),p=!1)}})}function q(){e(".media-frame-content .media-toolbar").width(e(".media-frame-content").width()-20)}function X(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 Q(e){document.cookie=e+"=; Max-Age=-99999999;"}q(),e(window).resize(function(){q()}),e(document).on("click",".button.organize-button",function(){e(".media-frame").hasClass("mode-select")?Q("media-select-mode"):X("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")||X("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()&&(f=0,p=!0,U())}),e(window).scroll(function(){})}else;function Z(){e("button.button.media-button.select-mode-toggle-button").length&&(clearInterval(l),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(){B(1)}),e(document).ajaxComplete(function(e,t,s){actionName=s.data,"undefined"!=typeof actionName&&actionName.length&&0==actionName.indexOf("action=delete-post&id=")&&B(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"))):Q("media-select-mode"),B(1)},1e3))}e(document).ready(function(){"attachment"==wcp_settings.post_type&&e("#tmpl-media-frame").length&&(l=setInterval(function(){Z()},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="+c,method:"post",success:function(t){0!=f&&f!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),D(),E()}}):(s=I(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="+c,method:"post",success:function(t){t=e.parseJSON(t),e("#bulk-move-folder").hide(),"1"==t.status?(0!=f&&f!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),D(),E()):(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,l,d="#js-tree-menu",c="",p=!1,u=!1,m=0,f=0,h=0,g=!1,_="",v=[],w=wcp_settings.page_url,b=[],y="<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>",k=null,j=null,x=1;function C(){"yes"==wcp_settings.useFolderUndo&&(e("#do-undo").addClass("active"),setTimeout(function(){e("#do-undo").removeClass("active")},parseInt(wcp_settings.defaultTimeout)))}function I(){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=S(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(C(),P()):(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=S(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(C(),P()):(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=S(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),_=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="+c,method:"post",success:function(e){C(),P()}}))}}),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="+c,method:"post",success:function(e){C(),P()}})):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="+c,method:"post",success:function(e){C(),P()}})):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")+","})),_=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="+c,method:"post",success:function(e){C(),P()}}))}}),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=S(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="+c,method:"post",success:function(e){C(),P(),L()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,s=S(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="+c,method:"post",success:function(e){C(),P(),L()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,s=S(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="+c,method:"post",success:function(e){C(),P(),L()}}))}}),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=S(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(C(),P(),L()):(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=S(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="+c,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(C(),P(),L()):(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=S(folderID,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),_=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="+c,method:"post",success:function(e){C(),P(),L()}}))}}),Y()}function S(e,t){if(v.length>0)for(i=0;i<v.length;i++)if(parseInt(v[i].folder_id)==parseInt(e))return v[i][t];return""}function D(e){if(v.length>0)for(i=0;i<v.length;i++)if(parseInt(v[i].folder_id)==parseInt(e))return i;return null}function P(){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")),""!=_&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==c)){if(e("#media-attachment-taxonomy-filter").length){_=_.split(",");for(var t=0;t<_.length;t++)""!=_[t]&&e(".attachments-browser li[data-id='"+_[t]+"']").remove()}_=""}e("#media-attachment-taxonomy-filter").length?q(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),b=t.taxonomies,Y()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+"&paged="+x+" #posts-filter",function(){var t={Title:"",Url:w+"&paged="+x};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>'),H(),T()}):e("#wpbody").load(w+"&paged="+x+" #wpbody-content",!1,function(t){var s={Title:"",Url:w+"&paged="+x};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>'),H()}))}function T(){H(),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 H(){if(v.length&&e("li.jstree-node").each(function(){folderPostId=D(e(this).attr("id")),null!=folderPostId&&(1==v[folderPostId].is_high?e(this).addClass("is-high"):e(this).removeClass("is-high"),1==v[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=y.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=y.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(),"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")}I()}function N(){contentHeight=e(window).height()-e("#wpadminbar").height()-e(".sticky-wcp-custom-form").height()-30;var t=0;if(e("#custom-scroll-menu").hasClass("mCustomScrollbar")){var s=e("#custom-scroll-menu"),o=s.find(".mCSB_dragger"),a=s.find(".mCSB_container").height();t=o.position().top/(s.height()-o.height())*(a-s.height()),e("#custom-scroll-menu").mCustomScrollbar("destroy")}e("#custom-scroll-menu").mCustomScrollbar({axis:"y",scrollButtons:{enable:!1},setHeight:contentHeight,theme:"3d",scrollbarPosition:"inside",scrollInertia:500,mouseWheelPixels:60}),0!=t&&e("#custom-scroll-menu").mCustomScrollbar("scrollTo",t+"px",{scrollInertia:0})}function U(){H()}function O(){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(""),u&&(m=f,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(f).text)+" #2"),f=e("#"+f+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+f+"_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 z(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(f).text),parentID=e("#wcp_folder_"+f).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 J(t){var s="Are you sure you want to delete the selected folder?",o="Items in the folder will not be deleted.";if(g=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(g=!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 R(){e(d).jstree({core:{cache:!1,animation:0,max_depth:n?"-1":1,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":if(!n)return!1;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)}),""!=c&&0!=c&&e(".jstree-node[id='"+c+"']").length&&(e("#js-tree-menu").jstree("select_node",c),e(".sticky-folders .sticky-folder-"+c+" a").length&&e(".sticky-folders .sticky-folder-"+c+" a").addClass("active-item")),e(".ajax-preloader").hide(),e(".js-tree-data").show(),N(),V(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active"),H(),I()}).bind("after_open.jstree",function(){I()}).bind("open_all.jstree",function(){I()}).bind("create_node.jstree",function(){I()}).bind("delete_node.jstree",function(){I()}).bind("close_all.jstree",function(){I()}).bind("after_close.jstree",function(){I()}).bind("move_node.jstree",function(t,s){"#"!=s.node.parent&&jQuery("#js-tree-menu").jstree("open_node",s.node.parent),folderMoveId=s.node.id,orderString="",e("#js-tree-menu .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"),P(),L(),Y(),I()):(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 A(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function F(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 M(){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),I()}function E(){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 L(){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 V(){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"),N()}function Y(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){wcp_settings.terms=b;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),lastFolderData=b;for(var s=0;s<b.length;s++)t.append("<option value='"+b[s].term_id+"'>"+b[s].name+" ("+b[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<b.length;s++)e("select.folder_for_media option:last-child").before("<option value='"+b[s].term_id+"'>"+b[s].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),s=0;s<b.length;s++)0!=parseInt(b[s].trash_count)&&(e(".jstree-node[id='"+b[s].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(b[s].trash_count),e(".sticky-folder-"+b[s].term_id+" .premio-folder-count").text(b[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<b.length;s++)e(".media-select-folder").append("<option value='"+b[s].term_id+"'>"+b[s].name+" ("+b[s].trash_count+")</option>");e(".media-select-folder").val("")}""!=c&&e("#wcp_folder_"+c).addClass("active-item"),p&&(e("#title_"+f).trigger("click"),p=!1)}function W(){e("#bulk-action-selector-top, #bulk-action-selector-bottom").val("-1"),0==e(".wp-list-table tbody input[type='checkbox']:checked").length?alert("Please select items to move in folder"):(e("#bulk-move-folder").show(),e("#bulk-select").html("<option value=''>Loading...</option>"),e(".move-to-folder").attr("disabled",!0),e("#move-to-folder").prop("disabled",!0),e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_get_default_list&active_id="+c,method:"post",success:function(t){if(t=e.parseJSON(t),e("#bulk-select").html("<option value=''>Select Folder</option><option value='-1'>(Unassigned)</option>"),e(".move-to-folder").prop("disabled",!1),e("#move-to-folder").prop("disabled",!1),1==t.status){var s=t.taxonomies;for(i=0;i<s.length;i++)e("#bulk-select").append("<option value='"+s[i].term_id+"'>"+s[i].name+"</option>")}}}))}if(e(document).ready(function(){b=wcp_settings.taxonomies,o=parseInt(wcp_settings.is_key_active),a=parseInt(wcp_settings.folders),c=parseInt(wcp_settings.selected_taxonomy),r=parseInt(wcp_settings.hasStars),n=parseInt(wcp_settings.hasChildren),x=parseInt(wcp_settings.currentPage),v=wcp_settings.folder_settings,R(),N();var l="1"==wcp_settings.isRTL||1==wcp_settings.isRTL?"w":"e";e(".wcp-content").resizable({resizeHeight:!1,handles:l,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 k=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>",menuHtml+=n?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a target='_blank' href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=r?"<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='mark-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</a></li><li class='duplicate-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-clone'></i></span>Duplicate folder (Pro)</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",k),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",c),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",c),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>",menuHtml+=n?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a target='_blank' href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=r?"<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='mark-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</a></li><li class='duplicate-folder-pro'><a target='_blank' href='"+wcp_settings.upgrade_url+"'><span class=''><i class='pfolder-clone'></i></span>Duplicate folder (Pro)</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",k),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",".new-folder-pro",function(t){t.preventDefault(),e(".dynamic-menu").remove(),e("#sub-folder-popup").show()}),e(document).on("click",".close-popup-button a",function(){e(".folder-popup-form").hide()}),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){}})}),I(),e(document).ajaxComplete(function(e,s,o){o.data!=t&&""!=o.data&&-1!=o.data.indexOf("action=query-attachments")&&I()}),e(document).on("click",".undo-button",function(){e("#do-undo").removeClass("active"),"yes"==wcp_settings.useFolderUndo&&e.ajax({url:wcp_settings.ajax_url,type:"post",data:{post_type:wcp_settings.post_type,nonce:wcp_settings.nonce,action:"wcp_undo_folder_changes"},success:function(t){e("#undo-done").addClass("active"),setTimeout(function(){e("#undo-done").removeClass("active")},2500),P()}})}),e(document).on("click",".close-undo-box",function(t){t.preventDefault(),e("#do-undo").removeClass("active")})}),e(window).on("resize",function(){N()}),e(window).scroll(function(){}),e(document).ready(function(){e(document).on("click","#add-new-folder",function(){e("#js-tree-menu a.jstree-clicked").length?(f=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),n||e("#pro-notice").removeClass("hide-it")):(f=0,e("#pro-notice").addClass("hide-it")),p=!1,O()}),e(document).on("click",".new-folder",function(){f=e(this).closest(".dynamic-menu").data("id"),p=!1,O()}),e(document).on("click",".duplicate-folder",function(t){t.stopPropagation(),f=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),p=!1,u=!0,O(),U()}),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=f;p&&(s=0),n||(s=0),h=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:h,name:folderNameDynamic,is_duplicate:u,duplicate_from:m},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),M(),U(),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};v.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)})}L(),V(),e("#media-attachment-taxonomy-filter").length&&(f=result.term_id,q(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&&(f=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),z())}),e(document).on("click",".rename-folder",function(t){t.stopPropagation(),f=e(this).closest(".dynamic-menu").data("id"),z(),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=S(f,"nonce"),parentID=e(".jstree-node[id='"+f+"']").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:f,order:h,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=D(result.id),null!=folderPostId&&(v[folderPostId].nonce=result.nonce,v[folderPostId].slug=result.slug),U(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),L(),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).ready(function(){e("#inline-remove").click(function(){e("#js-tree-menu a.jstree-clicked").length?(f=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),J(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),J(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"),f=e(this).closest(".dynamic-menu").data("id"),J(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=S(f,"nonce"),g?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),L(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),P(),V(),L(),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_"+c).length||(e(".header-posts a").trigger("click"),c=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="+f+"&nonce="+s,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(f),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-"+f).remove(),U(),L(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),P(),V(),c==f&&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=S(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=D(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&&(v[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(v[folderPostId].is_high=0)),U(),L()):(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=1:folderStatus=0,e(".form-loader-count").css("width","100%"),s=S(folderID,"nonce"),M(),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),L())}})})}),e(document).ready(function(){e(document).on("click","a.jstree-anchor",function(t){if(x=1,t.stopPropagation(),e(".un-categorised-items").removeClass("active-item"),e(".header-posts a").removeClass("active-item"),e("active-item").removeClass("active-item"),c=e(this).closest("li.jstree-node").attr("id"),f=e(this).closest("li.jstree-node").attr("id"),e(".sticky-folders .sticky-folder-"+c+" 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=S(s,"slug"),w=wcp_settings.page_url+thisSlug+"&paged="+x;var o={Title:thisSlug,Url:w};history.pushState(o,o.Title,o.Url),F(thisSlug),e(".custom-media-select").removeClass("active")}else{var a=S(c,"slug");w=wcp_settings.page_url+a+"&paged="+x,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+" #posts-filter",function(){var t={Title:a,Url:w};history.pushState(t,t.Title,t.Url),F(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>'),T()}):e("#wpbody").load(w+" #wpbody-content",function(){var t={Title:a,Url:w};history.pushState(t,t.Title,t.Url),F(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>'),T()})}H(),e(".sticky-folders .sticky-folder-"+c+" a").addClass("active-item")}),e(".header-posts").click(function(){if(c="",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){c="",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),F("all"),H()}else x=1,w=wcp_settings.page_url+"&paged="+x,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+" #posts-filter",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),F("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>'),H(),T()}):e("#wpbody").load(w+" #wpbody-content",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),F("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>'),H(),T()})}),e(".un-categorised-items").click(function(){if(c="-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),F("-1"),H()}else x=1,w=wcp_settings.page_url+"-1&paged="+x,e(".form-loader-count").css("width","100%"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(w+" #posts-filter",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),F("-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>'),H(),T()}):e("#wpbody").load(w+" #wpbody-content",function(){var t={Title:"",Url:w};history.pushState(t,t.Title,t.Url),F("-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>'),H(),T()})}),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")),_="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){_+=e(this).attr("id")+","}),""!=_&&(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="+_+"&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))}}))}),M()}),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:not(.pro-feature)",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),R(),b=t.terms,Y()),e(".form-loader-count").css("width","0"),H()}})})}),e(document).ready(function(){e(document).on("keyup","#folder-search",function(){A()}),e(document).on("change","#folder-search",function(){A()}),e(document).on("blur","#folder-search",function(){A()})}),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){}})})}),e(document).ready(function(){e(document).on("click",".thumbnail-hover-box a",function(t){return t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault(),window.open(e(this).prop("href"),"_blank"),wp.media.frame.close(),!1}),e(document).on("click","#doaction",function(t){return"move_to_folder"==e("#bulk-action-selector-top").val()?(W(),!1):"edit"==e("#bulk-action-selector-top").val()&&"object"==typeof inlineEditPost?(inlineEditPost.setBulk(),!1):void 0}),e(document).on("click","#doaction2",function(t){return"move_to_folder"==e("#bulk-action-selector-bottom").val()?(W(),!1):"edit"==e("#bulk-action-selector-bottom").val()&&"object"==typeof inlineEditPost?(inlineEditPost.setBulk(),!1):void 0}),e(document).on("submit","#bulk-folder-form",function(t){t.stopPropagation(),t.preventDefault(),""!=e("#bulk-select").val()&&(chkStr="",e(".wp-list-table input:checked").each(function(){chkStr+=e(this).val()+","}),""!=e("#bulk-select").val()&&("-1"==e("#bulk-select").val()?e.ajax({url:wcp_settings.ajax_url,data:"post_id="+chkStr+"&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="+c,method:"post",success:function(t){e("#bulk-move-folder").hide(),P(),L()}}):(s=S(e("#bulk-select").val(),"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="+e("#bulk-select").val()+"&nonce="+s+"&status="+wcp_settings.taxonomy_status+"&taxonomy="+c,method:"post",success:function(t){t=e.parseJSON(t),e("#bulk-move-folder").hide(),"1"==t.status?(P(),L()):(e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),e("#error-folder-popup-message").html(t.message),e("#error-folder-popup").show())}}))))})}),"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>'),U(),E()});var B=null;function q(s){B=e.ajax({url:wcp_settings.ajax_url,data:"type="+wcp_settings.post_type+"&action=wcp_get_default_list&active_id="+c,method:"post",beforeSend:function(){null!=B&&B.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}))}b=o.taxonomies,Y(),""!=c&&e("#wcp_folder_"+c).addClass("active-item"),p&&(e("#title_"+f).trigger("click"),p=!1)}})}function X(){e(".media-frame-content .media-toolbar").width(e(".media-frame-content").width()-20)}function Q(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 Z(e){document.cookie=e+"=; Max-Age=-99999999;"}X(),e(window).resize(function(){X()}),e(document).on("click",".button.organize-button",function(){e(".media-frame").hasClass("mode-select")?Z("media-select-mode"):Q("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")||Q("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()&&(f=0,p=!0,O())}),e(window).scroll(function(){})}else;function G(){e("button.button.media-button.select-mode-toggle-button").length&&(clearInterval(l),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(){q(1)}),e(document).ajaxComplete(function(e,t,s){actionName=s.data,"undefined"!=typeof actionName&&actionName.length&&0==actionName.indexOf("action=delete-post&id=")&&q(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"))):Z("media-select-mode"),q(1)},1e3))}e(document).ready(function(){"attachment"==wcp_settings.post_type&&e("#tmpl-media-frame").length&&(l=setInterval(function(){G()},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="+c,method:"post",success:function(t){0!=f&&f!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),P(),L()}}):(s=S(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="+c,method:"post",success:function(t){t=e.parseJSON(t),e("#bulk-move-folder").hide(),"1"==t.status?(0!=f&&f!=e(".media-select-folder").val()&&e("ul.attachments li.selected").remove(),P(),L()):(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/page-post-media.js CHANGED
@@ -1035,8 +1035,45 @@
1035
  });
1036
 
1037
  setDragAndDropElements();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1038
  });
1039
 
 
 
 
 
 
 
 
 
 
 
1040
  function setDragAndDropElements() {
1041
  $(".jstree-anchor:not(.ui-droppable)").droppable({
1042
  accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
@@ -1060,6 +1097,7 @@
1060
  success: function (res) {
1061
  res = $.parseJSON(res);
1062
  if(res.status == "1") {
 
1063
  resetMediaAndPosts();
1064
  } else {
1065
  $(".folder-popup-form").hide();
@@ -1087,6 +1125,7 @@
1087
  res = $.parseJSON(res);
1088
  if(res.status == "1") {
1089
  // window.location.reload();
 
1090
  resetMediaAndPosts();
1091
  } else {
1092
  $(".folder-popup-form").hide();
@@ -1111,6 +1150,7 @@
1111
  data: "post_ids=" + chkStr + "&type=" + folders_media_options.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce="+nonce+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+activeRecordID,
1112
  method: 'post',
1113
  success: function (res) {
 
1114
  // window.location.reload();
1115
  resetMediaAndPosts();
1116
  ajaxAnimation();
@@ -1165,6 +1205,7 @@
1165
  method: 'post',
1166
  success: function (res) {
1167
  //window.location.reload();
 
1168
  resetMediaAndPosts();
1169
  }
1170
  });
@@ -1183,6 +1224,7 @@
1183
  method: 'post',
1184
  success: function (res) {
1185
  //window.location.reload();
 
1186
  resetMediaAndPosts();
1187
  }
1188
  });
@@ -1201,6 +1243,7 @@
1201
  method: 'post',
1202
  success: function (res) {
1203
  // window.location.reload();
 
1204
  resetMediaAndPosts();
1205
  }
1206
  });
@@ -1230,6 +1273,7 @@
1230
  method: 'post',
1231
  success: function (res) {
1232
  // window.location.reload();
 
1233
  resetMediaAndPosts();
1234
  ajaxAnimation();
1235
  }
@@ -1250,6 +1294,7 @@
1250
  method: 'post',
1251
  success: function (res) {
1252
  // window.location.reload();
 
1253
  resetMediaAndPosts();
1254
  ajaxAnimation();
1255
  }
@@ -1269,6 +1314,7 @@
1269
  method: 'post',
1270
  success: function (res) {
1271
  // window.location.reload();
 
1272
  resetMediaAndPosts();
1273
  ajaxAnimation();
1274
  }
1035
  });
1036
 
1037
  setDragAndDropElements();
1038
+
1039
+ $(document).on("click", ".undo-button", function(){
1040
+ $("#do-undo").removeClass("active");
1041
+ if(folders_media_options.useFolderUndo == "yes") {
1042
+ $.ajax({
1043
+ url: folders_media_options.ajax_url,
1044
+ type: 'post',
1045
+ data: {
1046
+ post_type: folders_media_options.post_type,
1047
+ nonce: folders_media_options.nonce,
1048
+ action: 'wcp_undo_folder_changes'
1049
+ },
1050
+ success: function(res){
1051
+ $("#undo-done").addClass("active");
1052
+ setTimeout(function(){
1053
+ $("#undo-done").removeClass("active");
1054
+ }, 2500);
1055
+ resetMediaAndPosts();
1056
+ }
1057
+ })
1058
+ }
1059
+ });
1060
+
1061
+ $(document).on("click", ".close-undo-box", function(e){
1062
+ e.preventDefault();
1063
+ $("#do-undo").removeClass("active");
1064
+ });
1065
  });
1066
 
1067
+
1068
+ function checkForUndoFunctionality() {
1069
+ if(folders_media_options.useFolderUndo == "yes") {
1070
+ $("#do-undo").addClass("active");
1071
+ setTimeout(function(){
1072
+ $("#do-undo").removeClass("active");
1073
+ }, parseInt(folders_media_options.defaultTimeout));
1074
+ }
1075
+ }
1076
+
1077
  function setDragAndDropElements() {
1078
  $(".jstree-anchor:not(.ui-droppable)").droppable({
1079
  accept: ".wcp-move-file, .wcp-move-multiple, .attachments-browser li.attachment",
1097
  success: function (res) {
1098
  res = $.parseJSON(res);
1099
  if(res.status == "1") {
1100
+ checkForUndoFunctionality();
1101
  resetMediaAndPosts();
1102
  } else {
1103
  $(".folder-popup-form").hide();
1125
  res = $.parseJSON(res);
1126
  if(res.status == "1") {
1127
  // window.location.reload();
1128
+ checkForUndoFunctionality();
1129
  resetMediaAndPosts();
1130
  } else {
1131
  $(".folder-popup-form").hide();
1150
  data: "post_ids=" + chkStr + "&type=" + folders_media_options.post_type + "&action=wcp_change_multiple_post_folder&folder_id=" + folderID + "&nonce="+nonce+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+activeRecordID,
1151
  method: 'post',
1152
  success: function (res) {
1153
+ checkForUndoFunctionality();
1154
  // window.location.reload();
1155
  resetMediaAndPosts();
1156
  ajaxAnimation();
1205
  method: 'post',
1206
  success: function (res) {
1207
  //window.location.reload();
1208
+ checkForUndoFunctionality();
1209
  resetMediaAndPosts();
1210
  }
1211
  });
1224
  method: 'post',
1225
  success: function (res) {
1226
  //window.location.reload();
1227
+ checkForUndoFunctionality();
1228
  resetMediaAndPosts();
1229
  }
1230
  });
1243
  method: 'post',
1244
  success: function (res) {
1245
  // window.location.reload();
1246
+ checkForUndoFunctionality();
1247
  resetMediaAndPosts();
1248
  }
1249
  });
1273
  method: 'post',
1274
  success: function (res) {
1275
  // window.location.reload();
1276
+ checkForUndoFunctionality();
1277
  resetMediaAndPosts();
1278
  ajaxAnimation();
1279
  }
1294
  method: 'post',
1295
  success: function (res) {
1296
  // window.location.reload();
1297
+ checkForUndoFunctionality();
1298
  resetMediaAndPosts();
1299
  ajaxAnimation();
1300
  }
1314
  method: 'post',
1315
  success: function (res) {
1316
  // window.location.reload();
1317
+ checkForUndoFunctionality();
1318
  resetMediaAndPosts();
1319
  ajaxAnimation();
1320
  }
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,a,s="",r=".folder-modal #js-tree-menu",d=[],l=-1,n=0,c=0,m="",p=-1,u=0,f="",h=folders_media_options.page_url,v="",g="",y=!1,j=!1,w=!1,k=0,b=0,x=[],C=null,S=null,I=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)}}),P=0,D=0,H=wp.media.view.AttachmentsBrowser;wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){H.prototype.createToolbar.call(this),this.toolbar.set("MediaLibraryOrganizerTaxonomyFilter",new I({controller:this.controller,model:this.collection.props,priority:-75}).render())}});var N,A=wp.media.model.Query;_.extend(A,{get:(N=[],function(e,t){var o,a={},s=A.orderby,r=A.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[A.propmap[t]||t]=e)}),_.defaults(a,A.defaultArgs),a.orderby=s.valuemap[e.orderby]||e.orderby,N=[],o||(o=new A([],_.extend(t||{},{props:e,args:a})),N.push(o)),o})});var O=window.wp;void 0!==O&&"function"==typeof O.Uploader&&(O.media.view.Modal.prototype.on("open",function(){s="",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)}),O.media.view.Modal.prototype.on("close",function(){s=""}),e.extend(O.Uploader.prototype,{progress:function(){},init:function(){this.uploader&&(this.uploader.bind("FileFiltered",function(t,o){P++,e(".folder-meter").css("width","0%"),e(".media-folder-loader").show(),e("#total_upload_files").text(P)}),this.uploader.bind("BeforeUpload",function(t,o){var a=l,s=t.settings.multipart_params;if((a=parseInt(a))>0&&(s.folder_for_media=a),D<P){e(".media-folder-loader").show();var r=D/P*100;e(".folder-meter").css("width",r+"%")}D++,e("#current_upload_files").text(D)}),this.uploader.bind("UploadComplete",function(e,t){l=-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%"),P=0,D=0},1250),function(){e("#media-attachment-taxonomy-filter").val();U=e.ajax({url:folders_media_options.ajax_url,data:"type=attachment&action=wcp_get_default_list&active_id=0",method:"post",beforeSend:function(){null!=U&&U.abort()},success:function(t){var t=e.parseJSON(t);x=t.taxonomies,q(),F()}})}(),void 0!==a.media.frame&&null!==a.media.frame.content.get()?(s="",e(".folder-modal ul.attachments li.selected").length&&(s=e(".folder-modal ul.attachments li.selected").data("id")),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 U,J=window.wp;if(void 0!==J&&"function"==typeof J.Uploader){var Q=window.wp.media,T=Q.view.Modal;Q.view.Modal=Q.view.Modal.extend({className:"folder-modal",initialize:function(){T.prototype.initialize.apply(this,arguments)},open:function(){T.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")||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(){W(),B(),M()})):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(){W(),B(),M()})),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!=l&&e("#media-attachment-taxonomy-filter").each(function(){e(this).val(l),e(this).trigger("change")})},1e3))},close:function(){T.prototype.close.apply(this,arguments),e(".folder-modal").removeClass("folder-modal")}})}function F(){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){n=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()+","}),f=V(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?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,f=V(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?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,f=V(n,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),g=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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){R(),K()}}))}}),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){n=-1,f=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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){R()}})):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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){R()}})):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")+","})),g=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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){R()}}))}}),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"),n=e(this).data("id"),o.draggable.hasClass("wcp-move-multiple")?(f=V(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){R(),K()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,f=V(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){R(),K()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,f=V(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){R(),K()}}))}}),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 M(){e(r).jstree({core:{cache:!1,animation:0,max_depth:a?"-1":1,check_callback:function(t,o,s,r,d){if(e("*").removeClass("drag-bot").removeClass("drag-in").removeClass("drag-up"),("move_node"===t||"copy_node"===t)&&d&&d.dnd)switch(d.pos){case"a":d.origin.get_node(d.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":if(!a)return!1;d.origin.get_node(d.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":d.origin.get_node(d.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)}),""!=v&&0!=v&&e(".jstree-node[id='"+v+"']").length&&(e("#js-tree-menu").jstree("select_node",v),e(".sticky-folders .sticky-folder-"+v+" a").length&&e(".sticky-folders .sticky-folder-"+v+" a").addClass("active-item"));e(".ajax-preloader").hide(),e(".js-tree-data").show(),B(),Y(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active")}(),F()}).bind("after_open.jstree",function(){F()}).bind("open_all.jstree",function(){F()}).bind("create_node.jstree",function(){F()}).bind("delete_node.jstree",function(){F()}).bind("close_all.jstree",function(){F()}).bind("after_close.jstree",function(){F()}).bind("move_node.jstree",function(t,o){"#"!=o.node.parent&&jQuery("#js-tree-menu").jstree("open_node",o.node.parent),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"),R(),K(),q(),F()):(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))}}))}),F()}function V(e,t){if(d.length>0)for(i=0;i<d.length;i++)if(parseInt(d[i].folder_id)==parseInt(e))return d[i][t];return""}function z(e){if(d.length>0)for(i=0;i<d.length;i++)if(parseInt(d[i].folder_id)==parseInt(e))return i;return null}function Y(){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"),B()}function B(){var t=0;if(e("#custom-scroll-menu").hasClass("mCustomScrollbar")){var o=jQuery("#custom-scroll-menu"),a=o.find(".mCSB_dragger"),s=o.find(".mCSB_container").height();t=a.position().top/(o.height()-a.height())*(s-o.height()),e("#custom-scroll-menu").mCustomScrollbar("destroy")}var r=jQuery(".folder-modal .media-modal-content").height()-e(".folder-modal .sticky-wcp-custom-form").height()-40;e(".folder-modal #custom-scroll-menu").closest(".media-frame-menu").length&&jQuery(".folder-custom-menu").length&&jQuery(".media-frame-menu").length&&(r=jQuery(".folder-modal .media-modal-content").height()-e(".folder-modal .sticky-wcp-custom-form").height()-jQuery(".folder-custom-menu").offset().top+jQuery(".media-frame-menu").offset().top-40),r<0&&(r=350),e("#custom-scroll-menu").mCustomScrollbar({axis:"y",scrollButtons:{enable:!0},setHeight:r,theme:"3d",scrollbarPosition:"inside",scrollInertia:500,mouseWheelPixels:60}),0!=t&&jQuery("#custom-scroll-menu").mCustomScrollbar("scrollTo",t+"px",{scrollInertia:0})}function R(){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")),""!=g&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==v)){if(e("#media-attachment-taxonomy-filter").length){g=g.split(",");for(var t=0;t<g.length;t++)""!=g[t]&&e(".attachments-browser li[data-id='"+g[t]+"']").remove()}g=""}e("#media-attachment-taxonomy-filter").length?G(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),x=t.taxonomies,q(),F()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(h+" #posts-filter",function(){var t={Title:"",Url:h};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(h+" #wpbody-content",!1,function(t){var o={Title:"",Url:h};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 q(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){folders_media_options.terms=x;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),x;for(var o=0;o<x.length;o++)t.append("<option value='"+x[o].term_id+"'>"+x[o].name+" ("+x[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<x.length;o++)e("select.folder_for_media option:last-child").before("<option value='"+x[o].term_id+"'>"+x[o].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),o=0;o<x.length;o++)0!=parseInt(x[o].trash_count)&&(e(".jstree-node[id='"+x[o].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(x[o].trash_count),e(".sticky-folder-"+x[o].term_id+" .premio-folder-count").text(x[o].trash_count));""!=v&&e("#wcp_folder_"+v).addClass("active-item"),j&&(e("#title_"+c).trigger("click"),j=!1)}function E(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function X(t){var o="Are you sure you want to delete the selected folder?",a="Items in the folder will not be deleted.";if(y=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(y=!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 L(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(c).text),parentID=e("#wcp_folder_"+c).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 Z(){if(0==u&&p>=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(""),w&&(k=c,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(c).text)+" #2"),c=e("#"+c+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+c+"_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 W(){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),F()}function G(o){U=e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_get_default_list&active_id="+v,method:"post",beforeSend:function(){null!=U&&U.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}))}x=a.taxonomies,q(),F()}})}function K(){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),F()}e(document).ready(function(){o=parseInt(folders_media_options.hasStars),a=parseInt(folders_media_options.hasChildren),e(document).on("click",".thumbnail-hover-box a",function(t){return t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault(),window.open(e(this).prop("href"),"_blank"),!1}),e(document).ajaxComplete(function(e,o,a){a.data!=t&&""!=a.data&&-1!=a.data.indexOf("action=query-attachments")&&F(),""!=s&&jQuery(".folder-modal ul.attachments li[data-id='"+s+"']").length&&!jQuery(".folder-modal ul.attachments li[data-id='"+s+"']").hasClass("selected")&&jQuery(".folder-modal ul.attachments li[data-id='"+s+"']").trigger("click")}),x=folders_media_options.terms,u=parseInt(folders_media_options.is_key_active),p=parseInt(folders_media_options.folders),d=folders_media_options.folder_settings,e(document).on("click",".header-posts a.all-posts",function(t){c=0,v="",l="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){c=0,v="",l="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");l=c=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=V(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()?l=e(this).val():"add-folder"==e(this).val()&&(l=-1)}),e(document).on("click",".new-folder-pro",function(t){t.preventDefault(),e(".dynamic-menu").remove(),e("#sub-folder-popup").show()}),e(document).on("click",".close-popup-button a",function(){e(".folder-popup-form").hide()}),e(document).on("click",".update-inline-record",function(s){var r;(s.stopImmediatePropagation(),s.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>",menuHtml+=a?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=o?"<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='mark-folder-pro'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</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),s.pageX==t||s.pageY==t?(e(".dynamic-menu").css("left",C),e(".dynamic-menu").css("top",S-10),r=S):(e(".dynamic-menu").css("left",s.pageX),e(".dynamic-menu").css("top",s.pageY),r=s.pageY),r+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(r+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 C=t.pageX,S=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 r;(s.stopImmediatePropagation(),s.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>",menuHtml+=a?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=o?"<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='mark-folder-pro'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</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"),s.pageX==t||s.pageY==t?(e(".dynamic-menu").css("left",C),e(".dynamic-menu").css("top",S-10),r=S):(e(".dynamic-menu").css("left",s.pageX),e(".dynamic-menu").css("top",s.pageY),r=s.pageY),r+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(r+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(),c=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),j=!1,w=!1,Z()}),e(document).on("click","#add-new-folder",function(t){e("#js-tree-menu a.jstree-clicked").length?(c=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),a||e("#pro-notice").removeClass("hide-it")):(c=0,e("#pro-notice").addClass("hide-it")),j=!1,Z()}),e(document).on("submit","#save-folder-form",function(t){if(t.stopPropagation(),t.preventDefault(),m=e("#add-update-folder-name").val(),""==e.trim(m))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=c;j&&(o=0),a||(o=0),b=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:b,name:m,is_duplicate:w,duplicate_from:k},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(u=parseInt(result.is_key_active),p=parseInt(result.folders),e("#current-folder").text(p),e("#ttl-fldr").text(10),W(),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};d.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)})}K(),Y(),c=result.term_id,G(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(),c=e(this).closest(".dynamic-menu").data("id"),L(),e(".dynamic-menu").remove()}),e(document).on("click","#inline-update",function(t){e("#js-tree-menu a.jstree-clicked").length&&(c=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),L())}),e(document).on("submit","#update-folder-form",function(o){return o.stopPropagation(),o.preventDefault(),m=e("#update-folder-item-name").val(),""==e.trim(m)?(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"),f=V(c,"nonce"),parentID=e(".jstree-node[id='"+c+"']").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:f,term_id:c,order:b,name:m},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=z(result.id),null!=folderPostId&&(d[folderPostId].nonce=result.nonce,d[folderPostId].slug=result.slug),e(".folder-popup-form").hide(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),K(),e("#media-attachment-taxonomy-filter").length&&G(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(),n=e(this).closest(".dynamic-menu").data("id"),f=V(n,"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="+n+"&type="+folders_media_options.post_type+"&action=wcp_mark_un_mark_folder&nonce="+f,method:"post",cache:!1,success:function(t){t=e.parseJSON(t),e(".form-loader-count").css("width","0%"),"1"==t.status?(folderPostId=z(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&&(d[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(d[folderPostId].is_high=0)),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())}})}),e(document).on("click",".duplicate-folder",function(t){t.stopPropagation(),c=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),j=!1,w=!0,Z()}),e(document).on("click",".remove-folder",function(){n=e(this).closest(".dynamic-menu").data("id"),c=e(this).closest(".dynamic-menu").data("id"),X(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>'),f=V(c,"nonce"),y?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(u=parseInt(t.is_key_active),p=parseInt(t.folders),e("#current-folder").text(p),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),K(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),R(),Y(),K(),e(".folder-modal #wcp_folder_"+v).length||(e(".header-posts a").trigger("click"),v=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="+c+"&nonce="+f,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(c),u=parseInt(t.is_key_active),p=parseInt(t.folders),e("#current-folder").text(p),e("#ttl-fldr").text(10),e(".sticky-folders .sticky-folder-"+c).remove(),K(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),R(),Y(),v==c&&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")),g="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){g+=e(this).attr("id")+","}),""!=g&&(e(".form-loader-count").css("width","100%"),f=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="+g+"&nonce="+f,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:not(.pro-feature)",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),x=t.terms,q(),M()),e(".form-loader-count").css("width","0")}})}),e(document).on("click",".jstree-node .jstree-icon",function(){n=e(this).closest("li.jstree-node").attr("id"),e("li.jstree-node[id='"+n+"']").hasClass("jstree-open")?folderStatus=1:folderStatus=0,e(".form-loader-count").css("width","100%"),f=V(n,"nonce"),W(),e.ajax({url:folders_media_options.ajax_url,data:"is_active="+folderStatus+"&action=save_wcp_folder_state&term_id="+n+"&nonce="+f,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status||(e("#wcp_folder_"+n).hasClass("active")?(e("#wcp_folder_"+n).removeClass("active"),e("#wcp_folder_"+n).find("ul.ui-sortable:first-child > li").slideUp(),folderStatus=0):(e("#wcp_folder_"+n).addClass("active"),e("#wcp_folder_"+n).find("ul.ui-sortable:first-child > li").slideDown(),folderStatus=1),K())}})}),e(document).on("keyup","#folder-search",function(){E()}),e(document).on("change","#folder-search",function(){E()}),e(document).on("blur","#folder-search",function(){E()}),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?(c=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),X(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),X(1))}),e(document).on("change",".folder_for_media",function(){"add-folder"==e(this).val()&&(j=!0,e("#add-new-folder").trigger("click"))}),F()})});
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,a,s="",r=".folder-modal #js-tree-menu",d=[],l=-1,n=0,c=0,m="",p=-1,u=0,f="",h=folders_media_options.page_url,v="",g="",y=!1,j=!1,k=!1,w=0,b=0,x=[],C=null,S=null,I=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)}}),P=0,D=0,H=wp.media.view.AttachmentsBrowser;wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){H.prototype.createToolbar.call(this),this.toolbar.set("MediaLibraryOrganizerTaxonomyFilter",new I({controller:this.controller,model:this.collection.props,priority:-75}).render())}});var N,A=wp.media.model.Query;_.extend(A,{get:(N=[],function(e,t){var o,a={},s=A.orderby,r=A.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[A.propmap[t]||t]=e)}),_.defaults(a,A.defaultArgs),a.orderby=s.valuemap[e.orderby]||e.orderby,N=[],o||(o=new A([],_.extend(t||{},{props:e,args:a})),N.push(o)),o})});var T=window.wp;void 0!==T&&"function"==typeof T.Uploader&&(T.media.view.Modal.prototype.on("open",function(){s="",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)}),T.media.view.Modal.prototype.on("close",function(){s=""}),e.extend(T.Uploader.prototype,{progress:function(){},init:function(){this.uploader&&(this.uploader.bind("FileFiltered",function(t,o){P++,e(".folder-meter").css("width","0%"),e(".media-folder-loader").show(),e("#total_upload_files").text(P)}),this.uploader.bind("BeforeUpload",function(t,o){var a=l,s=t.settings.multipart_params;if((a=parseInt(a))>0&&(s.folder_for_media=a),D<P){e(".media-folder-loader").show();var r=D/P*100;e(".folder-meter").css("width",r+"%")}D++,e("#current_upload_files").text(D)}),this.uploader.bind("UploadComplete",function(e,t){l=-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%"),P=0,D=0},1250),function(){e("#media-attachment-taxonomy-filter").val();U=e.ajax({url:folders_media_options.ajax_url,data:"type=attachment&action=wcp_get_default_list&active_id=0",method:"post",beforeSend:function(){null!=U&&U.abort()},success:function(t){var t=e.parseJSON(t);x=t.taxonomies,E(),M()}})}(),void 0!==a.media.frame&&null!==a.media.frame.content.get()?(s="",e(".folder-modal ul.attachments li.selected").length&&(s=e(".folder-modal ul.attachments li.selected").data("id")),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 U,O=window.wp;if(void 0!==O&&"function"==typeof O.Uploader){var F=window.wp.media,J=F.view.Modal;F.view.Modal=F.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")||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(){G(),R(),V()})):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(){G(),R(),V()})),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!=l&&e("#media-attachment-taxonomy-filter").each(function(){e(this).val(l),e(this).trigger("change")})},1e3))},close:function(){J.prototype.close.apply(this,arguments),e(".folder-modal").removeClass("folder-modal")}})}function Q(){"yes"==folders_media_options.useFolderUndo&&(e("#do-undo").addClass("active"),setTimeout(function(){e("#do-undo").removeClass("active")},parseInt(folders_media_options.defaultTimeout)))}function M(){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){n=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()+","}),f=z(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(Q(),q()):(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,f=z(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(Q(),q()):(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,f=z(n,"nonce"),e(".attachments-browser li.attachment.selected").length>1&&(chkStr="",e(".attachments-browser li.attachment.selected").each(function(){chkStr+=e(this).data("id")+","})),g=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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){Q(),q(),$()}}))}}),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){n=-1,f=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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){Q(),q()}})):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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){Q(),q()}})):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")+","})),g=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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){Q(),q()}}))}}),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"),n=e(this).data("id"),o.draggable.hasClass("wcp-move-multiple")?(f=z(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){Q(),q(),$()}}))):o.draggable.hasClass("wcp-move-file")?(postID=o.draggable[0].attributes["data-id"].nodeValue,f=z(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){Q(),q(),$()}})):o.draggable.hasClass("attachment")&&(chkStr=o.draggable[0].attributes["data-id"].nodeValue,f=z(n,"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="+n+"&nonce="+f+"&status="+folders_media_options.taxonomy_status+"&taxonomy="+v,method:"post",success:function(e){Q(),q(),$()}}))}}),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 V(){e(r).jstree({core:{cache:!1,animation:0,max_depth:a?"-1":1,check_callback:function(t,o,s,r,d){if(e("*").removeClass("drag-bot").removeClass("drag-in").removeClass("drag-up"),("move_node"===t||"copy_node"===t)&&d&&d.dnd)switch(d.pos){case"a":d.origin.get_node(d.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":if(!a)return!1;d.origin.get_node(d.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":d.origin.get_node(d.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)}),""!=v&&0!=v&&e(".jstree-node[id='"+v+"']").length&&(e("#js-tree-menu").jstree("select_node",v),e(".sticky-folders .sticky-folder-"+v+" a").length&&e(".sticky-folders .sticky-folder-"+v+" a").addClass("active-item"));e(".ajax-preloader").hide(),e(".js-tree-data").show(),R(),B(),e(".sticky-folders ul > li").length>0&&e(".sticky-folders").addClass("active")}(),M()}).bind("after_open.jstree",function(){M()}).bind("open_all.jstree",function(){M()}).bind("create_node.jstree",function(){M()}).bind("delete_node.jstree",function(){M()}).bind("close_all.jstree",function(){M()}).bind("after_close.jstree",function(){M()}).bind("move_node.jstree",function(t,o){"#"!=o.node.parent&&jQuery("#js-tree-menu").jstree("open_node",o.node.parent),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"),q(),$(),E(),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(),window.location.reload(!0))}}))}),M()}function z(e,t){if(d.length>0)for(i=0;i<d.length;i++)if(parseInt(d[i].folder_id)==parseInt(e))return d[i][t];return""}function Y(e){if(d.length>0)for(i=0;i<d.length;i++)if(parseInt(d[i].folder_id)==parseInt(e))return i;return null}function B(){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"),R()}function R(){var t=0;if(e("#custom-scroll-menu").hasClass("mCustomScrollbar")){var o=jQuery("#custom-scroll-menu"),a=o.find(".mCSB_dragger"),s=o.find(".mCSB_container").height();t=a.position().top/(o.height()-a.height())*(s-o.height()),e("#custom-scroll-menu").mCustomScrollbar("destroy")}var r=jQuery(".folder-modal .media-modal-content").height()-e(".folder-modal .sticky-wcp-custom-form").height()-40;e(".folder-modal #custom-scroll-menu").closest(".media-frame-menu").length&&jQuery(".folder-custom-menu").length&&jQuery(".media-frame-menu").length&&(r=jQuery(".folder-modal .media-modal-content").height()-e(".folder-modal .sticky-wcp-custom-form").height()-jQuery(".folder-custom-menu").offset().top+jQuery(".media-frame-menu").offset().top-40),r<0&&(r=350),e("#custom-scroll-menu").mCustomScrollbar({axis:"y",scrollButtons:{enable:!0},setHeight:r,theme:"3d",scrollbarPosition:"inside",scrollInertia:500,mouseWheelPixels:60}),0!=t&&jQuery("#custom-scroll-menu").mCustomScrollbar("scrollTo",t+"px",{scrollInertia:0})}function q(){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")),""!=g&&(e("#js-tree-menu a.jstree-clicked").length>0||"-1"==v)){if(e("#media-attachment-taxonomy-filter").length){g=g.split(",");for(var t=0;t<g.length;t++)""!=g[t]&&e(".attachments-browser li[data-id='"+g[t]+"']").remove()}g=""}e("#media-attachment-taxonomy-filter").length?K(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),x=t.taxonomies,E(),M()}}),e(".folder-loader-ajax").addClass("active"),e("#folder-posts-filter").length?e("#folder-posts-filter").load(h+" #posts-filter",function(){var t={Title:"",Url:h};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(h+" #wpbody-content",!1,function(t){var o={Title:"",Url:h};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 E(){if(e("#media-attachment-taxonomy-filter").length&&(e("#media-attachment-taxonomy-filter").each(function(){folders_media_options.terms=x;var t=e(this);currentDDVal=e(this).val(),t.html("<option value='all'>All Folders</option><option value='unassigned'>(Unassigned)</option>"),x;for(var o=0;o<x.length;o++)t.append("<option value='"+x[o].term_id+"'>"+x[o].name+" ("+x[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<x.length;o++)e("select.folder_for_media option:last-child").before("<option value='"+x[o].term_id+"'>"+x[o].name+"</option>");""!=t&&e(".folder_for_media").val(t)}for(e("span.premio-folder-count").text(""),e(".folder-count").text(""),o=0;o<x.length;o++)0!=parseInt(x[o].trash_count)&&(e(".jstree-node[id='"+x[o].term_id+"'] > a.jstree-anchor span.premio-folder-count").text(x[o].trash_count),e(".sticky-folder-"+x[o].term_id+" .premio-folder-count").text(x[o].trash_count));""!=v&&e("#wcp_folder_"+v).addClass("active-item"),j&&(e("#title_"+c).trigger("click"),j=!1)}function X(){var t=e.trim(e("#folder-search").val());e("#js-tree-menu").jstree("search",t)}function L(t){var o="Are you sure you want to delete the selected folder?",a="Items in the folder will not be deleted.";if(y=!1,1==t&&e("#folder-hide-show-checkbox").is(":checked")){if(y=!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 Z(){folderName=e.trim(e("#js-tree-menu").jstree(!0).get_node(c).text),parentID=e("#wcp_folder_"+c).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 W(){if(0==u&&p>=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(""),k&&(w=c,e("#add-update-folder-name").val(e.trim(e("#js-tree-menu").jstree(!0).get_node(c).text)+" #2"),c=e("#"+c+"_anchor").closest(".jstree-node").parent().parent().hasClass("jstree-node")?e("#"+c+"_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 G(){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),M()}function K(o){U=e.ajax({url:folders_media_options.ajax_url,data:"type="+folders_media_options.post_type+"&action=wcp_get_default_list&active_id="+v,method:"post",beforeSend:function(){null!=U&&U.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}))}x=a.taxonomies,E(),M()}})}function $(){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),M()}e(document).ready(function(){o=parseInt(folders_media_options.hasStars),a=parseInt(folders_media_options.hasChildren),e(document).on("click",".thumbnail-hover-box a",function(t){return t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault(),window.open(e(this).prop("href"),"_blank"),!1}),e(document).ajaxComplete(function(e,o,a){a.data!=t&&""!=a.data&&-1!=a.data.indexOf("action=query-attachments")&&M(),""!=s&&jQuery(".folder-modal ul.attachments li[data-id='"+s+"']").length&&!jQuery(".folder-modal ul.attachments li[data-id='"+s+"']").hasClass("selected")&&jQuery(".folder-modal ul.attachments li[data-id='"+s+"']").trigger("click")}),x=folders_media_options.terms,u=parseInt(folders_media_options.is_key_active),p=parseInt(folders_media_options.folders),d=folders_media_options.folder_settings,e(document).on("click",".header-posts a.all-posts",function(t){c=0,v="",l="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){c=0,v="",l="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");l=c=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=z(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()?l=e(this).val():"add-folder"==e(this).val()&&(l=-1)}),e(document).on("click",".new-folder-pro",function(t){t.preventDefault(),e(".dynamic-menu").remove(),e("#sub-folder-popup").show()}),e(document).on("click",".close-popup-button a",function(){e(".folder-popup-form").hide()}),e(document).on("click",".update-inline-record",function(s){var r;(s.stopImmediatePropagation(),s.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>",menuHtml+=a?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=o?"<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='mark-folder-pro'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</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),s.pageX==t||s.pageY==t?(e(".dynamic-menu").css("left",C),e(".dynamic-menu").css("top",S-10),r=S):(e(".dynamic-menu").css("left",s.pageX),e(".dynamic-menu").css("top",s.pageY),r=s.pageY),r+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(r+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 C=t.pageX,S=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 r;(s.stopImmediatePropagation(),s.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>",menuHtml+=a?"<li class='new-folder'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Folder</a></li>":"<li class='new-folder-pro'><a href='javascript:;'><span class=''><i class='pfolder-add-folder'></i></span>New Sub-folder (Pro)</a></li>",menuHtml+="<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>",menuHtml+=o?"<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='mark-folder-pro'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class=''><i class='pfolder-star'></i></span>"+(isHigh?"Remove Star (Pro)":"Add a Star (Pro)")+"</a></li>",menuHtml+="<li class='lock-folder'><a target='_blank' href='"+folders_media_options.upgrade_url+"'><span class='dashicons dashicons-lock'></span>Lock Folder (Pro)</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"),s.pageX==t||s.pageY==t?(e(".dynamic-menu").css("left",C),e(".dynamic-menu").css("top",S-10),r=S):(e(".dynamic-menu").css("left",s.pageX),e(".dynamic-menu").css("top",s.pageY),r=s.pageY),r+e(".dynamic-menu").height()>e(window).height()&&e(".dynamic-menu").css("margin-top",e(window).height()-(r+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(),c=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu"),j=!1,k=!1,W()}),e(document).on("click","#add-new-folder",function(t){e("#js-tree-menu a.jstree-clicked").length?(c=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),a||e("#pro-notice").removeClass("hide-it")):(c=0,e("#pro-notice").addClass("hide-it")),j=!1,W()}),e(document).on("submit","#save-folder-form",function(t){if(t.stopPropagation(),t.preventDefault(),m=e("#add-update-folder-name").val(),""==e.trim(m))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=c;j&&(o=0),a||(o=0),b=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:b,name:m,is_duplicate:k,duplicate_from:w},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(u=parseInt(result.is_key_active),p=parseInt(result.folders),e("#current-folder").text(p),e("#ttl-fldr").text(10),G(),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};d.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)})}$(),B(),c=result.term_id,K(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(),c=e(this).closest(".dynamic-menu").data("id"),Z(),e(".dynamic-menu").remove()}),e(document).on("click","#inline-update",function(t){e("#js-tree-menu a.jstree-clicked").length&&(c=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),Z())}),e(document).on("submit","#update-folder-form",function(o){return o.stopPropagation(),o.preventDefault(),m=e("#update-folder-item-name").val(),""==e.trim(m)?(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"),f=z(c,"nonce"),parentID=e(".jstree-node[id='"+c+"']").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:f,term_id:c,order:b,name:m},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=Y(result.id),null!=folderPostId&&(d[folderPostId].nonce=result.nonce,d[folderPostId].slug=result.slug),e(".folder-popup-form").hide(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),$(),e("#media-attachment-taxonomy-filter").length&&K(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(),n=e(this).closest(".dynamic-menu").data("id"),f=z(n,"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="+n+"&type="+folders_media_options.post_type+"&action=wcp_mark_un_mark_folder&nonce="+f,method:"post",cache:!1,success:function(t){t=e.parseJSON(t),e(".form-loader-count").css("width","0%"),"1"==t.status?(folderPostId=Y(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&&(d[folderPostId].is_high=1)):(e("li.jstree-node[id='"+t.id+"']").removeClass("is-high"),e(".sticky-folder-"+t.id).removeClass("is-high"),null!=folderPostId&&(d[folderPostId].is_high=0)),$()):(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(),c=e(this).closest(".dynamic-menu").data("id"),e(".dynamic-menu").remove(),j=!1,k=!0,W()}),e(document).on("click",".remove-folder",function(){n=e(this).closest(".dynamic-menu").data("id"),c=e(this).closest(".dynamic-menu").data("id"),L(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>'),f=z(c,"nonce"),y?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(u=parseInt(t.is_key_active),p=parseInt(t.folders),e("#current-folder").text(p),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),$(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),q(),B(),$(),e(".folder-modal #wcp_folder_"+v).length||(e(".header-posts a").trigger("click"),v=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="+c+"&nonce="+f,method:"post",success:function(t){"1"==(t=e.parseJSON(t)).status?(e("#js-tree-menu").jstree().delete_node(c),u=parseInt(t.is_key_active),p=parseInt(t.folders),e("#current-folder").text(p),e("#ttl-fldr").text(10),e(".sticky-folders .sticky-folder-"+c).remove(),$(),e(".folder-popup-form").hide(),e(".folder-popup-form").removeClass("disabled"),q(),B(),v==c&&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")),g="",e("#js-tree-menu .jstree-node:not(.jstree-leaf)").each(function(){g+=e(this).attr("id")+","}),""!=g&&(e(".form-loader-count").css("width","100%"),f=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="+g+"&nonce="+f,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:not(.pro-feature)",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),x=t.terms,E(),V()),e(".form-loader-count").css("width","0")}})}),e(document).on("click",".jstree-node .jstree-icon",function(){n=e(this).closest("li.jstree-node").attr("id"),e("li.jstree-node[id='"+n+"']").hasClass("jstree-open")?folderStatus=1:folderStatus=0,e(".form-loader-count").css("width","100%"),f=z(n,"nonce"),G(),e.ajax({url:folders_media_options.ajax_url,data:"is_active="+folderStatus+"&action=save_wcp_folder_state&term_id="+n+"&nonce="+f,method:"post",success:function(t){e(".form-loader-count").css("width","0"),"0"==(t=e.parseJSON(t)).status||(e("#wcp_folder_"+n).hasClass("active")?(e("#wcp_folder_"+n).removeClass("active"),e("#wcp_folder_"+n).find("ul.ui-sortable:first-child > li").slideUp(),folderStatus=0):(e("#wcp_folder_"+n).addClass("active"),e("#wcp_folder_"+n).find("ul.ui-sortable:first-child > li").slideDown(),folderStatus=1),$())}})}),e(document).on("keyup","#folder-search",function(){X()}),e(document).on("change","#folder-search",function(){X()}),e(document).on("blur","#folder-search",function(){X()}),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?(c=e("#js-tree-menu a.jstree-clicked").closest("li.jstree-node").attr("id"),L(1),e(".dynamic-menu").remove(),e(".active-menu").removeClass("active-menu")):e("#folder-hide-show-checkbox").is(":checked")&&(e(".dynamic-menu").remove(),L(1))}),e(document).on("change",".folder_for_media",function(){"add-folder"==e(this).val()&&(j=!0,e("#add-new-folder").trigger("click"))}),M(),e(document).on("click",".undo-button",function(){e("#do-undo").removeClass("active"),"yes"==folders_media_options.useFolderUndo&&e.ajax({url:folders_media_options.ajax_url,type:"post",data:{post_type:folders_media_options.post_type,nonce:folders_media_options.nonce,action:"wcp_undo_folder_changes"},success:function(t){e("#undo-done").addClass("active"),setTimeout(function(){e("#undo-done").removeClass("active")},2500),q()}})}),e(document).on("click",".close-undo-box",function(t){t.preventDefault(),e("#do-undo").removeClass("active")})})});
assets/js/replace-file-name.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ "use strict";
3
+ if (typeof define === 'function' && define.amd) {
4
+ define(['jquery'], factory);
5
+ }
6
+ else if(typeof module !== 'undefined' && module.exports) {
7
+ module.exports = factory(require('jquery'));
8
+ }
9
+ else {
10
+ factory(jQuery);
11
+ }
12
+ }(function ($, undefined) {
13
+ $(document).ready(function(){
14
+ var appendString = "<div class='folders-undo-notification' id='name-change-success'><div class='folders-undo-body' style='padding: 0'><a href='javascript:;' class='close-undo-box'><span></span></a><div class='folders-undo-header' style='padding: 0'></div></div></div>";
15
+ $("body").append(appendString);
16
+ $(document).on("click", ".folder-replace-checkbox", function(){
17
+ if($(this).is(":checked")) {
18
+ $(this).closest("td").find("a.update-name-with-title").addClass("show");
19
+ } else {
20
+ $(this).closest("td").find("a.update-name-with-title").removeClass("show");
21
+ }
22
+ });
23
+ $(document).on("click", ".close-undo-box", function(e){
24
+ e.preventDefault();
25
+ $("#name-change-success").removeClass("active");
26
+ });
27
+ });
28
+ }));
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.8
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  * Text Domain: folders
@@ -17,12 +17,6 @@ if(!defined("WCP_FOLDERS_PLUGIN_FILE")) {
17
  if(!defined("WCP_FOLDERS_PLUGIN_BASE")) {
18
  define('WCP_FOLDERS_PLUGIN_BASE', plugin_basename(WCP_FOLDERS_PLUGIN_FILE));
19
  }
20
- if(!defined("WCP_FOLDER")) {
21
- define('WCP_FOLDER', 'folders');
22
- }
23
- if(!defined("WCP_FOLDER_VAR")) {
24
- define('WCP_FOLDER_VAR', 'folders_settings');
25
- }
26
  if(!defined("WCP_DS")) {
27
  define("WCP_DS", DIRECTORY_SEPARATOR);
28
  }
@@ -30,7 +24,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.8");
34
  }
35
 
36
 
2
  /**
3
  * Plugin Name: Folders
4
  * Description: Arrange media, pages, custom post types and posts into folders
5
+ * Version: 2.6.9
6
  * Author: Premio
7
  * Author URI: https://premio.io/downloads/folders/
8
  * Text Domain: folders
17
  if(!defined("WCP_FOLDERS_PLUGIN_BASE")) {
18
  define('WCP_FOLDERS_PLUGIN_BASE', plugin_basename(WCP_FOLDERS_PLUGIN_FILE));
19
  }
 
 
 
 
 
 
20
  if(!defined("WCP_DS")) {
21
  define("WCP_DS", DIRECTORY_SEPARATOR);
22
  }
24
  define('WCP_FOLDER_URL', plugin_dir_url(__FILE__));
25
  }
26
  if(!defined("WCP_FOLDER_VERSION")) {
27
+ define('WCP_FOLDER_VERSION', "2.6.9");
28
  }
29
 
30
 
includes/folders.class.php CHANGED
@@ -79,6 +79,8 @@ class WCP_Folders
79
  add_action('wp_ajax_wcp_remove_all_folders_data', array($this, 'remove_all_folders_data'));
80
  /* Update folders Status */
81
  add_action('wp_ajax_wcp_update_folders_uninstall_status', array($this, 'update_folders_uninstall_status'));
 
 
82
  self::$folders = 10;
83
 
84
  /* Send message on plugin deactivate */
@@ -184,12 +186,12 @@ class WCP_Folders
184
  $errorCounter = 0;
185
 
186
  if (!isset($postData['nonce']) || empty($postData['nonce'])) {
187
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
188
  $errorCounter++;
189
  } else {
190
  $nonce = self::sanitize_options($postData['nonce']);
191
  if(!wp_verify_nonce($nonce, 'wcp_folders_uninstall_status')) {
192
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
193
  $errorCounter++;
194
  }
195
  }
@@ -214,13 +216,13 @@ class WCP_Folders
214
  $errorCounter = 0;
215
 
216
  if (!isset($postData['nonce']) || empty($postData['nonce'])) {
217
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
218
  $errorCounter++;
219
  } else {
220
  $type = self::sanitize_options($postData['type']);
221
  $nonce = self::sanitize_options($postData['nonce']);
222
  if(!wp_verify_nonce($nonce, 'remove_folders_data')) {
223
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
224
  $errorCounter++;
225
  }
226
  }
@@ -289,25 +291,25 @@ class WCP_Folders
289
  $errorCounter = 0;
290
 
291
  if (!isset($postData['order']) || empty($postData['order'])) {
292
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
293
  $errorCounter++;
294
  } else if (!isset($postData['type']) || empty($postData['type'])) {
295
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
296
  $errorCounter++;
297
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
298
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
299
  $errorCounter++;
300
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
301
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
302
  $errorCounter++;
303
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
304
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
305
  $errorCounter++;
306
  } else {
307
  $type = self::sanitize_options($postData['type']);
308
  $nonce = self::sanitize_options($postData['nonce']);
309
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
310
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
311
  $errorCounter++;
312
  }
313
  }
@@ -355,19 +357,19 @@ class WCP_Folders
355
  $postData = filter_input_array(INPUT_POST);
356
  $error = 0;
357
  if (!isset($postData['post_id']) || empty($postData['post_id'])) {
358
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
359
  $error = 1;
360
  } else if (!isset($postData['post_type']) || empty($postData['type'])) {
361
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
362
  $error = 1;
363
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
364
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
365
  $error = 1;
366
  } else if ($postData['post_type'] == "page" && !current_user_can("edit_pages")) {
367
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
368
  $error = 1;
369
  } else if ($postData['post_type'] != "page" && !current_user_can("edit_posts")) {
370
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
371
  $error = 1;
372
  }
373
  if($error == 0) {
@@ -408,7 +410,7 @@ class WCP_Folders
408
 
409
  $post_table = $wpdb->prefix."posts";
410
  $term_table = $wpdb->prefix."term_relationships";
411
- $options = get_option(WCP_FOLDER_VAR);
412
  $option_array = array();
413
  if(!empty($options)) {
414
  foreach ($options as $option) {
@@ -649,18 +651,18 @@ class WCP_Folders
649
  }
650
  /* Free/Pro Class name change */
651
  $options = WCP_Tree::get_folder_option_data($post_type);?>
652
- <p class="attachments-category"><?php esc_html_e("Select a folder (Optional)", WCP_FOLDER) ?></p>
653
- <p class="attachments-category"><?php esc_html_e("First select the folder, and then upload the files", WCP_FOLDER) ?><br/></p>
654
  <p>
655
  <?php
656
  $request = $_SERVER['REQUEST_URI'];
657
  $request = strpos($request, "post.php");
658
  ?>
659
  <select name="folder_for_media" class="folder_for_media">
660
- <option value="-1">- <?php esc_html_e('Unassigned', WCP_FOLDER) ?></option>
661
  <?php echo $options ?>
662
  <?php if(($typenow == "attachment" && isset($current_screen->base) && $current_screen->base == "upload") || ($request !== false) || self::is_for_this_post_type('attachment') || self::is_for_this_post_type('media')) {?>
663
- <option value="add-folder"><?php esc_html_e('+ Create a New Folder', WCP_FOLDER) ?></option>
664
  <?php } ?>
665
  </select>
666
  </p>
@@ -679,25 +681,25 @@ class WCP_Folders
679
  $errorCounter = 0;
680
 
681
  if (!isset($postData['status']) || empty($postData['status'])) {
682
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
683
  $errorCounter++;
684
  } else if (!isset($postData['type']) || empty($postData['type'])) {
685
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
686
  $errorCounter++;
687
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
688
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
689
  $errorCounter++;
690
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
691
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
692
  $errorCounter++;
693
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
694
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
695
  $errorCounter++;
696
  } else {
697
  $type = self::sanitize_options($postData['type']);
698
  $nonce = self::sanitize_options($postData['nonce']);
699
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
700
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
701
  $errorCounter++;
702
  }
703
  }
@@ -722,25 +724,25 @@ class WCP_Folders
722
  $postData = filter_input_array(INPUT_POST);
723
  $errorCounter = 0;
724
  if (!isset($postData['status']) || empty($postData['status'])) {
725
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
726
  $errorCounter++;
727
  } else if (!isset($postData['type']) || empty($postData['type'])) {
728
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
729
  $errorCounter++;
730
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
731
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
732
  $errorCounter++;
733
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
734
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
735
  $errorCounter++;
736
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
737
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
738
  $errorCounter++;
739
  } else {
740
  $type = self::sanitize_options($postData['type']);
741
  $nonce = self::sanitize_options($postData['nonce']);
742
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
743
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
744
  $errorCounter++;
745
  }
746
  }
@@ -764,22 +766,23 @@ class WCP_Folders
764
  $postData = filter_input_array(INPUT_POST);
765
  $errorCounter = 0;
766
  if (!isset($postData['post_id']) || empty($postData['post_id'])) {
767
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
768
  $errorCounter++;
769
  } else if (!isset($postData['type']) || empty($postData['type'])) {
770
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
771
  $errorCounter++;
772
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
773
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
774
  $errorCounter++;
775
  } else if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['type'])) {
776
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
777
  $errorCounter++;
778
  } else if(!current_user_can("manage_categories")) {
779
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
780
  $errorCounter++;
781
  }
782
  if ($errorCounter == 0) {
 
783
  $type = self::sanitize_options($postData['type']);
784
  $post_id = self::sanitize_options($postData['post_id']);
785
 
@@ -789,10 +792,18 @@ class WCP_Folders
789
 
790
  foreach($post_id as $id) {
791
  if(!empty($id) && is_numeric($id) && $id > 0) {
 
 
 
 
 
 
 
792
  wp_delete_object_term_relationships($id, $taxonomy);
793
  }
794
  }
795
-
 
796
  $response['status'] = 1;
797
  }
798
  echo json_encode($response);
@@ -1048,7 +1059,7 @@ class WCP_Folders
1048
  return;
1049
  }
1050
 
1051
- if ($typenow == "attachment" || !is_admin()) {
1052
  /* Free/Pro URL Change */
1053
  global $typenow;
1054
  $is_active = 1;
@@ -1116,11 +1127,19 @@ class WCP_Folders
1116
  $hasChild = empty($hasChild)?0:1;
1117
  $hasStars = empty($hasStars)?0:1;
1118
 
 
 
 
 
 
 
 
 
1119
  wp_enqueue_script('folders-tree', WCP_FOLDER_URL . 'assets/js/jstree.min.js', array(), WCP_FOLDER_VERSION);
1120
  wp_enqueue_script('wcp-folders-mcustomscrollbar', WCP_FOLDER_URL . 'assets/js/jquery.mcustomscrollbar.min.js', array(), WCP_FOLDER_VERSION);
1121
- wp_enqueue_script('folders-media', WCP_FOLDER_URL . 'assets/js/page-post-media.min.js', array('media-editor', 'media-views', 'jquery', 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'backbone'), WCP_FOLDER_VERSION, true);
1122
  wp_enqueue_script('wcp-jquery-touch', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.ui.touch-punch.min.js', array('jquery'), WCP_FOLDER_VERSION);
1123
- wp_localize_script('folders-media', 'folders_media_options', array(
1124
  'terms' => $taxonomies,
1125
  'taxonomy' => get_taxonomy('media_folder'),
1126
  'ajax_url' => admin_url("admin-ajax.php"),
@@ -1144,7 +1163,9 @@ class WCP_Folders
1144
  'svg_file' => WCP_FOLDER_URL . 'assets/images/pin.png',
1145
  'folder_settings' => $folder_settings,
1146
  'hasStars' => $hasStars,
1147
- 'hasChildren' => $hasChild
 
 
1148
  ));
1149
  /* Free/Pro URL Change */
1150
  wp_enqueue_style('folders-jstree', WCP_FOLDER_URL . 'assets/css/jstree.min.css', array(), WCP_FOLDER_VERSION);
@@ -1364,14 +1385,18 @@ class WCP_Folders
1364
  return;
1365
  }
1366
 
 
 
 
 
1367
  $current_term = false;
1368
  if ( isset( $_REQUEST['media_folder'] ) ) {
1369
  $current_term = sanitize_text_field($_REQUEST['media_folder']);
1370
  }
1371
 
1372
  wp_dropdown_categories( array(
1373
- 'show_option_all' => esc_attr__( 'All Folders', WCP_FOLDER),
1374
- 'show_option_none' => esc_attr__( '(Unassigned)', WCP_FOLDER),
1375
  'option_none_value' => -1,
1376
  'orderby' => 'meta_value_num',
1377
  'order' => 'ASC',
@@ -1422,19 +1447,19 @@ class WCP_Folders
1422
  $response['errors'] = array();
1423
  $response['message'] = "";
1424
  $errorArray = [];
1425
- $errorMessage = esc_attr__("%s is required", WCP_FOLDER);
1426
  $postData = filter_input_array(INPUT_POST);
1427
  if (!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
1428
  $error = array(
1429
  "key" => "textarea_text",
1430
- "message" => esc_attr__("Please enter your message", WCP_FOLDER)
1431
  );
1432
  $errorArray[] = $error;
1433
  }
1434
  if (!isset($postData['user_email']) || trim($postData['user_email']) == "") {
1435
  $error = array(
1436
  "key" => "user_email",
1437
- "message" => sprintf($errorMessage, __("Email", WCP_FOLDER))
1438
  );
1439
  $errorArray[] = $error;
1440
  } else if (!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) {
@@ -1448,14 +1473,14 @@ class WCP_Folders
1448
  if (!isset($postData['folder_help_nonce']) || trim($postData['folder_help_nonce']) == "") {
1449
  $error = array(
1450
  "key" => "nonce",
1451
- "message" => esc_attr__("Your request is not valid", WCP_FOLDER)
1452
  );
1453
  $errorArray[] = $error;
1454
  } else {
1455
  if (!wp_verify_nonce($postData['folder_help_nonce'], 'wcp_folder_help_nonce')) {
1456
  $error = array(
1457
  "key" => "nonce",
1458
- "message" => esc_attr__("Your request is not valid", WCP_FOLDER)
1459
  );
1460
  $errorArray[] = $error;
1461
  }
@@ -1520,13 +1545,13 @@ class WCP_Folders
1520
  $errorCounter++;
1521
  $response['message'] = "Please provide reason";
1522
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1523
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1524
  $errorCounter++;
1525
  $response['valid'] = 0;
1526
  } else {
1527
  $nonce = self::sanitize_options($postData['nonce']);
1528
  if(!wp_verify_nonce($nonce, 'wcp_folder_deactivate_nonce')) {
1529
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1530
  $errorCounter++;
1531
  $response['valid'] = 0;
1532
  }
@@ -1590,7 +1615,7 @@ class WCP_Folders
1590
  }
1591
 
1592
  public static function ttl_fldrs() {
1593
- $post_types = get_option(WCP_FOLDER_VAR);
1594
  $post_types = is_array($post_types) ? $post_types : array();
1595
  $total = 0;
1596
  foreach ($post_types as $post_type) {
@@ -1626,22 +1651,22 @@ class WCP_Folders
1626
  $postData = filter_input_array(INPUT_POST);
1627
  $errorCounter = 0;
1628
  if (!isset($postData['type']) || empty($postData['type'])) {
1629
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1630
  $errorCounter++;
1631
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1632
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1633
  $errorCounter++;
1634
  } else if (!current_user_can("manage_categories") || ($postData['type'] == "page" && !current_user_can("edit_pages"))) {
1635
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
1636
  $errorCounter++;
1637
  } else if (!current_user_can("manage_categories") || ($postData['type'] != "page" && !current_user_can("edit_posts"))) {
1638
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
1639
  $errorCounter++;
1640
  } else {
1641
  $type = self::sanitize_options($postData['type']);
1642
  $nonce = self::sanitize_options($postData['nonce']);
1643
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
1644
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1645
  $errorCounter++;
1646
  }
1647
  }
@@ -1672,25 +1697,25 @@ class WCP_Folders
1672
  $postData = filter_input_array(INPUT_POST);
1673
  $errorCounter = 0;
1674
  if (!isset($postData['width']) || empty($postData['width'])) {
1675
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1676
  $errorCounter++;
1677
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1678
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1679
  $errorCounter++;
1680
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1681
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1682
  $errorCounter++;
1683
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
1684
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
1685
  $errorCounter++;
1686
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
1687
- $response['message'] = esc_attr__("You have not permission to update width", WCP_FOLDER);
1688
  $errorCounter++;
1689
  } else {
1690
  $type = self::sanitize_options($postData['type']);
1691
  $nonce = self::sanitize_options($postData['nonce']);
1692
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
1693
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1694
  $errorCounter++;
1695
  }
1696
  }
@@ -1715,31 +1740,32 @@ class WCP_Folders
1715
  $postData = filter_input_array(INPUT_POST);
1716
  $errorCounter = 0;
1717
  if (!isset($postData['post_ids']) || empty($postData['post_ids'])) {
1718
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1719
  $errorCounter++;
1720
  } else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
1721
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1722
  $errorCounter++;
1723
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1724
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1725
  $errorCounter++;
1726
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1727
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1728
  $errorCounter++;
1729
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
1730
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
1731
  $errorCounter++;
1732
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
1733
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
1734
  $errorCounter++;
1735
  } else {
1736
  $folder_id = self::sanitize_options($postData['folder_id']);
1737
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$folder_id)) {
1738
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1739
  $errorCounter++;
1740
  }
1741
  }
1742
  if ($errorCounter == 0) {
 
1743
  $postID = self::sanitize_options($postData['post_ids']);
1744
  $postID = trim($postID, ",");
1745
  $folderID = self::sanitize_options($postData['folder_id']);
@@ -1759,6 +1785,11 @@ class WCP_Folders
1759
  $post_type = self::get_custom_post_type($type);
1760
  foreach ($postArray as $post) {
1761
  $terms = get_the_terms($post, $post_type);
 
 
 
 
 
1762
  if (!empty($terms)) {
1763
  foreach ($terms as $term) {
1764
  if(!empty($taxonomy) && ($term->term_id == $taxonomy || $term->slug == $taxonomy)) {
@@ -1770,11 +1801,58 @@ class WCP_Folders
1770
  }
1771
  }
1772
  $response['status'] = 1;
 
 
1773
  }
1774
  echo json_encode($response);
1775
  wp_die();
1776
  }
1777
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1778
  public function wcp_change_post_folder()
1779
  {
1780
  $response = array();
@@ -1786,26 +1864,26 @@ class WCP_Folders
1786
  $errorCounter = 0;
1787
  if (!isset($postData['post_id']) || empty($postData['post_id'])) {
1788
  $errorCounter++;
1789
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1790
  } else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
1791
  $errorCounter++;
1792
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1793
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1794
  $errorCounter++;
1795
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1796
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1797
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1798
  $errorCounter++;
1799
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
1800
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
1801
  $errorCounter++;
1802
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
1803
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
1804
  $errorCounter++;
1805
  } else {
1806
  $term_id = self::sanitize_options($postData['folder_id']);
1807
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
1808
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1809
  $errorCounter++;
1810
  }
1811
  }
@@ -1848,18 +1926,18 @@ class WCP_Folders
1848
  $postData = filter_input_array(INPUT_POST);
1849
  $errorCounter = 0;
1850
  if (!current_user_can("manage_categories")) {
1851
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
1852
  $errorCounter++;
1853
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
1854
  $errorCounter++;
1855
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1856
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1857
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1858
  $errorCounter++;
1859
  } else {
1860
  $term_id = self::sanitize_options($postData['term_id']);
1861
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
1862
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1863
  $errorCounter++;
1864
  }
1865
  }
@@ -1891,18 +1969,18 @@ class WCP_Folders
1891
  $postData = filter_input_array(INPUT_POST);
1892
  $errorCounter = 0;
1893
  if (!current_user_can("manage_categories")) {
1894
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
1895
  $errorCounter++;
1896
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
1897
  $errorCounter++;
1898
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1899
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1900
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1901
  $errorCounter++;
1902
  } else {
1903
  $term_id = self::sanitize_options($postData['term_id']);
1904
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
1905
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1906
  $errorCounter++;
1907
  }
1908
  }
@@ -1934,21 +2012,21 @@ class WCP_Folders
1934
  $postData = filter_input_array(INPUT_POST);
1935
  $errorCounter = 0;
1936
  if (!current_user_can("manage_categories")) {
1937
- $response['message'] = esc_attr__("You have not permission to update folder order", WCP_FOLDER);
1938
  $errorCounter++;
1939
  } else if (!isset($postData['term_ids']) || empty($postData['term_ids'])) {
1940
  $errorCounter++;
1941
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1942
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1943
  $errorCounter++;
1944
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1945
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1946
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1947
  $errorCounter++;
1948
  } else {
1949
  $type = self::sanitize_options($postData['type']);
1950
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
1951
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
1952
  $errorCounter++;
1953
  }
1954
  }
@@ -1994,18 +2072,18 @@ class WCP_Folders
1994
  $postData = filter_input_array(INPUT_POST);
1995
  $errorCounter = 0;
1996
  if (!current_user_can("manage_categories")) {
1997
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
1998
  $errorCounter++;
1999
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2000
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2001
  $errorCounter++;
2002
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2003
- $response['message'] = esc_attr__("Unable to create folder, Your request is not valid", WCP_FOLDER);
2004
  $errorCounter++;
2005
  } else {
2006
  $term_id = self::sanitize_options($postData['term_id']);
2007
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2008
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2009
  $errorCounter++;
2010
  }
2011
  }
@@ -2034,24 +2112,24 @@ class WCP_Folders
2034
  $postData = filter_input_array(INPUT_POST);
2035
  $errorCounter = 0;
2036
  if (!current_user_can("manage_categories")) {
2037
- $response['message'] = esc_attr__("You have not permission to update folder", WCP_FOLDER);
2038
  $errorCounter++;
2039
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2040
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2041
  $errorCounter++;
2042
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2043
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2044
  $errorCounter++;
2045
  } else if (!isset($postData['parent_id'])) {
2046
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2047
  $errorCounter++;
2048
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2049
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2050
  $errorCounter++;
2051
  } else {
2052
  $term_id = self::sanitize_options($postData['term_id']);
2053
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2054
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2055
  $errorCounter++;
2056
  }
2057
  }
@@ -2080,18 +2158,18 @@ class WCP_Folders
2080
  $postData = filter_input_array(INPUT_POST);
2081
  $errorCounter = 0;
2082
  if (!isset($postData['type']) || empty($postData['type'])) {
2083
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2084
  $errorCounter++;
2085
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2086
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2087
  $errorCounter++;
2088
  } else if (!current_user_can("manage_categories")) {
2089
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2090
  $errorCounter++;
2091
  } else {
2092
  $type = self::sanitize_options($postData['type']);
2093
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
2094
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2095
  $errorCounter++;
2096
  }
2097
  }
@@ -2121,21 +2199,21 @@ class WCP_Folders
2121
  $errorCounter = 0;
2122
  $error = "";
2123
  if (!current_user_can("manage_categories")) {
2124
- $error = esc_attr__("You have not permission to remove folder", WCP_FOLDER);
2125
  $errorCounter++;
2126
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2127
- $error = esc_attr__("Your request is not valid", WCP_FOLDER);
2128
  $errorCounter++;
2129
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2130
- $error = esc_attr__("Your request is not valid", WCP_FOLDER);
2131
  $errorCounter++;
2132
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2133
- $response['message'] = esc_attr__("Your request is not valid", WCP_FOLDER);
2134
  $errorCounter++;
2135
  } else {
2136
  $type = self::sanitize_options($postData['type']);
2137
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
2138
- $error = esc_attr__("Your request is not valid", WCP_FOLDER);
2139
  $errorCounter++;
2140
  }
2141
  }
@@ -2176,21 +2254,21 @@ class WCP_Folders
2176
  $postData = filter_input_array(INPUT_POST);
2177
  $errorCounter = 0;
2178
  if (!current_user_can("manage_categories")) {
2179
- $error = esc_attr__("You have not permission to remove folder", WCP_FOLDER);
2180
  $errorCounter++;
2181
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2182
- $error = esc_attr__("Your request is not valid", WCP_FOLDER);
2183
  $errorCounter++;
2184
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2185
- $error = esc_attr__("Your request is not valid", WCP_FOLDER);
2186
  $errorCounter++;
2187
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2188
- $error = esc_attr__("Unable to delete folder, Your request is not valid", WCP_FOLDER);
2189
  $errorCounter++;
2190
  } else {
2191
  $term_id = self::sanitize_options($postData['term_id']);
2192
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2193
- $error = esc_attr__("Unable to delete folder, Your request is not valid", WCP_FOLDER);
2194
  $errorCounter++;
2195
  }
2196
  }
@@ -2240,24 +2318,24 @@ class WCP_Folders
2240
  $postData = $_REQUEST;
2241
  $errorCounter = 0;
2242
  if (!current_user_can("manage_categories")) {
2243
- $error = esc_attr__("You have not permission to update folder", WCP_FOLDER);
2244
  $errorCounter++;
2245
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2246
- $error = esc_attr__("Unable to rename folder, Your request is not valid", WCP_FOLDER);
2247
  $errorCounter++;
2248
  } else if (!isset($postData['name']) || empty($postData['name'])) {
2249
- $error = esc_attr__("Folder name can no be empty", WCP_FOLDER);
2250
  $errorCounter++;
2251
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2252
- $error = esc_attr__("Your request is not valid", WCP_FOLDER);
2253
  $errorCounter++;
2254
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2255
- $error = esc_attr__("Unable to rename folder, Your request is not valid", WCP_FOLDER);
2256
  $errorCounter++;
2257
  } else {
2258
  $term_id = self::sanitize_options($postData['term_id']);
2259
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2260
- $error = esc_attr__("Unable to rename folder, Your request is not valid", WCP_FOLDER);
2261
  $errorCounter++;
2262
  }
2263
  }
@@ -2281,7 +2359,7 @@ class WCP_Folders
2281
  $response['term_title'] = $postData['name'];
2282
  $response['nonce'] = $term_nonce;
2283
  } else {
2284
- $response['message'] = esc_attr__("Unable to rename folder", WCP_FOLDER);
2285
  }
2286
  } else {
2287
  $response['error'] = 1;
@@ -2321,24 +2399,25 @@ class WCP_Folders
2321
  $response['message2'] = "";
2322
  $postData = $_REQUEST;
2323
  $errorCounter = 0;
 
2324
  if (!current_user_can("manage_categories")) {
2325
- $error = esc_attr__("You have not permission to add folder", WCP_FOLDER);
2326
  $errorCounter++;
2327
  } else if (!isset($postData['name']) || empty($postData['name'])) {
2328
- $error = esc_attr__("Folder name can no be empty", WCP_FOLDER);
2329
  $errorCounter++;
2330
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2331
- $error = esc_attr__("Your request is not valid", WCP_FOLDER);
2332
  $errorCounter++;
2333
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2334
  $response['login'] = 0;
2335
- $error = esc_attr__("Unable to create folder, Your request is not valid", WCP_FOLDER);
2336
  $errorCounter++;
2337
  } else {
2338
  $type = self::sanitize_options($postData['type']);
2339
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
2340
  $response['login'] = 0;
2341
- $error = esc_attr__("Unable to create folder, Your request is not valid", WCP_FOLDER);
2342
  $errorCounter++;
2343
  }
2344
  }
@@ -2455,7 +2534,7 @@ class WCP_Folders
2455
  }
2456
  } else {
2457
  $response['error'] = 1;
2458
- $response['message'] = esc_attr__("Folder name already exists", WCP_FOLDER);
2459
  }
2460
  } else {
2461
  $response['error'] = 1;
@@ -2467,7 +2546,7 @@ class WCP_Folders
2467
 
2468
  public function is_for_this_post_type($post_type)
2469
  {
2470
- $post_types = get_option(WCP_FOLDER_VAR);
2471
  $post_types = is_array($post_types)?$post_types:array();
2472
  return in_array($post_type, $post_types);
2473
  }
@@ -2484,7 +2563,7 @@ class WCP_Folders
2484
  return true;
2485
  }
2486
 
2487
- $post_types = get_option(WCP_FOLDER_VAR);
2488
  $post_types = is_array($post_types)?$post_types:array();
2489
 
2490
  if(empty($typenow) && 'upload' == $current_screen->base ) {
@@ -2501,7 +2580,7 @@ class WCP_Folders
2501
  global $current_screen;
2502
  $current_type = $current_screen->base;
2503
  $action = $current_screen->action;
2504
- $post_types = get_option(WCP_FOLDER_VAR);
2505
  $post_types = is_array($post_types)?$post_types:array();
2506
  global $typenow;
2507
  if (in_array($current_type, $post_types) && in_array($action, array("add", ""))) {
@@ -2595,7 +2674,7 @@ class WCP_Folders
2595
 
2596
  public function create_folder_terms()
2597
  {
2598
- $options = get_option(WCP_FOLDER_VAR);
2599
  $options = is_array($options)?$options:array();
2600
  $old_plugin_status = 0;
2601
  $posts = array();
@@ -2611,7 +2690,7 @@ class WCP_Folders
2611
  }
2612
  }
2613
  if(!empty($posts)) {
2614
- update_option(WCP_FOLDER_VAR, $posts);
2615
  }
2616
  }
2617
  if ($old_plugin_status == 1) {
@@ -2621,24 +2700,24 @@ class WCP_Folders
2621
  update_option("folder_old_plugin_status", "1");
2622
  }
2623
  }
2624
- $posts = get_option(WCP_FOLDER_VAR);
2625
  if (!empty($posts)) {
2626
  foreach ($posts as $post_type) {
2627
  $labels = array(
2628
- 'name' => esc_html__('Folders', WCP_FOLDER),
2629
- 'singular_name' => esc_html__('Folder', WCP_FOLDER),
2630
- 'all_items' => esc_html__('All Folders', WCP_FOLDER),
2631
- 'edit_item' => esc_html__('Edit Folder', WCP_FOLDER),
2632
- 'update_item' => esc_html__('Update Folder', WCP_FOLDER),
2633
- 'add_new_item' => esc_html__('Add New Folder', WCP_FOLDER),
2634
- 'new_item_name' => esc_html__('Add folder name', WCP_FOLDER),
2635
- 'menu_name' => esc_html__('Folders', WCP_FOLDER),
2636
- 'search_items' => esc_html__('Search Folders', WCP_FOLDER),
2637
- 'parent_item' => esc_html__('Parent Folder', WCP_FOLDER),
2638
  );
2639
 
2640
  $args = array(
2641
- 'label' => esc_html__('Folder', WCP_FOLDER),
2642
  'labels' => $labels,
2643
  'show_tagcloud' => false,
2644
  'hierarchical' => true,
@@ -2969,7 +3048,7 @@ class WCP_Folders
2969
  /* Free/Pro Version change */
2970
  wp_enqueue_script('wcp-folders-jstree', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jstree.min.js', array('jquery'), WCP_FOLDER_VERSION);
2971
  wp_enqueue_script('wcp-folders-mcustomscrollbar', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.mcustomscrollbar.min.js', array(), WCP_FOLDER_VERSION);
2972
- wp_enqueue_script('wcp-folders-custom', plugin_dir_url(dirname(__FILE__)) . 'assets/js/folders.js', array('jquery', 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'backbone'), WCP_FOLDER_VERSION);
2973
  wp_enqueue_script('wcp-jquery-touch', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.ui.touch-punch.min.js', array('jquery'), WCP_FOLDER_VERSION);
2974
 
2975
  $post_type = self::get_custom_post_type($typenow);
@@ -3029,6 +3108,12 @@ class WCP_Folders
3029
  $show_in_page = "hide";
3030
  }
3031
  $taxonomies = self::get_terms_hierarchical($post_type);
 
 
 
 
 
 
3032
 
3033
  $folder_settings = array();
3034
  foreach($taxonomies as $taxonomy) {
@@ -3073,7 +3158,9 @@ class WCP_Folders
3073
  'folder_settings' => $folder_settings,
3074
  'hasStars' => $hasStars,
3075
  'hasChildren' => $hasChild,
3076
- 'currentPage' => $currentPage
 
 
3077
  ));
3078
  } else {
3079
  self::is_add_update_screen();
@@ -3108,11 +3195,11 @@ class WCP_Folders
3108
 
3109
  public function plugin_action_links($links)
3110
  {
3111
- array_unshift($links, '<a href="' . admin_url("admin.php?page=wcp_folders_settings") . '" >' . esc_html__('Settings', WCP_FOLDER) . '</a>');
3112
- $links['need_help'] = '<a target="_blank" href="https://premio.io/help/folders/?utm_source=pluginspage" >'.__( 'Need help?', WCP_FOLDER).'</a>';
3113
 
3114
  /* PRO link for only for FREE*/
3115
- $links['pro'] = '<a class="wcp-folder-upgrade-button" href="'.$this->getFoldersUpgradeURL().'" >'.__( 'Upgrade', WCP_FOLDER).'</a>';
3116
  return $links;
3117
  }
3118
 
@@ -3126,7 +3213,7 @@ class WCP_Folders
3126
  }
3127
 
3128
  public function check_and_set_post_type() {
3129
- $options = get_option(WCP_FOLDER_VAR);
3130
  $old_plugin_status = 0;
3131
  $post_array = array();
3132
  if (!empty($options) && is_array($options)) {
@@ -3147,11 +3234,11 @@ class WCP_Folders
3147
  if (empty($old_plugin_var) || $old_plugin_var == null) {
3148
  update_option("folder_old_plugin_status", "1");
3149
  }
3150
- update_option(WCP_FOLDER_VAR, $post_array);
3151
  self::set_default_values_if_not_exists();
3152
  }
3153
- if (!empty($post_array) && get_option(WCP_FOLDER_VAR) === false) {
3154
- update_option(WCP_FOLDER_VAR, $post_array);
3155
  update_option("folders_show_in_menu", "off");
3156
  }
3157
  }
@@ -3251,7 +3338,7 @@ class WCP_Folders
3251
  $options = get_option("folders_settings");
3252
  if (is_array($options) && in_array($type, $options)) {
3253
  $columns = array(
3254
- 'wcp_move' => '<div class="wcp-move-multiple wcp-col" title="' . esc_attr__('Move selected items', WCP_FOLDER) . '"><span class="dashicons dashicons-move"></span><div class="wcp-items"></div></div>',
3255
  ) + $defaults;
3256
  return $columns;
3257
  }
@@ -3309,8 +3396,8 @@ class WCP_Folders
3309
  $customize_folders = get_option("customize_folders");
3310
  if (isset($customize_folders['show_folder_in_settings']) && $customize_folders['show_folder_in_settings'] == "yes") {
3311
  add_options_page(
3312
- esc_html__('Folders Settings', WCP_FOLDER),
3313
- esc_html__('Folders Settings', WCP_FOLDER),
3314
  'manage_options',
3315
  'wcp_folders_settings',
3316
  array($this, 'wcp_folders_settings')
@@ -3319,8 +3406,8 @@ class WCP_Folders
3319
  $menu_slug = 'wcp_folders_settings';
3320
 
3321
  // Add menu item for settings page
3322
- $page_title = esc_attr__('Folders', WCP_FOLDER);
3323
- $menu_title = esc_attr__('Folders Settings', WCP_FOLDER);
3324
  $capability = 'manage_options';
3325
  $callback = array($this, "wcp_folders_settings");
3326
  $icon_url = 'dashicons-category';
@@ -3341,8 +3428,8 @@ class WCP_Folders
3341
  if($recommended_plugin === false) {
3342
  add_submenu_page(
3343
  $menu_slug,
3344
- esc_html__('Recommended Plugins', WCP_FOLDER),
3345
- esc_html__('Recommended Plugins', WCP_FOLDER),
3346
  'manage_options',
3347
  'recommended-folder-plugins',
3348
  array($this, 'recommended_plugins')
@@ -3352,8 +3439,8 @@ class WCP_Folders
3352
  /* Do not Change Free/Pro Change for menu */
3353
  add_submenu_page(
3354
  $menu_slug,
3355
- esc_attr__('Upgrade to Pro', WCP_FOLDER),
3356
- esc_attr__('Upgrade to Pro', WCP_FOLDER),
3357
  'manage_options',
3358
  'folders-upgrade-to-pro',
3359
  array($this, 'wcp_folders_upgrade_or_register')
@@ -4345,7 +4432,7 @@ class WCP_Folders
4345
 
4346
  public function set_default_values_if_not_exists()
4347
  {
4348
- $options = get_option(WCP_FOLDER_VAR);
4349
  $options = empty($options) || !is_array($options) ? array() : $options;
4350
  foreach ($options as $option) {
4351
  $post_type = self::get_custom_post_type($option);
79
  add_action('wp_ajax_wcp_remove_all_folders_data', array($this, 'remove_all_folders_data'));
80
  /* Update folders Status */
81
  add_action('wp_ajax_wcp_update_folders_uninstall_status', array($this, 'update_folders_uninstall_status'));
82
+ /* Undo Functionality */
83
+ add_action('wp_ajax_wcp_undo_folder_changes', array($this, 'wcp_undo_folder_changes'));
84
  self::$folders = 10;
85
 
86
  /* Send message on plugin deactivate */
186
  $errorCounter = 0;
187
 
188
  if (!isset($postData['nonce']) || empty($postData['nonce'])) {
189
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
190
  $errorCounter++;
191
  } else {
192
  $nonce = self::sanitize_options($postData['nonce']);
193
  if(!wp_verify_nonce($nonce, 'wcp_folders_uninstall_status')) {
194
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
195
  $errorCounter++;
196
  }
197
  }
216
  $errorCounter = 0;
217
 
218
  if (!isset($postData['nonce']) || empty($postData['nonce'])) {
219
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
220
  $errorCounter++;
221
  } else {
222
  $type = self::sanitize_options($postData['type']);
223
  $nonce = self::sanitize_options($postData['nonce']);
224
  if(!wp_verify_nonce($nonce, 'remove_folders_data')) {
225
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
226
  $errorCounter++;
227
  }
228
  }
291
  $errorCounter = 0;
292
 
293
  if (!isset($postData['order']) || empty($postData['order'])) {
294
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
295
  $errorCounter++;
296
  } else if (!isset($postData['type']) || empty($postData['type'])) {
297
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
298
  $errorCounter++;
299
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
300
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
301
  $errorCounter++;
302
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
303
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
304
  $errorCounter++;
305
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
306
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
307
  $errorCounter++;
308
  } else {
309
  $type = self::sanitize_options($postData['type']);
310
  $nonce = self::sanitize_options($postData['nonce']);
311
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
312
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
313
  $errorCounter++;
314
  }
315
  }
357
  $postData = filter_input_array(INPUT_POST);
358
  $error = 0;
359
  if (!isset($postData['post_id']) || empty($postData['post_id'])) {
360
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
361
  $error = 1;
362
  } else if (!isset($postData['post_type']) || empty($postData['type'])) {
363
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
364
  $error = 1;
365
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
366
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
367
  $error = 1;
368
  } else if ($postData['post_type'] == "page" && !current_user_can("edit_pages")) {
369
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
370
  $error = 1;
371
  } else if ($postData['post_type'] != "page" && !current_user_can("edit_posts")) {
372
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
373
  $error = 1;
374
  }
375
  if($error == 0) {
410
 
411
  $post_table = $wpdb->prefix."posts";
412
  $term_table = $wpdb->prefix."term_relationships";
413
+ $options = get_option('folders_settings');
414
  $option_array = array();
415
  if(!empty($options)) {
416
  foreach ($options as $option) {
651
  }
652
  /* Free/Pro Class name change */
653
  $options = WCP_Tree::get_folder_option_data($post_type);?>
654
+ <p class="attachments-category"><?php esc_html_e("Select a folder (Optional)", 'folders'); ?></p>
655
+ <p class="attachments-category"><?php esc_html_e("First select the folder, and then upload the files", 'folders'); ?><br/></p>
656
  <p>
657
  <?php
658
  $request = $_SERVER['REQUEST_URI'];
659
  $request = strpos($request, "post.php");
660
  ?>
661
  <select name="folder_for_media" class="folder_for_media">
662
+ <option value="-1">- <?php esc_html_e('Unassigned', 'folders'); ?></option>
663
  <?php echo $options ?>
664
  <?php if(($typenow == "attachment" && isset($current_screen->base) && $current_screen->base == "upload") || ($request !== false) || self::is_for_this_post_type('attachment') || self::is_for_this_post_type('media')) {?>
665
+ <option value="add-folder"><?php esc_html_e('+ Create a New Folder', 'folders'); ?></option>
666
  <?php } ?>
667
  </select>
668
  </p>
681
  $errorCounter = 0;
682
 
683
  if (!isset($postData['status']) || empty($postData['status'])) {
684
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
685
  $errorCounter++;
686
  } else if (!isset($postData['type']) || empty($postData['type'])) {
687
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
688
  $errorCounter++;
689
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
690
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
691
  $errorCounter++;
692
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
693
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
694
  $errorCounter++;
695
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
696
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
697
  $errorCounter++;
698
  } else {
699
  $type = self::sanitize_options($postData['type']);
700
  $nonce = self::sanitize_options($postData['nonce']);
701
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
702
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
703
  $errorCounter++;
704
  }
705
  }
724
  $postData = filter_input_array(INPUT_POST);
725
  $errorCounter = 0;
726
  if (!isset($postData['status']) || empty($postData['status'])) {
727
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
728
  $errorCounter++;
729
  } else if (!isset($postData['type']) || empty($postData['type'])) {
730
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
731
  $errorCounter++;
732
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
733
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
734
  $errorCounter++;
735
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
736
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
737
  $errorCounter++;
738
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
739
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
740
  $errorCounter++;
741
  } else {
742
  $type = self::sanitize_options($postData['type']);
743
  $nonce = self::sanitize_options($postData['nonce']);
744
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
745
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
746
  $errorCounter++;
747
  }
748
  }
766
  $postData = filter_input_array(INPUT_POST);
767
  $errorCounter = 0;
768
  if (!isset($postData['post_id']) || empty($postData['post_id'])) {
769
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
770
  $errorCounter++;
771
  } else if (!isset($postData['type']) || empty($postData['type'])) {
772
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
773
  $errorCounter++;
774
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
775
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
776
  $errorCounter++;
777
  } else if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['type'])) {
778
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
779
  $errorCounter++;
780
  } else if(!current_user_can("manage_categories")) {
781
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
782
  $errorCounter++;
783
  }
784
  if ($errorCounter == 0) {
785
+ $folderUndoSettings = array();
786
  $type = self::sanitize_options($postData['type']);
787
  $post_id = self::sanitize_options($postData['post_id']);
788
 
792
 
793
  foreach($post_id as $id) {
794
  if(!empty($id) && is_numeric($id) && $id > 0) {
795
+ $terms = get_the_terms($id, $taxonomy);
796
+ $post_terms = array(
797
+ 'post_id' => $id,
798
+ 'terms' => $terms
799
+ );
800
+ $folderUndoSettings[] = $post_terms;
801
+
802
  wp_delete_object_term_relationships($id, $taxonomy);
803
  }
804
  }
805
+ delete_transient("folder_undo_settings");
806
+ set_transient("folder_undo_settings", $folderUndoSettings, DAY_IN_SECONDS);
807
  $response['status'] = 1;
808
  }
809
  echo json_encode($response);
1059
  return;
1060
  }
1061
 
1062
+ if (($typenow == "attachment" || !is_admin()) && self::is_for_this_post_type('attachment')) {
1063
  /* Free/Pro URL Change */
1064
  global $typenow;
1065
  $is_active = 1;
1127
  $hasChild = empty($hasChild)?0:1;
1128
  $hasStars = empty($hasStars)?0:1;
1129
 
1130
+ $customize_folders = get_option('customize_folders');
1131
+ $use_folder_undo = !isset($customize_folders['use_folder_undo'])?"yes":$customize_folders['use_folder_undo'];
1132
+ $defaultTimeout = !isset($customize_folders['default_timeout'])?5:intval($customize_folders['default_timeout']);
1133
+ if(empty($defaultTimeout) || !is_numeric($defaultTimeout) || $defaultTimeout < 0) {
1134
+ $defaultTimeout = 5;
1135
+ }
1136
+ $defaultTimeout = $defaultTimeout*1000;
1137
+
1138
  wp_enqueue_script('folders-tree', WCP_FOLDER_URL . 'assets/js/jstree.min.js', array(), WCP_FOLDER_VERSION);
1139
  wp_enqueue_script('wcp-folders-mcustomscrollbar', WCP_FOLDER_URL . 'assets/js/jquery.mcustomscrollbar.min.js', array(), WCP_FOLDER_VERSION);
1140
+ wp_enqueue_script('wcp-folders-media', WCP_FOLDER_URL . 'assets/js/page-post-media.min.js', array('jquery', 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'backbone'), WCP_FOLDER_VERSION, true);
1141
  wp_enqueue_script('wcp-jquery-touch', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.ui.touch-punch.min.js', array('jquery'), WCP_FOLDER_VERSION);
1142
+ wp_localize_script('wcp-folders-media', 'folders_media_options', array(
1143
  'terms' => $taxonomies,
1144
  'taxonomy' => get_taxonomy('media_folder'),
1145
  'ajax_url' => admin_url("admin-ajax.php"),
1163
  'svg_file' => WCP_FOLDER_URL . 'assets/images/pin.png',
1164
  'folder_settings' => $folder_settings,
1165
  'hasStars' => $hasStars,
1166
+ 'hasChildren' => $hasChild,
1167
+ 'useFolderUndo' => $use_folder_undo,
1168
+ 'defaultTimeout' => $defaultTimeout,
1169
  ));
1170
  /* Free/Pro URL Change */
1171
  wp_enqueue_style('folders-jstree', WCP_FOLDER_URL . 'assets/css/jstree.min.css', array(), WCP_FOLDER_VERSION);
1385
  return;
1386
  }
1387
 
1388
+ if(!self::is_for_this_post_type('attachment')) {
1389
+ return;
1390
+ }
1391
+
1392
  $current_term = false;
1393
  if ( isset( $_REQUEST['media_folder'] ) ) {
1394
  $current_term = sanitize_text_field($_REQUEST['media_folder']);
1395
  }
1396
 
1397
  wp_dropdown_categories( array(
1398
+ 'show_option_all' => esc_html__( 'All Folders', 'folders'),
1399
+ 'show_option_none' => esc_html__( '(Unassigned)', 'folders'),
1400
  'option_none_value' => -1,
1401
  'orderby' => 'meta_value_num',
1402
  'order' => 'ASC',
1447
  $response['errors'] = array();
1448
  $response['message'] = "";
1449
  $errorArray = [];
1450
+ $errorMessage = esc_html__("%s is required", 'folders');
1451
  $postData = filter_input_array(INPUT_POST);
1452
  if (!isset($postData['textarea_text']) || trim($postData['textarea_text']) == "") {
1453
  $error = array(
1454
  "key" => "textarea_text",
1455
+ "message" => esc_html__("Please enter your message", 'folders')
1456
  );
1457
  $errorArray[] = $error;
1458
  }
1459
  if (!isset($postData['user_email']) || trim($postData['user_email']) == "") {
1460
  $error = array(
1461
  "key" => "user_email",
1462
+ "message" => sprintf($errorMessage, __("Email", 'folders'))
1463
  );
1464
  $errorArray[] = $error;
1465
  } else if (!filter_var($postData['user_email'], FILTER_VALIDATE_EMAIL)) {
1473
  if (!isset($postData['folder_help_nonce']) || trim($postData['folder_help_nonce']) == "") {
1474
  $error = array(
1475
  "key" => "nonce",
1476
+ "message" => esc_html__("Your request is not valid", 'folders')
1477
  );
1478
  $errorArray[] = $error;
1479
  } else {
1480
  if (!wp_verify_nonce($postData['folder_help_nonce'], 'wcp_folder_help_nonce')) {
1481
  $error = array(
1482
  "key" => "nonce",
1483
+ "message" => esc_html__("Your request is not valid", 'folders')
1484
  );
1485
  $errorArray[] = $error;
1486
  }
1545
  $errorCounter++;
1546
  $response['message'] = "Please provide reason";
1547
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1548
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1549
  $errorCounter++;
1550
  $response['valid'] = 0;
1551
  } else {
1552
  $nonce = self::sanitize_options($postData['nonce']);
1553
  if(!wp_verify_nonce($nonce, 'wcp_folder_deactivate_nonce')) {
1554
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1555
  $errorCounter++;
1556
  $response['valid'] = 0;
1557
  }
1615
  }
1616
 
1617
  public static function ttl_fldrs() {
1618
+ $post_types = get_option('folders_settings');
1619
  $post_types = is_array($post_types) ? $post_types : array();
1620
  $total = 0;
1621
  foreach ($post_types as $post_type) {
1651
  $postData = filter_input_array(INPUT_POST);
1652
  $errorCounter = 0;
1653
  if (!isset($postData['type']) || empty($postData['type'])) {
1654
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1655
  $errorCounter++;
1656
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1657
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1658
  $errorCounter++;
1659
  } else if (!current_user_can("manage_categories") || ($postData['type'] == "page" && !current_user_can("edit_pages"))) {
1660
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
1661
  $errorCounter++;
1662
  } else if (!current_user_can("manage_categories") || ($postData['type'] != "page" && !current_user_can("edit_posts"))) {
1663
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
1664
  $errorCounter++;
1665
  } else {
1666
  $type = self::sanitize_options($postData['type']);
1667
  $nonce = self::sanitize_options($postData['nonce']);
1668
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
1669
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1670
  $errorCounter++;
1671
  }
1672
  }
1697
  $postData = filter_input_array(INPUT_POST);
1698
  $errorCounter = 0;
1699
  if (!isset($postData['width']) || empty($postData['width'])) {
1700
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1701
  $errorCounter++;
1702
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1703
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1704
  $errorCounter++;
1705
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1706
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1707
  $errorCounter++;
1708
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
1709
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
1710
  $errorCounter++;
1711
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
1712
+ $response['message'] = esc_html__("You have not permission to update width", 'folders');
1713
  $errorCounter++;
1714
  } else {
1715
  $type = self::sanitize_options($postData['type']);
1716
  $nonce = self::sanitize_options($postData['nonce']);
1717
  if(!wp_verify_nonce($nonce, 'wcp_folder_nonce_'.$type)) {
1718
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1719
  $errorCounter++;
1720
  }
1721
  }
1740
  $postData = filter_input_array(INPUT_POST);
1741
  $errorCounter = 0;
1742
  if (!isset($postData['post_ids']) || empty($postData['post_ids'])) {
1743
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1744
  $errorCounter++;
1745
  } else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
1746
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1747
  $errorCounter++;
1748
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1749
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1750
  $errorCounter++;
1751
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1752
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1753
  $errorCounter++;
1754
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
1755
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
1756
  $errorCounter++;
1757
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
1758
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
1759
  $errorCounter++;
1760
  } else {
1761
  $folder_id = self::sanitize_options($postData['folder_id']);
1762
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$folder_id)) {
1763
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1764
  $errorCounter++;
1765
  }
1766
  }
1767
  if ($errorCounter == 0) {
1768
+ $folderUndoSettings = array();
1769
  $postID = self::sanitize_options($postData['post_ids']);
1770
  $postID = trim($postID, ",");
1771
  $folderID = self::sanitize_options($postData['folder_id']);
1785
  $post_type = self::get_custom_post_type($type);
1786
  foreach ($postArray as $post) {
1787
  $terms = get_the_terms($post, $post_type);
1788
+ $post_terms = array(
1789
+ 'post_id' => $post,
1790
+ 'terms' => $terms
1791
+ );
1792
+ $folderUndoSettings[] = $post_terms;
1793
  if (!empty($terms)) {
1794
  foreach ($terms as $term) {
1795
  if(!empty($taxonomy) && ($term->term_id == $taxonomy || $term->slug == $taxonomy)) {
1801
  }
1802
  }
1803
  $response['status'] = 1;
1804
+ delete_transient("folder_undo_settings");
1805
+ set_transient("folder_undo_settings", $folderUndoSettings, DAY_IN_SECONDS);
1806
  }
1807
  echo json_encode($response);
1808
  wp_die();
1809
  }
1810
 
1811
+ public function wcp_undo_folder_changes() {
1812
+ $response = array();
1813
+ $response['status'] = 0;
1814
+ $response['error'] = 0;
1815
+ $response['data'] = array();
1816
+ $response['message'] = "";
1817
+ $postData = filter_input_array(INPUT_POST);
1818
+ $errorCounter = 0;
1819
+ if (!isset($postData['post_type']) || empty($postData['post_type'])) {
1820
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1821
+ $errorCounter++;
1822
+ } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1823
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1824
+ $errorCounter++;
1825
+ } else {
1826
+ if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$postData['post_type'])) {
1827
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1828
+ $errorCounter++;
1829
+ }
1830
+ }
1831
+ if ($errorCounter == 0) {
1832
+ $response['status'] = 1;
1833
+ $folder_undo_settings = get_transient("folder_undo_settings");
1834
+ $type = self::sanitize_options($postData['post_type']);
1835
+ $post_type = self::get_custom_post_type($type);
1836
+ if(!empty($folder_undo_settings) && is_array($folder_undo_settings)) {
1837
+ foreach($folder_undo_settings as $item) {
1838
+ $terms = get_the_terms($item['post_id'], $post_type);
1839
+ if (!empty($terms)) {
1840
+ foreach ($terms as $term) {
1841
+ wp_remove_object_terms($item['post_id'], $term->term_id, $post_type);
1842
+ }
1843
+ }
1844
+ if(!empty($item['terms']) && is_array($item['terms'])) {
1845
+ foreach($item['terms'] as $term) {
1846
+ wp_set_post_terms($item['post_id'], $term->term_id, $post_type, true);
1847
+ }
1848
+ }
1849
+ }
1850
+ }
1851
+ }
1852
+ echo json_encode($response);
1853
+ die;
1854
+ }
1855
+
1856
  public function wcp_change_post_folder()
1857
  {
1858
  $response = array();
1864
  $errorCounter = 0;
1865
  if (!isset($postData['post_id']) || empty($postData['post_id'])) {
1866
  $errorCounter++;
1867
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1868
  } else if (!isset($postData['folder_id']) || empty($postData['folder_id'])) {
1869
  $errorCounter++;
1870
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1871
  } else if (!isset($postData['type']) || empty($postData['type'])) {
1872
  $errorCounter++;
1873
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1874
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1875
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1876
  $errorCounter++;
1877
  } else if ($postData['type'] == "page" && !current_user_can("edit_pages")) {
1878
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
1879
  $errorCounter++;
1880
  } else if ($postData['type'] != "page" && !current_user_can("edit_posts")) {
1881
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
1882
  $errorCounter++;
1883
  } else {
1884
  $term_id = self::sanitize_options($postData['folder_id']);
1885
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
1886
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1887
  $errorCounter++;
1888
  }
1889
  }
1926
  $postData = filter_input_array(INPUT_POST);
1927
  $errorCounter = 0;
1928
  if (!current_user_can("manage_categories")) {
1929
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
1930
  $errorCounter++;
1931
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
1932
  $errorCounter++;
1933
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1934
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1935
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1936
  $errorCounter++;
1937
  } else {
1938
  $term_id = self::sanitize_options($postData['term_id']);
1939
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
1940
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1941
  $errorCounter++;
1942
  }
1943
  }
1969
  $postData = filter_input_array(INPUT_POST);
1970
  $errorCounter = 0;
1971
  if (!current_user_can("manage_categories")) {
1972
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
1973
  $errorCounter++;
1974
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
1975
  $errorCounter++;
1976
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1977
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
1978
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1979
  $errorCounter++;
1980
  } else {
1981
  $term_id = self::sanitize_options($postData['term_id']);
1982
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
1983
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
1984
  $errorCounter++;
1985
  }
1986
  }
2012
  $postData = filter_input_array(INPUT_POST);
2013
  $errorCounter = 0;
2014
  if (!current_user_can("manage_categories")) {
2015
+ $response['message'] = esc_html__("You have not permission to update folder order", 'folders');
2016
  $errorCounter++;
2017
  } else if (!isset($postData['term_ids']) || empty($postData['term_ids'])) {
2018
  $errorCounter++;
2019
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2020
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2021
  $errorCounter++;
2022
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2023
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2024
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2025
  $errorCounter++;
2026
  } else {
2027
  $type = self::sanitize_options($postData['type']);
2028
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
2029
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2030
  $errorCounter++;
2031
  }
2032
  }
2072
  $postData = filter_input_array(INPUT_POST);
2073
  $errorCounter = 0;
2074
  if (!current_user_can("manage_categories")) {
2075
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
2076
  $errorCounter++;
2077
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2078
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2079
  $errorCounter++;
2080
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2081
+ $response['message'] = esc_html__("Unable to create folder, Your request is not valid", 'folders');
2082
  $errorCounter++;
2083
  } else {
2084
  $term_id = self::sanitize_options($postData['term_id']);
2085
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2086
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2087
  $errorCounter++;
2088
  }
2089
  }
2112
  $postData = filter_input_array(INPUT_POST);
2113
  $errorCounter = 0;
2114
  if (!current_user_can("manage_categories")) {
2115
+ $response['message'] = esc_html__("You have not permission to update folder", 'folders');
2116
  $errorCounter++;
2117
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2118
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2119
  $errorCounter++;
2120
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2121
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2122
  $errorCounter++;
2123
  } else if (!isset($postData['parent_id'])) {
2124
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2125
  $errorCounter++;
2126
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2127
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2128
  $errorCounter++;
2129
  } else {
2130
  $term_id = self::sanitize_options($postData['term_id']);
2131
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2132
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2133
  $errorCounter++;
2134
  }
2135
  }
2158
  $postData = filter_input_array(INPUT_POST);
2159
  $errorCounter = 0;
2160
  if (!isset($postData['type']) || empty($postData['type'])) {
2161
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2162
  $errorCounter++;
2163
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2164
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2165
  $errorCounter++;
2166
  } else if (!current_user_can("manage_categories")) {
2167
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2168
  $errorCounter++;
2169
  } else {
2170
  $type = self::sanitize_options($postData['type']);
2171
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
2172
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2173
  $errorCounter++;
2174
  }
2175
  }
2199
  $errorCounter = 0;
2200
  $error = "";
2201
  if (!current_user_can("manage_categories")) {
2202
+ $error = esc_html__("You have not permission to remove folder", 'folders');
2203
  $errorCounter++;
2204
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2205
+ $error = esc_html__("Your request is not valid", 'folders');
2206
  $errorCounter++;
2207
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2208
+ $error = esc_html__("Your request is not valid", 'folders');
2209
  $errorCounter++;
2210
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2211
+ $response['message'] = esc_html__("Your request is not valid", 'folders');
2212
  $errorCounter++;
2213
  } else {
2214
  $type = self::sanitize_options($postData['type']);
2215
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
2216
+ $error = esc_html__("Your request is not valid", 'folders');
2217
  $errorCounter++;
2218
  }
2219
  }
2254
  $postData = filter_input_array(INPUT_POST);
2255
  $errorCounter = 0;
2256
  if (!current_user_can("manage_categories")) {
2257
+ $error = esc_html__("You have not permission to remove folder", 'folders');
2258
  $errorCounter++;
2259
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2260
+ $error = esc_html__("Your request is not valid", 'folders');
2261
  $errorCounter++;
2262
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2263
+ $error = esc_html__("Your request is not valid", 'folders');
2264
  $errorCounter++;
2265
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2266
+ $error = esc_html__("Unable to delete folder, Your request is not valid", 'folders');
2267
  $errorCounter++;
2268
  } else {
2269
  $term_id = self::sanitize_options($postData['term_id']);
2270
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2271
+ $error = esc_html__("Unable to delete folder, Your request is not valid", 'folders');
2272
  $errorCounter++;
2273
  }
2274
  }
2318
  $postData = $_REQUEST;
2319
  $errorCounter = 0;
2320
  if (!current_user_can("manage_categories")) {
2321
+ $error = esc_html__("You have not permission to update folder", 'folders');
2322
  $errorCounter++;
2323
  } else if (!isset($postData['term_id']) || empty($postData['term_id'])) {
2324
+ $error = esc_html__("Unable to rename folder, Your request is not valid", 'folders');
2325
  $errorCounter++;
2326
  } else if (!isset($postData['name']) || empty($postData['name'])) {
2327
+ $error = esc_html__("Folder name can no be empty", 'folders');
2328
  $errorCounter++;
2329
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2330
+ $error = esc_html__("Your request is not valid", 'folders');
2331
  $errorCounter++;
2332
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2333
+ $error = esc_html__("Unable to rename folder, Your request is not valid", 'folders');
2334
  $errorCounter++;
2335
  } else {
2336
  $term_id = self::sanitize_options($postData['term_id']);
2337
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_term_'.$term_id)) {
2338
+ $error = esc_html__("Unable to rename folder, Your request is not valid", 'folders');
2339
  $errorCounter++;
2340
  }
2341
  }
2359
  $response['term_title'] = $postData['name'];
2360
  $response['nonce'] = $term_nonce;
2361
  } else {
2362
+ $response['message'] = esc_html__("Unable to rename folder", 'folders');
2363
  }
2364
  } else {
2365
  $response['error'] = 1;
2399
  $response['message2'] = "";
2400
  $postData = $_REQUEST;
2401
  $errorCounter = 0;
2402
+ $error= "";
2403
  if (!current_user_can("manage_categories")) {
2404
+ $error = esc_html__("You have not permission to add folder", 'folders');
2405
  $errorCounter++;
2406
  } else if (!isset($postData['name']) || empty($postData['name'])) {
2407
+ $error = esc_html__("Folder name can no be empty", 'folders');
2408
  $errorCounter++;
2409
  } else if (!isset($postData['type']) || empty($postData['type'])) {
2410
+ $error = esc_html__("Your request is not valid", 'folders');
2411
  $errorCounter++;
2412
  } else if (!isset($postData['nonce']) || empty($postData['nonce'])) {
2413
  $response['login'] = 0;
2414
+ $error = esc_html__("Unable to create folder, Your request is not valid", 'folders');
2415
  $errorCounter++;
2416
  } else {
2417
  $type = self::sanitize_options($postData['type']);
2418
  if(!wp_verify_nonce($postData['nonce'], 'wcp_folder_nonce_'.$type)) {
2419
  $response['login'] = 0;
2420
+ $error = esc_html__("Unable to create folder, Your request is not valid", 'folders');
2421
  $errorCounter++;
2422
  }
2423
  }
2534
  }
2535
  } else {
2536
  $response['error'] = 1;
2537
+ $response['message'] = esc_html__("Folder name already exists", 'folders');
2538
  }
2539
  } else {
2540
  $response['error'] = 1;
2546
 
2547
  public function is_for_this_post_type($post_type)
2548
  {
2549
+ $post_types = get_option('folders_settings');
2550
  $post_types = is_array($post_types)?$post_types:array();
2551
  return in_array($post_type, $post_types);
2552
  }
2563
  return true;
2564
  }
2565
 
2566
+ $post_types = get_option('folders_settings');
2567
  $post_types = is_array($post_types)?$post_types:array();
2568
 
2569
  if(empty($typenow) && 'upload' == $current_screen->base ) {
2580
  global $current_screen;
2581
  $current_type = $current_screen->base;
2582
  $action = $current_screen->action;
2583
+ $post_types = get_option('folders_settings');
2584
  $post_types = is_array($post_types)?$post_types:array();
2585
  global $typenow;
2586
  if (in_array($current_type, $post_types) && in_array($action, array("add", ""))) {
2674
 
2675
  public function create_folder_terms()
2676
  {
2677
+ $options = get_option('folders_settings');
2678
  $options = is_array($options)?$options:array();
2679
  $old_plugin_status = 0;
2680
  $posts = array();
2690
  }
2691
  }
2692
  if(!empty($posts)) {
2693
+ update_option('folders_settings', $posts);
2694
  }
2695
  }
2696
  if ($old_plugin_status == 1) {
2700
  update_option("folder_old_plugin_status", "1");
2701
  }
2702
  }
2703
+ $posts = get_option('folders_settings');
2704
  if (!empty($posts)) {
2705
  foreach ($posts as $post_type) {
2706
  $labels = array(
2707
+ 'name' => esc_html__('Folders', 'folders'),
2708
+ 'singular_name' => esc_html__('Folder', 'folders'),
2709
+ 'all_items' => esc_html__('All Folders', 'folders'),
2710
+ 'edit_item' => esc_html__('Edit Folder', 'folders'),
2711
+ 'update_item' => esc_html__('Update Folder', 'folders'),
2712
+ 'add_new_item' => esc_html__('Add New Folder', 'folders'),
2713
+ 'new_item_name' => esc_html__('Add folder name', 'folders'),
2714
+ 'menu_name' => esc_html__('Folders', 'folders'),
2715
+ 'search_items' => esc_html__('Search Folders', 'folders'),
2716
+ 'parent_item' => esc_html__('Parent Folder', 'folders'),
2717
  );
2718
 
2719
  $args = array(
2720
+ 'label' => esc_html__('Folder', 'folders'),
2721
  'labels' => $labels,
2722
  'show_tagcloud' => false,
2723
  'hierarchical' => true,
3048
  /* Free/Pro Version change */
3049
  wp_enqueue_script('wcp-folders-jstree', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jstree.min.js', array('jquery'), WCP_FOLDER_VERSION);
3050
  wp_enqueue_script('wcp-folders-mcustomscrollbar', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.mcustomscrollbar.min.js', array(), WCP_FOLDER_VERSION);
3051
+ wp_enqueue_script('wcp-folders-custom', plugin_dir_url(dirname(__FILE__)) . 'assets/js/folders.min.js', array('jquery', 'jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-sortable', 'backbone'), WCP_FOLDER_VERSION);
3052
  wp_enqueue_script('wcp-jquery-touch', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.ui.touch-punch.min.js', array('jquery'), WCP_FOLDER_VERSION);
3053
 
3054
  $post_type = self::get_custom_post_type($typenow);
3108
  $show_in_page = "hide";
3109
  }
3110
  $taxonomies = self::get_terms_hierarchical($post_type);
3111
+ $use_folder_undo = !isset($customize_folders['use_folder_undo'])?"yes":$customize_folders['use_folder_undo'];
3112
+ $defaultTimeout = !isset($customize_folders['default_timeout'])?5:intval($customize_folders['default_timeout']);
3113
+ if(empty($defaultTimeout) || !is_numeric($defaultTimeout) || $defaultTimeout < 0) {
3114
+ $defaultTimeout = 5;
3115
+ }
3116
+ $defaultTimeout = $defaultTimeout*1000;
3117
 
3118
  $folder_settings = array();
3119
  foreach($taxonomies as $taxonomy) {
3158
  'folder_settings' => $folder_settings,
3159
  'hasStars' => $hasStars,
3160
  'hasChildren' => $hasChild,
3161
+ 'currentPage' => $currentPage,
3162
+ 'useFolderUndo' => $use_folder_undo,
3163
+ 'defaultTimeout' => $defaultTimeout,
3164
  ));
3165
  } else {
3166
  self::is_add_update_screen();
3195
 
3196
  public function plugin_action_links($links)
3197
  {
3198
+ array_unshift($links, '<a href="' . admin_url("admin.php?page=wcp_folders_settings") . '" >' . esc_html__('Settings', 'folders') . '</a>');
3199
+ $links['need_help'] = '<a target="_blank" href="https://premio.io/help/folders/?utm_source=pluginspage" >'.__( 'Need help?', 'folders').'</a>';
3200
 
3201
  /* PRO link for only for FREE*/
3202
+ $links['pro'] = '<a class="wcp-folder-upgrade-button" href="'.$this->getFoldersUpgradeURL().'" >'.__( 'Upgrade', 'folders').'</a>';
3203
  return $links;
3204
  }
3205
 
3213
  }
3214
 
3215
  public function check_and_set_post_type() {
3216
+ $options = get_option('folders_settings');
3217
  $old_plugin_status = 0;
3218
  $post_array = array();
3219
  if (!empty($options) && is_array($options)) {
3234
  if (empty($old_plugin_var) || $old_plugin_var == null) {
3235
  update_option("folder_old_plugin_status", "1");
3236
  }
3237
+ update_option('folders_settings', $post_array);
3238
  self::set_default_values_if_not_exists();
3239
  }
3240
+ if (!empty($post_array) && get_option('folders_settings') === false) {
3241
+ update_option('folders_settings', $post_array);
3242
  update_option("folders_show_in_menu", "off");
3243
  }
3244
  }
3338
  $options = get_option("folders_settings");
3339
  if (is_array($options) && in_array($type, $options)) {
3340
  $columns = array(
3341
+ 'wcp_move' => '<div class="wcp-move-multiple wcp-col" title="' . esc_html__('Move selected items', 'folders') . '"><span class="dashicons dashicons-move"></span><div class="wcp-items"></div></div>',
3342
  ) + $defaults;
3343
  return $columns;
3344
  }
3396
  $customize_folders = get_option("customize_folders");
3397
  if (isset($customize_folders['show_folder_in_settings']) && $customize_folders['show_folder_in_settings'] == "yes") {
3398
  add_options_page(
3399
+ esc_html__('Folders Settings', 'folders'),
3400
+ esc_html__('Folders Settings', 'folders'),
3401
  'manage_options',
3402
  'wcp_folders_settings',
3403
  array($this, 'wcp_folders_settings')
3406
  $menu_slug = 'wcp_folders_settings';
3407
 
3408
  // Add menu item for settings page
3409
+ $page_title = esc_html__('Folders', 'folders');
3410
+ $menu_title = esc_html__('Folders Settings', 'folders');
3411
  $capability = 'manage_options';
3412
  $callback = array($this, "wcp_folders_settings");
3413
  $icon_url = 'dashicons-category';
3428
  if($recommended_plugin === false) {
3429
  add_submenu_page(
3430
  $menu_slug,
3431
+ esc_html__('Recommended Plugins', 'folders'),
3432
+ esc_html__('Recommended Plugins', 'folders'),
3433
  'manage_options',
3434
  'recommended-folder-plugins',
3435
  array($this, 'recommended_plugins')
3439
  /* Do not Change Free/Pro Change for menu */
3440
  add_submenu_page(
3441
  $menu_slug,
3442
+ esc_html__('Upgrade to Pro', 'folders'),
3443
+ esc_html__('Upgrade to Pro', 'folders'),
3444
  'manage_options',
3445
  'folders-upgrade-to-pro',
3446
  array($this, 'wcp_folders_upgrade_or_register')
4432
 
4433
  public function set_default_values_if_not_exists()
4434
  {
4435
+ $options = get_option('folders_settings');
4436
  $options = empty($options) || !is_array($options) ? array() : $options;
4437
  foreach ($options as $option) {
4438
  $post_type = self::get_custom_post_type($option);
includes/form.class.php CHANGED
@@ -26,7 +26,7 @@ class WCP_Forms {
26
  <div class="wcp-custom-form">
27
  <div class="form-title">
28
  <div class="plugin-title">
29
- <?php esc_html_e("Folders", WCP_FOLDER ) ?>
30
  <span class="folder-loader-ajax">
31
  <svg id="successAnimation" fill="#F51366" class="animated" xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 70 70">
32
  <path id="successAnimationResult" fill="#D8D8D8" d="M35,60 C21.1928813,60 10,48.8071187 10,35 C10,21.1928813 21.1928813,10 35,10 C48.8071187,10 60,21.1928813 60,35 C60,48.8071187 48.8071187,60 35,60 Z M23.6332378,33.2260427 L22.3667622,34.7739573 L34.1433655,44.40936 L47.776114,27.6305926 L46.223886,26.3694074 L33.8566345,41.59064 L23.6332378,33.2260427 Z"></path>
@@ -37,7 +37,7 @@ class WCP_Forms {
37
  </div>
38
  <div class="plugin-button">
39
  <a href="javascript:;" class="add-new-folder" id="add-new-folder">
40
- <span class="create_new_folder"><i class="pfolder-add-folder"></i></span> <span><?php esc_html_e("New Folder", WCP_FOLDER ) ?></span>
41
  </a>
42
  </div>
43
  <div class="clear"></div>
@@ -48,10 +48,10 @@ class WCP_Forms {
48
  <input type="checkbox" id="folder-hide-show-checkbox">
49
  </li>
50
  <li>
51
- <a href="javascript:;" id="inline-update"><span class="icon pfolder-edit"></span> <span class="text"><?php esc_html_e("Rename", WCP_FOLDER ) ?></span> </a>
52
  </li>
53
  <li>
54
- <a href="javascript:;" id="inline-remove"><span class="icon pfolder-remove"></span> <span class="text"><?php esc_html_e("Delete", WCP_FOLDER ) ?></span> </a>
55
  </li>
56
  <li>
57
  <div class="form-options">
@@ -63,14 +63,14 @@ class WCP_Forms {
63
  </a>
64
  <div class="folder-sort-menu <?php echo ($is_old)?"":"is-pro" ?>">
65
  <ul>
66
- <li><a data-sort="a-z" href="#"><?php esc_html_e("A → Z", WCP_FOLDER ) ?></a></li>
67
- <li><a data-sort="z-a" href="#"><?php esc_html_e("Z → A", WCP_FOLDER ) ?></a></li>
68
  <?php if($is_old) { ?>
69
- <li><a data-sort="n-o" href="#"><?php esc_html_e("Sort by newest", WCP_FOLDER ) ?></a></li>
70
- <li><a data-sort="o-n" href="#"><?php esc_html_e("Sort by oldest", WCP_FOLDER ) ?></a></li>
71
  <?php } else { ?>
72
- <li><a data-sort="n-o" target="_blank" class="pro-feature" href="<?php echo esc_url($upgradeURL) ?>"><?php esc_html_e("Sort by newest", WCP_FOLDER ) ?> <span><?php esc_html_e("(Pro)", WCP_FOLDER ) ?></span></a></li>
73
- <li><a data-sort="o-n" target="_blank" class="pro-feature" href="<?php echo esc_url($upgradeURL) ?>"><?php esc_html_e("Sort by oldest", WCP_FOLDER ) ?> <span><?php esc_html_e("(Pro)", WCP_FOLDER ) ?></span></a></li>
74
  <?php } ?>
75
  </ul>
76
  </div>
@@ -80,7 +80,7 @@ class WCP_Forms {
80
  </li>
81
  </ul>
82
  <div class="upgrade-message">
83
- <span class="upgrade-message"><a class="pink" href="<?php echo esc_url($upgradeURL) ?>"><?php esc_html_e("Unlock all Pro features", WCP_FOLDER) ?> <span class="dashicons dashicons-arrow-right-alt"></span></a></span>
84
  </div>
85
  </div>
86
  <div class="form-loader">
26
  <div class="wcp-custom-form">
27
  <div class="form-title">
28
  <div class="plugin-title">
29
+ <?php esc_html_e("Folders", 'folders'); ?>
30
  <span class="folder-loader-ajax">
31
  <svg id="successAnimation" fill="#F51366" class="animated" xmlns="http://www.w3.org/2000/svg" width="70" height="70" viewBox="0 0 70 70">
32
  <path id="successAnimationResult" fill="#D8D8D8" d="M35,60 C21.1928813,60 10,48.8071187 10,35 C10,21.1928813 21.1928813,10 35,10 C48.8071187,10 60,21.1928813 60,35 C60,48.8071187 48.8071187,60 35,60 Z M23.6332378,33.2260427 L22.3667622,34.7739573 L34.1433655,44.40936 L47.776114,27.6305926 L46.223886,26.3694074 L33.8566345,41.59064 L23.6332378,33.2260427 Z"></path>
37
  </div>
38
  <div class="plugin-button">
39
  <a href="javascript:;" class="add-new-folder" id="add-new-folder">
40
+ <span class="create_new_folder"><i class="pfolder-add-folder"></i></span> <span><?php esc_html_e("New Folder", 'folders'); ?></span>
41
  </a>
42
  </div>
43
  <div class="clear"></div>
48
  <input type="checkbox" id="folder-hide-show-checkbox">
49
  </li>
50
  <li>
51
+ <a href="javascript:;" id="inline-update"><span class="icon pfolder-edit"></span> <span class="text"><?php esc_html_e("Rename", 'folders'); ?></span> </a>
52
  </li>
53
  <li>
54
+ <a href="javascript:;" id="inline-remove"><span class="icon pfolder-remove"></span> <span class="text"><?php esc_html_e("Delete", 'folders'); ?></span> </a>
55
  </li>
56
  <li>
57
  <div class="form-options">
63
  </a>
64
  <div class="folder-sort-menu <?php echo ($is_old)?"":"is-pro" ?>">
65
  <ul>
66
+ <li><a data-sort="a-z" href="#"><?php esc_html_e("A → Z", 'folders'); ?></a></li>
67
+ <li><a data-sort="z-a" href="#"><?php esc_html_e("Z → A", 'folders'); ?></a></li>
68
  <?php if($is_old) { ?>
69
+ <li><a data-sort="n-o" href="#"><?php esc_html_e("Sort by newest", 'folders'); ?></a></li>
70
+ <li><a data-sort="o-n" href="#"><?php esc_html_e("Sort by oldest", 'folders'); ?></a></li>
71
  <?php } else { ?>
72
+ <li><a data-sort="n-o" target="_blank" class="pro-feature" href="<?php echo esc_url($upgradeURL) ?>"><?php esc_html_e("Sort by newest", 'folders'); ?> <span><?php esc_html_e("(Pro)", 'folders'); ?></span></a></li>
73
+ <li><a data-sort="o-n" target="_blank" class="pro-feature" href="<?php echo esc_url($upgradeURL) ?>"><?php esc_html_e("Sort by oldest", 'folders'); ?> <span><?php esc_html_e("(Pro)", 'folders'); ?></span></a></li>
74
  <?php } ?>
75
  </ul>
76
  </div>
80
  </li>
81
  </ul>
82
  <div class="upgrade-message">
83
+ <span class="upgrade-message"><a class="pink" href="<?php echo esc_url($upgradeURL) ?>"><?php esc_html_e("Unlock all Pro features", 'folders'); ?> <span class="dashicons dashicons-arrow-right-alt"></span></a></span>
84
  </div>
85
  </div>
86
  <div class="form-loader">
includes/media.replace.php CHANGED
@@ -41,8 +41,85 @@ class folders_replace_media {
41
  } else {
42
  $this->upgradeLink = admin_url("admin.php?page=folders-upgrade-to-pro");
43
  }
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  public function folders_admin_css_and_js($page) {
47
  if($page == "media_page_folders-replace-media" || $page == "admin_page_folders-replace-media") {
48
  wp_enqueue_style('folders-media', plugin_dir_url(dirname(__FILE__)) . 'assets/css/replace-media.css', array(), WCP_FOLDER_VERSION);
41
  } else {
42
  $this->upgradeLink = admin_url("admin.php?page=folders-upgrade-to-pro");
43
  }
44
+
45
+ /* to replace file name */
46
+ add_action('add_meta_boxes', function () {
47
+ add_meta_box('folders-replace-file-name', esc_html__('Change file name', 'folders'), array($this, 'change_file_name_box'), 'attachment', 'side', 'core');
48
+ });
49
+
50
+ add_filter('attachment_fields_to_edit', array($this, 'attachment_replace_name_with_title'), 10, 2);
51
+
52
+ add_action('admin_head', array($this, 'premio_replace_file_CSS'));
53
+
54
+ add_action('wp_enqueue_media', array($this, 'replace_media_file_script'));
55
  }
56
 
57
+ public function change_file_name_box($post) { ?>
58
+ <p class="upgrade-bottom">
59
+ <label for="change_file_name"><input disabled type="checkbox" id="change_file_name" name="premio_change_file_name" value="yes"> <?php esc_html_e("Change file name according to title", "folders") ?></label>
60
+ </p>
61
+ <div class="upgrade-box">
62
+ <a href="<?php echo esc_url($this->upgradeLink) ?>" target="_blank"><?php esc_html_e("Upgrade to Pro", "folders"); ?></a>
63
+ </div>
64
+ <?php
65
+ }
66
+
67
+ public function replace_media_file_script() {
68
+ wp_enqueue_script('folders-replace-media', WCP_FOLDER_URL . 'assets/js/replace-file-name.js', array('jquery'), WCP_FOLDER_VERSION, true);
69
+ wp_localize_script('folders-replace-media', 'replace_media_options', array(
70
+ 'ajax_url' => admin_url("admin-ajax.php"),
71
+ ));
72
+ }
73
+
74
+ public function premio_replace_file_CSS() {
75
+ echo '<style>
76
+ .compat-field-replace_file_name th.label {display: none;}
77
+ .compat-field-replace_file_name td.field {width: 100%; border-top: solid 1px #c0c0c0; padding:10px 0 0 0;margin: 0;float: none;}
78
+ .compat-field-replace_file_name td.field label {width: 100%; display: block;padding:0 0 10px 0;}
79
+ .compat-field-replace_file_name td.field label input[type="checkbox"] {margin: 0 4px 0 2px;}
80
+ .compat-field-replace_file_name td.field a.update-name-with-title {display: none;}
81
+ .compat-field-replace_file_name td.field a.update-name-with-title.show {display: inline-block;}
82
+
83
+ .compat-field-folders th.label {width: 100%; text-align: left; padding: 0 0 10px 0; margin: 0; border-top: solid 1px #c0c0c0;float: none;}
84
+ .compat-field-folders th.label .alignleft {float: none; text-align: left; font-weight: bold;}
85
+ .compat-field-folders th.label br {display: none;}
86
+ .compat-field-folders td.field {width: 100%; padding: 0; margin: 0;float: none;}
87
+ .folders-undo-notification{position:fixed;right:-500px;bottom:25px;width:280px;background:#fff;padding:15px;-webkit-box-shadow:0 3px 6px -4px rgb(0 0 0 / 12%),0 6px 16px 0 rgb(0 0 0 / 8%),0 9px 28px 8px rgb(0 0 0 / 5%);box-shadow:0 3px 6px -4px rgb(0 0 0 / 12%),0 6px 16px 0 rgb(0 0 0 / 8%),0 9px 28px 8px rgb(0 0 0 / 5%);transition:all .25s linear;z-index:250010}.folders-undo-notification.active{right:25px}.folders-undo-header{font-weight:500;font-size:14px;padding:0 0 3px 0}.folders-undo-body{font-size:13px;padding:0 0 5px 0}.folders-undo-footer{text-align:right;padding:5px 0 0 0}.folders-undo-footer .undo-button{background:#1da1f4;border:none;color:#fff;padding:3px 10px;font-size:12px;border-radius:2px;cursor:pointer}.folders-undo-body{position:relative}.close-undo-box{position:absolute;right:-10px;top:0;width:16px;height:16px;transition:all .25s linear}.close-undo-box:hover{transform:rotate(180deg)}.close-undo-box span{display:block;position:relative;width:16px;height:16px;transition:all .2s linear}.close-undo-box span:after,.close-undo-box span:before{content:"";position:absolute;width:12px;height:2px;background-color:#333;display:block;border-radius:2px;transform:rotate(45deg);top:7px;left:2px}.close-undo-box span:after{transform:rotate(-45deg)}
88
+ .folders-undo-notification.no .folders-undo-header { color: #dd0000; }
89
+ .folders-undo-notification.yes .folders-undo-header { color: #014737; }
90
+ .update-name-with-title .spinner {display: none; visibility: visible; margin-right: 0;}
91
+ .update-name-with-title.in-progress .spinner {display: inline-block;}
92
+
93
+ #folders-replace-file-name .inside {position: relative;padding:0;margin:0}
94
+ #folders-replace-file-name .inside p {padding: 1em; margin: 0;}
95
+ #folders-replace-file-name .upgrade-box {position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.3); z-index: 1;display: none;}
96
+ #folders-replace-file-name:hover .upgrade-box { display: block; }
97
+ #folders-replace-file-name:hover p {filter: blur(1.2px);}
98
+ #folders-replace-file-name:hover .upgrade-box a {display: inline-block; position: absolute; left: 0; right: 0; width: 100px; margin: 0 auto; top: 50%; padding: 5px 10px; text-decoration: none; background: #fa166b; color: #fff; border-radius: 4px; text-align: center; margin-top: -14px;}
99
+ </style>';
100
+ }
101
+
102
+ public function attachment_replace_name_with_title($form_fields, $post)
103
+ {
104
+ $screen = null;
105
+ if (function_exists('get_current_screen'))
106
+ {
107
+ $screen = get_current_screen();
108
+
109
+ if(! is_null($screen) && $screen->id == 'attachment') // hide on edit attachment screen.
110
+ return $form_fields;
111
+ }
112
+
113
+ $form_fields["replace_file_name"] = array(
114
+ "label" => esc_html__("Replace media", "folders"),
115
+ "input" => "html",
116
+ "html" => "<label for='attachment_title_{$post->ID}' data-post='{$post->ID}' data-nonce='".wp_create_nonce('change_attachment_title_'.$post->ID)."'><input id='attachment_title_{$post->ID}' type='checkbox' class='folder-replace-checkbox' value='{$post->ID}'>".esc_html__("Update file name with title")."</label><a href='".$this->upgradeLink."' target='_blank' style='background: {$this->button_color}; border-color: {$this->button_color}; color:#ffffff' type='button' class='button update-name-with-title' >".esc_html__("Upgrade to Pro", "folders")."</a>",
117
+ "helps" => ""
118
+ );
119
+
120
+ return $form_fields;
121
+ }
122
+
123
  public function folders_admin_css_and_js($page) {
124
  if($page == "media_page_folders-replace-media" || $page == "admin_page_folders-replace-media") {
125
  wp_enqueue_style('folders-media', plugin_dir_url(dirname(__FILE__)) . 'assets/css/replace-media.css', array(), WCP_FOLDER_VERSION);
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.7
6
- Stable tag: 2.6.8
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly create unlimited folders and organize and manage your Media Library files, Pages & Posts in folders
@@ -47,6 +47,7 @@ It’s rather simple really – once you install the plugin, you can begin using
47
  * New! Media replace - replace media files with other files uploaded by you
48
  * New! Import folders from other plugins - import folders from FileBird, Enhanced Media Library, Wicked Folders, Real Media Library, and WP Media Folder
49
  * You can also move media library files, pages, posts, or any custom post to folders without using our drag and drop feature. Whenever you select any element or select some elements in bulk, you can move it to a folder using our dropdown menu
 
50
  * Select specific folders when you add media to your pages, posts or any other post type
51
  * Drag and drop folders, change order, and hierarchy
52
  * Search folder names
@@ -68,10 +69,13 @@ It’s rather simple really – once you install the plugin, you can begin using
68
  = FOLDERS PLUGIN PRO FEATURES 🚀 =
69
  * <a href="https://premio.io/downloads/folders?utm_source=wporg" target="_blank" title="Folders pro plans"><strong>Upgrade to pro</strong></a> to get unlimited sub-folders :)
70
  * Create folders for each post type - use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)
 
71
  * Download any media library folder as ZIP: you can download any media library folder as a zip file. Use this feature to organize your website files and download them locally.
72
  * Sticky folders - you can pin your folders to the upper part of the folders navigation area. Use the sticky folders feature to make your most important folders accessible at all times.
73
  * Add stars to important directories
74
  * Lock folders - locked folders stay pinned, and cannot be dragged or deleted
 
 
75
  * Duplicate folders - duplicate an existing folder with all its content
76
  * Sort your folders based on creation date
77
  * Upload directly to a media library folder - you can easily upload images or any other kind of files to a specific folder
@@ -189,6 +193,9 @@ A live demo for the Folders plugin is available at <a href="https://demo.premio.
189
 
190
  == Changelog ==
191
 
 
 
 
192
  = 2.6.8 =
193
  Unlimited folders are now available in the free version 🎉
194
  We've also added an option to purge all plugin's data on removal + fixed some bugs
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.7
6
+ Stable tag: 2.6.9
7
  Plugin URI: https://premio.io/downloads/folders/
8
 
9
  Folders is a WordPress plugin that will help you quickly create unlimited folders and organize and manage your Media Library files, Pages & Posts in folders
47
  * New! Media replace - replace media files with other files uploaded by you
48
  * New! Import folders from other plugins - import folders from FileBird, Enhanced Media Library, Wicked Folders, Real Media Library, and WP Media Folder
49
  * You can also move media library files, pages, posts, or any custom post to folders without using our drag and drop feature. Whenever you select any element or select some elements in bulk, you can move it to a folder using our dropdown menu
50
+ * NEW! - Undo action - undo your last action in Folders with the click of a button
51
  * Select specific folders when you add media to your pages, posts or any other post type
52
  * Drag and drop folders, change order, and hierarchy
53
  * Search folder names
69
  = FOLDERS PLUGIN PRO FEATURES 🚀 =
70
  * <a href="https://premio.io/downloads/folders?utm_source=wporg" target="_blank" title="Folders pro plans"><strong>Upgrade to pro</strong></a> to get unlimited sub-folders :)
71
  * Create folders for each post type - use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)
72
+ * NEW! 🎉 Dynamic Folders - automatically filter posts, pages, custom posts, media library files based on author, date, file types & more
73
  * Download any media library folder as ZIP: you can download any media library folder as a zip file. Use this feature to organize your website files and download them locally.
74
  * Sticky folders - you can pin your folders to the upper part of the folders navigation area. Use the sticky folders feature to make your most important folders accessible at all times.
75
  * Add stars to important directories
76
  * Lock folders - locked folders stay pinned, and cannot be dragged or deleted
77
+ * NEW! Auto Rename file based on title - replace the actual file name of media files with the title from the WordPress editor
78
+ * NEW! Advanced Media Replacements - replace media files when uploading and update all references in the database, change dates, organize by newer date & more without hurting your SEO
79
  * Duplicate folders - duplicate an existing folder with all its content
80
  * Sort your folders based on creation date
81
  * Upload directly to a media library folder - you can easily upload images or any other kind of files to a specific folder
193
 
194
  == Changelog ==
195
 
196
+ = 2.6.9 =
197
+ Undo your last action and fixed some bugs and plugin conflicts
198
+
199
  = 2.6.8 =
200
  Unlimited folders are now available in the free version 🎉
201
  We've also added an option to purge all plugin's data on removal + fixed some bugs
templates/admin/admin-content.php CHANGED
@@ -6,7 +6,8 @@ if ( ! defined( 'ABSPATH' ) ) exit;
6
  $string = "";
7
  global $typenow;
8
  $width = get_option("wcp_dynamic_width_for_" . $typenow);
9
- if($width == null || empty($width)) {
 
10
  $width = 280;
11
  }
12
  $width = $width - 40;
@@ -53,7 +54,7 @@ button.button.organize-button:hover { background-color: <?php echo esc_attr($cus
53
  .mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { background: <?php echo esc_attr($customize_folders['folder_bg_color']) ?> !important; }
54
  .ui-state-highlight { border-color: <?php echo esc_attr($customize_folders['folder_bg_color']) ?> !important; background: rgba(<?php echo esc_attr($rgbColor['r'].",".$rgbColor['g'].",".$rgbColor['b'].", 0.08") ?> !important;}
55
  .jstree-node.drag-in > a.jstree-anchor.jstree-hovered { background-color: <?php echo esc_attr($customize_folders['folder_bg_color']) ?> !important; color: #ffffff; }
56
- <?php
57
  $font_family = "";
58
  if(isset($customize_folders['folder_font']) && !empty($customize_folders['folder_font'])) {
59
  $font_family = $customize_folders['folder_font'];
@@ -131,10 +132,10 @@ if(!empty($post_type)) {
131
  </div>
132
  <div class="folder-separator"></div>
133
  <div class="header-posts">
134
- <a href="javascript:;" class="all-posts <?php echo esc_attr($active_all_class) ?>"><?php esc_attr_e("All ".$title, WCP_FOLDER ) ?> <span class="total-count"><?php echo $ttpsts ?></span></a>
135
  </div>
136
  <div class="un-categorised-items <?php echo esc_attr($active) ?>">
137
- <a href="javascript:;" class="un-categorized-posts"><?php esc_attr_e("Unassigned ".$title, WCP_FOLDER) ?> <span class="total-count total-empty"><?php echo $ttemp ?></span> </a>
138
  </div>
139
  <div class="folder-separator-2"></div>
140
  </div>
@@ -167,32 +168,32 @@ if(!empty($post_type)) {
167
  </div>
168
  <form action="" method="post" id="save-folder-form">
169
  <div id="add-update-folder-title" class="add-update-folder-title">
170
- Add a new folder
171
  </div>
172
  <div class="add-folder-note">
173
- Enter your folder's name (or create more than one folder by separating the name with a comma)
174
  </div>
175
  <div class="folder-form-input">
176
  <div class="folder-group">
177
  <input id="add-update-folder-name" autocomplete="off" required="required">
178
  <span class="highlight"></span><span class="folder-bar"></span>
179
- <label for="add-update-folder-name">Folder name</label>
180
  </div>
181
  </div>
182
  <div class="folder-form-errors">
183
- <span class="dashicons dashicons-info"></span> Please enter folder name
184
  </div>
185
  <div class="folder-form-buttons hide-it pro-message" id="pro-notice">
186
- <span class="pro-tip">
187
- Pro tip
188
- </span>
189
  <div class="pro-notice">
190
- <a class="inline-button" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>">Upgrade to Pro</a> to create subfolders (with 20+ amaizing features) & premium support 🎉
191
  </div>
192
  </div>
193
  <div class="folder-form-buttons">
194
- <a href="javascript:;" class="form-cancel-btn">Cancel</a>
195
- <button type="submit" class="form-submit-btn" id="save-folder-data" style="width: 160px">Submit</button>
196
  </div>
197
  </form>
198
  </div>
@@ -207,21 +208,21 @@ if(!empty($post_type)) {
207
  </div>
208
  <form action="" method="post" id="update-folder-form">
209
  <div id="update-folder-title" class="add-update-folder-title">
210
- Rename folder
211
  </div>
212
  <div class="folder-form-input">
213
  <div class="folder-group">
214
  <input id="update-folder-item-name" autocomplete="off" required="required">
215
  <span class="highlight"></span><span class="folder-bar"></span>
216
- <label for="update-folder-item-name">Folder name</label>
217
  </div>
218
  </div>
219
  <div class="folder-form-errors">
220
- <span class="dashicons dashicons-info"></span> Please enter folder name
221
  </div>
222
  <div class="folder-form-buttons">
223
- <a href="javascript:;" class="form-cancel-btn">Cancel</a>
224
- <button type="submit" class="form-submit-btn" id="update-folder-data" style="width: 160px">Submit</button>
225
  </div>
226
  </form>
227
  </div>
@@ -235,14 +236,14 @@ if(!empty($post_type)) {
235
  <a class="" href="javascript:;"><span></span></a>
236
  </div>
237
  <div class="add-update-folder-title" id="remove-folder-message">
238
- Are you sure you want to delete the selected folder?
239
  </div>
240
  <div class="folder-form-message" id="remove-folder-notice">
241
- Items in the folder will not be deleted.
242
  </div>
243
  <div class="folder-form-buttons">
244
- <a href="javascript:;" class="form-cancel-btn">No, Keep it</a>
245
- <a href="javascript:;" class="form-submit-btn" id="remove-folder-item">Yes, Delete it!</a>
246
  </div>
247
  </div>
248
  </div>
@@ -258,11 +259,11 @@ if(!empty($post_type)) {
258
 
259
  </div>
260
  <div class="folder-form-message">
261
- Unlock unlimited amount of folders by upgrading to one of our pro plans.
262
  </div>
263
  <div class="folder-form-buttons">
264
- <a href="javascript:;" class="form-cancel-btn">Cancel</a>
265
- <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn">See Pro Plans</a>
266
  </div>
267
  </div>
268
  </div>
@@ -278,7 +279,7 @@ if(!empty($post_type)) {
278
 
279
  </div>
280
  <div class="folder-form-buttons">
281
- <a href="javascript:;" class="form-cancel-btn">Close</a>
282
  </div>
283
  </div>
284
  </div>
@@ -291,42 +292,41 @@ if(!empty($post_type)) {
291
  <a class="" href="javascript:;"><span></span></a>
292
  </div>
293
  <div class="add-update-folder-title">
294
- Sub-folders is a pro feature
295
  </div>
296
  <div class="folder-form-message" style="padding: 25px 10px;" >
297
- Hey, it looks like you want to create sub-folders on Folders. Sub-folders is a premium feature. Upgrade now to create, access and organize your files with sub-folders.
298
  </div>
299
  <div class="folder-form-buttons">
300
- <a href="javascript:;" class="form-cancel-btn">Cancel</a>
301
- <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn">Upgrade Now</a>
302
  </div>
303
  </div>
304
  </div>
305
  </div>
306
 
307
  <div class="folder-popup-form" id="add-sub-folder-popup">
308
-
309
  <div class="popup-form-content">
310
  <div class="popup-form-data">
311
  <div class="close-popup-button">
312
  <a class="" href="javascript:;"><span></span></a>
313
  </div>
314
  <div class="add-update-folder-title">
315
- Add a new folder
316
  </div>
317
  <div class="folder-form-input">
318
  <div class="folder-group">
319
  <input id="update-folder-item-name" autocomplete="off" required="required" readonly>
320
  <span class="highlight"></span><span class="folder-bar"></span>
321
- <label for="update-folder-item-name">Folder name</label>
322
  </div>
323
  </div>
324
  <div class="folder-form-buttons">
325
  <span class="pro-tip">
326
- Pro tip
327
  </span>
328
  <div class="pro-notice">
329
- <a class="inline-button" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>">Upgrade to Pro</a> to create subfolders (with 20+ amaizing features) & premium support 🎉
330
  </div>
331
  </div>
332
  </div>
@@ -334,26 +334,42 @@ if(!empty($post_type)) {
334
  </div>
335
 
336
  <div class="folder-popup-form" id="bulk-move-folder">
337
- <form action="" method="post" id="bulk-folder-form">
338
- <div class="popup-form-content">
339
- <div class="popup-form-data">
340
- <div class="close-popup-button">
341
- <a class="" href="javascript:;"><span></span></a>
342
- </div>
343
- <div class="popup-folder-title">
344
- Select Folder
345
- </div>
346
- <div class="select-box">
347
- <select id="bulk-select">
348
- <option value="">Select Folder</option>
349
- </select>
350
- </div>
351
- <div class="folder-form-buttons">
352
- <a href="javascript:;" class="form-cancel-btn">Cancel</a>
353
- <button type="submit" class="form-submit-btn" id="move-to-folder" style="width: 200px">Move to Folder</button>
 
354
  </div>
355
  </div>
 
 
 
 
 
 
 
 
 
356
  </div>
357
- </form>
358
- </div>
 
 
 
 
 
 
359
  </div>
6
  $string = "";
7
  global $typenow;
8
  $width = get_option("wcp_dynamic_width_for_" . $typenow);
9
+ $width = intval($width);
10
+ if($width == null || empty($width) || $width > 1200) {
11
  $width = 280;
12
  }
13
  $width = $width - 40;
54
  .mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar { background: <?php echo esc_attr($customize_folders['folder_bg_color']) ?> !important; }
55
  .ui-state-highlight { border-color: <?php echo esc_attr($customize_folders['folder_bg_color']) ?> !important; background: rgba(<?php echo esc_attr($rgbColor['r'].",".$rgbColor['g'].",".$rgbColor['b'].", 0.08") ?> !important;}
56
  .jstree-node.drag-in > a.jstree-anchor.jstree-hovered { background-color: <?php echo esc_attr($customize_folders['folder_bg_color']) ?> !important; color: #ffffff; }
57
+ <?php
58
  $font_family = "";
59
  if(isset($customize_folders['folder_font']) && !empty($customize_folders['folder_font'])) {
60
  $font_family = $customize_folders['folder_font'];
132
  </div>
133
  <div class="folder-separator"></div>
134
  <div class="header-posts">
135
+ <a href="javascript:;" class="all-posts <?php echo esc_attr($active_all_class) ?>"><?php esc_attr_e("All ".$title, 'folders'); ?> <span class="total-count"><?php echo $ttpsts ?></span></a>
136
  </div>
137
  <div class="un-categorised-items <?php echo esc_attr($active) ?>">
138
+ <a href="javascript:;" class="un-categorized-posts"><?php esc_attr_e("Unassigned ".$title, 'folders'); ?> <span class="total-count total-empty"><?php echo $ttemp ?></span> </a>
139
  </div>
140
  <div class="folder-separator-2"></div>
141
  </div>
168
  </div>
169
  <form action="" method="post" id="save-folder-form">
170
  <div id="add-update-folder-title" class="add-update-folder-title">
171
+ <?php esc_html_e("Add a new folder", "folders") ?>
172
  </div>
173
  <div class="add-folder-note">
174
+ <?php esc_html_e("Enter your folder's name (or create more than one folder by separating the name with a comma)", "folders") ?>
175
  </div>
176
  <div class="folder-form-input">
177
  <div class="folder-group">
178
  <input id="add-update-folder-name" autocomplete="off" required="required">
179
  <span class="highlight"></span><span class="folder-bar"></span>
180
+ <label for="add-update-folder-name"><?php esc_html_e("Folder name", "folders") ?></label>
181
  </div>
182
  </div>
183
  <div class="folder-form-errors">
184
+ <span class="dashicons dashicons-info"></span> <?php esc_html_e("Please enter folder name", "folders") ?>
185
  </div>
186
  <div class="folder-form-buttons hide-it pro-message" id="pro-notice">
187
+ <span class="pro-tip">
188
+ <?php esc_html_e("Pro tip", "folders") ?>
189
+ </span>
190
  <div class="pro-notice">
191
+ <?php printf( esc_html__("%sUpgrade to Pro%s to create subfolders (with 20+ amazing features) & premium support 🎉", "folders"), '<a class="inline-button" target="_blank" href="'.esc_url($this->getFoldersUpgradeURL()).'">', "</a>"); ?>
192
  </div>
193
  </div>
194
  <div class="folder-form-buttons">
195
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", "folders") ?></a>
196
+ <button type="submit" class="form-submit-btn" id="save-folder-data" style="width: 160px"><?php esc_html_e("Submit", "folders") ?></button>
197
  </div>
198
  </form>
199
  </div>
208
  </div>
209
  <form action="" method="post" id="update-folder-form">
210
  <div id="update-folder-title" class="add-update-folder-title">
211
+ <?php esc_html_e("Rename folder", "folders") ?>
212
  </div>
213
  <div class="folder-form-input">
214
  <div class="folder-group">
215
  <input id="update-folder-item-name" autocomplete="off" required="required">
216
  <span class="highlight"></span><span class="folder-bar"></span>
217
+ <label for="update-folder-item-name"><?php esc_html_e("Folder name", "folders") ?></label>
218
  </div>
219
  </div>
220
  <div class="folder-form-errors">
221
+ <span class="dashicons dashicons-info"></span> <?php esc_html_e("Please enter folder name", "folders") ?>
222
  </div>
223
  <div class="folder-form-buttons">
224
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", "folders") ?></a>
225
+ <button type="submit" class="form-submit-btn" id="update-folder-data" style="width: 160px"><?php esc_html_e("Submit", "folders") ?></button>
226
  </div>
227
  </form>
228
  </div>
236
  <a class="" href="javascript:;"><span></span></a>
237
  </div>
238
  <div class="add-update-folder-title" id="remove-folder-message">
239
+ <?php esc_html_e("Are you sure you want to delete the selected folder?", "folders") ?>
240
  </div>
241
  <div class="folder-form-message" id="remove-folder-notice">
242
+ <?php esc_html_e("Items in the folder will not be deleted.", "folders") ?>
243
  </div>
244
  <div class="folder-form-buttons">
245
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("No, Keep it", "folders") ?></a>
246
+ <a href="javascript:;" class="form-submit-btn" id="remove-folder-item"><?php esc_html_e("Yes, Delete it!", "folders") ?></a>
247
  </div>
248
  </div>
249
  </div>
259
 
260
  </div>
261
  <div class="folder-form-message">
262
+ <?php esc_html_e("Unlock unlimited amount of folders by activating license key.", "folders") ?>
263
  </div>
264
  <div class="folder-form-buttons">
265
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", "folders") ?></a>
266
+ <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn"><?php esc_html_e("Activate License Key", "folders") ?></a>
267
  </div>
268
  </div>
269
  </div>
279
 
280
  </div>
281
  <div class="folder-form-buttons">
282
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Close", "folders") ?></a>
283
  </div>
284
  </div>
285
  </div>
292
  <a class="" href="javascript:;"><span></span></a>
293
  </div>
294
  <div class="add-update-folder-title">
295
+ <?php esc_html_e("Sub-folders is a pro feature", "folders") ?>
296
  </div>
297
  <div class="folder-form-message" style="padding: 25px 10px;" >
298
+ <?php esc_html_e("Hey, it looks like you want to create sub-folders on Folders. Sub-folders is a premium feature. Upgrade to Pro to create, access and organize your files with sub-folders.", "folders") ?>
299
  </div>
300
  <div class="folder-form-buttons">
301
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", "folders") ?></a>
302
+ <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn"><?php esc_html_e("Activate License Key", "folders") ?></a>
303
  </div>
304
  </div>
305
  </div>
306
  </div>
307
 
308
  <div class="folder-popup-form" id="add-sub-folder-popup">
 
309
  <div class="popup-form-content">
310
  <div class="popup-form-data">
311
  <div class="close-popup-button">
312
  <a class="" href="javascript:;"><span></span></a>
313
  </div>
314
  <div class="add-update-folder-title">
315
+ <?php esc_html_e("Add a new folder", "folders") ?>
316
  </div>
317
  <div class="folder-form-input">
318
  <div class="folder-group">
319
  <input id="update-folder-item-name" autocomplete="off" required="required" readonly>
320
  <span class="highlight"></span><span class="folder-bar"></span>
321
+ <label for="update-folder-item-name"><?php esc_html_e("Folder name", "folders") ?></label>
322
  </div>
323
  </div>
324
  <div class="folder-form-buttons">
325
  <span class="pro-tip">
326
+ <?php esc_html_e("Pro tip", "folders") ?>
327
  </span>
328
  <div class="pro-notice">
329
+ <?php printf( esc_html__("%sUpgrade to Pro%s to create subfolders (with 20+ amazing features) & premium support 🎉", "folders"), '<a class="inline-button" target="_blank" href="'.esc_url($this->getFoldersUpgradeURL()).'">', "</a>"); ?>
330
  </div>
331
  </div>
332
  </div>
334
  </div>
335
 
336
  <div class="folder-popup-form" id="bulk-move-folder">
337
+ <form action="" method="post" id="bulk-folder-form">
338
+ <div class="popup-form-content">
339
+ <div class="popup-form-data">
340
+ <div class="close-popup-button">
341
+ <a class="" href="javascript:;"><span></span></a>
342
+ </div>
343
+ <div class="popup-folder-title">
344
+ <?php esc_html_e("Select Folder", "folders") ?>
345
+ </div>
346
+ <div class="select-box">
347
+ <select id="bulk-select">
348
+ <option value=""><?php esc_html_e("Select Folder", "folders") ?></option>
349
+ </select>
350
+ </div>
351
+ <div class="folder-form-buttons">
352
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", "folders") ?></a>
353
+ <button type="submit" class="form-submit-btn" id="move-to-folder" style="width: 200px"><?php esc_html_e("Move to Folder", "folders") ?></button>
354
+ </div>
355
  </div>
356
  </div>
357
+ </form>
358
+ </div>
359
+
360
+ <div class="folders-undo-notification" id="do-undo">
361
+ <div class="folders-undo-body">
362
+ <a href="javascript:;" class="close-undo-box"><span></span></a>
363
+ <div class="folders-undo-header"><?php esc_html_e("Action performed successfully", "folders") ?></div>
364
+ <div class="folders-undo-body"><?php printf(esc_html__("Your action has been successfully completed. Click the %sUndo%s button to reverse the action", "folders"), "<b>", "</b>"); ?></div>
365
+ <div class="folders-undo-footer"><button class="undo-button" type="button"><?php esc_html_e("Undo", "folders") ?></button></div>
366
  </div>
367
+ </div>
368
+
369
+ <div class="folders-undo-notification" id="undo-done">
370
+ <div class="folders-undo-body" style="padding: 0">
371
+ <a href="javascript:;" class="close-undo-box"><span></span></a>
372
+ <div class="folders-undo-header" style="color: #014737; padding: 0"><?php esc_html_e("Action reversed successfully", "folders") ?></div>
373
+ </div>
374
+ </div>
375
  </div>
templates/admin/folder-deactivate-form.php CHANGED
@@ -305,21 +305,21 @@ if ( ! defined( 'ABSPATH' ) ) exit;
305
  <div class="folder-serveypanel">
306
  <form action="#" method="post" id="folder-deactivate-form">
307
  <div class="folder-popup-header">
308
- <h2><?php esc_html_e('Quick feedback about Folders', WCP_FOLDER); ?> 🙏</h2>
309
  </div>
310
  <div class="folder-popup-body">
311
- <h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Folders :)', WCP_FOLDER); ?></h3>
312
  <div class="form-control">
313
- <input type="email" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="<?php echo _e("Email address", WCP_FOLDER) ?>" id="folder-deactivate-email_id">
314
  </div>
315
  <div class="form-control">
316
  <label></label>
317
- <textarea placeholder="<?php esc_html_e("Your comment", WCP_FOLDER) ?>" id="folder-comment"></textarea>
318
  </div>
319
- <?php esc_html_e("Having any problem with the Folders plugins?", WCP_FOLDER) ?><a class='folder-deactivate-button' href='javascript:;'><?php esc_html_e("Click here", WCP_FOLDER) ?></a><?php esc_html_e(" to contact our support now", WCP_FOLDER) ?>
320
  </div>
321
  <div class="folder-popup-footer">
322
- <label class="folder-anonymous"><input type="checkbox"/><?php esc_html_e('Anonymous feedback', WCP_FOLDER); ?>
323
  </label>
324
  <input type="button" class="button button-secondary button-skip folder-popup-skip-feedback" value="Skip &amp; Deactivate">
325
 
@@ -328,7 +328,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
328
  <img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt="">
329
  </span>
330
  <input type="submit" class="button button-secondary button-deactivate folder-popup-allow-deactivate" value="Submit &amp; Deactivate" disabled="disabled">
331
- <a href="#" class="button button-primary folder-popup-button-close"><?php esc_attr_e('Cancel', WCP_FOLDER); ?></a>
332
  </div>
333
  </div>
334
  </form>
305
  <div class="folder-serveypanel">
306
  <form action="#" method="post" id="folder-deactivate-form">
307
  <div class="folder-popup-header">
308
+ <h2><?php esc_html_e('Quick feedback about Folders', 'folders'); ?> 🙏</h2>
309
  </div>
310
  <div class="folder-popup-body">
311
+ <h3><?php esc_html_e('Your feedback will help us improve the product, please tell us why did you decide to deactivate Folders :)', 'folders'); ?></h3>
312
  <div class="form-control">
313
+ <input type="email" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="<?php echo _e("Email address", 'folders'); ?>" id="folder-deactivate-email_id">
314
  </div>
315
  <div class="form-control">
316
  <label></label>
317
+ <textarea placeholder="<?php esc_html_e("Your comment", 'folders'); ?>" id="folder-comment"></textarea>
318
  </div>
319
+ <?php esc_html_e("Having any problem with the Folders plugins?", 'folders'); ?><a class='folder-deactivate-button' href='javascript:;'><?php esc_html_e("Click here", 'folders'); ?></a><?php esc_html_e(" to contact our support now", 'folders'); ?>
320
  </div>
321
  <div class="folder-popup-footer">
322
+ <label class="folder-anonymous"><input type="checkbox"/><?php esc_html_e('Anonymous feedback', 'folders'); ?>
323
  </label>
324
  <input type="button" class="button button-secondary button-skip folder-popup-skip-feedback" value="Skip &amp; Deactivate">
325
 
328
  <img src="<?php echo esc_url(admin_url('/images/spinner.gif')); ?>" alt="">
329
  </span>
330
  <input type="submit" class="button button-secondary button-deactivate folder-popup-allow-deactivate" value="Submit &amp; Deactivate" disabled="disabled">
331
+ <a href="#" class="button button-primary folder-popup-button-close"><?php esc_attr_e('Cancel', 'folders'); ?></a>
332
  </div>
333
  </div>
334
  </form>
templates/admin/general-settings.php CHANGED
@@ -1,1365 +1,1399 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- ?>
4
- <!-- do not change here, Free/Pro URL Change -->
5
- <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/settings.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
6
- <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/folder-icon.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
7
- <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/spectrum.min.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
8
- <?php if($setting_page == "folder-settings") { ?>
9
- <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/select2.min.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
10
- <script type="text/javascript" src='<?php echo WCP_FOLDER_URL ?>assets/js/select2.min.js?ver=<?php echo WCP_FOLDER_VERSION ?>' ></script>
11
- <?php } ?>
12
- <script src="<?php echo WCP_FOLDER_URL ?>assets/js/spectrum.min.js"></script>
13
- <style>
14
- <?php if ( function_exists( 'is_rtl' ) && is_rtl() ) { ?>
15
- #setting-form {
16
- float: right;
17
- }
18
- <?php } ?>
19
- </style>
20
- <script>
21
- (function (factory) {
22
- "use strict";
23
- if (typeof define === 'function' && define.amd) {
24
- define(['jquery'], factory);
25
- }
26
- else if(typeof module !== 'undefined' && module.exports) {
27
- module.exports = factory(require('jquery'));
28
- }
29
- else {
30
- factory(jQuery);
31
- }
32
- }(function ($, undefined) {
33
- var selectedItem;
34
- var importTitle = "<?php esc_html_e("Import folders from %plugin%", "folders"); ?>";
35
- var importDesc = "<?php esc_html_e("Are you sure you'd like to import %d folders from %plugin%?", "folders"); ?>";
36
- var removeTitle = "<?php esc_html_e("Are you sure?", "folders"); ?>";
37
- var removeDesc = "<?php esc_html_e("You're about to delete %plugin%'s folders. Are you sure you'd like to proceed?", "folders"); ?>";
38
- $(document).ready(function(){
39
- <?php if($setting_page == "folder-settings") { ?>
40
- $(".select2-box").select2();
41
- <?php } ?>
42
- $(document).on("click",".form-cancel-btn, .close-popup-button, .folder-popup-form",function(){
43
- if($(this).hasClass("cancel-folders") || $(this).hasClass("remove-folders-box") || $(this).hasClass("close-remove-folders")) {
44
- $("#remove_folders_when_removed").prop("checked", false);
45
- setFoldersRemoveStatus("off");
46
- }
47
- if($(this).hasClass("delete-button")) {
48
- setFoldersRemoveStatus("on");
49
- }
50
- $(".folder-popup-form").hide();
51
- });
52
- $(document).on("click",".import-folders-button", function(e){
53
- $("#import-folders-popup").show();
54
- });
55
- $(document).on("click",".popup-form-content", function(e){
56
- e.stopPropagation();
57
- e.stopImmediatePropagation();
58
- });
59
- $(document).on("click",".folder-select",function(){
60
- if($(this).is(":checked")) {
61
- $(this).closest("tr").find(".hide-show-option").removeClass("hide-option");
62
- } else {
63
- $(this).closest("tr").find(".hide-show-option").addClass("hide-option");
64
- }
65
- });
66
- $(document).on("click", ".accordion-header", function(){
67
- if($(this).hasClass("active")) {
68
- $(this).closest(".accordion").find(".accordion-content").slideUp();
69
- $(this).removeClass("active");
70
- } else {
71
- $(this).closest(".accordion").find(".accordion-content").slideDown();
72
- $(this).addClass("active");
73
- }
74
- });
75
- $(document).on("change", ".hide-show-option", function(){
76
- if($(this).val() == "folders-pro") {
77
- $(this).find("option").prop("selected", false);
78
- $(this).find("option:first").prop("selected", true);
79
- window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank");
80
- }
81
- });
82
- $(document).on("change", "#folder_font", function(){
83
- if($(this).val() == "folders-pro") {
84
- $(this).val("").trigger("change");
85
- window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank");
86
- }
87
- });
88
- $(document).on("change", "#folder_size", function(){
89
- if($(this).val() == "folders-pro" || $(this).val() == "folders-pro-item") {
90
- $(this).val("16").trigger("change");
91
- window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank");
92
- }
93
- });
94
- $(".accordion-header:first").trigger("click");
95
- $("#folder_font, #folder_size").change(function(){
96
- setCSSProperties();
97
- });
98
- $(document).on("click", "input[name='customize_folders[show_media_details]']", function(){
99
- if($("#show_media_details").is(":checked")) {
100
- $(".media-setting-box").addClass("active");
101
- } else {
102
- $(".media-setting-box").removeClass("active");
103
- }
104
- });
105
- setCSSProperties();
106
- $('.color-field').spectrum({
107
- chooseText: "Submit",
108
- preferredFormat: "hex",
109
- showInput: true,
110
- cancelText: "Cancel",
111
- move: function (color) {
112
- $(this).val(color.toHexString());
113
- setCSSProperties();
114
- },
115
- change: function (color) {
116
- $(this).val(color.toHexString());
117
- setCSSProperties();
118
- }
119
- });
120
- $(document).on("click", "input[name='customize_folders[remove_folders_when_removed]']", function(e){
121
- if($(this).is(":checked")) {
122
- $("#remove-folders-data-box").show();
123
- //setFoldersRemoveStatus("on");
124
- } else {
125
- setFoldersRemoveStatus("off");
126
- }
127
- })
128
- $(document).on("click", ".import-folder-data", function(e){
129
- selectedItem = $(this).closest("tr").data("plugin");
130
- if(!$(this).hasClass("in-popup")) {
131
- var pluginName = $(this).closest("tr").find(".plugin-name").html();
132
- var pluginFolders = parseInt($(this).closest("tr").data("folders"));
133
- var popupTitle = importTitle.replace("%plugin%", pluginName);
134
- $(".import-folder-title").html(popupTitle);
135
- var popupDesc = importDesc.replace("%plugin%", "<b>" + pluginName + "</b>");
136
- popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>");
137
- $(".import-folder-note").html(popupDesc);
138
- $("#import-plugin-data").show();
139
- } else {
140
- importPluginData();
141
- }
142
- });
143
- $(document).on("click", ".remove-folders-data", function(e){
144
- e.preventDefault();
145
- $("#remove-confirmation-box").show();
146
- $("#delete-input").focus();
147
- });
148
- $(document).on("keyup", "#delete-input", function(){
149
- if($.trim($(this).val()) != "") {
150
- var inputVal = $.trim($(this).val()).toLowerCase();
151
- if (inputVal == "delete") {
152
- $("#remove-folders-data-button").prop("disabled", false);
153
- $(".delete-confirmation-message").html("<?php esc_html_e('This will delete all existing folders & settings', WCP_FOLDER); ?>");
154
- } else {
155
- $("#remove-folders-data-button").prop("disabled", true);
156
- if (inputVal != "") {
157
- var textLen = inputVal.length;
158
- var curStr = ("delete").substring(0, textLen);
159
- if (curStr != inputVal) {
160
- $(".delete-confirmation-message").html("<?php esc_html_e('Please type DELETE and click on the "Delete" button to confirm', WCP_FOLDER); ?>");
161
- } else {
162
- $(".delete-confirmation-message").html("");
163
- }
164
- } else {
165
- $(".delete-confirmation-message").html("");
166
- }
167
- }
168
- } else {
169
- $(".delete-confirmation-message").html("");
170
- }
171
- });
172
- $(document).on("submit", "#remove_folders_data", function(e){
173
- e.preventDefault();
174
- if($.trim($("#delete-input").val()).toLowerCase() == "delete") {
175
- $.ajax({
176
- url: "<?php echo admin_url("admin-ajax.php") ?>",
177
- data: {
178
- action: 'wcp_remove_all_folders_data',
179
- nonce: $("#remove-folder-nonce").val()
180
- },
181
- type: 'post',
182
- success: function(res) {
183
- <?php
184
- $redirectURL = $this->getFolderSettingsURL();
185
- if(!empty($redirectURL)) {
186
- $page = isset($_POST['tab_page'])?$_POST['tab_page']:"";
187
- $type = filter_input(INPUT_GET, 'setting_page', FILTER_SANITIZE_STRING);
188
- $type = empty($type)?"":"&setting_page=".$type;
189
- $redirectURL = $redirectURL.$type;
190
- if(!empty($page)) {
191
- $redirectURL .= "&setting_page=".$page;
192
- }
193
- }
194
- $redirectURL = $redirectURL."&note=2";
195
- ?>
196
- window.location = "<?php echo $redirectURL ?>";
197
- }
198
- });
199
- }
200
- return false;
201
- });
202
- $(document).on("change", "#delete-input", function(){
203
- if($.trim($(this).val()).toLowerCase() == "delete") {
204
- $("#remove-folders-data-button").prop("disabled", false);
205
- } else {
206
- $("#remove-folders-data-button").prop("disabled", true);
207
- }
208
- });
209
- /*$(document).on("click", "#remove-folders-data-button", function(e){
210
- e.preventDefault();
211
- $(".folder-popup-form").hide();
212
- $("#remove-confirmation-box").show();
213
- });*/
214
- $(document).on("click", "#import-folder-button", function(e){
215
- importPluginData();
216
- });
217
- $(document).on("click", ".remove-folder-data", function(e){
218
- selectedItem = $(this).closest("tr").data("plugin");
219
- var pluginName = $(this).closest("tr").find(".plugin-name").html();
220
- var pluginFolders = parseInt($(this).closest("tr").data("folders"));
221
- var popupTitle = removeTitle.replace("%plugin%", pluginName);
222
- $(".remove-folder-title").html(popupTitle);
223
- var popupDesc = removeDesc.replace("%plugin%", "<b>" + pluginName + "</b>");
224
- popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>");
225
- $(".remove-folder-note").html(popupDesc);
226
- $("#remove-plugin-data").show();
227
- });
228
- $(document).on("click", "#remove-folder-button", function(){
229
- removePluginData();
230
- });
231
- setTooltipPosition();
232
-
233
- $(document).on("click", ".checkbox-color", function(){
234
- setCSSProperties();
235
- });
236
-
237
- $(document).on("change", ".checkbox-color", function(){
238
- setCSSProperties();
239
- });
240
- });
241
-
242
- function setFoldersRemoveStatus(status) {
243
- $.ajax({
244
- url: "<?php echo admin_url("admin-ajax.php") ?>",
245
- data: {
246
- 'action': 'wcp_update_folders_uninstall_status',
247
- 'status': status,
248
- 'nonce': "<?php echo wp_create_nonce("wcp_folders_uninstall_status") ?>"
249
- },
250
- type: 'post',
251
- success: function (res) {
252
-
253
- }
254
- });
255
- }
256
-
257
- function importPluginData() {
258
- $("#import-folder-button").addClass("button");
259
- $("#import-folder-button").prop("disabled", true);
260
- $(".other-plugins-"+selectedItem+" .import-folder-data").prop("disabled", true);
261
- $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").addClass("active");
262
- $.ajax({
263
- url: "<?php echo admin_url("admin-ajax.php") ?>",
264
- data: {
265
- 'plugin': $(".other-plugins-"+selectedItem).data("plugin"),
266
- 'nonce': $(".other-plugins-"+selectedItem).data("nonce"),
267
- 'action': 'wcp_import_plugin_folders_data'
268
- },
269
- type: 'post',
270
- success: function(res){
271
- var response = $.parseJSON(res);
272
- if(response.status == -1) {
273
- $(".other-plugins-"+selectedItem+" .import-folder-data").prop("disabled", false);
274
- $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").removeClass("active");
275
- $("#import-third-party-plugin-data").hide();
276
- $("#no-more-folder-credit").show();
277
- $("#import-folder-button").removeClass("button");
278
- $("#import-folder-button").prop("disabled", false);
279
- } else if(response.status) {
280
- $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("success-import");
281
- $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove();
282
- } else {
283
- $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import");
284
- $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove();
285
- }
286
- $("#import-folder-button").prop("disabled", false);
287
- $("#import-plugin-data").hide();
288
- }
289
- });
290
- }
291
-
292
- function removePluginData() {
293
- $(".other-plugins-"+selectedItem+" .remove-folder-data .spinner").addClass("active");
294
- $.ajax({
295
- url: "<?php echo admin_url("admin-ajax.php") ?>",
296
- data: {
297
- 'plugin': $(".other-plugins-"+selectedItem).data("plugin"),
298
- 'nonce': $(".other-plugins-"+selectedItem).data("nonce"),
299
- 'action': 'wcp_remove_plugin_folders_data'
300
- },
301
- type: 'post',
302
- success: function(res){
303
- var response = $.parseJSON(res);
304
- $("#remove-plugin-data").hide();
305
- if(response.status) {
306
- $(".other-plugins-"+response.data.plugin).remove();
307
- } else {
308
- $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import");
309
- $(".other-plugins-"+response.data.plugin+" .remove-folder-data .spinner").removeClass("active");
310
- }
311
-
312
- if($("#import-folders-popup .plugin-import-table tr").length == 0) {
313
- $("#import-folders-popup").hide();
314
- $(".has-other-plugins").remove();
315
- $(".no-more-plugins").addClass("active");
316
- }
317
- }
318
- });
319
- }
320
-
321
- function setCSSProperties() {
322
- if(jQuery("#new_folder_color").length && $("#new_folder_color").val() != "") {
323
- $("#add-new-folder").css("border-color", $("#new_folder_color").val());
324
- $("#add-new-folder").css("background-color", $("#new_folder_color").val());
325
- } else if ($("input[name='customize_folders[new_folder_color]']:checked").length) {
326
- $("#add-new-folder").css("border-color", $("input[name='customize_folders[new_folder_color]']:checked").val());
327
- $("#add-new-folder").css("background-color", $("input[name='customize_folders[new_folder_color]']:checked").val());
328
- }
329
-
330
- if($("#bulk_organize_button_color").length && $("#bulk_organize_button_color").val() != "") {
331
- $(".organize-button").css("border-color", $("#bulk_organize_button_color").val());
332
- $(".organize-button").css("background-color", $("#bulk_organize_button_color").val());
333
- $(".organize-button").css("color", "#ffffff");
334
- } else if ($("input[name='customize_folders[bulk_organize_button_color]']:checked").length) {
335
- $(".organize-button").css("border-color", $("input[name='customize_folders[bulk_organize_button_color]']:checked").val());
336
- $(".organize-button").css("background-color", $("input[name='customize_folders[bulk_organize_button_color]']:checked").val());
337
- $(".organize-button").css("color", "#ffffff");
338
- }
339
-
340
- if($("#dropdown_color").length && $("#dropdown_color").val() != "") {
341
- $(".media-select").css("border-color", $("#dropdown_color").val());
342
- $(".media-select").css("color", $("#dropdown_color").val());
343
- } else if ($("input[name='customize_folders[dropdown_color]']:checked").length) {
344
- $(".media-select").css("border-color", $("input[name='customize_folders[dropdown_color]']:checked").val());
345
- $(".media-select").css("color", $("input[name='customize_folders[dropdown_color]']:checked").val());
346
- }
347
-
348
- if($("#folder_bg_color").length && $("#folder_bg_color").val() != "") {
349
- $(".all-posts.active-item-link").css("border-color", $("#folder_bg_color").val());
350
- $(".all-posts.active-item-link").css("background-color", $("#folder_bg_color").val());
351
- $(".all-posts.active-item-link").css("color", "#ffffff");
352
- } else if ($("input[name='customize_folders[folder_bg_color]']:checked").length) {
353
- $(".all-posts.active-item-link").css("border-color", $("input[name='customize_folders[folder_bg_color]']:checked").val());
354
- $(".all-posts.active-item-link").css("background-color", $("input[name='customize_folders[folder_bg_color]']:checked").val());
355
- $(".all-posts.active-item-link").css("color", "#ffffff");
356
- }
357
-
358
- $("#custom-css").html("");
359
- if($("#folder_font").val() != "") {
360
- font_val = $("#folder_font").val();
361
- $('head').append('<link href="https://fonts.googleapis.com/css?family=' + font_val + ':400,600,700" rel="stylesheet" type="text/css" class="chaty-google-font">');
362
- $('.preview-box').css('font-family', font_val);
363
- } else {
364
- $('.preview-box').css('style', "");
365
- }
366
- if($("#folder_size").val() != "") {
367
- $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", $("#folder_size").val()+"px");
368
- } else {
369
- $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", "14px");
370
- }
371
- }
372
-
373
- $(window).on("scroll", function(){
374
- setTooltipPosition();
375
- }).on("resize", function(){
376
- setTooltipPosition();
377
- });
378
-
379
- function setTooltipPosition() {
380
- if($(".html-tooltip:not(.no-position)").length) {
381
- $(".html-tooltip:not(.no-position)").each(function(){
382
- if($(this).offset().top - $(window).scrollTop() > 540) {
383
- $(this).addClass("top").removeClass("side").removeClass("bottom");
384
- $(this).find(".tooltip-text").attr("style","");
385
- $(this).find(".tooltip-text").removeClass("hide-arrow");
386
- } else if($(window).height() - ($(this).offset().top - $(window).scrollTop()) > 460) {
387
- $(this).addClass("bottom").removeClass("top").removeClass("side");
388
- $(this).find(".tooltip-text").attr("style","");
389
- $(this).find(".tooltip-text").removeClass("hide-arrow");
390
- } else {
391
- $(this).addClass("side").removeClass("top").removeClass("bottom");
392
- if($(this).find(".tooltip-text").length) {
393
- $(this).find(".tooltip-text").attr("style","");
394
- $(this).find(".tooltip-text").removeClass("hide-arrow");
395
-
396
- if($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50 < 0) {
397
- $(this).find(".tooltip-text").css("margin-top", Math.abs($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50)+"px");
398
- $(this).find(".tooltip-text").addClass("hide-arrow");
399
- } else {
400
- $(this).find(".tooltip-text").attr("style","");
401
- if(($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) > 0) {
402
- $(this).find(".tooltip-text").css("margin-top", ((-1)*Math.abs($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) - 10)+"px");
403
- $(this).find(".tooltip-text").addClass("hide-arrow");
404
- }
405
- }
406
- }
407
- }
408
- });
409
- }
410
- }
411
- }));
412
- </script>
413
- <div id="custom-css">
414
-
415
- </div>
416
- <div class="wrap">
417
- <h1><?php esc_html_e( 'Folders Settings', WCP_FOLDER ); ?></h1>
418
- <?php
419
- settings_fields('folders_settings');
420
- settings_fields('default_folders');
421
- settings_fields('customize_folders');
422
- $options = get_option('folders_settings');
423
- $default_folders = get_option('default_folders');
424
- $customize_folders = get_option('customize_folders');
425
- $default_folders = (empty($default_folders) || !is_array($default_folders))?array():$default_folders;
426
- do_settings_sections( __FILE__ );
427
- ?>
428
- <?php if(isset($_GET['note']) && $_GET['note'] == 1) { ?>
429
- <div class="folder-notification notice notice-success is-dismissible">
430
- <div class="folder-notification-title"><?php esc_html_e("Changes Saved", "folders") ?></div>
431
- <div class="folder-notification-note"><?php esc_html_e("Your changes have been saved.", "folders") ?></div>
432
- </div>
433
- <?php } if(isset($_GET['note']) && $_GET['note'] == 2) {?>
434
- <div class="folder-notification notice notice-error is-dismissible">
435
- <div class="folder-notification-title"><?php esc_html_e("Folders Deleted", "folders") ?></div>
436
- <div class="folder-notification-note"><?php esc_html_e("All folders has been successfully deleted.", "folders") ?></div>
437
- </div>
438
- <?php } ?>
439
- <?php if($setting_page!="license-key") { ?>
440
- <form action="options.php" method="post" id="setting-form">
441
- <input type="hidden" name="tab_page" value="<?php echo esc_attr($setting_page) ?>">
442
- <?php } ?>
443
- <div class="folders-tabs">
444
- <div class="folder-tab-menu">
445
- <ul>
446
- <li><a class="<?php echo esc_attr(($setting_page=="folder-settings")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=folder-settings") ?>"><?php esc_html_e( 'Folders Settings', WCP_FOLDER ); ?></a></li>
447
- <li><a class="<?php echo esc_attr(($setting_page=="customize-folders")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=customize-folders") ?>"><?php esc_html_e( 'Customize Folders', WCP_FOLDER ); ?></a></li>
448
- <li><a class="<?php echo esc_attr(($setting_page=="folders-import")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=folders-import") ?>"><?php esc_html_e( 'Tools', WCP_FOLDER ); ?></a></li>
449
- <?php if($isInSettings) { ?>
450
- <li><a class="<?php echo esc_attr(($setting_page=="upgrade-to-pro")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=upgrade-to-pro") ?>"><?php esc_html_e( 'Upgrade to Pro', WCP_FOLDER ); ?></a></li>
451
- <?php } ?>
452
- </ul>
453
- </div>
454
- <div class="folder-tab-content">
455
- <div class="tab-content <?php echo esc_attr(($setting_page=="folder-settings")?"active":"") ?>" id="folder-settings">
456
- <div class="accordion-content no-bp">
457
- <div class="accordion-left">
458
- <table class="form-table">
459
- <tboby>
460
- <?php
461
- $post_types = get_post_types( array( ), 'objects' );
462
- $post_array = array("page", "post", "attachment");
463
- foreach ( $post_types as $post_type ) : ?>
464
- <?php
465
- if ( ! $post_type->show_ui) continue;
466
- $is_checked = !in_array( $post_type->name, $options )?"hide-option":"";
467
- $selected_id = (isset($default_folders[$post_type->name]))?$default_folders[$post_type->name]:"all";
468
- $is_exists = WCP_Folders::check_for_setting($post_type->name, "default_folders");
469
- $is_customized = WCP_Folders::check_for_setting($post_type->name, "folders_settings");
470
- if(in_array($post_type->name, $post_array) || $is_customized === true){
471
- ?>
472
- <tr>
473
- <td class="no-padding">
474
- <label label for="folders_<?php echo esc_attr($post_type->name); ?>" class="custom-checkbox">
475
- <input type="checkbox" class="folder-select sr-only" id="folders_<?php echo esc_attr($post_type->name); ?>" name="folders_settings[]" value="<?php echo esc_attr($post_type->name); ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/>
476
- <span></span>
477
- </label>
478
- </td>
479
- <td class="" width="260px">
480
- <label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use Folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?></label>
481
- </td>
482
- <td class="default-folder">
483
- <label class="hide-show-option <?php echo esc_attr($is_checked) ?>" for="folders_for_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Default folder: ', WCP_FOLDER ) ?></label>
484
- </td>
485
- <td>
486
- <select class="hide-show-option <?php echo esc_attr($is_checked) ?>" id="folders_for_<?php echo esc_attr($post_type->name); ?>" name="default_folders[<?php echo esc_attr($post_type->name); ?>]" ?>
487
- <option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option>
488
- <option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option>
489
- <?php
490
- if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) {
491
- foreach ($terms_data[$post_type->name] as $term) {
492
- if(empty($is_exists) || $is_exists === false) {
493
- echo "<option class='pro-select-item' value='folders-pro'>" . esc_attr( $term->name ). " (Pro) 🔑</option>";
494
- } else {
495
- $selected = ( $selected_id == $term->slug ) ? "selected" : "";
496
- echo "<option " . esc_attr( $selected ) . " value='" . esc_attr( $term->slug ) . "'>" . esc_attr( $term->name ) . "</option>";
497
- }
498
- }
499
- } ?>
500
- </select>
501
- </td>
502
- </tr>
503
- <?php
504
- } else {
505
- $show_media_details = "off";
506
- ?>
507
- <tr>
508
- <td style="padding: 15px 10px 15px 0px" colspan="4">
509
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
510
- <label for="" class="custom-checkbox send-user-to-pro">
511
- <input disabled type="checkbox" class="sr-only" name="customize_folders[show_media_details]" id="show_media_details" value="on" <?php checked($show_media_details, "on") ?>>
512
- <span></span>
513
- </label>
514
- <label for="" class="send-user-to-pro">
515
- <?php esc_html_e( 'Use Folders with: ', WCP_FOLDER )." ".esc_html_e($post_type->label); ?>
516
- <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button>
517
- </label>
518
- </a>
519
- </td>
520
- </tr>
521
- <?php }
522
- endforeach; ?>
523
- <?php
524
- $show_in_page = !isset($customize_folders['folders_enable_replace_media'])?"yes":$customize_folders['folders_enable_replace_media'];
525
- ?>
526
- <tr>
527
- <td class="no-padding">
528
- <input type="hidden" name="customize_folders[folders_enable_replace_media]" value="no">
529
- <label for="folders_enable_replace_media" class="custom-checkbox">
530
- <input id="folders_enable_replace_media" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[folders_enable_replace_media]" value="yes">
531
- <span></span>
532
- </label>
533
- </td>
534
- <td colspan="3">
535
- <label for="folders_enable_replace_media" ><?php esc_html_e( 'Enable Replace Media', WCP_FOLDER ); ?> <span class="folder-tooltip" data-title="<?php esc_html_e("The Replace Media feature will allow you to replace your media files throughout your website with the click of a button, which means the file will be replaced for all your posts, pages, etc ", "folders") ?>"><span class="dashicons dashicons-editor-help"></span></span></label>
536
- </td>
537
- </tr>
538
- <?php
539
- $show_in_page = !isset($customize_folders['show_folder_in_settings'])?"no":$customize_folders['show_folder_in_settings'];
540
- ?>
541
- <tr>
542
- <td class="no-padding">
543
- <input type="hidden" name="customize_folders[show_folder_in_settings]" value="no">
544
- <label for="show_folder_in_settings" class="custom-checkbox">
545
- <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">
546
- <span></span>
547
- </label>
548
- </td>
549
- <td colspan="3">
550
- <label for="show_folder_in_settings" ><?php esc_html_e( 'Place the Folders settings page nested under "Settings"', WCP_FOLDER ); ?></label>
551
- </td>
552
- </tr>
553
- <?php $val = get_option("folders_show_in_menu"); ?>
554
- <input type="hidden" name="folders_show_in_menu" value="off" />
555
- <tr>
556
- <td width="20" class="no-padding">
557
- <label for="folders_show_in_menu" class="custom-checkbox">
558
- <input class="sr-only" type="checkbox" id="folders_show_in_menu" name="folders_show_in_menu" value="on" <?php checked($val, "on") ?>/>
559
- <span></span>
560
- </label>
561
- </td>
562
- <td colspan="3">
563
- <label for="folders_show_in_menu" ><?php esc_html_e( 'Show the folders also in WordPress menu', WCP_FOLDER ); ?></label>
564
- </td>
565
- </tr>
566
- <!-- Do not make changes here, Only for Free -->
567
- <tr>
568
- <td style="padding: 15px 10px 15px 0px" colspan="4">
569
- <input type="hidden" name="folders_settings1" value="folders">
570
- <?php
571
- $show_media_details = !isset($customize_folders['show_media_details'])?"on":$customize_folders['show_media_details'];
572
- $show_media_details = "off";
573
- ?>
574
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
575
- <label for="" class="custom-checkbox send-user-to-pro">
576
- <input disabled type="checkbox" class="sr-only" name="customize_folders[show_media_details]" id="show_media_details" value="on" <?php checked($show_media_details, "on") ?>>
577
- <span></span>
578
- </label>
579
- <label for="" class="send-user-to-pro">
580
- <?php esc_html_e("Show media details on hover", "folders"); ?>
581
- <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button>
582
- <span class="html-tooltip bottom">
583
- <span class="dashicons dashicons-editor-help"></span>
584
- <span class="tooltip-text top" style="">
585
- Show useful metadata including title, size, type, date, dimension & more on hover.
586
- <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/folders-media.gif") ?>">
587
- </span>
588
- </span>
589
- </label>
590
- </a>
591
- </td>
592
- </tr>
593
- </tboby>
594
- </table>
595
- <input type="hidden" name="customize_folders[show_media_details]" value="off">
596
- <div class="media-details">
597
- <div class="">
598
- <?php
599
- $media_settings = array(
600
- 'image_title' => array(
601
- "title" => esc_html__("Title", "folders"),
602
- "default" => "on",
603
- ),
604
- 'image_alt_text' => array(
605
- "title" => esc_html__("Alternative Text", "folders"),
606
- "default" => "off",
607
- ),
608
- 'image_file_url' => array(
609
- "title" => esc_html__("File URL", "folders"),
610
- "default" => "off",
611
- ),
612
- 'image_dimensions' => array(
613
- "title" => esc_html__("Dimensions", "folders"),
614
- "default" => "on",
615
- ),
616
- 'image_size' => array(
617
- "title" => esc_html__("Size", "folders"),
618
- "default" => "off",
619
- ),
620
- 'image_file_name' => array(
621
- "title" => esc_html__("Filename", "folders"),
622
- "default" => "off",
623
- ),
624
- 'image_type' => array(
625
- "title" => esc_html__("Type", "folders"),
626
- "default" => "on",
627
- ),
628
- 'image_date' => array(
629
- "title" => esc_html__("Date", "folders"),
630
- "default" => "on",
631
- ),
632
- 'image_uploaded_by' => array(
633
- "title" => esc_html__("Uploaded by", "folders"),
634
- "default" => "off",
635
- )
636
- );
637
- $media_col_settings = isset($customize_folders['media_col_settings']) && is_array($customize_folders['media_col_settings'])?$customize_folders['media_col_settings']:array("image_title","image_dimensions","image_type","image_date");
638
- ?>
639
- <input type="hidden" name="customize_folders[media_col_settings][]" value="all">
640
- <div class="media-setting-box active send-user-to-pro" >
641
- <div class="normal-box">
642
- <select disabled multiple="multiple" name="customize_folders[media_col_settings][]" class="select2-box">
643
- <?php foreach($media_settings as $key=>$media) {
644
- $selected = $media['default'];
645
- ?>
646
- <option <?php selected($selected, "on") ?> value="<?php echo esc_attr($key) ?>"><?php echo esc_attr($media['title']) ?></option>
647
- <?php } ?>
648
- </select>
649
- </div>
650
- <a class="upgrade-box" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
651
- <button type="button"><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button>
652
- </a>
653
- </div>
654
- </div>
655
- </div>
656
- </div>
657
- <div class="accordion-right">
658
- <div class="premio-help">
659
- <a href="https://premio.io/help/folders/?utm_source=pluginspage" target="_blank">
660
- <div class="premio-help-btn">
661
- <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/premio-help.png") ?>" alt="Premio Help" class="Premio Help" />
662
- <div class="need-help">Need Help</div>
663
- <div class="visit-our">Visit our</div>
664
- <div class="knowledge-base">knowledge base</div>
665
- </div>
666
- </a>
667
- </div>
668
- </div>
669
- <div class="clear"></div>
670
- <div class="submit-button">
671
- <?php submit_button(); ?>
672
- </div>
673
- </div>
674
- </div>
675
- <div class="tab-content <?php echo esc_attr(($setting_page=="customize-folders")?"active":"") ?>" id="customize-folders">
676
- <div class="accordion-content">
677
- <div class="accordion-left">
678
- <table class="form-table">
679
- <?php
680
- $colors = array(
681
- "#FA166B",
682
- "#0073AA",
683
- "#484848"
684
- );
685
- $color = !isset($customize_folders['new_folder_color'])||empty($customize_folders['new_folder_color'])?"#FA166B":$customize_folders['new_folder_color'];
686
- $setting_color = WCP_Folders::check_for_setting("new_folder_color", "customize_folders");
687
- ?>
688
- <tr>
689
- <td width="255px" class="no-padding">
690
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
691
- <label for="new_folder_color" ><b>"New Folder"</b> button color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button></label>
692
- </a>
693
- </td>
694
- <td>
695
- <ul class="color-list">
696
- <?php $field_name = "new_folder_color"; foreach ($colors as $key=>$value) { ?>
697
- <li>
698
- <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
699
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
700
- <span style="background: <?php echo esc_attr($value) ?>"></span>
701
- </label>
702
- </li>
703
- <?php } $key = 3; ?>
704
- <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
705
- <li>
706
- <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
707
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
708
- <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
709
- </label>
710
- </li>
711
- <?php } ?>
712
- <li>
713
- <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
714
- <span class="color-box"><span class="gradient"></span> <span class="color-box-area">Custom</span></span>
715
- <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
716
- </a>
717
- </li>
718
- </ul>
719
- </td>
720
- <td rowspan="4" >
721
-
722
- </td>
723
- </tr>
724
- <?php
725
- $color = !isset($customize_folders['bulk_organize_button_color'])||empty($customize_folders['bulk_organize_button_color'])?"#FA166B":$customize_folders['bulk_organize_button_color'];
726
- $setting_color = WCP_Folders::check_for_setting("bulk_organize_button_color", "customize_folders");
727
- ?>
728
- <tr>
729
- <td class="no-padding">
730
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
731
- <label for="bulk_organize_button_color" ><b>"Bulk Organize"</b> button color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button></label>
732
- </a>
733
- </td>
734
- <td>
735
- <ul class="color-list">
736
- <?php $field_name = "bulk_organize_button_color"; foreach ($colors as $key=>$value) { ?>
737
- <li>
738
- <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
739
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
740
- <span style="background: <?php echo esc_attr($value) ?>"></span>
741
- </label>
742
- </li>
743
- <?php } $key = 3; ?>
744
- <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
745
- <li>
746
- <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
747
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
748
- <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
749
- </label>
750
- </li>
751
- <?php } ?>
752
- <li>
753
- <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
754
- <span class="color-box"><span class="gradient"></span> <span class="color-box-area">Custom</span></span>
755
- <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
756
- </a>
757
- </li>
758
- </ul>
759
- </td>
760
- </tr>
761
- <?php
762
- $color = !isset($customize_folders['media_replace_button'])||empty($customize_folders['media_replace_button'])?"#FA166B":$customize_folders['media_replace_button'];
763
- $setting_color = WCP_Folders::check_for_setting("media_replace_button", "customize_folders");
764
- ?>
765
- <tr>
766
- <td class="no-padding">
767
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
768
- <label for="media_replace_button" ><b>"Replace File"</b> media library button <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button></label>
769
- </a>
770
- </td>
771
- <td>
772
- <ul class="color-list">
773
- <?php $field_name = "media_replace_button"; foreach ($colors as $key=>$value) { ?>
774
- <li>
775
- <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
776
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
777
- <span style="background: <?php echo esc_attr($value) ?>"></span>
778
- </label>
779
- </li>
780
- <?php } $key = 3; ?>
781
- <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
782
- <li>
783
- <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
784
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
785
- <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
786
- </label>
787
- </li>
788
- <?php } ?>
789
- <li>
790
- <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
791
- <span class="color-box"><span class="gradient"></span> <span class="color-box-area">Custom</span></span>
792
- <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
793
- </a>
794
- </li>
795
- </ul>
796
- </td>
797
- </tr>
798
- <?php
799
- $color = !isset($customize_folders['dropdown_color'])||empty($customize_folders['dropdown_color'])?"#484848":$customize_folders['dropdown_color'];
800
- $setting_color = WCP_Folders::check_for_setting("dropdown_color", "customize_folders");
801
- ?>
802
- <tr>
803
- <td class="no-padding">
804
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
805
- <label for="dropdown_color" >Dropdown color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button></label>
806
- </a>
807
- </td>
808
- <td>
809
- <ul class="color-list">
810
- <?php $field_name = "dropdown_color"; foreach ($colors as $key=>$value) { ?>
811
- <li>
812
- <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
813
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
814
- <span style="background: <?php echo esc_attr($value) ?>"></span>
815
- </label>
816
- </li>
817
- <?php } $key = 3; ?>
818
- <?php if($setting_color !== false && $setting_color != "#484848") { ?>
819
- <li>
820
- <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
821
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
822
- <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
823
- </label>
824
- </li>
825
- <?php } ?>
826
- <li>
827
- <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
828
- <span class="color-box"><span class="gradient"></span> <span class="color-box-area">Custom</span></span>
829
- <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
830
- </a>
831
- </li>
832
- </ul>
833
- </td>
834
- </tr>
835
- <?php
836
- $color = !isset($customize_folders['folder_bg_color'])||empty($customize_folders['folder_bg_color'])?"#FA166B":$customize_folders['folder_bg_color'];
837
- $setting_color = WCP_Folders::check_for_setting("folder_bg_color", "customize_folders");
838
- ?>
839
- <tr>
840
- <td class="no-padding">
841
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
842
- <label for="folder_bg_color" >Folders background color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button></label>
843
- </a>
844
- </td>
845
- <td>
846
- <ul class="color-list">
847
- <?php $field_name = "folder_bg_color"; foreach ($colors as $key=>$value) { ?>
848
- <li>
849
- <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
850
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
851
- <span style="background: <?php echo esc_attr($value) ?>"></span>
852
- </label>
853
- </li>
854
- <?php } $key = 3; ?>
855
- <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
856
- <li>
857
- <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
858
- <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
859
- <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
860
- </label>
861
- </li>
862
- <?php } ?>
863
- <li>
864
- <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
865
- <span class="color-box"><span class="gradient"></span> <span class="color-box-area">Custom</span></span>
866
- <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
867
- </a>
868
- </li>
869
- </ul>
870
- </td>
871
- </tr>
872
- <?php
873
- $font = !isset($customize_folders['folder_font'])||empty($customize_folders['folder_font'])?"":$customize_folders['folder_font'];
874
- $setting_font = WCP_Folders::check_for_setting("folder_font", "customize_folders");
875
- $index = 0;
876
- ?>
877
- <tr>
878
- <td class="no-padding">
879
- <label for="folder_font" >
880
- <?php if($setting_font !== false && $setting_font != "" && !in_array($setting_font, array("Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"))) {
881
- esc_html_e("Folders font", WCP_FOLDER);
882
- } else { ?>
883
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
884
- <?php esc_html_e( 'Folders font', WCP_FOLDER ) ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button>
885
- </a>
886
- <?php } ?>
887
- </label>
888
- </td>
889
- <td colspan="2">
890
- <select name="customize_folders[folder_font]" id="folder_font" >
891
- <?php $group = '';
892
- foreach ($fonts as $key => $value):
893
- $title = $key;
894
- if($index == 0) {
895
- $key = "";
896
- }
897
- $index++;
898
- if ($value != $group) {
899
- echo '<optgroup label="' . $value . '">';
900
- $group = $value;
901
- }
902
- if(($setting_font !== false && $setting_font != "" && !in_array($setting_font, array("Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"))) || $value != "Google Fonts" ) { ?>
903
- <option value="<?php echo $key; ?>" <?php selected($font, $key); ?>><?php echo $title; ?></option>
904
- <?php } else { ?>
905
- <option class="pro-select-item" value="folders-pro"><?php echo $title; ?> (Pro) 🔑</option>
906
- <?php } ?>
907
- <?php endforeach; ?>
908
- </select>
909
- </td>
910
- </tr>
911
- <?php
912
- $size = ! isset( $customize_folders['folder_size'] ) || empty( $customize_folders['folder_size'] ) ? "16" : $customize_folders['folder_size'];
913
- $folder_size = WCP_Folders::check_for_setting("folder_size", "customize_folders");
914
- ?>
915
- <tr>
916
- <td class="no-padding">
917
- <label for="folder_size" >
918
- <?php if($folder_size === false || intval($folder_size) === 16) { ?>
919
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
920
- <?php esc_html_e( 'Folders size', WCP_FOLDER ) ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button>
921
- </a>
922
- <?php } else { ?>
923
- <?php esc_html_e("Folders size", WCP_FOLDER); ?>
924
- <?php } ?>
925
- </label>
926
- </td>
927
- <td colspan="2">
928
- <?php
929
- if($folder_size === false || intval($folder_size) == 16) {
930
- $sizes = array(
931
- "folders-pro" => "Small (Pro) 🔑",
932
- "16" => "Medium",
933
- "folders-pro-item" => "Large (Pro) 🔑"
934
- );
935
- $size = 16;
936
- } else {
937
- $sizes = array(
938
- "12" => "Small",
939
- "16" => "Medium",
940
- "20" => "Large"
941
- );
942
- }
943
- ?>
944
- <select name="customize_folders[folder_size]" id="folder_size" >
945
- <?php
946
- foreach ($sizes as $key=>$value) {
947
- $selected = ($key == $size)?"selected":"";
948
- echo "<option ".$selected." value='".$key."'>".$value."</option>";
949
- }
950
- ?>
951
- </select>
952
- </td>
953
- </tr>
954
- <?php
955
- $show_in_page = isset($customize_folders['show_in_page'])?$customize_folders['show_in_page']:"hide";
956
- $show_folder = WCP_Folders::check_for_setting("show_in_page", "customize_folders");
957
- if(empty($show_in_page)) {
958
- $show_in_page = "hide";
959
- }
960
- ?>
961
- <tr>
962
- <td colspan="3" style="padding: 15px 20px 15px 0">
963
- <input type="hidden" name="customize_folders[show_in_page]" value="hide">
964
- <?php if($show_folder === false || $show_folder === "hide") { ?>
965
- <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
966
- <label for="" class="custom-checkbox send-user-to-pro">
967
- <input disabled type="checkbox" class="sr-only" name="customize_folders[show_in_page]" id="show_in_page" value="on" <?php checked($show_in_page, "show") ?>>
968
- <span></span>
969
- </label>
970
- <label for="" class="send-user-to-pro">
971
- <?php esc_html_e("Show Folders in upper position", "folders"); ?>
972
- <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", WCP_FOLDER) ?></button>
973
- </label>
974
- </a>
975
- <?php } else { ?>
976
- <div class="custom-checkbox">
977
- <input id="show_folders" class="sr-only" <?php checked($show_in_page, "show") ?> type="checkbox" name="customize_folders[show_in_page]" value="show">
978
- <span></span>
979
- </div>
980
- <label for="show_folders">Show Folders in upper position</label>
981
- <?php } ?>
982
- </td>
983
- </tr>
984
- </table>
985
- </div>
986
- <div class="accordion-right">
987
- <div class="preview-text">
988
- Preview
989
- <div class="preview-text-info">See the full functionality on your media library, posts, pages, and custom posts</div>
990
- </div>
991
- <div class="preview-inner-box">
992
- <div class="preview-box">
993
- <div class="wcp-custom-form">
994
- <div class="form-title">
995
- Folders
996
- <a href="javascript:;" class="add-new-folder" id="add-new-folder">
997
- <span class="create_new_folder"><i class="pfolder-add-folder"></i></span>
998
- <span>New Folder</span>
999
- </a>
1000
- <div class="clear"></div>
1001
- </div>
1002
- <div class="form-options">
1003
- <ul>
1004
- <li>
1005
- <div class="custom-checkbox">
1006
- <input type="checkbox" class="sr-only" >
1007
- <span></span>
1008
- </div>
1009
- </li>
1010
- <li>
1011
- <a href="javascript:;" id="inline-update"><span class="icon pfolder-edit-folder"><span class="path2"></span></span> <span class="text">Rename</span> </a>
1012
- </li>
1013
- <li>
1014
- <a href="javascript:;" id="inline-remove"><span class="icon pfolder-remove"></span> <span class="text">Delete</span> </a>
1015
- </li>
1016
- <li class="last">
1017
- <a href="javascript:;" id="expand-collapse-list" data-tooltip="Expand"><span class="icon pfolder-arrow-down"></span></a>
1018
- </li>
1019
- <li class="last">
1020
- <a href="javascript:;" ><span class="icon pfolder-arrow-sort"></span></a>
1021
- </li>
1022
- </ul>
1023
- </div>
1024
- </div>
1025
- <div class="shadow-box">
1026
- <div class="header-posts">
1027
- <a href="javascript:;" class="all-posts active-item-link">All Files <span class="total-count">215</span></a>
1028
- </div>
1029
- <div class="un-categorised-items ui-droppable">
1030
- <a href="javascript:;" class="un-categorized-posts">Unassigned Files <span class="total-count total-empty">191</span> </a>
1031
- </div>
1032
- <div class="separator"></div>
1033
- <ul class="folder-list">
1034
- <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span>Folder 1</span><span class="total-count">20</span><span class="clear"></span></a></li>
1035
- <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span>Folder 2</span><span class="total-count">13</span><span class="clear"></span></a></li>
1036
- <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span>Folder 3</span><span class="total-count">5</span><span class="clear"></span></a></li>
1037
- </ul>
1038
- <div class="separator"></div>
1039
- <div class="media-buttons">
1040
- <select class="media-select">
1041
- <option>All Files</option>
1042
- <option>Folder 1</option>
1043
- <option>Folder 2</option>
1044
- <option>Folder 3</option>
1045
- </select>
1046
- <button type="button" class="button organize-button">Bulk Organize</button>
1047
- <div style="clear: both;"></div>
1048
- </div>
1049
- </div>
1050
- </div>
1051
- </div>
1052
- </div>
1053
- <div class="clear"></div>
1054
- <?php submit_button(); ?>
1055
- </div>
1056
- </div>
1057
- <div class="tab-content <?php echo esc_attr(($setting_page=="folders-import")?"active":"") ?>" id="folder-import">
1058
- <?php
1059
- $remove_folders_when_removed = !isset($customize_folders['remove_folders_when_removed'])?"off":$customize_folders['remove_folders_when_removed'];
1060
- ?>
1061
- <input type="hidden" name="customize_folders[remove_folders_when_removed]" value="off" />
1062
- <div class="folder-danger-zone">
1063
- <table class="import-export-table">
1064
- <?php if($is_plugin_exists) { ?>
1065
- <tr class="has-other-plugins">
1066
- <td>
1067
- <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Export/Import", "folders"); ?></span>
1068
- <span class="folder-text"><span><?php esc_html_e("External folders found.", "folders"); ?></span> <?php esc_html_e("Click import to start importing external folders.", "folders"); ?></span>
1069
- </td>
1070
- <td class="last-td">
1071
- <a href="#" class="import-folders-button"><?php esc_html_e("Import", "folders"); ?></a>
1072
- </td>
1073
- </tr>
1074
- <?php } ?>
1075
- <tr class="no-more-plugins <?php echo (!$is_plugin_exists)?"active":"" ?>">
1076
- <td>
1077
- <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Export/Import", "folders"); ?></span>
1078
- <span class="folder-text"><?php esc_html_e("Couldn't detect any external folders that can be imported. Please contact us if you have external folders that were not detected", "folders"); ?></span>
1079
- </td>
1080
- <td class="last-td">
1081
- <a href="https://premio.io/contact/" target="_blank" class="contact-folders-button"><?php esc_html_e("Contact Us", "folders"); ?></a>
1082
- </td>
1083
- </tr>
1084
- <tr>
1085
- <td colspan="2"><span class="danzer-title"><span class="dashicons dashicons-warning"></span> <?php esc_html_e("Danger Zone", "folders"); ?></span></td>
1086
- </tr>
1087
- <tr>
1088
- <td>
1089
- <span class="danger-info"><?php esc_html_e("Delete plugin data upon deletion", "folders"); ?></span>
1090
- <span class="danger-data"><?php esc_html_e("Delete all folders when the plugin is removed. This feature will remove all existing folders created by the plugin upon deletion.", "folders"); ?> <b><?php esc_html_e("(Not recommended)", "folders"); ?></span></b>
1091
- </td>
1092
- <td class="last-td" >
1093
- <div class="inline-checkbox">
1094
- <label class="folder-switch" for="remove_folders_when_removed">
1095
- <input type="checkbox" class="sr-only change-folder-status" name="customize_folders[remove_folders_when_removed]" id="remove_folders_when_removed" value="on" <?php checked($remove_folders_when_removed, "on") ?>>
1096
- <div class="folder-slider round"></div>
1097
- </label>
1098
- </div>
1099
- </td>
1100
- </tr>
1101
- <tr>
1102
- <td>
1103
- <span class="danger-info"><?php esc_html_e("Manual Data Removal", "folders"); ?></span>
1104
- <span class="danger-data"><?php esc_html_e("Delete all folders data manually This feature will remove all existing folders created by the plugin. Use this feature with caution.", "folders"); ?>
1105
- </td>
1106
- <td class="last-td">
1107
- <a href="#" class="remove-folders-data"><?php esc_html_e("Delete Now", "folders"); ?></a>
1108
- </td>
1109
- </tr>
1110
- </table>
1111
- </div>
1112
- </div>
1113
- <div class="tab-content <?php echo esc_attr(($setting_page=="license-key")?"active":"") ?>">
1114
- <?php if($setting_page=="license-key") { ?>
1115
- <?php
1116
- $type = filter_input(INPUT_GET, 'm', FILTER_SANITIZE_STRING);
1117
- if(isset($type) && !empty($type)) {
1118
- switch ($type) {
1119
- case "error": ?>
1120
- <div class='folder-error-message'><?php esc_attr_e("Your license key is not valid",WCP_FOLDER ) ?></div>
1121
- <?php break;
1122
- case "valid": ?>
1123
- <div class='folder-success-message'><?php esc_attr_e("Your license key is activated successfully",WCP_FOLDER ) ?></div>
1124
- <?php break;
1125
- case "unactivated": ?>
1126
- <div class='folder-success-message'><?php esc_attr_e("Your license key is deactivated successfully",WCP_FOLDER ) ?></div>
1127
- <?php break;
1128
- case "expired": ?>
1129
- <div class='folder-error-message'><?php esc_attr_e("Your license has been expired",WCP_FOLDER ) ?></div>
1130
- <?php break;
1131
- case "no_activations": ?>
1132
- <div class='folder-error-message'><?php esc_attr_e("Your license was activated for another domain, please visit your ",WCP_FOLDER ) ?><a target="_blank" href="https://go.premio.io"><?php esc_attr_e("Premio account",WCP_FOLDER ) ?></a></div>
1133
- <?php break;
1134
- }
1135
- }
1136
- ?>
1137
- <div class="key-table">
1138
- <div class="license-key-footer">
1139
- <?php
1140
- $licenseKey = get_option("wcp_folder_license_key");
1141
- $licenseData = array();
1142
- $active_status = 0;
1143
- delete_transient("folder_license_key_data");
1144
- if(!empty($licenseKey)) {
1145
- $licenseData = $this->get_license_key_data($licenseKey);
1146
- if(!empty($licenseData)) {
1147
- if($licenseData['license'] == "valid") {
1148
- $active_status = 1;
1149
- } else if($licenseData['license'] == "expired") {
1150
- $active_status = 2;
1151
- }
1152
- } else {
1153
- $licenseKey = "";
1154
- }
1155
- }
1156
- if(!$active_status) {
1157
- esc_attr_e("To receive updates, please enter your valid license key.", WCP_FOLDER );
1158
- } else if ($active_status == 1 && $licenseData['expires'] == "lifetime") {
1159
- esc_attr_e("You have a lifetime license", WCP_FOLDER);
1160
- } else if($active_status == 1 ){
1161
- esc_attr_e("Your license will expire on ".date("d M, Y",strtotime($licenseData['expires'])));
1162
- } else if($active_status == 2 ){
1163
- $url = WCP_PRO_FOLDER_API_URL.'/checkout/?edd_license_key='.$licenseKey."&download_id=".WCP_PRO_FOLDER_PR0DUCT_ID; ?>
1164
- <span class='error-message'><?php esc_attr_e("Your license has been expired on ", WCP_FOLDER).esc_attr(date("d M, Y",strtotime($licenseData['expires']))) ?></span><a target="_blank" href="<?php echo esc_url($url) ?>" class="button button-primary" ><?php esc_attr_e("Renew Now", WCP_FOLDER ) ?></a> <?php
1165
- }
1166
- ?>
1167
- </div>
1168
- <form action="" id="license_key_form">
1169
- <div class="input-field">
1170
- <label for="license_key"><?php esc_attr_e("License Key", WCP_FOLDER ) ?></label>
1171
- <input class="license-key" id="license_key" name="license_key" value="<?php echo esc_attr($licenseKey) ?>">
1172
- </div>
1173
- <div class="submit">
1174
- <?php if($active_status != 0) { ?>
1175
- <a href="javascript:;" class="button secondary-button" id="deactivate_key"><?php esc_attr_e("Deactivate Key", WCP_FOLDER ) ?></a>
1176
- <?php } ?>
1177
- <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_attr_e("Activate Key", WCP_FOLDER ) ?>">
1178
- </div>
1179
- </form>
1180
- </div>
1181
- <?php } ?>
1182
- </div>
1183
- </div>
1184
- </div>
1185
- <?php
1186
- ?>
1187
- <input type="hidden" name="folder_nonce" value="<?php echo wp_create_nonce("folder_settings") ?>">
1188
- <input type="hidden" name="folder_page" value="<?php echo $_SERVER['REQUEST_URI'] ?>">
1189
- <?php if($setting_page!="upgrade-to-pro") { ?>
1190
- </form>
1191
- <?php } ?>
1192
- </div>
1193
-
1194
- <div class="folder-popup-form" id="import-plugin-data">
1195
- <div class="popup-form-content">
1196
- <div class="popup-content">
1197
- <div class="close-popup-button">
1198
- <a class="" href="javascript:;"><span></span></a>
1199
- </div>
1200
- <div class="import-folder-title"></div>
1201
- <div class="import-folder-note">Are you sure you'd like to import $x folders from $plugin?</div>
1202
- <div class="folder-form-buttons">
1203
- <button type="submit" class="form-submit-btn" id="import-folder-button"><?php esc_html_e("Import", WCP_FOLDER); ?></button>
1204
- <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", WCP_FOLDER); ?></a>
1205
- </div>
1206
- </div>
1207
- </div>
1208
- </div>
1209
-
1210
- <?php //if($plugin['is_exists']) { ?>
1211
- <div class="folder-popup-form" id="import-folders-popup">
1212
- <div class="popup-form-content">
1213
- <div class="popup-content">
1214
- <div class="close-popup-button">
1215
- <a class="" href="javascript:;"><span></span></a>
1216
- </div>
1217
- <div class="import-plugin-title"><?php esc_html_e("Import data", WCP_FOLDER); ?></div>
1218
- <div class="plugin-import-table">
1219
- <div class="import-folder-table">
1220
- <table>
1221
- <tbody>
1222
- <?php foreach ($plugin_info as $slug=>$plugin) { ?>
1223
- <?php if($plugin['is_exists']) { ?>
1224
- <tr class="other-plugins-<?php echo esc_attr__($slug) ?>" data-plugin="<?php echo esc_attr__($slug) ?>" data-nonce="<?php echo wp_create_nonce("import_data_from_".$slug) ?>" data-folders="<?php echo esc_attr($plugin['total_folders']) ?>" data-attachments="<?php echo esc_attr($plugin['total_attachments']) ?>">
1225
- <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th>
1226
- <td>
1227
- <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".$plugin['total_folders']."</b>", ($plugin['total_folders']>1)?esc_html__("s"):"" ,"<b>".$plugin['total_attachments']."</b>", ($plugin['total_attachments']>1)?esc_html__("s"):"") ?></span>
1228
- <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button>
1229
- <button type="button" class="button button-secondary remove-folder-data in-popup"><?php esc_html_e("Delete plugin data", "folders"); ?> <span class="spinner"></span></button>
1230
- </td>
1231
- </tr>
1232
- <?php } ?>
1233
- <?php } ?>
1234
- </tbody>
1235
- </table>
1236
- </div>
1237
- </div>
1238
- <div class="folder-form-buttons">
1239
- <div class=""></div>
1240
- <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Close", WCP_FOLDER); ?></a>
1241
- </div>
1242
- </div>
1243
- </div>
1244
- </div>
1245
- <?php //} ?>
1246
-
1247
- <div class="folder-popup-form" id="remove-plugin-data">
1248
- <div class="popup-form-content">
1249
- <div class="popup-content">
1250
- <div class="close-popup-button">
1251
- <a class="" href="javascript:;"><span></span></a>
1252
- </div>
1253
- <div class="remove-folder-title">Are you sure?</div>
1254
- <div class="remove-folder-note">You're about to delete $plugin's folders. Are you sure you'd like to proceed?</div>
1255
- <div class="folder-form-buttons">
1256
- <button type="submit" class="form-submit-btn delete-folder-plugin" id="remove-folder-button"><?php esc_html_e("Delete plugin data", WCP_FOLDER); ?></button>
1257
- <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", WCP_FOLDER); ?></a>
1258
- </div>
1259
- </div>
1260
- </div>
1261
- </div>
1262
-
1263
- <div class="folder-popup-form remove-folders-box" id="remove-folders-data-box">
1264
- <div class="popup-form-content">
1265
- <div class="popup-content">
1266
- <div class="close-popup-button close-remove-folders">
1267
- <a class="" href="javascript:;"><span></span></a>
1268
- </div>
1269
- <div class="remove-folder-title"><?php esc_html_e("Are you sure?", WCP_FOLDER); ?></div>
1270
- <div class="remove-folder-note"><?php echo sprintf(esc_html__("Folders will remove all created folders once you remove the plugin. We recommend you %s if you plan to use Folders in future.", WCP_FOLDER), "<b>".esc_html__("not to use this feature", WCP_FOLDER)."</b>"); ?></div>
1271
- <div class="folder-form-buttons">
1272
- <a href="javascript:;" class="form-cancel-btn cancel-folders"><?php esc_html_e("Cancel", WCP_FOLDER); ?></a>
1273
- <button type="submit" class="form-cancel-btn delete-button"><?php esc_html_e("I want to delete anyway", WCP_FOLDER); ?></button>
1274
- </div>
1275
- </div>
1276
- </div>
1277
- </div>
1278
-
1279
- <div class="folder-popup-form" id="remove-confirmation-box">
1280
- <div class="popup-form-content">
1281
- <div class="popup-content">
1282
- <form id="remove_folders_data" autocomplete="off" >
1283
- <div class="close-popup-button">
1284
- <a class="" href="javascript:;"><span></span></a>
1285
- </div>
1286
- <div class="remove-folder-title"></div>
1287
- <div class="remove-folder-note text-left">
1288
- <b><?php esc_html_e("Type DELETE to confirm", WCP_FOLDER); ?></b>
1289
- <div class="input-box">
1290
- <input autocomplete="off" type="text" id="delete-input" name="delete" >
1291
- </div>
1292
- <div class="delete-confirmation-message"><?php esc_html_e('', WCP_FOLDER); ?></div>
1293
- </div>
1294
- <div class="folder-form-buttons">
1295
- <input type="hidden" name="nonce" id="remove-folder-nonce" value="<?php echo wp_create_nonce("remove_folders_data") ?>">
1296
- <input type="hidden" name="action" value="remove_all_folders_data">
1297
- <button disabled type="submit" class="form-submit-btn delete-button" id="remove-folders-data-button"><?php esc_html_e("Delete", WCP_FOLDER); ?></button>
1298
- <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", WCP_FOLDER); ?></a>
1299
- </div>
1300
- </form>
1301
- </div>
1302
- </div>
1303
- </div>
1304
-
1305
- <?php
1306
- $option = get_option("folder_intro_box");
1307
- if(($option == "show" || get_option("folder_redirect_status") == 2) && $is_plugin_exists) { ?>
1308
- <div class="folder-popup-form" id="import-third-party-plugin-data" style="display: block" ?>
1309
- <div class="popup-form-content">
1310
- <div class="popup-content">
1311
- <div class="close-popup-button">
1312
- <a class="" href="javascript:;"><span></span></a>
1313
- </div>
1314
- <div class="import-plugin-title"><?php esc_html_e("Import data", WCP_FOLDER); ?></div>
1315
- <div class="import-plugin-note"><?php esc_html_e("We've detected that you use another folders plugin. Would you like the Folders plugin to import your current folders? Keep in mind you can always do it in Folders Settings -> Import", WCP_FOLDER) ?></div>
1316
- <div class="plugin-import-table">
1317
- <div class="import-folder-table">
1318
- <table>
1319
- <tbody>
1320
- <?php foreach ($plugin_info as $slug=>$plugin) {
1321
- if($plugin['is_exists']) { ?>
1322
- <tr class="other-plugins-<?php echo esc_attr__($slug) ?>" data-plugin="<?php echo esc_attr__($slug) ?>" data-nonce="<?php echo wp_create_nonce("import_data_from_".$slug) ?>" data-folders="<?php echo esc_attr($plugin['total_folders']) ?>" data-attachments="<?php echo esc_attr($plugin['total_attachments']) ?>">
1323
- <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th>
1324
- <td>
1325
- <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button>
1326
- <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".$plugin['total_folders']."</b>", ($plugin['total_folders']>1)?esc_html__("s"):"" ,"<b>".$plugin['total_attachments']."</b>", ($plugin['total_attachments']>1)?esc_html__("s"):"") ?></span>
1327
- </td>
1328
- </tr>
1329
- <?php }
1330
- } ?>
1331
- </tbody>
1332
- </table>
1333
- </div>
1334
- </div>
1335
- <div class="folder-form-buttons">
1336
- <div class=""></div>
1337
- <a href="javascript:;" id="cancel-plugin-import" class="form-cancel-btn"><?php esc_html_e("Close", WCP_FOLDER); ?></a>
1338
- </div>
1339
- </div>
1340
- </div>
1341
- </div>
1342
- <?php
1343
- if($option != "show") {
1344
- update_option("folder_redirect_status", 3);
1345
- }
1346
- } ?>
1347
- <div class="folder-popup-form" id="no-more-folder-credit">
1348
- <div class="popup-form-content">
1349
- <div class="popup-content">
1350
- <div class="close-popup-button">
1351
- <a class="" href="javascript:;"><span></span></a>
1352
- </div>
1353
- <div class="add-update-folder-title" id="folder-limitation-message">
1354
- You've reached the 10 folder limitation!
1355
- </div>
1356
- <div class="folder-form-message">
1357
- Unlock unlimited amount of folders by upgrading to one of our pro plans.
1358
- </div>
1359
- <div class="folder-form-buttons">
1360
- <a href="javascript:;" class="form-cancel-btn">Cancel</a>
1361
- <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn">See Pro Plans</a>
1362
- </div>
1363
- </div>
1364
- </div>
1365
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+ ?>
4
+ <!-- do not change here, Free/Pro URL Change -->
5
+ <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/settings.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
6
+ <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/folder-icon.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
7
+ <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/spectrum.min.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
8
+ <?php if($setting_page == "folder-settings") { ?>
9
+ <link rel='stylesheet' href='<?php echo WCP_FOLDER_URL ?>assets/css/select2.min.css?ver=<?php echo WCP_FOLDER_VERSION ?>' type='text/css' media='all' />
10
+ <script type="text/javascript" src='<?php echo WCP_FOLDER_URL ?>assets/js/select2.min.js?ver=<?php echo WCP_FOLDER_VERSION ?>' ></script>
11
+ <?php } ?>
12
+ <script src="<?php echo WCP_FOLDER_URL ?>assets/js/spectrum.min.js"></script>
13
+ <style>
14
+ <?php if ( function_exists( 'is_rtl' ) && is_rtl() ) { ?>
15
+ #setting-form {
16
+ float: right;
17
+ }
18
+ <?php } ?>
19
+ </style>
20
+ <script>
21
+ (function (factory) {
22
+ "use strict";
23
+ if (typeof define === 'function' && define.amd) {
24
+ define(['jquery'], factory);
25
+ }
26
+ else if(typeof module !== 'undefined' && module.exports) {
27
+ module.exports = factory(require('jquery'));
28
+ }
29
+ else {
30
+ factory(jQuery);
31
+ }
32
+ }(function ($, undefined) {
33
+ var selectedItem;
34
+ var importTitle = "<?php esc_html_e("Import folders from %plugin%", "folders"); ?>";
35
+ var importDesc = "<?php esc_html_e("Are you sure you'd like to import %d folders from %plugin%?", "folders"); ?>";
36
+ var removeTitle = "<?php esc_html_e("Are you sure?", "folders"); ?>";
37
+ var removeDesc = "<?php esc_html_e("You're about to delete %plugin%'s folders. Are you sure you'd like to proceed?", "folders"); ?>";
38
+ $(document).ready(function(){
39
+ <?php if($setting_page == "folder-settings") { ?>
40
+ $(".select2-box").select2();
41
+ <?php } ?>
42
+ $(document).on("click",".form-cancel-btn, .close-popup-button, .folder-popup-form",function(){
43
+ if($(this).hasClass("cancel-folders") || $(this).hasClass("remove-folders-box") || $(this).hasClass("close-remove-folders")) {
44
+ $("#remove_folders_when_removed").prop("checked", false);
45
+ setFoldersRemoveStatus("off");
46
+ }
47
+ if($(this).hasClass("delete-button")) {
48
+ setFoldersRemoveStatus("on");
49
+ }
50
+ $(".folder-popup-form").hide();
51
+ });
52
+ $(document).on("click",".import-folders-button", function(e){
53
+ $("#import-folders-popup").show();
54
+ });
55
+ $(document).on("click",".popup-form-content", function(e){
56
+ e.stopPropagation();
57
+ e.stopImmediatePropagation();
58
+ });
59
+ $(document).on("click",".folder-select",function(){
60
+ if($(this).is(":checked")) {
61
+ $(this).closest("tr").find(".hide-show-option").removeClass("hide-option");
62
+ } else {
63
+ $(this).closest("tr").find(".hide-show-option").addClass("hide-option");
64
+ }
65
+ });
66
+ $(document).on("click", ".accordion-header", function(){
67
+ if($(this).hasClass("active")) {
68
+ $(this).closest(".accordion").find(".accordion-content").slideUp();
69
+ $(this).removeClass("active");
70
+ } else {
71
+ $(this).closest(".accordion").find(".accordion-content").slideDown();
72
+ $(this).addClass("active");
73
+ }
74
+ });
75
+ $(document).on("change", ".hide-show-option", function(){
76
+ if($(this).val() == "folders-pro") {
77
+ $(this).find("option").prop("selected", false);
78
+ $(this).find("option:first").prop("selected", true);
79
+ window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank");
80
+ }
81
+ });
82
+ $(document).on("change", "#folder_font", function(){
83
+ if($(this).val() == "folders-pro") {
84
+ $(this).val("").trigger("change");
85
+ window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank");
86
+ }
87
+ });
88
+ $(document).on("change", "#folder_size", function(){
89
+ if($(this).val() == "folders-pro" || $(this).val() == "folders-pro-item") {
90
+ $(this).val("16").trigger("change");
91
+ window.open("<?php echo esc_url($this->getFoldersUpgradeURL()) ?>", "_blank");
92
+ }
93
+ });
94
+ $(".accordion-header:first").trigger("click");
95
+ $("#folder_font, #folder_size").change(function(){
96
+ setCSSProperties();
97
+ });
98
+ $(document).on("click", "input[name='customize_folders[show_media_details]']", function(){
99
+ if($("#show_media_details").is(":checked")) {
100
+ $(".media-setting-box").addClass("active");
101
+ } else {
102
+ $(".media-setting-box").removeClass("active");
103
+ }
104
+ });
105
+ setCSSProperties();
106
+ $('.color-field').spectrum({
107
+ chooseText: "Submit",
108
+ preferredFormat: "hex",
109
+ showInput: true,
110
+ cancelText: "Cancel",
111
+ move: function (color) {
112
+ $(this).val(color.toHexString());
113
+ setCSSProperties();
114
+ },
115
+ change: function (color) {
116
+ $(this).val(color.toHexString());
117
+ setCSSProperties();
118
+ }
119
+ });
120
+ $(document).on("click", "input[name='customize_folders[remove_folders_when_removed]']", function(e){
121
+ if($(this).is(":checked")) {
122
+ $("#remove-folders-data-box").show();
123
+ //setFoldersRemoveStatus("on");
124
+ } else {
125
+ setFoldersRemoveStatus("off");
126
+ }
127
+ })
128
+ $(document).on("click", ".import-folder-data", function(e){
129
+ selectedItem = $(this).closest("tr").data("plugin");
130
+ if(!$(this).hasClass("in-popup")) {
131
+ var pluginName = $(this).closest("tr").find(".plugin-name").html();
132
+ var pluginFolders = parseInt($(this).closest("tr").data("folders"));
133
+ var popupTitle = importTitle.replace("%plugin%", pluginName);
134
+ $(".import-folder-title").html(popupTitle);
135
+ var popupDesc = importDesc.replace("%plugin%", "<b>" + pluginName + "</b>");
136
+ popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>");
137
+ $(".import-folder-note").html(popupDesc);
138
+ $("#import-plugin-data").show();
139
+ } else {
140
+ importPluginData();
141
+ }
142
+ });
143
+ $(document).on("click", ".remove-folders-data", function(e){
144
+ e.preventDefault();
145
+ $("#remove-confirmation-box").show();
146
+ $("#delete-input").focus();
147
+ });
148
+ $(document).on("keyup", "#delete-input", function(){
149
+ if($.trim($(this).val()) != "") {
150
+ var inputVal = $.trim($(this).val()).toLowerCase();
151
+ if (inputVal == "delete") {
152
+ $("#remove-folders-data-button").prop("disabled", false);
153
+ $(".delete-confirmation-message").html("<?php esc_html_e('This will delete all existing folders & settings', 'folders'); ?>");
154
+ } else {
155
+ $("#remove-folders-data-button").prop("disabled", true);
156
+ if (inputVal != "") {
157
+ var textLen = inputVal.length;
158
+ var curStr = ("delete").substring(0, textLen);
159
+ if (curStr != inputVal) {
160
+ $(".delete-confirmation-message").html("<?php esc_html_e('Please type DELETE and click on the "Delete" button to confirm', 'folders'); ?>");
161
+ } else {
162
+ $(".delete-confirmation-message").html("");
163
+ }
164
+ } else {
165
+ $(".delete-confirmation-message").html("");
166
+ }
167
+ }
168
+ } else {
169
+ $(".delete-confirmation-message").html("");
170
+ }
171
+ });
172
+ $(document).on("submit", "#remove_folders_data", function(e){
173
+ e.preventDefault();
174
+ if($.trim($("#delete-input").val()).toLowerCase() == "delete") {
175
+ $.ajax({
176
+ url: "<?php echo admin_url("admin-ajax.php") ?>",
177
+ data: {
178
+ action: 'wcp_remove_all_folders_data',
179
+ nonce: $("#remove-folder-nonce").val()
180
+ },
181
+ type: 'post',
182
+ success: function(res) {
183
+ <?php
184
+ $redirectURL = $this->getFolderSettingsURL();
185
+ if(!empty($redirectURL)) {
186
+ $page = isset($_POST['tab_page'])?$_POST['tab_page']:"";
187
+ $type = filter_input(INPUT_GET, 'setting_page', FILTER_SANITIZE_STRING);
188
+ $type = empty($type)?"":"&setting_page=".$type;
189
+ $redirectURL = $redirectURL.$type;
190
+ if(!empty($page)) {
191
+ $redirectURL .= "&setting_page=".$page;
192
+ }
193
+ }
194
+ $redirectURL = $redirectURL."&note=2";
195
+ ?>
196
+ window.location = "<?php echo $redirectURL ?>";
197
+ }
198
+ });
199
+ }
200
+ return false;
201
+ });
202
+ $(document).on("change", "#delete-input", function(){
203
+ if($.trim($(this).val()).toLowerCase() == "delete") {
204
+ $("#remove-folders-data-button").prop("disabled", false);
205
+ } else {
206
+ $("#remove-folders-data-button").prop("disabled", true);
207
+ }
208
+ });
209
+ /*$(document).on("click", "#remove-folders-data-button", function(e){
210
+ e.preventDefault();
211
+ $(".folder-popup-form").hide();
212
+ $("#remove-confirmation-box").show();
213
+ });*/
214
+ $(document).on("click", "#import-folder-button", function(e){
215
+ importPluginData();
216
+ });
217
+ $(document).on("click", ".remove-folder-data", function(e){
218
+ selectedItem = $(this).closest("tr").data("plugin");
219
+ var pluginName = $(this).closest("tr").find(".plugin-name").html();
220
+ var pluginFolders = parseInt($(this).closest("tr").data("folders"));
221
+ var popupTitle = removeTitle.replace("%plugin%", pluginName);
222
+ $(".remove-folder-title").html(popupTitle);
223
+ var popupDesc = removeDesc.replace("%plugin%", "<b>" + pluginName + "</b>");
224
+ popupDesc = popupDesc.replace("%d", "<b>" + pluginFolders + "</b>");
225
+ $(".remove-folder-note").html(popupDesc);
226
+ $("#remove-plugin-data").show();
227
+ });
228
+ $(document).on("click", "#remove-folder-button", function(){
229
+ removePluginData();
230
+ });
231
+ setTooltipPosition();
232
+
233
+ $(document).on("click", ".checkbox-color", function(){
234
+ setCSSProperties();
235
+ });
236
+
237
+ $(document).on("change", ".checkbox-color", function(){
238
+ setCSSProperties();
239
+ });
240
+ $(document).on("click", "#use_folder_undo", function(){
241
+ if($(this).is(":checked")) {
242
+ $(".timeout-settings").addClass("active");
243
+ } else {
244
+ $(".timeout-settings").removeClass("active");
245
+ }
246
+ });
247
+ $('.enable-replace-media').hover(
248
+ function(){
249
+ //$(this).addClass('hover')
250
+ },
251
+ function(){
252
+ $(this).removeClass('show')
253
+ }
254
+ )
255
+ $('.enable-replace-media .html-tooltip').hover(
256
+ function(){
257
+ $(this).closest(".enable-replace-media").addClass('show')
258
+ },
259
+ function(){
260
+ //$(this).removeClass('show')
261
+ }
262
+ )
263
+ });
264
+
265
+ function setFoldersRemoveStatus(status) {
266
+ $.ajax({
267
+ url: "<?php echo admin_url("admin-ajax.php") ?>",
268
+ data: {
269
+ 'action': 'wcp_update_folders_uninstall_status',
270
+ 'status': status,
271
+ 'nonce': "<?php echo wp_create_nonce("wcp_folders_uninstall_status") ?>"
272
+ },
273
+ type: 'post',
274
+ success: function (res) {
275
+
276
+ }
277
+ });
278
+ }
279
+
280
+ function importPluginData() {
281
+ $("#import-folder-button").addClass("button");
282
+ $("#import-folder-button").prop("disabled", true);
283
+ $(".other-plugins-"+selectedItem+" .import-folder-data").prop("disabled", true);
284
+ $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").addClass("active");
285
+ $.ajax({
286
+ url: "<?php echo admin_url("admin-ajax.php") ?>",
287
+ data: {
288
+ 'plugin': $(".other-plugins-"+selectedItem).data("plugin"),
289
+ 'nonce': $(".other-plugins-"+selectedItem).data("nonce"),
290
+ 'action': 'wcp_import_plugin_folders_data'
291
+ },
292
+ type: 'post',
293
+ success: function(res){
294
+ var response = $.parseJSON(res);
295
+ if(response.status == -1) {
296
+ $(".other-plugins-"+selectedItem+" .import-folder-data").prop("disabled", false);
297
+ $(".other-plugins-"+selectedItem+" .import-folder-data .spinner").removeClass("active");
298
+ $("#import-third-party-plugin-data").hide();
299
+ $("#no-more-folder-credit").show();
300
+ $("#import-folder-button").removeClass("button");
301
+ $("#import-folder-button").prop("disabled", false);
302
+ } else if(response.status) {
303
+ $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("success-import");
304
+ $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove();
305
+ } else {
306
+ $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import");
307
+ $(".other-plugins-"+response.data.plugin+" .import-folder-data").remove();
308
+ }
309
+ $("#import-folder-button").prop("disabled", false);
310
+ $("#import-plugin-data").hide();
311
+ }
312
+ });
313
+ }
314
+
315
+ function removePluginData() {
316
+ $(".other-plugins-"+selectedItem+" .remove-folder-data .spinner").addClass("active");
317
+ $.ajax({
318
+ url: "<?php echo admin_url("admin-ajax.php") ?>",
319
+ data: {
320
+ 'plugin': $(".other-plugins-"+selectedItem).data("plugin"),
321
+ 'nonce': $(".other-plugins-"+selectedItem).data("nonce"),
322
+ 'action': 'wcp_remove_plugin_folders_data'
323
+ },
324
+ type: 'post',
325
+ success: function(res){
326
+ var response = $.parseJSON(res);
327
+ $("#remove-plugin-data").hide();
328
+ if(response.status) {
329
+ $(".other-plugins-"+response.data.plugin).remove();
330
+ } else {
331
+ $(".other-plugins-"+response.data.plugin+" .import-message").html(response.message).addClass("error-import");
332
+ $(".other-plugins-"+response.data.plugin+" .remove-folder-data .spinner").removeClass("active");
333
+ }
334
+
335
+ if($("#import-folders-popup .plugin-import-table tr").length == 0) {
336
+ $("#import-folders-popup").hide();
337
+ $(".has-other-plugins").remove();
338
+ $(".no-more-plugins").addClass("active");
339
+ }
340
+ }
341
+ });
342
+ }
343
+
344
+ function setCSSProperties() {
345
+ if(jQuery("#new_folder_color").length && $("#new_folder_color").val() != "") {
346
+ $("#add-new-folder").css("border-color", $("#new_folder_color").val());
347
+ $("#add-new-folder").css("background-color", $("#new_folder_color").val());
348
+ } else if ($("input[name='customize_folders[new_folder_color]']:checked").length) {
349
+ $("#add-new-folder").css("border-color", $("input[name='customize_folders[new_folder_color]']:checked").val());
350
+ $("#add-new-folder").css("background-color", $("input[name='customize_folders[new_folder_color]']:checked").val());
351
+ }
352
+
353
+ if($("#bulk_organize_button_color").length && $("#bulk_organize_button_color").val() != "") {
354
+ $(".organize-button").css("border-color", $("#bulk_organize_button_color").val());
355
+ $(".organize-button").css("background-color", $("#bulk_organize_button_color").val());
356
+ $(".organize-button").css("color", "#ffffff");
357
+ } else if ($("input[name='customize_folders[bulk_organize_button_color]']:checked").length) {
358
+ $(".organize-button").css("border-color", $("input[name='customize_folders[bulk_organize_button_color]']:checked").val());
359
+ $(".organize-button").css("background-color", $("input[name='customize_folders[bulk_organize_button_color]']:checked").val());
360
+ $(".organize-button").css("color", "#ffffff");
361
+ }
362
+
363
+ if($("#dropdown_color").length && $("#dropdown_color").val() != "") {
364
+ $(".media-select").css("border-color", $("#dropdown_color").val());
365
+ $(".media-select").css("color", $("#dropdown_color").val());
366
+ } else if ($("input[name='customize_folders[dropdown_color]']:checked").length) {
367
+ $(".media-select").css("border-color", $("input[name='customize_folders[dropdown_color]']:checked").val());
368
+ $(".media-select").css("color", $("input[name='customize_folders[dropdown_color]']:checked").val());
369
+ }
370
+
371
+ if($("#folder_bg_color").length && $("#folder_bg_color").val() != "") {
372
+ $(".all-posts.active-item-link").css("border-color", $("#folder_bg_color").val());
373
+ $(".all-posts.active-item-link").css("background-color", $("#folder_bg_color").val());
374
+ $(".all-posts.active-item-link").css("color", "#ffffff");
375
+ } else if ($("input[name='customize_folders[folder_bg_color]']:checked").length) {
376
+ $(".all-posts.active-item-link").css("border-color", $("input[name='customize_folders[folder_bg_color]']:checked").val());
377
+ $(".all-posts.active-item-link").css("background-color", $("input[name='customize_folders[folder_bg_color]']:checked").val());
378
+ $(".all-posts.active-item-link").css("color", "#ffffff");
379
+ }
380
+
381
+ $("#custom-css").html("");
382
+ if($("#folder_font").val() != "") {
383
+ font_val = $("#folder_font").val();
384
+ $('head').append('<link href="https://fonts.googleapis.com/css?family=' + font_val + ':400,600,700" rel="stylesheet" type="text/css" class="chaty-google-font">');
385
+ $('.preview-box').css('font-family', font_val);
386
+ } else {
387
+ $('.preview-box').css('style', "");
388
+ }
389
+ if($("#folder_size").val() != "") {
390
+ $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", $("#folder_size").val()+"px");
391
+ } else {
392
+ $(".folder-list li a span, .header-posts a, .un-categorised-items a").css("font-size", "14px");
393
+ }
394
+ }
395
+
396
+ $(window).on("scroll", function(){
397
+ setTooltipPosition();
398
+ }).on("resize", function(){
399
+ setTooltipPosition();
400
+ });
401
+
402
+ function setTooltipPosition() {
403
+ if($(".html-tooltip:not(.no-position)").length) {
404
+ $(".html-tooltip:not(.no-position)").each(function(){
405
+ if($(this).offset().top - $(window).scrollTop() > 540) {
406
+ $(this).addClass("top").removeClass("side").removeClass("bottom");
407
+ $(this).find(".tooltip-text").attr("style","");
408
+ $(this).find(".tooltip-text").removeClass("hide-arrow");
409
+ } else if($(window).height() - ($(this).offset().top - $(window).scrollTop()) > 460) {
410
+ $(this).addClass("bottom").removeClass("top").removeClass("side");
411
+ $(this).find(".tooltip-text").attr("style","");
412
+ $(this).find(".tooltip-text").removeClass("hide-arrow");
413
+ } else {
414
+ $(this).addClass("side").removeClass("top").removeClass("bottom");
415
+ if($(this).find(".tooltip-text").length) {
416
+ $(this).find(".tooltip-text").attr("style","");
417
+ $(this).find(".tooltip-text").removeClass("hide-arrow");
418
+
419
+ if($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50 < 0) {
420
+ $(this).find(".tooltip-text").css("margin-top", Math.abs($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50)+"px");
421
+ $(this).find(".tooltip-text").addClass("hide-arrow");
422
+ } else {
423
+ $(this).find(".tooltip-text").attr("style","");
424
+ if(($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) > 0) {
425
+ $(this).find(".tooltip-text").css("margin-top", ((-1)*Math.abs($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) - 10)+"px");
426
+ $(this).find(".tooltip-text").addClass("hide-arrow");
427
+ }
428
+ }
429
+ }
430
+ }
431
+ });
432
+ }
433
+ }
434
+ }));
435
+ </script>
436
+ <div id="custom-css">
437
+
438
+ </div>
439
+ <div class="wrap">
440
+ <h1><?php esc_html_e( 'Folders Settings', 'folders'); ?></h1>
441
+ <?php
442
+ settings_fields('folders_settings');
443
+ settings_fields('default_folders');
444
+ settings_fields('customize_folders');
445
+ $options = get_option('folders_settings');
446
+ $default_folders = get_option('default_folders');
447
+ $customize_folders = get_option('customize_folders');
448
+ $default_folders = (empty($default_folders) || !is_array($default_folders))?array():$default_folders;
449
+ do_settings_sections( __FILE__ );
450
+ ?>
451
+ <?php if(isset($_GET['note']) && $_GET['note'] == 1) { ?>
452
+ <div class="folder-notification notice notice-success is-dismissible">
453
+ <div class="folder-notification-title"><?php esc_html_e("Changes Saved", "folders") ?></div>
454
+ <div class="folder-notification-note"><?php esc_html_e("Your changes have been saved.", "folders") ?></div>
455
+ </div>
456
+ <?php } if(isset($_GET['note']) && $_GET['note'] == 2) {?>
457
+ <div class="folder-notification notice notice-error is-dismissible">
458
+ <div class="folder-notification-title"><?php esc_html_e("Folders Deleted", "folders") ?></div>
459
+ <div class="folder-notification-note"><?php esc_html_e("All folders has been successfully deleted.", "folders") ?></div>
460
+ </div>
461
+ <?php } ?>
462
+ <?php if($setting_page!="license-key") { ?>
463
+ <form action="options.php" method="post" id="setting-form">
464
+ <input type="hidden" name="tab_page" value="<?php echo esc_attr($setting_page) ?>">
465
+ <?php } ?>
466
+ <div class="folders-tabs">
467
+ <div class="folder-tab-menu">
468
+ <ul>
469
+ <li><a class="<?php echo esc_attr(($setting_page=="folder-settings")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=folder-settings") ?>"><?php esc_html_e( 'Folders Settings', 'folders'); ?></a></li>
470
+ <li><a class="<?php echo esc_attr(($setting_page=="customize-folders")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=customize-folders") ?>"><?php esc_html_e( 'Customize Folders', 'folders'); ?></a></li>
471
+ <li><a class="<?php echo esc_attr(($setting_page=="folders-import")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=folders-import") ?>"><?php esc_html_e( 'Tools', 'folders'); ?></a></li>
472
+ <?php if($isInSettings) { ?>
473
+ <li><a class="<?php echo esc_attr(($setting_page=="upgrade-to-pro")?"active":"") ?>" href="<?php echo esc_url($settingURL."&setting_page=upgrade-to-pro") ?>"><?php esc_html_e( 'Upgrade to Pro', 'folders'); ?></a></li>
474
+ <?php } ?>
475
+ </ul>
476
+ </div>
477
+ <div class="folder-tab-content">
478
+ <div class="tab-content <?php echo esc_attr(($setting_page=="folder-settings")?"active":"") ?>" id="folder-settings">
479
+ <div class="accordion-content no-bp">
480
+ <div class="accordion-left">
481
+ <table class="form-table">
482
+ <tboby>
483
+ <?php
484
+ $post_types = get_post_types( array( ), 'objects' );
485
+ $post_array = array("page", "post", "attachment");
486
+ foreach ( $post_types as $post_type ) : ?>
487
+ <?php
488
+ if ( ! $post_type->show_ui) continue;
489
+ $is_checked = !in_array( $post_type->name, $options )?"hide-option":"";
490
+ $selected_id = (isset($default_folders[$post_type->name]))?$default_folders[$post_type->name]:"all";
491
+ $is_exists = WCP_Folders::check_for_setting($post_type->name, "default_folders");
492
+ $is_customized = WCP_Folders::check_for_setting($post_type->name, "folders_settings");
493
+ if(in_array($post_type->name, $post_array) || $is_customized === true){
494
+ ?>
495
+ <tr>
496
+ <td class="no-padding">
497
+ <label label for="folders_<?php echo esc_attr($post_type->name); ?>" class="custom-checkbox">
498
+ <input type="checkbox" class="folder-select sr-only" id="folders_<?php echo esc_attr($post_type->name); ?>" name="folders_settings[]" value="<?php echo esc_attr($post_type->name); ?>"<?php if ( in_array( $post_type->name, $options ) ) echo ' checked="checked"'; ?>/>
499
+ <span></span>
500
+ </label>
501
+ </td>
502
+ <td class="" width="260px">
503
+ <label for="folders_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Use Folders with: ', 'folders')." ".esc_html_e($post_type->label); ?></label>
504
+ </td>
505
+ <td class="default-folder">
506
+ <label class="hide-show-option <?php echo esc_attr($is_checked) ?>" for="folders_for_<?php echo esc_attr($post_type->name); ?>" ><?php esc_html_e( 'Default folder: ', 'folders'); ?></label>
507
+ </td>
508
+ <td>
509
+ <select class="hide-show-option <?php echo esc_attr($is_checked) ?>" id="folders_for_<?php echo esc_attr($post_type->name); ?>" name="default_folders[<?php echo esc_attr($post_type->name); ?>]" ?>
510
+ <option value="">All <?php echo esc_attr($post_type->label) ?> Folder</option>
511
+ <option value="-1" <?php echo ($selected_id == -1)?"selected":"" ?>>Unassigned <?php echo esc_attr($post_type->label) ?></option>
512
+ <?php
513
+ if(isset($terms_data[$post_type->name]) && !empty($terms_data[$post_type->name])) {
514
+ foreach ($terms_data[$post_type->name] as $term) {
515
+ if(empty($is_exists) || $is_exists === false) {
516
+ echo "<option class='pro-select-item' value='folders-pro'>" . esc_attr( $term->name ). " (Pro) 🔑</option>";
517
+ } else {
518
+ $selected = ( $selected_id == $term->slug ) ? "selected" : "";
519
+ echo "<option " . esc_attr( $selected ) . " value='" . esc_attr( $term->slug ) . "'>" . esc_attr( $term->name ) . "</option>";
520
+ }
521
+ }
522
+ } ?>
523
+ </select>
524
+ </td>
525
+ </tr>
526
+ <?php
527
+ } else {
528
+ $show_media_details = "off";
529
+ ?>
530
+ <tr>
531
+ <td style="padding: 15px 10px 15px 0px" colspan="4">
532
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
533
+ <label for="" class="custom-checkbox send-user-to-pro">
534
+ <input disabled type="checkbox" class="sr-only" name="customize_folders[show_media_details]" id="show_media_details" value="on" <?php checked($show_media_details, "on") ?>>
535
+ <span></span>
536
+ </label>
537
+ <label for="" class="send-user-to-pro">
538
+ <?php esc_html_e( 'Use Folders with: ', 'folders')." ".esc_html_e($post_type->label); ?>
539
+ <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button>
540
+ </label>
541
+ </a>
542
+ </td>
543
+ </tr>
544
+ <?php }
545
+ endforeach; ?>
546
+ <?php
547
+ $show_in_page = !isset($customize_folders['use_folder_undo'])?"yes":$customize_folders['use_folder_undo'];
548
+ ?>
549
+ <tr>
550
+ <td class="no-padding">
551
+ <input type="hidden" name="customize_folders[use_folder_undo]" value="no">
552
+ <label for="use_folder_undo" class="custom-checkbox">
553
+ <input id="use_folder_undo" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[use_folder_undo]" value="yes">
554
+ <span></span>
555
+ </label>
556
+ </td>
557
+ <td colspan="3">
558
+ <label for="use_folder_undo" ><?php esc_html_e( 'Use folders with Undo action after performing tasks', 'folders'); ?> <span class="recommanded">Recommended</span></label>
559
+ </td>
560
+ </tr>
561
+ <?php
562
+ $default_timeout = !isset($customize_folders['default_timeout'])?"5":$customize_folders['default_timeout'];
563
+ ?>
564
+ <tr class="timeout-settings <?php echo ($show_in_page == "yes")?"active":"" ?>">
565
+ <td style="padding: 10px 0;" colspan="4">
566
+ <label for="default_timeout" ><?php esc_html_e( 'Default timeout', 'folders'); ?></label>
567
+ <div class="seconds-box">
568
+ <input type="number" class="seconds-input" name="customize_folders[default_timeout]" value="<?php echo esc_attr($default_timeout) ?>" />
569
+ </div>
570
+ </td>
571
+ </tr>
572
+ <?php
573
+ $show_in_page = !isset($customize_folders['folders_enable_replace_media'])?"yes":$customize_folders['folders_enable_replace_media'];
574
+ ?>
575
+ <tr>
576
+ <td class="no-padding">
577
+ <input type="hidden" name="customize_folders[folders_enable_replace_media]" value="no">
578
+ <label for="folders_enable_replace_media" class="custom-checkbox">
579
+ <input id="folders_enable_replace_media" class="sr-only" <?php checked($show_in_page, "yes") ?> type="checkbox" name="customize_folders[folders_enable_replace_media]" value="yes">
580
+ <span></span>
581
+ </label>
582
+ </td>
583
+ <td colspan="3" class="enable-replace-media">
584
+ <label for="folders_enable_replace_media" ><?php esc_html_e( 'Enable Replace Media', 'folders'); ?>
585
+ <span class="html-tooltip no-position top">
586
+ <span class="dashicons dashicons-editor-help"></span>
587
+ <span class="tooltip-text top" style="">
588
+ <?php esc_html_e("The Replace Media feature will allow you to replace your media files throughout your website with the click of a button, which means the file will be replaced for all your posts, pages, etc", "folders") ?>
589
+ <span class="new"><?php printf(esc_html__("%sPro version ✨%s includes updating all previous links of the file in the database, changing dates & more", "folders"), "<a href='".esc_url($this->getFoldersUpgradeURL())."' target='_blank'>", "</a>") ?></span>
590
+ </span>
591
+ </span>
592
+ <span class="recommanded">Recommended</span>
593
+ </label>
594
+ </td>
595
+ </tr>
596
+ <?php
597
+ $show_in_page = !isset($customize_folders['show_folder_in_settings'])?"no":$customize_folders['show_folder_in_settings'];
598
+ ?>
599
+ <tr>
600
+ <td class="no-padding">
601
+ <input type="hidden" name="customize_folders[show_folder_in_settings]" value="no">
602
+ <label for="show_folder_in_settings" class="custom-checkbox">
603
+ <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">
604
+ <span></span>
605
+ </label>
606
+ </td>
607
+ <td colspan="3">
608
+ <label for="show_folder_in_settings" ><?php esc_html_e( 'Place the Folders settings page nested under "Settings"', 'folders'); ?></label>
609
+ </td>
610
+ </tr>
611
+ <?php $val = get_option("folders_show_in_menu"); ?>
612
+ <input type="hidden" name="folders_show_in_menu" value="off" />
613
+ <tr>
614
+ <td width="20" class="no-padding">
615
+ <label for="folders_show_in_menu" class="custom-checkbox">
616
+ <input class="sr-only" type="checkbox" id="folders_show_in_menu" name="folders_show_in_menu" value="on" <?php checked($val, "on") ?>/>
617
+ <span></span>
618
+ </label>
619
+ </td>
620
+ <td colspan="3">
621
+ <label for="folders_show_in_menu" ><?php esc_html_e( 'Show the folders also in WordPress menu', 'folders'); ?></label>
622
+ </td>
623
+ </tr>
624
+ <tr>
625
+ <td style="padding: 15px 10px 15px 0px" colspan="4">
626
+ <?php $dynamic_folders = "off"; ?>
627
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
628
+ <label for="" class="custom-checkbox send-user-to-pro">
629
+ <input disabled type="checkbox" class="sr-only" name="customize_folders[dynamic_folders]" id="dynamic_folders" value="on" <?php checked($dynamic_folders, "on") ?>>
630
+ <span></span>
631
+ </label>
632
+ <label for="" class="send-user-to-pro">
633
+ <?php esc_html_e("Dynamic Folders", "folders"); ?>
634
+ <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button>
635
+ <span class="html-tooltip dynamic ">
636
+ <span class="dashicons dashicons-editor-help"></span>
637
+ <span class="tooltip-text top" style="">
638
+ <?php esc_html_e("Automatically filter posts/pages/custom posts/media files based on author, date, file types & more", "folders") ?>
639
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/dynamic-folders.gif") ?>">
640
+ </span>
641
+ </span>
642
+ <span class="recommanded">Recommended</span>
643
+ </label>
644
+ </a>
645
+ </td>
646
+ </tr>
647
+ <tr>
648
+ <td style="padding: 15px 10px 15px 0px" colspan="4">
649
+ <?php $replace_media_title = "off"; ?>
650
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
651
+ <label for="" class="custom-checkbox send-user-to-pro">
652
+ <input disabled type="checkbox" class="sr-only" name="customize_folders[replace_media_title]" id="replace_media_title" value="on" <?php checked($replace_media_title, "on") ?>>
653
+ <span></span>
654
+ </label>
655
+ <label for="" class="send-user-to-pro">
656
+ <?php esc_html_e("Auto Rename file based on title", "folders"); ?>
657
+ <span class="folder-tooltip" data-title="<?php esc_html_e("Replace the actual file name of media files with the title from the WordPress editor.", "folders") ?>"><span class="dashicons dashicons-editor-help"></span></span></label>
658
+ <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders') ?></button>
659
+ </label>
660
+ </a>
661
+ </td>
662
+ </tr>
663
+ <!-- Do not make changes here, Only for Free -->
664
+ <tr>
665
+ <td style="padding: 15px 10px 15px 0px" colspan="4">
666
+ <input type="hidden" name="folders_settings1" value="folders">
667
+ <?php
668
+ $show_media_details = !isset($customize_folders['show_media_details'])?"on":$customize_folders['show_media_details'];
669
+ $show_media_details = "off";
670
+ ?>
671
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
672
+ <label for="" class="custom-checkbox send-user-to-pro">
673
+ <input disabled type="checkbox" class="sr-only" name="customize_folders[show_media_details]" id="show_media_details" value="on" <?php checked($show_media_details, "on") ?>>
674
+ <span></span>
675
+ </label>
676
+ <label for="" class="send-user-to-pro">
677
+ <?php esc_html_e("Show media details on hover", "folders"); ?>
678
+ <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button>
679
+ <span class="html-tooltip bottom">
680
+ <span class="dashicons dashicons-editor-help"></span>
681
+ <span class="tooltip-text top" style="">
682
+ <?php esc_html_e("Show useful metadata including title, size, type, date, dimension & more on hover.", "folders"); ?>
683
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/folders-media.gif") ?>">
684
+ </span>
685
+ </span>
686
+ <span class="recommanded">Recommended</span>
687
+ </label>
688
+ </a>
689
+ </td>
690
+ </tr>
691
+ </tboby>
692
+ </table>
693
+ <input type="hidden" name="customize_folders[show_media_details]" value="off">
694
+ <div class="media-details">
695
+ <div class="">
696
+ <?php
697
+ $media_settings = array(
698
+ 'image_title' => array(
699
+ "title" => esc_html__("Title", "folders"),
700
+ "default" => "on",
701
+ ),
702
+ 'image_alt_text' => array(
703
+ "title" => esc_html__("Alternative Text", "folders"),
704
+ "default" => "off",
705
+ ),
706
+ 'image_file_url' => array(
707
+ "title" => esc_html__("File URL", "folders"),
708
+ "default" => "off",
709
+ ),
710
+ 'image_dimensions' => array(
711
+ "title" => esc_html__("Dimensions", "folders"),
712
+ "default" => "on",
713
+ ),
714
+ 'image_size' => array(
715
+ "title" => esc_html__("Size", "folders"),
716
+ "default" => "off",
717
+ ),
718
+ 'image_file_name' => array(
719
+ "title" => esc_html__("Filename", "folders"),
720
+ "default" => "off",
721
+ ),
722
+ 'image_type' => array(
723
+ "title" => esc_html__("Type", "folders"),
724
+ "default" => "on",
725
+ ),
726
+ 'image_date' => array(
727
+ "title" => esc_html__("Date", "folders"),
728
+ "default" => "on",
729
+ ),
730
+ 'image_uploaded_by' => array(
731
+ "title" => esc_html__("Uploaded by", "folders"),
732
+ "default" => "off",
733
+ )
734
+ );
735
+ $media_col_settings = isset($customize_folders['media_col_settings']) && is_array($customize_folders['media_col_settings'])?$customize_folders['media_col_settings']:array("image_title","image_dimensions","image_type","image_date");
736
+ ?>
737
+ <input type="hidden" name="customize_folders[media_col_settings][]" value="all">
738
+ <div class="media-setting-box active send-user-to-pro" >
739
+ <div class="normal-box">
740
+ <select disabled multiple="multiple" name="customize_folders[media_col_settings][]" class="select2-box">
741
+ <?php foreach($media_settings as $key=>$media) {
742
+ $selected = $media['default'];
743
+ ?>
744
+ <option <?php selected($selected, "on") ?> value="<?php echo esc_attr($key) ?>"><?php echo esc_attr($media['title']) ?></option>
745
+ <?php } ?>
746
+ </select>
747
+ </div>
748
+ <a class="upgrade-box" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
749
+ <button type="button"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button>
750
+ </a>
751
+ </div>
752
+ </div>
753
+ </div>
754
+ </div>
755
+ <div class="accordion-right">
756
+ <div class="premio-help">
757
+ <a href="https://premio.io/help/folders/?utm_source=pluginspage" target="_blank">
758
+ <div class="premio-help-btn">
759
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/premio-help.png") ?>" alt="Premio Help" class="Premio Help" />
760
+ <div class="need-help">Need Help</div>
761
+ <div class="visit-our">Visit our</div>
762
+ <div class="knowledge-base">knowledge base</div>
763
+ </div>
764
+ </a>
765
+ </div>
766
+ </div>
767
+ <div class="clear"></div>
768
+ <div class="submit-button">
769
+ <?php submit_button(); ?>
770
+ </div>
771
+ </div>
772
+ </div>
773
+ <div class="tab-content <?php echo esc_attr(($setting_page=="customize-folders")?"active":"") ?>" id="customize-folders">
774
+ <div class="accordion-content">
775
+ <div class="accordion-left">
776
+ <table class="form-table">
777
+ <?php
778
+ $colors = array(
779
+ "#FA166B",
780
+ "#0073AA",
781
+ "#484848"
782
+ );
783
+ $color = !isset($customize_folders['new_folder_color'])||empty($customize_folders['new_folder_color'])?"#FA166B":$customize_folders['new_folder_color'];
784
+ $setting_color = WCP_Folders::check_for_setting("new_folder_color", "customize_folders");
785
+ ?>
786
+ <tr>
787
+ <td width="255px" class="no-padding">
788
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
789
+ <label for="new_folder_color" ><b>"New Folder"</b> button color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label>
790
+ </a>
791
+ </td>
792
+ <td>
793
+ <ul class="color-list">
794
+ <?php $field_name = "new_folder_color"; foreach ($colors as $key=>$value) { ?>
795
+ <li>
796
+ <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
797
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
798
+ <span style="background: <?php echo esc_attr($value) ?>"></span>
799
+ </label>
800
+ </li>
801
+ <?php } $key = 3; ?>
802
+ <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
803
+ <li>
804
+ <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
805
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
806
+ <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
807
+ </label>
808
+ </li>
809
+ <?php } ?>
810
+ <li>
811
+ <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
812
+ <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span>
813
+ <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
814
+ </a>
815
+ </li>
816
+ </ul>
817
+ </td>
818
+ <td rowspan="4" >
819
+
820
+ </td>
821
+ </tr>
822
+ <?php
823
+ $color = !isset($customize_folders['bulk_organize_button_color'])||empty($customize_folders['bulk_organize_button_color'])?"#FA166B":$customize_folders['bulk_organize_button_color'];
824
+ $setting_color = WCP_Folders::check_for_setting("bulk_organize_button_color", "customize_folders");
825
+ ?>
826
+ <tr>
827
+ <td class="no-padding">
828
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
829
+ <label for="bulk_organize_button_color" ><b>"Bulk Organize"</b> button color <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label>
830
+ </a>
831
+ </td>
832
+ <td>
833
+ <ul class="color-list">
834
+ <?php $field_name = "bulk_organize_button_color"; foreach ($colors as $key=>$value) { ?>
835
+ <li>
836
+ <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
837
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
838
+ <span style="background: <?php echo esc_attr($value) ?>"></span>
839
+ </label>
840
+ </li>
841
+ <?php } $key = 3; ?>
842
+ <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
843
+ <li>
844
+ <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
845
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
846
+ <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
847
+ </label>
848
+ </li>
849
+ <?php } ?>
850
+ <li>
851
+ <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
852
+ <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span>
853
+ <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
854
+ </a>
855
+ </li>
856
+ </ul>
857
+ </td>
858
+ </tr>
859
+ <?php
860
+ $color = !isset($customize_folders['media_replace_button'])||empty($customize_folders['media_replace_button'])?"#FA166B":$customize_folders['media_replace_button'];
861
+ $setting_color = WCP_Folders::check_for_setting("media_replace_button", "customize_folders");
862
+ ?>
863
+ <tr>
864
+ <td class="no-padding">
865
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
866
+ <label for="media_replace_button" ><b>"Replace File"</b> media library button <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label>
867
+ </a>
868
+ </td>
869
+ <td>
870
+ <ul class="color-list">
871
+ <?php $field_name = "media_replace_button"; foreach ($colors as $key=>$value) { ?>
872
+ <li>
873
+ <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
874
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
875
+ <span style="background: <?php echo esc_attr($value) ?>"></span>
876
+ </label>
877
+ </li>
878
+ <?php } $key = 3; ?>
879
+ <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
880
+ <li>
881
+ <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
882
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
883
+ <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
884
+ </label>
885
+ </li>
886
+ <?php } ?>
887
+ <li>
888
+ <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
889
+ <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span>
890
+ <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
891
+ </a>
892
+ </li>
893
+ </ul>
894
+ </td>
895
+ </tr>
896
+ <?php
897
+ $color = !isset($customize_folders['dropdown_color'])||empty($customize_folders['dropdown_color'])?"#484848":$customize_folders['dropdown_color'];
898
+ $setting_color = WCP_Folders::check_for_setting("dropdown_color", "customize_folders");
899
+ ?>
900
+ <tr>
901
+ <td class="no-padding">
902
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
903
+ <label for="dropdown_color" ><?php echo esc_html_e("Dropdown color", "folders") ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label>
904
+ </a>
905
+ </td>
906
+ <td>
907
+ <ul class="color-list">
908
+ <?php $field_name = "dropdown_color"; foreach ($colors as $key=>$value) { ?>
909
+ <li>
910
+ <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
911
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
912
+ <span style="background: <?php echo esc_attr($value) ?>"></span>
913
+ </label>
914
+ </li>
915
+ <?php } $key = 3; ?>
916
+ <?php if($setting_color !== false && $setting_color != "#484848") { ?>
917
+ <li>
918
+ <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
919
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
920
+ <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
921
+ </label>
922
+ </li>
923
+ <?php } ?>
924
+ <li>
925
+ <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
926
+ <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span>
927
+ <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
928
+ </a>
929
+ </li>
930
+ </ul>
931
+ </td>
932
+ </tr>
933
+ <?php
934
+ $color = !isset($customize_folders['folder_bg_color'])||empty($customize_folders['folder_bg_color'])?"#FA166B":$customize_folders['folder_bg_color'];
935
+ $setting_color = WCP_Folders::check_for_setting("folder_bg_color", "customize_folders");
936
+ ?>
937
+ <tr>
938
+ <td class="no-padding">
939
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
940
+ <label for="folder_bg_color" ><?php echo esc_html_e("Folders background color", "folders") ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button></label>
941
+ </a>
942
+ </td>
943
+ <td>
944
+ <ul class="color-list">
945
+ <?php $field_name = "folder_bg_color"; foreach ($colors as $key=>$value) { ?>
946
+ <li>
947
+ <label class="color-checkbox <?php echo ($color == $value)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
948
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($value) ?>" <?php checked($color, $value) ?> />
949
+ <span style="background: <?php echo esc_attr($value) ?>"></span>
950
+ </label>
951
+ </li>
952
+ <?php } $key = 3; ?>
953
+ <?php if($setting_color !== false && $setting_color != "#FA166B") { ?>
954
+ <li>
955
+ <label class="color-checkbox <?php echo ($color == $setting_color)?"active":"" ?>" for="<?php echo esc_attr($field_name)."-".$key ?>">
956
+ <input type="radio" id="<?php echo esc_attr($field_name)."-".$key ?>" name="customize_folders[<?php echo esc_attr($field_name) ?>]" class="sr-only checkbox-color" value="<?php echo esc_attr($setting_color) ?>" <?php checked($color, $setting_color) ?> />
957
+ <span style="background: <?php echo esc_attr($setting_color) ?>"></span>
958
+ </label>
959
+ </li>
960
+ <?php } ?>
961
+ <li>
962
+ <a class="upgrade-box-link d-block" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
963
+ <span class="color-box"><span class="gradient"></span> <span class="color-box-area"><?php echo esc_html_e("Custom", "folders") ?></span></span>
964
+ <span class="upgrade-link"><?php echo esc_html_e("Upgrade to Pro", "folders") ?></span>
965
+ </a>
966
+ </li>
967
+ </ul>
968
+ </td>
969
+ </tr>
970
+ <?php
971
+ $font = !isset($customize_folders['folder_font'])||empty($customize_folders['folder_font'])?"":$customize_folders['folder_font'];
972
+ $setting_font = WCP_Folders::check_for_setting("folder_font", "customize_folders");
973
+ $index = 0;
974
+ ?>
975
+ <tr>
976
+ <td class="no-padding">
977
+ <label for="folder_font" >
978
+ <?php if($setting_font !== false && $setting_font != "" && !in_array($setting_font, array("Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"))) {
979
+ esc_html_e("Folders font", 'folders');
980
+ } else { ?>
981
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
982
+ <?php esc_html_e( 'Folders font', 'folders'); ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button>
983
+ </a>
984
+ <?php } ?>
985
+ </label>
986
+ </td>
987
+ <td colspan="2">
988
+ <select name="customize_folders[folder_font]" id="folder_font" >
989
+ <?php $group = '';
990
+ foreach ($fonts as $key => $value):
991
+ $title = $key;
992
+ if($index == 0) {
993
+ $key = "";
994
+ }
995
+ $index++;
996
+ if ($value != $group) {
997
+ echo '<optgroup label="' . $value . '">';
998
+ $group = $value;
999
+ }
1000
+ if(($setting_font !== false && $setting_font != "" && !in_array($setting_font, array("Arial","Tahoma","Verdana","Helvetica","Times New Roman","Trebuchet MS","Georgia"))) || $value != "Google Fonts" ) { ?>
1001
+ <option value="<?php echo $key; ?>" <?php selected($font, $key); ?>><?php echo $title; ?></option>
1002
+ <?php } else { ?>
1003
+ <option class="pro-select-item" value="folders-pro"><?php echo $title; ?> (Pro) 🔑</option>
1004
+ <?php } ?>
1005
+ <?php endforeach; ?>
1006
+ </select>
1007
+ </td>
1008
+ </tr>
1009
+ <?php
1010
+ $size = ! isset( $customize_folders['folder_size'] ) || empty( $customize_folders['folder_size'] ) ? "16" : $customize_folders['folder_size'];
1011
+ $folder_size = WCP_Folders::check_for_setting("folder_size", "customize_folders");
1012
+ ?>
1013
+ <tr>
1014
+ <td class="no-padding">
1015
+ <label for="folder_size" >
1016
+ <?php if($folder_size === false || intval($folder_size) === 16) { ?>
1017
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
1018
+ <?php esc_html_e( 'Folders size', 'folders'); ?> <button type="button" class="upgrade-link" ><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button>
1019
+ </a>
1020
+ <?php } else { ?>
1021
+ <?php esc_html_e("Folders size", 'folders'); ?>
1022
+ <?php } ?>
1023
+ </label>
1024
+ </td>
1025
+ <td colspan="2">
1026
+ <?php
1027
+ if($folder_size === false || intval($folder_size) == 16) {
1028
+ $sizes = array(
1029
+ "folders-pro" => "Small (Pro) 🔑",
1030
+ "16" => "Medium",
1031
+ "folders-pro-item" => "Large (Pro) 🔑"
1032
+ );
1033
+ $size = 16;
1034
+ } else {
1035
+ $sizes = array(
1036
+ "12" => "Small",
1037
+ "16" => "Medium",
1038
+ "20" => "Large"
1039
+ );
1040
+ }
1041
+ ?>
1042
+ <select name="customize_folders[folder_size]" id="folder_size" >
1043
+ <?php
1044
+ foreach ($sizes as $key=>$value) {
1045
+ $selected = ($key == $size)?"selected":"";
1046
+ echo "<option ".$selected." value='".$key."'>".$value."</option>";
1047
+ }
1048
+ ?>
1049
+ </select>
1050
+ </td>
1051
+ </tr>
1052
+ <?php
1053
+ $show_in_page = isset($customize_folders['show_in_page'])?$customize_folders['show_in_page']:"hide";
1054
+ $show_folder = WCP_Folders::check_for_setting("show_in_page", "customize_folders");
1055
+ if(empty($show_in_page)) {
1056
+ $show_in_page = "hide";
1057
+ }
1058
+ ?>
1059
+ <tr>
1060
+ <td colspan="3" style="padding: 15px 20px 15px 0">
1061
+ <input type="hidden" name="customize_folders[show_in_page]" value="hide">
1062
+ <?php if($show_folder === false || $show_folder === "hide") { ?>
1063
+ <a class="upgrade-box-link" target="_blank" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" >
1064
+ <label for="" class="custom-checkbox send-user-to-pro">
1065
+ <input disabled type="checkbox" class="sr-only" name="customize_folders[show_in_page]" id="show_in_page" value="on" <?php checked($show_in_page, "show") ?>>
1066
+ <span></span>
1067
+ </label>
1068
+ <label for="" class="send-user-to-pro">
1069
+ <?php esc_html_e("Show Folders in upper position", "folders"); ?>
1070
+ <button type="button" class="upgrade-link" href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>"><?php esc_html_e("Upgrade to Pro", 'folders'); ?></button>
1071
+ </label>
1072
+ </a>
1073
+ <?php } else { ?>
1074
+ <div class="custom-checkbox">
1075
+ <input id="show_folders" class="sr-only" <?php checked($show_in_page, "show") ?> type="checkbox" name="customize_folders[show_in_page]" value="show">
1076
+ <span></span>
1077
+ </div>
1078
+ <label for="show_folders"><?php esc_html_e("Show Folders in upper position", 'folders'); ?></label>
1079
+ <?php } ?>
1080
+ </td>
1081
+ </tr>
1082
+ </table>
1083
+ </div>
1084
+ <div class="accordion-right">
1085
+ <div class="preview-text">
1086
+ Preview
1087
+ <div class="preview-text-info"><?php esc_html_e("See the full functionality on your media library, posts, pages, and custom posts", 'folders'); ?></div>
1088
+ </div>
1089
+ <div class="preview-inner-box">
1090
+ <div class="preview-box">
1091
+ <div class="wcp-custom-form">
1092
+ <div class="form-title">
1093
+ <?php esc_html_e("Folders", 'folders'); ?>
1094
+ <a href="javascript:;" class="add-new-folder" id="add-new-folder">
1095
+ <span class="create_new_folder"><i class="pfolder-add-folder"></i></span>
1096
+ <span><?php esc_html_e("New Folder", 'folders'); ?></span>
1097
+ </a>
1098
+ <div class="clear"></div>
1099
+ </div>
1100
+ <div class="form-options">
1101
+ <ul>
1102
+ <li>
1103
+ <div class="custom-checkbox">
1104
+ <input type="checkbox" class="sr-only" >
1105
+ <span></span>
1106
+ </div>
1107
+ </li>
1108
+ <li>
1109
+ <a href="javascript:;" id="inline-update"><span class="icon pfolder-edit-folder"><span class="path2"></span></span> <span class="text"><?php esc_html_e("Rename", 'folders'); ?></span> </a>
1110
+ </li>
1111
+ <li>
1112
+ <a href="javascript:;" id="inline-remove"><span class="icon pfolder-remove"></span> <span class="text"><?php esc_html_e("Delete", 'folders'); ?></span> </a>
1113
+ </li>
1114
+ <li class="last">
1115
+ <a href="javascript:;" id="expand-collapse-list" data-tooltip="Expand"><span class="icon pfolder-arrow-down"></span></a>
1116
+ </li>
1117
+ <li class="last">
1118
+ <a href="javascript:;" ><span class="icon pfolder-arrow-sort"></span></a>
1119
+ </li>
1120
+ </ul>
1121
+ </div>
1122
+ </div>
1123
+ <div class="shadow-box">
1124
+ <div class="header-posts">
1125
+ <a href="javascript:;" class="all-posts active-item-link"><?php esc_html_e("All Files", 'folders'); ?> <span class="total-count">215</span></a>
1126
+ </div>
1127
+ <div class="un-categorised-items ui-droppable">
1128
+ <a href="javascript:;" class="un-categorized-posts"><?php esc_html_e("Unassigned Files", 'folders'); ?> <span class="total-count total-empty">191</span> </a>
1129
+ </div>
1130
+ <div class="separator"></div>
1131
+ <ul class="folder-list">
1132
+ <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span><?php esc_html_e("Folder 1", 'folders'); ?></span><span class="total-count">20</span><span class="clear"></span></a></li>
1133
+ <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span><?php esc_html_e("Folder 2", 'folders'); ?></span><span class="total-count">13</span><span class="clear"></span></a></li>
1134
+ <li><a href="javascript:;"><i class="wcp-icon pfolder-folder-close"></i> <span><?php esc_html_e("Folder 3", 'folders'); ?></span><span class="total-count">5</span><span class="clear"></span></a></li>
1135
+ </ul>
1136
+ <div class="separator"></div>
1137
+ <div class="media-buttons">
1138
+ <select class="media-select">
1139
+ <option><?php esc_html_e("All Files", 'folders'); ?></option>
1140
+ <option><?php esc_html_e("Folder 1", 'folders'); ?></option>
1141
+ <option><?php esc_html_e("Folder 2", 'folders'); ?></option>
1142
+ <option><?php esc_html_e("Folder 3", 'folders'); ?></option>
1143
+ </select>
1144
+ <button type="button" class="button organize-button"><?php esc_html_e("Bulk Organize", 'folders'); ?></button>
1145
+ <div style="clear: both;"></div>
1146
+ </div>
1147
+ </div>
1148
+ </div>
1149
+ </div>
1150
+ </div>
1151
+ <div class="clear"></div>
1152
+ <?php submit_button(); ?>
1153
+ </div>
1154
+ </div>
1155
+ <div class="tab-content <?php echo esc_attr(($setting_page=="folders-import")?"active":"") ?>" id="folder-import">
1156
+ <?php
1157
+ $remove_folders_when_removed = !isset($customize_folders['remove_folders_when_removed'])?"off":$customize_folders['remove_folders_when_removed'];
1158
+ ?>
1159
+ <input type="hidden" name="customize_folders[remove_folders_when_removed]" value="off" />
1160
+ <div class="folder-danger-zone">
1161
+ <table class="import-export-table">
1162
+ <?php if($is_plugin_exists) { ?>
1163
+ <tr class="has-other-plugins">
1164
+ <td>
1165
+ <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Export/Import", "folders"); ?></span>
1166
+ <span class="folder-text"><span><?php esc_html_e("External folders found.", "folders"); ?></span> <?php esc_html_e("Click import to start importing external folders.", "folders"); ?></span>
1167
+ </td>
1168
+ <td class="last-td">
1169
+ <a href="#" class="import-folders-button"><?php esc_html_e("Import", "folders"); ?></a>
1170
+ </td>
1171
+ </tr>
1172
+ <?php } ?>
1173
+ <tr class="no-more-plugins <?php echo (!$is_plugin_exists)?"active":"" ?>">
1174
+ <td>
1175
+ <span class="folder-info"><span class="dashicons dashicons-admin-generic"></span> <?php esc_html_e("Export/Import", "folders"); ?></span>
1176
+ <span class="folder-text"><?php esc_html_e("Couldn't detect any external folders that can be imported. Please contact us if you have external folders that were not detected", "folders"); ?></span>
1177
+ </td>
1178
+ <td class="last-td">
1179
+ <a href="https://premio.io/contact/" target="_blank" class="contact-folders-button"><?php esc_html_e("Contact Us", "folders"); ?></a>
1180
+ </td>
1181
+ </tr>
1182
+ <tr>
1183
+ <td colspan="2"><span class="danzer-title"><span class="dashicons dashicons-warning"></span> <?php esc_html_e("Danger Zone", "folders"); ?></span></td>
1184
+ </tr>
1185
+ <tr>
1186
+ <td>
1187
+ <span class="danger-info"><?php esc_html_e("Delete plugin data upon deletion", "folders"); ?></span>
1188
+ <span class="danger-data"><?php esc_html_e("Delete all folders when the plugin is removed. This feature will remove all existing folders created by the plugin upon deletion.", "folders"); ?> <b><?php esc_html_e("(Not recommended)", "folders"); ?></span></b>
1189
+ </td>
1190
+ <td class="last-td" >
1191
+ <div class="inline-checkbox">
1192
+ <label class="folder-switch" for="remove_folders_when_removed">
1193
+ <input type="checkbox" class="sr-only change-folder-status" name="customize_folders[remove_folders_when_removed]" id="remove_folders_when_removed" value="on" <?php checked($remove_folders_when_removed, "on") ?>>
1194
+ <div class="folder-slider round"></div>
1195
+ </label>
1196
+ </div>
1197
+ </td>
1198
+ </tr>
1199
+ <tr>
1200
+ <td>
1201
+ <span class="danger-info"><?php esc_html_e("Manual Data Removal", "folders"); ?></span>
1202
+ <span class="danger-data"><?php esc_html_e("Delete all folders data manually This feature will remove all existing folders created by the plugin. Use this feature with caution.", "folders"); ?>
1203
+ </td>
1204
+ <td class="last-td">
1205
+ <a href="#" class="remove-folders-data"><?php esc_html_e("Delete Now", "folders"); ?></a>
1206
+ </td>
1207
+ </tr>
1208
+ </table>
1209
+ </div>
1210
+ </div>
1211
+ <div class="tab-content <?php echo esc_attr(($setting_page=="upgrade-to-pro")?"active":"") ?>">
1212
+ <?php if($setting_page=="upgrade-to-pro") { ?>
1213
+ <style>#wpwrap { background: #f0f0f1 !important; }</style>
1214
+ <?php include_once "upgrade-table.php"; ?>
1215
+ <?php } ?>
1216
+ </div>
1217
+ </div>
1218
+ </div>
1219
+ <?php
1220
+ ?>
1221
+ <input type="hidden" name="folder_nonce" value="<?php echo wp_create_nonce("folder_settings") ?>">
1222
+ <input type="hidden" name="folder_page" value="<?php echo $_SERVER['REQUEST_URI'] ?>">
1223
+ <?php if($setting_page!="upgrade-to-pro") { ?>
1224
+ </form>
1225
+ <?php } ?>
1226
+ </div>
1227
+
1228
+ <div class="folder-popup-form" id="import-plugin-data">
1229
+ <div class="popup-form-content">
1230
+ <div class="popup-content">
1231
+ <div class="close-popup-button">
1232
+ <a class="" href="javascript:;"><span></span></a>
1233
+ </div>
1234
+ <div class="import-folder-title"></div>
1235
+ <div class="import-folder-note">Are you sure you'd like to import $x folders from $plugin?</div>
1236
+ <div class="folder-form-buttons">
1237
+ <button type="submit" class="form-submit-btn" id="import-folder-button"><?php esc_html_e("Import", 'folders'); ?></button>
1238
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a>
1239
+ </div>
1240
+ </div>
1241
+ </div>
1242
+ </div>
1243
+
1244
+ <?php //if($plugin['is_exists']) { ?>
1245
+ <div class="folder-popup-form" id="import-folders-popup">
1246
+ <div class="popup-form-content">
1247
+ <div class="popup-content">
1248
+ <div class="close-popup-button">
1249
+ <a class="" href="javascript:;"><span></span></a>
1250
+ </div>
1251
+ <div class="import-plugin-title"><?php esc_html_e("Import data", 'folders'); ?></div>
1252
+ <div class="plugin-import-table">
1253
+ <div class="import-folder-table">
1254
+ <table>
1255
+ <tbody>
1256
+ <?php foreach ($plugin_info as $slug=>$plugin) { ?>
1257
+ <?php if($plugin['is_exists']) { ?>
1258
+ <tr class="other-plugins-<?php echo esc_attr__($slug) ?>" data-plugin="<?php echo esc_attr__($slug) ?>" data-nonce="<?php echo wp_create_nonce("import_data_from_".$slug) ?>" data-folders="<?php echo esc_attr($plugin['total_folders']) ?>" data-attachments="<?php echo esc_attr($plugin['total_attachments']) ?>">
1259
+ <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th>
1260
+ <td>
1261
+ <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".$plugin['total_folders']."</b>", ($plugin['total_folders']>1)?esc_html__("s"):"" ,"<b>".$plugin['total_attachments']."</b>", ($plugin['total_attachments']>1)?esc_html__("s"):"") ?></span>
1262
+ <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button>
1263
+ <button type="button" class="button button-secondary remove-folder-data in-popup"><?php esc_html_e("Delete plugin data", "folders"); ?> <span class="spinner"></span></button>
1264
+ </td>
1265
+ </tr>
1266
+ <?php } ?>
1267
+ <?php } ?>
1268
+ </tbody>
1269
+ </table>
1270
+ </div>
1271
+ </div>
1272
+ <div class="folder-form-buttons">
1273
+ <div class=""></div>
1274
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Close", 'folders'); ?></a>
1275
+ </div>
1276
+ </div>
1277
+ </div>
1278
+ </div>
1279
+ <?php //} ?>
1280
+
1281
+ <div class="folder-popup-form" id="remove-plugin-data">
1282
+ <div class="popup-form-content">
1283
+ <div class="popup-content">
1284
+ <div class="close-popup-button">
1285
+ <a class="" href="javascript:;"><span></span></a>
1286
+ </div>
1287
+ <div class="remove-folder-title"><?php esc_html_e("Are you sure?", 'folders'); ?></div>
1288
+ <div class="remove-folder-note"></div>
1289
+ <div class="folder-form-buttons">
1290
+ <button type="submit" class="form-submit-btn delete-folder-plugin" id="remove-folder-button"><?php esc_html_e("Delete plugin data", 'folders'); ?></button>
1291
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a>
1292
+ </div>
1293
+ </div>
1294
+ </div>
1295
+ </div>
1296
+
1297
+ <div class="folder-popup-form remove-folders-box" id="remove-folders-data-box">
1298
+ <div class="popup-form-content">
1299
+ <div class="popup-content">
1300
+ <div class="close-popup-button close-remove-folders">
1301
+ <a class="" href="javascript:;"><span></span></a>
1302
+ </div>
1303
+ <div class="remove-folder-title"><?php esc_html_e("Are you sure?", 'folders'); ?></div>
1304
+ <div class="remove-folder-note"><?php printf(esc_html__("Folders will remove all created folders once you remove the plugin. We recommend you %snot to use this feature%s if you plan to use Folders in future.", 'folders'), "<b>", "</b>"); ?></div>
1305
+ <div class="folder-form-buttons">
1306
+ <a href="javascript:;" class="form-cancel-btn cancel-folders"><?php esc_html_e("Cancel", 'folders'); ?></a>
1307
+ <button type="submit" class="form-cancel-btn delete-button"><?php esc_html_e("I want to delete anyway", 'folders'); ?></button>
1308
+ </div>
1309
+ </div>
1310
+ </div>
1311
+ </div>
1312
+
1313
+ <div class="folder-popup-form" id="remove-confirmation-box">
1314
+ <div class="popup-form-content">
1315
+ <div class="popup-content">
1316
+ <form id="remove_folders_data" autocomplete="off" >
1317
+ <div class="close-popup-button">
1318
+ <a class="" href="javascript:;"><span></span></a>
1319
+ </div>
1320
+ <div class="remove-folder-title"></div>
1321
+ <div class="remove-folder-note text-left">
1322
+ <b><?php esc_html_e("Type DELETE to confirm", 'folders'); ?></b>
1323
+ <div class="input-box">
1324
+ <input autocomplete="off" type="text" id="delete-input" name="delete" >
1325
+ </div>
1326
+ <div class="delete-confirmation-message"><?php esc_html_e('', 'folders'); ?></div>
1327
+ </div>
1328
+ <div class="folder-form-buttons">
1329
+ <input type="hidden" name="nonce" id="remove-folder-nonce" value="<?php echo wp_create_nonce("remove_folders_data") ?>">
1330
+ <input type="hidden" name="action" value="remove_all_folders_data">
1331
+ <button disabled type="submit" class="form-submit-btn delete-button" id="remove-folders-data-button"><?php esc_html_e("Delete", 'folders'); ?></button>
1332
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a>
1333
+ </div>
1334
+ </form>
1335
+ </div>
1336
+ </div>
1337
+ </div>
1338
+
1339
+ <?php
1340
+ $option = get_option("folder_intro_box");
1341
+ if(($option == "show" || get_option("folder_redirect_status") == 2) && $is_plugin_exists) { ?>
1342
+ <div class="folder-popup-form" id="import-third-party-plugin-data" style="display: block" ?>
1343
+ <div class="popup-form-content">
1344
+ <div class="popup-content">
1345
+ <div class="close-popup-button">
1346
+ <a class="" href="javascript:;"><span></span></a>
1347
+ </div>
1348
+ <div class="import-plugin-title"><?php esc_html_e("Import data", 'folders'); ?></div>
1349
+ <div class="import-plugin-note"><?php esc_html_e("We've detected that you use another folders plugin. Would you like the Folders plugin to import your current folders? Keep in mind you can always do it in Folders Settings -> Import", 'folders'); ?></div>
1350
+ <div class="plugin-import-table">
1351
+ <div class="import-folder-table">
1352
+ <table>
1353
+ <tbody>
1354
+ <?php foreach ($plugin_info as $slug=>$plugin) {
1355
+ if($plugin['is_exists']) { ?>
1356
+ <tr class="other-plugins-<?php echo esc_attr__($slug) ?>" data-plugin="<?php echo esc_attr__($slug) ?>" data-nonce="<?php echo wp_create_nonce("import_data_from_".$slug) ?>" data-folders="<?php echo esc_attr($plugin['total_folders']) ?>" data-attachments="<?php echo esc_attr($plugin['total_attachments']) ?>">
1357
+ <th class="plugin-name"><?php echo esc_attr__($plugin['name']) ?></th>
1358
+ <td>
1359
+ <button type="button" class="button button-primary import-folder-data in-popup"><?php esc_html_e("Import", "folders"); ?> <span class="spinner"></span></button>
1360
+ <span class="import-message"><?php printf(esc_html__("%s folder%s and %s attachment%s", "folders"), "<b>".$plugin['total_folders']."</b>", ($plugin['total_folders']>1)?esc_html__("s"):"" ,"<b>".$plugin['total_attachments']."</b>", ($plugin['total_attachments']>1)?esc_html__("s"):"") ?></span>
1361
+ </td>
1362
+ </tr>
1363
+ <?php }
1364
+ } ?>
1365
+ </tbody>
1366
+ </table>
1367
+ </div>
1368
+ </div>
1369
+ <div class="folder-form-buttons">
1370
+ <div class=""></div>
1371
+ <a href="javascript:;" id="cancel-plugin-import" class="form-cancel-btn"><?php esc_html_e("Close", 'folders'); ?></a>
1372
+ </div>
1373
+ </div>
1374
+ </div>
1375
+ </div>
1376
+ <?php
1377
+ if($option != "show") {
1378
+ update_option("folder_redirect_status", 3);
1379
+ }
1380
+ } ?>
1381
+ <div class="folder-popup-form" id="no-more-folder-credit">
1382
+ <div class="popup-form-content">
1383
+ <div class="popup-content">
1384
+ <div class="close-popup-button">
1385
+ <a class="" href="javascript:;"><span></span></a>
1386
+ </div>
1387
+ <div class="add-update-folder-title" id="folder-limitation-message">
1388
+ <?php esc_html_e("You've reached the 10 folder limitation!", 'folders'); ?>
1389
+ </div>
1390
+ <div class="folder-form-message">
1391
+ <?php esc_html_e("Unlock unlimited amount of folders by upgrading to one of our pro plans.", 'folders'); ?>
1392
+ </div>
1393
+ <div class="folder-form-buttons">
1394
+ <a href="javascript:;" class="form-cancel-btn"><?php esc_html_e("Cancel", 'folders'); ?></a>
1395
+ <a href="<?php echo esc_url($this->getFoldersUpgradeURL()) ?>" target="_blank" class="form-submit-btn"><?php esc_html_e("See Pro Plans", 'folders'); ?></a>
1396
+ </div>
1397
+ </div>
1398
+ </div>
1399
+ </div>
templates/admin/help.php CHANGED
@@ -7,12 +7,12 @@ if ( ! defined( 'ABSPATH' ) ) exit;
7
  <b>Gal Dubinski</b> Co-Founder at Premio
8
  </div>
9
  <div class="folder-help-content">
10
- <p><?php esc_html_e("Hello! Are you experiencing any problems with Folders? Please let me know :)", WCP_FOLDER) ?></p>
11
  <div class="folder-form-field">
12
- <input type="text" name="user_email" id="user_email" placeholder="<?php esc_html_e("Email", WCP_FOLDER) ?>">
13
  </div>
14
  <div class="folder-form-field">
15
- <textarea type="text" name="textarea_text" id="textarea_text" placeholder="<?php esc_html_e("How can I help you?", WCP_FOLDER) ?>"></textarea>
16
  </div>
17
  <div class="form-button">
18
  <button type="submit" class="folder-help-button" ><?php esc_html_e("Chat") ?></button>
@@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
24
  </div>
25
  <div class="folder-help-btn">
26
  <!-- Free/Pro Only URL Change -->
27
- <a class="folder-help-tooltip" href="javascript:;"><img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/owner.png") ?>" alt="<?php esc_html_e("Need help?", WCP_FOLDER) ?>" /></a>
28
  </div>
29
  <script>
30
  jQuery(document).ready(function(){
@@ -43,19 +43,19 @@ if ( ! defined( 'ABSPATH' ) ) exit;
43
  responseArray = jQuery.parseJSON(responseText);
44
  if(responseArray.error == 1) {
45
  jQuery(".folder-help-button").attr("disabled",false);
46
- jQuery(".folder-help-button").text("<?php esc_html_e("Chat", WCP_FOLDER) ?>");
47
  for(i=0;i<responseArray.errors.length;i++) {
48
  jQuery("#"+responseArray.errors[i]['key']).addClass("input-error");
49
  jQuery("#"+responseArray.errors[i]['key']).after('<span class="error-message">'+responseArray.errors[i]['message']+'</span>');
50
  }
51
  } else if(responseArray.status == 1) {
52
- jQuery(".folder-help-button").text("<?php esc_html_e("Done!", WCP_FOLDER) ?>");
53
  setTimeout(function(){
54
  jQuery(".folder-help-header").remove();
55
- jQuery(".folder-help-content").html("<p class='success-p'><?php esc_html_e("Your message is sent successfully.", WCP_FOLDER) ?></p>");
56
  },1000);
57
  } else if(responseArray.status == 0) {
58
- jQuery(".folder-help-content").html("<p class='error-p'><?php esc_html_e("There is some problem in sending request. Please send us mail on <a href='mailto:contact@premio.io'>contact@premio.io</a>", WCP_FOLDER) ?></p>");
59
  }
60
  }
61
  });
7
  <b>Gal Dubinski</b> Co-Founder at Premio
8
  </div>
9
  <div class="folder-help-content">
10
+ <p><?php esc_html_e("Hello! Are you experiencing any problems with Folders? Please let me know :)", 'folders'); ?></p>
11
  <div class="folder-form-field">
12
+ <input type="text" name="user_email" id="user_email" placeholder="<?php esc_html_e("Email", 'folders'); ?>">
13
  </div>
14
  <div class="folder-form-field">
15
+ <textarea type="text" name="textarea_text" id="textarea_text" placeholder="<?php esc_html_e("How can I help you?", 'folders'); ?>"></textarea>
16
  </div>
17
  <div class="form-button">
18
  <button type="submit" class="folder-help-button" ><?php esc_html_e("Chat") ?></button>
24
  </div>
25
  <div class="folder-help-btn">
26
  <!-- Free/Pro Only URL Change -->
27
+ <a class="folder-help-tooltip" href="javascript:;"><img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/owner.png") ?>" alt="<?php esc_html_e("Need help?", 'folders'); ?>" /></a>
28
  </div>
29
  <script>
30
  jQuery(document).ready(function(){
43
  responseArray = jQuery.parseJSON(responseText);
44
  if(responseArray.error == 1) {
45
  jQuery(".folder-help-button").attr("disabled",false);
46
+ jQuery(".folder-help-button").text("<?php esc_html_e("Chat", 'folders'); ?>");
47
  for(i=0;i<responseArray.errors.length;i++) {
48
  jQuery("#"+responseArray.errors[i]['key']).addClass("input-error");
49
  jQuery("#"+responseArray.errors[i]['key']).after('<span class="error-message">'+responseArray.errors[i]['message']+'</span>');
50
  }
51
  } else if(responseArray.status == 1) {
52
+ jQuery(".folder-help-button").text("<?php esc_html_e("Done!", 'folders'); ?>");
53
  setTimeout(function(){
54
  jQuery(".folder-help-header").remove();
55
+ jQuery(".folder-help-content").html("<p class='success-p'><?php esc_html_e("Your message is sent successfully.", 'folders'); ?></p>");
56
  },1000);
57
  } else if(responseArray.status == 0) {
58
+ jQuery(".folder-help-content").html("<p class='error-p'><?php esc_html_e("There is some problem in sending request. Please send us mail on <a href='mailto:contact@premio.io'>contact@premio.io</a>", 'folders'); ?></p>");
59
  }
60
  }
61
  });
templates/admin/media-replace.php CHANGED
@@ -37,12 +37,10 @@ if(isset($customize_folders['show_folder_in_settings']) && $customize_folders['s
37
  } else {
38
  $upgradeURL = admin_url("admin.php?page=folders-upgrade-to-pro");
39
  }
 
40
  ?>
41
  <div class="wrap">
42
  <h2><?php esc_html_e("Replace Media", "folders"); ?></h2>
43
- <div class="file-type warning replace-message">
44
- <?php esc_html_e("Replacement file is not the same filetype. This might cause unexpected issues", "folders"); ?>
45
- </div>
46
  <form enctype="multipart/form-data" method="POST" action="<?php echo esc_url($form_action) ?>">
47
  <div class="replace-media-page">
48
  <p><b><?php esc_html_e("Current File", "folders") ?></b>: <?php echo esc_attr($file_name) ?></p>
@@ -93,6 +91,71 @@ if(isset($customize_folders['show_folder_in_settings']) && $customize_folders['s
93
  </div>
94
  <div class="clearfix"></div>
95
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  <div class="replace-media-buttons">
97
  <button type="submit" class="button button-primary" disabled><?php echo esc_html_e("Replace File", "folders") ?></button>
98
  <button type="button" class="button button-secondary" onclick="history.back();"><?php echo esc_html_e("Cancel", "folders") ?></button>
37
  } else {
38
  $upgradeURL = admin_url("admin.php?page=folders-upgrade-to-pro");
39
  }
40
+ $current_date = date_i18n('d/M/Y H:i', strtotime($attachment->post_date) )
41
  ?>
42
  <div class="wrap">
43
  <h2><?php esc_html_e("Replace Media", "folders"); ?></h2>
 
 
 
44
  <form enctype="multipart/form-data" method="POST" action="<?php echo esc_url($form_action) ?>">
45
  <div class="replace-media-page">
46
  <p><b><?php esc_html_e("Current File", "folders") ?></b>: <?php echo esc_attr($file_name) ?></p>
91
  </div>
92
  <div class="clearfix"></div>
93
  </div>
94
+
95
+ <div class="file-type warning replace-message">
96
+ <?php esc_html_e("Replacement file is not the same filetype. This might cause unexpected issues", "folders"); ?>
97
+ </div>
98
+
99
+ <div class="media-bottom-box pro">
100
+ <div class="media-bottom-pro">
101
+ <div class="media-bottom-box-left">
102
+ <div class="media-setting">
103
+ <div class="media-title"><?php esc_html_e("Replacement Options", "folders") ?></div>
104
+ <div class="media-form">
105
+ <div class="media-option">
106
+ <label for="replace_only_file"><input type="radio" checked name="replacement_option" value="replace_only_file" id="replace_only_file" /> <?php esc_html_e("Just replace the file", "folders") ?></label>
107
+ </div>
108
+ <div class="media-note">
109
+ <?php esc_html_e("Note: This option requires you to upload a file of the same type (png) as the one you are replacing. The name of the attachment will stay the same (image.png) no matter what the file you upload is called.", "folders"); ?>
110
+ </div>
111
+ <div class="media-option">
112
+ <label for="replace_file_with_name"><input type="radio" name="replacement_option" value="replace_file_with_name" id="replace_file_with_name" /> <?php esc_html_e("Replace the file, use new file name and update all links", "folders") ?></label>
113
+ </div>
114
+ <div class="media-note">
115
+ <?php esc_html_e("Note: If you check this option, the name and type of the file you are about to upload will replace the old file. All links pointing to the current file (image.png) will be updated to point to the new file name. (If any other websites link to the file directly, those links will no longer work. Be careful.)", "folders"); ?>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ <div class="media-bottom-box-right">
121
+ <div class="media-setting">
122
+ <div class="media-title"><?php esc_html_e("Date Options", "folders") ?></div>
123
+ <div class="media-form">
124
+ <div class="media-note">
125
+ <?php esc_html_e("When replacing the media, do you want to:", "folders"); ?>
126
+ </div>
127
+ <ul>
128
+ <li>
129
+ <label for="replace_date"><input type="radio" name="date_options" value="replace_date" id="replace_date" /> <?php esc_html_e("Replace the date", "folders") ?></label>
130
+ </li>
131
+ <li>
132
+ <label for="keep_date"><input type="radio" checked name="date_options" value="keep_date" id="keep_date" /> <?php esc_html_e("Keep the date", "folders") ?> <small>(<?php echo esc_attr($current_date) ?>)</small></label>
133
+ </li>
134
+ <li>
135
+ <label for="select_custom_date"><input type="radio" name="date_options" value="custom_date" id="select_custom_date" /> <?php esc_html_e("Set a Custom Date", "folders") ?></label>
136
+ </li>
137
+ </ul>
138
+ <div class="custom-date" id="custom-date">
139
+ <label for="custom_date"><?php esc_html_e("Custom date", "folders"); ?></label>
140
+ <span class="inline"><input type="text" class="media-date" name="custom_date" value="<?php echo date("F j, Y") ?>" id="custom_date"></span><span class="inline-block">@</span><span class="inline"><input type="text" name="custom_date_hour" class="media-time" value="<?php echo date("m") ?>" id="custom_date_hour"></span><span class="inline-block">:</span><span class="inline"><input type="text" class="media-time" name="custom_date_min" value="<?php echo date("i") ?>" id="custom_date_min"></span>
141
+ </div>
142
+ <div class="custom-date" id="custom-path">
143
+ <input type="hidden" name="new_folder_option" value="0">
144
+ <label for="new_folder_option"><input type="checkbox" id="new_folder_option" name="new_folder_option" value="1"><?php esc_html_e("Put new Upload in Updated Folder", "folders"); ?></label>
145
+ <span class="inline"><input type="text" class="media-date" name="new_folder_path" value="<?php echo date("Y/m") ?>" id="new_folder_path"></span>
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </div>
150
+ <div class="clear"></div>
151
+ </div>
152
+ <div class="media-bottom-pro-button">
153
+ <div class="pro-button">
154
+ <a target="_blank" href="<?php echo esc_url($upgradeURL) ?>"><?php esc_html_e("Upgrade to Pro", "folders") ?></a>
155
+ </div>
156
+ </div>
157
+ </div>
158
+
159
  <div class="replace-media-buttons">
160
  <button type="submit" class="button button-primary" disabled><?php echo esc_html_e("Replace File", "folders") ?></button>
161
  <button type="button" class="button button-secondary" onclick="history.back();"><?php echo esc_html_e("Cancel", "folders") ?></button>
templates/admin/recommended-plugins.php CHANGED
@@ -144,8 +144,8 @@ if ( $data && ! is_wp_error( $data ) ) {
144
  ?>
145
  <div class="wrap mystickyelement-wrap recommended-plugins">
146
  <h2>
147
- <?php _e('Try out our recommended plugins', WCP_FOLDER); ?>
148
- <a class="hide-recommended-btn" href="#" class=""><?php _e('Hide From Menu', WCP_FOLDER);?></a>
149
  </h2>
150
  </div>
151
  <div class="wrap recommended-plugins">
144
  ?>
145
  <div class="wrap mystickyelement-wrap recommended-plugins">
146
  <h2>
147
+ <?php _e('Try out our recommended plugins', 'folders'); ?>
148
+ <a class="hide-recommended-btn" href="#" class=""><?php _e('Hide From Menu', 'folders');?></a>
149
  </h2>
150
  </div>
151
  <div class="wrap recommended-plugins">
templates/admin/update.php CHANGED
@@ -1,95 +1,257 @@
1
- <?php if(!defined('ABSPATH')) exit; ?>
2
  <style>
 
 
 
3
 
4
- .updates-form-form {
5
- min-height: calc(100vh - 280px);
 
 
 
 
 
6
  }
7
- .popup-form-content {
8
- background: #ffffff;
9
- min-height: 100px;
10
- width: 450px;
11
- text-align: center;
12
- margin-top: 50px;
13
- border: solid 1px #c1c1c1;
14
  }
15
- .updates-content-buttons button {
16
- margin: 10px 3px !important;
17
- float: left;
18
  }
19
- .updates-content-buttons a span {
20
- -webkit-animation: fa-spin 0.75s infinite linear;
21
- animation: fa-spin 0.75s infinite linear;
 
 
 
 
 
 
22
  }
23
- .updates-content-buttons a:hover, .updates-content-buttons a:focus {
24
- color: #ffffff;
25
- background-image: linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1));
 
 
 
 
26
  }
27
- .updates-content-buttons a:focus {
28
- outline: 0;
29
- box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(50,100,150,.4);
30
  }
31
- .updates-content-buttons button.form-cancel-btn {
32
- float: right !important;
33
  }
34
- .form-submit-btn {
35
- background-color: #3085d6;
 
 
 
 
 
 
 
 
 
 
36
  }
37
- .updates-content-buttons a span {
38
- -webkit-animation: fa-spin 0.75s infinite linear;
39
- animation: fa-spin 0.75s infinite linear;
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
- .add-update-title {
42
- font-size: 20px;
43
- line-height: 30px;
44
- padding: 20px 20px 0;
 
 
 
 
45
  }
46
- .folder-update-input {
47
- padding: 10px 20px;
48
  }
49
- .folder-update-input input {
50
- width: 100%;
51
- transition: border-color .3s,box-shadow .3s;
52
- border: 1px solid #d9d9d9;
53
- border-radius: .1875em;
54
- font-size: 1.125em;
55
- box-shadow: inset 0 1px 1px rgba(0,0,0,.06);
56
- box-sizing: border-box;
57
- height: 2.625em;
58
- margin: 1em auto;
59
  }
60
- .updates-content-buttons {
61
- background: #c1c1c1;
62
- padding: 0 20px;
 
 
 
63
  }
64
-
65
  </style>
66
- <div class="updates-form-form" >
67
- <div class="popup-form-content">
68
- <div id="add-update-title" class="add-update-title">
69
- Would you like to get feature updates for Folders in real-time?
70
- </div>
71
- <div class="folder-update-input">
72
- <input id="folder_update_email" autocomplete="off" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="Email address">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  </div>
74
- <div class="updates-content-buttons">
75
- <button href="javascript:;" class="button button-primary form-submit-btn yes">Yes, I want</button>
76
- <button href="javascript:;" class="button button-secondary form-cancel-btn no">Skip</button>
77
- <div style="clear: both"></div>
78
  </div>
79
  <input type="hidden" id="folder_update_status" value="<?php echo wp_create_nonce("folder_update_status") ?>">
80
  </div>
81
  </div>
82
  <script>
83
  jQuery(document).ready(function($) {
84
- $(document).on("click", ".updates-content-buttons button", function () {
85
  var updateStatus = 0;
86
  if ($(this).hasClass("yes")) {
87
  updateStatus = 1;
88
  }
89
- $(".updates-content-buttons button").attr("disabled", true);
90
  $.ajax({
91
  url: ajaxurl,
92
- data: "action=folder_update_status&status=" + updateStatus + "&nonce=" + $("#folder_update_status").val() + "&email=" + $("#folder_update_email").val(),
93
  type: 'post',
94
  cache: false,
95
  success: function () {
1
+ <?php if (!defined('ABSPATH')) { exit; } ?>
2
  <style>
3
+ body {
4
+ background: #ffffff !important;
5
+ }
6
 
7
+ .chaty-updates-form {
8
+ width: 768px;
9
+ padding: 70px 40px;
10
+ box-shadow: 0px 20px 25px rgb(0 0 0 / 10%), 0px 10px 10px rgb(0 0 0 / 4%);
11
+ display: flex;
12
+ margin: 100px auto 0;
13
+ font-family: Rubik, sans-serif;
14
  }
15
+ .update-title {
16
+ font-style: normal;
17
+ font-weight: 500;
18
+ font-size: 26px;
19
+ line-height: 150%;
20
+ align-items: center;
21
+ color: #334155;
22
  }
23
+ .updates-form-form-left {
24
+ padding: 50px 20px 50px 0;
 
25
  }
26
+ .updates-form-form-right p {
27
+ font-style: normal;
28
+ font-weight: normal;
29
+ font-size: 14px;
30
+ line-height: 150%;
31
+ position: relative;
32
+ padding: 0 0 20px 0;
33
+ color: #475569;
34
+ margin: 40px 0;
35
  }
36
+ .updates-form-form-right p:after {
37
+ content: "";
38
+ border: 1px solid #3C85F7;
39
+ position: absolute;
40
+ bottom: 5px;
41
+ left: 0;
42
+ width: 90px;
43
  }
44
+ .updates-form {
45
+ display: flex;
 
46
  }
47
+ .update-form-input {
48
+ position: relative;
49
  }
50
+ .update-form-input input {
51
+ width: 320px;
52
+ background: #F4F4F5;
53
+ border: 1px solid #F4F4F5;
54
+ box-sizing: border-box;
55
+ border-radius: 4px;
56
+ height: 40px;
57
+ line-height: 40px;
58
+ padding: 0 50px 0 40px;
59
+ font-size: 13px;
60
+ box-sizing: border-box;
61
+ color: #334155;
62
  }
63
+ .update-form-input .form-submit-btn {
64
+ background: #3C85F7;
65
+ border-radius: 4px;
66
+ border: none;
67
+ color: #fff;
68
+ font-style: normal;
69
+ font-weight: 500;
70
+ font-size: 13px;
71
+ line-height: 150%;
72
+ height: 34px;
73
+ padding: 0 10px;
74
+ position: absolute;
75
+ right: 3px;
76
+ top: 3px;
77
+ cursor: pointer;
78
  }
79
+ .updates-form .form-cancel-btn.no {
80
+ margin: 0 0 0 3px;
81
+ background: transparent;
82
+ border: none;
83
+ color: #64748B;
84
+ font-size: 13px;
85
+ line-height: 40px;
86
+ padding: 0 0 0 5px;
87
  }
88
+ .updates-form .form-cancel-btn.no:hover {
89
+ color: #334155;
90
  }
91
+ .mail-icon {
92
+ position: absolute;
93
+ top: 8px;
94
+ left: 10px;
 
 
 
 
 
 
95
  }
96
+ .update-notice {
97
+ margin: 50px 0 0 0;
98
+ font-size: 12px;
99
+ padding: 0 110px 0 0;
100
+ line-height: 150%;
101
+ color: #64748B;
102
  }
 
103
  </style>
104
+ <div class="chaty-updates-form">
105
+ <div class="updates-form-form-left">
106
+ <svg width="261" height="243" viewBox="0 0 261 243" fill="none" xmlns="http://www.w3.org/2000/svg">
107
+ <path d="M10.6418 144.346C10.6418 144.346 10.4222 143.702 10.0669 142.505" stroke="#69F0AE" stroke-width="9" stroke-miterlimit="10"/>
108
+ <path opacity="0.6" d="M9.02692 138.772C1.17536 108.652 -23.303 -30.1614 222.082 56.4967" stroke="#3C85F7" stroke-width="9" stroke-miterlimit="10" stroke-dasharray="12.04 12.04"/>
109
+ <path d="M223.919 57.1403L225.744 57.7839" stroke="#69F0AE" stroke-width="9" stroke-miterlimit="10"/>
110
+ <path d="M195.688 164.197C195.69 157.688 193.254 151.414 188.857 146.6C184.46 141.787 178.418 138.782 171.915 138.173C165.411 137.563 158.913 139.394 153.693 143.306C148.472 147.218 144.905 152.93 143.689 159.325L63.0771 157.146L63.9621 170.945C63.9621 170.945 52.4674 197.37 112.88 204.411V231.12H182.721V186.712C186.665 184.412 189.936 181.123 192.211 177.174C194.486 173.224 195.684 168.75 195.688 164.197Z" fill="url(#paint0_linear)"/>
111
+ <path d="M66.7297 171.524C66.7297 171.524 55.7227 196.83 113.577 203.581V229.169H180.463V161.4L65.8706 158.308L66.7297 171.524Z" fill="#F6B9AD"/>
112
+ <path d="M100.158 65.922C98.4136 68.6639 95.6514 70.6067 92.4743 71.326C89.2972 72.0453 85.9635 71.4827 83.2014 69.7609L47.2896 46.1834C44.5376 44.4457 42.5876 41.6936 41.8657 38.5282C41.1437 35.3627 41.7085 32.0413 43.4365 29.2894C45.1804 26.551 47.9403 24.6107 51.1143 23.8915C54.2883 23.1724 57.6189 23.7327 60.3799 25.4504L96.2916 49.028C99.0458 50.7635 100.998 53.5147 101.723 56.6803C102.447 59.8459 101.885 63.1685 100.158 65.922Z" fill="url(#paint1_linear)"/>
113
+ <path d="M98.1685 64.6316C96.5474 67.1803 93.9798 68.9862 91.0267 69.6548C88.0735 70.3235 84.9747 69.8005 82.4073 68.2002L49.0148 46.2831C46.4567 44.668 44.6441 42.1098 43.973 39.1675C43.3019 36.2251 43.8268 33.1378 45.433 30.5797C47.0541 28.0311 49.6216 26.2252 52.5748 25.5565C55.528 24.8879 58.6267 25.4108 61.1942 27.0111L94.5803 48.9314C97.1385 50.5455 98.9518 53.1026 99.6241 56.0442C100.296 58.9859 99.7731 62.0731 98.1685 64.6316Z" fill="#F6B9AD"/>
114
+ <path d="M167.763 190.085C181.635 190.085 192.881 178.88 192.881 165.059C192.881 151.238 181.635 140.034 167.763 140.034C153.891 140.034 142.645 151.238 142.645 165.059C142.645 178.88 153.891 190.085 167.763 190.085Z" fill="#F6B9AD"/>
115
+ <path d="M163.242 0H67.0204C64.8353 0 63.064 1.76486 63.064 3.94193V183.327C63.064 185.504 64.8353 187.269 67.0204 187.269H163.242C165.427 187.269 167.198 185.504 167.198 183.327V3.94193C167.198 1.76486 165.427 0 163.242 0Z" fill="url(#paint2_linear)"/>
116
+ <path d="M161.384 2.53249H68.8776C66.4445 2.53249 64.4722 4.49761 64.4722 6.92171V180.354C64.4722 182.778 66.4445 184.743 68.8776 184.743H161.384C163.817 184.743 165.79 182.778 165.79 180.354V6.92171C165.79 4.49761 163.817 2.53249 161.384 2.53249Z" fill="white"/>
117
+ <path opacity="0.9" d="M140.584 7.0987C140.291 9.03104 139.314 10.7951 137.829 12.0717C136.344 13.3484 134.449 14.0533 132.487 14.059H97.4962C95.5353 14.0525 93.6414 13.3472 92.1569 12.0707C90.6725 10.7941 89.6954 9.0305 89.4024 7.0987H70.8635C70.3581 7.09827 69.8576 7.19709 69.3905 7.38951C68.9234 7.58192 68.499 7.86415 68.1415 8.22008C67.7839 8.576 67.5003 8.99864 67.3068 9.46383C67.1133 9.92902 67.0137 10.4277 67.0137 10.9312V176.331C67.0132 176.835 67.1124 177.334 67.3056 177.799C67.4987 178.264 67.7819 178.687 68.1392 179.044C68.4964 179.4 68.9206 179.682 69.3875 179.875C69.8544 180.068 70.3549 180.167 70.8603 180.167H159.401C159.906 180.168 160.407 180.069 160.874 179.876C161.341 179.684 161.766 179.402 162.123 179.046C162.481 178.69 162.764 178.267 162.958 177.802C163.151 177.337 163.251 176.838 163.251 176.335V10.9344C163.251 10.4309 163.152 9.93216 162.959 9.4668C162.766 9.00145 162.483 8.57858 162.125 8.22235C161.768 7.86613 161.344 7.58354 160.877 7.39074C160.41 7.19793 159.91 7.0987 159.404 7.0987H140.584Z" fill="#3C85F7"/>
118
+ <path d="M125.919 9.28044H104.631C104.275 9.28044 103.985 9.56858 103.985 9.92402V10.0431C103.985 10.3985 104.275 10.6867 104.631 10.6867H125.919C126.275 10.6867 126.565 10.3985 126.565 10.0431V9.92402C126.565 9.56858 126.275 9.28044 125.919 9.28044Z" fill="#DBDBDB"/>
119
+ <path d="M131.36 10.6867C131.828 10.6867 132.207 10.3092 132.207 9.84356C132.207 9.37794 131.828 9.00047 131.36 9.00047C130.893 9.00047 130.514 9.37794 130.514 9.84356C130.514 10.3092 130.893 10.6867 131.36 10.6867Z" fill="#DBDBDB"/>
120
+ <path d="M184.002 169.471C176.713 171.151 171.71 166.414 170.024 159.154L153.275 97.1903C152.474 93.6895 153.096 90.0153 155.005 86.9699C156.915 83.9246 159.956 81.7557 163.464 80.9367C166.978 80.1391 170.666 80.7591 173.722 82.6612C176.779 84.5634 178.956 87.5933 179.778 91.0892L193.446 154.643C195.132 161.915 191.289 167.791 184.002 169.471Z" fill="url(#paint3_linear)"/>
121
+ <path d="M177.898 92.6093C176.477 86.4812 170.339 82.6613 164.188 84.0772C158.038 85.4931 154.204 91.6086 155.625 97.7367L171.027 164.152C172.448 170.28 178.586 174.1 184.737 172.684C190.887 171.268 194.721 165.152 193.3 159.024L177.898 92.6093Z" fill="#F6B9AD"/>
122
+ <path d="M192.778 220.796H97.1768V243H192.778V220.796Z" fill="url(#paint4_linear)"/>
123
+ <path d="M190.194 223.371H99.7607V240.747H190.194V223.371Z" fill="#FF8976"/>
124
+ <path d="M136.46 58.6881L129.051 53.1308L132.281 48.9475L126.891 44.7321L123.522 48.9862L115.903 43.2744C115.613 43.0574 115.26 42.9401 114.897 42.9401C114.534 42.9401 114.181 43.0574 113.891 43.2744L93.695 58.2537C92.9296 58.8973 92.2126 59.6342 92.2061 61.3204H92.1835L92.1318 84.3992V85.4257C92.131 85.7562 92.1955 86.0835 92.3216 86.3892C92.4478 86.6948 92.6331 86.9727 92.867 87.207C93.101 87.4412 93.3789 87.6273 93.685 87.7545C93.9911 87.8818 94.3194 87.9477 94.6511 87.9485H95.6458L114.795 87.9904L134.942 88.0354C135.274 88.0363 135.603 87.972 135.909 87.8463C136.216 87.7207 136.495 87.536 136.73 87.3029C136.965 87.0699 137.152 86.7929 137.28 86.488C137.407 86.183 137.474 85.8559 137.474 85.5255L137.529 61.462H137.571C137.571 59.7726 137.226 59.3317 136.46 58.6881Z" fill="url(#paint5_linear)"/>
125
+ <path d="M135.582 61.8127C135.582 60.2746 135.259 59.882 134.568 59.2867L115.812 45.2341C115.547 45.0359 115.225 44.9288 114.893 44.9288C114.562 44.9288 114.24 45.0359 113.975 45.2341L95.5488 58.9037C95.1056 59.2192 94.749 59.6406 94.512 60.1293C94.275 60.6179 94.1651 61.1581 94.1923 61.7001H94.173L94.1245 82.7581V83.6945C94.1237 84.3033 94.3653 84.8875 94.7965 85.3189C95.2277 85.7503 95.8131 85.9936 96.4241 85.9953H97.3317L114.805 86.0339L133.185 86.0757C133.796 86.0766 134.383 85.8358 134.816 85.4062C135.249 84.9766 135.493 84.3934 135.495 83.7846L135.543 61.8288L135.582 61.8127Z" fill="url(#paint6_linear)"/>
126
+ <path d="M94.5117 61.7844L135.152 61.8763L135.101 84.1538C135.101 84.3304 135.065 84.5052 134.997 84.6683C134.929 84.8313 134.829 84.9794 134.703 85.104C134.578 85.2286 134.429 85.3274 134.265 85.3946C134.101 85.4618 133.925 85.4962 133.748 85.4958L95.9598 85.4104C95.5649 85.4095 95.1865 85.2523 94.9079 84.9735C94.6293 84.6947 94.4733 84.317 94.4742 83.9236L94.5246 61.7844L94.5117 61.7844Z" fill="#6C63FF"/>
127
+ <path opacity="0.2" d="M94.5117 61.7844L135.152 61.8763L135.101 84.1538C135.101 84.3304 135.065 84.5052 134.997 84.6683C134.929 84.8313 134.829 84.9794 134.703 85.104C134.578 85.2286 134.429 85.3274 134.265 85.3946C134.101 85.4618 133.925 85.4962 133.748 85.4958L95.9598 85.4104C95.5649 85.4095 95.1865 85.2523 94.9079 84.9735C94.6293 84.6947 94.4733 84.317 94.4742 83.9236L94.5246 61.7844L94.5117 61.7844Z" fill="white"/>
128
+ <path d="M94.5154 61.7773L94.4702 82.24C94.4694 82.6528 94.5502 83.0618 94.7079 83.4436C94.8657 83.8253 95.0975 84.1724 95.3899 84.4649C95.6823 84.7575 96.0297 84.9897 96.4122 85.1485C96.7947 85.3073 97.2049 85.3894 97.6192 85.3903L131.948 85.4675" fill="#F5F5F5"/>
129
+ <path d="M135.158 61.8674L135.113 82.3429C135.112 82.7558 135.03 83.1645 134.871 83.5456C134.711 83.9267 134.478 84.2728 134.184 84.5641C133.891 84.8555 133.542 85.0863 133.159 85.2435C132.776 85.4008 132.366 85.4813 131.951 85.4804L97.6221 85.4032" fill="white"/>
130
+ <path d="M113.972 45.7682L95.885 59.0582C95.4505 59.3626 95.1004 59.7715 94.8672 60.2469C94.634 60.7223 94.5252 61.2488 94.5511 61.7773L135.211 61.906C135.211 60.4097 134.888 60.0171 134.216 59.4508L115.79 45.7747C115.528 45.5777 115.21 45.4705 114.882 45.4694C114.554 45.4682 114.235 45.5731 113.972 45.7682Z" fill="#6C63FF"/>
131
+ <path opacity="0.2" d="M113.972 45.7682L95.885 59.0582C95.4505 59.3626 95.1004 59.7715 94.8672 60.2469C94.634 60.7223 94.5252 61.2488 94.5511 61.7773L135.211 61.906C135.211 60.4097 134.888 60.0171 134.216 59.4508L115.79 45.7747C115.528 45.5777 115.21 45.4705 114.882 45.4694C114.554 45.4682 114.235 45.5731 113.972 45.7682Z" fill="black"/>
132
+ <path d="M130.757 50.3924L125.838 46.5502L113.949 61.5521L107.561 56.6158L103.559 61.684L112.858 68.7602L115.164 70.604L130.757 50.3924Z" fill="url(#paint7_linear)"/>
133
+ <path d="M130.395 50.299L125.938 46.8945L114.126 62.2407L107.567 57.2304L104.146 61.6711L112.935 68.3772L115.189 70.0602L130.395 50.299Z" fill="white"/>
134
+ <path d="M92.4451 99.6939C90.7137 102.415 87.972 104.343 84.8186 105.057C81.6652 105.771 78.3563 105.213 75.6148 103.504L45.0935 83.7041C42.3622 81.9791 40.427 79.2474 39.7105 76.1056C38.994 72.9638 39.5545 69.6671 41.2694 66.9356C43.0008 64.2144 45.7426 62.2863 48.896 61.5724C52.0494 60.8586 55.3582 61.417 58.0998 63.1256L88.621 82.9254C91.3523 84.6504 93.2875 87.3821 94.004 90.5239C94.7205 93.6657 94.16 96.9624 92.4451 99.6939Z" fill="url(#paint8_linear)"/>
135
+ <path d="M90.8236 98.6513C89.2025 101.2 86.6349 103.006 83.6817 103.675C80.7285 104.343 77.6298 103.82 75.0623 102.22L46.4757 83.6752C43.9176 82.06 42.1051 79.5019 41.434 76.5595C40.7628 73.6172 41.2877 70.5298 42.8939 67.9718C44.515 65.4231 47.0826 63.6172 50.0358 62.9486C52.9889 62.2799 56.0877 62.8028 58.6551 64.4031L87.2418 82.9479C89.7998 84.5631 91.6124 87.1212 92.2835 90.0635C92.9546 93.0059 92.4298 96.0933 90.8236 98.6513Z" fill="#F6B9AD"/>
136
+ <path d="M86.218 132.394C84.4951 135.104 81.7661 137.023 78.6271 137.734C75.488 138.445 72.1942 137.889 69.4652 136.188L45.3776 120.662C42.6583 118.945 40.7314 116.226 40.0179 113.099C39.3044 109.971 39.8623 106.689 41.5697 103.97C43.2925 101.261 46.0216 99.3413 49.1606 98.6305C52.2996 97.9196 55.5935 98.4754 58.3225 100.177L82.4068 115.706C85.1258 117.422 87.0527 120.14 87.7668 123.267C88.4809 126.394 87.924 129.675 86.218 132.394Z" fill="url(#paint9_linear)"/>
137
+ <path d="M80.1721 165.262C78.434 167.996 75.6803 169.934 72.5127 170.651C69.3452 171.369 66.0214 170.808 63.2676 169.091L48.3493 158.247C45.6051 156.515 43.6604 153.771 42.9402 150.616C42.2201 147.46 42.7829 144.148 44.5059 141.404C46.2461 138.672 49.0007 136.737 52.1681 136.022C55.3355 135.307 58.6582 135.87 61.4105 137.588L76.3287 148.429C79.0703 150.161 81.0131 152.902 81.7331 156.056C82.4532 159.21 81.892 162.519 80.1721 165.262Z" fill="url(#paint10_linear)"/>
138
+ <path d="M78.9674 164.454C77.3463 167.003 74.7787 168.809 71.8255 169.477C68.8723 170.146 65.7736 169.623 63.2061 168.023L49.2955 157.912C46.7375 156.297 44.9249 153.739 44.2538 150.797C43.5827 147.854 44.1075 144.767 45.7137 142.209C47.3348 139.66 49.9024 137.854 52.8556 137.186C55.8088 136.517 58.9075 137.04 61.475 138.64L75.3856 148.751C77.9436 150.366 79.7562 152.924 80.4273 155.866C81.0984 158.809 80.5736 161.896 78.9674 164.454Z" fill="#F6B9AD"/>
139
+ <path d="M148.074 104.122H82.187V123.751H148.074V104.122Z" fill="url(#paint11_linear)"/>
140
+ <path d="M145.814 106.052H84.4482V120.211H145.814V106.052Z" fill="#69F0AE"/>
141
+ <path d="M259.84 69.0305L261 69.2107L260.819 69.0401H260.916L260.764 68.9886L239.741 49.1245L234.638 57.1468L230.395 64.4643L232.361 64.77L231.489 68.7344L259.84 69.0305Z" fill="url(#paint12_linear)"/>
142
+ <path d="M235.52 57.5651L231.645 64.2615L260.066 68.8728L241.76 56.1717L235.52 57.5651Z" fill="#6C63FF"/>
143
+ <path opacity="0.2" d="M235.52 57.5651L231.645 64.2615L260.066 68.8728L241.76 56.1717L235.52 57.5651Z" fill="black"/>
144
+ <path d="M240.188 50.2283L260.067 68.8728L235.521 57.5651L240.188 50.2283Z" fill="#6C63FF"/>
145
+ <path d="M232.691 68.197L259.989 68.7151L234.506 59.6985L232.691 68.197Z" fill="#6C63FF"/>
146
+ <path d="M84.8936 131.554C83.2725 134.103 80.7049 135.909 77.7517 136.578C74.7985 137.246 71.6998 136.723 69.1323 135.123L46.4723 120.514C43.9142 118.899 42.1017 116.34 41.4305 113.398C40.7594 110.456 41.2843 107.368 42.8905 104.81C44.509 102.259 47.0754 100.45 50.0288 99.7781C52.9822 99.1063 56.0823 99.6268 58.6517 101.226L81.3118 115.835C83.8743 117.45 85.69 120.011 86.3613 122.958C87.0326 125.904 86.5049 128.995 84.8936 131.554Z" fill="#F6B9AD"/>
147
+ <defs>
148
+ <linearGradient id="paint0_linear" x1="129.387" y1="231.132" x2="129.387" y2="138.061" gradientUnits="userSpaceOnUse">
149
+ <stop stop-color="#808080" stop-opacity="0.25"/>
150
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
151
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
152
+ </linearGradient>
153
+ <linearGradient id="paint1_linear" x1="24916.3" y1="14199" x2="24916.3" y2="7023.87" gradientUnits="userSpaceOnUse">
154
+ <stop stop-color="#808080" stop-opacity="0.25"/>
155
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
156
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
157
+ </linearGradient>
158
+ <linearGradient id="paint2_linear" x1="56806.2" y1="122524" x2="56806.2" y2="13540.6" gradientUnits="userSpaceOnUse">
159
+ <stop stop-color="#808080" stop-opacity="0.25"/>
160
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
161
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
162
+ </linearGradient>
163
+ <linearGradient id="paint3_linear" x1="29845.7" y1="53620" x2="29845.7" y2="28883.9" gradientUnits="userSpaceOnUse">
164
+ <stop stop-color="#808080" stop-opacity="0.25"/>
165
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
166
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
167
+ </linearGradient>
168
+ <linearGradient id="paint4_linear" x1="61020.9" y1="18572.5" x2="61020.9" y2="17040.4" gradientUnits="userSpaceOnUse">
169
+ <stop stop-color="#808080" stop-opacity="0.25"/>
170
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
171
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
172
+ </linearGradient>
173
+ <linearGradient id="paint5_linear" x1="114.85" y1="88.0322" x2="114.85" y2="42.9365" gradientUnits="userSpaceOnUse">
174
+ <stop stop-opacity="0.12"/>
175
+ <stop offset="0.55" stop-opacity="0.09"/>
176
+ <stop offset="1" stop-opacity="0.02"/>
177
+ </linearGradient>
178
+ <linearGradient id="paint6_linear" x1="22673.8" y1="14029.1" x2="22673.8" y2="8768.08" gradientUnits="userSpaceOnUse">
179
+ <stop stop-color="#808080" stop-opacity="0.25"/>
180
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
181
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
182
+ </linearGradient>
183
+ <linearGradient id="paint7_linear" x1="15019" y1="7079.44" x2="15023" y2="5279.5" gradientUnits="userSpaceOnUse">
184
+ <stop stop-opacity="0.12"/>
185
+ <stop offset="0.55" stop-opacity="0.09"/>
186
+ <stop offset="1" stop-opacity="0.02"/>
187
+ </linearGradient>
188
+ <linearGradient id="paint8_linear" x1="21783.4" y1="17691.5" x2="21783.4" y2="11649.7" gradientUnits="userSpaceOnUse">
189
+ <stop stop-color="#808080" stop-opacity="0.25"/>
190
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
191
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
192
+ </linearGradient>
193
+ <linearGradient id="paint9_linear" x1="18747.1" y1="20007.7" x2="18747.1" y2="15107.8" gradientUnits="userSpaceOnUse">
194
+ <stop stop-color="#808080" stop-opacity="0.25"/>
195
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
196
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
197
+ </linearGradient>
198
+ <linearGradient id="paint10_linear" x1="15098.2" y1="21407.6" x2="15098.2" y2="17548.1" gradientUnits="userSpaceOnUse">
199
+ <stop stop-color="#808080" stop-opacity="0.25"/>
200
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
201
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
202
+ </linearGradient>
203
+ <linearGradient id="paint11_linear" x1="22956.9" y1="7652.93" x2="22956.9" y2="6455.55" gradientUnits="userSpaceOnUse">
204
+ <stop stop-opacity="0.12"/>
205
+ <stop offset="0.55" stop-opacity="0.09"/>
206
+ <stop offset="1" stop-opacity="0.02"/>
207
+ </linearGradient>
208
+ <linearGradient id="paint12_linear" x1="21383.9" y1="21299.4" x2="22083.3" y2="20191.7" gradientUnits="userSpaceOnUse">
209
+ <stop stop-color="#808080" stop-opacity="0.25"/>
210
+ <stop offset="0.54" stop-color="#808080" stop-opacity="0.12"/>
211
+ <stop offset="1" stop-color="#808080" stop-opacity="0.1"/>
212
+ </linearGradient>
213
+ </defs>
214
+ </svg>
215
+ </div>
216
+ <div class="updates-form-form-right">
217
+ <div class="update-title">Be first</div>
218
+ <p>Be among the first to know about our latest features & what we're working on. Plus, insider offer & flash sales.</p>
219
+ <div class="updates-form">
220
+ <div class="update-form-input">
221
+ <div class="mail-icon">
222
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
223
+ <mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="2" y="4" width="20" height="16">
224
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6ZM20 6L12 11L4 6H20ZM12 13L4 8V18H20V8L12 13Z" fill="white"/>
225
+ </mask>
226
+ <g mask="url(#mask0)">
227
+ <rect width="24" height="24" fill="#94A3B8"/>
228
+ </g>
229
+ </svg>
230
+ </div>
231
+ <input id="chaty_update_email" autocomplete="off" value="<?php echo get_option( 'admin_email' ) ?>" placeholder="Email address">
232
+ <button href="javascript:;" class="form-submit-btn yes">Sign Up</button>
233
+ </div>
234
+ <div class="update-form-skip-button">
235
+ <button href="javascript:;" class="form-cancel-btn no">Skip</button>
236
+ </div>
237
  </div>
238
+ <div class="update-notice">
239
+ You can remove yourself from the list whenever you want, no strings attached 😛
 
 
240
  </div>
241
  <input type="hidden" id="folder_update_status" value="<?php echo wp_create_nonce("folder_update_status") ?>">
242
  </div>
243
  </div>
244
  <script>
245
  jQuery(document).ready(function($) {
246
+ $(document).on("click", ".updates-form button", function () {
247
  var updateStatus = 0;
248
  if ($(this).hasClass("yes")) {
249
  updateStatus = 1;
250
  }
251
+ $(".updates-form button").attr("disabled", true);
252
  $.ajax({
253
  url: ajaxurl,
254
+ data: "action=folder_update_status&status=" + updateStatus + "&nonce=" + $("#folder_update_status").val() + "&email=" + $("#chaty_update_email").val(),
255
  type: 'post',
256
  cache: false,
257
  success: function () {
templates/admin/upgrade-table.php CHANGED
@@ -15,7 +15,7 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
15
  <div class="price-table-top">
16
  <div class="price-head">
17
  <div class="plan-name">Basic</div>
18
- <div class="plan-price">$25<span>/year</span></div>
19
  </div>
20
  <div class="price-websites">For small website owners</div>
21
  <div class="price-offer">Renewals for <b>25% off</b></div>
@@ -25,10 +25,30 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
25
  <li><a href="javascript:;" class="cus-tooltip">1 website <span class="has-tooltip">*</span><span class="tooltip__content">Use Folders on 1 domain</span></a></li>
26
  <li><a href="javascript:;">Organize pages, posts, and media files</a></li>
27
  <li><a href="javascript:;" class="cus-tooltip">Unlimited subfolders (with multilevel support)<span class="has-tooltip">*</span><span class="tooltip__content">Create unlimited folders, sub-folders with multi-level support</span></a></li>
 
 
 
 
 
 
 
 
 
 
28
  <li><a href="javascript:;" class="cus-tooltip">Create folders for each post type. I.e. WooCommerce, Elementor<span class="has-tooltip">*</span><span class="tooltip__content">Use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)</span></a></li>
29
- <li><a href="javascript:;" class="cus-tooltip">Metadata details on Media Library hover<span class="has-tooltip">*</span><span class="tooltip__content">Show useful metadata including title, size, type, date, dimension & more on hover.</span></a></li>
 
 
 
 
 
 
 
 
 
30
  <li><a href="javascript:;" class="cus-tooltip">Sort folders based on the date<span class="has-tooltip">*</span><span class="tooltip__content">Sort folders based on the creation date of the folders</span></a></li>
31
- <li><a href="javascript:;" class="cus-tooltip">Replace media of all types and compare them while replacing<span class="has-tooltip">*</span><span class="tooltip__content">Replace all types of media files including PDF/SVG/ZIP/DOCX/XSLX & more. While replacing compare the two files side by side</span></a></li>
 
32
  <li><a href="javascript:;" class="cus-tooltip">Default folder while uploading media<span class="has-tooltip">*</span><span class="tooltip__content">Upload files to a default folder if no other folder is selected while uploading</span></a></li>
33
  <li><a href="javascript:;" class="cus-tooltip">Sticky folders & folder bookmarking<span class="has-tooltip">*</span><span class="tooltip__content">Pin selected folders on top of the navigation for easier access</span></a></li>
34
  <li><a href="javascript:;" class="cus-tooltip">Duplicate folders<span class="has-tooltip">*</span><span class="tooltip__content">Duplicate an existing folder with all its content</span></a></li>
@@ -40,12 +60,12 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
40
  <div class="price-table-bottom">
41
  <div class="custom-dd">
42
  <select class="multiple-options">
43
- <option data-option="1_year" data-header="Renewals for 25% off" data-price="25" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=1">Updates &amp; support for 1 year</option>
44
- <option data-option="2_year" data-header="For 2 years" data-price="39" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=13">Updates &amp; support for 2 years</option>
45
- <option data-option="lifetime" data-header="For lifetime" data-price="79" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=5">Updates &amp; support for lifetime</option>
46
  </select>
47
  </div>
48
- <a class="cart-link" target="_blank" href="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=1">Buy now</a>
49
  </div>
50
  <div class="bottom-position"></div>
51
  </div>
@@ -55,7 +75,7 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
55
  <div class="price-table-top">
56
  <div class="price-head">
57
  <div class="plan-name">Plus</div>
58
- <div class="plan-price">$59<span>/year</span></div>
59
  </div>
60
  <div class="price-websites">For businesses with multiple websites</div>
61
  <div class="price-offer">Renewals for <b>25% off</b></div>
@@ -65,10 +85,30 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
65
  <li><a href="javascript:;" class="cus-tooltip">5 website <span class="has-tooltip">*</span><span class="tooltip__content">Use Folders on 5 domains</span></a></li>
66
  <li><a href="javascript:;">Organize pages, posts, and media files</a></li>
67
  <li><a href="javascript:;" class="cus-tooltip">Unlimited subfolders (with multilevel support)<span class="has-tooltip">*</span><span class="tooltip__content">Create unlimited folders, sub-folders with multi-level support</span></a></li>
 
 
 
 
 
 
 
 
 
 
68
  <li><a href="javascript:;" class="cus-tooltip">Create folders for each post type. I.e. WooCommerce, Elementor<span class="has-tooltip">*</span><span class="tooltip__content">Use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)</span></a></li>
69
- <li><a href="javascript:;" class="cus-tooltip">Metadata details on Media Library hover<span class="has-tooltip">*</span><span class="tooltip__content">Show useful metadata including title, size, type, date, dimension & more on hover.</span></a></li>
 
 
 
 
 
 
 
 
 
70
  <li><a href="javascript:;" class="cus-tooltip">Sort folders based on the date<span class="has-tooltip">*</span><span class="tooltip__content">Sort folders based on the creation date of the folders</span></a></li>
71
- <li><a href="javascript:;" class="cus-tooltip">Replace media of all types and compare them while replacing<span class="has-tooltip">*</span><span class="tooltip__content">Replace all types of media files including PDF/SVG/ZIP/DOCX/XSLX & more. While replacing compare the two files side by side</span></a></li>
 
72
  <li><a href="javascript:;" class="cus-tooltip">Default folder while uploading media<span class="has-tooltip">*</span><span class="tooltip__content">Upload files to a default folder if no other folder is selected while uploading</span></a></li>
73
  <li><a href="javascript:;" class="cus-tooltip">Sticky folders & folder bookmarking<span class="has-tooltip">*</span><span class="tooltip__content">Pin selected folders on top of the navigation for easier access</span></a></li>
74
  <li><a href="javascript:;" class="cus-tooltip">Duplicate folders<span class="has-tooltip">*</span><span class="tooltip__content">Duplicate an existing folder with all its content</span></a></li>
@@ -80,12 +120,12 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
80
  <div class="price-table-bottom">
81
  <div class="custom-dd">
82
  <select class="multiple-options">
83
- <option data-option="1_year" data-header="Renewals for 25% off" data-price="59" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=2">Updates &amp; support for 1 year</option>
84
- <option data-option="2_year" data-header="For 2 years" data-price="89" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=14">Updates &amp; support for 2 years</option>
85
- <option data-option="lifetime" data-header="For lifetime" data-price="149" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=7">Updates &amp; support for lifetime</option>
86
  </select>
87
  </div>
88
- <a class="cart-link" target="_blank" href="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=2">Buy now</a>
89
  </div>
90
  <div class="bottom-position"></div>
91
  </div>
@@ -95,7 +135,7 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
95
  <div class="price-table-top">
96
  <div class="price-head">
97
  <div class="plan-name">Agency</div>
98
- <div class="plan-price">$99<span>/year</span></div>
99
  </div>
100
  <div class="price-websites">For agencies who manage clients</div>
101
  <div class="price-offer">Renewals for <b>25% off</b></div>
@@ -113,10 +153,29 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
113
  </li>
114
  <li><a href="javascript:;">Organize pages, posts, and media files</a></li>
115
  <li><a href="javascript:;" class="cus-tooltip">Unlimited subfolders (with multilevel support)<span class="has-tooltip">*</span><span class="tooltip__content">Create unlimited folders, sub-folders with multi-level support</span></a></li>
 
 
 
 
 
 
 
 
 
 
116
  <li><a href="javascript:;" class="cus-tooltip">Create folders for each post type. I.e. WooCommerce, Elementor<span class="has-tooltip">*</span><span class="tooltip__content">Use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)</span></a></li>
117
- <li><a href="javascript:;" class="cus-tooltip">Metadata details on Media Library hover<span class="has-tooltip">*</span><span class="tooltip__content">Show useful metadata including title, size, type, date, dimension & more on hover.</span></a></li>
 
 
 
 
 
 
 
 
118
  <li><a href="javascript:;" class="cus-tooltip">Sort folders based on the date<span class="has-tooltip">*</span><span class="tooltip__content">Sort folders based on the creation date of the folders</span></a></li>
119
- <li><a href="javascript:;" class="cus-tooltip">Replace media of all types and compare them while replacing<span class="has-tooltip">*</span><span class="tooltip__content">Replace all types of media files including PDF/SVG/ZIP/DOCX/XSLX & more. While replacing compare the two files side by side</span></a></li>
 
120
  <li><a href="javascript:;" class="cus-tooltip">Default folder while uploading media<span class="has-tooltip">*</span><span class="tooltip__content">Upload files to a default folder if no other folder is selected while uploading</span></a></li>
121
  <li><a href="javascript:;" class="cus-tooltip">Sticky folders & folder bookmarking<span class="has-tooltip">*</span><span class="tooltip__content">Pin selected folders on top of the navigation for easier access</span></a></li>
122
  <li><a href="javascript:;" class="cus-tooltip">Duplicate folders<span class="has-tooltip">*</span><span class="tooltip__content">Duplicate an existing folder with all its content</span></a></li>
@@ -128,12 +187,12 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
128
  <div class="price-table-bottom">
129
  <div class="custom-dd">
130
  <select class="multiple-options has-multiple-websites">
131
- <option data-option="1_year" data-header="Renewals for 25% off" data-price="99" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=10">Updates &amp; support for 1 year</option>
132
- <option data-option="2_year" data-header="For 2 years" data-price="149" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=15">Updates &amp; support for 2 years</option>
133
- <option data-option="lifetime" data-header="For lifetime" data-price="249" value="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=12">Updates &amp; support for lifetime</option>
134
  </select>
135
  </div>
136
- <a class="cart-link" target="_blank" href="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=10">Buy now</a>
137
  </div>
138
  <div class="bottom-position"></div>
139
  </div>
@@ -144,10 +203,10 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
144
  </div>
145
  <div class="text-center price-after">
146
  <p class="money-guaranteed"><span class="dashicons dashicons-yes"></span>
147
- <?php esc_html_e("30 days money back guaranteed", WCP_FOLDER); ?>
148
  </p>
149
  <p class="money-guaranteed"><span class="dashicons dashicons-yes"></span>
150
- <?php esc_html_e("The plugin will always keep working even if you don't renew your license", WCP_FOLDER); ?>
151
  </p>
152
  <div class="payments">
153
  <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/payment.png") ?>" alt="Payment" class="payment-img" />
@@ -183,44 +242,44 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
183
  var priceOptions = {
184
  "50_websites": {
185
  "1_year": {
186
- "price": 99,
187
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=10"
188
  },
189
  "2_year": {
190
- "price": 149,
191
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=15"
192
  },
193
  "lifetime": {
194
- "price": 249,
195
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=12"
196
  }
197
  },
198
  "500_websites": {
199
  "1_year": {
200
- "price": 179,
201
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=16"
202
  },
203
  "2_year": {
204
- "price": 269,
205
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=17"
206
  },
207
  "lifetime": {
208
- "price": 449,
209
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=18"
210
  }
211
  },
212
  "1000_websites": {
213
  "1_year": {
214
- "price": 249,
215
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=19"
216
  },
217
  "2_year": {
218
- "price": 375,
219
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=20"
220
  },
221
  "lifetime": {
222
- "price": 619,
223
- "link": "https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=21"
224
  }
225
  }
226
  };
@@ -300,6 +359,40 @@ $pro_url = "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_opt
300
  $(this).closest(".price-table").find(".price-table-bottom").outerWidth($(this).closest(".price-table").width());
301
  }
302
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
  }));
305
  </script>
15
  <div class="price-table-top">
16
  <div class="price-head">
17
  <div class="plan-name">Basic</div>
18
+ <div class="plan-price">$39<span>/year</span></div>
19
  </div>
20
  <div class="price-websites">For small website owners</div>
21
  <div class="price-offer">Renewals for <b>25% off</b></div>
25
  <li><a href="javascript:;" class="cus-tooltip">1 website <span class="has-tooltip">*</span><span class="tooltip__content">Use Folders on 1 domain</span></a></li>
26
  <li><a href="javascript:;">Organize pages, posts, and media files</a></li>
27
  <li><a href="javascript:;" class="cus-tooltip">Unlimited subfolders (with multilevel support)<span class="has-tooltip">*</span><span class="tooltip__content">Create unlimited folders, sub-folders with multi-level support</span></a></li>
28
+ <li><a href="javascript:;" class="cus-tooltip">
29
+ <span class="html-tooltip dynamic last">
30
+ Dynamic Folders<span class="has-tooltip">*</span>
31
+ <span class="tooltip-text" style="">
32
+ <?php esc_html_e("Automatically filter posts/pages/custom posts/media files based on author, date, file types & more", "folders") ?>
33
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/dynamic-folders.gif") ?>">
34
+ </span>
35
+ </span>
36
+ </a>
37
+ </li>
38
  <li><a href="javascript:;" class="cus-tooltip">Create folders for each post type. I.e. WooCommerce, Elementor<span class="has-tooltip">*</span><span class="tooltip__content">Use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)</span></a></li>
39
+ <li><a href="javascript:;" class="cus-tooltip">
40
+ <span class="html-tooltip last">
41
+ Metadata details on Media Library hover <span class="has-tooltip">*</span>
42
+ <span class="tooltip-text " style="">
43
+ <?php esc_html_e("Show useful metadata including title, size, type, date, dimension & more on hover.", "folders") ?>
44
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/folders-media.gif") ?>">
45
+ </span>
46
+ </span>
47
+ </a>
48
+ </li>
49
  <li><a href="javascript:;" class="cus-tooltip">Sort folders based on the date<span class="has-tooltip">*</span><span class="tooltip__content">Sort folders based on the creation date of the folders</span></a></li>
50
+ <li><a href="javascript:;" class="cus-tooltip">Replace media for all file types and update file names from WordPress titles<span class="has-tooltip">*</span><span class="tooltip__content">Replace all types of media files including PDF/SVG/ZIP/DOCX/XSLX & more. While replacing compare the two files side by side</span></a></li>
51
+ <li><a href="javascript:;" class="cus-tooltip">Advanced Media Replacements<span class="has-tooltip">*</span><span class="tooltip__content">Replace media files when uploading and update all references in the database, change dates, organize by newer date & more without hurting your SEO</span></a></li>
52
  <li><a href="javascript:;" class="cus-tooltip">Default folder while uploading media<span class="has-tooltip">*</span><span class="tooltip__content">Upload files to a default folder if no other folder is selected while uploading</span></a></li>
53
  <li><a href="javascript:;" class="cus-tooltip">Sticky folders & folder bookmarking<span class="has-tooltip">*</span><span class="tooltip__content">Pin selected folders on top of the navigation for easier access</span></a></li>
54
  <li><a href="javascript:;" class="cus-tooltip">Duplicate folders<span class="has-tooltip">*</span><span class="tooltip__content">Duplicate an existing folder with all its content</span></a></li>
60
  <div class="price-table-bottom">
61
  <div class="custom-dd">
62
  <select class="multiple-options">
63
+ <option data-option="1_year" data-header="Renewals for 25% off" data-price="39" value="<?php echo $pro_url ?>22">Updates &amp; support for 1 year</option>
64
+ <option data-option="2_year" data-header="For 2 years" data-price="59" value="<?php echo $pro_url ?>23">Updates &amp; support for 2 years</option>
65
+ <option data-option="lifetime" data-header="For lifetime" data-price="119" value="<?php echo $pro_url ?>24">Updates &amp; support for lifetime</option>
66
  </select>
67
  </div>
68
+ <a class="cart-link" target="_blank" href="<?php echo $pro_url ?>22">Buy now</a>
69
  </div>
70
  <div class="bottom-position"></div>
71
  </div>
75
  <div class="price-table-top">
76
  <div class="price-head">
77
  <div class="plan-name">Plus</div>
78
+ <div class="plan-price">$89<span>/year</span></div>
79
  </div>
80
  <div class="price-websites">For businesses with multiple websites</div>
81
  <div class="price-offer">Renewals for <b>25% off</b></div>
85
  <li><a href="javascript:;" class="cus-tooltip">5 website <span class="has-tooltip">*</span><span class="tooltip__content">Use Folders on 5 domains</span></a></li>
86
  <li><a href="javascript:;">Organize pages, posts, and media files</a></li>
87
  <li><a href="javascript:;" class="cus-tooltip">Unlimited subfolders (with multilevel support)<span class="has-tooltip">*</span><span class="tooltip__content">Create unlimited folders, sub-folders with multi-level support</span></a></li>
88
+ <li><a href="javascript:;" class="cus-tooltip">
89
+ <span class="html-tooltip dynamic last">
90
+ Dynamic Folders<span class="has-tooltip">*</span>
91
+ <span class="tooltip-text top" style="">
92
+ <?php esc_html_e("Automatically filter posts/pages/custom posts/media files based on author, date, file types & more", "folders") ?>
93
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/dynamic-folders.gif") ?>">
94
+ </span>
95
+ </span>
96
+ </a>
97
+ </li>
98
  <li><a href="javascript:;" class="cus-tooltip">Create folders for each post type. I.e. WooCommerce, Elementor<span class="has-tooltip">*</span><span class="tooltip__content">Use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)</span></a></li>
99
+ <li><a href="javascript:;" class="cus-tooltip">
100
+ <span class="html-tooltip last">
101
+ Metadata details on Media Library hover <span class="has-tooltip">*</span>
102
+ <span class="tooltip-text" style="">
103
+ <?php esc_html_e("Show useful metadata including title, size, type, date, dimension & more on hover.", "folders") ?>
104
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/folders-media.gif") ?>">
105
+ </span>
106
+ </span>
107
+ </a>
108
+ </li>
109
  <li><a href="javascript:;" class="cus-tooltip">Sort folders based on the date<span class="has-tooltip">*</span><span class="tooltip__content">Sort folders based on the creation date of the folders</span></a></li>
110
+ <li><a href="javascript:;" class="cus-tooltip">Replace media for all file types and update file names from WordPress titles<span class="has-tooltip">*</span><span class="tooltip__content">Replace all types of media files including PDF/SVG/ZIP/DOCX/XSLX & more. While replacing compare the two files side by side</span></a></li>
111
+ <li><a href="javascript:;" class="cus-tooltip">Advanced Media Replacements<span class="has-tooltip">*</span><span class="tooltip__content">Replace media files when uploading and update all references in the database, change dates, organize by newer date & more without hurting your SEO</span></a></li>
112
  <li><a href="javascript:;" class="cus-tooltip">Default folder while uploading media<span class="has-tooltip">*</span><span class="tooltip__content">Upload files to a default folder if no other folder is selected while uploading</span></a></li>
113
  <li><a href="javascript:;" class="cus-tooltip">Sticky folders & folder bookmarking<span class="has-tooltip">*</span><span class="tooltip__content">Pin selected folders on top of the navigation for easier access</span></a></li>
114
  <li><a href="javascript:;" class="cus-tooltip">Duplicate folders<span class="has-tooltip">*</span><span class="tooltip__content">Duplicate an existing folder with all its content</span></a></li>
120
  <div class="price-table-bottom">
121
  <div class="custom-dd">
122
  <select class="multiple-options">
123
+ <option data-option="1_year" data-header="Renewals for 25% off" data-price="89" value="<?php echo $pro_url ?>25">Updates &amp; support for 1 year</option>
124
+ <option data-option="2_year" data-header="For 2 years" data-price="139" value="<?php echo $pro_url ?>26">Updates &amp; support for 2 years</option>
125
+ <option data-option="lifetime" data-header="For lifetime" data-price="229" value="<?php echo $pro_url ?>27">Updates &amp; support for lifetime</option>
126
  </select>
127
  </div>
128
+ <a class="cart-link" target="_blank" href="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=25">Buy now</a>
129
  </div>
130
  <div class="bottom-position"></div>
131
  </div>
135
  <div class="price-table-top">
136
  <div class="price-head">
137
  <div class="plan-name">Agency</div>
138
+ <div class="plan-price">$149<span>/year</span></div>
139
  </div>
140
  <div class="price-websites">For agencies who manage clients</div>
141
  <div class="price-offer">Renewals for <b>25% off</b></div>
153
  </li>
154
  <li><a href="javascript:;">Organize pages, posts, and media files</a></li>
155
  <li><a href="javascript:;" class="cus-tooltip">Unlimited subfolders (with multilevel support)<span class="has-tooltip">*</span><span class="tooltip__content">Create unlimited folders, sub-folders with multi-level support</span></a></li>
156
+ <li><a href="javascript:;" class="cus-tooltip">
157
+ <span class="html-tooltip dynamic last">
158
+ Dynamic Folders<span class="has-tooltip">*</span>
159
+ <span class="tooltip-text top" style="">
160
+ <?php esc_html_e("Automatically filter posts/pages/custom posts/media files based on author, date, file types & more", "folders") ?>
161
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/dynamic-folders.gif") ?>">
162
+ </span>
163
+ </span>
164
+ </a>
165
+ </li>
166
  <li><a href="javascript:;" class="cus-tooltip">Create folders for each post type. I.e. WooCommerce, Elementor<span class="has-tooltip">*</span><span class="tooltip__content">Use folders with other plugins that have custom post type (e.g. Elementor templates, WooCommerce & more)</span></a></li>
167
+ <li><a href="javascript:;" class="cus-tooltip">
168
+ <span class="html-tooltip last">
169
+ Metadata details on Media Library hover <span class="has-tooltip">*</span>
170
+ <span class="tooltip-text top" style="">
171
+ <?php esc_html_e("Show useful metadata including title, size, type, date, dimension & more on hover.", "folders") ?>
172
+ <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/folders-media.gif") ?>">
173
+ </span>
174
+ </span>
175
+ </a></li>
176
  <li><a href="javascript:;" class="cus-tooltip">Sort folders based on the date<span class="has-tooltip">*</span><span class="tooltip__content">Sort folders based on the creation date of the folders</span></a></li>
177
+ <li><a href="javascript:;" class="cus-tooltip">Replace media for all file types and update file names from WordPress titles<span class="has-tooltip">*</span><span class="tooltip__content">Replace all types of media files including PDF/SVG/ZIP/DOCX/XSLX & more. While replacing compare the two files side by side</span></a></li>
178
+ <li><a href="javascript:;" class="cus-tooltip">Advanced Media Replacements<span class="has-tooltip">*</span><span class="tooltip__content">Replace media files when uploading and update all references in the database, change dates, organize by newer date & more without hurting your SEO</span></a></li>
179
  <li><a href="javascript:;" class="cus-tooltip">Default folder while uploading media<span class="has-tooltip">*</span><span class="tooltip__content">Upload files to a default folder if no other folder is selected while uploading</span></a></li>
180
  <li><a href="javascript:;" class="cus-tooltip">Sticky folders & folder bookmarking<span class="has-tooltip">*</span><span class="tooltip__content">Pin selected folders on top of the navigation for easier access</span></a></li>
181
  <li><a href="javascript:;" class="cus-tooltip">Duplicate folders<span class="has-tooltip">*</span><span class="tooltip__content">Duplicate an existing folder with all its content</span></a></li>
187
  <div class="price-table-bottom">
188
  <div class="custom-dd">
189
  <select class="multiple-options has-multiple-websites">
190
+ <option data-option="1_year" data-header="Renewals for 25% off" data-price="149" value="<?php echo $pro_url ?>28">Updates &amp; support for 1 year</option>
191
+ <option data-option="2_year" data-header="For 2 years" data-price="229" value="<?php echo $pro_url ?>29">Updates &amp; support for 2 years</option>
192
+ <option data-option="lifetime" data-header="For lifetime" data-price="389" value="<?php echo $pro_url ?>30">Updates &amp; support for lifetime</option>
193
  </select>
194
  </div>
195
+ <a class="cart-link" target="_blank" href="https://go.premio.io/?edd_action=add_to_cart&amp;download_id=687&amp;edd_options%5Bprice_id%5D=28">Buy now</a>
196
  </div>
197
  <div class="bottom-position"></div>
198
  </div>
203
  </div>
204
  <div class="text-center price-after">
205
  <p class="money-guaranteed"><span class="dashicons dashicons-yes"></span>
206
+ <?php esc_html_e("30 days money back guaranteed", 'folders'); ?>
207
  </p>
208
  <p class="money-guaranteed"><span class="dashicons dashicons-yes"></span>
209
+ <?php esc_html_e("The plugin will always keep working even if you don't renew your license", 'folders'); ?>
210
  </p>
211
  <div class="payments">
212
  <img src="<?php echo esc_url(WCP_FOLDER_URL."assets/images/payment.png") ?>" alt="Payment" class="payment-img" />
242
  var priceOptions = {
243
  "50_websites": {
244
  "1_year": {
245
+ "price": 149,
246
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=28"
247
  },
248
  "2_year": {
249
+ "price": 229,
250
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=29"
251
  },
252
  "lifetime": {
253
+ "price": 389,
254
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=30"
255
  }
256
  },
257
  "500_websites": {
258
  "1_year": {
259
+ "price": 279,
260
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=31"
261
  },
262
  "2_year": {
263
+ "price": 419,
264
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=32"
265
  },
266
  "lifetime": {
267
+ "price": 699,
268
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=33"
269
  }
270
  },
271
  "1000_websites": {
272
  "1_year": {
273
+ "price": 389,
274
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=34"
275
  },
276
  "2_year": {
277
+ "price": 585,
278
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=35"
279
  },
280
  "lifetime": {
281
+ "price": 959,
282
+ "link": "https://go.premio.io/?edd_action=add_to_cart&download_id=687&edd_options[price_id]=36"
283
  }
284
  }
285
  };
359
  $(this).closest(".price-table").find(".price-table-bottom").outerWidth($(this).closest(".price-table").width());
360
  }
361
  });
362
+ setTooltipPosition();
363
+ }
364
+
365
+ function setTooltipPosition() {
366
+ if($(".html-tooltip:not(.no-position)").length) {
367
+ $(".html-tooltip:not(.no-position)").each(function(){
368
+ if($(this).offset().top - $(window).scrollTop() > 540) {
369
+ $(this).addClass("top").removeClass("side").removeClass("bottom");
370
+ $(this).find(".tooltip-text").attr("style","");
371
+ $(this).find(".tooltip-text").removeClass("hide-arrow");
372
+ } else if($(window).height() - ($(this).offset().top - $(window).scrollTop()) > 460) {
373
+ $(this).addClass("bottom").removeClass("top").removeClass("side");
374
+ $(this).find(".tooltip-text").attr("style","");
375
+ $(this).find(".tooltip-text").removeClass("hide-arrow");
376
+ } else {
377
+ $(this).addClass("side").removeClass("top").removeClass("bottom");
378
+ if($(this).find(".tooltip-text").length) {
379
+ $(this).find(".tooltip-text").attr("style","");
380
+ $(this).find(".tooltip-text").removeClass("hide-arrow");
381
+
382
+ if($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50 < 0) {
383
+ $(this).find(".tooltip-text").css("margin-top", Math.abs($(this).find(".tooltip-text").offset().top - $(window).scrollTop() - 50)+"px");
384
+ $(this).find(".tooltip-text").addClass("hide-arrow");
385
+ } else {
386
+ $(this).find(".tooltip-text").attr("style","");
387
+ if(($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) > 0) {
388
+ $(this).find(".tooltip-text").css("margin-top", ((-1)*Math.abs($(this).find(".tooltip-text").offset().top + parseInt($(this).find(".tooltip-text").outerHeight()) - $(window).scrollTop() - $(window).height()) - 10)+"px");
389
+ $(this).find(".tooltip-text").addClass("hide-arrow");
390
+ }
391
+ }
392
+ }
393
+ }
394
+ });
395
+ }
396
  }
397
  }));
398
  </script>