From 4ce6f9581b73ad0e64e2eced6f1dc95ea80ba5ba Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 21 Apr 2022 17:36:05 +0000 Subject: [PATCH] wait #5241 @1.25 --- inc/commons/class.common.tools.php | 22 ++----------------- inc/ws/Metier/class.ws.book.parametres.php | 9 +++++--- inc/ws/Metier/class.ws.document.php | 2 +- .../html5/master/class.ws.html5.compiler.php | 13 +++++++++++ .../html5/master/class.ws.html5.links.php | 5 ++++- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 67a6cc881..e31ae80f0 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -968,25 +968,7 @@ class commonTools public static function createGitRepos() { - commonDroits::min(0.5); - global $core; - - $res = commonPage::barre(); - $res .= commonPage::tMain(); - $res .= commonPage::bh(); - $res .= '
'; - $res .= '
'; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= ''; - $res .= '
' . __('Création d\'un dépôt git') . '
' . __('Dépôt') . 'git@git.cubedesigners.com:' . form::field('repos', 20, 512) . '.git
' . $core->typo->BoutonOK(__('Création')) . '
'; - $res .= '
'; - $res .= '
'; - $res .= ''; - $res .= commonPage::bf(); - $res .= commonPage::bMain(); - return $res; + header('Location: https://toolbox.fluidbook.com/tools/gitreposcreate'); } @@ -1189,7 +1171,7 @@ class commonTools 'wesco' => 'Wesco', 'mopec' => 'Mopec', 'intex' => 'Intex', - 'grosfillex'=>'Grosfillex']; + 'grosfillex' => 'Grosfillex']; $options = array_flip($options); ksort($options); diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 02b66ee79..9da5a797e 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -556,7 +556,6 @@ class wsBookParametres extends wsParametres $this->fields['linkTooltipMaxWidth'] = array('type' => 'integer', 'default' => 140, 'editable' => true, 'label' => __('Largeur max des infobulles des liens de type "infobulle"')); $this->fields['openLinkAtStartup'] = ['type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Déclencher un lien à l\'ouverture du fluidbook')]; - $this->fields['mobileIgnoreBackgroundLinks'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Ignorer les liens de background')); $this->forms['links'] = array('label' => __('Liens'), 'fieldsnames' => array('permanentLinks', 'mobileLinksRevealAnim', 'linkBlinkTime', 'linkBlinkRepetition', '|', 'openLinkAtStartup', '|', 'customLinkClass', 'ignoreLinksTypes', 'mobileIgnoreBackgroundLinks', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkFilePrefix')); @@ -571,11 +570,15 @@ class wsBookParametres extends wsParametres $this->forms['multimedia'] = ['label' => __('Multimedia'), 'fieldsnames' => ['textPopupStylesheet', 'textPopupWidth', '|', 'iframePopupMaxWidth', '|', 'OAMChromeFactor', 'OAMIEFactor']]; - $this->fields['PDFRenderer'] = ['type' => 'combo', 'datas' => [__('Navigateur') => 'native', 'PDF.js' => 'pdfjs', 'PDF.js (legacy)' => 'pdfjs-legacy'], 'default' => 'native', 'editable' => true, 'label' => __('Rendu des PDF par')]; + $pdfRendererOptions = [__('Navigateur') => 'native', 'PDF.js' => 'pdfjs', 'PDF.js (legacy)' => 'pdfjs-legacy']; + $pdfRenderOptionsIframe = array_merge($pdfRendererOptions, [__('Ecraser en SVG') => 'svg']); + + $this->fields['PDFRenderer'] = ['type' => 'combo', 'datas' => $pdfRendererOptions, 'default' => 'native', 'editable' => true, 'label' => __('Rendu des PDF (téléchargement)')]; + $this->fields['PDFRendererIframe'] = ['type' => 'combo', 'datas' => $pdfRenderOptionsIframe, 'default' => 'native', 'editable' => true, 'label' => __('Rendu des PDF (iframes)')]; $this->fields['PDFJSCSS'] = ['type' => 'textarea', 'default' => '', 'editable' => true, 'label' => 'Styles PDF.js']; $this->forms['pdf'] = ['label' => 'PDF', - 'fieldsnames' => ['PDFRenderer', 'PDFJSCSS']]; + 'fieldsnames' => ['PDFRenderer', 'PDFRendererIframe', '|', 'PDFJSCSS']]; $slideshowPopupLibraries = [ 'Splide (' . __('défaut') . ')' => 'splide', diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 81569f1d3..3abc5a99a 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -62,7 +62,7 @@ class wsDocument extends cubeMetier ['name' => 'vincent', 'host' => 'paris.cubedesigners.com', 'port' => 22923, 'weight' => 1], ['name' => 'godzilla', 'host' => 'godzilla.cubedesigners.com', 'weight' => 3], ['name' => 'dracula', 'host' => 'dracula.cubedesigners.com', 'weight' => 3], - ['name' => 'her', 'host' => 'her.cubedesigners.com', 'weight' => 4], + ['name' => 'her', 'host' => 'her.cubedesigners.com', 'port' => 22022, 'weight' => 4], ]; protected static $resolution2multiply = array(72 => 2, 100 => 2, 150 => 3, 200 => 3, 300 => 3, 450 => 4, 600 => 5); 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 890920a9e..fbe8af54f 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -2036,7 +2036,20 @@ height="0" width="0" style="display:none;visibility:hidden"> $linksCopy = $links; + foreach ($linksCopy as $k => $linkData) { + if ($this->book->parametres->PDFRendererIframe === 'svg' && $linkData['type'] == 31 && stristr($linkData['to'], '.pdf')) { + $ofile = $this->wdir . '/' . $linkData['to']; + $dfile = $this->wdir . '/' . $linkData['to'] . '.svg'; + if (!file_exists($dfile) || filemtime($dfile) < filemtime($ofile)) { + $cmd="pdftocairo -svg -f 1 -l 1 $ofile $dfile"; + `$cmd`; + } + $linkData['type'] = 6; + $linkData['to'] = $linkData['alternative'] = $linkData['to'] . '.svg'; + $linkData['backgroundColor'] = '#fff'; + $links[$k] = $linkData; + } if ($linkData['type'] == 26 || $linkData == 40) { $linkData['to'] = anchorLink::normalizeAnchor($linkData['to']); $anchorExists[$linkData['to']] = $linkData; 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 ece0f0ad8..7f79bfaa2 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -56,6 +56,7 @@ class wsHTML5Link public $allowsAnimation = true; public $forceTexture = false; public $letterspacing = 0; + public $backgroundColor=null; protected $role = 'button'; @@ -1146,7 +1147,9 @@ class htmlMultimediaPopupImage extends normalLink $res = parent::getAdditionnalContent(); $dim = CubeIT_Image::getimagesize($this->wdir . '/' . $this->alternative); - $markup = '
'; + $bg=null===$this->backgroundColor?'':' style="background-color:'.$this->backgroundColor.';"'; + + $markup = '
'; $read = ''; if ($this->read_mode) { $read = ' data-readmode="1"'; -- 2.39.5