예제 #1
0
    protected function loadJsFiles()
    {
        if (!self::$js_loaded) {
            $this->cms->addJavascript($this->language->routing['bare_entry_url'] . '&resource=js&id=modernizr/modernizr.custom.js');
            $this->cms->addJavascript($this->language->routing['bare_entry_url'] . '&resource=js&id=webshim/polyfiller.js');
            //$this->cms->addJavascript('//cdn.jsdelivr.net/webshim/1.14.5/polyfiller.js');
            ?>
            <script type="text/javascript">
                webshim.setOptions('basePath', '<?php 
            echo $this->language->routing['bare_entry_url'] . '&resource=js&id=webshim/shims/';
            ?>
')
                webshim.activeLang('<?php 
            echo $this->language->getCurrentLanguage();
            ?>
');
                //Configure forms features
                webshim.setOptions("forms", {
                    lazyCustomMessages: true,
                    replaceValidationUI: true,
                    customDatalist: "auto",
                    list: {
                        "filter": "^"
                    }
                });

                //Configure forms-ext features
                webshim.setOptions("forms-ext", {
                    replaceUI: "auto",
                    types: "date range number",
                    date: {
                        startView: 2,
                        openOnFocus: true,
                        classes: "show-week",
                        dateSigns: '-',
                        dateFormat: 'yy-mm-dd'
                    },
                    number: {
                        calculateWidth: false
                    },
                    range: {
                        classes: "show-activevaluetooltip"
                    },
                    datepicker: {
                        dateFormat: 'yy-mm-dd'
                    }
                });

                //Load forms and forms-ext features
                webshim.polyfill('forms forms-ext');
            </script>
            <?php 
            self::$js_loaded = true;
        }
    }
예제 #2
0
 function __construct(FieldFactory $factory, ICms $cms, Language $language, $form_resource, $form_method, $name = '', $id = '')
 {
     $this->factory = $factory;
     $this->cms = $cms;
     $this->language = $language;
     $this->form_resource = $form_resource;
     $this->form_method = $form_method;
     $this->name = $name ? $name : $form_resource;
     $this->id = $id ? $id : $this->name;
     $submission_id = htmlentities(@$_REQUEST['submission_id']);
     $this->submission_id = strlen($submission_id) == 13 ? $submission_id : uniqid();
     $js = htmlentities($language->routing['bare_entry_url'] . '&resource=js&id=form');
     $this->cms->addJavascript($js);
 }
예제 #3
0
 /**
  * Can be overridden if you want to do some work without changing the constructor
  */
 public function initialise()
 {
     //Include JQuery early, so that feature-specific javascript files can use it straight away
     $this->cms->addJavascript($this->language->routing['bare_entry_url'] . '&resource=js&id=jquery/jquery-1.11.1.min.js');
 }