예제 #1
0
파일: Cropper.php 프로젝트: luoche/iisns
 /**
  * Registers Webuploader assets
  */
 protected function registerClientScript()
 {
     $view = $this->getView();
     CropperAsset::register($view);
     $js = "\nvar container = \$('.uploader-container');\nUploader.init(function( src ) {\n    Croper.setSource( src );\n    // 隐藏选择按钮。\n    container.addClass('webuploader-element-invisible');\n    // 当用户选择上传的时候,开始上传。\n    Croper.setCallback(function( data ) {\n        Uploader.crop(data);\n        Uploader.upload();\n    });\n});\n";
     $view->registerJs($js, $view::POS_READY);
 }
예제 #2
0
 /**
  * Registers Umeditor plugin
  */
 protected function registerPlugin()
 {
     $view = $this->getView();
     CropperAsset::register($view);
 }