/* ----------------------------------------------------------------------------- GALLY-CUISE Template for Piwigo ------------------------------------------------------------------------------ file: js/theme.js file release: 1.0.0 theme release: 1.5.0 ------------------------------------------------------------------------------ author: cljosse at piwigo.org << May the Little SpaceFrog be with you >> ------------------------------------------------------------------------------ Specific JS for the theme see the release_notes.txt file for more informations ----------------------------------------------------------------------------- */ var gallyCuise=null; jQuery(document).ready( function() { gallyCuise = new GallyCuise(); jQuery('a.pwg-state-default').each(function (i) { obj = this; jQuery(obj).addClass("button").removeClass('pwg-state-default').removeClass('pwg-button'); html = jQuery(obj).html(); if (html.indexOf("url(") > 0) { id = this.id; jQuery(this).css({ backgroundPosition:"-588px +28px" }); htmls = html.split("url("); htmls = htmls[1].split(")"); html = ""; }else if (html.indexOf("map") > 0) { html=""; jQuery(this).css({ backgroundPosition:"-588px -28px" , position:'relative' // bottom:'-10px',left:'-5px' }); } jQuery(obj).html(html); }); } ); function GallyCuise() { function init() { // apply specific actions for categories pages if(jQuery('#theCategoryPage').length>0) { setCatThumbHeight(); setTipPosition_Category(); } // apply specific actions for picture pages if(jQuery('#thePicturePage').length>0) { setTipPosition_Picture(); } setTipPosition_Menu(); win_height = jQuery("#thumbContents").height(); if (!win_height) win_height = jQuery("#theImage").height(); } /** * set the same height for all category block */ function setCatThumbHeight() { var maxH=0; jQuery('div ul.thumbnailCategories li div.thumbnailCategory').each( function (index) { height=jQuery(this).height(); if(height>maxH) maxH=height; } ); jQuery('div ul.thumbnailCategories li div.thumbnailCategory').height(maxH); } function setTipPosition_Category() { jQuery('#categoryActionsID a.button').addClass('sTipOnLeft'); jQuery('div ul.thumbnailCategories li div.thumbnailCategory').addClass('sTipOnTop'); } function setTipPosition_Picture() { jQuery('#imageToolBar div.navButtons a.navButton').addClass('sTipOnLeft').removeClass('sTipOnTop'); jQuery('#imageToolBar div.randomButtons a.button').addClass('sTipOnRight').removeClass('sTipOnTop'); } function setTipPosition_Menu() { jQuery('#menubar span').removeClass('sTipOnTop'); jQuery('#menuTagCloud a').removeClass('sTipOnTop').addClass('sTipOnRight'); } init(); }