Browse Source

Varia: Removing obsolte scripts and functions.

Allan Cole 5 years ago
parent
commit
e21bc475a1

+ 0 - 12
varia/inc/template-functions.php

@@ -35,11 +35,6 @@ function varia_body_classes( $classes ) {
 		$classes[] = 'hfeed';
 	}
 
-	// Adds a class if image filters are enabled.
-	if ( varia_image_filters_enabled() ) {
-		$classes[] = 'image-filters-enabled';
-	}
-
 	return $classes;
 }
 add_filter( 'body_class', 'varia_body_classes' );
@@ -114,13 +109,6 @@ function varia_can_show_post_thumbnail() {
 	return apply_filters( 'varia_can_show_post_thumbnail', ! post_password_required() && ! is_attachment() && has_post_thumbnail() );
 }
 
-/**
- * Returns true if image filters are enabled on the theme options.
- */
-function varia_image_filters_enabled() {
-	return 0 !== get_theme_mod( 'image_filter', 1 );
-}
-
 /**
  * Returns the size for avatars used in the theme.
  */

+ 0 - 30
varia/js/customize-controls.js

@@ -1,30 +0,0 @@
-/**
- * File customizer.js.
- *
- * Theme Customizer enhancements for a better user experience.
- *
- * Contains handlers to make Theme Customizer preview reload changes asynchronously.
- */
-
-(function() {
-
-	wp.customize.bind( 'ready', function() {
-
-		// Only show the color hue control when there's a custom primary color.
-		wp.customize( 'primary_color', function( setting ) {
-			wp.customize.control( 'primary_color_hue', function( control ) {
-				var visibility = function() {
-					if ( 'custom' === setting.get() ) {
-						control.container.slideDown( 180 );
-					} else {
-						control.container.slideUp( 180 );
-					}
-				};
-
-				visibility();
-				setting.bind( visibility );
-			});
-		});
-	});
-
-})( jQuery );

+ 0 - 60
varia/js/customize-preview.js

@@ -1,60 +0,0 @@
-/**
- * File customizer.js.
- *
- * Theme Customizer enhancements for a better user experience.
- *
- * Contains handlers to make Theme Customizer preview reload changes asynchronously.
- */
-
-(function( $ ) {
-
-	// Primary color.
-	wp.customize( 'primary_color', function( value ) {
-		value.bind( function( to ) {
-			// Update custom color CSS.
-			var style = $( '#custom-theme-colors' ),
-				hue = style.data( 'hue' ),
-				css = style.html(),
-				color;
-
-			if( 'custom' === to ){
-				// If a custom primary color is selected, use the currently set primary_color_hue
-				color = wp.customize.get().primary_color_hue;
-			} else {
-				// If the "default" option is selected, get the default primary_color_hue
-				color = VariaPreviewData.default_hue;
-			}
-
-			// Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed.
-			css = css.split( hue + ',' ).join( color + ',' );
-			style.html( css ).data( 'hue', color );
-		});
-	});
-
-	// Primary color hue.
-	wp.customize( 'primary_color_hue', function( value ) {
-		value.bind( function( to ) {
-
-			// Update custom color CSS.
-			var style = $( '#custom-theme-colors' ),
-				hue = style.data( 'hue' ),
-				css = style.html();
-
-			// Equivalent to css.replaceAll, with hue followed by comma to prevent values with units from being changed.
-			css = css.split( hue + ',' ).join( to + ',' );
-			style.html( css ).data( 'hue', to );
-		});
-	});
-
-	// Image filter.
-	wp.customize( 'image_filter', function( value ) {
-		value.bind( function( to ) {
-			if ( to ) {
-				$( 'body' ).addClass( 'image-filters-enabled' );
-			} else {
-				$( 'body' ).removeClass( 'image-filters-enabled' );
-			}
-		} );
-	} );
-
-})( jQuery );

+ 0 - 1
varia/js/skip-link-focus-fix-min.js

@@ -1 +0,0 @@
-/(trident|msie)/i.test(navigator.userAgent)&&document.getElementById&&window.addEventListener&&window.addEventListener("hashchange",function(){var t,e=location.hash.substring(1);/^[A-z0-9_-]+$/.test(e)&&(t=document.getElementById(e))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())},!1);

+ 0 - 33
varia/js/skip-link-focus-fix.js

@@ -1,33 +0,0 @@
-/**
- * File skip-link-focus-fix.js.
- *
- * Helps with accessibility for keyboard only users.
- *
- * This is the source file for what is minified in the varia_skip_link_focus_fix() PHP function.
- *
- * Learn more: https://git.io/vWdr2
- */
-( function() {
-	var isIe = /(trident|msie)/i.test( navigator.userAgent );
-
-	if ( isIe && document.getElementById && window.addEventListener ) {
-		window.addEventListener( 'hashchange', function() {
-			var id = location.hash.substring( 1 ),
-				element;
-
-			if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) {
-				return;
-			}
-
-			element = document.getElementById( id );
-
-			if ( element ) {
-				if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) {
-					element.tabIndex = -1;
-				}
-
-				element.focus();
-			}
-		}, false );
-	}
-} )();