From b1df5e47b71c81d18b36cc44c3cd05a7505235c8 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Tue, 29 Aug 2017 10:40:11 +0000 Subject: [PATCH] Tidy up compiler scripts - no longer need to specify extra CSS/LESS files manually since everything is copied from the /styles directory by the _writeLess() function. WIP #807 @0.5 --- .../burgermenu/class.ws.html5.compiler.php | 24 +------------------ .../html5/master/class.ws.html5.links.php | 2 +- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php b/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php index bb09cc700..cf729c628 100644 --- a/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php @@ -92,15 +92,6 @@ class wsHTML5Compiler { // Collection of LESS files to be compiled // Filename with no extension, relative to the /style directory in the player build folder public $lessFiles = ['fluidbook']; - public $lessFilesExtras = [ - // Extra files that will be copied when compiling LESS (eg. used to allow video-js-core.css to be copied) - 'mmenu/mmenu.less', - 'mmenu/jquery.mmenu.all.css', -// 'mmenu/jquery.mmenu.css', -// 'mmenu/jquery.mmenu.offcanvas.css', -// 'mmenu/jquery.mmenu.positioning.css', -// 'mmenu/jquery.mmenu.effects.css', - ]; public $specialCSS = array(); public $phonegapStandardPlugins = array('ios' => array('ExternalFileUtil'), @@ -504,13 +495,10 @@ class wsHTML5Compiler { * @param $path The path of the file relative to the /style folder, without any extension * @param $extra_files Optional array of extra files that should be copied across for use during LESS compilation */ - public function addLess($path, $extra_files = []) { + public function addLess($path) { if (!in_array($path, $this->lessFiles)) { $this->lessFiles[] = $path; } - - // Make sure no duplicates are added here either - $this->lessFilesExtras = array_unique(array_merge($this->lessFilesExtras, $extra_files)); } protected function writeIndex() { @@ -1471,16 +1459,6 @@ class wsHTML5Compiler { } file_put_contents($tmp . '/book-variables.less', implode("\n", $bookVariables)); - // Also copy any "extra" files that might be needed by LESS compilation - // (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), 0777, true); - } - copy($this->assets . '/style/' . $extra, $destination_extra); - } - foreach ($this->lessFiles as $f) { $source_less = $this->assets . '/style/' . $f . '.less'; diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 88d000e48..5ad7c36dd 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -512,7 +512,7 @@ class internalLink extends normalLink { 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']); + $compiler->addLess('videojs/videojs'); } public function getClasses() { -- 2.39.5