Esempio n. 1
0
 /**
  * Register the slider
  */
 private function registerToView()
 {
     $view = $this->getView();
     $slider_options = \yii\helpers\Json::encode($this->sliderOptions);
     // Register the slider to the view
     $view->registerJs("\n\t\t\tjQuery(document).ready(function(\$) {\n        \t\t\$('#{$this->id}').sliderPro({$slider_options});\n    \t\t});\n\t\t");
     CoreAsset::register($view);
 }
Esempio n. 2
0
 /**
  * Register the ckeditor files to the view
  */
 private function registerToView()
 {
     $view = $this->getView();
     $id = \yii\helpers\Json::encode($this->options['id']);
     $editor_options = \yii\helpers\Json::encode($this->editorOptions);
     // Register the javascript to replace the $id input with an instance of ckeditor
     $view->registerJs("CKEDITOR.replace({$id}, {$editor_options});");
     CoreAsset::register($view);
 }
Esempio n. 3
0
 /**
  * Load the options and start the widget
  */
 public function run()
 {
     $this->echoLoadingTags();
     $assets = CoreAsset::register($this->view);
     if ($this->theme === true) {
         // Register the theme
         ThemeAsset::register($this->view);
     }
     if (isset($this->options['language'])) {
         $assets->language = $this->options['language'];
     }
     $assets->googleCalendar = $this->googleCalendar;
     $this->clientOptions['header'] = $this->header;
     $this->view->registerJs(implode("\n", ["jQuery('#{$this->options['id']}').fullCalendar({$this->getClientOptions()});"]), \yii\web\View::POS_READY);
 }
Esempio n. 4
0
 /**
  *
  */
 public function registerAssets()
 {
     CoreAsset::register($this->view);
     $options = \yii\helpers\Json::encode($this->options);
     $this->view->registerJs("\$('#{$this->table_id}').floatThead({$options});");
 }