Make image inserts use full root URL
This commit is contained in:
parent
de4e848e6d
commit
5d099ab10c
2
admin.go
2
admin.go
|
@ -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"`
|
||||
}
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
padding: 30px;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #7f2aff;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue