|
@@ -113,7 +113,7 @@ class Markdown extends Field
|
|
|
*/
|
|
|
public function imageUrl(string $url)
|
|
|
{
|
|
|
- return $this->options(['imageUploadURL' => admin_url($url)]);
|
|
|
+ return $this->options(['imageUploadURL' => $this->formatUrl(admin_url($url))]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -146,7 +146,7 @@ class Markdown extends Field
|
|
|
|
|
|
$this->options['onload'] = JavaScript::make(
|
|
|
<<<JS
|
|
|
-function () {
|
|
|
+function () {
|
|
|
this.setMarkdown($('#{$this->id}-template').html());
|
|
|
}
|
|
|
JS
|
|
@@ -165,9 +165,19 @@ JS
|
|
|
* @return string
|
|
|
*/
|
|
|
protected function defaultImageUploadUrl()
|
|
|
+ {
|
|
|
+ return $this->formatUrl(route('dcat.api.editor-md.upload'));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $url
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ protected function formatUrl(string $url)
|
|
|
{
|
|
|
return Helper::urlWithQuery(
|
|
|
- route('dcat.api.editor-md.upload'),
|
|
|
+ $url,
|
|
|
[
|
|
|
'_token' => csrf_token(),
|
|
|
'disk' => $this->disk,
|