]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 23 Apr 2012 13:02:23 +0000 (13:02 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 23 Apr 2012 13:02:23 +0000 (13:02 +0000)
inc/ws/Util/html5/class.ws.html5.compiler.php

index 91946062420a4f2bfcb1c6d9dbed9d66345a8ca8..eb5271f44330ba2ed8443b9fd210838499979eda 100644 (file)
@@ -36,6 +36,12 @@ class wsHTML5Compiler {
                'js/libs/jquery/jquery.hashchange.js',
                'js/tester.js'
        );
+       protected static $widgetJsFiles = array(
+               'js/libs/cube/fb.js',
+               'js/libs/modernizr.js',
+               'js/libs/jquery/jquery.js',
+               'js/widget.js'
+       );
        protected $cssX = array();
        protected $cssY = array();
        protected $cssWidths = array();
@@ -343,6 +349,22 @@ class wsHTML5Compiler {
                file_put_contents($this->vdir . '/index.html', $html);
                file_put_contents($this->vdir . '/indexu.html', $uhtml);
                file_put_contents($this->vdir . '/indext.html', $uhtml);
+
+               // Write widget html
+               $whtml = file_get_contents(WS_COMPILE_ASSETS . '/_html5/widget.html');
+               $scripts = array();
+               foreach (self::$widgetJsFiles as $js) {
+                       $scripts[] = '<script type="text/javascript" src="' . $js . '"></script>';
+               }
+               $scripts[] = '<script type="text/javascript" src="data/datas.js"></script>';
+               $script = implode("\n\t\t", $scripts);
+
+               $style = '<link type="text/css" rel="stylesheet" href="style/widget.css">';
+               $vars = array('titre', 'style', 'script');
+               foreach ($vars as $v) {
+                       $whtml = str_replace('<!-- $' . $v . ' -->', $$v, $whtml);
+               }
+               file_put_contents($this->vdir . '/widget.html', $whtml);
        }
 
        protected function writeLangs() {
@@ -391,8 +413,6 @@ class wsHTML5Compiler {
        }
 
        protected function writeJs() {
-
-
                $mintime = 0;
                $minimized = WS_COMPILE_ASSETS . '/_html5/js/min.js';
                if (file_exists($minimized)) {