Skip to content

Commit

Permalink
style(template): Update template
Browse files Browse the repository at this point in the history
  • Loading branch information
anibalsanchez committed Jan 16, 2023
1 parent 70d5705 commit bb7a886
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EXTENSION_DESC="XT Tailwind - My Blog template, based on Tailwind CSS."
EXTENSION_CDN="http://cdn.extly.com"
TRANSLATION_KEY="XTTAILWIND"

RELEASE_VERSION="7.1.0"
RELEASE_VERSION="8.0.0"

LICENSE="GNU General Public License version 3 or later; see LICENSE.txt"
LICENSE_CODE="GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html"
Expand Down
4 changes: 2 additions & 2 deletions .phan/config.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/*
* @package XT Search for Algolia
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down
11 changes: 6 additions & 5 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<?php

/**
/*
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2018-2022 Extly, CB. All rights reserved.
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @package XT Search for Algolia
* @see https://www.extly.com
*/

$header = <<<'EOF'
@package XT Tailwind for Joomla
@author Extly, CB. <[email protected]>
@copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
@copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
@license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
@see https://www.extly.com
Expand Down
4 changes: 2 additions & 2 deletions composer-with-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
}
],
"require": {
"php": ">=5.6",
"php": "^7.3 || ^8.0",
"anibalsanchez/extly-html-asset-tags-builder": "^1.7.0",
"anibalsanchez/xt-tailwind-for-joomla-template": "dev-master",
"doctrine/inflector": "~1.1.0",
"extly/xt-renderers-for-joomla": "^0.0.1",
"extly/xt-renderers-for-joomla": "^0.0.2",
"illuminate/support": "~5.4.0",
"mnsami/composer-custom-directory-installer": "^2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"php": "^7.3 || ^8.0",
"anibalsanchez/extly-html-asset-tags-builder": "^1.7.0",
"doctrine/inflector": "~1.1.0",
"extly/xt-renderers-for-joomla": "^0.0.1",
"extly/xt-renderers-for-joomla": "^0.0.2",
"illuminate/support": "~5.4.0",
"mnsami/composer-custom-directory-installer": "^2.0"
},
Expand Down
24 changes: 4 additions & 20 deletions library/src/Infrastructure/Service/Cms/Joomla/ScriptHelper.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

