Skip to content

Commit

Permalink
Integrated info notice type support. Improved a11y. Fixed RTL positio…
Browse files Browse the repository at this point in the history
…ning.
  • Loading branch information
sybrew committed Nov 7, 2019
1 parent d82ba5c commit efbea05
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 29 deletions.
2 changes: 1 addition & 1 deletion autodescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: The SEO Framework
* Plugin URI: https://theseoframework.com/
* Description: An automated, advanced, accessible, unbranded and extremely fast SEO solution for your WordPress website.
* Version: 4.0.3-dev-1
* Version: 4.0.3-dev-2
* Author: The SEO Framework Team
* Author URI: https://theseoframework.com/
* License: GPLv3
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function _do_upgrade_notice() {
[ 'a' ],
[ 'a_internal' => false ]
),
'updated',
'info',
false,
false
);
Expand Down Expand Up @@ -344,7 +344,7 @@ function _output_upgrade_notices() {

foreach ( $notices as $notice ) {
//* @TODO rtl?
\the_seo_framework()->do_dismissible_notice( 'SEO: ' . $notice, 'updated' );
\the_seo_framework()->do_dismissible_notice( 'SEO: ' . $notice, 'info' );
}
}

Expand Down
9 changes: 7 additions & 2 deletions inc/classes/admin-pages.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static function _do_settings_page_notices() {

case 'unchanged':
$message = \__( 'No SEO settings were changed, but the caches have been flushed.', 'autodescription' );
$type = 'warning';
$type = 'info';
break;

case 'reset':
Expand Down Expand Up @@ -353,6 +353,8 @@ public function field_id( $id, $echo = true ) {
* @since 2.6.0
* @since 3.0.6 The messages are no longer auto-styled to "strong".
* @since 4.0.0 Added a tabindex, so keyboard navigation is possible on the "empty" dashicon.
* @since 4.0.3 1. Keyboard navigation is now supported on the dismiss icon.
* 2. The info notice type is now supported.
*
* @param string $message The notice message. Expected to be escaped if $escape is false.
* @param string $type The notice type : 'updated', 'error', 'warning'. Expected to be escaped.
Expand All @@ -372,6 +374,9 @@ public function generate_dismissible_notice( $message = '', $type = 'updated', $
if ( 'warning' === $type )
$type = 'notice-warning';

if ( 'info' === $type )
$type = 'notice-info';

$a11y = $a11y ? 'tsf-show-icon' : '';

return vsprintf(
Expand All @@ -381,7 +386,7 @@ public function generate_dismissible_notice( $message = '', $type = 'updated', $
( $a11y ? 'tsf-show-icon' : '' ),
( $escape ? \esc_html( $message ) : $message ),
sprintf(
'<a class="hide-if-no-tsf-js tsf-dismiss" title="%s" tabindex=0></a>',
'<a class="hide-if-no-tsf-js tsf-dismiss" href="javascript:;" title="%s"></a>',
\esc_attr__( 'Dismiss this notice', 'autodescription' )
),
]
Expand Down
2 changes: 1 addition & 1 deletion inc/functions/upgrade-suggestion.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function _suggest_extension_manager() {
[ 'a', 'strong' ],
[ 'a_internal' => false ]
),
'updated',
'info',
false,
false
);
Expand Down
2 changes: 1 addition & 1 deletion lib/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ body.rtl .tsf-top-wrap > h1 {
float: right;
}

body.rtl .tsf-top-button {
body.rtl .tsf-top-buttons {
float: left;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/css/settings.min.css

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

18 changes: 12 additions & 6 deletions lib/css/tsf.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,34 @@ body.rtl .tsf-notice.tsf-show-icon p:before {
}

.error.tsf-notice.tsf-show-icon p:before {
color: #dd3811;
color: #dc3232;
content: "\f534";
}

.notice-warning.tsf-notice.tsf-show-icon p:before {
color: #ffa01b;
color: #ffb900;
content: "\f227";
}

.notice-info.tsf-notice.tsf-show-icon p:before {
color: #00a0d2;
font-size: 16px;
content: "\f223";
}

.updated.tsf-notice.tsf-show-icon p:before {
color: #0cc34b;
color: #46b450;
font-size: 16px;
content: "\f147";
}

a.tsf-dismiss {
position: absolute;
top: 0;
right: 1px;
right: 0;
border: none;
margin: 0;
padding: 9px;
padding: 10px;
background: 0 0;
color: #72777c;
cursor: pointer;
Expand All @@ -72,7 +78,7 @@ a.tsf-dismiss {

body.rtl a.tsf-dismiss {
right: initial;
left: 1px;
left: 0;
}

a.tsf-dismiss:before {
Expand Down
Loading

0 comments on commit efbea05

Please sign in to comment.