10
10
11
11
.files > li > .file-select {
12
12
position : absolute ;
13
- top : -4 px ;
13
+ top : -7 px ;
14
14
left : -1px ;
15
15
}
16
16
61
61
62
62
</style >
63
63
64
- <script data-exec-on-popstate >
64
+ <script >
65
65
66
- $ (function () {
67
- $ (' .file-delete' ).click (function () {
66
+ var deleteFiles = function (files ) {
67
+
68
+ if (! files .length ) {
69
+ return ;
70
+ }
68
71
69
- var path = $ (this ).data (' path' );
70
-
71
- swal ({
72
- title: " {{ trans (' admin.delete_confirm' ) } }" ,
73
- type: " warning" ,
74
- showCancelButton: true ,
75
- confirmButtonColor: " #DD6B55" ,
76
- confirmButtonText: " {{ trans (' admin.confirm' ) } }" ,
77
- showLoaderOnConfirm: true ,
78
- closeOnConfirm: false ,
79
- cancelButtonText: " {{ trans (' admin.cancel' ) } }" ,
72
+ $ .admin .confirm ({
73
+ title: $ .admin .trans (' delete_confirm' ),
80
74
preConfirm : function () {
81
75
return new Promise (function (resolve ) {
82
-
83
76
$ .ajax ({
84
77
method: ' delete' ,
85
78
url: ' {{ $url [' delete' ] } }' ,
86
79
data: {
87
- ' files[]' : [path],
88
- _token: LA .token
80
+ ' files[]' : files,
89
81
},
90
82
success : function (data ) {
91
- $ .pjax .reload (' #pjax-container' );
92
-
83
+ $ .admin .reload ();
93
84
resolve (data);
94
85
}
95
86
});
100
91
var data = result .value ;
101
92
if (typeof data === ' object' ) {
102
93
if (data .status ) {
103
- swal (data .message , ' ' , ' success ' );
94
+ $ . admin . toastr . success (data .message );
104
95
} else {
105
- swal (data .message , ' ' , ' error ' );
96
+ $ . admin . toastr . error (data .message );
106
97
}
107
98
}
108
99
});
100
+ };
101
+
102
+ $ (' .file-delete' ).click (function () {
103
+ deleteFiles ([$ (this ).data (' path' )]);
104
+ });
105
+
106
+ $ (' .file-delete-multiple' ).click (function () {
107
+ var files = $ (" .file-select input:checked" ).map (function (){
108
+ return $ (this ).val ();
109
+ }).toArray ();
110
+ deleteFiles (files);
109
111
});
110
112
111
113
$ (' #moveModal' ).on (' show.bs.modal' , function (event ) {
139
141
data: {
140
142
path: path,
141
143
' new' : name,
142
- _token: LA .token ,
143
144
},
144
145
success : function (data ) {
145
- $ .pjax .reload (' #pjax-container ' );
146
+ $ .admin .reload ();
146
147
147
148
if (typeof data === ' object' ) {
148
149
if (data .status ) {
149
- toastr .success (data .message );
150
+ $ . admin . toastr .success (data .message );
150
151
} else {
151
- toastr .error (data .message );
152
+ $ . admin . toastr .error (data .message );
152
153
}
153
154
}
154
155
}
173
174
data: formData,
174
175
async: false ,
175
176
success : function (data ) {
176
- $ .pjax .reload (' #pjax-container ' );
177
+ $ .admin .reload ();
177
178
178
179
if (typeof data === ' object' ) {
179
180
if (data .status ) {
180
- toastr .success (data .message );
181
+ $ . admin . toastr .success (data .message );
181
182
} else {
182
- toastr .error (data .message );
183
+ $ . admin . toastr .error (data .message );
183
184
}
184
185
}
185
186
},
@@ -198,137 +199,112 @@ function closeModal() {
198
199
}
199
200
200
201
$ (' .media-reload' ).click (function () {
201
- $ .pjax .reload (' #pjax-container ' );
202
+ $ .admin .reload ();
202
203
});
203
204
204
205
$ (' .goto-url button' ).click (function () {
205
206
var path = $ (' .goto-url input' ).val ();
206
- $ .pjax ({container : ' #pjax-container ' , url : ' {{ $url [' index' ] } } ?path=' + path } );
207
+ $ .admin . redirect ( ' {{ $url [' index' ] } } ?path=' + path);
207
208
});
208
209
209
- $ (' .file-select>input' ).iCheck ({checkboxClass: ' icheckbox_minimal-blue' });
210
-
211
- $ (' .file-delete-multiple' ).click (function () {
212
- var files = $ (" .file-select input:checked" ).map (function (){
213
- return $ (this ).val ();
214
- }).toArray ();
215
-
216
- if (! files .length ) {
217
- return ;
210
+ $ (' .files-select-all' ).on (' change' , function (event ) {
211
+ if (this .checked ) {
212
+ $ (' .grid-row-checkbox' ).prop (' checked' , true );
213
+ } else {
214
+ $ (' .grid-row-checkbox' ).prop (' checked' , false );
218
215
}
216
+ });
219
217
220
- swal ({
221
- title: " {{ trans (' admin.delete_confirm' ) } }" ,
222
- type: " warning" ,
223
- showCancelButton: true ,
224
- confirmButtonColor: " #DD6B55" ,
225
- confirmButtonText: " {{ trans (' admin.confirm' ) } }" ,
226
- showLoaderOnConfirm: true ,
227
- closeOnConfirm: false ,
228
- cancelButtonText: " {{ trans (' admin.cancel' ) } }" ,
229
- preConfirm : function () {
230
- return new Promise (function (resolve ) {
231
-
232
- $ .ajax ({
233
- method: ' delete' ,
234
- url: ' {{ $url [' delete' ] } }' ,
235
- data: {
236
- ' files[]' : files,
237
- _token: LA .token
238
- },
239
- success : function (data ) {
240
- $ .pjax .reload (' #pjax-container' );
241
-
242
- resolve (data);
243
- }
244
- });
218
+ $ (' .file-select input' ).on (' change' , function () {
219
+ if (this .checked ) {
220
+ $ (this ).closest (' tr' ).css (' background-color' , ' #ffffd5' );
221
+ } else {
222
+ $ (this ).closest (' tr' ).css (' background-color' , ' ' );
223
+ }
224
+ });
245
225
246
- });
247
- }
248
- }).then (function (result ) {
249
- var data = result .value ;
250
- if (typeof data === ' object' ) {
251
- if (data .status ) {
252
- swal (data .message , ' ' , ' success' );
253
- } else {
254
- swal (data .message , ' ' , ' error' );
255
- }
256
- }
257
- });
226
+ $ (' .file-select-all input' ).on (' change' , function () {
227
+ if (this .checked ) {
228
+ $ (' .file-select input' ).prop (' checked' , true );
229
+ } else {
230
+ $ (' .file-select input' ).prop (' checked' , false );
231
+ }
258
232
});
259
- });
260
233
234
+ $ (' table>tbody>tr' ).mouseover (function () {
235
+ $ (this ).find (' .btn-group' ).removeClass (' d-none' );
236
+ }).mouseout (function () {
237
+ $ (this ).find (' .btn-group' ).addClass (' d-none' );
238
+ });
261
239
</script >
262
240
263
241
<div class =" row" >
264
242
<!-- /.col -->
265
- <div class =" col-md-12" >
266
- <div class =" box box-primary" >
267
-
268
- <div class =" box-body no-padding" >
243
+ <div class =" col-12" >
244
+ <div class =" card card-@color card-outline" >
245
+
246
+ <div class =" card-header" >
247
+ <div class =" card-tools" >
248
+ <div class =" input-group float-right goto-url" style =" width : 350px ;" >
249
+ <input type =" text" name =" path" class =" form-control" value =" {{ ' /' . trim ($url [' path' ], ' /' ) } }" >
250
+ <div class =" input-group-append" >
251
+ <button type =" submit" class =" btn btn-default" ><i class =" fas fa-arrow-right" ></i ></button >
252
+ </div >
253
+ </div >
254
+ </div >
255
+ <div class =" float-left d-flex" >
269
256
270
- <div class =" mailbox-controls with-border" >
271
257
<div class =" btn-group" >
272
258
<a href =" " type =" button" class =" btn btn-default btn media-reload" title =" Refresh" >
273
- <i class =" fa fa-refresh " ></i >
259
+ <i class =" fas fa-sync " ></i >
274
260
</a >
275
261
<a type =" button" class =" btn btn-default btn file-delete-multiple" title =" Delete" >
276
- <i class =" fa fa-trash-o " ></i >
262
+ <i class =" fas fa-trash" ></i >
277
263
</a >
278
264
</div >
279
265
<!-- /.btn-group -->
280
- <label class =" btn btn-default btn" {{-- data-toggle="modal" data-target="#uploadModal"--}} >
281
- <i class =" fa fa-upload" ></i >  ;  ; {{ trans (' admin.upload' ) } }
266
+
267
+ <label class =" btn btn-default mb-0 ml-1" >
268
+ <i class =" fas fa-upload" ></i >  ;  ; {{ trans (' admin.upload' ) } }
282
269
<form action =" {{ $url [' upload' ] } }" method =" post" class =" file-upload-form" enctype =" multipart/form-data" pjax-container >
283
- <input type =" file" name =" files[]" class =" hidden file-upload" multiple >
270
+ <input type =" file" name =" files[]" class =" d-none file-upload" multiple >
284
271
<input type =" hidden" name =" dir" value =" {{ $url [' path' ] } }" />
285
272
{{ csrf_field () } }
286
273
</form >
287
274
</label >
288
275
289
276
<!-- /.btn-group -->
290
- <a class =" btn btn-default btn" data-toggle =" modal" data-target =" #newFolderModal" >
291
- <i class =" fa fa-folder" ></i >  ;  ; {{ trans (' admin.new_folder' ) } }
277
+ <a class =" btn btn-default btn ml-1 " data-toggle =" modal" data-target =" #newFolderModal" >
278
+ <i class =" fas fa-folder" ></i >  ;  ; {{ trans (' admin.new_folder' ) } }
292
279
</a >
293
280
294
- <div class =" btn-group" >
295
- <a href =" {{ route (' media-index' , [' path' => $url [' path' ], ' view' => ' table' ]) } }" class =" btn btn-default {{ request (' view' ) == ' table' ? ' active' : ' ' } }" ><i class =" fa fa-list" ></i ></a >
296
- <a href =" {{ route (' media-index' , [' path' => $url [' path' ], ' view' => ' list' ]) } }" class =" btn btn-default {{ request (' view' ) == ' list' ? ' active' : ' ' } }" ><i class =" fa fa-th" ></i ></a >
297
- </div >
298
-
299
- {{-- <form action="{{ $url['index'] }}" method="get" pjax-container>--}}
300
- <div class =" input-group input-group-sm pull-right goto-url" style =" width : 250px ;" >
301
- <input type =" text" name =" path" class =" form-control pull-right" value =" {{ ' /' . trim ($url [' path' ], ' /' ) } }" >
302
-
303
- <div class =" input-group-btn" >
304
- <button type =" submit" class =" btn btn-default" ><i class =" fa fa-arrow-right" ></i ></button >
305
- </div >
281
+ <div class =" btn-group ml-1" >
282
+ <a href =" {{ route (' media-index' , [' path' => $url [' path' ], ' view' => ' table' ]) } }" class =" btn btn-default active" ><i class =" fas fa-list" ></i ></a >
283
+ <a href =" {{ route (' media-index' , [' path' => $url [' path' ], ' view' => ' list' ]) } }" class =" btn btn-default" ><i class =" fas fa-th" ></i ></a >
306
284
</div >
307
- {{-- </form>--}}
308
-
309
285
</div >
310
-
311
- <!-- /.mailbox-read-message -->
312
286
</div >
287
+
313
288
<!-- /.box-body -->
314
- <div class =" box-footer " >
315
- <ol class =" breadcrumb" style = " margin-bottom : 10 px ; " >
289
+ <div class =" box-body " >
290
+ <ol class =" breadcrumb m-2 " >
316
291
317
- <li ><a href =" {{ route (' media-index' ) } }" ><i class =" fa fa-th-large " ></i > </a ></li >
292
+ <li class = " breadcrumb-item " ><a href =" {{ route (' media-index' ) } }" ><i class =" far fa-folder-open " ></i > </a ></li >
318
293
319
294
@foreach ($nav as $item )
320
- <li ><a href =" {{ $item [' url' ] } }" > {{ $item [' name' ] } } </a ></li >
295
+ <li class = " breadcrumb-item " ><a href =" {{ $item [' url' ] } }" > {{ $item [' name' ] } } </a ></li >
321
296
@endforeach
322
297
</ol >
323
- <ul class =" files clearfix" >
298
+ <ul class =" files clearfix m-3 " >
324
299
325
300
@if (empty ($list ) )
326
301
<li style =" height : 200px ;border : none ;" ></li >
327
302
@else
328
303
@foreach ($list as $item )
329
304
<li >
330
- <span class =" file-select" >
331
- <input type =" checkbox" value =" {{ $item [' name' ] } }" />
305
+ <span class =" file-select icheck-@color d-inline" >
306
+ <input type =" checkbox" value =" {{ $item [' name' ] } }" id =" @id " />
307
+ <label for =' @id ' ></label >
332
308
</span >
333
309
334
310
{!! $item [' preview' ] ! !}
@@ -345,15 +321,15 @@ function closeModal() {
345
321
<span class =" caret" ></span >
346
322
<span class =" sr-only" >Toggle Dropdown</span >
347
323
</button >
348
- <ul class =" dropdown-menu" role =" menu" >
349
- <li >< a href =" #" class =" file-rename" data-toggle =" modal" data-target =" #moveModal" data-name =" {{ $item [' name' ] } }" >Rename & Move</a ></ li >
350
- <li >< a href =" #" class =" file-delete" data-path =" {{ $item [' name' ] } }" >Delete</a ></ li >
324
+ <div class =" dropdown-menu" role =" menu" >
325
+ <a href =" #" class =" file-rename dropdown-item " data-toggle =" modal" data-target =" #moveModal" data-name =" {{ $item [' name' ] } }" >Rename & Move</a >
326
+ <a href =" #" class =" file-delete dropdown-item " data-path =" {{ $item [' name' ] } }" >Delete</a >
351
327
@unless ($item [' isDir' ] )
352
- <li >< a target =" _blank" href =" {{ $item [' download' ] } }" >Download</a ></ li >
328
+ <a target =" _blank" class = " dropdown-item " href =" {{ $item [' download' ] } }" >Download</a >
353
329
@endunless
354
- <li class =" divider" ></li >
355
- <li >< a href =" #" data-toggle =" modal" data-target =" #urlModal" data-url =" {{ $item [' url' ] } }" >Url</a ></ li >
356
- </ul >
330
+ <div role = " separator " class =" dropdown- divider" ></div >
331
+ <a href =" #" data-toggle =" modal" class = " dropdown-item " data-target =" #urlModal" data-url =" {{ $item [' url' ] } }" >Url</a >
332
+ </div >
357
333
</div >
358
334
</span >
359
335
</div >
@@ -374,8 +350,8 @@ function closeModal() {
374
350
<div class =" modal-dialog" role =" document" >
375
351
<div class =" modal-content" >
376
352
<div class =" modal-header" >
353
+ <h5 class =" modal-title" id =" moveModalLabel" >Rename & Move</h5 >
377
354
<button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" ><span aria-hidden =" true" >× ; </span ></button >
378
- <h4 class =" modal-title" id =" moveModalLabel" >Rename & Move</h4 >
379
355
</div >
380
356
<form id =" file-move" >
381
357
<div class =" modal-body" >
@@ -398,8 +374,8 @@ function closeModal() {
398
374
<div class =" modal-dialog" role =" document" >
399
375
<div class =" modal-content" >
400
376
<div class =" modal-header" >
377
+ <h5 class =" modal-title" id =" urlModalLabel" >Url</h5 >
401
378
<button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" ><span aria-hidden =" true" >× ; </span ></button >
402
- <h4 class =" modal-title" id =" urlModalLabel" >Url</h4 >
403
379
</div >
404
380
<div class =" modal-body" >
405
381
<div class =" form-group" >
@@ -417,8 +393,8 @@ function closeModal() {
417
393
<div class =" modal-dialog" role =" document" >
418
394
<div class =" modal-content" >
419
395
<div class =" modal-header" >
396
+ <h5 class =" modal-title" id =" newFolderModalLabel" >New folder</h5 >
420
397
<button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" ><span aria-hidden =" true" >× ; </span ></button >
421
- <h4 class =" modal-title" id =" newFolderModalLabel" >New folder</h4 >
422
398
</div >
423
399
<form id =" new-folder" >
424
400
<div class =" modal-body" >
0 commit comments