diff --git a/system/Assets.php b/system/Assets.php index 1773f3a..c4b6612 100644 --- a/system/Assets.php +++ b/system/Assets.php @@ -16,6 +16,7 @@ class Assets $this->inlineJS = array(); $this->inlineCSS = array(); $this->editorJS = array(); + $this->editorCSS = array(); $this->editorInlineJS = array(); $this->svgSymbols = array(); $this->imageUrl = false; @@ -207,12 +208,12 @@ class Assets public function renderCSS() { - return implode('', $this->CSS) . implode('', $this->inlineCSS); + return implode("\n", $this->CSS) . implode("\n", $this->inlineCSS); } public function renderJS() { - return implode('', $this->JS) . implode('', $this->inlineJS); + return implode("\n", $this->JS) . implode("\n", $this->inlineJS); } public function renderSvg() @@ -236,9 +237,24 @@ class Assets $this->editorInlineJS[] = ''; } + public function addEditorCSS($CSS) + { + $CSSfile = $this->getFileUrl($CSS); + + if($CSSfile) + { + $this->editorCSS[] = ''; + } + } + public function renderEditorJS() { - return implode('', $this->editorJS) . implode('', $this->editorInlineJS); + return implode("\n", $this->editorJS) . implode("\n", $this->editorInlineJS); + } + + public function renderEditorCSS() + { + return implode("\n", $this->editorCSS); } /** diff --git a/system/Controllers/MetaApiController.php b/system/Controllers/MetaApiController.php index dcebb92..428693d 100644 --- a/system/Controllers/MetaApiController.php +++ b/system/Controllers/MetaApiController.php @@ -7,6 +7,7 @@ use Slim\Http\Response; use Typemill\Models\WriteYaml; use Typemill\Models\WriteMeta; use Typemill\Models\Folder; +use Typemill\Events\OnMetaDefinitionsLoaded; class MetaApiController extends ContentController { @@ -60,6 +61,9 @@ class MetaApiController extends ContentController $metatabs = array_merge_recursive($metatabs, $themeSettings['metatabs']); } + # dispatch meta + $metatabs = $this->c->dispatcher->dispatch('onMetaDefinitionsLoaded', new OnMetaDefinitionsLoaded($metatabs))->getData(); + return $metatabs; } diff --git a/system/Events/OnMetaDefinitionsLoaded.php b/system/Events/OnMetaDefinitionsLoaded.php new file mode 100644 index 0000000..21ddb44 --- /dev/null +++ b/system/Events/OnMetaDefinitionsLoaded.php @@ -0,0 +1,14 @@ +container->assets->addInlineCSS($CSS); } + protected function addEditorCSS($CSS) + { + $this->container->assets->addEditorCSS($CSS); + } + protected function activateAxios() { $this->container->assets->activateAxios(); diff --git a/system/author/editor/editor-blox.twig b/system/author/editor/editor-blox.twig index cf249e0..2649f6c 100644 --- a/system/author/editor/editor-blox.twig +++ b/system/author/editor/editor-blox.twig @@ -23,6 +23,7 @@ :errors="formErrors[currentTab]" :schema="formDefinitions[currentTab]" :formdata="formData[currentTab]" + :item="item" v-on:saveform="saveForm"> diff --git a/system/author/js/vue-blox.js b/system/author/js/vue-blox.js index a045fdd..3abd986 100644 --- a/system/author/js/vue-blox.js +++ b/system/author/js/vue-blox.js @@ -31,7 +31,7 @@ const contentComponent = Vue.component('content-block', { compmarkdown: '', componentType: '', disabled: false, - load: false, +//fix load: false, newblock: false, } }, @@ -1386,7 +1386,7 @@ const imageComponent = Vue.component('image-component', { maxsize: 5, // megabyte imgpreview: false, showmedialib: false, - load: false, +//fix load: false, imgmeta: false, imgalt: '', imgtitle: '', @@ -1683,7 +1683,7 @@ const fileComponent = Vue.component('file-component', { return { maxsize: 5, // megabyte showmedialib: false, - load: false, +//fix load: false, filemeta: false, filetitle: '', fileextension: '', diff --git a/system/author/js/vue-meta.js b/system/author/js/vue-meta.js index 6689c86..6bfc346 100644 --- a/system/author/js/vue-meta.js +++ b/system/author/js/vue-meta.js @@ -11,479 +11,6 @@ Vue.filter('translate', function (value) { } }) -Vue.component('component-text', { - props: ['class', 'id', 'description', 'maxlength', 'hidden', 'readonly', 'required', 'disabled', 'placeholder', 'label', 'name', 'type', 'value', 'errors'], - template: '