Author: Antonio Ramirez (amigo.cobos@gmail.com)
Inheritance: extends yii\web\AssetBundle
Beispiel #1
0
 /**
  * 
  * Method register editor on change
  * 
  */
 protected function registerOnChange()
 {
     $ckeditor = \dosamigos\ckeditor\CKEditorAsset::register($this->view);
     $plugin = __DIR__ . '/plugins';
     $this->recurse_copy($plugin, $ckeditor->basePath . '/plugins');
     $browseOptions = ['config.extraPlugins' => 'onchange'];
     $this->clientOptions = ArrayHelper::merge($browseOptions, $this->clientOptions);
 }
Beispiel #2
0
 /**
  * Registers CKEditor plugin
  */
 protected function registerPlugin()
 {
     $view = $this->getView();
     CKEditorAsset::register($view);
     $id = $this->options['id'];
     $options = $this->clientOptions !== false && !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '{}';
     $js = "CKEDITOR.replace('{$id}', {$options});";
     $view->registerJs($js);
 }
Beispiel #3
0
 /**
  * Registers CKEditor plugin
  */
 protected function registerPlugin()
 {
     $view = $this->getView();
     CKEditorAsset::register($view);
     $id = $this->options['id'];
     $options = $this->clientOptions !== false && !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '{}';
     $js = [];
     if ($this->disableAutoInline) {
         $js[] = "CKEDITOR.disableAutoInline = true;";
     }
     $js[] = "CKEDITOR.inline('{$id}', {$options});";
     $view->registerJs(implode("\n", $js));
 }
 /**
  * Registers CKEditor plugin
  */
 protected function registerPlugin()
 {
     $view = $this->getView();
     CKEditorAsset::register($view);
     $id = $this->options['id'];
     $options = $this->clientOptions !== false && !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '{}';
     $js = [];
     if ($this->disableAutoInline) {
         $js[] = "CKEDITOR.disableAutoInline = true;";
     }
     $js[] = "CKEDITOR.inline('{$id}', {$options});";
     if (isset($this->clientOptions['filebrowserUploadUrl'])) {
         $js[] = "dosamigos.ckEditorWidget.registerCsrfImageUploadHandler();";
     }
     $view->registerJs(implode("\n", $js));
 }