formatName($this->id); $config = (array) WangEditor::config('config'); $config = json_encode(array_merge([ 'zIndex' => 0, 'uploadImgShowBase64' => true, ], $config, $this->options)); $token = csrf_token(); $this->script = <<id}').attr('initialized')) { return; } var E = window.wangEditor var editor = new E('#{$this->id}'); editor.customConfig.uploadImgParams = {_token: '$token'} Object.assign(editor.customConfig, {$config}) editor.customConfig.onchange = function (html) { $('#input-$id').val(html); } editor.create(); $('#{$this->id}').attr('initialized', 1); })(jQuery); EOT; return parent::render(); } }