PluginProbe ʕ •ᴥ•ʔ
Download Manager / 3.3.63
Download Manager v3.3.63
3.3.63 3.3.62 3.3.61 3.3.60 3.3.59 3.3.58 3.3.57 3.3.56 trunk 2.1.3 2.3.0 2.5.96 2.5.97 2.6.2 2.6.96 2.8.3 2.9.99 3.0.4 3.1.05 3.1.07 3.1.08 3.1.11 3.1.12 3.1.14 3.1.17 3.1.18 3.1.22 3.1.23 3.1.24 3.1.25 3.1.26 3.1.27 3.1.28 3.2.04 3.2.13 3.2.14 3.2.16 3.2.18 3.2.19 3.2.21 3.2.22 3.2.23 3.2.24 3.2.25 3.2.27 3.2.28 3.2.29 3.2.30 3.2.31 3.2.32 3.2.33 3.2.34 3.2.35 3.2.37 3.2.38 3.2.39 3.2.40 3.2.41 3.2.42 3.2.43 3.2.44 3.2.45 3.2.46 3.2.47 3.2.48 3.2.49 3.2.50 3.2.51 3.2.52 3.2.53 3.2.54 3.2.55 3.2.56 3.2.57 3.2.58 3.2.59 3.2.60 3.2.61 3.2.63 3.2.64 3.2.65 3.2.66 3.2.67 3.2.68 3.2.69 3.2.70 3.2.71 3.2.72 3.2.73 3.2.74 3.2.75 3.2.76 3.2.77 3.2.78 3.2.79 3.2.80 3.2.81 3.2.82 3.2.83 3.2.84 3.2.85 3.2.86 3.2.87 3.2.88 3.2.89 3.2.90 3.2.91 3.2.92 3.2.93 3.2.94 3.2.95 3.2.96 3.2.97 3.2.98 3.2.99 3.3.00 3.3.01 3.3.02 3.3.03 3.3.04 3.3.05 3.3.06 3.3.07 3.3.08 3.3.09 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.15 3.3.16 3.3.17 3.3.18 3.3.19 3.3.20 3.3.21 3.3.22 3.3.23 3.3.24 3.3.25 3.3.26 3.3.27 3.3.28 3.3.29 3.3.30 3.3.31 3.3.32 3.3.33 3.3.34 3.3.35 3.3.36 3.3.37 3.3.38 3.3.39 3.3.40 3.3.41 3.3.42 3.3.43 3.3.44 3.3.45 3.3.46 3.3.47 3.3.48 3.3.49 3.3.50 3.3.51 3.3.52 3.3.53 3.3.54 3.3.55
download-manager / src / AssetManager / views / asset-manager-picker.php
download-manager / src / AssetManager / views Last commit date
asset-manager-picker.php 7 months ago asset-manager-ui.php 1 week ago dir-viewer.php 9 months ago embed-asset.php 5 years ago
asset-manager-picker.php
1340 lines
1 <?php
2 if(!defined('ABSPATH')) die('Error!');
3 global $wp_scripts;
4
5 ?>
6 <!DOCTYPE html>
7 <html style="background: transparent">
8 <head>
9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10 <meta name="viewport" content="width=device-width,initial-scale=1.0">
11 <title><?php _e('Asset Manager Picker', 'download-manager') ?></title>
12
13 <link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/adminui/css/base.min.css" />
14 <link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/admin-styles.min.css" />
15 <link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/simple-scrollbar.min.css" />
16 <link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/fontawesome/css/all.css" />
17 <script src="<?php echo includes_url(); ?>/js/jquery/jquery.js"></script>
18 <script src="<?php echo includes_url(); ?>/js/jquery/jquery.form.min.js"></script>
19 <script src="<?php echo WPDM_BASE_URL; ?>assets/js/wpdm.min.js"></script>
20 <script src="<?php echo WPDM_BASE_URL; ?>assets/js/front.js"></script>
21 <script src="<?php echo WPDM_BASE_URL; ?>assets/js/vue.min.js"></script>
22
23 <?php
24 //wp_head();
25 \WPDM\__\Apply::googleFont();
26 ?>
27 <style>
28 @import url("https://fonts.googleapis.com/css2?family=Overpass+Mono&subset=latin");
29 html, body{
30 overflow: visible;
31 height: 100%;
32 width: 100%;
33 padding: 0;
34 margin: 0;
35 font-weight: 300;
36 font-size: 10pt;
37 font-family: var(--wpdm-font);
38 }
39 h4.modal-title{
40 font-weight: 700;
41 text-transform: uppercase;
42 letter-spacing: 1px;
43 color: #555555;
44 font-size: 11pt;
45 display: inline-block;
46 font-family: var(--wpdm-font);
47 }
48
49 .w3eden label{
50 font-weight: 400;
51 }
52 img{
53 max-width: 100%;
54 }
55
56 .c-pointer{
57 color: #1272d2;
58 transition: all ease-in-out 300ms;
59 }
60 .c-pointer:hover{
61 color: #2c92fa;
62 }
63 .d-inline-block{
64 display: inline-block !important;
65 }
66
67 .modal-backdrop{
68 background: rgba(0,0,0,0);
69 transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
70 }
71 .modal-backdrop.show{
72 background: rgba(0,0,0,0.5);
73 }
74
75 .modal.fade{
76 opacity: 0;
77 visibility: hidden;
78 transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
79 }
80 .modal.fade.show{
81 opacity: 1;
82 visibility: visible;
83 }
84 .modal.fade .modal-dialog {
85 transform: scale(0.95) translateY(-20px);
86 opacity: 0;
87 transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
88 }
89 .modal.fade.show .modal-dialog {
90 transform: scale(1) translateY(0);
91 opacity: 1;
92 }
93
94 .modal {
95 text-align: center;
96 padding: 0!important;
97 }
98
99 .wpdm-social-lock.btn {
100 display: block;
101 width: 100%;
102 }
103
104 @media (min-width: 768px) {
105 .modal:before {
106 content: '';
107 display: inline-block;
108 height: 100%;
109 vertical-align: middle;
110 margin-right: -4px;
111 }
112
113 .modal-dialog {
114 display: inline-block;
115 text-align: left;
116 vertical-align: middle;
117 }
118
119 .wpdm-social-lock.btn {
120 display: inline-block;
121 width: 47%;
122 }
123 }
124
125 @-moz-keyframes spin {
126 from { -moz-transform: rotate(0deg); }
127 to { -moz-transform: rotate(360deg); }
128 }
129 @-webkit-keyframes spin {
130 from { -webkit-transform: rotate(0deg); }
131 to { -webkit-transform: rotate(360deg); }
132 }
133 @keyframes spin {
134 from {transform:rotate(0deg);}
135 to {transform:rotate(360deg);}
136 }
137 .spin{
138 -webkit-animation-name: spin;
139 -webkit-animation-duration: 2000ms;
140 -webkit-animation-iteration-count: infinite;
141 -webkit-animation-timing-function: linear;
142 -moz-animation-name: spin;
143 -moz-animation-duration: 2000ms;
144 -moz-animation-iteration-count: infinite;
145 -moz-animation-timing-function: linear;
146 -ms-animation-name: spin;
147 -ms-animation-duration: 2000ms;
148 -ms-animation-iteration-count: infinite;
149 -ms-animation-timing-function: linear;
150
151 animation-name: spin;
152 animation-duration: 2000ms;
153 animation-iteration-count: infinite;
154 animation-timing-function: linear;
155 display: inline-block;
156 }
157
158
159 .w3eden .card-default {
160 border-radius: 3px;
161 margin-top: 10px !important;
162 }
163 .w3eden .card-default:last-child{
164 margin-bottom: 0 !important;
165 }
166 .w3eden .card-default .card-header{
167 letter-spacing: 0.5px;
168 font-weight: 600;
169 background-color: #f6f8f9;
170 }
171
172 .w3eden .card-default .card-footer{
173 background-color: #fafafa;
174 }
175
176 .btn{
177 outline: none !important;
178 }
179 .w3eden .card{
180 margin-bottom: 0;
181 }
182 .w3eden .modal-header{
183 border: 0;
184 }
185 .w3eden .modal-content{
186 box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
187 border: 0;
188 border-radius: 3px;
189 background: transparent;
190 overflow: hidden;
191 max-width: 100%;
192 }
193 .w3eden .modal-body{
194 max-height: calc(100vh - 210px);
195 overflow-y: auto;
196 padding: 0 !important;
197 }
198
199
200 .w3eden .input-group-lg .input-group-btn .btn{
201 border-top-right-radius: 4px !important;
202 border-bottom-right-radius: 4px !important;
203 }
204 .w3eden .wpforms-field-medium{
205 max-width: 100% !important;
206 width: 100% !important;
207 }
208
209 .w3eden .input-group.input-group-lg .input-group-btn .btn {
210 font-size: 11pt !important;
211 }
212
213
214 .close{
215 position: absolute;
216 z-index: 999999;
217 top: 5px;
218 right: 5px;
219 opacity: 0 !important;
220 }
221 .modal-content:hover .close{
222 opacity: 0.8 !important;
223 }
224 .close:hover .fa-times-circle{
225 color: #ff3c54 !important;
226 }
227 .close .fa-times-circle,
228 .close:hover .fa-times-circle,
229 .modal-content:hover .close,
230 .close{
231 -webkit-transition: ease-in-out 400ms;
232 -moz-transition: ease-in-out 400ms;
233 -ms-transition: ease-in-out 400ms;
234 -o-transition: ease-in-out 400ms;
235 transition: ease-in-out 400ms;
236 }
237
238 #filelist .panel-heading{
239 padding-right: 30px;
240 }
241 .w3eden #upfile .progress-bar-info {
242 background-color: var(--color-purple);
243 }
244 #breadcrumb,
245 .list-group-item,
246 .wpdm-file-locator,
247 .wpdm-dir-locator a.explore-dir{
248 font-family: 'Overpass Mono', sans-serif !important;
249 }
250 .well-file{
251 font-family: Montserrat,sans-serif;
252 font-size: 12px;
253 line-height: 28px;
254 }
255 .progress:after{
256 position: absolute;
257 color: rgba(0,0,0,0.3);
258 width: 100%;
259 text-align: center;
260 left: 0;
261 font-family: Montserrat,sans-serif;
262 font-size: 12px;
263 text-transform: uppercase;
264 }
265 .panel-file{
266 font-size: 12px;
267 }
268 .panel-file .media-body {
269 line-height: normal;
270 display: inline-block;
271 }
272 .item_label{
273 margin-top: 5px;
274 font-size: 9pt;
275 line-height: 1;
276 display: block;
277 font-weight: 600;
278 font-family: 'Overpass Mono';
279 letter-spacing: 0.5px;
280 color: #5e6a6d;
281 }
282
283 .w3eden .well .btn-sm{
284 padding: 8px 16px;
285 }
286 .panel-file .panel-footer{
287 text-align: center;
288 }
289 .modal *{
290 font-size: 10pt;
291 }
292
293 .w3eden .modal-content{
294 border-radius: 3px !important;
295 box-shadow: 0 0 25px rgba(0,0, 0, 0.2);
296 }
297 #drag-drop-area{
298 border: 0.2rem dashed #28c83599 !important;
299 border-radius: 5px;
300 font-family: "Overpass Mono", monospace;
301 color: rgba(0,0,0,0.2);
302 font-size: 14pt;
303 }
304 #drag-drop-area .btn{
305 font-family: "Overpass Mono", monospace;
306 border-radius: 500px;
307 }
308
309 #breadcrumb{
310 margin: 10px 0 10px;
311 font-size: 9pt;
312 color: #888888;
313 }
314
315 .w3eden .panel.wpdm-file-manager-panel{
316 border: 1px solid #e7eaea !important;
317 margin: 0 !important;
318 }
319 .w3eden .panel.wpdm-file-manager-panel .panel-heading{
320 /*background: linear-gradient(to bottom, rgb(253, 255, 255) 0%,rgb(240, 243, 243) 100%);*/
321 background: rgba(240, 243, 243, 0.3);
322 border-top: 1px solid #e7eaea !important;
323 border-bottom: 1px solid #e7eaea !important;
324 /*box-shadow: 2px 0 5px rgba(18, 150, 201, 0.09);*/
325
326 }
327 .panel-heading,
328 #breadcrumb a{
329 color: #aaaaaa;
330 text-transform: unset !important;
331 font-weight: 400;
332 }
333 #breadcrumb .fa{
334 color: #8896aa;
335 display: inline-block;
336 margin-top: -2px !important;
337 vertical-align: middle;
338 margin-right: 5px;
339 margin-left: 5px;
340 }
341 .panel-file .panel-body{
342 height: 130px;
343 text-align: center;
344 }
345 #scandir .file-row,
346 #scandir .dir-row{
347 padding: 10px 10px 10px 0;
348 border-bottom: 1px solid #eeeeee;
349 -webkit-transition: all ease-in-out 300ms;
350 -moz-transition: all ease-in-out 300ms;
351 -ms-transition: all ease-in-out 300ms;
352 -o-transition: all ease-in-out 300ms;
353 transition: all ease-in-out 300ms;
354 }
355 #scandir .file-row:hover, #scandir .dir-row:hover {
356 background: rgba(0,0,0,0.02);
357 -webkit-transition: all ease-in-out 300ms;
358 -moz-transition: all ease-in-out 300ms;
359 -ms-transition: all ease-in-out 300ms;
360 -o-transition: all ease-in-out 300ms;
361 transition: all ease-in-out 300ms;
362
363 }
364 img.icon{
365 width: 38px;
366 margin-right: 5px;
367 padding: 0 !important;
368 }
369 #scandir img{
370 box-shadow: none;
371 margin-bottom: 0;
372 }
373 .action-btns-ctrl{
374 line-height: 40px;
375 width: 32px;
376 text-align: center;
377 outline: none !important;
378 margin-right: 5px;
379 }
380 .action-btns {
381 opacity: 0 !important;
382 position: absolute !important;
383 z-index: -99;
384 right: 50px;
385 white-space: nowrap;
386 -webkit-transition: all ease-in-out 400ms;
387 -moz-transition: all ease-in-out 400ms;
388 -ms-transition: all ease-in-out 400ms;
389 -o-transition: all ease-in-out 400ms;
390 transition: all ease-in-out 400ms;
391 line-height: 40px;
392 }
393 .action-btns.action-btns-show{
394 opacity: 1 !important;
395 z-index: 999;
396 }
397
398 .action-btns .btn.btn-xs {
399 width: 32px;
400 height: 28px;
401 line-height: 26px;
402 padding: 0;
403 font-size: 8pt;
404 text-align: center;
405 border-radius: 5px;
406 }
407
408 img.fm-folder{
409 box-shadow: none;
410 width: 16px;
411 display: inline-block;
412 vertical-align: middle;
413 }
414 .wpdmfm-folder-tree{
415 padding: 0;
416 margin: 0;
417 }
418
419 .wpdmfm-folder-tree li{
420 list-style: none;
421 padding: 0;
422 margin: 0;
423 font-size: 12px;
424 color: #757f8d;
425 white-space: nowrap;
426 line-height: 20px;
427 }
428 .wpdmfm-folder-tree li > .handle{
429 background: url("<?php echo WPDM_BASE_URL.'assets/images/folder.svg' ?>") left center no-repeat;
430 background-size: 16px;
431 display: inline-block;
432 width: 20px;
433 height: 20px;
434 float: left;
435 cursor: pointer;
436 }
437 .wpdmfm-folder-tree ul{
438 margin-left: 18px !important;
439 padding-left: 0;
440 }
441 .wpdmfm-folder-tree li a:visited,
442 .wpdmfm-folder-tree li a:hover,
443 .wpdmfm-folder-tree li a{
444 color: #657989;
445 text-decoration: none;
446 font-family: var(--wpdm-font);
447 cursor: pointer;
448 }
449 .wpdmfm-folder-tree li a:hover{
450 color: #6075c8;
451 }
452 .wpdmfm-folder-tree li.expanded > .handle{
453 background: url("<?php echo WPDM_BASE_URL.'assets/images/folder-o.svg' ?>") left 2px no-repeat;
454 background-size: 16px;
455 }
456 .wpdmfm-folder-tree li.busy > .handle{
457 background: url("<?php echo WPDM_BASE_URL.'assets/images/loader.svg' ?>") left no-repeat;
458 background-size: 16px;
459 }
460 .wpdm-dir-locator,
461 .wpdm-file-locator{
462 padding: 15px !important;
463 }
464 .wpdm-dir-locator{
465 background: rgba(240, 243, 243, 0.2);
466 border-right: 1px solid #e7eaea;
467 }
468
469 [data-simplebar]{
470 height: 500px;
471 min-width: 100%;
472 }
473 .wpdm-dir-locator .simplebar-content{
474 overflow-x: auto !important;
475 }
476 .wpdm-file-locator [data-simplebar]{
477 overflow-x: hidden !important;
478 }
479
480 #wpbody-content{
481 margin-bottom: 0 !important;
482 padding-bottom: 0 !important;
483 }
484
485 #mainfmc{
486 overflow: hidden;
487 }
488 .w3eden #mainfmc .btn{
489 text-transform: capitalize !important;
490 font-family: var(--wpdm-font) !important;
491 font-weight: 400 !important;
492 }
493
494 .w3eden .btn.btn-simple:not(:hover){
495 color: #7886a2;
496 border-color: #c9cfdb;
497 }
498
499 .w3eden .btn.btn-simple:hover { background-color: rgba(201, 207, 219, 0.2) !important; }
500 .w3eden .btn.btn-simple:hover:not(.btn-danger):not(.btn-info):not(.btn-primary):not(.btn-success){ color: #3c5382; }
501 .w3eden .btn.btn-simple.btn-success:hover { background-color: rgba(var(--color-success-rgb), 0.1) !important; }
502 .w3eden .btn.btn-simple.btn-primary:hover { background-color: rgba(var(--color-primary-rgb), 0.1) !important; }
503 .w3eden .btn.btn-simple.btn-danger:hover { background-color: rgba(var(--color-danger-rgb), 0.1) !important; }
504 .w3eden .btn.btn-simple.btn-info:hover { background-color: rgba(var(--color-info-rgb), 0.1) !important; }
505
506 .w3eden .btn.btn-simple:active {
507 box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.13);
508 }
509
510 #wpdmeditor{
511 position: absolute;
512 left: 0;
513 top: 0;
514 border: 0;
515 width: 100%;
516 height: calc(100vh - 148px);
517 z-index: 9;
518 box-shadow: none;
519 border-radius: 0;
520 }
521 #wpdmeditor .panel-heading{
522 border-top: 0 !important;
523 }
524 #wpdmeditor .panel-heading,
525 #wpdmeditor .panel-footer{
526 border-radius: 0;
527 }
528 #wpdmeditor #filecontent_alt,
529 #wpdmeditor #filecontent{
530 height: calc(100% - 94px);
531 width: 100%;
532 padding: 30px;
533 overflow: auto;
534 font-family: "Overpass Mono", monospace;
535 border: 0;
536 background: transparent;
537 }
538 .CodeMirror.cm-s-default.CodeMirror-wrap{
539 height: calc(100% - 94px);
540 }
541 #wpdmeditor #filecontent_alt{
542 text-align: center;
543 }
544 #wpdmeditor #filecontent_alt img{
545 max-width: 100%;
546 }
547 #filewin{
548 -webkit-transition: all ease-in-out 400ms;
549 -moz-transition: all ease-in-out 400ms;
550 -ms-transition: all ease-in-out 400ms;
551 -o-transition: all ease-in-out 400ms;
552 transition: all ease-in-out 400ms;
553 border-right: 1px solid #eee;
554 }
555
556 .w3eden #__file_settings_tabs.nav.nav-tabs > li > a{
557 box-shadow: none !important;
558 border: 1px solid #e8e8e8;
559 padding: 8px 16px;
560 font-size: 10px;
561 font-weight: 400 !important;
562 }
563 .w3eden #__file_settings_tabs.nav.nav-tabs > li.active > a{
564 border-bottom: 1px solid #ffffff;
565 }
566 .w3eden #__file_settings_tabs.nav.nav-tabs > li:not(.active) > a{
567 background: #fafafa;
568 }
569
570 .w3eden #__asset_settings .form-control.input-lg{
571 border: 0;
572 background: #ffffff; text-align: center; font-family: "Overpass Mono", monospace;font-size: 11pt !important;box-shadow: none !important;
573 }
574 .w3eden #__asset_settings .panel-default{
575 border: 1px solid #e6e6e6;
576 }
577 .w3eden #__asset_settings .panel-default .panel-heading {
578 border-bottom: 1px solid #e6e6e6;
579 background: #fafafa;
580 }
581 .w3eden #__asset_settings .panel-default .panel-footer {
582 border-top: 1px solid #e6e6e6;
583 background: #fafafa;
584 }
585
586 .allow-roles label,
587 .w3eden #__asset_settings .tab-content *,
588 .w3eden #__asset_settings .tab-content{
589 font-size: 11px;
590 }
591 .allow-roles label{
592 font-weight: 400;
593 line-height: 16px;
594 }
595 .allow-roles label input{
596 margin: 0 5px !important;
597 }
598
599 #newcomment{
600 min-height: 50px;
601 font-size: 12px !important;
602 }
603
604 #__asset_comments .asset-comment{
605 border: 1px solid #e8e8e8;
606 margin: 5px 0;
607 border-radius: 3px;
608 padding: 15px;
609 }
610 #__asset_comments .asset-comment .avatar{
611 width: 32px;
612 height: auto;
613 border-radius: 500px;
614 }
615
616 .w3eden .modal-header .close.pull-right {
617 height: 16px;
618 line-height: 16px;
619 }
620
621 #__asset_links .asset-link{
622 margin: 5px 0;
623 border: 1px solid #e8e8e8;
624 border-radius: 3px !important;
625 }
626 #__asset_links .asset-link .form-control{
627 background: #ffffff;
628 border: 0 !important;
629 box-shadow: none !important;
630 }
631 #__asset_links .asset-link .input-group-addon{
632 border: 0 !important;
633 background: #ffffff;
634 padding-right: 0;
635 color: var(--color-info);
636 }
637 #__asset_links .asset-link .btn{
638 border: 0 !important;
639 background: #ffffff;
640 color: var(--color-success);
641 border-left: 1px solid #e8e8e8 !important;
642 z-index: 2;
643 }
644 #__asset_links .asset-link .btn .fa-trash.color-danger{
645 color: var(--color-danger) !important;
646 }
647
648 .w3eden #__asset_links .asset-link.input-group-lg > .form-control, .w3eden #__asset_links .asset-link.input-group-lg > .input-group-addon, .w3eden #__asset_links .asset-link.input-group-lg > .input-group-btn > .btn {
649 height: 36px;
650 padding: 8px 12px;
651 }
652
653 .wp-video{ margin: 0 auto !important; width: 100% !important; }
654 .wp-video-shortcode,
655 .wp-audio-shortcode {
656 margin: 15px 15px 10px 15px;
657 width: calc(100% - 30px) !important;
658 }
659 .wp-video-shortcode{
660 height: auto !important;
661 }
662
663 #filelist .panel.upcompleted .panel-heading::before {
664 content: "\f560";
665 position: absolute;
666 color: #41c441;
667 right: 10px;
668 font-family: "Font Awesome 5 Free";
669 transition: all ease-in-out 400ms;
670
671 }
672 #filelist .panel.upfailed .panel-heading::before {
673 content: "\f071";
674 position: absolute;
675 color: var(--color-red);
676 right: 10px;
677 font-family: "Font Awesome 5 Free";
678 transition: all ease-in-out 400ms;
679
680 }
681
682 /* Modal animation handled by .modal.fade.show .modal-dialog */
683
684 </style>
685
686
687
688
689 <?php do_action("wpdm_modal_iframe_head"); ?>
690 </head>
691 <body class="w3eden" style="background: transparent">
692
693 <div class="modal fade" id="wpdm-asset-picker" tabindex="-1" role="dialog" aria-labelledby="wpdm-optinmagicLabel">
694 <div class="modal-dialog" role="document" style="width: 80%;max-width: calc(100% - 20px);">
695
696 <div class="modal-content">
697 <div class="modal-body">
698 <?php
699 global $current_user;
700 $root = \WPDM\AssetManager\AssetManager::root();
701 //$items = file_exists($root)?glob($root.'*', GLOB_ONLYDIR):array();
702 if(is_admin()){
703 ?>
704
705
706
707 <?php
708 }
709 ?>
710
711
712 <div class="w3eden" id="mainfmarea">
713 <?php do_action("wpdm_frontend_filemanager_top", ""); ?>
714 <div id="loadingfm" class="blockui" style="position: fixed;width: 100%;height: 100%;z-index: 99"></div>
715 <div id="mainfmc" class="panel panel-default wpdm-file-manager-panel" style="display: none;">
716 <div class="panel-body">
717 <div class="media well-sm well-file" style="margin: 0;padding: 0">
718 <div class="pull-right">
719 <button class="btn btn-primary btn-simple btn-sm ttip" title="Reload" id="reload"><i class="fa fa-sync"></i></button>
720 <button class="btn btn-danger btn-simple btn-sm" data-target="#wpdm-asset-picker" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i></button>
721 </div>
722 <h3 style="display: inline-block;font-size: 12pt;letter-spacing: 0.5px;font-weight: 400;font-family: var(--wpdm-font)">
723 <i class="fas fa-photo-video text-primary"></i> <?php echo __( "Server File Picker", "download-manager" ) ?>
724 </h3>
725 <?php /* if(!current_user_can('manage_options')){ ?>
726 <div class="media-body">
727 <div class="progress text-center" style="margin: 2px 0 0 5px;height: 27px;line-height: 27px;border-radius;border-radius: 2px;font-family: 'Overpass Mono', sans-serif !important;">
728 Used: <span id="disklimit"><i class="fa fa-sun fa-spin"></i></span> | Limit: <?php echo wpdm_user_space_limit(); ?> MB
729 <div title="15% Used" class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%;line-height: 31px;font-size: 13px;overflow: visible">
730 </div>
731 </div>
732 </div>
733 <?php } */ ?>
734 </div>
735 </div>
736 <div class="panel-heading" style="border-radius: 0;border-top: 1px solid #dddddd">
737 <div id="ldn" style="float:right;font-size: 9pt;margin-top: 10px;display: none" class="text-danger"><i class="fa fa-sun fa-spin"></i> Loading...</div>
738 <div v-if="total_pages > 1" id="__asset_pages" style="margin: 0;float: right;font-weight: 400;font-family: 'Overpass Mono', sans-serif !important;white-space: nowrap">
739 <div style="float:left;">
740 <div class="c-pointer d-inline-block" v-on:click="prevPage()"><i v-if="current_page > 1" class="fa fa-arrow-alt-circle-left"></i></div> <span class="text-muted">On Page</span> <strong>{{current_page}}</strong> <span class="text-muted">of total</span> <strong>{{total_pages}}</strong> <div class="c-pointer d-inline-block" v-if="current_page < total_pages" v-on:click="nextPage()"><i class="fa fa-arrow-alt-circle-right"></i></div>
741 </div>
742 <div style="display: inline-block;margin-left: 10px">
743 <div class="input-group input-group-xs" style="width: 90px;">
744 <input type="number" @input="event => goto_page = event.target.value" :value="current_page" :max="total_pages" min="1" placeholder="Page" class="form-control" style="min-height: 16px; line-height: 20px; height: 20px; padding: 0px; font-size: 10px;text-align: center;font-family: 'Overpass Mono', monospace;">
745 <div class="input-group-btn"><button type="button" v-on:click="gotoPage()" class="btn btn-secondary btn-xs">GO</button></div>
746 </div>
747 </div>
748 </div>
749 <div id="breadcrumb" style="margin: 0"></div>
750 </div>
751 <div class="panel-body-c" id="wpdmfm_explorer">
752
753 <div class="row" style="margin: 0">
754 <?php do_action("wpdm_frontend_filemanager_after_breadcrumb", ""); ?>
755 <div class="col-md-3 wpdm-dir-locator">
756 <div data-simplebar ss-container>
757 <ul class="wpdmfm-folder-tree" id="wpdmfm-folder-tree">
758 <li data-path="" id="<?php echo md5('home'); ?>" class="expand-dir"><i class="fa fa-hdd color-purple"></i> <a class="explore-dir" href="#" data-path=""> Home</a></li>
759 </ul>
760 </div>
761 </div>
762 <div class="col-md-6 wpdm-file-locator" id="filewin">
763 <div id="wpdmeditor" class="panel panel-default">
764 <div class="panel-heading"><div class="pull-right"><a id="close-editor" href="#"><i class="fa fa-times-circle text-muted"></i></a></div><span id="wpdmefn"></span></div>
765 <textarea id="filecontent"></textarea>
766 <div id="filecontent_alt" style="display: none"></div>
767 <div class="panel-footer text-right">
768 <button type="button" id="savefile" class="btn btn-primary"><i class="fa fa-save"></i> <?php echo __( "Save Changes", "download-manager" ) ?></button>
769 </div>
770 </div>
771 <div data-simplebar ss-container>
772 <div id="scandir">
773 </div>
774 </div>
775 </div>
776 <div class="col-md-3" id="cogwin" style="margin-right: 0;padding-right: 0;padding-left: 0;">
777 <div class="panel panel-default" style="border: 0;border-radius: 0">
778 <div class="panel-heading" style="border-radius: 0;border-top: 0 !important;margin-bottom: 1px !important;background: #fafafa;border-bottom: 1px solid #eeeeee !important;">
779 Selected Files
780 </div>
781
782 <div class="list-group" id="__file_list">
783
784 <div class="list-group-item" v-for="(file, index) in files" :id="'file_' + index">
785 <div class="media">
786 <div class="pull-right"><a href="#" class="btn-remove-file" :data-target="index"><i class="fa fa-trash text-danger"></i></a></div>
787 <div class="media-body">
788 {{file.name}}
789 </div>
790 </div>
791 </div>
792
793 </div>
794 <div class="panel-footer" style="border-bottom: 1px solid #dddddd !important;border-radius: 0">
795 <button type="button" id="attach-files" class="btn btn-primary btn-block"><?php echo __( "Attach selected files", "download-manager" )?></button>
796 </div>
797
798 </div>
799 </div>
800 <?php do_action("wpdm_frontend_filemanager_bottom", ""); ?>
801 </div>
802
803 </div>
804 </div>
805
806
807
808 <div id="dirTPL" style="display: none">
809 <div class="dir-row">
810 <div class="row panel-file panel-folder">
811
812 <div class="col-md-12">
813 <div class="media-folder media" data-id="{{dirid}}" data-path="{{path}}" style="cursor: pointer">
814 <img class="icon pull-left" src="<?php echo plugins_url('download-manager/assets/file-type-icons/folder.png'); ?>" />
815 <div class="dir-info"><div class="item_label" title="{{item}}">{{item_label}}</div><small class="color-purple">{{note}}</small></div>
816 </div>
817 </div>
818 </div>
819 </div>
820 </div>
821
822 <div id="fileTPL" style="display: none">
823
824 <div class="file-row">
825 <div class="row panel-file file-tpl">
826 <div class="col-md-12 text-left btn-open-file c-pointer btn-add-queue" data-filetype="{{contenttype}}" data-path="{{path}}" data-label="{{item_label}}" data-target="{{path_on}}">
827
828 <div class="file-info media">
829 <img class="icon pull-left" src="{{icon}}" />
830 <div class="dir-info"><div class="item_label" title="{{item}}">{{item_label}}</div><small class="color-purple">{{note}}</small></div>
831 </div>
832 </div>
833 </div>
834 </div>
835
836 </div>
837
838 </div>
839
840 <script src="<?php echo WPDM_BASE_URL ?>assets/js/simple-scrollbar.min.js"></script>
841 <script>
842 var current_path = '', editor = '', opened = '', wpdmfm_selected_files = [], wpdmfm_active_asset_settings, $ = jQuery;
843 var ajaxurl = "<?php echo admin_url('/admin-ajax.php'); ?>";
844
845 /* === assetPages === */
846 var assetPages = Vue.createApp({
847 data() {
848 return {
849 total_pages: 1,
850 current_page: 1,
851 items_per_page: 15,
852 goto_page: 1
853 };
854 },
855 methods: {
856 nextPage() {
857 let topage = this.current_page + 1;
858 topage = topage > this.total_pages ? 1 : topage;
859 WPDMAM.scanDir(current_path, topage);
860 },
861 prevPage() {
862 let topage = this.current_page - 1;
863 topage = topage < 1 ? 1 : topage;
864 WPDMAM.scanDir(current_path, topage);
865 },
866 gotoPage() {
867 WPDMAM.scanDir(current_path, this.goto_page);
868 }
869 }
870 }).mount('#__asset_pages');
871
872 /* === fileList === */
873 var fileList = Vue.createApp({
874 data() {
875 return {
876 files: []
877 };
878 }
879 }).mount('#__file_list');
880
881 /* === linkSettings === */
882 var linkSettings = Vue.createApp({
883 data() {
884 return {
885 link: {
886 access: {
887 roles: ['guest'],
888 users: ['admin']
889 }
890 }
891 };
892 },
893 methods: {
894 roleSelected(role) {
895 for (var i = 0; i < this.link.access.roles.length; i++) {
896 if (this.link.access.roles[i] === role) {
897 return true;
898 }
899 }
900 return false;
901 }
902 }
903 }).mount('#__link_settings');
904
905 /*var assetPages = new Vue({
906 el: '#__asset_pages',
907 data: {
908 total_pages: 1,
909 current_page: 1,
910 items_per_page: 15,
911 goto_page: 1
912 },
913 methods: {
914 nextPage: function () {
915 let topage = this.current_page + 1;
916 topage = topage > this.total_pages ? 1 : topage;
917 WPDMAM.scanDir(current_path, topage)
918 },
919 prevPage: function () {
920 let topage = this.current_page - 1;
921 topage = topage < 1 ? 1 : topage;
922 WPDMAM.scanDir(current_path, topage)
923 },
924 gotoPage: function() {
925 WPDMAM.scanDir(current_path, this.goto_page);
926 }
927
928 }
929 });
930
931 var fileList = new Vue({
932 el: '#__file_list',
933 data: {
934 files: []
935 }
936 });
937
938 var linkSettings = new Vue({
939 el: '#__link_settings',
940 data: {
941 link: {
942 access: {
943 roles: ['guest'],
944 users:['admin']
945 }
946 }
947 },
948 methods: {
949 roleSelected: function (role) {
950 for(var i=0; i < this.link.access.roles.length; i++){
951 if( this.link.access.roles[i] == role){
952 return true
953 }
954 }
955 return false
956 }
957 }
958 });*/
959
960 /* View in fullscreen */
961 function openFullscreen(elementid) {
962 var elem = document.getElementById(elementid);
963 if (elem.requestFullscreen) {
964 elem.requestFullscreen();
965 } else if (elem.mozRequestFullScreen) { /* Firefox */
966 elem.mozRequestFullScreen();
967 } else if (elem.webkitRequestFullscreen) { /* Chrome, Safari and Opera */
968 elem.webkitRequestFullscreen();
969 } else if (elem.msRequestFullscreen) { /* IE/Edge */
970 elem.msRequestFullscreen();
971 }
972 }
973
974 var WPDMAM = {
975 copy: function (item) {
976 localStorage.setItem("__wpdm_fm_copy", current_path+"|||"+item);
977 localStorage.setItem("__wpdm_fm_move", 0);
978 $('.btn-copy').html('<i class="fa fa-copy"></i>');
979 $('.btn-cut').html('<i class="fa fa-cut"></i>');
980 $('#btn-paste').removeAttr('disabled').attr("data-item", localStorage.getItem("__wpdm_fm_copy"));
981 },
982 cut: function (item) {
983 localStorage.setItem("__wpdm_fm_copy", current_path+"|||"+item);
984 localStorage.setItem("__wpdm_fm_move", 1);
985 $('.btn-copy').html('<i class="fa fa-copy"></i>');
986 $('.btn-cut').html('<i class="fa fa-cut"></i>');
987 $('#btn-paste').removeAttr('disabled').attr("data-item", localStorage.getItem("__wpdm_fm_copy"));
988 },
989 delete: function (filepath) {
990 if(!confirm('Are you sure?')) return false;
991 $.get(ajaxurl, {__wpdm_unlink:'<?php echo wp_create_nonce(WPDMAM_NONCE_KEY); ?>', action: 'wpdm_unlink', path: current_path, delete: filepath}, function (data) {
992 WPDMAM.scanDir(current_path);
993 });
994 },
995 scanDir: function(path, page) {
996 $('#reload').attr('disabled', 'disabled').find('.fa').addClass('fa-spin');
997 WPDM.blockUI('#filewin');
998 if(typeof page === 'undefined') page = 1;
999 localStorage.setItem('__wpdm_am_cp', path);
1000 $.get(ajaxurl, {__wpdm_scandir:'<?php echo wp_create_nonce(NONCE_KEY); ?>', action: 'wpdm_scandir', path: path, sdpage: page}, function (data) {
1001 if(data.success === true) {
1002 assetPages.total_pages = data.total_pages;
1003 assetPages.current_page = data.current_page;
1004 $('#scandir').html('');
1005 var items = data.items;
1006 $.each(items, function (index, entry) {
1007 if (entry.type == 'file') {
1008 ext = entry.contenttype.replace("/", "_");
1009 var tpl = $('#fileTPL').html();
1010 tpl = tpl.replace("{{icon}}", entry.icon);
1011 tpl = tpl.replace("{{ext}}", ext);
1012 tpl = tpl.replace("{{contenttype}}", entry.contenttype);
1013 tpl = tpl.replace(/\{\{item_label\}\}/ig, entry.item_label);
1014 tpl = tpl.replace("{{note}}", entry.note);
1015 tpl = tpl.replace("{{file_size}}", entry.file_size);
1016 tpl = tpl.replace(/\{\{path\}\}/ig, entry.path);
1017 tpl = tpl.replace(/\{\{path_on\}\}/ig, entry.wp_rel_path);
1018 tpl = tpl.replace(/\{\{item\}\}/ig, entry.item);
1019 tpl = tpl.replace(/\{\{id\}\}/ig, index);
1020 var _star = entry.featured ? 'fas' : 'far';
1021 tpl = tpl.replace(/\{\{star\}\}/ig, _star);
1022 } else {
1023 var tpl = $('#dirTPL').html();
1024 tpl = tpl.replace("{{icon}}", entry.icon);
1025 tpl = tpl.replace(/\{\{item_label\}\}/ig, entry.item_label);
1026 tpl = tpl.replace("{{note}}", entry.note);
1027 tpl = tpl.replace("{{file_size}}", entry.file_size);
1028 tpl = tpl.replace(/\{\{path\}\}/ig, entry.path);
1029 tpl = tpl.replace(/\{\{item\}\}/ig, entry.item);
1030 tpl = tpl.replace(/\{\{id\}\}/ig, index);
1031 tpl = tpl.replace(/\{\{dirid\}\}/ig, entry.id);
1032 }
1033 $('#scandir').append(tpl);
1034 });
1035 WPDM.unblockUI('#filewin');
1036 $('#reload').removeAttr('disabled', 'disabled').html("<i class='fa fa-sync'></i>");
1037 $('#breadcrumb').html(data.breadcrumb);
1038 } else {
1039 WPDM.pushNotify("<?=esc_attr__( 'Error', 'download-manager' ); ?>!", data.message, 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png', 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png');
1040 }
1041 });
1042 },
1043 searchDir: function(path, keyword) {
1044 $('#reload').attr('disabled', 'disabled').find('.fa').addClass('fa-spin');
1045 WPDM.blockUI('#filewin');
1046 if(typeof page === 'undefined') page = 1;
1047 localStorage.setItem('__wpdm_am_cp', path);
1048 $.get(ajaxurl, {__wpdm_scandir:'<?php echo wp_create_nonce(NONCE_KEY); ?>', action: 'wpdm_scandir', path: path, keyword: keyword}, function (data) {
1049 if(data.success === true) {
1050 assetPages.total_pages = data.total_pages;
1051 assetPages.current_page = data.current_page;
1052 $('#scandir').html('');
1053 var items = data.items;
1054 $.each(items, function (index, entry) {
1055 if (entry.type == 'file') {
1056 ext = entry.contenttype.replace("/", "_");
1057 var tpl = $('#fileTPL').html();
1058 tpl = tpl.replace("{{icon}}", entry.icon);
1059 tpl = tpl.replace("{{ext}}", ext);
1060 tpl = tpl.replace("{{contenttype}}", entry.contenttype);
1061 tpl = tpl.replace(/\{\{item_label\}\}/ig, entry.item_label);
1062 tpl = tpl.replace("{{note}}", entry.note);
1063 tpl = tpl.replace("{{file_size}}", entry.file_size);
1064 tpl = tpl.replace(/\{\{path\}\}/ig, entry.path);
1065 tpl = tpl.replace(/\{\{path_on\}\}/ig, entry.wp_rel_path);
1066 tpl = tpl.replace(/\{\{item\}\}/ig, entry.item);
1067 tpl = tpl.replace(/\{\{id\}\}/ig, index);
1068 var _star = entry.featured ? 'fas' : 'far';
1069 tpl = tpl.replace(/\{\{star\}\}/ig, _star);
1070 } else {
1071 var tpl = $('#dirTPL').html();
1072 tpl = tpl.replace("{{icon}}", entry.icon);
1073 tpl = tpl.replace(/\{\{item_label\}\}/ig, entry.item_label);
1074 tpl = tpl.replace("{{note}}", entry.note);
1075 tpl = tpl.replace("{{file_size}}", entry.file_size);
1076 tpl = tpl.replace(/\{\{path\}\}/ig, entry.path);
1077 tpl = tpl.replace(/\{\{item\}\}/ig, entry.item);
1078 tpl = tpl.replace(/\{\{id\}\}/ig, index);
1079 tpl = tpl.replace(/\{\{dirid\}\}/ig, entry.id);
1080 }
1081 $('#scandir').append(tpl);
1082 });
1083 WPDM.unblockUI('#filewin');
1084 $('#reload').removeAttr('disabled', 'disabled').html("<i class='fa fa-sync'></i>");
1085 $('#breadcrumb').html(data.breadcrumb);
1086 } else {
1087 WPDM.pushNotify("<?=esc_attr__( 'Error', 'download-manager' ); ?>!", data.message, 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png', 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png');
1088 }
1089 });
1090 },
1091 hideEditor: function() {
1092 $('#wpdmeditor').fadeOut();
1093 if(editor == '') return;
1094 editor.codemirror.toTextArea();
1095 $('#filecontent').val('');
1096 $('#wpdmeditor').addClass('blockui');
1097 }
1098 }
1099
1100 jQuery(function ($) {
1101
1102 //$('#wpdmfm_explorer').css('height', (window.innerHeight - 190)+'px');
1103
1104 $('#mainfmc').fadeIn();
1105 $('#loadingfm').hide();
1106
1107
1108 function refresh_scandir(path) {
1109 hide_editor();
1110 $('#reload').attr('disabled', 'disabled').find('.fa').addClass('fa-spin');
1111 WPDM.blockUI('#filewin');
1112 $.get(ajaxurl, {__wpdm_scandir:'<?php echo wp_create_nonce(NONCE_KEY); ?>', action: 'wpdm_scandir', path: path}, function (data) {
1113 if(data.success === true) {
1114 assetPages.total_pages = data.total_pages;
1115 assetPages.current_page = data.current_page;
1116 $('#scandir').html('');
1117 var items = data.items;
1118 $.each(items, function (index, entry) {
1119 if (entry.type == 'file') {
1120 var tpl = $('#fileTPL').html();
1121 tpl = tpl.replace("{{icon}}", entry.icon);
1122 tpl = tpl.replace("{{contenttype}}", entry.contenttype);
1123 tpl = tpl.replace(/\{\{item_label\}\}/ig, entry.item_label);
1124 tpl = tpl.replace("{{note}}", entry.note);
1125 tpl = tpl.replace("{{file_size}}", entry.file_size);
1126 tpl = tpl.replace(/\{\{path\}\}/ig, entry.path);
1127 tpl = tpl.replace(/\{\{path_on\}\}/ig, entry.wp_rel_path);
1128 tpl = tpl.replace(/\{\{item\}\}/ig, entry.item);
1129 tpl = tpl.replace(/\{\{id\}\}/ig, index);
1130 } else {
1131 var tpl = $('#dirTPL').html();
1132 tpl = tpl.replace("{{icon}}", entry.icon);
1133 tpl = tpl.replace("{{item_label}}", entry.item_label);
1134 tpl = tpl.replace("{{note}}", entry.note);
1135 tpl = tpl.replace("{{file_size}}", entry.file_size);
1136 tpl = tpl.replace(/\{\{path\}\}/ig, entry.path);
1137 tpl = tpl.replace(/\{\{item\}\}/ig, entry.item);
1138 tpl = tpl.replace(/\{\{id\}\}/ig, index);
1139 tpl = tpl.replace(/\{\{dirid\}\}/ig, entry.id);
1140 }
1141 $('#scandir').append(tpl);
1142 });
1143 WPDM.unblockUI('#filewin');
1144 $('#reload').removeAttr('disabled', 'disabled').html("<i class='fa fa-sync'></i>");
1145 $('#breadcrumb').html(data.breadcrumb);
1146 } else {
1147 WPDM.pushNotify("Error!", data.message, 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png', 'https://cdn0.iconfinder.com/data/icons/small-n-flat/24/678080-shield-error-256.png');
1148 }
1149 });
1150 }
1151
1152 function hide_editor() {
1153 $('#wpdmeditor').fadeOut();
1154 if(editor == '') return;
1155 editor.codemirror.toTextArea();
1156 $('#filecontent').val('');
1157 $('#wpdmeditor').addClass('blockui');
1158 }
1159
1160 function hide_settings() {
1161 $('#cogwin').hide();
1162 $('#filewin').removeClass('col-md-6').addClass('col-md-9');
1163 $('#cogwin > .panel').addClass('blockui');
1164 }
1165
1166 function expand_dir(id) {
1167 var $this = $('#'+id);
1168 $this.addClass('busy');
1169 var chid = "expanded_" + id;
1170 var slide = 1;
1171 var _ajaxurl = ajaxurl == undefined ? wpdm_url.ajax : ajaxurl;
1172 $.get(_ajaxurl, {__wpdm_scandir:'<?php echo wp_create_nonce(NONCE_KEY); ?>', action: 'wpdm_scandir', dirs: 1, path: $this.data('path')}, function (dirs){
1173 if($("#"+chid).length == 1) {
1174 $("#" + chid).remove();
1175 slide = 0;
1176 }
1177
1178 $this.append("<ul id='"+chid+"' style='display: none'></ul>");
1179 $.each(dirs, function (id, dir) {
1180 $('#'+chid).append("<li class='expand-dir' id='"+dir.id+"' data-path='"+dir.path+"'><span class='handle'></span><a href='#' class='explore-dir' data-path='"+dir.path+"'>"+dir.item_label+"</a></li>");
1181 });
1182 $this.removeClass('busy').addClass('expanded');
1183 if(slide == 1)
1184 $('#'+chid).slideDown();
1185 else
1186 $('#'+chid).show();
1187 });
1188 }
1189
1190
1191
1192 $('#reload').on('click', function () {
1193 refresh_scandir(current_path);
1194 });
1195
1196 $('body').on('click', '#attach-files', function(){
1197 window.parent.attach_server_files(fileList.files);
1198 jQuery('#wpdm-asset-picker').modal('hide');
1199 });
1200
1201 $('body').on('click', '#close-editor', function (e) {
1202 e.preventDefault();
1203 hide_editor();
1204 });
1205
1206 /*$('body').on('click', '#close-settings', function (e) {
1207 e.preventDefault();
1208 hide_settings();
1209 });*/
1210
1211
1212
1213 $('body').on('click', '.media-folder', function (e) {
1214 e.preventDefault();
1215 current_path = $(this).data('path');
1216 refresh_scandir(current_path);
1217 expand_dir($(this).data('id'));
1218 });
1219
1220
1221 $('body').on('click', '.btn-add-queue', function (e) {
1222 e.preventDefault();
1223 if($(this).data('queued') === undefined) {
1224 var file_path = $(this).data('target');
1225 var file_name = $(this).data('label');
1226 fileList.files.push({path: file_path, name: file_name});
1227 }
1228 $(this).data('queued', 1);
1229 console.log(fileList.files);
1230 });
1231
1232 $('body').on('click', '.btn-remove-file', function (e) {
1233 e.preventDefault();
1234 fileList.files.splice($(this).data('target'), 1);
1235 //$(this).data('queued', 1);
1236 });
1237
1238 $('body').on('click', '.expand-dir > .handle, .explore-dir', function (e) {
1239 e.preventDefault();
1240
1241 var $this = $(this).parent('.expand-dir');
1242 var chid = "expanded_"+$(this).parent('.expand-dir').attr('id');
1243
1244 if ($(this).hasClass('explore-dir')){
1245 current_path = $this.data('path');
1246 refresh_scandir($this.data('path'));
1247 }
1248
1249 if($this.hasClass('expanded') && !$(this).hasClass('explore-dir')){
1250 $('#'+chid).slideUp(function () {
1251 $(this).remove();
1252 $this.removeClass('expanded');
1253 });
1254 return false;
1255 }
1256
1257 $this.addClass('busy');
1258
1259 expand_dir($(this).parent('.expand-dir').attr('id'));
1260 });
1261
1262 var uacc = '';
1263
1264 function split(val) {
1265 return val.split(/,\s*/);
1266 }
1267
1268 function extractLast(term) {
1269 return split(term).pop();
1270 }
1271
1272
1273 refresh_scandir('');
1274 expand_dir('<?php echo md5('home'); ?>');
1275
1276 $('.ttip').tooltip();
1277
1278
1279 });
1280
1281 </script>
1282
1283
1284
1285 </div>
1286
1287 </div>
1288
1289 </div>
1290 <?php
1291
1292 ?>
1293 </div>
1294
1295 <script>
1296
1297 jQuery(function ($) {
1298
1299 $('a').each(function () {
1300 $(this).attr('target', '_blank');
1301 });
1302
1303 $('body').on('click','a', function () {
1304 $(this).attr('target', '_blank');
1305 });
1306
1307 $('#wpdm-asset-picker').on('hidden.bs.modal', function (e) {
1308 var parentWindow = document.createElement("a");
1309 parentWindow.href = document.referrer.toString();
1310 if(parentWindow.hostname === window.location.hostname)
1311 window.parent.hide_asset_picker_frame();
1312 else
1313 window.parent.postMessage({'task': 'hideiframe'}, "*");
1314 });
1315
1316 $(window).on('resize', function () {
1317 $('#wpdm-asset-picker .modal-content').css('height', (window.innerHeight - 210) + 'px');
1318 jQuery('#wpdm-asset-picker [data-simplebar]').css('height', (window.innerHeight - 345) + 'px');
1319 });
1320
1321
1322 });
1323
1324 function showModal() {
1325 jQuery('#wpdm-asset-picker').modal('show');
1326 jQuery('#wpdm-asset-picker .modal-content').css('height', (window.innerHeight - 210) + 'px');
1327 jQuery('#wpdm-asset-picker [data-simplebar]').css('height', (window.innerHeight - 345) + 'px');
1328
1329 }
1330 showModal();
1331 </script>
1332 <div style="display: none">
1333
1334 <?php do_action("wpdm_modal_iframe_footer"); ?>
1335 </div>
1336 </body>
1337 </html>
1338
1339
1340