Changeset 1545989
- Timestamp:
- 12/05/2016 04:01:48 PM (9 years ago)
- Location:
- customizer-social-icons/trunk
- Files:
-
- 18 added
- 1 deleted
- 3 edited
-
assets/css/customizer-social-icons-controls.css (added)
-
assets/js/customizer-social-icons-display-colors.js (added)
-
assets/js/customizer-social-icons-live-preview.js (modified) (5 diffs)
-
autoload.php (added)
-
class-customizer-social-icons.php (deleted)
-
customizer-social-icons.php (modified) (1 diff)
-
includes (added)
-
includes/class-customizer-social-icons-configs.php (added)
-
includes/class-customizer-social-icons-customizer-menus.php (added)
-
includes/class-customizer-social-icons-customizer.php (added)
-
includes/class-customizer-social-icons-loader.php (added)
-
includes/class-customizer-social-icons-menus.php (added)
-
includes/class-customizer-social-icons-util.php (added)
-
includes/class-customizer-social-icons.php (added)
-
includes/configs (added)
-
includes/configs/base.config.php (added)
-
includes/configs/html.config.php (added)
-
includes/configs/i18n.config.php (added)
-
includes/configs/icon-sizes.config.php (added)
-
includes/configs/networks.config.php (added)
-
includes/interface-customizer-social-icons-configs.php (added)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
customizer-social-icons/trunk/assets/js/customizer-social-icons-live-preview.js
r1541221 r1545989 13 13 var self = CustomizerSocialIcons.LivePreview; 14 14 15 15 16 /** 16 17 * Initialize Social Media Icon Controls. 17 18 * 18 * @since 1.1.019 * @since 0.1 19 20 */ 20 21 self.initialize = function() { 22 $( document ).ready( self.onReady ); 21 23 self.iconSize(); 22 24 self.iconText(); 25 self.iconColor(); 26 self.iconColorSecondary(); 27 self.iconHoverColor(); 28 self.iconHoverColorSecondary(); 23 29 self.iconSpacing(); 30 31 }; 32 33 self.onReady = function() { 34 self.getSettings(); 35 }; 36 37 self.getSettings = function() { 38 wp.customize.bind( 'ready', _.defer( function() { 39 self.configs = { 40 iconStyle : api( 'customizer_social_icons_type_setting' )(), 41 hoverColor : api( 'customizer_social_icons_hover_color_setting' )(), 42 hoverColorSecondary : api( 'customizer_social_icons_hover_color_secondary_setting' )(), 43 currentColor : api( 'customizer_social_icons_color_setting' )(), 44 currentColorSecondary : api( 'customizer_social_icons_color_secondary_setting' )(), 45 }; 46 } ) ); 47 }; 48 49 /** 50 * Listen for hover. 51 * 52 * @since 0.3 53 */ 54 self.hover = function() { 55 $( '.menu-social' ); 56 var $icons, $stack, $openStack, selector, currentColor; 57 // Define selector for stacks or standard icons. 58 $icons = $( '.menu-social a' ); 59 $stack = $( '.menu-social' ).find( 'span.stack-closed' ).parent( 'a' ); 60 $openStack = $( '.menu-social' ).find( 'span.stack-open' ).parent( 'a' ); 61 if ( $stack.length ) { 62 selector = $stack; 63 selector.hover( 64 function( e ) { 65 // Set hover color. 66 $( e.currentTarget ).find( '.fa-inverse' ).css( 'color', self.configs.hoverColor ); 67 // Set hover color. 68 $( e.currentTarget ).find( 'i.fa:first-child' ).css( 'color', self.configs.hoverColorSecondary ); 69 }, 70 function( e ) { 71 // Reassign to the current secondary color. 72 $( e.currentTarget ).find( '.fa-inverse' ).css( 'color', self.configs.currentColor ); 73 // Set hover color. 74 $( e.currentTarget ).find( 'i.fa:first-child' ).css( 'color', self.configs.currentColorSecondary ); 75 } 76 ); 77 return; 78 } 79 selector = $icons; 80 if ( $openStack.length ) selector = $openStack; 81 selector.hover( 82 function( e ) { 83 // Set hover color. 84 $( e.currentTarget ).find( 'i.fa' ).css( 'color', self.configs.hoverColor ); 85 }, 86 function( e ) { 87 // Reassign to the current color. 88 $( e.currentTarget ).find( 'i.fa' ).css( 'color', self.configs.currentColor ); 89 } 90 ); 24 91 }; 25 92 … … 27 94 * Adjust Social Media Icon Size. 28 95 * 29 * @since 1.1.096 * @since 0.2 30 97 */ 31 98 self.iconSize = function() { … … 34 101 value.bind( function( to ) { 35 102 var $icons, $stack, selector; 36 37 103 // Define selector for stacks or standard icons. 38 104 $icons = $( '.menu-social' ).find( 'i.fa' ); … … 58 124 * Hide or Show Social Media Icon Text. 59 125 * 60 * @since 1.1.0126 * @since 0.2 61 127 */ 62 128 self.iconText = function() { … … 82 148 83 149 /** 150 * Adjust Social Media Icon Color. 151 * 152 * @since 0.3 153 */ 154 self.iconColor = function() { 155 // Set logo letter spacing on site title text live 156 api( 'customizer_social_icons_color_setting', function( value ) { 157 value.bind( function( to ) { 158 self.configs.currentColor = to; 159 var $icons = self.configs.iconStyle, selector; 160 161 if ( $icons === 'icon' ) { 162 selector = $( '.menu-social' ).find( 'i.fa' ); 163 } else if ( $icons === 'icon-square' || $icons === 'icon-circle' ) { 164 selector = $( '.menu-social' ).find( 'span.stack-closed > .fa-inverse' ); 165 } else { 166 selector = $( '.menu-social' ).find( 'span.fa-stack' ); 167 } 168 169 // Add color to selector. 170 selector.css( 'color', to ); 171 self.hover(); 172 } ); 173 } ); 174 }; 175 176 self.iconColorSecondary = function() { 177 // Set logo letter spacing on site title text live 178 api( 'customizer_social_icons_color_secondary_setting', function( value ) { 179 value.bind( function( to ) { 180 self.configs.currentColorSecondary = to; 181 var $icons = self.configs.iconStyle, selector; 182 selector = $( '.menu-social' ).find( 'span.stack-closed > i.fa:not(.fa-inverse)' ); 183 184 // Add color to selector. 185 selector.css( 'color', to ); 186 self.hover(); 187 } ); 188 } ); 189 }; 190 191 /** 192 * Adjust Social Media Icon Hover Color. 193 * 194 * @since 0.3 195 */ 196 self.iconHoverColor = function() { 197 // Set logo letter spacing on site title text live 198 api( 'customizer_social_icons_hover_color_setting', function( value ) { 199 value.bind( function( to ) { 200 // Update hover color. 201 self.configs.hoverColor = to; 202 self.hover(); 203 } ); 204 } ); 205 }; 206 207 /** 208 * Adjust Social Media Icon Hover Color. 209 * 210 * @since 0.3 211 */ 212 self.iconHoverColorSecondary = function() { 213 // Set logo letter spacing on site title text live 214 api( 'customizer_social_icons_hover_color_secondary_setting', function( value ) { 215 value.bind( function( to ) { 216 // Update hover color. 217 self.configs.hoverColorSecondary = to; 218 self.hover(); 219 } ); 220 } ); 221 }; 222 223 /** 84 224 * Adjust Social Media Icon Spacing. 85 225 * 86 * @since 1.1.0226 * @since 0.2 87 227 */ 88 228 self.iconSpacing = function() { -
customizer-social-icons/trunk/customizer-social-icons.php
r1540892 r1545989 28 28 * @package CustomizerSocialIcons 29 29 */ 30 // Include the autoloader 31 include_once wp_normalize_path( plugin_dir_path( __FILE__ ) . '/autoload.php' ); 30 32 31 require_once __DIR__ . '/class-customizer-social-icons.php';32 new Customizer_Social_Icons();33 $customizer_social_icons = new Customizer_Social_Icons(); 34 $customizer_social_icons->run(); -
customizer-social-icons/trunk/readme.txt
r1541221 r1545989 4 4 Tags: customizer, social media icons, social icons, social media, social, customize, customize social 5 5 Requires at least: 4.3 6 Tested up to: 4. 67 Stable tag: 0. 26 Tested up to: 4.7 7 Stable tag: 0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 15 15 Customizer Social Icons aims to bring one of the most implemented features across websites into your WordPress Customizer. It helps to bridge the gap of not having a native Social Media Icon tool available in WordPress directly, and gives you the features you need without the overhead of a clunky non-native interface. 16 16 17 You can control the style , size, and spacing of your icons to fit your website's needs hassle free inside of the WordPress Customizer. Any of your social media network urls found in your menus will automatically be transformed into the corresponding social media icons for you.17 You can control the style of icon, colors, size, and spacing of your icons to fit your website's needs hassle free inside of the WordPress Customizer. Any of your social media network urls found in your menus will automatically be transformed into the corresponding social media icons for you. 18 18 19 19 Available Social Media Icons: … … 85 85 1. Click on "Customize" to get to the WordPress Customizer. 86 86 2. Click on the tab that says "Menus". 87 3. Next, click on "Menu Locations," and you will see a new panel slide in that will display all of your theme's available menu locations. The menu locations are locations your theme has designated as being locations you can stick a menu inside. These will be the locations you can add Social Media Icons to with this plugin. 87 3. Next, click on "Menu Locations," and you will see a new panel slide in that will display all of your theme's available menu locations. The menu locations are locations your theme has designated as being locations you can stick a menu inside. These will be the locations you can add Social Media Icons to with this plugin. 88 88 4. Click on "Edit Menu" if you have a menu assigned to a location, or select a menu from the dropdown to add icons to that. 89 89 5. Press "Add Items," and a panel will slide out with some options of things you can add. … … 96 96 97 97 **A**: Yes! This plugin has a configuration filter, so you can just inspect the 'networks' array for how to prepare the data and filter to suit your needs! 98 99 98 100 99 = Q: How can I add this to my own theme and set defaults? = … … 110 109 5. **Social Icon Styles** - Various Icon Styles are available to make the icons fit better with your overall design. 111 110 6. **Social Icon Sizes** - You can change the size of your social icons right in the customizer to give a different look to your chosen icons. 111 7. **Social Icon Colors** - Colors can be changed for your social icons in the WordPress customizer controls as well. 112 112 113 113 == Changelog == 114 115 = 0.3 = 116 * New Feature: Added color selections for icons in customizer. 117 * Update: Changed control styles to look more modern. 118 * Update: Added and checked compatibility for WordPress 4.7. 119 * Update: Classes now use autoloader, expanded configs. 114 120 115 121 = 0.2 =
Note: See TracChangeset
for help on using the changeset viewer.