From b5c6cc59bd673b010583d66e62752147a5d239dc Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 10 Oct 2018 18:02:14 +0000 Subject: [PATCH] #2286 --- .../html5/master/class.ws.html5.compiler.php | 13 ++++++++++++- .../Util/html5/master/class.ws.html5.links.php | 16 +++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 5261e0920..80670630b 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -162,6 +162,7 @@ class wsHTML5Compiler public $beginBody = array(); public $seoArticles = []; public $securityPolicyWhitelist = ['*.google-analytics.com', '*.youtube.com', '*.ytimg.com']; + public $writeLinksData = false; protected $_indexVars = null; public $_signature; @@ -887,7 +888,7 @@ class wsHTML5Compiler $lang = $daoLang->selectById($this->book->lang); $langs = $daoLang->selectAll(); - $t=CubeIT_Util_Object::toArray($this->book->traductions); + $t = CubeIT_Util_Object::toArray($this->book->traductions); $traductions = (!is_countable($t) || !count($t)) ? $lang->traductions : $t; @@ -1047,6 +1048,7 @@ class wsHTML5Compiler $cpages = array(); $css = array(); $linkPages = []; + $allLinksData = []; usort($links, array($this, '_sortLinks')); @@ -1054,6 +1056,8 @@ class wsHTML5Compiler if (in_array($linkData['type'], $ignore)) { continue; } + + $linkData['hidden'] = in_array($linkData['uid'], $hiddenLinks); if ($linkData['type'] == 28) { $this->addSEOArticle($linkData['page'], $linkData['to'], $linkData['extra'], $linkData['image']); @@ -1087,6 +1091,8 @@ class wsHTML5Compiler $pages[$link->page] .= $c; } + $allLinksData[$linkData['uid']] = $linkData; + if ($link->keep()) { $this->hiddenContents[] = $c; } @@ -1116,6 +1122,11 @@ class wsHTML5Compiler $this->config->links[$i] = $c; $this->config->clinks[$i] = $cc; } + + if ($this->writeLinksData) { + $this->config->linksData = $allLinksData; + } + return $css; } 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 53dc96f50..8528b96fc 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -225,14 +225,18 @@ class wsHTML5Link if (!$this->video_height) { $this->video_height = $this->height; } - - if ($this->target == '') { $this->target = '_blank'; } $this->wdir = WS_BOOKS . '/working/' . $compiler->book_id . '/'; $this->id = $id; $this->compiler = $compiler; + $this->init(); + } + + public function init() + { + } public function getDefaultTooltip() @@ -510,10 +514,16 @@ class htmlMultimediaPopupLink extends htmlMultimediaPopupImage class zoomhdLink extends normalLink { + public function init() + { + $this->compiler->addJs('js/libs/fluidbook/links/fluidbook.links.zoomhd.js'); + $this->compiler->writeLinksData=true; + } + public function getURL() { $this->copyExternalFile($this->to); - return '#/zoomhd/' . md5($this->to); + return '#/zoomhd/' . $this->uid; } public function getAdditionnalContent() -- 2.39.5