/**
  * @inheritdoc
  */
 public function registerClientScript()
 {
     $view = $this->getView();
     GalleryAsset::register($view);
     PranshupranetaAsset::register($view);
     $id = $this->options['id'];
     $options = Json::encode($this->clientOptions);
     $items = $this->json ? Json::encode($this->items) : "\$('#{$id}').find('a.gallery-item').hide()";
     $js = "blueimp.Gallery({$items}, {$options});";
     $view->registerJs($js);
 }
 /**
  * Registers the client script required for the plugin
  */
 public function registerClientScript()
 {
     $view = $this->getView();
     GalleryAsset::register($view);
     PranshupranetaAsset::register($view);
     $id = $this->options['id'];
     $options = Json::encode($this->clientOptions);
     $js = "pranshupraneta.gallery.registerLightBoxHandlers('#{$id} a', {$options});";
     $view->registerJs($js);
     if (!empty($this->clientEvents)) {
         $js = [];
         foreach ($this->clientEvents as $event => $handler) {
             $js[] = "jQuery('{$id}').on('{$event}', {$handler});";
         }
         $view->registerJs(implode("\n", $js));
     }
 }
 /**
  * Registers required script for the plugin to work as jQuery File Uploader UI
  */
 public function registerClientScript()
 {
     $view = $this->getView();
     if ($this->gallery) {
         GalleryAsset::register($view);
     }
     FileUploadUIAsset::register($view);
     $options = Json::encode($this->clientOptions);
     $id = $this->options['id'];
     $js[] = ";jQuery('#{$id}').fileupload({$options});";
     if (!empty($this->clientEvents)) {
         foreach ($this->clientEvents as $event => $handler) {
             $js[] = "jQuery('#{$id}').on('{$event}', {$handler});";
         }
     }
     $view->registerJs(implode("\n", $js));
     if ($this->load) {
         $view->registerJs("\n                \$('#{$id}').addClass('fileupload-processing');\n                \$.ajax({\n                    url: \$('#{$id}').fileupload('option', 'url'),\n                    dataType: 'json',\n                    context: \$('#{$id}')[0]\n                }).always(function () {\n                    \$(this).removeClass('fileupload-processing');\n                }).done(function (result) {\n                    \$(this).fileupload('option', 'done').call(this, \$.Event('done'), {result: result});\n                });\n            ");
     }
 }