/*
* @package Extly Infrastructure Support for Joomla
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2021 Extly, CB. All rights reserved.
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
*/
Expand All @@ -29,6 +29,7 @@
final class ScriptHelper
{
const CLIENT_FRONTEND = 1;

const CLIENT_ADMINISTRATOR = 0;

public static function addScriptDeclaration($script)
Expand Down Expand Up @@ -68,7 +69,6 @@ public static function addStyleDeclaration($style)
*
* @param string $extensionScript Param
* @param mixed $attribs Html Attributes
* @param mixed $options
*/
public static function addDeferredExtensionScript($extensionScript, $options = [], $attribs = [])
{
Expand Down Expand Up @@ -104,7 +104,6 @@ public static function addDeferredExtensionStylesheet($extensionRelativeScript,
*
* @param string $extensionScriptUri Param
* @param mixed $attribs Html Attributes
* @param mixed $options
*/
public static function addDeferredScript($extensionScriptUri, $options = [], $attribs = [])
{
Expand Down Expand Up @@ -134,8 +133,6 @@ public static function addDeferredScript($extensionScriptUri, $options = [], $at
* ScriptHelper::addDeferredStylesheet('https://cdn.jsdelivr.net/npm/...instantsearch.min.css');
*
* @param string $stylesheetUri Param
* @param mixed $options
* @param mixed $attribs
*/
public static function addDeferredStylesheet($stylesheetUri, $options = [], $attribs = [])
{
Expand All @@ -161,10 +158,6 @@ public static function addDeferredStylesheet($stylesheetUri, $options = [], $att
* addInlineScript (Extension).
*
* Example: ScriptHelper::addInlineScript('lib_xtdir4alg/app/autocomplete.min.js');
*
* @param mixed $extensionRelativeScript
* @param mixed $options
* @param mixed $attribs
*/
public static function addInlineExtensionScript($extensionRelativeScript, $options = [], $attribs = [])
{
Expand Down Expand Up @@ -197,11 +190,6 @@ public static function addInlineExtensionScript($extensionRelativeScript, $optio
* addInlineStylesheet.
*
* Example: ScriptHelper::addInlineStylesheet('mod_xtdir4alg_autocomplete/xtdir4alg_autocomplete.min.css');
*
* @param string $extensionStyle
* @param mixed $extensionRelativeStylesheet
* @param mixed $options
* @param mixed $attribs
*/
public static function addInlineExtensionStylesheet($extensionRelativeStylesheet, $options = [], $attribs = [])
{
Expand Down Expand Up @@ -310,10 +298,6 @@ public static function addScriptVersion($url, $options = [], $attribs = [])
* addDeferredStyle.
*
* @deprecated
*
* @param mixed $stylesheetUri
* @param mixed $options
* @param mixed $attribs
*/
public static function addDeferredStyle($stylesheetUri, $options = [], $attribs = [])
{
Expand Down
2 changes: 1 addition & 1 deletion template/.phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down
4 changes: 2 additions & 2 deletions template/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand All @@ -14,7 +14,7 @@
@package XT Tailwind for Joomla
@author Extly, CB. <[email protected]>
@copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
@copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
@license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
@see https://www.extly.com
Expand Down
2 changes: 1 addition & 1 deletion template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ npm run prod

## Copyright & License

- Copyright (c)2012-2022 Extly, CB. All rights reserved.
- Copyright (c)2012-2023 Extly, CB. All rights reserved.
- Distributed under the GNU General Public License version 3 or later; see LICENSE
- This project is dedicated to [Andrea Gentil](http://www.twitter.com/andreagentil) ;-D
14 changes: 7 additions & 7 deletions template/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down Expand Up @@ -54,17 +54,17 @@
// Add template js - JavaScript to be deferred - Removed to Optimize
// $templateJsFile = CMSHTMLHelper::script('template.js', ['relative' => true, 'pathOnly' => true]);
// $templateJsFile = $templateJsFile.'?'.$mediaversion;
// $htmlAssetRepository->push(ScriptTag::create(ScriptHelper::addMediaVersion($templateJsFile)));
// $htmlAssetRepository->push(new ScriptTag(ScriptHelper::addMediaVersion($templateJsFile)));

// Add template.css
$templateCssFile = CMSHTMLHelper::stylesheet('template.css', ['relative' => true, 'pathOnly' => true]);
$htmlAssetRepository->push(LinkCriticalStylesheetTag::create(ScriptHelper::addMediaVersion($templateCssFile)));
$htmlAssetRepository->push(new LinkCriticalStylesheetTag(ScriptHelper::addMediaVersion($templateCssFile)));

// Additional inline head scripts
$headScripts = $params->get('headScripts');

if (!empty($headScripts)) {
$htmlAssetRepository->push(InlineScriptTag::create($headScripts));
$htmlAssetRepository->push(new InlineScriptTag($headScripts));
}

$headData = $document->getHeadData();
Expand All @@ -73,13 +73,13 @@

// Prism - Deferred Stylesheet
$prismCssFile = CMSHTMLHelper::stylesheet('prism.css', ['relative' => true, 'pathOnly' => true]);
$htmlAssetRepository->push(LinkStylesheetTag::create(ScriptHelper::addMediaVersion($prismCssFile)));
$htmlAssetRepository->push(new LinkStylesheetTag(ScriptHelper::addMediaVersion($prismCssFile)));

// Prism - Deferred JavaScript
$prismJsFile = CMSHTMLHelper::script('prism.js', ['relative' => true, 'pathOnly' => true]);
$htmlAssetRepository->push(ScriptTag::create(ScriptHelper::addMediaVersion($prismJsFile)));
$htmlAssetRepository->push(new ScriptTag(ScriptHelper::addMediaVersion($prismJsFile)));

$htmlAssetRepository->push(ScriptTag::create('https://buttons.github.io/buttons.js'));
$htmlAssetRepository->push(new ScriptTag('https://buttons.github.io/buttons.js'));

$logoTitle = htmlspecialchars($params->get('logoTitle', '@Anibal_Sanchez'));
$siteDescription = htmlspecialchars($params->get('siteDescription'), \ENT_QUOTES, 'UTF-8');
Expand Down
10 changes: 5 additions & 5 deletions template/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down Expand Up @@ -59,17 +59,17 @@
// Add template js - JavaScript to be deferred - Removed to Optimize
// $templateJsFile = CMSHTMLHelper::script('template.js', ['relative' => true, 'pathOnly' => true]);
// $templateJsFile = $templateJsFile.'?'.$mediaversion;
// $htmlAssetRepository->push(ScriptTag::create(ScriptHelper::addMediaVersion($templateJsFile)));
// $htmlAssetRepository->push(new ScriptTag(ScriptHelper::addMediaVersion($templateJsFile)));

// Add template.css
$templateCssFile = CMSHTMLHelper::stylesheet('template.css', ['relative' => true, 'pathOnly' => true]);
$htmlAssetRepository->push(LinkCriticalStylesheetTag::create(ScriptHelper::addMediaVersion($templateCssFile)));
$htmlAssetRepository->push(new LinkCriticalStylesheetTag(ScriptHelper::addMediaVersion($templateCssFile)));

// Additional inline head scripts
$headScripts = $params->get('headScripts');

if (!empty($headScripts)) {
$htmlAssetRepository->push(InlineScriptTag::create($headScripts));
$htmlAssetRepository->push(new InlineScriptTag($headScripts));
}

$headData = $document->getHeadData();
Expand All @@ -90,7 +90,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<base href="<?php echo CMSUri::current(); ?>">
<?php
echo HtmlAssetTagsBuilder::create()->generate(HtmlAssetRepository::GLOBAL_POSITION_HEAD);
echo (new HtmlAssetTagsBuilder())->generate(HtmlAssetRepository::GLOBAL_POSITION_HEAD);
?>
</head>

Expand Down
2 changes: 1 addition & 1 deletion template/html/com_content/article/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down
2 changes: 1 addition & 1 deletion template/html/com_content/featured/default_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down
2 changes: 1 addition & 1 deletion template/html/layouts/joomla/pagination/link.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down
16 changes: 8 additions & 8 deletions template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package XT Tailwind for Joomla
*
* @author Extly, CB. <[email protected]>
* @copyright Copyright (c)2012-2022 Extly, CB. All rights reserved.
* @copyright Copyright (c)2012-2023 Extly, CB. All rights reserved.
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
*
* @see https://www.extly.com
Expand Down Expand Up @@ -54,17 +54,17 @@
// Add template js - JavaScript to be deferred - Removed to Optimize
// $templateJsFile = CMSHTMLHelper::script('template.js', ['relative' => true, 'pathOnly' => true]);
// $templateJsFile = $templateJsFile.'?'.$mediaversion;
// $htmlAssetRepository->push(ScriptTag::create(ScriptHelper::addMediaVersion($templateJsFile)));
// $htmlAssetRepository->push(new ScriptTag(ScriptHelper::addMediaVersion($templateJsFile)));

// Add template.css
$templateCssFile = CMSHTMLHelper::stylesheet('template.css', ['relative' => true, 'pathOnly' => true]);
$htmlAssetRepository->push(LinkCriticalStylesheetTag::create(ScriptHelper::addMediaVersion($templateCssFile)));
$htmlAssetRepository->push(new LinkCriticalStylesheetTag(ScriptHelper::addMediaVersion($templateCssFile)));

// Additional inline head scripts
$headScripts = $params->get('headScripts');

if (!empty($headScripts)) {
$htmlAssetRepository->push(InlineScriptTag::create($headScripts));
$htmlAssetRepository->push(new InlineScriptTag($headScripts));
}

$headData = $document->getHeadData();
Expand All @@ -73,13 +73,13 @@

// Prism - Deferred Stylesheet
$prismCssFile = CMSHTMLHelper::stylesheet('prism.css', ['relative' => true, 'pathOnly' => true]);
$htmlAssetRepository->push(LinkStylesheetTag::create(ScriptHelper::addMediaVersion($prismCssFile)));
$htmlAssetRepository->push(new LinkStylesheetTag(ScriptHelper::addMediaVersion($prismCssFile)));

// Prism - Deferred JavaScript
$prismJsFile = CMSHTMLHelper::script('prism.js', ['relative' => true, 'pathOnly' => true]);
$htmlAssetRepository->push(ScriptTag::create(ScriptHelper::addMediaVersion($prismJsFile)));
$htmlAssetRepository->push(new ScriptTag(ScriptHelper::addMediaVersion($prismJsFile)));

$htmlAssetRepository->push(ScriptTag::create('https://buttons.github.io/buttons.js'));
$htmlAssetRepository->push(new ScriptTag('https://buttons.github.io/buttons.js'));

$logoTitle = htmlspecialchars($params->get('logoTitle', '@Anibal_Sanchez'));
$siteDescription = htmlspecialchars($params->get('siteDescription'), \ENT_QUOTES, 'UTF-8');
Expand Down Expand Up @@ -191,4 +191,4 @@
<jdoc:include type="XTHtmlAssetsBody" name="body" style="none" />
</body>

</html>
</html>
2 changes: 1 addition & 1 deletion template/language/en-GB/en-GB.tpl_xttailwind.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;
; Extly, CB <[email protected]>
; Copyright (c)2012-2022 Extly, CB All rights reserved.
; Copyright (c)2012-2023 Extly, CB All rights reserved.
; License GNU General Public License version 3 or later; see LICENSE.txt
;

Expand Down
2 changes: 1 addition & 1 deletion template/language/en-GB/en-GB.tpl_xttailwind.sys.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;
; Extly, CB <[email protected]>
; Copyright (c)2012-2022 Extly, CB All rights reserved.
; Copyright (c)2012-2023 Extly, CB All rights reserved.
; License GNU General Public License version 3 or later; see LICENSE.txt
;

Expand Down
Loading

0 comments on commit bb7a886

Please sign in to comment.