Skip to content

Commit

Permalink
v3.0.2
Browse files Browse the repository at this point in the history
## Fixed

- refetching content after cache clearing
- bad html in card modal causing tippy error
- bulk selection with "shift+click" doesn't work correctly when **sortBy** is used
- a couple of gestures “recheck shortcuts”
- better scroll to item in long list on manager init “hopefully its fixed for good now”
- folders with locked items getting fake remove

## New

- move modal have the selected items info as well “same as the delete modal”
- removed “vue-scroll-stop” and replaced it with something simpler
- the url will be changed according to the opened folder
  - so you can use the back/forward button like normal.
  - open a path directly with a url
  - using local storage to remember opened folders now works only for the modal
- locked list moved to ls instead of saving it with each cached key
  • Loading branch information
ctf0 committed May 12, 2018
1 parent bdd966a commit 39c0ac4
Show file tree
Hide file tree
Showing 20 changed files with 878 additions and 757 deletions.
71 changes: 34 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
- [install dependencies](https://github.com/ctf0/Laravel-Media-Manager/wiki/Packages-In-Use)

```bash
yarn add vue vue-ls vue-tippy@v1 vue2-filters vue-bounty vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next vue-scroll-stop idb-keyval axios dropzone cropperjs keycode date-fns babel-preset-es2015-node6 babel-preset-stage-2
yarn add vue vue-ls vue-tippy@v1 vue2-filters vue-bounty vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next idb-keyval axios dropzone cropperjs keycode date-fns
# or
npm install vue vue-ls vue-tippy@v1 vue2-filters vue-bounty vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next vue-scroll-stop idb-keyval axios dropzone cropperjs keycode date-fns babel-preset-es2015-node6 babel-preset-stage-2 --save
npm install vue vue-ls vue-tippy@v1 vue2-filters vue-bounty vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next idb-keyval axios dropzone cropperjs keycode date-fns --save
```

- add this one liner to your main js file and run `npm run watch` to compile your `js/css` files.
Expand Down Expand Up @@ -98,41 +98,38 @@
+ rename
+ new folder
- disable/enable buttons depend on the usage to avoid noise & keep the user focused
- shortcuts

| navigation | button | keyboard | click / tap | touch |
|----------------|--------------------------------------------|---------------|--------------------------|-------------------------|
| | upload *(toolbar)* | u | * | |
| | refresh *(toolbar)* | r | * / hold *(clear cache)* | |
| | move *(toolbar)* | m | * | swipe up |
| | image editor *(toolbar)* | e | * | |
| | delete *(toolbar)* | d/del | * | swipe down |
| | lock/unlock *(toolbar)* | l | * | |
| | change visibility *(toolbar)* | v | * | |
| | (reset) bulk select *(toolbar)* | b | * | |
| | (reset) bulk select all *(toolbar)* | a | * | |
| | cancel bulk selection | esc | | |
| | cancel search *(toolbar)* | esc | * | |
| |   | | | |
| | toggle *(sidebar)* | t | * | |
| | play/pause media *(sidebar)* | space | * | |
| | preview image/pdf/text *(sidebar)* | space | * | |
| |   | | | |
| | confirm rename *(modal)* | enter | * | |
| | confirm delete *(modal)* | enter | * | |
| | confirm move *(modal)* | enter | * | |
| | create new folder *(modal)* | enter | * | |
| |   | | | |
| | limit bulk select *(files container)* | shift + click | | |
| | preview image/pdf/text *(files container)* | space | ** | |
| | image editor *(files container)* | | hold | |
| | hide *(preview)* | space/esc | * | |
| select next | | right / down | * | swipe left *(preview)* |
| select prev | | left / up | * | swipe right *(preview)* |
| select first | | home | | |
| select last | | end | | |
| open folder | | enter | ** | |
| go to prev dir | folderName *(breadcrumb)* | backspace | * | swipe right *(files container)* |
- shortcuts / gestures

| navigation | button | keyboard | click / tap | touch |
|----------------|-------------------------------------|---------------|--------------------------|---------------------------------|
| | upload *(toolbar)* | u | * | |
| | refresh *(toolbar)* | r | * / hold *(clear cache)* | |
| | move *(toolbar)* | m | * | |
| | image editor *(toolbar)* | e | * | |
| | delete *(toolbar)* | d/del | * | |
| | lock/unlock *(toolbar)* | l | * | |
| | change visibility *(toolbar)* | v | * | |
| | (reset) bulk select *(toolbar)* | b / esc | * | |
| | (reset) bulk select all *(toolbar)* | a | * | |
| | reset search *(toolbar)* | esc *(input)* | * | |
| |   | | | |
| | toggle sidebar *(breadcrumb bar)* | t | * | |
| | confirm *(modal)* | enter | * | |
| | hide *(preview)* | space/esc | * | |
| |   | | | |
| | play/pause media *(item)* | space | ** | |
| | preview image/pdf/text *(item)* | space | ** | |
| | move *(item)* | | | swipe up |
| | delete *(item)* | | | swipe down |
| | image editor *(item)* | | | hold |
| | limit bulk select *(item)* | shift + click | | |
| |   | | | |
| select next | | right / down | * | swipe left *(preview)* |
| select prev | | left / up | * | swipe right *(preview)* |
| select first | | home | | |
| select last | | end | | |
| open folder | | enter | ** | |
| go to prev dir | folderName *(breadcrumb bar)* | backspace | * | swipe right *(items container)* |

- events

Expand Down
12 changes: 0 additions & 12 deletions logs/v3.0.1.txt

This file was deleted.

18 changes: 18 additions & 0 deletions logs/v3.0.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Fixed

- refetching content after cache clearing
- bad html in card modal causing tippy error
- bulk selection with "shift+click" doesn't work correctly when **sortBy** is used
- a couple of gestures “recheck shortcuts”
- better scroll to item in long list on manager init “hopefully its fixed for good now”
- folders with locked items getting fake remove

## New

- move modal have the selected items info as well “same as the delete modal”
- removed “vue-scroll-stop” and replaced it with something simpler
- the url will be changed according to the opened folder
- so you can use the back/forward button like normal.
- open a path directly with a url
- using local storage to remember opened folders now works only for the modal
- locked list moved to ls instead of saving it with each cached key
82 changes: 54 additions & 28 deletions src/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,36 +441,44 @@ public function delete_file(Request $request)
{
$folderLocation = $request->folder_location;
$result = [];
$fullCacheClear = false;
$lockedList = $this->db->pluck('path')->toArray();

foreach ($request->deleted_files as $one) {
$file_name = $one['name'];
$type = $one['type'];
$result[] = [
'success' => true,
'name' => $file_name,
'type' => $type,
];

$file_name = "$folderLocation/$file_name";
$file_name = $one['name'];
$file_type = $one['type'];
$file_name = $folderLocation == '' ? $file_name : "$folderLocation/$file_name";

// folder
if ($type == 'folder') {
if ($file_type == 'folder') {
// check for files in lock list
foreach ($this->storageDisk->allFiles($file_name) as $file) {
if (in_array($this->resolveUrl($file), $this->db->pluck('path')->toArray())) {
$fullCacheClear = true;
$result[] = [
foreach ($this->getFolderListByType($this->getFolderContent($file_name, true), 'file') as $file) {
$item_name = $file['basename'];
$item_type = $file['mimetype'];
$item_path = $file['path'];

if (in_array($this->resolveUrl($item_path), $lockedList)) {
$result[] = [
'success' => false,
'message' => trans('MediaManager::messages.error_in_locked_list', ['attr' => pathinfo($file, PATHINFO_BASENAME)]),
'name' => $item_name,
'type' => $item_type,
'message' => trans('MediaManager::messages.error_in_locked_list', ['attr' => $item_name]),
];
}

// remove file
else {
if (!$this->storageDisk->delete($file)) {
if ($this->storageDisk->delete($item_path)) {
$result[] = [
'success' => true,
'name' => $item_name,
'type' => $item_type,
'parent_path' => dirname($item_path),
];
} else {
$result[] = [
'success' => false,
'name' => $item_name,
'type' => $item_type,
'message' => trans('MediaManager::messages.error_deleting_file'),
];
}
Expand All @@ -485,47 +493,65 @@ public function delete_file(Request $request)
// remove folder if its size is == 0
// even if it have locked folders without items
if ($this->getFolderInfo($file_name)['files_size'] == 0) {
if (!$this->storageDisk->deleteDirectory($file_name)) {
$result[] = [
'success' => false,
'message' => trans('MediaManager::messages.error_deleting_file'),
if ($this->storageDisk->deleteDirectory($file_name)) {
$result[] = [
'success' => true,
'name' => $file_name,
'type' => $file_type,
];
} else {

// fire event
event('MMFileDeleted', [
'file_path' => $this->getFilePath($file_name),
'is_folder' => true,
]);
} else {
$result[] = [
'success' => false,
'name' => $file_name,
'type' => $file_type,
'message' => trans('MediaManager::messages.error_deleting_file'),
];
}
}

// still have locked items
else {
$result[] = [
'success' => false,
'name' => $file_name,
'type' => $file_type,
'message' => trans('MediaManager::messages.error_delete_fwli', ['attr'=>$file_name]),
];
}
}

// file
else {
if (!$this->storageDisk->delete($file_name)) {
$result[] = [
'success' => false,
'message' => trans('MediaManager::messages.error_deleting_file'),
if ($this->storageDisk->delete($file_name)) {
$result[] = [
'success' => true,
'name' => $file_name,
'type' => $file_type,
];
} else {

// fire event
event('MMFileDeleted', [
'file_path' => $this->getFilePath($file_name),
'is_folder' => false,
]);
} else {
$result[] = [
'success' => false,
'name' => $file_name,
'type' => $file_type,
'message' => trans('MediaManager::messages.error_deleting_file'),
];
}
}
}

return response()->json(['res' => $result, 'fullCacheClear' => $fullCacheClear]);
return response()->json(['res' => $result]);
}

/**
Expand Down
Loading

0 comments on commit 39c0ac4

Please sign in to comment.