From 5ff5bb335b6653252bd221a7a090521c2187c19b Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 9 Sep 2013 15:16:22 +0000 Subject: [PATCH] --- fluidbook/compile/_js/fluidbook.js | 8 +-- inc/ws/Util/class.ws.exporter.php | 4 +- inc/ws/Util/html5/class.ws.html5.compiler.php | 55 +++++-------------- 3 files changed, 20 insertions(+), 47 deletions(-) diff --git a/fluidbook/compile/_js/fluidbook.js b/fluidbook/compile/_js/fluidbook.js index dadd95db7..7dd30868a 100644 --- a/fluidbook/compile/_js/fluidbook.js +++ b/fluidbook/compile/_js/fluidbook.js @@ -27,7 +27,6 @@ function getPath() { } function getFlashvars(junk, fv) { - var res = {}; if (fv != undefined) { res = fv; @@ -185,11 +184,12 @@ function redirectPDF() { function redirectMobile() { var page = ''; var get = parseGet(); + console.log(get); var html = 'index.html'; if (get['widget'] != undefined && get['widget'] == '1') { html = 'widget.html'; - page = '?'; - if (get['backgroud'] != undefined) { + page = '?widget=1&'; + if (get['background'] != undefined) { page += "background=" + get['background']; } } @@ -206,7 +206,7 @@ function redirectMobile() { } - if (pageNr > 0) { + if (page == '' && pageNr > 0) { page = '#/page/' + pageNr; } diff --git a/inc/ws/Util/class.ws.exporter.php b/inc/ws/Util/class.ws.exporter.php index 8ef893b55..7a2b9d70b 100644 --- a/inc/ws/Util/class.ws.exporter.php +++ b/inc/ws/Util/class.ws.exporter.php @@ -53,6 +53,7 @@ class wsExporter { CubeIT_Mobile_Phonegap::FEATURE_NOTIFICATION_DIALOG, CubeIT_Mobile_Phonegap::FEATURE_INAPPBROWSER, CubeIT_Mobile_Phonegap::FEATURE_SPLASHSCREEN, + CubeIT_Mobile_Phonegap::FEATURE_GLOBALIZATION, CubeIT_Mobile_Phonegap::FEATURE_PUSHNOTIFICATION ) ); @@ -363,7 +364,8 @@ class wsExporter { } - $cl = CubeIT_CommandLine_Rsync($src, $dest, $erase); + + $cl = new CubeIT_CommandLine_Rsync($src, $dest, $erase); $cl->execute(); if (!is_null($chown)) { `chown -R $chown $dest`; diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index 618db597c..af38b4777 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -236,7 +236,15 @@ class wsHTML5Compiler { $this->config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject()); } - public static function getPhonegapVersion($v) { + public function getResolutions() { + $res = self::$resolutions; + if ($this->widget) { + $res = array_merge(array(36), $res); + } + return $res; + } + + public static function getPhonegapVersion($v = 'latest') { if ($v != 'latest') { return $v; } @@ -256,7 +264,6 @@ class wsHTML5Compiler { $versions[] = $file; } usort($versions, 'version_compare'); - $versions = array_reverse($versions, true); return $versions; } @@ -471,43 +478,7 @@ class wsHTML5Compiler { $script = ''; if ($this->phonegap) { - $script .= '' . "\n"; - - $standardPlugins = isset($this->phonegapStandardPlugins[$this->phonegap]) ? $this->phonegapStandardPlugins[$this->phonegap] : array(); - foreach ($standardPlugins as $p) { - $to = $this->vdir . '/data/' . $p . '.js'; - $this->copy($this->assets . '/js/libs/phonegap/plugins/' . $this->phonegap . '/' . $p . '.js', $to); - $script .= '' . "\n"; - } - - $plugins = explode("\n", $this->book->parametres->phonegapPlugins); - foreach ($plugins as $p) { - $p = trim($p); - if ($p == 'ChildBrowser') { - continue; - } - $pluginDir = 'data/phonegap/' . $p; - $d = $this->vdir . '/' . $pluginDir; - mkdir($d, 0777, true); - - if ($this->phonegap == 'ios') { - $os = 'iOS'; - } else if ($this->phonegap == 'android') { - $os = 'Android'; - } - - $orig = PHONEGAP_PLUGINS . '/' . $os . '/' . $p; - $dr = opendir($orig); - while ($file = readdir($dr)) { - if ($file == '.' || $file == '..') { - continue; - } - if (files::getExtension($file) == 'js') { - $this->copy($orig . '/' . $file, $d . '/' . $file); - $script .= '' . "\n"; - } - } - } + //$script .= '' . "\n"; } $script .= '' . "\n"; $script .= '' . "\n"; @@ -907,7 +878,7 @@ class wsHTML5Compiler { } protected function writeImages() { - foreach (self::$resolutions as $r) { + foreach ($this->getResolutions() as $r) { mkdir($this->vdir . '/data/background/' . $r, 0777, true); } $srcPrefix = $this->backgroundsPrefix; @@ -927,7 +898,7 @@ class wsHTML5Compiler { $this->copy($svg, $this->vdir . '/data/contents/p' . $page . '.svg'); } - foreach (self::$resolutions as $r) { + foreach ($this->getResolutions() as $r) { $ok = $this->copy(WS_DOCS . '/' . $infos['document_id'] . '/html/' . $srcPrefix . $r . '-' . $infos['document_page'] . '.jpg', $this->vdir . '/data/background/' . $r . '/' . $this->backgroundsPrefix . $page . '.jpg'); if (!$ok && $r = 300) { $this->maxRes = 150; @@ -1026,7 +997,7 @@ class wsHTML5Compiler { $res[] = '.doublePage._2d,.doublePage._3d{' . self::writeCSSUA('transition', 'all ' . $this->book->parametres->mobileTransitionDuration . 's ease-in-out') . '}'; $res[] = '.background{' . self::writeCSSUA('transform-origin', 'top left') . ';}'; - foreach (self::$resolutions as $r) { + foreach ($this->getResolutions() as $r) { $ratio = round(72 / $r, 3) * $cssScale; $wr = $cssWidth / $ratio; -- 2.39.5