source: extensions/Slide/js/slide.js @ 23122

Last change on this file since 23122 was 23122, checked in by Miklfe, 11 years ago
File size: 7.8 KB
Line 
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(){
70                                var wipalen = window.parent.length;
71                                if(wipalen==1){
72                                        $('#menubar').remove();
73                                        $('#theHeader').addClass('headbord');
74                                        }
75                                if(wipalen>3) {
76                                        $('#menubar').remove();
77                                        $('#theHeader').addClass('headbord');
78                                                                }
79                                                });
80       
81        //close the slide
82                        function close(){$.pageslide.close()};
83                                                       
84        //fit the size of the screen           
85                                var w_w = $(window).width()-41 + 'px';
86                                        $('#pageslide').css({width: w_w});             
87                                var w_h = $(window).height() + 'px';
88                                var w_mh = $(window).height()-180 + 'px';
89                                        $('#the_page').css({height: w_h});             
90                                        $('.intabs').css({height: w_h});       
91                                        $('#content').css({minHeight: w_mh});
92                                                               
93        //when click on tabs or scroll bar                                     
94                        $('.tabs').bind('click',
95                                function(){
96                                        $('.intabs').removeClass('visibleTransi')
97                                                                .css("cursor","default");
98                                        $('.jspDrag').css("cursor","pointer");                 
99                                        $('.jspVerticalBar').addClass('visibleTransi');
100                                        $('.jspVerticalBar').removeClass('hideTransi');
101                                                        });
102                                                       
103                        $('.jspTrack').bind('click',
104                                function(){
105                                        $('.intabs').removeClass('visibleTransi')
106                                                                .css("cursor","default");
107                                        $('.jspDrag').css("cursor","pointer");                 
108                                        $('.jspVerticalBar').addClass('visibleTransi');
109                                        $('.jspVerticalBar').removeClass('hideTransi');
110                                                        });
111
112        //when click on link with class'slide'         
113                        $('.slide').bind('click',
114                                function(){
115                                        $('.intabs').addClass('visibleTransi')
116                                                                .css("cursor","pointer");
117                                        $('.jspDrag').css("cursor","default");                 
118                                        $('.jspVerticalBar').addClass('hideTransi');
119                                        $('.jspVerticalBar').removeClass('visibleTransi');
120                                                        });
121                                                       
122        //specif tab in page indentification
123                                var content=$('#theIdentificationPage .titrePage a').first().text();
124                                var link='<a href="index.php">' + content + '</a>';
125                                $('#theIdentificationPage .intabs').addClass('visible');
126                                $('#theIdentificationPage #sld_tab').replaceWith('<div id="sld_tabIdent">' + link + '</div>');
127                                $('#theIdentificationPage #menubar').remove();
128                                               
129        //title page           
130                                var titre=$('#sld_tab').text();
131                                var titre=titre.substring(titre.lastIndexOf("/"));
132                                var titre=titre.replace("/","");
133                                if ((titre.indexOf("[")>=0)){
134                                        var titre=titre.substring(0,titre.indexOf("[",1));
135                                                                                        };
136                                $('#sld_tab').replaceWith("<div id='sld_tab'>"+ titre +"</div>")               
137                       
138                                var titre=$('#content .titrePage h2').first().text();
139                                var titre=titre.substring(titre.lastIndexOf("/"));
140                                var titre=titre.replace("/","");
141                                $('#content .titrePage h2').first().replaceWith("<h2>"+ titre +"</h2>");
142                               
143                                $('.browsePath a').remove();
144                                var titre=$('.browsePath').text();
145                                var titre=titre.substring(titre.lastIndexOf("/"));
146                                var titre=titre.replace("/","");
147                                var titre=titre.replace("[","");
148                                var titre=titre.replace("]","");
149                                $('.browsePath').replaceWith("<h2>"+ titre +"</h2>");
150                                               
151
152        //description size on thumbnail
153                                var l=$('.illustration img').width();
154                                if(l<230){
155                                $('.description').css('width','80%');
156                                                        };
157                                               
158        //input scearch on menubar
159                        $('#submitSearch').bind('click',
160                                function(){
161                                        $('.intabs').addClass('visibleTransi');
162                                        $('.jspVerticalBar').addClass('hideTransi');
163                                        $('.jspVerticalBar').removeClass('visibleTransi');
164                                                        });
165
166        //piwitheme link in footer                             
167                                var piwithemehtml = 'http://piwitheme.fr';
168                                var link=' - theme by <a href="http://piwitheme.fr" target="_blank">piwitheme</a>';
169                                $('#copyright').append(link);
170       
171        //specific IE8
172                if ($.browser.msie  && parseInt($.browser.version, 10) === 8) {
173                        $("#sortOrderLink").click(function() {
174                                var elt = $("#sortOrderBox");
175                                elt.css("left", Math.min( $(this).offset().left, $(window).width() - elt.outerWidth(true) - 5))
176                                        .css("top", $(this).offset().top + $(this).outerHeight(true))
177                                        .toggle();
178                                                        });
179                        $("#sortOrderBox").on("mouseleave", function() {
180                                $(this).hide();
181                                                        });
182                        $("#derivativeSwitchLink").click(function() {
183                                var elt = $("#derivativeSwitchBox");
184                                elt.css("left", Math.min( $(this).offset().left, $(window).width() - elt.outerWidth(true) - 5))
185                                        .css("top", $(this).offset().top + $(this).outerHeight(true))
186                                        .toggle();
187                                                        });
188                        $("#derivativeSwitchBox").on("mouseleave", function() {
189                                $(this).hide();
190                                                        });
191                        $("#languageSwitchLink").click(function() {
192                                var elt = $("#languageSwitchBox");
193                                elt.css("left", Math.min($(this).offset().left, $(window).width() - elt.outerWidth(true) - 5))
194                                        .css("top", $(this).offset().top + $(this).outerHeight(true))
195                                        .toggle();
196                                                        });
197                        $("#languageSwitchBox").on("mouseleave", function() {
198                                $(this).hide();
199                                                        });                             
200                };
201});
Note: See TracBrowser for help on using the repository browser.