Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Make image inserts use full root URL

Kailash Nadh5d099ab10c9b
diff --git a/admin.go b/admin.go
index f704e32a..4f42570c 100644
--- a/admin.go
+++ b/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"`
}
diff --git a/default-template.html b/default-template.html
index c9abea6a..3fd7a362 100644
--- a/default-template.html
+++ b/default-template.html
@@ -36,6 +36,10 @@
padding: 30px;
}
+ img {
+ max-width: 100%;
+ }
+
a {
color: #7f2aff;
}
diff --git a/frontend/my/src/Campaign.js b/frontend/my/src/Campaign.js
index 3d4a1c9d..8664dd86 100644
--- a/frontend/my/src/Campaign.js
+++ b/frontend/my/src/Campaign.js
@@ -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);
}