/******************************************************************************* CSS on Sails Framework Title: Pocketlistings Author: XHTMLized (http://www.xhtmlized.com/) Date: February 2024 *******************************************************************************/ $(document).ready(function() { GHH.init(); $(".navbar-toggle").click(function() { var flag = 0; if(!$(this).hasClass('open')) { var flag = 1; $(this).toggleClass('open'); } $( "#navigation" ).slideToggle( "slow", function() { if(flag == 0) { $(".navbar-toggle").toggleClass('open'); } // Animation complete. }); return false; }); }); $(".node-type-gallery-image .field-gallery a").html("« Back to album"); $(".node-type-gallery-image .field-gallery").css('display', 'block'); $(".field-gallery-image").addClass("cursor-pointer"); var aux = $(".node-type-gallery-image .browse.right").attr('href'); $(".field-gallery-image").attr("onClick", "location.href='"+aux+"'"); $(".button-print").attr('target', '_blank'); var GHH = { init: function() { GHH.likeButton(); GHH.fixesIE(); GHH.featuredSlideshow(); GHH.articleSlideshow(); GHH.tabs(); GHH.tooltips(); GHH.lightbox(); GHH.newsletterPlaceholder(); GHH.followButton(); }, likeButton: function(){ var nid=$("#nid").val(); if(typeof FB!='undefined'){ FB.Event.subscribe('edge.create', function(response) { $.get('/facebook/like/' + nid); } ); } }, followButton: function(){ $("#anonymous-follow").click(function(){ var array=$('body').attr('class').split(' '); var nid=''; for(var element in array){ if(array[element].match('^og-context-')){ var desired_element = array[element]; nid = desired_element.replace("og-context-",""); } } var link = $('#login').find('.item-list').find('.first').find('a'); $.get('/follow/anonymous/'+nid); }); }, fixesIE: function() { //Add Stuff Dropdown $('#add-stuff, #left li, button').hover(function(){ $(this).addClass('hover'); },function(){ $(this).removeClass('hover'); }); }, featuredSlideshow: function() { var container = $('#featured .view'), carousel = null, items = null; items = container.find('.items'); var itemWidth = 290; // Exist carousel initialization if there aren't more than 3 items //if (items.find('.featured-item').size() < 4) return; carousel = items.jcarousel({ scroll: 1, speed: 'slow', width: 257, itemFallbackDimension:257, setupCallback: function(carousel) { container.addClass('jcarousel-processed'); carousel.reload(); }, reloadCallback: function(carousel) { var num = Math.floor(carousel.clipping() / itemWidth); carousel.options.scroll = num; carousel.options.visible = num; carousel.options.itemFallbackDimension = 257; } }); }, articleSlideshow: function() { var s = $('.slideshow > div.scrollable').scrollable({ onSeek: function(el,ind){ this.getRoot().siblings('.title').html(this.getItems().eq(ind).attr('title')); } }).data('scrollable'); if(s){ s.seekTo(0); } // Enlarge functionality $('.slideshow .enlarge').click(function(){ var currentPhoto = $('.slideshow .scrollable .items a').get(s.getIndex()) $(currentPhoto).trigger('click'); return false; }); }, tabs: function() { $('.block .tabs').each(function(){ $('ul',this).tabs($(this).siblings('.block-content').children('div'),{ tabs: 'li', current: 'active' }); }); }, tooltipOver: function(){ var api = $(this).data('tooltip'); if(!api.isShown(true)){ api.show(); } }, tooltipLeave: function(){ var api = $(this).data('tooltip'); api.hide(); }, tooltipLeaveSlow: function(){ var api = $(this).data('tooltip'); api.hide(1000); }, tooltips: function() { if(!(/iPhone|iPod|Android|iPad|Blackberry|webOS/i.test(navigator.userAgent))){ $('ul a[title]').each(function(i, e){ // cannot trust only in 'ul a[title]' selector, need to verify // one by one if title is set, otherwise this causes a bug if ($(e).attr('title') != ''){ $(e).tooltip({ position: 'bottom center', delay: 0, layout: '