Beispiel #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();
 }
Beispiel #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();
 }
Beispiel #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);
    }
Beispiel #4
0
    public function videojsInclude()
    {
        static $loaded = null;
        $css = <<<EOF
.video-js {
    min-width:100%; 
    max-width:100%;

}
.vjs-fullscreen {padding-top: 0px}
EOF;
        if (!$loaded) {
            assets::setEndHTML(' <script src="https://vjs.zencdn.net/5.6.0/video.js"></script>');
            assets::setRelAsset('css', 'https://vjs.zencdn.net/5.6.0/video-js.css');
            assets::setStringCss($css, null, array('head' => true));
            $loaded = true;
            return $css;
        }
    }
Beispiel #5
0
 /**
  * sets all <head></head> meta info. 
  * Params should not be encoded
  * @param string $title html page title
  * @param string $description html page description and og description
  * @param string $keywords keywords
  * @param string $image image
  * @param string $type og type
  */
 public static function setMetaAll($title, $description = '', $keywords = '', $image = '', $type = '', $author = '')
 {
     // title
     assets::setTitle(html::specialEncode($title));
     self::setMetaAsStr('<meta property="og:title" content="' . html::specialEncode($title) . '" />' . "\n");
     // description
     if (empty($description)) {
         $description = conf::getMainIni('meta_desc');
     }
     $desc = strings::substr2($description, 255);
     $og_desc = html::specialEncode(strings::substr2($description, 320));
     if (!empty($og_desc)) {
         self::setMetaAsStr('<meta property="og:description" content="' . $og_desc . '"/>' . "\n");
     }
     if (!empty($desc)) {
         self::setMeta(array('description' => $desc));
     }
     if (!empty($author)) {
         self::setMeta(array('author' => $author));
     }
     // keywords
     if (empty($keywords)) {
         $keywords = conf::getMainIni('meta_meywords');
     }
     if (!empty($keywords)) {
         self::setMeta(array('keywords' => $keywords));
     }
     // image
     if (!empty($image)) {
         $server = conf::getSchemeWithServerName();
         $image = $server . $image;
     }
     if (!empty($image)) {
         self::setMetaAsStr('<meta property="og:image" content="' . $image . '"/>' . "\n");
     }
     // type
     if (!empty($type)) {
         self::setMetaAsStr('<meta property="og:type" content="' . $type . '"/>' . "\n");
     }
 }
 public static function loadTemplateIniAssets()
 {
     assets::loadTemplateIniAssets();
 }
Beispiel #7
0
    /**
     * eho the footer
     */
    public static function footer()
    {
        echo template::getEndHTML();
        echo assets::getCompressedJs();
        ?>
</body>
</html><?php 
    }
 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));
 }