Skip to content

Commit

Permalink
v2.5.4
Browse files Browse the repository at this point in the history
- fix long press on folder opens image editor
- fix clear cache & local storage didnt reset folder hierarchy
- fix swipeUp,swipeDown,hold not working unless a file is selected first
- fix applying a filters after saving a cropped image reset it back to original, instead now image wont be replaced on saving
- cleanups
- missing method
  • Loading branch information
ctf0 committed Feb 10, 2018
1 parent 30fea63 commit 4304d05
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 85 deletions.
24 changes: 0 additions & 24 deletions logs/v2.5.3.txt

This file was deleted.

6 changes: 6 additions & 0 deletions logs/v2.5.4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- fix long press on folder opens image editor
- fix clear cache & local storage didnt reset folder hierarchy
- fix swipeUp,swipeDown,hold not working unless a file is selected first
- fix applying a filters after saving a cropped image reset it back to original, instead now image wont be replaced on saving
- cleanups
- missing method
2 changes: 1 addition & 1 deletion src/Controllers/MediaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public function delete_file(Request $request)

// remove folder if its size is == 0
// even if it have locked folders without items
if ($this->folderSize($file_name) == 0) {
if ($this->getFolderInfo($file_name)['files_size'] == 0) {
if (!$this->storageDisk->deleteDirectory($file_name)) {
$result[] = [
'success' => false,
Expand Down
8 changes: 3 additions & 5 deletions src/Controllers/OpsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,9 @@ protected function getFolderInfo($folder)
*/
protected function cleanName($text, $folder = null)
{
$pattern = $this->filePattern($this->fileChars);

if ($folder) {
$pattern = $this->filePattern($this->folderChars);
}
$pattern = $folder
? $this->filePattern($this->folderChars)
: $this->filePattern($this->fileChars);

$text = preg_replace($pattern, '', $text);

Expand Down
6 changes: 2 additions & 4 deletions src/resources/assets/js/components/ImageEditor/caman.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ export default {
},
watch: {
reset(val) {
if (val) {
this.controls = false
this.range = 0
}
this.controls = false
this.range = 0
}
}
}
Expand Down
62 changes: 37 additions & 25 deletions src/resources/assets/js/components/ImageEditor/cropper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,41 @@
<!-- effects -->
<div class="top">
<div class="__cropper-top-toolbar" v-if="imageCaman">
<camann :step="10" :min="-100" :max="100" icon="sun-o" filter-name="brightness"
<camann :step="10" :min="-100" :max="100"
icon="sun-o" filter-name="brightness"
:reset="reset" :processing="processing"/>
<camann :step="10" :min="-100" :max="100" icon="adjust" filter-name="contrast"
<camann :step="10" :min="-100" :max="100"
icon="adjust" filter-name="contrast"
:reset="reset" :processing="processing"/>
<camann :step="10" :min="-100" :max="100" icon="eye-slash" filter-name="saturation"
<camann :step="10" :min="-100" :max="100"
icon="eye-slash" filter-name="saturation"
:reset="reset" :processing="processing"/>
<camann :step="10" :min="-100" :max="100" icon="flash" filter-name="vibrance"
<camann :step="10" :min="-100" :max="100"
icon="flash" filter-name="vibrance"
:reset="reset" :processing="processing"/>
<camann :step="10" :min="-100" :max="100" icon="thermometer-half" filter-name="exposure"
<camann :step="10" :min="-100" :max="100"
icon="thermometer-half" filter-name="exposure"
:reset="reset" :processing="processing"/>
<camann :step="5" :min="0" :max="100" icon="eyedropper" filter-name="hue"
<camann :step="5" :min="0" :max="100"
icon="eyedropper" filter-name="hue"
:reset="reset" :processing="processing"/>
<camann :step="5" :min="0" :max="100" icon="lemon-o" filter-name="sepia"
<camann :step="5" :min="0" :max="100"
icon="lemon-o" filter-name="sepia"
:reset="reset" :processing="processing"/>
<camann :step="0.1" :min="0" :max="10" icon="flask" filter-name="gamma"
<camann :step="0.1" :min="0" :max="10"
icon="flask" filter-name="gamma"
:reset="reset" :processing="processing"/>
<camann :step="5" :min="0" :max="100" icon="dot-circle-o" filter-name="noise"
<camann :step="5" :min="0" :max="100"
icon="dot-circle-o" filter-name="noise"
:reset="reset" :processing="processing"/>
<camann :step="5" :min="0" :max="100" icon="scissors" filter-name="clip"
<camann :step="5" :min="0" :max="100"
icon="scissors" filter-name="clip"
:reset="reset" :processing="processing"/>
<camann :step="5" :min="0" :max="100" icon="diamond" filter-name="sharpen"
<camann :step="5" :min="0" :max="100"
icon="diamond" filter-name="sharpen"
:reset="reset" :processing="processing"/>
<camann :step="1" :min="0" :max="20" icon="filter" filter-name="stackBlur"
<camann :step="1" :min="0" :max="20"
icon="filter" filter-name="stackBlur"
:reset="reset" :processing="processing"/>
<camann icon="shield" filter-name="greyscale"
:reset="reset" :processing="processing"/>
Expand All @@ -35,8 +47,8 @@
</div>
</div>

<!-- controls -->
<div class="mid">
<!-- controls -->
<div class="__cropper-side-toolbar" v-if="imageCropper">
<button class="btn-plain"
:class="{'is-active': dragModeIs('move')}"
Expand Down Expand Up @@ -90,28 +102,31 @@
</button>
</div>

<!-- img -->
<div class="card-image">
<figure class="image">
<img :src="url" id="cropper">
<img :src="url" id="cropper" crossOrigin="anonymous">
</figure>
</div>
</div>

<!-- save/reset -->
<div class="bottom">
<div class="__cropper-bottom-toolbar" v-if="imageCropper">
<!-- reset -->
<button class="btn-plain"
:disabled="processing"
@click="Ops('reset')"
v-tippy :title="trans('crop_reset')">
<span class="icon"><icon :name="processing ? 'spinner' : 'times'" :pulse="processing"/></span>
</button>
<!-- clear -->
<button class="btn-plain"
:disabled="processing || !imageCropper.cropped"
@click="Ops('clear')"
v-tippy :title="trans('clear')">
<span class="icon"><icon :name="processing ? 'spinner' : 'ban'" :pulse="processing"/></span>
</button>
<!-- apply -->
<button class="btn-plain"
:disabled="processing || !hasChanged"
@click="applyChanges()"
Expand Down Expand Up @@ -207,15 +222,19 @@ export default {
return final
}
},
mounted() {
this.camanStart()
this.editorEvents()
},
methods: {
camanStart() {
this.imageCaman = Caman('#cropper', () => {
this.cropperStart()
})
Caman.Event.listen('renderFinished', () => {
this.processing = false
})
},
cropperStart() {
let image = document.getElementById('cropper')
Expand All @@ -238,12 +257,6 @@ export default {
}
})
},
editorEvents() {
// caman
Caman.Event.listen('renderFinished', () => {
this.processing = false
})
},
// operations
Ops(action) {
Expand Down Expand Up @@ -343,7 +356,7 @@ export default {
imageSmoothingQuality: 'high'
}).toDataURL(type)
cropper.replace(data)
// cropper.replace(data)
this.saveToDisk(data, file.name)
},
saveToDisk(data, name) {
Expand Down Expand Up @@ -386,10 +399,9 @@ export default {
// filters
updateFilter(name, val) {
this.processing = true
this.hasChangedByFilter = true
let caman = this.imageCaman
let cropper = this.imageCropper
let caman = this.imageCaman
// val ? caman.revert(false) : false
Expand Down
2 changes: 2 additions & 0 deletions src/resources/assets/js/components/modules/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default {
this.$ls.set('ctf0-Media_Manager', storage)
},
removeLs() {
this.folders = []
this.$ls.remove('ctf0-Media_Manager')
// location.reload()
},

// cache
Expand Down
12 changes: 2 additions & 10 deletions src/resources/assets/js/components/modules/filtration.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ export default {
filterDirList(dir) {
// dont show dirs that have similarity with selected item(s)
if (this.bulkItemsCount) {
if (this.bulkList.filter((e) => dir.match(`(/?)${e.name}(/?)`)).length > 0) {
return false
}

return true
return this.bulkList.filter((e) => dir.match(`(/?)${e.name}(/?)`)).length > 0 ? false : true
}

return this.selectedFile && !dir.includes(this.selectedFile.name)
Expand All @@ -85,11 +81,7 @@ export default {
this.searchItemsCount = this.filesList.length

if (this.searchItemsCount == 0) {
if (oldCount == 0) {
return
}

return this.noSearch('show')
return oldCount == 0 ? false : this.noSearch('show')
}

this.noSearch('hide')
Expand Down
4 changes: 3 additions & 1 deletion src/resources/assets/js/components/modules/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ export default {
methods: {
// btns
imageEditor() {
this.toggleModal('imageEditor_modal')
if (this.selectedFileIs('image')) {
this.toggleModal('imageEditor_modal')
}
},
imageEditorCard() {
this.toggleModal()
Expand Down
16 changes: 4 additions & 12 deletions src/resources/assets/js/components/modules/selected.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,11 @@ export default {
? this.toggleModal('preview_modal')
: this.openFolder(this.selectedFile)
}

return
},

/* Folder */
openFolder(file) {
if (!this.isBulkSelecting()) {
if (!this.fileTypeIs(file, 'folder')) {
return
}

if (!this.isBulkSelecting() && this.fileTypeIs(file, 'folder')) {
this.folders.push(file.name)
this.getFiles(this.folders)
}
Expand All @@ -112,11 +106,9 @@ export default {
let length = this.folders.length
let newSelected = length - 1

if (length == 0 || this.restrictPath && this.files.path == `/${this.restrictPath}`) {
return
}

this.goToFolder(newSelected)
return length == 0 || this.restrictPath && this.files.path == `/${this.restrictPath}`
? false
: this.goToFolder(newSelected)
},

/* Navigation */
Expand Down
6 changes: 3 additions & 3 deletions src/resources/views/_manager.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,9 @@ class="button"
<v-touch class="__file-box"
:class="{'bulk-selected': IsInBulkList(file), 'selected' : selectedFile == file}"
:ref="'file_' + index"
@swipeup="moveItem()"
@swipedown="deleteItem()"
@hold="imageEditor()">
@swipeup="moveItem(), setSelected(file, index)"
@swipedown="deleteItem(), setSelected(file, index)"
@hold="imageEditor(), setSelected(file, index)">

{{-- lock file --}}
<button class="__box-lock-icon icon"
Expand Down

0 comments on commit 4304d05

Please sign in to comment.