Skip to content

Commit

Permalink
v3.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ctf0 committed Jun 23, 2018
1 parent 4eb1841 commit 18025a3
Show file tree
Hide file tree
Showing 34 changed files with 658 additions and 332 deletions.
95 changes: 55 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Latest Stable Version](https://img.shields.io/packagist/v/ctf0/media-manager.svg)](https://packagist.org/packages/ctf0/media-manager) [![Total Downloads](https://img.shields.io/packagist/dt/ctf0/media-manager.svg)](https://packagist.org/packages/ctf0/media-manager) [![Donate with Bitcoin](https://en.cryptobadges.io/badge/micro/16ri7Hh848bw7vxbEevKHFuHXLmsV8Vc9L)](https://en.cryptobadges.io/donate/16ri7Hh848bw7vxbEevKHFuHXLmsV8Vc9L)

<p align="center">
<img src="https://user-images.githubusercontent.com/7388088/36298904-278ede2a-1303-11e8-8413-0bf02984019a.png">
<img src="https://user-images.githubusercontent.com/7388088/41806986-f9835870-76c7-11e8-95a9-534e45ccf7dd.png">
</p>

- to optimize uploaded files on the fly try [spatie](https://github.com/spatie/laravel-image-optimizer)
Expand Down Expand Up @@ -35,9 +35,9 @@
- [install dependencies](https://github.com/ctf0/Laravel-Media-Manager/wiki/Packages-In-Use)

```bash
yarn add vue vue-ls vue-async-computed vue-tippy@v1 vue2-filters vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next idb-keyval axios dropzone cropperjs keycode date-fns lottie-web laravel-echo
yarn add vue vue-ls vue-async-computed vue-tippy@v1 vue2-filters vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next idb-keyval axios dropzone cropperjs keycode date-fns lottie-web laravel-echo fuse.js
# or
npm install vue vue-ls vue-async-computed vue-tippy@v1 vue2-filters vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next idb-keyval axios dropzone cropperjs keycode date-fns lottie-web laravel-echo --save
npm install vue vue-ls vue-async-computed vue-tippy@v1 vue2-filters vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next idb-keyval axios dropzone cropperjs keycode date-fns lottie-web laravel-echo fuse.js --save
```

- run `npm run watch` to compile your `js/css` files.
Expand Down Expand Up @@ -66,9 +66,9 @@
- use the manager
+ [from modal](https://github.com/ctf0/Laravel-Media-Manager/wiki/Use-The-Manager-From-A-Modal)
+ [with any wysiwyg editor](https://github.com/ctf0/Laravel-Media-Manager/wiki/Use-The-Manager-With-Any-WYSIWYG-Editor)
- auto scroll to selected item when using (left/up, right/down, home, end)
- auto scroll to selected item when using (left, up, righ, down, home, end)
- [lock/unlock](https://github.com/ctf0/Laravel-Media-Manager/wiki/Lock-Files-&-Folder) item/s ***"sqLite must be installed"***
- search
- search "current / global"
- filter by
+ folder
+ image
Expand All @@ -86,43 +86,45 @@
+ search found
- protection against overwriting (files/folders)
- file name sanitization for
+ upload
+ rename
+ new folder
+ upload
+ rename
+ new folder
- autoplay media files ***"if selected filter is audio/video"***
- disable/enable buttons depend on the usage to avoid noise & keep the user focused
- shortcuts / gestures

| navigation | button | keyboard | click / tap | touch |
|----------------|------------------------------------------|------------------|-------------------------------|---------------------------------|
| | toggle upload panel *(toolbar)* | u | * | |
| | refresh *(toolbar)* | r | * / hold *(clear ls & cache)* | |
| | move *(toolbar)* | m | * | |
| | image editor *(toolbar)* | e | * | |
| | delete *(toolbar)* | d / del | * | |
| | lock/unlock *(toolbar)* | l | * | |
| | change visibility *(toolbar)* | v | * | |
| | toggle bulk selection *(toolbar)* | b | * | |
| | (reset) bulk select all *(toolbar)* | a | * | |
| | toggle sidebar *(path bar)* | t | * | |
| | confirm *(modal)* | enter | * | |
| | toggle preview "image/pdf/text" *(item)* | space | ** | |
| | play/pause media *(item)* | space | ** | |
| | hide (modal / upload panel) | esc | | |
| | reset (search / bulk selection) | esc | | |
| | &nbsp; | | | |
| | move *(item)* | | | swipe up |
| | delete *(item)* | | | swipe down |
| | image editor *(item)* | | | hold |
| | limit bulk select *(item)* | shift + click | | |
| | current + next bulk select *(item)* | alt/meta + click | | |
| | &nbsp; | | | |
| 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 *(path bar)* | backspace | * | swipe right *(items container)* |
| navigation | button | keyboard | click / tap | touch |
|-----------------------|---------------------------------------------|------------------|-------------------------------|---------------------------------|
| | toggle upload panel *(toolbar)* | u | * | |
| | refresh *(toolbar)* | r | * / hold *(clear ls & cache)* | |
| | move *(toolbar)* | m | * | |
| | image editor *(toolbar)* | e | * | |
| | delete *(toolbar)* | d / del | * | |
| | lock/unlock *(toolbar)* | l | * | |
| | change visibility *(toolbar)* | v | * | |
| | toggle bulk selection *(toolbar)* | b | * | |
| | (reset) bulk select all *(toolbar)* | a | * | |
| | toggle sidebar *(path bar)* | t | * | |
| | confirm *(modal)* | enter | * | |
| | toggle preview image/pdf/text *(item)* | space | ** | |
| | play/pause media *(item)* | space | ** | |
| | hide (modal / upload-panel / global-search) | esc | | |
| | reset (search / bulk selection) | esc | | |
| | &nbsp; | | | |
| | move *(item)* | | | swipe up |
| | delete *(item)* | | | swipe down |
| | image editor *(item)* | | | hold |
| | limit bulk select *(item)* | shift + click | | |
| | current + next bulk select *(item)* | alt/meta + click | | |
| | &nbsp; | | | |
| select next *(item)* | | right | * | swipe left *(preview)* |
| select prev *(item)* | | left | * | swipe right *(preview)* |
| select first *(item)* | | home | | |
| select last *(item)* | | end | | |
| select next *(row)* | | down | | |
| select prev *(row)* | | up | | |
| open folder | | enter | ** | |
| go to prev dir | folderName *(path bar)* | backspace | * | swipe right *(items container)* |

- events

Expand All @@ -138,7 +140,7 @@
| | MMFileUploaded($file_path) | get uploaded file full [path][path] |
| | [MMFileSaved][event]($file_path) | get saved(edited/link) image full [path][path] |
| | MMFileDeleted($file_path, $is_folder) | get deleted file/folder full [path][path] |
| | MMFileRenamed($old_path, $new_path) | get renamed file/folder "old & new" [path][path] |
| | MMFileRenamed($old_path, $new_path) | get renamed file/folder old & new [path][path] |
| | MMFileMoved($old_path, $new_path) | get moved file/folder "old & new" [path][path] |

[js]: https://github.com/gocanto/vuemit
Expand Down Expand Up @@ -215,7 +217,20 @@ return [
/*
* automatically invalidate cache after "in Minutes"
*/
'cacheExpiresAfter'=> 60,
'cacheExpiresAfter' => 60,

/*
* in-order to get the folder items count & size
* we need to recursively get all the files inside the folders
* which could make the request take longer
*/
'get_folder_info' => true,

/**
* do you want to enable broadcasting the changes
* made by one user to others ?
*/
'enable_broadcasting' => false
];
```

Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"maennchen/zipstream-php": "~1.0",
"ctf0/package-changelog": "^1.0"
},
"suggest": {
"league/flysystem-cached-adapter": "Required to use the Flysystem cache (~1.0)."
},
"autoload": {
"psr-4": {
"ctf0\\MediaManager\\": "src"
Expand Down
29 changes: 0 additions & 29 deletions logs/v3.1.0.txt

This file was deleted.

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

- config option “enable_broadcasting”
- global search
- keyboard navigate by row
- use natural sort “natsort” for items


## Fix

- dirs name after lock/unlock
- pdf file having 2 icons
- using the refresh btn even when its disabled
- incorrect mobile nav file name

## Removed

- item hover shadow
44 changes: 25 additions & 19 deletions src/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace ctf0\MediaManager\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use League\Flysystem\Plugin\ListWith;
use ctf0\MediaManager\Controllers\Moduels\Lock;
Expand All @@ -29,33 +28,35 @@ class MediaController extends Controller
NewFolder,
Visibility;

protected $config;
protected $baseUrl;
protected $db;
protected $fileChars;
protected $fileSystem;
protected $folderChars;
protected $ignoreFiles;
protected $LMF;
protected $GFI;
protected $sanitizedText;
protected $storageDisk;
protected $storageDiskInfo;
protected $unallowedMimes;

public function __construct()
{
$this->config = config('mediaManager');
$this->fileSystem = array_get($this->config, 'storage_disk');
$this->storageDisk = app('filesystem')->disk($this->fileSystem);
$config = app('config')->get('mediaManager');
$this->fileSystem = array_get($config, 'storage_disk');
$this->ignoreFiles = array_get($config, 'ignore_files');
$this->fileChars = array_get($config, 'allowed_fileNames_chars');
$this->folderChars = array_get($config, 'allowed_folderNames_chars');
$this->sanitizedText = array_get($config, 'sanitized_text');
$this->unallowedMimes = array_get($config, 'unallowed_mimes');
$this->LMF = array_get($config, 'last_modified_format');
$this->GFI = array_get($config, 'get_folder_info', true);

$this->storageDisk = app('filesystem')->disk($this->fileSystem);
$this->storageDiskInfo = app('config')->get("filesystems.disks.{$this->fileSystem}");
$this->baseUrl = $this->storageDisk->url('/');
$this->ignoreFiles = array_get($this->config, 'ignore_files');
$this->fileChars = array_get($this->config, 'allowed_fileNames_chars');
$this->folderChars = array_get($this->config, 'allowed_folderNames_chars');
$this->sanitizedText = array_get($this->config, 'sanitized_text');
$this->unallowedMimes = array_get($this->config, 'unallowed_mimes');
$this->LMF = array_get($this->config, 'last_modified_format');
$this->db = app('db')->connection('mediamanager')->table('locked');
$this->storageDiskInfo = config("filesystems.disks.{$this->fileSystem}");

$this->storageDisk->addPlugin(new ListWith());
}
Expand All @@ -70,13 +71,18 @@ public function index()
return view('MediaManager::media');
}

/**
* globalSearch all the manager files
* TODO "better use caching".
*
* @return [type] [description]
*/
public function globalSearch(Request $request)
public function globalSearch()
{
return collect($this->getFolderContent('/', true))->reject(function ($item) { // remove unwanted
return preg_grep($this->ignoreFiles, [$item['path']]) || $item['type'] == 'dir';
})->map(function ($file) {
return $file = [
'name' => $file['basename'],
'type' => $file['mimetype'],
'path' => $this->resolveUrl($file['path']),
'dir' => $file['dirname'] != '' ? $file['dirname'] : '/',
'last_modified_formated' => $this->getItemTime($file['timestamp']),
];
})->values()->all();
}
}
2 changes: 2 additions & 0 deletions src/Controllers/Modules/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ protected function zipAndDownload($name, $list)
if ($streamRead) {
$progress += $counter;
broadcast(new MediaZipProgress(['progress'=>round($progress, 0)]));

$zip->addFileFromStream($file_name, $streamRead);
} else {
broadcast(new MediaZipProgress([
Expand Down Expand Up @@ -98,6 +99,7 @@ protected function zipAndDownloadDir($name, $list)
if ($streamRead) {
$progress += $counter;
broadcast(new MediaZipProgress(['progress'=>round($progress, 0)]));

$zip->addFileFromStream($full_name, $streamRead);
} else {
broadcast(new MediaZipProgress([
Expand Down
Loading

0 comments on commit 18025a3

Please sign in to comment.