Example #1
0
 /**
  * html5 upload form. Standalone.
  * @param string $url
  * @return string $str html and script
  */
 public function fileHtml5($url)
 {
     assets::setJs('/bower_components/jquery-html5-upload/jquery.html5_upload.js');
     $js = $this->getJs($url);
     $script = $this->getJs($url);
     return $script . $this->getHtml();
 }
Example #2
0
 /**
  * html5 upload form. Standalone.
  * @param string $url
  * @return string $str html and script
  */
 public function fileHtml5($url)
 {
     assets::setJs('/js/jquery.html5_upload.js');
     $js = $this->getJs($url);
     assets::setStringJs($js);
     return $this->getHtml();
 }
Example #3
0
    /**
     * function to create a easy TOC for any module. 
     * @param array $options e.g. array ('exclude' => 'h1', 'content' => '#content_article'); 
     */
    public static function set($options = array())
    {
        assets::setJs('/bower_components/toc/dist/toc.min.js');
        if (!isset($options['selectors'])) {
            $options['selectors'] = 'h1,h2,h3,h4';
        }
        if (!isset($options['container'])) {
            $options['container'] = '#content';
        }
        $str = <<<EOF
    \$(document).ready(function() {
        \$('#toc').toc({selectors: '{$options['selectors']}' , container: '{$options['container']}', prefix: 'toc', 'smoothScrolling': false});
    });
EOF;
        assets::setStringJs($str);
    }
Example #4
0
 public static function load()
 {
     assets::setCss('//cdn.jsdelivr.net/simplemde/latest/simplemde.min.css', null, array('head' => true));
     assets::setJs('//cdn.jsdelivr.net/simplemde/latest/simplemde.min.js', null, array('head' => true));
 }