Skip to content

Commit

Permalink
Merge pull request #174 from RRZE-Webteam/dev
Browse files Browse the repository at this point in the history
v1.22.4
  • Loading branch information
cassandre authored Feb 28, 2022
2 parents c27dcb2 + 99f0ea6 commit 5e56a5b
Show file tree
Hide file tree
Showing 12 changed files with 6,446 additions and 52 deletions.
8 changes: 7 additions & 1 deletion assets/css/_accordion.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ button.expand-all.standard-btn {
}
&.active:hover,
&.active:focus {
//border-color: var(--color-primary-dunkler, $colorDefaultDunkler);
border-color: var(--color-primary-dunkler, $colorDefaultDunkler);
background-color: var(--color-primary-dunkler, $colorDefaultDunkler);
color: var(--color-primary-ci-hell-kontrast, #fff);
}
Expand All @@ -90,6 +90,7 @@ button.expand-all.standard-btn {
&:hover,
&:focus,
&.active {
border-color: var(--color-phil-ci-hell, $colorPhilFak);
background-color: var(--color-phil-ci-hell, $colorPhilFak);
color: var(--color-phil-ci-hell-kontrast, #fff);
}
Expand All @@ -107,6 +108,7 @@ button.expand-all.standard-btn {
&:hover,
&:focus,
&.active {
border-color: var(--color-rw-ci-hell, $colorRwFak);
background-color: var(--color-rw-ci-hell, $colorRwFak);
color: var(--color-rw-ci-hell-kontrast, #fff);
}
Expand All @@ -124,6 +126,7 @@ button.expand-all.standard-btn {
&:hover,
&:focus,
&.active {
border-color: var(--color-med-ci-hell, $colorMedFak);
background-color: var(--color-med-ci-hell, $colorMedFak);
color: var(--color-med-ci-hell-kontrast, #fff);
}
Expand All @@ -141,6 +144,7 @@ button.expand-all.standard-btn {
&:hover,
&:focus,
&.active {
border-color: var(--color-nat-ci-hell, $colorNatFak);
background-color: var(--color-nat-ci-hell, $colorNatFak);
color: var(--color-nat-ci-hell-kontrast, #fff);
}
Expand All @@ -158,6 +162,7 @@ button.expand-all.standard-btn {
&:hover,
&:focus,
&.active {
border-color: var(--color-tf-ci-hell, $colorTechFak);
background-color: var(--color-tf-ci-hell, $colorTechFak);
color: var(--color-tf-ci-dunkel-kontrast, #fff);
}
Expand All @@ -174,6 +179,7 @@ button.expand-all.standard-btn {
&:hover,
&:focus,
&.active {
border-color: var(--color-zentral-ci-hell, $colorDefault);
background-color: var(--color-zentral-ci-hell, $colorDefault);
color: var(--color-zentral-ci-hell-kontrast, #fff);
}
Expand Down
14 changes: 14 additions & 0 deletions assets/css/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,22 @@ a.standard-btn {
}
&.black-btn {
background: $text;
color: #fff;
&:hover, &:focus, &:active {
background: darken($text, 12%);
color: #fff;
}
}
&.ghost-btn {
background: transparent;
color: var(--color-Text, $text);
border: 1px solid var(--color-ContentBorders, #dfe6ec);
&:hover, &:focus, &:active {
color: var(--color-ghostbutton-hover-text, #fff);
background: var(--color-ghostbutton-hover-bg, $primary);
}
.fau-events & {
border-width: 2px;
}
}
&.full-btn {
Expand Down
6,395 changes: 6,380 additions & 15 deletions assets/css/rrze-elements.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/rrze-elements.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/css/rrze-elements.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/rrze-elements.min.css.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions includes/Accordion/Accordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ public function shortcodeCollapse($atts, $content, $tag)
public static function enqueueScripts() {
wp_register_script(
'rrze-accordions',
//plugins_url('assets/js/rrze-accordion.min.js', plugin_basename(__FILE__)),
plugins_url('assets/js/rrze-accordion.js', plugin_basename(__FILE__)),
['jquery'],
plugins_url('assets/js/rrze-accordion.min.js', plugin_basename(__FILE__)),
//plugins_url('assets/js/rrze-accordion.js', plugin_basename(__FILE__)),
['jquery', 'wp-i18n'],
'1.0.0'
);
}
Expand Down
5 changes: 4 additions & 1 deletion includes/Accordion/assets/js/rrze-accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ jQuery(document).ready(function($) {
$($thisgroup).children('.accordion-heading').children('.accordion-toggle').toggleClass('active');
$($thisgroup).children('.accordion-body').slideToggle();
// refresh Slick Gallery
$($thisgroup).find("div.slick-slider").slick("refresh");
let $slick = $($thisgroup).find("div.slick-slider");
if ($slick.length < 0) {
$slick.slick("refresh");
}
}

function openAnchorAccordion($target) {
Expand Down
2 changes: 1 addition & 1 deletion includes/Accordion/assets/js/rrze-accordion.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 31 additions & 25 deletions includes/Button/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,45 @@ public function __construct()
*/
public function shortcodeButton($atts, $content = '')
{
extract(shortcode_atts([
'link' => '#',
'target' => '',
'color' => '',
'border_color' => '',
'size' => '',
'width' => '',
'style' => '',
'font' => '',
'title' => '',
], $atts));
$atts = shortcode_atts(
array(
'link' => '#',
'target' => '',
'color' => '',
'border_color' => '',
'size' => '',
'width' => '',
'style' => '',
'font' => '',
'title' => '',
'aria-label' => '',
), $atts );

$style = (in_array($style, ['success', 'info', 'warning', 'danger', 'primary'])) ? ' ' . $style . '-btn' : ' primary-btn';
$arialabel = $atts['aria-label'] != '' ? ' aria-label="' . sanitize_text_field($atts['aria-label']) . '"' : '';
/*if ($arialabel != '' && stripos($arialabel, $content) === false) {
return do_shortcode('[alert style="danger"]' . __('<strong>Button shortcode error</strong>: The button text ("' . $content . '") has to be included in the aria label ("' . sanitize_text_field($atts['aria-label']) . '"). ' , 'rrze-elements') . '[/alert]');
}*/
$style = (in_array($atts['style'], ['success', 'info', 'warning', 'danger', 'primary', 'ghost'])) ? ' ' . $atts['style'] . '-btn' : ' primary-btn';
$color_hex = '';
$color_name = '';

if ((substr($color, 0, 1) == '#') && (in_array(strlen($color), [4, 7]))) {
if ((substr($atts['color'], 0, 1) == '#') && (in_array(strlen($atts['color']), [4, 7]))) {
$color_name = '';
$color_hex = 'background-color:' . $color . ';';
$color_hex = 'background-color:' . $atts['color'] . ';';
$style = 'X';
}

if (in_array($color, ['red', 'yellow', 'blue', 'green', 'grey', 'black'])) {
$color_name = ' ' . $color . '-btn';
if (in_array($atts['color'], ['red', 'yellow', 'blue', 'green', 'grey', 'black'])) {
$color_name = ' ' . $atts['color'] . '-btn';
$style = 'Y';
}

$border_color = ((substr($border_color, 0, 1) == '#') && (in_array(strlen($border_color), [4, 7]))) ? ' border:1px solid' . $border_color . ';' : '';
$border_color = ((substr($atts['border_color'], 0, 1) == '#') && (in_array(strlen($atts['border_color']), [4, 7]))) ? ' border:1px solid' . $atts['border_color'] . ';' : '';

$size = ($size) ? ' ' . $size . '-btn' : '';
$target = ($target == 'blank') ? ' target="_blank"' : '';
$link = esc_url($link);
switch ($font) {
$size = ($atts['size']) ? ' ' . $atts['size'] . '-btn' : '';
$target = ($atts['target'] == 'blank') ? ' target="_blank"' : '';
$link = esc_url($atts['link']);
switch ($atts['font']) {
case 'dark':
$fontColor = ' color: #1a1a1a;';
break;
Expand All @@ -67,8 +73,8 @@ public function shortcodeButton($atts, $content = '')
default:
$fontColor = '';
}
$title = $title != '' ? ' title="' . sanitize_text_field($title) . '"' : '';
$width = trim($width);
$title = $atts['title'] != '' ? ' title="' . sanitize_text_field($atts['title']) . '"' : '';
$width = trim($atts['width']);
$width_full = '';
$width_px = '';
if ($width == 'full') {
Expand All @@ -79,11 +85,11 @@ public function shortcodeButton($atts, $content = '')
$width = $width . 'px';
}

if ('' != $color || '' != $fontColor) {
if ('' != $atts['color'] || '' != $fontColor) {
$style = '';
}

$output = '<a' . $target . $title . ' class="standard-btn' . $color_name . $size . $width_full . $style . '" href="' . $link . '" style="' . $fontColor . $color_hex . $width_px . $border_color . '"><span>' . do_shortcode($content) . '</span></a>';
$output = '<a' . $target . $title . $arialabel . ' class="standard-btn' . $color_name . $size . $width_full . $style . '" href="' . $link . '" style="' . $fontColor . $color_hex . $width_px . $border_color . '"><span>' . do_shortcode($content) . '</span></a>';

wp_enqueue_style('fontawesome');
wp_enqueue_style('rrze-elements');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rrze-elements",
"version": "1.22.1",
"version": "1.22.4",
"description": "RRZE Elements: Gestalterische Erweiterungen für Webauftritte.",
"main": "rrze-elements.php",
"textdomain": "rrze-elements",
Expand Down
2 changes: 1 addition & 1 deletion rrze-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: RRZE Elements
Plugin URI: https://github.com/RRZE-Webteam/rrze-elements
Description: Advanced design elements for WordPress websites.
Version: 1.22.3
Version: 1.22.4
Author: RRZE Webteam
Author URI: https://blogs.fau.de/webworking/
License: GNU General Public License v2
Expand Down

0 comments on commit 5e56a5b

Please sign in to comment.