diff --git a/packages/netlify-cms-locales/src/en/index.js b/packages/netlify-cms-locales/src/en/index.js
index e13c78ac..f48279fb 100644
--- a/packages/netlify-cms-locales/src/en/index.js
+++ b/packages/netlify-cms-locales/src/en/index.js
@@ -157,11 +157,17 @@ const en = {
},
image: {
choose: 'Choose an image',
+ chooseUrl: 'Insert from URL',
+ replaceUrl: 'Replace with URL',
+ promptUrl: 'Enter the URL of the image',
chooseDifferent: 'Choose different image',
remove: 'Remove image',
},
file: {
choose: 'Choose a file',
+ chooseUrl: 'Insert from URL',
+ replaceUrl: 'Replace with URL',
+ promptUrl: 'Enter the URL of the file',
chooseDifferent: 'Choose different file',
remove: 'Remove file',
},
diff --git a/packages/netlify-cms-widget-file/src/withFileControl.js b/packages/netlify-cms-widget-file/src/withFileControl.js
index d3e36178..5348d90f 100644
--- a/packages/netlify-cms-widget-file/src/withFileControl.js
+++ b/packages/netlify-cms-widget-file/src/withFileControl.js
@@ -60,12 +60,12 @@ const FileLinkList = styled.ul`
const FileWidgetButton = styled.button`
${buttons.button};
${components.badge};
+ margin-bottom: 12px;
`;
const FileWidgetButtonRemove = styled.button`
${buttons.button};
${components.badgeDanger};
- margin-top: 12px;
`;
function isMultiple(value) {
@@ -174,6 +174,14 @@ export default function withFileControl({ forImage } = {}) {
});
};
+ handleUrl = subject => e => {
+ e.preventDefault();
+
+ const url = window.prompt(this.props.t(`editor.editorWidgets.${subject}.promptUrl`));
+
+ return this.props.onChange(url);
+ };
+
handleRemove = e => {
e.preventDefault();
this.props.onClearMediaControl(this.controlID);
@@ -255,6 +263,9 @@ export default function withFileControl({ forImage } = {}) {
{t(`editor.editorWidgets.${subject}.chooseDifferent`)}
+
+ {t(`editor.editorWidgets.${subject}.replaceUrl`)}
+
{t(`editor.editorWidgets.${subject}.remove`)}
@@ -266,9 +277,14 @@ export default function withFileControl({ forImage } = {}) {
renderNoSelection = subject => {
const { t } = this.props;
return (
-
- {t(`editor.editorWidgets.${subject}.choose`)}
-
+ <>
+
+ {t(`editor.editorWidgets.${subject}.choose`)}
+
+
+ {t(`editor.editorWidgets.${subject}.chooseUrl`)}
+
+ >
);
};