From: Vincent Vanwaelscappel Date: Tue, 23 Aug 2022 07:31:00 +0000 (+0200) Subject: wip #5399 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=df637b8e8291f8d9f997c358975dc0e67b2906cc;p=fluidbook-toolbox.git wip #5399 @0.5 --- diff --git a/app/Fluidbook/SEO/Document.php b/app/Fluidbook/SEO/Document.php index a6c274cc6..a1767027b 100644 --- a/app/Fluidbook/SEO/Document.php +++ b/app/Fluidbook/SEO/Document.php @@ -126,15 +126,14 @@ class Document public function _getPageLabel($page) { $res = $this->compiler->getSetting('title'); - dd($this->compiler->getSetting('chapters')); - foreach ($this->compiler->getSetting('chapters') as $chapter) { - if (trim($chapter->label, "\t\r\n\0\x0B-+") == '') { + foreach ($this->compiler->getFluidbook()->chapters as $chapter) { + if (trim($chapter['label'], "\t\r\n\0\x0B-+") == '') { continue; } - if ($chapter->page == '') { + if ($chapter['page'] == '') { continue; } - $p = $this->compiler->virtualToPhysical($chapter->page); + $p = $this->compiler->virtualToPhysical($chapter['page']); if ($p == '') { continue; } @@ -142,7 +141,7 @@ class Document continue; } if ($page >= $p) { - $res = $chapter->label; + $res = $chapter['label']; } } return $res; diff --git a/app/Jobs/FluidbookCompiler.php b/app/Jobs/FluidbookCompiler.php index d5baadb09..0f2c94706 100644 --- a/app/Jobs/FluidbookCompiler.php +++ b/app/Jobs/FluidbookCompiler.php @@ -1451,13 +1451,17 @@ height="0" width="0" style="display:none;visibility:hidden"> } } + /** + * @throws \Exception + */ protected function writeSounds() { if ($this->fluidbookSettings->soundTheme == '') { return; } - $this->config->simpleSoundTheme = file_exists(WS_SOUNDS . '/' . $this->fluidbookSettings->soundTheme . '/flip.mp3'); - $this->vdir->copyDirectory(WS_SOUNDS . '/' . $this->fluidbookSettings->soundTheme, 'data/sounds'); + $dir = resource_path('fluidbookpublication/sounds/' . $this->fluidbookSettings->soundTheme); + $this->setSetting('simpleSoundTheme', file_exists($dir . '/flip.mp3')); + $this->vdir->copyDirectory($dir, 'data/sounds'); } protected function writeAccessibility() diff --git a/resources/fluidbookpublication/sounds/classic/corner-drag.mp3 b/resources/fluidbookpublication/sounds/classic/corner-drag.mp3 new file mode 100644 index 000000000..aa48cb80e Binary files /dev/null and b/resources/fluidbookpublication/sounds/classic/corner-drag.mp3 differ diff --git a/resources/fluidbookpublication/sounds/classic/corner-release.mp3 b/resources/fluidbookpublication/sounds/classic/corner-release.mp3 new file mode 100644 index 000000000..ac176ec53 Binary files /dev/null and b/resources/fluidbookpublication/sounds/classic/corner-release.mp3 differ diff --git a/resources/fluidbookpublication/sounds/classic/cover-flip.mp3 b/resources/fluidbookpublication/sounds/classic/cover-flip.mp3 new file mode 100644 index 000000000..8c1701aed Binary files /dev/null and b/resources/fluidbookpublication/sounds/classic/cover-flip.mp3 differ diff --git a/resources/fluidbookpublication/sounds/classic/page-flip-1.mp3 b/resources/fluidbookpublication/sounds/classic/page-flip-1.mp3 new file mode 100644 index 000000000..d11aafab9 Binary files /dev/null and b/resources/fluidbookpublication/sounds/classic/page-flip-1.mp3 differ diff --git a/resources/fluidbookpublication/sounds/classic/page-flip-2.mp3 b/resources/fluidbookpublication/sounds/classic/page-flip-2.mp3 new file mode 100644 index 000000000..479714396 Binary files /dev/null and b/resources/fluidbookpublication/sounds/classic/page-flip-2.mp3 differ diff --git a/resources/fluidbookpublication/sounds/corner-drag.mp3 b/resources/fluidbookpublication/sounds/corner-drag.mp3 new file mode 100644 index 000000000..aa48cb80e Binary files /dev/null and b/resources/fluidbookpublication/sounds/corner-drag.mp3 differ diff --git a/resources/fluidbookpublication/sounds/corner-release.mp3 b/resources/fluidbookpublication/sounds/corner-release.mp3 new file mode 100644 index 000000000..ac176ec53 Binary files /dev/null and b/resources/fluidbookpublication/sounds/corner-release.mp3 differ diff --git a/resources/fluidbookpublication/sounds/cover-flip.mp3 b/resources/fluidbookpublication/sounds/cover-flip.mp3 new file mode 100644 index 000000000..8c1701aed Binary files /dev/null and b/resources/fluidbookpublication/sounds/cover-flip.mp3 differ diff --git a/resources/fluidbookpublication/sounds/heavy/corner-drag.mp3 b/resources/fluidbookpublication/sounds/heavy/corner-drag.mp3 new file mode 100644 index 000000000..aa48cb80e Binary files /dev/null and b/resources/fluidbookpublication/sounds/heavy/corner-drag.mp3 differ diff --git a/resources/fluidbookpublication/sounds/heavy/corner-release.mp3 b/resources/fluidbookpublication/sounds/heavy/corner-release.mp3 new file mode 100644 index 000000000..ac176ec53 Binary files /dev/null and b/resources/fluidbookpublication/sounds/heavy/corner-release.mp3 differ diff --git a/resources/fluidbookpublication/sounds/heavy/cover-flip.mp3 b/resources/fluidbookpublication/sounds/heavy/cover-flip.mp3 new file mode 100644 index 000000000..8c1701aed Binary files /dev/null and b/resources/fluidbookpublication/sounds/heavy/cover-flip.mp3 differ diff --git a/resources/fluidbookpublication/sounds/heavy/page-flip-1.mp3 b/resources/fluidbookpublication/sounds/heavy/page-flip-1.mp3 new file mode 100644 index 000000000..8c1701aed Binary files /dev/null and b/resources/fluidbookpublication/sounds/heavy/page-flip-1.mp3 differ diff --git a/resources/fluidbookpublication/sounds/heavy/page-flip-2.mp3 b/resources/fluidbookpublication/sounds/heavy/page-flip-2.mp3 new file mode 100644 index 000000000..8c1701aed Binary files /dev/null and b/resources/fluidbookpublication/sounds/heavy/page-flip-2.mp3 differ diff --git a/resources/fluidbookpublication/sounds/light/corner-drag.mp3 b/resources/fluidbookpublication/sounds/light/corner-drag.mp3 new file mode 100644 index 000000000..aa48cb80e Binary files /dev/null and b/resources/fluidbookpublication/sounds/light/corner-drag.mp3 differ diff --git a/resources/fluidbookpublication/sounds/light/corner-release.mp3 b/resources/fluidbookpublication/sounds/light/corner-release.mp3 new file mode 100644 index 000000000..ac176ec53 Binary files /dev/null and b/resources/fluidbookpublication/sounds/light/corner-release.mp3 differ diff --git a/resources/fluidbookpublication/sounds/light/cover-flip.mp3 b/resources/fluidbookpublication/sounds/light/cover-flip.mp3 new file mode 100644 index 000000000..d11aafab9 Binary files /dev/null and b/resources/fluidbookpublication/sounds/light/cover-flip.mp3 differ diff --git a/resources/fluidbookpublication/sounds/light/page-flip-1.mp3 b/resources/fluidbookpublication/sounds/light/page-flip-1.mp3 new file mode 100644 index 000000000..d11aafab9 Binary files /dev/null and b/resources/fluidbookpublication/sounds/light/page-flip-1.mp3 differ diff --git a/resources/fluidbookpublication/sounds/light/page-flip-2.mp3 b/resources/fluidbookpublication/sounds/light/page-flip-2.mp3 new file mode 100644 index 000000000..479714396 Binary files /dev/null and b/resources/fluidbookpublication/sounds/light/page-flip-2.mp3 differ diff --git a/resources/fluidbookpublication/sounds/page-flip-1.mp3 b/resources/fluidbookpublication/sounds/page-flip-1.mp3 new file mode 100644 index 000000000..d11aafab9 Binary files /dev/null and b/resources/fluidbookpublication/sounds/page-flip-1.mp3 differ diff --git a/resources/fluidbookpublication/sounds/page-flip-2.mp3 b/resources/fluidbookpublication/sounds/page-flip-2.mp3 new file mode 100644 index 000000000..479714396 Binary files /dev/null and b/resources/fluidbookpublication/sounds/page-flip-2.mp3 differ diff --git a/resources/fluidbookpublication/sounds/silent/corner-drag.mp3 b/resources/fluidbookpublication/sounds/silent/corner-drag.mp3 new file mode 100644 index 000000000..9cd8436ea Binary files /dev/null and b/resources/fluidbookpublication/sounds/silent/corner-drag.mp3 differ diff --git a/resources/fluidbookpublication/sounds/silent/corner-release.mp3 b/resources/fluidbookpublication/sounds/silent/corner-release.mp3 new file mode 100644 index 000000000..9cd8436ea Binary files /dev/null and b/resources/fluidbookpublication/sounds/silent/corner-release.mp3 differ diff --git a/resources/fluidbookpublication/sounds/silent/cover-flip.mp3 b/resources/fluidbookpublication/sounds/silent/cover-flip.mp3 new file mode 100644 index 000000000..9cd8436ea Binary files /dev/null and b/resources/fluidbookpublication/sounds/silent/cover-flip.mp3 differ diff --git a/resources/fluidbookpublication/sounds/silent/page-flip-1.mp3 b/resources/fluidbookpublication/sounds/silent/page-flip-1.mp3 new file mode 100644 index 000000000..9cd8436ea Binary files /dev/null and b/resources/fluidbookpublication/sounds/silent/page-flip-1.mp3 differ diff --git a/resources/fluidbookpublication/sounds/silent/page-flip-2.mp3 b/resources/fluidbookpublication/sounds/silent/page-flip-2.mp3 new file mode 100644 index 000000000..9cd8436ea Binary files /dev/null and b/resources/fluidbookpublication/sounds/silent/page-flip-2.mp3 differ diff --git a/resources/fluidbookpublication/sounds/woosh/flip.mp3 b/resources/fluidbookpublication/sounds/woosh/flip.mp3 new file mode 100644 index 000000000..1e6d9060e Binary files /dev/null and b/resources/fluidbookpublication/sounds/woosh/flip.mp3 differ