From 1a5d00b986a5bd82f8d1b639b2d3f27564650bca Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Fri, 22 Nov 2013 22:41:21 +0000 Subject: [PATCH] Twenty Fourteen: standardize comment blocks and jQuery function wrapper calls in JavaScript files. Props seanchayes for initial patch, see #25946. git-svn-id: https://develop.svn.wordpress.org/trunk@26332 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyfourteen/js/customizer.js | 3 +-- .../themes/twentyfourteen/js/featured-content-admin.js | 8 ++++++-- src/wp-content/themes/twentyfourteen/js/functions.js | 7 +++++++ .../themes/twentyfourteen/js/keyboard-image-navigation.js | 7 +++++-- src/wp-content/themes/twentyfourteen/js/slider.js | 3 +-- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/wp-content/themes/twentyfourteen/js/customizer.js b/src/wp-content/themes/twentyfourteen/js/customizer.js index df2a8f7853..acfb5e21bd 100644 --- a/src/wp-content/themes/twentyfourteen/js/customizer.js +++ b/src/wp-content/themes/twentyfourteen/js/customizer.js @@ -1,9 +1,8 @@ /** - * Theme Customizer enhancements for a better user experience. + * Twenty Fourteen Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ - ( function( $ ) { // Site title and description. wp.customize( 'blogname', function( value ) { diff --git a/src/wp-content/themes/twentyfourteen/js/featured-content-admin.js b/src/wp-content/themes/twentyfourteen/js/featured-content-admin.js index 4385fb5fc7..74e0e2f0e9 100644 --- a/src/wp-content/themes/twentyfourteen/js/featured-content-admin.js +++ b/src/wp-content/themes/twentyfourteen/js/featured-content-admin.js @@ -1,4 +1,8 @@ +/** + * Twenty Fourteen Featured Content admin behavior: add a tag suggestion + * when changing the tag. + */ /* global ajaxurl:true */ -jQuery( function( $ ) { +( function( $ ) { $( '#customize-control-featured-content-tag-name input' ).suggest( ajaxurl + '?action=ajax-tag-search&tax=post_tag', { delay: 500, minchars: 2 } ); -} ); +} )( jQuery ); diff --git a/src/wp-content/themes/twentyfourteen/js/functions.js b/src/wp-content/themes/twentyfourteen/js/functions.js index fad6c00208..24802e516c 100644 --- a/src/wp-content/themes/twentyfourteen/js/functions.js +++ b/src/wp-content/themes/twentyfourteen/js/functions.js @@ -1,3 +1,10 @@ +/** + * Theme functions file + * + * Contains handlers for navigation, accessibility, header sizing + * footer widgets and Featured Content slider + * + */ ( function( $ ) { var body = $( 'body' ), _window = $( window ); diff --git a/src/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js b/src/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js index 736c378ed8..f1e2facda3 100644 --- a/src/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js +++ b/src/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js @@ -1,4 +1,7 @@ -jQuery( function( $ ) { +/** + * Twenty Fourteen keyboard support for image navigation. + */ +( function( $ ) { $( document ).on( 'keydown.twentyfourteen', function( e ) { var url = false; @@ -15,4 +18,4 @@ jQuery( function( $ ) { window.location = url; } } ); -} ); \ No newline at end of file +} )( jQuery ); \ No newline at end of file diff --git a/src/wp-content/themes/twentyfourteen/js/slider.js b/src/wp-content/themes/twentyfourteen/js/slider.js index 9c83d775e0..e06ae25223 100644 --- a/src/wp-content/themes/twentyfourteen/js/slider.js +++ b/src/wp-content/themes/twentyfourteen/js/slider.js @@ -1,11 +1,10 @@ -/* global DocumentTouch:true,setImmediate:true,featuredSliderDefaults:true,MSGesture:true */ /* * Twenty Fourteen Featured Content Slider * * Adapted from FlexSlider v2.2.0, copyright 2012 WooThemes * @link http://www.woothemes.com/flexslider/ */ - +/* global DocumentTouch:true,setImmediate:true,featuredSliderDefaults:true,MSGesture:true */ ( function( $ ) { // FeaturedSlider: object instance. $.featuredslider = function( el, options ) {