/** * Bracara v1.0 * Drupal Multipurpose Theme * http://bracara.leaftree.pt * * leaftree 2013 * @leaftreeInc * http://leaftree.pt */ (function ($) { "use strict"; $(document).ready(function() { // Panel Version 1 var active = $('.panels-1 .active').first().parent().attr('data-target'); $(active).show(); var panelRunning = false; $('.panels-1 .panel-1-icon i').on('click touchstart', function() { if (!panelRunning) { var target = $(this).parent().attr('data-target'); var active = $('.panels-1 .active').first().parent().attr('data-target'); if (target != active) { panelRunning = true; $('.panels-1 .panel-1-icon i').each(function() { $(this).removeClass('active'); }); $(this).addClass('active'); $(active).fadeOut(500, function() { $(target).fadeIn(500, function() { panelRunning = false; }); }); } } }); // End of Panel Version 1 // prevent the # links to scroll to the top of the page $("[href=#]").click(function(e) { e.preventDefault(); }); $('.testimonials-slider').flexslider({ slideshowSpeed: 5000, directionNav: false }); $('.flex-bullet-slider').flexslider({ slideshowSpeed: 5000, directionNav: false, animation: "slide" }); $('.flex-arrow-slider').flexslider({ slideshowSpeed: 5000, directionNav: true, animation: "slide" }); $('.highlighted-slider-1').flexslider({ slideshowSpeed: 5000, directionNav: false, animation: "slide" }); $('.vertical-center').flexVerticalCenter('padding-top'); $("[data-toggle=popover]").popover(); $("[data-toggle=tooltip]").tooltip(); // buttons loading $('.btn-loading').click(function () { var btn = $(this) btn.button('loading') setTimeout(function () { btn.button('reset') }, 3000) }); if (jQuery().placeholder) { $('input, textarea').placeholder(); } //Portfolio page functionalities $('#grid').mixitup(); }); })(jQuery); // Google maps goodness jQuery(window).load(function() { "use strict"; if (document.getElementById('map_canvas')) { var gLatitude = Drupal.settings['settings']['google_latitude']; var gLongitude = Drupal.settings['settings']['google_longitude']; var gZoom = Drupal.settings['settings']['google_zoom']; var gTitle = Drupal.settings['settings']['google_title']; var gDescription = Drupal.settings['settings']['google_description']; var bracara_base_url = Drupal.settings['settings']['bracara_base_url']; var latlng = new google.maps.LatLng(gLatitude, gLongitude); var settings = { zoom: parseInt(gZoom), center: latlng, scrollwheel: false, mapTypeControl: true, mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}, navigationControl: true, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), settings); var companyLogo = new google.maps.MarkerImage(bracara_base_url + '/sites/all/themes/bracara/img/google-maps/map-marker.png', new google.maps.Size(20,30), new google.maps.Point(0,0), new google.maps.Point(10,30)); var companyMarker = new google.maps.Marker({ position: latlng, map: map, icon: companyLogo, title: gTitle }); var contentString = '
' + gDescription + '
'+ '