Simplify component.php to minimal layout with conditional analytics #82
@@ -123,8 +123,6 @@ $fontStyles = '';
|
|||||||
|
|
||||||
if ($params_FontScheme) {
|
if ($params_FontScheme) {
|
||||||
if (stripos($params_FontScheme, 'https://') === 0) {
|
if (stripos($params_FontScheme, 'https://') === 0) {
|
||||||
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
|
|
||||||
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
|
|
||||||
$this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
|
$this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
|
||||||
$wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [
|
$wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [
|
||||||
'media' => 'print',
|
'media' => 'print',
|
||||||
|
|||||||
@@ -149,8 +149,6 @@ $fontStyles = '';
|
|||||||
|
|
||||||
if ($params_FontScheme) {
|
if ($params_FontScheme) {
|
||||||
if (stripos($params_FontScheme, 'https://') === 0) {
|
if (stripos($params_FontScheme, 'https://') === 0) {
|
||||||
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com/', ['crossorigin' => 'anonymous']);
|
|
||||||
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com/', ['crossorigin' => 'anonymous']);
|
|
||||||
$this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
|
$this->getPreloadManager()->preload($params_FontScheme, ['as' => 'style', 'crossorigin' => 'anonymous']);
|
||||||
$wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [
|
$wa->registerAndUseStyle('fontscheme.current', $params_FontScheme, [], [
|
||||||
'media' => 'print',
|
'media' => 'print',
|
||||||
|
|||||||
@@ -135,7 +135,6 @@ if (class_exists('\Joomla\Component\Users\Site\Helper\RouteHelper')) {
|
|||||||
<head>
|
<head>
|
||||||
<jdoc:include type="head" />
|
<jdoc:include type="head" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
||||||
|
|
||||||
<?php if ($params_theme_enabled) : ?>
|
<?php if ($params_theme_enabled) : ?>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -198,17 +198,15 @@
|
|||||||
|
|
||||||
<!-- Typography -->
|
<!-- Typography -->
|
||||||
<field name="theme_sep_typo" type="spacer" label="Typography" hr="false" class="text fw-bold" />
|
<field name="theme_sep_typo" type="spacer" label="Typography" hr="false" class="text fw-bold" />
|
||||||
<field name="useFontScheme" type="groupedlist" label="TPL_MOKOCASSIOPEIA_FONT_LABEL" description="TPL_MOKOCASSIOPEIA_FONT_LABEL_DESC" default="media/templates/site/mokocassiopeia/css/colors/fonts-local_roboto.css">
|
<field name="useFontScheme" type="groupedlist" label="TPL_MOKOCASSIOPEIA_FONT_LABEL" description="TPL_MOKOCASSIOPEIA_FONT_LABEL_DESC" default="media/templates/site/mokocassiopeia/css/fonts/roboto.css">
|
||||||
<option value="0">JNONE</option>
|
<option value="0">JNONE</option>
|
||||||
<group label="TPL_MOKOCASSIOPEIA_FONT_GROUP_LOCAL">
|
<group label="TPL_MOKOCASSIOPEIA_FONT_GROUP_LOCAL">
|
||||||
<option value="media/templates/site/mokocassiopeia/css/colors/fonts-local_roboto.css">Roboto (local)</option>
|
<option value="media/templates/site/mokocassiopeia/css/fonts/roboto.css">Roboto (local)</option>
|
||||||
</group>
|
<option value="media/templates/site/mokocassiopeia/css/fonts/noto-sans.css">Noto Sans (local)</option>
|
||||||
<group label="TPL_MOKOCASSIOPEIA_FONT_GROUP_WEB">
|
<option value="media/templates/site/mokocassiopeia/css/fonts/fira-sans.css">Fira Sans (local)</option>
|
||||||
<option value="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@100;300;400;700&display=swap">Fira Sans (web)</option>
|
|
||||||
<option value="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@100;300;400;700&family=Roboto:wght@100;300;400;700&display=swap">Roboto + Noto Sans (web)</option>
|
|
||||||
</group>
|
</group>
|
||||||
</field>
|
</field>
|
||||||
<field name="noteFontScheme" type="note" description="TPL_MOKOCASSIOPEIA_FONT_NOTE_TEXT" class="alert alert-warning" />
|
<field name="noteFontScheme" type="note" description="TPL_MOKOCASSIOPEIA_FONT_NOTE_TEXT" class="alert alert-info" />
|
||||||
|
|
||||||
<!-- Branding & Icons -->
|
<!-- Branding & Icons -->
|
||||||
<field name="theme_sep_brand" type="spacer" label="Branding & Icons" hr="false" class="text fw-bold" />
|
<field name="theme_sep_brand" type="spacer" label="Branding & Icons" hr="false" class="text fw-bold" />
|
||||||
|
|||||||
Reference in New Issue
Block a user