kopia lustrzana https://github.com/nextcloud/social
Adds attachments to the data sent to the server when posting a toot.
Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>pull/657/head
rodzic
f0fb14e29c
commit
a7b84cfeb0
|
@ -80,7 +80,7 @@
|
||||||
</emoji-picker>
|
</emoji-picker>
|
||||||
|
|
||||||
<masonry>
|
<masonry>
|
||||||
<div v-for="(item, index) in postAttachments" :key="index">
|
<div v-for="(item, index) in miniatures" :key="index">
|
||||||
<img :src="item">
|
<img :src="item">
|
||||||
</div>
|
</div>
|
||||||
</masonry>
|
</masonry>
|
||||||
|
@ -94,7 +94,7 @@
|
||||||
<popover-menu :menu="visibilityPopover" />
|
<popover-menu :menu="visibilityPopover" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label v-tooltip="'Upload image'" class="icon-upload" for="file-upload" />
|
<label v-tooltip="'Upload image'" class="icon-upload" for="file-upload" />
|
||||||
<input id="file-upload" ref="addAttach" class="upload-button" type="file" @change="uploadImages" />
|
<input id="file-upload" ref="addAttach" class="upload-button" type="file" @change="uploadImages" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -389,7 +389,8 @@ export default {
|
||||||
type: localStorage.getItem('social.lastPostType') || 'followers',
|
type: localStorage.getItem('social.lastPostType') || 'followers',
|
||||||
loading: false,
|
loading: false,
|
||||||
post: '',
|
post: '',
|
||||||
postAttachments: [],
|
miniatures: [], // miniatures of images stored in postAttachments
|
||||||
|
postAttachments: [], // The toot's attachments
|
||||||
canType: true,
|
canType: true,
|
||||||
search: '',
|
search: '',
|
||||||
replyTo: null,
|
replyTo: null,
|
||||||
|
@ -608,7 +609,8 @@ export default {
|
||||||
canvas.height = imgHeight
|
canvas.height = imgHeight
|
||||||
ctx.drawImage(img, 0, 0, imgWidth, imgHeight)
|
ctx.drawImage(img, 0, 0, imgWidth, imgHeight)
|
||||||
var resizedImg = canvas.toDataURL()
|
var resizedImg = canvas.toDataURL()
|
||||||
self.postAttachments.push(resizedImg)
|
self.postAttachments.push(Img)
|
||||||
|
self.miniatures.push(resizedImg)
|
||||||
}
|
}
|
||||||
img.src = e.target.result
|
img.src = e.target.result
|
||||||
}
|
}
|
||||||
|
@ -667,7 +669,8 @@ export default {
|
||||||
content: element.innerText.trim(),
|
content: element.innerText.trim(),
|
||||||
to: to,
|
to: to,
|
||||||
hashtags: hashtags,
|
hashtags: hashtags,
|
||||||
type: this.type
|
type: this.type,
|
||||||
|
attachments: this.postAttachments
|
||||||
}
|
}
|
||||||
if (this.replyTo) {
|
if (this.replyTo) {
|
||||||
data.replyTo = this.replyTo.id
|
data.replyTo = this.replyTo.id
|
||||||
|
|
Ładowanie…
Reference in New Issue