protected function _init() { $doc = \Flywheel\Factory::getDocument(); $doc->addJsVar('get_locations_url', $this->getRender()->createUrl('transporter/location/get_all_locations')); $doc->addJs('js/process/transporter/transporter.js'); $doc->addJs('js/process/transporter/location.js'); }
public function end() { $htmlOptions = array_merge(['rel' => $this->rel, 'data-value' => $this->selected, 'id' => $this->id], $this->htmlOptions); /** @var Form $this->form */ $this->form->selectOption($this->name, '', $htmlOptions)->display(); $doc = \Flywheel\Factory::getDocument(); $doc->addJsCode('Transporter.Location.Province.display("#' . $this->id . '");'); }
public function end() { $doc = Factory::getDocument(); $js = 'tinymce.init({ selector: "' . implode(array_unique($this->_selectors)) . "\",\n" . ($this->width ? 'width :' . $this->width . ",\n" : '') . ($this->height ? 'height :' . $this->height . ",\n" : '') . ($this->content_css ? 'content_css : "' . $this->content_css . "\",\n" : '') . 'plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "media save table directionality", "emoticons template paste textcolor" ], theme:"modern", skin:"lightgray", menubar : false, toolbar1: "bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media | forecolor", image_advtab: true, });'; $doc->addJsCode($js, 'TOP', 'standard'); }
public function end() { $doc = Factory::getDocument(); $opt = array_merge(['focus' => false, 'styleWithSpan' => false, 'maximumImageFileSize' => ini_get('upload_max_filesize') * 1000000.0, 'toolbar' => [['style', ['style']], ['font', ['bold', 'italic', 'underline', 'clear']], ['font-style', ['fontsize']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['height', ['height']], ['table', ['table']], ['insert', ['link', 'video', 'picture', 'hr']], ['view', ['fullscreen', 'codeview']], ['help', ['undo', 'redo', 'help']]]], ['height' => $this->height]); $js = ''; $opt = json_encode($opt); $opt = str_replace('}', ', onImageUpload: function(files, editor, welEditable) { media_upload(files[0],editor,welEditable); } }', $opt); foreach ($this->_selectors as $selector) { $js .= '$("' . $selector . '").summernote( ' . $opt . ' );'; /*$js .= '$("' .$selector .'").summernote({ onImageUpload: function(files, editor, welEditable) { media_upload(files[0],editor,welEditable); } });';*/ } $doc->addJsCode($js); }
/** * get HTMLDocument object * @return \Flywheel\Document\Html */ public function document() { return Factory::getDocument(); }