diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index fc5640e..c2c8aef 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -10,7 +10,7 @@ assignees: ''
-> What version of Laravel are you using? (nothing lower than v5.4).
+> What version of Laravel are you using? (nothing lower than v6).
...
diff --git a/README.md b/README.md
index 77abe2b..90d6868 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
Laravel Media Manager
+
@@ -24,14 +25,6 @@
- `composer require ctf0/media-manager`
-- (Laravel < 5.5) add the service provider to `config/app.php`
-
- ```php
- 'providers' => [
- ctf0\MediaManager\MediaManagerServiceProvider::class,
- ]
- ```
-
- publish the package assets with
`php artisan vendor:publish --provider="ctf0\MediaManager\MediaManagerServiceProvider"`
@@ -43,7 +36,7 @@
- [install dependencies](https://github.com/ctf0/Laravel-Media-Manager/wiki/Packages-In-Use)
```bash
- yarn add vue vue-ls vue-infinite-loading vue-image-compare2 vue-tippy@v2 vue2-filters vue-input-autowidth vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next vue-focuspoint-component axios dropzone cropperjs keycode lottie-web plyr fuse.js music-metadata-browser idb-keyval
+ yarn add vue vue-ls vue-infinite-loading vue-image-compare2 vue-tippy@v2 vue2-filters vue-input-autowidth vue-notif vue-clipboard2 vue-awesome@v2 vue-touch@next vue-focuspoint-component axios dropzone cropperjs keycode lottie-web plyr fuse.js music-metadata-browser idb-keyval annyang
yarn add worker-loader --dev
```
@@ -54,10 +47,7 @@
// app.js
window.Vue = require('vue')
- // Laravel < v5.7
- require('../vendor/MediaManager/js/manager')
- // Laravel > v5.7
- // require('../assets/vendor/MediaManager/js/manager')
+ require('../assets/vendor/MediaManager/js/manager')
new Vue({
el: '#app'
diff --git a/composer.json b/composer.json
index f28d476..8c9bbf7 100644
--- a/composer.json
+++ b/composer.json
@@ -19,7 +19,7 @@
],
"require": {
"php": "~7.0",
- "illuminate/support": "^5.4 || ^6.0 || ^7.0",
+ "illuminate/support": "^6.0 || ^7.0",
"maennchen/zipstream-php": "~1.0",
"ctf0/package-changelog": "*",
"jhofm/flysystem-iterator": "^2.2"
diff --git a/logs/v3.6.6.txt b/logs/v3.6.6.txt
deleted file mode 100644
index b3eb104..0000000
--- a/logs/v3.6.6.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-- use restrict from modal "issues/139"
-- fix not updating the page url on manager startup
-- update wiki
diff --git a/logs/v3.7.0.txt b/logs/v3.7.0.txt
new file mode 100644
index 0000000..615b540
--- /dev/null
+++ b/logs/v3.7.0.txt
@@ -0,0 +1,9 @@
+- add voice search, plz test and reply back
+- add new npm-dep "annyang"
+- fix not able to scroll the files container on touch screen
+- fix timestamp issue for cloud disks "https://github.com/ctf0/Laravel-Media-Manager/issues/143"
+- fix url update "https://github.com/ctf0/Laravel-Media-Manager/issues/142"
+- make sure all tooltips have the same styles
+- hide folder info if 'get_folder_info' is false
+- stop supporting laravel v5
+- some cleanups
diff --git a/src/App/Controllers/MediaController.php b/src/App/Controllers/MediaController.php
index 56bd4ad..18cf571 100755
--- a/src/App/Controllers/MediaController.php
+++ b/src/App/Controllers/MediaController.php
@@ -61,8 +61,8 @@ public function __construct()
$this->storageDiskInfo = app('config')->get("filesystems.disks.{$this->fileSystem}");
$this->baseUrl = $this->storageDisk->url('/');
$this->db = app('db')
- ->connection($config['database_connection'] ?? 'mediamanager')
- ->table($config['table_locked'] ?? 'locked');
+ ->connection($config['database_connection'])
+ ->table($config['table_locked']);
$this->storageDisk->addPlugin(new IteratorPlugin());
}
diff --git a/src/App/Controllers/Modules/GetContent.php b/src/App/Controllers/Modules/GetContent.php
index dd7aab8..90a095c 100644
--- a/src/App/Controllers/Modules/GetContent.php
+++ b/src/App/Controllers/Modules/GetContent.php
@@ -47,24 +47,20 @@ protected function getData($dir)
$dirList = $this->getFolderContent($dir);
$storageFolders = $this->getFolderListByType($dirList, 'dir');
$storageFiles = $this->getFolderListByType($dirList, 'file');
- $pattern = $this->ignoreFiles;
// folders
foreach ($storageFolders as $folder) {
$path = $folder['path'];
- $time = $folder['timestamp'];
-
- if ($this->GFI) {
- $info = $this->getFolderInfoFromList($this->getFolderContent($path, true));
- }
+ $time = $folder['timestamp'] ?? null;
+ $info = $this->GFI ? $this->getFolderInfoFromList($this->getFolderContent($path, true)) : [];
$list[] = [
'name' => $folder['basename'],
'type' => 'folder',
+ 'size' => $info['size'] ?? 0,
+ 'count' => $info['count'] ?? 0,
'path' => $this->resolveUrl($path),
'storage_path' => $path,
- 'size' => isset($info) ? $info['size'] : 0,
- 'count' => isset($info) ? $info['count'] : 0,
'last_modified' => $time,
'last_modified_formated' => $this->getItemTime($time),
];
@@ -73,15 +69,15 @@ protected function getData($dir)
// files
foreach ($storageFiles as $file) {
$path = $file['path'];
- $time = $file['timestamp'];
+ $time = $file['timestamp'] ?? null;
$list[] = [
'name' => $file['basename'],
'type' => $file['mimetype'],
- 'path' => $this->resolveUrl($path),
- 'storage_path' => $path,
'size' => $file['size'],
'visibility' => $file['visibility'],
+ 'path' => $this->resolveUrl($path),
+ 'storage_path' => $path,
'last_modified' => $time,
'last_modified_formated' => $this->getItemTime($time),
];
diff --git a/src/App/Controllers/Modules/Utils.php b/src/App/Controllers/Modules/Utils.php
index accf584..cc62448 100644
--- a/src/App/Controllers/Modules/Utils.php
+++ b/src/App/Controllers/Modules/Utils.php
@@ -59,7 +59,7 @@ protected function filePattern($item)
protected function getItemTime($time)
{
- return Carbon::createFromTimestamp($time)->{$this->LMF}();
+ return $time ? Carbon::createFromTimestamp($time)->{$this->LMF}() : null;
}
/**
diff --git a/src/config/mediaManager.php b/src/config/mediaManager.php
index 41fcefe..7b099b7 100644
--- a/src/config/mediaManager.php
+++ b/src/config/mediaManager.php
@@ -35,6 +35,7 @@
* white space
*
* to add & nest folders in one go add '\/'
+ * avoid using '#' as browser interpret it as an anchor
*/
'allowed_folderNames_chars' => '_\-\s',
diff --git a/src/resources/assets/js/components/globalSearch/button.vue b/src/resources/assets/js/components/globalSearch/button.vue
index efe280c..669a449 100644
--- a/src/resources/assets/js/components/globalSearch/button.vue
+++ b/src/resources/assets/js/components/globalSearch/button.vue
@@ -1,5 +1,5 @@
- {
- this.loading = false
- this.done = true
- EventHub.fire('global-search-index', data)
- this.showNotif(this.trans('glbl_search_avail'))
+ .then(({data}) => {
+ this.loading = false
+ this.done = true
+ EventHub.fire('global-search-index', data)
+ this.showNotif(this.trans('glbl_search_avail'))
- }).catch((err) => {
- console.error(err)
- })
+ }).catch((err) => {
+ console.error(err)
+ })
},
showSearchPanel() {
EventHub.fire('toggle-global-search', true)
diff --git a/src/resources/assets/js/components/globalSearch/image.vue b/src/resources/assets/js/components/globalSearch/image.vue
index b229ed0..138f8f8 100644
--- a/src/resources/assets/js/components/globalSearch/image.vue
+++ b/src/resources/assets/js/components/globalSearch/image.vue
@@ -12,7 +12,7 @@
diff --git a/src/resources/assets/js/components/globalSearch/panel.vue b/src/resources/assets/js/components/globalSearch/panel.vue
index c79bc35..3adc582 100644
--- a/src/resources/assets/js/components/globalSearch/panel.vue
+++ b/src/resources/assets/js/components/globalSearch/panel.vue
@@ -68,7 +68,7 @@
- {{ item.dir_path }}
diff --git a/src/resources/assets/js/components/manager.vue b/src/resources/assets/js/components/manager.vue
index 7fb2db4..da308b8 100644
--- a/src/resources/assets/js/components/manager.vue
+++ b/src/resources/assets/js/components/manager.vue
@@ -28,19 +28,20 @@ import Watchers from '../modules/watch'
export default {
components: {
+ containerClickOverlay: require('./utils/container-click-overlay.vue').default,
contentRatio: require('./utils/ratio.vue').default,
+ dirBookmarks: require('./toolbar/dir-bookmark.vue').default,
+ filterAndSorting: require('./toolbar/filter-sort.vue').default,
globalSearchBtn: require('./globalSearch/button.vue').default,
globalSearchPanel: require('./globalSearch/panel.vue').default,
imageEditor: require('./image/editor/main.vue').default,
imageIntersect: require('./image/lazyLoading.vue').default,
imagePreview: require('./image/preview.vue').default,
- usageIntroOverlay: require('./usageIntro/overlay.vue').default,
+ InfiniteLoading: require('vue-infinite-loading').default,
+ uploadPreview: require('./utils/upload-preview.vue').default,
usageIntroBtn: require('./usageIntro/button.vue').default,
usageIntroPanel: require('./usageIntro/panel.vue').default,
- uploadPreview: require('./utils/upload-preview.vue').default,
- InfiniteLoading: require('vue-infinite-loading').default,
- filterAndSorting: require('./toolbar/filter-sort.vue').default,
- dirBookmarks: require('./toolbar/dir-bookmark.vue').default
+ voiceSearch: require('./search-by-voice.vue').default
},
name: 'media-manager',
mixins: [
@@ -172,9 +173,11 @@ export default {
window.addEventListener('popstate', this.urlNavigation)
document.addEventListener('keydown', this.shortCuts)
},
+ beforeMount() {
+ this.eventsListener()
+ },
mounted() {
this.init()
- this.eventsListener()
},
updated: debounce(function() {
if (this.firstRun) {
@@ -200,40 +203,12 @@ export default {
this.noScroll('remove')
},
methods: {
- init() {
- // small screen stuff
- if (this.checkForSmallScreen()) {
- this.applySmallScreen()
- }
-
+ eventsListener() {
// restrictions
EventHub.listen('external_modal_resrtict', (data) => {
return this.restrictions = Object.assign(this.restrictions, data)
})
- if (this.restrictModeIsOn) {
- this.clearUrlQuery()
- this.resolveRestrictFolders()
-
- return this.getFiles().then(this.afterInit())
- }
-
- // normal
- this.getPathFromUrl()
- .then(this.preSaved())
- .then(this.getFiles(null, this.selectedFile))
- .then(this.updatePageUrl())
- .then(this.afterInit())
-
- },
- afterInit() {
- this.fileUpload()
- this.$nextTick(() => {
- this.onResize()
- this.firstRun = true
- })
- },
- eventsListener() {
// check if image was edited
EventHub.listen('image-edited', (msg) => {
this.imageWasEdited = true
@@ -273,6 +248,36 @@ export default {
EventHub.listen('dir-bookmarks-update', (data) => this.dirBookmarks = data)
},
+ init() {
+ // small screen stuff
+ if (this.checkForSmallScreen()) {
+ this.applySmallScreen()
+ }
+
+ // restrictions
+ if (this.restrictModeIsOn) {
+ this.clearUrlQuery()
+ this.resolveRestrictFolders()
+
+ return this.getFiles().then(this.afterInit())
+ }
+
+ // normal
+ this.getPathFromUrl()
+ .then(this.preSaved())
+ .then(this.getFiles(null, this.selectedFile))
+ .then(this.updatePageUrl())
+ .then(this.afterInit())
+
+ },
+ afterInit() {
+ this.fileUpload()
+ this.$nextTick(() => {
+ this.onResize()
+ this.firstRun = true
+ })
+ },
+
shortCuts(e) {
let key = keycode(e)
diff --git a/src/resources/assets/js/components/search-by-voice.vue b/src/resources/assets/js/components/search-by-voice.vue
new file mode 100644
index 0000000..b564513
--- /dev/null
+++ b/src/resources/assets/js/components/search-by-voice.vue
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/resources/assets/js/components/usageIntro/button.vue b/src/resources/assets/js/components/usageIntro/button.vue
index 629c336..d90d3b5 100644
--- a/src/resources/assets/js/components/usageIntro/button.vue
+++ b/src/resources/assets/js/components/usageIntro/button.vue
@@ -1,5 +1,5 @@
-