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

Last change on this file since 25053 was 25053, checked in by Miklfe, 11 years ago
File size: 7.6 KB
Line 
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                                               
37                $( document ).ready(function() 
38                        {                               
39                        if($('.illustration a').hasClass('cboxElement'))
40                                {
41                                $('.illustration a').addClass('noSlide').removeClass('slide');
42                                }
43                });     
44               
45                        $.each(t,function(){
46                                $(this).attr('class','noSlide');
47                        });
48                       
49                        var r = [       $('.pwg-icon-letters'),
50                                                $('.pwg-icon-cloud'),
51                                                $('.pwg-icon-help'),
52                                                $('.pwg-icon-favorite-del'),
53                                                $('.pwg-icon-caddie-add'),
54                                                $('.pwg-icon-category-view-flat'),
55                                                $('.pwg-icon-category-view-normal'),
56                                                $('#thePicturePage .pwg-icon-slideshow'),
57                                                $('#thePicturePage .pwg-icon-camera-info'),
58                                                $('#thePicturePage .pwg-icon-save'),
59                                                $('#thePicturePage .pwg-icon-favorite-add'),
60                                                $('#thePicturePage .pwg-icon-representative'),
61                                                $('#thePicturePage .pwg-icon-edit'),
62                                                $('.pwg-icon-category-edit')
63                                                ];
64                        $.each(r,function(){
65                                $(this).parent().attr('class','noSlide');
66                        });
67
68                        $('a:not(.noSlide)').addClass('slide');
69                       
70                        var s = [       $('.description_stuffs .zero nb-comments'),
71                                                $('.description_stuffs .nb-hits'),
72                                                $('.description_stuffs .nb-comments'),
73                                                $('.pwg-icon-arrow-n').parent()
74                                                ];
75                        $.each(s,function(){
76                                $(this).remove();
77                        });
78
79                        var u = [       $('#linkToPiwigo a'),
80                                                $('#copyright a'),
81                                                ];
82                        $.each(u,function(){
83                                $(this).attr('target','blank');
84                        });
85                       
86                        $('.stuffs_block .illustration .description').removeClass('description').addClass('description_stuffs');
87                        $('.titrePage + div').addClass('blockConteneur');
88                        $('.myHomePage_links a[href="index.php?/contact"]').addClass('slide');
89
90        //initialise scroll bar         
91                        var settings = {
92                                verticalDragMinHeight: 100,
93                                verticalDragMaxHeight: 100,
94                                autoReinitialise: true
95                                                };
96                        var pane = $('.scrollpane').jScrollPane(settings);
97                        var api= pane.data('jsp');
98
99        //open the slide
100                        $(function(){
101                                $('.slide').pageslide({direction: "left",speed:2000});
102                                        });
103
104                        $(function(){
105                                var wipalen = window.parent.length;
106                                if(wipalen==1){
107                                        $('#menubar').remove();
108                                        $('#theHeader').addClass('headbord');
109                                        }
110                                if(wipalen>3) {
111                                        $('#menubar').remove();
112                                        $('#theHeader').addClass('headbord');
113                                                                }
114                                                });
115       
116        //close the slide
117                        function close(){$.pageslide.close()};
118                                                       
119        //fit the size of the screen           
120                                var w_w = $(window).width()-41 + 'px',
121                                        w_h = $(window).height() + 'px',
122                                        w_mh = $(window).height()-180 + 'px';
123                                $('#pageslide').css({width: w_w});             
124                                $('#the_page').css({height: w_h});             
125                                $('.intabs').css({height: w_h});       
126                                $('#content').css({minHeight: w_mh});
127                                                               
128        //when click on tabs or scroll bar                                     
129                        $('.tabs').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                        $('.jspTrack').bind('click',
139                                function(){
140                                        $('.intabs').removeClass('visibleTransi')
141                                                                .css("cursor","default");
142                                        $('.jspDrag').css("cursor","pointer");                 
143                                        $('.jspVerticalBar').addClass('visibleTransi');
144                                        $('.jspVerticalBar').removeClass('hideTransi');
145                                                        });
146
147        //when click on link with class'slide'         
148                        $('.slide').bind('click',
149                                function(){
150                                        $('.intabs').addClass('visibleTransi')
151                                                                .css("cursor","pointer");
152                                        $('.jspDrag').css("cursor","default");                 
153                                        $('.jspVerticalBar').addClass('hideTransi');
154                                        $('.jspVerticalBar').removeClass('visibleTransi');
155                                                        });
156                                                       
157        //specif tab in page indentification
158                                var content=$('#theIdentificationPage .titrePage a').first().text(),
159                                        link='<a href="index.php">' + content + '</a>';
160                                $('#theIdentificationPage .intabs').addClass('visible');
161                                $('#theIdentificationPage #sld_tab').replaceWith('<div id="sld_tabIdent">' + link + '</div>');
162                                $('#theIdentificationPage #menubar').remove();
163                                               
164        //title page           
165                                var titre=$('#sld_tab').text(),
166                                        titre=titre.substring(titre.lastIndexOf("/")),
167                                        titre=titre.replace("/","");
168                                if ((titre.indexOf("[")>=0)){
169                                        var titre=titre.substring(0,titre.indexOf("[",1));
170                                                                                        };
171                                $('#sld_tab').replaceWith("<div id='sld_tab'>"+ titre +"</div>")               
172                       
173                                var titre=$('#content .titrePage h2').first().text(),
174                                        titre=titre.substring(titre.lastIndexOf("/")),
175                                        titre=titre.replace("/","");
176                                $('#content .titrePage h2').first().replaceWith("<h2>"+ titre +"</h2>");
177                               
178                                $('.browsePath a').remove();
179                                var titre=$('.browsePath').text(),
180                                        titre=titre.substring(titre.lastIndexOf("/")),
181                                        titre=titre.replace("/",""),
182                                        titre=titre.replace("[",""),
183                                        titre=titre.replace("]","");
184                                $('.browsePath').replaceWith("<h2>"+ titre +"</h2>");
185                                               
186
187        //description size on thumbnail
188                                var l=$('.illustration img').width();
189                                if(l<230){
190                                $('.description').css('width','80%');
191                                                        };
192                                               
193        //input scearch on menubar
194                        $('#submitSearch').bind('click',
195                                function(){
196                                        $('.intabs').addClass('visibleTransi');
197                                        $('.jspVerticalBar').addClass('hideTransi');
198                                        $('.jspVerticalBar').removeClass('visibleTransi');
199                                                        });
200
201        //piwitheme link in footer                             
202                                var piwithemehtml = 'http://piwitheme.fr';
203                                var link=' - theme by <a href="http://piwitheme.fr" target="_blank">piwitheme</a>';
204                                $('#copyright').append(link);
205       
206        //specific IE8
207                if ($.browser.msie  && parseInt($.browser.version, 10) === 8) {
208                        $("#sortOrderLink").click(function() {
209                                var elt = $("#sortOrderBox");
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                        $("#sortOrderBox").on("mouseleave", function() {
215                                $(this).hide();
216                                                        });
217                        $("#derivativeSwitchLink").click(function() {
218                                var elt = $("#derivativeSwitchBox");
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                        $("#derivativeSwitchBox").on("mouseleave", function() {
224                                $(this).hide();
225                                                        });
226                        $("#languageSwitchLink").click(function() {
227                                var elt = $("#languageSwitchBox");
228                                elt.css("left", Math.min($(this).offset().left, $(window).width() - elt.outerWidth(true) - 5))
229                                        .css("top", $(this).offset().top + $(this).outerHeight(true))
230                                        .toggle();
231                                                        });
232                        $("#languageSwitchBox").on("mouseleave", function() {
233                                $(this).hide();
234                                                        });                             
235                };
236});
Note: See TracBrowser for help on using the repository browser.