PageSourceSearch

https://battlebrothersgame.com/wp-content/plugins/sk_isotope_gallery/js/rx_isotope_gallery.js?ver=6.7.9

js battlebrothersgame.com collected 2026-09-24 09:33:51 UTC 17,450 bytes, 438 lines download raw bytes

1jQuery(document).ready(function(){
2    jQuery('.rx_isotope_ui').each(function(indx){
3         rx_igallery = new RxIsotopeGallery();
4         rx_igallery.init(jQuery(this)); 
5    });
6    handleBeacons();
7});
8
9function handleBeacons(){
10        jQuery('.genericBeaconIsotope').each(function(indx){
11            var beacon = jQuery(this);
12            beacon.hover(function(e){
13                TweenMax.to(jQuery(this).find('.beaconCircle1'), .3, {scale:1.5, opacity: 0, ease:Elastic.EaseOut});
14                TweenMax.to(jQuery(this).find('.beaconCircle2'), .2, {scale:.95, opacity:.7, ease:Elastic.EaseOut});
15            }, function(e){
16                TweenMax.to(jQuery(this).find('.beaconCircle1'), .2, {scale:1, opacity: 1, ease:Elastic.EaseIn});
17                TweenMax.to(jQuery(this).find('.beaconCircle2'), .1, {scale:1, opacity:1, ease:Elastic.EaseOut});
18            });            
19        });            
20}
21
22function RxIsotopeGallery(){
23    
24    var rx_gallery_ui;
25    var main_gallery;
26    this.init = function(ui){
27        rx_gallery_ui = ui;
28        initIsotopeMenu(); 
29        handleLinks();       
30    }
31        
32    function handleLinks(){
33        main_gallery = new Array();
34        var isotopeItems = rx_gallery_ui.find('.isotopeContainer').children('.isotopeItem');        
35        for(var i=0;i<isotopeItems.length;i++){
36            var overlay = jQuery(isotopeItems[i]).find('.isotopeItemOverlay');
37            overlay.css('opacity', 0);
38            overlay.css('display', 'block');
39            var image_caption = overlay.find('.isotopeItemCaption').html();
40            overlay.find('.isotopeItemCaption').remove();
41            overlay.hover(function(e){
42                var beacon = jQuery(this).find('.rx_isotope_beacon');
43                beacon.css('left', jQuery(this).width()/2-beacon.width()/2+'px');
44                beacon.css('top', jQuery(this).height()/2-beacon.height()/2+'px');
45                TweenMax.to(jQuery(this), .2, {css:{opacity: 1}, ease:Power4.EaseIn});
46            }, function(e){
47                TweenMax.to(jQuery(this), .4, {css:{opacity: 0}, ease:Power4.EaseIn});
48            });
49            
50            main_gallery.push({imgURL: overlay.attr('data-full_url'), itemDescription: image_caption});    
51            
52            overlay.click(function(e){
53                e.preventDefault();
54                var indx = parseFloat(jQuery(this).attr('data-indx'));
55                new IsotopeGalleryLightbox(main_gallery, indx, lightboxControlsColor);               
56            });            
57        }
58    }
59    
60    var isotopeMenu;
61    var selectedBackColor = '6abde9';
62    var lightboxControlsColor = '6abde9';
63    function initIsotopeMenu(){                  
64        var menuUI = rx_gallery_ui.find('.isotopeMenu'); 
65        selectedBackColor = menuUI.attr('data-selectedcolor');
66        lightboxControlsColor = menuUI.attr('data-lightboxcolor');          
67        
68        isotopeMenu = new Array(); 
69        var menu_children = menuUI.children('li');    
70
71        for(var i=0;i<menu_children.length;i++){
72            var link = jQuery(menu_children[i]).find('a');
73            link.attr('data-indx', i);
74            isotopeMenu.push({categoryID: link.attr('href'), link: link, iconClass: link.attr('class')});           
75            link.click(function(e){                
76                e.preventDefault();               
77                selectMenuItem(jQuery(this).attr('data-indx'));              
78            });            
79        }
80        
81
82        selectMenuItem(0);
83    }    
84    
85    //select isotope menu
86    function selectMenuItem(indx){
87        for(var i=0;i<isotopeMenu.length;i++){
88            if(i==indx){                
89                isotopeMenu[i].link.css('background-color', '#'+selectedBackColor);
90                filterIsotopeItems(indx);
91            }else{
92                isotopeMenu[i].link.css('background', 'none');
93            }
94        }
95    }
96    
97    function filterIsotopeItems(index){
98         var selector = "."+isotopeMenu[index].categoryID;
99         (selector==".*")?selector="*":null;
100                  
101         rx_gallery_ui.find('.isotopeContainer').isotope({
102               layoutMode : 'masonry',
103               filter: selector,
104               animationOptions: {
105                   duration: 750,
106                   easing: 'linear',
107                   queue: false
108              }});       
109    }     
110    
111}
112
113
114
115
116    /* iGallery lightbox
117    ================================================== */   
118   function IsotopeGalleryLightbox(original_gallery, index, controls_color){
119       var _buttons_colors = (controls_color!=undefined)?controls_color:'6abde9';
120       var gallery = new Array();
121       for(var i=0;i<original_gallery.length;i++){
122           gallery.push(original_gallery[i]);
123       }
124              
125       
126       var tmpl = ''+
127       '<div id="sk_igallery_lightbox">'+
128       '</div>';
129       var preloaderTmpl = '<div class="iGalleryPreloader"><img src="'+GALLERY_DTA_FRONT.IMAGES_URL+'/preloader.gif" alt="preloader" /></div>';
130       
131       var containersTmpl = ''+
132       '<p id="ilghtb_caption"></p>'+
133       '<div id="ilghtb_img"></div>'+
134       '<div id="ilghtb_controls">'+
135            '<a href="#" class="genericBoxButtonLightbox ifloatRight lightBxRight" style="margin-left: 1px; background-color: #'+_buttons_colors+';"><img src="'+GALLERY_DTA_FRONT.IMAGES_URL+'/right.png" alt="" /></a>'+
136            '<a href="#" class="genericBoxButtonLightbox ifloatRight lightBxClose" style="margin-left: 1px; background-color: #'+_buttons_colors+';"><img src="'+GALLERY_DTA_FRONT.IMAGES_URL+'/close.png" alt="" /></a>'+
137            '<a href="#" class="genericBoxButtonLightbox ifloatRight lightBxLeft" style="background-color: #'+_buttons_colors+';"><img src="'+GALLERY_DTA_FRONT.IMAGES_URL+'/left_arrow.png" alt="" /></a>'+
138        '</div>'+
139       '';
140       
141       var secure_scr_tmpl = '<div id="isecure_screen"></div>';
142       
143    var leftBtn;
144    var closeBtn;
145    var rightBtn;
146           
147       var lgthBox;
148       var iPreloader;
149       var initialH = 70;
150       var preloaderSize = 28;
151       var currentIndex = index;
152       
153       var secure_UI;
154       show();    
155       function show(){
156           secure_UI = jQuery(secure_scr_tmpl);   
157           secure_screen(true);                  
158           lgthBox = jQuery(tmpl);
159           lgthBox.css('top', jQuery(window).height()/2+'px');
160           lgthBox.appendTo('body');
161           iPreloader = jQuery(preloaderTmpl);
162           iPreloader.css('opacity', 0);
163           TweenMax.to(iPreloader, 0, {css:{scale:0}});
164           iPreloader.appendTo(lgthBox);
165           jQuery(containersTmpl).appendTo(lgthBox); 
166           jQuery('#ilghtb_controls').css('opacity', 0);         
167           lightBoxResize();
168           TweenMax.to(lgthBox, .3, {css:{opacity:1, height: initialH, top: (jQuery(window).height()/2-initialH/2)}, delay: .2, ease:Power3.EaseIn, onComplete: function(){
169               lightBoxResize();
170               TweenMax.to(iPreloader, .2, {css:{opacity:1, scale: 1}, ease:Power3.EaseIn, onComplete: function(){
171                   loadImage(imageFirstTime);
172               }});
173           }});
174           
175            leftBtn = lgthBox.find('.lightBxLeft');
176            closeBtn = lgthBox.find('.lightBxClose');
177            rightBtn = lgthBox.find('.lightBxRight');
178            
179            buttonsHover();
180            buttonsClick();                      
181       }
182       
183       
184        function buttonsHover(){
185            leftBtn.hover(function(e){
186                if(!leftValid){return;}
187                    TweenMax.to(jQuery(this), .1, {css:{opacity:.8}, ease:Power3.easeIn});
188                }, function(e){
189                    if(!leftValid){return;}
190                    TweenMax.to(jQuery(this), .1, {css:{opacity:1}, ease:Power3.easeIn});
191                }); 
192            closeBtn.hover(function(e){
193                    TweenMax.to(jQuery(this), .1, {css:{opacity:.8}, ease:Power3.easeIn});
194                }, function(e){
195                    TweenMax.to(jQuery(this), .1, {css:{opacity:1}, ease:Power3.easeIn});
196                }); 
197            rightBtn.hover(function(e){
198                if(!rightValid){return;}
199                    TweenMax.to(jQuery(this), .1, {css:{opacity:.8}, ease:Power3.easeIn});
200                }, function(e){
201                    if(!rightValid){return;}
202                    TweenMax.to(jQuery(this), .1, {css:{opacity:1}, ease:Power3.easeIn});
203                });                         
204        }
205        
206        function buttonsClick(){
207            leftBtn.click(function(e){
208                e.preventDefault();
209                if(!leftValid){
210                    return;
211                }
212                currentIndex--;
213                initopenNewImage();
214            });
215            closeBtn.click(function(e){
216                e.preventDefault();
217                closeLightbox();
218            });
219            rightBtn.click(function(e){
220                e.preventDefault();
221                if(!rightValid){
222                    return;
223                }
224                currentIndex++;
225                initopenNewImage();
226            });                
227        }
228        
229        
230        function closeLightbox(){           
231            //secure_screen.secure(true);
232            TweenMax.to(currentImage, .4, {css:{opacity: 0}, ease:Power3.easeIn});
233            TweenMax.to(jQuery('#ilghtb_caption'), .4, {css:{opacity: 0}, delay: .2, ease:Power3.easeIn});
234            TweenMax.to(jQuery('#ilghtb_controls'), .4, {css:{opacity: 0}, delay: .2, ease:Power3.easeIn});
235            
236
237            TweenMax.to(lgthBox, .5, {css:{height: '2px'}, delay: .6, ease:Power3.easeIn});
238            TweenMax.to(lgthBox, .5, {css:{top: jQuery(window).height()/2+'px'}, delay: .6, ease:Power3.easeIn, onComplete: lightboxClosed});                
239        }        
240        
241        function lightboxClosed(){
242            //secure_screen.secure(false);
243            TweenMax.to(lgthBox, .2, {css:{height: '0px'}, ease:Power3.easeIn, onComplete: gcc_lgtbox});
244        }
245        
246        function gcc_lgtbox(){
247            isActive = false;
248            try{
249                lgthBox.empty();
250                lgthBox.remove();
251                lgthBox = null;
252                gallery = null;
253                secure_UI.remove();
254                secure_UI = null;
255            }catch(e){}
256        } 
257        
258           function secure_screen(val){
259               if(val){
260                   try{
261                      secure_UI.remove(); 
262                   }catch(e){}
263                   secure_UI.appendTo('body');
264               }else{
265                   secure_UI.remove();
266               }
267           }               
268        
269        function initopenNewImage(){
270            //secure_screen.secure(true);
271            validateButtons();
272            TweenMax.to(iPreloader, 0, {css:{opacity: 0, scale: 0}});
273            TweenMax.to(currentImage, .4, {css:{opacity: 0}, ease:Power3.easeIn});
274            TweenMax.to(iPreloader, .2, {css:{opacity: 1, scale: 1}, delay: .4, ease:Power3.easeIn, onComplete: loadNewImage});
275            //preloaderGIF
276        }  
277    
278        function loadNewImage(){
279            try{            
280                currentImage.remove();
281            }catch(e){}
282            loadImage(newImageLoaded);
283        }
284        
285        function newImageLoaded(img){
286            if(gallery[currentIndex].img==null){
287                gallery[currentIndex].img = img;             
288            }
289            TweenMax.to(iPreloader, .3, {css:{scale: 0, opacity: 0}, ease:Power3.easeIn});
290            show_lgtb_image();      
291        }                          
292        
293        var leftValid = false;
294        var rightValid = false;
295        function validateButtons(){
296            leftBtn.css('visibility', 'visible');
297            rightBtn.css('visibility', 'visible');
298            leftBtn.removeClass('iLightboxDisabledButton');
299            rightBtn.removeClass('iLightboxDisabledButton');
300            leftBtn.css('background-color', '#'+_buttons_colors);
301            rightBtn.css('background-color', '#'+_buttons_colors);            
302            leftValid = true;
303            rightValid = true;
304            if(currentIndex==0){
305                //leftBtn.css('visibility', 'hidden');
306                //leftBtn.removeClass('portfolioButtonColor');
307                leftBtn.addClass('iLightboxDisabledButton');
308                leftBtn.css('background-color', '#'+'7b7b7b');
309                leftValid = false;
310            }
311            if(currentIndex==gallery.length-1){
312                //rightBtn.css('visibility', 'hidden');
313                rightBtn.css('background-color', '#'+'7b7b7b');
314                rightBtn.addClass('iLightboxDisabledButton');
315                rightValid = false;
316            }
317            if(currentIndex!=gallery.length-1 && currentIndex!=0){
318                leftBtn.css('visibility', 'visible');
319                rightBtn.css('visibility', 'visible');
320                leftBtn.removeClass('iLightboxDisabledButton');
321                rightBtn.removeClass('iLightboxDisabledButton');            
322                leftValid = true;
323                rightValid = true;            
324            }                 
325    
326        }        
327               
328       
329       function imageFirstTime(img){
330           if(gallery[currentIndex].img==null){
331               gallery[currentIndex].img = img;
332           }
333           expandLightbox();
334       }
335       
336       function expandLightbox(){
337           TweenMax.to(iPreloader, .2, {css:{opacity:0, scale: 0}, ease:Power3.EaseIn});
338           TweenMax.to(lgthBox, .4, {css:{height:jQuery(window).height(), top: 0}, delay: .3, ease:Power3.EaseIn, onComplete: function(){
339               lgthBox.css('height', '100%');
340               show_lgtb_image();
341           }});           
342       }
343       
344       var currentImage;
345       var isActive;
346       function show_lgtb_image(){
347            if(gallery[currentIndex].img==undefined || gallery[currentIndex].img == "" || gallery[currentIndex].img ==null){
348                //broken image                
349                return;
350            }
351            isActive = true;
352            currentImage = gallery[currentIndex].img;
353            currentImage.css('position', 'absolute');
354            currentImage.css('max-width', '80%');
355            currentImage.css('max-height', '80%');
356            currentImage.css('opacity', 0);
357            currentImage.appendTo(jQuery('#ilghtb_img'));
358                /* NOTE: (js) Enabled Context Menu once gain
359				currentImage.bind('contextmenu', function(e) {
360                    return false;
361                });
362				*/
363            jQuery('#ilghtb_caption').css('opacity', 0);
364            jQuery('#ilghtb_caption').html(gallery[currentIndex].itemDescription);            
365            lightBoxResize();
366            TweenMax.to(currentImage, .4, {css:{opacity: 1}, ease:Power3.easeIn});
367            TweenMax.to(jQuery('#ilghtb_caption'), .4, {css:{opacity: 1}, delay: .2, ease:Power3.easeIn});
368            TweenMax.to(jQuery('#ilghtb_controls'), .4, {css:{opacity: 1}, delay: .2, ease:Power3.easeIn});
369            
370            validateButtons();
371            secure_screen(false);                      
372       }
373       
374        jQuery(window).resize(function(){
375             lightBoxResize();            
376        });
377        
378        
379        function loadImage(callBack){
380            var url = gallery[currentIndex].imgURL;
381            var axjReq = new JQueryAJAX();        
382            axjReq.loadImage(url, function(img){            
383                callBack(img);
384            });        
385        }        
386        
387        
388        function lightBoxResize(){
389            try{
390                iPreloader.css('top', lgthBox.height()/2-preloaderSize/2+'px');
391                iPreloader.css('left', lgthBox.width()/2-preloaderSize/2+'px');
392                
393                if(isActive){
394                    if(currentImage!=null&&currentImage!=undefined){
395                        currentImage.css('left', lgthBox.width()/2-currentImage.width()/2+'px');
396                        currentImage.css('top', lgthBox.height()/2-currentImage.height()/2+'px');
397                    }                    
398                }
399                jQuery('#ilghtb_controls').css('left', lgthBox.width()/2-jQuery('#ilghtb_controls').width()/2+'px');            
400                
401            }catch(e){}
402        }       
403       
404       function gcc_ilightbox(){
405           try{
406               
407           }catch(e){}
408       }
409   }
410    /* end iGallery lightbox
411    ================================================== */    
412   
413   
414    function JQueryAJAX(){
415        /**
416         * load data trough get
417         */
418        this.getData = function(path, successCallBack, failCallBack){
419            jQuery.get(path, function(response){
420               //first responce                   
421            }).error(function() { failCallBack(); })
422            .success(function(response) {
423                successCallBack(response);           
424            })        
425        }
426        
427        this.loadImage = function(path, successCallBack, failCallBack){
428            var _url = path;
429            var _im =jQuery("<img />");
430            _im.bind("load",function(){ 
431                    successCallBack(jQuery(this));
432                });
433            _im.attr('src',_url);
434        }
435    }          
436        
437
438

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.