From bdb586144cba1d1ef2f61b4f83d56ddf01bca979 Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 17 Apr 2024 13:16:41 +0300 Subject: [PATCH] append app prefix to window title --- config.json | 13 +------------ src/Entity/App.php | 18 ++++++++++++------ src/Entity/Tab/Page.php | 19 +++++-------------- 3 files changed, 18 insertions(+), 32 deletions(-) diff --git a/config.json b/config.json index 55146236..bd7724c1 100644 --- a/config.json +++ b/config.json @@ -12,13 +12,6 @@ "header": { "enabled":true, - "title": - { - "length": - { - "max":64 - } - }, "button": { "close":true @@ -32,11 +25,7 @@ { "title": { - "default":"New page", - "length": - { - "max":32 - } + "default":"New page" }, "redirect": { diff --git a/src/Entity/App.php b/src/Entity/App.php index 68a38fb3..e671e770 100644 --- a/src/Entity/App.php +++ b/src/Entity/App.php @@ -191,13 +191,19 @@ class App { if ($value) { + if ($value == 'Welcome to Yoda!') + { + $title = $value; + } - /* @TODO - $title = urldecode( - mb_strlen($value) > $this->config->header->title->length->max ? mb_substr($value, 0, $this->config->header->title->length->max) . '...' - : $value - ); - */ $title = $value; + else + { + $title = sprintf( + '%s - %s', + $value, + $this->config->name + ); + } } else diff --git a/src/Entity/Tab/Page.php b/src/Entity/Tab/Page.php index 80a6c85e..ccdc8932 100644 --- a/src/Entity/Tab/Page.php +++ b/src/Entity/Tab/Page.php @@ -664,10 +664,6 @@ class Page $title = $origin->getHost(); } - $this->app->setTitle( - $title - ); - $this->setTitle( $title ); @@ -757,10 +753,6 @@ class Page $h1 ); - $this->app->setTitle( - $title - ); - $this->setTitle( $title ); @@ -773,12 +765,7 @@ class Page { if ($value) { - /* @TODO - $title = urldecode( - mb_strlen($value) > $this->config->title->length->max ? mb_substr($value, 0, $this->config->title->length->max) . '...' - : $value - ); - */ $title = $value; + $title = $value; } else @@ -790,6 +777,10 @@ class Page $this->box, $title ); + + $this->app->setTitle( + $title + ); } public function setProgress(