'js/libs/fix/detect-zoom.js',
'js/libs/cube/fb.js',
'js/libs/cube/util.js',
- 'js/libs/fastclick/fastclick.js',
'js/libs/json.js',
'js/libs/flashdetect.js',
'js/libs/screenfull.js',
}
public function compile() {
+
$dirsToCreate = array('data/images', 'data/contents', 'data/background', 'data/thumbnails', 'data/style');
if (in_array('flv', $this->getVideosFormats())) {
$dirsToCreate[] = 'swf';
$this->lessFilesExtras = array_unique(array_merge($this->lessFilesExtras, $extra_files));
}
- protected function writeIndex($numCSS) {
+ protected function writeIndex() {
global $core;
$html = file_get_contents($this->assets . '/_index.html');
foreach ($finals as $jsfinal => $files) {
$mintime = 0;
- $minimized = $this->assets . '/js/' . $jsfinal . '-min.js';
+ $hash = hash('sha256', json_encode($files));
+ $minimized = $this->assets . '/js/min/' . $jsfinal . '-' . $hash . '-min.js';
+ if (!file_exists(dirname($minimized))) {
+ mkdir(dirname($minimized));
+ }
if (file_exists($minimized)) {
$mintime = filemtime($minimized);
- }
-
- $reminimize = false;
- if ($jsfinal == 'special') {
+ $reminimize = false;
+ } else {
+ $mintime = 0;
$reminimize = true;
}
+
if (!$reminimize) {
foreach ($files as $file) {
if (filemtime($this->assets . '/' . $file) > $mintime) {
}
if ($reminimize) {
- $js = '';
+ $js = 'var files=' . json_encode($files) . ';';
foreach ($files as $file) {
$js .= file_get_contents($this->assets . '/' . $file);
$js .= ";\n\n";
$uglify->setArg('no-copyright');
$uglify->setArg(null, $tmp);
$uglify->execute();
- //$uglify->debug();
+ $uglify->debug();
+
+
}
$dest = $this->vdir . '/data/' . $jsfinal . '.js';
copy($minimized, $dest);
$res[] = $shade;
// SVG
+
$res[] = 'svg .fill-c-menu-back{fill:' . wsHTML5::colorToCSS($this->theme->parametres->couleurB) . ';}';
$res[] = 'svg .fill-c-menu-text{fill:' . wsHTML5::colorToCSS($this->theme->parametres->subTextColor) . ';}';
$res[] = '.portrait #fluidbook .bookmark.left{left:' . ($cssWidth - $size) . 'px;}';
// Menus
-
-
$menuColor = new CubeIT_Graphics_Color($this->theme->parametres->couleurB);
$menuColor->setAlpha(1);
$menuTextColor = wsHTML5::colorToCSS($this->theme->parametres->subTextColor);
$this->stylesheets[] = 'data/style/style_' . $k . '.css';
file_put_contents(sprintf($file, $k), implode("\n", $css));
}
-
return count($res);
}
$tmp = CubeIT_Files::tmpdir();
copy($this->assets . '/style/variables.less', $tmp . '/variables.less');
+ copy($this->assets . '/style/mixins.less', $tmp . '/mixins.less');
$bookVariables = array();
foreach ($variables as $k => $v) {
// (eg. video-js-core.css is needed by videojs.less)
foreach ($this->lessFilesExtras as $extra) {
$destination_extra = $tmp . '/' . $extra;
- if (!is_dir(dirname($destination_extra))) mkdir(dirname($destination_extra));
+ if (!is_dir(dirname($destination_extra))) {
+ mkdir(dirname($destination_extra), 0777, true);
+ }
copy($this->assets . '/style/' . $extra, $destination_extra);
}
$destination_less = $tmp . '/' . $f . '.less';
$destination_css = 'style/' . $f . '.css';
- if (!file_exists($source_less)) continue;
+ if (!file_exists($source_less)) {
+ continue;
+ }
// LESS file might be in a subfolder, so create if it doesn't exist
- if (!is_dir(dirname($destination_less))) mkdir(dirname($destination_less));
+ if (!is_dir(dirname($destination_less))) {
+ mkdir(dirname($destination_less), 0777, true);
+ }
// Generated CSS file might be in a subfolder, so create if it doesn't exist
- if (!is_dir(dirname($this->vdir . '/' . $f . '.css'))) mkdir(dirname($this->vdir . '/' . $f . '.css'));
+ if (!is_dir(dirname($this->vdir . '/' . $f . '.css'))) {
+ mkdir(dirname($this->vdir . '/' . $f . '.css'), 0777, true);
+ }
// Less files must be copied to temporary directory so they'll
// have access to the variables generated in book-variables.less
}
class videoLink extends wsHTML5Link {
-
public static function addVideoJS($compiler) {
$compiler->addJs('js/libs/videojs/video.js');
$compiler->addLess('videojs/videojs', ['videojs/video-js-core.css']);
public function getHTMLContent() {
- static::addVideoJS($this->compiler);
$this->copyExternalFile($this->to, true);
}
public static function makeVideoTag($linkDatas, $w = null, $h = null, $compiler = null) {
+ static::addVideoJS($compiler);
$attributes = static::getVideoAttributes($linkDatas, $w, $h, $compiler);
$attr['width'] = $w;
$attr['height'] = $h;
} else if (!is_null($compiler)) {
+
$path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg';
$dim = getimagesize($path);
$attr['width'] = $dim[0];
}
-
class audioPopupLink extends normalLink {
public function getURL() {