From: Vincent Vanwaelscappel Date: Thu, 28 Aug 2025 15:11:04 +0000 (+0200) Subject: wait #7596 @4 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b974dce35d6a1727826500f21bd476574b2ac679;p=fluidbook-toolbox.git wait #7596 @4 --- diff --git a/app/Fluidbook/Compiler/Secure.php b/app/Fluidbook/Compiler/Secure.php index 2c5968dd2..3493991fa 100644 --- a/app/Fluidbook/Compiler/Secure.php +++ b/app/Fluidbook/Compiler/Secure.php @@ -103,6 +103,11 @@ trait Secure if ($this->fluidbookSettings->secureClientSideMode == '0') { $variables['CODE'] = ' $(function(){ + var redirect="index.html"; + $(document).on("click","[data-redirect]",function(e){ + redirect=$(this).data("redirect"); + return true; + }); $(\'form\').on(\'submit\', function (e) { e.preventDefault(); @@ -119,7 +124,7 @@ trait Secure error = false; window.sessionStorage.setItem(\'secureUsername\', u); window.sessionStorage.setItem(\'securePassword\', p); - window.location = \'index.html\'; + window.location = redirect; } }); if (error) { @@ -131,6 +136,11 @@ trait Secure } else { $variables['CODE'] = ' $(function(){ + var redirect="index.html"; + $(document).on("click","[data-redirect]",function(e){ + redirect=$(this).data("redirect"); + return true; + }); $(\'form\').on(\'submit\', function (e) { e.preventDefault(); @@ -142,7 +152,7 @@ trait Secure if (hu === user) { error = false; window.sessionStorage.setItem(\'secureUsername\', u); - window.location = \'index.html\'; + window.location = redirect; } }); if (error) { diff --git a/app/Http/Controllers/Admin/Operations/Tools/FluidbookSecurePage.php b/app/Http/Controllers/Admin/Operations/Tools/FluidbookSecurePage.php new file mode 100644 index 000000000..9db70d118 --- /dev/null +++ b/app/Http/Controllers/Admin/Operations/Tools/FluidbookSecurePage.php @@ -0,0 +1,58 @@ +setEnctype('multipart/form-data'); + $form->setTitle(__('Compliler une page de sécurisation de fluidbook')); + $form->setSubmitLabel(__('Compiler')); + $form->setSubmitIcon('la-lock'); + $form->addField('template', StandardFile::class, __('Template'), ['accept' => ['.html']]); + $form->addField('fluidbook', FluidbookID::class, __('Fluidbook'), ['hint' => __('Utilise les paramètres de sécurisation de ce fluidbook')]); + return view('tools.form', ['form' => $form]); + } + + + public function dofluidbooksecurepage() + { + /** @var FluidbookPublication $fluidbook */ + $fluidbook = FluidbookPublication::withoutGlobalScopes()->find(request()->get('fluidbook')); + $fluidbook->secureClientSidePassword = '___secure.html'; + move_uploaded_file(request()->allFiles()['template']->getPathname(), $fluidbook->getAssetDir() . '/___secure.html'); + Compiler::compile($fluidbook, false, false, true); + $final = $fluidbook->getFinalPath(); + + // TODO : add other assets by parsing html and finding needed assets (images, logo) + $copy = ['secure.html' => 'index.html', + 'data/forge.js' => 'data/forge.js', + 'data/noaccents.js' => 'data/noaccents.js', + 'data/jquery.js' => 'data/jquery.js', + ]; + + $tmp = Files::tmpdir(); + Files::mkdir($tmp . '/data'); + foreach ($copy as $from => $to) { + copy($final . '/' . $from, $tmp . '/' . $to); + } + $tmpzip = Files::tempnam() . '.zip'; + Zip::archive($tmp, $tmpzip); + + return response()->download($tmpzip, 'secure.zip')->deleteFileAfterSend(true); + } +} diff --git a/app/Http/Controllers/Admin/ToolsController.php b/app/Http/Controllers/Admin/ToolsController.php index c29646755..e1bd60fd3 100644 --- a/app/Http/Controllers/Admin/ToolsController.php +++ b/app/Http/Controllers/Admin/ToolsController.php @@ -14,6 +14,7 @@ use App\Http\Controllers\Admin\Operations\Tools\FluidbookCopyLinks; use App\Http\Controllers\Admin\Operations\Tools\FluidbookEasyCreation; use App\Http\Controllers\Admin\Operations\Tools\FluidbookReferencesURL; use App\Http\Controllers\Admin\Operations\Tools\FluidbookReplicate; +use App\Http\Controllers\Admin\Operations\Tools\FluidbookSecurePage; use App\Http\Controllers\Admin\Operations\Tools\GitReposCreate; use App\Http\Controllers\Admin\Operations\Tools\ImagesResizer; use App\Http\Controllers\Admin\Operations\Tools\ImportFluidbookSettings; @@ -25,7 +26,6 @@ use App\Http\Controllers\Admin\Operations\Tools\StaticSiteUploader; use App\Http\Controllers\Admin\Operations\Tools\SVGCleaner; use App\Http\Controllers\Admin\Operations\Tools\TextToSpeech; use App\Http\Controllers\Admin\Operations\Tools\Webfonts; -use App\Http\Controllers\Admin\Operations\Tools\WebfontsOperation; use App\Http\Controllers\Controller; class ToolsController extends Controller @@ -52,6 +52,7 @@ class ToolsController extends Controller use PDFLayers; use Webfonts; use FluidbookEasyCreation; + use FluidbookSecurePage; protected function index($tool, $args = '') { diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index b2b2afdaa..fad22c3ad 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -372,10 +372,12 @@ trait PublicationSettings ], 'default' => 'flip3d', ]); - $this->_addSettingField('slideTransitionsElastic', Checkbox::class, __('Mode elastique pour les transitions slide'), ['default' => false]); + $this->_addSettingField('slideTransitionsElastic', Checkbox::class, __('Mode elastique pour les transitions slide'), ['when' => ['mobileTransitions' => ['slide', 'flip', 'flip3d']], 'default' => false]); + $this->_addSettingField('elasticTransitionDirection', SelectFromArray::class, $this->__('Direction'), ['when' => ['slideTransitionsElastic' => '1', 'mobileTransitions' => ['slide', 'flip', 'flip3d']], 'options' => ['horizontal' => __('Horizontal'), 'vertical' => __('Vertical')], 'default' => 'vertical']); $this->_addSettingField('mobileTransitionDuration', Number::class, $this->__('Durée de la transition'), [ 'default' => 0.5, ]); + $this->_addSettingField('mobileTransitionDurationSlide', Number::class, $this->__('Durée de la transition (fade, slide)'), [ 'hint' => $this->__('Laisser à zéro pour utiliser la valeur générale'), 'default' => 0, diff --git a/composer.lock b/composer.lock index 07a4ef6e0..1c1a145b3 100644 --- a/composer.lock +++ b/composer.lock @@ -1681,16 +1681,16 @@ }, { "name": "composer/semver", - "version": "3.4.3", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", - "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { @@ -1742,7 +1742,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.3" + "source": "https://github.com/composer/semver/tree/3.4.4" }, "funding": [ { @@ -1752,13 +1752,9 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2024-09-19T14:15:21+00:00" + "time": "2025-08-20T19:15:30+00:00" }, { "name": "creativeorange/gravatar", @@ -2528,13 +2524,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_util.git", - "reference": "2b3f590546da10edc98c719b99f5d802f29098f2" + "reference": "5707c953b156499432ada9197f7b4c7c6e6dd9ce" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-d27dbc.tar", - "reference": "2b3f590546da10edc98c719b99f5d802f29098f2", - "shasum": "542f6c66ec2f1a1918a0187c03c6dc117f6d8e16" + "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-ee0a7c.tar", + "reference": "5707c953b156499432ada9197f7b4c7c6e6dd9ce", + "shasum": "2c903a3859779eb8274250d090526bb5e96854f3" }, "require": { "cubist/net": "dev-master", @@ -2568,7 +2564,7 @@ } ], "description": "Utilities class", - "time": "2025-08-07T16:12:56+00:00" + "time": "2025-08-28T08:53:02+00:00" }, { "name": "cviebrock/eloquent-sluggable", @@ -4136,13 +4132,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/fluidbook_tools.git", - "reference": "b2e0e8f5313a053510a64f3fbd73101f38b82c0f" + "reference": "4b50779b7ffc47e0778ffa4ebeac19ac6e8f19f1" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-bef312.tar", - "reference": "b2e0e8f5313a053510a64f3fbd73101f38b82c0f", - "shasum": "fa89fef484bc1dad8ec4b2b0f8b0e3a262df5576" + "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-91e247.tar", + "reference": "4b50779b7ffc47e0778ffa4ebeac19ac6e8f19f1", + "shasum": "cd0919839d475d13509d6671a3cc525045bb76eb" }, "require": { "barryvdh/laravel-debugbar": "*", @@ -4178,7 +4174,7 @@ } ], "description": "Fluidbook Tools", - "time": "2025-08-07T14:13:43+00:00" + "time": "2025-08-26T15:29:06+00:00" }, { "name": "fpdf/fpdf", @@ -4928,22 +4924,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.9.3", + "version": "7.10.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", - "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.3", - "guzzlehttp/psr7": "^2.7.0", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -5034,7 +5030,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.9.3" + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" }, "funding": [ { @@ -5050,20 +5046,20 @@ "type": "tidelift" } ], - "time": "2025-03-27T13:37:11+00:00" + "time": "2025-08-23T22:36:01+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" + "reference": "481557b130ef3790cf82b713667b43030dc9c957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", - "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", "shasum": "" }, "require": { @@ -5071,7 +5067,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" + "phpunit/phpunit": "^8.5.44 || ^9.6.25" }, "type": "library", "extra": { @@ -5117,7 +5113,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.2.0" + "source": "https://github.com/guzzle/promises/tree/2.3.0" }, "funding": [ { @@ -5133,20 +5129,20 @@ "type": "tidelift" } ], - "time": "2025-03-27T13:27:01+00:00" + "time": "2025-08-22T14:34:08+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.7.1", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" + "reference": "21dc724a0583619cd1652f673303492272778051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", - "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051", + "reference": "21dc724a0583619cd1652f673303492272778051", "shasum": "" }, "require": { @@ -5162,7 +5158,7 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "http-interop/http-factory-tests": "0.9.0", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" + "phpunit/phpunit": "^8.5.44 || ^9.6.25" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -5233,7 +5229,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.7.1" + "source": "https://github.com/guzzle/psr7/tree/2.8.0" }, "funding": [ { @@ -5249,20 +5245,20 @@ "type": "tidelift" } ], - "time": "2025-03-27T12:30:47+00:00" + "time": "2025-08-23T21:21:41+00:00" }, { "name": "guzzlehttp/uri-template", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/guzzle/uri-template.git", - "reference": "30e286560c137526eccd4ce21b2de477ab0676d2" + "reference": "4f4bbd4e7172148801e76e3decc1e559bdee34e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/uri-template/zipball/30e286560c137526eccd4ce21b2de477ab0676d2", - "reference": "30e286560c137526eccd4ce21b2de477ab0676d2", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/4f4bbd4e7172148801e76e3decc1e559bdee34e1", + "reference": "4f4bbd4e7172148801e76e3decc1e559bdee34e1", "shasum": "" }, "require": { @@ -5271,7 +5267,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.44 || ^9.6.25", "uri-template/tests": "1.0.0" }, "type": "library", @@ -5319,7 +5315,7 @@ ], "support": { "issues": "https://github.com/guzzle/uri-template/issues", - "source": "https://github.com/guzzle/uri-template/tree/v1.0.4" + "source": "https://github.com/guzzle/uri-template/tree/v1.0.5" }, "funding": [ { @@ -5335,7 +5331,7 @@ "type": "tidelift" } ], - "time": "2025-02-03T10:55:03+00:00" + "time": "2025-08-22T14:27:06+00:00" }, { "name": "hollodotme/fast-cgi-client", @@ -9276,16 +9272,16 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.3", + "version": "1.9.4", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" + "reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", - "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d", + "reference": "638a154f8d4ee6a5cfa96d6a34dfbe0cffa9566d", "shasum": "" }, "require": { @@ -9293,7 +9289,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" + "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34" }, "type": "library", "extra": { @@ -9335,7 +9331,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.4" }, "funding": [ { @@ -9347,7 +9343,7 @@ "type": "tidelift" } ], - "time": "2024-07-20T21:41:07+00:00" + "time": "2025-08-21T11:53:16+00:00" }, { "name": "pnz/json-exception", @@ -16054,16 +16050,16 @@ }, { "name": "composer/class-map-generator", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "134b705ddb0025d397d8318a75825fe3c9d1da34" + "reference": "ba9f089655d4cdd64e762a6044f411ccdaec0076" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/134b705ddb0025d397d8318a75825fe3c9d1da34", - "reference": "134b705ddb0025d397d8318a75825fe3c9d1da34", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/ba9f089655d4cdd64e762a6044f411ccdaec0076", + "reference": "ba9f089655d4cdd64e762a6044f411ccdaec0076", "shasum": "" }, "require": { @@ -16107,7 +16103,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.6.1" + "source": "https://github.com/composer/class-map-generator/tree/1.6.2" }, "funding": [ { @@ -16117,13 +16113,9 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2025-03-24T13:50:44+00:00" + "time": "2025-08-20T18:52:43+00:00" }, { "name": "doctrine/instantiator", @@ -17269,16 +17261,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.24", + "version": "9.6.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701" + "reference": "049c011e01be805202d8eebedef49f769a8ec7b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea49afa29aeea25ea7bf9de9fdd7cab163cc0701", - "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/049c011e01be805202d8eebedef49f769a8ec7b7", + "reference": "049c011e01be805202d8eebedef49f769a8ec7b7", "shasum": "" }, "require": { @@ -17352,7 +17344,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.24" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.25" }, "funding": [ { @@ -17376,7 +17368,7 @@ "type": "tidelift" } ], - "time": "2025-08-10T08:32:42+00:00" + "time": "2025-08-20T14:38:31+00:00" }, { "name": "psy/psysh", @@ -18457,16 +18449,16 @@ }, { "name": "spatie/backtrace", - "version": "1.7.4", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/spatie/backtrace.git", - "reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe" + "reference": "8c0f16a59ae35ec8c62d85c3c17585158f430110" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/cd37a49fce7137359ac30ecc44ef3e16404cccbe", - "reference": "cd37a49fce7137359ac30ecc44ef3e16404cccbe", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/8c0f16a59ae35ec8c62d85c3c17585158f430110", + "reference": "8c0f16a59ae35ec8c62d85c3c17585158f430110", "shasum": "" }, "require": { @@ -18504,7 +18496,8 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/backtrace/tree/1.7.4" + "issues": "https://github.com/spatie/backtrace/issues", + "source": "https://github.com/spatie/backtrace/tree/1.8.1" }, "funding": [ { @@ -18516,7 +18509,7 @@ "type": "other" } ], - "time": "2025-05-08T15:41:09+00:00" + "time": "2025-08-26T08:22:30+00:00" }, { "name": "spatie/error-solutions", diff --git a/resources/views/tools/sidebar.blade.php b/resources/views/tools/sidebar.blade.php index 1270a672e..fd8e002bf 100644 --- a/resources/views/tools/sidebar.blade.php +++ b/resources/views/tools/sidebar.blade.php @@ -9,6 +9,9 @@ +