WP Photo Album Plus - Version 6.9.09

Version Description

  • Panorama support phase III.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 6.9.09
Comparing to
See all releases

Code changes from version 6.9.08 to 6.9.09

changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
3
  = 6.9.08 =
4
 
5
  = Bug Fixes =
1
  WP Photo Album Plus Changelog
2
 
3
+ = 6.9.09 =
4
+
5
+ = New Features =
6
+
7
+ * Panorama images phase III: Lightbox supports panoramic images.
8
+
9
  = 6.9.08 =
10
 
11
  = Bug Fixes =
js/wppa-lightbox.js CHANGED
@@ -3,7 +3,7 @@
3
  // Conatins lightbox modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaLightboxVersion = '6.8.08';
7
 
8
  // Global inits
9
  var wppaNormsBtnOpac = 0.75;
@@ -15,6 +15,8 @@ var wppaOvlMode = '';
15
  var wppaOvlCurIdx = 0;
16
  var wppaOvlSvgInverse = false;
17
  var wppaOvlFsExitBtnSize = '48';
 
 
18
 
19
  // Global size specs
20
  var wppaSavedContainerWidth = 0;
@@ -193,6 +195,19 @@ wppaConsoleLog( 'wppaOvlNorm' );
193
  function wppaOvlShow( arg ) {
194
  wppaConsoleLog( 'wppaOvlShow arg=' + arg );
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  // Do the setup right after the invocation of the lightbox
197
  if ( wppaOvlFirst ) {
198
 
@@ -233,6 +248,9 @@ wppaConsoleLog( 'wppaOvlShow arg=' + arg );
233
  wppaOvlVideoNaturalHeights = [];
234
  wppaOvlImgs = [];
235
  wppaOvlIdx = 0;
 
 
 
236
 
237
  // Do we use rel or data-rel?
238
  var rel;
@@ -280,6 +298,19 @@ wppaConsoleLog( 'wppaOvlShow arg=' + arg );
280
  wppaOvlAudioHtmls[j] = jQuery( anchor ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-audiohtml' ) ) : '';
281
  wppaOvlVideoNaturalWidths[j] = jQuery( anchor ).attr( 'data-videonatwidth' ) ? jQuery( anchor ).attr( 'data-videonatwidth' ) : '';
282
  wppaOvlVideoNaturalHeights[j] = jQuery( anchor ).attr( 'data-videonatheight' ) ? jQuery( anchor ).attr( 'data-videonatheight' ) : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
283
  if ( anchor.href == arg.href ) {
284
  wppaOvlIdx = j; // Current index
285
  }
@@ -303,6 +334,18 @@ wppaConsoleLog( 'wppaOvlShow arg=' + arg );
303
  wppaOvlAudioHtmls[0] = jQuery( arg ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-audiohtml' ) ) : '';
304
  wppaOvlVideoNaturalWidths[0] = jQuery( arg ).attr( 'data-videonatwidth' ) ? jQuery( arg ).attr( 'data-videonatwidth' ) : '';
305
  wppaOvlVideoNaturalHeights[0] = jQuery( arg ).attr( 'data-videonatheight' ) ? jQuery( arg ).attr( 'data-videonatheight' ) : '';
 
 
 
 
 
 
 
 
 
 
 
 
306
  wppaOvlIdx = 0;
307
  }
308
  }
@@ -312,6 +355,8 @@ wppaConsoleLog( 'wppaOvlShow arg=' + arg );
312
  wppaOvlIdx = arg;
313
  }
314
 
 
 
315
  // Now start the actual function
316
  setTimeout( function(){ _wppaOvlShow( wppaOvlIdx )}, 1 );
317
 
@@ -340,9 +385,9 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
340
  wppaOvlImgs[idx] = new Image();
341
  wppaOvlImgs[idx].src = wppaOvlUrls[idx]; // Preload
342
  wppaConsoleLog( 'Preloading ' + ( idx + 1 ) + '/' + wppaOvlUrls.length + ' (current)' );
343
- if ( ! wppaIsIe && ! wppaOvlImgs[idx].complete ) {
344
  wppaConsoleLog( 'Retrying preload current image' );
345
- setTimeout( '_wppaOvlShow(' + idx + ')', 10 );
346
  return;
347
  }
348
  }
@@ -358,7 +403,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
358
  next = wppaOvlIdx + 1;
359
  }
360
  // only if not video
