Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.2.9 #154

Merged
merged 31 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cd612b3
Add some basic shaming scripts and styles
bjcfuller Apr 9, 2019
f522386
Align shame messages to elements better
bjcfuller Apr 9, 2019
9bf96ab
Some more shame message positioning tweaks
bjcfuller Apr 9, 2019
b017338
Shame for local file img src's and shame for linking to PDFs
bjcfuller Apr 9, 2019
ebc0d75
Code style fixes
bjcfuller Apr 9, 2019
4d79914
Switch from gulp-uglify to gulp-terser for js minifying. gulp-terser…
bjcfuller Apr 10, 2019
e96ba3c
Restructure shame script to use helper functions; use mixins for styl…
bjcfuller Apr 10, 2019
82ce58e
Add some more file type checks
bjcfuller Apr 10, 2019
58000fb
Style shame messages a bit more; relocate the status message and add …
bjcfuller Apr 10, 2019
40096a6
Only show the status message if there are critical errors
bjcfuller Apr 10, 2019
b37383b
Shame font tags and inline styles
bjcfuller Apr 10, 2019
4e74799
Move shaming of deprecated tags to their own function
bjcfuller Apr 10, 2019
40de655
Add ability to display multiple issues for an element; add shaming fo…
bjcfuller Apr 11, 2019
7904f64
Fix onmouseover error message; tweak message styles and collapse mult…
bjcfuller Apr 11, 2019
1fd52e6
Fix code styles
bjcfuller Apr 11, 2019
24738b2
Remove collapsing of multiple messages; close error messages by defau…
bjcfuller Apr 11, 2019
7799c0a
Add dropdown arrows to messages
bjcfuller Apr 11, 2019
b5e9755
Clean up css a little
bjcfuller Apr 11, 2019
bb48611
Allow beta features to be individually turned on via the customizer, …
bjcfuller Apr 22, 2019
ed4690f
Merge pull request #152 from uriweb/release-1.2.8
bjcfuller Apr 25, 2019
39fe2e9
Reinstall devDependencies and recompile
bjcfuller Apr 26, 2019
a7c1d4a
Enable beta features based on user role instead of global var
bjcfuller Apr 26, 2019
61c9c0c
Rewrite function that checks user role... no longer returns role, but…
bjcfuller Apr 26, 2019
488f3aa
Merge branch 'feat-shaming' into develop
bjcfuller Apr 26, 2019
30ac07f
checks referrer environment value in get_current_path before using it…
May 9, 2019
dfb953c
adds margin to allow for drop shadow on program oembeds
May 10, 2019
b23116f
Add bottom padding to google search result blocks; fix code styles
bjcfuller May 10, 2019
a9e52df
Add style customizations for the super panel component
bjcfuller May 16, 2019
3d1feb7
Bump version to 1.2.9
bjcfuller May 21, 2019
1ab5da8
Update devDependencies
bjcfuller May 21, 2019
48efc42
Update readme
bjcfuller May 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# URI Modern

URI Modern is a WordPress theme designed for the University of Rhode Island. It's designed to replace all themes currently being used on the university's websites, and unify the online brand and experience.
URI Modern is a WordPress theme designed for the University of Rhode Island. It's designed to replace all themes currently being used on the university's websites, and unify the online brand and experience.

## What's new in 1.2.8
## What's new in 1.2.9

URI Modern 1.2.8 is a bug fix release.
URI Modern 1.2.9 is a bug fix release.

