/** * @param Parameter $parameter * @return array|Element[] */ public function headElements(Parameter $parameter) { $elements = [HeadElements::jquery(), HeadElements::jqueryUi(), HeadElements::jqueryUiCss()]; if ($this->mobile->isMobile()) { $elements[] = HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js'); } return $elements; }
/** * @param DataTable $value * @return array|Element[] */ public function headElements($value) { $elements = []; $table = $value->getTable(); $renderer = $this->renderers->getRenderer($table); if ($renderer instanceof WebRenderer) { $elements = $renderer->headElements($table); } $options = json_encode($value->getOptions()); $elements[] = HeadElements::style('//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css'); $elements[] = HeadElements::script('//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js'); $elements[] = new Element('script', [], ["\n \$(function () {\n \$('.data-table > table').dataTable({$options});\n });\n "]); return $elements; }
/** * @param mixed $value * @return array|\rtens\domin\delivery\web\Element[] */ public function headElements($value) { $elements = parent::headElements($value); $elements[] = HeadElements::script('http://dima117.github.io/Chart.Scatter/Chart.Scatter.min.js'); return $elements; }
/** * @param Parameter $parameter * @return array|\rtens\domin\delivery\web\Element[] */ public function headElements(Parameter $parameter) { $script = file_get_contents(__DIR__ . '/js/ImageField.js'); $script = str_replace('$cropperOptions$', json_encode($this->getCropperOptions()), $script); $script = str_replace('$webcamjsOptions$', json_encode($this->getWebcamOptions()), $script); return [HeadElements::jquery(), HeadElements::bootstrapJs(), HeadElements::bootstrap(), HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/cropper/0.9.3/cropper.min.js'), HeadElements::style('//cdnjs.cloudflare.com/ajax/libs/cropper/0.9.3/cropper.min.css'), HeadElements::script('http://pixlcore.com/demos/webcamjs/webcam.js'), new Element('script', [], [$script])]; }
/** * @param Parameter $parameter * @return array|Element[] */ public function headElements(Parameter $parameter) { return array_merge([HeadElements::jquery(), HeadElements::jqueryUi(), new Element('script', [], ["\$(function () {\n \$('.array-new-items').appendTo('body');\n \$('.array-items').sortable({handle:'.sortable-handle'});\n \$('.array-items .sortable-handle').disableSelection();\n });"])], $this->mobile->isMobile() ? [HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js')] : [], $this->itemHeadElements($this->makeInnerParameter($parameter))); }
function requireTouchPunchForMobile() { Mockster::stub($this->detector->isMobile())->will()->return_(true); $this->assert->contains($this->field->headElements(new Parameter('foo', new ArrayType(new UnknownType()))), HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js')); }
/** * @param Parameter $parameter * @return array|Element[] */ public function headElements(Parameter $parameter) { return [HeadElements::bootstrap(), HeadElements::jquery(), HeadElements::style('//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.min.css'), HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.min.js'), new Element('script', [], ["\n \$(function () {\n \$('.boolean-switch').bootstrapSwitch({\n size: 'small',\n onColor: 'success',\n onText: 'Yes',\n offText: 'No'\n });\n });"])]; }
/** * @param Parameter $parameter * @return array|Element[] */ public function headElements(Parameter $parameter) { return [HeadElements::jquery(), HeadElements::bootstrap(), HeadElements::bootstrapJs(), HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment.min.js'), HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.14.30/js/bootstrap-datetimepicker.min.js'), HeadElements::style('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.14.30/css/bootstrap-datetimepicker.min.css'), new Element('script', [], ['var dateTimePickerSettings = ' . json_encode($this->getOptions()) . ';'])]; }
/** * @param Parameter $parameter * @return array|\rtens\domin\delivery\web\Element[] */ public function headElements(Parameter $parameter) { return [HeadElements::jquery(), HeadElements::style('//cdn.rawgit.com/rtens/bootstrap-combobox/cffe84e7/css/bootstrap-combobox.css'), HeadElements::script('//cdn.rawgit.com/rtens/bootstrap-combobox/cffe84e7/js/bootstrap-combobox.js'), new Element('style', [], ['.typeahead-long { width:100% }'])]; }
/** * @param mixed $value * @return array|Element[] */ public function headElements($value) { return [HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js')]; }
/** * @param Parameter $parameter * @return array|Element[] */ public function headElements(Parameter $parameter) { return [HeadElements::jquery(), HeadElements::bootstrap(), HeadElements::bootstrapJs(), HeadElements::fontAwesome(), HeadElements::style('//cdnjs.cloudflare.com/ajax/libs/summernote/0.6.10/summernote.min.css'), HeadElements::script('//cdnjs.cloudflare.com/ajax/libs/summernote/0.6.10/summernote.min.js'), new Element('script', [], ["\n \$(function() {\n \$('.summernote').summernote({\n onKeyup: function(e) {\n \$(this).val(\$(this).code());\n }\n });\n \$('.summernote').on('invalid', function (e) {\n var editor = \$(e.target).siblings('.note-editor');\n editor.popover({\n content: 'Please fill out this field.',\n placement: 'bottom',\n trigger: 'manual'\n });\n editor.popover('show');\n\n editor.click(function () {\n editor.popover('hide');\n });\n });\n });\n "])]; }