[19486] | 1 | /* ----------------------------------------------------------------------------- |
---|
| 2 | GALLY-CUISE |
---|
| 3 | Template for Piwigo |
---|
| 4 | ------------------------------------------------------------------------------ |
---|
| 5 | file: js/theme.js |
---|
| 6 | file release: 1.0.0 |
---|
| 7 | theme release: 1.5.0 |
---|
| 8 | ------------------------------------------------------------------------------ |
---|
| 9 | author: cljosse at piwigo.org |
---|
| 10 | << May the Little SpaceFrog be with you >> |
---|
| 11 | ------------------------------------------------------------------------------ |
---|
| 12 | Specific JS for the theme |
---|
| 13 | |
---|
| 14 | see the release_notes.txt file for more informations |
---|
| 15 | ----------------------------------------------------------------------------- */ |
---|
| 16 | |
---|
| 17 | var gallyCuise=null; |
---|
| 18 | |
---|
| 19 | jQuery(document).ready( |
---|
| 20 | function() |
---|
| 21 | { |
---|
| 22 | gallyCuise = new GallyCuise(); |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | jQuery('a.pwg-state-default').each(function (i) { |
---|
| 26 | obj = this; |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | jQuery(obj).addClass("button").removeClass('pwg-state-default').removeClass('pwg-button'); |
---|
| 30 | html = jQuery(obj).html(); |
---|
| 31 | if (html.indexOf("url(") > 0) { |
---|
| 32 | |
---|
| 33 | id = this.id; |
---|
| 34 | jQuery(this).css({ |
---|
| 35 | backgroundPosition:"-588px +28px" |
---|
| 36 | |
---|
| 37 | }); |
---|
| 38 | htmls = html.split("url("); |
---|
| 39 | htmls = htmls[1].split(")"); |
---|
| 40 | html = "<img src=" + htmls[0] + " class='pwg-button img_button' />"; |
---|
| 41 | |
---|
| 42 | }else if (html.indexOf("map") > 0) { |
---|
| 43 | html=""; |
---|
| 44 | jQuery(this).css({ |
---|
| 45 | backgroundPosition:"-588px -28px" , |
---|
| 46 | position:'relative' |
---|
| 47 | // bottom:'-10px',left:'-5px' |
---|
| 48 | }); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | jQuery(obj).html(html); |
---|
| 52 | }); |
---|
| 53 | } |
---|
| 54 | ); |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | function GallyCuise() |
---|
| 58 | { |
---|
| 59 | function init() { |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | // apply specific actions for categories pages |
---|
| 63 | if(jQuery('#theCategoryPage').length>0) |
---|
| 64 | { |
---|
| 65 | setCatThumbHeight(); |
---|
| 66 | setTipPosition_Category(); |
---|
| 67 | } |
---|
| 68 | // apply specific actions for picture pages |
---|
| 69 | if(jQuery('#thePicturePage').length>0) |
---|
| 70 | { |
---|
| 71 | setTipPosition_Picture(); |
---|
| 72 | } |
---|
| 73 | setTipPosition_Menu(); |
---|
| 74 | win_height = jQuery("#thumbContents").height(); |
---|
| 75 | if (!win_height) |
---|
| 76 | win_height = jQuery("#theImage").height(); |
---|
| 77 | |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | /** |
---|
| 81 | * set the same height for all category block |
---|
| 82 | */ |
---|
| 83 | function setCatThumbHeight() |
---|
| 84 | { |
---|
| 85 | var maxH=0; |
---|
| 86 | |
---|
| 87 | jQuery('div ul.thumbnailCategories li div.thumbnailCategory').each( |
---|
| 88 | function (index) |
---|
| 89 | { |
---|
| 90 | height=jQuery(this).height(); |
---|
| 91 | if(height>maxH) maxH=height; |
---|
| 92 | } |
---|
| 93 | ); |
---|
| 94 | |
---|
| 95 | jQuery('div ul.thumbnailCategories li div.thumbnailCategory').height(maxH); |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | function setTipPosition_Category() |
---|
| 99 | { |
---|
| 100 | jQuery('#categoryActionsID a.button').addClass('sTipOnLeft'); |
---|
| 101 | jQuery('div ul.thumbnailCategories li div.thumbnailCategory').addClass('sTipOnTop'); |
---|
| 102 | } |
---|
| 103 | |
---|
| 104 | function setTipPosition_Picture() |
---|
| 105 | { |
---|
| 106 | jQuery('#imageToolBar div.navButtons a.navButton').addClass('sTipOnLeft').removeClass('sTipOnTop'); |
---|
| 107 | jQuery('#imageToolBar div.randomButtons a.button').addClass('sTipOnRight').removeClass('sTipOnTop'); |
---|
| 108 | } |
---|
| 109 | |
---|
| 110 | function setTipPosition_Menu() |
---|
| 111 | { |
---|
| 112 | jQuery('#menubar span').removeClass('sTipOnTop'); |
---|
| 113 | jQuery('#menuTagCloud a').removeClass('sTipOnTop').addClass('sTipOnRight'); |
---|
| 114 | } |
---|
| 115 | |
---|
| 116 | init(); |
---|
| 117 | } |
---|