361
- if ( wppaOvlVideoHtmls[next] == '' ) {
362
  wppaOvlImgs[next] = new Image();
363
  wppaOvlImgs[next].src = wppaOvlUrls[next]; // Preload
364
  wppaConsoleLog( 'Preloading > ' + ( next + 1 ) );
@@ -366,7 +411,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
366
 
367
  // Preload previous ( for hitting the prev button )
368
  // Only when in browsemode
369
- if ( ! wppaOvlRunning ) {
370
  if ( wppaOvlIdx == 0 ) {
371
  prev = wppaOvlUrls.length-1;
372
  }
@@ -388,12 +433,33 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
388
  // A single image?
389
  wppaOvlIsSingle = ( wppaOvlUrls.length == 1 );
390
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  // Fullsize?
392
- if ( wppaOvlMode != 'normal' ) {
393
  var html;
394
 
 
 
 
 
 
395
  // Fullsize Video
396
- if ( wppaIsVideo ) {
397
  html =
398
  '<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+'px; height:'+screen.height+'px; left:0px; top:0px; text-align:center;" >'+
399
  '<video id="wppa-overlay-img" controls preload="metadata"' +
@@ -483,7 +549,8 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
483
  '</div>';
484
 
485
 
486
- // The 'back to normal' icon
 
487
  html += '<div' +
488
  ' id="wppa-norms-btn"' +
489
  ' style="height:48px;z-index:100098;position:fixed;top:0;right:' + wppaOvlFsExitBtnSize + 'px;opacity:' + wppaNormsBtnOpac + ';"' +
@@ -495,6 +562,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
495
  ' >' +
496
  wppaSvgHtml( 'Exit-Full-Screen', wppaOvlFsExitBtnSize+'px', true, true, '0', '0', '0', '0' ) +
497
  '</div>';
 
498
 
499
  // Replacing the html stops a running video,
500
  // so we only replace html on a new id, or a photo without audio
@@ -504,14 +572,14 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
504
  jQuery( '#wppa-overlay-ic' ).html( html );
505
  }
506
 
 
 
 
 
 
507
  // Disable right mouse button optionally
508
  wppaProtect();
509
- // jQuery( '#wppa-overlay-img' ).bind( 'contextmenu', function(e) {
510
- // return false;
511
- // });
512
 
513
- // Replace svg img src to html
514
- // wppaReplaceSvg();
515
 
516
  wppaOvlIsVideo = wppaIsVideo;
517
  setTimeout( 'wppaOvlFormatFull()', 1 );
@@ -523,8 +591,10 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
523
  }
524
  wppaOvlFirst = false;
525
 
 
 
526
  // Record we are in
527
- wppaOvlOpen = true;
528
 
529
  return false;
530
  }
@@ -762,7 +832,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
762
  wppaOvlTitles[idx] +
763
  '</div>';
764
  '</div>';
765
- //alert(html);
766
  // Insert the html
767
  jQuery( '#wppa-overlay-ic' ).html( html );
768
 
@@ -770,15 +840,17 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
770
  // wppaReplaceSvg();
771
 
772
  // Restore opacity of fs and exit buttons
773
- // wppaShowFsButtons();
774
 
775
  // Disable right mouse button
776
  jQuery( '#wppa-overlay-img' ).bind( 'contextmenu', function(e) {
777
  return false;
778
  });
779
 
780
- // Size
781
- wppaOvlResize();
 
 
782
 
783
  // Show fs and exit buttons
784
  if ( wppaOvlFirst ) {
@@ -786,7 +858,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
786
  }
787
 
788
  // Record we are in
789
- wppaOvlOpen = true;
790
 
791
  // Done!
792
  return false;
@@ -797,6 +869,9 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
797
  function wppaOvlSize( speed ) {
798
  wppaConsoleLog( 'wppaOvlSize' );
799
 
 
 
 
800
  var img = document.getElementById( 'wppa-overlay-img' ); // Do NOT jquerify this:
801
  var txt = document.getElementById( 'wppa-overlay-txt' ); // jQuery does not support .naturalHeight etc.
802
 
@@ -926,6 +1001,11 @@ wppaConsoleLog( 'wppaOvlSize' );
926
  function wppaOvlFormatFull() {
927
  wppaConsoleLog( 'wppaOvlFormatFull '+wppaOvlMode );
928
 
 
 
 
 
 
929
  var img;
930
  var natWidth;
931
  var natHeight;
@@ -1205,6 +1285,9 @@ wppaConsoleLog( 'wppaOvlHide' );
1205
  jQuery( '#wppa-fulls-btn' ).stop().fadeOut( 300 );
1206
  jQuery( '#wppa-exit-btn' ).stop().fadeOut( 300 );
1207
 
 
 
 
1208
  // Record we are out
1209
  wppaOvlOpen = false;
1210
  }
@@ -1264,6 +1347,7 @@ wppaConsoleLog( 'wppaInitOverlay' );
1264
  wppaOvlFsPhotoId = 0; // Reset ovl fullscreen photo id
1265
  wppaPhotoId = 0;
1266
  wppaOvlCurIdx = 0;
 
1267
 
1268
  // First time ?
1269
  if ( wppaSavedContainerWidth == 0 ) {
@@ -1292,43 +1376,16 @@ wppaConsoleLog( 'wppaInitOverlay' );
1292
 
1293
  // found one
1294
  wppaWppaOverlayActivated = true;
1295
- /*
1296
- // Install handler
1297
- if ( wppaIsMobile ) {
1298
 
1299
- // Install ontouch handlers
1300
- jQuery( anchor ).on( 'touchstart', function( event ) { // tap
1301
-
1302
- wppaStartTime();
1303
-
1304
- });
1305
- jQuery( anchor ).on( 'touchend', function( event ) { // tap
1306
-
1307
- if ( wppaInTime() ) {
1308
- wppaOvlShow( this );
1309
- }
1310
- event.preventDefault();
1311
- });
1312
-
1313
- }
1314
- else {
1315
- */
1316
  // Install onclick handler
1317
  jQuery( anchor ).on( 'click', function( event ) {
1318
  wppaOvlShow( this );
1319
  event.preventDefault();
1320
  });
1321
- /*
1322
- }
1323
- */
1324
  // Set cursor to magnifier
1325
  jQuery( anchor ).css( 'cursor', 'url( ' + wppaImageDirectory + wppaMagnifierCursor + ' ),auto' );
1326
- //alert( 'url( wppaImageDirectory + wppaMagnifierCursor ),auto' );
1327
 
1328
- // // Install orientationchange handler if mobile
1329
- // if ( wppaIsMobile ) {
1330
- // window.addEventListener( 'orientationchange', wppaDoOnOrientationChange);
1331
- // }
1332
  }
1333
  }
1334
 
@@ -1347,6 +1404,11 @@ wppaConsoleLog( 'wppaInitOverlay' );
1347
  function wppaOvlResize() {
1348
  wppaConsoleLog( 'wppaOvlResize' );
1349
 
 
 
 
 
 
1350
  // After resizing, the number of lines may have changed
1351
  setTimeout( 'wppaOvlSize( '+wppaOvlAnimSpeed+' )', 10 );
1352
 
3
  // Conatins lightbox modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaLightboxVersion = '6.9.09';
7
 
8
  // Global inits
9
  var wppaNormsBtnOpac = 0.75;
15
  var wppaOvlCurIdx = 0;
16
  var wppaOvlSvgInverse = false;
17
  var wppaOvlFsExitBtnSize = '48';
18
+ var wppaOvlActivePanorama = 0;
19
+ var wppaOvlHasPanoramas = false;
20
 
21
  // Global size specs
22
  var wppaSavedContainerWidth = 0;
195
  function wppaOvlShow( arg ) {
196
  wppaConsoleLog( 'wppaOvlShow arg=' + arg );
197
 
198
+ var panData;
199
+ var dotPos;
200
+
201
+ // Panorama requires image container top=0 left=0
202
+ // Non panorama: 50%
203
+ if ( wppaOvlActivePanorama > 0 ) {
204
+ jQuery( '#wppa-overlay-ic' ).css({top:0,left:0});
205
+ }
206
+ else {
207
+ jQuery( '#wppa-overlay-ic' ).css({top:'50%',left:'50%'});
208
+ }
209
+ // jQuery( '#wppa-overlay-ic' ).css({top:'50%',left:'50%'});
210
+
211
  // Do the setup right after the invocation of the lightbox
212
  if ( wppaOvlFirst ) {
213
 
248
  wppaOvlVideoNaturalHeights = [];
249
  wppaOvlImgs = [];
250
  wppaOvlIdx = 0;
251
+ wppaOvlPanoramaHtml = [];
252
+ wppaOvlPanoramaIds = [];
253
+ wppaOvlHasPanoramas = false;
254
 
255
  // Do we use rel or data-rel?
256
  var rel;
298
  wppaOvlAudioHtmls[j] = jQuery( anchor ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-audiohtml' ) ) : '';
299
  wppaOvlVideoNaturalWidths[j] = jQuery( anchor ).attr( 'data-videonatwidth' ) ? jQuery( anchor ).attr( 'data-videonatwidth' ) : '';
300
  wppaOvlVideoNaturalHeights[j] = jQuery( anchor ).attr( 'data-videonatheight' ) ? jQuery( anchor ).attr( 'data-videonatheight' ) : '';
301
+ panData = jQuery( anchor ).attr( 'data-panorama' ) ? jQuery( anchor ).attr( 'data-panorama' ) : '';
302
+
303
+ if ( panData.length > 0 ) {
304
+ wppaOvlHasPanoramas = true;
305
+ dotPos = panData.indexOf( '.' );
306
+ wppaOvlPanoramaHtml[j] = panData.substr(dotPos+1);
307
+ wppaOvlPanoramaIds[j] = panData.substr(0,dotPos);
308
+ }
309
+ else {
310
+ wppaOvlPanoramaHtml[j] = '';
311
+ wppaOvlPanoramaIds[j] = 0;
312
+ }
313
+
314
  if ( anchor.href == arg.href ) {
315
  wppaOvlIdx = j; // Current index
316
  }
334
  wppaOvlAudioHtmls[0] = jQuery( arg ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-audiohtml' ) ) : '';
335
  wppaOvlVideoNaturalWidths[0] = jQuery( arg ).attr( 'data-videonatwidth' ) ? jQuery( arg ).attr( 'data-videonatwidth' ) : '';
336
  wppaOvlVideoNaturalHeights[0] = jQuery( arg ).attr( 'data-videonatheight' ) ? jQuery( arg ).attr( 'data-videonatheight' ) : '';
337
+ panData = jQuery( arg ).attr( 'data-panorama' );
338
+
339
+ if ( panData.length > 0 ) {
340
+ wppaOvlHasPanoramas = true;
341
+ dotPos = panData.indexOf( '.' );
342
+ wppaOvlPanoramaHtml[0] = panData.substr(dotPos+1);
343
+ wppaOvlPanoramaIds[0] = panData.substr(0,dotPos);
344
+ }
345
+ else {
346
+ wppaOvlPanoramaHtml[0] = '';
347
+ wppaOvlPanoramaIds[0] = 0;
348
+ }
349
  wppaOvlIdx = 0;
350
  }
351
  }
355
  wppaOvlIdx = arg;
356
  }
357
 
358
+ wppaOvlOpen = true;
359
+
360
  // Now start the actual function
361
  setTimeout( function(){ _wppaOvlShow( wppaOvlIdx )}, 1 );
362
 
385
  wppaOvlImgs[idx] = new Image();
386
  wppaOvlImgs[idx].src = wppaOvlUrls[idx]; // Preload
387
  wppaConsoleLog( 'Preloading ' + ( idx + 1 ) + '/' + wppaOvlUrls.length + ' (current)' );
388
+ if ( ! wppaIsIe && ! wppaOvlImgs[idx].complete && wppaOvlOpen ) {
389
  wppaConsoleLog( 'Retrying preload current image' );
390
+ setTimeout( '_wppaOvlShow(' + idx + ')', 100 );
391
  return;
392
  }
393
  }
403
  next = wppaOvlIdx + 1;
404
  }
405
  // only if not video
406
+ if ( wppaOvlVideoHtmls[next] == '' && wppaOvlOpen ) {
407
  wppaOvlImgs[next] = new Image();
408
  wppaOvlImgs[next].src = wppaOvlUrls[next]; // Preload
409
  wppaConsoleLog( 'Preloading > ' + ( next + 1 ) );
411
 
412
  // Preload previous ( for hitting the prev button )
413
  // Only when in browsemode
414
+ if ( ! wppaOvlRunning && wppaOvlOpen ) {
415
  if ( wppaOvlIdx == 0 ) {
416
  prev = wppaOvlUrls.length-1;
417
  }
433
  // A single image?
434
  wppaOvlIsSingle = ( wppaOvlUrls.length == 1 );
435
 
436
+ // If there are panoramas, switch to fullscreen, if not yet
437
+ if ( wppaOvlHasPanoramas && wppaOvlMode == 'normal' ) {
438
+ // wppaOvlFull();
439
+ }
440
+
441
+ // Panorama requires image container top=0 left=0
442
+ // Non panorama: 50%
443
+ if ( wppaOvlPanoramaIds[idx] > 0 ) {
444
+ wppaOvlActivePanorama = wppaOvlPanoramaIds[idx];
445
+ jQuery( '#wppa-overlay-ic' ).css({top:0,left:0});
446
+ }
447
+ else {
448
+ wppaOvlActivePanorama = 0;
449
+ jQuery( '#wppa-overlay-ic' ).css({top:'50%',left:'50%'});
450
+ }
451
+
452
  // Fullsize?
453
+ if ( wppaOvlMode != 'normal' || wppaOvlActivePanorama ) {
454
  var html;
455
 
456
+ // Fullsize panorama?
457
+ if ( wppaOvlActivePanorama ) {
458
+ html = wppaOvlPanoramaHtml[idx];
459
+ }
460
+
461
  // Fullsize Video
462
+ else if ( wppaIsVideo ) {
463
  html =
464
  '<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+'px; height:'+screen.height+'px; left:0px; top:0px; text-align:center;" >'+
465
  '<video id="wppa-overlay-img" controls preload="metadata"' +
549
  '</div>';
550
 
551
 
552
+ // The 'back to normal' icon, only on non-panorama
553
+ if ( wppaOvlMode != 'normal' ) {
554
  html += '<div' +
555
  ' id="wppa-norms-btn"' +
556
  ' style="height:48px;z-index:100098;position:fixed;top:0;right:' + wppaOvlFsExitBtnSize + 'px;opacity:' + wppaNormsBtnOpac + ';"' +
562
  ' >' +
563
  wppaSvgHtml( 'Exit-Full-Screen', wppaOvlFsExitBtnSize+'px', true, true, '0', '0', '0', '0' ) +
564
  '</div>';
565
+ }
566
 
567
  // Replacing the html stops a running video,
568
  // so we only replace html on a new id, or a photo without audio
572
  jQuery( '#wppa-overlay-ic' ).html( html );
573
  }
574
 
575
+ // If panorama and single, hide panorama browse buttons
576
+ if ( wppaOvlPanoramaIds[idx] > 0 && wppaOvlIsSingle ) {
577
+ jQuery( '.wppa-panorama-prevnext' ). hide();
578
+ }
579
+
580
  // Disable right mouse button optionally
581
  wppaProtect();
 
 
 
582
 
 
 
583
 
584
  wppaOvlIsVideo = wppaIsVideo;
585
  setTimeout( 'wppaOvlFormatFull()', 1 );
591
  }
592
  wppaOvlFirst = false;
593
 
594
+ // ??
595
+ wppaShowFsButtons();
596
  // Record we are in
597
+ // wppaOvlOpen = true;
598
 
599
  return false;
600
  }
832
  wppaOvlTitles[idx] +
833
  '</div>';
834
  '</div>';
835
+
836
  // Insert the html
837
  jQuery( '#wppa-overlay-ic' ).html( html );
838
 
840
  // wppaReplaceSvg();
841
 
842
  // Restore opacity of fs and exit buttons
843
+ wppaShowFsButtons();
844
 
845
  // Disable right mouse button
846
  jQuery( '#wppa-overlay-img' ).bind( 'contextmenu', function(e) {
847
  return false;
848
  });
849
 
850
+ // Size if not panorama
851
+ if ( wppaOvlPanoramaIds[idx] == 0 ) {
852
+ wppaOvlResize();
853
+ }
854
 
855
  // Show fs and exit buttons
856
  if ( wppaOvlFirst ) {
858
  }
859
 
860
  // Record we are in
861
+ // wppaOvlOpen = true;
862
 
863
  // Done!
864
  return false;
869
  function wppaOvlSize( speed ) {
870
  wppaConsoleLog( 'wppaOvlSize' );
871
 
872
+ // Panoramas do their own formatting
873
+ if ( wppaOvlActivePanorama ) return;
874
+
875
  var img = document.getElementById( 'wppa-overlay-img' ); // Do NOT jquerify this:
876
  var txt = document.getElementById( 'wppa-overlay-txt' ); // jQuery does not support .naturalHeight etc.
877
 
1001
  function wppaOvlFormatFull() {
1002
  wppaConsoleLog( 'wppaOvlFormatFull '+wppaOvlMode );
1003
 
1004
+ // Panoramas do their own formatting
1005
+ if ( wppaOvlActivePanorama > 0 ) {
1006
+ return;
1007
+ }
1008
+
1009
  var img;
1010
  var natWidth;
1011
  var natHeight;
1285
  jQuery( '#wppa-fulls-btn' ).stop().fadeOut( 300 );
1286
  jQuery( '#wppa-exit-btn' ).stop().fadeOut( 300 );
1287
 
1288
+ // Stop any panorama from running the renderer
1289
+ wppaOvlActivePanorama = 0;
1290
+
1291
  // Record we are out
1292
  wppaOvlOpen = false;
1293
  }
1347
  wppaOvlFsPhotoId = 0; // Reset ovl fullscreen photo id
1348
  wppaPhotoId = 0;
1349
  wppaOvlCurIdx = 0;
1350
+ wppaOvlActivePanorama = 0;
1351
 
1352
  // First time ?
1353
  if ( wppaSavedContainerWidth == 0 ) {
1376
 
1377
  // found one
1378
  wppaWppaOverlayActivated = true;
 
 
 
1379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1380
  // Install onclick handler
1381
  jQuery( anchor ).on( 'click', function( event ) {
1382
  wppaOvlShow( this );
1383
  event.preventDefault();
1384
  });
1385
+
 
 
1386
  // Set cursor to magnifier
1387
  jQuery( anchor ).css( 'cursor', 'url( ' + wppaImageDirectory + wppaMagnifierCursor + ' ),auto' );
 
1388
 
 
 
 
 
1389
  }
1390
  }
1391
 
1404
  function wppaOvlResize() {
1405
  wppaConsoleLog( 'wppaOvlResize' );
1406
 
1407
+ // Not if panorama
1408
+ if ( wppaOvlActivePanorama > 0 ) {
1409
+ return;
1410
+ }
1411
+
1412
  // After resizing, the number of lines may have changed
1413
  setTimeout( 'wppaOvlSize( '+wppaOvlAnimSpeed+' )', 10 );
1414
 
js/wppa-lightbox.min.js CHANGED
@@ -1 +1 @@
1
- var wppaSavedContainerHeight,wppaSavedMarginLeft,wppaSavedMarginTop,wppaSavedImageWidth,wppaSavedImageHeight,wppaLightboxVersion="6.8.08",wppaNormsBtnOpac=.75,wppaIsVideo=!1,wppaHasAudio=!1,wppaOvlImgs=[],wppaKbHandlerInstalled=!1,wppaOvlMode="",wppaOvlCurIdx=0,wppaOvlSvgInverse=!1,wppaOvlFsExitBtnSize="48",wppaSavedContainerWidth=0;function wppaDoOnOrientationChange(p){"normal"!=wppaOvlMode&&document.getElementById("wppa-overlay-img")&&setTimeout("wppaOvlShow( "+wppaOvlIdx+" )",10)}function wppaOvlKeyboardHandler(p){var a,e;null==p?(a=event.keyCode,e=27):(a=p.keyCode,e=27);var t=String.fromCharCode(a).toLowerCase();switch(a){case e:wppaStopVideo(mocc),"normal"!=wppaOvlMode&&wppaOvlNorm(!0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(t){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"d":jQuery("#wppa-ovl-legenda-1").css("visibility","hidden"),jQuery("#wppa-ovl-legenda-2").css("visibility","hidden"),wppaShowLegenda="hidden";break;case"f":wppaOvlFull();break;case"l":wppaOvlNorm();break;case"q":case"x":wppaStopVideo(mocc),"normal"!=wppaOvlMode&&wppaOvlNorm(!0),wppaOvlHide()}return!1}function wppaOvlFull(p){wppaConsoleLog("wppaOvlFull"),wppaNormsBtnOpac=.75;var a=wppaOvlMode;p||wppaOvlStepMode();var e=document.getElementById("wppa-overlay-ic");e&&((p||"normal"==a)&&(e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(),setTimeout(function(){wppaOvlShow(wppaOvlIdx)},50)),"normal"==wppaOvlMode&&(document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()),setTimeout(function(){wppaShowFsButtons(.75)},30),jQuery("#wppa-ovl-legenda-1").html(""))}function wppaOvlNorm(p){wppaConsoleLog("wppaOvlNorm"),wppaOvlMode="normal",wppaNormsBtnOpac=.75,document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen(),p?wppaOvlMode=wppaOvlModeInitial:(setTimeout(function(){wppaShowFsButtons(.75)},30),setTimeout(function(){wppaOvlShow(wppaOvlIdx)},50))}function wppaOvlShow(p){if(wppaConsoleLog("wppaOvlShow arg="+p),wppaOvlFirst&&(jQuery("#weaver-final").removeClass("wvr-hide-bang"),jQuery("#wppa-overlay-bg").stop().fadeTo(3,wppaOvlOpacity),wppaKbHandlerInstalled||(jQuery(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),jQuery("#wppa-overlay-bg").css({width:window.innerWidth,height:window.innerHeight}),"normal"!=wppaOvlModeInitial&&wppaOvlFull(!0)),"object"==typeof p){wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlImgs=[],wppaOvlIdx=0;var a=(p.rel?p.rel:!!jQuery(p).attr("data-rel")&&jQuery(p).attr("data-rel")).split("[");if(a[1]){var e,t,o=a[1],l=jQuery("a"),i=0;for(t=0;t<l.length;t++)e=l[t],(a=!!jQuery(e).attr("data-rel")&&jQuery(e).attr("data-rel").split("[")).length>1&&"wppa"==a[0]&&a[1]==o&&(wppaOvlUrls[i]=e.href,jQuery(e).attr("data-lbtitle")?wppaOvlTitles[i]=wppaRepairScriptTags(jQuery(e).attr("data-lbtitle")):wppaOvlTitles[i]=wppaRepairScriptTags(e.title),wppaOvlAlts[i]=jQuery(e).attr("data-alt")?jQuery(e).attr("data-alt"):"",wppaOvlVideoHtmls[i]=jQuery(e).attr("data-videohtml")?decodeURI(jQuery(e).attr("data-videohtml")):"",wppaOvlAudioHtmls[i]=jQuery(e).attr("data-audiohtml")?decodeURI(jQuery(e).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[i]=jQuery(e).attr("data-videonatwidth")?jQuery(e).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[i]=jQuery(e).attr("data-videonatheight")?jQuery(e).attr("data-videonatheight"):"",e.href==p.href&&(wppaOvlIdx=i),i++)}else wppaOvlUrls[0]=p.href,jQuery(p).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(jQuery(p).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(p.title),wppaOvlAlts[0]=jQuery(p).attr("data-alt")?jQuery(p).attr("data-alt"):"",wppaOvlVideoHtmls[0]=jQuery(p).attr("data-videohtml")?decodeURI(jQuery(p).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=jQuery(p).attr("data-audiohtml")?decodeURI(jQuery(p).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[0]=jQuery(p).attr("data-videonatwidth")?jQuery(p).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=jQuery(p).attr("data-videonatheight")?jQuery(p).attr("data-videonatheight"):"",wppaOvlIdx=0}else wppaOvlIdx=p;setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},1)}function _wppaOvlShow(p){if(wppaConsoleLog("_wppaOvlShow, idx="+p),wppaOvlCurIdx=p,wppaOvlFirst&&jQuery("#wppa-ovl-spin").fadeIn(500),wppaIsVideo=""!=wppaOvlVideoHtmls[p],wppaHasAudio=""!=wppaOvlAudioHtmls[p],wppaOvlUrls[p].length>0&&!wppaIsVideo&&(wppaOvlImgs[p]=new Image,wppaOvlImgs[p].src=wppaOvlUrls[p],wppaConsoleLog("Preloading "+(p+1)+"/"+wppaOvlUrls.length+" (current)"),!wppaIsIe&&!wppaOvlImgs[p].complete))return wppaConsoleLog("Retrying preload current image"),void setTimeout("_wppaOvlShow("+p+")",10);var a,e;if(a=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,""==wppaOvlVideoHtmls[a]&&(wppaOvlImgs[a]=new Image,wppaOvlImgs[a].src=wppaOvlUrls[a],wppaConsoleLog("Preloading > "+(a+1))),wppaOvlRunning||(e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1,""==wppaOvlVideoHtmls[e]&&(wppaOvlImgs[e]=new Image,wppaOvlImgs[e].src=wppaOvlUrls[e],wppaConsoleLog("Preloading < "+(e+1)))),wppaPhotoId=wppaUrlToId(wppaOvlUrls[p]),_bumpViewCount(wppaPhotoId),wppaOvlIsSingle=1==wppaOvlUrls.length,"normal"!=wppaOvlMode){wppaIsVideo?(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video><div style=\"height: 20px; width: 100%; position:absolute; top:0; left:0;\" onmouseover=\"jQuery('#wppa-ovl-legenda-2').css('visibility','visible');\" onmouseout=\"jQuery('#wppa-ovl-legenda-2').css('visibility','hidden');wppaShowLegenda='hidden';\" >",wppaOvlShowLegenda&&(l+='<div id="wppa-ovl-legenda-2" style="position:fixed; left:0; top:0; background-color:'+("black"==wppaOvlTheme?"#272727":"#a7a7a7")+"; color:"+("black"==wppaOvlTheme?"#a7a7a7":"#272727")+"; visibility:"+wppaShowLegenda+';" >Mode='+wppaOvlMode+". "+(wppaOvlIsSingle?wppaOvlFullLegendaSingle:wppaOvlFullLegenda)+"</div>"),l+="</div>"):(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" src="'+wppaOvlUrls[p]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),l+="<div style=\"height: 20px; width: 100%; position:absolute; top:0; left:0;\" onmouseover=\"jQuery('#wppa-ovl-legenda-2').css('visibility','visible');\" onmouseout=\"jQuery('#wppa-ovl-legenda-2').css('visibility','hidden');wppaShowLegenda='hidden';\" >",wppaOvlShowLegenda&&(l+='<div id="wppa-ovl-legenda-2" style="position:fixed; left:0; top:0; background-color:'+("black"==wppaOvlTheme?"#272727":"#a7a7a7")+"; color:"+("black"==wppaOvlTheme?"#a7a7a7":"#272727")+"; visibility:"+wppaShowLegenda+';" >Mode='+wppaOvlMode+". "+(wppaOvlIsSingle?wppaOvlFullLegendaSingle:wppaOvlFullLegenda)+"</div>"),l+="</div>");var t=(wppaIsMobile,"0.1");return l+='<div id="wppa-exit-btn" style="height:'+wppaOvlFsExitBtnSize+"px;z-index:100098;position:fixed;top:0;right:0;opacity:"+wppaNormsBtnOpac+';" onclick="wppaOvlHide()" onmouseover="jQuery(this).stop().fadeTo(300,1);" ontouchstart="jQuery(this).stop().fadeTo(300,1);" onmouseout="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" ontouchend="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" >'+wppaSvgHtml("Exit",wppaOvlFsExitBtnSize+"px",!0,!0,"0","0","0","0")+"</div>",l+='<div id="wppa-norms-btn" style="height:48px;z-index:100098;position:fixed;top:0;right:'+wppaOvlFsExitBtnSize+"px;opacity:"+wppaNormsBtnOpac+';" onclick="wppaOvlNorm()" onmouseover="jQuery(this).stop().fadeTo(300,1);" ontouchstart="jQuery(this).stop().fadeTo(300,1);" onmouseout="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" ontouchend="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" >'+wppaSvgHtml("Exit-Full-Screen",wppaOvlFsExitBtnSize+"px",!0,!0,"0","0","0","0")+"</div>",(wppaIsVideo||wppaHasAudio)&&wppaOvlFsPhotoId==wppaPhotoId&&0!=wppaPhotoId||(wppaStopVideo(0),wppaStopAudio(),jQuery("#wppa-overlay-ic").html(l)),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout("wppaOvlFormatFull()",1),wppaIsVideo||wppaHasAudio?setTimeout("wppaOvlUpdateFsId()",20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,wppaOvlOpen=!0,!1}wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);var o="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(o=wppaOvlFontColor);wppaOvlUrls.length;jQuery("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video>",wppaOvlIsVideo=!0):(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" src="'+wppaOvlUrls[p]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),wppaOvlIsVideo=!1),!wppaOvlShowStartStop||wppaOvlIsSingle||wppaIsVideo||(l+='<div id="wppa-ovl-start-stop-btn" class="wppa-ovl-nav-btn" style="z-index:100101;position:absolute;top:50%;margin-top:-24px;left:50%;margin-left:-24px;'+(-1==wppaOvlIdx?"visibility:hidden;":"")+"box-shadow:none;"+(wppaOvlFirst?"opacity:1;":"opacity:0;")+'" onclick="wppaOvlStartStop()" onmouseover="jQuery(this).stop().fadeTo(200,1);" onmouseout="jQuery(this).stop().fadeTo(200,0);" ontouchstart="jQuery(this).stop().fadeTo(200,1);" onload="jQuery(this).stop().fadeTo(5000,0);" >'+wppaSvgHtml(wppaOvlRunning?"Pause-Button":"Play-Button","48px",!0,!0,"0","20","50","50")+"</div>"),wppaOvlIsSingle||(l+='<div id="wppa-ovl-prev-btn" class="wppa-ovl-nav-btn" style="position:absolute;z-index:100101;width:48px;top:50%;margin-top:-24px;left:1px;box-shadow:none;'+(wppaOvlFirst?"opacity:1;":"opacity:0;")+'" onclick="wppaOvlShowPrev()" onmouseover="jQuery(this).stop().fadeTo(200,1);" onmouseout="jQuery(this).stop().fadeTo(200,0);" ontouchstart="jQuery(this).stop().fadeTo(200,1);" onload="jQuery(this).stop().fadeTo(5000,0);" >'+wppaSvgHtml("Prev-Button","48px",!0,!0)+"</div>",l+='<div id="wppa-ovl-next-btn" class="wppa-ovl-nav-btn" style="position:absolute;z-index:100101;width:48px;top:50%;margin-top:-24px;right:1px;box-shadow:none;'+(wppaOvlFirst?"opacity:1;":"opacity:0;")+'" onclick="wppaOvlShowNext()" onmouseover="jQuery(this).stop().fadeTo(200,1);" onmouseout="jQuery(this).stop().fadeTo(200,0);" ontouchstart="jQuery(this).stop().fadeTo(200,1);" onload="jQuery(this).stop().fadeTo(5000,0);" >'+wppaSvgHtml("Next-Button","48px",!0,!0)+"</div>"),l+="</div>";var i=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+o+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >'+(i?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[p]+"</div>",jQuery("#wppa-overlay-ic").html(l),jQuery("#wppa-overlay-img").bind("contextmenu",function(p){return!1}),wppaOvlResize(),wppaOvlFirst&&wppaShowFsButtons(),wppaOvlOpen=!0,!1}function wppaOvlSize(p){wppaConsoleLog("wppaOvlSize");var a=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(a&&e&&"none"!=jQuery("#wppa-overlay-bg").css("display")){if("normal"==wppaOvlMode){var t,o,l,i,n,w,r,d=jQuery(window).width(),v=jQuery(window).height();wppaOvlIsVideo?(t=a.clientWidth,o=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],l=wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):(t=a.clientWidth,o=a.naturalWidth,l=a.naturalHeight),void 0===o&&(o=a.clientWidth,l=a.clientHeight),(w=(i=(d-3*wppaOvlBorderWidth)/o)<(n=v/l)?i:n)<1&&(o=parseInt(o*w),l=parseInt(l*w));var s=jQuery("#wppa-overlay-txt").height();"auto"==wppaOvlTxtHeight?(0==s&&(s=20+2*wppaOvlBorderWidth),r=v-s-20-2*wppaOvlBorderWidth):r=v-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth;var u=parseInt(r*o/l),h=(wppaOvlPadTop,parseInt((d-u)/2),u);l<r&&(wppaOvlPadTop+(r-l)/2,parseInt((d-o)/2),h=o);var O=wppaSavedImageWidth-h<3&&h-wppaSavedImageWidth<3;return h<=10&&(h=240,l=180,o=240,O=!1),h=parseInt(h),wppaSavedImageWidth=parseInt(h),wppaSavedImageHeight=parseInt(h*l/o),wppaSavedMarginLeft=-parseInt(h/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(h+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+jQuery("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),jQuery("#wppa-overlay-img").stop().animate({width:wppaSavedImageWidth,height:wppaSavedImageHeight},p),jQuery("#wppa-overlay-ic").stop().animate({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},p),O?(jQuery("#wppa-ovl-spin").stop().fadeOut(),wppaConsoleLog("Done "+wppaOvlIdx),wppaOvlFirst=!1):(setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},p+10),wppaConsoleLog("Not done "+wppaOvlIdx+" saved="+wppaSavedImageWidth+", wid="+h+", cw="+t+", nw="+o+", img complete="+document.getElementById("wppa-overlay-img").complete)),!0}wppaOvlFormatFull()}else wppaConsoleLog("Lb quitted")}function wppaOvlFormatFull(){var p,a,e;if(wppaConsoleLog("wppaOvlFormatFull "+wppaOvlMode),wppaOvlIsVideo)p=document.getElementById("wppa-overlay-img"),a=wppaOvlVideoNaturalWidths[wppaOvlIdx],e=wppaOvlVideoNaturalHeights[wppaOvlIdx];else{if(p=document.getElementById("wppa-overlay-img"),!(wppaIsIe||p&&p.complete))return void setTimeout("wppaOvlFormatFull()",10);a=p.naturalWidth,e=p.naturalHeight}var t=screen.width/screen.height,o=a/e,l=0,i=0,n=0,w=0,r=0,d=0,v="hidden";switch(wppaOvlMode){case"padded":t>o?(l=(screen.width-screen.height*o)/2,i=0,n=screen.height,w=screen.height*o):(l=0,i=(screen.height-screen.width/o)/2,n=screen.width/o,w=screen.width);break;case"stretched":l=0,i=0,n=screen.height,w=screen.width;break;case"clipped":t>o?(l=0,i=(screen.height-screen.width/o)/2,n=screen.width/o,w=screen.width):(l=(screen.width-screen.height*o)/2,i=0,n=screen.height,w=screen.height*o);break;case"realsize":(l=(screen.width-a)/2)<0&&(d=parseInt(-l),l=0),(i=(screen.height-e)/2)<0&&(r=parseInt(-i),i=0),n=e,w=a,v="auto"}return l=parseInt(l),i=parseInt(i),n=parseInt(n),w=parseInt(w),jQuery(p).css({height:n,width:w,marginLeft:l,marginTop:i,left:0,top:0,maxWidth:1e4}),jQuery(p).css({visibility:"visible"}),jQuery("#wppa-ovl-full-bg").css({overflow:v}),jQuery("#wppa-ovl-full-bg").scrollTop(r),jQuery("#wppa-ovl-full-bg").scrollLeft(d),jQuery("#wppa-ovl-spin").stop().fadeOut(),!0}function wppaOvlUpdateFsId(){wppaConsoleLog("wppaOvlUpdateFsId"),wppaOvlFsPhotoId=wppaPhotoId}function wppaOvlStartAudio(){wppaConsoleLog("wppaOvlStartAudio");var p=document.getElementById("wppa-overlay-audio");p&&"function"==typeof p.play&&(p.play(),wppaConsoleLog("Audio play wppa-overlay-audio"))}function wppaOvlStepMode(){wppaConsoleLog("wppaOvlStepMode from "+wppaOvlMode);for(var p=new Array("normal","padded","stretched","clipped","realsize","padded"),a=0;a<p.length;){if(wppaOvlMode==p[a])return wppaOvlMode=p[a+1],void wppaOvlShow(wppaOvlIdx);a++}}function wppaOvlStartStop(){wppaConsoleLog("wppaOvlStartStop called. Running="+wppaOvlRunning),wppaOvlRunning?(wppaOvlRunning=!1,jQuery("#wppa-ovl-start-stop-btn").html(wppaSvgHtml(wppaOvlRunning?"Pause-Button":"Play-Button","48px",!0,!0,"0","20","50","50")),-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&jQuery("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&jQuery("#wppa-ovl-next-btn").css("visibility","visible"))):(jQuery("#wppa-ovl-start-stop-btn").html(wppaSvgHtml((wppaOvlRunning,"Pause-Button"),"48px",!0,!0,"0","20","50","50")),wppaOvlRunning=!0,wppaOvlRun())}function wppaOvlRun(){if(wppaConsoleLog("wppaOvlRun, running="+wppaOvlRunning),wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout("wppaOvlRun()",50);else{if(!wppaIsVideo){var p=document.getElementById("wppa-overlay-img");if(p&&!wppaIsIe&&!p.complete)return wppaConsoleLog("Wait during run"),void setTimeout("wppaOvlRun()",50)}var a;a=wppaOvlIdx>=wppaOvlUrls.length-1?0:wppaOvlIdx+1,wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlShow(a),setTimeout("wppaOvlRun()",wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){return wppaConsoleLog("wppaOvlShowPrev"),wppaOvlFsPhotoId=0,wppaPhotoId=0,!wppaOvlIsSingle&&(wppaOvlIdx<1&&(wppaOvlIdx=wppaOvlUrls.length),wppaOvlShow(wppaOvlIdx-1),!1)}function wppaOvlShowNext(){return wppaConsoleLog("wppaOvlShowNext"),wppaOvlFsPhotoId=0,wppaPhotoId=0,!wppaOvlIsSingle&&(wppaOvlIdx>=wppaOvlUrls.length-1&&(wppaOvlIdx=-1),wppaOvlShow(wppaOvlIdx+1),!1)}function wppaOvlHide(){wppaConsoleLog("wppaOvlHide"),wppaStopAudio(),"normal"!=wppaOvlMode&&wppaOvlNorm(!0),jQuery("#wppa-overlay-ic").html(""),jQuery("#wppa-overlay-bg").fadeOut(300),jQuery(document).off("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!1,wppaOvlFirst=!0,wppaOvlRunning=!1,wppaOvlMode=wppaOvlModeInitial,wppaNormsBtnOpac=.75,jQuery("#wppa-ovl-spin").stop().fadeOut(),jQuery("#wppa-fulls-btn").stop().fadeOut(300),jQuery("#wppa-exit-btn").stop().fadeOut(300),wppaOvlOpen=!1}function wppaOvlOnclick(p){switch(wppaConsoleLog("wppaOvlOnClick"),wppaOvlOnclickType){case"none":break;case"close":"normal"==wppaOvlMode&&wppaOvlHide();break;case"browse":var a=p.screenX-window.screenX;p.clientY>48&&(a<screen.width/2?wppaOvlShowPrev():wppaOvlShowNext());break;default:alert("Unimplemented action: "+wppaOvlOnclickType)}return!0}function wppaInitOverlay(){wppaConsoleLog("wppaInitOverlay"),jQuery(".wp-caption").each(function(){var p=jQuery(this),a=p.find("IMG[alt]").attr("alt")||"",e=p.find(".wp-caption-text").html()||"",t=p.find("a"),o=a+"<br>"+e;t.attr("data-lbtitle")||t.attr("data-lbtitle",o)}),""==wppaOvlMode&&(wppaOvlMode=wppaOvlModeInitial);var p,a,e=jQuery("a"),t=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlCurIdx=0,0==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),a=0;a<e.length;a++)p=e[a],jQuery(p).attr("data-rel")?t=jQuery(p).attr("data-rel").split("["):p.rel?t=p.rel.split("["):t[0]="","wppa"==t[0]&&(wppaWppaOverlayActivated=!0,jQuery(p).on("click",function(p){wppaOvlShow(this),p.preventDefault()}),jQuery(p).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto"));wppaIsMobile&&window.addEventListener("orientationchange",wppaDoOnOrientationChange)}function wppaOvlResize(){wppaConsoleLog("wppaOvlResize"),setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout("wppaOvlStartAudio()",100)}function wppaShowFsButtons(p){void 0!==p&&(wppaNormsBtnOpac=p),jQuery("#wppa-exit-btn").stop().fadeTo(3,wppaNormsBtnOpac),"normal"==wppaOvlMode?jQuery("#wppa-fulls-btn").stop().fadeTo(3,wppaNormsBtnOpac):jQuery("#wppa-norms-btn").stop().fadeTo(3,wppaNormsBtnOpac)}jQuery(document).ready(function(p){wppaInitOverlay()}),jQuery(window).resize(function(){jQuery("#wppa-overlay-bg").css({height:window.innerHeight,width:window.innerWidth}),wppaOvlResize()}),wppaConsoleLog("wppa-lightbox.js version "+wppaLightboxVersion+" loaded.","force");
1
+ var wppaSavedContainerHeight,wppaSavedMarginLeft,wppaSavedMarginTop,wppaSavedImageWidth,wppaSavedImageHeight,wppaLightboxVersion="6.9.09",wppaNormsBtnOpac=.75,wppaIsVideo=!1,wppaHasAudio=!1,wppaOvlImgs=[],wppaKbHandlerInstalled=!1,wppaOvlMode="",wppaOvlCurIdx=0,wppaOvlSvgInverse=!1,wppaOvlFsExitBtnSize="48",wppaOvlActivePanorama=0,wppaOvlHasPanoramas=!1,wppaSavedContainerWidth=0;function wppaDoOnOrientationChange(p){"normal"!=wppaOvlMode&&document.getElementById("wppa-overlay-img")&&setTimeout("wppaOvlShow( "+wppaOvlIdx+" )",10)}function wppaOvlKeyboardHandler(p){var a,e;a=null==p?event.keyCode:p.keyCode,e=27;var t=String.fromCharCode(a).toLowerCase();switch(a){case e:wppaStopVideo(mocc),"normal"!=wppaOvlMode&&wppaOvlNorm(!0),wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext()}switch(t){case"p":wppaOvlShowPrev();break;case"n":wppaOvlShowNext();break;case"s":wppaOvlStartStop();break;case"d":jQuery("#wppa-ovl-legenda-1").css("visibility","hidden"),jQuery("#wppa-ovl-legenda-2").css("visibility","hidden"),wppaShowLegenda="hidden";break;case"f":wppaOvlFull();break;case"l":wppaOvlNorm();break;case"q":case"x":wppaStopVideo(mocc),"normal"!=wppaOvlMode&&wppaOvlNorm(!0),wppaOvlHide()}return!1}function wppaOvlFull(p){wppaConsoleLog("wppaOvlFull"),wppaNormsBtnOpac=.75;var a=wppaOvlMode;p||wppaOvlStepMode();var e=document.getElementById("wppa-overlay-ic");e&&((p||"normal"==a)&&(e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(),setTimeout(function(){wppaOvlShow(wppaOvlIdx)},50)),"normal"==wppaOvlMode&&(document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()),setTimeout(function(){wppaShowFsButtons(.75)},30),jQuery("#wppa-ovl-legenda-1").html(""))}function wppaOvlNorm(p){wppaConsoleLog("wppaOvlNorm"),wppaOvlMode="normal",wppaNormsBtnOpac=.75,document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen(),p?wppaOvlMode=wppaOvlModeInitial:(setTimeout(function(){wppaShowFsButtons(.75)},30),setTimeout(function(){wppaOvlShow(wppaOvlIdx)},50))}function wppaOvlShow(p){var a,e;if(wppaConsoleLog("wppaOvlShow arg="+p),0<wppaOvlActivePanorama?jQuery("#wppa-overlay-ic").css({top:0,left:0}):jQuery("#wppa-overlay-ic").css({top:"50%",left:"50%"}),wppaOvlFirst&&(jQuery("#weaver-final").removeClass("wvr-hide-bang"),jQuery("#wppa-overlay-bg").stop().fadeTo(3,wppaOvlOpacity),wppaKbHandlerInstalled||(jQuery(document).on("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!0),jQuery("#wppa-overlay-bg").css({width:window.innerWidth,height:window.innerHeight}),"normal"!=wppaOvlModeInitial&&wppaOvlFull(!0)),"object"==typeof p){wppaOvlUrls=[],wppaOvlTitles=[],wppaOvlAlts=[],wppaOvlVideoHtmls=[],wppaOvlAudioHtmls=[],wppaOvlVideoNaturalWidths=[],wppaOvlVideoNaturalHeights=[],wppaOvlImgs=[],wppaOvlIdx=0,wppaOvlPanoramaHtml=[],wppaOvlPanoramaIds=[],wppaOvlHasPanoramas=!1;var t=(p.rel?p.rel:!!jQuery(p).attr("data-rel")&&jQuery(p).attr("data-rel")).split("[");if(t[1]){var o,l,i=t[1],n=jQuery("a"),r=0;for(l=0;l<n.length;l++)o=n[l],1<(t=!!jQuery(o).attr("data-rel")&&jQuery(o).attr("data-rel").split("[")).length&&"wppa"==t[0]&&t[1]==i&&(wppaOvlUrls[r]=o.href,jQuery(o).attr("data-lbtitle")?wppaOvlTitles[r]=wppaRepairScriptTags(jQuery(o).attr("data-lbtitle")):wppaOvlTitles[r]=wppaRepairScriptTags(o.title),wppaOvlAlts[r]=jQuery(o).attr("data-alt")?jQuery(o).attr("data-alt"):"",wppaOvlVideoHtmls[r]=jQuery(o).attr("data-videohtml")?decodeURI(jQuery(o).attr("data-videohtml")):"",wppaOvlAudioHtmls[r]=jQuery(o).attr("data-audiohtml")?decodeURI(jQuery(o).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[r]=jQuery(o).attr("data-videonatwidth")?jQuery(o).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[r]=jQuery(o).attr("data-videonatheight")?jQuery(o).attr("data-videonatheight"):"",0<(a=jQuery(o).attr("data-panorama")?jQuery(o).attr("data-panorama"):"").length?(wppaOvlHasPanoramas=!0,e=a.indexOf("."),wppaOvlPanoramaHtml[r]=a.substr(e+1),wppaOvlPanoramaIds[r]=a.substr(0,e)):(wppaOvlPanoramaHtml[r]="",wppaOvlPanoramaIds[r]=0),o.href==p.href&&(wppaOvlIdx=r),r++)}else wppaOvlUrls[0]=p.href,jQuery(p).attr("data-lbtitle")?wppaOvlTitles[0]=wppaRepairScriptTags(jQuery(p).attr("data-lbtitle")):wppaOvlTitles[0]=wppaRepairScriptTags(p.title),wppaOvlAlts[0]=jQuery(p).attr("data-alt")?jQuery(p).attr("data-alt"):"",wppaOvlVideoHtmls[0]=jQuery(p).attr("data-videohtml")?decodeURI(jQuery(p).attr("data-videohtml")):"",wppaOvlAudioHtmls[0]=jQuery(p).attr("data-audiohtml")?decodeURI(jQuery(p).attr("data-audiohtml")):"",wppaOvlVideoNaturalWidths[0]=jQuery(p).attr("data-videonatwidth")?jQuery(p).attr("data-videonatwidth"):"",wppaOvlVideoNaturalHeights[0]=jQuery(p).attr("data-videonatheight")?jQuery(p).attr("data-videonatheight"):"",0<(a=jQuery(p).attr("data-panorama")).length?(wppaOvlHasPanoramas=!0,e=a.indexOf("."),wppaOvlPanoramaHtml[0]=a.substr(e+1),wppaOvlPanoramaIds[0]=a.substr(0,e)):(wppaOvlPanoramaHtml[0]="",wppaOvlPanoramaIds[0]=0),wppaOvlIdx=0}else wppaOvlIdx=p;wppaOvlOpen=!0,setTimeout(function(){_wppaOvlShow(wppaOvlIdx)},1)}function _wppaOvlShow(p){if(wppaConsoleLog("_wppaOvlShow, idx="+p),wppaOvlCurIdx=p,wppaOvlFirst&&jQuery("#wppa-ovl-spin").fadeIn(500),wppaIsVideo=""!=wppaOvlVideoHtmls[p],wppaHasAudio=""!=wppaOvlAudioHtmls[p],0<wppaOvlUrls[p].length&&!wppaIsVideo&&(wppaOvlImgs[p]=new Image,wppaOvlImgs[p].src=wppaOvlUrls[p],wppaConsoleLog("Preloading "+(p+1)+"/"+wppaOvlUrls.length+" (current)"),!wppaIsIe&&!wppaOvlImgs[p].complete&&wppaOvlOpen))return wppaConsoleLog("Retrying preload current image"),void setTimeout("_wppaOvlShow("+p+")",100);var a,e;if(a=wppaOvlIdx==wppaOvlUrls.length-1?0:wppaOvlIdx+1,""==wppaOvlVideoHtmls[a]&&wppaOvlOpen&&(wppaOvlImgs[a]=new Image,wppaOvlImgs[a].src=wppaOvlUrls[a],wppaConsoleLog("Preloading > "+(a+1))),!wppaOvlRunning&&wppaOvlOpen&&(e=0==wppaOvlIdx?wppaOvlUrls.length-1:wppaOvlIdx-1,""==wppaOvlVideoHtmls[e]&&(wppaOvlImgs[e]=new Image,wppaOvlImgs[e].src=wppaOvlUrls[e],wppaConsoleLog("Preloading < "+(e+1)))),wppaPhotoId=wppaUrlToId(wppaOvlUrls[p]),_bumpViewCount(wppaPhotoId),wppaOvlIsSingle=1==wppaOvlUrls.length,0<wppaOvlPanoramaIds[p]?(wppaOvlActivePanorama=wppaOvlPanoramaIds[p],jQuery("#wppa-overlay-ic").css({top:0,left:0})):(wppaOvlActivePanorama=0,jQuery("#wppa-overlay-ic").css({top:"50%",left:"50%"})),"normal"!=wppaOvlMode||wppaOvlActivePanorama){wppaOvlActivePanorama?l=wppaOvlPanoramaHtml[p]:(wppaIsVideo?l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><video id="wppa-overlay-img" controls preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" style="border:none; width:'+screen.width+'px; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video><div style=\"height: 20px; width: 100%; position:absolute; top:0; left:0;\" onmouseover=\"jQuery('#wppa-ovl-legenda-2').css('visibility','visible');\" onmouseout=\"jQuery('#wppa-ovl-legenda-2').css('visibility','hidden');wppaShowLegenda='hidden';\" >":(l='<div id="wppa-ovl-full-bg" style="position:fixed; width:'+screen.width+"px; height:"+screen.height+'px; left:0px; top:0px; text-align:center;" ><img id="wppa-overlay-img" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" src="'+wppaOvlUrls[p]+'" style="border:none; width:'+screen.width+'px; visibility:hidden; box-shadow:none; position:absolute;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata"'+(wppaOvlAudioStart?" autoplay":"")+' onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;left:0px;bottom:0px;padding:0;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),l+="<div style=\"height: 20px; width: 100%; position:absolute; top:0; left:0;\" onmouseover=\"jQuery('#wppa-ovl-legenda-2').css('visibility','visible');\" onmouseout=\"jQuery('#wppa-ovl-legenda-2').css('visibility','hidden');wppaShowLegenda='hidden';\" >"),wppaOvlShowLegenda&&(l+='<div id="wppa-ovl-legenda-2" style="position:fixed; left:0; top:0; background-color:'+("black"==wppaOvlTheme?"#272727":"#a7a7a7")+"; color:"+("black"==wppaOvlTheme?"#a7a7a7":"#272727")+"; visibility:"+wppaShowLegenda+';" >Mode='+wppaOvlMode+". "+(wppaOvlIsSingle?wppaOvlFullLegendaSingle:wppaOvlFullLegenda)+"</div>"),l+="</div>");var t=(wppaIsMobile,"0.1");return l+='<div id="wppa-exit-btn" style="height:'+wppaOvlFsExitBtnSize+"px;z-index:100098;position:fixed;top:0;right:0;opacity:"+wppaNormsBtnOpac+';" onclick="wppaOvlHide()" onmouseover="jQuery(this).stop().fadeTo(300,1);" ontouchstart="jQuery(this).stop().fadeTo(300,1);" onmouseout="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" ontouchend="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" >'+wppaSvgHtml("Exit",wppaOvlFsExitBtnSize+"px",!0,!0,"0","0","0","0")+"</div>","normal"!=wppaOvlMode&&(l+='<div id="wppa-norms-btn" style="height:48px;z-index:100098;position:fixed;top:0;right:'+wppaOvlFsExitBtnSize+"px;opacity:"+wppaNormsBtnOpac+';" onclick="wppaOvlNorm()" onmouseover="jQuery(this).stop().fadeTo(300,1);" ontouchstart="jQuery(this).stop().fadeTo(300,1);" onmouseout="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" ontouchend="jQuery(this).stop().fadeTo(300,'+t+");wppaNormsBtnOpac="+t+';" >'+wppaSvgHtml("Exit-Full-Screen",wppaOvlFsExitBtnSize+"px",!0,!0,"0","0","0","0")+"</div>"),(wppaIsVideo||wppaHasAudio)&&wppaOvlFsPhotoId==wppaPhotoId&&0!=wppaPhotoId||(wppaStopVideo(0),wppaStopAudio(),jQuery("#wppa-overlay-ic").html(l)),0<wppaOvlPanoramaIds[p]&&wppaOvlIsSingle&&jQuery(".wppa-panorama-prevnext").hide(),wppaProtect(),wppaOvlIsVideo=wppaIsVideo,setTimeout("wppaOvlFormatFull()",1),wppaIsVideo||wppaHasAudio?setTimeout("wppaOvlUpdateFsId()",20):wppaOvlFsPhotoId=0,wppaOvlFirst=!1,wppaShowFsButtons(),!1}wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaStopVideo(0);var o="black"==wppaOvlTheme?"#a7a7a7":"#272727";wppaOvlFontColor&&(o=wppaOvlFontColor);wppaOvlUrls.length;jQuery("#wppa-overlay-ic").css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop});var l="";l+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >',wppaIsVideo?(l+='<video id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" preload="metadata"'+(wppaOvlVideoStart?" autoplay":"")+' onpause="wppaOvlVideoPlaying = false;" onplay="wppaOvlVideoPlaying = true;" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" controls style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" >'+wppaOvlVideoHtmls[p]+"</video>",wppaOvlIsVideo=!0):(l+='<img id="wppa-overlay-img" onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);" onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);" ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" src="'+wppaOvlUrls[p]+'" style="border-width:'+wppaOvlBorderWidth+"px "+wppaOvlBorderWidth+"px 0;border-style:solid;border-color:"+wppaOvlTheme+";width:"+wppaSavedImageWidth+"px;height:"+wppaSavedImageHeight+"px;box-shadow:none;box-sizing:content-box;position:relative;border-top-left-radius:"+wppaOvlRadius+"px;border-top-right-radius:"+wppaOvlRadius+'px;margin:0;padding:0;" alt="'+wppaOvlAlts[p]+'" />',wppaHasAudio&&(l+='<audio id="wppa-overlay-audio" class="wppa-overlay-audio" data-from="wppa" preload="metadata" onpause="wppaOvlAudioPlaying = false;" onplay="wppaOvlAudioPlaying = true;" style="width:100%;position:absolute;box-shadow:none;left:0;bottom:0;padding:0 '+wppaOvlBorderWidth+'px;margin:0;background-color:transparent;box-sizing:border-box;" controls >'+wppaOvlAudioHtmls[p]+"</audio>"),wppaOvlIsVideo=!1),!wppaOvlShowStartStop||wppaOvlIsSingle||wppaIsVideo||(l+='<div id="wppa-ovl-start-stop-btn" class="wppa-ovl-nav-btn" style="z-index:100101;position:absolute;top:50%;margin-top:-24px;left:50%;margin-left:-24px;'+(-1==wppaOvlIdx?"visibility:hidden;":"")+"box-shadow:none;"+(wppaOvlFirst?"opacity:1;":"opacity:0;")+'" onclick="wppaOvlStartStop()" onmouseover="jQuery(this).stop().fadeTo(200,1);" onmouseout="jQuery(this).stop().fadeTo(200,0);" ontouchstart="jQuery(this).stop().fadeTo(200,1);" onload="jQuery(this).stop().fadeTo(5000,0);" >'+wppaSvgHtml(wppaOvlRunning?"Pause-Button":"Play-Button","48px",!0,!0,"0","20","50","50")+"</div>"),wppaOvlIsSingle||(l+='<div id="wppa-ovl-prev-btn" class="wppa-ovl-nav-btn" style="position:absolute;z-index:100101;width:48px;top:50%;margin-top:-24px;left:1px;box-shadow:none;'+(wppaOvlFirst?"opacity:1;":"opacity:0;")+'" onclick="wppaOvlShowPrev()" onmouseover="jQuery(this).stop().fadeTo(200,1);" onmouseout="jQuery(this).stop().fadeTo(200,0);" ontouchstart="jQuery(this).stop().fadeTo(200,1);" onload="jQuery(this).stop().fadeTo(5000,0);" >'+wppaSvgHtml("Prev-Button","48px",!0,!0)+"</div>",l+='<div id="wppa-ovl-next-btn" class="wppa-ovl-nav-btn" style="position:absolute;z-index:100101;width:48px;top:50%;margin-top:-24px;right:1px;box-shadow:none;'+(wppaOvlFirst?"opacity:1;":"opacity:0;")+'" onclick="wppaOvlShowNext()" onmouseover="jQuery(this).stop().fadeTo(200,1);" onmouseout="jQuery(this).stop().fadeTo(200,0);" ontouchstart="jQuery(this).stop().fadeTo(200,1);" onload="jQuery(this).stop().fadeTo(5000,0);" >'+wppaSvgHtml("Next-Button","48px",!0,!0)+"</div>"),l+="</div>";var i=!wppaOvlIsSingle&&wppaOvlShowCounter;return l+='<div id="wppa-overlay-txt-container" style="position:relative;padding:10px;background-color:'+wppaOvlTheme+";color:"+o+";text-align:center;font-family:"+wppaOvlFontFamily+";font-size:"+wppaOvlFontSize+"px;font-weight:"+wppaOvlFontWeight+";line-height:"+wppaOvlLineHeight+"px;box-shadow:none;border-bottom-left-radius:"+wppaOvlRadius+"px;border-bottom-right-radius:"+wppaOvlRadius+'px;" ><div id="wppa-overlay-txt" style="text-align:center;min-height:36px;width:100%;'+("auto"==wppaOvlTxtHeight?"max-height:200px;":"max-height:"+wppaOvlTxtHeight+"px;")+'overflow:auto;box-shadow:none;" >'+(i?wppaOvlIdx+1+"/"+wppaOvlUrls.length+"<br />":"")+wppaOvlTitles[p]+"</div>",jQuery("#wppa-overlay-ic").html(l),wppaShowFsButtons(),jQuery("#wppa-overlay-img").bind("contextmenu",function(p){return!1}),0==wppaOvlPanoramaIds[p]&&wppaOvlResize(),wppaOvlFirst&&wppaShowFsButtons(),!1}function wppaOvlSize(p){if(wppaConsoleLog("wppaOvlSize"),!wppaOvlActivePanorama){var a=document.getElementById("wppa-overlay-img"),e=document.getElementById("wppa-overlay-txt");if(a&&e&&"none"!=jQuery("#wppa-overlay-bg").css("display")){if("normal"==wppaOvlMode){var t,o,l,i,n,r,w,d=jQuery(window).width(),v=jQuery(window).height();wppaOvlIsVideo?(t=a.clientWidth,o=wppaOvlVideoNaturalWidths[wppaOvlCurIdx],l=wppaOvlVideoNaturalHeights[wppaOvlCurIdx]):(t=a.clientWidth,o=a.naturalWidth,l=a.naturalHeight),void 0===o&&(o=a.clientWidth,l=a.clientHeight),(r=(i=(d-3*wppaOvlBorderWidth)/o)<(n=v/l)?i:n)<1&&(o=parseInt(o*r),l=parseInt(l*r));var s=jQuery("#wppa-overlay-txt").height();"auto"==wppaOvlTxtHeight?(0==s&&(s=20+2*wppaOvlBorderWidth),w=v-s-20-2*wppaOvlBorderWidth):w=v-wppaOvlTxtHeight-20-2*wppaOvlBorderWidth;var u=parseInt(w*o/l),O=(wppaOvlPadTop,parseInt((d-u)/2),u);l<w&&(wppaOvlPadTop+(w-l)/2,parseInt((d-o)/2),O=o);var h=wppaSavedImageWidth-O<3&&O-wppaSavedImageWidth<3;return O<=10&&(l=180,h=!(o=O=240)),O=parseInt(O),wppaSavedImageWidth=parseInt(O),wppaSavedImageHeight=parseInt(O*l/o),wppaSavedMarginLeft=-parseInt(O/2+wppaOvlBorderWidth),wppaSavedContainerWidth=parseInt(O+2*wppaOvlBorderWidth),wppaSavedContainerHeight=parseInt(wppaSavedImageHeight+wppaOvlBorderWidth+jQuery("#wppa-overlay-txt-container").height()+20),wppaSavedMarginTop=-parseInt(wppaSavedContainerHeight/2),jQuery("#wppa-overlay-img").stop().animate({width:wppaSavedImageWidth,height:wppaSavedImageHeight},p),jQuery("#wppa-overlay-ic").stop().animate({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop},p),h?(jQuery("#wppa-ovl-spin").stop().fadeOut(),wppaConsoleLog("Done "+wppaOvlIdx),wppaOvlFirst=!1):(setTimeout(function(){wppaOvlSize(wppaOvlAnimSpeed)},p+10),wppaConsoleLog("Not done "+wppaOvlIdx+" saved="+wppaSavedImageWidth+", wid="+O+", cw="+t+", nw="+o+", img complete="+document.getElementById("wppa-overlay-img").complete)),!0}wppaOvlFormatFull()}else wppaConsoleLog("Lb quitted")}}function wppaOvlFormatFull(){if(wppaConsoleLog("wppaOvlFormatFull "+wppaOvlMode),!(0<wppaOvlActivePanorama)){var p,a,e;if(wppaOvlIsVideo)p=document.getElementById("wppa-overlay-img"),a=wppaOvlVideoNaturalWidths[wppaOvlIdx],e=wppaOvlVideoNaturalHeights[wppaOvlIdx];else{if(p=document.getElementById("wppa-overlay-img"),!(wppaIsIe||p&&p.complete))return void setTimeout("wppaOvlFormatFull()",10);a=p.naturalWidth,e=p.naturalHeight}var t=screen.width/screen.height,o=a/e,l=0,i=0,n=0,r=0,w=0,d=0,v="hidden";switch(wppaOvlMode){case"padded":o<t?(l=(screen.width-screen.height*o)/2,i=0,n=screen.height,r=screen.height*o):(l=0,i=(screen.height-screen.width/o)/2,n=screen.width/o,r=screen.width);break;case"stretched":i=l=0,n=screen.height,r=screen.width;break;case"clipped":o<t?(l=0,i=(screen.height-screen.width/o)/2,n=screen.width/o,r=screen.width):(l=(screen.width-screen.height*o)/2,i=0,n=screen.height,r=screen.height*o);break;case"realsize":(l=(screen.width-a)/2)<0&&(d=parseInt(-l),l=0),(i=(screen.height-e)/2)<0&&(w=parseInt(-i),i=0),n=e,r=a,v="auto"}return l=parseInt(l),i=parseInt(i),n=parseInt(n),r=parseInt(r),jQuery(p).css({height:n,width:r,marginLeft:l,marginTop:i,left:0,top:0,maxWidth:1e4}),jQuery(p).css({visibility:"visible"}),jQuery("#wppa-ovl-full-bg").css({overflow:v}),jQuery("#wppa-ovl-full-bg").scrollTop(w),jQuery("#wppa-ovl-full-bg").scrollLeft(d),jQuery("#wppa-ovl-spin").stop().fadeOut(),!0}}function wppaOvlUpdateFsId(){wppaConsoleLog("wppaOvlUpdateFsId"),wppaOvlFsPhotoId=wppaPhotoId}function wppaOvlStartAudio(){wppaConsoleLog("wppaOvlStartAudio");var p=document.getElementById("wppa-overlay-audio");p&&"function"==typeof p.play&&(p.play(),wppaConsoleLog("Audio play wppa-overlay-audio"))}function wppaOvlStepMode(){wppaConsoleLog("wppaOvlStepMode from "+wppaOvlMode);for(var p=new Array("normal","padded","stretched","clipped","realsize","padded"),a=0;a<p.length;){if(wppaOvlMode==p[a])return wppaOvlMode=p[a+1],void wppaOvlShow(wppaOvlIdx);a++}}function wppaOvlStartStop(){wppaConsoleLog("wppaOvlStartStop called. Running="+wppaOvlRunning),wppaOvlRunning?(wppaOvlRunning=!1,jQuery("#wppa-ovl-start-stop-btn").html(wppaSvgHtml(wppaOvlRunning?"Pause-Button":"Play-Button","48px",!0,!0,"0","20","50","50")),-1!=wppaOvlIdx&&(0!=wppaOvlIdx&&jQuery("#wppa-ovl-prev-btn").css("visibility","visible"),wppaOvlIdx!=wppaOvlUrls.length-1&&jQuery("#wppa-ovl-next-btn").css("visibility","visible"))):(jQuery("#wppa-ovl-start-stop-btn").html(wppaSvgHtml((wppaOvlRunning,"Pause-Button"),"48px",!0,!0,"0","20","50","50")),wppaOvlRunning=!0,wppaOvlRun())}function wppaOvlRun(){if(wppaConsoleLog("wppaOvlRun, running="+wppaOvlRunning),wppaOvlRunning)if(wppaOvlVideoPlaying||wppaOvlAudioPlaying)setTimeout("wppaOvlRun()",50);else{if(!wppaIsVideo){var p=document.getElementById("wppa-overlay-img");if(p&&!wppaIsIe&&!p.complete)return wppaConsoleLog("Wait during run"),void setTimeout("wppaOvlRun()",50)}var a;a=wppaOvlIdx>=wppaOvlUrls.length-1?0:wppaOvlIdx+1,wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlShow(a),setTimeout("wppaOvlRun()",wppaOvlSlideSpeed)}}function wppaOvlShowPrev(){return wppaConsoleLog("wppaOvlShowPrev"),wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlIsSingle||(wppaOvlIdx<1&&(wppaOvlIdx=wppaOvlUrls.length),wppaOvlShow(wppaOvlIdx-1)),!1}function wppaOvlShowNext(){return wppaConsoleLog("wppaOvlShowNext"),wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlIsSingle||(wppaOvlIdx>=wppaOvlUrls.length-1&&(wppaOvlIdx=-1),wppaOvlShow(wppaOvlIdx+1)),!1}function wppaOvlHide(){wppaConsoleLog("wppaOvlHide"),wppaStopAudio(),"normal"!=wppaOvlMode&&wppaOvlNorm(!0),jQuery("#wppa-overlay-ic").html(""),jQuery("#wppa-overlay-bg").fadeOut(300),jQuery(document).off("keydown",wppaOvlKeyboardHandler),wppaKbHandlerInstalled=!1,wppaOvlFirst=!0,wppaOvlRunning=!1,wppaOvlMode=wppaOvlModeInitial,wppaNormsBtnOpac=.75,jQuery("#wppa-ovl-spin").stop().fadeOut(),jQuery("#wppa-fulls-btn").stop().fadeOut(300),jQuery("#wppa-exit-btn").stop().fadeOut(300),wppaOvlActivePanorama=0,wppaOvlOpen=!1}function wppaOvlOnclick(p){switch(wppaConsoleLog("wppaOvlOnClick"),wppaOvlOnclickType){case"none":break;case"close":"normal"==wppaOvlMode&&wppaOvlHide();break;case"browse":var a=p.screenX-window.screenX;48<p.clientY&&(a<screen.width/2?wppaOvlShowPrev():wppaOvlShowNext());break;default:alert("Unimplemented action: "+wppaOvlOnclickType)}return!0}function wppaInitOverlay(){wppaConsoleLog("wppaInitOverlay"),jQuery(".wp-caption").each(function(){var p=jQuery(this),a=p.find("IMG[alt]").attr("alt")||"",e=p.find(".wp-caption-text").html()||"",t=p.find("a"),o=a+"<br>"+e;t.attr("data-lbtitle")||t.attr("data-lbtitle",o)}),""==wppaOvlMode&&(wppaOvlMode=wppaOvlModeInitial);var p,a,e=jQuery("a"),t=[];for(wppaOvlFsPhotoId=0,wppaPhotoId=0,(wppaOvlActivePanorama=wppaOvlCurIdx=0)==wppaSavedContainerWidth&&(wppaSavedContainerWidth=240+2*wppaOvlBorderWidth,wppaSavedContainerHeight=180+3*wppaOvlBorderWidth+20+("auto"==wppaOvlTxtHeight?50:wppaOvlTxtHeight),wppaSavedMarginLeft=-(120+wppaOvlBorderWidth),wppaSavedMarginTop=-(90+wppaOvlBorderWidth+10+("auto"==wppaOvlTxtHeight?25:wppaOvlTxtHeight/2)),wppaSavedImageWidth=240,wppaSavedImageHeight=180+wppaOvlBorderWidth),a=0;a<e.length;a++)p=e[a],jQuery(p).attr("data-rel")?t=jQuery(p).attr("data-rel").split("["):p.rel?t=p.rel.split("["):t[0]="","wppa"==t[0]&&(wppaWppaOverlayActivated=!0,jQuery(p).on("click",function(p){wppaOvlShow(this),p.preventDefault()}),jQuery(p).css("cursor","url( "+wppaImageDirectory+wppaMagnifierCursor+" ),auto"));wppaIsMobile&&window.addEventListener("orientationchange",wppaDoOnOrientationChange)}function wppaOvlResize(){wppaConsoleLog("wppaOvlResize"),0<wppaOvlActivePanorama||(setTimeout("wppaOvlSize( "+wppaOvlAnimSpeed+" )",10),wppaOvlAudioStart&&!wppaOvlAudioPlaying&&setTimeout("wppaOvlStartAudio()",100))}function wppaShowFsButtons(p){void 0!==p&&(wppaNormsBtnOpac=p),jQuery("#wppa-exit-btn").stop().fadeTo(3,wppaNormsBtnOpac),"normal"==wppaOvlMode?jQuery("#wppa-fulls-btn").stop().fadeTo(3,wppaNormsBtnOpac):jQuery("#wppa-norms-btn").stop().fadeTo(3,wppaNormsBtnOpac)}jQuery(document).ready(function(p){wppaInitOverlay()}),jQuery(window).resize(function(){jQuery("#wppa-overlay-bg").css({height:window.innerHeight,width:window.innerWidth}),wppaOvlResize()}),wppaConsoleLog("wppa-lightbox.js version "+wppaLightboxVersion+" loaded.","force");
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 6.9.08
6
- Stable tag: 6.9.07
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -137,8 +137,12 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
137
 
138
  == Upgrade Notice ==
139
 
 
 
 
 
140
  = 6.9.08 =
141
-
142
  * This version addresses various minor bug fixes and feature requests.
143
  * Panorama support phase II.
144
 
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 6.9.09
6
+ Stable tag: 6.9.08
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
137
 
138
  == Upgrade Notice ==
139
 
140
+ = 6.9.09 =
141
+
142
+ * Panorama support phase III.
143
+
144
  = 6.9.08 =
145
+
146
  * This version addresses various minor bug fixes and feature requests.
147
  * Panorama support phase II.
148
 
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 6.9.05
7
  *
8
  */
9
 
@@ -918,6 +918,7 @@ global $wpdb;
918
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
919
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
920
  ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' .
 
921
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
922
  ' style="cursor:' . wppa_wait() . ';"' .
923
  ' onclick="return false;"' .
@@ -1131,6 +1132,7 @@ global $wpdb;
1131
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
1132
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1133
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
 
1134
  ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
1135
  ' >'
1136
  );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 6.9.09
7
  *
8
  */
9
 
918
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
919
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
920
  ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' .
921
+ wppa_get_lb_panorama_full_html( $id ) .
922
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
923
  ' style="cursor:' . wppa_wait() . ';"' .
924
  ' onclick="return false;"' .
1132
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
1133
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[alw-' . wppa( 'mocc' ) . '-' . $albumid . ']"' .
1134
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1135
+ wppa_get_lb_panorama_full_html( $id ) .
1136
  ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
1137
  ' >'
1138
  );
wppa-album-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
- * Version 6.8.08
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -193,6 +193,7 @@ class AlbumWidget extends WP_Widget {
193
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
194
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[alw-'.wppa( 'mocc' ).'-'.$album['id'].']"' .
195
  ' ' . wppa( 'lbtitle' ) . '="'.$title.'"' .
 
196
  ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
197
  ' style="cursor:' . wppa_wait() . ';"' .
198
  ' onclick="return false;"' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * display thumbnail albums
6
+ * Version 6.9.09
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
193
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $thumb['id'] ) ) . '"' : '' ) .
194
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[alw-'.wppa( 'mocc' ).'-'.$album['id'].']"' .
195
  ' ' . wppa( 'lbtitle' ) . '="'.$title.'"' .
196
+ wppa_get_lb_panorama_full_html( $id ) .
197
  ' data-alt="' . esc_attr( wppa_get_imgalt( $thumb['id'], true ) ) . '"' .
198
  ' style="cursor:' . wppa_wait() . ';"' .
199
  ' onclick="return false;"' .
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.9.05
7
  *
8
  */
9
 
@@ -4366,6 +4366,7 @@ function wppa_bestof_html( $args, $widget = true ) {
4366
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
4367
  ' style="cursor:' . wppa_wait() . ';"' . // url( ' . wppa_get_imgdir() . wppa_opt( 'magnifier' ) . ' ),pointer;"' .
4368
  ' title="' . wppa_zoom_in( $id ) . '"' .
 
4369
  ' onclick="return false;"' .
4370
  ' >';
4371
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.9.09
7
  *
8
  */
9
 
4366
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
4367
  ' style="cursor:' . wppa_wait() . ';"' . // url( ' . wppa_get_imgdir() . wppa_opt( 'magnifier' ) . ' ),pointer;"' .
4368
  ' title="' . wppa_zoom_in( $id ) . '"' .
4369
+ wppa_get_lb_panorama_full_html( $id ) .
4370
  ' onclick="return false;"' .
4371
  ' >';
4372
  }
wppa-links.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
- * Version 6.9.06
7
  *
8
  */
9
 
@@ -1537,7 +1537,7 @@ global $wpdb;
1537
  //$result['url'] = str_replace( 'xxx', $is_video['0'], $result['url'] );
1538
  }
1539
  else {
1540
- if ( wppa_switch( 'lb_hres' ) && ! wppa_is_stereo( $id ) ) {
1541
  $result['url'] = wppa_get_hires_url( $id );
1542
  }
1543
  else {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Frontend links
6
+ * Version 6.9.09
7
  *
8
  */
9
 
1537
  //$result['url'] = str_replace( 'xxx', $is_video['0'], $result['url'] );
1538
  }
1539
  else {
1540
+ if ( wppa_switch( 'lb_hres' ) && ! wppa_is_stereo( $id ) || wppa_is_panorama( $id ) ) {
1541
  $result['url'] = wppa_get_hires_url( $id );
1542
  }
1543
  else {
wppa-non-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
- * Version 6.9.07
7
  *
8
  */
9
 
@@ -545,6 +545,8 @@ global $wppa_js_page_data_file;
545
  'opacity:1;' .
546
  'box-shadow:none;' .
547
  'box-sizing:content-box;' .
 
 
548
  '"' .
549
  ' >' .
550
  '</div>';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 6.9.09
7
  *
8
  */
9
 
545
  'opacity:1;' .
546
  'box-shadow:none;' .
547
  'box-sizing:content-box;' .
548
+ 'text-align:center;' . // for panorama
549
+ 'background-color:transparent;' .
550
  '"' .
551
  ' >' .
552
  '</div>';
wppa-picture.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Make the picture html
6
- * Version 6.9.08
7
  *
8
  */
9
 
@@ -126,7 +126,6 @@ function wppa_get_picture_html( $args ) {
126
 
127
  }
128
  if ( $link['is_lightbox'] ) {
129
- // $style .= 'cursor:' . wppa_wait() . ';'; //url( ' . wppa_get_imgdir() . wppa_opt( 'magnifier' ) . ' ),pointer;';
130
  $title = wppa_zoom_in( $id );
131
  }
132
 
@@ -153,6 +152,7 @@ function wppa_get_picture_html( $args ) {
153
  ( $videox ? ' data-videonatwidth="' . $videox . '"' : '' ) .
154
  ( $videoy ? ' data-videonatheight="' . $videoy . '"' : '' ) .
155
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'"' .
 
156
  ( $link['target'] ? ' target="' . $link['target'] . '"' : '' ) .
157
  ' class="thumb-img"' .
158
  ' id="a-' . $id . '-' . wppa( 'mocc' ) . '"' .
@@ -276,6 +276,24 @@ function wppa_get_picture_html( $args ) {
276
  return $result;
277
  }
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  // Get the html for a panorama image
280
  function wppa_get_panorama_html( $args ) {
281
 
@@ -305,6 +323,7 @@ function wppa_get_spheric_panorama_html( $args ) {
305
  'width' => false,
306
  'height' => false,
307
  'haslink' => false,
 
308
  );
309
 
310
  $args = wp_parse_args( $args, $defaults );
@@ -314,89 +333,120 @@ function wppa_get_spheric_panorama_html( $args ) {
314
  $width = $args['width'] ? $args['width'] : wppa_get_container_width();
315
  $height = $args['height'] ? $args['height'] : round( $width * wppa_get_photoy( $id ) / wppa_get_photox( $id ) );
316
  $haslink = $args['haslink'];
317
- $iconsize = wppa_opt( 'nav_icon_size_panorama' ) . 'px;';
318
-
 
319
  $url = wppa_is_mobile() ? wppa_get_photo_url( $id ) : wppa_get_hires_url( $id );
320
 
321
  $result =
 
322
  ( $haslink ? '</a>' : '' ) .
323
- '<div' .
324
- ' id="wppa-panorama-div-' . $mocc . '"' .
325
- ' class="wppa-panorama-div wppa-panorama-div-' . $mocc . '"' .
326
- ' style="margin-bottom:4px;cursor:grab;"' .
327
- ' >' .
328
- '</div>' .
329
- '<div' .
330
- ' id="wppa-panoramacontrol-div-' . $mocc . '"' .
331
- ' class="wppa-panoramacontrol-div wppa-panoramacontrol-div-' . $mocc . '"' .
332
- ' style="text-align:center;margin-bottom:4px;"' .
333
- ' >' .
334
- '<span' .
335
- ' id="wppa-panoramacontrol-left-' . $mocc . '"' .
336
- ' style="margin:2px;"' .
337
- ' >' .
338
- wppa_get_svghtml( 'Left-4', $iconsize ) .
339
- '</span>' .
340
- '<span' .
341
- ' id="wppa-panoramacontrol-right-' . $mocc . '"' .
342
- ' style="margin:2px;"' .
343
- ' >' .
344
- wppa_get_svghtml( 'Right-4', $iconsize ) .
345
- '</span>' .
346
- '<span' .
347
- ' id="wppa-panoramacontrol-up-' . $mocc . '"' .
348
- ' style="margin:2px;"' .
349
- ' >' .
350
- wppa_get_svghtml( 'Up-4', $iconsize ) .
351
- '</span>' .
352
- '<span' .
353
- ' id="wppa-panoramacontrol-down-' . $mocc . '"' .
354
- ' style="margin:2px;"' .
355
- ' >' .
356
- wppa_get_svghtml( 'Down-4', $iconsize ) .
357
- '</span>' .
358
- '<span' .
359
- ' id="wppa-panoramacontrol-zoomin-' . $mocc . '"' .
360
- ' style="margin:2px;"' .
361
- ' >' .
362
- wppa_get_svghtml( 'ZoomIn', $iconsize ) .
363
- '</span>' .
364
- '<span' .
365
- ' id="wppa-panoramacontrol-zoomout-' . $mocc . '"' .
366
- ' style="margin:2px;"' .
367
- ' >' .
368
- wppa_get_svghtml( 'ZoomOut', $iconsize ) .
 
 
 
 
 
 
 
 
 
 
 
 
369
  '</span>' .
 
 
 
 
 
 
 
 
 
 
 
370
  '</div>' .
371
- '<script>' .
372
 
373
- 'jQuery(document).ready(function(){' .
374
-
375
- 'var manualControl = false,' .
376
- 'longitude = 0,' .
377
- 'latitude = 0,' .
378
- 'savedX,' .
379
- 'savedY,' .
380
- 'savedLongitude,' .
381
- 'savedLatitude,' .
382
- 'deltaX = 0,' .
383
- 'deltaY = 0,' .
384
- 'deltaFov = 0,' .
385
- 'fov = 75,' .
386
- 'run = true,' .
387
- 'busy = false,' .
388
- 'aspect = ' . $width / $height . ',' .
389
- 'div = document.getElementById("wppa-panorama-div-' . $mocc . '"),' .
390
- 'left = document.getElementById("wppa-panoramacontrol-left-' . $mocc . '"),' .
391
- 'right = document.getElementById("wppa-panoramacontrol-right-' . $mocc . '"),' .
392
- 'up = document.getElementById("wppa-panoramacontrol-up-' . $mocc . '"),' .
393
- 'down = document.getElementById("wppa-panoramacontrol-down-' . $mocc . '"),' .
394
- 'zoomin = document.getElementById("wppa-panoramacontrol-zoomin-' . $mocc . '"),' .
395
- 'zoomout = document.getElementById("wppa-panoramacontrol-zoomout-' . $mocc . '");' .
 
 
 
 
 
 
 
396
 
397
  // setting up the renderer
398
- 'renderer' . $mocc . ' = new THREE.WebGLRenderer();' .
399
- 'renderer' . $mocc . '.setSize(' . $width . ', ' . $height . ');' .
400
 
401
  // Place the element
402
  'div.appendChild(renderer' . $mocc . '.domElement);' .
@@ -405,72 +455,82 @@ function wppa_get_spheric_panorama_html( $args ) {
405
  'var scene = new THREE.Scene();' .
406
 
407
  // adding a camera
408
- 'var camera = new THREE.PerspectiveCamera(fov, aspect, 1, 1000);' .
409
- 'camera.target = new THREE.Vector3(0, 0, 0);' .
410
 
411
  // creation of a big sphere geometry
412
- 'var sphere = new THREE.SphereGeometry(100, 100, 40);' .
413
- 'sphere.applyMatrix(new THREE.Matrix4().makeScale(-1, 1, 1));' .
414
 
415
  // creation of the sphere material
416
- 'var sphereMaterial = new THREE.MeshBasicMaterial();' .
417
- 'sphereMaterial.map = THREE.ImageUtils.loadTexture("' . $url . '");' .
418
 
419
  // geometry + material = mesh (actual object)
420
- 'var sphereMesh = new THREE.Mesh(sphere, sphereMaterial);' .
421
- 'scene.add(sphereMesh);' .
422
 
423
  // listeners
424
- ( wppa_is_mobile() ? /*
425
- div.addEventListener("touchstart", onDivMouseDown, false);
426
- div.addEventListener("touchmove", onDivMouseMove, false);
427
- div.addEventListener("touchend", onDivMouseUp, false); */
428
- 'right.addEventListener("touchstart", function(){run=true;deltaX=0.2;render();}, false);' .
429
- 'right.addEventListener("touchend", function(){run=false;deltaX=0}, false);' .
430
- 'left.addEventListener("touchstart", function(){run=true;deltaX=-0.2;render();}, false);' .
431
- 'left.addEventListener("touchend", function(){run=false;deltaX=0}, false);' .
432
- 'up.addEventListener("touchstart", function(){run=true;deltaY=0.2;render();}, false);' .
433
- 'up.addEventListener("touchend", function(){run=false;deltaY=0}, false);' .
434
- 'down.addEventListener("touchstart", function(){run=true;deltaY=-0.2;render();}, false);' .
435
- 'down.addEventListener("touchend", function(){run=false;deltaY=0}, false);' .
436
- 'zoomin.addEventListener("touchstart", function(){run=true;deltaFov=-0.2;doZoom();render();}, false);' .
437
- 'zoomin.addEventListener("touchend", function(){run=false;deltaFov=0}, false);' .
438
- 'zoomout.addEventListener("touchstart", function(){run=true;deltaFov=0.2;doZoom();render();}, false);' .
439
- 'zoomout.addEventListener("touchend", function(){run=false;deltaFov=0}, false);'
440
  :
441
- 'div.addEventListener("mousedown", onDivMouseDown, false);' .
442
- 'div.addEventListener("mousemove", onDivMouseMove, false);' .
443
- 'div.addEventListener("mouseup", onDivMouseUp, false);' .
444
- // 'div.addEventListener("mouseout", onDivMouseUp, false);' .
445
- 'right.addEventListener("mousedown", function(){run=true;deltaX=0.2;render();}, false);' .
446
- 'right.addEventListener("mouseup", function(){run=false;deltaX=0}, false);' .
447
- 'left.addEventListener("mousedown", function(){run=true;deltaX=-0.2;render();}, false);' .
448
- 'left.addEventListener("mouseup", function(){run=false;deltaX=0}, false);' .
449
- 'up.addEventListener("mousedown", function(){run=true;deltaY=0.2;render();}, false);' .
450
- 'up.addEventListener("mouseup", function(){run=false;deltaY=0}, false);' .
451
- 'down.addEventListener("mousedown", function(){run=true;deltaY=-0.2;render();}, false);' .
452
- 'down.addEventListener("mouseup", function(){run=false;deltaY=0}, false);' .
453
- 'zoomin.addEventListener("mousedown", function(){run=true;deltaFov=-0.2;doZoom();render();}, false);' .
454
- 'zoomin.addEventListener("mouseup", function(){run=false;deltaFov=0}, false);' .
455
- 'zoomout.addEventListener("mousedown", function(){run=true;deltaFov=0.2;doZoom();render();}, false);' .
456
- 'zoomout.addEventListener("mouseup", function(){run=false;deltaFov=0}, false);'
457
  ) .
 
 
 
 
 
 
 
458
 
459
- // Init and Resize hanler
460
- 'jQuery(window).on("DOMContentLoaded load resize scroll",onResize' . $mocc . ');' .
461
 
462
  // Doit!
463
  'render();' .
464
 
 
465
  'function render(){
466
 
467
- if(!run)return;
468
- if(busy)return;
469
- busy = true;
 
 
 
 
 
470
 
471
  requestAnimationFrame(render);
472
 
473
- if(!manualControl){
474
  longitude += deltaX;
475
  latitude += deltaY;
476
  }' .
@@ -488,73 +548,242 @@ function wppa_get_spheric_panorama_html( $args ) {
488
  'renderer' . $mocc . '.render(scene, camera);
489
 
490
  busy = false;
 
491
  }' .
492
 
493
  // Zoom in/out
494
  'function doZoom(){
495
-
496
  fov += deltaFov;
497
  fov = Math.max(20, Math.min(120, fov));
498
  camera = new THREE.PerspectiveCamera(fov, aspect, 1, 1000);
499
  camera.target = new THREE.Vector3(0, 0, 0);
500
- if (run) setTimeout(function(){doZoom()}, 25);
501
  }' .
502
 
503
- // when the mouse is pressed, we switch to manual control and save current coordinates
504
- 'function onDivMouseDown(event){
 
 
 
 
 
 
 
 
505
 
506
- event.preventDefault();
 
 
 
 
 
 
 
 
 
507
 
 
 
 
508
  manualControl = true;
509
-
510
- savedX = event.clientX;
511
- savedY = event.clientY;
512
-
513
  savedLongitude = longitude;
514
  savedLatitude = latitude;
515
-
516
- run=true;
517
  render();
518
-
519
  }' .
520
-
521
- // when the mouse moves, if in manual contro we adjust coordinates
522
- 'function onDivMouseMove(event){
523
-
524
  if(manualControl){
525
- longitude = (savedX - event.clientX) * 0.1 + savedLongitude;
526
- latitude = (event.clientY - savedY) * 0.1 + savedLatitude;
527
  }
528
-
529
  }' .
530
-
531
- // when the mouse is released, we turn manual control off
532
- 'function onDivMouseUp(event){
533
-
534
  manualControl = false;
535
- run=false;
 
536
 
 
 
 
 
 
 
 
 
 
 
 
 
537
  }' .
538
 
539
- // When a (responsive) resize is required, we resize the scene
540
- 'function onResize' . $mocc . '(event){
541
- var containerwidth = div.parentNode.clientWidth;
542
- var newWidth = containerwidth;
543
- var newHeight = newWidth * ' . ( $height / $width ) . ';
544
- renderer' . $mocc . '.setSize(newWidth, newHeight);
545
- run=true;
546
  render();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  doZoom();
548
- run=false;
 
549
 
 
 
 
 
 
 
 
550
  }' .
551
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
552
  '});
553
 
554
  </script>
555
  ' . ( $haslink ? '<a>' : '' ) . '';
556
 
557
- return $result;
 
558
  }
559
 
560
  // Non 360 flat panorama
@@ -566,6 +795,7 @@ function wppa_get_flat_panorama_html( $args ) {
566
  'width' => false,
567
  'height' => false,
568
  'haslink' => false,
 
569
  );
570
 
571
  $args = wp_parse_args( $args, $defaults );
@@ -575,89 +805,117 @@ function wppa_get_flat_panorama_html( $args ) {
575
  $width = $args['width'] ? $args['width'] : wppa_get_container_width();
576
  $height = $args['height'] ? $args['height'] : round( $width * wppa_get_photoy( $id ) / wppa_get_photox( $id ) );
577
  $haslink = $args['haslink'];
578
- $iconsize = wppa_opt( 'nav_icon_size_panorama' ) . 'px;';
 
 
579
 
580
  $url = wppa_is_mobile() ? wppa_get_photo_url( $id ) : wppa_get_hires_url( $id );
581
 
582
  $result =
 
583
  ( $haslink ? '</a>' : '' ) .
584
 
585
- // The container
586
- '<div' .
587
- ' id="wppa-panorama-div-' . $mocc . '"' .
588
- ' class="wppa-panorama-div wppa-panorama-div-' . $mocc . '"' .
589
- ' style="margin-bottom:4px;"' .
590
- ' >' .
 
 
 
591
 
592
  // The actual drawing area
593
- '<canvas' .
594
- ' id="wppa-panorama-canvas-' . $mocc . '"' .
595
- ' style="background-color:black;cursor:grab;"' .
596
- ' width="' . $width . '"' .
597
- ' height=' . ( $width / 2 ) . '"' .
598
- ' >' .
599
- '</canvas>' .
600
 
601
  // The preview image
602
- '<canvas' .
603
- ' id="wppa-panorama-prev-canvas-' . $mocc . '"' .
604
- ' style="margin-top:4px;background-color:black;"' .
605
- ' width="' . $width . '"' .
606
- ' height=' . $height . '"' .
607
- ' />' .
608
 
609
- '</div>' .
610
 
611
  // The controlbar
612
- '<div' .
613
- ' id="wppa-panoramacontrol-div-' . $mocc . '"' .
614
- ' class="wppa-panoramacontrol-div wppa-panoramacontrol-div-' . $mocc . '"' .
615
- ' style="text-align:center;margin-bottom:4px;"' .
616
- ' >' .
617
- '<span' .
618
- ' id="wppa-panoramacontrol-left-' . $mocc . '"' .
619
- ' style="margin:2px;"' .
620
- ' >' .
621
- wppa_get_svghtml( 'Left-4', $iconsize ) .
622
- '</span>' .
623
- '<span' .
624
- ' id="wppa-panoramacontrol-right-' . $mocc . '"' .
625
- ' style="margin:2px;"' .
626
- ' >' .
627
- wppa_get_svghtml( 'Right-4', $iconsize ) .
628
- '</span>' .
629
- '<span' .
630
- ' id="wppa-panoramacontrol-up-' . $mocc . '"' .
631
- ' style="margin:2px;"' .
632
- ' >' .
633
- wppa_get_svghtml( 'Up-4', $iconsize ) .
634
- '</span>' .
635
- '<span' .
636
- ' id="wppa-panoramacontrol-down-' . $mocc . '"' .
637
- ' style="margin:2px;"' .
638
- ' >' .
639
- wppa_get_svghtml( 'Down-4', $iconsize ) .
640
- '</span>' .
641
- '<span' .
642
- ' id="wppa-panoramacontrol-zoomin-' . $mocc . '"' .
643
- ' style="margin:2px;"' .
644
- ' >' .
645
- wppa_get_svghtml( 'ZoomIn', $iconsize ) .
646
- '</span>' .
647
- '<span' .
648
- ' id="wppa-panoramacontrol-zoomout-' . $mocc . '"' .
649
- ' style="margin:2px;"' .
650
- ' >' .
651
- wppa_get_svghtml( 'ZoomOut', $iconsize ) .
 
 
 
 
 
 
 
 
 
 
 
652
  '</span>' .
 
 
 
 
 
 
 
 
 
 
 
653
  '</div>' .
654
 
 
655
 
656
  '<script>' .
657
 
658
  // Create image object and add the image url to it
659
- 'image' . $mocc . ' = new Image();' .
660
- 'image' . $mocc . '.src = "' . $url . '",' .
661
 
662
  // When document complete, run the main proc
663
  'jQuery(document).ready(function(){wppaDoFlatPanorama' . $mocc . '();});' .
@@ -669,110 +927,114 @@ function wppa_get_flat_panorama_html( $args ) {
669
  'if (!image' . $mocc . '.complete){setTimeout( wppaDoFlatPanorama' . $mocc . ', 20 );return;}' .
670
 
671
  // Var declarations
672
- 'var manualControl = false,' .
673
- 'deltaX = 0,' .
674
- 'deltaY = 0,' .
675
- 'deltaFactor = 1.0,' .
676
- 'run = true,' .
677
- 'busy = false,' .
678
- 'div = document.getElementById("wppa-panorama-div-' . $mocc . '"),' .
679
- 'canvas = document.getElementById("wppa-panorama-canvas-' . $mocc . '"),' .
680
- 'prevCanvas = document.getElementById("wppa-panorama-prev-canvas-' . $mocc . '"),' .
681
- 'left = document.getElementById("wppa-panoramacontrol-left-' . $mocc . '"),' .
682
- 'right = document.getElementById("wppa-panoramacontrol-right-' . $mocc . '"),' .
683
- 'up = document.getElementById("wppa-panoramacontrol-up-' . $mocc . '"),' .
684
- 'down = document.getElementById("wppa-panoramacontrol-down-' . $mocc . '"),' .
685
- 'zoomin = document.getElementById("wppa-panoramacontrol-zoomin-' . $mocc . '"),' .
686
- 'zoomout = document.getElementById("wppa-panoramacontrol-zoomout-' . $mocc . '"),' .
687
- 'canvasWidth = div.parentNode.clientWidth,' .
688
- 'canvasHeight = canvasWidth / 2,' .
689
- 'savedCanvasX = 0,' .
690
- 'savedCanvasY = 0,' .
691
- 'fromHeight = image' . $mocc . '.height / 2,' .
692
- 'fromWidth = fromHeight * 2,' .
693
- 'fromX = ( image' . $mocc . '.width - fromWidth ) / 2,' .
694
- 'fromY = ( image' . $mocc . '.height - fromHeight ) / 2,' .
695
- 'centerX = fromX + fromWidth / 2,' .
696
- 'centerY = fromY + fromHeight / 2;' .
697
-
698
- // Set canvas sizes
699
- // 'canvas.width = canvasWidth;' .
700
- // 'canvas.height = canvasHeight;' .
701
- // 'prevCanvas.width = canvasWidth;' .
702
- // 'prevCanvas.height = canvasWidth * image' . $mocc . '.height / image' . $mocc . '.width;' .
703
- // 'jQuery(prevCanvas).css({width:\'\',height:\'\'});' .
704
 
705
  // Install listeners
706
- ( wppa_is_mobile() ? /*
707
- div.addEventListener("touchstart", onDivMouseDown, false);
708
- div.addEventListener("touchmove", onDivMouseMove, false);
709
- div.addEventListener("touchend", onDivMouseUp, false); */
710
- 'right.addEventListener("touchstart", function(){run=true;deltaX=2;render();}, false);' .
711
- 'right.addEventListener("touchend", onButtonup, false);' .
712
- 'left.addEventListener("touchstart", function(){run=true;deltaX=-2;render();}, false);' .
713
- 'left.addEventListener("touchend", onButtonup, false);' .
714
- 'up.addEventListener("touchstart", function(){run=true;deltaY=-2;render();}, false);' .
715
- 'up.addEventListener("touchend", onButtonup, false);' .
716
- 'down.addEventListener("touchstart", function(){run=true;deltaY=2;render();}, false);' .
717
- 'down.addEventListener("touchend", onButtonup, false);' .
718
- 'zoomin.addEventListener("touchstart", function(){run=true;deltaFactor=1.01;render();}, false);' .
719
- 'zoomin.addEventListener("touchend", onButtonup, false);' .
720
- 'zoomout.addEventListener("touchstart", function(){run=true;deltaFactor=0.99;render();}, false);' .
721
- 'zoomout.addEventListener("touchend", onButtonup, false);'
722
  :
723
- 'canvas.addEventListener("mousedown", onCanvasMouseDown, false);' .
724
- 'canvas.addEventListener("mousemove", onCanvasMouseMove, false);' .
725
- 'canvas.addEventListener("mouseup", onCanvasMouseUp, false);' .
726
- // 'canvas.addEventListener("mouseout", onCanvasMouseUp, false);' .
727
- 'prevCanvas.addEventListener("mousedown", onCanvasMouseDown, false);' .
728
- 'prevCanvas.addEventListener("mousemove", onPrevCanvasMouseMove, false);' .
729
- 'prevCanvas.addEventListener("mouseup", onCanvasMouseUp, false);' .
730
- // 'prevCanvas.addEventListener("mouseout", onCanvasMouseUp, false);' .
731
- 'right.addEventListener("mousedown", function(){run=true;deltaX=2;render();}, false);' .
732
- 'right.addEventListener("mouseup", onButtonup, false);' .
733
- 'left.addEventListener("mousedown", function(){run=true;deltaX=-2;render();}, false);' .
734
- 'left.addEventListener("mouseup", onButtonup, false);' .
735
- 'up.addEventListener("mousedown", function(){run=true;deltaY=-2;render();}, false);' .
736
- 'up.addEventListener("mouseup", onButtonup, false);' .
737
- 'down.addEventListener("mousedown", function(){run=true;deltaY=2;render();}, false);' .
738
- 'down.addEventListener("mouseup", onButtonup, false);' .
739
- 'zoomin.addEventListener("mousedown", function(){run=true;deltaFactor=1.01;render();}, false);' .
740
- 'zoomin.addEventListener("mouseup", onButtonup, false);' .
741
- 'zoomout.addEventListener("mousedown", function(){run=true;deltaFactor=0.99;render();}, false);' .
742
- 'zoomout.addEventListener("mouseup", onButtonup, false);'
743
  ) .
744
 
 
 
 
 
 
745
  // Install Resize handler
746
- 'jQuery(window).on("DOMContentLoaded load resize scroll",onResize' . $mocc . ');' .
747
 
748
  // Do the rendering
749
  'render();' .
750
 
 
 
 
751
  // The render function
752
- 'function render(){' .
753
- 'if (!run) return;' .
754
- 'if (busy) return;' .
755
- 'busy = true;' .
 
 
 
 
 
756
 
757
  // manualControl is true when a drag on the canvas is being performed
758
  'if(!manualControl){' .
759
 
760
  // Panning
761
- 'fromX += deltaX;' .
762
- 'fromY += deltaY;' .
763
 
764
  // Zooming
765
- 'var newHeight = fromHeight / deltaFactor;' .
766
- 'var newWidth = fromWidth / deltaFactor;' .
767
 
768
  // Keep zooming in range
769
- 'if ( deltaFactor != 1 && newHeight <= image' . $mocc . '.height && newHeight > 50 ) {' .
770
- 'fromX -= ( newWidth - fromWidth ) / 2;' .
771
- 'fromY -= ( newHeight - fromHeight ) / 2;' .
772
- 'fromWidth = newWidth;' .
773
- 'fromHeight = newHeight;' .
774
- '}' .
775
- '}' .
776
 
777
  // Keep viewport within image boundaries
778
  'fromX = Math.max(0, Math.min(image' . $mocc . '.width-fromWidth, fromX));' .
@@ -780,14 +1042,14 @@ function wppa_get_flat_panorama_html( $args ) {
780
 
781
  // Draw the image
782
  'var context = canvas.getContext("2d");' .
783
- 'context.drawImage(image' . $mocc . ',fromX,fromY,fromWidth,fromHeight,0,0,canvasWidth,canvasHeight);' .
784
 
785
  // Draw the preview image
786
  'var prevContext = prevCanvas.getContext("2d");' .
787
  'prevContext.clearRect(0, 0, prevCanvas.width, prevCanvas.height);' .
788
  'prevContext.drawImage(image' . $mocc . ',0,0,image' . $mocc . '.width,image' . $mocc . '.height,0,0,prevCanvas.width,prevCanvas.height);' .
789
 
790
- // Draw viewport rect on preview iamge
791
  'var factor = prevCanvas.width / image' . $mocc . '.width;' .
792
  'prevContext.strokeRect(factor*fromX,factor*fromY,factor*fromWidth,factor*fromHeight);' .
793
 
@@ -795,72 +1057,247 @@ function wppa_get_flat_panorama_html( $args ) {
795
  'busy = false;' .
796
 
797
  // Re-render if needed
798
- 'if (run) {' .
799
  'if (manualControl){setTimeout(function(){render()},25);}' .
800
  'else {setTimeout(function(){render()},5);}' .
801
- '}' .
 
802
  '}' .
803
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
804
  // When a navigation button is released, stop and reset all deltas
805
- 'function onButtonup(event) {' .
806
- 'run=false;deltaX=0;deltaY=0;deltaFactor=1;' .
807
- '}' .
 
 
808
 
809
  // When a (responsive) resize is required, we resize the scene
810
- 'function onResize' . $mocc . '(event){' .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
811
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  'canvasWidth = div.parentNode.clientWidth;' .
813
  'canvasHeight = canvasWidth / 2;' .
814
  'canvas.width = canvasWidth;' .
815
  'canvas.height = canvasHeight;' .
816
  'prevCanvas.width = canvasWidth;' .
817
  'prevCanvas.height = canvasWidth * ' . $height . ' / ' . $width . ';' .
818
- 'run=true;' .
819
- 'render();' .
820
- 'run=false;' .
 
821
  '}' .
822
 
823
  // when the mouse is pressed on the canvas, we switch to manual control and save current coordinates
824
- 'function onCanvasMouseDown(event){
825
 
826
- event.preventDefault();
827
 
828
  manualControl = true;
829
 
830
- savedCanvasX = event.offsetX;
831
- savedCanvasY = event.offsetY;
832
 
833
  fromX = fromX;
834
  fromY = fromY;
835
 
836
- run=true;
837
  render();
838
 
839
  }' .
840
 
841
- 'function onCanvasMouseMove(event){
842
 
843
  if ( manualControl && !busy ){
844
 
845
  var factor = canvasWidth / fromWidth;
846
 
847
- fromX = ( savedCanvasX - event.offsetX ) / factor + fromX;
848
- fromY = ( savedCanvasY - event.offsetY ) / factor + fromY;
849
 
850
- savedCanvasX = event.offsetX;
851
- savedCanvasY = event.offsetY;
852
  }
853
 
854
  }' .
855
 
856
- 'function onPrevCanvasMouseMove(event){
857
 
858
  var factor = prevCanvas.width / image' . $mocc . '.width;
859
 
860
- if (event.offsetX > factor * fromX &&
861
- event.offsetX < factor * ( fromX + fromWidth ) &&
862
- event.offsetY > factor * fromY &&
863
- event.offsetY < factor * ( fromY + fromHeight ) ) {
864
 
865
  jQuery(prevCanvas).css(\'cursor\',\'grab\');
866
  }
@@ -870,25 +1307,25 @@ function wppa_get_flat_panorama_html( $args ) {
870
 
871
  if ( manualControl && !busy ){
872
 
873
- if (event.offsetX > factor * fromX &&
874
- event.offsetX < factor * ( fromX + fromWidth ) &&
875
- event.offsetY > factor * fromY &&
876
- event.offsetY < factor * ( fromY + fromHeight ) ) {
877
 
878
- fromX = ( event.offsetX - savedCanvasX ) / factor + fromX;
879
- fromY = ( event.offsetY - savedCanvasY ) / factor + fromY;
880
 
881
- savedCanvasX = event.offsetX;
882
- savedCanvasY = event.offsetY;
883
 
884
  }
885
  }
886
  }' .
887
 
888
- 'function onCanvasMouseUp(event){
889
 
890
  manualControl = false;
891
- run=false;
892
 
893
  }' .
894
 
@@ -897,5 +1334,25 @@ function wppa_get_flat_panorama_html( $args ) {
897
  </script>
898
  ' . ( $haslink ? '<a>' : '' ) . '';
899
 
900
- return $result;
901
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Make the picture html
6
+ * Version 6.9.09
7
  *
8
  */
9
 
126
 
127
  }
128
  if ( $link['is_lightbox'] ) {
 
129
  $title = wppa_zoom_in( $id );
130
  }
131
 
152
  ( $videox ? ' data-videonatwidth="' . $videox . '"' : '' ) .
153
  ( $videoy ? ' data-videonatheight="' . $videoy . '"' : '' ) .
154
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'"' .
155
+ wppa_get_lb_panorama_full_html( $id ) .
156
  ( $link['target'] ? ' target="' . $link['target'] . '"' : '' ) .
157
  ' class="thumb-img"' .
158
  ' id="a-' . $id . '-' . wppa( 'mocc' ) . '"' .
276
  return $result;
277
  }
278
 
279
+ // Get full html for a lightbox panorama image, e.g. ' data-panorama="'..."' for use in lightbox anchor link
280
+ function wppa_get_lb_panorama_full_html( $id ) {
281
+
282
+ $result = wppa_get_lb_panorama_html( $id );
283
+ if ( $result ) {
284
+ return ' data-panorama="' . esc_attr( $result ) . '"';
285
+ }
286
+ else {
287
+ return '';
288
+ }
289
+ }
290
+
291
+ // Get the html for a lightbox panorama image
292
+ function wppa_get_lb_panorama_html( $id ) {
293
+
294
+ return wppa_get_panorama_html( array( 'id' => $id, 'lightbox' => true, ) );
295
+ }
296
+
297
  // Get the html for a panorama image
298
  function wppa_get_panorama_html( $args ) {
299
 
323
  'width' => false,
324
  'height' => false,
325
  'haslink' => false,
326
+ 'lightbox' => 0,
327
  );
328
 
329
  $args = wp_parse_args( $args, $defaults );
333
  $width = $args['width'] ? $args['width'] : wppa_get_container_width();
334
  $height = $args['height'] ? $args['height'] : round( $width * wppa_get_photoy( $id ) / wppa_get_photox( $id ) );
335
  $haslink = $args['haslink'];
336
+ $icsiz = wppa_opt( 'nav_icon_size_panorama' );
337
+ $iconsize = $icsiz . 'px;';
338
+ $lightbox = $args['lightbox'];
339
  $url = wppa_is_mobile() ? wppa_get_photo_url( $id ) : wppa_get_hires_url( $id );
340
 
341
  $result =
342
+ ( $lightbox ? $id . '.' : '' ) .
343
  ( $haslink ? '</a>' : '' ) .
344
+ ( $lightbox ? '<div id="wppa-ovl-panorama-container" >' : '' ) .
345
+ '<div
346
+ id="wppa-panorama-div-' . $mocc . '"
347
+ class="wppa-panorama-div wppa-panorama-div-' . $mocc . '"
348
+ style="margin-bottom:4px;cursor:grab;"
349
+ >
350
+ </div>
351
+ <div
352
+ id="wppa-panoramacontrol-div-' . $mocc . '"
353
+ class="wppa-panoramacontrol-div wppa-panoramacontrol-div-' . $mocc . '"
354
+ style="text-align:center;"
355
+ >' .
356
+ ( $lightbox ?
357
+ '<span
358
+ id="wppa-panoramacontrol-prev-' . $mocc . '"
359
+ class="wppa-panorama-prevnext"
360
+ style="margin:0 2px 0 0;float:left;"
361
+ >' .
362
+ wppa_get_svghtml( 'Prev-Button', $iconsize, true ) .
363
+ '</span>'
364
+ :
365
+ ''
366
+ ) .
367
+ '<span
368
+ id="wppa-panoramacontrol-left-' . $mocc . '"
369
+ style="margin:0 2px;"
370
+ >' .
371
+ wppa_get_svghtml( 'Left-4', $iconsize, true ) .
372
+ '</span>
373
+ <span
374
+ id="wppa-panoramacontrol-right-' . $mocc . '"
375
+ style="margin:0 2px;"
376
+ >' .
377
+ wppa_get_svghtml( 'Right-4', $iconsize, true ) .
378
+ '</span>
379
+ <span
380
+ id="wppa-panoramacontrol-up-' . $mocc . '"
381
+ style="margin:0 2px;"
382
+ >' .
383
+ wppa_get_svghtml( 'Up-4', $iconsize, true ) .
384
+ '</span>
385
+ <span
386
+ id="wppa-panoramacontrol-down-' . $mocc . '"
387
+ style="margin:0 2px;"
388
+ >' .
389
+ wppa_get_svghtml( 'Down-4', $iconsize, true ) .
390
+ '</span>
391
+ <span
392
+ id="wppa-panoramacontrol-zoomin-' . $mocc . '"
393
+ style="margin:0 2px;"
394
+ >' .
395
+ wppa_get_svghtml( 'ZoomIn', $iconsize, true ) .
396
+ '</span>
397
+ <span
398
+ id="wppa-panoramacontrol-zoomout-' . $mocc . '"
399
+ style="margin:0 2px;"
400
+ >' .
401
+ wppa_get_svghtml( 'ZoomOut', $iconsize, true ) .
402
  '</span>' .
403
+ ( $lightbox ?
404
+ '<span
405
+ id="wppa-panoramacontrol-next-' . $mocc . '"
406
+ class="wppa-panorama-prevnext"
407
+ style="margin:0 0 0 2px;float:right;"
408
+ >' .
409
+ wppa_get_svghtml( 'Next-Button', $iconsize, true ) .
410
+ '</span>'
411
+ :
412
+ ''
413
+ ) .
414
  '</div>' .
 
415
 
416
+ ( $lightbox ? '</div>' : '' ) .
417
+
418
+ '<script>
419
+
420
+ jQuery(document).ready(function(){
421
+
422
+ var
423
+ manualControl = false,
424
+ longitude = 180,
425
+ latitude = 0,
426
+ savedX,
427
+ savedY,
428
+ savedLongitude,
429
+ savedLatitude,
430
+ deltaX = 0,
431
+ deltaY = 0,
432
+ deltaFov = 0,
433
+ fov = 75,
434
+ run = 2,
435
+ busy = false,
436
+ aspect = ' . $width / $height . ',
437
+ div = document.getElementById( "wppa-panorama-div-' . $mocc . '" ),
438
+ left = document.getElementById( "wppa-panoramacontrol-left-' . $mocc . '" ),
439
+ right = document.getElementById( "wppa-panoramacontrol-right-' . $mocc . '" ),
440
+ up = document.getElementById( "wppa-panoramacontrol-up-' . $mocc . '" ),
441
+ down = document.getElementById( "wppa-panoramacontrol-down-' . $mocc . '" ),
442
+ zoomin = document.getElementById( "wppa-panoramacontrol-zoomin-' . $mocc . '" ),
443
+ zoomout = document.getElementById( "wppa-panoramacontrol-zoomout-' . $mocc . '" ),
444
+ prev = document.getElementById( "wppa-panoramacontrol-prev-' . $mocc . '" ),
445
+ next = document.getElementById( "wppa-panoramacontrol-next-' . $mocc . '" );' .
446
 
447
  // setting up the renderer
448
+ 'renderer' . $mocc . ' = new THREE.WebGLRenderer();
449
+ renderer' . $mocc . '.setSize(' . $width . ', ' . $height . ');' .
450
 
451
  // Place the element
452
  'div.appendChild(renderer' . $mocc . '.domElement);' .
455
  'var scene = new THREE.Scene();' .
456
 
457
  // adding a camera
458
+ 'var camera = new THREE.PerspectiveCamera(fov, aspect, 1, 1000);
459
+ camera.target = new THREE.Vector3(0, 0, 0);' .
460
 
461
  // creation of a big sphere geometry
462
+ 'var sphere = new THREE.SphereGeometry(100, 100, 40);
463
+ sphere.applyMatrix(new THREE.Matrix4().makeScale(-1, 1, 1));' .
464
 
465
  // creation of the sphere material
466
+ 'var sphereMaterial = new THREE.MeshBasicMaterial();
467
+ sphereMaterial.map = THREE.ImageUtils.loadTexture("' . $url . '");' .
468
 
469
  // geometry + material = mesh (actual object)
470
+ 'var sphereMesh = new THREE.Mesh(sphere, sphereMaterial);
471
+ scene.add(sphereMesh);' .
472
 
473
  // listeners
474
+ ( wppa_is_mobile() ?
475
+ 'right.addEventListener("touchstart", onRightMouseDown,true);
476
+ right.addEventListener("touchend", onButtonUp,true);
477
+ left.addEventListener("touchstart", onLeftMouseDown,true);
478
+ left.addEventListener("touchend", onButtonUp,true);
479
+ up.addEventListener("touchstart", onUpMouseDown,true);
480
+ up.addEventListener("touchend", onButtonUp,true);
481
+ down.addEventListener("touchstart", onDownMouseDown,true);
482
+ down.addEventListener("touchend", onButtonUp,true);
483
+ zoomin.addEventListener("touchstart", onZoomInMouseDown,true);
484
+ zoomin.addEventListener("touchend", onButtonUp,true);
485
+ zoomout.addEventListener("touchstart", onZoomOutMouseDown,true);
486
+ zoomout.addEventListener("touchend", onButtonUp,true);'
 
 
 
487
  :
488
+ 'div.addEventListener("mousedown", onDivMouseDown,true);
489
+ div.addEventListener("mousemove", onDivMouseMove,true);
490
+ div.addEventListener("mouseup", onDivMouseUp,true);
491
+ div.addEventListener("mouseout", onDivMouseUp,true);
492
+ right.addEventListener("mousedown", onRightMouseDown,true);
493
+ right.addEventListener("mouseup", onButtonUp,true);
494
+ left.addEventListener("mousedown", onLeftMouseDown,true);
495
+ left.addEventListener("mouseup", onButtonUp,true);
496
+ up.addEventListener("mousedown", onUpMouseDown,true);
497
+ up.addEventListener("mouseup", onButtonUp,true);
498
+ down.addEventListener("mousedown", onDownMouseDown,true);
499
+ down.addEventListener("mouseup", onButtonUp,true);
500
+ zoomin.addEventListener("mousedown", onZoomInMouseDown,true);
501
+ zoomin.addEventListener("mouseup", onButtonUp,true);
502
+ zoomout.addEventListener("mousedown", onZoomOutMouseDown,true);
503
+ zoomout.addEventListener("mouseup", onButtonUp,true);'
504
  ) .
505
+ 'if (prev) {
506
+ prev.addEventListener("click", panPrev,true);
507
+ next.addEventListener("click", panNext,true);
508
+ }' .
509
+
510
+ // Install Resize hanler
511
+ 'jQuery(window).on("DOMContentLoaded load resize scroll orientationchange",onResize' . $mocc . ');' .
512
 
513
+ // Resize
514
+ 'onResize' . $mocc . '();' .
515
 
516
  // Doit!
517
  'render();' .
518
 
519
+ // The rendering function
520
  'function render(){
521
 
522
+ if(run==0)return;
523
+ if(busy)return;' .
524
+
525
+ ( $lightbox ? 'if ( wppaOvlActivePanorama != ' . $id . ' ) return;' : '' ) .
526
+
527
+ 'busy = true;
528
+
529
+ jQuery("#wppa-ovl-spin").stop().fadeOut();
530
 
531
  requestAnimationFrame(render);
532
 
533
+ if ( ! manualControl ) {
534
  longitude += deltaX;
535
  latitude += deltaY;
536
  }' .
548
  'renderer' . $mocc . '.render(scene, camera);
549
 
550
  busy = false;
551
+ if (run<5) run--;
552
  }' .
553
 
554
  // Zoom in/out
555
  'function doZoom(){
 
556
  fov += deltaFov;
557
  fov = Math.max(20, Math.min(120, fov));
558
  camera = new THREE.PerspectiveCamera(fov, aspect, 1, 1000);
559
  camera.target = new THREE.Vector3(0, 0, 0);
560
+ if (run>0) setTimeout(function(){doZoom()}, 25);
561
  }' .
562
 
563
+ // Previous
564
+ 'function panPrev(e) {
565
+ e.preventDefault();
566
+ var stop;
567
+ if ( ! stop ) {
568
+ stop = true;
569
+ jQuery(this).css({opacity:0.5});
570
+ wppaOvlShowPrev();
571
+ }
572
+ }' .
573
 
574
+ // Next
575
+ 'function panNext(e) {
576
+ e.preventDefault();
577
+ var stop;
578
+ if ( ! stop ) {
579
+ stop = true;
580
+ jQuery(this).css({opacity:0.5});
581
+ wppaOvlShowNext();
582
+ }
583
+ }' .
584
 
585
+ // Manual movement on the image div
586
+ 'function onDivMouseDown(e){
587
+ e.preventDefault();
588
  manualControl = true;
589
+ savedX = e.clientX;
590
+ savedY = e.clientY;
 
 
591
  savedLongitude = longitude;
592
  savedLatitude = latitude;
593
+ run=5;
 
594
  render();
 
595
  }' .
596
+ 'function onDivMouseMove(e){
 
 
 
597
  if(manualControl){
598
+ longitude = (savedX - e.clientX) * 0.1 + savedLongitude;
599
+ latitude = (e.clientY - savedY) * 0.1 + savedLatitude;
600
  }
 
601
  }' .
602
+ 'function onDivMouseUp(e){
 
 
 
603
  manualControl = false;
604
+ ' . ( $lightbox ? '' : 'run=1;' ) . '
605
+ }' .
606
 
607
+ // Horizontal movement by buttons
608
+ 'function onRightMouseDown(e) {
609
+ e.preventDefault();
610
+ run=5;
611
+ deltaX=0.2;
612
+ render();
613
+ }' .
614
+ 'function onLeftMouseDown(e) {
615
+ e.preventDefault();
616
+ run=5;
617
+ deltaX=-0.2;
618
+ render();
619
  }' .
620
 
621
+ // Vertical movement by buttons
622
+ 'function onUpMouseDown(e) {
623
+ e.preventDefault();
624
+ run=5;
625
+ deltaY=0.2;
 
 
626
  render();
627
+ }' .
628
+ 'function onDownMouseDown(e) {
629
+ e.preventDefault();
630
+ run=5;
631
+ deltaY=-0.2;
632
+ render();
633
+ }' .
634
+
635
+ // Zooming
636
+ 'function onZoomInMouseDown(e) {
637
+ e.preventDefault();
638
+ run=5;
639
+ deltaFov=-0.4;
640
+ doZoom();
641
+ render();
642
+ }' .
643
+ 'function onZoomOutMouseDown(e) {
644
+ e.preventDefault();
645
+ run=5;
646
+ deltaFov=0.4;
647
  doZoom();
648
+ render();
649
+ }' .
650
 
651
+ // Release a button resets all deltas and indicates one rendering to go
652
+ 'function onButtonUp(e) {
653
+ e.preventDefault();
654
+ deltaX=0;
655
+ deltaY=0;
656
+ deltaFov=0;
657
+ if ( ! ' . $lightbox . ' ) run--;
658
  }' .
