kopia lustrzana https://github.com/nextcloud/social
smaller resize + lint errors
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/626/head
rodzic
d6b424bb81
commit
fff29cd492
|
@ -61,6 +61,9 @@ class CacheDocumentService {
|
|||
use TStringTools;
|
||||
|
||||
|
||||
const RESIZED_HEIGHT = 250;
|
||||
const RESIZED_WIDTH = 350;
|
||||
|
||||
/** @var IAppData */
|
||||
private $appData;
|
||||
|
||||
|
@ -186,7 +189,7 @@ class CacheDocumentService {
|
|||
$image->quality_jpg = 100;
|
||||
$image->quality_png = 9;
|
||||
|
||||
$image->resizeToBestFit(500, 300);
|
||||
$image->resizeToBestFit(self::RESIZED_WIDTH, self::RESIZED_HEIGHT);
|
||||
$content = $image->getImageAsString();
|
||||
} catch (ImageResizeException $e) {
|
||||
}
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -1,28 +1,30 @@
|
|||
<template>
|
||||
<masonry>
|
||||
<div v-for="(item, index) in attachments" :key="index">
|
||||
<img :src="OC.generateUrl('/apps/social/document/get/resized?id=' + item.id)" @click="showModal(index)"/>
|
||||
<img :src="OC.generateUrl('/apps/social/document/get/resized?id=' + item.id)" @click="showModal(index)">
|
||||
</div>
|
||||
<modal v-show="modal" @close="closeModal" @previous="showPrevious" @next="showNext" :hasPrevious="current > 0" :hasNext="current < (attachments.length - 1)" size="full">
|
||||
<div class="modal__content">
|
||||
<img ref="modalImg" src=""/>
|
||||
</div>
|
||||
<modal v-show="modal" :has-previous="current > 0" :has-next="current < (attachments.length - 1)"
|
||||
size="full" @close="closeModal" @previous="showPrevious"
|
||||
@next="showNext">
|
||||
<div class="modal__content">
|
||||
<img ref="modalImg" src="">
|
||||
</div>
|
||||
</modal>
|
||||
</masonry>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import Modal from 'nextcloud-vue/dist/Components/Modal';
|
||||
import Modal from 'nextcloud-vue/dist/Components/Modal'
|
||||
|
||||
export default {
|
||||
name: 'PostAttachment',
|
||||
components: {
|
||||
Modal,
|
||||
Modal
|
||||
},
|
||||
mixins: [],
|
||||
props: {
|
||||
attachments: Array,
|
||||
attachments: Array
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -32,7 +34,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
showModal(idx) {
|
||||
this.current = idx;
|
||||
this.current = idx
|
||||
this.$refs.modalImg.src = OC.generateUrl('/apps/social/document/get?id=' + this.attachments[this.current].id)
|
||||
this.modal = true
|
||||
},
|
||||
|
@ -40,11 +42,11 @@ export default {
|
|||
this.modal = false
|
||||
},
|
||||
showPrevious() {
|
||||
this.current--;
|
||||
this.current--
|
||||
this.$refs.modalImg.src = OC.generateUrl('/apps/social/document/get?id=' + this.attachments[this.current].id)
|
||||
},
|
||||
showNext() {
|
||||
this.current++;
|
||||
this.current++
|
||||
this.$refs.modalImg.src = OC.generateUrl('/apps/social/document/get?id=' + this.attachments[this.current].id)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ Vue.use(vuetwemoji, {
|
|||
className: 'emoji', // custom className for image output
|
||||
size: 'twemoji' // image size
|
||||
})
|
||||
Vue.use(VueMasonry);
|
||||
Vue.use(VueMasonry)
|
||||
|
||||
/* eslint-disable-next-line no-new */
|
||||
new Vue({
|
||||
|
|
Ładowanie…
Reference in New Issue