Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 7a08bf0

Browse files
committed
update
- get rid of bs-modal - fix enter not working in file_move - cleanup code - add some placeholders to view for easier navigation as its too long - add events for modal show / hide - remove depend.js and merge all to media.js instead - update rdme - update view - update styles
1 parent 0060f26 commit 7a08bf0

File tree

10 files changed

+331
-898
lines changed

10 files changed

+331
-898
lines changed

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<img src="https://user-images.githubusercontent.com/7388088/30516878-a29c0b4a-9b4b-11e7-9075-a3ae2c2914ff.jpg">
33
</p>
44

5-
## Intro
6-
75
- Inspired by [Voyager](https://github.com/the-control-group/voyager), [October](https://github.com/octobercms/october), [WordPress](https://codex.wordpress.org/Media_Library_Screen)
86

97
- to optimize uploaded files on the fly try [approached](https://github.com/approached/laravel-image-optimizer) or [spatie](https://github.com/spatie/laravel-image-optimizer)
@@ -64,25 +62,32 @@
6462

6563
| navigation | button | keyboard | mouse (click) |
6664
|---------------------|-------------------------------|-----------|---------------|
67-
| | upload *(toolbar)* | u | |
68-
| | refresh *(toolbar)* | r | |
69-
| | move *(toolbar)* | m | |
70-
| | delete *(toolbar)* | d/del | |
71-
| | bulk select *(toolbar)* | b | |
72-
| | bulk select all *(toolbar)* | a | |
73-
| | toggle *(sidebar)* | t | |
74-
| | file rename *(modal)* | enter | |
75-
| | file delete *(modal)* | enter | |
76-
| | create new folder *(modal)* | enter | |
77-
| select next | | right | |
78-
| select prev | | left | |
79-
| select first | | home | |
80-
| select last | | end | |
65+
| | upload *(toolbar)* | u | * |
66+
| | refresh *(toolbar)* | r | * |
67+
| | move *(toolbar)* | m | * |
68+
| | delete *(toolbar)* | d/del | * |
69+
| | bulk select *(toolbar)* | b | * |
70+
| | bulk select all *(toolbar)* | a | * |
71+
| | toggle *(sidebar)* | t | * |
72+
| | file rename *(modal)* | enter | * |
73+
| | file delete *(modal)* | enter | * |
74+
| | create new folder *(modal)* | enter | * |
75+
| select next | | right | * |
76+
| select prev | | left | * |
77+
| select first | | home | * |
78+
| select last | | end | * |
8179
| open folder | | enter | double click |
82-
| go back to prev dir | folderName *(breadcrumb)* | backspace | |
83-
| play/pause media | player controller *(sidebar)* | space | |
84-
| view image | image *(sidebar)* | space | |
85-
| hide image | image *(light-box)* | space/esc | |
80+
| go back to prev dir | folderName *(breadcrumb)* | backspace | * |
81+
| play/pause media | player controller *(sidebar)* | space | * |
82+
| view image | image *(sidebar)* | space | * |
83+
| hide image | image *(light-box)* | space/esc | * |
84+
85+
- events
86+
87+
| event-name | description |
88+
|------------|-----------------------------------|
89+
| modal-show | do something when modal is showen |
90+
| modal-hide | do something when modal is hidden |
8691

8792
## Config
8893
**config/mediaManager.php**
@@ -171,8 +176,3 @@ new Vue({
171176
el: '#app'
172177
})
173178
```
174-
175-
## ToDo "ANY HELP IS APPRECIATED"
176-
177-
* Add Support To Other Css Frameworks.
178-
* Add Support For Editors usage "tinymce / Ckeditor/ etc..".

src/Controllers/MediaController.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,27 +307,29 @@ public function getFiles($dir)
307307

308308
foreach ($storageFolders as $folder) {
309309
if (!preg_grep($pattern, [$folder])) {
310+
$time = $this->storageDisk->lastModified($folder);
310311
$files[] = [
311312
'name' => strpos($folder, '/') > 1 ? str_replace('/', '', strrchr($folder, '/')) : $folder,
312313
'type' => 'folder',
313314
'path' => $this->storageDisk->url($folder),
314315
'size' => '',
315316
'items' => count($this->storageDisk->allFiles($folder)) + count($this->storageDisk->allDirectories($folder)),
316-
'last_modified' => $this->storageDisk->lastModified($folder),
317-
'last_modified_formated' => Carbon::createFromTimestamp($this->storageDisk->lastModified($folder))->{$this->LMF}(),
317+
'last_modified' => $time,
318+
'last_modified_formated' => Carbon::createFromTimestamp($time)->{$this->LMF}(),
318319
];
319320
}
320321
}
321322

322323
foreach ($storageFiles as $file) {
323324
if (!preg_grep($pattern, [$file])) {
325+
$time = $this->storageDisk->lastModified($file);
324326
$files[] = [
325327
'name' => strpos($file, '/') > 1 ? str_replace('/', '', strrchr($file, '/')) : $file,
326328
'type' => $this->storageDisk->mimeType($file),
327329
'path' => $this->storageDisk->url($file),
328330
'size' => $this->storageDisk->size($file),
329-
'last_modified' => $this->storageDisk->lastModified($file),
330-
'last_modified_formated' => Carbon::createFromTimestamp($this->storageDisk->lastModified($file))->{$this->LMF}(),
331+
'last_modified' => $time,
332+
'last_modified_formated' => Carbon::createFromTimestamp($time)->{$this->LMF}(),
331333
];
332334
}
333335
}

0 commit comments

Comments
 (0)