659
 
660
+ // When a (responsive) resize is required, we resize the scene
661
+ 'function onResize' . $mocc . '(e){' .
662
+
663
+ ( $lightbox ?
664
+
665
+ // Show image container
666
+ 'jQuery("#wppa-overlay-ic").css("display", "");' .
667
+
668
+ // There are 4 possiblilities: all combi of 'Width is the limit or not' and 'Mode is normal or fullscreen'
669
+ 'var widthIsLim,
670
+ modeIsNormal = wppaOvlMode == "normal";' .
671
+
672
+ // Find container dimensions dependant of mode
673
+ 'var contWidth, contHeight;
674
+
675
+ if ( modeIsNormal ) {
676
+ contWidth = window.innerWidth ? window.innerWidth : screen.width;
677
+ contHeight = window.innerHeight ? window.innerHeight : screen.height;
678
+ }
679
+ else {
680
+ contWidth = screen.width;
681
+ contHeight = screen.height;
682
+ }' .
683
+
684
+ // Initialize new display sizes
685
+ 'var newWidth,
686
+ newHeight,
687
+ topMarg,
688
+ leftMarg,
689
+ extraX = 8,
690
+ extraY = 8 + ' . $icsiz . ' + 40;' .
691
+
692
+ // Add borderwidth in case of mode == normal
693
+ 'if ( modeIsNormal ) {
694
+ extraX += 2 * ' . wppa_opt( 'ovl_border_width' ) . ';
695
+ extraY += 2 * ' . wppa_opt( 'ovl_border_width' ) . ';
696
+ }
697
+ ' .
698
+
699
+ // Find out if the width is the limitng dimension
700
+ 'widthIsLim = ( contHeight > ( ( ( contWidth - extraX ) / 2 ) + extraY ) );' .
701
+
702
+ // Compute new sizes and margins
703
+ 'if ( widthIsLim ) {
704
+ newWidth = contWidth - extraX;
705
+ newHeight = newWidth / 2;
706
+ topMarg = ( contHeight - newHeight - extraY ) / 2 + 20;' .
707
+ '}
708
+ else {
709
+ newHeight = contHeight - extraY;
710
+ newWidth = newHeight * 2;
711
+ topMarg = 20;' .
712
+
713
+ '}
714
+ newWidth = parseInt(newWidth);
715
+ newHeight = parseInt(newHeight);
716
+ ' .
717
+
718
+ // Set css common for all 4 situations
719
+ 'jQuery("#wppa-ovl-panorama-container").css({marginTop:topMarg});
720
+ jQuery("#wppa-overlay-ic").css({marginTop:0});' .
721
+
722
+ // Now set css for all 4 situations: Mode is normal
723
+ 'if ( modeIsNormal ) {' .
724
+
725
+ // Common for mode normal
726
+ 'jQuery("#wppa-ovl-panorama-container").css({
727
+ backgroundColor:"' . wppa_opt( 'ovl_theme' ) . '",
728
+ padding:"' . wppa_opt( 'ovl_border_width' ) . 'px",
729
+ borderRadius:"' . wppa_opt( 'ovl_border_radius' ) . 'px",
730
+ width:newWidth
731
+ });
732
+ jQuery( "#wppa-panoramacontrol-div-' . $mocc . '" ).css({marginLeft:0});' .
733
+
734
+ // Limit specific
735
+ 'if ( widthIsLim ) {
736
+ jQuery("#wppa-overlay-ic").css({marginLeft:4});
737
+ }
738
+ else {
739
+ jQuery("#wppa-overlay-ic").css({marginLeft:(contWidth-newWidth)/2});
740
+ }
741
+ }' .
742
+
743
+ // Mode is fullscreen
744
+ 'else {' .
745
+
746
+ // Common for mode fullscreen
747
+ 'jQuery("#wppa-overlay-ic").css({marginLeft:0});
748
+ jQuery("#wppa-ovl-panorama-container").css({
749
+ backgroundColor:"transparent",
750
+ padding:0,
751
+ borderRadius:0,
752
+ width:newWidth,
753
+ marginLeft:(contWidth-newWidth)/2
754
+ });
755
+
756
+ if ( widthIsLim ) {
757
+ jQuery("#wppa-panoramacontrol-div-' . $mocc . '").css({marginLeft:0});
758
+ }
759
+ else {
760
+ jQuery("#wppa-panoramacontrol-div-' . $mocc . '").css({marginLeft:0});
761
+ }
762
+ }
763
+
764
+ renderer' . $mocc . '.setSize(newWidth, newHeight);
765
+ run=5;
766
+ render();
767
+ doZoom();
768
+ ' :
769
+ '
770
+ var containerwidth = div.parentNode.clientWidth;
771
+ var newWidth = containerwidth;
772
+ var newHeight = newWidth * ' . ( $height / $width ) . ';
773
+ renderer' . $mocc . '.setSize(newWidth, newHeight);
774
+ run=5;
775
+ render();
776
+ doZoom();
777
+ run=false;'
778
+ ) . '
779
+ }' .
780
  '});
