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