Skip to content

Commit

Permalink
some updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ctf0 committed Mar 27, 2020
1 parent 07dcdbb commit 717144b
Show file tree
Hide file tree
Showing 20 changed files with 165 additions and 82 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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
```

Expand Down
1 change: 0 additions & 1 deletion src/App/Controllers/Modules/GetContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/App/Controllers/Modules/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
18 changes: 9 additions & 9 deletions src/resources/assets/js/components/globalSearch/button.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<button v-tippy
<button v-tippy="{arrow: true}"
:disabled="loading || isLoading"
:title="trans('glbl_search')"
class="button"
Expand Down Expand Up @@ -30,15 +30,15 @@ export default {
this.loading = true
axios.get(this.route)
.then(({data}) => {
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)
Expand Down
2 changes: 1 addition & 1 deletion src/resources/assets/js/components/globalSearch/image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<style scoped>
img {
background-color: black;
background-color: $black;
}
</style>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/assets/js/components/globalSearch/panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<p class="subtitle is-marginless link"
@click.stop="goToFolder(item.dir_path, item.name)">
<span class="icon"><icon name="folder"/></span>
<span v-tippy
<span v-tippy="{arrow: true}"
:title="trans('go_to_folder')">{{ item.dir_path }}</span>
</p>
<time>
Expand Down
11 changes: 6 additions & 5 deletions src/resources/assets/js/components/manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
67 changes: 67 additions & 0 deletions src/resources/assets/js/components/search-by-voice.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<template>
<button v-if="isSupported"
v-tippy="{arrow: true}"
class="button"
:title="run ? trans('voice_stop') : trans('voice_start')"
@click.stop="toggle()">
<span class="icon"
:class="run ? 'has-text-danger' : 'has-text-link'">
<icon name="microphone"/>
</span>
</button>
</template>

<script>
import annyang from 'annyang'
export default {
props: ['trans', 'searchFor'],
data() {
return {
run: false,
isSupported: true,
transcript: null
}
},
created() {
if (!annyang) {
this.isSupported = false
console.error('Speech Recognition is not supported')
}
},
mounted() {
annyang.addCallback('result', (phrases) => {
this.$parent.searchFor = phrases[0]
})
},
beforeDestroy() {
annyang.removeCallback()
},
methods: {
toggle() {
return this.run ? this.stop() : this.start()
},
stop() {
this.run = false
annyang.abort()
},
start() {
this.run = true
annyang.start()
// NOTE: testing
// setTimeout(() => {
// annyang.trigger('Time for some thrilling heroics')
// }, 1000)
}
},
watch: {
searchFor(val) {
if (!val) {
this.transcript = null
this.stop()
}
}
}
}
</script>
2 changes: 1 addition & 1 deletion src/resources/assets/js/components/usageIntro/button.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="usage-intro-btn extra-func-btns link"
<div class="usage-intro-btn"
@click.stop="showPanel()">
<span class="icon is-large">
<icon name="pref"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
<template>
<div :class="{'active': show}" class="gesture-overlay"/>
<div :class="{'active': show}"
class="gesture-overlay"/>
</template>

<style scoped lang="scss">
@import '../../../sass/partials/vars';
.gesture-overlay {
position: absolute;
z-index: 10;
top: 0;
right: 0;
background-color: rgba($blue, 0.25);
bottom: 0;
left: 0;
visibility: hidden;
opacity: 0;
transition: all 0.2s;
background-color: rgba($blue, 0.25);
position: absolute;
right: 0;
top: 0;
transition: all $anim-time;
visibility: hidden;
z-index: 10;
}
.active {
visibility: visible;
opacity: 1;
visibility: visible;
}
</style>

<script>
Expand Down
6 changes: 0 additions & 6 deletions src/resources/assets/js/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ window.Fuse = require('fuse.js')

// vue-tippy
Vue.use(require('vue-tippy'), {
arrow: true,
touchHold: true,
inertia: true,
performance: true,
flipDuration: 0,
popperOptions: {
modifiers: {
preventOverflow: {enabled: false},
hide: {enabled: false}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/resources/assets/js/modules/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import 'vue-awesome/icons/angle-down'
import 'vue-awesome/icons/cloud-upload'
import 'vue-awesome/icons/shopping-cart'
import 'vue-awesome/icons/cart-plus'
import 'vue-awesome/icons/microphone'
// cropperjs
import 'vue-awesome/icons/crop'
import 'vue-awesome/icons/ban'
Expand Down
12 changes: 6 additions & 6 deletions src/resources/assets/js/modules/url.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default {
methods: {
getUrlWithoutQuery() {
let url = new URLSearchParams(location.search)
let params = new URLSearchParams(location.search)

return url.has('path')
? location.href.replace(url.get('path'), '')
return params.has('path')
? location.href.replace(params.get('path'), '')
: location.href
},
clearUrlQuery() {
Expand All @@ -13,10 +13,10 @@ export default {
getPathFromUrl() {
return new Promise((resolve) => {
if (!this.inModal) {
let url = new URLSearchParams(location.search)
let params = new URLSearchParams(location.search)

this.folders = url.has('path')
? this.arrayFilter(url.get('path').replace(/#/g, '').split('/'))
this.folders = params.has('path')
? this.arrayFilter(params.get('path').replace(/#/g, '').split('/'))
: []
}

Expand Down
18 changes: 11 additions & 7 deletions src/resources/assets/sass/manager.scss
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@
position: absolute;
right: 0;
top: 0;
touch-action: initial !important;
transition: all $anim-time $anim-ease;
will-change: height, width, left, right;
}
Expand Down Expand Up @@ -819,12 +820,9 @@
.movable-list {
background: $white;
border-radius: 100vw;
box-shadow: 0 15px 30px 0 rgba($black, 0.05), 0 5px 15px 0 rgba($black, 0.08);

.icon {
height: 2.5rem;
width: 2.5rem;
}
cursor: pointer;
position: relative;
transition: all $anim-time;

.counter {
background: $red;
Expand All @@ -837,12 +835,18 @@
position: absolute;
right: -0.5rem;
top: -0.5rem;
z-index: -1;
z-index: 1;

&:empty {
display: none;
}
}

&:hover {
box-shadow: 0 15px 30px 0 rgba($black, 0.05), 0 5px 15px 0 rgba($black, 0.08);
color: $black;
transform: translateY(-0.7rem);
}
}

.media.link {
Expand Down
11 changes: 6 additions & 5 deletions src/resources/assets/sass/modules/usage-intro.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

.usage-intro-btn {
border-radius: 100vw;
cursor: pointer;
display: none;
transition: transform 0.3s, color 0.3s, box-shadow 0.3s;
transition: all $anim-time;

&:hover {
box-shadow: 0 15px 30px 0 rgba($red, 0.11), 0 5px 15px 0 rgba($red, 0.08);
Expand All @@ -17,7 +18,7 @@
overflow-y: scroll !important;

.gradient-pattern {
background: radial-gradient(rgba(white, 0.02) 15%, transparent 16%), rgba($dark, 0.98);
background: radial-gradient(rgba($white, 0.02) 15%, transparent 16%), rgba($dark, 0.98);
background-clip: border-box;
background-origin: padding-box;
background-position: 10px 10px;
Expand Down Expand Up @@ -65,7 +66,7 @@

.__corner {
bottom: 0;
color: black;
color: $black;
display: none;
font: normal 100%/normal Arial, Helvetica, sans-serif;
font-size: 3.5rem;
Expand All @@ -78,7 +79,7 @@
word-break: break-all;

p {
color: black;
color: $black;
}

&::before,
Expand All @@ -89,7 +90,7 @@
}

&::after {
background-color: black;
background-color: $black;
height: 150%;
left: -3rem;
margin-bottom: -1rem;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/assets/sass/packages/goo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
z-index: -1;

.btn-plain {
color: white;
color: $white;
height: 100%;
width: 100%;

Expand Down
4 changes: 4 additions & 0 deletions src/resources/lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,8 @@
'set' => 'Change Visibility',
'success' => '":attr" Visibility Was Updated',
],
'voice' => [
'start' => 'Say Something',
'stop' => 'Turn Microphone Off',
],
];
Loading

0 comments on commit 717144b

Please sign in to comment.