781
 
782
  </script>
783
  ' . ( $haslink ? '<a>' : '' ) . '';
784
 
785
+ //return $result;
786
+ return wppa_panorama_min( $result );
787
  }
788
 
789
  // Non 360 flat panorama
795
  'width' => false,
796
  'height' => false,
797
  'haslink' => false,
798
+ 'lightbox' => 0,
799
  );
800
 
801
  $args = wp_parse_args( $args, $defaults );
805
  $width = $args['width'] ? $args['width'] : wppa_get_container_width();
806
  $height = $args['height'] ? $args['height'] : round( $width * wppa_get_photoy( $id ) / wppa_get_photox( $id ) );
807
  $haslink = $args['haslink'];
808
+ $icsiz = wppa_opt( 'nav_icon_size_panorama' );
809
+ $iconsize = $icsiz . 'px;';
810
+ $lightbox = $args['lightbox'];
811
 
812
  $url = wppa_is_mobile() ? wppa_get_photo_url( $id ) : wppa_get_hires_url( $id );
813
 
814
  $result =
815
+ ( $lightbox ? $id . '.' : '' ) .
816
  ( $haslink ? '</a>' : '' ) .
817
 
818
+ // The overall container
819
+ ( $lightbox ? '<div id="wppa-ovl-panorama-container" >' : '' ) .
820
+
821
+ // The canvas container
822
+ '<div
823
+ id="wppa-panorama-div-' . $mocc . '"
824
+ class="wppa-panorama-div wppa-panorama-div-' . $mocc . '"
825
+ style="margin-bottom:4px;"
826
+ >' .
827
 
