1 | /* ----------------------------------------------------------------------------- |
---|
2 | GALLY-GRUM-DARK-II |
---|
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: grum 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 gallyGrumDarkII=null; |
---|
18 | |
---|
19 | $(document).ready( |
---|
20 | function() |
---|
21 | { |
---|
22 | gallyGrumDarkII=new GallyGrumDarkII(); |
---|
23 | } |
---|
24 | ); |
---|
25 | |
---|
26 | |
---|
27 | function GallyGrumDarkII () |
---|
28 | { |
---|
29 | function init() |
---|
30 | { |
---|
31 | // apply specific actions for categories pages |
---|
32 | if($('#theCategoryPage').length>0) |
---|
33 | { |
---|
34 | setCatThumbHeight(); |
---|
35 | setTipPosition_Category(); |
---|
36 | } |
---|
37 | // apply specific actions for picture pages |
---|
38 | if($('#thePicturePage').length>0) |
---|
39 | { |
---|
40 | setTipPosition_Picture(); |
---|
41 | } |
---|
42 | setTipPosition_Menu(); |
---|
43 | } |
---|
44 | |
---|
45 | /** |
---|
46 | * set the same height for all category block |
---|
47 | */ |
---|
48 | function setCatThumbHeight() |
---|
49 | { |
---|
50 | var maxH=0; |
---|
51 | |
---|
52 | $('div ul.thumbnailCategories li div.thumbnailCategory').each( |
---|
53 | function (index) |
---|
54 | { |
---|
55 | height=$(this).height(); |
---|
56 | if(height>maxH) maxH=height; |
---|
57 | } |
---|
58 | ); |
---|
59 | |
---|
60 | $('div ul.thumbnailCategories li div.thumbnailCategory').height(maxH); |
---|
61 | } |
---|
62 | |
---|
63 | function setTipPosition_Category() |
---|
64 | { |
---|
65 | $('#categoryActionsID a.button').addClass('sTipOnLeft'); |
---|
66 | $('div ul.thumbnailCategories li div.thumbnailCategory').addClass('sTipOnTop'); |
---|
67 | } |
---|
68 | |
---|
69 | function setTipPosition_Picture() |
---|
70 | { |
---|
71 | $('#imageToolBar div.navButtons a.navButton').addClass('sTipOnLeft').removeClass('sTipOnTop'); |
---|
72 | $('#imageToolBar div.randomButtons a.button').addClass('sTipOnRight').removeClass('sTipOnTop'); |
---|
73 | } |
---|
74 | |
---|
75 | function setTipPosition_Menu() |
---|
76 | { |
---|
77 | $('#menubar span').removeClass('sTipOnTop'); |
---|
78 | $('#menuTagCloud a').removeClass('sTipOnTop').addClass('sTipOnRight'); |
---|
79 | } |
---|
80 | |
---|
81 | init(); |
---|
82 | } |
---|