class wsHTML5Compiler {
- public static function factory($book_id, $version = 'stable', $phonegap = false, $dir = null) {
+ public static function factory($book_id, $version = 'stable', $phonegap = false, $dir = null, $standalone = false) {
if (is_null($version)) {
global $core;
$dao = new wsDAOBook($core->con);
}
if ($version == 'stable') {
- return new wsHTML5Compiler($book_id, $version, $phonegap, $dir);
+ return new wsHTML5Compiler($book_id, $version, $phonegap, $dir, $standalone);
} else {
- return new wsHTML5CompilerDev($book_id, $version, $phonegap, $dir);
+ return new wsHTML5CompilerDev($book_id, $version, $phonegap, $dir, $standalone);
}
}
protected $config = array();
protected $assets = '';
protected $phonegap = false;
+ protected $standalone = false;
- function __construct($book_id, $version = 'stable', $phonegap = false, $dir = null) {
+ function __construct($book_id, $version = 'stable', $phonegap = false, $dir = null, $standalone = false) {
global $core;
+
+
if ($version == 'stable') {
$this->assets = WS_COMPILE_ASSETS . '/_html5prod';
wsMaintenance::updateHTML5Sources(array(), false);
$this->assets = WS_COMPILE_ASSETS . '/_html5';
}
$this->phonegap = $phonegap;
+ $this->standalone = $standalone || $this->phonegap;
cubePHP::set_memory('4G');
if ($this->phonegap) {
$this->config->friend = $this->config->twitter = $this->config->facebook = false;
}
- $this->config->standalone = $this->phonegap;
+ $this->config->standalone = $this->standalone;
return 'var DATAS=' . json_encode($this->config) . ';' . "\n";
}