828
  // The actual drawing area
829
+ '<canvas
830
+ id="wppa-panorama-canvas-' . $mocc . '"
831
+ style="background-color:black;cursor:grab;"
832
+ width="' . $width . '"
833
+ height="' . ( $width / 2 ) . '"
834
+ ></canvas>' .
 
835
 
836
  // The preview image
837
+ '<canvas
838
+ id="wppa-panorama-prev-canvas-' . $mocc . '"
839
+ style="margin-top:4px;background-color:black;"
840
+ width="' . $width . '"
841
+ height=' . $height . '"
842
+ ></canvas>
843
 
844
+ </div>' .
845
 
846
  // The controlbar
847
+ '<div
848
+ id="wppa-panoramacontrol-div-' . $mocc . '"
849
+ class="wppa-panoramacontrol-div wppa-panoramacontrol-div-' . $mocc . '"
850
+ style="text-align:center;"
851
+ >' .
852
+ ( $lightbox ?
853
+ '<span
854
+ id="wppa-panoramacontrol-prev-' . $mocc . '"
855
+ class="wppa-panorama-prevnext"
856
+ style="margin:0 2px 0 0;float:left;"
857
+ >' .
858
+ wppa_get_svghtml( 'Prev-Button', $iconsize, true ) .
859
+ '</span>'
860
+ :
861
+ ''
862
+ ) .
863
+ '<span
864
+ id="wppa-panoramacontrol-left-' . $mocc . '"
865
+ style="margin:0 2px;"
866
+ >' .
867
+ wppa_get_svghtml( 'Left-4', $iconsize, true ) .
868
+ '</span>
869
+ <span
870
+ id="wppa-panoramacontrol-right-' . $mocc . '"
871
+ style="margin:0 2px;"
872
+ >' .
873
+ wppa_get_svghtml( 'Right-4', $iconsize, true ) .
874
+ '</span>
875
+ <span
876
+ id="wppa-panoramacontrol-up-' . $mocc . '"
877
+ style="margin:0 2px;"
878
+ >' .
879
+ wppa_get_svghtml( 'Up-4', $iconsize, true ) .
880
+ '</span>
881
+ <span
882
+ id="wppa-panoramacontrol-down-' . $mocc . '"
883
+ style="margin:0 2px;"
884
+ >' .
885
+ wppa_get_svghtml( 'Down-4', $iconsize, true ) .
886
+ '</span>
887
+ <span
888
+ id="wppa-panoramacontrol-zoomin-' . $mocc . '"
889
+ style="margin:0 2px;"
890
+ >' .
891
+ wppa_get_svghtml( 'ZoomIn', $iconsize, true ) .
892
+ '</span>
893
+ <span
894
+ id="wppa-panoramacontrol-zoomout-' . $mocc . '"
895
+ style="margin:0 2px;"
896
+ >' .
897
+ wppa_get_svghtml( 'ZoomOut', $iconsize, true ) .
898
  '</span>' .
