1(function($) { 2 $.fn.edupageAlbum2 = function(options) { 3 4 var opts = $.extend( {}, $.fn.edupageAlbum2.defaults, options); 5 var photos = opts.photos; 6 var thumbSize = 108; 7 var loadedImages = {}; 8 return this.each(function() { 9 var thisElem = this; 10 var $this = $(this); 11 var gallery = null; 12 /*var $photoContainer1 = $(this).find('.photos-photo-1'); 13 var $photoContainer2 = $(this).find('.photos-photo-2'); 14 var $aktContainer = $photoContainer1; 15 var $hiddenContainer = $photoContainer2; 16 var $photoTitleContainer = $(this).find('.photos-photo-title'); 17 var photosPerPage = 1; 18 var maxPages = 1; 19 var currentPageInd = -1; 20 var currentPhotoInd = 0; 21 var preloadingImageCount = 0; 22 var isPlaying = false; 23 var playInterval = 2000; 24 var minPhotoContainerHeight = 480; 25 var wasInner = false; 26 var loadHdPhotos = false;*/ 27 28 var canAutoOpenFullscreen = true; 29 if (window.ascFullscreenOpened) { 30 canAutoOpenFullscreen = false; 31 } 32 function isMobile() { 33 return MobileAppBridge.isActive() || opts.isMobile; 34 } 35 36 function initElements() { 37 var s = ''; 38 s += '<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">'; 39 40 s += '<div class="pswp__bg"></div>'; 41 42 43 s += '<div class="pswp__scroll-wrap">'; 44 45 46 s += '<div class="pswp__container">'; 47 s += '<div class="pswp__item"></div>'; 48 s += '<div class="pswp__item"></div>'; 49 s += '<div class="pswp__item"></div>'; 50 s += '</div>'; 51 52 53 s += '<div class="pswp__ui pswp__ui--hidden">'; 54 55 s += '<div class="pswp__top-bar">'; 56 57 s += '<div class="pswp__counter"></div>'; 58 59 s += '<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>'; 60 61 s += '<button class="pswp__button pswp__button--share" title="Share"></button>'; 62 63 s += '<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>'; 64 65 s += '<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>'; 66 67 68 s += '<div class="pswp__preloader">'; 69 s += '<div class="pswp__preloader__icn">'; 70 s += '<div class="pswp__preloader__cut">'; 71 s += '<div class="pswp__preloader__donut"></div>'; 72 s += '</div>'; 73 s += '</div>'; 74 75 s += '</div>'; 76 s += '</div>'; 77 78 s += '<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">'; 79 s += '<div class="pswp__share-tooltip"></div>'; 80 s += '</div>'; 81 82 s += '<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">'; 83 s += '</button>'; 84 85 s += '<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">'; 86 s += '</button>'; 87 88 s += '<div class="pswp__caption">'; 89 s += '<div class="pswp__caption__center"></div>'; 90 s += '</div>'; 91 s += '</div>'; 92 s += '</div>'; 93 s += '</div>'; 94 95 $this.addClass('photos-galleryViewer'); 96 if (isMobile()) { 97 $this.toggleClass('photos-galleryViewer-mobile', true); 98 } else { 99 $this.toggleClass('photos-galleryViewer-web', true); 100 } 101 102 $this.html(''); 103 var pswpElement = $(s).appendTo($this); 104 105 var items = []; 106 107 for (var i=0;i<photos.length;i++) { 108 var photo = photos[i]; 109 items.push({ 110 src: photo.hdsrc ? photo.hdsrc : photo.src, 111 title: (photo.title ? ''+photo.title : opts.galleryDesc),//Date.fromDbString(photo.time).format('D d.m.Y H:i')+ 112 w: photo.width ? photo.width : 1200, 113 h: photo.height ? photo.height : 800 114 }); 115 } 116 117 gallery = new PhotoSwipe( pswpElement.get(0), PhotoSwipeUI_Default, items, { 118 index: 0, 119 closeOnScroll: false, 120 closeOnVerticalDrag: false, 121 history: false, 122 tapToClose: false, 123 clickToCloseNonZoomable: false, 124 fullscreenEl: !MobileAppBridge.isIOS(), 125 shareEl: false, 126 pinchToClose : false, 127 loop: false 128 }); 129 130 gallery.init(); 131 var galleryClosing = false; 132 gallery.listen('close', function(e) { 133 if (MobileAppBridge.isV2Active()) { 134 setTimeout(function() { 135 EdupageApp.popView(); 136 },10); 137 } else { 138 139 galleryClosing = true; 140 /*$this.closest('.photos-galleryWindow').toggleClass('closing',false); 141 setTimeout(function() {*/ 142 143 close(true); 144 setTimeout(function() { 145 cancelFullscreen(); 146 //MobileAppBridge.runFlexMethod('fullScreenClose',{}); 147 },120); 148 //},200); 149 } 150 151 }); 152 153 gallery.listen('imageLoadComplete',function(index,item) { 154 if (index == 0) { 155 setTimeout(function() { 156 $this.toggleClass('firstLoaded', true); 157 $this.closest('.photos-galleryWindow').toggleClass('loaded',true); 158 },700); 159 } 160 }); 161 162 //$this.closest('.photos-galleryWindow').toggleClass('loaded',true); 163 164 165 $(window).on('resize.edupageAlbum2',function() { 166 if (galleryClosing) { 167 $(window).off('resize.edupageAlbum2'); 168 return; 169 } 170 if ($(window).width() > $(window).height()) { 171 gallery.ui.hideControls(); 172 if (canAutoOpenFullscreen && !MobileAppBridge.isIOS()) { 173 openFullscreen(); 174 175 canAutoOpenFullscreen = false; 176 } 177 } else { 178 gallery.ui.showControls(); 179 canAutoOpenFullscreen = true; 180 } 181 182 gallery.updateSize(true); 183 }); 184 185 if (window.ascFullscreenOpened) { 186 canAutoOpenFullscreen = false; 187 setTimeout(function() { 188 $(window).resize(); 189 gallery.updateSize(true); 190 document.dispatchEvent(new Event('fullscreenchange'));
191 },100); 192 } 193 } 194 195 196 function close(noFullScreenClose) { 197 $(window).off('resize.edupageAlbum2'); 198 setTimeout(function() { 199 window.edupageOpenedGallery = ''; 200 },300); 201 202 if (MobileAppBridge.isActive()) { 203 204 if (!noFullScreenClose) { 205 cancelFullscreen(); 206 } 207 setTimeout(function() { 208 $this.closest('.photos-galleryWindow').remove(); 209 },50); 210 211 } else { 212 $j(window).off('hashchange.galleryviewer') 213 $this.closest('.photos-galleryWindow').remove(); 214 215 } 216 217 218 } 219 220 function fullScreenElement() { 221 return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement; 222 } 223 224 function openFullscreen() { 225 if (MobileAppBridge.isActive() && !window.ascFullscreenOpened) { 226 227 228 MobileAppBridge.runFlexMethod('fullScreenOpen',{}); 229 window.ascFullscreenOpened = true; 230 231 setTimeout(function() { 232 $(window).resize(); 233 gallery.updateSize(true); 234 235 },100); 236 document.dispatchEvent(new Event('fullscreenchange'));
237 238 239 } 240 } 241 function cancelFullscreen() { 242 if (MobileAppBridge.isActive() && window.ascFullscreenOpened) { 243 window.ascFullscreenOpened = false; 244 canAutoOpenFullscreen = false; 245 246 MobileAppBridge.runFlexMethod('fullScreenClose',{}); 247 248 setTimeout(function() { 249 $(window).resize(); 250 251 },200); 252 document.dispatchEvent(new Event('fullscreenchange')); 253 } 254 } 255 256 257 if (MobileAppBridge.isActive()) { 258 259 //MobileAppBridge.runFlexMethod('fullScreenOpen',{}); 260 setTimeout(function() { 261 initElements(); 262 },200); 263 } else { 264 initElements(); 265 } 266 267 window.edupageOpenedGallery = opts.albumid+':'+opts.galleryid; 268 269 if (MobileAppBridge.isActive() && !MobileAppBridge.isV2Active()) { 270 MobileAppBridge.registerBackHandler($(this), function() { 271 close(true); 272 setTimeout(function() { 273 cancelFullscreen(); 274 //MobileAppBridge.runFlexMethod('fullScreenClose',{}); 275 },120); 276 }); 277 278 279 } 280 }); 281 } 282 283 $.fn.edupageAlbum2.defaults = { 284 photos: [], 285 selectedPhoto: 0, 286 galleryTitle: '', 287 gallerySubtitle: '', 288 albumTitle: 'Photoalbum', 289 closeTitle: 'Close', 290 onFullScreen: null, 291 showTitle: true, 292 noPhotosTitle: 'No photos in this gallery.', 293 btnViewImageTitle: 'Show image in a new window', 294 btnFullScreenTitle: 'Open / close full screen', 295 btnPlayPauseTitle: 'Play / pause', 296 showSlideShow: true, 297 mozeIstNaspat: true 298 }; 299 300}(jQuery));
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.