-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
928 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<browserconfig> | ||
<msapplication> | ||
<tile> | ||
<square150x150logo src="/mstile-150x150.png"/> | ||
<TileColor>#ffffff</TileColor> | ||
</tile> | ||
</msapplication> | ||
</browserconfig> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "", | ||
"short_name": "", | ||
"icons": [ | ||
{ | ||
"src": "/android-chrome-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/android-chrome-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"theme_color": "#ffffff", | ||
"background_color": "#ffffff", | ||
"display": "standalone" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<?php | ||
namespace Joomla\CMS\Document\Renderer\Html; | ||
|
||
\defined('JPATH_PLATFORM') || die; | ||
|
||
use Joomla\CMS\Document\DocumentRenderer; | ||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\Helper\TagsHelper; | ||
use Joomla\CMS\WebAsset\WebAssetAttachBehaviorInterface; | ||
use Joomla\Utilities\ArrayHelper; | ||
|
||
class metasRenderer extends DocumentRenderer | ||
{ | ||
/** | ||
* Renders the document metas and returns the results as a string | ||
* | ||
* @param string $head (unused) | ||
* @param array $params Associative array of values | ||
* @param string $content The script | ||
* | ||
* @return string The output of the script | ||
* | ||
* @since 4.0.0 | ||
*/ | ||
public function render($head, $params = [], $content = null) | ||
{ | ||
// Convert the tagids to titles | ||
if (isset($this->_doc->_metaTags['name']['tags'])) | ||
{ | ||
$tagsHelper = new TagsHelper; | ||
$this->_doc->_metaTags['name']['tags'] = implode(', ', $tagsHelper->getTagNames($this->_doc->_metaTags['name']['tags'])); | ||
} | ||
|
||
/** @var \Joomla\CMS\Application\CMSApplication $app */ | ||
$wa = $this->_doc->getWebAssetManager(); | ||
$wc = $this->_doc->getScriptOptions('webcomponents'); | ||
|
||
// Check for AttachBehavior and web components | ||
foreach ($wa->getAssets('script', true) as $asset) | ||
{ | ||
if ($asset instanceof WebAssetAttachBehaviorInterface) | ||
{ | ||
$asset->onAttachCallback($this->_doc); | ||
} | ||
|
||
if ($asset->getOption('webcomponent')) | ||
{ | ||
$wc[] = $asset->getUri(); | ||
} | ||
} | ||
|
||
if ($wc) | ||
{ | ||
$this->_doc->addScriptOptions('webcomponents', array_unique($wc)); | ||
} | ||
|
||
// Trigger the onBeforeCompileHead event | ||
Factory::getApplication()->triggerEvent('onBeforeCompileHead'); | ||
|
||
// Add Script Options as inline asset | ||
$scriptOptions = $this->_doc->getScriptOptions(); | ||
|
||
if ($scriptOptions) | ||
{ | ||
$prettyPrint = (JDEBUG && \defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false); | ||
$jsonOptions = json_encode($scriptOptions, $prettyPrint); | ||
$jsonOptions = $jsonOptions ? $jsonOptions : '{}'; | ||
|
||
$wa->addInlineScript( | ||
$jsonOptions, | ||
['name' => 'joomla.script.options', 'position' => 'before'], | ||
['type' => 'application/json', 'class' => 'joomla-script-options new'], | ||
['core'] | ||
); | ||
} | ||
|
||
// Lock the AssetManager | ||
$wa->lock(); | ||
|
||
$buffer = ''; | ||
|
||
// Generate charset when using HTML5 (should happen first) | ||
$buffer .= '<meta charset="' . $this->_doc->getCharset() . '">'; | ||
|
||
// Generate base tag (need to happen early) | ||
$base = $this->_doc->getBase(); | ||
|
||
if (!empty($base)) | ||
{ | ||
$buffer .= '<base href="' . $base . '">'; | ||
} | ||
|
||
// Generate META tags (needs to happen as early as possible in the head) | ||
foreach ($this->_doc->_metaTags as $type => $tag) | ||
{ | ||
foreach ($tag as $name => $contents) | ||
{ | ||
if ($type !== 'http-equiv' && !empty($contents)) | ||
{ | ||
$buffer .= '<meta ' . $type . '="' . $name . '" content="' | ||
. htmlspecialchars($contents, ENT_COMPAT, 'UTF-8') . '">'; | ||
} | ||
} | ||
} | ||
|
||
// Don't add empty descriptions | ||
$documentDescription = $this->_doc->getDescription(); | ||
|
||
if ($documentDescription) | ||
{ | ||
$buffer .= '<meta name="description" content="' . htmlspecialchars($documentDescription, ENT_COMPAT, 'UTF-8') . '">'; | ||
} | ||
|
||
// Don't add empty generators | ||
$generator = $this->_doc->getGenerator(); | ||
|
||
if ($generator) | ||
{ | ||
$buffer .= '<meta name="generator" content="' . htmlspecialchars($generator, ENT_COMPAT, 'UTF-8') . '">'; | ||
} | ||
|
||
$buffer .= '<title>' . htmlspecialchars($this->_doc->getTitle(), ENT_COMPAT, 'UTF-8') . '</title>'; | ||
|
||
// Generate link declarations | ||
foreach ($this->_doc->_links as $link => $linkAtrr) | ||
{ | ||
$buffer .= '<link href="' . $link . '" ' . $linkAtrr['relType'] . '="' . $linkAtrr['relation'] . '"'; | ||
|
||
if (\is_array($linkAtrr['attribs'])) | ||
{ | ||
if ($temp = ArrayHelper::toString($linkAtrr['attribs'])) | ||
{ | ||
$buffer .= ' ' . $temp; | ||
} | ||
} | ||
|
||
$buffer .= '>'; | ||
} | ||
|
||
return ltrim($buffer); | ||
} | ||
} |
Oops, something went wrong.