Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 4304d05

Browse files
committed
v2.5.4
- 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
1 parent 30fea63 commit 4304d05

File tree

11 files changed

+63
-85
lines changed

11 files changed

+63
-85
lines changed

logs/v2.5.3.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

logs/v2.5.4.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- fix long press on folder opens image editor
2+
- fix clear cache & local storage didnt reset folder hierarchy
3+
- fix swipeUp,swipeDown,hold not working unless a file is selected first
4+
- fix applying a filters after saving a cropped image reset it back to original, instead now image wont be replaced on saving
5+
- cleanups
6+
- missing method

src/Controllers/MediaController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public function delete_file(Request $request)
507507

508508
// remove folder if its size is == 0
509509
// even if it have locked folders without items
510-
if ($this->folderSize($file_name) == 0) {
510+
if ($this->getFolderInfo($file_name)['files_size'] == 0) {
511511
if (!$this->storageDisk->deleteDirectory($file_name)) {
512512
$result[] = [
513513
'success' => false,

src/Controllers/OpsTrait.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,9 @@ protected function getFolderInfo($folder)
107107
*/
108108
protected function cleanName($text, $folder = null)
109109
{
110-
$pattern = $this->filePattern($this->fileChars);
111-
112-
if ($folder) {
113-
$pattern = $this->filePattern($this->folderChars);
114-
}
110+
$pattern = $folder
111+
? $this->filePattern($this->folderChars)
112+
: $this->filePattern($this->fileChars);
115113

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

src/resources/assets/js/components/ImageEditor/caman.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ export default {
7474
},
7575
watch: {
7676
reset(val) {
77-
if (val) {
78-
this.controls = false
79-
this.range = 0
80-
}
77+
this.controls = false
78+
this.range = 0
8179
}
8280
}
8381
}

src/resources/assets/js/components/ImageEditor/cropper.vue

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,41 @@
44
<!-- effects -->
55
<div class="top">
66
<div class="__cropper-top-toolbar" v-if="imageCaman">
7-
<camann :step="10" :min="-100" :max="100" icon="sun-o" filter-name="brightness"
7+
<camann :step="10" :min="-100" :max="100"
8+
icon="sun-o" filter-name="brightness"
89
:reset="reset" :processing="processing"/>
9-
<camann :step="10" :min="-100" :max="100" icon="adjust" filter-name="contrast"
10+
<camann :step="10" :min="-100" :max="100"
11+
icon="adjust" filter-name="contrast"
1012
:reset="reset" :processing="processing"/>
11-
<camann :step="10" :min="-100" :max="100" icon="eye-slash" filter-name="saturation"
13+
<camann :step="10" :min="-100" :max="100"
14+
icon="eye-slash" filter-name="saturation"
1215
:reset="reset" :processing="processing"/>
13-
<camann :step="10" :min="-100" :max="100" icon="flash" filter-name="vibrance"
16+
<camann :step="10" :min="-100" :max="100"
17+
icon="flash" filter-name="vibrance"
1418
:reset="reset" :processing="processing"/>
15-
<camann :step="10" :min="-100" :max="100" icon="thermometer-half" filter-name="exposure"
19+
<camann :step="10" :min="-100" :max="100"
20+
icon="thermometer-half" filter-name="exposure"
1621
:reset="reset" :processing="processing"/>
17-
<camann :step="5" :min="0" :max="100" icon="eyedropper" filter-name="hue"
22+
<camann :step="5" :min="0" :max="100"
23+
icon="eyedropper" filter-name="hue"
1824
:reset="reset" :processing="processing"/>
19-
<camann :step="5" :min="0" :max="100" icon="lemon-o" filter-name="sepia"
25+
<camann :step="5" :min="0" :max="100"
26+
icon="lemon-o" filter-name="sepia"
2027
:reset="reset" :processing="processing"/>
21-
<camann :step="0.1" :min="0" :max="10" icon="flask" filter-name="gamma"
28+
<camann :step="0.1" :min="0" :max="10"
29+
icon="flask" filter-name="gamma"
2230
:reset="reset" :processing="processing"/>
23-
<camann :step="5" :min="0" :max="100" icon="dot-circle-o" filter-name="noise"
31+
<camann :step="5" :min="0" :max="100"
32+
icon="dot-circle-o" filter-name="noise"
2433
:reset="reset" :processing="processing"/>
25-
<camann :step="5" :min="0" :max="100" icon="scissors" filter-name="clip"
34+
<camann :step="5" :min="0" :max="100"
35+
icon="scissors" filter-name="clip"
2636
:reset="reset" :processing="processing"/>
27-
<camann :step="5" :min="0" :max="100" icon="diamond" filter-name="sharpen"
37+
<camann :step="5" :min="0" :max="100"
38+
icon="diamond" filter-name="sharpen"
2839
:reset="reset" :processing="processing"/>
29-
<camann :step="1" :min="0" :max="20" icon="filter" filter-name="stackBlur"
40+
<camann :step="1" :min="0" :max="20"
41+
icon="filter" filter-name="stackBlur"
3042
:reset="reset" :processing="processing"/>
3143
<camann icon="shield" filter-name="greyscale"
3244
:reset="reset" :processing="processing"/>
@@ -35,8 +47,8 @@
3547
</div>
3648
</div>
3749

38-
<!-- controls -->
3950
<div class="mid">
51+
<!-- controls -->
4052
<div class="__cropper-side-toolbar" v-if="imageCropper">
4153
<button class="btn-plain"
4254
:class="{'is-active': dragModeIs('move')}"
@@ -90,28 +102,31 @@
90102
</button>
91103
</div>
92104

105+
<!-- img -->
93106
<div class="card-image">
94107
<figure class="image">
95-
<img :src="url" id="cropper">
108+
<img :src="url" id="cropper" crossOrigin="anonymous">
96109
</figure>
97110
</div>
98111
</div>
99112

100-
<!-- save/reset -->
101113
<div class="bottom">
102114
<div class="__cropper-bottom-toolbar" v-if="imageCropper">
115+
<!-- reset -->
103116
<button class="btn-plain"
104117
:disabled="processing"
105118
@click="Ops('reset')"
106119
v-tippy :title="trans('crop_reset')">
107120
<span class="icon"><icon :name="processing ? 'spinner' : 'times'" :pulse="processing"/></span>
108121
</button>
122+
<!-- clear -->
109123
<button class="btn-plain"
110124
:disabled="processing || !imageCropper.cropped"
111125
@click="Ops('clear')"
112126
v-tippy :title="trans('clear')">
113127
<span class="icon"><icon :name="processing ? 'spinner' : 'ban'" :pulse="processing"/></span>
114128
</button>
129+
<!-- apply -->
115130
<button class="btn-plain"
116131
:disabled="processing || !hasChanged"
117132
@click="applyChanges()"
@@ -207,15 +222,19 @@ export default {
207222
return final
208223
}
209224
},
225+
210226
mounted() {
211227
this.camanStart()
212-
this.editorEvents()
213228
},
214229
methods: {
215230
camanStart() {
216231
this.imageCaman = Caman('#cropper', () => {
217232
this.cropperStart()
218233
})
234+
235+
Caman.Event.listen('renderFinished', () => {
236+
this.processing = false
237+
})
219238
},
220239
cropperStart() {
221240
let image = document.getElementById('cropper')
@@ -238,12 +257,6 @@ export default {
238257
}
239258
})
240259
},
241-
editorEvents() {
242-
// caman
243-
Caman.Event.listen('renderFinished', () => {
244-
this.processing = false
245-
})
246-
},
247260
248261
// operations
249262
Ops(action) {
@@ -343,7 +356,7 @@ export default {
343356
imageSmoothingQuality: 'high'
344357
}).toDataURL(type)
345358
346-
cropper.replace(data)
359+
// cropper.replace(data)
347360
this.saveToDisk(data, file.name)
348361
},
349362
saveToDisk(data, name) {
@@ -386,10 +399,9 @@ export default {
386399
// filters
387400
updateFilter(name, val) {
388401
this.processing = true
389-
390402
this.hasChangedByFilter = true
391-
let caman = this.imageCaman
392403
let cropper = this.imageCropper
404+
let caman = this.imageCaman
393405
394406
// val ? caman.revert(false) : false
395407

src/resources/assets/js/components/modules/cache.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export default {
1111
this.$ls.set('ctf0-Media_Manager', storage)
1212
},
1313
removeLs() {
14+
this.folders = []
1415
this.$ls.remove('ctf0-Media_Manager')
16+
// location.reload()
1517
},
1618

1719
// cache

src/resources/assets/js/components/modules/filtration.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ export default {
6767
filterDirList(dir) {
6868
// dont show dirs that have similarity with selected item(s)
6969
if (this.bulkItemsCount) {
70-
if (this.bulkList.filter((e) => dir.match(`(/?)${e.name}(/?)`)).length > 0) {
71-
return false
72-
}
73-
74-
return true
70+
return this.bulkList.filter((e) => dir.match(`(/?)${e.name}(/?)`)).length > 0 ? false : true
7571
}
7672

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

8783
if (this.searchItemsCount == 0) {
88-
if (oldCount == 0) {
89-
return
90-
}
91-
92-
return this.noSearch('show')
84+
return oldCount == 0 ? false : this.noSearch('show')
9385
}
9486

9587
this.noSearch('hide')

src/resources/assets/js/components/modules/image.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ export default {
22
methods: {
33
// btns
44
imageEditor() {
5-
this.toggleModal('imageEditor_modal')
5+
if (this.selectedFileIs('image')) {
6+
this.toggleModal('imageEditor_modal')
7+
}
68
},
79
imageEditorCard() {
810
this.toggleModal()

src/resources/assets/js/components/modules/selected.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,11 @@ export default {
7676
? this.toggleModal('preview_modal')
7777
: this.openFolder(this.selectedFile)
7878
}
79-
80-
return
8179
},
8280

8381
/* Folder */
8482
openFolder(file) {
85-
if (!this.isBulkSelecting()) {
86-
if (!this.fileTypeIs(file, 'folder')) {
87-
return
88-
}
89-
83+
if (!this.isBulkSelecting() && this.fileTypeIs(file, 'folder')) {
9084
this.folders.push(file.name)
9185
this.getFiles(this.folders)
9286
}
@@ -112,11 +106,9 @@ export default {
112106
let length = this.folders.length
113107
let newSelected = length - 1
114108

115-
if (length == 0 || this.restrictPath && this.files.path == `/${this.restrictPath}`) {
116-
return
117-
}
118-
119-
this.goToFolder(newSelected)
109+
return length == 0 || this.restrictPath && this.files.path == `/${this.restrictPath}`
110+
? false
111+
: this.goToFolder(newSelected)
120112
},
121113

122114
/* Navigation */

0 commit comments

Comments
 (0)