Explorar el Código

Lazy load logo on install, logo on header and theme thumbs in config slide (#4998)

* feat: lazy load logo on install, logo on header and theme thumbs in config slide
Sadetdin EYILI hace 3 años
padre
commit
bbe3eb8f41
Se han modificado 5 ficheros con 9 adiciones y 9 borrados
  1. 2 2
      app/install.php
  2. 4 4
      app/layout/header.phtml
  3. 1 1
      app/layout/simple.phtml
  4. 1 1
      app/views/configure/display.phtml
  5. 1 1
      p/index.html

+ 2 - 2
app/install.php

@@ -445,7 +445,7 @@ function printStep1() {
 	<?php } else { ?>
 	<p class="alert alert-error"><?= _t('install.action.fix_errors_before') ?></p>
 	<a id="actualize" class="btn" href="./index.php?step=1" title="<?= _t('install.check.reload') ?>">
-		<img class="icon" src="../themes/icons/refresh.svg" alt="🔃" />
+		<img class="icon" src="../themes/icons/refresh.svg" alt="🔃" loading="lazy" />
 	</a>
 	<?php } ?>
 <?php
@@ -676,7 +676,7 @@ if (_t('gen.dir') === 'rtl') {
 	<div class="item title">
 		<div id="logo-wrapper">
 			<a href="./">
-				<img class="logo" src="../themes/icons/FreshRSS-logo.svg" alt="">
+				<img class="logo" src="../themes/icons/FreshRSS-logo.svg" alt="" loading="lazy">
 			</a>
 		</div>
 	</div>

+ 4 - 4
app/layout/header.phtml

@@ -2,7 +2,7 @@
 	<div class="item title">
 		<a href="<?= _url('index', 'index') ?>">
 			<?php if (FreshRSS_Context::$system_conf->logo_html == '') { ?>
-				<img class="logo" src="<?= _i('FreshRSS-logo', FreshRSS_Themes::ICON_URL) ?>" alt="FreshRSS" />
+				<img class="logo" src="<?= _i('FreshRSS-logo', FreshRSS_Themes::ICON_URL) ?>" alt="FreshRSS" loading="lazy" />
 			<?php
 				} else {
 					echo FreshRSS_Context::$system_conf->logo_html;
@@ -18,7 +18,7 @@
 				<input type="search" name="search" id="search" class="extend"
 					value="<?= htmlspecialchars(htmlspecialchars_decode(FreshRSS_Context::$search, ENT_QUOTES), ENT_COMPAT, 'UTF-8') ?>"
 					placeholder="<?= _t('gen.menu.search') ?>" />
-				
+
 				<?php $param_a = Minz_Request::actionName(); ?>
 				<?php if (in_array($param_a, ['normal', 'global', 'reader'])) { ?>
 				<input type="hidden" name="a" value="<?= $param_a ?>" />
@@ -83,7 +83,7 @@
 				</li>
 				<?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
 				<li class="item dropdown-section">
-					<div class="dropdown-section-title">	
+					<div class="dropdown-section-title">
 						<?= _t('gen.menu.admin') ?>
 					</div>
 					<ul>
@@ -98,7 +98,7 @@
 					</ul>
 				</li>
 				<?php } ?>
-				
+
 				<li class="item dropdown-section">
 					<ul>
 						<li class="item"><a href="<?= _url('index', 'logs') ?>"><?= _t('gen.menu.logs') ?></a></li>

+ 1 - 1
app/layout/simple.phtml

@@ -31,7 +31,7 @@
 		<div class="item title">
 			<a href="<?= _url('index', 'index') ?>">
 				<?php if (FreshRSS_Context::$system_conf->logo_html == '') { ?>
-					<img class="logo" src="<?= _i('FreshRSS-logo', FreshRSS_Themes::ICON_URL) ?>" alt="FreshRSS" />
+					<img class="logo" src="<?= _i('FreshRSS-logo', FreshRSS_Themes::ICON_URL) ?>" alt="FreshRSS" loading="lazy" />
 				<?php
 					} else {
 						echo FreshRSS_Context::$system_conf->logo_html;

+ 1 - 1
app/views/configure/display.phtml

@@ -60,7 +60,7 @@
 							data-leave-validation="<?= (FreshRSS_Context::$user_conf->theme === $theme['id']) ? 1 : 0 ?>" />
 						<li class="slide-container">
 							<div class="slide">
-								<img src="<?= Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png') ?>" />
+								<img src="<?= Minz_Url::display('/themes/' . $theme['id'] . '/thumbs/original.png') ?>" loading="lazy" />
 							</div>
 							<div class="nav">
 								<?php if ($i !== 1) {?>

+ 1 - 1
p/index.html

@@ -14,6 +14,6 @@
 
 <body>
 <h1><a href="i/">FreshRSS</a></h1>
-<p><a href="i/"><img class="logo" width="25%" src="themes/icons/icon.svg" alt="⊚" /></a></p>
+<p><a href="i/"><img class="logo" width="25%" src="themes/icons/icon.svg" alt="⊚" loading="lazy" /></a></p>
 </body>
 </html>