Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.4.05 |
Comparing to | |
See all releases |
Code changes from version 6.4.04 to 6.4.05
- js/wppa-admin-scripts.js +5 -2
- js/wppa-lightbox.js +130 -122
- js/wppa-lightbox.min.js +9 -9
- js/wppa-tinymce-shortcodes.js +76 -41
- readme.txt +16 -2
- wppa-breadcrumb.php +3 -3
- wppa-functions.php +68 -12
- wppa-items.php +7 -3
- wppa-non-admin.php +7 -2
- wppa-settings-autosave.php +22 -1
- wppa-setup.php +2 -1
- wppa-tinymce-shortcodes.php +86 -14
- wppa.php +2 -2
js/wppa-admin-scripts.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
-
/* Version 6.4.
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
@@ -1928,7 +1928,10 @@ function wppaArrayToEnum( arr, sep ) {
|
|
1928 |
}
|
1929 |
|
1930 |
// ltrim .
|
1931 |
-
while ( result.substr(0,1) == '.') result = result.substr(1);
|
|
|
|
|
|
|
1932 |
|
1933 |
return result;
|
1934 |
}
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
+
/* Version 6.4.05
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
1928 |
}
|
1929 |
|
1930 |
// ltrim .
|
1931 |
+
while ( result.substr(0,1) == '.' ) result = result.substr(1);
|
1932 |
+
|
1933 |
+
// ltrim sep
|
1934 |
+
while ( result.substr(0,1) == sep ) result = result.substr(1);
|
1935 |
|
1936 |
return result;
|
1937 |
}
|
js/wppa-lightbox.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
//
|
3 |
// Conatins lightbox modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
-
//
|
6 |
-
var wppaLightboxVersion = '6.
|
7 |
|
8 |
// Global inits
|
9 |
var wppaNormsBtnOpac = 1;
|
@@ -27,7 +27,7 @@ jQuery( document ).ready(function( e ) {
|
|
27 |
|
28 |
// Window resize handler
|
29 |
jQuery( window ).resize(function() {
|
30 |
-
jQuery("#wppa-overlay-bg").css({
|
31 |
height:window.innerHeight,
|
32 |
width:window.innerWidth,
|
33 |
});
|
@@ -41,7 +41,7 @@ function wppaOvlKeyboardHandler( e ) {
|
|
41 |
|
42 |
var keycode;
|
43 |
var escapeKey;
|
44 |
-
|
45 |
if ( e == null ) { // ie
|
46 |
keycode = event.keyCode;
|
47 |
escapeKey = 27;
|
@@ -49,9 +49,9 @@ function wppaOvlKeyboardHandler( e ) {
|
|
49 |
keycode = e.keyCode;
|
50 |
escapeKey = 27; //e.DOM_VK_ESCAPE;
|
51 |
}
|
52 |
-
|
53 |
var key = String.fromCharCode( keycode ).toLowerCase();
|
54 |
-
|
55 |
switch ( keycode ) {
|
56 |
case escapeKey:
|
57 |
wppaStopVideo( mocc );
|
@@ -67,9 +67,9 @@ function wppaOvlKeyboardHandler( e ) {
|
|
67 |
wppaOvlShowNext();
|
68 |
break;
|
69 |
}
|
70 |
-
|
71 |
switch ( key ) {
|
72 |
-
case 'p':
|
73 |
wppaOvlShowPrev();
|
74 |
break;
|
75 |
case 'n':
|
@@ -94,16 +94,16 @@ function wppaOvlKeyboardHandler( e ) {
|
|
94 |
}
|
95 |
wppaOvlHide();
|
96 |
break;
|
97 |
-
|
98 |
}
|
99 |
-
|
100 |
return false;
|
101 |
}
|
102 |
|
103 |
// Switch to fullscreen mode
|
104 |
function wppaOvlFull() {
|
105 |
wppaConsoleLog( 'wppaOvlFull' );
|
106 |
-
|
107 |
var oldMode = wppaOvlMode;
|
108 |
wppaOvlStepMode();
|
109 |
var elem = document.getElementById('wppa-overlay-ic');
|
@@ -143,45 +143,45 @@ wppaConsoleLog( 'wppaOvlNorm' );
|
|
143 |
document.webkitCancelFullScreen();
|
144 |
}
|
145 |
if ( exit ) return;
|
146 |
-
|
147 |
setTimeout( 'wppaOvlShow( '+wppaOvlIdx+' )', 1000 );
|
148 |
}
|
149 |
|
150 |
// Prepare the display of the lightbox overlay.
|
151 |
-
// arg is either numeric ( index to current lightbox set ) or
|
152 |
// 'this' for a single image or for the first of a set
|
153 |
function wppaOvlShow( arg ) {
|
154 |
wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
155 |
|
156 |
// Do the setup right after the invocation of the lightbox
|
157 |
if ( wppaOvlFirst ) {
|
158 |
-
|
159 |
// Prevent Weaver ii from hiding us
|
160 |
jQuery( '#weaver-final' ).removeClass( 'wvr-hide-bang' );
|
161 |
|
162 |
// Init background
|
163 |
jQuery( '#wppa-overlay-bg' ).fadeTo( 3, wppaOvlOpacity );
|
164 |
-
|
165 |
// Install keyboard handler
|
166 |
if ( ! wppaKbHandlerInstalled ) {
|
167 |
jQuery( document ).on('keydown', wppaOvlKeyboardHandler );
|
168 |
wppaKbHandlerInstalled = true;
|
169 |
}
|
170 |
-
|
171 |
// Stop all slideshows
|
172 |
var occ = 0;
|
173 |
while ( occ < wppaTopMoc ) {
|
174 |
occ++;
|
175 |
wppaStopShow( occ );
|
176 |
}
|
177 |
-
|
178 |
// Adjust background size
|
179 |
-
jQuery( '#wppa-overlay-bg' ).css({
|
180 |
width:window.innerWidth,
|
181 |
height:window.innerHeight,
|
182 |
});
|
183 |
}
|
184 |
-
|
185 |
// If arg = 'this', setup the array of data
|
186 |
if ( typeof( arg ) == 'object' ) {
|
187 |
|
@@ -190,8 +190,8 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
|
190 |
wppaOvlTitles = [];
|
191 |
wppaOvlVideoHtmls = [];
|
192 |
wppaOvlAudioHtmls = [];
|
193 |
-
wppaOvlVideoNaturalWidths = [];
|
194 |
-
wppaOvlVideoNaturalHeights = [];
|
195 |
wppaOvlImgs = [];
|
196 |
wppaOvlIdx = 0;
|
197 |
|
@@ -206,17 +206,17 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
|
206 |
else {
|
207 |
rel = false;
|
208 |
}
|
209 |
-
|
210 |
// Are we in a set?
|
211 |
var temp = rel.split( '[' );
|
212 |
-
|
213 |
// We are in a set if temp[1] is defined
|
214 |
-
if ( temp[1] ) {
|
215 |
var setname = temp[1];
|
216 |
var anchors = jQuery( 'a' );
|
217 |
var anchor;
|
218 |
var i, j = 0;
|
219 |
-
|
220 |
// Save the set
|
221 |
for ( i = 0; i < anchors.length; i++ ) {
|
222 |
anchor = anchors[i];
|
@@ -237,7 +237,7 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
|
237 |
}
|
238 |
wppaOvlVideoHtmls[j] = jQuery( anchor ).attr( 'data-videohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-videohtml' ) ) : '';
|
239 |
wppaOvlAudioHtmls[j] = jQuery( anchor ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-audiohtml' ) ) : '';
|
240 |
-
wppaOvlVideoNaturalWidths[j] = jQuery( anchor ).attr( 'data-videonatwidth' ) ? jQuery( anchor ).attr( 'data-videonatwidth' ) : '';
|
241 |
wppaOvlVideoNaturalHeights[j] = jQuery( anchor ).attr( 'data-videonatheight' ) ? jQuery( anchor ).attr( 'data-videonatheight' ) : '';
|
242 |
if ( anchor.href == arg.href ) {
|
243 |
wppaOvlIdx = j; // Current index
|
@@ -247,10 +247,10 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
|
247 |
}
|
248 |
}
|
249 |
}
|
250 |
-
|
251 |
// Single image, treat as set with one element
|
252 |
-
else {
|
253 |
-
wppaOvlUrls[0] = arg.href;
|
254 |
if ( jQuery( arg ).attr( 'data-lbtitle' ) ) {
|
255 |
wppaOvlTitles[0] = wppaRepairScriptTags( jQuery( arg ).attr( 'data-lbtitle' ) );
|
256 |
}
|
@@ -261,12 +261,12 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
|
261 |
wppaOvlAudioHtmls[0] = jQuery( arg ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-audiohtml' ) ) : '';
|
262 |
wppaOvlVideoNaturalWidths[0] = jQuery( arg ).attr( 'data-videonatwidth' ) ? jQuery( arg ).attr( 'data-videonatwidth' ) : '';
|
263 |
wppaOvlVideoNaturalHeights[0] = jQuery( arg ).attr( 'data-videonatheight' ) ? jQuery( arg ).attr( 'data-videonatheight' ) : '';
|
264 |
-
wppaOvlImgs[0]
|
265 |
wppaOvlIdx = 0;
|
266 |
}
|
267 |
-
}
|
268 |
|
269 |
-
// Arg is numeric
|
270 |
else {
|
271 |
wppaOvlIdx = arg;
|
272 |
}
|
@@ -283,11 +283,11 @@ wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
|
283 |
// Show the lightbox overlay.
|
284 |
// idx is the numeric index to current lightbox set
|
285 |
function _wppaOvlShow( idx ) {
|
286 |
-
wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
287 |
|
288 |
// Show spinner
|
289 |
jQuery( '#wppa-overlay-sp' ).css( { visibility: 'visible' } );
|
290 |
-
|
291 |
// Preload current image
|
292 |
if ( wppaOvlUrls[idx].length > 0 ) { // Not an empty url
|
293 |
wppaOvlImgs[idx] = new Image();
|
@@ -302,7 +302,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
302 |
|
303 |
var next;
|
304 |
var prev;
|
305 |
-
|
306 |
// Preload next
|
307 |
if ( wppaOvlIdx == ( wppaOvlUrls.length-1 ) ) {
|
308 |
next = 0;
|
@@ -313,7 +313,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
313 |
wppaOvlImgs[next] = new Image();
|
314 |
wppaOvlImgs[next].src = wppaOvlUrls[next]; // Preload
|
315 |
wppaConsoleLog( 'Preloading > '+(next+1) );
|
316 |
-
|
317 |
// Preload previous ( for hitting the prev button )
|
318 |
// Only when in browsemode
|
319 |
if ( ! wppaOvlRunning ) {
|
@@ -331,7 +331,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
331 |
// Find photo id and bump its viewcount
|
332 |
wppaPhotoId = wppaUrlToId( wppaOvlUrls[idx] );
|
333 |
_bumpViewCount( wppaPhotoId );
|
334 |
-
|
335 |
// Find handy switches
|
336 |
wppaIsVideo = wppaOvlVideoHtmls[idx] != '';
|
337 |
wppaHasAudio = wppaOvlAudioHtmls[idx] != '';
|
@@ -342,10 +342,10 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
342 |
// Fullsize?
|
343 |
if ( wppaOvlMode != 'normal' ) {
|
344 |
var html;
|
345 |
-
|
346 |
// Fullsize Video
|
347 |
if ( wppaIsVideo ) {
|
348 |
-
html =
|
349 |
'<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery( window ).width()+'px; height:'+jQuery( window ).height()+'px; left:0px; top:0px; text-align:center;" >'+
|
350 |
'<video id="wppa-overlay-img" controls preload="metadata"' +
|
351 |
( wppaOvlVideoStart ? ' autoplay' : '' ) +
|
@@ -371,7 +371,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
371 |
}
|
372 |
// Fullsize Photo
|
373 |
else {
|
374 |
-
html =
|
375 |
'<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery( window ).width()+'px; height:'+jQuery( window ).height()+'px; left:0px; top:0px; text-align:center;" >'+
|
376 |
'<img id="wppa-overlay-img"'+
|
377 |
' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+
|
@@ -382,7 +382,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
382 |
' style="border:none; width:'+jQuery( window ).width()+'px; visibility:hidden; box-shadow:none; position:absolute;"'+
|
383 |
' />';
|
384 |
if ( wppaHasAudio ) {
|
385 |
-
html += '<audio' +
|
386 |
' id="wppa-overlay-audio"' +
|
387 |
' class="wppa-overlay-audio"' +
|
388 |
' data-from="wppa"' +
|
@@ -414,7 +414,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
414 |
'</div>';
|
415 |
'</div>';
|
416 |
}
|
417 |
-
|
418 |
// The 'back to normal' icon
|
419 |
html += '<img' +
|
420 |
' id="wppa-norms-btn"' +
|
@@ -446,7 +446,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
446 |
wppaOvlFirst = false;
|
447 |
return false;
|
448 |
}
|
449 |
-
|
450 |
// NOT fullsize
|
451 |
else {
|
452 |
// Initialize
|
@@ -462,21 +462,23 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
462 |
// Initial sizing of image container ( contains image, borders and subtext )
|
463 |
jQuery( '#wppa-overlay-ic' ).css( {
|
464 |
width:wppaSavedContainerWidth,
|
465 |
-
marginLeft:wppaSavedMarginLeft,
|
466 |
marginTop:wppaSavedMarginTop,
|
467 |
});
|
468 |
-
|
469 |
// Make the html
|
470 |
var html = '';
|
471 |
|
472 |
// The img sub image container
|
473 |
html += '<div id="img-sb-img-cont" style="position:relative;line-height:0;" >';
|
474 |
-
|
475 |
// Not Fullsize Video
|
476 |
if ( wppaIsVideo ) {
|
477 |
-
|
478 |
html += '<video' +
|
479 |
' id="wppa-overlay-img"' +
|
|
|
|
|
480 |
' preload="metadata"' +
|
481 |
( wppaOvlVideoStart ? ' autoplay' : '' ) +
|
482 |
' onpause="wppaOvlVideoPlaying = false;"' +
|
@@ -503,14 +505,16 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
503 |
' >' +
|
504 |
wppaOvlVideoHtmls[idx] +
|
505 |
'</video>';
|
506 |
-
|
507 |
wppaOvlIsVideo = true;
|
508 |
}
|
509 |
-
|
510 |
// Not fullsize photo
|
511 |
else {
|
512 |
html += '<img' +
|
513 |
' id="wppa-overlay-img"'+
|
|
|
|
|
514 |
' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"' +
|
515 |
' ontouchend="wppaTouchEnd( event );"' +
|
516 |
' ontouchmove="wppaTouchMove( event );"' +
|
@@ -531,10 +535,10 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
531 |
'padding:0;' +
|
532 |
'"' +
|
533 |
' />';
|
534 |
-
|
535 |
// Audio on not fullsize
|
536 |
if ( wppaHasAudio ) {
|
537 |
-
html += '<audio' +
|
538 |
' id="wppa-overlay-audio"' +
|
539 |
' class="wppa-overlay-audio"' +
|
540 |
' data-from="wppa"' +
|
@@ -559,10 +563,11 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
559 |
}
|
560 |
wppaOvlIsVideo = false;
|
561 |
}
|
562 |
-
|
563 |
// The quit symbol image
|
564 |
html += '<img' +
|
565 |
' id="wppa-overlay-qt-img"' +
|
|
|
566 |
' src="' + wppaStopSymbolUrl + '"' +
|
567 |
' style="' +
|
568 |
'position:absolute;' +
|
@@ -577,9 +582,9 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
577 |
'"' +
|
578 |
' onclick="wppaOvlHide()"' +
|
579 |
' ontouchend="wppaOvlHide()"' +
|
580 |
-
' onmouseover="jQuery(this).stop().fadeTo(200,
|
581 |
' onmouseout="jQuery(this).stop().fadeTo(200,0);"' +
|
582 |
-
' ontouchstart="jQuery(this).stop().fadeTo(200,
|
583 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
584 |
' />';
|
585 |
|
@@ -587,6 +592,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
587 |
if ( wppaOvlShowStartStop && ! wppaOvlIsSingle ) {
|
588 |
html += '<img' +
|
589 |
' id="wppa-ovl-start-stop-btn"' +
|
|
|
590 |
' src="'+( wppaOvlRunning ? wppaPauseSymbolUrl : wppaStartSymbolUrl )+'"' +
|
591 |
' style="' +
|
592 |
'height:'+wppaStartPauseSymbolSize+'px;' +
|
@@ -603,19 +609,20 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
603 |
'"' +
|
604 |
' onclick="wppaOvlStartStop()"' +
|
605 |
' ontouchend="wppaOvlStartStop()"' +
|
606 |
-
' onmouseover="jQuery(this).stop().fadeTo(200,
|
607 |
' onmouseout="jQuery(this).stop().fadeTo(200,0);"' +
|
608 |
-
' ontouchstart="jQuery(this).stop().fadeTo(200,
|
609 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
610 |
' />';
|
611 |
}
|
612 |
-
|
613 |
// Show browse buttons only if we are in a set
|
614 |
if ( ! wppaOvlIsSingle ) {
|
615 |
-
|
616 |
// The prev button
|
617 |
html += '<img' +
|
618 |
' id="wppa-ovl-prev-btn"' +
|
|
|
619 |
' src="'+wppaImageDirectory+'prev-'+wppaOvlTheme+'.gif"' +
|
620 |
' style="' +
|
621 |
'position:absolute;' +
|
@@ -624,7 +631,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
624 |
( wppaLeftRightSymbolBradius ? 'border-radius:' + wppaLeftRightSymbolBradius + 'px;' : '' ) +
|
625 |
'top:50%;' +
|
626 |
'margin-top:-' + ( wppaLeftRightSymbolSize/2 ) + 'px;' +
|
627 |
-
'left:1px;' +
|
628 |
'box-shadow:none;' +
|
629 |
( wppaOvlFirst ? 'opacity:1;' : 'opacity:0;' ) +
|
630 |
'"' +
|
@@ -635,10 +642,11 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
635 |
' ontouchstart="jQuery(this).stop().fadeTo(200,1);"' +
|
636 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
637 |
' />';
|
638 |
-
|
639 |
// The next button
|
640 |
html += '<img' +
|
641 |
' id="wppa-ovl-next-btn"' +
|
|
|
642 |
' src="'+wppaImageDirectory+'next-'+wppaOvlTheme+'.gif"' +
|
643 |
' style="' +
|
644 |
'position:absolute;' +
|
@@ -647,7 +655,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
647 |
( wppaLeftRightSymbolBradius ? 'border-radius:' + wppaLeftRightSymbolBradius + 'px;' : '' ) +
|
648 |
'top:50%;' +
|
649 |
'margin-top:-' + ( wppaLeftRightSymbolSize/2 ) + 'px;' +
|
650 |
-
'right:1px;' +
|
651 |
'box-shadow:none;' +
|
652 |
( wppaOvlFirst ? 'opacity:1;' : 'opacity:0;' ) +
|
653 |
'"' +
|
@@ -659,7 +667,7 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
659 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
660 |
' />';
|
661 |
}
|
662 |
-
|
663 |
// Close the #img-sb-img-cont
|
664 |
html += '</div>';
|
665 |
|
@@ -685,24 +693,24 @@ wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
|
685 |
' id="wppa-overlay-txt"' +
|
686 |
' style="' +
|
687 |
'text-align:center;' +
|
688 |
-
'min-height:36px;' +
|
689 |
-
'width:100%;' +
|
690 |
( wppaOvlTxtHeight == 'auto' ? 'max-height:200px;' : 'max-height:' + wppaOvlTxtHeight + 'px;' ) +
|
691 |
'overflow:auto;' +
|
692 |
'box-shadow:none;' +
|
693 |
'"' +
|
694 |
' >' +
|
695 |
( showCounter ? ( wppaOvlIdx + 1 ) + '/' + wppaOvlUrls.length + '<br />' : '' ) +
|
696 |
-
wppaOvlTitles[idx] +
|
697 |
'</div>';
|
698 |
'</div>';
|
699 |
|
700 |
-
// Insert the html
|
701 |
jQuery( '#wppa-overlay-ic' ).html( html );
|
702 |
-
|
703 |
// Size
|
704 |
wppaOvlResize();
|
705 |
-
|
706 |
// Done!
|
707 |
return false;
|
708 |
}
|
@@ -726,12 +734,12 @@ wppaConsoleLog( 'wppaOvlSize' );
|
|
726 |
wppaOvlFormatFull();
|
727 |
return;
|
728 |
}
|
729 |
-
|
730 |
|
731 |
var iw = jQuery( window ).width();
|
732 |
-
var ih = jQuery( window ).height();
|
733 |
var cw, nw, nh;
|
734 |
-
|
735 |
if ( wppaOvlIsVideo ) {
|
736 |
cw = 640;
|
737 |
nw = 640;
|
@@ -739,14 +747,14 @@ wppaConsoleLog( 'wppaOvlSize' );
|
|
739 |
}
|
740 |
else {
|
741 |
cw = img.clientWidth;
|
742 |
-
nw = img.naturalWidth;
|
743 |
-
nh = img.naturalHeight;
|
744 |
}
|
745 |
-
|
746 |
var fakt1;
|
747 |
var fakt2;
|
748 |
var fakt;
|
749 |
-
|
750 |
// If the width is the limiting factor, adjust the height
|
751 |
if ( typeof( nw ) == 'undefined' ) { // ver 4 browser
|
752 |
nw = img.clientWidth;
|
@@ -796,14 +804,14 @@ wppaConsoleLog( 'wppaOvlSize' );
|
|
796 |
|
797 |
// Save new image width and height
|
798 |
var done = ( wppaSavedImageWidth - wid < 3 && wid - wppaSavedImageWidth < 3 );
|
799 |
-
|
800 |
if ( wid <= 10 ) {
|
801 |
wid = 240;
|
802 |
nh = 180;
|
803 |
nw = 240;
|
804 |
done = false;
|
805 |
}
|
806 |
-
|
807 |
wppaSavedImageWidth = wid;
|
808 |
wppaSavedImageHeight = wid * nh / nw;
|
809 |
wppaSavedMarginLeft = - ( wid / 2 + wppaOvlBorderWidth );
|
@@ -813,21 +821,21 @@ wppaConsoleLog( 'wppaOvlSize' );
|
|
813 |
|
814 |
// Go to final size
|
815 |
jQuery( '#wppa-overlay-img' ).animate( {
|
816 |
-
width:wppaSavedImageWidth,
|
817 |
height:wppaSavedImageHeight,
|
818 |
-
},
|
819 |
-
speed
|
820 |
);
|
821 |
-
|
822 |
jQuery( '#wppa-overlay-ic' ).animate( {
|
823 |
-
width:wppaSavedContainerWidth,
|
824 |
-
marginLeft:wppaSavedMarginLeft,
|
825 |
marginTop:wppaSavedMarginTop,
|
826 |
-
},
|
827 |
-
speed
|
828 |
);
|
829 |
|
830 |
-
|
831 |
// Done?
|
832 |
if ( ! done ) {
|
833 |
setTimeout( function(){ wppaOvlSize(wppaOvlAnimSpeed) }, speed + 100 );
|
@@ -835,7 +843,7 @@ wppaConsoleLog( 'wppaOvlSize' );
|
|
835 |
', img complete='+document.getElementById( 'wppa-overlay-img' ).complete );
|
836 |
}
|
837 |
else {
|
838 |
-
|
839 |
// Remove spinner
|
840 |
jQuery( '#wppa-overlay-sp' ).css( { visibility: 'hidden' } );
|
841 |
wppaConsoleLog( 'Done '+wppaOvlIdx );
|
@@ -851,7 +859,7 @@ wppaConsoleLog( 'wppaOvlFormatFull' );
|
|
851 |
var img;
|
852 |
var natWidth;
|
853 |
var natHeight;
|
854 |
-
|
855 |
// Find the natural image sizes
|
856 |
if ( wppaOvlIsVideo ) {
|
857 |
img = document.getElementById( 'wppa-overlay-img' );
|
@@ -861,9 +869,9 @@ wppaConsoleLog( 'wppaOvlFormatFull' );
|
|
861 |
else {
|
862 |
img = document.getElementById( 'wppa-overlay-img' );
|
863 |
if ( ! img || ! img.complete ) {
|
864 |
-
|
865 |
// Wait for load complete
|
866 |
-
setTimeout( 'wppaOvlFormatFull()', 100 );
|
867 |
return;
|
868 |
}
|
869 |
natWidth = img.naturalWidth;
|
@@ -871,7 +879,7 @@ wppaConsoleLog( 'wppaOvlFormatFull' );
|
|
871 |
}
|
872 |
|
873 |
var screenRatio = jQuery( window ).width() / jQuery( window ).height();
|
874 |
-
var imageRatio = natWidth / natHeight;
|
875 |
var margLeft = 0;
|
876 |
var margTop = 0;
|
877 |
var imgHeight = 0;
|
@@ -946,7 +954,7 @@ wppaConsoleLog( 'wppaOvlFormatFull' );
|
|
946 |
return true; // Done!
|
947 |
}
|
948 |
|
949 |
-
// This function is called after a timeout to update fullsize photo id.
|
950 |
// Used to determine if a video/audio must restart
|
951 |
function wppaOvlUpdateFsId() {
|
952 |
wppaConsoleLog( 'wppaOvlUpdateFsId' );
|
@@ -990,34 +998,34 @@ wppaConsoleLog('wppaOvlStartStop called. Running='+wppaOvlRunning);
|
|
990 |
|
991 |
// Running?
|
992 |
if ( wppaOvlRunning ) {
|
993 |
-
|
994 |
// Stop it
|
995 |
wppaOvlRunning = false;
|
996 |
-
|
997 |
// Swap button image
|
998 |
jQuery( '#wppa-ovl-start-stop-btn' ).attr( 'src', wppaStartSymbolUrl );
|
999 |
-
|
1000 |
// If in a set: Determine visibility of browse buttons and make visible if appliccable
|
1001 |
-
if ( wppaOvlIdx != -1 ) {
|
1002 |
-
|
1003 |
// NOT first, show prev button
|
1004 |
if ( wppaOvlIdx != 0 ) {
|
1005 |
jQuery( '#wppa-ovl-prev-btn' ).css('visibility', 'visible');
|
1006 |
}
|
1007 |
-
|
1008 |
// NOT last, show next button
|
1009 |
if ( wppaOvlIdx != ( wppaOvlUrls.length-1 ) ) {
|
1010 |
jQuery( '#wppa-ovl-next-btn' ).css('visibility', 'visible');
|
1011 |
}
|
1012 |
}
|
1013 |
}
|
1014 |
-
|
1015 |
// Not running
|
1016 |
else {
|
1017 |
-
|
1018 |
// Swap button image
|
1019 |
jQuery( '#wppa-ovl-start-stop-btn' ).attr( 'src', wppaPauseSymbolUrl );
|
1020 |
-
|
1021 |
// Start it
|
1022 |
wppaOvlRunning = true;
|
1023 |
wppaOvlRun();
|
@@ -1030,10 +1038,10 @@ wppaConsoleLog( 'wppaOvlRun, running='+wppaOvlRunning );
|
|
1030 |
|
1031 |
// Already running?
|
1032 |
if ( ! wppaOvlRunning ) return;
|
1033 |
-
|
1034 |
// Wait until playing audio or video ends
|
1035 |
if ( wppaOvlVideoPlaying || wppaOvlAudioPlaying ) {
|
1036 |
-
setTimeout( 'wppaOvlRun()', 500 );
|
1037 |
return;
|
1038 |
}
|
1039 |
|
@@ -1048,15 +1056,15 @@ wppaConsoleLog( 'wppaOvlRun, running='+wppaOvlRunning );
|
|
1048 |
}
|
1049 |
}
|
1050 |
}
|
1051 |
-
|
1052 |
-
|
1053 |
var next;
|
1054 |
if ( wppaOvlIdx >= ( wppaOvlUrls.length-1 ) ) next = 0;
|
1055 |
else next = wppaOvlIdx + 1;
|
1056 |
-
|
1057 |
wppaOvlFsPhotoId = 0;
|
1058 |
wppaPhotoId = 0;
|
1059 |
-
|
1060 |
wppaOvlShow( next );
|
1061 |
|
1062 |
setTimeout( 'wppaOvlRun()', wppaOvlSlideSpeed );
|
@@ -1068,7 +1076,7 @@ wppaConsoleLog( 'wppaOvlShowPrev' );
|
|
1068 |
|
1069 |
wppaOvlFsPhotoId = 0;
|
1070 |
wppaPhotoId = 0;
|
1071 |
-
|
1072 |
if ( wppaOvlIsSingle ) return false;
|
1073 |
if ( wppaOvlIdx < 1 ) {
|
1074 |
wppaOvlIdx = wppaOvlUrls.length; // Restart at last
|
@@ -1083,7 +1091,7 @@ wppaConsoleLog( 'wppaOvlShowNext' );
|
|
1083 |
|
1084 |
wppaOvlFsPhotoId = 0;
|
1085 |
wppaPhotoId = 0;
|
1086 |
-
|
1087 |
if ( wppaOvlIsSingle ) return false;
|
1088 |
if ( wppaOvlIdx >= ( wppaOvlUrls.length-1 ) ) {
|
1089 |
wppaOvlIdx = -1; // Restart at first
|
@@ -1098,17 +1106,17 @@ wppaConsoleLog( 'wppaOvlHide' );
|
|
1098 |
|
1099 |
// Stop audio
|
1100 |
wppaStopAudio();
|
1101 |
-
|
1102 |
// Clear image container
|
1103 |
jQuery( '#wppa-overlay-ic' ).html( '' );
|
1104 |
-
|
1105 |
// Remove background
|
1106 |
jQuery( '#wppa-overlay-bg' ).fadeOut( 300 );
|
1107 |
-
|
1108 |
// Remove kb handler
|
1109 |
jQuery( document ).off( 'keydown', wppaOvlKeyboardHandler );
|
1110 |
wppaKbHandlerInstalled = false;
|
1111 |
-
|
1112 |
// Reset switches
|
1113 |
wppaOvlFirst = true;
|
1114 |
wppaOvlRunning = false;
|
@@ -1151,16 +1159,16 @@ wppaConsoleLog( 'wppaInitOverlay' );
|
|
1151 |
|
1152 |
wppaOvlFsPhotoId = 0; // Reset ovl fullscreen photo id
|
1153 |
wppaPhotoId = 0;
|
1154 |
-
|
1155 |
wppaSavedContainerWidth = 240 + 2 * wppaOvlBorderWidth;
|
1156 |
wppaSavedContainerHeight = 180 + 3 * wppaOvlBorderWidth + 20 + ( wppaOvlTxtHeight == 'auto' ? 50 : wppaOvlTxtHeight );
|
1157 |
wppaSavedMarginLeft = - ( 120 + wppaOvlBorderWidth );
|
1158 |
wppaSavedMarginTop = - ( 90 + wppaOvlBorderWidth + 10 + ( wppaOvlTxtHeight == 'auto' ? 25 : wppaOvlTxtHeight / 2 ) );
|
1159 |
wppaSavedImageWidth = 240;
|
1160 |
wppaSavedImageHeight = 180 + wppaOvlBorderWidth;
|
1161 |
-
|
1162 |
for ( i = 0; i < anchors.length; i++ ) {
|
1163 |
-
|
1164 |
anchor = anchors[i];
|
1165 |
if ( jQuery( anchor ).attr( 'data-rel' ) ) {
|
1166 |
temp = jQuery( anchor ).attr( 'data-rel' ).split( "[" );
|
@@ -1173,21 +1181,21 @@ wppaConsoleLog( 'wppaInitOverlay' );
|
|
1173 |
}
|
1174 |
|
1175 |
if ( temp[0] == 'wppa' ) {
|
1176 |
-
|
1177 |
// found one
|
1178 |
wppaWppaOverlayActivated = true;
|
1179 |
-
|
1180 |
// Install onclick handler
|
1181 |
jQuery( anchor ).click( function( event ) {
|
1182 |
wppaOvlShow( this );
|
1183 |
event.preventDefault();
|
1184 |
-
});
|
1185 |
-
|
1186 |
// Install ontouchstart handler
|
1187 |
jQuery( anchor ).on( "touchstart", function( event ) {
|
1188 |
wppaOvlShow( this );
|
1189 |
// event.preventDefault();
|
1190 |
-
});
|
1191 |
}
|
1192 |
}
|
1193 |
}
|
@@ -1200,7 +1208,7 @@ wppaConsoleLog( 'wppaInitOverlay' );
|
|
1200 |
function wppaOvlResize() {
|
1201 |
wppaConsoleLog( 'wppaOvlResize' );
|
1202 |
|
1203 |
-
// After resizing, the number of lines may have changed
|
1204 |
setTimeout( 'wppaOvlSize( '+wppaOvlAnimSpeed+' )', 100 );
|
1205 |
|
1206 |
if ( wppaOvlAudioStart && ! wppaOvlAudioPlaying ) {
|
2 |
//
|
3 |
// Conatins lightbox modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
+
//
|
6 |
+
var wppaLightboxVersion = '6.4.05';
|
7 |
|
8 |
// Global inits
|
9 |
var wppaNormsBtnOpac = 1;
|
27 |
|
28 |
// Window resize handler
|
29 |
jQuery( window ).resize(function() {
|
30 |
+
jQuery("#wppa-overlay-bg").css({
|
31 |
height:window.innerHeight,
|
32 |
width:window.innerWidth,
|
33 |
});
|
41 |
|
42 |
var keycode;
|
43 |
var escapeKey;
|
44 |
+
|
45 |
if ( e == null ) { // ie
|
46 |
keycode = event.keyCode;
|
47 |
escapeKey = 27;
|
49 |
keycode = e.keyCode;
|
50 |
escapeKey = 27; //e.DOM_VK_ESCAPE;
|
51 |
}
|
52 |
+
|
53 |
var key = String.fromCharCode( keycode ).toLowerCase();
|
54 |
+
|
55 |
switch ( keycode ) {
|
56 |
case escapeKey:
|
57 |
wppaStopVideo( mocc );
|
67 |
wppaOvlShowNext();
|
68 |
break;
|
69 |
}
|
70 |
+
|
71 |
switch ( key ) {
|
72 |
+
case 'p':
|
73 |
wppaOvlShowPrev();
|
74 |
break;
|
75 |
case 'n':
|
94 |
}
|
95 |
wppaOvlHide();
|
96 |
break;
|
97 |
+
|
98 |
}
|
99 |
+
|
100 |
return false;
|
101 |
}
|
102 |
|
103 |
// Switch to fullscreen mode
|
104 |
function wppaOvlFull() {
|
105 |
wppaConsoleLog( 'wppaOvlFull' );
|
106 |
+
|
107 |
var oldMode = wppaOvlMode;
|
108 |
wppaOvlStepMode();
|
109 |
var elem = document.getElementById('wppa-overlay-ic');
|
143 |
document.webkitCancelFullScreen();
|
144 |
}
|
145 |
if ( exit ) return;
|
146 |
+
|
147 |
setTimeout( 'wppaOvlShow( '+wppaOvlIdx+' )', 1000 );
|
148 |
}
|
149 |
|
150 |
// Prepare the display of the lightbox overlay.
|
151 |
+
// arg is either numeric ( index to current lightbox set ) or
|
152 |
// 'this' for a single image or for the first of a set
|
153 |
function wppaOvlShow( arg ) {
|
154 |
wppaConsoleLog( 'wppaOvlShow arg='+arg );
|
155 |
|
156 |
// Do the setup right after the invocation of the lightbox
|
157 |
if ( wppaOvlFirst ) {
|
158 |
+
|
159 |
// Prevent Weaver ii from hiding us
|
160 |
jQuery( '#weaver-final' ).removeClass( 'wvr-hide-bang' );
|
161 |
|
162 |
// Init background
|
163 |
jQuery( '#wppa-overlay-bg' ).fadeTo( 3, wppaOvlOpacity );
|
164 |
+
|
165 |
// Install keyboard handler
|
166 |
if ( ! wppaKbHandlerInstalled ) {
|
167 |
jQuery( document ).on('keydown', wppaOvlKeyboardHandler );
|
168 |
wppaKbHandlerInstalled = true;
|
169 |
}
|
170 |
+
|
171 |
// Stop all slideshows
|
172 |
var occ = 0;
|
173 |
while ( occ < wppaTopMoc ) {
|
174 |
occ++;
|
175 |
wppaStopShow( occ );
|
176 |
}
|
177 |
+
|
178 |
// Adjust background size
|
179 |
+
jQuery( '#wppa-overlay-bg' ).css({
|
180 |
width:window.innerWidth,
|
181 |
height:window.innerHeight,
|
182 |
});
|
183 |
}
|
184 |
+
|
185 |
// If arg = 'this', setup the array of data
|
186 |
if ( typeof( arg ) == 'object' ) {
|
187 |
|
190 |
wppaOvlTitles = [];
|
191 |
wppaOvlVideoHtmls = [];
|
192 |
wppaOvlAudioHtmls = [];
|
193 |
+
wppaOvlVideoNaturalWidths = [];
|
194 |
+
wppaOvlVideoNaturalHeights = [];
|
195 |
wppaOvlImgs = [];
|
196 |
wppaOvlIdx = 0;
|
197 |
|
206 |
else {
|
207 |
rel = false;
|
208 |
}
|
209 |
+
|
210 |
// Are we in a set?
|
211 |
var temp = rel.split( '[' );
|
212 |
+
|
213 |
// We are in a set if temp[1] is defined
|
214 |
+
if ( temp[1] ) {
|
215 |
var setname = temp[1];
|
216 |
var anchors = jQuery( 'a' );
|
217 |
var anchor;
|
218 |
var i, j = 0;
|
219 |
+
|
220 |
// Save the set
|
221 |
for ( i = 0; i < anchors.length; i++ ) {
|
222 |
anchor = anchors[i];
|
237 |
}
|
238 |
wppaOvlVideoHtmls[j] = jQuery( anchor ).attr( 'data-videohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-videohtml' ) ) : '';
|
239 |
wppaOvlAudioHtmls[j] = jQuery( anchor ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( anchor ).attr( 'data-audiohtml' ) ) : '';
|
240 |
+
wppaOvlVideoNaturalWidths[j] = jQuery( anchor ).attr( 'data-videonatwidth' ) ? jQuery( anchor ).attr( 'data-videonatwidth' ) : '';
|
241 |
wppaOvlVideoNaturalHeights[j] = jQuery( anchor ).attr( 'data-videonatheight' ) ? jQuery( anchor ).attr( 'data-videonatheight' ) : '';
|
242 |
if ( anchor.href == arg.href ) {
|
243 |
wppaOvlIdx = j; // Current index
|
247 |
}
|
248 |
}
|
249 |
}
|
250 |
+
|
251 |
// Single image, treat as set with one element
|
252 |
+
else {
|
253 |
+
wppaOvlUrls[0] = arg.href;
|
254 |
if ( jQuery( arg ).attr( 'data-lbtitle' ) ) {
|
255 |
wppaOvlTitles[0] = wppaRepairScriptTags( jQuery( arg ).attr( 'data-lbtitle' ) );
|
256 |
}
|
261 |
wppaOvlAudioHtmls[0] = jQuery( arg ).attr( 'data-audiohtml' ) ? decodeURI( jQuery( arg ).attr( 'data-audiohtml' ) ) : '';
|
262 |
wppaOvlVideoNaturalWidths[0] = jQuery( arg ).attr( 'data-videonatwidth' ) ? jQuery( arg ).attr( 'data-videonatwidth' ) : '';
|
263 |
wppaOvlVideoNaturalHeights[0] = jQuery( arg ).attr( 'data-videonatheight' ) ? jQuery( arg ).attr( 'data-videonatheight' ) : '';
|
264 |
+
wppaOvlImgs[0]
|
265 |
wppaOvlIdx = 0;
|
266 |
}
|
267 |
+
}
|
268 |
|
269 |
+
// Arg is numeric
|
270 |
else {
|
271 |
wppaOvlIdx = arg;
|
272 |
}
|
283 |
// Show the lightbox overlay.
|
284 |
// idx is the numeric index to current lightbox set
|
285 |
function _wppaOvlShow( idx ) {
|
286 |
+
wppaConsoleLog( '_wppaOvlShow, idx='+idx );
|
287 |
|
288 |
// Show spinner
|
289 |
jQuery( '#wppa-overlay-sp' ).css( { visibility: 'visible' } );
|
290 |
+
|
291 |
// Preload current image
|
292 |
if ( wppaOvlUrls[idx].length > 0 ) { // Not an empty url
|
293 |
wppaOvlImgs[idx] = new Image();
|
302 |
|
303 |
var next;
|
304 |
var prev;
|
305 |
+
|
306 |
// Preload next
|
307 |
if ( wppaOvlIdx == ( wppaOvlUrls.length-1 ) ) {
|
308 |
next = 0;
|
313 |
wppaOvlImgs[next] = new Image();
|
314 |
wppaOvlImgs[next].src = wppaOvlUrls[next]; // Preload
|
315 |
wppaConsoleLog( 'Preloading > '+(next+1) );
|
316 |
+
|
317 |
// Preload previous ( for hitting the prev button )
|
318 |
// Only when in browsemode
|
319 |
if ( ! wppaOvlRunning ) {
|
331 |
// Find photo id and bump its viewcount
|
332 |
wppaPhotoId = wppaUrlToId( wppaOvlUrls[idx] );
|
333 |
_bumpViewCount( wppaPhotoId );
|
334 |
+
|
335 |
// Find handy switches
|
336 |
wppaIsVideo = wppaOvlVideoHtmls[idx] != '';
|
337 |
wppaHasAudio = wppaOvlAudioHtmls[idx] != '';
|
342 |
// Fullsize?
|
343 |
if ( wppaOvlMode != 'normal' ) {
|
344 |
var html;
|
345 |
+
|
346 |
// Fullsize Video
|
347 |
if ( wppaIsVideo ) {
|
348 |
+
html =
|
349 |
'<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery( window ).width()+'px; height:'+jQuery( window ).height()+'px; left:0px; top:0px; text-align:center;" >'+
|
350 |
'<video id="wppa-overlay-img" controls preload="metadata"' +
|
351 |
( wppaOvlVideoStart ? ' autoplay' : '' ) +
|
371 |
}
|
372 |
// Fullsize Photo
|
373 |
else {
|
374 |
+
html =
|
375 |
'<div id="wppa-ovl-full-bg" style="position:fixed; width:'+jQuery( window ).width()+'px; height:'+jQuery( window ).height()+'px; left:0px; top:0px; text-align:center;" >'+
|
376 |
'<img id="wppa-overlay-img"'+
|
377 |
' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+
|
382 |
' style="border:none; width:'+jQuery( window ).width()+'px; visibility:hidden; box-shadow:none; position:absolute;"'+
|
383 |
' />';
|
384 |
if ( wppaHasAudio ) {
|
385 |
+
html += '<audio' +
|
386 |
' id="wppa-overlay-audio"' +
|
387 |
' class="wppa-overlay-audio"' +
|
388 |
' data-from="wppa"' +
|
414 |
'</div>';
|
415 |
'</div>';
|
416 |
}
|
417 |
+
|
418 |
// The 'back to normal' icon
|
419 |
html += '<img' +
|
420 |
' id="wppa-norms-btn"' +
|
446 |
wppaOvlFirst = false;
|
447 |
return false;
|
448 |
}
|
449 |
+
|
450 |
// NOT fullsize
|
451 |
else {
|
452 |
// Initialize
|
462 |
// Initial sizing of image container ( contains image, borders and subtext )
|
463 |
jQuery( '#wppa-overlay-ic' ).css( {
|
464 |
width:wppaSavedContainerWidth,
|
465 |
+
marginLeft:wppaSavedMarginLeft,
|
466 |
marginTop:wppaSavedMarginTop,
|
467 |
});
|
468 |
+
|
469 |
// Make the html
|
470 |
var html = '';
|
471 |
|
472 |
// The img sub image container
|
473 |
html += '<div id="img-sb-img-cont" style="position:relative;line-height:0;" >';
|
474 |
+
|
475 |
// Not Fullsize Video
|
476 |
if ( wppaIsVideo ) {
|
477 |
+
|
478 |
html += '<video' +
|
479 |
' id="wppa-overlay-img"' +
|
480 |
+
' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"' +
|
481 |
+
' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"' +
|
482 |
' preload="metadata"' +
|
483 |
( wppaOvlVideoStart ? ' autoplay' : '' ) +
|
484 |
' onpause="wppaOvlVideoPlaying = false;"' +
|
505 |
' >' +
|
506 |
wppaOvlVideoHtmls[idx] +
|
507 |
'</video>';
|
508 |
+
|
509 |
wppaOvlIsVideo = true;
|
510 |
}
|
511 |
+
|
512 |
// Not fullsize photo
|
513 |
else {
|
514 |
html += '<img' +
|
515 |
' id="wppa-overlay-img"'+
|
516 |
+
' onmouseover="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0.8);"' +
|
517 |
+
' onmouseout="jQuery(\'.wppa-ovl-nav-btn\').stop().fadeTo(200,0);"' +
|
518 |
' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"' +
|
519 |
' ontouchend="wppaTouchEnd( event );"' +
|
520 |
' ontouchmove="wppaTouchMove( event );"' +
|
535 |
'padding:0;' +
|
536 |
'"' +
|
537 |
' />';
|
538 |
+
|
539 |
// Audio on not fullsize
|
540 |
if ( wppaHasAudio ) {
|
541 |
+
html += '<audio' +
|
542 |
' id="wppa-overlay-audio"' +
|
543 |
' class="wppa-overlay-audio"' +
|
544 |
' data-from="wppa"' +
|
563 |
}
|
564 |
wppaOvlIsVideo = false;
|
565 |
}
|
566 |
+
|
567 |
// The quit symbol image
|
568 |
html += '<img' +
|
569 |
' id="wppa-overlay-qt-img"' +
|
570 |
+
' class="wppa-ovl-nav-btn"' +
|
571 |
' src="' + wppaStopSymbolUrl + '"' +
|
572 |
' style="' +
|
573 |
'position:absolute;' +
|
582 |
'"' +
|
583 |
' onclick="wppaOvlHide()"' +
|
584 |
' ontouchend="wppaOvlHide()"' +
|
585 |
+
' onmouseover="jQuery(this).stop().fadeTo(200,1);"' +
|
586 |
' onmouseout="jQuery(this).stop().fadeTo(200,0);"' +
|
587 |
+
' ontouchstart="jQuery(this).stop().fadeTo(200,1);"' +
|
588 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
589 |
' />';
|
590 |
|
592 |
if ( wppaOvlShowStartStop && ! wppaOvlIsSingle ) {
|
593 |
html += '<img' +
|
594 |
' id="wppa-ovl-start-stop-btn"' +
|
595 |
+
' class="wppa-ovl-nav-btn"' +
|
596 |
' src="'+( wppaOvlRunning ? wppaPauseSymbolUrl : wppaStartSymbolUrl )+'"' +
|
597 |
' style="' +
|
598 |
'height:'+wppaStartPauseSymbolSize+'px;' +
|
609 |
'"' +
|
610 |
' onclick="wppaOvlStartStop()"' +
|
611 |
' ontouchend="wppaOvlStartStop()"' +
|
612 |
+
' onmouseover="jQuery(this).stop().fadeTo(200,1);"' +
|
613 |
' onmouseout="jQuery(this).stop().fadeTo(200,0);"' +
|
614 |
+
' ontouchstart="jQuery(this).stop().fadeTo(200,1);"' +
|
615 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
616 |
' />';
|
617 |
}
|
618 |
+
|
619 |
// Show browse buttons only if we are in a set
|
620 |
if ( ! wppaOvlIsSingle ) {
|
621 |
+
|
622 |
// The prev button
|
623 |
html += '<img' +
|
624 |
' id="wppa-ovl-prev-btn"' +
|
625 |
+
' class="wppa-ovl-nav-btn"' +
|
626 |
' src="'+wppaImageDirectory+'prev-'+wppaOvlTheme+'.gif"' +
|
627 |
' style="' +
|
628 |
'position:absolute;' +
|
631 |
( wppaLeftRightSymbolBradius ? 'border-radius:' + wppaLeftRightSymbolBradius + 'px;' : '' ) +
|
632 |
'top:50%;' +
|
633 |
'margin-top:-' + ( wppaLeftRightSymbolSize/2 ) + 'px;' +
|
634 |
+
'left:1px;' +
|
635 |
'box-shadow:none;' +
|
636 |
( wppaOvlFirst ? 'opacity:1;' : 'opacity:0;' ) +
|
637 |
'"' +
|
642 |
' ontouchstart="jQuery(this).stop().fadeTo(200,1);"' +
|
643 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
644 |
' />';
|
645 |
+
|
646 |
// The next button
|
647 |
html += '<img' +
|
648 |
' id="wppa-ovl-next-btn"' +
|
649 |
+
' class="wppa-ovl-nav-btn"' +
|
650 |
' src="'+wppaImageDirectory+'next-'+wppaOvlTheme+'.gif"' +
|
651 |
' style="' +
|
652 |
'position:absolute;' +
|
655 |
( wppaLeftRightSymbolBradius ? 'border-radius:' + wppaLeftRightSymbolBradius + 'px;' : '' ) +
|
656 |
'top:50%;' +
|
657 |
'margin-top:-' + ( wppaLeftRightSymbolSize/2 ) + 'px;' +
|
658 |
+
'right:1px;' +
|
659 |
'box-shadow:none;' +
|
660 |
( wppaOvlFirst ? 'opacity:1;' : 'opacity:0;' ) +
|
661 |
'"' +
|
667 |
' onload="jQuery(this).stop().fadeTo(5000,0);"' +
|
668 |
' />';
|
669 |
}
|
670 |
+
|
671 |
// Close the #img-sb-img-cont
|
672 |
html += '</div>';
|
673 |
|
693 |
' id="wppa-overlay-txt"' +
|
694 |
' style="' +
|
695 |
'text-align:center;' +
|
696 |
+
'min-height:36px;' +
|
697 |
+
'width:100%;' +
|
698 |
( wppaOvlTxtHeight == 'auto' ? 'max-height:200px;' : 'max-height:' + wppaOvlTxtHeight + 'px;' ) +
|
699 |
'overflow:auto;' +
|
700 |
'box-shadow:none;' +
|
701 |
'"' +
|
702 |
' >' +
|
703 |
( showCounter ? ( wppaOvlIdx + 1 ) + '/' + wppaOvlUrls.length + '<br />' : '' ) +
|
704 |
+
wppaOvlTitles[idx] +
|
705 |
'</div>';
|
706 |
'</div>';
|
707 |
|
708 |
+
// Insert the html
|
709 |
jQuery( '#wppa-overlay-ic' ).html( html );
|
710 |
+
|
711 |
// Size
|
712 |
wppaOvlResize();
|
713 |
+
|
714 |
// Done!
|
715 |
return false;
|
716 |
}
|
734 |
wppaOvlFormatFull();
|
735 |
return;
|
736 |
}
|
737 |
+
|
738 |
|
739 |
var iw = jQuery( window ).width();
|
740 |
+
var ih = jQuery( window ).height();
|
741 |
var cw, nw, nh;
|
742 |
+
|
743 |
if ( wppaOvlIsVideo ) {
|
744 |
cw = 640;
|
745 |
nw = 640;
|
747 |
}
|
748 |
else {
|
749 |
cw = img.clientWidth;
|
750 |
+
nw = img.naturalWidth;
|
751 |
+
nh = img.naturalHeight;
|
752 |
}
|
753 |
+
|
754 |
var fakt1;
|
755 |
var fakt2;
|
756 |
var fakt;
|
757 |
+
|
758 |
// If the width is the limiting factor, adjust the height
|
759 |
if ( typeof( nw ) == 'undefined' ) { // ver 4 browser
|
760 |
nw = img.clientWidth;
|
804 |
|
805 |
// Save new image width and height
|
806 |
var done = ( wppaSavedImageWidth - wid < 3 && wid - wppaSavedImageWidth < 3 );
|
807 |
+
|
808 |
if ( wid <= 10 ) {
|
809 |
wid = 240;
|
810 |
nh = 180;
|
811 |
nw = 240;
|
812 |
done = false;
|
813 |
}
|
814 |
+
|
815 |
wppaSavedImageWidth = wid;
|
816 |
wppaSavedImageHeight = wid * nh / nw;
|
817 |
wppaSavedMarginLeft = - ( wid / 2 + wppaOvlBorderWidth );
|
821 |
|
822 |
// Go to final size
|
823 |
jQuery( '#wppa-overlay-img' ).animate( {
|
824 |
+
width:wppaSavedImageWidth,
|
825 |
height:wppaSavedImageHeight,
|
826 |
+
},
|
827 |
+
speed
|
828 |
);
|
829 |
+
|
830 |
jQuery( '#wppa-overlay-ic' ).animate( {
|
831 |
+
width:wppaSavedContainerWidth,
|
832 |
+
marginLeft:wppaSavedMarginLeft,
|
833 |
marginTop:wppaSavedMarginTop,
|
834 |
+
},
|
835 |
+
speed
|
836 |
);
|
837 |
|
838 |
+
|
839 |
// Done?
|
840 |
if ( ! done ) {
|
841 |
setTimeout( function(){ wppaOvlSize(wppaOvlAnimSpeed) }, speed + 100 );
|
843 |
', img complete='+document.getElementById( 'wppa-overlay-img' ).complete );
|
844 |
}
|
845 |
else {
|
846 |
+
|
847 |
// Remove spinner
|
848 |
jQuery( '#wppa-overlay-sp' ).css( { visibility: 'hidden' } );
|
849 |
wppaConsoleLog( 'Done '+wppaOvlIdx );
|
859 |
var img;
|
860 |
var natWidth;
|
861 |
var natHeight;
|
862 |
+
|
863 |
// Find the natural image sizes
|
864 |
if ( wppaOvlIsVideo ) {
|
865 |
img = document.getElementById( 'wppa-overlay-img' );
|
869 |
else {
|
870 |
img = document.getElementById( 'wppa-overlay-img' );
|
871 |
if ( ! img || ! img.complete ) {
|
872 |
+
|
873 |
// Wait for load complete
|
874 |
+
setTimeout( 'wppaOvlFormatFull()', 100 );
|
875 |
return;
|
876 |
}
|
877 |
natWidth = img.naturalWidth;
|
879 |
}
|
880 |
|
881 |
var screenRatio = jQuery( window ).width() / jQuery( window ).height();
|
882 |
+
var imageRatio = natWidth / natHeight;
|
883 |
var margLeft = 0;
|
884 |
var margTop = 0;
|
885 |
var imgHeight = 0;
|
954 |
return true; // Done!
|
955 |
}
|
956 |
|
957 |
+
// This function is called after a timeout to update fullsize photo id.
|
958 |
// Used to determine if a video/audio must restart
|
959 |
function wppaOvlUpdateFsId() {
|
960 |
wppaConsoleLog( 'wppaOvlUpdateFsId' );
|
998 |
|
999 |
// Running?
|
1000 |
if ( wppaOvlRunning ) {
|
1001 |
+
|
1002 |
// Stop it
|
1003 |
wppaOvlRunning = false;
|
1004 |
+
|
1005 |
// Swap button image
|
1006 |
jQuery( '#wppa-ovl-start-stop-btn' ).attr( 'src', wppaStartSymbolUrl );
|
1007 |
+
|
1008 |
// If in a set: Determine visibility of browse buttons and make visible if appliccable
|
1009 |
+
if ( wppaOvlIdx != -1 ) {
|
1010 |
+
|
1011 |
// NOT first, show prev button
|
1012 |
if ( wppaOvlIdx != 0 ) {
|
1013 |
jQuery( '#wppa-ovl-prev-btn' ).css('visibility', 'visible');
|
1014 |
}
|
1015 |
+
|
1016 |
// NOT last, show next button
|
1017 |
if ( wppaOvlIdx != ( wppaOvlUrls.length-1 ) ) {
|
1018 |
jQuery( '#wppa-ovl-next-btn' ).css('visibility', 'visible');
|
1019 |
}
|
1020 |
}
|
1021 |
}
|
1022 |
+
|
1023 |
// Not running
|
1024 |
else {
|
1025 |
+
|
1026 |
// Swap button image
|
1027 |
jQuery( '#wppa-ovl-start-stop-btn' ).attr( 'src', wppaPauseSymbolUrl );
|
1028 |
+
|
1029 |
// Start it
|
1030 |
wppaOvlRunning = true;
|
1031 |
wppaOvlRun();
|
1038 |
|
1039 |
// Already running?
|
1040 |
if ( ! wppaOvlRunning ) return;
|
1041 |
+
|
1042 |
// Wait until playing audio or video ends
|
1043 |
if ( wppaOvlVideoPlaying || wppaOvlAudioPlaying ) {
|
1044 |
+
setTimeout( 'wppaOvlRun()', 500 );
|
1045 |
return;
|
1046 |
}
|
1047 |
|
1056 |
}
|
1057 |
}
|
1058 |
}
|
1059 |
+
|
1060 |
+
|
1061 |
var next;
|
1062 |
if ( wppaOvlIdx >= ( wppaOvlUrls.length-1 ) ) next = 0;
|
1063 |
else next = wppaOvlIdx + 1;
|
1064 |
+
|
1065 |
wppaOvlFsPhotoId = 0;
|
1066 |
wppaPhotoId = 0;
|
1067 |
+
|
1068 |
wppaOvlShow( next );
|
1069 |
|
1070 |
setTimeout( 'wppaOvlRun()', wppaOvlSlideSpeed );
|
1076 |
|
1077 |
wppaOvlFsPhotoId = 0;
|
1078 |
wppaPhotoId = 0;
|
1079 |
+
|
1080 |
if ( wppaOvlIsSingle ) return false;
|
1081 |
if ( wppaOvlIdx < 1 ) {
|
1082 |
wppaOvlIdx = wppaOvlUrls.length; // Restart at last
|
1091 |
|
1092 |
wppaOvlFsPhotoId = 0;
|
1093 |
wppaPhotoId = 0;
|
1094 |
+
|
1095 |
if ( wppaOvlIsSingle ) return false;
|
1096 |
if ( wppaOvlIdx >= ( wppaOvlUrls.length-1 ) ) {
|
1097 |
wppaOvlIdx = -1; // Restart at first
|
1106 |
|
1107 |
// Stop audio
|
1108 |
wppaStopAudio();
|
1109 |
+
|
1110 |
// Clear image container
|
1111 |
jQuery( '#wppa-overlay-ic' ).html( '' );
|
1112 |
+
|
1113 |
// Remove background
|
1114 |
jQuery( '#wppa-overlay-bg' ).fadeOut( 300 );
|
1115 |
+
|
1116 |
// Remove kb handler
|
1117 |
jQuery( document ).off( 'keydown', wppaOvlKeyboardHandler );
|
1118 |
wppaKbHandlerInstalled = false;
|
1119 |
+
|
1120 |
// Reset switches
|
1121 |
wppaOvlFirst = true;
|
1122 |
wppaOvlRunning = false;
|
1159 |
|
1160 |
wppaOvlFsPhotoId = 0; // Reset ovl fullscreen photo id
|
1161 |
wppaPhotoId = 0;
|
1162 |
+
|
1163 |
wppaSavedContainerWidth = 240 + 2 * wppaOvlBorderWidth;
|
1164 |
wppaSavedContainerHeight = 180 + 3 * wppaOvlBorderWidth + 20 + ( wppaOvlTxtHeight == 'auto' ? 50 : wppaOvlTxtHeight );
|
1165 |
wppaSavedMarginLeft = - ( 120 + wppaOvlBorderWidth );
|
1166 |
wppaSavedMarginTop = - ( 90 + wppaOvlBorderWidth + 10 + ( wppaOvlTxtHeight == 'auto' ? 25 : wppaOvlTxtHeight / 2 ) );
|
1167 |
wppaSavedImageWidth = 240;
|
1168 |
wppaSavedImageHeight = 180 + wppaOvlBorderWidth;
|
1169 |
+
|
1170 |
for ( i = 0; i < anchors.length; i++ ) {
|
1171 |
+
|
1172 |
anchor = anchors[i];
|
1173 |
if ( jQuery( anchor ).attr( 'data-rel' ) ) {
|
1174 |
temp = jQuery( anchor ).attr( 'data-rel' ).split( "[" );
|
1181 |
}
|
1182 |
|
1183 |
if ( temp[0] == 'wppa' ) {
|
1184 |
+
|
1185 |
// found one
|
1186 |
wppaWppaOverlayActivated = true;
|
1187 |
+
|
1188 |
// Install onclick handler
|
1189 |
jQuery( anchor ).click( function( event ) {
|
1190 |
wppaOvlShow( this );
|
1191 |
event.preventDefault();
|
1192 |
+
});
|
1193 |
+
|
1194 |
// Install ontouchstart handler
|
1195 |
jQuery( anchor ).on( "touchstart", function( event ) {
|
1196 |
wppaOvlShow( this );
|
1197 |
// event.preventDefault();
|
1198 |
+
});
|
1199 |
}
|
1200 |
}
|
1201 |
}
|
1208 |
function wppaOvlResize() {
|
1209 |
wppaConsoleLog( 'wppaOvlResize' );
|
1210 |
|
1211 |
+
// After resizing, the number of lines may have changed
|
1212 |
setTimeout( 'wppaOvlSize( '+wppaOvlAnimSpeed+' )', 100 );
|
1213 |
|
1214 |
if ( wppaOvlAudioStart && ! wppaOvlAudioPlaying ) {
|
js/wppa-lightbox.min.js
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
//
|
3 |
// Conatins lightbox modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
-
//
|
6 |
|
7 |
-
var wppaLightboxVersion='6.
|
8 |
var key=String.fromCharCode(keycode).toLowerCase();switch(keycode){case escapeKey:wppaStopVideo(mocc);if(wppaOvlMode!='normal'){wppaOvlNorm(true);}
|
9 |
wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext();break;}
|
10 |
switch(key){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'q':case'x':wppaStopVideo(mocc);if(wppaOvlMode!='normal'){wppaOvlNorm(true);}
|
@@ -54,21 +54,21 @@ wppaOvlIsVideo=wppaIsVideo;setTimeout('wppaOvlFormatFull()',10);if(wppaIsVideo||
|
|
54 |
else{wppaOvlFsPhotoId=0;}
|
55 |
wppaOvlFirst=false;return false;}
|
56 |
else{wppaOvlFsPhotoId=0;wppaPhotoId=0;wppaStopVideo(0);var txtcol=wppaOvlTheme=='black'?'#a7a7a7':'#272727';if(wppaOvlFontColor){txtcol=wppaOvlFontColor;}
|
57 |
-
var showNav=wppaOvlUrls.length>1;jQuery('#wppa-overlay-ic').css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop,});var html='';html+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >';if(wppaIsVideo){html+='<video'+' id="wppa-overlay-img"'+' preload="metadata"'+
|
58 |
(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;'+'"'+' >'+
|
59 |
wppaOvlVideoHtmls[idx]+'</video>';wppaOvlIsVideo=true;}
|
60 |
-
else{html+='<img'+' id="wppa-overlay-img"'+' ontouchstart="wppaTouchStart( event, \'wppa-overlay-img\', -1 );"'+' ontouchend="wppaTouchEnd( event );"'+' ontouchmove="wppaTouchMove( event );"'+' ontouchcancel="wppaTouchCancel( event );"'+' src="'+wppaOvlUrls[idx]+'"'+' 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;'+'"'+' />';if(wppaHasAudio){html+='<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'+' >'+
|
61 |
wppaOvlAudioHtmls[idx]+'</audio>';}
|
62 |
wppaOvlIsVideo=false;}
|
63 |
-
html+='<img'+' id="wppa-overlay-qt-img"'+' src="'+wppaStopSymbolUrl+'"'+' style="'+'position:absolute;'+'z-index:100101;'+'right:'+wppaOvlBorderWidth+'px;'+'top:'+wppaOvlBorderWidth+'px;'+'box-shadow:none;'+'cursor:pointer;'+'height:'+wppaStopSymbolSize+'px;'+
|
64 |
(wppaStopSumbolBradius>0?'border-radius:'+wppaStopSumbolBradius+'px;':'')+
|
65 |
-
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlHide()"'+' ontouchend="wppaOvlHide()"'+' onmouseover="jQuery(this).stop().fadeTo(200,
|
66 |
(wppaStartPauseSymbolBradius>0?'border-radius:'+wppaStartPauseSymbolBradius+'px;':'')+'z-index:100101;'+'position:absolute;'+'top:50%;'+'margin-top:'+(-wppaStartPauseSymbolSize/2)+'px;'+'left:50%;'+'margin-left:'+(-wppaStartPauseSymbolSize/2)+'px;'+
|
67 |
(wppaOvlIdx==-1?'visibility:hidden;':'')+'box-shadow:none;'+
|
68 |
-
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlStartStop()"'+' ontouchend="wppaOvlStartStop()"'+' onmouseover="jQuery(this).stop().fadeTo(200,
|
69 |
-
if(!wppaOvlIsSingle){html+='<img'+' id="wppa-ovl-prev-btn"'+' src="'+wppaImageDirectory+'prev-'+wppaOvlTheme+'.gif"'+' style="'+'position:absolute;'+'z-index:100101;'+'width:'+wppaLeftRightSymbolSize+'px;'+
|
70 |
(wppaLeftRightSymbolBradius?'border-radius:'+wppaLeftRightSymbolBradius+'px;':'')+'top:50%;'+'margin-top:-'+(wppaLeftRightSymbolSize/2)+'px;'+'left:1px;'+'box-shadow:none;'+
|
71 |
-
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlShowPrev()"'+' ontouchend="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);"'+' />';html+='<img'+' id="wppa-ovl-next-btn"'+' src="'+wppaImageDirectory+'next-'+wppaOvlTheme+'.gif"'+' style="'+'position:absolute;'+'z-index:100101;'+'width:'+wppaLeftRightSymbolSize+'px;'+
|
72 |
(wppaLeftRightSymbolBradius?'border-radius:'+wppaLeftRightSymbolBradius+'px;':'')+'top:50%;'+'margin-top:-'+(wppaLeftRightSymbolSize/2)+'px;'+'right:1px;'+'box-shadow:none;'+
|
73 |
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlShowNext()"'+' ontouchend="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);"'+' />';}
|
74 |
html+='</div>';var showCounter=!wppaOvlIsSingle&&wppaOvlShowCounter;html+='<div id="wppa-overlay-txt-container"'+' style="'+'position:relative;'+'padding:10px;'+'background-color:'+wppaOvlTheme+';'+'color:'+txtcol+';'+'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%;'+
|
2 |
//
|
3 |
// Conatins lightbox modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
+
//
|
6 |
|
7 |
+
var wppaLightboxVersion='6.4.05';var wppaNormsBtnOpac=1;var wppaIsVideo=false;var wppaHasAudio=false;var wppaOvlImgs=[];var wppaKbHandlerInstalled=false;var wppaSavedContainerWidth;var wppaSavedContainerHeight;var wppaSavedMarginLeft;var wppaSavedMarginTop;var wppaSavedImageWidth;var wppaSavedImageHeight;jQuery(document).ready(function(e){wppaInitOverlay();});jQuery(window).resize(function(){jQuery("#wppa-overlay-bg").css({height:window.innerHeight,width:window.innerWidth,});wppaOvlResize(10);});function wppaOvlKeyboardHandler(e){var keycode;var escapeKey;if(e==null){keycode=event.keyCode;escapeKey=27;}else{keycode=e.keyCode;escapeKey=27;}
|
8 |
var key=String.fromCharCode(keycode).toLowerCase();switch(keycode){case escapeKey:wppaStopVideo(mocc);if(wppaOvlMode!='normal'){wppaOvlNorm(true);}
|
9 |
wppaOvlHide();break;case 37:wppaOvlShowPrev();break;case 39:wppaOvlShowNext();break;}
|
10 |
switch(key){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'q':case'x':wppaStopVideo(mocc);if(wppaOvlMode!='normal'){wppaOvlNorm(true);}
|
54 |
else{wppaOvlFsPhotoId=0;}
|
55 |
wppaOvlFirst=false;return false;}
|
56 |
else{wppaOvlFsPhotoId=0;wppaPhotoId=0;wppaStopVideo(0);var txtcol=wppaOvlTheme=='black'?'#a7a7a7':'#272727';if(wppaOvlFontColor){txtcol=wppaOvlFontColor;}
|
57 |
+
var showNav=wppaOvlUrls.length>1;jQuery('#wppa-overlay-ic').css({width:wppaSavedContainerWidth,marginLeft:wppaSavedMarginLeft,marginTop:wppaSavedMarginTop,});var html='';html+='<div id="img-sb-img-cont" style="position:relative;line-height:0;" >';if(wppaIsVideo){html+='<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"'+
|
58 |
(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;'+'"'+' >'+
|
59 |
wppaOvlVideoHtmls[idx]+'</video>';wppaOvlIsVideo=true;}
|
60 |
+
else{html+='<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[idx]+'"'+' 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;'+'"'+' />';if(wppaHasAudio){html+='<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'+' >'+
|
61 |
wppaOvlAudioHtmls[idx]+'</audio>';}
|
62 |
wppaOvlIsVideo=false;}
|
63 |
+
html+='<img'+' id="wppa-overlay-qt-img"'+' class="wppa-ovl-nav-btn"'+' src="'+wppaStopSymbolUrl+'"'+' style="'+'position:absolute;'+'z-index:100101;'+'right:'+wppaOvlBorderWidth+'px;'+'top:'+wppaOvlBorderWidth+'px;'+'box-shadow:none;'+'cursor:pointer;'+'height:'+wppaStopSymbolSize+'px;'+
|
64 |
(wppaStopSumbolBradius>0?'border-radius:'+wppaStopSumbolBradius+'px;':'')+
|
65 |
+
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlHide()"'+' ontouchend="wppaOvlHide()"'+' 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);"'+' />';if(wppaOvlShowStartStop&&!wppaOvlIsSingle){html+='<img'+' id="wppa-ovl-start-stop-btn"'+' class="wppa-ovl-nav-btn"'+' src="'+(wppaOvlRunning?wppaPauseSymbolUrl:wppaStartSymbolUrl)+'"'+' style="'+'height:'+wppaStartPauseSymbolSize+'px;'+
|
66 |
(wppaStartPauseSymbolBradius>0?'border-radius:'+wppaStartPauseSymbolBradius+'px;':'')+'z-index:100101;'+'position:absolute;'+'top:50%;'+'margin-top:'+(-wppaStartPauseSymbolSize/2)+'px;'+'left:50%;'+'margin-left:'+(-wppaStartPauseSymbolSize/2)+'px;'+
|
67 |
(wppaOvlIdx==-1?'visibility:hidden;':'')+'box-shadow:none;'+
|
68 |
+
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlStartStop()"'+' ontouchend="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);"'+' />';}
|
69 |
+
if(!wppaOvlIsSingle){html+='<img'+' id="wppa-ovl-prev-btn"'+' class="wppa-ovl-nav-btn"'+' src="'+wppaImageDirectory+'prev-'+wppaOvlTheme+'.gif"'+' style="'+'position:absolute;'+'z-index:100101;'+'width:'+wppaLeftRightSymbolSize+'px;'+
|
70 |
(wppaLeftRightSymbolBradius?'border-radius:'+wppaLeftRightSymbolBradius+'px;':'')+'top:50%;'+'margin-top:-'+(wppaLeftRightSymbolSize/2)+'px;'+'left:1px;'+'box-shadow:none;'+
|
71 |
+
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlShowPrev()"'+' ontouchend="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);"'+' />';html+='<img'+' id="wppa-ovl-next-btn"'+' class="wppa-ovl-nav-btn"'+' src="'+wppaImageDirectory+'next-'+wppaOvlTheme+'.gif"'+' style="'+'position:absolute;'+'z-index:100101;'+'width:'+wppaLeftRightSymbolSize+'px;'+
|
72 |
(wppaLeftRightSymbolBradius?'border-radius:'+wppaLeftRightSymbolBradius+'px;':'')+'top:50%;'+'margin-top:-'+(wppaLeftRightSymbolSize/2)+'px;'+'right:1px;'+'box-shadow:none;'+
|
73 |
(wppaOvlFirst?'opacity:1;':'opacity:0;')+'"'+' onclick="wppaOvlShowNext()"'+' ontouchend="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);"'+' />';}
|
74 |
html+='</div>';var showCounter=!wppaOvlIsSingle&&wppaOvlShowCounter;html+='<div id="wppa-overlay-txt-container"'+' style="'+'position:relative;'+'padding:10px;'+'background-color:'+wppaOvlTheme+';'+'color:'+txtcol+';'+'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%;'+
|
js/wppa-tinymce-shortcodes.js
CHANGED
@@ -2,13 +2,13 @@
|
|
2 |
* Pachkage: wp-photo-album-plus
|
3 |
*
|
4 |
*
|
5 |
-
* Version 6.
|
6 |
*
|
7 |
*/
|
8 |
|
9 |
// Add the wppa button to the mce editor
|
10 |
tinymce.PluginManager.add('wppagallery', function(editor, url) {
|
11 |
-
|
12 |
function openWppaShortcodeGenerator() {
|
13 |
// triggers the thickbox
|
14 |
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
@@ -17,13 +17,13 @@ tinymce.PluginManager.add('wppagallery', function(editor, url) {
|
|
17 |
H = H - 120;
|
18 |
tb_show( 'WPPA+ Shortcode Generator', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=wppagallery-form' );
|
19 |
}
|
20 |
-
|
21 |
editor.addButton('mygallery_button', {
|
22 |
image: wppaImageDirectory+'albumnew32.png',
|
23 |
tooltip: 'WPPA+ Shortcode Generator',
|
24 |
onclick: openWppaShortcodeGenerator
|
25 |
});
|
26 |
-
|
27 |
});
|
28 |
|
29 |
// executes this when the DOM is ready
|
@@ -31,10 +31,10 @@ jQuery(function(){
|
|
31 |
|
32 |
// creates a form to be displayed everytime the button is clicked
|
33 |
var xmlhttp = wppaGetXmlHttp(); // located in wppa-admin-scripts.js
|
34 |
-
|
35 |
// wppa-ajax.php calls wppa_make_tinymce_dialog(); which is located in wppa-tinymce.php
|
36 |
-
var url = wppaAjaxUrl+'?action=wppa&wppa-action=tinymcedialog';
|
37 |
-
|
38 |
xmlhttp.open("GET",url,true);
|
39 |
xmlhttp.send();
|
40 |
xmlhttp.onreadystatechange=function() {
|
@@ -42,22 +42,22 @@ jQuery(function(){
|
|
42 |
var formtext = xmlhttp.responseText;
|
43 |
|
44 |
var form = jQuery(formtext);
|
45 |
-
|
46 |
var table = form.find('table');
|
47 |
form.appendTo('body').hide();
|
48 |
-
|
49 |
// handles the click event of the submit button
|
50 |
form.find('#wppagallery-submit').click(function(){
|
51 |
-
|
52 |
// Get the shortcode from the preview/edit box
|
53 |
newShortcode = document.getElementById('wppagallery-shortcode-preview').value;
|
54 |
-
|
55 |
// Filter
|
56 |
newShortcode = newShortcode.replace(/"/g, '"');
|
57 |
-
|
58 |
// inserts the shortcode into the active editor
|
59 |
tinyMCE.activeEditor.execCommand('mceInsertContent', 0, newShortcode);
|
60 |
-
|
61 |
// closes Thickbox
|
62 |
tb_remove();
|
63 |
});
|
@@ -69,7 +69,7 @@ function wppaGalleryEvaluate() {
|
|
69 |
|
70 |
// Assume shortcode complete
|
71 |
var shortcodeOk = true;
|
72 |
-
|
73 |
// Hide option elements
|
74 |
jQuery('#wppagallery-galery-type-tr').hide();
|
75 |
jQuery('#wppagallery-slides-type-tr').hide();
|
@@ -94,6 +94,9 @@ function wppaGalleryEvaluate() {
|
|
94 |
jQuery('#wppagallery-taglist-tr').hide();
|
95 |
jQuery('#wppagallery-album-super-tr').hide();
|
96 |
jQuery('#wppagallery-calendar-tr').hide();
|
|
|
|
|
|
|
97 |
|
98 |
// Init shortcode parts
|
99 |
var shortcode = '[wppa';
|
@@ -125,12 +128,16 @@ function wppaGalleryEvaluate() {
|
|
125 |
var taglist = '';
|
126 |
var owner = '';
|
127 |
var tags = '';
|
128 |
-
var
|
129 |
var i,j,t;
|
130 |
var caltype = '';
|
131 |
var reverse = false;
|
132 |
var allopen = false;
|
133 |
-
|
|
|
|
|
|
|
|
|
134 |
// Type
|
135 |
topType = jQuery('#wppagallery-top-type').attr('value');
|
136 |
switch ( topType ) {
|
@@ -185,11 +192,12 @@ function wppaGalleryEvaluate() {
|
|
185 |
switch ( type ) {
|
186 |
case 'search':
|
187 |
jQuery('#wppagallery-search-tr').show();
|
188 |
-
|
189 |
-
|
|
|
|
|
190 |
break;
|
191 |
case 'supersearch':
|
192 |
-
// jQuery('#wppagallery-search-tr').show();
|
193 |
break;
|
194 |
case 'tagcloud':
|
195 |
case 'multitag':
|
@@ -269,7 +277,7 @@ function wppaGalleryEvaluate() {
|
|
269 |
}
|
270 |
else {
|
271 |
}
|
272 |
-
|
273 |
// Album
|
274 |
if ( needAlbum ) {
|
275 |
albumType = jQuery('#wppagallery-album-type').attr('value');
|
@@ -300,7 +308,7 @@ function wppaGalleryEvaluate() {
|
|
300 |
// and get the album identifier
|
301 |
if ( type == 'cover') {
|
302 |
jQuery('#wppagallery-album-virt-cover-tr').show();
|
303 |
-
album = jQuery('#wppagallery-album-virt-cover').attr('value');
|
304 |
}
|
305 |
else { // type != cover
|
306 |
jQuery('#wppagallery-album-virt-tr').show();
|
@@ -324,6 +332,12 @@ function wppaGalleryEvaluate() {
|
|
324 |
break;
|
325 |
case '#tags':
|
326 |
jQuery('#wppagallery-phototags-tr').show();
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
needTag = true;
|
328 |
t = jQuery('.wppagallery-phototags');
|
329 |
var tagarr = [];
|
@@ -336,7 +350,7 @@ function wppaGalleryEvaluate() {
|
|
336 |
}
|
337 |
i++;
|
338 |
}
|
339 |
-
tags = wppaArrayToEnum( tagarr,
|
340 |
if ( tags != '' ) {
|
341 |
jQuery('.wppagallery-phototags').css('color', '#070');
|
342 |
}
|
@@ -349,9 +363,26 @@ function wppaGalleryEvaluate() {
|
|
349 |
break;
|
350 |
case '#cat':
|
351 |
jQuery('#wppagallery-albumcat-tr').show();
|
|
|
|
|
|
|
|
|
|
|
|
|
352 |
needCat = true;
|
353 |
-
|
354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
jQuery('#wppagallery-albumcat').css('color', '#070');
|
356 |
}
|
357 |
break;
|
@@ -372,8 +403,8 @@ function wppaGalleryEvaluate() {
|
|
372 |
default:
|
373 |
alert( 'Unimplemented virtual album: '+album );
|
374 |
}
|
375 |
-
if ( ( album != '#cat' ||
|
376 |
-
( album != '#owner' || owner != '' ) &&
|
377 |
( album != '#upldr' || owner != '' ) &&
|
378 |
( album != '#topten' || parent != '' ) &&
|
379 |
( album != '#lasten' || parent != '' ) &&
|
@@ -388,14 +419,14 @@ function wppaGalleryEvaluate() {
|
|
388 |
album = '';
|
389 |
}
|
390 |
}
|
391 |
-
|
392 |
// No album specified
|
393 |
if ( album == '' ) {
|
394 |
jQuery('#wppagallery-album-real').css('color', '#700');
|
395 |
jQuery('#wppagallery-album-virt').css('color', '#700');
|
396 |
jQuery('#wppagallery-album-virt-cover').css('color', '#700');
|
397 |
}
|
398 |
-
|
399 |
// Add album specs to shortcode
|
400 |
else {
|
401 |
jQuery('#wppagallery-album-real').css('color', '#070');
|
@@ -408,10 +439,10 @@ function wppaGalleryEvaluate() {
|
|
408 |
if ( parent != '' ) shortcode += ','+parent;
|
409 |
if ( count != '' ) shortcode += ','+count;
|
410 |
if ( tags != '' ) shortcode += ','+tags;
|
411 |
-
if (
|
412 |
shortcode += '"';
|
413 |
}
|
414 |
-
|
415 |
// Photo
|
416 |
if ( needPhoto ) {
|
417 |
photo = jQuery('#wppagallery-photo').attr('value');
|
@@ -427,13 +458,17 @@ function wppaGalleryEvaluate() {
|
|
427 |
jQuery('#wppagallery-photo').css('color', '#070');
|
428 |
}
|
429 |
}
|
430 |
-
|
431 |
// Search options
|
432 |
if ( type == 'search' ) {
|
433 |
sub = jQuery('#wppagallery-sub').attr('checked');
|
434 |
root = jQuery('#wppagallery-root').attr('checked');
|
435 |
if ( sub == 'checked' ) shortcode += ' sub="1"';
|
436 |
-
if ( root == 'checked' )
|
|
|
|
|
|
|
|
|
437 |
}
|
438 |
if ( type == 'tagcloud' || type == 'multitag' ) {
|
439 |
if ( taglist != '' ) {
|
@@ -452,7 +487,7 @@ function wppaGalleryEvaluate() {
|
|
452 |
shortcode += ' all="1"';
|
453 |
}
|
454 |
}
|
455 |
-
|
456 |
// Size
|
457 |
var size = document.getElementById('wppagallery-size').value;
|
458 |
if ( size != '' && size != 'auto' ) {
|
@@ -469,13 +504,13 @@ function wppaGalleryEvaluate() {
|
|
469 |
if ( size != 0 ) {
|
470 |
shortcode += ' size="'+size+'"';
|
471 |
}
|
472 |
-
|
473 |
// Align
|
474 |
var align = document.getElementById('wppagallery-align').value;
|
475 |
if ( align != 'none' ) {
|
476 |
shortcode += ' align="'+align+'"';
|
477 |
}
|
478 |
-
|
479 |
// Extract comment
|
480 |
var t = document.getElementById('wppagallery-shortcode-preview').value;
|
481 |
t = t.replace(/"/g, '"');
|
@@ -486,12 +521,12 @@ function wppaGalleryEvaluate() {
|
|
486 |
|
487 |
// Close
|
488 |
shortcode += ']'+shortcodeComment+'[/wppa]';
|
489 |
-
|
490 |
// Display shortcode
|
491 |
shortcode = shortcode.replace(/"/g, '"');
|
492 |
var html = '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+shortcode+'" />';
|
493 |
document.getElementById('wppagallery-shortcode-preview-container').innerHTML = html;
|
494 |
-
|
495 |
// Is shortcode complete?
|
496 |
shortcodeOk = ( album != '' || ! needAlbum ) &&
|
497 |
( photo != '' || ! needPhoto ) &&
|
@@ -502,8 +537,8 @@ function wppaGalleryEvaluate() {
|
|
502 |
( searchType != '' || ! needSearchType ) &&
|
503 |
( miscType != '' || ! needMiscType ) &&
|
504 |
( tags != '' || ! needTag ) &&
|
505 |
-
(
|
506 |
-
|
507 |
// Debug
|
508 |
if ( ! shortcodeOk ) {
|
509 |
var text = '';
|
@@ -516,10 +551,10 @@ function wppaGalleryEvaluate() {
|
|
516 |
if ( searchType == '' && needSearchType ) text += 'Need searchType';
|
517 |
if ( miscType == '' && needMiscType ) text += 'Need miscType';
|
518 |
if ( tags == '' && needTag ) text += 'Need tags';
|
519 |
-
if (
|
520 |
// alert( text );
|
521 |
}
|
522 |
-
|
523 |
// Display the right button
|
524 |
if ( shortcodeOk ) {
|
525 |
jQuery('#wppagallery-submit').show();
|
2 |
* Pachkage: wp-photo-album-plus
|
3 |
*
|
4 |
*
|
5 |
+
* Version 6.4.05
|
6 |
*
|
7 |
*/
|
8 |
|
9 |
// Add the wppa button to the mce editor
|
10 |
tinymce.PluginManager.add('wppagallery', function(editor, url) {
|
11 |
+
|
12 |
function openWppaShortcodeGenerator() {
|
13 |
// triggers the thickbox
|
14 |
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
|
17 |
H = H - 120;
|
18 |
tb_show( 'WPPA+ Shortcode Generator', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=wppagallery-form' );
|
19 |
}
|
20 |
+
|
21 |
editor.addButton('mygallery_button', {
|
22 |
image: wppaImageDirectory+'albumnew32.png',
|
23 |
tooltip: 'WPPA+ Shortcode Generator',
|
24 |
onclick: openWppaShortcodeGenerator
|
25 |
});
|
26 |
+
|
27 |
});
|
28 |
|
29 |
// executes this when the DOM is ready
|
31 |
|
32 |
// creates a form to be displayed everytime the button is clicked
|
33 |
var xmlhttp = wppaGetXmlHttp(); // located in wppa-admin-scripts.js
|
34 |
+
|
35 |
// wppa-ajax.php calls wppa_make_tinymce_dialog(); which is located in wppa-tinymce.php
|
36 |
+
var url = wppaAjaxUrl+'?action=wppa&wppa-action=tinymcedialog';
|
37 |
+
|
38 |
xmlhttp.open("GET",url,true);
|
39 |
xmlhttp.send();
|
40 |
xmlhttp.onreadystatechange=function() {
|
42 |
var formtext = xmlhttp.responseText;
|
43 |
|
44 |
var form = jQuery(formtext);
|
45 |
+
|
46 |
var table = form.find('table');
|
47 |
form.appendTo('body').hide();
|
48 |
+
|
49 |
// handles the click event of the submit button
|
50 |
form.find('#wppagallery-submit').click(function(){
|
51 |
+
|
52 |
// Get the shortcode from the preview/edit box
|
53 |
newShortcode = document.getElementById('wppagallery-shortcode-preview').value;
|
54 |
+
|
55 |
// Filter
|
56 |
newShortcode = newShortcode.replace(/"/g, '"');
|
57 |
+
|
58 |
// inserts the shortcode into the active editor
|
59 |
tinyMCE.activeEditor.execCommand('mceInsertContent', 0, newShortcode);
|
60 |
+
|
61 |
// closes Thickbox
|
62 |
tb_remove();
|
63 |
});
|
69 |
|
70 |
// Assume shortcode complete
|
71 |
var shortcodeOk = true;
|
72 |
+
|
73 |
// Hide option elements
|
74 |
jQuery('#wppagallery-galery-type-tr').hide();
|
75 |
jQuery('#wppagallery-slides-type-tr').hide();
|
94 |
jQuery('#wppagallery-taglist-tr').hide();
|
95 |
jQuery('#wppagallery-album-super-tr').hide();
|
96 |
jQuery('#wppagallery-calendar-tr').hide();
|
97 |
+
jQuery('#wppagallery-tags-cats-tr').hide();
|
98 |
+
jQuery('#wppagallery-landing-tr').hide();
|
99 |
+
jQuery('#wppagallery-rootalbum-tr').hide();
|
100 |
|
101 |
// Init shortcode parts
|
102 |
var shortcode = '[wppa';
|
128 |
var taglist = '';
|
129 |
var owner = '';
|
130 |
var tags = '';
|
131 |
+
var cats = '';
|
132 |
var i,j,t;
|
133 |
var caltype = '';
|
134 |
var reverse = false;
|
135 |
var allopen = false;
|
136 |
+
var andor = false;
|
137 |
+
var sep = '';
|
138 |
+
var landing = '0';
|
139 |
+
var rootalbum = '0';
|
140 |
+
|
141 |
// Type
|
142 |
topType = jQuery('#wppagallery-top-type').attr('value');
|
143 |
switch ( topType ) {
|
192 |
switch ( type ) {
|
193 |
case 'search':
|
194 |
jQuery('#wppagallery-search-tr').show();
|
195 |
+
if ( jQuery('#wppagallery-root').attr('checked') == 'checked' ) jQuery('#wppagallery-rootalbum-tr').show();
|
196 |
+
rootalbum = jQuery('#wppagallery-rootalbum').val();
|
197 |
+
jQuery('#wppagallery-landing-tr').show();
|
198 |
+
landing = jQuery('#wppagallery-landing').val();
|
199 |
break;
|
200 |
case 'supersearch':
|
|
|
201 |
break;
|
202 |
case 'tagcloud':
|
203 |
case 'multitag':
|
277 |
}
|
278 |
else {
|
279 |
}
|
280 |
+
|
281 |
// Album
|
282 |
if ( needAlbum ) {
|
283 |
albumType = jQuery('#wppagallery-album-type').attr('value');
|
308 |
// and get the album identifier
|
309 |
if ( type == 'cover') {
|
310 |
jQuery('#wppagallery-album-virt-cover-tr').show();
|
311 |
+
album = jQuery('#wppagallery-album-virt-cover').attr('value');
|
312 |
}
|
313 |
else { // type != cover
|
314 |
jQuery('#wppagallery-album-virt-tr').show();
|
332 |
break;
|
333 |
case '#tags':
|
334 |
jQuery('#wppagallery-phototags-tr').show();
|
335 |
+
jQuery('#wppagallery-tags-cats-tr').show();
|
336 |
+
andor = jQuery('[name=andor]:checked').val();
|
337 |
+
if ( ! andor ) jQuery('#wppagallery-or').attr( 'checked', 'checked' );
|
338 |
+
andor = jQuery('[name=andor]:checked').val();
|
339 |
+
if ( andor == 'or' ) sep = ';';
|
340 |
+
else sep = ',';
|
341 |
needTag = true;
|
342 |
t = jQuery('.wppagallery-phototags');
|
343 |
var tagarr = [];
|
350 |
}
|
351 |
i++;
|
352 |
}
|
353 |
+
tags = wppaArrayToEnum( tagarr, sep );
|
354 |
if ( tags != '' ) {
|
355 |
jQuery('.wppagallery-phototags').css('color', '#070');
|
356 |
}
|
363 |
break;
|
364 |
case '#cat':
|
365 |
jQuery('#wppagallery-albumcat-tr').show();
|
366 |
+
jQuery('#wppagallery-tags-cats-tr').show();
|
367 |
+
andor = jQuery('[name=andor]:checked').val();
|
368 |
+
if ( ! andor ) jQuery('#wppagallery-or').attr( 'checked', 'checked' );
|
369 |
+
andor = jQuery('[name=andor]:checked').val();
|
370 |
+
if ( andor == 'or' ) sep = ';';
|
371 |
+
else sep = ',';
|
372 |
needCat = true;
|
373 |
+
t = jQuery('.wppagallery-albumcat');
|
374 |
+
var catarr = [];
|
375 |
+
i = 0;
|
376 |
+
j = 0;
|
377 |
+
while ( i < t.length ) {
|
378 |
+
if ( t[i].selected ) {
|
379 |
+
catarr[j] = t[i].value;
|
380 |
+
j++;
|
381 |
+
}
|
382 |
+
i++;
|
383 |
+
}
|
384 |
+
cats = wppaArrayToEnum( catarr, sep );
|
385 |
+
if ( cats != '' ) {
|
386 |
jQuery('#wppagallery-albumcat').css('color', '#070');
|
387 |
}
|
388 |
break;
|
403 |
default:
|
404 |
alert( 'Unimplemented virtual album: '+album );
|
405 |
}
|
406 |
+
if ( ( album != '#cat' || cats != '' ) &&
|
407 |
+
( album != '#owner' || owner != '' ) &&
|
408 |
( album != '#upldr' || owner != '' ) &&
|
409 |
( album != '#topten' || parent != '' ) &&
|
410 |
( album != '#lasten' || parent != '' ) &&
|
419 |
album = '';
|
420 |
}
|
421 |
}
|
422 |
+
|
423 |
// No album specified
|
424 |
if ( album == '' ) {
|
425 |
jQuery('#wppagallery-album-real').css('color', '#700');
|
426 |
jQuery('#wppagallery-album-virt').css('color', '#700');
|
427 |
jQuery('#wppagallery-album-virt-cover').css('color', '#700');
|
428 |
}
|
429 |
+
|
430 |
// Add album specs to shortcode
|
431 |
else {
|
432 |
jQuery('#wppagallery-album-real').css('color', '#070');
|
439 |
if ( parent != '' ) shortcode += ','+parent;
|
440 |
if ( count != '' ) shortcode += ','+count;
|
441 |
if ( tags != '' ) shortcode += ','+tags;
|
442 |
+
if ( cats != '' ) shortcode += ','+cats;
|
443 |
shortcode += '"';
|
444 |
}
|
445 |
+
|
446 |
// Photo
|
447 |
if ( needPhoto ) {
|
448 |
photo = jQuery('#wppagallery-photo').attr('value');
|
458 |
jQuery('#wppagallery-photo').css('color', '#070');
|
459 |
}
|
460 |
}
|
461 |
+
|
462 |
// Search options
|
463 |
if ( type == 'search' ) {
|
464 |
sub = jQuery('#wppagallery-sub').attr('checked');
|
465 |
root = jQuery('#wppagallery-root').attr('checked');
|
466 |
if ( sub == 'checked' ) shortcode += ' sub="1"';
|
467 |
+
if ( root == 'checked' ) {
|
468 |
+
if ( rootalbum != '0' ) shortcode += ' root="#'+rootalbum+'"';
|
469 |
+
else shortcode += ' root="1"';
|
470 |
+
}
|
471 |
+
if ( landing != '0' ) shortcode += ' landing="'+landing+'"';
|
472 |
}
|
473 |
if ( type == 'tagcloud' || type == 'multitag' ) {
|
474 |
if ( taglist != '' ) {
|
487 |
shortcode += ' all="1"';
|
488 |
}
|
489 |
}
|
490 |
+
|
491 |
// Size
|
492 |
var size = document.getElementById('wppagallery-size').value;
|
493 |
if ( size != '' && size != 'auto' ) {
|
504 |
if ( size != 0 ) {
|
505 |
shortcode += ' size="'+size+'"';
|
506 |
}
|
507 |
+
|
508 |
// Align
|
509 |
var align = document.getElementById('wppagallery-align').value;
|
510 |
if ( align != 'none' ) {
|
511 |
shortcode += ' align="'+align+'"';
|
512 |
}
|
513 |
+
|
514 |
// Extract comment
|
515 |
var t = document.getElementById('wppagallery-shortcode-preview').value;
|
516 |
t = t.replace(/"/g, '"');
|
521 |
|
522 |
// Close
|
523 |
shortcode += ']'+shortcodeComment+'[/wppa]';
|
524 |
+
|
525 |
// Display shortcode
|
526 |
shortcode = shortcode.replace(/"/g, '"');
|
527 |
var html = '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+shortcode+'" />';
|
528 |
document.getElementById('wppagallery-shortcode-preview-container').innerHTML = html;
|
529 |
+
|
530 |
// Is shortcode complete?
|
531 |
shortcodeOk = ( album != '' || ! needAlbum ) &&
|
532 |
( photo != '' || ! needPhoto ) &&
|
537 |
( searchType != '' || ! needSearchType ) &&
|
538 |
( miscType != '' || ! needMiscType ) &&
|
539 |
( tags != '' || ! needTag ) &&
|
540 |
+
( cats != '' || ! needCat );
|
541 |
+
|
542 |
// Debug
|
543 |
if ( ! shortcodeOk ) {
|
544 |
var text = '';
|
551 |
if ( searchType == '' && needSearchType ) text += 'Need searchType';
|
552 |
if ( miscType == '' && needMiscType ) text += 'Need miscType';
|
553 |
if ( tags == '' && needTag ) text += 'Need tags';
|
554 |
+
if ( cats == '' && needCat ) text += 'Need cats';
|
555 |
// alert( text );
|
556 |
}
|
557 |
+
|
558 |
// Display the right button
|
559 |
if ( shortcodeOk ) {
|
560 |
jQuery('#wppagallery-submit').show();
|
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¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
|
5 |
-
Version: 6.4.
|
6 |
-
Stable tag: 6.4.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -180,6 +180,20 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
|
|
180 |
|
181 |
See for additional information: http://wppa.opajaap.nl/changelog/
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
= 6.4.04 =
|
184 |
|
185 |
= Bug Fixes =
|
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¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
|
5 |
+
Version: 6.4.05
|
6 |
+
Stable tag: 6.4.04
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
180 |
|
181 |
See for additional information: http://wppa.opajaap.nl/changelog/
|
182 |
|
183 |
+
= 6.4.05 =
|
184 |
+
|
185 |
+
= Bug Fixes =
|
186 |
+
|
187 |
+
* Lightbox did not work on slideshow when it was set to ligtbox single image and there were no other links to lightbox. Fixed.
|
188 |
+
|
189 |
+
= Other Changes =
|
190 |
+
|
191 |
+
* Extended shortcode attribute: album="#cat,Category" now supports multiple categories:
|
192 |
+
album="#cat,Cat1;Cat2;Cat3" meaning all albums with category Cat1, Cat2 or Cat3.
|
193 |
+
album="#cat,Cat1,Cat2,Cat3" meaning all albums with category Cat1, Cat2 and Cat3.
|
194 |
+
* The search shortcode extensions introduced in version 6.4.03 are now supported by the shortcode generator.
|
195 |
+
* On hovering the lightbox image, all navigation buttons will fade-in and on leaving the image fad-out now rather than on the bottons themselves.
|
196 |
+
|
197 |
= 6.4.04 =
|
198 |
|
199 |
= Bug Fixes =
|
wppa-breadcrumb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -401,13 +401,13 @@ global $wppa_session;
|
|
401 |
}
|
402 |
elseif ( wppa( 'is_cat' ) ) { // Categorized albums
|
403 |
if ( wppa( 'is_slide' ) ) {
|
404 |
-
$value = __( 'Category:' , 'wp-photo-album-plus').' '.
|
405 |
$thumbhref = wppa_get_permalink().'wppa-cover=0&wppa-occur='.wppa( 'occur' ).'&wppa-cat='.wppa( 'is_cat' ).'&wppa-album='.wppa( 'start_album' );
|
406 |
$thumbajax = wppa_get_ajaxlink().'wppa-cover=0&wppa-occur='.wppa( 'occur' ).'&wppa-cat='.wppa( 'is_cat' ).'&wppa-album='.wppa( 'start_album' );
|
407 |
$title = __( 'View the thumbnails' , 'wp-photo-album-plus');
|
408 |
wppa_bcitem( $value, $thumbhref, $title, 'b8', $thumbajax );
|
409 |
}
|
410 |
-
$value = __( 'Category:' , 'wp-photo-album-plus').' '.
|
411 |
$href = '';
|
412 |
$title = '';
|
413 |
wppa_bcitem( $value, $href, $title, 'b9' );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
+
* Version 6.4.05
|
7 |
*
|
8 |
*/
|
9 |
|
401 |
}
|
402 |
elseif ( wppa( 'is_cat' ) ) { // Categorized albums
|
403 |
if ( wppa( 'is_slide' ) ) {
|
404 |
+
$value = __( 'Category:' , 'wp-photo-album-plus').' '.str_replace( ';', ' '.__( 'or', 'wp-photo-album-plus' ).' ', str_replace( ',', ' '.__( 'and', 'wp-photo-album-plus' ).' ', trim( wppa( 'is_cat' ), ',;' ) ) );
|
405 |
$thumbhref = wppa_get_permalink().'wppa-cover=0&wppa-occur='.wppa( 'occur' ).'&wppa-cat='.wppa( 'is_cat' ).'&wppa-album='.wppa( 'start_album' );
|
406 |
$thumbajax = wppa_get_ajaxlink().'wppa-cover=0&wppa-occur='.wppa( 'occur' ).'&wppa-cat='.wppa( 'is_cat' ).'&wppa-album='.wppa( 'start_album' );
|
407 |
$title = __( 'View the thumbnails' , 'wp-photo-album-plus');
|
408 |
wppa_bcitem( $value, $thumbhref, $title, 'b8', $thumbajax );
|
409 |
}
|
410 |
+
$value = __( 'Category:' , 'wp-photo-album-plus').' '.str_replace( ';', ' '.__( 'or', 'wp-photo-album-plus' ).' ', str_replace( ',', ' '.__( 'and', 'wp-photo-album-plus' ).' ', trim( wppa( 'is_cat' ), ',;' ) ) );
|
411 |
$href = '';
|
412 |
$title = '';
|
413 |
wppa_bcitem( $value, $href, $title, 'b9' );
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -365,26 +365,82 @@ global $wppa_session;
|
|
365 |
wppa( 'photos_only', true );
|
366 |
break;
|
367 |
case '#cat':
|
368 |
-
$
|
369 |
-
$
|
370 |
-
|
371 |
-
wppa( 'is_cat', $
|
372 |
-
if ( ! $
|
373 |
wppa_dbg_msg( 'Missing cat #cat album spec: ' . wppa( 'start_album' ), 'red', 'force' );
|
374 |
wppa_reset_occurrance();
|
375 |
return; // Forget this occurrance
|
376 |
}
|
|
|
|
|
377 |
$albs = $wpdb->get_results( "SELECT * FROM `".WPPA_ALBUMS."`", ARRAY_A );
|
378 |
wppa_dbg_q( 'Q-main-4' );
|
379 |
wppa_cache_album( 'add', $albs );
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
}
|
386 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
$id = rtrim( $id, '.' );
|
|
|
|
|
|
|
|
|
|
|
388 |
break;
|
389 |
case '#owner':
|
390 |
$temp = explode( ',', wppa( 'start_album' ) );
|
@@ -1978,7 +2034,7 @@ static $user;
|
|
1978 |
$result .= $name."','";
|
1979 |
$result .= $desc."','";
|
1980 |
$result .= wppa_encrypt_photo( $id )."','";
|
1981 |
-
wppa_dbg_msg('id='.$id, 'red');
|
1982 |
$result .= $avgrat."','";
|
1983 |
$result .= $distext."','";
|
1984 |
$result .= $myrat."','";
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
+
* Version 6.4.05
|
7 |
*
|
8 |
*/
|
9 |
|
365 |
wppa( 'photos_only', true );
|
366 |
break;
|
367 |
case '#cat':
|
368 |
+
$cats = substr( wppa( 'start_album' ), 5 );
|
369 |
+
$cats = trim( wppa_sanitize_tags( $cats, true ), ',;' );
|
370 |
+
|
371 |
+
wppa( 'is_cat', $cats );
|
372 |
+
if ( ! $cats ) {
|
373 |
wppa_dbg_msg( 'Missing cat #cat album spec: ' . wppa( 'start_album' ), 'red', 'force' );
|
374 |
wppa_reset_occurrance();
|
375 |
return; // Forget this occurrance
|
376 |
}
|
377 |
+
|
378 |
+
// Get all albums and cache its data
|
379 |
$albs = $wpdb->get_results( "SELECT * FROM `".WPPA_ALBUMS."`", ARRAY_A );
|
380 |
wppa_dbg_q( 'Q-main-4' );
|
381 |
wppa_cache_album( 'add', $albs );
|
382 |
+
|
383 |
+
// $cats is not empty. If it contains a , all cats must be met ( AND case )
|
384 |
+
// It may contain a ; any cat must be met
|
385 |
+
|
386 |
+
// AND case
|
387 |
+
if ( strpos( $cats, ',' ) !== false ) {
|
388 |
+
|
389 |
+
// Do not accept a mix of , and ; Convert ; to ,
|
390 |
+
$cats = str_replace( ';', ',', $cats );
|
391 |
+
$cats = explode( ',', $cats );
|
392 |
+
$id = '';
|
393 |
+
|
394 |
+
if ( $albs ) foreach ( $albs as $alb ) {
|
395 |
+
$albcats = explode( ',', $alb['cats'] );
|
396 |
+
|
397 |
+
// Assume in
|
398 |
+
$in = true;
|
399 |
+
|
400 |
+
// Test all required cats against album cats array
|
401 |
+
foreach( $cats as $cat ) {
|
402 |
+
if ( ! in_array( $cat, $albcats, true ) ) {
|
403 |
+
$in = false;
|
404 |
+
}
|
405 |
+
}
|
406 |
+
|
407 |
+
if ( $in ) {
|
408 |
+
$id .= $alb['id'].'.';
|
409 |
+
}
|
410 |
}
|
411 |
}
|
412 |
+
|
413 |
+
// OR case
|
414 |
+
else {
|
415 |
+
$cats = explode( ';', $cats );
|
416 |
+
$id = '';
|
417 |
+
|
418 |
+
if ( $albs ) foreach ( $albs as $alb ) {
|
419 |
+
$albcats = explode( ',', $alb['cats'] );
|
420 |
+
|
421 |
+
// Assume out
|
422 |
+
$in = false;
|
423 |
+
|
424 |
+
// Test all possible cats against album cats array
|
425 |
+
foreach( $cats as $cat ) {
|
426 |
+
if ( in_array( $cat, $albcats, true ) ) {
|
427 |
+
$in = true;
|
428 |
+
}
|
429 |
+
}
|
430 |
+
|
431 |
+
if ( $in ) {
|
432 |
+
$id .= $alb['id'].'.';
|
433 |
+
}
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
// Remove possible trailing dot
|
438 |
$id = rtrim( $id, '.' );
|
439 |
+
|
440 |
+
// Add children?
|
441 |
+
if ( wppa_switch( 'cats_inherit' ) ) {
|
442 |
+
$id = wppa_alb_to_enum_children( $id );
|
443 |
+
}
|
444 |
break;
|
445 |
case '#owner':
|
446 |
$temp = explode( ',', wppa( 'start_album' ) );
|
2034 |
$result .= $name."','";
|
2035 |
$result .= $desc."','";
|
2036 |
$result .= wppa_encrypt_photo( $id )."','";
|
2037 |
+
//wppa_dbg_msg('id='.$id, 'red');
|
2038 |
$result .= $avgrat."','";
|
2039 |
$result .= $distext."','";
|
2040 |
$result .= $myrat."','";
|
wppa-items.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -411,8 +411,12 @@ function wppa_get_album_name( $id, $extended = false ) {
|
|
411 |
return '';
|
412 |
}
|
413 |
else {
|
414 |
-
if ( ! $album )
|
415 |
-
|
|
|
|
|
|
|
|
|
416 |
}
|
417 |
|
418 |
// To prevent recursive rendering of scripts or shortcodes:
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
+
* Version 6.4.05
|
7 |
*
|
8 |
*/
|
9 |
|
411 |
return '';
|
412 |
}
|
413 |
else {
|
414 |
+
if ( ! $album ) {
|
415 |
+
$name = __( '--- deleted ---', 'wp-photo-album-plus');
|
416 |
+
}
|
417 |
+
else {
|
418 |
+
$name = __( stripslashes( $album['name'] ) );
|
419 |
+
}
|
420 |
}
|
421 |
|
422 |
// To prevent recursive rendering of scripts or shortcodes:
|
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.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -210,7 +210,12 @@ global $wppa_opt;
|
|
210 |
// If the minified version is available, it will be loaded, else the normal version.
|
211 |
// If you want to debug js, just delete the minified version; this will cause the normal
|
212 |
// - readable - version to be loaded.
|
213 |
-
|
|
|
|
|
|
|
|
|
|
|
214 |
|
215 |
$js_files = array ( 'wppa',
|
216 |
'wppa-slideshow',
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
+
* Version 6.4.05
|
7 |
*
|
8 |
*/
|
9 |
|
210 |
// If the minified version is available, it will be loaded, else the normal version.
|
211 |
// If you want to debug js, just delete the minified version; this will cause the normal
|
212 |
// - readable - version to be loaded.
|
213 |
+
|
214 |
+
$any_lightbox = ( wppa_opt( 'lightbox_name' ) == 'wppa' ) &&
|
215 |
+
( wppa_switch( 'lightbox_global' ) ||
|
216 |
+
in_array( 'lightbox', $wppa_opt ) ||
|
217 |
+
in_array( 'lightboxsingle', $wppa_opt )
|
218 |
+
);
|
219 |
|
220 |
$js_files = array ( 'wppa',
|
221 |
'wppa-slideshow',
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -55,6 +55,17 @@ global $wppa_tags;
|
|
55 |
// echo '<!-- End Test area ---><br />';
|
56 |
// End test area
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
// Initialize
|
59 |
wppa_initialize_runtime( true );
|
60 |
$options_error = false;
|
@@ -3951,6 +3962,16 @@ global $wppa_tags;
|
|
3951 |
$clas = 'wppa_imgfact_';
|
3952 |
$tags = 'cover,layout';
|
3953 |
wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3954 |
}
|
3955 |
wppa_setting_subheader( 'E', '1', __( 'Rating related settings' , 'wp-photo-album-plus') );
|
3956 |
{
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 6.4.05
|
7 |
*
|
8 |
*/
|
9 |
|
55 |
// echo '<!-- End Test area ---><br />';
|
56 |
// End test area
|
57 |
|
58 |
+
// Verify some urls; set to default if empty
|
59 |
+
if ( ! $wppa_opt['wppa_start_symbol_url'] ) {
|
60 |
+
wppa_update_option( 'wppa_start_symbol_url', wppa_get_imgdir( 'start.png', 'abs' ) );
|
61 |
+
}
|
62 |
+
if ( ! $wppa_opt['wppa_pause_symbol_url'] ) {
|
63 |
+
wppa_update_option( 'wppa_pause_symbol_url', wppa_get_imgdir( 'pause.png', 'abs' ) );
|
64 |
+
}
|
65 |
+
if ( ! $wppa_opt['wppa_stop_symbol_url'] ) {
|
66 |
+
wppa_update_option( 'wppa_stop_symbol_url', wppa_get_imgdir( 'stop.png', 'abs' ) );
|
67 |
+
}
|
68 |
+
|
69 |
// Initialize
|
70 |
wppa_initialize_runtime( true );
|
71 |
$options_error = false;
|
3962 |
$clas = 'wppa_imgfact_';
|
3963 |
$tags = 'cover,layout';
|
3964 |
wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags);
|
3965 |
+
|
3966 |
+
$name = __('Cats inherit', 'wp-photo-album-plus');
|
3967 |
+
$desc = __('Child albums seem to have the parents Categories', 'wp-photo-album-plus');
|
3968 |
+
$help = esc_js(__('When you use album="#cat,...", in a shortcode, the child albums will be included.', 'wp-photo-album-plus'));
|
3969 |
+
$slug = 'wppa_cats_inherit';
|
3970 |
+
$html = wppa_checkbox($slug);
|
3971 |
+
$clas = '';
|
3972 |
+
$tags = 'album,cover,meta';
|
3973 |
+
wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
|
3974 |
+
|
3975 |
}
|
3976 |
wppa_setting_subheader( 'E', '1', __( 'Rating related settings' , 'wp-photo-album-plus') );
|
3977 |
{
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -979,6 +979,7 @@ Hide Camera info
|
|
979 |
'wppa_cover_opacity' => '85',
|
980 |
'wppa_cover_type' => 'default',
|
981 |
'wppa_imgfact_count' => '10',
|
|
|
982 |
// E Rating
|
983 |
'wppa_rating_login' => 'yes',
|
984 |
'wppa_rating_change' => 'yes',
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 6.4.05
|
7 |
*
|
8 |
*/
|
9 |
|
979 |
'wppa_cover_opacity' => '85',
|
980 |
'wppa_cover_type' => 'default',
|
981 |
'wppa_imgfact_count' => '10',
|
982 |
+
'wppa_cats_inherit' => 'no',
|
983 |
// E Rating
|
984 |
'wppa_rating_login' => 'yes',
|
985 |
'wppa_rating_change' => 'yes',
|
wppa-tinymce-shortcodes.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
*
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -82,8 +82,32 @@ global $wpdb;
|
|
82 |
$tags = wppa_get_taglist();
|
83 |
$cats = wppa_get_catlist();
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
// Make the html
|
86 |
$result =
|
|
|
87 |
'<div id="wppagallery-form">'.
|
88 |
'<style type="text/css">'.
|
89 |
'#wppagallery-table tr, #wppagallery-table th, #wppagallery-table td {'.
|
@@ -201,7 +225,7 @@ global $wpdb;
|
|
201 |
'<option value="#lasten" >'.__('The most recently uploaded photos', 'wp-photo-album-plus').'</option>'.
|
202 |
'<option value="#featen" >'.__('A random selection of featured photos', 'wp-photo-album-plus').'</option>'.
|
203 |
'<option value="#comten" >'.__('The most recently commented photos', 'wp-photo-album-plus').'</option>'.
|
204 |
-
'<option value="#tags" >'.__('Photos
|
205 |
'<option value="#cat" >'.__('Albums tagged with a certain category', 'wp-photo-album-plus').'</option>'.
|
206 |
'<option value="#owner" >'.__('Photos in albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
|
207 |
'<option value="#upldr" >'.__('Photos uploaded by a certain user', 'wp-photo-album-plus').'</option>'.
|
@@ -218,7 +242,7 @@ global $wpdb;
|
|
218 |
'<option value="" disabled="disabled" selected="selected" style="color:#700" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
|
219 |
'<option value="#last" >'.__('The most recently modified album', 'wp-photo-album-plus').'</option>'.
|
220 |
'<option value="#owner" >'.__('Albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
|
221 |
-
'<option value="#cat" >'.__('Albums tagged with
|
222 |
'<option value="#all" >'.__('All albums in the system', 'wp-photo-album-plus').'</option>'.
|
223 |
'</select>'.
|
224 |
'</td>'.
|
@@ -237,7 +261,7 @@ global $wpdb;
|
|
237 |
// All standard albums
|
238 |
foreach ( $albums as $album ) {
|
239 |
$id = $album['id'];
|
240 |
-
$result .= '<option class="wppagallery-album-r" value="' . $id . '" >'.stripslashes( __( $album['name']
|
241 |
}
|
242 |
}
|
243 |
else {
|
@@ -260,7 +284,7 @@ global $wpdb;
|
|
260 |
// All standard albums
|
261 |
foreach ( $albums as $album ) {
|
262 |
$id = $album['id'];
|
263 |
-
$result .= '<option class="wppagallery-album-ropt" style="color:#070" value="' . $id . '" >'.stripslashes( __( $album['name']
|
264 |
}
|
265 |
}
|
266 |
else {
|
@@ -305,7 +329,7 @@ global $wpdb;
|
|
305 |
// All standard albums
|
306 |
foreach ( $albums as $album ) {
|
307 |
$id = $album['id'];
|
308 |
-
$result .= '<option class="wppagallery-album-p" value="'.$id.'" >'.stripslashes(__($album['name']
|
309 |
}
|
310 |
}
|
311 |
else {
|
@@ -328,7 +352,7 @@ global $wpdb;
|
|
328 |
// All standard albums
|
329 |
foreach ( $albums as $album ) {
|
330 |
$id = $album['id'];
|
331 |
-
$result .= '<option class="wppagallery-album" value="'.$id.'" >'.stripslashes(__($album['name']
|
332 |
}
|
333 |
}
|
334 |
else {
|
@@ -354,14 +378,14 @@ global $wpdb;
|
|
354 |
'</td>'.
|
355 |
'</tr>'.
|
356 |
|
357 |
-
// Albums with certain
|
358 |
'<tr id="wppagallery-albumcat-tr" style="display:none;" >'.
|
359 |
-
'<th><label for="wppagallery-albumcat">'.__('The cat
|
360 |
'<td>'.
|
361 |
-
'<select id="wppagallery-albumcat" style="color:#700;" onchange="wppaGalleryEvaluate()">'.
|
362 |
'<option value="" disabled="disabled" selected="selected" style="color:#700" >'.__('--- please select category ---', 'wp-photo-album-plus').'</option>';
|
363 |
if ( $cats ) foreach ( array_keys( $cats ) as $cat ) {
|
364 |
-
$result .= '<option value="'.$cat.'" >'.$cat.'</option>';
|
365 |
}
|
366 |
$result .=
|
367 |
'</select>'.
|
@@ -380,7 +404,7 @@ global $wpdb;
|
|
380 |
|
381 |
// Most recent 100 photos
|
382 |
foreach ( $photos as $photo ) {
|
383 |
-
$name = stripslashes(__($photo['name']
|
384 |
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
385 |
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
386 |
$result .= '<option value="'.wppa_fix_poster_ext($photo['id'].'.'.$photo['ext'], $photo['id']).'" >'.$name.' ('.wppa_get_album_name($photo['album']).')'.'</option>';
|
@@ -414,7 +438,7 @@ global $wpdb;
|
|
414 |
|
415 |
// Photos with certain tags
|
416 |
'<tr id="wppagallery-phototags-tr" style="display:none;" >'.
|
417 |
-
'<th><label for="wppagallery-phototags">'.__('The
|
418 |
'<td>'.
|
419 |
'<select id="wppagallery-phototags" style="color:#700;" multiple="multiple" onchange="wppaGalleryEvaluate()">'.
|
420 |
'<option value="" disabled="disabled" selected="selected" style="color:#700" >'.__('--- please select tag(s) ---', 'wp-photo-album-plus').'</option>';
|
@@ -426,6 +450,15 @@ global $wpdb;
|
|
426 |
'</td>'.
|
427 |
'</tr>'.
|
428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
// Search additional settings
|
430 |
'<tr id="wppagallery-search-tr" style="display:none;" >'.
|
431 |
'<th><label>'.__('Additional features:', 'wp-photo-album-plus').'</label></th>'.
|
@@ -435,6 +468,45 @@ global $wpdb;
|
|
435 |
'</td>'.
|
436 |
'</tr>'.
|
437 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
// Tagcloud/list additional settings
|
439 |
'<tr id="wppagallery-taglist-tr" style="display:none;" >'.
|
440 |
'<th><label>'.__('Additional features:', 'wp-photo-album-plus').'</label></th>'.
|
@@ -467,7 +539,7 @@ global $wpdb;
|
|
467 |
// All standard albums
|
468 |
foreach ( $albums as $album ) {
|
469 |
$id = $album['id'];
|
470 |
-
$result .= '<option class="wppagallery-album" value="'.$id.'" >'.stripslashes(__($album['name']
|
471 |
}
|
472 |
}
|
473 |
else {
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
*
|
6 |
+
* Version 6.4.05
|
7 |
*
|
8 |
*/
|
9 |
|
82 |
$tags = wppa_get_taglist();
|
83 |
$cats = wppa_get_catlist();
|
84 |
|
85 |
+
// Pages suitable for landing
|
86 |
+
$query = "SELECT ID, post_title, post_content, post_parent " .
|
87 |
+
"FROM " . $wpdb->posts . " " .
|
88 |
+
"WHERE post_type = 'page' AND post_status = 'publish' " .
|
89 |
+
"ORDER BY post_title ASC";
|
90 |
+
$pages = $wpdb->get_results( $query, ARRAY_A );
|
91 |
+
|
92 |
+
if ( $pages ) {
|
93 |
+
|
94 |
+
// Add parents optionally OR translate only
|
95 |
+
if ( wppa_switch( 'wppa_hier_pagesel' ) ) $pages = wppa_add_parents( $pages );
|
96 |
+
|
97 |
+
// Just translate
|
98 |
+
else {
|
99 |
+
foreach ( array_keys( $pages ) as $index ) {
|
100 |
+
$pages[$index]['post_title'] = __( stripslashes($pages[$index]['post_title'] ) );
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
// Sort alpahbetically
|
105 |
+
$pages = wppa_array_sort( $pages, 'post_title' );
|
106 |
+
}
|
107 |
+
|
108 |
// Make the html
|
109 |
$result =
|
110 |
+
'<style>#TB_ajaxContent {box-sizing:border-box; width:100% !important;}</style>'.
|
111 |
'<div id="wppagallery-form">'.
|
112 |
'<style type="text/css">'.
|
113 |
'#wppagallery-table tr, #wppagallery-table th, #wppagallery-table td {'.
|
225 |
'<option value="#lasten" >'.__('The most recently uploaded photos', 'wp-photo-album-plus').'</option>'.
|
226 |
'<option value="#featen" >'.__('A random selection of featured photos', 'wp-photo-album-plus').'</option>'.
|
227 |
'<option value="#comten" >'.__('The most recently commented photos', 'wp-photo-album-plus').'</option>'.
|
228 |
+
'<option value="#tags" >'.__('Photos tagged with certain tags', 'wp-photo-album-plus').'</option>'.
|
229 |
'<option value="#cat" >'.__('Albums tagged with a certain category', 'wp-photo-album-plus').'</option>'.
|
230 |
'<option value="#owner" >'.__('Photos in albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
|
231 |
'<option value="#upldr" >'.__('Photos uploaded by a certain user', 'wp-photo-album-plus').'</option>'.
|
242 |
'<option value="" disabled="disabled" selected="selected" style="color:#700" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
|
243 |
'<option value="#last" >'.__('The most recently modified album', 'wp-photo-album-plus').'</option>'.
|
244 |
'<option value="#owner" >'.__('Albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
|
245 |
+
'<option value="#cat" >'.__('Albums tagged with certain categories', 'wp-photo-album-plus').'</option>'.
|
246 |
'<option value="#all" >'.__('All albums in the system', 'wp-photo-album-plus').'</option>'.
|
247 |
'</select>'.
|
248 |
'</td>'.
|
261 |
// All standard albums
|
262 |
foreach ( $albums as $album ) {
|
263 |
$id = $album['id'];
|
264 |
+
$result .= '<option class="wppagallery-album-r" value="' . $id . '" >'.stripslashes( __( $album['name'] ) ) . ' (' . $id . ')</option>';
|
265 |
}
|
266 |
}
|
267 |
else {
|
284 |
// All standard albums
|
285 |
foreach ( $albums as $album ) {
|
286 |
$id = $album['id'];
|
287 |
+
$result .= '<option class="wppagallery-album-ropt" style="color:#070" value="' . $id . '" >'.stripslashes( __( $album['name'] ) ) . ' (' . $id . ')</option>';
|
288 |
}
|
289 |
}
|
290 |
else {
|
329 |
// All standard albums
|
330 |
foreach ( $albums as $album ) {
|
331 |
$id = $album['id'];
|
332 |
+
$result .= '<option class="wppagallery-album-p" value="'.$id.'" >'.stripslashes(__($album['name'])).' ('.$id.')</option>';
|
333 |
}
|
334 |
}
|
335 |
else {
|
352 |
// All standard albums
|
353 |
foreach ( $albums as $album ) {
|
354 |
$id = $album['id'];
|
355 |
+
$result .= '<option class="wppagallery-album" value="'.$id.'" >'.stripslashes(__($album['name'])).' ('.$id.')</option>';
|
356 |
}
|
357 |
}
|
358 |
else {
|
378 |
'</td>'.
|
379 |
'</tr>'.
|
380 |
|
381 |
+
// Albums with certain cats
|
382 |
'<tr id="wppagallery-albumcat-tr" style="display:none;" >'.
|
383 |
+
'<th><label for="wppagallery-albumcat">'.__('The album cat(s):', 'wp-photo-album-plus').'</label></th>'.
|
384 |
'<td>'.
|
385 |
+
'<select id="wppagallery-albumcat" style="color:#700;" onchange="wppaGalleryEvaluate()" multiple="multiple" >'.
|
386 |
'<option value="" disabled="disabled" selected="selected" style="color:#700" >'.__('--- please select category ---', 'wp-photo-album-plus').'</option>';
|
387 |
if ( $cats ) foreach ( array_keys( $cats ) as $cat ) {
|
388 |
+
$result .= '<option class="wppagallery-albumcat" value="'.$cat.'" >'.$cat.'</option>';
|
389 |
}
|
390 |
$result .=
|
391 |
'</select>'.
|
404 |
|
405 |
// Most recent 100 photos
|
406 |
foreach ( $photos as $photo ) {
|
407 |
+
$name = stripslashes(__($photo['name']));
|
408 |
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
409 |
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
410 |
$result .= '<option value="'.wppa_fix_poster_ext($photo['id'].'.'.$photo['ext'], $photo['id']).'" >'.$name.' ('.wppa_get_album_name($photo['album']).')'.'</option>';
|
438 |
|
439 |
// Photos with certain tags
|
440 |
'<tr id="wppagallery-phototags-tr" style="display:none;" >'.
|
441 |
+
'<th><label for="wppagallery-phototags">'.__('The photo tag(s):', 'wp-photo-album-plus').'</label></th>'.
|
442 |
'<td>'.
|
443 |
'<select id="wppagallery-phototags" style="color:#700;" multiple="multiple" onchange="wppaGalleryEvaluate()">'.
|
444 |
'<option value="" disabled="disabled" selected="selected" style="color:#700" >'.__('--- please select tag(s) ---', 'wp-photo-album-plus').'</option>';
|
450 |
'</td>'.
|
451 |
'</tr>'.
|
452 |
|
453 |
+
// Tags and cats additional settings
|
454 |
+
'<tr id="wppagallery-tags-cats-tr" style="display:none;" >'.
|
455 |
+
'<th><label>'.__('Or / And:', 'wp-photo-album-plus').'</label></th>'.
|
456 |
+
'<td>'.
|
457 |
+
'<input id="wppagallery-or" type="radio" name="andor" value="or" onchange="wppaGalleryEvaluate()"/>'.__('Meet any', 'wp-photo-album-plus').' '.
|
458 |
+
'<input id="wppagallery-and" type="radio" name="andor" value="and" onchange="wppaGalleryEvaluate()"/>'.__('Meet all', 'wp-photo-album-plus').
|
459 |
+
'</td>'.
|
460 |
+
'</tr>'.
|
461 |
+
|
462 |
// Search additional settings
|
463 |
'<tr id="wppagallery-search-tr" style="display:none;" >'.
|
464 |
'<th><label>'.__('Additional features:', 'wp-photo-album-plus').'</label></th>'.
|
468 |
'</td>'.
|
469 |
'</tr>'.
|
470 |
|
471 |
+
// Optiona root album
|
472 |
+
'<tr id="wppagallery-rootalbum-tr" style="display:none;" >'.
|
473 |
+
'<th><label>'.__('Search root:', 'wp-photo-album-plus').'</label></th>'.
|
474 |
+
'<td>'.
|
475 |
+
'<select id="wppagallery-rootalbum" style="color:#070" onchange="wppaGalleryEvaluate()" >'.
|
476 |
+
'<option value="0" selected="selected" >'.__('--- default ---', 'wp-photo-album-plus').'</option>';
|
477 |
+
if ( $albums ) {
|
478 |
+
|
479 |
+
// All standard albums
|
480 |
+
foreach ( $albums as $album ) {
|
481 |
+
$id = $album['id'];
|
482 |
+
$result .= '<option class="wppagallery-rootalbum" value="'.$id.'" >'.stripslashes(__($album['name'])).' ('.$id.')</option>';
|
483 |
+
}
|
484 |
+
}
|
485 |
+
$result .=
|
486 |
+
'</select>'.
|
487 |
+
'</td>'.
|
488 |
+
'</tr>'.
|
489 |
+
|
490 |
+
// Landing page
|
491 |
+
'<tr id="wppagallery-landing-tr" style="display:none;" >'.
|
492 |
+
'<th><label>'.__('Landing page:', 'wp-photo-album-plus').'</label></th>'.
|
493 |
+
'<td>'.
|
494 |
+
'<select id="wppagallery-landing" style="color:#070" onchange="wppaGalleryEvaluate()" >'.
|
495 |
+
'<option value="0" selected="selected" >'.__('--- default ---', 'wp-photo-album-plus').'</option>';
|
496 |
+
if ( $pages ) {
|
497 |
+
foreach( $pages as $page ) {
|
498 |
+
$dis = '';
|
499 |
+
if ( strpos( $page['post_content'], '[wppa' ) === false ) {
|
500 |
+
$dis = ' disabled="disabled"';
|
501 |
+
}
|
502 |
+
$result .= '<option value="'.$page['ID'].'"'.$dis.' >'.__( $page['post_title'] ).'</option>';
|
503 |
+
}
|
504 |
+
}
|
505 |
+
$result .=
|
506 |
+
'</select>'.
|
507 |
+
'</td>'.
|
508 |
+
'</tr>'.
|
509 |
+
|
510 |
// Tagcloud/list additional settings
|
511 |
'<tr id="wppagallery-taglist-tr" style="display:none;" >'.
|
512 |
'<th><label>'.__('Additional features:', 'wp-photo-album-plus').'</label></th>'.
|
539 |
// All standard albums
|
540 |
foreach ( $albums as $album ) {
|
541 |
$id = $album['id'];
|
542 |
+
$result .= '<option class="wppagallery-album" value="'.$id.'" >'.stripslashes(__($album['name'])).' ('.$id.')</option>';
|
543 |
}
|
544 |
}
|
545 |
else {
|
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.4.
|
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/
|
@@ -34,7 +34,7 @@ global $wppa_revno; $wppa_revno = '6404';
|
|
34 |
/* This is the api interface version number
|
35 |
/* It is incremented at any code change.
|
36 |
*/
|
37 |
-
global $wppa_api_version; $wppa_api_version = '6-4-
|
38 |
|
39 |
/* start timers */
|
40 |
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.4.05
|
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/
|
34 |
/* This is the api interface version number
|
35 |
/* It is incremented at any code change.
|
36 |
*/
|
37 |
+
global $wppa_api_version; $wppa_api_version = '6-4-05-002';
|
38 |
|
39 |
/* start timers */
|
40 |
global $wppa_starttime; $wppa_starttime = microtime(true);
|