From 88725b136a1fab109db28a8d2e099081b4d19d9c Mon Sep 17 00:00:00 2001
From: Vincent Vanwaelscappel
Date: Fri, 6 Jan 2023 18:03:39 +0100
Subject: [PATCH] .
---
app/Http/Controllers/FrontController.php | 28 +++++++++++++---------
resources/js/mmenu.js | 2 +-
resources/views/menu_song.blade.php | 5 ----
resources/views/notion_menu_song.blade.php | 1 -
4 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php
index 3152283..8aff76d 100644
--- a/app/Http/Controllers/FrontController.php
+++ b/app/Http/Controllers/FrontController.php
@@ -172,6 +172,7 @@ class FrontController extends Controller {
$database = $notion->databases()->find($collection->notion_database);
$songs = $notion->databases()->queryAllPages($database);
+
$res = [];
foreach ($songs as $song) {
$pageContents = '';
@@ -202,7 +203,6 @@ class FrontController extends Controller {
$s['notes'] = self::_blockToHtml($notesProperty);
$s['notion_url'] = $song->url;
-
$s['files'] = [];
$s['audios'] = [];
foreach ($filesProperty->files as $file) {
@@ -226,11 +226,10 @@ class FrontController extends Controller {
* @return string
*/
protected static function _blockToHtml($block) {
- $start = '';
- $end = '';
+ $start = '';
+ $end = '
';
if ($block instanceof Paragraph) {
- $start = '';
- $end = '
';
+
}
$res = '';
foreach ($block->text as $rt) {
@@ -239,6 +238,10 @@ class FrontController extends Controller {
$res = $start . $res . $end;
$res = str_replace('
', '', $res);
$res = str_replace('
', '', $res);
+ $res = str_replace('
', '
', $res);
+ $res = str_replace('
', '', $res);
+ $res = str_replace('', '
', $res);
+ $res = str_replace('
', '', $res);
return $res;
}
@@ -249,13 +252,16 @@ class FrontController extends Controller {
protected static function _richTextToHtml($rt) {
$start = '';
$end = '';
+
if ($rt->annotations->isBold) {
- $start = '' . $start;
- $end = $end . '';
- }
- if ($rt->annotations->isItalic) {
- $start = '' . $start;
- $end = $end . '';
+ $start = '' . $start;
+ $end = $end . '
';
+ } else if ($rt->annotations->isItalic) {
+ $start = '' . $start;
+ $end = $end . '
';
+ } else {
+ $start = '' . $start;
+ $end = $end . '
';
}
if ($rt->annotations->isUnderline) {
$start = '' . $start;
diff --git a/resources/js/mmenu.js b/resources/js/mmenu.js
index f483c67..8acf9c0 100644
--- a/resources/js/mmenu.js
+++ b/resources/js/mmenu.js
@@ -88,7 +88,7 @@ function updateSongView() {
});
$("body").get(0).style.setProperty("--text-multi", getOption('size'));
- s.find('.lyrics,h3').css('font-size', getOption('size') * 16);
+ s.find('.lyrics,h3,p,blockquote,div').css('font-size', getOption('size') * 16);
}
diff --git a/resources/views/menu_song.blade.php b/resources/views/menu_song.blade.php
index 9b791a8..37fffb2 100644
--- a/resources/views/menu_song.blade.php
+++ b/resources/views/menu_song.blade.php
@@ -1,10 +1,5 @@
@php
$songurl="/$collection->slug/$csong->slug.html";
- $prefetch[]=$songurl;
- $tracks=$csong->getAudioTracks();
- foreach ($tracks as $track) {
- $prefetch[]=$track['url'];
- }
@endphp
id == $song->id) class="active"
@endif href="{{$songurl}}">{{trim($csong->title.' - '.$csong->artist,' -')}}
diff --git a/resources/views/notion_menu_song.blade.php b/resources/views/notion_menu_song.blade.php
index 334b59a..8ac46a6 100644
--- a/resources/views/notion_menu_song.blade.php
+++ b/resources/views/notion_menu_song.blade.php
@@ -1,6 +1,5 @@
@php
$songurl="/$collection->slug/".$csong->getUrl();
- $prefetch[]=$songurl;
@endphp
{{trim($csong->getOrder().' - '.$csong->getTitle().' - '.$csong->getArtist(),' -')}}
--
2.39.5