Skip to content

Commit

Permalink
Merge branch '4.1-dev' into Bootstrap_collapse_for_child_sub-categories
Browse files Browse the repository at this point in the history
  • Loading branch information
Denitz committed Feb 23, 2022
2 parents ed88e54 + 52553bf commit faacdae
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 51 deletions.
2 changes: 1 addition & 1 deletion administrator/language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ JGLOBAL_BLOG="Blog"
JGLOBAL_BLOG_ACROSS_OPTION="Across"
JGLOBAL_BLOG_CLASS="Article Class"
JGLOBAL_BLOG_CLASS_LEADING="Leading Article Class"
JGLOBAL_BLOG_CLASS_NOTE_DESC="You can add any CSS class for your own styling ideas.<br>Add a border on top with class boxed.<br>For image position use for example image-left, image-right. Add image-alternate for alternative ordering of intro-images."
JGLOBAL_BLOG_CLASS_NOTE_DESC="You can add any CSS class for your own styling ideas.<br>Add a border on top with class boxed.<br>For image position use for example image-left, image-right. Add image-alternate for alternate ordering of intro images."
JGLOBAL_BLOG_DOWN_OPTION="Down"
JGLOBAL_BLOG_LAYOUT_OPTIONS="Blog Layout"
JGLOBAL_CATEGORIES_OPTIONS="Categories"
Expand Down
19 changes: 16 additions & 3 deletions build/build-modules-js/init/recreate-media.es6.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const { existsSync } = require('fs');
const { readdir } = require('fs').promises;
const { stat, copy, emptyDirSync } = require('fs-extra');
const {
stat, copy, existsSync, emptyDirSync,
} = require('fs-extra');
const {
readFile, writeFile, readdir,
} = require('fs').promises;
const { join, extname } = require('path');
const recursive = require('recursive-readdir');

const RootPath = process.cwd();
const knownDirs = [
Expand Down Expand Up @@ -70,4 +74,13 @@ module.exports.recreateMediaFolder = async (options) => {
};

await copy(join(RootPath, 'build/media_source'), join(RootPath, 'media'), { filter: filterFunc, preserveTimestamps: true });

const SCSSMediafolders = await recursive(join(RootPath, 'media/templates'), ['!*.+(scss)']);

// Patch the scss files
Object.keys(SCSSMediafolders).forEach(async (file) => {
const contents = await readFile(SCSSMediafolders[file], 'utf8');
// Transform this `../../../../../../media/` to `../../../../`
await writeFile(SCSSMediafolders[file], contents.replace(/\.\.\/\.\.\/\.\.\/\.\.\/\.\.\/\.\.\/media\//g, '../../../../'));
});
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Awesomplete
@import "../../../../../../../../node_modules/awesomplete/awesomplete";
@import "../../../../../../../../media/vendor/awesomplete/css/awesomplete";

.awesomplete {
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@import "../../../../../../../../media/vendor/bootstrap/scss/mixins";

// choices.js
@import "../../../../../../../../node_modules/choices.js/src/styles/choices";
@import "../../../../../../../../media/vendor/choicesjs/scss/choices";

.choices {
border: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../../variables";
@import "../../../../../../../../node_modules/joomla-ui-custom-elements/dist/css/joomla-alert";
@import "../../../../../../../../media/vendor/joomla-custom-elements/css/joomla-alert";

// The following is a restyle for the system alerts

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Minicolours
@import "../../../../../../../../node_modules/@claviska/jquery-minicolors/jquery.minicolors";
@import "../../../../../../../../media/vendor/minicolors/css/jquery.minicolors";

.minicolors-theme-bootstrap {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@
}
}

.image-left &,
.image-right & {
flex-direction: row;
.item-image {
flex: 1 0 40%;
}
}

.item-image {
margin-top: 3px;
margin-bottom: 15px;
Expand All @@ -142,8 +134,10 @@
margin-bottom: 0;
}

.image-right & {
order: 1;
@include media-breakpoint-up(lg) {
.image-right & {
order: 1;
}
}

.image-bottom & {
Expand All @@ -168,6 +162,12 @@

@include media-breakpoint-up(lg) {
flex-direction: row;
.item-image {
flex: 1 0 40%;
}
.item-content {
flex: 1 0 60%;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion layouts/joomla/form/field/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
input-name=".field-user-input-name"
button-select=".button-select">
<div class="input-group">
<input <?php echo ArrayHelper::toString($inputAttributes), $dataAttribute; ?> readonly>
<input <?php echo ArrayHelper::toString($inputAttributes), $dataAttribute; ?> readonly>
<?php if (!$readonly) : ?>
<button type="button" class="btn btn-primary button-select" title="<?php echo Text::_('JLIB_FORM_CHANGE_USER'); ?>">
<span class="icon-user icon-white" aria-hidden="true"></span>
Expand Down
40 changes: 8 additions & 32 deletions plugins/fields/media/tmpl/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,22 @@
*/
defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Layout\LayoutHelper;

if (empty($field->value) || empty($field->value['imagefile']))
{
return;
}

$class = $fieldParams->get('image_class');
$class = $fieldParams->get('image_class');
$options = [
'src' => $field->value['imagefile'],
'alt' => empty($field->value['alt_text']) && empty($field->value['alt_empty']) ? false : $field->value['alt_text'],
];

if ($class)
{
$class = ' class="' . htmlentities($class, ENT_COMPAT, 'UTF-8', true) . '"';
$options['class'] = $class;
}

$value = $field->value;

if ($value)
{
$img = HTMLHelper::cleanImageURL($value['imagefile']);
$imgUrl = htmlentities($img->url, ENT_COMPAT, 'UTF-8', true);
$alt = empty($value['alt_text']) && empty($value['alt_empty']) ? '' : ' alt="' . htmlspecialchars($value['alt_text'], ENT_COMPAT, 'UTF-8') . '"';

if ($img->attributes['width'] > 0 && $img->attributes['height'] > 0)
{
$buffer = sprintf('<img loading="lazy" width="%s" height="%s" src="%s"%s%s>',
$img->attributes['width'],
$img->attributes['height'],
$imgUrl,
$class,
$alt
);
}
else
{
$buffer = sprintf('<img src="%s"%s%s>',
$imgUrl,
$class,
$alt
);
}

echo $buffer;
}
echo LayoutHelper::render('joomla.html.image', $options);

0 comments on commit faacdae

Please sign in to comment.