/*! * Contact Buttons Plugin Demo 0.1.0 * https://github.com/joege/contact-buttons-plugin * * Copyright 2015, José Gonçalves * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ (function ($) { 'use strict'; // Main function $.contactButtons = function( options ){ // Define the defaults var defaults = { effect : '', // slide-on-scroll buttons : { 'facebook': { class: 'facebook', use: false, icon: 'facebook', link: '', title: 'Follow on Facebook' }, 'google': { class: 'gplus', use: false, icon: 'google-plus', link: '', title: 'Visit on Google Plus' }, 'linkedin': { class: 'linkedin', use: false, icon: 'linkedin', link: '', title: 'Visit on LinkedIn' }, 'twitter': { class: 'twitter', use: false, icon: 'twitter', link: '', title: 'Follow on Twitter' }, 'pinterest': { class: 'pinterest', use: false, icon: 'pinterest', link: '', title: 'Follow on Pinterest' }, 'phone': { class: 'phone', use: false, icon: 'phone', link: '', title: 'Call us', type: 'phone' }, 'email': { class: 'email', use: false, icon: 'envelope', link: '', title: 'Send us an email', type: 'email' } } }; // Merge defaults and options var s, settings = options; for (s in defaults.buttons) { if (options.buttons[s]) { settings.buttons[s] = $.extend( defaults.buttons[s], options.buttons[s] ); } } // Define the container for the buttons var oContainer = $("#contact-buttons-bar"); // Check if the container is already on the page if ( oContainer.length === 0 ) { // Insert the container element $('body').append('