Make image inserts use full root URL

This commit is contained in:
Kailash Nadh 2018-11-02 23:57:44 +05:30
parent de4e848e6d
commit 5d099ab10c
3 changed files with 8 additions and 5 deletions

View File

@ -10,7 +10,7 @@ import (
type configScript struct {
RootURL string `json:"rootURL"`
UploadURI string `json:"uploadURL"`
UploadURI string `json:"uploadURI"`
FromEmail string `json:"fromEmail"`
Messengers []string `json:"messengers"`
}

View File

@ -36,6 +36,10 @@
padding: 30px;
}
img {
max-width: 100%;
}
a {
color: #7f2aff;
}

View File

@ -36,11 +36,11 @@ class Editor extends React.PureComponent {
[{ "color": [] }, { "background": [] }, { 'size': [] }],
[{"list": "ordered"}, {"list": "bullet"}, {"indent": "-1"}, {"indent": "+1"}],
[{"align": ""}, { "align": "center" }, { "align": "right" }, { "align": "justify" }],
["link", "gallery"],
["link", "image"],
["clean", "font"]
],
handlers: {
"gallery": () => {
"image": () => {
this.props.toggleMedia()
}
}
@ -62,12 +62,11 @@ class Editor extends React.PureComponent {
// Custom handler for inserting images from the media popup.
insertMedia = (uri) => {
const quill = this.state.quill.getEditor()
let range = quill.getSelection(true);
quill.updateContents(new Delta()
.retain(range.index)
.delete(range.length)
.insert({ image: uri })
.insert({ image: this.props.config.rootURL + uri })
, null);
}