1 | $(function(){ |
---|
2 | if($('body').attr('id') == 'theCategoryPage'){ |
---|
3 | $('#menu_start').hide() |
---|
4 | }; |
---|
5 | if($('body').attr('id') != 'theCategoryPage'){ |
---|
6 | $('#menu').hide() |
---|
7 | }; |
---|
8 | |
---|
9 | //determines what page will slide |
---|
10 | var t = [ $('#menu_start a'), |
---|
11 | $('.navigationBar a'), |
---|
12 | $('.calendarBar a'), |
---|
13 | $('.calendarCalBar a'), |
---|
14 | $('.navigationButtons a'), |
---|
15 | $('#imageHeaderBar a'), |
---|
16 | $('.calImg a'), |
---|
17 | $('.date_today'), |
---|
18 | $('#sortOrderBox a'), |
---|
19 | $('#derivativeSwitchBox a'), |
---|
20 | $('#sortOrderLink'), |
---|
21 | $('#derivativeSwitchLink'), |
---|
22 | $('.actions a'), |
---|
23 | $('.navThumb'), |
---|
24 | $('.calendarTitle a'), |
---|
25 | $('#linkToPiwigo a'), |
---|
26 | $('#copyright a'), |
---|
27 | //determines what page will slide->specific plugin |
---|
28 | $('#languageSwitchLink'), |
---|
29 | $('#languageSwitchBox a'), |
---|
30 | $('#theHeader a'), |
---|
31 | $('#myHomePage a'), |
---|
32 | $('#mbAdditionalPages a'), |
---|
33 | $('#photosAddContent a'), |
---|
34 | $('.amm-MenuBar-links-icons a') |
---|
35 | ]; |
---|
36 | $.each(t,function(){ |
---|
37 | $(this).attr('class','noSlide'); |
---|
38 | }); |
---|
39 | |
---|
40 | var r = [ $('.pwg-icon-letters'), |
---|
41 | $('.pwg-icon-cloud'), |
---|
42 | $('.pwg-icon-help'), |
---|
43 | $('.pwg-icon-favorite-del'), |
---|
44 | $('.pwg-icon-caddie-add'), |
---|
45 | $('.pwg-icon-category-view-flat'), |
---|
46 | $('.pwg-icon-category-view-normal'), |
---|
47 | $('#thePicturePage .pwg-icon-slideshow'), |
---|
48 | $('#thePicturePage .pwg-icon-camera-info'), |
---|
49 | $('#thePicturePage .pwg-icon-save'), |
---|
50 | $('#thePicturePage .pwg-icon-favorite-add'), |
---|
51 | $('#thePicturePage .pwg-icon-representative'), |
---|
52 | $('#thePicturePage .pwg-icon-edit'), |
---|
53 | $('.pwg-icon-category-edit') |
---|
54 | ]; |
---|
55 | $.each(r,function(){ |
---|
56 | $(this).parent().attr('class','noSlide'); |
---|
57 | }); |
---|
58 | |
---|
59 | $('a:not(.noSlide)').addClass('slide'); |
---|
60 | |
---|
61 | var s = [ $('.description_stuffs .zero nb-comments'), |
---|
62 | $('.description_stuffs .nb-hits'), |
---|
63 | $('.description_stuffs .nb-comments'), |
---|
64 | $('.pwg-icon-arrow-n').parent() |
---|
65 | ]; |
---|
66 | $.each(s,function(){ |
---|
67 | $(this).remove(); |
---|
68 | }); |
---|
69 | |
---|
70 | var u = [ $('#linkToPiwigo a'), |
---|
71 | $('#copyright a'), |
---|
72 | ]; |
---|
73 | $.each(u,function(){ |
---|
74 | $(this).attr('target','blank'); |
---|
75 | }); |
---|
76 | |
---|
77 | $('.stuffs_block .illustration .description').removeClass('description').addClass('description_stuffs'); |
---|
78 | $('.titrePage + div').addClass('blockConteneur'); |
---|
79 | $('.myHomePage_links a[href="index.php?/contact"]').addClass('slide'); |
---|
80 | |
---|
81 | //initialise scroll bar |
---|
82 | var settings = { |
---|
83 | verticalDragMinHeight: 100, |
---|
84 | verticalDragMaxHeight: 100, |
---|
85 | autoReinitialise: true |
---|
86 | }; |
---|
87 | var pane = $('.scrollpane').jScrollPane(settings); |
---|
88 | var api= pane.data('jsp'); |
---|
89 | |
---|
90 | //open the slide |
---|
91 | $(function(){ |
---|
92 | $('.slide').pageslide({direction: "left",speed:2000}); |
---|
93 | }); |
---|
94 | |
---|
95 | $(function(){ |
---|
96 | var wipalen = window.parent.length; |
---|
97 | if(wipalen==1){ |
---|
98 | $('#menubar').remove(); |
---|
99 | $('#theHeader').addClass('headbord'); |
---|
100 | } |
---|
101 | if(wipalen>3) { |
---|
102 | $('#menubar').remove(); |
---|
103 | $('#theHeader').addClass('headbord'); |
---|
104 | } |
---|
105 | }); |
---|
106 | |
---|
107 | //close the slide |
---|
108 | function close(){$.pageslide.close()}; |
---|
109 | |
---|
110 | //fit the size of the screen |
---|
111 | var w_w = $(window).width()-41 + 'px', |
---|
112 | w_h = $(window).height() + 'px', |
---|
113 | w_mh = $(window).height()-180 + 'px'; |
---|
114 | $('#pageslide').css({width: w_w}); |
---|
115 | $('#the_page').css({height: w_h}); |
---|
116 | $('.intabs').css({height: w_h}); |
---|
117 | $('#content').css({minHeight: w_mh}); |
---|
118 | |
---|
119 | //when click on tabs or scroll bar |
---|
120 | $('.tabs').bind('click', |
---|
121 | function(){ |
---|
122 | $('.intabs').removeClass('visibleTransi') |
---|
123 | .css("cursor","default"); |
---|
124 | $('.jspDrag').css("cursor","pointer"); |
---|
125 | $('.jspVerticalBar').addClass('visibleTransi'); |
---|
126 | $('.jspVerticalBar').removeClass('hideTransi'); |
---|
127 | }); |
---|
128 | |
---|
129 | $('.jspTrack').bind('click', |
---|
130 | function(){ |
---|
131 | $('.intabs').removeClass('visibleTransi') |
---|
132 | .css("cursor","default"); |
---|
133 | $('.jspDrag').css("cursor","pointer"); |
---|
134 | $('.jspVerticalBar').addClass('visibleTransi'); |
---|
135 | $('.jspVerticalBar').removeClass('hideTransi'); |
---|
136 | }); |
---|
137 | |
---|
138 | //when click on link with class'slide' |
---|
139 | $('.slide').bind('click', |
---|
140 | function(){ |
---|
141 | $('.intabs').addClass('visibleTransi') |
---|
142 | .css("cursor","pointer"); |
---|
143 | $('.jspDrag').css("cursor","default"); |
---|
144 | $('.jspVerticalBar').addClass('hideTransi'); |
---|
145 | $('.jspVerticalBar').removeClass('visibleTransi'); |
---|
146 | }); |
---|
147 | |
---|
148 | //specif tab in page indentification |
---|
149 | var content=$('#theIdentificationPage .titrePage a').first().text(), |
---|
150 | link='<a href="index.php">' + content + '</a>'; |
---|
151 | $('#theIdentificationPage .intabs').addClass('visible'); |
---|
152 | $('#theIdentificationPage #sld_tab').replaceWith('<div id="sld_tabIdent">' + link + '</div>'); |
---|
153 | $('#theIdentificationPage #menubar').remove(); |
---|
154 | |
---|
155 | //title page |
---|
156 | var titre=$('#sld_tab').text(), |
---|
157 | titre=titre.substring(titre.lastIndexOf("/")), |
---|
158 | titre=titre.replace("/",""); |
---|
159 | if ((titre.indexOf("[")>=0)){ |
---|
160 | var titre=titre.substring(0,titre.indexOf("[",1)); |
---|
161 | }; |
---|
162 | $('#sld_tab').replaceWith("<div id='sld_tab'>"+ titre +"</div>") |
---|
163 | |
---|
164 | var titre=$('#content .titrePage h2').first().text(), |
---|
165 | titre=titre.substring(titre.lastIndexOf("/")), |
---|
166 | titre=titre.replace("/",""); |
---|
167 | $('#content .titrePage h2').first().replaceWith("<h2>"+ titre +"</h2>"); |
---|
168 | |
---|
169 | $('.browsePath a').remove(); |
---|
170 | var titre=$('.browsePath').text(), |
---|
171 | titre=titre.substring(titre.lastIndexOf("/")), |
---|
172 | titre=titre.replace("/",""), |
---|
173 | titre=titre.replace("[",""), |
---|
174 | titre=titre.replace("]",""); |
---|
175 | $('.browsePath').replaceWith("<h2>"+ titre +"</h2>"); |
---|
176 | |
---|
177 | |
---|
178 | //description size on thumbnail |
---|
179 | var l=$('.illustration img').width(); |
---|
180 | if(l<230){ |
---|
181 | $('.description').css('width','80%'); |
---|
182 | }; |
---|
183 | |
---|
184 | //input scearch on menubar |
---|
185 | $('#submitSearch').bind('click', |
---|
186 | function(){ |
---|
187 | $('.intabs').addClass('visibleTransi'); |
---|
188 | $('.jspVerticalBar').addClass('hideTransi'); |
---|
189 | $('.jspVerticalBar').removeClass('visibleTransi'); |
---|
190 | }); |
---|
191 | |
---|
192 | //piwitheme link in footer |
---|
193 | var piwithemehtml = 'http://piwitheme.fr'; |
---|
194 | var link=' - theme by <a href="http://piwitheme.fr" target="_blank">piwitheme</a>'; |
---|
195 | $('#copyright').append(link); |
---|
196 | |
---|
197 | //specific IE8 |
---|
198 | if ($.browser.msie && parseInt($.browser.version, 10) === 8) { |
---|
199 | $("#sortOrderLink").click(function() { |
---|
200 | var elt = $("#sortOrderBox"); |
---|
201 | elt.css("left", Math.min( $(this).offset().left, $(window).width() - elt.outerWidth(true) - 5)) |
---|
202 | .css("top", $(this).offset().top + $(this).outerHeight(true)) |
---|
203 | .toggle(); |
---|
204 | }); |
---|
205 | $("#sortOrderBox").on("mouseleave", function() { |
---|
206 | $(this).hide(); |
---|
207 | }); |
---|
208 | $("#derivativeSwitchLink").click(function() { |
---|
209 | var elt = $("#derivativeSwitchBox"); |
---|
210 | elt.css("left", Math.min( $(this).offset().left, $(window).width() - elt.outerWidth(true) - 5)) |
---|
211 | .css("top", $(this).offset().top + $(this).outerHeight(true)) |
---|
212 | .toggle(); |
---|
213 | }); |
---|
214 | $("#derivativeSwitchBox").on("mouseleave", function() { |
---|
215 | $(this).hide(); |
---|
216 | }); |
---|
217 | $("#languageSwitchLink").click(function() { |
---|
218 | var elt = $("#languageSwitchBox"); |
---|
219 | elt.css("left", Math.min($(this).offset().left, $(window).width() - elt.outerWidth(true) - 5)) |
---|
220 | .css("top", $(this).offset().top + $(this).outerHeight(true)) |
---|
221 | .toggle(); |
---|
222 | }); |
---|
223 | $("#languageSwitchBox").on("mouseleave", function() { |
---|
224 | $(this).hide(); |
---|
225 | }); |
---|
226 | }; |
---|
227 | }); |
---|