* Adds support for styling text with `type-sans` and `type-serif` classes
* Adds definitions for allowed Gutenberg blocks and colors
* Updates the Search & Filter template to adopt generic styling
* Adds style customizations for [URI Component Library](https://github.com/uriweb/uri-component-library) panels formatted as "super"
* Reconfigures how beta features are accessed (no longer requires editing `wp-config.php`)
* Introduces accessibility and code error checking as a beta feature (availability based on user role)
* Updates devDependencies

For complete details, see the [commit history](https://github.com/uriweb/uri-modern/pull/151/commits) and the [issue tracker](https://github.com/uriweb/uri-modern/issues).
For complete details, see the [commit history](https://github.com/uriweb/uri-modern/pull/154/commits) and the [issue tracker](https://github.com/uriweb/uri-modern/issues).

## How do I get set up?

Expand All @@ -33,4 +33,4 @@ Contributors: Brandon Fuller, John Pennypacker
Tags: themes
Requires at least: 4.0
Tested up to: 5.0
Stable tag: 1.2.8
Stable tag: 1.2.9
34 changes: 32 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,20 @@ function uri_modern_scripts() {
'is' => array(
'404' => is_404(),
'childTheme' => get_template_directory_uri() != get_stylesheet_directory_uri() ? true : false,
'admin' => uri_modern_has_admin_privilages(),
),
'features' => array(
'betaShaming' => false,
),
);

/**
* Enable ADA and code compliance shaming
*/
if ( get_option( 'beta_shaming' ) ) {
$values['features']['betaShaming'] = true;
}

wp_enqueue_style( 'uri-modern-style', get_template_directory_uri() . '/style.css', array(), uri_modern_cache_buster(), 'all' );

wp_enqueue_script( 'uri-modern-navigation', get_template_directory_uri() . '/js/navigation.js', array(), uri_modern_cache_buster(), true );
Expand All @@ -399,7 +410,7 @@ function uri_modern_scripts() {
/**
* Enable styles in the WYSIWYG Editor (BETA FEATURE)
*/
if ( defined( 'URI_BETA_FEATURES' ) && URI_BETA_FEATURES === true ) {
if ( get_option( 'beta_editor_theme_styles' ) ) {

if ( is_admin() ) {
add_editor_style( get_template_directory_uri() . '/style.css', __FILE__ );
Expand All @@ -418,7 +429,7 @@ function uri_modern_scripts() {
*/
function uri_modern_get_current_path( $strip = true ) {

if ( strpos( $_SERVER['HTTP_REFERER'], 'wp-admin/customize.php' ) === false ) {
if ( ! isset( $_SERVER['HTTP_REFERER'] ) || strpos( $_SERVER['HTTP_REFERER'], 'wp-admin/customize.php' ) === false ) {
$current_path = trim( $_SERVER['REQUEST_URI'] );
} else {
// when the Customizer is being used, we need to use the referrer
Expand Down Expand Up @@ -544,6 +555,25 @@ function uri_modern_get_field() {
}


/**
* Get user role
*/
function uri_modern_has_admin_privilages() {

$admin = false;

global $current_user;
$role = array_shift( $current_user->roles );

if ( 'administrator' == $role || 'Webadmin' == $role ) {
$admin = true;
}

return $admin;

}


/**
* Enable shortcodes in text widgets
*/
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var imagemin = require('gulp-imagemin');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var stripDebug = require('gulp-strip-debug');
var uglify = require('gulp-uglify');
var terser = require('gulp-terser');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('autoprefixer');
Expand Down Expand Up @@ -67,7 +67,7 @@ function scripts(done) {
gulp.src('./src/js/*.js')
.pipe(concat('script.min.js'))
//.pipe(stripDebug())
.pipe(uglify())
.pipe(terser())
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('./js/')) // Pipe to main
.pipe(rename('script.static.min.js'))
Expand Down
Binary file added images/errors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ function uri_modern_customize_register( $wp_customize ) {
uri_modern_options_site_footer( $wp_customize );
uri_modern_options_posts( $wp_customize );
uri_modern_options_breadcrumbs( $wp_customize );

if ( uri_modern_has_admin_privilages() ) {
uri_modern_options_beta_features( $wp_customize );
}
}
add_action( 'customize_register', 'uri_modern_customize_register' );

Expand Down Expand Up @@ -349,6 +353,70 @@ function uri_modern_options_posts( $wp_customize ) {

}

/**
* Creates options for beta features
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function uri_modern_options_beta_features( $wp_customize ) {

// Add section for post options.
$wp_customize->add_section(
'uri_modern_customizer_beta_features',
array(
'title' => __( 'Beta Features', 'uri' ),
'priority' => 200,
)
);

/* Use theme styles in the editor */
$wp_customize->add_setting(
'beta_editor_theme_styles',
array(
'default' => '',
'type' => 'option',
'sanitize_callback' => 'uri_modern_validate_checkbox',
)
);

$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'beta_editor_theme_styles',
array(
'section' => 'uri_modern_customizer_beta_features',
'label' => __( 'Editor styles', 'uri' ),
'description' => __( 'Use theme styles in the visual editor', 'uri' ),
'type' => 'checkbox',
)
)
);

/* Show shaming */
$wp_customize->add_setting(
'beta_shaming',
array(
'default' => '',
'type' => 'option',
'sanitize_callback' => 'uri_modern_validate_checkbox',
)
);

$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'beta_shaming',
array(
'section' => 'uri_modern_customizer_beta_features',
'label' => __( 'Show shaming', 'uri' ),
'description' => __( 'Show errors with ADA compliance and other coding issues', 'uri' ),
'type' => 'checkbox',
)
)
);

}


/**
* Creates options for breadcrumbs
Expand Down
11 changes: 7 additions & 4 deletions inc/get-breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ function uri_modern_breadcrumbs_get_link( $path ) {

if ( 0 !== $post_id ) { // it's a post or a page.
$p = get_page_by_path( $path );
$output = array(
'name' => get_the_title( $p->ID ),
'href' => get_site_url() . $path,
);
$output = null;
if ( is_object( $p ) ) {
$output = array(
'name' => get_the_title( $p->ID ),
'href' => get_site_url() . $path,
);
}
return $output;
}

Expand Down
6 changes: 3 additions & 3 deletions js/script.min.js

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

2 changes: 1 addition & 1 deletion map/style.css.map

Large diffs are not rendered by default.

Loading