diff --git a/system/typemill/Controllers/ControllerWebSystem.php b/system/typemill/Controllers/ControllerWebSystem.php index 4bfa34a..97ca36d 100644 --- a/system/typemill/Controllers/ControllerWebSystem.php +++ b/system/typemill/Controllers/ControllerWebSystem.php @@ -74,6 +74,7 @@ class ControllerWebSystem extends Controller $extension = new Extension(); $themeDefinitions = $extension->getThemeDetails($this->settings['theme']); $themeSettings = $extension->getThemeSettings($this->settings['themes']); + $readymades = []; # add userroles and other datasets foreach($themeDefinitions as $name => $definitions) @@ -93,6 +94,11 @@ class ControllerWebSystem extends Controller } } } + + if(isset($definitions['readymades'])) + { + $readymades[$name] = $definitions['readymades']; + } } $license = []; @@ -106,9 +112,10 @@ class ControllerWebSystem extends Controller 'darkmode' => $request->getAttribute('c_darkmode'), 'mainnavi' => $mainNavigation, 'jsdata' => [ - 'systemnavi' => $systemNavigation, + 'systemnavi' => $systemNavigation, 'settings' => $themeSettings, 'definitions' => $themeDefinitions, + 'readymades' => $readymades, 'theme' => $this->settings['theme'], 'license' => $license, 'labels' => $this->c->get('translations'), diff --git a/system/typemill/author/js/vue-forms.js b/system/typemill/author/js/vue-forms.js index b686dd3..95f63ed 100644 --- a/system/typemill/author/js/vue-forms.js +++ b/system/typemill/author/js/vue-forms.js @@ -88,17 +88,25 @@ app.component('component-codearea', { `, mounted: function() { - this.resizeCodearea(); - this.highlight(this.value); + this.initialize() + + eventBus.$on('codeareaupdate', this.initialize ); }, methods: { - update: function($event, name) + initialize() + { + this.$nextTick(() => { + this.highlight(this.value); + this.resizeCodearea(); + }); + }, + update($event, name) { this.highlight($event.target.value); this.resizeCodearea(); eventBus.$emit('forminput', {'name': name, 'value': $event.target.value}); }, - resizeCodearea: function() + resizeCodearea() { let codeeditor = this.$refs["editor"]; @@ -110,7 +118,7 @@ app.component('component-codearea', { } }); }, - highlight: function(code) + highlight(code) { if(code === undefined) { diff --git a/system/typemill/author/js/vue-themes.js b/system/typemill/author/js/vue-themes.js index 8fc1cbc..23121a8 100644 --- a/system/typemill/author/js/vue-themes.js +++ b/system/typemill/author/js/vue-themes.js @@ -35,6 +35,31 @@ const app = Vue.createApp({