899
+ ( $lightbox ?
900
+ '<span
901
+ id="wppa-panoramacontrol-next-' . $mocc . '"
902
+ class="wppa-panorama-prevnext"
903
+ style="margin:0 0 0 2px;float:right;"
904
+ >' .
905
+ wppa_get_svghtml( 'Next-Button', $iconsize, true ) .
906
+ '</span>'
907
+ :
908
+ ''
909
+ ) .
910
  '</div>' .
911
 
912
+ ( $lightbox ? '</div>' : '' ) .
913
 
914
  '<script>' .
915
 
916
  // Create image object and add the image url to it
917
+ 'var image' . $mocc . ' = new Image();
918
+ image' . $mocc . '.src = "' . $url . '",' .
919
 
920
  // When document complete, run the main proc
921
  'jQuery(document).ready(function(){wppaDoFlatPanorama' . $mocc . '();});' .
927
  'if (!image' . $mocc . '.complete){setTimeout( wppaDoFlatPanorama' . $mocc . ', 20 );return;}' .
928
 
929
  // Var declarations
930
+ 'var
931
+ manualControl = false,
932
+ deltaX = 0,
933
+ deltaY = 0,
934
+ deltaFactor = 1.0,
935
+ run = 2,
936
+ busy = false,
937
+ div = document.getElementById("wppa-panorama-div-' . $mocc . '"),
938
+ canvas = document.getElementById("wppa-panorama-canvas-' . $mocc . '"),
939
+ prevCanvas = document.getElementById("wppa-panorama-prev-canvas-' . $mocc . '"),
940
+ left = document.getElementById("wppa-panoramacontrol-left-' . $mocc . '"),
941
+ right = document.getElementById("wppa-panoramacontrol-right-' . $mocc . '"),
942
+ up = document.getElementById("wppa-panoramacontrol-up-' . $mocc . '"),
943
+ down = document.getElementById("wppa-panoramacontrol-down-' . $mocc . '"),
944
+ zoomin = document.getElementById("wppa-panoramacontrol-zoomin-' . $mocc . '"),
945
+ zoomout = document.getElementById("wppa-panoramacontrol-zoomout-' . $mocc . '"),
946
+ prev = document.getElementById( "wppa-panoramacontrol-prev-' . $mocc . '" ),
947
+ next = document.getElementById( "wppa-panoramacontrol-next-' . $mocc . '" ),
948
+ canvasWidth = div.parentNode.clientWidth,
949
+ canvasHeight = canvasWidth / 2,
950
+ savedCanvasX = 0,
951
+ savedCanvasY = 0,
952
+ fromHeight = image' . $mocc . '.height / 2,
953
+ fromWidth = fromHeight * 2,
954
+ fromX = ( image' . $mocc . '.width - fromWidth ) / 2,
955
+ fromY = ( image' . $mocc . '.height - fromHeight ) / 2,
956
+ centerX = fromX + fromWidth / 2,
957
+ centerY = fromY + fromHeight / 2;' .
 
 
 
 
958
 
