Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/657/head
Maxence Lange 2019-08-26 15:58:54 -01:00
rodzic b44d4e6636
commit 8ef030c108
1 zmienionych plików z 12 dodań i 12 usunięć

Wyświetl plik

@ -647,37 +647,37 @@ export default {
// draw a close badge in the upper-right corner // draw a close badge in the upper-right corner
ctx.beginPath() ctx.beginPath()
ctx.arc( imgWidth - 25, 25, 15, 0, 2 * Math.PI) ctx.arc(imgWidth - 25, 25, 15, 0, 2 * Math.PI)
ctx.fillStyle = 'white' ctx.fillStyle = 'white'
ctx.fill() ctx.fill()
ctx.lineWidth = 3 ctx.lineWidth = 3
ctx.StrokeStyle = 'darkgray' ctx.StrokeStyle = 'darkgray'
ctx.stroke() ctx.stroke()
ctx.beginPath() ctx.beginPath()
ctx.moveTo( imgWidth - (25+10), 25-10 ) ctx.moveTo(imgWidth - (25 + 10), 25 - 10)
ctx.lineTo( imgWidth - (25-10), 25+10 ) ctx.lineTo(imgWidth - (25 - 10), 25 + 10)
ctx.stroke() ctx.stroke()
ctx.moveTo( imgWidth - (25-10), 25-10 ) ctx.moveTo(imgWidth - (25 - 10), 25 - 10)
ctx.lineTo( imgWidth - (25+10), 25+10 ) ctx.lineTo(imgWidth - (25 + 10), 25 + 10)
ctx.stroke() ctx.stroke()
// Add filename to generic icon for non image document // Add filename to generic icon for non image document
if ( ! e.target.result.startsWith("data:image") ) { if (!e.target.result.startsWith('data:image')) {
ctx.fillStyle = 'black' ctx.fillStyle = 'black'
ctx.font = "12px Arial" ctx.font = '12px Arial'
ctx.fillText(file.name, 30, imgHeight - 20) ctx.fillText(file.name, 30, imgHeight - 20)
} }
// Save miniature // Save miniature
self.miniatures.push(canvas.toDataURL()) self.miniatures.push(canvas.toDataURL())
} }
// Save document // Save document
self.postAttachments.push(e.target.result) self.postAttachments.push(e.target.result)
// Draw a generic icon when document is not an image // Draw a generic icon when document is not an image
if ( e.target.result.startsWith("data:image") ) { if (e.target.result.startsWith('data:image')) {
img.src = e.target.result img.src = e.target.result
} else { } else {
img.src = OC.generateUrl('svg/core/filetypes/x-office-document?color=d8d8d8') img.src = OC.generateUrl('svg/core/filetypes/x-office-document?color=d8d8d8')
@ -688,8 +688,8 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
}, },
removeAttachment(idx) { removeAttachment(idx) {
this.postAttachments.splice(idx,1) this.postAttachments.splice(idx, 1)
this.miniatures.splice(idx,1) this.miniatures.splice(idx, 1)
}, },
insert(emoji) { insert(emoji) {
if (typeof emoji === 'object') { if (typeof emoji === 'object') {