From eb0d0d6e96c396f179f9b710589cdea64cedd810 Mon Sep 17 00:00:00 2001 From: filesite Date: Tue, 26 Apr 2022 20:34:42 +0800 Subject: [PATCH] improve view --- themes/googleimage/controller/SiteController.php | 8 ++++---- themes/googleimage/views/site/index.php | 4 +++- www/js/googleimage.js | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/themes/googleimage/controller/SiteController.php b/themes/googleimage/controller/SiteController.php index 606349c..a278b09 100644 --- a/themes/googleimage/controller/SiteController.php +++ b/themes/googleimage/controller/SiteController.php @@ -43,11 +43,11 @@ Class SiteController extends Controller { } $pageTitle = !empty($titles) ? $titles[0]['name'] : "FileSite.io - 无数据库、基于文件和目录的Markdown文档、网址导航、图书、图片、视频网站PHP开源系统"; + if (!empty($readmeFile['title'])) { + $pageTitle = $readmeFile['title']; + } if (!empty($subcate)) { - $pageTitle = "{$subcate['directory']}的照片,来自{$pageTitle}"; - if (!empty($readmeFile['title'])) { - $pageTitle = $readmeFile['title']; - } + $pageTitle = "{$subcate['directory']}照片,来自{$pageTitle}"; } $viewName = 'index'; $params = compact('cateId', 'dirTree', 'scanResults', 'menus', 'htmlReadme', 'htmlCateReadme'); diff --git a/themes/googleimage/views/site/index.php b/themes/googleimage/views/site/index.php index c543c98..7e78fad 100644 --- a/themes/googleimage/views/site/index.php +++ b/themes/googleimage/views/site/index.php @@ -93,7 +93,9 @@ eof; eof; } - }else if (!empty($category['files'])) { //一级目录支持 + } + + if (!empty($category['files'])) { //一级目录支持 foreach($category['files'] as $file) { if (!in_array($file['extension'], $imgExts)) {continue;} diff --git a/www/js/googleimage.js b/www/js/googleimage.js index ce9c00c..857f350 100644 --- a/www/js/googleimage.js +++ b/www/js/googleimage.js @@ -22,7 +22,7 @@ //init photo gallery if ($('.img-preview').length > 0) { var imgContainer = $('.content').get(0); - var links = imgContainer.getElementsByTagName('a'); + var links = imgContainer.getElementsByClassName('img-preview'); $('.img-preview').click(function(evt) { var target = evt.target;