959
  // Install listeners
960
+ ( wppa_is_mobile() ?
961
+ 'right.addEventListener("touchstart", onRightMouseDown,true);
962
+ right.addEventListener("touchend", onButtonUp,true);
963
+ left.addEventListener("touchstart", onLeftMouseDown,true);
964
+ left.addEventListener("touchend", onButtonUp,true);
965
+ up.addEventListener("touchstart", onUpMouseDown,true);
966
+ up.addEventListener("touchend", onButtonUp,true);
967
+ down.addEventListener("touchstart", onDownMouseDown,true);
968
+ down.addEventListener("touchend", onButtonUp,true);
969
+ zoomin.addEventListener("touchstart", onZoomInMouseDown,true);
970
+ zoomin.addEventListener("touchend", onButtonUp,true);
971
+ zoomout.addEventListener("touchstart", onZoomOutMouseDown,true);
972
+ zoomout.addEventListener("touchend", onButtonUp,true);'
 
 
 
973
  :
974
+ 'canvas.addEventListener("mousedown", onCanvasMouseDown,true);
975
+ canvas.addEventListener("mousemove", onCanvasMouseMove,true);
976
+ canvas.addEventListener("mouseup", onCanvasMouseUp,true);
977
+ prevCanvas.addEventListener("mousedown", onCanvasMouseDown,true);
978
+ prevCanvas.addEventListener("mousemove", onPrevCanvasMouseMove,true);
979
+ prevCanvas.addEventListener("mouseup", onCanvasMouseUp,true);
980
+ right.addEventListener("mousedown", onRightMouseDown,true);
981
+ right.addEventListener("mouseup", onButtonUp,true);
982
+ left.addEventListener("mousedown", onLeftMouseDown,true);
983
+ left.addEventListener("mouseup", onButtonUp,true);
984
+ up.addEventListener("mousedown", onUpMouseDown,true);
985
+ up.addEventListener("mouseup", onButtonUp,true);
986
+ down.addEventListener("mousedown", onDownMouseDown,true);
987
+ down.addEventListener("mouseup", onButtonUp,true);
988
+ zoomin.addEventListener("mousedown", onZoomInMouseDown,true);
989
+ zoomin.addEventListener("mouseup", onButtonUp,true);
990
+ zoomout.addEventListener("mousedown", onZoomOutMouseDown,true);
991
+ zoomout.addEventListener("mouseup", onButtonUp,true);'
 
 
992
  ) .
