From: Vincent Vanwaelscappel Date: Wed, 23 Aug 2023 15:31:20 +0000 (+0200) Subject: wip #6167 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b6c411af28ad5ce4328b59a0f66d29d7ffd76257;p=fluidbook-toolbox.git wip #6167 @1 --- diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php index c497075af..8bae9ef5b 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php @@ -27,7 +27,7 @@ trait LinksOperation Route::match(['post'], $segment . '/{id}/edit/links/move', $controller . '@moveLinks'); Route::match(['get'], $segment . '/{id}/edit/links/versions/restore/{version}', $controller . '@restoreLinks'); Route::match(['get'], $segment . '/{id}/edit/links/fixdriftedlinks', $controller . '@fixDriftedLinks'); - Route::match(['get'], $segment . '/{id}/edit/links/assets/{file}', $controller . '@getLinkAsset'); + Route::match(['get'], $segment . '/{id}/edit/links/assets/{file}', $controller . '@getLinkAsset')->name('fluidbookpublication-link-asset'); Route::put($segment . '/{id}/save/links', $controller . '@saveLinks'); Route::get($segment . '/{id}/edit/{type}_{page}.{format}', $controller . '@getLinkPage') diff --git a/resources/linkeditor/js/linkeditor.utils.js b/resources/linkeditor/js/linkeditor.utils.js index 7995da433..2116afcdb 100644 --- a/resources/linkeditor/js/linkeditor.utils.js +++ b/resources/linkeditor/js/linkeditor.utils.js @@ -16,7 +16,7 @@ LinkeditorUtils.prototype = { if (page === undefined) { page = this.linkeditor.currentPage; } - return page.toString().indexOf('link_') === 0 || page === 'aftersearch' || page === 'background'; + return page.toString().indexOf('link_') === 0 || (THEME[page] !== undefined && THEME[page] !== null); }, getSpecialPageAssetURL(page) { @@ -137,14 +137,9 @@ LinkeditorUtils.prototype = { roundDimension: function (v) { return (Math.round(v * 100000) / 100000); - }, - intersectRect: function (r1, r2) { - return !(r2.left > r1.right || - r2.right < r1.left || - r2.top > r1.bottom || - r2.bottom < r1.top); - }, - isfocusOnFormItem: function () { + }, intersectRect: function (r1, r2) { + return !(r2.left > r1.right || r2.right < r1.left || r2.top > r1.bottom || r2.bottom < r1.top); + }, isfocusOnFormItem: function () { return $(document.activeElement).is('input[type="text"],input[type="email"],input[type="number"],input[type="tel"],input[type="search"],textarea,select'); }, diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index b14fc69f6..9b617e089 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -21,15 +21,38 @@ $themeData=$theme->getPageData(); $t=$themeData->getRawData(); - $extraFiles=['background'=>'backgroundImage','aftersearch'=>'afterSearch']; + $extraThemeFiles=['background'=>'backgroundImage','aftersearch'=>'afterSearch']; + $extraFluidbookFiles=['tabs'=>'tabsHTML5']; $hasExtra=false; - foreach ($extraFiles as $name=>$field) { + foreach ($extraThemeFiles as $name=>$field) { $file=$themeData->getImageFile($t[$field]); if(null===$file){ $t[$name]=null; continue; } - $t[$name]=['path'=>$file,'url'=>$themeData->getImageURL($t[$field]),'dim'=>Cubist\Util\Graphics\Image::getimagesize($file)]; + $t[$name]=['path'=>$file,'url'=>$themeData->getImageURL($t[$field]),'dim'=> \Cubist\Util\Graphics\Image::getimagesize($file)]; + $hasExtra=true; + } + foreach ($extraFluidbookFiles as $name=>$field) { + $fname=$fluidbook->$field; + if(!$fname){ + continue; + } + $file=$fluidbook->getAssetDir().'/'.$fname; + if(null===$file || !file_exists($file)){ + $t[$name]=null; + continue; + } + + if(stristr($file,'.svg')){ + $opt=\Fluidbook\Tools\SVG\SVGTools::optimizeSVG($file); + } + + $t[$name]=[ + 'path'=>$file, + 'url'=>route('fluidbookpublication-link-asset',['id'=>$fluidbook->id,'file'=>str_replace('.svg','.o.svg',$fname)]), + 'dim'=> \Cubist\Util\Graphics\Image::getimagesize($file) + ]; $hasExtra=true; } @@ -231,6 +254,13 @@ data-special="aftersearch" data-tooltip="{{__('Editer les liens de l\'image supplémentaire du menu')}}"> @endif + @if($fluidbook->tabsHTML5 && stristr($fluidbook->tabsHTML5,'.svg')) + + @endif @endif
@if($fluidbook->pdfThumbnails)