993
 
994
+ 'if (prev) {
995
+ prev.addEventListener("click", panPrev,true);
996
+ next.addEventListener("click", panNext,true);
997
+ }' .
998
+
999
  // Install Resize handler
1000
+ 'jQuery(window).on("DOMContentLoaded load resize scroll orientationchange",onResize' . $mocc . ');' .
1001
 
1002
  // Do the rendering
1003
  'render();' .
1004
 
1005
+ // Resize
1006
+ 'onResize' . $mocc . '();' .
1007
+
1008
  // The render function
1009
+ 'function render(){
1010
+
1011
+ if (run==0) return;
1012
+ if (busy) return;
1013
+ busy = true;' .
1014
+
1015
+ ( $lightbox ? 'if ( wppaOvlActivePanorama != ' . $id . ' ) return;' : '' ) .
1016
+
1017
+ 'jQuery("#wppa-ovl-spin").stop().fadeOut();' .
1018
 
1019
  // manualControl is true when a drag on the canvas is being performed
1020
  'if(!manualControl){' .
1021
 
1022
  // Panning
1023
+ 'fromX += deltaX;
1024
+ fromY += deltaY;' .
1025
 
1026
  // Zooming
1027
+ 'var newHeight = fromHeight / deltaFactor;
1028
+ var newWidth = fromWidth / deltaFactor;' .
1029
 
1030
  // Keep zooming in range
1031
+ 'if ( deltaFactor != 1 && newHeight <= image' . $mocc . '.height && newHeight > 50 ) {
1032
+ fromX -= ( newWidth - fromWidth ) / 2;
1033
+ fromY -= ( newHeight - fromHeight ) / 2;
1034
+ fromWidth = newWidth;
1035
+ fromHeight = newHeight;
1036
+ }
1037
+ }' .
1038
 
1039
  // Keep viewport within image boundaries
1040
  'fromX = Math.max(0, Math.min(image' . $mocc . '.width-fromWidth, fromX));' .
1042
 
1043
  // Draw the image
1044
  'var context = canvas.getContext("2d");' .
1045
+ 'context.drawImage(image' . $mocc . ',fromX,fromY,fromWidth,fromHeight,0,0,canvas.width,canvas.height);' .
1046
 
1047
  // Draw the preview image
1048
  'var prevContext = prevCanvas.getContext("2d");' .
1049
  'prevContext.clearRect(0, 0, prevCanvas.width, prevCanvas.height);' .
1050
  'prevContext.drawImage(image' . $mocc . ',0,0,image' . $mocc . '.width,image' . $mocc . '.height,0,0,prevCanvas.width,prevCanvas.height);' .
1051
 
1052
+ // Draw viewport rect on preview image
1053
  'var factor = prevCanvas.width / image' . $mocc . '.width;' .
1054
  'prevContext.strokeRect(factor*fromX,factor*fromY,factor*fromWidth,factor*fromHeight);' .
1055
 
1057
  'busy = false;' .
1058
 
1059
  // Re-render if needed
1060
+ 'if (run>0) {' .
1061
  'if (manualControl){setTimeout(function(){render()},25);}' .
1062
  'else {setTimeout(function(){render()},5);}' .
1063
+ '}
1064
+ if(run<5)run--;' .
1065
  '}' .
1066
 
1067
+ // Previous
1068
+ 'function panPrev(e) {
1069
+ e.preventDefault();
1070
+ var stop;
1071
+ if ( ! stop ) {
1072
+ stop = true;
1073
+ jQuery(this).css({opacity:0.5});
1074
+ wppaOvlShowPrev();
1075
+ }
1076
+ }' .
1077
+
1078
+ // Next
1079
+ 'function panNext(e) {
1080
+ e.preventDefault();
1081
+ var stop;
1082
+ if ( ! stop ) {
1083
+ stop = true;
1084
+ jQuery(this).css({opacity:0.5});
1085
+ wppaOvlShowNext();
1086
+ }
1087
+ }' .
1088
+
1089
+ // Horizontal movement by button
1090
+ 'function onRightMouseDown(e){
1091
+ e.preventDefault();
1092
+ run=5;deltaX=3;render();
1093
+ }' .
1094
+
1095
+ 'function onLeftMouseDown(e){
1096
+ e.preventDefault();
1097
+ run=5;deltaX=-3;render();
1098
+ }' .
1099
+
1100
+ // Vertical movement by button
1101
+ 'function onUpMouseDown(e){
1102
+ e.preventDefault();
1103
+ run=5;deltaY=-3;render();
1104
+ }' .
1105
+
1106
+ 'function onDownMouseDown(e){
1107
+ e.preventDefault();
1108
+ run=5;deltaY=3;render();
1109
+ }' .
1110
+
1111
+ // Zooming
1112
+ 'function onZoomInMouseDown(e){
1113
+ e.preventDefault();
1114
+ run=5;deltaFactor=1.005;render();
1115
+ e.preventDefault();
1116
+ }' .
1117
+
1118
+ 'function onZoomOutMouseDown(e){
1119
+ e.preventDefault();
1120
+ run=5;deltaFactor=0.995;render();
1121
+ }' .
1122
+
1123
  // When a navigation button is released, stop and reset all deltas
1124
+ 'function onButtonUp(e) {
1125
+ e.preventDefault();
1126
+ deltaX=0;deltaY=0;deltaFactor=1;
1127
+ if ( ! ' . $lightbox . ' ) run--;
1128
+ }' .
1129
 
1130
  // When a (responsive) resize is required, we resize the scene
1131
+ 'function onResize' . $mocc . '(e){' .
1132
+
1133
+ ( $lightbox ?
1134
+
1135
+ // Show image container
1136
+ 'jQuery("#wppa-overlay-ic").css("display", "");' .
1137
+
1138
+ // There are 4 possiblilities: all combi of 'Width is the limit or not' and 'Mode is normal or fullscreen'
1139
+ 'var widthIsLim,
1140
+ modeIsNormal = wppaOvlMode == "normal";' .
1141
+
1142
+ // First find container dimensions dependant of mode
1143
+ 'var contWidth, contHeight;
1144
+
1145
+ if ( modeIsNormal ) {
1146
+ contWidth = window.innerWidth ? window.innerWidth : screen.width;
1147
+ contHeight = window.innerHeight ? window.innerHeight : screen.height;
1148
+ }
1149
+ else {
1150
+ contWidth = screen.width;
1151
+ contHeight = screen.height;
1152
+ }
1153
+ newWidth = parseInt(newWidth);
1154
+ newHeight = parseInt(newHeight);
1155
+ ' .
1156
+
1157
+ // Initialize new display sizes
1158
+ 'var newWidth,
1159
+ newHeight,
1160
+ topMarg,
1161
+ leftMarg,
1162
+ extraX = 8,
1163
+ extraY = 24 + ' . $icsiz . ' + contWidth * ' . $height . ' / ' . $width . ' + 40;' .
1164
+
1165
+ // Add borderwidth in case of mode == normal
1166
+ 'if ( modeIsNormal ) {
1167
+ extraX += 2 * ' . wppa_opt( 'ovl_border_width' ) . ';
1168
+ extraY += 2 * ' . wppa_opt( 'ovl_border_width' ) . ';
1169
+ }
1170
+ ' .
1171
+
1172
+ // Find out if the width is the limitng dimension
1173
+ 'widthIsLim = ( contHeight > ( ( contWidth / 2 ) + extraY ) );' .
1174
+
1175
+ // Compute new sizes and margins
1176
+ 'if ( widthIsLim ) {
1177
+ newWidth = contWidth - extraX;
1178
+ newHeight = newWidth / 2;
1179
+ topMarg = ( contHeight - newHeight - extraY ) / 2 + 20;' .
1180
+ '}
1181
+ else {
1182
+ newWidth = 2 * ( contHeight - ' . $icsiz . ' - 24 - 40 ) / ( 1 + 2 * ' . $height . ' / ' . $width . ' );
1183
+ newHeight = newWidth / 2;
1184
+ topMarg = 20;' .
1185
+
1186
+ '}' .
1187
+
1188
+ // Set css common for all 4 situations
1189
+ 'jQuery("#wppa-ovl-panorama-container").css({marginTop:topMarg});
1190
+ jQuery("#wppa-overlay-ic").css({marginTop:0});
1191
+
1192
+ canvas.width = newWidth;
1193
+ canvas.height = newHeight;
1194
+ prevCanvas.width = newWidth;
1195
+ prevCanvas.height = newWidth * ' . $height . ' / ' . $width . ';' .
1196
+
1197
+ // Now set css for all 4 situations: Mode is normal
1198
+ 'if ( modeIsNormal ) {' .
1199
+
1200
+ // Common for mode normal
1201
+ 'jQuery("#wppa-ovl-panorama-container").css({
1202
+ backgroundColor:"' . wppa_opt( 'ovl_theme' ) . '",
1203
+ padding:"' . wppa_opt( 'ovl_border_width' ) . 'px",
1204
+ borderRadius:"' . wppa_opt( 'ovl_border_radius' ) . 'px",
1205
+ width:newWidth
1206
+ });
1207
+ jQuery( "#wppa-panoramacontrol-div-' . $mocc . '" ).css({marginLeft:0});' .
1208
+
1209
+ // Limit specific
1210
+ 'if ( widthIsLim ) {
1211
+ jQuery("#wppa-overlay-ic").css({marginLeft:4});
1212
+ }
1213
+ else {
1214
+ jQuery("#wppa-overlay-ic").css({marginLeft:(contWidth-newWidth)/2});
1215
+ }
1216
 
1217
+ }' .
1218
+
1219
+ // Mode is fullscreen
1220
+ 'else {' .
1221
+
1222
+ // Common for mode fullscreen
1223
+ 'jQuery("#wppa-overlay-ic").css({marginLeft:0});
1224
+ jQuery("#wppa-ovl-panorama-container").css({
1225
+ backgroundColor:"transparent",
1226
+ padding:0,
1227
+ borderRadius:0,
1228
+ width:newWidth,
1229
+ marginLeft:(contWidth-newWidth)/2
1230
+ });
1231
+ jQuery("#wppa-panoramacontrol-div-' . $mocc . '").css({marginLeft:0});' .
1232
+
1233
+ /*
1234
+
1235
+ if ( widthIsLim ) {
1236
+ jQuery("#wppa-panoramacontrol-div-' . $mocc . '").css({marginLeft:0});
1237
+ }
1238
+ else {
1239
+ jQuery("#wppa-panoramacontrol-div-' . $mocc . '").css({marginLeft:(contWidth-newWidth)/2});
1240
+
1241
+ } */ '
1242
+ }' .
1243
+
1244
+ 'run=5;
1245
+ render();
1246
+
1247
+ ' :
1248
  'canvasWidth = div.parentNode.clientWidth;' .
1249
  'canvasHeight = canvasWidth / 2;' .
1250
  'canvas.width = canvasWidth;' .
1251
  'canvas.height = canvasHeight;' .
1252
  'prevCanvas.width = canvasWidth;' .
1253
  'prevCanvas.height = canvasWidth * ' . $height . ' / ' . $width . ';' .
1254
+ 'run=5;' .
1255
+ 'render();'
1256
+ ) .
1257
+
1258
  '}' .
1259
 
1260
  // when the mouse is pressed on the canvas, we switch to manual control and save current coordinates
1261
+ 'function onCanvasMouseDown(e){
1262
 
1263
+ e.preventDefault();
1264
 
1265
  manualControl = true;
1266
 
1267
+ savedCanvasX = e.offsetX;
1268
+ savedCanvasY = e.offsetY;
1269
 
1270
  fromX = fromX;
1271
  fromY = fromY;
1272
 
1273
+ run=5;
1274
  render();
1275
 
1276
  }' .
1277
 
1278
+ 'function onCanvasMouseMove(e){
1279
 
1280
  if ( manualControl && !busy ){
1281
 
1282
  var factor = canvasWidth / fromWidth;
1283
 
1284
+ fromX = ( savedCanvasX - e.offsetX ) / factor + fromX;
1285
+ fromY = ( savedCanvasY - e.offsetY ) / factor + fromY;
1286
 
1287
+ savedCanvasX = e.offsetX;
1288
+ savedCanvasY = e.offsetY;
1289
  }
1290
 
1291
  }' .
1292
 
1293
+ 'function onPrevCanvasMouseMove(e){
1294
 
1295
  var factor = prevCanvas.width / image' . $mocc . '.width;
1296
 
1297
+ if (e.offsetX > factor * fromX &&
1298
+ e.offsetX < factor * ( fromX + fromWidth ) &&
1299
+ e.offsetY > factor * fromY &&
1300
+ e.offsetY < factor * ( fromY + fromHeight ) ) {
1301
 
1302
  jQuery(prevCanvas).css(\'cursor\',\'grab\');
1303
  }
1307
 
1308
  if ( manualControl && !busy ){
1309
 
1310
+ if (e.offsetX > factor * fromX &&
1311
+ e.offsetX < factor * ( fromX + fromWidth ) &&
1312
+ e.offsetY > factor * fromY &&
1313
+ e.offsetY < factor * ( fromY + fromHeight ) ) {
1314
 
1315
+ fromX = ( e.offsetX - savedCanvasX ) / factor + fromX;
1316
+ fromY = ( e.offsetY - savedCanvasY ) / factor + fromY;
1317
 
1318
+ savedCanvasX = e.offsetX;
1319
+ savedCanvasY = e.offsetY;
1320
 
1321
  }
1322
  }
1323
  }' .
1324
 
1325
+ 'function onCanvasMouseUp(e){
1326
 
1327
  manualControl = false;
1328
+ ' . ( $lightbox ? '' : 'run=1;' ) . '
1329
 
1330
  }' .
1331
 
1334
  </script>
1335
  ' . ( $haslink ? '<a>' : '' ) . '';
1336
 
1337
+ return wppa_panorama_min( $result );
1338
  }
1339
+
1340
+ // Minimize inine mixed html / js code
1341
+ function wppa_panorama_min( $result ) {
1342
+
1343
+ $result = str_replace( "\t", '', $result );
1344
+ $result = str_replace( "\n", ' ', $result );
1345
+
1346
+ $result = str_replace( array( ' = ',' + ',' * ',' / ' ), array( '=','+','*','/' ), $result );
1347
+ $olen = 0;
1348
+ $nlen = strlen( $result );
1349
+ do {
1350
+ $olen = $nlen;
1351
+ $result = str_replace( " ", ' ', $result );
1352
+ $nlen = strlen( $result );
1353
+ } while ( $nlen != $olen );
1354
+ $result = str_replace( array( ', ', '; ', '( ', ' )', '{ ', ' }', '( "', '" )' ), array( ',', ';', '(', ')', '{', '}', '("', '")' ), $result );
1355
+ $result = str_replace( '> <', '><', $result );
1356
+
1357
+ return $result;
1358
+ }
wppa-potd-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the widget
6
- * Version 6.8.08
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -78,6 +78,7 @@ class PhotoOfTheDay extends WP_Widget {
78
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
79
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '"' .
80
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
 
81
  ' onclick="return false;"' .
82
  ' style="cursor:' . wppa_wait() . ';"';
83
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * display the widget
6
+ * Version 6.9.09
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
78
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
79
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '"' .
80
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
81
+ wppa_get_lb_panorama_full_html( $id ) .
82
  ' onclick="return false;"' .
83
  ' style="cursor:' . wppa_wait() . ';"';
84
  }
wppa-thumbnails.php CHANGED
@@ -5,7 +5,7 @@
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
- * Version 6.8.09
9
  *
10
  */
11
 
@@ -314,6 +314,7 @@ global $wpdb;
314
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
315
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[occ'.wppa( 'mocc' ).']"' .
316
  ' ' . wppa( 'lbtitle' ) . '="'.$title.'" ' .
 
317
  ' class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'"' .
318
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
319
  ' onclick="return false;"' .
@@ -1325,6 +1326,7 @@ global $wpdb;
1325
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
1326
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
1327
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
 
1328
  ' class="thumb-img"' .
1329
  ' id="x-' . $xid . '-' . wppa( 'mocc' ) . '"' .
1330
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
@@ -1652,6 +1654,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
1652
  ( $audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '' ) .
1653
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[' . $type . '-' . $album . '-' . wppa( 'mocc' ) . ']"' .
1654
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
 
1655
  ' target="' . $link['target'] . '"' .
1656
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
1657
  ' style="cursor:' . wppa_wait() . ';"' .
@@ -1860,6 +1863,7 @@ function wppa_do_filmthumb( $id, $idx, $do_for_feed = false, $glue = false ) {
1860
  ( $audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '' ) .
1861
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
1862
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
 
1863
  ' >';
1864
  }
1865
 
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
+ * Version 6.9.09
9
  *
10
  */
11
 
314
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
315
  ' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[occ'.wppa( 'mocc' ).']"' .
316
  ' ' . wppa( 'lbtitle' ) . '="'.$title.'" ' .
317
+ wppa_get_lb_panorama_full_html( $id ) .
318
  ' class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'"' .
319
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
320
  ' onclick="return false;"' .
1326
  ( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
1327
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
1328
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1329
+ wppa_get_lb_panorama_full_html( $id ) .
1330
  ' class="thumb-img"' .
1331
  ' id="x-' . $xid . '-' . wppa( 'mocc' ) . '"' .
1332
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
1654
  ( $audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '' ) .
1655
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[' . $type . '-' . $album . '-' . wppa( 'mocc' ) . ']"' .
1656
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1657
+ wppa_get_lb_panorama_full_html( $id ) .
1658
  ' target="' . $link['target'] . '"' .
1659
  ' data-alt="' . esc_attr( wppa_get_imgalt( $id, true ) ) . '"' .
1660
  ' style="cursor:' . wppa_wait() . ';"' .
1863
  ( $audiohtml ? ' data-audiohtml="' . $audiohtml . '"' : '' ) .
1864
  ' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
1865
  ( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
1866
+ wppa_get_lb_panorama_full_html( $id ) .
1867
  ' >';
1868
  }
1869
 
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 6.9.08.008
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -22,8 +22,8 @@ global $wpdb;
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
- global $wppa_revno; $wppa_revno = '6908'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-9-08-008'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 6.9.09.009
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
+ global $wppa_revno; $wppa_revno = '6909'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-9-09-009'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );