WP Photo Album Plus - Version 8.0.10.006

Version Description

= 8.0.10 =

  • This version addresses various bug fixes, feature requests and security fixes.
Download this release

Release Info

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

Code changes from version 8.1.00.007 to 8.0.10.006

Files changed (54) hide show
  1. changelog.txt +0 -8
  2. {vendor/cloudinary → cloudinary}/README.md +0 -0
  3. {vendor/cloudinary → cloudinary}/index.php +0 -0
  4. {vendor/cloudinary → cloudinary}/src/Api.php +0 -0
  5. {vendor/cloudinary → cloudinary}/src/Cloudinary.php +0 -0
  6. {vendor/cloudinary → cloudinary}/src/Uploader.php +0 -0
  7. {vendor/cloudinary → cloudinary}/src/cacert.pem +0 -0
  8. js/sortable.js +0 -1550
  9. js/sortable.min.js +0 -9
  10. js/wppa-admin-scripts.js +28 -167
  11. js/wppa-admin-scripts.min.js +1 -1
  12. js/wppa-all.js +1 -1
  13. js/wppa-gutenberg-wppa.js +18 -21
  14. js/wppa.js +13 -27
  15. js/wppa.min.js +1 -1
  16. theme/wppa-style.css +1 -16
  17. wppa-admin-functions.php +16 -2
  18. wppa-admin-styles.css +1 -178
  19. wppa-admin.php +29 -86
  20. wppa-ajax-front.php +30 -0
  21. wppa-ajax.php +19 -6
  22. wppa-album-admin-autosave.php +105 -75
  23. wppa-album-navigator-widget.php +10 -1
  24. wppa-boxes-html.php +46 -10
  25. wppa-cache.php +2 -2
  26. wppa-cloudinary.php +4 -4
  27. wppa-comment-admin.php +56 -17
  28. wppa-common-functions.php +2 -2
  29. wppa-date-time.php +38 -5
  30. wppa-defaults.php +11 -11
  31. wppa-encrypt.php +1 -1
  32. wppa-export.php +4 -4
  33. wppa-filter.php +10 -6
  34. wppa-functions.php +10 -13
  35. wppa-gutenberg-wppa.php +15 -15
  36. wppa-import.php +12 -5
  37. wppa-init.php +6 -19
  38. wppa-input.php +13 -39
  39. wppa-items.php +2 -2
  40. wppa-links.php +20 -4
  41. wppa-maintenance.php +39 -31
  42. wppa-non-admin.php +68 -44
  43. wppa-photo-admin-autosave.php +240 -72
  44. wppa-scripts.php +628 -628
  45. wppa-settings-autosave.php +137 -28
  46. wppa-setup.php +1 -2
  47. wppa-slideshow.php +9 -3
  48. wppa-styles.php +14 -4
  49. wppa-tinymce-common.php +77 -3
  50. wppa-tinymce-shortcodes.php +17 -1
  51. wppa-upload.php +18 -11
  52. wppa-utils.php +136 -53
  53. wppa-wrappers.php +4 -5
  54. wppa.php +2 -2
changelog.txt CHANGED
@@ -1,13 +1,5 @@
1
  WP Photo Album Plus Changelog
2
 
3
- = 8.1.00 =
4
-
5
- * Many changes to comply with the wp coding standards to improve security:
6
- - Removed ajax method 'Classic' as it used a method that is not allowed.
7
- - Javascript is now always deferred (Removed Advanced settings -> System I -> Item 11: Defer javascript),
8
- in order to use the prescribed method for inline javascript.
9
- - Drpped all custom style items in Advanced settings -> System -> I. Use wp customized instead.
10
-
11
  = 8.0.10 =
12
 
13
  * Security fix: The logfile was prone to XSS attacks. Fixed.
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
 
 
3
  = 8.0.10 =
4
 
5
  * Security fix: The logfile was prone to XSS attacks. Fixed.
{vendor/cloudinary → cloudinary}/README.md RENAMED
File without changes
{vendor/cloudinary → cloudinary}/index.php RENAMED
File without changes
{vendor/cloudinary → cloudinary}/src/Api.php RENAMED
File without changes
{vendor/cloudinary → cloudinary}/src/Cloudinary.php RENAMED
File without changes
{vendor/cloudinary → cloudinary}/src/Uploader.php RENAMED
File without changes
{vendor/cloudinary → cloudinary}/src/cacert.pem RENAMED
File without changes
js/sortable.js DELETED
@@ -1,1550 +0,0 @@
1
- /*!
2
- * jQuery UI Sortable 1.12.1
3
- * http://jqueryui.com
4
- *
5
- * Copyright jQuery Foundation and other contributors
6
- * Released under the MIT license.
7
- * http://jquery.org/license
8
- */
9
-
10
- //>>label: Sortable
11
- //>>group: Interactions
12
- //>>description: Enables items in a list to be sorted using the mouse.
13
- //>>docs: http://api.jqueryui.com/sortable/
14
- //>>demos: http://jqueryui.com/sortable/
15
- //>>css.structure: ../../themes/base/sortable.css
16
-
17
- ( function( factory ) {
18
- if ( typeof define === "function" && define.amd ) {
19
-
20
- // AMD. Register as an anonymous module.
21
- define( [
22
- "jquery",
23
- "./mouse",
24
- "./core"
25
- ], factory );
26
- } else {
27
-
28
- // Browser globals
29
- factory( jQuery );
30
- }
31
- }( function( $ ) {
32
-
33
- return $.widget( "ui.sortable", $.ui.mouse, {
34
- version: "1.12.1",
35
- widgetEventPrefix: "sort",
36
- ready: false,
37
- options: {
38
- appendTo: "parent",
39
- axis: false,
40
- connectWith: false,
41
- containment: false,
42
- cursor: "auto",
43
- cursorAt: false,
44
- dropOnEmpty: true,
45
- forcePlaceholderSize: false,
46
- forceHelperSize: false,
47
- grid: false,
48
- handle: false,
49
- helper: "original",
50
- items: "> *",
51
- opacity: false,
52
- placeholder: false,
53
- revert: false,
54
- scroll: true,
55
- scrollSensitivity: 20,
56
- scrollSpeed: 20,
57
- scope: "default",
58
- tolerance: "intersect",
59
- zIndex: 1000,
60
-
61
- // Callbacks
62
- activate: null,
63
- beforeStop: null,
64
- change: null,
65
- deactivate: null,
66
- out: null,
67
- over: null,
68
- receive: null,
69
- remove: null,
70
- sort: null,
71
- start: null,
72
- stop: null,
73
- update: null
74
- },
75
-
76
- _isOverAxis: function( x, reference, size ) {
77
- return ( x >= reference ) && ( x < ( reference + size ) );
78
- },
79
-
80
- _isFloating: function( item ) {
81
- return ( /left|right/ ).test( item.css( "float" ) ) ||
82
- ( /inline|table-cell/ ).test( item.css( "display" ) );
83
- },
84
-
85
- _create: function() {
86
- this.containerCache = {};
87
- this._addClass( "ui-sortable" );
88
-
89
- //Get the items
90
- this.refresh();
91
-
92
- //Let's determine the parent's offset
93
- this.offset = this.element.offset();
94
-
95
- //Initialize mouse events for interaction
96
- this._mouseInit();
97
-
98
- this._setHandleClassName();
99
-
100
- //We're ready to go
101
- this.ready = true;
102
-
103
- },
104
-
105
- _setOption: function( key, value ) {
106
- this._super( key, value );
107
-
108
- if ( key === "handle" ) {
109
- this._setHandleClassName();
110
- }
111
- },
112
-
113
- _setHandleClassName: function() {
114
- var that = this;
115
- this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
116
- $.each( this.items, function() {
117
- that._addClass(
118
- this.instance.options.handle ?
119
- this.item.find( this.instance.options.handle ) :
120
- this.item,
121
- "ui-sortable-handle"
122
- );
123
- } );
124
- },
125
-
126
- _destroy: function() {
127
- this._mouseDestroy();
128
-
129
- for ( var i = this.items.length - 1; i >= 0; i-- ) {
130
- this.items[ i ].item.removeData( this.widgetName + "-item" );
131
- }
132
-
133
- return this;
134
- },
135
-
136
- _mouseCapture: function( event, overrideHandle ) {
137
- var currentItem = null,
138
- validHandle = false,
139
- that = this;
140
-
141
- if ( this.reverting ) {
142
- return false;
143
- }
144
-
145
- if ( this.options.disabled || this.options.type === "static" ) {
146
- return false;
147
- }
148
-
149
- //We have to refresh the items data once first
150
- this._refreshItems( event );
151
-
152
- //Find out if the clicked node (or one of its parents) is a actual item in this.items
153
- $( event.target ).parents().each( function() {
154
- if ( $.data( this, that.widgetName + "-item" ) === that ) {
155
- currentItem = $( this );
156
- return false;
157
- }
158
- } );
159
- if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
160
- currentItem = $( event.target );
161
- }
162
-
163
- if ( !currentItem ) {
164
- return false;
165
- }
166
- if ( this.options.handle && !overrideHandle ) {
167
- $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
168
- if ( this === event.target ) {
169
- validHandle = true;
170
- }
171
- } );
172
- if ( !validHandle ) {
173
- return false;
174
- }
175
- }
176
-
177
- this.currentItem = currentItem;
178
- this._removeCurrentsFromItems();
179
- return true;
180
-
181
- },
182
-
183
- _mouseStart: function( event, overrideHandle, noActivation ) {
184
-
185
- var i, body,
186
- o = this.options;
187
-
188
- this.currentContainer = this;
189
-
190
- //We only need to call refreshPositions, because the refreshItems call has been moved to
191
- // mouseCapture
192
- this.refreshPositions();
193
-
194
- //Create and append the visible helper
195
- this.helper = this._createHelper( event );
196
-
197
- //Cache the helper size
198
- this._cacheHelperProportions();
199
-
200
- /*
201
- * - Position generation -
202
- * This block generates everything position related - it's the core of draggables.
203
- */
204
-
205
- //Cache the margins of the original element
206
- this._cacheMargins();
207
-
208
- //Get the next scrolling parent
209
- this.scrollParent = this.helper.scrollParent();
210
-
211
- //The element's absolute position on the page minus margins
212
- this.offset = this.currentItem.offset();
213
- this.offset = {
214
- top: this.offset.top - this.margins.top,
215
- left: this.offset.left - this.margins.left
216
- };
217
-
218
- $.extend( this.offset, {
219
- click: { //Where the click happened, relative to the element
220
- left: event.pageX - this.offset.left,
221
- top: event.pageY - this.offset.top
222
- },
223
- parent: this._getParentOffset(),
224
-
225
- // This is a relative to absolute position minus the actual position calculation -
226
- // only used for relative positioned helper
227
- relative: this._getRelativeOffset()
228
- } );
229
-
230
- // Only after we got the offset, we can change the helper's position to absolute
231
- // TODO: Still need to figure out a way to make relative sorting possible
232
- this.helper.css( "position", "absolute" );
233
- this.cssPosition = this.helper.css( "position" );
234
-
235
- //Generate the original position
236
- this.originalPosition = this._generatePosition( event );
237
- this.originalPageX = event.pageX;
238
- this.originalPageY = event.pageY;
239
-
240
- //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
241
- ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
242
-
243
- //Cache the former DOM position
244
- this.domPosition = {
245
- prev: this.currentItem.prev()[ 0 ],
246
- parent: this.currentItem.parent()[ 0 ]
247
- };
248
-
249
- // If the helper is not the original, hide the original so it's not playing any role during
250
- // the drag, won't cause anything bad this way
251
- if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
252
- this.currentItem.hide();
253
- }
254
-
255
- //Create the placeholder
256
- this._createPlaceholder();
257
-
258
- //Set a containment if given in the options
259
- if ( o.containment ) {
260
- this._setContainment();
261
- }
262
-
263
- if ( o.cursor && o.cursor !== "auto" ) { // cursor option
264
- body = this.document.find( "body" );
265
-
266
- // Support: IE
267
- this.storedCursor = body.css( "cursor" );
268
- body.css( "cursor", o.cursor );
269
-
270
- this.storedStylesheet =
271
- $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
272
- }
273
-
274
- if ( o.opacity ) { // opacity option
275
- if ( this.helper.css( "opacity" ) ) {
276
- this._storedOpacity = this.helper.css( "opacity" );
277
- }
278
- this.helper.css( "opacity", o.opacity );
279
- }
280
-
281
- if ( o.zIndex ) { // zIndex option
282
- if ( this.helper.css( "zIndex" ) ) {
283
- this._storedZIndex = this.helper.css( "zIndex" );
284
- }
285
- this.helper.css( "zIndex", o.zIndex );
286
- }
287
-
288
- //Prepare scrolling
289
- if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
290
- this.scrollParent[ 0 ].tagName !== "HTML" ) {
291
- this.overflowOffset = this.scrollParent.offset();
292
- }
293
-
294
- //Call callbacks
295
- this._trigger( "start", event, this._uiHash() );
296
-
297
- //Recache the helper size
298
- if ( !this._preserveHelperProportions ) {
299
- this._cacheHelperProportions();
300
- }
301
-
302
- //Post "activate" events to possible containers
303
- if ( !noActivation ) {
304
- for ( i = this.containers.length - 1; i >= 0; i-- ) {
305
- this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
306
- }
307
- }
308
-
309
- //Prepare possible droppables
310
- if ( $.ui.ddmanager ) {
311
- $.ui.ddmanager.current = this;
312
- }
313
-
314
- if ( $.ui.ddmanager && !o.dropBehaviour ) {
315
- $.ui.ddmanager.prepareOffsets( this, event );
316
- }
317
-
318
- this.dragging = true;
319
-
320
- this._addClass( this.helper, "ui-sortable-helper" );
321
-
322
- // Execute the drag once - this causes the helper not to be visiblebefore getting its
323
- // correct position
324
- this._mouseDrag( event );
325
- return true;
326
-
327
- },
328
-
329
- _mouseDrag: function( event ) {
330
- var i, item, itemElement, intersection,
331
- o = this.options,
332
- scrolled = false;
333
-
334
- //Compute the helpers position
335
- this.position = this._generatePosition( event );
336
- this.positionAbs = this._convertPositionTo( "absolute" );
337
-
338
- if ( !this.lastPositionAbs ) {
339
- this.lastPositionAbs = this.positionAbs;
340
- }
341
-
342
- //Do scrolling
343
- if ( this.options.scroll ) {
344
- if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
345
- this.scrollParent[ 0 ].tagName !== "HTML" ) {
346
-
347
- if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
348
- event.pageY < o.scrollSensitivity ) {
349
- this.scrollParent[ 0 ].scrollTop =
350
- scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
351
- } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
352
- this.scrollParent[ 0 ].scrollTop =
353
- scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
354
- }
355
-
356
- if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
357
- event.pageX < o.scrollSensitivity ) {
358
- this.scrollParent[ 0 ].scrollLeft = scrolled =
359
- this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
360
- } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
361
- this.scrollParent[ 0 ].scrollLeft = scrolled =
362
- this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
363
- }
364
-
365
- } else {
366
-
367
- if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
368
- scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
369
- } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
370
- o.scrollSensitivity ) {
371
- scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
372
- }
373
-
374
- if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
375
- scrolled = this.document.scrollLeft(
376
- this.document.scrollLeft() - o.scrollSpeed
377
- );
378
- } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
379
- o.scrollSensitivity ) {
380
- scrolled = this.document.scrollLeft(
381
- this.document.scrollLeft() + o.scrollSpeed
382
- );
383
- }
384
-
385
- }
386
-
387
- if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
388
- $.ui.ddmanager.prepareOffsets( this, event );
389
- }
390
- }
391
-
392
- //Regenerate the absolute position used for position checks
393
- this.positionAbs = this._convertPositionTo( "absolute" );
394
-
395
- //Set the helper position
396
- if ( !this.options.axis || this.options.axis !== "y" ) {
397
- this.helper[ 0 ].style.left = this.position.left + "px";
398
- }
399
- if ( !this.options.axis || this.options.axis !== "x" ) {
400
- this.helper[ 0 ].style.top = this.position.top + "px";
401
- }
402
-
403
- //Rearrange
404
- for ( i = this.items.length - 1; i >= 0; i-- ) {
405
-
406
- //Cache variables and intersection, continue if no intersection
407
- item = this.items[ i ];
408
- itemElement = item.item[ 0 ];
409
- intersection = this._intersectsWithPointer( item );
410
- if ( !intersection ) {
411
- continue;
412
- }
413
-
414
- // Only put the placeholder inside the current Container, skip all
415
- // items from other containers. This works because when moving
416
- // an item from one container to another the
417
- // currentContainer is switched before the placeholder is moved.
418
- //
419
- // Without this, moving items in "sub-sortables" can cause
420
- // the placeholder to jitter between the outer and inner container.
421
- if ( item.instance !== this.currentContainer ) {
422
- continue;
423
- }
424
-
425
- // Cannot intersect with itself
426
- // no useless actions that have been done before
427
- // no action if the item moved is the parent of the item checked
428
- if ( itemElement !== this.currentItem[ 0 ] &&
429
- this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement &&
430
- !$.contains( this.placeholder[ 0 ], itemElement ) &&
431
- ( this.options.type === "semi-dynamic" ?
432
- !$.contains( this.element[ 0 ], itemElement ) :
433
- true
434
- )
435
- ) {
436
-
437
- this.direction = intersection === 1 ? "down" : "up";
438
-
439
- if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) {
440
- this._rearrange( event, item );
441
- } else {
442
- break;
443
- }
444
-
445
- this._trigger( "change", event, this._uiHash() );
446
- break;
447
- }
448
- }
449
-
450
- //Post events to containers
451
- this._contactContainers( event );
452
-
453
- //Interconnect with droppables
454
- if ( $.ui.ddmanager ) {
455
- $.ui.ddmanager.drag( this, event );
456
- }
457
-
458
- //Call callbacks
459
- this._trigger( "sort", event, this._uiHash() );
460
-
461
- this.lastPositionAbs = this.positionAbs;
462
- return false;
463
-
464
- },
465
-
466
- _mouseStop: function( event, noPropagation ) {
467
-
468
- if ( !event ) {
469
- return;
470
- }
471
-
472
- //If we are using droppables, inform the manager about the drop
473
- if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
474
- $.ui.ddmanager.drop( this, event );
475
- }
476
-
477
- if ( this.options.revert ) {
478
- var that = this,
479
- cur = this.placeholder.offset(),
480
- axis = this.options.axis,
481
- animation = {};
482
-
483
- if ( !axis || axis === "x" ) {
484
- animation.left = cur.left - this.offset.parent.left - this.margins.left +
485
- ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
486
- 0 :
487
- this.offsetParent[ 0 ].scrollLeft
488
- );
489
- }
490
- if ( !axis || axis === "y" ) {
491
- animation.top = cur.top - this.offset.parent.top - this.margins.top +
492
- ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
493
- 0 :
494
- this.offsetParent[ 0 ].scrollTop
495
- );
496
- }
497
- this.reverting = true;
498
- $( this.helper ).animate(
499
- animation,
500
- parseInt( this.options.revert, 10 ) || 500,
501
- function() {
502
- that._clear( event );
503
- }
504
- );
505
- } else {
506
- this._clear( event, noPropagation );
507
- }
508
-
509
- return false;
510
-
511
- },
512
-
513
- cancel: function() {
514
-
515
- if ( this.dragging ) {
516
-
517
- this._mouseUp( new $.Event( "mouseup", { target: null } ) );
518
-
519
- if ( this.options.helper === "original" ) {
520
- this.currentItem.css( this._storedCSS );
521
- this._removeClass( this.currentItem, "ui-sortable-helper" );
522
- } else {
523
- this.currentItem.show();
524
- }
525
-
526
- //Post deactivating events to containers
527
- for ( var i = this.containers.length - 1; i >= 0; i-- ) {
528
- this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
529
- if ( this.containers[ i ].containerCache.over ) {
530
- this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
531
- this.containers[ i ].containerCache.over = 0;
532
- }
533
- }
534
-
535
- }
536
-
537
- if ( this.placeholder ) {
538
-
539
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
540
- // it unbinds ALL events from the original node!
541
- if ( this.placeholder[ 0 ].parentNode ) {
542
- this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
543
- }
544
- if ( this.options.helper !== "original" && this.helper &&
545
- this.helper[ 0 ].parentNode ) {
546
- this.helper.remove();
547
- }
548
-
549
- $.extend( this, {
550
- helper: null,
551
- dragging: false,
552
- reverting: false,
553
- _noFinalSort: null
554
- } );
555
-
556
- if ( this.domPosition.prev ) {
557
- $( this.domPosition.prev ).after( this.currentItem );
558
- } else {
559
- $( this.domPosition.parent ).prepend( this.currentItem );
560
- }
561
- }
562
-
563
- return this;
564
-
565
- },
566
-
567
- serialize: function( o ) {
568
-
569
- var items = this._getItemsAsjQuery( o && o.connected ),
570
- str = [];
571
- o = o || {};
572
-
573
- $( items ).each( function() {
574
- var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
575
- .match( o.expression || ( /(.+)[\-=_](.+)/ ) );
576
- if ( res ) {
577
- str.push(
578
- ( o.key || res[ 1 ] + "[]" ) +
579
- "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
580
- }
581
- } );
582
-
583
- if ( !str.length && o.key ) {
584
- str.push( o.key + "=" );
585
- }
586
-
587
- return str.join( "&" );
588
-
589
- },
590
-
591
- toArray: function( o ) {
592
-
593
- var items = this._getItemsAsjQuery( o && o.connected ),
594
- ret = [];
595
-
596
- o = o || {};
597
-
598
- items.each( function() {
599
- ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
600
- } );
601
- return ret;
602
-
603
- },
604
-
605
- /* Be careful with the following core functions */
606
- _intersectsWith: function( item ) {
607
-
608
- var x1 = this.positionAbs.left,
609
- x2 = x1 + this.helperProportions.width,
610
- y1 = this.positionAbs.top,
611
- y2 = y1 + this.helperProportions.height,
612
- l = item.left,
613
- r = l + item.width,
614
- t = item.top,
615
- b = t + item.height,
616
- dyClick = this.offset.click.top,
617
- dxClick = this.offset.click.left,
618
- isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
619
- ( y1 + dyClick ) < b ),
620
- isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
621
- ( x1 + dxClick ) < r ),
622
- isOverElement = isOverElementHeight && isOverElementWidth;
623
-
624
- if ( this.options.tolerance === "pointer" ||
625
- this.options.forcePointerForContainers ||
626
- ( this.options.tolerance !== "pointer" &&
627
- this.helperProportions[ this.floating ? "width" : "height" ] >
628
- item[ this.floating ? "width" : "height" ] )
629
- ) {
630
- return isOverElement;
631
- } else {
632
-
633
- return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
634
- x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
635
- t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
636
- y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
637
-
638
- }
639
- },
640
-
641
- _intersectsWithPointer: function( item ) {
642
- var verticalDirection, horizontalDirection,
643
- isOverElementHeight = ( this.options.axis === "x" ) ||
644
- this._isOverAxis(
645
- this.positionAbs.top + this.offset.click.top, item.top, item.height ),
646
- isOverElementWidth = ( this.options.axis === "y" ) ||
647
- this._isOverAxis(
648
- this.positionAbs.left + this.offset.click.left, item.left, item.width ),
649
- isOverElement = isOverElementHeight && isOverElementWidth;
650
-
651
- if ( !isOverElement ) {
652
- return false;
653
- }
654
-
655
- verticalDirection = this._getDragVerticalDirection();
656
- horizontalDirection = this._getDragHorizontalDirection();
657
-
658
- return this.floating ?
659
- ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 )
660
- : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
661
-
662
- },
663
-
664
- _intersectsWithSides: function( item ) {
665
-
666
- var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
667
- this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
668
- isOverRightHalf = this._isOverAxis( this.positionAbs.left +
669
- this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
670
- verticalDirection = this._getDragVerticalDirection(),
671
- horizontalDirection = this._getDragHorizontalDirection();
672
-
673
- if ( this.floating && horizontalDirection ) {
674
- return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
675
- ( horizontalDirection === "left" && !isOverRightHalf ) );
676
- } else {
677
- return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
678
- ( verticalDirection === "up" && !isOverBottomHalf ) );
679
- }
680
-
681
- },
682
-
683
- _getDragVerticalDirection: function() {
684
- var delta = this.positionAbs.top - this.lastPositionAbs.top;
685
- return delta !== 0 && ( delta > 0 ? "down" : "up" );
686
- },
687
-
688
- _getDragHorizontalDirection: function() {
689
- var delta = this.positionAbs.left - this.lastPositionAbs.left;
690
- return delta !== 0 && ( delta > 0 ? "right" : "left" );
691
- },
692
-
693
- refresh: function( event ) {
694
- this._refreshItems( event );
695
- this._setHandleClassName();
696
- this.refreshPositions();
697
- return this;
698
- },
699
-
700
- _connectWith: function() {
701
- var options = this.options;
702
- return options.connectWith.constructor === String ?
703
- [ options.connectWith ] :
704
- options.connectWith;
705
- },
706
-
707
- _getItemsAsjQuery: function( connected ) {
708
-
709
- var i, j, cur, inst,
710
- items = [],
711
- queries = [],
712
- connectWith = this._connectWith();
713
-
714
- if ( connectWith && connected ) {
715
- for ( i = connectWith.length - 1; i >= 0; i-- ) {
716
- cur = $( connectWith[ i ], this.document[ 0 ] );
717
- for ( j = cur.length - 1; j >= 0; j-- ) {
718
- inst = $.data( cur[ j ], this.widgetFullName );
719
- if ( inst && inst !== this && !inst.options.disabled ) {
720
- queries.push( [ $.isFunction( inst.options.items ) ?
721
- inst.options.items.call( inst.element ) :
722
- $( inst.options.items, inst.element )
723
- .not( ".ui-sortable-helper" )
724
- .not( ".ui-sortable-placeholder" ), inst ] );
725
- }
726
- }
727
- }
728
- }
729
-
730
- queries.push( [ $.isFunction( this.options.items ) ?
731
- this.options.items
732
- .call( this.element, null, { options: this.options, item: this.currentItem } ) :
733
- $( this.options.items, this.element )
734
- .not( ".ui-sortable-helper" )
735
- .not( ".ui-sortable-placeholder" ), this ] );
736
-
737
- function addItems() {
738
- items.push( this );
739
- }
740
- for ( i = queries.length - 1; i >= 0; i-- ) {
741
- queries[ i ][ 0 ].each( addItems );
742
- }
743
-
744
- return $( items );
745
-
746
- },
747
-
748
- _removeCurrentsFromItems: function() {
749
-
750
- var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
751
-
752
- this.items = $.grep( this.items, function( item ) {
753
- for ( var j = 0; j < list.length; j++ ) {
754
- if ( list[ j ] === item.item[ 0 ] ) {
755
- return false;
756
- }
757
- }
758
- return true;
759
- } );
760
-
761
- },
762
-
763
- _refreshItems: function( event ) {
764
-
765
- this.items = [];
766
- this.containers = [ this ];
767
-
768
- var i, j, cur, inst, targetData, _queries, item, queriesLength,
769
- items = this.items,
770
- queries = [ [ $.isFunction( this.options.items ) ?
771
- this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
772
- $( this.options.items, this.element ), this ] ],
773
- connectWith = this._connectWith();
774
-
775
- //Shouldn't be run the first time through due to massive slow-down
776
- if ( connectWith && this.ready ) {
777
- for ( i = connectWith.length - 1; i >= 0; i-- ) {
778
- cur = $( connectWith[ i ], this.document[ 0 ] );
779
- for ( j = cur.length - 1; j >= 0; j-- ) {
780
- inst = $.data( cur[ j ], this.widgetFullName );
781
- if ( inst && inst !== this && !inst.options.disabled ) {
782
- queries.push( [ $.isFunction( inst.options.items ) ?
783
- inst.options.items
784
- .call( inst.element[ 0 ], event, { item: this.currentItem } ) :
785
- $( inst.options.items, inst.element ), inst ] );
786
- this.containers.push( inst );
787
- }
788
- }
789
- }
790
- }
791
-
792
- for ( i = queries.length - 1; i >= 0; i-- ) {
793
- targetData = queries[ i ][ 1 ];
794
- _queries = queries[ i ][ 0 ];
795
-
796
- for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
797
- item = $( _queries[ j ] );
798
-
799
- // Data for target checking (mouse manager)
800
- item.data( this.widgetName + "-item", targetData );
801
-
802
- items.push( {
803
- item: item,
804
- instance: targetData,
805
- width: 0, height: 0,
806
- left: 0, top: 0
807
- } );
808
- }
809
- }
810
-
811
- },
812
-
813
- refreshPositions: function( fast ) {
814
-
815
- // Determine whether items are being displayed horizontally
816
- this.floating = this.items.length ?
817
- this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
818
- false;
819
-
820
- //This has to be redone because due to the item being moved out/into the offsetParent,
821
- // the offsetParent's position will change
822
- if ( this.offsetParent && this.helper ) {
823
- this.offset.parent = this._getParentOffset();
824
- }
825
-
826
- var i, item, t, p;
827
-
828
- for ( i = this.items.length - 1; i >= 0; i-- ) {
829
- item = this.items[ i ];
830
-
831
- //We ignore calculating positions of all connected containers when we're not over them
832
- if ( item.instance !== this.currentContainer && this.currentContainer &&
833
- item.item[ 0 ] !== this.currentItem[ 0 ] ) {
834
- continue;
835
- }
836
-
837
- t = this.options.toleranceElement ?
838
- $( this.options.toleranceElement, item.item ) :
839
- item.item;
840
-
841
- if ( !fast ) {
842
- item.width = t.outerWidth();
843
- item.height = t.outerHeight();
844
- }
845
-
846
- p = t.offset();
847
- item.left = p.left;
848
- item.top = p.top;
849
- }
850
-
851
- if ( this.options.custom && this.options.custom.refreshContainers ) {
852
- this.options.custom.refreshContainers.call( this );
853
- } else {
854
- for ( i = this.containers.length - 1; i >= 0; i-- ) {
855
- p = this.containers[ i ].element.offset();
856
- this.containers[ i ].containerCache.left = p.left;
857
- this.containers[ i ].containerCache.top = p.top;
858
- this.containers[ i ].containerCache.width =
859
- this.containers[ i ].element.outerWidth();
860
- this.containers[ i ].containerCache.height =
861
- this.containers[ i ].element.outerHeight();
862
- }
863
- }
864
-
865
- return this;
866
- },
867
-
868
- _createPlaceholder: function( that ) {
869
- that = that || this;
870
- var className,
871
- o = that.options;
872
-
873
- if ( !o.placeholder || o.placeholder.constructor === String ) {
874
- className = o.placeholder;
875
- o.placeholder = {
876
- element: function() {
877
-
878
- var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(),
879
- element = $( "<" + nodeName + ">", that.document[ 0 ] );
880
-
881
- that._addClass( element, "ui-sortable-placeholder",
882
- className || that.currentItem[ 0 ].className )
883
- ._removeClass( element, "ui-sortable-helper" );
884
-
885
- if ( nodeName === "tbody" ) {
886
- that._createTrPlaceholder(
887
- that.currentItem.find( "tr" ).eq( 0 ),
888
- $( "<tr>", that.document[ 0 ] ).appendTo( element )
889
- );
890
- } else if ( nodeName === "tr" ) {
891
- that._createTrPlaceholder( that.currentItem, element );
892
- } else if ( nodeName === "img" ) {
893
- element.attr( "src", that.currentItem.attr( "src" ) );
894
- }
895
-
896
- if ( !className ) {
897
- element.css( "visibility", "hidden" );
898
- }
899
-
900
- return element;
901
- },
902
- update: function( container, p ) {
903
-
904
- // 1. If a className is set as 'placeholder option, we don't force sizes -
905
- // the class is responsible for that
906
- // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
907
- // class name is specified
908
- if ( className && !o.forcePlaceholderSize ) {
909
- return;
910
- }
911
-
912
- //If the element doesn't have a actual height by itself (without styles coming
913
- // from a stylesheet), it receives the inline height from the dragged item
914
- if ( !p.height() ) {
915
- p.height(
916
- that.currentItem.innerHeight() -
917
- parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
918
- parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
919
- }
920
- if ( !p.width() ) {
921
- p.width(
922
- that.currentItem.innerWidth() -
923
- parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
924
- parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
925
- }
926
- }
927
- };
928
- }
929
-
930
- //Create the placeholder
931
- that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
932
-
933
- //Append it after the actual current item
934
- that.currentItem.after( that.placeholder );
935
-
936
- //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
937
- o.placeholder.update( that, that.placeholder );
938
-
939
- },
940
-
941
- _createTrPlaceholder: function( sourceTr, targetTr ) {
942
- var that = this;
943
-
944
- sourceTr.children().each( function() {
945
- $( "<td>&#160;</td>", that.document[ 0 ] )
946
- .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
947
- .appendTo( targetTr );
948
- } );
949
- },
950
-
951
- _contactContainers: function( event ) {
952
- var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
953
- floating, axis,
954
- innermostContainer = null,
955
- innermostIndex = null;
956
-
957
- // Get innermost container that intersects with item
958
- for ( i = this.containers.length - 1; i >= 0; i-- ) {
959
-
960
- // Never consider a container that's located within the item itself
961
- if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
962
- continue;
963
- }
964
-
965
- if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
966
-
967
- // If we've already found a container and it's more "inner" than this, then continue
968
- if ( innermostContainer &&
969
- $.contains(
970
- this.containers[ i ].element[ 0 ],
971
- innermostContainer.element[ 0 ] ) ) {
972
- continue;
973
- }
974
-
975
- innermostContainer = this.containers[ i ];
976
- innermostIndex = i;
977
-
978
- } else {
979
-
980
- // container doesn't intersect. trigger "out" event if necessary
981
- if ( this.containers[ i ].containerCache.over ) {
982
- this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
983
- this.containers[ i ].containerCache.over = 0;
984
- }
985
- }
986
-
987
- }
988
-
989
- // If no intersecting containers found, return
990
- if ( !innermostContainer ) {
991
- return;
992
- }
993
-
994
- // Move the item into the container if it's not there already
995
- if ( this.containers.length === 1 ) {
996
- if ( !this.containers[ innermostIndex ].containerCache.over ) {
997
- this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
998
- this.containers[ innermostIndex ].containerCache.over = 1;
999
- }
1000
- } else {
1001
-
1002
- // When entering a new container, we will find the item with the least distance and
1003
- // append our item near it
1004
- dist = 10000;
1005
- itemWithLeastDistance = null;
1006
- floating = innermostContainer.floating || this._isFloating( this.currentItem );
1007
- posProperty = floating ? "left" : "top";
1008
- sizeProperty = floating ? "width" : "height";
1009
- axis = floating ? "pageX" : "pageY";
1010
-
1011
- for ( j = this.items.length - 1; j >= 0; j-- ) {
1012
- if ( !$.contains(
1013
- this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
1014
- ) {
1015
- continue;
1016
- }
1017
- if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
1018
- continue;
1019
- }
1020
-
1021
- cur = this.items[ j ].item.offset()[ posProperty ];
1022
- nearBottom = false;
1023
- if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
1024
- nearBottom = true;
1025
- }
1026
-
1027
- if ( Math.abs( event[ axis ] - cur ) < dist ) {
1028
- dist = Math.abs( event[ axis ] - cur );
1029
- itemWithLeastDistance = this.items[ j ];
1030
- this.direction = nearBottom ? "up" : "down";
1031
- }
1032
- }
1033
-
1034
- //Check if dropOnEmpty is enabled
1035
- if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
1036
- return;
1037
- }
1038
-
1039
- if ( this.currentContainer === this.containers[ innermostIndex ] ) {
1040
- if ( !this.currentContainer.containerCache.over ) {
1041
- this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
1042
- this.currentContainer.containerCache.over = 1;
1043
- }
1044
- return;
1045
- }
1046
-
1047
- itemWithLeastDistance ?
1048
- this._rearrange( event, itemWithLeastDistance, null, true ) :
1049
- this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
1050
- this._trigger( "change", event, this._uiHash() );
1051
- this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
1052
- this.currentContainer = this.containers[ innermostIndex ];
1053
-
1054
- //Update the placeholder
1055
- this.options.placeholder.update( this.currentContainer, this.placeholder );
1056
-
1057
- this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
1058
- this.containers[ innermostIndex ].containerCache.over = 1;
1059
- }
1060
-
1061
- },
1062
-
1063
- _createHelper: function( event ) {
1064
-
1065
- var o = this.options,
1066
- helper = $.isFunction( o.helper ) ?
1067
- $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
1068
- ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
1069
-
1070
- //Add the helper to the DOM if that didn't happen already
1071
- if ( !helper.parents( "body" ).length ) {
1072
- $( o.appendTo !== "parent" ?
1073
- o.appendTo :
1074
- this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] );
1075
- }
1076
-
1077
- if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
1078
- this._storedCSS = {
1079
- width: this.currentItem[ 0 ].style.width,
1080
- height: this.currentItem[ 0 ].style.height,
1081
- position: this.currentItem.css( "position" ),
1082
- top: this.currentItem.css( "top" ),
1083
- left: this.currentItem.css( "left" )
1084
- };
1085
- }
1086
-
1087
- if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
1088
- helper.width( this.currentItem.width() );
1089
- }
1090
- if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
1091
- helper.height( this.currentItem.height() );
1092
- }
1093
-
1094
- return helper;
1095
-
1096
- },
1097
-
1098
- _adjustOffsetFromHelper: function( obj ) {
1099
- if ( typeof obj === "string" ) {
1100
- obj = obj.split( " " );
1101
- }
1102
- if ( $.isArray( obj ) ) {
1103
- obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
1104
- }
1105
- if ( "left" in obj ) {
1106
- this.offset.click.left = obj.left + this.margins.left;
1107
- }
1108
- if ( "right" in obj ) {
1109
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1110
- }
1111
- if ( "top" in obj ) {
1112
- this.offset.click.top = obj.top + this.margins.top;
1113
- }
1114
- if ( "bottom" in obj ) {
1115
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1116
- }
1117
- },
1118
-
1119
- _getParentOffset: function() {
1120
-
1121
- //Get the offsetParent and cache its position
1122
- this.offsetParent = this.helper.offsetParent();
1123
- var po = this.offsetParent.offset();
1124
-
1125
- // This is a special case where we need to modify a offset calculated on start, since the
1126
- // following happened:
1127
- // 1. The position of the helper is absolute, so it's position is calculated based on the
1128
- // next positioned parent
1129
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
1130
- // the document, which means that the scroll is included in the initial calculation of the
1131
- // offset of the parent, and never recalculated upon drag
1132
- if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1133
- $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
1134
- po.left += this.scrollParent.scrollLeft();
1135
- po.top += this.scrollParent.scrollTop();
1136
- }
1137
-
1138
- // This needs to be actually done for all browsers, since pageX/pageY includes this
1139
- // information with an ugly IE fix
1140
- if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
1141
- ( this.offsetParent[ 0 ].tagName &&
1142
- this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
1143
- po = { top: 0, left: 0 };
1144
- }
1145
-
1146
- return {
1147
- top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
1148
- left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
1149
- };
1150
-
1151
- },
1152
-
1153
- _getRelativeOffset: function() {
1154
-
1155
- if ( this.cssPosition === "relative" ) {
1156
- var p = this.currentItem.position();
1157
- return {
1158
- top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
1159
- this.scrollParent.scrollTop(),
1160
- left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
1161
- this.scrollParent.scrollLeft()
1162
- };
1163
- } else {
1164
- return { top: 0, left: 0 };
1165
- }
1166
-
1167
- },
1168
-
1169
- _cacheMargins: function() {
1170
- this.margins = {
1171
- left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
1172
- top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
1173
- };
1174
- },
1175
-
1176
- _cacheHelperProportions: function() {
1177
- this.helperProportions = {
1178
- width: this.helper.outerWidth(),
1179
- height: this.helper.outerHeight()
1180
- };
1181
- },
1182
-
1183
- _setContainment: function() {
1184
-
1185
- var ce, co, over,
1186
- o = this.options;
1187
- if ( o.containment === "parent" ) {
1188
- o.containment = this.helper[ 0 ].parentNode;
1189
- }
1190
- if ( o.containment === "document" || o.containment === "window" ) {
1191
- this.containment = [
1192
- 0 - this.offset.relative.left - this.offset.parent.left,
1193
- 0 - this.offset.relative.top - this.offset.parent.top,
1194
- o.containment === "document" ?
1195
- this.document.width() :
1196
- this.window.width() - this.helperProportions.width - this.margins.left,
1197
- ( o.containment === "document" ?
1198
- ( this.document.height() || document.body.parentNode.scrollHeight ) :
1199
- this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
1200
- ) - this.helperProportions.height - this.margins.top
1201
- ];
1202
- }
1203
-
1204
- if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
1205
- ce = $( o.containment )[ 0 ];
1206
- co = $( o.containment ).offset();
1207
- over = ( $( ce ).css( "overflow" ) !== "hidden" );
1208
-
1209
- this.containment = [
1210
- co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
1211
- ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
1212
- co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
1213
- ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
1214
- co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
1215
- ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
1216
- ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
1217
- this.helperProportions.width - this.margins.left,
1218
- co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
1219
- ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
1220
- ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
1221
- this.helperProportions.height - this.margins.top
1222
- ];
1223
- }
1224
-
1225
- },
1226
-
1227
- _convertPositionTo: function( d, pos ) {
1228
-
1229
- if ( !pos ) {
1230
- pos = this.position;
1231
- }
1232
- var mod = d === "absolute" ? 1 : -1,
1233
- scroll = this.cssPosition === "absolute" &&
1234
- !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1235
- $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
1236
- this.offsetParent :
1237
- this.scrollParent,
1238
- scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
1239
-
1240
- return {
1241
- top: (
1242
-
1243
- // The absolute mouse position
1244
- pos.top +
1245
-
1246
- // Only for relative positioned nodes: Relative offset from element to offset parent
1247
- this.offset.relative.top * mod +
1248
-
1249
- // The offsetParent's offset without borders (offset + border)
1250
- this.offset.parent.top * mod -
1251
- ( ( this.cssPosition === "fixed" ?
1252
- -this.scrollParent.scrollTop() :
1253
- ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
1254
- ),
1255
- left: (
1256
-
1257
- // The absolute mouse position
1258
- pos.left +
1259
-
1260
- // Only for relative positioned nodes: Relative offset from element to offset parent
1261
- this.offset.relative.left * mod +
1262
-
1263
- // The offsetParent's offset without borders (offset + border)
1264
- this.offset.parent.left * mod -
1265
- ( ( this.cssPosition === "fixed" ?
1266
- -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
1267
- scroll.scrollLeft() ) * mod )
1268
- )
1269
- };
1270
-
1271
- },
1272
-
1273
- _generatePosition: function( event ) {
1274
-
1275
- var top, left,
1276
- o = this.options,
1277
- pageX = event.pageX,
1278
- pageY = event.pageY,
1279
- scroll = this.cssPosition === "absolute" &&
1280
- !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1281
- $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
1282
- this.offsetParent :
1283
- this.scrollParent,
1284
- scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
1285
-
1286
- // This is another very weird special case that only happens for relative elements:
1287
- // 1. If the css position is relative
1288
- // 2. and the scroll parent is the document or similar to the offset parent
1289
- // we have to refresh the relative offset during the scroll so there are no jumps
1290
- if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1291
- this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
1292
- this.offset.relative = this._getRelativeOffset();
1293
- }
1294
-
1295
- /*
1296
- * - Position constraining -
1297
- * Constrain the position to a mix of grid, containment.
1298
- */
1299
-
1300
- if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
1301
-
1302
- if ( this.containment ) {
1303
- if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
1304
- pageX = this.containment[ 0 ] + this.offset.click.left;
1305
- }
1306
- if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
1307
- pageY = this.containment[ 1 ] + this.offset.click.top;
1308
- }
1309
- if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
1310
- pageX = this.containment[ 2 ] + this.offset.click.left;
1311
- }
1312
- if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
1313
- pageY = this.containment[ 3 ] + this.offset.click.top;
1314
- }
1315
- }
1316
-
1317
- if ( o.grid ) {
1318
- top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
1319
- o.grid[ 1 ] ) * o.grid[ 1 ];
1320
- pageY = this.containment ?
1321
- ( ( top - this.offset.click.top >= this.containment[ 1 ] &&
1322
- top - this.offset.click.top <= this.containment[ 3 ] ) ?
1323
- top :
1324
- ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
1325
- top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
1326
- top;
1327
-
1328
- left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
1329
- o.grid[ 0 ] ) * o.grid[ 0 ];
1330
- pageX = this.containment ?
1331
- ( ( left - this.offset.click.left >= this.containment[ 0 ] &&
1332
- left - this.offset.click.left <= this.containment[ 2 ] ) ?
1333
- left :
1334
- ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
1335
- left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
1336
- left;
1337
- }
1338
-
1339
- }
1340
-
1341
- return {
1342
- top: (
1343
-
1344
- // The absolute mouse position
1345
- pageY -
1346
-
1347
- // Click offset (relative to the element)
1348
- this.offset.click.top -
1349
-
1350
- // Only for relative positioned nodes: Relative offset from element to offset parent
1351
- this.offset.relative.top -
1352
-
1353
- // The offsetParent's offset without borders (offset + border)
1354
- this.offset.parent.top +
1355
- ( ( this.cssPosition === "fixed" ?
1356
- -this.scrollParent.scrollTop() :
1357
- ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
1358
- ),
1359
- left: (
1360
-
1361
- // The absolute mouse position
1362
- pageX -
1363
-
1364
- // Click offset (relative to the element)
1365
- this.offset.click.left -
1366
-
1367
- // Only for relative positioned nodes: Relative offset from element to offset parent
1368
- this.offset.relative.left -
1369
-
1370
- // The offsetParent's offset without borders (offset + border)
1371
- this.offset.parent.left +
1372
- ( ( this.cssPosition === "fixed" ?
1373
- -this.scrollParent.scrollLeft() :
1374
- scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
1375
- )
1376
- };
1377
-
1378
- },
1379
-
1380
- _rearrange: function( event, i, a, hardRefresh ) {
1381
-
1382
- a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) :
1383
- i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
1384
- ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
1385
-
1386
- //Various things done here to improve the performance:
1387
- // 1. we create a setTimeout, that calls refreshPositions
1388
- // 2. on the instance, we have a counter variable, that get's higher after every append
1389
- // 3. on the local scope, we copy the counter variable, and check in the timeout,
1390
- // if it's still the same
1391
- // 4. this lets only the last addition to the timeout stack through
1392
- this.counter = this.counter ? ++this.counter : 1;
1393
- var counter = this.counter;
1394
-
1395
- this._delay( function() {
1396
- if ( counter === this.counter ) {
1397
-
1398
- //Precompute after each DOM insertion, NOT on mousemove
1399
- this.refreshPositions( !hardRefresh );
1400
- }
1401
- } );
1402
-
1403
- },
1404
-
1405
- _clear: function( event, noPropagation ) {
1406
-
1407
- this.reverting = false;
1408
-
1409
- // We delay all events that have to be triggered to after the point where the placeholder
1410
- // has been removed and everything else normalized again
1411
- var i,
1412
- delayedTriggers = [];
1413
-
1414
- // We first have to update the dom position of the actual currentItem
1415
- // Note: don't do it if the current item is already removed (by a user), or it gets
1416
- // reappended (see #4088)
1417
- if ( !this._noFinalSort && this.currentItem.parent().length ) {
1418
- this.placeholder.before( this.currentItem );
1419
- }
1420
- this._noFinalSort = null;
1421
-
1422
- if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
1423
- for ( i in this._storedCSS ) {
1424
- if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
1425
- this._storedCSS[ i ] = "";
1426
- }
1427
- }
1428
- this.currentItem.css( this._storedCSS );
1429
- this._removeClass( this.currentItem, "ui-sortable-helper" );
1430
- } else {
1431
- this.currentItem.show();
1432
- }
1433
-
1434
- if ( this.fromOutside && !noPropagation ) {
1435
- delayedTriggers.push( function( event ) {
1436
- this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
1437
- } );
1438
- }
1439
- if ( ( this.fromOutside ||
1440
- this.domPosition.prev !==
1441
- this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
1442
- this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
1443
-
1444
- // Trigger update callback if the DOM position has changed
1445
- delayedTriggers.push( function( event ) {
1446
- this._trigger( "update", event, this._uiHash() );
1447
- } );
1448
- }
1449
-
1450
- // Check if the items Container has Changed and trigger appropriate
1451
- // events.
1452
- if ( this !== this.currentContainer ) {
1453
- if ( !noPropagation ) {
1454
- delayedTriggers.push( function( event ) {
1455
- this._trigger( "remove", event, this._uiHash() );
1456
- } );
1457
- delayedTriggers.push( ( function( c ) {
1458
- return function( event ) {
1459
- c._trigger( "receive", event, this._uiHash( this ) );
1460
- };
1461
- } ).call( this, this.currentContainer ) );
1462
- delayedTriggers.push( ( function( c ) {
1463
- return function( event ) {
1464
- c._trigger( "update", event, this._uiHash( this ) );
1465
- };
1466
- } ).call( this, this.currentContainer ) );
1467
- }
1468
- }
1469
-
1470
- //Post events to containers
1471
- function delayEvent( type, instance, container ) {
1472
- return function( event ) {
1473
- container._trigger( type, event, instance._uiHash( instance ) );
1474
- };
1475
- }
1476
- for ( i = this.containers.length - 1; i >= 0; i-- ) {
1477
- if ( !noPropagation ) {
1478
- delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
1479
- }
1480
- if ( this.containers[ i ].containerCache.over ) {
1481
- delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
1482
- this.containers[ i ].containerCache.over = 0;
1483
- }
1484
- }
1485
-
1486
- //Do what was originally in plugins
1487
- if ( this.storedCursor ) {
1488
- this.document.find( "body" ).css( "cursor", this.storedCursor );
1489
- this.storedStylesheet.remove();
1490
- }
1491
- if ( this._storedOpacity ) {
1492
- this.helper.css( "opacity", this._storedOpacity );
1493
- }
1494
- if ( this._storedZIndex ) {
1495
- this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
1496
- }
1497
-
1498
- this.dragging = false;
1499
-
1500
- if ( !noPropagation ) {
1501
- this._trigger( "beforeStop", event, this._uiHash() );
1502
- }
1503
-
1504
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
1505
- // it unbinds ALL events from the original node!
1506
- this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
1507
-
1508
- if ( !this.cancelHelperRemoval ) {
1509
- if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
1510
- this.helper.remove();
1511
- }
1512
- this.helper = null;
1513
- }
1514
-
1515
- if ( !noPropagation ) {
1516
- for ( i = 0; i < delayedTriggers.length; i++ ) {
1517
-
1518
- // Trigger all delayed events
1519
- delayedTriggers[ i ].call( this, event );
1520
- }
1521
- this._trigger( "stop", event, this._uiHash() );
1522
- }
1523
-
1524
- this.fromOutside = false;
1525
- return !this.cancelHelperRemoval;
1526
-
1527
- },
1528
-
1529
- _trigger: function() {
1530
- if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
1531
- this.cancel();
1532
- }
1533
- },
1534
-
1535
- _uiHash: function( _inst ) {
1536
- var inst = _inst || this;
1537
- return {
1538
- helper: inst.helper,
1539
- placeholder: inst.placeholder || $( [] ),
1540
- position: inst.position,
1541
- originalPosition: inst.originalPosition,
1542
- offset: inst.positionAbs,
1543
- item: inst.currentItem,
1544
- sender: _inst ? _inst.element : null
1545
- };
1546
- }
1547
-
1548
- } );
1549
-
1550
- } ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/sortable.min.js DELETED
@@ -1,9 +0,0 @@
1
- /*!
2
- * jQuery UI Sortable 1.12.1
3
- * http://jqueryui.com
4
- *
5
- * Copyright jQuery Foundation and other contributors
6
- * Released under the MIT license.
7
- * http://jquery.org/license
8
- */
9
- !function(t){"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],t):t(jQuery)}(function(u){return u.widget("ui.sortable",u.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),u.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),u(t.target).parents().each(function(){if(u.data(this,o.widgetName+"-item")===o)return i=u(this),!1}),!!(i=u.data(t.target,o.widgetName+"-item")===o?u(t.target):i)&&(!(this.options.handle&&!e&&(u(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,o,r=this.options;if((this.currentContainer=this).refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},u.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=u("<style>*{ cursor: "+r.cursor+" !important; }</style>").appendTo(o)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,o,r=this.options,n=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<r.scrollSensitivity?this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop+r.scrollSpeed:t.pageY-this.overflowOffset.top<r.scrollSensitivity&&(this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop-r.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<r.scrollSensitivity?this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft+r.scrollSpeed:t.pageX-this.overflowOffset.left<r.scrollSensitivity&&(this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft-r.scrollSpeed)):(t.pageY-this.document.scrollTop()<r.scrollSensitivity?n=this.document.scrollTop(this.document.scrollTop()-r.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<r.scrollSensitivity&&(n=this.document.scrollTop(this.document.scrollTop()+r.scrollSpeed)),t.pageX-this.document.scrollLeft()<r.scrollSensitivity?n=this.document.scrollLeft(this.document.scrollLeft()-r.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<r.scrollSensitivity&&(n=this.document.scrollLeft(this.document.scrollLeft()+r.scrollSpeed))),!1!==n&&u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||u.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&u.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),u.ui.ddmanager&&u.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,o,r;if(t)return u.ui.ddmanager&&!this.options.dropBehaviour&&u.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),r={},(o=this.options.axis)&&"x"!==o||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,u(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new u.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),u.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?u(this.domPosition.prev).after(this.currentItem):u(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},u(t).each(function(){var t=(u(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(u(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,r=t.left,n=r+t.width,h=t.top,a=h+t.height,l=this.offset.click.top,c=this.offset.click.left,l="x"===this.options.axis||h<s+l&&s+l<a,c="y"===this.options.axis||r<e+c&&e+c<n;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?l&&c:r<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<n&&h<s+this.helperProportions.height/2&&o-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this._getDragVerticalDirection(),t=this._getDragHorizontalDirection(),this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),t=this._getDragHorizontalDirection();return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,o,r=[],n=[],h=this._connectWith();if(h&&t)for(e=h.length-1;0<=e;e--)for(i=(s=u(h[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&n.push([u.isFunction(o.options.items)?o.options.items.call(o.element):u(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function a(){r.push(this)}for(n.push([u.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):u(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=n.length-1;0<=e;e--)n[e][0].each(a);return u(r)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=u.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,o,r,n,h,a,l=this.items,c=[[u.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):u(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(e=p.length-1;0<=e;e--)for(i=(s=u(p[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(c.push([u.isFunction(o.options.items)?o.options.items.call(o.element[0],t,{item:this.currentItem}):u(o.options.items,o.element),o]),this.containers.push(o));for(e=c.length-1;0<=e;e--)for(r=c[e][1],a=(n=c[e][i=0]).length;i<a;i++)(h=u(n[i])).data(this.widgetName+"-item",r),l.push({item:h,instance:r,width:0,height:0,left:0,top:0})},refreshPositions:function(t){var e,i,s,o;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),e=this.items.length-1;0<=e;e--)(i=this.items[e]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?u(this.options.toleranceElement,i.item):i.item,t||(i.width=s.outerWidth(),i.height=s.outerHeight()),o=s.offset(),i.left=o.left,i.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)o=this.containers[e].element.offset(),this.containers[e].containerCache.left=o.left,this.containers[e].containerCache.top=o.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,o.placeholder={element:function(){var t=i.currentItem[0].nodeName.toLowerCase(),e=u("<"+t+">",i.document[0]);return i._addClass(e,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(e,"ui-sortable-helper"),"tbody"===t?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),u("<tr>",i.document[0]).appendTo(e)):"tr"===t?i._createTrPlaceholder(i.currentItem,e):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=u(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){u("<td>&#160;</td>",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,o,r,n,h,a,l,c=null,p=null,f=this.containers.length-1;0<=f;f--)u.contains(this.currentItem[0],this.containers[f].element[0])||(this._intersectsWith(this.containers[f].containerCache)?c&&u.contains(this.containers[f].element[0],c.element[0])||(c=this.containers[f],p=f):this.containers[f].containerCache.over&&(this.containers[f]._trigger("out",t,this._uiHash(this)),this.containers[f].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,o=(a=c.floating||this._isFloating(this.currentItem))?"left":"top",r=a?"width":"height",l=a?"pageX":"pageY",e=this.items.length-1;0<=e;e--)u.contains(this.containers[p].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(n=this.items[e].item.offset()[o],h=!1,t[l]-n>this.items[e][r]/2&&(h=!0),Math.abs(t[l]-n)<i&&(i=Math.abs(t[l]-n),s=this.items[e],this.direction=h?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[p]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t=u.isFunction(e.helper)?u(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||u("parent"!==e.appendTo?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=u.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&u.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=u(i.containment)[0],e=u(i.containment).offset(),i="hidden"!==u(t).css("overflow"),this.containment=[e.left+(parseInt(u(t).css("borderLeftWidth"),10)||0)+(parseInt(u(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(u(t).css("borderTopWidth"),10)||0)+(parseInt(u(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(u(t).css("borderLeftWidth"),10)||0)-(parseInt(u(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(u(t).css("borderTopWidth"),10)||0)-(parseInt(u(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===u.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||u([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}})});
 
 
 
 
 
 
 
 
 
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 8.1.00.004
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -1014,7 +1014,7 @@ function wppaAjaxUpdateOptionCheckBox(slug, elem) {
1014
  url += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1015
  if (elem.checked) url += '&value=yes';
1016
  else url += '&value=no';
1017
-
1018
  // Process the result
1019
  xmlhttp.onreadystatechange=function() {
1020
  switch (xmlhttp.readyState) {
@@ -1153,9 +1153,6 @@ function wppaMaintenanceProc(slug, intern, asCronJob ) {
1153
  if ( ! asCronJob ) {
1154
  jQuery("#"+slug+"_status").html('Pending');
1155
  }
1156
-
1157
- // Start update togo
1158
- setTimeout( function() {wppaAjaxUpdateTogo(slug);}, 1000 );
1159
  },
1160
 
1161
  error: function( xhr, status, error ) {
@@ -1266,14 +1263,6 @@ function wppaAjaxPopupWindow( slug ) {
1266
  jQuery( '.ui-widget-overlay' ).css({
1267
  backgroundColor: 'transparent',
1268
  });
1269
-
1270
- setTimeout( function() {
1271
- if (jQuery("#wppa-maintenance-list").niceScroll) {
1272
- jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{});
1273
- };
1274
- }, 1000 );
1275
-
1276
- /* ' . wppa_opt( 'nicescroll_opts' ) . ' */
1277
  }
1278
  }
1279
 
@@ -1385,6 +1374,7 @@ function wppaEncode(xtext) {
1385
  if (idx < temp.length) result += '||PLUS||';
1386
  }
1387
 
 
1388
  return result;
1389
  }
1390
 
@@ -1412,7 +1402,6 @@ function wppaGetXmlHttp() {
1412
  }
1413
 
1414
  function wppaPhotoStatusChange(id) {
1415
-
1416
  // Init
1417
  jQuery('#psdesc-'+id).css({display: 'none'});
1418
  if ( ! jQuery('#status-'+id) ) return;
@@ -1513,7 +1502,25 @@ function wppaReload(arg) {
1513
  document.location.reload( true );
1514
  }
1515
  }
1516
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1517
  var wppaFeCount = 0;
1518
  function wppaFeAjaxLog(key) {
1519
 
@@ -1698,7 +1705,6 @@ function wppaAjaxUpdateTogo(slug) {
1698
  type: 'GET',
1699
  timeout: 100000,
1700
  beforeSend: function( xhr ) {
1701
- // wppaConsoleLog('Requesting togo for slug '+slug, 'force');
1702
  },
1703
  success: function( result, status, xhr ) {
1704
 
@@ -1717,7 +1723,7 @@ function wppaAjaxUpdateTogo(slug) {
1717
  }
1718
  jQuery( '#' + slug + '_status' ).html( New );
1719
 
1720
- setTimeout( function() {wppaAjaxUpdateTogo(slug);}, 1000 );
1721
  },
1722
  error: function( xhr ) {
1723
  },
@@ -1808,7 +1814,7 @@ function wppaTimedConfirm( text ) {
1808
  }
1809
 
1810
  function wppaAjaxGetSpinnerHtml( type, target ) {
1811
-
1812
  jQuery.ajax( { url: wppaAjaxUrl,
1813
  data: 'action=wppa' +
1814
  '&wppa-action=update-option' +
@@ -1821,7 +1827,7 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
1821
  beforeSend: function( xhr ) {
1822
  },
1823
  success: function( result, status, xhr ) {
1824
-
1825
  // Split status and data
1826
  var data = result.split('|');
1827
 
@@ -1830,10 +1836,10 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
1830
 
1831
  },
1832
  error: function( xhr ) {
1833
-
1834
  },
1835
  complete: function( xhr ) {
1836
-
1837
  }
1838
  } );
1839
  }
@@ -1842,6 +1848,7 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
1842
  // Movable horizon on photo admin page
1843
  function wppaDragHorizon(elmnt) {
1844
 
 
1845
  var pos2 = 0, pos4 = 0;
1846
 
1847
  elmnt.onmousedown = dragMouseDown;
@@ -1882,127 +1889,6 @@ function wppaDragHorizon(elmnt) {
1882
  }
1883
  }
1884
 
1885
- // Photo admin page specific functions
1886
- function wppaBulkActionChange( elm, id ) {
1887
- wppa_setCookie( 'wppa_bulk_action',elm.value,365 );
1888
- if ( elm.value == 'wppa-bulk-move-to' || elm.value == 'wppa-bulk-copy-to' ) jQuery( '#wppa-bulk-album' ).css( 'display', 'inline' );
1889
- else jQuery( '#wppa-bulk-album' ).css( 'display', 'none' );
1890
- if ( elm.value == 'wppa-bulk-status' ) jQuery( '#wppa-bulk-status' ).css( 'display', 'inline' );
1891
- else jQuery( '#wppa-bulk-status' ).css( 'display', 'none' );
1892
- if ( elm.value == 'wppa-bulk-owner' ) jQuery( '#wppa-bulk-owner' ).css( 'display', 'inline' );
1893
- else jQuery( '#wppa-bulk-owner' ).css( 'display', 'none' );
1894
- }
1895
- function wppaBulkDoitOnClick() {
1896
- var photos = jQuery( '.wppa-bulk-photo' );
1897
- var count=0;
1898
- for ( i=0; i< photos.length; i++ ) {
1899
- var photo = photos[i];
1900
- if ( photo.checked ) count++;
1901
- }
1902
- if ( count == 0 ) {
1903
- alert( 'No photos selected' );
1904
- return false;
1905
- }
1906
- var action = document.getElementById( 'wppa-bulk-action' ).value;
1907
- switch ( action ) {
1908
- case '':
1909
- alert( 'No action selected' );
1910
- return false;
1911
- break;
1912
- case 'wppa-bulk-delete':
1913
- break;
1914
- case 'wppa-bulk-move-to':
1915
- case 'wppa-bulk-copy-to':
1916
- var album = document.getElementById( 'wppa-bulk-album' ).value;
1917
- if ( album == 0 ) {
1918
- alert( 'No album selected' );
1919
- return false;
1920
- }
1921
- break;
1922
- case 'wppa-bulk-status':
1923
- var status = document.getElementById( 'wppa-bulk-status' ).value;
1924
- if ( status == 0 ) {
1925
- alert( 'No status selected' );
1926
- return false;
1927
- }
1928
- break;
1929
- case 'wppa-bulk-owner':
1930
- var owner = documnet.getElementById( 'wppa-bulk-owner' ).value;
1931
- if ( owner == 0 ) {
1932
- alert( 'No new owner selected' );
1933
- return false;
1934
- }
1935
- break;
1936
- default:
1937
- alert( 'Unimplemented action requested: '+action );
1938
- return false;
1939
- break;
1940
-
1941
- }
1942
- return true;
1943
- }
1944
- function wppaSetThumbsize( elm ) {
1945
- var thumbsize = elm.value;
1946
- wppa_setCookie( 'wppa_bulk_thumbsize',thumbsize,365 );
1947
- jQuery( '.wppa-bulk-thumb' ).css( 'max-width', thumbsize+'px' );
1948
- jQuery( '.wppa-bulk-thumb' ).css( 'max-height', ( thumbsize/2 )+'px' );
1949
- jQuery( '.wppa-bulk-dec' ).css( 'height', ( thumbsize/2 )+'px' );
1950
- }
1951
- jQuery(document).ready( function() {
1952
- if ( !document.getElementById( 'wppa-bulk-action' ) ) return;
1953
- var action = wppa_getCookie( 'wppa_bulk_action' );
1954
- document.getElementById( 'wppa-bulk-action' ).value = action;
1955
- if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) {
1956
- jQuery( '#wppa-bulk-album' ).css( 'display','inline' );
1957
- document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' );
1958
- }
1959
- if ( action == 'wppa-bulk-status' ) {
1960
- jQuery( '#wppa-bulk-status' ).css( 'display','inline' );
1961
- document.getElementById( 'wppa-bulk-status' ).value = wppa_getCookie( 'wppa_bulk_status' );
1962
- }
1963
- if ( action == 'wppa-bulk-owner' ) {
1964
- jQuery( '#wppa-bulk-owner' ).css( 'display','inline' );
1965
- document.getElementById( 'wppa-bulk-owner' ).value = wppa_getCookie( 'wppa_bulk_owner' );
1966
- }
1967
- } );
1968
-
1969
- function wppaToggleConfirmDelete( elm ) {
1970
- var status = jQuery( elm ).prop( 'checked' );
1971
- if ( status ) {
1972
- wppa_setCookie( 'wppaConfirmDelete', 'checked', 365 );
1973
- }
1974
- else {
1975
- wppa_setCookie( 'wppaConfirmDelete', 'unchecked', 365 );
1976
- }
1977
- }
1978
- function wppaToggleConfirmMove( elm ) {
1979
- var status = jQuery( elm ).prop( 'checked' );
1980
- if ( status ) {
1981
- wppa_setCookie( 'wppaConfirmMove', 'checked', 365 );
1982
- }
1983
- else {
1984
- wppa_setCookie( 'wppaConfirmMove', 'unchecked', 365 );
1985
- }
1986
- }
1987
- function wppaSetConfirmDelete( id ) {
1988
- var status = wppa_getCookie( 'wppaConfirmDelete' );
1989
- if ( status == 'checked' ) {
1990
- jQuery( '#' + id ).prop( 'checked', true );
1991
- }
1992
- else {
1993
- jQuery( '#' + id ).prop( 'checked', false );
1994
- }
1995
- }
1996
- function wppaSetConfirmMove( id ) {
1997
- var status = wppa_getCookie( 'wppaConfirmMove' );
1998
- if ( status == 'checked' ) {
1999
- jQuery( '#' + id ).prop( 'checked', true );
2000
- }
2001
- else {
2002
- jQuery( '#' + id ).prop( 'checked', false );
2003
- }
2004
- }
2005
-
2006
  // Replace log
2007
  function wppaAjaxReplaceLog() {
2008
 
@@ -2026,28 +1912,3 @@ function wppaAjaxReplaceLog() {
2026
  }
2027
  });
2028
  }
2029
-
2030
- // Hide admin spinner
2031
- jQuery(document).ready( function() {
2032
- setTimeout( "wppaTestAdminReady()", 200 );
2033
- });
2034
- function wppaTestAdminReady() {
2035
- if ( document.readyState === "complete" ) {
2036
- jQuery( "#wppa-admin-spinner" ).fadeOut();
2037
- }
2038
- else {
2039
- setTimeout( "wppaTestAdminReady()", 200 );
2040
- }
2041
- }
2042
-
2043
- // Util for comment admin
2044
- function wppaCommentAdminUpdateHref( id ) {
2045
-
2046
- var val = encodeURIComponent(jQuery("#commenttext-"+id).val());
2047
- var href = jQuery("#href-"+id).attr("href");
2048
- var arr = href.split("commenttext=");
2049
- arr[1] = val;
2050
- href = arr[0] + "commenttext=" + arr[1];
2051
- jQuery("#href-"+id).attr("href", href);
2052
- jQuery("#href-"+id).css("display","inline");
2053
- }
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 8.1.00.001
5
  /* Various js routines used in admin pages
6
  */
7
 
1014
  url += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1015
  if (elem.checked) url += '&value=yes';
1016
  else url += '&value=no';
1017
+ //wppaConsoleLog(url,'force');
1018
  // Process the result
1019
  xmlhttp.onreadystatechange=function() {
1020
  switch (xmlhttp.readyState) {
1153
  if ( ! asCronJob ) {
1154
  jQuery("#"+slug+"_status").html('Pending');
1155
  }
 
 
 
1156
  },
1157
 
1158
  error: function( xhr, status, error ) {
1263
  jQuery( '.ui-widget-overlay' ).css({
1264
  backgroundColor: 'transparent',
1265
  });
 
 
 
 
 
 
 
 
1266
  }
1267
  }
1268
 
1374
  if (idx < temp.length) result += '||PLUS||';
1375
  }
1376
 
1377
+ // alert('encoded result='+result);
1378
  return result;
1379
  }
1380
 
1402
  }
1403
 
1404
  function wppaPhotoStatusChange(id) {
 
1405
  // Init
1406
  jQuery('#psdesc-'+id).css({display: 'none'});
1407
  if ( ! jQuery('#status-'+id) ) return;
1502
  document.location.reload( true );
1503
  }
1504
  }
1505
+ /*
1506
+ function wppaTrim (str, chr) {
1507
+ if ( ! chr ) {
1508
+ */
1509
+ // return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
1510
+ /* }
1511
+ else {
1512
+ // Ltrim
1513
+ while ( str.substr( 0,1 ) == chr ) {
1514
+ str = str.substr( 1 );
1515
+ }
1516
+ // Rtrim
1517
+ while ( str.substr( str.length-1, 1 ) == chr ) {
1518
+ str = str.substr( 0, str.length-1 );
1519
+ }
1520
+ }
1521
+ return str;
1522
+ }
1523
+ */
1524
  var wppaFeCount = 0;
1525
  function wppaFeAjaxLog(key) {
1526
 
1705
  type: 'GET',
1706
  timeout: 100000,
1707
  beforeSend: function( xhr ) {
 
1708
  },
1709
  success: function( result, status, xhr ) {
1710
 
1723
  }
1724
  jQuery( '#' + slug + '_status' ).html( New );
1725
 
1726
+ setTimeout( function() {wppaAjaxUpdateTogo(slug);}, 5000 );
1727
  },
1728
  error: function( xhr ) {
1729
  },
1814
  }
1815
 
1816
  function wppaAjaxGetSpinnerHtml( type, target ) {
1817
+ //alert(type+' '+target);
1818
  jQuery.ajax( { url: wppaAjaxUrl,
1819
  data: 'action=wppa' +
1820
  '&wppa-action=update-option' +
1827
  beforeSend: function( xhr ) {
1828
  },
1829
  success: function( result, status, xhr ) {
1830
+ //alert(result);
1831
  // Split status and data
1832
  var data = result.split('|');
1833
 
1836
 
1837
  },
1838
  error: function( xhr ) {
1839
+ //alert('Error');
1840
  },
1841
  complete: function( xhr ) {
1842
+ //alert('Complete');
1843
  }
1844
  } );
1845
  }
1848
  // Movable horizon on photo admin page
1849
  function wppaDragHorizon(elmnt) {
1850
 
1851
+ // var pos1 = 0, pos3 = 0;
1852
  var pos2 = 0, pos4 = 0;
1853
 
1854
  elmnt.onmousedown = dragMouseDown;
1889
  }
1890
  }
1891
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1892
  // Replace log
1893
  function wppaAjaxReplaceLog() {
1894
 
1912
  }
1913
  });
1914
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/wppa-admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var i=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;i.open("POST",wppaAjaxUrl+a,!0),i.onload=function(){if(200===i.status){var e=wppaTrim(i.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},i.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a){var p="",n="",p=e||'<div style="padding-left:5px;" >';a?n=a:aftrer="</div>",wppaFeAjaxLog("in");var o=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,o.open("GET",a,!0),o.send(),o.onreadystatechange=function(){switch(o.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==o.status?("ER"==(e=wppaTrim(o.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=p+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=p+'<span style="color:red;" >Comm error '+o.status+": "+o.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(i,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+i+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(i,l,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+i+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"visible"}),jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+n+"-"+i).html(r)}}"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,i=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,i=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],i=o),wppaAlbumUpdateMatrix[i][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[i][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,i,l,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(i),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=i||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(l)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?(r||jQuery("#"+n+"_status").html("Pending"),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),setTimeout(function(){jQuery("#wppa-maintenance-list").niceScroll&&jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{})},1e3))}function wppaAjaxUpdateOptionValue(i,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(i)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+i,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+i.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+i).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=i&&"icon_corner_style"!=i||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=i&&"svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=i&&"ovl_svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,i=0;i<e.length;)0!=(a=e[i].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),i++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaBulkActionChange(e,t){wppa_setCookie("wppa_bulk_action",e.value,365),"wppa-bulk-move-to"==e.value||"wppa-bulk-copy-to"==e.value?jQuery("#wppa-bulk-album").css("display","inline"):jQuery("#wppa-bulk-album").css("display","none"),"wppa-bulk-status"==e.value?jQuery("#wppa-bulk-status").css("display","inline"):jQuery("#wppa-bulk-status").css("display","none"),"wppa-bulk-owner"==e.value?jQuery("#wppa-bulk-owner").css("display","inline"):jQuery("#wppa-bulk-owner").css("display","none")}function wppaBulkDoitOnClick(){var e=jQuery(".wppa-bulk-photo"),t=0;for(i=0;i<e.length;i++)e[i].checked&&t++;if(0==t)return alert("No photos selected"),!1;var a=document.getElementById("wppa-bulk-action").value;switch(a){case"":return alert("No action selected"),!1;case"wppa-bulk-delete":break;case"wppa-bulk-move-to":case"wppa-bulk-copy-to":if(0==document.getElementById("wppa-bulk-album").value)return alert("No album selected"),!1;break;case"wppa-bulk-status":if(0==document.getElementById("wppa-bulk-status").value)return alert("No status selected"),!1;break;case"wppa-bulk-owner":if(0==documnet.getElementById("wppa-bulk-owner").value)return alert("No new owner selected"),!1;break;default:return alert("Unimplemented action requested: "+a),!1}return!0}function wppaSetThumbsize(e){e=e.value;wppa_setCookie("wppa_bulk_thumbsize",e,365),jQuery(".wppa-bulk-thumb").css("max-width",e+"px"),jQuery(".wppa-bulk-thumb").css("max-height",e/2+"px"),jQuery(".wppa-bulk-dec").css("height",e/2+"px")}function wppaToggleConfirmDelete(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmDelete","checked",365):wppa_setCookie("wppaConfirmDelete","unchecked",365)}function wppaToggleConfirmMove(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmMove","checked",365):wppa_setCookie("wppaConfirmMove","unchecked",365)}function wppaSetConfirmDelete(e){"checked"==wppa_getCookie("wppaConfirmDelete")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaSetConfirmMove(e){"checked"==wppa_getCookie("wppaConfirmMove")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}function wppaTestAdminReady(){"complete"===document.readyState?jQuery("#wppa-admin-spinner").fadeOut():setTimeout("wppaTestAdminReady()",200)}function wppaCommentAdminUpdateHref(e){var t=encodeURIComponent(jQuery("#commenttext-"+e).val()),a=jQuery("#href-"+e).attr("href"),p=a.split("commenttext=");p[1]=t,a=p[0]+"commenttext="+p[1],jQuery("#href-"+e).attr("href",a),jQuery("#href-"+e).css("display","inline")}jQuery(document).ready(function(){var e=wppa_getCookie("wppa_bulk_action");"wppa-bulk-move-to"!=(document.getElementById("wppa-bulk-action").value=e)&&"wppa-bulk-copy-to"!=e||(jQuery("#wppa-bulk-album").css("display","inline"),document.getElementById("wppa-bulk-album").value=wppa_getCookie("wppa_bulk_album")),"wppa-bulk-status"==e&&(jQuery("#wppa-bulk-status").css("display","inline"),document.getElementById("wppa-bulk-status").value=wppa_getCookie("wppa_bulk_status")),"wppa-bulk-owner"==e&&(jQuery("#wppa-bulk-owner").css("display","inline"),document.getElementById("wppa-bulk-owner").value=wppa_getCookie("wppa_bulk_owner"))}),jQuery(document).ready(function(){setTimeout("wppaTestAdminReady()",200)});
1
+ function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var i=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;i.open("POST",wppaAjaxUrl+a,!0),i.onload=function(){if(200===i.status){var e=wppaTrim(i.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},i.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a){var p="",n="",p=e||'<div style="padding-left:5px;" >';a?n=a:aftrer="</div>",wppaFeAjaxLog("in");var o=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,o.open("GET",a,!0),o.send(),o.onreadystatechange=function(){switch(o.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==o.status?("ER"==(e=wppaTrim(o.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=p+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=p+'<span style="color:red;" >Comm error '+o.status+": "+o.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(i,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+i+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(i,l,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+i+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"visible"}),jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+n+"-"+i).html(r)}}"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,i=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,i=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],i=o),wppaAlbumUpdateMatrix[i][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[i][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,i,l,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(i),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=i||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(l)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?r||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}))}function wppaAjaxUpdateOptionValue(i,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(i)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+i,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+i.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+i).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=i&&"icon_corner_style"!=i||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=i&&"svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=i&&"ovl_svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,i=0;i<e.length;)0!=(a=e[i].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),i++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}
js/wppa-all.js CHANGED
@@ -1,7 +1,7 @@
1
  // wppa-utils
2
  function wppaAnimate(e,t,a,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(t),i&&setTimeout(i,10)):jQuery(e).stop().animate(t,a,p,i)}function wppaFadeIn(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),a&&setTimeout(a,10)):jQuery(e).stop().fadeIn(t,a)}function wppaFadeOut(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),a&&setTimeout(a,10)):jQuery(e).stop().fadeOut(t,a)}function wppaFadeTo(e,t,a,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:a}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(t,a,p)}function wppaTrim(e,t){e=wppaTrimLeft(e,t);return e=wppaTrimRight(e,t)}function wppaTrimLeft(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(0,i)==t;)p=(a=a.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimLeft(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/^\s\s*/,"")}return a}function wppaTrimRight(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(p-i)==t;)p=(a=a.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimRight(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/\s\s*$/,"")}return a}function wppa_setCookie(e,t,a){var p=new Date;p.setDate(p.getDate()+a);p=escape(t)+(null==a?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var t,a,p=document.cookie.split(";"),i=0;i<p.length;i++)if(t=p[i].substr(0,p[i].indexOf("=")),a=p[i].substr(p[i].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==e)return unescape(a);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){var a,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=t||(a=(new Date).getTime()%864e5,a-=60*(p=Math.floor(a/36e5))*60*1e3,a-=60*(i=Math.floor(a/6e4))*1e3,t=Math.floor(a/1e3),console.log("At: "+p+":"+i+":"+t+"."+(a-=1e3*t)+" message: "+e))}function wppaSvgHtml(e,t,a,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}t=t||"32px",a="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):a?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==a&&(a="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(t?"height:"+t+";":"")+"fill:"+s+";background-color:"+a+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}var wppaMakeLazyVisibleScrollEndTimer;function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(function(){wppaMakeLazyVisible("scrollend")},wppaScrollEndDelay)}wppaJsUtilsVersion="8.0.04.006";var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(e){if(wppaLazyLoad&&!wppaLazyBusy){wppaLazyBusy=!0;var t,a=new Date,p=a.getTime();if(p<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible("selftimer")},100),void(wppaLazyBusy=!1);wppaInitMasonryPlus(),wppaLastLazy=p,clearTimeout(wppaLazyTimer);var i=0;jQuery("*[data-src]").each(function(){t=jQuery(this).attr("data-src"),wppaIsElementInViewport(this)&&(jQuery(this).attr("src",t),jQuery(this).removeAttr("data-src"),i++)}),0<i&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&(setTimeout(function(){jQuery("div").getNiceScroll().resize()},500),setTimeout(function(){jQuery("div").getNiceScroll().resize()},1500)),setTimeout(function(){jQuery(".wppa-box").trigger("scroll"),jQuery("body").trigger("scroll")},250)),p=(a=new Date).getTime(),wppaLastLazy=p,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var t=jQuery(e);t[0]&&"BODY"!=t[0].nodeName;){if("none"==jQuery(t[0]).css("display"))return!1;var a=jQuery(t[0]).css("visibility");if("hidden"==a||"collapse"==a)return!1;t=jQuery(t[0]).parent()}e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||(wppaIsMobile?0<e.bottom&&0<e.right&&e.left<3*screen.width&&e.top<3*screen.height:0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight())}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,t,a){a=a?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==a?t:(wppaIsMini[e]?a/2:a)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var t=e.parentNode.clientWidth;jQuery(e).css({maxWidth:t})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,t,a=jQuery;wppaOvlOpen&&(t=wppaIsFs()?(a(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(a(".wppa-pctl-div-lb").css({position:"initial"}),a("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(t-=20),t<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(t/12-4))&&(a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?a(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):a(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),a(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,t,a){},error:function(e,t,a){wppaConsoleLog("wppaServerLog failed. Error = "+a+", status = "+t,"force")}})}function wppaTimNow(){return(new Date).getTime()}function wppaShowCoords(e){e=e.getBoundingClientRect();alert("Top = "+parseInt(e.top)+", Left = "+parseInt(e.left)+", WinH = "+jQuery(window).height()+", WinW = "+jQuery(window).width()+", Scrolltop = "+jQuery(document).scrollTop())}
3
  // wppa
4
- function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.1.00.005",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)}),jQuery(document).ready(function(){jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",wppaNieScrollOpts)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){jQuery(".wppa-ss-button").each(function(){mocc=jQuery(this).attr("data-mocc"),wppaSuperSearchSelect(mocc)})}),jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="8.0.10.001";function wppaStoreSlideInfo(p,a,e,t,i,w,r,n,o,l,s,d,u,_,m,c,y,h,S,g,x,f,I,j,Q,b,v,N,T,C,k,R,F){o=wppaRepairScriptTags(o),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFilmThumbTitles[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=N,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+N+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]='<span class="sdf-'+p+'" >'+wppaRepairBrTags(r)+"</span>",_wppaNames[p][a]='<span class="sdn-'+p+'" >'+n+"</span>",_wppaFilmThumbTitles[p][a]=n,_wppaDsc[p][a]=o,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=y,""!=h?_wppaLinkTarget[p][a]=h:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=x,_wppaExifHtml[p][a]=f,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=N,_wppaAudioHtml[p][a]=T,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){wppaSlideInitRunning[p]&&("start"==wppaSlideInitRunning[p]?a=-1:"stopprev"==wppaSlideInitRunning[p]?a=_wppaSlides[p].length-1:"stopnext"==wppaSlideInitRunning[p]&&(a=0),wppaSlideInitRunning[p]=""),_wppaIsBusy[p]?_wppaTP[p]=a:(_wppaSSRuns[p]?(_wppaStop(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))):(_wppaStart(p,a),-1==a&&jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0)))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(n=_wppaRealId[p],_wppaLat[p][n[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][n[_wppaNxtIdx[p]]],_wppaLon[p][n[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,n=_wppaNxtIdx[p],o=(wppaNumbarMax-1)/2;n<o?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-o<n?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=n+o+.5-1,(i=n-o+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(o=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",o,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",o,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,n="#theimg"+e+"-"+p,o="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(n,wppaAnimationSpeed),setTimeout(wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:-l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"none":wppaFadeIn(o,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(n,wppaAnimationSpeed),wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p,wppaEasingSlide),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){wppaSlideInitRunning[p]="start",jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect()}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),n=e.naturalWidth;void 0===n&&(n=parseInt(e.style.maxWidth));var o=e.naturalHeight;void 0===o&&(o=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,y,h,S,g,x,f,e=wppaStretch;if(u)j=w-d,h=y=0,x=S=w,f=g=(c=parseInt(j*o/n))+d,jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c});else{if(s<(x=w)&&(x=s),S=x,g=f=parseInt(x*l),e||x-d<=n||f-d<=o?l<(o+d)/(n+d)?(c=f-d,j=parseInt(c*n/o)):(j=x-d,c=parseInt(j*o/n)):(j=n,c=o),"default"!=_&&"none"!=_){switch(_){case"top":h=0;break;case"center":h=parseInt((f-(c+d))/2);break;case"bottom":h=f-(c+d);break;case"fit":h=0,g=f=c+d}jQuery("#"+a).css({marginTop:h,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),I=(x-j)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:j,left:I}))}var j=parseInt(x/3),I=2*j,r=0<r.length?f-wppaAudioHeight-wppaSlideBorderWidth-h:f;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:I})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return t=wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var n,o,l=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"";if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>";else if(""==wppaLightBox[p])t="<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" ></a>',d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),o=".pdf"==(n=_wppaHiresUrl[p][e]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(wppaSlideLinkEqual?' onclick="wppaStopAudio();wppaStopShow('+p+");jQuery('#wppa-film-"+e+"-"+p+"').trigger('click');return false;\"":' onclick="wppaStopAudio();wppaStopShow('+p+');"')+' style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+">"+(o?"<iframe "+l+' src="'+n+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if("linear"!=a&&(a=wppaEasingSlide),document.getElementById("wppa-filmstrip-"+p)&&_wppaSlides[p]){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var n=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(n))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):(n=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(n<i?2:i<n-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w}):(i<n-1.5*w||n+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i}),wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible("filmstripmocc="+p),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var o=0;o<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][o]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+o+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==o?(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]))),o++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery("#wppa-next-pagelink-"+p).trigger("click")):0<e.length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery(e).trigger("click")):_wppaNextSlide(p,_wppaNxtIdx[p]=0)):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopprev",jQuery("#wppa-prev-page-last-item-"+p).trigger("click")):(_wppaNxtIdx[p]+=_wppaSlides[p].length,_wppaNextSlide(p,0)):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a)}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p)}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSlides[p]&&(_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden")))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
1
  // wppa-utils
2
  function wppaAnimate(e,t,a,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(t),i&&setTimeout(i,10)):jQuery(e).stop().animate(t,a,p,i)}function wppaFadeIn(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),a&&setTimeout(a,10)):jQuery(e).stop().fadeIn(t,a)}function wppaFadeOut(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),a&&setTimeout(a,10)):jQuery(e).stop().fadeOut(t,a)}function wppaFadeTo(e,t,a,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:a}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(t,a,p)}function wppaTrim(e,t){e=wppaTrimLeft(e,t);return e=wppaTrimRight(e,t)}function wppaTrimLeft(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(0,i)==t;)p=(a=a.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimLeft(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/^\s\s*/,"")}return a}function wppaTrimRight(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(p-i)==t;)p=(a=a.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimRight(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/\s\s*$/,"")}return a}function wppa_setCookie(e,t,a){var p=new Date;p.setDate(p.getDate()+a);p=escape(t)+(null==a?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var t,a,p=document.cookie.split(";"),i=0;i<p.length;i++)if(t=p[i].substr(0,p[i].indexOf("=")),a=p[i].substr(p[i].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==e)return unescape(a);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){var a,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=t||(a=(new Date).getTime()%864e5,a-=60*(p=Math.floor(a/36e5))*60*1e3,a-=60*(i=Math.floor(a/6e4))*1e3,t=Math.floor(a/1e3),console.log("At: "+p+":"+i+":"+t+"."+(a-=1e3*t)+" message: "+e))}function wppaSvgHtml(e,t,a,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}t=t||"32px",a="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):a?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==a&&(a="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(t?"height:"+t+";":"")+"fill:"+s+";background-color:"+a+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}var wppaMakeLazyVisibleScrollEndTimer;function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(function(){wppaMakeLazyVisible("scrollend")},wppaScrollEndDelay)}wppaJsUtilsVersion="8.0.04.006";var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(e){if(wppaLazyLoad&&!wppaLazyBusy){wppaLazyBusy=!0;var t,a=new Date,p=a.getTime();if(p<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible("selftimer")},100),void(wppaLazyBusy=!1);wppaInitMasonryPlus(),wppaLastLazy=p,clearTimeout(wppaLazyTimer);var i=0;jQuery("*[data-src]").each(function(){t=jQuery(this).attr("data-src"),wppaIsElementInViewport(this)&&(jQuery(this).attr("src",t),jQuery(this).removeAttr("data-src"),i++)}),0<i&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&(setTimeout(function(){jQuery("div").getNiceScroll().resize()},500),setTimeout(function(){jQuery("div").getNiceScroll().resize()},1500)),setTimeout(function(){jQuery(".wppa-box").trigger("scroll"),jQuery("body").trigger("scroll")},250)),p=(a=new Date).getTime(),wppaLastLazy=p,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var t=jQuery(e);t[0]&&"BODY"!=t[0].nodeName;){if("none"==jQuery(t[0]).css("display"))return!1;var a=jQuery(t[0]).css("visibility");if("hidden"==a||"collapse"==a)return!1;t=jQuery(t[0]).parent()}e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||(wppaIsMobile?0<e.bottom&&0<e.right&&e.left<3*screen.width&&e.top<3*screen.height:0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight())}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,t,a){a=a?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==a?t:(wppaIsMini[e]?a/2:a)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var t=e.parentNode.clientWidth;jQuery(e).css({maxWidth:t})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,t,a=jQuery;wppaOvlOpen&&(t=wppaIsFs()?(a(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(a(".wppa-pctl-div-lb").css({position:"initial"}),a("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(t-=20),t<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(t/12-4))&&(a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?a(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):a(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),a(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,t,a){},error:function(e,t,a){wppaConsoleLog("wppaServerLog failed. Error = "+a+", status = "+t,"force")}})}function wppaTimNow(){return(new Date).getTime()}function wppaShowCoords(e){e=e.getBoundingClientRect();alert("Top = "+parseInt(e.top)+", Left = "+parseInt(e.left)+", WinH = "+jQuery(window).height()+", WinW = "+jQuery(window).width()+", Scrolltop = "+jQuery(document).scrollTop())}
3
  // wppa
4
+ function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.0.07.017",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="8.0.10.001";function wppaStoreSlideInfo(p,a,e,t,i,w,r,n,o,l,s,d,u,_,m,c,y,h,S,g,x,f,I,j,Q,b,v,N,T,C,k,R,F){o=wppaRepairScriptTags(o),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFilmThumbTitles[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=N,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+N+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]='<span class="sdf-'+p+'" >'+wppaRepairBrTags(r)+"</span>",_wppaNames[p][a]='<span class="sdn-'+p+'" >'+n+"</span>",_wppaFilmThumbTitles[p][a]=n,_wppaDsc[p][a]=o,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=y,""!=h?_wppaLinkTarget[p][a]=h:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=x,_wppaExifHtml[p][a]=f,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=N,_wppaAudioHtml[p][a]=T,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){wppaSlideInitRunning[p]&&("start"==wppaSlideInitRunning[p]?a=-1:"stopprev"==wppaSlideInitRunning[p]?a=_wppaSlides[p].length-1:"stopnext"==wppaSlideInitRunning[p]&&(a=0),wppaSlideInitRunning[p]=""),_wppaIsBusy[p]?_wppaTP[p]=a:(_wppaSSRuns[p]?(_wppaStop(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))):(_wppaStart(p,a),-1==a&&jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0)))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(n=_wppaRealId[p],_wppaLat[p][n[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][n[_wppaNxtIdx[p]]],_wppaLon[p][n[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,n=_wppaNxtIdx[p],o=(wppaNumbarMax-1)/2;n<o?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-o<n?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=n+o+.5-1,(i=n-o+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(o=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",o,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",o,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,n="#theimg"+e+"-"+p,o="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(n,wppaAnimationSpeed),setTimeout(wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:-l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"none":wppaFadeIn(o,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(n,wppaAnimationSpeed),wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p,wppaEasingSlide),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){wppaSlideInitRunning[p]="start",jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect()}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),n=e.naturalWidth;void 0===n&&(n=parseInt(e.style.maxWidth));var o=e.naturalHeight;void 0===o&&(o=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,y,h,S,g,x,f,e=wppaStretch;if(u)j=w-d,h=y=0,x=S=w,f=g=(c=parseInt(j*o/n))+d,jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c});else{if(s<(x=w)&&(x=s),S=x,g=f=parseInt(x*l),e||x-d<=n||f-d<=o?l<(o+d)/(n+d)?(c=f-d,j=parseInt(c*n/o)):(j=x-d,c=parseInt(j*o/n)):(j=n,c=o),"default"!=_&&"none"!=_){switch(_){case"top":h=0;break;case"center":h=parseInt((f-(c+d))/2);break;case"bottom":h=f-(c+d);break;case"fit":h=0,g=f=c+d}jQuery("#"+a).css({marginTop:h,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),I=(x-j)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:j,left:I}))}var j=parseInt(x/3),I=2*j,r=0<r.length?f-wppaAudioHeight-wppaSlideBorderWidth-h:f;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:I})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return t=wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var n,o,l=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"";if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>";else if(""==wppaLightBox[p])t="<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" ></a>',d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),o=".pdf"==(n=_wppaHiresUrl[p][e]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(wppaSlideLinkEqual?' onclick="wppaStopAudio();wppaStopShow('+p+");jQuery('#wppa-film-"+e+"-"+p+"').trigger('click');return false;\"":' onclick="wppaStopAudio();wppaStopShow('+p+');"')+' style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+">"+(o?"<iframe "+l+' src="'+n+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if("linear"!=a&&(a=wppaEasingSlide),document.getElementById("wppa-filmstrip-"+p)&&_wppaSlides[p]){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var n=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(n))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):(n=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(n<i?2:i<n-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w}):(i<n-1.5*w||n+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i}),wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible("filmstripmocc="+p),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var o=0;o<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][o]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+o+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==o?(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]))),o++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery("#wppa-next-pagelink-"+p).trigger("click")):0<e.length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery(e).trigger("click")):_wppaNextSlide(p,_wppaNxtIdx[p]=0)):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopprev",jQuery("#wppa-prev-page-last-item-"+p).trigger("click")):(_wppaNxtIdx[p]+=_wppaSlides[p].length,_wppaNextSlide(p,0)):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a)}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p)}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSlides[p]&&(_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden")))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
js/wppa-gutenberg-wppa.js CHANGED
@@ -1,7 +1,7 @@
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
- * Version 8.1.00.007
5
  */
6
 
7
  // Global vars
@@ -382,10 +382,10 @@ function wppaGutenbergGalleryEvaluate() {
382
  if ( ! wppaIsEmpty( album ) ) {
383
  jQuery('#wppagallery-album-virt').css('color', '#070');
384
  switch ( album ) {
385
- case '@topten':
386
- case '@lasten':
387
- case '@featen':
388
- case '@comten':
389
  jQuery('#wppagallery-album-realopt-tr').show();
390
 
391
  // We use parent here for optional album(s), because album is already used for virtual album type
@@ -404,7 +404,7 @@ function wppaGutenbergGalleryEvaluate() {
404
  jQuery('#wppagallery-photo-count-tr').show();
405
  count = jQuery('#wppagallery-photo-count').val();
406
  break;
407
- case '@tags':
408
  jQuery('#wppagallery-phototags-tr').show();
409
  jQuery('#wppagallery-tags-cats-tr').show();
410
  andor = jQuery('[name=andor]:checked').val();
@@ -426,13 +426,13 @@ function wppaGutenbergGalleryEvaluate() {
426
  }
427
  tags = wppaArrayToEnum( tagarr, sep );
428
  break;
429
- case '@last':
430
  jQuery('#wppagallery-album-parent-tr').show();
431
  parent = jQuery('#wppagallery-album-parent-parent').val();
432
  jQuery('#wppagallery-album-count-tr').show();
433
  count = jQuery('#wppagallery-album-count').val();
434
  break;
435
- case '@cat':
436
  jQuery('#wppagallery-albumcat-tr').show();
437
  jQuery('#wppagallery-tags-cats-tr').show();
438
  andor = jQuery('[name=andor]:checked').val();
@@ -454,8 +454,8 @@ function wppaGutenbergGalleryEvaluate() {
454
  }
455
  cats = wppaArrayToEnum( catarr, sep );
456
  break;
457
- case '@owner':
458
- case '@upldr':
459
  jQuery('#wppagallery-owner-tr').show();
460
  needOwner = true;
461
  owner = jQuery('#wppagallery-owner').val();
@@ -466,20 +466,20 @@ function wppaGutenbergGalleryEvaluate() {
466
  parent = parent.toString().replace( 'zero', '0' );
467
  }
468
  break;
469
- case '@all':
470
  break;
471
  default:
472
  if ( album != null ) {
473
  alert( wppaUIERR + ': ' + album );
474
  }
475
  }
476
- if ( ( album != '@cat' || cats != '' ) &&
477
- ( album != '@owner' || owner != '' ) &&
478
- ( album != '@upldr' || owner != '' ) &&
479
- ( album != '@topten' || parent != '' ) &&
480
- ( album != '@lasten' || parent != '' ) &&
481
- ( album != '@comten' || parent != '' ) &&
482
- ( album != '@featen' || parent != '' ) ) {
483
  }
484
  }
485
  break;
@@ -629,7 +629,6 @@ function wppaGutenbergGalleryEvaluate() {
629
 
630
  // Display shortcode
631
  dispShortcode = shortcode.replace(/"/g, '&quot;');
632
- dispShortcode = dispShortcode.replace(/@/g, '&#35;');
633
  html = '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+dispShortcode+'" />';
634
  jQuery('#wppagallery-shortcode-preview-container').html( html );
635
 
@@ -672,8 +671,6 @@ function wppaGutenbergGalleryEvaluate() {
672
 
673
  if ( shortcodeOk ) {
674
  result = shortcode.replace( /#/g, '@' );
675
- result = shortcode.replace( /"/g, '\"' );
676
- result = shortcode.replace( /'/g, "\'" );
677
  }
678
  else {
679
  result = '';
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
+ * Version 7.5.10
5
  */
6
 
7
  // Global vars
382
  if ( ! wppaIsEmpty( album ) ) {
383
  jQuery('#wppagallery-album-virt').css('color', '#070');
384
  switch ( album ) {
385
+ case '#topten':
386
+ case '#lasten':
387
+ case '#featen':
388
+ case '#comten':
389
  jQuery('#wppagallery-album-realopt-tr').show();
390
 
391
  // We use parent here for optional album(s), because album is already used for virtual album type
404
  jQuery('#wppagallery-photo-count-tr').show();
405
  count = jQuery('#wppagallery-photo-count').val();
406
  break;
407
+ case '#tags':
408
  jQuery('#wppagallery-phototags-tr').show();
409
  jQuery('#wppagallery-tags-cats-tr').show();
410
  andor = jQuery('[name=andor]:checked').val();
426
  }
427
  tags = wppaArrayToEnum( tagarr, sep );
428
  break;
429
+ case '#last':
430
  jQuery('#wppagallery-album-parent-tr').show();
431
  parent = jQuery('#wppagallery-album-parent-parent').val();
432
  jQuery('#wppagallery-album-count-tr').show();
433
  count = jQuery('#wppagallery-album-count').val();
434
  break;
435
+ case '#cat':
436
  jQuery('#wppagallery-albumcat-tr').show();
437
  jQuery('#wppagallery-tags-cats-tr').show();
438
  andor = jQuery('[name=andor]:checked').val();
454
  }
455
  cats = wppaArrayToEnum( catarr, sep );
456
  break;
457
+ case '#owner':
458
+ case '#upldr':
459
  jQuery('#wppagallery-owner-tr').show();
460
  needOwner = true;
461
  owner = jQuery('#wppagallery-owner').val();
466
  parent = parent.toString().replace( 'zero', '0' );
467
  }
468
  break;
469
+ case '#all':
470
  break;
471
  default:
472
  if ( album != null ) {
473
  alert( wppaUIERR + ': ' + album );
474
  }
475
  }
476
+ if ( ( album != '#cat' || cats != '' ) &&
477
+ ( album != '#owner' || owner != '' ) &&
478
+ ( album != '#upldr' || owner != '' ) &&
479
+ ( album != '#topten' || parent != '' ) &&
480
+ ( album != '#lasten' || parent != '' ) &&
481
+ ( album != '#comten' || parent != '' ) &&
482
+ ( album != '#featen' || parent != '' ) ) {
483
  }
484
  }
485
  break;
629
 
630
  // Display shortcode
631
  dispShortcode = shortcode.replace(/"/g, '&quot;');
 
632
  html = '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+dispShortcode+'" />';
633
  jQuery('#wppagallery-shortcode-preview-container').html( html );
634
 
671
 
672
  if ( shortcodeOk ) {
673
  result = shortcode.replace( /#/g, '@' );
 
 
674
  }
675
  else {
676
  result = '';
js/wppa.js CHANGED
@@ -3,7 +3,7 @@
3
  // contains common vars and functions
4
  //
5
 
6
- wppaWppaVer = '8.1.00.005';
7
 
8
  // Tabby click function
9
  function wppaTabbyClick(){
@@ -186,11 +186,6 @@ function wppaSizeAutoDiv() {
186
  });
187
  }
188
 
189
- // Add nicescroller to thumbarea
190
- jQuery(document).ready(function(){
191
- jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",wppaNieScrollOpts);
192
- });
193
-
194
  var wppaLastAllAutocols = 0;
195
  var wppaLastAllAutocolsTimer = 0;
196
  // Do the auto cols
@@ -979,32 +974,23 @@ function wppaUrlToId( url ) {
979
  return temp;
980
  }
981
 
982
- // Init supersearch
983
- jQuery(document).ready(function () {
984
- jQuery('.wppa-ss-button').each(function(){
985
- mocc = jQuery(this).attr('data-mocc');
986
- wppaSuperSearchSelect(mocc);
987
- });
988
- });
989
-
990
-
991
  // Opens/closes selection boxes in supersearch html
992
  function wppaSuperSearchSelect( mocc, go ) {
993
 
994
  // Init
995
  jQuery( '#wppa-ss-albumopt-'+mocc ).css('display', 'none');
996
- jQuery( '#wppa-ss-albumcat-'+mocc ).css('display', 'none');
997
- jQuery( '#wppa-ss-albumname-'+mocc ).css('display', 'none');
998
- jQuery( '#wppa-ss-albumtext-'+mocc ).css('display', 'none');
999
- jQuery( '#wppa-ss-photoopt-'+mocc ).css('display', 'none');
1000
- jQuery( '#wppa-ss-photoname-'+mocc ).css('display', 'none');
1001
- jQuery( '#wppa-ss-photoowner-'+mocc ).css('display', 'none');
1002
- jQuery( '#wppa-ss-phototag-'+mocc ).css('display', 'none');
1003
- jQuery( '#wppa-ss-phototext-'+mocc ).css('display', 'none');
1004
- jQuery( '#wppa-ss-photoexif-'+mocc ).css('display', 'none');
1005
- jQuery( '#wppa-ss-photoiptc-'+mocc ).css('display', 'none');
1006
- jQuery( '#wppa-ss-exifopts-'+mocc ).css('display', 'none');
1007
- jQuery( '#wppa-ss-iptcopts-'+mocc ).css('display', 'none');
1008
 
1009
  jQuery( '#wppa-ss-spinner-'+mocc ).css('display', 'none');
1010
  jQuery( '#wppa-ss-button-'+mocc ).css('display', 'none');
3
  // contains common vars and functions
4
  //
5
 
6
+ wppaWppaVer = '8.0.07.017';
7
 
8
  // Tabby click function
9
  function wppaTabbyClick(){
186
  });
187
  }
188
 
 
 
 
 
 
189
  var wppaLastAllAutocols = 0;
190
  var wppaLastAllAutocolsTimer = 0;
191
  // Do the auto cols
974
  return temp;
975
  }
976
 
 
 
 
 
 
 
 
 
 
977
  // Opens/closes selection boxes in supersearch html
978
  function wppaSuperSearchSelect( mocc, go ) {
979
 
980
  // Init
981
  jQuery( '#wppa-ss-albumopt-'+mocc ).css('display', 'none');
982
+ jQuery( '#wppa-ss-albumcat-'+mocc ).css('display', 'none');
983
+ jQuery( '#wppa-ss-albumname-'+mocc ).css('display', 'none');
984
+ jQuery( '#wppa-ss-albumtext-'+mocc ).css('display', 'none');
985
+ jQuery( '#wppa-ss-photoopt-'+mocc ).css('display', 'none');
986
+ jQuery( '#wppa-ss-photoname-'+mocc ).css('display', 'none');
987
+ jQuery( '#wppa-ss-photoowner-'+mocc ).css('display', 'none');
988
+ jQuery( '#wppa-ss-phototag-'+mocc ).css('display', 'none');
989
+ jQuery( '#wppa-ss-phototext-'+mocc ).css('display', 'none');
990
+ jQuery( '#wppa-ss-photoexif-'+mocc ).css('display', 'none');
991
+ jQuery( '#wppa-ss-photoiptc-'+mocc ).css('display', 'none');
992
+ jQuery( '#wppa-ss-exifopts-'+mocc ).css('display', 'none');
993
+ jQuery( '#wppa-ss-iptcopts-'+mocc ).css('display', 'none');
994
 
995
  jQuery( '#wppa-ss-spinner-'+mocc ).css('display', 'none');
996
  jQuery( '#wppa-ss-button-'+mocc ).css('display', 'none');
js/wppa.min.js CHANGED
@@ -1 +1 @@
1
- function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.1.00.005",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)}),jQuery(document).ready(function(){jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",wppaNieScrollOpts)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){jQuery(".wppa-ss-button").each(function(){mocc=jQuery(this).attr("data-mocc"),wppaSuperSearchSelect(mocc)})}),jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
1
+ function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.0.07.017",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
theme/wppa-style.css CHANGED
@@ -529,7 +529,7 @@ display:none;
529
  font-weight:bold;
530
  }
531
  .wppa-real-calendar-caption {
532
- text-align:center !important;
533
  font-size:1.4em;
534
  }
535
  .wppa-real-calendar-days {
@@ -644,18 +644,3 @@ display:none;
644
  text-align:right !important;
645
  padding-right: 2% !important;
646
  }
647
-
648
- /* Grid box */
649
- .wppa-grid {
650
- border:none;
651
- margin:0 !important;
652
- padding:0 !important;
653
- }
654
- .wppa-grid tr {
655
- border:none;
656
- }
657
- .wppa-grid td {
658
- border:none;
659
- padding:6px;
660
- vertical-align:middle;
661
- }
529
  font-weight:bold;
530
  }
531
  .wppa-real-calendar-caption {
532
+
533
  font-size:1.4em;
534
  }
535
  .wppa-real-calendar-days {
644
  text-align:right !important;
645
  padding-right: 2% !important;
646
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 8.0.09.003
7
  *
8
  */
9
 
@@ -934,7 +934,21 @@ function wppa_admin_spinner() {
934
  'margin-top:-33px;' .
935
  'z-index:9999999;' .
936
  '"' .
937
- ' />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
938
  echo $result;
939
  }
940
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 8.0.09.001
7
  *
8
  */
9
 
934
  'margin-top:-33px;' .
935
  'z-index:9999999;' .
936
  '"' .
937
+ ' />' .
938
+ '<script type="text/javascript" >' .
939
+ /* 'jQuery( "#wppa-admin-spinner" ).css( { left:(screen.width/2-33),top:(screen.height/2-33) } );' . */
940
+ 'jQuery(document).ready( function() { ' .
941
+ 'setTimeout( "wppaTestAdminReady()", 200 ); ' .
942
+ '} );' .
943
+ 'function wppaTestAdminReady() { ' .
944
+ ' if ( document.readyState === "complete" ) {' .
945
+ 'jQuery( "#wppa-admin-spinner" ).fadeOut(); ' .
946
+ ' } else { ' .
947
+ ' setTimeout( "wppaTestAdminReady()", 200 ); ' .
948
+ '}' .
949
+ '}' .
950
+ '</script>';
951
+
952
  echo $result;
953
  }
954
 
wppa-admin-styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
- * version 8.1.00.007
5
  */
6
  #files_list, #files_list2
7
  {
@@ -285,180 +285,3 @@ border:1px solid black;
285
  /*.wppa-links table { border-top:1px solid #ccc; margin:0; padding:0; }*/
286
  .wppa-links td { margin:0 !important; padding:0 10px !important; }
287
 
288
- /* Album admin used styles */
289
- .sortable-placeholder-albums {
290
- width: 100%;
291
- height: 60px;
292
- margin: 5px;
293
- border: 1px dotted #cccccc;
294
- border-radius:3px;
295
- float: left;
296
- }
297
- .ui-state-default-albums {
298
- position: relative;
299
- width: 100%;
300
- height: 60px;
301
- margin: 5px;
302
- border: 1px solid #cccccc;
303
- border-radius:3px;
304
- float: left;
305
- }
306
- .ui-state-default-albums td {
307
- padding:0 !important;
308
- line-height:12px !important;
309
- text-align:center !important;
310
- }
311
- #src-alb{
312
- color:transparent;
313
- }
314
- /* Comment admin */
315
- .column-photo {
316
- width:180px;
317
- }
318
- .column-user, .column-email, .column-timestamp {
319
- width:180px;
320
- }
321
- .column-status {
322
- width:100px;
323
- }
324
- /* Maintenance popup */
325
- #wppa-maintenance-list h2 {
326
- margin-top:0;
327
- }
328
- #wppa-maintenance-list div {
329
- background-color:#f1f1f1; border:1px solid #ddd;
330
- }
331
- #wppa-maintenance-list td, #wppa-maintenance-list th {
332
- border-right: 1px solid darkgray;
333
- }
334
- /* Photo admin */
335
- .cropper-drag-box{
336
- background-color:transparent;
337
- }
338
- /* Photo admin sequence */
339
- .sortable-placeholder {
340
- border-color: #cccccc;
341
- }
342
- .ui-state-default, .sortable-placeholder {
343
- border: 1px solid !important;
344
- position: relative !important;
345
- width: 180px;
346
- height: 180px;
347
- margin: 5px;
348
- border-radius:3px;
349
- float: left !important;
350
- }
351
-
352
- .wppa-publish {
353
- background-color: rgb( 255, 255, 224 );
354
- border-color: rgb( 230, 219, 85 );
355
- }
356
- .wppa-featured {
357
- background-color: rgb( 224, 255, 224 );
358
- border-color: rgb( 85, 238, 85 );
359
- }
360
- .wppa-pending, .wppa-scheduled, .wppa-private {
361
- background-color: rgb( 255, 235, 232 );
362
- border-color: rgb( 204, 0, 0 );
363
- }
364
- .wppa-bronze {
365
- background-color: rgb( 221, 221, 187 );
366
- border-color: rgb( 204, 204, 170 );
367
- }
368
- .wppa-silver {
369
- background-color: rgb( 255, 255, 255 );
370
- border-color: rgb( 238, 238, 238 );
371
- }
372
- .wppa-gold {
373
- background-color: rgb( 238, 238, 204 );
374
- border-color: rgb( 221, 221, 187 );
375
- }
376
-
377
- /* Settigs page */
378
-
379
- .wppa-master-tabs {
380
- position:relative;
381
- top:24px;
382
- }
383
- .wppa-setting-tabs {
384
- position:relative;
385
- top:24px;
386
- }
387
- .wppa-setting-tabs li {
388
- border-color: darkgrey;
389
- border-width: 1px;
390
- float: left;
391
- background-color: white;
392
- padding: 8px 10px;
393
- font-size: 22px;
394
- color: darkgrey;
395
- border-style: solid;
396
- text-align: center;
397
- margin: 0 4px 0 0;
398
- border-top-left-radius: 8px;
399
- border-top-right-radius: 8px;
400
- cursor: pointer;
401
- }
402
- .wppa-master-tabs li {
403
- border-color: darkgrey;
404
- border-width: 1px;
405
- float: left;
406
- background-color: white;
407
- padding: 8px 10px;
408
- font-size: 22px;
409
- color: darkgrey;
410
- border-style: solid;
411
- text-align: center;
412
- margin: 0 4px 6px 0;
413
- border-radius: 8px;
414
- cursor: pointer;
415
- }
416
- #wppa-setting-tab-99 {
417
- float: right;
418
- }
419
- .wppa-tabdesc h3 {
420
- margin: 0 0 9px 0;
421
- padding: 6px 0 0 0;
422
- }
423
- .wppa-master-tabs .active {
424
- color: black;
425
- background-color:#dddddd;
426
- }
427
- .wppa-setting-tabs .active {
428
- color: black;
429
- border-bottom-color: white;
430
- background-color:#dddddd;
431
- }
432
- #wppa-setting-content {
433
- clear:both;
434
- background-color: white;
435
- border-left:1px solid black;
436
- border-right:1px solid black;
437
- border-bottom:1px solid black;
438
- position:relative;
439
- top:24px;
440
- border-color:darkgrey;
441
- margin-bottom:12px;
442
- }
443
- .wppa-colorbox {
444
- height: 28px !important;
445
- }
446
- .wppa-doit-button {
447
- float:left;
448
- border-radius:3px;
449
- font-size: 11px !important;
450
- margin: 0 4px;
451
- padding: 0 6px;
452
- border: 1px solid darkgrey !important;
453
- }
454
-
455
- #wppa-cloudinary-table table, #wppa-cloudinary-table tbody, #wppa-cloudinary-table tr, #wppa-cloudinary-table td {
456
- margin:0;
457
- padding:0;
458
- border:none;
459
- font-size:9px;
460
- line-height: 11px;
461
- }
462
- #wppa-cloudinary-table td {
463
- height:11px;
464
- }
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
+ * version 7.3.05
5
  */
6
  #files_list, #files_list2
7
  {
285
  /*.wppa-links table { border-top:1px solid #ccc; margin:0; padding:0; }*/
286
  .wppa-links td { margin:0 !important; padding:0 10px !important; }
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.1.00.006
7
  *
8
  */
9
 
@@ -84,13 +84,6 @@ add_action( 'admin_init', 'wppa_admin_styles' );
84
 
85
  function wppa_admin_styles() {
86
  global $wppa_api_version;
87
-
88
- // Load styles only when on a wppa page
89
- // $page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
90
- // if ( substr( $page, 0, 4 ) !== 'wppa' ) {
91
- // return;
92
- // }
93
-
94
  wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $wppa_api_version );
95
  wp_enqueue_style( 'wppa_admin_style' );
96
 
@@ -103,46 +96,6 @@ global $wppa_api_version;
103
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $wppa_api_version);
104
  wp_enqueue_style('wppa_style');
105
 
106
- $the_css = wppa_create_wppa_dynamic_css();
107
- $the_css .= '
108
- /* WPPA Admin styles */
109
- #TB_ajaxContent {
110
- box-sizing:border-box; width:100% !important;
111
- }
112
- #wppagallery-table select {
113
- max-width:540px;
114
- }
115
- #wppagallery-table option {
116
- color: #070;
117
- }
118
- #wppagallery-table tr, #wppagallery-table th, #wppagallery-table td {
119
- padding: 2px; 0;
120
- }
121
-
122
- .wppa-bar {
123
- background-color: #7f7;
124
- width:0%;
125
- height:18px;
126
- border-radius: 3px;
127
- line-height: 18px;
128
- margin: 0;
129
- }
130
- .wppa-percent {
131
- position:relative;
132
- display:inline-block;
133
- top:-19px;
134
- font-size: 12px;
135
- line-height: 18px;
136
- margin: 0;
137
- }
138
- .wppa-message {
139
- clear: both;
140
- }
141
- #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
142
- padding: 2px; 0;
143
- }';
144
- wp_add_inline_style( 'wppa_style', $the_css );
145
-
146
  }
147
 
148
  /* ADMIN SCRIPTS */
@@ -150,40 +103,34 @@ add_action( 'admin_init', 'wppa_admin_scripts' );
150
 
151
  function wppa_admin_scripts() {
152
  global $wppa_api_version;
153
-
154
- $depts = array(
155
- 'jquery',
156
- // 'jquery-ui-sortable', // does not work in 5.9RC2
157
- 'jquery-ui-dialog',
158
- 'jquery-form',
159
- 'jquery-masonry',
160
- );
161
-
162
- if ( wppa_is_file( WPPA_PATH.'/js/wppa-admin-scripts.min.js' ) ) {
163
- wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.min.js', $depts, $wppa_api_version, true );
164
  }
165
  else {
166
- wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.js', $depts, $wppa_api_version, true );
167
  }
168
- wp_enqueue_script( 'wppa-upload', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version, true );
169
- wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js',$depts, $wppa_api_version );
170
- wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', $depts, $wppa_api_version );
171
- wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', $depts, $wppa_api_version );
172
- wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', $depts, $wppa_api_version );
173
- wp_enqueue_script( 'wppa-zoom', WPPA_URL . '/js/wppa-zoom.js', $depts, $wppa_api_version );
174
- wp_enqueue_script( 'wppa-spheric', WPPA_URL . '/js/wppa-spheric.js', $depts, $wppa_api_version );
175
- wp_enqueue_script( 'wppa-three', WPPA_URL . '/vendor/three/three.min.js', $depts, $wppa_api_version );
 
 
 
 
 
176
  if ( wppa_can_magick() ) {
177
- wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', $depts, $wppa_api_version );
178
  }
179
 
180
  wp_enqueue_style( 'wp-jquery-ui-dialog' );
181
-
182
- // jQuery sortable 1.13.0 fails, 1.12.1 works. Tested on 5.9RC2 vs 5.8
183
- wp_enqueue_script( 'wppa-jquery-sortable', WPPA_URL . '/js/sortable.min.js', $depts );
184
  }
185
 
186
- /*
187
  add_action( 'admin_head', 'wppa_inject_css' );
188
 
189
  function wppa_inject_css() {
@@ -191,7 +138,6 @@ global $wppa_api_version;
191
 
192
  echo wppa_create_wppa_dynamic_css();
193
  }
194
- */
195
 
196
  /* ADMIN PAGE PHP's */
197
 
@@ -232,6 +178,7 @@ function wppa_page_import() {
232
  wppa_grant_albums();
233
  wppa_rename_files_sanitized( WPPA_DEPOT_PATH );
234
  require_once 'wppa-import.php';
 
235
  _wppa_page_import();
236
  }
237
  // Moderate admin page
@@ -365,28 +312,24 @@ function wppa_block_categories( $categories, $post ) {
365
  add_filter( 'block_categories_all', 'wppa_block_categories', 10, 2 );
366
 
367
  // Fix Gutenberg bug
368
- function wppa_fix_gutenberg_shortcodes( $id ) {
369
  global $wpdb;
370
 
371
  // Get the post
372
- $post = get_post( $id, ARRAY_A );
373
-
374
- $post_content = $post['post_content']; //$wpdb->get_var( $wpdb->prepare( "SELECT post_content FROM $wpdb->posts WHERE ID = %d", $post ) );
375
 
376
  // Fix
377
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post_content );
378
- // $new_content = str_replace( '&apos;', '"', $new_content );
379
 
380
  // Update if fixed
381
  if ( $post_content != $new_content ) {
 
 
382
 
383
- $post['post_content'] = $new_content;
384
- $iret = wp_insert_post( $post );
385
-
386
- // If successfull, clear cache for this post
387
- if ( $iret == $post ) {
388
- wppa_clear_cache( ['page' => $id] );
389
- }
390
  }
391
  }
392
  add_action( 'save_post', 'wppa_fix_gutenberg_shortcodes' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.0.08.007
7
  *
8
  */
9
 
84
 
85
  function wppa_admin_styles() {
86
  global $wppa_api_version;
 
 
 
 
 
 
 
87
  wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $wppa_api_version );
88
  wp_enqueue_style( 'wppa_admin_style' );
89
 
96
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $wppa_api_version);
97
  wp_enqueue_style('wppa_style');
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
101
  /* ADMIN SCRIPTS */
103
 
104
  function wppa_admin_scripts() {
105
  global $wppa_api_version;
106
+ wp_register_script( 'wppa_upload_script', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version );
107
+ wp_enqueue_script( 'wppa_upload_script' );
108
+ if ( is_file( WPPA_PATH.'/js/wppa-admin-scripts.min.js' ) ) {
109
+ wp_register_script( 'wppa_admin_script', WPPA_URL.'/js/wppa-admin-scripts.min.js', '', $wppa_api_version );
 
 
 
 
 
 
 
110
  }
111
  else {
112
+ wp_register_script( 'wppa_admin_script', WPPA_URL.'/js/wppa-admin-scripts.js', '', $wppa_api_version );
113
  }
114
+ wp_enqueue_script( 'wppa_admin_script' );
115
+ wp_enqueue_script( 'jquery' );
116
+ wp_enqueue_script( 'jquery-ui-sortable' );
117
+ wp_enqueue_script( 'jquery-ui-dialog' );
118
+ wp_enqueue_script( 'jquery-form' );
119
+ wp_enqueue_script( 'jquery-masonry' );
120
+ wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js', array(), $wppa_api_version );
121
+ wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', array(), $wppa_api_version );
122
+ wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', array(), $wppa_api_version );
123
+ wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', array(), $wppa_api_version );
124
+ wp_enqueue_script( 'wppa-zoom', WPPA_URL . '/js/wppa-zoom.js', array(), $wppa_api_version );
125
+ wp_enqueue_script( 'wppa-spheric', WPPA_URL . '/js/wppa-spheric.js', array(), $wppa_api_version );
126
+ wp_enqueue_script( 'wppa-three', WPPA_URL . '/vendor/three/three.min.js', array(), $wppa_api_version );
127
  if ( wppa_can_magick() ) {
128
+ wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', array(), $wppa_api_version );
129
  }
130
 
131
  wp_enqueue_style( 'wp-jquery-ui-dialog' );
 
 
 
132
  }
133
 
 
134
  add_action( 'admin_head', 'wppa_inject_css' );
135
 
136
  function wppa_inject_css() {
138
 
139
  echo wppa_create_wppa_dynamic_css();
140
  }
 
141
 
142
  /* ADMIN PAGE PHP's */
143
 
178
  wppa_grant_albums();
179
  wppa_rename_files_sanitized( WPPA_DEPOT_PATH );
180
  require_once 'wppa-import.php';
181
+ echo '<script type="text/javascript" >/* <![CDATA[ */wppa_import = "'.__('Import', 'wp-photo-album-plus').'"; wppa_update = "'.__('Update', 'wp-photo-album-plus').'";/* ]]> */</script>';
182
  _wppa_page_import();
183
  }
184
  // Moderate admin page
312
  add_filter( 'block_categories_all', 'wppa_block_categories', 10, 2 );
313
 
314
  // Fix Gutenberg bug
315
+ function wppa_fix_gutenberg_shortcodes( $post ) {
316
  global $wpdb;
317
 
318
  // Get the post
319
+ $post_content = $wpdb->get_var( $wpdb->prepare( "SELECT post_content FROM $wpdb->posts WHERE ID = %d", $post ) );
 
 
320
 
321
  // Fix
322
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post_content );
 
323
 
324
  // Update if fixed
325
  if ( $post_content != $new_content ) {
326
+ $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_content = %s WHERE ID = %d", $new_content, $post ) );
327
+ }
328
 
329
+ // If wppa content, clear wppa cache
330
+ if ( strpos( $post_content, '[wppa' ) !== false ||
331
+ strpos( $post_content, '[photo' ) !== false ) {
332
+ wppa_clear_cache( ['page' => $post] );
 
 
 
333
  }
334
  }
335
  add_action( 'save_post', 'wppa_fix_gutenberg_shortcodes' );
wppa-ajax-front.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* wppa-ajax-front.php
3
+ *
4
+ * Supplies the functionality like wp-admin/admin-ajax.php for wppa frontend ajax requests without using wp-admin files
5
+ * version 7.3.00
6
+ *
7
+ */
8
+ define( 'DOING_AJAX', true );
9
+
10
+ /** Load WordPress Bootstrap */
11
+ require_once ( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/wp-load.php' );
12
+
13
+ /** Allow for cross-domain requests (from the frontend). */
14
+ send_origin_headers();
15
+
16
+ // Require an action parameter
17
+ if ( empty( $_REQUEST['action'] ) )
18
+ die( '0' );
19
+
20
+ // Load the wppa admin functions
21
+ require_once 'wppa-admin.php';
22
+
23
+ @header( 'Content-Type: text/html; charset=' . wppa_get_option( 'blog_charset' ) );
24
+ @header( 'X-Robots-Tag: noindex' );
25
+
26
+ send_nosniff_header();
27
+ nocache_headers();
28
+
29
+ wppa_ajax_callback();
30
+
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.1.00.007
6
  *
7
  */
8
 
@@ -71,7 +71,7 @@ global $wppa;
71
  $args = '';
72
  $t = array_merge( $_GET, $_POST );
73
  foreach( array_keys( $t ) as $key ) {
74
- $args .= $key . '=' . wppa_get( $key ) . ', ';
75
  }
76
  wppa_log( 'Ajx', 'Script = ' . basename( $_SERVER['SCRIPT_FILENAME'] ) . ', Args = ' . $args );
77
  }
@@ -501,6 +501,18 @@ global $wppa;
501
  wppa_secfail( '72' );
502
  }
503
 
 
 
 
 
 
 
 
 
 
 
 
 
504
  wppa( 'mocc', $mocc );
505
  wppa( 'comment_photo', $photoid );
506
  wppa( 'comment_id', $commentid );
@@ -1084,7 +1096,6 @@ global $wppa;
1084
  case 'getshortcodedrendered':
1085
  $shortcode = wppa_get( 'shortcode' );
1086
  $shortcode = str_replace( '@', '#', $shortcode );
1087
- $shortcode = stripslashes( $shortcode );
1088
 
1089
  wppa_load_theme();
1090
 
@@ -1097,10 +1108,12 @@ global $wppa;
1097
  echo
1098
  '<div id="wppa-gutenberg-div-' . $wppa['mocc'] . '" >' .
1099
  '<div style="font-size:10px;color:green;margin-bottom:2px;width:100%;text-align:center;" ><i>(' .
1100
- esc_html( __('Links and buttons will not work in this preview', 'wp-photo-album-plus') ) .
1101
  ')</i></div>' .
1102
  $result .
1103
- '</div>';
 
 
1104
  wppa_exit();
1105
  break;
1106
 
@@ -1515,7 +1528,7 @@ global $wppa;
1515
  $mem = memory_get_peak_usage( true ) / 1024 / 1024;
1516
 
1517
  $msg = sprintf( 'WPPA Ajax render: db queries: WP:%d, WPPA+: %d in %4.2f seconds, using %4.2f MB memory max', $nq_1, $nq_2 - $nq_1, $tim_2 - $tim_1, $mem );
1518
- wppa_log( 'ajx', $msg );
1519
  break;
1520
 
1521
  case 'delete-photo':
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.0.10.005
6
  *
7
  */
8
 
71
  $args = '';
72
  $t = array_merge( $_GET, $_POST );
73
  foreach( array_keys( $t ) as $key ) {
74
+ $args .= $key . '=' . $t[$key] . ', ';
75
  }
76
  wppa_log( 'Ajx', 'Script = ' . basename( $_SERVER['SCRIPT_FILENAME'] ) . ', Args = ' . $args );
77
  }
501
  wppa_secfail( '72' );
502
  }
503
 
504
+ // If db agree required, see if it is present
505
+ $doit = true;
506
+ if ( wppa_switch( 'comment_need_db_agree' ) ) {
507
+ if ( wppa_get( 'db-agree' ) ) {
508
+ echo
509
+ '<script type="text/javascript" >' .
510
+ 'alert( "' . esc_js( __( 'Your comment needs your agreement for database storage', 'wp-photo-album-plus' ) ) . '" )' .
511
+ '</script>';
512
+ $doit = false;
513
+ }
514
+ }
515
+
516
  wppa( 'mocc', $mocc );
517
  wppa( 'comment_photo', $photoid );
518
  wppa( 'comment_id', $commentid );
1096
  case 'getshortcodedrendered':
1097
  $shortcode = wppa_get( 'shortcode' );
1098
  $shortcode = str_replace( '@', '#', $shortcode );
 
1099
 
1100
  wppa_load_theme();
1101
 
1108
  echo
1109
  '<div id="wppa-gutenberg-div-' . $wppa['mocc'] . '" >' .
1110
  '<div style="font-size:10px;color:green;margin-bottom:2px;width:100%;text-align:center;" ><i>(' .
1111
+ __('Links and buttons will not work in this preview', 'wp-photo-album-plus') .
1112
  ')</i></div>' .
1113
  $result .
1114
+ '</div>
1115
+ <script>_wppaDoAutocol(' . $wppa['mocc'] . ');</script>';
1116
+
1117
  wppa_exit();
1118
  break;
1119
 
1528
  $mem = memory_get_peak_usage( true ) / 1024 / 1024;
1529
 
1530
  $msg = sprintf( 'WPPA Ajax render: db queries: WP:%d, WPPA+: %d in %4.2f seconds, using %4.2f MB memory max', $nq_1, $nq_2 - $nq_1, $tim_2 - $tim_1, $mem );
1531
+ echo '<script type="text/javascript" >wppaConsoleLog( \''.$msg.'\', \'force\' )</script>';
1532
  break;
1533
 
1534
  case 'delete-photo':
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 8.1.00.005
7
  *
8
  */
9
 
@@ -288,21 +288,18 @@ global $wppa_revno;
288
  }
289
  }
290
 
291
- $remark = sprintf( __( 'Album %s is not modified yet', 'wp-photo-album-plus' ), $edit_id );
292
-
293
  // Set all to pano
294
  $timeup = false;
295
  $pano = wppa_get( 'pano-val', '9' );
296
  if ( in_array( $pano, array( '0', '1', '2' ) ) ) {
297
 
298
- // $last = get_option( 'wppa_last_pano_set', '0' );
299
  $done = '0';
300
  $todo = $wpdb->get_results( $wpdb->prepare( "SELECT id, photox, photoy, panorama, angle FROM $wpdb->wppa_photos
301
  WHERE album = %d
302
-
303
  AND ext = 'jpg'
304
- AND panorama <> %d
305
- ORDER BY id", $edit_id, $pano ), ARRAY_A );
306
  $tot = count( $todo );
307
 
308
  if ( $tot ) foreach( $todo as $item ) {
@@ -359,18 +356,18 @@ global $wppa_revno;
359
  wppa_remake_files( '', $id );
360
  wppa_get_photox( $id, true );
361
  wppa_get_photoy( $id, true );
362
- // update_option( 'wppa_last_pano_set', $id );
363
  $done++;
364
 
365
  if ( ! in_array( $pano, array( '0', '1', '2' ) ) ) {
366
- $remark = __( 'No items processed', 'wp-photo-album-plus' );
367
  }
368
  elseif ( $done == $tot ) {
369
- $remark = __( 'All applicable items processed', 'wp-photo-album-plus' );
370
- // delete_option( 'wppa_last_pano_set' );
371
  }
372
  else {
373
- $remark = sprintf( __( '%1d items out of %2d processed', 'wp-photo-album-plus' ), $done, $tot );
374
  }
375
  }
376
 
@@ -378,13 +375,17 @@ global $wppa_revno;
378
  $timeup = wppa_is_time_up() && ( $done != $tot );
379
  if ( $timeup ) break;
380
  }
381
- else {
382
- $remark = __( 'No items to process', 'wp-photo-album-plus' );
383
- }
384
 
385
  if ( $timeup ) {
386
- $remark .= ' ' . __( 'No time left, please reload the page to continue.', 'wp-photo-album-plus' );
387
  }
 
 
 
 
 
 
 
388
  }
389
 
390
  // Get the album information
@@ -423,7 +424,6 @@ global $wppa_revno;
423
  $tpviews = $treecounts['treephotoviews'];
424
  $nsub = $treecounts['selfalbums'];
425
 
426
-
427
  // Open the photo album admin page
428
  echo
429
  '<div class="wrap">';
@@ -431,8 +431,9 @@ global $wppa_revno;
431
  // The spinner to indicate busyness
432
  wppa_admin_spinner();
433
 
434
- // Local js functions
435
- $the_js = '
 
436
  function wppaTryInheritCats( id ) {
437
 
438
  var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
@@ -496,9 +497,9 @@ global $wppa_revno;
496
  else {
497
  alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
498
  }
499
- }';
500
 
501
- wp_add_inline_script( 'wppa-admin', $the_js );
502
 
503
  // The header
504
  echo '
@@ -1042,7 +1043,7 @@ global $wppa_revno;
1042
  id="albumstatus-' . $id . '"
1043
  style="font-weight:bold;color:#00AA00;"
1044
  >' .
1045
- esc_html( $remark ) . '
1046
  </span>';
1047
 
1048
 
@@ -1786,16 +1787,16 @@ global $wppa_revno;
1786
  type="button"
1787
  value="' . esc_attr( __( 'Go', 'wp-photo-album-plus' ) ) . '"
1788
  onclick="wppaGoEditAlbNo();"
1789
- />';
1790
-
1791
- $the_js = '
1792
  function wppaGoEditAlbNo() {
1793
  var id = document.getElementById("wppa-edit-albid").value;
1794
  var nonce = "' . wp_create_nonce( 'wppa-nonce' ) .'";
1795
  var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce="+nonce+"&tab=edit&edit-id="+id;
1796
  document.location.href=href;
1797
- };';
1798
- wp_add_inline_script( 'wppa-admin', $the_js );
 
1799
 
1800
  ?>
1801
 
@@ -2657,23 +2658,23 @@ global $wpdb;
2657
  </tfoot>
2658
 
2659
  </table>
2660
- <?php
2661
- $the_js = '
2662
  function checkArrows() {
2663
- elms = jQuery(".alb-arrow-off");
2664
  for(i=0;i<elms.length;i++) {
2665
  elm = elms[i];
2666
- if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "none";
2667
  }
2668
- elms = jQuery(".alb-arrow-on");
2669
  for(i=0;i<elms.length;i++) {
2670
  elm = elms[i];
2671
- if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "";
2672
  }
2673
- }';
2674
-
2675
- wp_add_inline_script( 'wppa-admin', $the_js );
2676
 
 
2677
  wppa_album_table_pagination( $page, $count );
2678
  wppa_album_admin_footer();
2679
 
@@ -2940,17 +2941,18 @@ global $wpdb;
2940
  />';
2941
 
2942
  // Open subalbums by clicking the open button if it was before (cookie), and if it is visible (!)
2943
- if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
2944
- $the_js = '
2945
- jQuery(document).ready(function(){
2946
- if (jQuery("#alb-'.$id.'").css("display")!=="none") {
2947
- jQuery("#alb-arrow-on-'.$id.'").trigger("click");
2948
- }
2949
- else {
2950
- wppa_setCookie("alb-arrow-'.$id.'","off",365);
2951
- }
2952
- });';
2953
- wp_add_inline_script( 'wppa-admin', $the_js );
 
2954
  }
2955
  }
2956
 
@@ -3338,7 +3340,33 @@ global $wpdb;
3338
  '</table>';
3339
 
3340
 
3341
- $the_js = '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3342
  jQuery( function() {
3343
  jQuery( "#sortable-albums" ).sortable( {
3344
  cursor: "move",
@@ -3367,7 +3395,7 @@ global $wpdb;
3367
  // Init
3368
  var ids = jQuery( ".wppa-sort-item-albums" );
3369
  var seq = jQuery( ".wppa-sort-seqn-albums" );
3370
- var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3371
 
3372
  // Mark needs update
3373
  var idx = 0;
@@ -3378,7 +3406,7 @@ global $wpdb;
3378
  var oldvalue = seq[idx].value;
3379
  var album = ids[idx].value;
3380
  if ( newvalue != oldvalue ) {
3381
- jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"orange"});
3382
  }
3383
  idx++;
3384
  }
@@ -3393,7 +3421,7 @@ global $wpdb;
3393
  var album = ids[idx].value;
3394
  if ( newvalue != oldvalue ) {
3395
  wppaDoSeqUpdateAlbum( album, newvalue );
3396
- jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"yellow"});
3397
  wppaLastAlbum = album;
3398
  }
3399
  idx++;
@@ -3402,40 +3430,40 @@ global $wpdb;
3402
 
3403
  function wppaDoSeqUpdateAlbum( album, seqno ) {
3404
 
3405
- var data = "action=wppa" +
3406
- "&wppa-action=update-album" +
3407
- "&album-id=" + album +
3408
- "&item=a_order" +
3409
- "&wppa-nonce=" + document.getElementById( "album-nonce-" + album ).value +
3410
- "&value=" + seqno;
3411
  var xmlhttp = new XMLHttpRequest();
3412
 
3413
  xmlhttp.onreadystatechange = function() {
3414
  if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
3415
  var ArrValues = xmlhttp.responseText.split( "||" );
3416
- if ( ArrValues[0] != "" ) {
3417
- alert( "The server returned unexpected output:\n" + ArrValues[0] );
3418
  }
3419
  switch ( ArrValues[1] ) {
3420
- case "0": // No error
3421
  var i = seqno - 1;
3422
- var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3423
  if ( descend ) {
3424
- i = ' . count( $albums ) . ' - seqno;
3425
  }
3426
- jQuery( "#wppa-album-seqno-" + album ).html( seqno );
3427
  if ( wppaRenumberPending ) {
3428
- jQuery( "#wppa-pb-"+i ).css({backgroundColor:"orange"});
3429
  }
3430
  else {
3431
- jQuery( "#wppa-pb-"+i ).css({backgroundColor:"green"});
3432
  }
3433
  if ( wppaLastAlbum = album ) {
3434
  wppaRenumberBusy = false;
3435
  }
3436
  break;
3437
  default: // Any error
3438
- jQuery( "#wppa-album-seqno-" + album ).html( "<span style=\'color:red\' >Err:" + ArrValues[1] + "</span>" );
3439
  break;
3440
  }
3441
  wppaAjaxInProgress--;
@@ -3452,19 +3480,16 @@ global $wpdb;
3452
  }
3453
  }
3454
  }
3455
- xmlhttp.open( "POST",wppaAjaxUrl,true );
3456
  xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3457
  xmlhttp.send( data );
3458
  wppaAjaxInProgress++;
3459
 
3460
- jQuery( "#wppa-sort-seqn-albums-" + album ).prop( "value", seqno ); // set hidden value to new value to prevent duplicate action
3461
- var spinnerhtml = "<img src=\'" + wppaImageDirectory + "spinner.gif\' />";
3462
- jQuery( "#wppa-album-seqno-" + album ).html( spinnerhtml );
3463
- }';
3464
-
3465
- wp_add_inline_script( 'wppa-admin', $the_js );
3466
-
3467
- ?>
3468
 
3469
  <br />
3470
 
@@ -3597,6 +3622,11 @@ function _wppa_search() {
3597
  update_option( 'wppa_search_page', 'wppa_search' );
3598
 
3599
  echo '
 
 
 
 
 
3600
  <div class="wrap" >
3601
  <img src="' . esc_attr( WPPA_URL . '/img/magnifier-large.png' ) . '" />
3602
  <h1 style="display:inline;" >' . __( 'Search photos', 'wp-photo-album-plus' ) . '</h1>
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.0.09.003
7
  *
8
  */
9
 
288
  }
289
  }
290
 
 
 
291
  // Set all to pano
292
  $timeup = false;
293
  $pano = wppa_get( 'pano-val', '9' );
294
  if ( in_array( $pano, array( '0', '1', '2' ) ) ) {
295
 
296
+ $last = get_option( 'wppa_last_pano_set', '0' );
297
  $done = '0';
298
  $todo = $wpdb->get_results( $wpdb->prepare( "SELECT id, photox, photoy, panorama, angle FROM $wpdb->wppa_photos
299
  WHERE album = %d
300
+ AND id > %d
301
  AND ext = 'jpg'
302
+ ORDER BY id", $edit_id, $last ), ARRAY_A );
 
303
  $tot = count( $todo );
304
 
305
  if ( $tot ) foreach( $todo as $item ) {
356
  wppa_remake_files( '', $id );
357
  wppa_get_photox( $id, true );
358
  wppa_get_photoy( $id, true );
359
+ update_option( 'wppa_last_pano_set', $id );
360
  $done++;
361
 
362
  if ( ! in_array( $pano, array( '0', '1', '2' ) ) ) {
363
+ $status = __( 'No items processed', 'wp-photo-album-plus' );
364
  }
365
  elseif ( $done == $tot ) {
366
+ $status = __( 'All applicable items processed', 'wp-photo-album-plus' );
367
+ delete_option( 'wppa_last_pano_set' );
368
  }
369
  else {
370
+ $status = sprintf( __( '%1d items out of %2d processed', 'wp-photo-album-plus' ), $done, $tot );
371
  }
372
  }
373
 
375
  $timeup = wppa_is_time_up() && ( $done != $tot );
376
  if ( $timeup ) break;
377
  }
 
 
 
378
 
379
  if ( $timeup ) {
380
+ $status .= ' ' . __( 'No time left, the page will be reloaded to continue. Stay tuned...', 'wp-photo-album-plus' );
381
  }
382
+
383
+ echo '
384
+ <script>
385
+ jQuery(document).ready(function(){
386
+ jQuery("#albumstatus-'.$edit_id.'").html("'.$status.'");
387
+ }); ' . ( $timeup ? 'setTimeout(function(){document.location.reload();}, 10000);' : '' ) . '
388
+ </script>';
389
  }
390
 
391
  // Get the album information
424
  $tpviews = $treecounts['treephotoviews'];
425
  $nsub = $treecounts['selfalbums'];
426
 
 
427
  // Open the photo album admin page
428
  echo
429
  '<div class="wrap">';
431
  // The spinner to indicate busyness
432
  wppa_admin_spinner();
433
 
434
+ // Local js functions placed here as long as there is not yet a possibility to translate texts in js files
435
+ echo '
436
+ <script>
437
  function wppaTryInheritCats( id ) {
438
 
439
  var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
497
  else {
498
  alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
499
  }
500
+ }
501
 
502
+ </script>';
503
 
504
  // The header
505
  echo '
1043
  id="albumstatus-' . $id . '"
1044
  style="font-weight:bold;color:#00AA00;"
1045
  >' .
1046
+ sprintf( __( 'Album %s is not modified yet', 'wp-photo-album-plus' ), $id ) . '
1047
  </span>';
1048
 
1049
 
1787
  type="button"
1788
  value="' . esc_attr( __( 'Go', 'wp-photo-album-plus' ) ) . '"
1789
  onclick="wppaGoEditAlbNo();"
1790
+ />
1791
+ <script>
 
1792
  function wppaGoEditAlbNo() {
1793
  var id = document.getElementById("wppa-edit-albid").value;
1794
  var nonce = "' . wp_create_nonce( 'wppa-nonce' ) .'";
1795
  var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce="+nonce+"&tab=edit&edit-id="+id;
1796
  document.location.href=href;
1797
+ }
1798
+ </script>
1799
+ ';
1800
 
1801
  ?>
1802
 
2658
  </tfoot>
2659
 
2660
  </table>
2661
+
2662
+ <script type="text/javascript" >
2663
  function checkArrows() {
2664
+ elms = jQuery('.alb-arrow-off');
2665
  for(i=0;i<elms.length;i++) {
2666
  elm = elms[i];
2667
+ if ( elm.parentNode.parentNode.style.display == 'none' ) elm.style.display = 'none';
2668
  }
2669
+ elms = jQuery('.alb-arrow-on');
2670
  for(i=0;i<elms.length;i++) {
2671
  elm = elms[i];
2672
+ if ( elm.parentNode.parentNode.style.display == 'none' ) elm.style.display = '';
2673
  }
2674
+ }
2675
+ </script>
 
2676
 
2677
+ <?php
2678
  wppa_album_table_pagination( $page, $count );
2679
  wppa_album_admin_footer();
2680
 
2941
  />';
2942
 
2943
  // Open subalbums by clicking the open button if it was before (cookie), and if it is visible (!)
2944
+ if ( isset( $_COOKIE['alb-arrow-' . $id] ) && $_COOKIE['alb-arrow-' . $id] == 'on' ) {
2945
+ echo '
2946
+ <script>
2947
+ jQuery(document).ready(function(){
2948
+ if (jQuery("#alb-'.$id.'").css("display")!=="none") {
2949
+ jQuery("#alb-arrow-on-'.$id.'").trigger("click");
2950
+ }
2951
+ else {
2952
+ wppa_setCookie("alb-arrow-'.$id.'","off",365);
2953
+ }
2954
+ });
2955
+ </script>';
2956
  }
2957
  }
2958
 
3340
  '</table>';
3341
 
3342
 
3343
+
3344
+ ?>
3345
+ <style>
3346
+ .sortable-placeholder-albums {
3347
+ width: 100%;
3348
+ height: 60px;
3349
+ margin: 5px;
3350
+ border: 1px dotted #cccccc;
3351
+ border-radius:3px;
3352
+ float: left;
3353
+ }
3354
+ .ui-state-default-albums {
3355
+ position: relative;
3356
+ width: 100%;
3357
+ height: 60px;
3358
+ margin: 5px;
3359
+ border: 1px solid #cccccc;
3360
+ border-radius:3px;
3361
+ float: left;
3362
+ }
3363
+ .ui-state-default-albums td {
3364
+ padding:0;
3365
+ line-height:12px;
3366
+ text-align:center;
3367
+ }
3368
+ </style>
3369
+ <script>
3370
  jQuery( function() {
3371
  jQuery( "#sortable-albums" ).sortable( {
3372
  cursor: "move",
3395
  // Init
3396
  var ids = jQuery( ".wppa-sort-item-albums" );
3397
  var seq = jQuery( ".wppa-sort-seqn-albums" );
3398
+ var descend = <?php if ( $is_descending ) echo 'true'; else echo 'false' ?>;
3399
 
3400
  // Mark needs update
3401
  var idx = 0;
3406
  var oldvalue = seq[idx].value;
3407
  var album = ids[idx].value;
3408
  if ( newvalue != oldvalue ) {
3409
+ jQuery( '#wppa-pb-'+idx ).css({backgroundColor:'orange'});
3410
  }
3411
  idx++;
3412
  }
3421
  var album = ids[idx].value;
3422
  if ( newvalue != oldvalue ) {
3423
  wppaDoSeqUpdateAlbum( album, newvalue );
3424
+ jQuery( '#wppa-pb-'+idx ).css({backgroundColor:'yellow'});
3425
  wppaLastAlbum = album;
3426
  }
3427
  idx++;
3430
 
3431
  function wppaDoSeqUpdateAlbum( album, seqno ) {
3432
 
3433
+ var data = 'action=wppa' +
3434
+ '&wppa-action=update-album' +
3435
+ '&album-id=' + album +
3436
+ '&item=a_order' +
3437
+ '&wppa-nonce=' + document.getElementById( 'album-nonce-' + album ).value +
3438
+ '&value=' + seqno;
3439
  var xmlhttp = new XMLHttpRequest();
3440
 
3441
  xmlhttp.onreadystatechange = function() {
3442
  if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
3443
  var ArrValues = xmlhttp.responseText.split( "||" );
3444
+ if ( ArrValues[0] != '' ) {
3445
+ alert( 'The server returned unexpected output:\n' + ArrValues[0] );
3446
  }
3447
  switch ( ArrValues[1] ) {
3448
+ case '0': // No error
3449
  var i = seqno - 1;
3450
+ var descend = <?php if ( $is_descending ) echo 'true'; else echo 'false' ?>;
3451
  if ( descend ) {
3452
+ i = <?php echo count( $albums ) ?> - seqno;
3453
  }
3454
+ jQuery( '#wppa-album-seqno-' + album ).html( seqno );
3455
  if ( wppaRenumberPending ) {
3456
+ jQuery( '#wppa-pb-'+i ).css({backgroundColor:'orange'});
3457
  }
3458
  else {
3459
+ jQuery( '#wppa-pb-'+i ).css({backgroundColor:'green'});
3460
  }
3461
  if ( wppaLastAlbum = album ) {
3462
  wppaRenumberBusy = false;
3463
  }
3464
  break;
3465
  default: // Any error
3466
+ jQuery( '#wppa-album-seqno-' + album ).html( '<span style="color"red" >Err:' + ArrValues[1] + '</span>' );
3467
  break;
3468
  }
3469
  wppaAjaxInProgress--;
3480
  }
3481
  }
3482
  }
3483
+ xmlhttp.open( 'POST',wppaAjaxUrl,true );
3484
  xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3485
  xmlhttp.send( data );
3486
  wppaAjaxInProgress++;
3487
 
3488
+ jQuery( "#wppa-sort-seqn-albums-" + album ).prop( 'value', seqno ); // set hidden value to new value to prevent duplicate action
3489
+ var spinnerhtml = '<img src="' + wppaImageDirectory + 'spinner.gif" />';
3490
+ jQuery( '#wppa-album-seqno-' + album ).html( spinnerhtml );
3491
+ }
3492
+ </script>
 
 
 
3493
 
3494
  <br />
3495
 
3622
  update_option( 'wppa_search_page', 'wppa_search' );
3623
 
3624
  echo '
3625
+ <style>
3626
+ #src-alb{
3627
+ color:transparent;
3628
+ }
3629
+ </style>
3630
  <div class="wrap" >
3631
  <img src="' . esc_attr( WPPA_URL . '/img/magnifier-large.png' ) . '" />
3632
  <h1 style="display:inline;" >' . __( 'Search photos', 'wp-photo-album-plus' ) . '</h1>
wppa-album-navigator-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
- * Version 8.1.00.004
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
@@ -366,6 +366,15 @@ class AlbumNavigatorWidget extends WP_Widget {
366
  }
367
  }
368
  $result .= '</ul>';
 
 
 
 
 
 
 
 
 
369
  }
370
  $level--;
371
  return wppa_compress_html( $result );
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
+ * Version 8.0.08.006
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
366
  }
367
  }
368
  $result .= '</ul>';
369
+ if ( $level == '1' && $ca ) {
370
+ $result .= '<script type="text/javascript" >';
371
+ while ( $ca != '0' && $ca != '-1' ) {
372
+ $result .= '
373
+ jQuery(\'.anw-'.$w.'-'.$ca.'\').css(\'display\',\'\'); jQuery(\'.anw-'.$w.'-'.$ca.'-\').css(\'display\',\'none\');';
374
+ $ca = wppa_get_parentalbumid($ca);
375
+ }
376
+ $result .= '</script>';
377
+ }
378
  }
379
  $level--;
380
  return wppa_compress_html( $result );
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 8.1.00.005
7
  *
8
  */
9
 
@@ -78,6 +78,11 @@ function wppa_thumb_area( $action ) {
78
  // Nicescroller
79
  if ( $nice ) {
80
  $result .= '
 
 
 
 
 
81
  </div>'; // close .wppa-nicewrap div
82
  }
83
 
@@ -135,6 +140,11 @@ function wppa_contest_box() {
135
  // Nicescroller
136
  if ( $nice ) {
137
  $result .= '
 
 
 
 
 
138
  </div>'; // close .wppa-nicewrap div
139
  }
140
 
@@ -1365,15 +1375,16 @@ global $photos_used;
1365
  <input
1366
  type="button"
1367
  id="wppa-ss-button-' . $mocc . '"
1368
- data-mocc="' . $mocc . '"
1369
- class="wppa-ss-button"
1370
  value="' . __( 'Submit', 'wp-photo-album-plus' ) . '"
1371
- style="vertical-align:top;margin:2px;display:none;"
1372
  onclick="wppaSuperSearchSelect(' . $mocc . ' , true)"
1373
  />';
1374
 
1375
  $result .= '
1376
- </form>';
 
 
 
1377
 
1378
  return $result; // wppa_compress_html( $result );
1379
  }
@@ -4400,7 +4411,8 @@ global $wpdb;
4400
  style="background-color:transparent;"
4401
  >' .
4402
  $smily_html .
4403
- $comment_input . '
 
4404
  </td>
4405
  <tr>
4406
  <tr>
@@ -4448,7 +4460,8 @@ global $wpdb;
4448
  </td>
4449
  <td>' .
4450
  $smily_html .
4451
- $comment_input . '
 
4452
  </td>
4453
  </tr>';
4454
  }
@@ -6377,7 +6390,7 @@ global $wppa_supported_stereo_glass_names;
6377
  $result .=
6378
  '<option' .
6379
  ' value="' . $wppa_supported_stereo_types[$key] . '"' .
6380
- ( wppa_get_cookie( "stereotype" ) == $wppa_supported_stereo_types[$key] ? ' selected' : '' ) .
6381
  ' >' .
6382
  $wppa_supported_stereo_type_names[$key] .
6383
  '</option>';
@@ -6393,7 +6406,7 @@ global $wppa_supported_stereo_glass_names;
6393
  $result .=
6394
  '<option' .
6395
  ' value="' . $wppa_supported_stereo_glasses[$key] . '"' .
6396
- ( wppa_get_cookie( "stereoglass" ) == $wppa_supported_stereo_glasses[$key] ? ' selected' : '' ) .
6397
  ' >' .
6398
  $wppa_supported_stereo_glass_names[$key] .
6399
  '</option>';
@@ -6593,6 +6606,11 @@ function wppa_grid_box() {
6593
  // Nicescroller
6594
  if ( $nice ) {
6595
  $result .= '
 
 
 
 
 
6596
  </div>'; // close .wppa-nicewrap div
6597
  }
6598
 
@@ -6611,7 +6629,25 @@ function wppa_get_grid_box_html( $photos ) {
6611
  $cols = wppa( 'gridcols' );
6612
  $size = 100 / $cols . '%';
6613
  $mocc = wppa( 'mocc' );
6614
- $result = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6615
 
6616
  // Open table
6617
  $result .= '
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.0.10.002
7
  *
8
  */
9
 
78
  // Nicescroller
79
  if ( $nice ) {
80
  $result .= '
81
+ <script>
82
+ jQuery(document).ready(function(){
83
+ jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
84
+ });
85
+ </script>
86
  </div>'; // close .wppa-nicewrap div
87
  }
88
 
140
  // Nicescroller
141
  if ( $nice ) {
142
  $result .= '
143
+ <script>
144
+ jQuery(document).ready(function(){
145
+ jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
146
+ });
147
+ </script>
148
  </div>'; // close .wppa-nicewrap div
149
  }
150
 
1375
  <input
1376
  type="button"
1377
  id="wppa-ss-button-' . $mocc . '"
 
 
1378
  value="' . __( 'Submit', 'wp-photo-album-plus' ) . '"
1379
+ style="vertical-align:top;margin:2px;"
1380
  onclick="wppaSuperSearchSelect(' . $mocc . ' , true)"
1381
  />';
1382
 
1383
  $result .= '
1384
+ </form>
1385
+ <script>
1386
+ jQuery(document).ready(function(){wppaSuperSearchSelect(' . $mocc . ')});
1387
+ </script>';
1388
 
1389
  return $result; // wppa_compress_html( $result );
1390
  }
4411
  style="background-color:transparent;"
4412
  >' .
4413
  $smily_html .
4414
+ $comment_input .
4415
+ ( wppa_switch( 'comment_need_db_agree' ) ? $dbconfirm_html : '' ) . '
4416
  </td>
4417
  <tr>
4418
  <tr>
4460
  </td>
4461
  <td>' .
4462
  $smily_html .
4463
+ $comment_input .
4464
+ ( wppa_switch( 'comment_need_db_agree' ) ? $dbconfirm_html : '' ) . '
4465
  </td>
4466
  </tr>';
4467
  }
6390
  $result .=
6391
  '<option' .
6392
  ' value="' . $wppa_supported_stereo_types[$key] . '"' .
6393
+ ( isset( $_COOKIE["stereotype"] ) && $_COOKIE["stereotype"] == $wppa_supported_stereo_types[$key] ? ' selected' : '' ) .
6394
  ' >' .
6395
  $wppa_supported_stereo_type_names[$key] .
6396
  '</option>';
6406
  $result .=
6407
  '<option' .
6408
  ' value="' . $wppa_supported_stereo_glasses[$key] . '"' .
6409
+ ( isset( $_COOKIE["stereoglass"] ) && $_COOKIE["stereoglass"] == $wppa_supported_stereo_glasses[$key] ? ' selected' : '' ) .
6410
  ' >' .
6411
  $wppa_supported_stereo_glass_names[$key] .
6412
  '</option>';
6606
  // Nicescroller
6607
  if ( $nice ) {
6608
  $result .= '
6609
+ <script>
6610
+ jQuery(document).ready(function(){
6611
+ jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
6612
+ });
6613
+ </script>
6614
  </div>'; // close .wppa-nicewrap div
6615
  }
6616
 
6629
  $cols = wppa( 'gridcols' );
6630
  $size = 100 / $cols . '%';
6631
  $mocc = wppa( 'mocc' );
6632
+
6633
+ // Local styles
6634
+ $result = '
6635
+ <style>
6636
+ .wppa-grid {
6637
+ border:none;
6638
+ margin:0 !important;
6639
+ padding:0 !important;
6640
+ }
6641
+ .wppa-grid tr {
6642
+ border:none;
6643
+ }
6644
+ .wppa-grid-' . $mocc . ' td {
6645
+ border:none;
6646
+ padding:6px;
6647
+ vertical-align:middle;
6648
+ width:' . $size . ';
6649
+ }
6650
+ </style>';
6651
 
6652
  // Open table
6653
  $result .= '
wppa-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  /* Contains all wppa smart cache functions
5
  /*
6
- /* Version 8.1.00.001
7
  */
8
 
9
  // Test for caching
@@ -215,7 +215,7 @@ function wppa_clear_cache( $args = array() ) {
215
  global $cache_path;
216
  global $wpdb;
217
 
218
- // wppa_log( 'obs', 'Clear cache called with args ' . var_export( $args, true ) );
219
 
220
  // Fill in default args
221
  $defaults = array( 'album' => '',
3
  /*
4
  /* Contains all wppa smart cache functions
5
  /*
6
+ /* Version 8.0.10.003
7
  */
8
 
9
  // Test for caching
215
  global $cache_path;
216
  global $wpdb;
217
 
218
+ wppa_log( 'obs', 'Clear cache called with args ' . var_export( $args, true ) );
219
 
220
  // Fill in default args
221
  $defaults = array( 'album' => '',
wppa-cloudinary.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /* Only loads when php version >= 5.3
3
  *
4
- * Version 8.1.00.001
5
  *
6
  */
7
 
@@ -14,9 +14,9 @@ function wppa_load_cloudinary() {
14
 
15
  if ( $cdn != 'cloudinary' && $cdn != 'cloudinarymaintenance' ) return;
16
 
17
- require_once 'vendor/cloudinary/src/Cloudinary.php';
18
- require_once 'vendor/cloudinary/src/Uploader.php';
19
- require_once 'vendor/cloudinary/src/Api.php';
20
 
21
  \Cloudinary::config(array(
22
  "cloud_name" => wppa_get_option('wppa_cdn_cloud_name'),
1
  <?php
2
  /* Only loads when php version >= 5.3
3
  *
4
+ * Version 7.5.03
5
  *
6
  */
7
 
14
 
15
  if ( $cdn != 'cloudinary' && $cdn != 'cloudinarymaintenance' ) return;
16
 
17
+ require_once 'cloudinary/src/Cloudinary.php';
18
+ require_once 'cloudinary/src/Uploader.php';
19
+ require_once 'cloudinary/src/Api.php';
20
 
21
  \Cloudinary::config(array(
22
  "cloud_name" => wppa_get_option('wppa_cdn_cloud_name'),
wppa-comment-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
- * Version 8.1.00.005
7
  *
8
  */
9
 
@@ -34,7 +34,7 @@ class WPPA_Comment_table extends WP_List_Table {
34
  function extra_tablenav( $which ) {
35
 
36
  if ( 'top' === $which ) {
37
- $comment_show = wppa_get_cookie( 'comadmin-show', 'all' );
38
  echo
39
  '<div class="alignleft actions">' .
40
  '<select id="wppa_comadmin_show" name="wppa_comadmin_show" onchange="" >
@@ -118,7 +118,7 @@ class WPPA_Comment_table extends WP_List_Table {
118
  '<textarea' .
119
  ' id="commenttext-' . $item['id'] . '"' .
120
  ' style="width:98%;"' .
121
- ' onchange="wppaCommentAdminUpdateHref(\'' . $item['id'] . '\')"' .
122
  ' >' .
123
  stripslashes( $item['comment'] ) .
124
  '</textarea>' .
@@ -294,20 +294,22 @@ class WPPA_Comment_table extends WP_List_Table {
294
 
295
  // Normal use
296
  else {
297
- switch( wppa_get_cookie( 'comadmin-show' ) ) {
298
- case 'all':
299
- break;
300
- case 'spam':
301
- $filter = "WHERE status = 'spam'";
302
- break;
303
- case 'pending':
304
- $filter = "WHERE status = 'pending' OR status = ''";
305
- break;
306
- case 'approved':
307
- $filter = "WHERE status = 'approved'";
308
- break;
309
- default:
310
- break;
 
 
311
  }
312
  }
313
 
@@ -353,6 +355,28 @@ function _wppa_comment_admin() {
353
  // Open page
354
  echo
355
  '<div class="wrap">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  <h1>' .
357
  ( $moderating ? __( 'Photo Albums -> Moderate Comment', 'wp-photo-album-plus' ) :
358
  __( 'Photo Albums -> Comment admin', 'wp-photo-album-plus' ) ) .
@@ -406,6 +430,21 @@ function _wppa_comment_admin() {
406
  echo
407
  '</tbody>
408
  </table>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  }
410
 
411
  echo
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
+ * Version 8.0.08.005
7
  *
8
  */
9
 
34
  function extra_tablenav( $which ) {
35
 
36
  if ( 'top' === $which ) {
37
+ $comment_show = isset( $_COOKIE['comadmin-show'] ) ? $_COOKIE['comadmin-show'] : 'all';
38
  echo
39
  '<div class="alignleft actions">' .
40
  '<select id="wppa_comadmin_show" name="wppa_comadmin_show" onchange="" >
118
  '<textarea' .
119
  ' id="commenttext-' . $item['id'] . '"' .
120
  ' style="width:98%;"' .
121
+ ' onchange="wppaUpdateHref(\'' . $item['id'] . '\')"' .
122
  ' >' .
123
  stripslashes( $item['comment'] ) .
124
  '</textarea>' .
294
 
295
  // Normal use
296
  else {
297
+ if ( isset( $_COOKIE['comadmin-show'] ) ) {
298
+ switch( $_COOKIE['comadmin-show'] ) {
299
+ case 'all':
300
+ break;
301
+ case 'spam':
302
+ $filter = "WHERE status = 'spam'";
303
+ break;
304
+ case 'pending':
305
+ $filter = "WHERE status = 'pending' OR status = ''";
306
+ break;
307
+ case 'approved':
308
+ $filter = "WHERE status = 'approved'";
309
+ break;
310
+ default:
311
+ break;
312
+ }
313
  }
314
  }
315
 
355
  // Open page
356
  echo
357
  '<div class="wrap">
358
+ <script type="text/javascript" >
359
+ function wppaUpdateHref( id ) {
360
+ var val = encodeURIComponent(jQuery(\'#commenttext-\'+id).val());
361
+ var href = jQuery(\'#href-\'+id).attr(\'href\');
362
+ var arr = href.split(\'commenttext=\');
363
+ arr[1] = val;
364
+ href = arr[0] + \'commenttext=\' + arr[1];
365
+ jQuery(\'#href-\'+id).attr(\'href\', href);
366
+ jQuery(\'#href-\'+id).css(\'display\',\'inline\');
367
+ }
368
+ </script>
369
+ <style type="text/css" >
370
+ .column-photo {
371
+ width:180px;
372
+ }
373
+ .column-user, .column-email, .column-timestamp {
374
+ width:180px;
375
+ }
376
+ .column-status {
377
+ width:100px;
378
+ }
379
+ </style>
380
  <h1>' .
381
  ( $moderating ? __( 'Photo Albums -> Moderate Comment', 'wp-photo-album-plus' ) :
382
  __( 'Photo Albums -> Comment admin', 'wp-photo-album-plus' ) ) .
430
  echo
431
  '</tbody>
432
  </table>';
433
+
434
+ /*
435
+ // Filter
436
+ $comment_show = isset( $_COOKIE['comadmin-show'] ) ? $_COOKIE['comadmin-show'] : 'all';
437
+ echo
438
+ '<p>' .
439
+ '<b>' . __( 'Filter', 'wp-photo-album-plus' ) . ': </b>' .
440
+ '<select name="wppa_comadmin_show" onchange="wppa_setCookie(\'comadmin-show\', this.value, \'365\'); document.location.reload(true);" >
441
+ <option value="all" ' . ( $comment_show == 'all' ? 'selected="selected"' : '' ) . ' >' . __( 'all', 'wp-photo-album-plus' ) . '</option>
442
+ <option value="pending" ' . ( $comment_show == 'pending' ? 'selected="selected"' : '' ) . '>' . __( 'pending', 'wp-photo-album-plus' ) . '</option>
443
+ <option value="approved" ' . ( $comment_show == 'approved' ? 'selected="selected"' : '' ) . '>' . __( 'approved', 'wp-photo-album-plus' ) . '</option>
444
+ <option value="spam" ' . ( $comment_show == 'spam' ? 'selected="selected"' : '' ) . '>' . __( 'spam', 'wp-photo-album-plus' ) . '</option>
445
+ </select>
446
+ </p>';
447
+ */
448
  }
449
 
450
  echo
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 8.1.00.001
6
  *
7
  */
8
 
@@ -113,7 +113,7 @@ global $wppa_current_shortcode_atts;
113
  $ajax = false;
114
  if ( $first_pla ) {
115
  $first_pla = false;
116
- $mocc = wppa_get( 'page', '4711', 'int' ); // Kind of random
117
  }
118
  }
119
 
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 8.0.09.001
6
  *
7
  */
8
 
113
  $ajax = false;
114
  if ( $first_pla ) {
115
  $first_pla = false;
116
+ $mocc = isset( $_REQUEST['page'] ) ? $_REQUEST['page'] : '4711'; // ; wppa_get( 'page', '4711', 'int' ); // Kind of random
117
  }
118
  }
119
 
wppa-date-time.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
- * Version 8.1.00.001
7
  *
8
  */
9
 
@@ -261,7 +261,32 @@ function wppa_local_date( $format, $timestamp = false ) {
261
  $time = time();
262
  }
263
 
264
- return wp_date( $format, $time );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  }
266
 
267
  // Return unix timestamp computed from readable date/time, corrected for timezone.
@@ -273,10 +298,18 @@ function wppa_local_strtotime( $str ) {
273
  // Find timezonestring
274
  $tzstring = wppa_get_option( 'timezone_string' );
275
 
276
- // Correct $time according to gmt_offset
277
- $current_offset = wppa_get_option( 'gmt_offset', 0 ) * 3600;
278
- $result -= $current_offset;
 
 
 
 
 
 
279
 
 
 
280
  return $result;
281
  }
282
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
+ * Version 7.7.05.002
7
  *
8
  */
9
 
261
  $time = time();
262
  }
263
 
264
+ // wp >= 5.3 ?
265
+ if ( function_exists( 'wp_date' ) ) {
266
+ return wp_date( $format, $time );
267
+ }
268
+
269
+ // Find timezonestring
270
+ $tzstring = wppa_get_option( 'timezone_string' );
271
+ if ( empty( $tzstring ) ) {
272
+
273
+ // Correct $time according to gmt_offset
274
+ $current_offset = wppa_get_option( 'gmt_offset', 0 );
275
+
276
+ $tzstring = 'UTC';
277
+
278
+ if ( is_numeric( $current_offset ) ) {
279
+ $time += $current_offset * 3600;
280
+ }
281
+ }
282
+
283
+ // Get the right output
284
+ date_default_timezone_set( $tzstring );
285
+ $result = date_i18n( $format, $time );
286
+
287
+ // Reset default timezone to wp standard
288
+ date_default_timezone_set( 'GMT' );
289
+ return $result;
290
  }
291
 
292
  // Return unix timestamp computed from readable date/time, corrected for timezone.
298
  // Find timezonestring
299
  $tzstring = wppa_get_option( 'timezone_string' );
300
 
301
+ if ( $tzstring ) {
302
+ date_default_timezone_set( "UTC" );
303
+ $current_offset = timezone_offset_get( timezone_open( $tzstring ), new DateTime() );
304
+ }
305
+ else {
306
+
307
+ // Correct $time according to gmt_offset
308
+ $current_offset = wppa_get_option( 'gmt_offset', 0 ) * 3600;
309
+ }
310
 
311
+ $result -= $current_offset;
312
+ date_default_timezone_set( 'GMT' );
313
  return $result;
314
  }
315
 
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
- * Version 8.1.00.005
7
  *
8
  */
9
 
@@ -482,14 +482,14 @@ horizrailenabled:false,";
482
  'wppa_auto_page' => 'no',
483
  'wppa_auto_page_type' => 'photo',
484
  'wppa_auto_page_links' => 'bottom',
485
- // 'wppa_defer_javascript' => 'yes',
486
- // 'wppa_custom_style' => '',
487
- // 'wppa_custom_style_chrome' => '',
488
- // 'wppa_custom_style_firefox' => '',
489
- // 'wppa_custom_style_safari' => '',
490
- // 'wppa_custom_style_edge' => '',
491
- // 'wppa_custom_style_ie' => '',
492
- // 'wppa_custom_style_opera' => '',
493
  'wppa_use_custom_style_file' => 'no',
494
  'wppa_enable_pdf' => 'yes', // IV-A30
495
  'wppa_use_custom_theme_file' => 'no',
@@ -611,6 +611,7 @@ horizrailenabled:false,";
611
  'wppa_comten_alt_thumbsize' => '75',
612
  'wppa_comment_smiley_picker' => 'no',
613
  'wppa_comment_clickable' => 'no',
 
614
  'wppa_comment_need_vote' => 'no',
615
 
616
  // G Overlay
@@ -1150,6 +1151,7 @@ horizrailenabled:false,";
1150
  'wppa_gpx_shortcode' => '[map style="width: auto; height:300px; margin:0; " marker="yes" lat="w#lat" lon="w#lon"]',
1151
  'wppa_geo_zoom' => '10',
1152
  'wppa_fotomoto_on' => 'no',
 
1153
  'wppa_fotomoto_hide_when_running' => 'no',
1154
  'wppa_fotomoto_min_width' => '400',
1155
  'wppa_image_magick' => '',
@@ -1224,8 +1226,6 @@ horizrailenabled:false,";
1224
 
1225
  'wppa_heartbeat' => '0',
1226
 
1227
- 'wppa_use_wp_upload_dir_locations' => 'no',
1228
-
1229
  );
1230
 
1231
  if ( $force ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
+ * Version 8.0.10.004
7
  *
8
  */
9
 
482
  'wppa_auto_page' => 'no',
483
  'wppa_auto_page_type' => 'photo',
484
  'wppa_auto_page_links' => 'bottom',
485
+ 'wppa_defer_javascript' => 'yes',
486
+ 'wppa_custom_style' => '',
487
+ 'wppa_custom_style_chrome' => '',
488
+ 'wppa_custom_style_firefox' => '',
489
+ 'wppa_custom_style_safari' => '',
490
+ 'wppa_custom_style_edge' => '',
491
+ 'wppa_custom_style_ie' => '',
492
+ 'wppa_custom_style_opera' => '',
493
  'wppa_use_custom_style_file' => 'no',
494
  'wppa_enable_pdf' => 'yes', // IV-A30
495
  'wppa_use_custom_theme_file' => 'no',
611
  'wppa_comten_alt_thumbsize' => '75',
612
  'wppa_comment_smiley_picker' => 'no',
613
  'wppa_comment_clickable' => 'no',
614
+ 'wppa_comment_need_db_agree' => 'no',
615
  'wppa_comment_need_vote' => 'no',
616
 
617
  // G Overlay
1151
  'wppa_gpx_shortcode' => '[map style="width: auto; height:300px; margin:0; " marker="yes" lat="w#lat" lon="w#lon"]',
1152
  'wppa_geo_zoom' => '10',
1153
  'wppa_fotomoto_on' => 'no',
1154
+ 'wppa_fotomoto_fontsize' => '',
1155
  'wppa_fotomoto_hide_when_running' => 'no',
1156
  'wppa_fotomoto_min_width' => '400',
1157
  'wppa_image_magick' => '',
1226
 
1227
  'wppa_heartbeat' => '0',
1228
 
 
 
1229
  );
1230
 
1231
  if ( $force ) {
wppa-encrypt.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
- * Version 8.1.00.001
7
  *
8
  */
9
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
+ * Version 8.0.07.009
7
  *
8
  */
9
 
wppa-export.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
- * Version 8.1.00.001
7
  *
8
  */
9
 
@@ -13,7 +13,7 @@ global $wpdb;
13
  // Export Photos admin page
14
 
15
  // Do the export if requested
16
- if ( wppa_get( 'export-submit' ) ) {
17
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
18
  wppa_export_photos();
19
  } ?>
@@ -99,13 +99,13 @@ global $wppa_temp_idx;
99
  if ( ! class_exists('ZipArchive') ) wppa_warning_message(__('Can export albums and photos, but cannot make a zipfile. Your php version does not support ZipArchive.', 'wp-photo-album-plus'));
100
  }
101
 
102
- $high = wppa_get( 'high', '0' );
103
 
104
  if ( $high ) {
105
  $id = 0;
106
  $cnt = 0;
107
  while ( $id <= $high ) {
108
- if ( wppa_get( 'album-' . $id, '0', 'text' ) ) {
109
  _e('<br/>Processing album', 'wp-photo-album-plus'); echo(' '.$id.'....');
110
  wppa_write_album_file_by_id($id);
111
  $photos = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
+ * Version 7.3.00
7
  *
8
  */
9
 
13
  // Export Photos admin page
14
 
15
  // Do the export if requested
16
+ if (isset($_POST['wppa-export-submit'])) {
17
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
18
  wppa_export_photos();
19
  } ?>
99
  if ( ! class_exists('ZipArchive') ) wppa_warning_message(__('Can export albums and photos, but cannot make a zipfile. Your php version does not support ZipArchive.', 'wp-photo-album-plus'));
100
  }
101
 
102
+ if (isset($_POST['high'])) $high = $_POST['high']; else $high = 0;
103
 
104
  if ( $high ) {
105
  $id = 0;
106
  $cnt = 0;
107
  while ( $id <= $high ) {
108
+ if (isset($_POST['album-'.$id])) {
109
  _e('<br/>Processing album', 'wp-photo-album-plus'); echo(' '.$id.'....');
110
  wppa_write_album_file_by_id($id);
111
  $photos = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 8.1.00.004
7
  *
8
  */
9
 
@@ -101,10 +101,14 @@ global $wppa_current_shortcode_atts;
101
  ( $nices ? '</div>': '' ) .
102
  '</div>';
103
 
104
- if ( $nices ) {
105
- $the_js = 'jQuery(document).ready(function(){jQuery("#wppa-div-' . $seqno . '").niceScroll(".wppa-divnicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});' . '});';
106
- wp_add_inline_script( 'wppa', $the_js );
107
- }
 
 
 
 
108
 
109
  return $result;
110
  }
@@ -293,7 +297,7 @@ global $other_deps;
293
  $unam = '';
294
  }
295
  $atts['album'] = '#tags,' . $unam;
296
- }
297
 
298
  // Displatch on type
299
  switch ( $type ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 8.0.09.001
7
  *
8
  */
9
 
101
  ( $nices ? '</div>': '' ) .
102
  '</div>';
103
 
104
+ if ( $nices ) {
105
+ $result .= '
106
+ <script>
107
+ jQuery(document).ready(function(){
108
+ jQuery("#wppa-div-' . $seqno . '").niceScroll(".wppa-divnicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});' .
109
+ '});
110
+ </script>';
111
+ }
112
 
113
  return $result;
114
  }
297
  $unam = '';
298
  }
299
  $atts['album'] = '#tags,' . $unam;
300
+ }
301
 
302
  // Displatch on type
303
  switch ( $type ) {
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.1.00.003
7
  *
8
  */
9
 
@@ -5101,7 +5101,7 @@ global $wppa_upload_succes_id;
5101
  if ( $done ) {
5102
 
5103
  // SUCCESSFUL UPLOAD, Blog It?
5104
- if ( current_user_can( 'edit_posts' ) && wppa_get( 'blogit' ) ) {
5105
 
5106
  $title = wppa_get( 'post-title' );
5107
  if ( ! $title ) {
@@ -5241,9 +5241,8 @@ global $wppa_upload_succes_id;
5241
 
5242
  $idx = '0';
5243
  while ( $idx < '10' ) {
5244
- $value = wppa_get( 'custom_' . $idx, '', 'html' );
5245
- if ( $value ) {
5246
-
5247
  $custom_data[$idx] = wppa_sanitize_custom_field( $value );
5248
  }
5249
  $idx++;
@@ -5339,7 +5338,7 @@ global $wppa_alert;
5339
  // Add new entry
5340
  if ( ! $id ) {
5341
 
5342
- $desc = wppa_get( 'user-desc', '', 'html' );
5343
  if ( ! $desc && wppa_switch( 'apply_newphoto_desc_user' ) ) {
5344
  $desc = wppa_opt( 'newphoto_description' );
5345
  }
@@ -5465,7 +5464,7 @@ global $wppa_alert;
5465
  $desc = balanceTags( wppa_get( 'user-desc' ), true );
5466
 
5467
  // If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
5468
- if ( ! $desc && wppa_get( 'blogit' ) ) {
5469
  $desc = 'w#name';
5470
  }
5471
 
@@ -5556,9 +5555,8 @@ function wppa_fe_add_tags( $id ) {
5556
  $tags = wppa_get_photo_item( $id, 'tags' );
5557
  $oldt = $tags;
5558
  for ( $i = '1'; $i < '4'; $i++ ) {
5559
- $dt = wppa_get( 'user-tags-' . $i, null, 'arraytxt' );
5560
- if ( $dt ) { // A (multi) selection out of 4 selectionboxes of existing tags
5561
- $tags .= ',' . implode( ',', $dt );
5562
  }
5563
  }
5564
  if ( wppa_get( 'new-tags' ) ) { // New tags
@@ -5584,9 +5582,8 @@ function wppa_fe_add_custom( $id ) {
5584
  if ( wppa_switch( 'fe_custom_fields' ) ) {
5585
  $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
5586
  for ( $i = '0'; $i < '10' ; $i++ ) {
5587
- $cd = wppa_get( 'wppa-user-custom-' . $i, '', 'html' );
5588
- if ( $cd ) {
5589
- $custom_data[$i] = strip_tags( $cd );
5590
  }
5591
  }
5592
  wppa_update_photo( array( 'id' => $id, 'custom' => serialize( $custom_data ) ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.0.10.002
7
  *
8
  */
9
 
5101
  if ( $done ) {
5102
 
5103
  // SUCCESSFUL UPLOAD, Blog It?
5104
+ if ( current_user_can( 'edit_posts' ) && isset( $_POST['wppa-blogit'] ) ) {
5105
 
5106
  $title = wppa_get( 'post-title' );
5107
  if ( ! $title ) {
5241
 
5242
  $idx = '0';
5243
  while ( $idx < '10' ) {
5244
+ if ( isset( $_POST['custom_' . $idx] ) ) {
5245
+ $value = wppa_get( 'custom_' . $idx );
 
5246
  $custom_data[$idx] = wppa_sanitize_custom_field( $value );
5247
  }
5248
  $idx++;
5338
  // Add new entry
5339
  if ( ! $id ) {
5340
 
5341
+ $desc = isset( $_POST['user-desc'] ) ? balanceTags( wppa_get( 'user-desc' ), true ) : '';
5342
  if ( ! $desc && wppa_switch( 'apply_newphoto_desc_user' ) ) {
5343
  $desc = wppa_opt( 'newphoto_description' );
5344
  }
5464
  $desc = balanceTags( wppa_get( 'user-desc' ), true );
5465
 
5466
  // If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
5467
+ if ( ! $desc && isset( $_POST['wppa-blogit'] ) ) {
5468
  $desc = 'w#name';
5469
  }
5470
 
5555
  $tags = wppa_get_photo_item( $id, 'tags' );
5556
  $oldt = $tags;
5557
  for ( $i = '1'; $i < '4'; $i++ ) {
5558
+ if ( isset( $_POST['wppa-user-tags-'.$i] ) ) { // Existing tags
5559
+ $tags .= ','.implode( ',', $_POST['wppa-user-tags-'.$i] );
 
5560
  }
5561
  }
5562
  if ( wppa_get( 'new-tags' ) ) { // New tags
5582
  if ( wppa_switch( 'fe_custom_fields' ) ) {
5583
  $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
5584
  for ( $i = '0'; $i < '10' ; $i++ ) {
5585
+ if ( isset( $_POST['wppa-user-custom-'.$i] ) ) {
5586
+ $custom_data[$i] = strip_tags( $_POST['wppa-user-custom-'.$i] );
 
5587
  }
5588
  }
5589
  wppa_update_photo( array( 'id' => $id, 'custom' => serialize( $custom_data ) ) );
wppa-gutenberg-wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.1.00.007
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
@@ -201,16 +201,16 @@ global $wpdb;
201
  '<td>'.
202
  '<select id="wppagallery-album-virt" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
203
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
204
- '<option value="@last" >'.__('The most recently added album', 'wp-photo-album-plus').'</option>'.
205
- '<option value="@topten" >'.__('The top rated photos', 'wp-photo-album-plus').'</option>'.
206
- '<option value="@lasten" >'.__('The most recently uploaded photos', 'wp-photo-album-plus').'</option>'.
207
- '<option value="@featen" >'.__('A random selection of featured photos', 'wp-photo-album-plus').'</option>'.
208
- '<option value="@comten" >'.__('The most recently commented photos', 'wp-photo-album-plus').'</option>'.
209
- '<option value="@tags" >'.__('Photos tagged with certain tags', 'wp-photo-album-plus').'</option>'.
210
- '<option value="@cat" >'.__('Albums tagged with a certain category', 'wp-photo-album-plus').'</option>'.
211
- '<option value="@owner" >'.__('Photos in albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
212
- '<option value="@upldr" >'.__('Photos uploaded by a certain user', 'wp-photo-album-plus').'</option>'.
213
- '<option value="@all" >'.__('All photos in the system', 'wp-photo-album-plus').'</option>'.
214
  '</select>'.
215
  '</td>'.
216
  '</tr>'.
@@ -221,10 +221,10 @@ global $wpdb;
221
  '<td>'.
222
  '<select id="wppagallery-album-virt-cover" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
223
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
224
- '<option value="@last" >'.__('The most recently modified album', 'wp-photo-album-plus').'</option>'.
225
- '<option value="@owner" >'.__('Albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
226
- '<option value="@cat" >'.__('Albums tagged with certain categories', 'wp-photo-album-plus').'</option>'.
227
- '<option value="@all" >'.__('All albums in the system', 'wp-photo-album-plus').'</option>'.
228
  '</select>'.
229
  '</td>'.
230
  '</tr>'.
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.0.02.006
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
201
  '<td>'.
202
  '<select id="wppagallery-album-virt" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
203
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
204
+ '<option value="#last" >'.__('The most recently added album', 'wp-photo-album-plus').'</option>'.
205
+ '<option value="#topten" >'.__('The top rated photos', 'wp-photo-album-plus').'</option>'.
206
+ '<option value="#lasten" >'.__('The most recently uploaded photos', 'wp-photo-album-plus').'</option>'.
207
+ '<option value="#featen" >'.__('A random selection of featured photos', 'wp-photo-album-plus').'</option>'.
208
+ '<option value="#comten" >'.__('The most recently commented photos', 'wp-photo-album-plus').'</option>'.
209
+ '<option value="#tags" >'.__('Photos tagged with certain tags', 'wp-photo-album-plus').'</option>'.
210
+ '<option value="#cat" >'.__('Albums tagged with a certain category', 'wp-photo-album-plus').'</option>'.
211
+ '<option value="#owner" >'.__('Photos in albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
212
+ '<option value="#upldr" >'.__('Photos uploaded by a certain user', 'wp-photo-album-plus').'</option>'.
213
+ '<option value="#all" >'.__('All photos in the system', 'wp-photo-album-plus').'</option>'.
214
  '</select>'.
215
  '</td>'.
216
  '</tr>'.
221
  '<td>'.
222
  '<select id="wppagallery-album-virt-cover" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
223
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
224
+ '<option value="#last" >'.__('The most recently modified album', 'wp-photo-album-plus').'</option>'.
225
+ '<option value="#owner" >'.__('Albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
226
+ '<option value="#cat" >'.__('Albums tagged with certain categories', 'wp-photo-album-plus').'</option>'.
227
+ '<option value="#all" >'.__('All albums in the system', 'wp-photo-album-plus').'</option>'.
228
  '</select>'.
229
  '</td>'.
230
  '</tr>'.
wppa-import.php CHANGED
@@ -191,7 +191,12 @@ global $wppa_session;
191
  'wp-photo-album-plus' ), WPPA_DEPOT_PATH ) );
192
  }
193
 
194
- $can_remote = true;
 
 
 
 
 
195
  // Get this users current source type setting ( local/remote )
196
  $source_type = wppa_get_option( 'wppa_import_source_type_'.$user, 'local' );
197
 
@@ -1722,12 +1727,14 @@ global $wppa_session;
1722
  $files = array();
1723
 
1724
  // Get page content
1725
- $response = wp_remote_get( $setting );
1726
- $contents = wp_remote_retrieve_body( $response );
1727
- $httpcode = wp_remote_retrieve_response_code( $response );
 
 
1728
 
1729
  // Process result
1730
- if ( $httpcode == 200 ) {
1731
 
1732
  // Preprocess
1733
  $contents = str_replace( '\'', '"', $contents );
191
  'wp-photo-album-plus' ), WPPA_DEPOT_PATH ) );
192
  }
193
 
194
+ // See if remote is possible
195
+ $can_remote = ini_get( 'allow_url_fopen' ) && function_exists( 'curl_init' );
196
+ if ( ! $can_remote ) {
197
+ update_option( 'wppa_import_source_type_'.$user, 'local' );
198
+ }
199
+
200
  // Get this users current source type setting ( local/remote )
201
  $source_type = wppa_get_option( 'wppa_import_source_type_'.$user, 'local' );
202
 
1727
  $files = array();
1728
 
1729
  // Get page content
1730
+ $curl = curl_init();
1731
+ curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
1732
+ curl_setopt( $curl, CURLOPT_URL, $setting );
1733
+ $contents = curl_exec( $curl );
1734
+ curl_close( $curl );
1735
 
1736
  // Process result
1737
+ if ( $contents ) {
1738
 
1739
  // Preprocess
1740
  $contents = str_replace( '\'', '"', $contents );
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 8.1.00.002
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -181,19 +181,6 @@ global $blog_id;
181
  define( 'WPPA_DEPOT_URL', site_url() . '/' . WPPA_DEPOT );
182
  }
183
  }
184
- // This is for sites where wp_upload_dir() returns valid output and having non standard file locations
185
- elseif ( get_option( 'wppa_use_wp_upload_dir_locations', 'no' ) == 'yes' ) {
186
- $user = is_user_logged_in() ? '/' . wppa_get_user() : '';
187
- $dir = wp_upload_dir();
188
- $basedir = $dir['basedir'];
189
- $baseurl = $dir['baseurl'];
190
- define( 'WPPA_UPLOAD_PATH', $basedir . '/wppa' );
191
- define( 'WPPA_UPLOAD_URL', $baseurl . '/wppa' );
192
- define( 'WPPA_UPLOAD', str_replace( ABSPATH, '', $basedir ) );
193
- define( 'WPPA_DEPOT_PATH', dirname( $basedir ) . '/wppa-depot' . $user );
194
- define( 'WPPA_DEPOT_URL', dirname( $baseurl ) . '/wppa-depot' . $user );
195
- define( 'WPPA_DEPOT', str_replace( ABSPATH, '', WPPA_DEPOT_PATH ) );
196
- }
197
  else { // Single site or multisite global
198
  define( 'WPPA_UPLOAD', $rel_uploads_path );
199
  if ( ! defined( 'WPPA_UPLOAD_PATH' ) ) {
@@ -279,19 +266,19 @@ function wppa_maintenance_messages() {
279
 
280
  // Check for pending actions
281
  if ( wppa_get_option( 'wppa_remove_empty_albums_status' ) && wppa_get_option( 'wppa_remove_empty_albums_user', wppa_get_user() ) == wppa_get_user() ) {
282
- wppa_warning_message( __( 'Remove empty albums needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '9', '', '', true ) );
283
  }
284
  if ( wppa_get_option( 'wppa_apply_new_photodesc_all_status' ) && wppa_get_option( 'wppa_apply_new_photodesc_all_user', wppa_get_user() ) == wppa_get_user() ) {
285
- wppa_warning_message( __( 'Applying new photo description needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '6', '', '', true ) );
286
  }
287
  if ( wppa_get_option( 'wppa_append_to_photodesc_status' ) && wppa_get_option( 'wppa_append_to_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
288
- wppa_warning_message( __( 'Appending to photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '7', '', '', true ) );
289
  }
290
  if ( wppa_get_option( 'wppa_remove_from_photodesc_status' ) && wppa_get_option( 'wppa_remove_from_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
291
- wppa_warning_message( __( 'Removing from photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '8', '', '', true ) );
292
  }
293
  if ( wppa_get_option( 'wppa_remove_file_extensions_status' ) && wppa_get_option( 'wppa_remove_file_extensions_user', wppa_get_user() ) == wppa_get_user() ) {
294
- wppa_warning_message( __( 'Removing file extensions needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '10', '', '', true ) );
295
  }
296
  if ( wppa_get_option( 'wppa_regen_thumbs_status' ) && wppa_get_option( 'wppa_regen_thumbs_user', wppa_get_user() ) == wppa_get_user() ) {
297
  wppa_warning_message( __( 'Regenerating the Thumbnails needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '4', '', '', true ) );
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 8.0.08.005
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
181
  define( 'WPPA_DEPOT_URL', site_url() . '/' . WPPA_DEPOT );
182
  }
183
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  else { // Single site or multisite global
185
  define( 'WPPA_UPLOAD', $rel_uploads_path );
186
  if ( ! defined( 'WPPA_UPLOAD_PATH' ) ) {
266
 
267
  // Check for pending actions
268
  if ( wppa_get_option( 'wppa_remove_empty_albums_status' ) && wppa_get_option( 'wppa_remove_empty_albums_user', wppa_get_user() ) == wppa_get_user() ) {
269
+ wppa_warning_message( __( 'Remove empty albums needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '31', '', '', true ) );
270
  }
271
  if ( wppa_get_option( 'wppa_apply_new_photodesc_all_status' ) && wppa_get_option( 'wppa_apply_new_photodesc_all_user', wppa_get_user() ) == wppa_get_user() ) {
272
+ wppa_warning_message( __( 'Applying new photo description needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '28', '', '', true ) );
273
  }
274
  if ( wppa_get_option( 'wppa_append_to_photodesc_status' ) && wppa_get_option( 'wppa_append_to_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
275
+ wppa_warning_message( __( 'Appending to photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '29', '', '', true ) );
276
  }
277
  if ( wppa_get_option( 'wppa_remove_from_photodesc_status' ) && wppa_get_option( 'wppa_remove_from_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
278
+ wppa_warning_message( __( 'Removing from photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '30', '', '', true ) );
279
  }
280
  if ( wppa_get_option( 'wppa_remove_file_extensions_status' ) && wppa_get_option( 'wppa_remove_file_extensions_user', wppa_get_user() ) == wppa_get_user() ) {
281
+ wppa_warning_message( __( 'Removing file extensions needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '32', '', '', true ) );
282
  }
283
  if ( wppa_get_option( 'wppa_regen_thumbs_status' ) && wppa_get_option( 'wppa_regen_thumbs_user', wppa_get_user() ) == wppa_get_user() ) {
284
  wppa_warning_message( __( 'Regenerating the Thumbnails needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '4', '', '', true ) );
wppa-input.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
- * Version 8.1.00.003
7
  *
8
  */
9
 
@@ -86,6 +86,7 @@ function wppa_get_get_filter( $name ) {
86
  case 'pano-val':
87
  case 'album-page-no':
88
  case 'high':
 
89
  $result = 'int';
90
  break;
91
 
@@ -131,10 +132,6 @@ function wppa_get_get_filter( $name ) {
131
  case 'applynewdesc':
132
  case 'remakealbum':
133
  case 'search-submit':
134
- case 'export-submit':
135
- case 'blogit':
136
- case 'cron':
137
- case 'seq':
138
  $result = 'bool';
139
  break;
140
 
@@ -219,7 +216,10 @@ function wppa_get_get_filter( $name ) {
219
  case 'delete':
220
  case 'cache':
221
  case 'item':
222
- case 'error':
 
 
 
223
  $result = 'text';
224
  break;
225
 
@@ -253,7 +253,7 @@ function wppa_get_get_filter( $name ) {
253
  case 'bulk-photo':
254
  $result = 'arraytxt';
255
  break;
256
-
257
  default:
258
  $result = 'raw';
259
  break;
@@ -269,11 +269,6 @@ global $wpdb;
269
  // Save orig xname for debug
270
  $oxname = $xname;
271
 
272
- // Sanitize
273
- $xname = sanitize_text_field( $xname );
274
- $default = $default ? sanitize_text_field( $default ) : false;
275
- $filter = sanitize_text_field( $filter );
276
-
277
  // Ajax call?
278
  if ( $xname == 'action' ) {
279
  if ( isset( $_REQUEST['wppa-action'] ) ) {
@@ -300,9 +295,7 @@ global $wpdb;
300
  $value = isset( $_REQUEST[$name] ) ? $_REQUEST[$name] : null;
301
  }
302
  if ( ! isset( $value ) ) $value = isset( $_REQUEST[$xname] ) ? $_REQUEST[$xname] : null;
303
- if ( ! isset( $value ) ) {
304
- return $default;
305
- }
306
 
307
  // Get the right filter
308
  if ( ! $filter ) {
@@ -378,7 +371,7 @@ global $wpdb;
378
  case 'url':
379
  $result = esc_url_raw( $value );
380
  break;
381
-
382
  case 'arraytxt':
383
  $result = array();
384
  foreach ( array_keys( $value ) as $key ) {
@@ -387,13 +380,13 @@ global $wpdb;
387
  break;
388
 
389
  case 'raw':
390
- wppa_log( 'err', 'Unfiltered (raw) querystring arg = ' . $name . ', value = ' . var_export( $value, true ) );
391
- $result = sanitize_text_field( $value );
392
  break;
393
 
394
  default:
395
- wppa_log( 'err', 'Unknown filter for querystring arg = ' . $name . ', value = ' . var_export( $value, true ) );
396
- $result = sanitize_text_field( $value );
397
  break;
398
  }
399
 
@@ -413,24 +406,5 @@ function wppa_sanitize_searchstring( $str ) {
413
  }
414
  $result = implode( ',', $temp );
415
 
416
- return $result;
417
- }
418
-
419
- // Retrieve a cookie, sanitized and verified
420
- function wppa_get_cookie( $name, $default = '' ) {
421
-
422
- // Sanitize
423
- $name = sanitize_text_field( $name );
424
- $default = sanitize_text_field( $default );
425
-
426
- // Validate
427
- if ( isset( $_COOKIE[$name] ) ) {
428
-
429
- $result = sanitize_text_field( $_COOKIE[$name] );
430
- }
431
- else {
432
- $result = $default;
433
- }
434
-
435
  return $result;
436
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
+ * Version 8.0.10.005
7
  *
8
  */
9
 
86
  case 'pano-val':
87
  case 'album-page-no':
88
  case 'high':
89
+ case 'albumeditid':
90
  $result = 'int';
91
  break;
92
 
132
  case 'applynewdesc':
133
  case 'remakealbum':
134
  case 'search-submit':
 
 
 
 
135
  $result = 'bool';
136
  break;
137
 
216
  case 'delete':
217
  case 'cache':
218
  case 'item':
219
+ case 'list':
220
+ case 'onoff':
221
+ case 'albumeditnonce':
222
+ case 'albumeditsubmit':
223
  $result = 'text';
224
  break;
225
 
253
  case 'bulk-photo':
254
  $result = 'arraytxt';
255
  break;
256
+
257
  default:
258
  $result = 'raw';
259
  break;
269
  // Save orig xname for debug
270
  $oxname = $xname;
271
 
 
 
 
 
 
272
  // Ajax call?
273
  if ( $xname == 'action' ) {
274
  if ( isset( $_REQUEST['wppa-action'] ) ) {
295
  $value = isset( $_REQUEST[$name] ) ? $_REQUEST[$name] : null;
296
  }
297
  if ( ! isset( $value ) ) $value = isset( $_REQUEST[$xname] ) ? $_REQUEST[$xname] : null;
298
+ if ( ! isset( $value ) ) return $default;
 
 
299
 
300
  // Get the right filter
301
  if ( ! $filter ) {
371
  case 'url':
372
  $result = esc_url_raw( $value );
373
  break;
374
+
375
  case 'arraytxt':
376
  $result = array();
377
  foreach ( array_keys( $value ) as $key ) {
380
  break;
381
 
382
  case 'raw':
383
+ wppa_log( 'obs', 'Unfiltered (raw) querystring arg = ' . $name . ', value = ' . var_export( $value, true ) );
384
+ $result = $value ? '1' : '0';
385
  break;
386
 
387
  default:
388
+ wppa_log( 'obs', 'Unknown filter for querystring arg = ' . $name . ', value = ' . var_export( $value, true ) );
389
+ $result = $value ? '1' : '0';
390
  break;
391
  }
392
 
406
  }
407
  $result = implode( ',', $temp );
408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  return $result;
410
  }
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 8.1.00.004
7
  *
8
  */
9
 
@@ -339,7 +339,7 @@ function wppa_get_photo_desc( $id, $xargs = array() ) {
339
  // To prevent recursive rendering of scripts or shortcodes:
340
  $desc = str_replace( array( '%%wppa%%', '[wppa', '[/wppa]' ), array( '%-wppa-%', '{wppa', '{/wppa}' ), $desc );
341
 
342
- // Geo. This is only in a slideshow
343
  if ( $thumb['location'] && ! wppa_in_widget() && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false && $args['dogeo'] ) {
344
  wppa_do_geo( $id, $thumb['location'] );
345
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
+ * Version 7.7.02.005
7
  *
8
  */
9
 
339
  // To prevent recursive rendering of scripts or shortcodes:
340
  $desc = str_replace( array( '%%wppa%%', '[wppa', '[/wppa]' ), array( '%-wppa-%', '{wppa', '{/wppa}' ), $desc );
341
 
342
+ // Geo
343
  if ( $thumb['location'] && ! wppa_in_widget() && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false && $args['dogeo'] ) {
344
  wppa_do_geo( $id, $thumb['location'] );
345
  }
wppa-links.php CHANGED
@@ -118,16 +118,32 @@ global $wppa_runtime_settings;
118
  if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
119
 
120
  switch ( wppa_opt( 'ajax_method' ) ) {
 
 
 
 
 
 
 
121
  case 'admin':
122
- case 'none':
123
  $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
124
  break;
125
- default: // 'normal'
126
  if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
127
- else $al = site_url() . '/wppaajax?action=wppa&amp;wppa-action=render';
 
 
 
128
  break;
129
  }
130
-
 
 
 
 
 
 
 
131
  // See if this call is from an ajax operation or...
132
  if ( wppa( 'ajax' ) ) {
133
  if ( wppa_get( 'size' ) ) $al .= '&amp;wppa-size=' . wppa_get( 'size' );
118
  if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
119
 
120
  switch ( wppa_opt( 'ajax_method' ) ) {
121
+ case 'normal':
122
+ if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
123
+ else $al = site_url() . '/wppaajax?action=wppa&amp;wppa-action=render';
124
+ break;
125
+ case 'wppaajax':
126
+ $al = site_url() . '/wppaajax?action=wppa&amp;wppa-action=render';
127
+ break;
128
  case 'admin':
 
129
  $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
130
  break;
131
+ case 'extern':
132
  if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
133
+ else $al = WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=render';
134
+ break;
135
+ case 'none':
136
+ $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
137
  break;
138
  }
139
+ /*
140
+ if ( ! is_admin() ) {
141
+ $al = site_url() . '/wppaajax/?action=wppa&amp;wppa-action=render';
142
+ }
143
+ else {
144
+ $al = admin_url( 'admin-ajax.php' ).'?action=wppa&amp;wppa-action=render';
145
+ }
146
+ */
147
  // See if this call is from an ajax operation or...
148
  if ( wppa( 'ajax' ) ) {
149
  if ( wppa_get( 'size' ) ) $al .= '&amp;wppa-size=' . wppa_get( 'size' );
wppa-maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
- * Version 8.1.00.005
7
  *
8
  */
9
 
@@ -946,9 +946,13 @@ global $wppa_endtime;
946
  // Test for timeout / ready
947
  $lastid = $id;
948
  update_option( $slug.'_last', $lastid );
949
-
950
- wppa_maintenance_update_status( $slug, $lastid, $wpdb->wppa_photos );
951
-
 
 
 
 
952
  if ( wppa_is_time_up() ) break; // Time out
953
  }
954
  else { // Nothing to do, Done anyway
@@ -1074,7 +1078,13 @@ global $wppa_endtime;
1074
  }
1075
 
1076
  // Update status
1077
- wppa_maintenance_update_status( $slug, $lastid, $wpdb->wppa_index );
 
 
 
 
 
 
1078
 
1079
  if ( wppa_is_time_up() ) break;
1080
  if ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) break;
@@ -1257,25 +1267,6 @@ global $wppa_endtime;
1257
  wppa_exit();
1258
  }
1259
 
1260
- // Stutus update
1261
- function wppa_maintenance_update_status( $slug, $lastid, $table ) {
1262
- global $wpdb;
1263
-
1264
- if ( $slug == 'wppa_cleanup' ) return;
1265
-
1266
- $togo = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $table WHERE id > %s ", $lastid ) );
1267
- if ( $togo ) {
1268
- update_option( $slug.'_togo', $togo );
1269
- if ( wppa_is_cron() ) {
1270
- update_option( $slug.'_status', 'Cron job' );
1271
- }
1272
- else {
1273
- update_option( $slug.'_status', 'Working' );
1274
- }
1275
- }
1276
- // wppa_log( 'obs', "Maint did $lastid for $slug" );
1277
- }
1278
-
1279
  function wppa_do_maintenance_popup( $slug ) {
1280
  global $wpdb;
1281
  global $wppa_log_file;
@@ -1288,7 +1279,18 @@ global $wppa_log_file;
1288
  '<div' .
1289
  ' id="wppa-maintenance-list"' .
1290
  ( strpos( $_SERVER['REQUEST_URI'], 'page=wppa_log' ) !== false || wppa_get( 'raw' ) ? '' : ' style="max-height:500px; overflow:hidden;width:100%;"' ) .
1291
- ' >';
 
 
 
 
 
 
 
 
 
 
 
1292
 
1293
  // Open nicescroller wrapper
1294
  $result .= '<div class="wppa-nicewrap" >';
@@ -1606,12 +1608,19 @@ global $wppa_log_file;
1606
  $result = 'Error: Unimplemented slug: ' . $slug . ' in wppa_do_maintenance_popup()';
1607
  }
1608
 
 
1609
  $result .= '
1610
- </div></div>';
 
 
 
 
 
 
 
1611
 
1612
- // Activate nicescroller on wrapper
1613
- // $the_js = 'if (jQuery("#wppa-maintenance-list").niceScroll) {jQuery(document).ready(function(){jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});});};';
1614
- // wp_add_inline_script( 'wppa-admin', $the_js );
1615
 
1616
  return htmlspecialchars( $header ) . '|' . $result;
1617
  }
@@ -1724,9 +1733,8 @@ function wppa_log_page() {
1724
  ' onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"' .
1725
  ' type="button" >' .
1726
  '</h1>' .
1727
-
1728
  wp_nonce_field('wppa-nonce', 'wppa-nonce') .
1729
-
1730
  '&nbsp;<img' .
1731
  ' id="wppa-spinner"' .
1732
  ' src="' . wppa_get_imgdir( 'spinner.gif' ) . '"' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.0.10.004
7
  *
8
  */
9
 
946
  // Test for timeout / ready
947
  $lastid = $id;
948
  update_option( $slug.'_last', $lastid );
949
+ if ( wppa_is_cron() ) {
950
+ $togo = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE id > %s ", $lastid ) );
951
+ if ( $togo ) {
952
+ update_option( $slug.'_togo', $togo );
953
+ update_option( $slug.'_status', 'Cron job' );
954
+ }
955
+ }
956
  if ( wppa_is_time_up() ) break; // Time out
957
  }
958
  else { // Nothing to do, Done anyway
1078
  }
1079
 
1080
  // Update status
1081
+ if ( wppa_is_cron() ) {
1082
+ $togo = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_index WHERE id > %s ", $lastid ) );
1083
+ if ( $togo ) {
1084
+ update_option( $slug.'_togo', $togo );
1085
+ update_option( $slug.'_status', 'Cron job' );
1086
+ }
1087
+ }
1088
 
1089
  if ( wppa_is_time_up() ) break;
1090
  if ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) break;
1267
  wppa_exit();
1268
  }
1269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1270
  function wppa_do_maintenance_popup( $slug ) {
1271
  global $wpdb;
1272
  global $wppa_log_file;
1279
  '<div' .
1280
  ' id="wppa-maintenance-list"' .
1281
  ( strpos( $_SERVER['REQUEST_URI'], 'page=wppa_log' ) !== false || wppa_get( 'raw' ) ? '' : ' style="max-height:500px; overflow:hidden;width:100%;"' ) .
1282
+ ' >' .
1283
+ '<style type="text/css" >' .
1284
+ '#wppa-maintenance-list h2 {' .
1285
+ 'margin-top:0;' .
1286
+ '}' .
1287
+ '#wppa-maintenance-list div {' .
1288
+ 'background-color:#f1f1f1; border:1px solid #ddd;' .
1289
+ '}' .
1290
+ '#wppa-maintenance-list td, #wppa-maintenance-list th {' .
1291
+ 'border-right: 1px solid darkgray;' .
1292
+ '}' .
1293
+ '</style>';
1294
 
1295
  // Open nicescroller wrapper
1296
  $result .= '<div class="wppa-nicewrap" >';
1608
  $result = 'Error: Unimplemented slug: ' . $slug . ' in wppa_do_maintenance_popup()';
1609
  }
1610
 
1611
+ // End nicescroller wrapper
1612
  $result .= '
1613
+ <script type="text/javascript" >
1614
+ if ( jQuery("#wppa-maintenance-list").niceScroll ) {
1615
+ jQuery(document).ready(function(){
1616
+ jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
1617
+ });
1618
+ }
1619
+ </script>
1620
+ </div>';
1621
 
1622
+ $result .=
1623
+ '</div>';
 
1624
 
1625
  return htmlspecialchars( $header ) . '|' . $result;
1626
  }
1733
  ' onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"' .
1734
  ' type="button" >' .
1735
  '</h1>' .
 
1736
  wp_nonce_field('wppa-nonce', 'wppa-nonce') .
1737
+ '<style type="text/css" >h2 { display:none; }</style>' .
1738
  '&nbsp;<img' .
1739
  ' id="wppa-spinner"' .
1740
  ' src="' . wppa_get_imgdir( 'spinner.gif' ) . '"' .
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 8.1.00.006
7
  *
8
  */
9
 
@@ -32,7 +32,6 @@ global $wppa_api_version;
32
  if ( is_file($userstyle) ) {
33
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css', array(), $wppa_api_version);
34
  wp_enqueue_style('wppa_style');
35
- wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
36
  return;
37
  }
38
 
@@ -41,7 +40,6 @@ global $wppa_api_version;
41
  if ( is_file($userstyle) ) {
42
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('template') . '/wppa-style.css', array(), $wppa_api_version);
43
  wp_enqueue_style('wppa_style');
44
- wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
45
  return;
46
  }
47
  }
@@ -57,46 +55,6 @@ global $wppa_api_version;
57
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $ver);
58
  wp_enqueue_style('wppa_style');
59
 
60
- $the_css = wppa_create_wppa_dynamic_css();
61
- $the_css .= '
62
- #wppaphoto-table {
63
- box-sizing:border-box; width:100% !important;
64
- }
65
- .wppa-bar {
66
- background-color: #7f7;
67
- width:0%;
68
- height:18px;
69
- border-radius: 3px;
70
- line-height: 18px;
71
- margin: 0;
72
- }
73
- .wppa-percent {
74
- position:relative;
75
- display:inline-block;
76
- top:-19px;
77
- font-size: 12px;
78
- line-height: 18px;
79
- margin: 0;
80
- }
81
- .wppa-message {
82
- clear: both;
83
- }
84
- #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
85
- padding: 2px; 0;
86
- }
87
- #wppaphoto-table th {
88
- width:200px;
89
- }
90
- #wppaphoto-table input {
91
- padding:4px;
92
- }
93
- #wppaphoto-table th, #wppaphoto-table td {
94
- border:none;
95
- }
96
- #wppaphoto-shortcode-preview-container {
97
- width:500px !important;
98
- }';
99
- wp_add_inline_style( 'wppa_style', $the_css );
100
  }
101
 
102
  /* SEO META TAGS AND SM SHARE DATA */
@@ -440,7 +398,72 @@ global $wppa_lang;
440
  global $wppa_api_version;
441
 
442
  // dynamic css
443
- // echo wppa_create_wppa_dynamic_css();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
 
445
  // Pinterest js
446
  if ( ( wppa_switch( 'share_on') || wppa_switch( 'share_on_widget') ) && wppa_switch( 'share_pinterest') ) {
@@ -454,6 +477,7 @@ global $wppa_api_version;
454
 
455
  echo '
456
  <script type="text/javascript" >
 
457
  </script>';
458
  }
459
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 8.0.07.001
7
  *
8
  */
9
 
32
  if ( is_file($userstyle) ) {
33
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css', array(), $wppa_api_version);
34
  wp_enqueue_style('wppa_style');
 
35
  return;
36
  }
37
 
40
  if ( is_file($userstyle) ) {
41
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('template') . '/wppa-style.css', array(), $wppa_api_version);
42
  wp_enqueue_style('wppa_style');
 
43
  return;
44
  }
45
  }
55
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $ver);
56
  wp_enqueue_style('wppa_style');
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
 
60
  /* SEO META TAGS AND SM SHARE DATA */
398
  global $wppa_api_version;
399
 
400
  // dynamic css
401
+ echo wppa_create_wppa_dynamic_css();
402
+
403
+ // Inline styles?
404
+ if ( wppa_opt( 'custom_style' ) ) {
405
+ echo '
406
+ <!-- WPPA+ Custom styles -->
407
+ <style type="text/css" >';
408
+ echo wppa_opt( 'custom_style' ) . '
409
+ </style>';
410
+ }
411
+
412
+ // Browser dependant css
413
+ if ( wppa_is_edge() ) {
414
+ if ( wppa_opt( 'custom_style_edge' ) ) {
415
+ echo '
416
+ <!-- WPPA+ Custom styles Edge -->
417
+ <style type="text/css" >
418
+ ' . wppa_opt( 'custom_style_edge' ) . '
419
+ </style>';
420
+ }
421
+ }
422
+ elseif ( wppa_is_chrome() ) {
423
+ if ( wppa_opt( 'custom_style_chrome' ) ) {
424
+ echo '
425
+ <!-- WPPA+ Custom styles Chrome -->
426
+ <style type="text/css" >
427
+ ' . wppa_opt( 'custom_style_chrome' ) . '
428
+ </style>';
429
+ }
430
+ }
431
+ elseif ( wppa_is_firefox() ) {
432
+ if ( wppa_opt( 'custom_style_firefox' ) ) {
433
+ echo '
434
+ <!-- WPPA+ Custom styles Firefox -->
435
+ <style type="text/css" >
436
+ ' . wppa_opt( 'custom_style_firefox' ) . '
437
+ </style>';
438
+ }
439
+ }
440
+ elseif ( wppa_is_safari() ) {
441
+ if ( wppa_opt( 'custom_style_safari' ) ) {
442
+ echo '
443
+ <!-- WPPA+ Custom styles Safari -->
444
+ <style type="text/css" >
445
+ ' . wppa_opt( 'custom_style_safari' ) . '
446
+ </style>';
447
+ }
448
+ }
449
+ elseif ( wppa_is_ie() ) {
450
+ if ( wppa_opt( 'custom_style_ie' ) ) {
451
+ echo '
452
+ <!-- WPPA+ Custom styles IE -->
453
+ <style type="text/css" >
454
+ ' . wppa_opt( 'custom_style_ie' ) . '
455
+ </style>';
456
+ }
457
+ }
458
+ elseif ( wppa_is_opera() ) {
459
+ if ( wppa_opt( 'custom_style_opera' ) ) {
460
+ echo '
461
+ <!-- WPPA+ Custom styles Opera -->
462
+ <style type="text/css" >
463
+ ' . wppa_opt( 'custom_style_opera' ) . '
464
+ </style>';
465
+ }
466
+ }
467
 
468
  // Pinterest js
469
  if ( ( wppa_switch( 'share_on') || wppa_switch( 'share_on_widget') ) && wppa_switch( 'share_pinterest') ) {
477
 
478
  echo '
479
  <script type="text/javascript" >
480
+ wppaDebug = true;
481
  </script>';
482
  }
483
 
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 8.1.00.006
7
  *
8
  */
9
 
@@ -300,22 +300,23 @@ global $wpdb;
300
  // There are photos to display for editing
301
  else {
302
 
303
- // Local js functions
304
- $the_js = "
 
305
  function wppaTryMove( id, video ) {
306
 
307
  var query;
308
 
309
  if ( ! jQuery( '#target-' + id ).val() ) {
310
- alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
311
  return false;
312
  }
313
 
314
  if ( video ) {
315
- query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
316
  }
317
  else {
318
- query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
319
  }
320
 
321
  if ( confirm( query ) ) {
@@ -328,15 +329,15 @@ function wppaTryCopy( id, video ) {
328
  var query;
329
 
330
  if ( ! jQuery( '#target-' + id ).val() ) {
331
- alert( '" . esc_js( __( 'Please select an album to copy to first.', 'wp-photo-album-plus' ) ) . "' );
332
  return false;
333
  }
334
 
335
  if ( video ) {
336
- query = '" . esc_js( __( 'Are you sure you want to copy this video?', 'wp-photo-album-plus' ) ) . "';
337
  }
338
  else {
339
- query = '" . esc_js( __( 'Are you sure you want to copy this photo?', 'wp-photo-album-plus' ) ) . "';
340
  }
341
 
342
  if ( confirm( query ) ) {
@@ -349,10 +350,10 @@ function wppaTryDelete( id, video ) {
349
  var query;
350
 
351
  if ( video ) {
352
- query = '" . esc_js( __( 'Are you sure you want to delete this video?', 'wp-photo-album-plus' ) ) . "';
353
  }
354
  else {
355
- query = '" . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . "';
356
  }
357
 
358
  if ( confirm( query ) ) {
@@ -367,7 +368,7 @@ function wppaTryUndelete ( id ) {
367
 
368
  function wppaTryRotLeft( id ) {
369
 
370
- var query = '" . esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) . "';
371
 
372
  if ( confirm( query ) ) {
373
  wppaAjaxUpdatePhoto( id, 'rotleft', 0 );
@@ -376,7 +377,7 @@ function wppaTryRotLeft( id ) {
376
 
377
  function wppaTryRot180( id ) {
378
 
379
- var query = '" . esc_js( __( 'Are you sure you want to rotate this photo 180&deg;?', 'wp-photo-album-plus' ) ) . "';
380
 
381
  if ( confirm( query ) ) {
382
  wppaAjaxUpdatePhoto( id, 'rot180', 0 );
@@ -385,7 +386,7 @@ function wppaTryRot180( id ) {
385
 
386
  function wppaTryRotRight( id ) {
387
 
388
- var query = '" . esc_js( __( 'Are you sure you want to rotate this photo right?', 'wp-photo-album-plus' ) ) . "';
389
 
390
  if ( confirm( query ) ) {
391
  wppaAjaxUpdatePhoto( id, 'rotright', 0 );
@@ -394,7 +395,7 @@ function wppaTryRotRight( id ) {
394
 
395
  function wppaTryFlip( id ) {
396
 
397
- var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
398
 
399
  if ( confirm( query ) ) {
400
  wppaAjaxUpdatePhoto( id, 'flip', 0 );
@@ -403,7 +404,7 @@ function wppaTryFlip( id ) {
403
 
404
  function wppaTryFlop( id ) {
405
 
406
- var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
407
 
408
  if ( confirm( query ) ) {
409
  wppaAjaxUpdatePhoto( id, 'flop', 0 );
@@ -415,22 +416,22 @@ function wppaTryWatermark( id, hasSource, canRemove ) {
415
  var query;
416
  var wmFile = jQuery( '#wmfsel_' + id ).val();
417
  if ( wmFile == '--- none ---' ) {
418
- alert( '" . esc_js( __( 'No watermark selected', 'wp-photo-album-plus' ) ) . "' );
419
  return;
420
  }
421
  if ( hasSource ) {
422
- query = '" . esc_js( __( 'Are you sure?', 'wp-photo-album-plus' ) ) . "';
423
- query += '. ';
424
- query += '" . esc_js( __( 'To revert to the default watermark setting afterwards: select Watermark: --- default --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
425
  if ( canRemove ) {
426
- query += '. ';
427
- query += '" . esc_js( __( 'To remove: select Watermark: --- none --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
428
  }
429
  }
430
  else {
431
- query = '" . esc_js( __( 'Are you sure? Once applied it can not be removed!', 'wp-photo-album-plus' ) ) . "';
432
- query += '. ';
433
- query += '" . esc_js( __( 'And I do not know if there is already a watermark on this photo', 'wp-photo-album-plus' ) ) . "';
434
  }
435
 
436
  if ( confirm( query ) ) {
@@ -444,7 +445,7 @@ function wppaTryMagick( id, slug, value ) {
444
  value = 0;
445
  }
446
 
447
- var query = '" . esc_js( __( 'Are you sure you want to magically process this photo?', 'wp-photo-album-plus' ) ) . "';
448
 
449
  if ( true || confirm( query ) ) {
450
  jQuery( '#wppa-admin-spinner' ).css( 'display', 'inline' );
@@ -475,11 +476,11 @@ function wppaToggleIptc( id, count ) {
475
 
476
  if ( jQuery( '#wppa-iptc-' + id ).css( 'display' ) == 'none' ) {
477
  jQuery( '#wppa-iptc-' + id ).show();
478
- jQuery( '#wppa-iptc-button-' + id ).val( '" . esc_js( __( 'Hide', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'IPTC items', 'wp-photo-album-plus' ) ) . "' );
479
  }
480
  else {
481
  jQuery( '#wppa-iptc-' + id ).hide();
482
- jQuery( '#wppa-iptc-button-' + id ).val( '" . esc_js( __( 'Show', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'IPTC items', 'wp-photo-album-plus' ) ) . "' );
483
  }
484
  }
485
 
@@ -487,15 +488,17 @@ function wppaToggleExif( id, count ) {
487
 
488
  if ( jQuery( '#wppa-exif-' + id ).css( 'display' ) == 'none' ) {
489
  jQuery( '#wppa-exif-' + id ).show();
490
- jQuery( '#wppa-exif-button-' + id ).val( '" . esc_js( __( 'Hide', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'EXIF items', 'wp-photo-album-plus' ) ) . "' );
491
  }
492
  else {
493
  jQuery( '#wppa-exif-' + id ).hide();
494
- jQuery( '#wppa-exif-button-' + id ).val( '" . esc_js( __( 'Show', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'EXIF items', 'wp-photo-album-plus' ) ) . "' );
495
  }
496
- }";
 
 
 
497
 
498
- wp_add_inline_script( 'wppa-admin', $the_js );
499
 
500
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
501
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
@@ -515,9 +518,10 @@ function wppaToggleExif( id, count ) {
515
  <hr
516
  style="position:relative;top:5px;left:0px;border:none;background-color:black;height:1px;width:100%;"
517
  />
518
- </div>';
519
-
520
- wp_add_inline_script( 'wppa-admin', 'wppaDragHorizon(document.getElementById("horizon"))' );
 
521
 
522
  // Albun name if moderate
523
  static $modalbum;
@@ -1829,9 +1833,8 @@ function wppaToggleExif( id, count ) {
1829
  else {
1830
  $value = $dflt;
1831
  }
1832
-
1833
- $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
1834
- wp_add_inline_script( 'wppa-admin', $the_js );
1835
 
1836
  echo
1837
  '</td>' .
@@ -1870,12 +1873,12 @@ function wppaToggleExif( id, count ) {
1870
  ' style="float:left;max-width:100%;" ' .
1871
  ' />';
1872
 
1873
- $the_js =
1874
- '
1875
  window.addEventListener("DOMContentLoaded", function () {
1876
 
1877
  /* Responive does not always works correcly, */
1878
- /* so we do a manual replace after resizing the window */
1879
  window.addEventListener("resize", function(){
1880
  var c = wppaCropper[' . $id . '];
1881
  var url = document.getElementById("fs-img-' . $id . '").src;
@@ -1899,8 +1902,12 @@ function wppaToggleExif( id, count ) {
1899
  var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
1900
  wppaTryMagick( "' . $id . '", \'crop\', value );
1901
  };
1902
- });';
1903
- wp_add_inline_script( 'wppa-admin', $the_js );
 
 
 
 
1904
 
1905
  echo
1906
  '</div>' .
@@ -2457,7 +2464,6 @@ function wppaToggleExif( id, count ) {
2457
  '<td style="padding:0 4px;" >' .
2458
  '<select' .
2459
  ' id="com-stat-' . $comment['id'] . '"' .
2460
- ' style="background-color:' . ( $comment['status'] == 'approved' ? '#ffffe0' : '#ffebe8' ) . '"' .
2461
  ' onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ');"' .
2462
  ' >' .
2463
  '<option value="pending" '.$p.'>'.__( 'Pending' , 'wp-photo-album-plus').'</option>' .
@@ -2476,7 +2482,8 @@ function wppaToggleExif( id, count ) {
2476
  echo '</td>';
2477
  }
2478
  echo '<td style="padding:0 4px;" >'.$comment['comment'].'</td>
2479
- </tr>';
 
2480
  }
2481
 
2482
  echo
@@ -2485,9 +2492,8 @@ function wppaToggleExif( id, count ) {
2485
  }
2486
  }
2487
 
2488
- wp_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$id.');' );
2489
-
2490
  echo
 
2491
  '<div style="clear:both;"></div>' .
2492
  '</div>' .
2493
  '<div style="clear:both;margin-top:7px;"></div>';
@@ -2516,12 +2522,12 @@ function wppa_album_photos_bulk( $album ) {
2516
  if ( wppa_get( 'bulk-action' ) ) {
2517
  check_admin_referer( 'wppa-bulk', 'wppa-bulk' );
2518
  if ( wppa_get( 'bulk-photo' ) ) {
2519
- $ids = (array) wppa_get( 'bulk-photo' );
2520
  $newalb = wppa_get( 'bulk-album' );
2521
  $status = wppa_get( 'bulk-status' );
2522
  $owner = wppa_get( 'bulk-owner' );
2523
  $totcount = count( $ids );
2524
-
2525
  if ( is_array( $ids ) ) {
2526
  foreach ( array_keys( $ids ) as $id ) {
2527
  $skip = false;
@@ -2645,10 +2651,10 @@ function wppa_album_photos_bulk( $album ) {
2645
  }
2646
 
2647
  $pagesize = wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
2648
- $next_after = wppa_get( 'next-after', '0' ) ? 1 : 0;
2649
  $p = wppa_get( 'page' );
2650
  if ( ! is_numeric( $p ) ) $p = 0;
2651
- $page = ( $p ? max( wppa_get( 'page' ), '1' ) : '1' ) + $next_after;
2652
  $skip = ( $page > '0' ? ( $page - '1' ) * $pagesize : '0' );
2653
 
2654
  if ( $album ) {
@@ -2684,32 +2690,150 @@ function wppa_album_photos_bulk( $album ) {
2684
  if ( $photos ) {
2685
  $plink = $link . '&next-after=' . $next_after;
2686
  wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2687
 
2688
- $the_js = "
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2689
  function wppaTryMove( id, video ) {
2690
 
2691
  var query;
2692
 
2693
  if ( ! jQuery( '#target-' + id ).val() ) {
2694
- alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
2695
  return false;
2696
  }
2697
 
2698
  if ( video ) {
2699
- query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
2700
  }
2701
  else {
2702
- query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
2703
  }
2704
 
2705
  if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
2706
- jQuery( '#moving-' + id ).html( '". __( 'Moving...', 'wp-photo-album-plus' ) . "' );
2707
- wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan=\'8\' >', '</td>' );
2708
  }
2709
- }";
2710
- wp_add_inline_script( 'wppa-admin', $the_js );
2711
 
2712
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2713
  <form action="<?php echo $link.'&wppa-page='.$page.'#manage-photos' ?>" method="post" >
2714
  <?php wp_nonce_field( 'wppa-bulk','wppa-bulk' ) ?>
2715
  <h3>
@@ -2810,16 +2934,13 @@ function wppaTryMove( id, video ) {
2810
  />
2811
  <?php _e('Confirm move', 'wp-photo-album-plus') ?>
2812
 
2813
- <?php echo '<small style="float:right;" > (' . count( $photos ) . ')</small>';
2814
-
2815
- $the_js = '
2816
  jQuery(document).ready( function() {
2817
- wppaSetConfirmDelete( "confirm-delete" );
2818
- wppaSetConfirmMove( "confirm-move" );
2819
- });';
2820
- wp_add_inline_script( 'wppa_admin', $the_js );
2821
-
2822
- ?>
2823
  </h3>
2824
  <?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
2825
  <table class="widefat" >
@@ -3019,7 +3140,7 @@ function wppaTryMove( id, video ) {
3019
  <!-- Remark -->
3020
  <td id="remark-<?php echo $photo['id'] ?>" style="width:25%;" >
3021
  <?php _e( 'Not modified' , 'wp-photo-album-plus') ?>
3022
- <?php wp_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$photo['id'].');' ); ?>
3023
  </td>
3024
  </tr>
3025
  <?php } ?>
@@ -3078,7 +3199,54 @@ global $wpdb;
3078
 
3079
  if ( $photos ) {
3080
  ?>
3081
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3082
  <script>
3083
  jQuery( function() {
3084
  jQuery( "#sortable" ).sortable( {
@@ -3144,7 +3312,7 @@ global $wpdb;
3144
  }
3145
  </script>
3146
  <?php if ( ! $is_p_order ) wppa_warning_message( __( 'Setting photo sequence order has only effect if the photo order method is set to <b>Order#</b>' , 'wp-photo-album-plus') ) ?>
3147
- <div class="widefat wppa-photo-admin-sortable" style="border-color:#cccccc" >
3148
  <div id="sortable">
3149
  <?php foreach ( $photos as $photo ) {
3150
  if ( wppa_is_video( $photo['id'] ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.0.07.018
7
  *
8
  */
9
 
300
  // There are photos to display for editing
301
  else {
302
 
303
+ // Local js functions placed here as long as there is not yet a possibility to translate texts in js files
304
+ ?>
305
+ <script>
306
  function wppaTryMove( id, video ) {
307
 
308
  var query;
309
 
310
  if ( ! jQuery( '#target-' + id ).val() ) {
311
+ alert( '<?php echo esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) ?>' );
312
  return false;
313
  }
314
 
315
  if ( video ) {
316
+ query = '<?php echo esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) ?>';
317
  }
318
  else {
319
+ query = '<?php echo esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) ?>';
320
  }
321
 
322
  if ( confirm( query ) ) {
329
  var query;
330
 
331
  if ( ! jQuery( '#target-' + id ).val() ) {
332
+ alert( '<?php echo esc_js( __( 'Please select an album to copy to first.', 'wp-photo-album-plus' ) ) ?>' );
333
  return false;
334
  }
335
 
336
  if ( video ) {
337
+ query = '<?php echo esc_js( __( 'Are you sure you want to copy this video?', 'wp-photo-album-plus' ) ) ?>';
338
  }
339
  else {
340
+ query = '<?php echo esc_js( __( 'Are you sure you want to copy this photo?', 'wp-photo-album-plus' ) ) ?>';
341
  }
342
 
343
  if ( confirm( query ) ) {
350
  var query;
351
 
352
  if ( video ) {
353
+ query = '<?php echo esc_js( __( 'Are you sure you want to delete this video?', 'wp-photo-album-plus' ) ) ?>';
354
  }
355
  else {
356
+ query = '<?php echo esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) ?>';
357
  }
358
 
359
  if ( confirm( query ) ) {
368
 
369
  function wppaTryRotLeft( id ) {
370
 
371
+ var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) ?>';
372
 
373
  if ( confirm( query ) ) {
374
  wppaAjaxUpdatePhoto( id, 'rotleft', 0 );
377
 
378
  function wppaTryRot180( id ) {
379
 
380
+ var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo 180&deg;?', 'wp-photo-album-plus' ) ) ?>';
381
 
382
  if ( confirm( query ) ) {
383
  wppaAjaxUpdatePhoto( id, 'rot180', 0 );
386
 
387
  function wppaTryRotRight( id ) {
388
 
389
+ var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo right?', 'wp-photo-album-plus' ) ) ?>';
390
 
391
  if ( confirm( query ) ) {
392
  wppaAjaxUpdatePhoto( id, 'rotright', 0 );
395
 
396
  function wppaTryFlip( id ) {
397
 
398
+ var query = '<?php echo esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) ?>';
399
 
400
  if ( confirm( query ) ) {
401
  wppaAjaxUpdatePhoto( id, 'flip', 0 );
404
 
405
  function wppaTryFlop( id ) {
406
 
407
+ var query = '<?php echo esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) ?>';
408
 
409
  if ( confirm( query ) ) {
410
  wppaAjaxUpdatePhoto( id, 'flop', 0 );
416
  var query;
417
  var wmFile = jQuery( '#wmfsel_' + id ).val();
418
  if ( wmFile == '--- none ---' ) {
419
+ alert( '<?php echo esc_js( __( 'No watermark selected', 'wp-photo-album-plus' ) ) ?>' );
420
  return;
421
  }
422
  if ( hasSource ) {
423
+ query = '<?php echo esc_js( __( 'Are you sure?', 'wp-photo-album-plus' ) ) ?>';
424
+ query += '\n';
425
+ query += '<?php echo esc_js( __( 'To revert to the default watermark setting afterwards: select Watermark: --- default --- and press the Remake files button', 'wp-photo-album-plus' ) ) ?>';
426
  if ( canRemove ) {
427
+ query += '\n';
428
+ query += '<?php echo esc_js( __( 'To remove: select Watermark: --- none --- and press the Remake files button', 'wp-photo-album-plus' ) ) ?>';
429
  }
430
  }
431
  else {
432
+ query = '<?php echo esc_js( __( 'Are you sure? Once applied it can not be removed!', 'wp-photo-album-plus' ) ) ?>';
433
+ query += '\n';
434
+ query += '<?php echo esc_js( __( 'And I do not know if there is already a watermark on this photo', 'wp-photo-album-plus' ) ) ?>';
435
  }
436
 
437
  if ( confirm( query ) ) {
445
  value = 0;
446
  }
447
 
448
+ var query = '<?php echo esc_js( __( 'Are you sure you want to magically process this photo?', 'wp-photo-album-plus' ) ) ?>';
449
 
450
  if ( true || confirm( query ) ) {
451
  jQuery( '#wppa-admin-spinner' ).css( 'display', 'inline' );
476
 
477
  if ( jQuery( '#wppa-iptc-' + id ).css( 'display' ) == 'none' ) {
478
  jQuery( '#wppa-iptc-' + id ).show();
479
+ jQuery( '#wppa-iptc-button-' + id ).val( '<?php _e( 'Hide', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'IPTC items', 'wp-photo-album-plus' ) ?>' );
480
  }
481
  else {
482
  jQuery( '#wppa-iptc-' + id ).hide();
483
+ jQuery( '#wppa-iptc-button-' + id ).val( '<?php _e( 'Show', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'IPTC items', 'wp-photo-album-plus' ) ?>' );
484
  }
485
  }
486
 
488
 
489
  if ( jQuery( '#wppa-exif-' + id ).css( 'display' ) == 'none' ) {
490
  jQuery( '#wppa-exif-' + id ).show();
491
+ jQuery( '#wppa-exif-button-' + id ).val( '<?php _e( 'Hide', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'EXIF items', 'wp-photo-album-plus' ) ?>' );
492
  }
493
  else {
494
  jQuery( '#wppa-exif-' + id ).hide();
495
+ jQuery( '#wppa-exif-button-' + id ).val( '<?php _e( 'Show', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'EXIF items', 'wp-photo-album-plus' ) ?>' );
496
  }
497
+ }
498
+
499
+ </script>
500
+ <?php
501
 
 
502
 
503
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
504
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
518
  <hr
519
  style="position:relative;top:5px;left:0px;border:none;background-color:black;height:1px;width:100%;"
520
  />
521
+ </div>
522
+ <script>
523
+ wppaDragHorizon(document.getElementById("horizon"));
524
+ </script>';
525
 
526
  // Albun name if moderate
527
  static $modalbum;
1833
  else {
1834
  $value = $dflt;
1835
  }
1836
+ echo
1837
+ '<script>jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});</script>';
 
1838
 
1839
  echo
1840
  '</td>' .
1873
  ' style="float:left;max-width:100%;" ' .
1874
  ' />';
1875
 
1876
+ echo
1877
+ '<script>
1878
  window.addEventListener("DOMContentLoaded", function () {
1879
 
1880
  /* Responive does not always works correcly, */
1881
+ /* so we do a manual relace after resizing the window */
1882
  window.addEventListener("resize", function(){
1883
  var c = wppaCropper[' . $id . '];
1884
  var url = document.getElementById("fs-img-' . $id . '").src;
1902
  var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
1903
  wppaTryMagick( "' . $id . '", \'crop\', value );
1904
  };
1905
+ });
1906
+
1907
+ </script>';
1908
+
1909
+ echo
1910
+ '<style>.cropper-drag-box{background-color:transparent;}img{max-width:100%}</style>';
1911
 
1912
  echo
1913
  '</div>' .
2464
  '<td style="padding:0 4px;" >' .
2465
  '<select' .
2466
  ' id="com-stat-' . $comment['id'] . '"' .
 
2467
  ' onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ');"' .
2468
  ' >' .
2469
  '<option value="pending" '.$p.'>'.__( 'Pending' , 'wp-photo-album-plus').'</option>' .
2482
  echo '</td>';
2483
  }
2484
  echo '<td style="padding:0 4px;" >'.$comment['comment'].'</td>
2485
+ </tr>' .
2486
+ '<script>wppaSetComBgCol(' . $comment['id'] . ')</script>';
2487
  }
2488
 
2489
  echo
2492
  }
2493
  }
2494
 
 
 
2495
  echo
2496
+ '<script>wppaPhotoStatusChange( ' . $id . ' )</script>' .
2497
  '<div style="clear:both;"></div>' .
2498
  '</div>' .
2499
  '<div style="clear:both;margin-top:7px;"></div>';
2522
  if ( wppa_get( 'bulk-action' ) ) {
2523
  check_admin_referer( 'wppa-bulk', 'wppa-bulk' );
2524
  if ( wppa_get( 'bulk-photo' ) ) {
2525
+ $ids = wppa_get( 'bulk-photo' );
2526
  $newalb = wppa_get( 'bulk-album' );
2527
  $status = wppa_get( 'bulk-status' );
2528
  $owner = wppa_get( 'bulk-owner' );
2529
  $totcount = count( $ids );
2530
+ if ( $newalb && ! is_numeric( $newalb ) ) wp_die( 'Security check failure 1' );
2531
  if ( is_array( $ids ) ) {
2532
  foreach ( array_keys( $ids ) as $id ) {
2533
  $skip = false;
2651
  }
2652
 
2653
  $pagesize = wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
2654
+ $next_after = wppa_get( 'next-after', '0' );
2655
  $p = wppa_get( 'page' );
2656
  if ( ! is_numeric( $p ) ) $p = 0;
2657
+ $page = ( $p ? max( wppa_get( 'page' ), '1' ) : '1' ) + wppa_get( 'next-after' );
2658
  $skip = ( $page > '0' ? ( $page - '1' ) * $pagesize : '0' );
2659
 
2660
  if ( $album ) {
2690
  if ( $photos ) {
2691
  $plink = $link . '&next-after=' . $next_after;
2692
  wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
2693
+ ?>
2694
+ <script type="text/javascript" >
2695
+ function wppaBulkActionChange( elm, id ) {
2696
+ wppa_setCookie( 'wppa_bulk_action',elm.value,365 );
2697
+ if ( elm.value == 'wppa-bulk-move-to' || elm.value == 'wppa-bulk-copy-to' ) jQuery( '#wppa-bulk-album' ).css( 'display', 'inline' );
2698
+ else jQuery( '#wppa-bulk-album' ).css( 'display', 'none' );
2699
+ if ( elm.value == 'wppa-bulk-status' ) jQuery( '#wppa-bulk-status' ).css( 'display', 'inline' );
2700
+ else jQuery( '#wppa-bulk-status' ).css( 'display', 'none' );
2701
+ if ( elm.value == 'wppa-bulk-owner' ) jQuery( '#wppa-bulk-owner' ).css( 'display', 'inline' );
2702
+ else jQuery( '#wppa-bulk-owner' ).css( 'display', 'none' );
2703
+ }
2704
+ function wppaBulkDoitOnClick() {
2705
+ var photos = jQuery( '.wppa-bulk-photo' );
2706
+ var count=0;
2707
+ for ( i=0; i< photos.length; i++ ) {
2708
+ var photo = photos[i];
2709
+ if ( photo.checked ) count++;
2710
+ }
2711
+ if ( count == 0 ) {
2712
+ alert( 'No photos selected' );
2713
+ return false;
2714
+ }
2715
+ var action = document.getElementById( 'wppa-bulk-action' ).value;
2716
+ switch ( action ) {
2717
+ case '':
2718
+ alert( 'No action selected' );
2719
+ return false;
2720
+ break;
2721
+ case 'wppa-bulk-delete':
2722
+ break;
2723
+ case 'wppa-bulk-move-to':
2724
+ case 'wppa-bulk-copy-to':
2725
+ var album = document.getElementById( 'wppa-bulk-album' ).value;
2726
+ if ( album == 0 ) {
2727
+ alert( 'No album selected' );
2728
+ return false;
2729
+ }
2730
+ break;
2731
+ case 'wppa-bulk-status':
2732
+ var status = document.getElementById( 'wppa-bulk-status' ).value;
2733
+ if ( status == 0 ) {
2734
+ alert( 'No status selected' );
2735
+ return false;
2736
+ }
2737
+ break;
2738
+ case 'wppa-bulk-owner':
2739
+ var owner = documnet.getElementById( 'wppa-bulk-owner' ).value;
2740
+ if ( owner == 0 ) {
2741
+ alert( 'No new owner selected' );
2742
+ return false;
2743
+ }
2744
+ break;
2745
+ default:
2746
+ alert( 'Unimplemented action requested: '+action );
2747
+ return false;
2748
+ break;
2749
 
2750
+ }
2751
+ return true;
2752
+ }
2753
+ function wppaSetThumbsize( elm ) {
2754
+ var thumbsize = elm.value;
2755
+ wppa_setCookie( 'wppa_bulk_thumbsize',thumbsize,365 );
2756
+ jQuery( '.wppa-bulk-thumb' ).css( 'max-width', thumbsize+'px' );
2757
+ jQuery( '.wppa-bulk-thumb' ).css( 'max-height', ( thumbsize/2 )+'px' );
2758
+ jQuery( '.wppa-bulk-dec' ).css( 'height', ( thumbsize/2 )+'px' );
2759
+ }
2760
+ jQuery(document).ready( function() {
2761
+ var action = wppa_getCookie( 'wppa_bulk_action' );
2762
+ document.getElementById( 'wppa-bulk-action' ).value = action;
2763
+ if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) {
2764
+ jQuery( '#wppa-bulk-album' ).css( 'display','inline' );
2765
+ document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' );
2766
+ }
2767
+ if ( action == 'wppa-bulk-status' ) {
2768
+ jQuery( '#wppa-bulk-status' ).css( 'display','inline' );
2769
+ document.getElementById( 'wppa-bulk-status' ).value = wppa_getCookie( 'wppa_bulk_status' );
2770
+ }
2771
+ if ( action == 'wppa-bulk-owner' ) {
2772
+ jQuery( '#wppa-bulk-owner' ).css( 'display','inline' );
2773
+ document.getElementById( 'wppa-bulk-owner' ).value = wppa_getCookie( 'wppa_bulk_owner' );
2774
+ }
2775
+ } );
2776
  function wppaTryMove( id, video ) {
2777
 
2778
  var query;
2779
 
2780
  if ( ! jQuery( '#target-' + id ).val() ) {
2781
+ alert( '<?php echo esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) ?>' );
2782
  return false;
2783
  }
2784
 
2785
  if ( video ) {
2786
+ query = '<?php echo esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) ?>';
2787
  }
2788
  else {
2789
+ query = '<?php echo esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) ?>';
2790
  }
2791
 
2792
  if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
2793
+ jQuery( '#moving-' + id ).html( '<?php _e( 'Moving...', 'wp-photo-album-plus' ) ?>' );
2794
+ wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan="8" >', '</td>' );
2795
  }
2796
+ }
 
2797
 
2798
+ function wppaToggleConfirmDelete( elm ) {
2799
+ var status = jQuery( elm ).prop( 'checked' );
2800
+ if ( status ) {
2801
+ wppa_setCookie( 'wppaConfirmDelete', 'checked', 365 );
2802
+ }
2803
+ else {
2804
+ wppa_setCookie( 'wppaConfirmDelete', 'unchecked', 365 );
2805
+ }
2806
+ }
2807
+ function wppaToggleConfirmMove( elm ) {
2808
+ var status = jQuery( elm ).prop( 'checked' );
2809
+ if ( status ) {
2810
+ wppa_setCookie( 'wppaConfirmMove', 'checked', 365 );
2811
+ }
2812
+ else {
2813
+ wppa_setCookie( 'wppaConfirmMove', 'unchecked', 365 );
2814
+ }
2815
+ }
2816
+ function wppaSetConfirmDelete( id ) {
2817
+ var status = wppa_getCookie( 'wppaConfirmDelete' );
2818
+ if ( status == 'checked' ) {
2819
+ jQuery( '#' + id ).prop( 'checked', true );
2820
+ }
2821
+ else {
2822
+ jQuery( '#' + id ).prop( 'checked', false );
2823
+ }
2824
+ }
2825
+ function wppaSetConfirmMove( id ) {
2826
+ var status = wppa_getCookie( 'wppaConfirmMove' );
2827
+ if ( status == 'checked' ) {
2828
+ jQuery( '#' + id ).prop( 'checked', true );
2829
+ }
2830
+ else {
2831
+ jQuery( '#' + id ).prop( 'checked', false );
2832
+ }
2833
+ }
2834
+
2835
+ </script>
2836
+ <?php /**/ ?>
2837
  <form action="<?php echo $link.'&wppa-page='.$page.'#manage-photos' ?>" method="post" >
2838
  <?php wp_nonce_field( 'wppa-bulk','wppa-bulk' ) ?>
2839
  <h3>
2934
  />
2935
  <?php _e('Confirm move', 'wp-photo-album-plus') ?>
2936
 
2937
+ <?php echo '<small style="float:right;" > (' . count( $photos ) . ')</small>'; ?>
2938
+ <script>
 
2939
  jQuery(document).ready( function() {
2940
+ wppaSetConfirmDelete( 'confirm-delete' );
2941
+ wppaSetConfirmMove( 'confirm-move' );
2942
+ });
2943
+ </script>
 
 
2944
  </h3>
2945
  <?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
2946
  <table class="widefat" >
3140
  <!-- Remark -->
3141
  <td id="remark-<?php echo $photo['id'] ?>" style="width:25%;" >
3142
  <?php _e( 'Not modified' , 'wp-photo-album-plus') ?>
3143
+ <script type="text/javascript" >wppaPhotoStatusChange( <?php echo $photo['id'] ?> )</script>
3144
  </td>
3145
  </tr>
3146
  <?php } ?>
3199
 
3200
  if ( $photos ) {
3201
  ?>
3202
+ <style>
3203
+ .sortable-placeholder {
3204
+ width: <?php echo $size ?>px;
3205
+ height: <?php echo $size ?>px;
3206
+ margin: 5px;
3207
+ border: 1px solid #cccccc;
3208
+ border-radius:3px;
3209
+ float: left;
3210
+ }
3211
+ .ui-state-default {
3212
+ position: relative;
3213
+ width: <?php echo $size ?>px;
3214
+ height: <?php echo $size ?>px;
3215
+ margin: 5px;
3216
+ border-radius:3px;
3217
+ float: left;
3218
+ }
3219
+ .wppa-publish {
3220
+ border: 1px solid;
3221
+ background-color: rgb( 255, 255, 224 );
3222
+ border-color: rgb( 230, 219, 85 );
3223
+ }
3224
+ .wppa-featured {
3225
+ border: 1px solid;
3226
+ background-color: rgb( 224, 255, 224 );
3227
+ border-color: rgb( 85, 238, 85 );
3228
+ }
3229
+ .wppa-pending, .wppa-scheduled, .wppa-private {
3230
+ border: 1px solid;
3231
+ background-color: rgb( 255, 235, 232 );
3232
+ border-color: rgb( 204, 0, 0 );
3233
+ }
3234
+ .wppa-bronze {
3235
+ border: 1px solid;
3236
+ background-color: rgb( 221, 221, 187 );
3237
+ border-color: rgb( 204, 204, 170 );
3238
+ }
3239
+ .wppa-silver {
3240
+ border: 1px solid;
3241
+ background-color: rgb( 255, 255, 255 );
3242
+ border-color: rgb( 238, 238, 238 );
3243
+ }
3244
+ .wppa-gold {
3245
+ border: 1px solid;
3246
+ background-color: rgb( 238, 238, 204 );
3247
+ border-color: rgb( 221, 221, 187 );
3248
+ }
3249
+ </style>
3250
  <script>
3251
  jQuery( function() {
3252
  jQuery( "#sortable" ).sortable( {
3312
  }
3313
  </script>
3314
  <?php if ( ! $is_p_order ) wppa_warning_message( __( 'Setting photo sequence order has only effect if the photo order method is set to <b>Order#</b>' , 'wp-photo-album-plus') ) ?>
3315
+ <div class="widefat" style="border-color:#cccccc" >
3316
  <div id="sortable">
3317
  <?php foreach ( $photos as $photo ) {
3318
  if ( wppa_is_video( $photo['id'] ) ) {
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.1.00.005
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -14,517 +14,514 @@ global $wppa_lang;
14
  global $wppa_session;
15
  global $wpdb;
16
 
17
- /* wppa-utils.js */
18
- $result = '
19
- wppaDebugCounter = 0,';
20
-
21
- /* wppa.js */
22
- $result .= '
23
- wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime),
24
- wppaOvlActivePanorama = 0,';
25
-
26
- /* Global and slideshow vars */
27
- $result .= '
28
- wppaFullValign = [],
29
- wppaFullHalign = [],
30
- wppaFullFrameDelta = [],
31
- wppaAutoColumnWidth = [],
32
- wppaAutoColumnFrac = [],
33
- wppaFadeInAfterFadeOut = false,
34
- wppaPreambule = [],
35
- wppaThumbnailPitch = [],
36
- wppaFilmStripLength = [],
37
- wppaFilmStripMargin = [],
38
- wppaFilmStripAreaDelta = [],
39
- wppaIsMini = [],
40
- wppaPortraitOnly = [],
41
- wppaLightBox = [],
42
- wppaSlideInitRunning = [],
43
- wppaSlidePause = [],
44
- wppaSlideBlank = [],
45
- wppaFilmPageSize = [],
46
- wppaAspectRatio = [],
47
- wppaFullSize = [],
48
- wppaLightboxSingle = [],
49
- wppaSiteUrl = "' . site_url() . '",
50
- wppaMasonryCols = [],
51
- wppaVideoPlaying = [],
52
- wppaAudioPlaying = [],
53
- wppaHis = 0,
54
- wppaStartHtml = [],
55
- wppaCanAjaxRender = false,
56
- wppaCanPushState = false,
57
- wppaMaxOccur = 0,
58
- wppaFirstOccur = 0,
59
- wppaUsePhotoNamesInUrls = false,
60
- wppaShareHideWhenRunning = false,
61
- wppaCommentRequiredAfterVote = true,
62
- wppaTopMoc = 0,
63
- wppaColWidth = [],
64
- wppaMCRWidth = [],
65
- wppaFotomotoHideWhenRunning = false,
66
- wppaFotomotoMinWidth = 400,
67
- wppaPhotoView = [],
68
- wppaBackgroundColorImage = "",
69
- wppaPopupLinkType = "",
70
- wppaPopupOnclick = [],
71
- wppaThumbTargetBlank = false,
72
- wppaRel = "rel",
73
- wppaEditPhotoWidth = "960",
74
- wppaThemeStyles = "",
75
- wppaStickyHeaderHeight = 0,
76
- wppaModalBgColor = "#ffffff",
77
- wppaBoxRadius = 0,
78
- wppaUploadEdit = "none",
79
- wppaPageArg = "",
80
- wppaCoverImageResponsive = [],
81
- wppaSearchBoxSelItems = [],
82
- wppaSlideWrap = [],
83
- wppaHideRightClick = false,
84
- wppaGeoZoom = 10,
85
- wppaAreaMaxFrac = 1.0,
86
- wppaNiceScroll = false,
87
- wppaIconSizeNormal = "default",
88
- wppaIconSizeStars = 24,
89
- wppaFilmInit = [],
90
- wppaResizeEndDelay = 200,
91
- wppaScrollEndDelay = 200,
92
- wppaArtmonkeyFileNotSource = false,
93
- wppaRequestInfoDialogText = "Please specify your question",
94
- wppaGlobalFsIconSize = 32,
95
- wppaFsFillcolor = "#999999",
96
- wppaFsBgcolor = "transparent",
97
- wppaSlideLinkEqual = ' . ( wppa_opt( 'slideshow_linktype' ) == 'same' ? 'true' : 'false' ) . ',
98
- _wppaId = [],
99
- _wppaRealId = [],
100
- _wppaAvg = [],
101
- _wppaDisc = [],
102
- _wppaMyr = [],
103
- _wppaVRU = [],
104
- _wppaLinkUrl = [],
105
- _wppaLinkTitle = [],
106
- _wppaLinkTarget = [],
107
- _wppaCommentHtml = [],
108
- _wppaIptcHtml = [],
109
- _wppaExifHtml = [],
110
- _wppaToTheSame = false,
111
- _wppaSlides = [],
112
- _wppaNames = [],
113
- _wppaFilmThumbTitles = [],
114
- _wppaFullNames = [],
115
- _wppaDsc = [],
116
- _wppaOgDsc = [],
117
- _wppaCurIdx = [],
118
- _wppaNxtIdx = [],
119
- _wppaTimeOut = [],
120
- _wppaSSRuns = [],
121
- _wppaFg = [],
122
- _wppaTP = [],
123
- _wppaIsBusy = [],
124
- _wppaFirst = [],
125
- _wppaVoteInProgress = false,
126
- _wppaTextDelay = ' . wppa_opt( 'animation_speed' ) . ',
127
- _wppaUrl = [],
128
- _wppaSkipRated = [],
129
- _wppaLbTitle = [],
130
- _wppaStateCount = 0,
131
- _wppaDidGoto = [],
132
- _wppaShareUrl = [],
133
- _wppaShareHtml = [],
134
- _wppaFilmNoMove = [],
135
- _wppaHiresUrl = [],
136
- _wppaIsVideo = [],
137
- _wppaVideoHtml = [],
138
- _wppaAudioHtml = [],
139
- _wppaVideoNatWidth = [],
140
- _wppaVideoNatHeight = [],
141
- _wppaWaitTexts = [],
142
- _wppaImageAlt = [],
143
- _wppaLastIdx = [],
144
- _wppaStopping = [],
145
- _wppaFilename = [],
146
- _wppaLat = [],
147
- _wppaLon = [],
148
- __wppaOverruleRun = false,
149
- wppaOvlIdx = 0,
150
- wppaOvlFirst = true,
151
- wppaOvlKbHandler = "",
152
- wppaOvlSizeHandler = "",
153
- wppaOvlPadTop = 5,
154
- wppaOvlRunning = false,
155
- wppaOvlVideoPlaying = false,
156
- wppaOvlAudioPlaying = false,
157
- wppaOvlShowLegenda = true,
158
- wppaOvlShowStartStop = true,
159
- wppaOvlRadius = 0,
160
- wppaOvlBorderWidth = 16,
161
- wppaOvlOpen = false,
162
- wppaOvlClosing = false,
163
- wppaThumbSize = 100,
164
- wppaTfMargin = 4,
165
- wppaZoomData = [],
166
- wppaSphericData = [],
167
- wppaOvlTxtHeight = 36,
168
- wppaOvlOpacity = 0.8,
169
- wppaOvlOnclickType = "none",
170
- wppaOvlTheme = "black",
171
- wppaOvlAnimSpeed = 300,
172
- wppaOvlSlideSpeed = 3000,
173
- wppaOvlFontFamily = "Helvetica",
174
- wppaOvlFontSize = "10",
175
- wppaOvlFontColor = "",
176
- wppaOvlFontWeight = "bold",
177
- wppaOvlLineHeight = "12",
178
- wppaOvlShowCounter = true,
179
- wppaOvlIsVideo = false,
180
- wppaShowLegenda = "",
181
- wppaOvlFsPhotoId = 0,
182
- wppaPhotoId = 0,
183
- wppaOvlVideoStart = false,
184
- wppaOvlAudioStart = false,
185
- wppaLastIptc = "",
186
- wppaLastExif = "",
187
- wppaIsIpad = false,
188
- wppaSvgFillcolor = "gray",
189
- wppaSvgBgcolor = "transparent",
190
- wppaSvgCornerStyle = "light",
191
- wppaCoverSpacing = 8,
192
- wppaEasingSlide = "' . wppa_opt( 'easing_slide' ) . '",
193
- wppaEasingLightbox = "' . wppa_opt( 'easing_lightbox' ) . '",
194
- wppaEasingPopup = "' . wppa_opt( 'easing_popup' ) . '",
195
- wppaEasingDefault = "swing",';
196
-
197
- /* wppa-ajax-front.js */
198
- $result .= '
199
- wppaRenderAdd = false,
200
- wppaWaitForCounter = 0,';
201
-
202
- /* wppa-lightbox.js */
203
- $result .= '
204
- wppaIsVideo = false,
205
- wppaHasAudio = false,
206
- wppaOvlIsPdf = false,
207
- wppaOvlImgs = [],
208
- wppaKbHandlerInstalled = false,
209
- wppaOvlCurIdx = 0,
210
- wppaOvlSvgInverse = false,
211
- wppaOvlHasPanoramas = false,
212
- wppaGlobalOvlPanoramaId = 0,
213
- wppaOvlBrowseOnClick = false,
214
- wppaOvlGlobal = false,
215
- wppaWppaOverlayActivated = false,
216
- wppaOvlTimer = 0,
217
- wppaSavedContainerWidth = 0,
218
- wppaSavedContainerHeight = 0,';
219
-
220
- /* wppa-touch.js */
221
- $result .= '
222
- wppaTriggerElementID = null,
223
- wppaFingerCount = 0,
224
- wppaStartX = 0,
225
- wppaStartY = 0,
226
- wppaCurX = 0,
227
- wppaCurY = 0,
228
- wppaDeltaX = 0,
229
- wppaDeltaY = 0,
230
- wppaHorzDiff = 0,
231
- wppaVertDiff = 0,
232
- wppaMinLength = 72,
233
- wppaSwipeLength = 0,
234
- wppaSwipeAngle = null,
235
- wppaSwipeDirection = null,
236
- wppaSwipeOnLightbox = false,
237
- wppaSwipeMocc = 0,
238
- wppaMobileTimeStart = 0,';
239
-
240
- /* admin-scripts.js */
241
- $result .= '
242
- wppa_moveup_url = "#",
243
- wppa_import = "' . esc_js( __( 'Import', 'wp-photo-album-plus' ) ) . '",
244
- wppa_update = "' . esc_js( __( 'Update', 'wp-photo-album-plus' ) ) . '",
245
- wppaUploadToThisAlbum = "' . esc_js( __( 'Upload to this album', 'wp-photo-album-plus' ) ) . '",
246
- wppaCloseText = "' . esc_js( __( 'Close!', 'wp-photo-album-plus' ) ) . '",
247
- wppaCropper = [],';
248
-
249
- // Find ajax url
250
- $can_ajax = 'true';
251
- switch ( wppa_opt( 'ajax_method' ) ) {
252
- case 'normal':
253
- if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
254
- else $ajax_url = site_url() . '/wppaajax';
255
- break;
256
- case 'wppaajax':
257
- $ajax_url = site_url() . '/wppaajax';
258
- break;
259
- case 'admin':
260
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
261
- break;
262
- case 'extern':
263
- if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
264
- else $ajax_url = WPPA_URL . '/wppa-ajax-front.php';
265
- break;
266
- case 'none':
267
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
268
- $can_ajax = 'false'; // works on frontend only
269
- break;
270
- }
271
-
272
- /* Language and config specific inits */
273
- $result .= '
274
- wppaImageDirectory = "' . wppa_get_imgdir() . '",
275
- wppaWppaUrl = "' . wppa_get_wppa_url() . '",
276
- wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '",
277
- wppaAjaxUrl = "' . $ajax_url . '",
278
- wppaUploadUrl = "' . WPPA_UPLOAD_URL . '",
279
- wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ',
280
- wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ',
281
- wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '",
282
- wppaAudioHeight = ' . wppa_get_audio_control_height() . ',
283
- wppaFilmThumbTitle = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Double click to start/stop slideshow running', 'wp-photo-album-plus' ) ) . '",
284
- wppaClickToView = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Click to view', 'wp-photo-album-plus' ) ) . '",
285
- wppaLang = "' . $wppa_lang . '",
286
- wppaVoteForMe = "' . __( wppa_opt( 'vote_button_text' ), 'wp-photo-album-plus' ) . '",
287
- wppaVotedForMe = "' . __( wppa_opt( 'voted_button_text' ), 'wp-photo-album-plus' ) . '",
288
- wppaDownLoad = "' . __( 'Download', 'wp-photo-album-plus' ) . '",
289
- wppaSlideShow = "' . __( 'Slideshow', 'wp-photo-album-plus' ) . '",
290
- wppaPhoto = "' . __( 'Photo', 'wp-photo-album-plus' ) . '",
291
- wppaOf = "' . __( 'of', 'wp-photo-album-plus' ) . '",
292
- wppaNextPhoto = "' . __( 'Next photo', 'wp-photo-album-plus' ) . '",
293
- wppaPreviousPhoto = "' . __( 'Previous photo', 'wp-photo-album-plus' ) . '",
294
- wppaNextP = "' . __( 'Next', 'wp-photo-album-plus' ) . '",
295
- wppaPrevP = "' . __( 'Prev.', 'wp-photo-album-plus' ) . '",
296
- wppaAvgRating = "' . __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) . '",
297
- wppaMyRating = "' . __( 'My&nbsp;rating', 'wp-photo-album-plus' ) . '",
298
- wppaAvgRat = "' . __( 'Avg.', 'wp-photo-album-plus' ) . '",
299
- wppaMyRat = "' . __( 'Mine', 'wp-photo-album-plus' ) . '",
300
- wppaDislikeMsg = "' . __( 'You marked this image as inappropriate.', 'wp-photo-album-plus' ) . '",
301
- wppaStart = "' . __( 'Start', 'wp-photo-album-plus' ) . '",
302
- wppaStop = "' . __( 'Stop', 'wp-photo-album-plus' ) . '",
303
- wppaPleaseName = "' . __( 'Please enter your name', 'wp-photo-album-plus' ) . '",
304
- wppaPleaseEmail = "' . __( 'Please enter a valid email address', 'wp-photo-album-plus' ) . '",
305
- wppaPleaseComment = "' . __( 'Please enter a comment', 'wp-photo-album-plus' ) . '",
306
- wppaProcessing = "' . __( 'Processing...', 'wp-photo-album-plus' ) . '",
307
- wppaDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '",
308
- wppaUploadFailed = "' . __( 'Upload failed', 'wp-photo-album-plus' ) . '",
309
- wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '",
310
- wppaGlobalFsIconSize = "'.wppa_opt( 'nav_icon_size_global_fs' ) . '",
311
- wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ) . '",
312
- wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ) . '",
313
- wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
314
- wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) && ! wppa_is_mobile() ? 'true' : 'false' ) . ',
315
- wppaNieScrollOpts = {' . wppa_opt( 'nicescroll_opts' ) . '},
316
- wppaVersion = "'.$wppa_api_version.'",
317
- wppaDebug = '.( wppa_switch( 'allow_debug' ) ? 'true' : 'false' ) . ',
318
- wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
319
- wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
320
- wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
321
- wppaAnimationSpeed = '.wppa_opt( 'animation_speed' ) . ',
322
- wppaThumbnailAreaDelta = '.wppa_get_thumbnail_area_delta() . ',
323
- wppaTextFrameDelta = '.wppa_get_textframe_delta() . ',
324
- wppaBoxDelta = '.wppa_get_box_delta() . ',
325
- wppaSlideShowTimeOut = '.wppa_opt( 'slideshow_timeout' ) . ',
326
- wppaFilmShowGlue = '.( wppa_switch( 'film_show_glue' ) ? 'true' : 'false' ) . ',
327
- wppaMiniTreshold = '.( wppa_opt( 'mini_treshold' ) ? wppa_opt( 'mini_treshold' ) : '0' ) . ',
328
- wppaRatingOnce = '.( wppa_switch( 'rating_change' ) || wppa_switch( 'rating_multi' ) ? 'false' : 'true' ) . ',
329
- wppaHideWhenEmpty = '.( wppa_switch( 'hide_when_empty' ) ? 'true' : 'false' ) . ',
330
- wppaBGcolorNumbar = "'.wppa_opt( 'bgcolor_numbar' ) . '",
331
- wppaBcolorNumbar = "'.wppa_opt( 'bcolor_numbar' ) . '",
332
- wppaBGcolorNumbarActive = "'.wppa_opt( 'bgcolor_numbar_active' ) . '",
333
- wppaBcolorNumbarActive = "'.wppa_opt( 'bcolor_numbar_active' ) . '",
334
- wppaFontFamilyNumbar = "'.wppa_opt( 'fontfamily_numbar' ) . '",
335
- wppaFontSizeNumbar = "'.wppa_opt( 'fontsize_numbar' ) . 'px",
336
- wppaFontColorNumbar = "'.wppa_opt( 'fontcolor_numbar' ) . '",
337
- wppaFontWeightNumbar = "'.wppa_opt( 'fontweight_numbar' ) . '",
338
- wppaFontFamilyNumbarActive = "'.wppa_opt( 'fontfamily_numbar_active' ) . '",
339
- wppaFontSizeNumbarActive = "'.wppa_opt( 'fontsize_numbar_active' ) . 'px",
340
- wppaFontColorNumbarActive = "'.wppa_opt( 'fontcolor_numbar_active' ) . '",
341
- wppaFontWeightNumbarActive = "'.wppa_opt( 'fontweight_numbar_active' ) . '",
342
- wppaNumbarMax = "'.wppa_opt( 'numbar_max' ) . '",
343
- wppaNextOnCallback = '.( wppa_switch( 'next_on_callback' ) ? 'true' : 'false' ) . ',
344
- wppaStarOpacity = '.str_replace(',', '.',( wppa_opt( 'star_opacity' )/'100' )) . ',
345
- wppaEmailRequired = "'.wppa_opt( 'comment_email_required' ) . '",
346
- wppaSlideBorderWidth = '.wppa_fbw().',
347
- wppaAllowAjax = '.$can_ajax.',
348
- wppaUsePhotoNamesInUrls = '.( wppa_switch( 'use_photo_names_in_urls' ) ? 'true' : 'false' ) . ',
349
- wppaThumbTargetBlank = '.( wppa_switch( 'thumb_blank' ) ? 'true' : 'false' ) . ',
350
- wppaRatingMax = '.wppa_opt( 'rating_max' ) . ',
351
- wppaRatingDisplayType = "'.wppa_opt( 'rating_display_type' ) . '",
352
- wppaRatingPrec = '.wppa_opt( 'rating_prec' ) . ',
353
- wppaStretch = '.( wppa_switch( 'enlarge' ) ? 'true' : 'false' ) . ',
354
- wppaMinThumbSpace = '.wppa_opt( 'tn_margin' ) . ',
355
- wppaThumbSpaceAuto = '.( wppa_switch( 'thumb_auto' ) ? 'true' : 'false' ) . ',
356
- wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
357
- wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
358
- wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
359
- wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'true' : 'false' ) . ',
360
- wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
361
- wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
362
- wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
363
- wppaComAltSize = '.wppa_opt( 'comten_alt_thumbsize' ) . ',
364
- wppaBumpViewCount = '.( wppa_switch( 'track_viewcounts' ) ? 'true' : 'false' ) . ',
365
- wppaBumpClickCount = '.( wppa_switch( 'track_clickcounts' ) ? 'true' : 'false' ) . ',
366
- wppaShareHideWhenRunning = '.( wppa_switch( 'share_hide_when_running' ) ? 'true' : 'false' ) . ',
367
- wppaFotomoto = '.( wppa_switch( 'fotomoto_on' ) ? 'true' : 'false' ) . ',
368
- wppaArtMonkeyButton = '.( wppa_opt( 'art_monkey_display' ) == 'button' ? 'true' : 'false' ) . ',
369
- wppaFotomotoHideWhenRunning = '.( wppa_switch( 'fotomoto_hide_when_running' ) ? 'true' : 'false' ) . ',
370
- wppaCommentRequiredAfterVote = '.( wppa_switch( 'vote_needs_comment' ) ? 'true' : 'false' ) . ',
371
- wppaFotomotoMinWidth = '.wppa_opt( 'fotomoto_min_width' ) . ',
372
- wppaShortQargs = '.( wppa_switch( 'use_short_qargs' ) ? 'true' : 'false' ) . ',
373
- wppaOvlHires = '.( wppa_switch( 'lb_hres' ) ? 'true' : 'false' ) . ',
374
- wppaSlideVideoStart = '.( wppa_switch( 'start_slide_video' ) ? 'true' : 'false' ) . ',
375
- wppaSlideAudioStart = '.( wppa_switch( 'start_slide_audio' ) ? 'true' : 'false' ) . ',
376
- wppaRel = "data-rel",
377
- wppaOvlRadius = '.wppa_opt( 'ovl_border_radius' ) . ',
378
- wppaOvlBorderWidth = '.wppa_opt( 'ovl_border_width' ) . ',
379
- wppaEditPhotoWidth = "'.(wppa_opt( 'upload_edit' ) == 'new' ? 500 : 960) . '",
380
- wppaThemeStyles = "'.(wppa_switch( 'upload_edit_theme_css' ) ? get_stylesheet_uri() : '' ) . '",
381
- wppaStickyHeaderHeight = '.wppa_opt( 'sticky_header_size' ) . ',
382
- wppaRenderModal = ' . ( wppa_switch( 'ajax_render_modal' ) ? 'true' : 'false' ) . ',
383
- wppaModalQuitImg = "url(' . wppa_get_imgdir( 'smallcross-' . wppa_opt( 'ovl_theme' ) . '.gif' ) . ' )",
384
- wppaBoxRadius = "' . wppa_opt( 'bradius' ) . '",
385
- wppaModalBgColor = "' . wppa_opt( 'bgcolor_modal' ) . '",
386
- wppaUploadEdit = "' . wppa_opt( 'upload_edit' ) . '",
387
- wppaSvgFillcolor = "' . wppa_opt( 'svg_color' ) . '",
388
- wppaSvgBgcolor = "' . wppa_opt( 'svg_bg_color' ) . '",
389
- wppaOvlSvgFillcolor = "' . wppa_opt( 'ovl_svg_color' ) . '",
390
- wppaOvlSvgBgcolor = "' . wppa_opt( 'ovl_svg_bg_color' ) . '",
391
- wppaSvgCornerStyle = "' . wppa_opt( 'icon_corner_style' ) . '",
392
- wppaHideRightClick = ' . ( wppa_switch( 'no_rightclick' ) ? 'true' : 'false' ) . ',
393
- wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ',
394
- wppaLazyLoad = ' . ( wppa_lazy() ? 'true' : 'false' ) . ',
395
- wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ',
396
- wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '",
397
- wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '",
398
- wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ',
399
- wppaExtendedResizeCount = ' . wppa_opt( 'extended_resize_count' ) . ',
400
- wppaExtendedResizeDelay = ' . wppa_opt( 'extended_resize_delay' ) . ',
401
- wppaCoverSpacing = ' . wppa_opt( 'cover_spacing' ) . ',
402
- wppaFilmonlyContinuous = ' . ( wppa_switch( 'filmonly_continuous' ) ? 'true' : 'false' ) . ',
403
- wppaNoAnimateOnMobile = ' . ( wppa_switch( 'no_animate_on_mobile' ) ? 'true' : 'false' ) . ',
404
- wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
405
- wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
406
- wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
407
- wppaArtmonkeyFileNotSource = ' . ( wppa_opt( 'art_monkey_link' ) == 'file' &&
408
- wppa_opt( 'art_monkey_display' ) == 'text' &&
409
- ! wppa_switch( 'artmonkey_use_source' ) ? 'true' : 'false' ) . ',
410
- wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
411
- wppaThumbAspect = ' . wppa_thumb_asp() . ',';
412
-
413
- /* Lightbox vars */
414
- $fontsize_lightbox = wppa_opt( 'fontsize_lightbox' ) ? wppa_opt( 'fontsize_lightbox' ) : '10';
415
- $d = wppa_switch( 'ovl_show_counter') ? 1 : 0;
416
- $ovlh = wppa_opt( 'ovl_txt_lines' ) == 'auto' ? 'auto' : ((wppa_opt( 'ovl_txt_lines' ) + $d) * ($fontsize_lightbox + 2));
417
- $lb_global = '';
418
- if ( wppa_switch( 'lightbox_global' ) && ! is_admin() ) {
419
- if ( wppa_switch( 'lightbox_global_set' ) ) {
420
- $lb_global = 'wppa[single]';
421
- }
422
- else {
423
- $lb_global = 'wppa';
424
- }
425
- }
426
-
427
- $result .= '
428
- wppaOvlTxtHeight = "'.$ovlh.'",
429
- wppaOvlOpacity = '.(wppa_opt( 'ovl_opacity' )/100).',
430
- wppaOvlOnclickType = "'.wppa_opt( 'ovl_onclick' ).'",
431
- wppaOvlTheme = "'.wppa_opt( 'ovl_theme' ).'",
432
- wppaOvlAnimSpeed = '.wppa_opt( 'ovl_anim' ).',
433
- wppaOvlSlideSpeed = '.wppa_opt( 'ovl_slide' ).',
434
- wppaVer4WindowWidth = 800,
435
- wppaVer4WindowHeight = 600,
436
- wppaOvlShowCounter = '.( wppa_switch( 'ovl_show_counter') ? 'true' : 'false' ).',
437
- '.( wppa_opt( 'fontfamily_lightbox' ) ? 'wppaOvlFontFamily = "'.wppa_opt( 'fontfamily_lightbox' ).'",' : '').'
438
- wppaOvlFontSize = "'.$fontsize_lightbox.'",
439
- '.( wppa_opt( 'fontcolor_lightbox' ) ? 'wppaOvlFontColor = "'.wppa_opt( 'fontcolor_lightbox' ).'",' : '').'
440
- '.( wppa_opt( 'fontweight_lightbox' ) ? 'wppaOvlFontWeight = "'.wppa_opt( 'fontweight_lightbox' ).'",' : '').'
441
- '.( wppa_opt( 'fontsize_lightbox' ) ? 'wppaOvlLineHeight = "'.(wppa_opt( 'fontsize_lightbox' ) + '2').'",' : '').'
442
- wppaOvlVideoStart = '.( wppa_switch( 'ovl_video_start' ) ? 'true' : 'false' ).',
443
- wppaOvlAudioStart = '.( wppa_switch( 'ovl_audio_start' ) ? 'true' : 'false' ).',
444
- wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).',
445
- wppaIsMobile = '.( wppa_is_mobile() ? 'true' : 'false' ).',
446
- wppaIsIpad = '.( wppa_is_ipad() ? 'true' : 'false' ).',
447
- wppaOvlIconSize = "'.wppa_opt( 'nav_icon_size_lightbox' ).'px",
448
- wppaOvlBrowseOnClick = '.( wppa_switch( 'ovl_browse_on_click' ) ? 'true' : 'false' ).',
449
- wppaOvlGlobal = ' . ( $lb_global ? '"' . $lb_global . '"' : 'false' ) . ',
450
- wppaPhotoDirectory = "'.WPPA_UPLOAD_URL.'/",
451
- wppaThumbDirectory = "'.WPPA_UPLOAD_URL.'/thumbs/",
452
- wppaTempDirectory = "'.WPPA_UPLOAD_URL.'/temp/",
453
- wppaFontDirectory = "'.WPPA_UPLOAD_URL.'/fonts/",
454
- wppaNoPreview = "'.__('No Preview available', 'wp-photo-album-plus').'",
455
- wppaUIERR = "'.__('Unimplemented virtual album', 'wp-photo-album-plus').'",
456
- wppaTxtProcessing = "'.__('Processing...', 'wp-photo-album-plus').'",
457
- wppaTxtDone = "'.__('Done!', 'wp-photo-album-plus').'",
458
- wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'",
459
- wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";';
460
-
461
- // Tinymce photo
462
- if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
463
- $id = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos
464
- WHERE ext <> 'xxx'
465
- AND panorama = 0
466
- ORDER BY timestamp DESC
467
- LIMIT 1" );
468
-
469
- // Fake we are in a widget, to prevent wppa_get_picture_html() from bumping viewcount
470
- wppa( 'in_widget', true );
471
-
472
- $result .= '
473
- wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
474
- wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
475
-
476
- // Reset faked widget
477
- wppa( 'in_widget', false );
478
- }
479
-
480
- // The photo views cache
481
- if ( isset( $wppa_session['photo'] ) ) {
482
- foreach ( array_keys( $wppa_session['photo'] ) as $p ) {
483
- $result .= '
484
- wppaPhotoView[' . $p . '] = true;';
485
- }
486
- }
487
-
488
- // Format
489
- $result = wppa_compress_js( $result );
490
- $result = '
491
  <!-- wppa js inits -->
492
  <script>
493
  ' . $result . '
494
  </script>
495
  <!-- End wppa js inits -->
496
  ';
497
- echo $result;
498
  }
499
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
500
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
501
 
502
  function wppa_thumb_asp() {
503
 
504
- $aspect = 1;
505
- if ( wppa_opt( 'thumb_aspect' ) != '0:0:none' ) {
506
- $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
507
- $aspect = $t[0] / $t[1];
508
- }
509
- elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
510
- $t = explode( 'x', wppa_opt( 'resize_to' ) );
511
- $aspect = $t[1] / $t[0];
512
- }
513
- else {
514
- $aspect = wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' );
515
- }
516
- return $aspect;
517
  }
518
 
519
  function wppa_fbw() {
520
 
521
- if ( is_numeric( wppa_opt( 'fullimage_border_width' ) ) ) {
522
- $fbw = wppa_opt( 'fullimage_border_width' ) + '1';
523
- }
524
- else {
525
- $fbw = '0';
526
- }
527
- return $fbw;
528
  }
529
 
530
  /* LOAD JAVASCRIPT */
@@ -536,84 +533,89 @@ global $wppa_api_version;
536
  global $wppa_lang;
537
  global $wppa_opt;
538
 
539
- $footer = wppa_is_defer();
540
-
541
- // WPPA+ Javascript files.
542
- // All wppa+ js files come in 2 flavours: the normal version and a minified version.
543
- // If the minified version is available, it will be loaded, else the normal version.
544
- // If you want to debug js, just delete the minified version; this will cause the normal
545
- // - readable - version to be loaded.
546
-
547
- // The js dependancies
548
- $js_depts = array( 'jquery',
549
- 'jquery-form',
550
- 'jquery-masonry',
551
- 'jquery-ui-dialog',
552
- );
553
-
554
- // First see if an 'all' file is present. This is to save http requests
555
- $all_file = dirname( __FILE__ ) . '/js/wppa-all.js';
556
- if ( wppa_is_file( $all_file ) ) {
557
- $js_ver = date( "ymd-Gis", filemtime( $all_file ) );
558
- wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa-all.js', $js_depts, $js_ver, $footer );
559
- }
560
-
561
- // No all file, do them one by one
562
- else {
563
- $js_files = array(
564
- 'wppa-utils',
565
- 'wppa',
566
- 'wppa-slideshow',
567
- 'wppa-ajax-front',
568
- 'wppa-lightbox',
569
- 'wppa-popup',
570
- 'wppa-touch',
571
- 'wppa-zoom',
572
- 'wppa-spheric',
573
- );
574
-
575
- foreach ( array_keys( $js_files ) as $idx ) {
576
- if ( is_file( dirname( __FILE__ ) . '/js/' . $js_files[$idx] . '.min.js' ) ) {
577
- $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.min.js' ) );
578
- wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.min.js', $js_depts, $js_ver, $footer );
579
- }
580
- else {
581
- $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.js' ) );
582
- wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.js', $js_depts, $js_ver, $footer );
583
- }
584
- }
585
- }
586
-
587
- // google maps
588
- if ( wppa_switch( 'save_gpx' ) && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false ) {
589
- $key = wppa_opt( 'map_apikey' );
590
- wp_enqueue_script( 'wppa-geo',
591
- 'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
592
- '',
593
- $wppa_api_version,
594
- $footer );
595
- }
596
-
597
- // Nicescroller
598
- if ( ! wppa_is_mobile() && ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) ) {
599
- $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
600
- wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, $js_depts, $wppa_api_version, $footer );
601
- $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
602
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
603
- }
604
-
605
- // Easing we need, borrow it from nicescroller if not already loaded
606
- else {
607
- $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
608
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
609
- }
610
-
611
- // Panorama
612
- if ( wppa_switch( 'enable_panorama' ) ) {
613
- $three_url = WPPA_URL . '/vendor/three/three.min.js';
614
- $ver = '122';
615
- wp_enqueue_script( 'wppa-three-min-js', $three_url, $js_depts, $wppa_api_version, $footer );
616
- }
 
 
 
 
 
617
 
618
  }
619
 
@@ -623,42 +625,42 @@ function wppa_js( $txt ) {
623
  global $wppa_js_page_data;
624
  global $wppa_script_open;
625
 
626
- // Validate input
627
- if ( wppa_switch( 'allow_debug' ) ) {
628
- $i = 0;
629
- $arr = array( '[' => 0, ']' => 0, '(' => 0, ')' => 0, '{' => 0, '}' => 0 );
630
- $t = array_keys( $arr );
631
- while ( $i < strlen( $txt ) ) {
632
- $c = substr( $txt, $i, 1 );
633
- if ( in_array( $c, $t ) ) $arr[$c]++;
634
- $i++;
635
- }
636
- for ( $i = 0; $i < 6; $i += 2 ) {
637
- if ( $arr[$t[$i]] != $arr[$t[$i + 1]] ) {
638
- wppa_log( 'err', 'Unmatched ' . $t[$i] . ' - ' . $t[$i + 1] . ' in ' . $txt . ' (wppa_js)', true );
639
- }
640
- }
641
- if ( substr( $txt, -1 ) != ';' ) {
642
- wppa_log( 'err', 'Missing ; in ' . $txt . ' (wppa_js)', true );
643
- $txt .= ';';
644
- }
645
- }
646
-
647
- // Do it
648
- if ( ! wppa_is_defer() || wppa_is_caching() ) {
649
- wppa_out( '
650
  <script>' . $txt . '</script>' );
651
- return;
652
- }
653
-
654
- if ( ! $wppa_script_open ) {
655
- $wppa_js_page_data = $txt;
656
- $wppa_script_open = true;
657
- }
658
- else {
659
- $wppa_js_page_data .= '
660
  ' . $txt;
661
- }
662
  }
663
 
664
  // Output page specific script in the footer.
@@ -669,41 +671,39 @@ function wppa_print_psjs() {
669
  global $wppa_js_page_data;
670
  global $wppa_script_open;
671
 
672
- if ( $wppa_js_page_data ) {
673
- echo '
674
  <!-- WPPA Page specific js -->
675
  <script>' . wppa_compress_js( $wppa_js_page_data ) . '
676
  </script>
677
  <!-- End WPPA Page specific js -->
678
  ';
679
 
680
- $wppa_js_page_data = '';
681
- $wppa_script_open = false;
682
- }
683
  }
684
 
685
  // Compress javascript
686
  function wppa_compress_js( $txt ) {
687
 
688
- $result = $txt;
689
- $result = str_replace( "\t", "", $result );
690
- $result = str_replace( "\r\n", "", $result );
691
- $result = str_replace( " = ", "=", $result );
692
- $result = str_replace( "; ", ";", $result );
693
- $result = str_replace( "/*", "\r\n/*", $result );
694
 
695
- return $result;
696
  }
697
 
698
  // Decide if we do defer js
699
  function wppa_is_defer() {
700
 
701
- return true;
702
-
703
- if ( is_admin() ) return true;
704
- if ( ! wppa_switch( 'defer_javascript' ) ) return false;
705
- if ( wppa( 'ajax' ) ) return false;
706
- if ( wppa( 'cron' ) ) return false;
707
- if ( wppa( 'is_slide' ) || wppa( 'is_slideonly' ) || wppa( 'is_filmonly' ) ) return false;
708
- return true;
709
  }
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.0.10.001
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
14
  global $wppa_session;
15
  global $wpdb;
16
 
17
+ /* wppa-utils.js */
18
+ $result = '
19
+ wppaDebugCounter = 0,';
20
+
21
+ /* wppa.js */
22
+ $result .= '
23
+ wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime),
24
+ wppaOvlActivePanorama = 0,';
25
+
26
+ /* Global and slideshow vars */
27
+ $result .= '
28
+ wppaFullValign = [],
29
+ wppaFullHalign = [],
30
+ wppaFullFrameDelta = [],
31
+ wppaAutoColumnWidth = [],
32
+ wppaAutoColumnFrac = [],
33
+ wppaFadeInAfterFadeOut = false,
34
+ wppaPreambule = [],
35
+ wppaThumbnailPitch = [],
36
+ wppaFilmStripLength = [],
37
+ wppaFilmStripMargin = [],
38
+ wppaFilmStripAreaDelta = [],
39
+ wppaIsMini = [],
40
+ wppaPortraitOnly = [],
41
+ wppaLightBox = [],
42
+ wppaSlideInitRunning = [],
43
+ wppaSlidePause = [],
44
+ wppaSlideBlank = [],
45
+ wppaFilmPageSize = [],
46
+ wppaAspectRatio = [],
47
+ wppaFullSize = [],
48
+ wppaLightboxSingle = [],
49
+ wppaSiteUrl = "' . site_url() . '",
50
+ wppaMasonryCols = [],
51
+ wppaVideoPlaying = [],
52
+ wppaAudioPlaying = [],
53
+ wppaHis = 0,
54
+ wppaStartHtml = [],
55
+ wppaCanAjaxRender = false,
56
+ wppaCanPushState = false,
57
+ wppaMaxOccur = 0,
58
+ wppaFirstOccur = 0,
59
+ wppaUsePhotoNamesInUrls = false,
60
+ wppaShareHideWhenRunning = false,
61
+ wppaCommentRequiredAfterVote = true,
62
+ wppaTopMoc = 0,
63
+ wppaColWidth = [],
64
+ wppaMCRWidth = [],
65
+ wppaFotomotoHideWhenRunning = false,
66
+ wppaFotomotoMinWidth = 400,
67
+ wppaPhotoView = [],
68
+ wppaBackgroundColorImage = "",
69
+ wppaPopupLinkType = "",
70
+ wppaPopupOnclick = [],
71
+ wppaThumbTargetBlank = false,
72
+ wppaRel = "rel",
73
+ wppaEditPhotoWidth = "960",
74
+ wppaThemeStyles = "",
75
+ wppaStickyHeaderHeight = 0,
76
+ wppaModalBgColor = "#ffffff",
77
+ wppaBoxRadius = 0,
78
+ wppaUploadEdit = "none",
79
+ wppaPageArg = "",
80
+ wppaCoverImageResponsive = [],
81
+ wppaSearchBoxSelItems = [],
82
+ wppaSlideWrap = [],
83
+ wppaHideRightClick = false,
84
+ wppaGeoZoom = 10,
85
+ wppaAreaMaxFrac = 1.0,
86
+ wppaNiceScroll = false,
87
+ wppaIconSizeNormal = "default",
88
+ wppaIconSizeStars = 24,
89
+ wppaFilmInit = [],
90
+ wppaResizeEndDelay = 200,
91
+ wppaScrollEndDelay = 200,
92
+ wppaArtmonkeyFileNotSource = false,
93
+ wppaRequestInfoDialogText = "Please specify your question",
94
+ wppaGlobalFsIconSize = 32,
95
+ wppaFsFillcolor = "#999999",
96
+ wppaFsBgcolor = "transparent",
97
+ wppaSlideLinkEqual = ' . ( wppa_opt( 'slideshow_linktype' ) == 'same' ? 'true' : 'false' ) . ',
98
+ _wppaId = [],
99
+ _wppaRealId = [],
100
+ _wppaAvg = [],
101
+ _wppaDisc = [],
102
+ _wppaMyr = [],
103
+ _wppaVRU = [],
104
+ _wppaLinkUrl = [],
105
+ _wppaLinkTitle = [],
106
+ _wppaLinkTarget = [],
107
+ _wppaCommentHtml = [],
108
+ _wppaIptcHtml = [],
109
+ _wppaExifHtml = [],
110
+ _wppaToTheSame = false,
111
+ _wppaSlides = [],
112
+ _wppaNames = [],
113
+ _wppaFilmThumbTitles = [],
114
+ _wppaFullNames = [],
115
+ _wppaDsc = [],
116
+ _wppaOgDsc = [],
117
+ _wppaCurIdx = [],
118
+ _wppaNxtIdx = [],
119
+ _wppaTimeOut = [],
120
+ _wppaSSRuns = [],
121
+ _wppaFg = [],
122
+ _wppaTP = [],
123
+ _wppaIsBusy = [],
124
+ _wppaFirst = [],
125
+ _wppaVoteInProgress = false,
126
+ _wppaTextDelay = ' . wppa_opt( 'animation_speed' ) . ',
127
+ _wppaUrl = [],
128
+ _wppaSkipRated = [],
129
+ _wppaLbTitle = [],
130
+ _wppaStateCount = 0,
131
+ _wppaDidGoto = [],
132
+ _wppaShareUrl = [],
133
+ _wppaShareHtml = [],
134
+ _wppaFilmNoMove = [],
135
+ _wppaHiresUrl = [],
136
+ _wppaIsVideo = [],
137
+ _wppaVideoHtml = [],
138
+ _wppaAudioHtml = [],
139
+ _wppaVideoNatWidth = [],
140
+ _wppaVideoNatHeight = [],
141
+ _wppaWaitTexts = [],
142
+ _wppaImageAlt = [],
143
+ _wppaLastIdx = [],
144
+ _wppaStopping = [],
145
+ _wppaFilename = [],
146
+ __wppaOverruleRun = false,
147
+ wppaOvlIdx = 0,
148
+ wppaOvlFirst = true,
149
+ wppaOvlKbHandler = "",
150
+ wppaOvlSizeHandler = "",
151
+ wppaOvlPadTop = 5,
152
+ wppaOvlRunning = false,
153
+ wppaOvlVideoPlaying = false,
154
+ wppaOvlAudioPlaying = false,
155
+ wppaOvlShowLegenda = true,
156
+ wppaOvlShowStartStop = true,
157
+ wppaOvlRadius = 0,
158
+ wppaOvlBorderWidth = 16,
159
+ wppaOvlOpen = false,
160
+ wppaOvlClosing = false,
161
+ wppaThumbSize = 100,
162
+ wppaTfMargin = 4,
163
+ wppaZoomData = [],
164
+ wppaSphericData = [],
165
+ wppaOvlTxtHeight = 36,
166
+ wppaOvlOpacity = 0.8,
167
+ wppaOvlOnclickType = "none",
168
+ wppaOvlTheme = "black",
169
+ wppaOvlAnimSpeed = 300,
170
+ wppaOvlSlideSpeed = 3000,
171
+ wppaOvlFontFamily = "Helvetica",
172
+ wppaOvlFontSize = "10",
173
+ wppaOvlFontColor = "",
174
+ wppaOvlFontWeight = "bold",
175
+ wppaOvlLineHeight = "12",
176
+ wppaOvlShowCounter = true,
177
+ wppaOvlIsVideo = false,
178
+ wppaShowLegenda = "",
179
+ wppaOvlFsPhotoId = 0,
180
+ wppaPhotoId = 0,
181
+ wppaOvlVideoStart = false,
182
+ wppaOvlAudioStart = false,
183
+ wppaLastIptc = "",
184
+ wppaLastExif = "",
185
+ wppaIsIpad = false,
186
+ wppaSvgFillcolor = "gray",
187
+ wppaSvgBgcolor = "transparent",
188
+ wppaSvgCornerStyle = "light",
189
+ wppaCoverSpacing = 8,
190
+ wppaEasingSlide = "' . wppa_opt( 'easing_slide' ) . '",
191
+ wppaEasingLightbox = "' . wppa_opt( 'easing_lightbox' ) . '",
192
+ wppaEasingPopup = "' . wppa_opt( 'easing_popup' ) . '",
193
+ wppaEasingDefault = "swing",';
194
+
195
+ /* wppa-ajax-front.js */
196
+ $result .= '
197
+ wppaRenderAdd = false,
198
+ wppaWaitForCounter = 0,';
199
+
200
+ /* wppa-lightbox.js */
201
+ $result .= '
202
+ wppaIsVideo = false,
203
+ wppaHasAudio = false,
204
+ wppaOvlIsPdf = false,
205
+ wppaOvlImgs = [],
206
+ wppaKbHandlerInstalled = false,
207
+ wppaOvlCurIdx = 0,
208
+ wppaOvlSvgInverse = false,
209
+ wppaOvlHasPanoramas = false,
210
+ wppaGlobalOvlPanoramaId = 0,
211
+ wppaOvlBrowseOnClick = false,
212
+ wppaOvlGlobal = false,
213
+ wppaWppaOverlayActivated = false,
214
+ wppaOvlTimer = 0,
215
+ wppaSavedContainerWidth = 0,
216
+ wppaSavedContainerHeight = 0,';
217
+
218
+ /* wppa-touch.js */
219
+ $result .= '
220
+ wppaTriggerElementID = null,
221
+ wppaFingerCount = 0,
222
+ wppaStartX = 0,
223
+ wppaStartY = 0,
224
+ wppaCurX = 0,
225
+ wppaCurY = 0,
226
+ wppaDeltaX = 0,
227
+ wppaDeltaY = 0,
228
+ wppaHorzDiff = 0,
229
+ wppaVertDiff = 0,
230
+ wppaMinLength = 72,
231
+ wppaSwipeLength = 0,
232
+ wppaSwipeAngle = null,
233
+ wppaSwipeDirection = null,
234
+ wppaSwipeOnLightbox = false,
235
+ wppaSwipeMocc = 0,
236
+ wppaMobileTimeStart = 0,';
237
+
238
+ /* admin-scripts.js */
239
+ $result .= '
240
+ wppa_moveup_url = "#",
241
+ wppa_import = "Import",
242
+ wppa_update = "Update",
243
+ wppaUploadToThisAlbum = "Upload to this album",
244
+ wppaCloseText = "' . __( 'Close!', 'wp-photo-album-plus' ) . '",
245
+ wppaCropper = [],';
246
+
247
+ // Find ajax url
248
+ $can_ajax = 'true';
249
+ switch ( wppa_opt( 'ajax_method' ) ) {
250
+ case 'normal':
251
+ if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
252
+ else $ajax_url = site_url() . '/wppaajax';
253
+ break;
254
+ case 'wppaajax':
255
+ $ajax_url = site_url() . '/wppaajax';
256
+ break;
257
+ case 'admin':
258
+ $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
259
+ break;
260
+ case 'extern':
261
+ if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
262
+ else $ajax_url = WPPA_URL . '/wppa-ajax-front.php';
263
+ break;
264
+ case 'none':
265
+ $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
266
+ $can_ajax = 'false'; // works on frontend only
267
+ break;
268
+ }
269
+
270
+ /* Language and config specific inits */
271
+ $result .= '
272
+ wppaImageDirectory = "' . wppa_get_imgdir() . '",
273
+ wppaWppaUrl = "' . wppa_get_wppa_url() . '",
274
+ wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '",
275
+ wppaAjaxUrl = "' . $ajax_url . '",
276
+ wppaUploadUrl = "' . WPPA_UPLOAD_URL . '",
277
+ wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ',
278
+ wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ',
279
+ wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '",
280
+ wppaAudioHeight = ' . wppa_get_audio_control_height() . ',
281
+ wppaFilmThumbTitle = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Double click to start/stop slideshow running', 'wp-photo-album-plus' ) ) . '",
282
+ wppaClickToView = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Click to view', 'wp-photo-album-plus' ) ) . '",
283
+ wppaLang = "' . $wppa_lang . '",
284
+ wppaVoteForMe = "' . __( wppa_opt( 'vote_button_text' ), 'wp-photo-album-plus' ) . '",
285
+ wppaVotedForMe = "' . __( wppa_opt( 'voted_button_text' ), 'wp-photo-album-plus' ) . '",
286
+ wppaDownLoad = "' . __( 'Download', 'wp-photo-album-plus' ) . '",
287
+ wppaSlideShow = "' . __( 'Slideshow', 'wp-photo-album-plus' ) . '",
288
+ wppaPhoto = "' . __( 'Photo', 'wp-photo-album-plus' ) . '",
289
+ wppaOf = "' . __( 'of', 'wp-photo-album-plus' ) . '",
290
+ wppaNextPhoto = "' . __( 'Next photo', 'wp-photo-album-plus' ) . '",
291
+ wppaPreviousPhoto = "' . __( 'Previous photo', 'wp-photo-album-plus' ) . '",
292
+ wppaNextP = "' . __( 'Next', 'wp-photo-album-plus' ) . '",
293
+ wppaPrevP = "' . __( 'Prev.', 'wp-photo-album-plus' ) . '",
294
+ wppaAvgRating = "' . __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) . '",
295
+ wppaMyRating = "' . __( 'My&nbsp;rating', 'wp-photo-album-plus' ) . '",
296
+ wppaAvgRat = "' . __( 'Avg.', 'wp-photo-album-plus' ) . '",
297
+ wppaMyRat = "' . __( 'Mine', 'wp-photo-album-plus' ) . '",
298
+ wppaDislikeMsg = "' . __( 'You marked this image as inappropriate.', 'wp-photo-album-plus' ) . '",
299
+ wppaStart = "' . __( 'Start', 'wp-photo-album-plus' ) . '",
300
+ wppaStop = "' . __( 'Stop', 'wp-photo-album-plus' ) . '",
301
+ wppaPleaseName = "' . __( 'Please enter your name', 'wp-photo-album-plus' ) . '",
302
+ wppaPleaseEmail = "' . __( 'Please enter a valid email address', 'wp-photo-album-plus' ) . '",
303
+ wppaPleaseComment = "' . __( 'Please enter a comment', 'wp-photo-album-plus' ) . '",
304
+ wppaProcessing = "' . __( 'Processing...', 'wp-photo-album-plus' ) . '",
305
+ wppaDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '",
306
+ wppaUploadFailed = "' . __( 'Upload failed', 'wp-photo-album-plus' ) . '",
307
+ wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '",
308
+ wppaGlobalFsIconSize = "'.wppa_opt( 'nav_icon_size_global_fs' ) . '",
309
+ wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ) . '",
310
+ wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ) . '",
311
+ wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
312
+ wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) && ! wppa_is_mobile() ? 'true' : 'false' ) . ',
313
+ wppaVersion = "'.$wppa_api_version.'",
314
+ wppaDebug = '.( wppa_switch( 'allow_debug' ) ? 'true' : 'false' ) . ',
315
+ wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
316
+ wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
317
+ wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
318
+ wppaAnimationSpeed = '.wppa_opt( 'animation_speed' ) . ',
319
+ wppaThumbnailAreaDelta = '.wppa_get_thumbnail_area_delta() . ',
320
+ wppaTextFrameDelta = '.wppa_get_textframe_delta() . ',
321
+ wppaBoxDelta = '.wppa_get_box_delta() . ',
322
+ wppaSlideShowTimeOut = '.wppa_opt( 'slideshow_timeout' ) . ',
323
+ wppaFilmShowGlue = '.( wppa_switch( 'film_show_glue' ) ? 'true' : 'false' ) . ',
324
+ wppaMiniTreshold = '.( wppa_opt( 'mini_treshold' ) ? wppa_opt( 'mini_treshold' ) : '0' ) . ',
325
+ wppaRatingOnce = '.( wppa_switch( 'rating_change' ) || wppa_switch( 'rating_multi' ) ? 'false' : 'true' ) . ',
326
+ wppaHideWhenEmpty = '.( wppa_switch( 'hide_when_empty' ) ? 'true' : 'false' ) . ',
327
+ wppaBGcolorNumbar = "'.wppa_opt( 'bgcolor_numbar' ) . '",
328
+ wppaBcolorNumbar = "'.wppa_opt( 'bcolor_numbar' ) . '",
329
+ wppaBGcolorNumbarActive = "'.wppa_opt( 'bgcolor_numbar_active' ) . '",
330
+ wppaBcolorNumbarActive = "'.wppa_opt( 'bcolor_numbar_active' ) . '",
331
+ wppaFontFamilyNumbar = "'.wppa_opt( 'fontfamily_numbar' ) . '",
332
+ wppaFontSizeNumbar = "'.wppa_opt( 'fontsize_numbar' ) . 'px",
333
+ wppaFontColorNumbar = "'.wppa_opt( 'fontcolor_numbar' ) . '",
334
+ wppaFontWeightNumbar = "'.wppa_opt( 'fontweight_numbar' ) . '",
335
+ wppaFontFamilyNumbarActive = "'.wppa_opt( 'fontfamily_numbar_active' ) . '",
336
+ wppaFontSizeNumbarActive = "'.wppa_opt( 'fontsize_numbar_active' ) . 'px",
337
+ wppaFontColorNumbarActive = "'.wppa_opt( 'fontcolor_numbar_active' ) . '",
338
+ wppaFontWeightNumbarActive = "'.wppa_opt( 'fontweight_numbar_active' ) . '",
339
+ wppaNumbarMax = "'.wppa_opt( 'numbar_max' ) . '",
340
+ wppaNextOnCallback = '.( wppa_switch( 'next_on_callback' ) ? 'true' : 'false' ) . ',
341
+ wppaStarOpacity = '.str_replace(',', '.',( wppa_opt( 'star_opacity' )/'100' )) . ',
342
+ wppaEmailRequired = "'.wppa_opt( 'comment_email_required' ) . '",
343
+ wppaSlideBorderWidth = '.wppa_fbw().',
344
+ wppaAllowAjax = '.$can_ajax.',
345
+ wppaUsePhotoNamesInUrls = '.( wppa_switch( 'use_photo_names_in_urls' ) ? 'true' : 'false' ) . ',
346
+ wppaThumbTargetBlank = '.( wppa_switch( 'thumb_blank' ) ? 'true' : 'false' ) . ',
347
+ wppaRatingMax = '.wppa_opt( 'rating_max' ) . ',
348
+ wppaRatingDisplayType = "'.wppa_opt( 'rating_display_type' ) . '",
349
+ wppaRatingPrec = '.wppa_opt( 'rating_prec' ) . ',
350
+ wppaStretch = '.( wppa_switch( 'enlarge' ) ? 'true' : 'false' ) . ',
351
+ wppaMinThumbSpace = '.wppa_opt( 'tn_margin' ) . ',
352
+ wppaThumbSpaceAuto = '.( wppa_switch( 'thumb_auto' ) ? 'true' : 'false' ) . ',
353
+ wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
354
+ wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
355
+ wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
356
+ wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'true' : 'false' ) . ',
357
+ wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
358
+ wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
359
+ wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
360
+ wppaComAltSize = '.wppa_opt( 'comten_alt_thumbsize' ) . ',
361
+ wppaBumpViewCount = '.( wppa_switch( 'track_viewcounts' ) ? 'true' : 'false' ) . ',
362
+ wppaBumpClickCount = '.( wppa_switch( 'track_clickcounts' ) ? 'true' : 'false' ) . ',
363
+ wppaShareHideWhenRunning = '.( wppa_switch( 'share_hide_when_running' ) ? 'true' : 'false' ) . ',
364
+ wppaFotomoto = '.( wppa_switch( 'fotomoto_on' ) ? 'true' : 'false' ) . ',
365
+ wppaArtMonkeyButton = '.( wppa_opt( 'art_monkey_display' ) == 'button' ? 'true' : 'false' ) . ',
366
+ wppaFotomotoHideWhenRunning = '.( wppa_switch( 'fotomoto_hide_when_running' ) ? 'true' : 'false' ) . ',
367
+ wppaCommentRequiredAfterVote = '.( wppa_switch( 'vote_needs_comment' ) ? 'true' : 'false' ) . ',
368
+ wppaFotomotoMinWidth = '.wppa_opt( 'fotomoto_min_width' ) . ',
369
+ wppaShortQargs = '.( wppa_switch( 'use_short_qargs' ) ? 'true' : 'false' ) . ',
370
+ wppaOvlHires = '.( wppa_switch( 'lb_hres' ) ? 'true' : 'false' ) . ',
371
+ wppaSlideVideoStart = '.( wppa_switch( 'start_slide_video' ) ? 'true' : 'false' ) . ',
372
+ wppaSlideAudioStart = '.( wppa_switch( 'start_slide_audio' ) ? 'true' : 'false' ) . ',
373
+ wppaRel = "data-rel",
374
+ wppaOvlRadius = '.wppa_opt( 'ovl_border_radius' ) . ',
375
+ wppaOvlBorderWidth = '.wppa_opt( 'ovl_border_width' ) . ',
376
+ wppaEditPhotoWidth = "'.(wppa_opt( 'upload_edit' ) == 'new' ? 500 : 960) . '",
377
+ wppaThemeStyles = "'.(wppa_switch( 'upload_edit_theme_css' ) ? get_stylesheet_uri() : '' ) . '",
378
+ wppaStickyHeaderHeight = '.wppa_opt( 'sticky_header_size' ) . ',
379
+ wppaRenderModal = ' . ( wppa_switch( 'ajax_render_modal' ) ? 'true' : 'false' ) . ',
380
+ wppaModalQuitImg = "url(' . wppa_get_imgdir( 'smallcross-' . wppa_opt( 'ovl_theme' ) . '.gif' ) . ' )",
381
+ wppaBoxRadius = "' . wppa_opt( 'bradius' ) . '",
382
+ wppaModalBgColor = "' . wppa_opt( 'bgcolor_modal' ) . '",
383
+ wppaUploadEdit = "' . wppa_opt( 'upload_edit' ) . '",
384
+ wppaSvgFillcolor = "' . wppa_opt( 'svg_color' ) . '",
385
+ wppaSvgBgcolor = "' . wppa_opt( 'svg_bg_color' ) . '",
386
+ wppaOvlSvgFillcolor = "' . wppa_opt( 'ovl_svg_color' ) . '",
387
+ wppaOvlSvgBgcolor = "' . wppa_opt( 'ovl_svg_bg_color' ) . '",
388
+ wppaSvgCornerStyle = "' . wppa_opt( 'icon_corner_style' ) . '",
389
+ wppaHideRightClick = ' . ( wppa_switch( 'no_rightclick' ) ? 'true' : 'false' ) . ',
390
+ wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ',
391
+ wppaLazyLoad = ' . ( wppa_lazy() ? 'true' : 'false' ) . ',
392
+ wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ',
393
+ wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '",
394
+ wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '",
395
+ wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ',
396
+ wppaExtendedResizeCount = ' . wppa_opt( 'extended_resize_count' ) . ',
397
+ wppaExtendedResizeDelay = ' . wppa_opt( 'extended_resize_delay' ) . ',
398
+ wppaCoverSpacing = ' . wppa_opt( 'cover_spacing' ) . ',
399
+ wppaFilmonlyContinuous = ' . ( wppa_switch( 'filmonly_continuous' ) ? 'true' : 'false' ) . ',
400
+ wppaNoAnimateOnMobile = ' . ( wppa_switch( 'no_animate_on_mobile' ) ? 'true' : 'false' ) . ',
401
+ wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
402
+ wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
403
+ wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
404
+ wppaArtmonkeyFileNotSource = ' . ( wppa_opt( 'art_monkey_link' ) == 'file' &&
405
+ wppa_opt( 'art_monkey_display' ) == 'text' &&
406
+ ! wppa_switch( 'artmonkey_use_source' ) ? 'true' : 'false' ) . ',
407
+ wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
408
+ wppaThumbAspect = ' . wppa_thumb_asp() . ',';
409
+
410
+ /* Lightbox vars */
411
+ $fontsize_lightbox = wppa_opt( 'fontsize_lightbox' ) ? wppa_opt( 'fontsize_lightbox' ) : '10';
412
+ $d = wppa_switch( 'ovl_show_counter') ? 1 : 0;
413
+ $ovlh = wppa_opt( 'ovl_txt_lines' ) == 'auto' ? 'auto' : ((wppa_opt( 'ovl_txt_lines' ) + $d) * ($fontsize_lightbox + 2));
414
+ $lb_global = '';
415
+ if ( wppa_switch( 'lightbox_global' ) && ! is_admin() ) {
416
+ if ( wppa_switch( 'lightbox_global_set' ) ) {
417
+ $lb_global = 'wppa[single]';
418
+ }
419
+ else {
420
+ $lb_global = 'wppa';
421
+ }
422
+ }
423
+
424
+ $result .= '
425
+ wppaOvlTxtHeight = "'.$ovlh.'",
426
+ wppaOvlOpacity = '.(wppa_opt( 'ovl_opacity' )/100).',
427
+ wppaOvlOnclickType = "'.wppa_opt( 'ovl_onclick' ).'",
428
+ wppaOvlTheme = "'.wppa_opt( 'ovl_theme' ).'",
429
+ wppaOvlAnimSpeed = '.wppa_opt( 'ovl_anim' ).',
430
+ wppaOvlSlideSpeed = '.wppa_opt( 'ovl_slide' ).',
431
+ wppaVer4WindowWidth = 800,
432
+ wppaVer4WindowHeight = 600,
433
+ wppaOvlShowCounter = '.( wppa_switch( 'ovl_show_counter') ? 'true' : 'false' ).',
434
+ '.( wppa_opt( 'fontfamily_lightbox' ) ? 'wppaOvlFontFamily = "'.wppa_opt( 'fontfamily_lightbox' ).'",' : '').'
435
+ wppaOvlFontSize = "'.$fontsize_lightbox.'",
436
+ '.( wppa_opt( 'fontcolor_lightbox' ) ? 'wppaOvlFontColor = "'.wppa_opt( 'fontcolor_lightbox' ).'",' : '').'
437
+ '.( wppa_opt( 'fontweight_lightbox' ) ? 'wppaOvlFontWeight = "'.wppa_opt( 'fontweight_lightbox' ).'",' : '').'
438
+ '.( wppa_opt( 'fontsize_lightbox' ) ? 'wppaOvlLineHeight = "'.(wppa_opt( 'fontsize_lightbox' ) + '2').'",' : '').'
439
+ wppaOvlVideoStart = '.( wppa_switch( 'ovl_video_start' ) ? 'true' : 'false' ).',
440
+ wppaOvlAudioStart = '.( wppa_switch( 'ovl_audio_start' ) ? 'true' : 'false' ).',
441
+ wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).',
442
+ wppaIsMobile = '.( wppa_is_mobile() ? 'true' : 'false' ).',
443
+ wppaIsIpad = '.( wppa_is_ipad() ? 'true' : 'false' ).',
444
+ wppaOvlIconSize = "'.wppa_opt( 'nav_icon_size_lightbox' ).'px",
445
+ wppaOvlBrowseOnClick = '.( wppa_switch( 'ovl_browse_on_click' ) ? 'true' : 'false' ).',
446
+ wppaOvlGlobal = ' . ( $lb_global ? '"' . $lb_global . '"' : 'false' ) . ',
447
+ wppaPhotoDirectory = "'.WPPA_UPLOAD_URL.'/",
448
+ wppaThumbDirectory = "'.WPPA_UPLOAD_URL.'/thumbs/",
449
+ wppaTempDirectory = "'.WPPA_UPLOAD_URL.'/temp/",
450
+ wppaFontDirectory = "'.WPPA_UPLOAD_URL.'/fonts/",
451
+ wppaNoPreview = "'.__('No Preview available', 'wp-photo-album-plus').'",
452
+ wppaUIERR = "'.__('Unimplemented virtual album', 'wp-photo-album-plus').'",
453
+ wppaTxtProcessing = "'.__('Processing...', 'wp-photo-album-plus').'",
454
+ wppaTxtDone = "'.__('Done!', 'wp-photo-album-plus').'",
455
+ wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'",
456
+ wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";';
457
+
458
+ // Tinymce photo
459
+ if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
460
+ $id = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos
461
+ WHERE ext <> 'xxx'
462
+ AND panorama = 0
463
+ ORDER BY timestamp DESC
464
+ LIMIT 1" );
465
+
466
+ // Fake we are in a widget, to prevent wppa_get_picture_html() from bumping viewcount
467
+ wppa( 'in_widget', true );
468
+
469
+ $result .= '
470
+ wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
471
+ wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
472
+
473
+ // Reset faked widget
474
+ wppa( 'in_widget', false );
475
+ }
476
+
477
+ // The photo views cache
478
+ if ( isset( $wppa_session['photo'] ) ) {
479
+ foreach ( array_keys( $wppa_session['photo'] ) as $p ) {
480
+ $result .= '
481
+ wppaPhotoView[' . $p . '] = true;';
482
+ }
483
+ }
484
+
485
+ // Format
486
+ $result = wppa_compress_js( $result );
487
+ $result = '
 
 
 
488
  <!-- wppa js inits -->
489
  <script>
490
  ' . $result . '
491
  </script>
492
  <!-- End wppa js inits -->
493
  ';
494
+ echo $result;
495
  }
496
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
497
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
498
 
499
  function wppa_thumb_asp() {
500
 
501
+ $aspect = 1;
502
+ if ( wppa_opt( 'thumb_aspect' ) != '0:0:none' ) {
503
+ $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
504
+ $aspect = $t[0] / $t[1];
505
+ }
506
+ elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
507
+ $t = explode( 'x', wppa_opt( 'resize_to' ) );
508
+ $aspect = $t[1] / $t[0];
509
+ }
510
+ else {
511
+ $aspect = wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' );
512
+ }
513
+ return $aspect;
514
  }
515
 
516
  function wppa_fbw() {
517
 
518
+ if ( is_numeric( wppa_opt( 'fullimage_border_width' ) ) ) {
519
+ $fbw = wppa_opt( 'fullimage_border_width' ) + '1';
520
+ }
521
+ else {
522
+ $fbw = '0';
523
+ }
524
+ return $fbw;
525
  }
526
 
527
  /* LOAD JAVASCRIPT */
533
  global $wppa_lang;
534
  global $wppa_opt;
535
 
536
+ $footer = wppa_is_defer();
537
+
538
+ // WPPA+ Javascript files.
539
+ // All wppa+ js files come in 2 flavours: the normal version and a minified version.
540
+ // If the minified version is available, it will be loaded, else the normal version.
541
+ // If you want to debug js, just delete the minified version; this will cause the normal
542
+ // - readable - version to be loaded.
543
+
544
+ // The js dependancies
545
+ $js_depts = array( 'jquery',
546
+ 'jquery-form',
547
+ 'jquery-masonry',
548
+ 'jquery-ui-dialog',
549
+ );
550
+
551
+ // First see if an 'all' file is present. This is to save http requests
552
+ $all_file = dirname( __FILE__ ) . '/js/wppa-all.js';
553
+ if ( wppa_is_file( $all_file ) ) {
554
+ $js_ver = date( "ymd-Gis", filemtime( $all_file ) );
555
+ wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa-all.js', $js_depts, $js_ver, false );
556
+ }
557
+
558
+ // No all file, do them one by one
559
+ else {
560
+ $js_files = array(
561
+ 'wppa-utils',
562
+ 'wppa',
563
+ 'wppa-slideshow',
564
+ 'wppa-ajax-front',
565
+ 'wppa-lightbox',
566
+ 'wppa-popup',
567
+ 'wppa-touch',
568
+ 'wppa-zoom',
569
+ 'wppa-spheric',
570
+ );
571
+
572
+ foreach ( array_keys( $js_files ) as $idx ) {
573
+ if ( is_file( dirname( __FILE__ ) . '/js/' . $js_files[$idx] . '.min.js' ) ) {
574
+ $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.min.js' ) );
575
+ wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.min.js', $js_depts, $js_ver, $footer );
576
+ }
577
+ else {
578
+ $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.js' ) );
579
+ wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.js', $js_depts, $js_ver, $footer );
580
+ }
581
+ }
582
+ }
583
+
584
+ // Start other (vendor) js files
585
+ $footer = false;
586
+
587
+ // google maps
588
+ if ( wppa_switch( 'save_gpx' ) && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false ) {
589
+ $key = wppa_opt( 'map_apikey' );
590
+ wp_enqueue_script( 'wppa-geo',
591
+ 'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
592
+ '',
593
+ $wppa_api_version,
594
+ $footer );
595
+ }
596
+
597
+ // Nicescroller
598
+ if ( ! wppa_is_mobile() && ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) ) {
599
+ $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
600
+ wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, array( 'jquery', 'nicescrollr-easing-min-js' ), 'all' );
601
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
602
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, array( 'jquery' ), 'all' );
603
+ }
604
+
605
+ // Easing we need, borrow it from nicescroller if not already loaded
606
+ else {
607
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
608
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, array( 'jquery' ), 'all' );
609
+ }
610
+
611
+ // Panorama
612
+ if ( wppa_switch( 'enable_panorama' ) ) {
613
+ $three_url = WPPA_URL . '/vendor/three/three.min.js';
614
+ $ver = '122';
615
+ wp_enqueue_script( 'wppa-three-min-js', $three_url, array(), $ver );
616
+ }
617
+
618
+ // End other (vendor) js files
619
 
620
  }
621
 
625
  global $wppa_js_page_data;
626
  global $wppa_script_open;
627
 
628
+ // Validate input
629
+ if ( wppa_switch( 'allow_debug' ) ) {
630
+ $i = 0;
631
+ $arr = array( '[' => 0, ']' => 0, '(' => 0, ')' => 0, '{' => 0, '}' => 0 );
632
+ $t = array_keys( $arr );
633
+ while ( $i < strlen( $txt ) ) {
634
+ $c = substr( $txt, $i, 1 );
635
+ if ( in_array( $c, $t ) ) $arr[$c]++;
636
+ $i++;
637
+ }
638
+ for ( $i = 0; $i < 6; $i += 2 ) {
639
+ if ( $arr[$t[$i]] != $arr[$t[$i + 1]] ) {
640
+ wppa_log( 'err', 'Unmatched ' . $t[$i] . ' - ' . $t[$i + 1] . ' in ' . $txt . ' (wppa_js)', true );
641
+ }
642
+ }
643
+ if ( substr( $txt, -1 ) != ';' ) {
644
+ wppa_log( 'err', 'Missing ; in ' . $txt . ' (wppa_js)', true );
645
+ $txt .= ';';
646
+ }
647
+ }
648
+
649
+ // Do it
650
+ if ( ! wppa_is_defer() || wppa_is_caching() ) {
651
+ wppa_out( '
652
  <script>' . $txt . '</script>' );
653
+ return;
654
+ }
655
+
656
+ if ( ! $wppa_script_open ) {
657
+ $wppa_js_page_data = $txt;
658
+ $wppa_script_open = true;
659
+ }
660
+ else {
661
+ $wppa_js_page_data .= '
662
  ' . $txt;
663
+ }
664
  }
665
 
666
  // Output page specific script in the footer.
671
  global $wppa_js_page_data;
672
  global $wppa_script_open;
673
 
674
+ if ( $wppa_js_page_data ) {
675
+ echo '
676
  <!-- WPPA Page specific js -->
677
  <script>' . wppa_compress_js( $wppa_js_page_data ) . '
678
  </script>
679
  <!-- End WPPA Page specific js -->
680
  ';
681
 
682
+ $wppa_js_page_data = '';
683
+ $wppa_script_open = false;
684
+ }
685
  }
686
 
687
  // Compress javascript
688
  function wppa_compress_js( $txt ) {
689
 
690
+ $result = $txt;
691
+ $result = str_replace( "\t", "", $result );
692
+ $result = str_replace( "\r\n", "", $result );
693
+ $result = str_replace( " = ", "=", $result );
694
+ $result = str_replace( "; ", ";", $result );
695
+ $result = str_replace( "/*", "\r\n/*", $result );
696
 
697
+ return $result;
698
  }
699
 
700
  // Decide if we do defer js
701
  function wppa_is_defer() {
702
 
703
+ if ( ! wppa_switch( 'defer_javascript' ) ) return false;
704
+ if ( wppa( 'ajax' ) ) return false;
705
+ if ( wppa( 'cron' ) ) return false;
706
+ if ( is_admin() ) return false;
707
+ if ( wppa( 'is_slide' ) || wppa( 'is_slideonly' ) || wppa( 'is_filmonly' ) ) return false;
708
+ return true;
 
 
709
  }
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.1.00.005
7
  *
8
  */
9
 
@@ -268,8 +268,16 @@ global $wppa_subtab_names;
268
  wppa_ok_message('Done! wppa_delete_all_from_cloudinary');
269
  }
270
  else {
271
- wppa_ok_message( 'Not yet Done! wppa_delete_all_from_cloudinary' .
272
- '<br />Please restart' );
 
 
 
 
 
 
 
 
273
  }
274
  break;
275
 
@@ -279,8 +287,16 @@ global $wppa_subtab_names;
279
  wppa_ok_message('Done! wppa_delete_derived_from_cloudinary');
280
  }
281
  else {
282
- wppa_ok_message( 'Not yet Done! wppa_delete_derived_from_cloudinary' .
283
- '<br />Please restart' );
 
 
 
 
 
 
 
 
284
  }
285
  break;
286
 
@@ -459,6 +475,88 @@ global $wppa_subtab_names;
459
  // The nonce field
460
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce' );
461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  // Any tab set? else default general
463
  $tab = wppa_get( 'tab', 'general' );
464
  $subtab = wppa_get( 'subtab', '0' );
@@ -594,9 +692,9 @@ global $wppa_subtab_names;
594
 
595
  // The js
596
  {
597
- $the_js =
598
-
599
- 'function wppaSettingTab(tab) {
600
  jQuery(".wppa-setting-tabs li").removeClass("active");
601
  jQuery("#wppa-setting-tab-"+tab).addClass("active");
602
  if ( tab == 99 ) {
@@ -688,9 +786,8 @@ global $wppa_subtab_names;
688
  if (jQuery(".' . $subtab . '").attr("data-inactive") == "1") jQuery(".' . $subtab . '").trigger("click");
689
  },100)});' : ''
690
  ) .
691
- ( $tab == 'watermark' ? 'jQuery(document).ready(function(){wppaCheckFontPreview();});' : '' );
692
-
693
- wp_add_inline_script( 'wppa-admin', $the_js );
694
  }
695
 
696
  // Open the content area
@@ -1250,7 +1347,11 @@ global $wppa_subtab_names;
1250
  wppa_setting_new($slug, '9', $name, $desc, $html, $help);
1251
 
1252
  wppa_setting_box_footer_new();
1253
- wp_add_inline_script( 'wppa-admin', 'wppaAjaxGetSpinnerHtml( "normal", "wppa-spin-pre-1" );wppaAjaxGetSpinnerHtml( "lightbox", "wppa-spin-pre-2" )' );
 
 
 
 
1254
  }
1255
  // Multimedia icon and stubfile specifications
1256
  if ( wppa_switch( 'enable_audio' ) || wppa_switch( 'enable_video' ) || wppa_switch( 'enable_pdf' ) )
@@ -3647,7 +3748,7 @@ global $wppa_subtab_names;
3647
  $html = wppa_select( $slug, $opts, $vals, $onchange ) .
3648
  '&nbsp;&nbsp;<img id="wppa-cursor" src="'.wppa_get_imgdir().wppa_opt( substr( $slug, 5 ) ).'" />';
3649
  wppa_setting_new($slug, '14', $name, $desc, $html, $help);
3650
- wp_add_inline_script( 'wppa-admin', $onchange );
3651
 
3652
  $name = __('Border width', 'wp-photo-album-plus');
3653
  $desc = __('Border width for lightbox display.', 'wp-photo-album-plus');
@@ -3874,6 +3975,13 @@ global $wppa_subtab_names;
3874
  $html = wppa_checkbox($slug);
3875
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
3876
 
 
 
 
 
 
 
 
3877
  $name = __('Comment needs vote', 'wp-photo-album-plus');
3878
  $desc = __('User needs to give a rating to get his comment published', 'wp-photo-album-plus');
3879
  $help = '';
@@ -5785,8 +5893,9 @@ global $wppa_subtab_names;
5785
  $slug = 'wppa_ajax_upload_method';
5786
  $opts = array( __('normal', 'wp-photo-album-plus'),
5787
  __('backend', 'wp-photo-album-plus'),
 
5788
  );
5789
- $vals = array( 'normal', 'backend' );
5790
  $html = wppa_select($slug, $opts, $vals);
5791
  wppa_setting_new($slug, '5.1', $name, $desc, $html, $help, wppa_switch( 'ajax_upload' ));
5792
 
@@ -6423,13 +6532,13 @@ global $wppa_subtab_names;
6423
  $help = __('Only change this setting when there are links that do not work', 'wp-photo-album-plus');
6424
  $slug = 'wppa_ajax_method';
6425
  $opts = array( __('Normal', 'wp-photo-album-plus'),
6426
- // __('Classic', 'wp-photo-album-plus'),
6427
  // __('Frontend and Backend: Frontend method', 'wp-photo-album-plus'),
6428
  __('Frontend and Backend: Backend method', 'wp-photo-album-plus'),
6429
  __('Frontend: none, Backend: Backend method', 'wp-photo-album-plus'),
6430
  );
6431
  $vals = array( 'normal',
6432
- // 'extern',
6433
  // 'wppaajax',
6434
  'admin',
6435
  'none',
@@ -6475,18 +6584,17 @@ global $wppa_subtab_names;
6475
  $vals = array('none', 'top', 'bottom', 'both');
6476
  $html = wppa_select($slug, $opts, $vals);
6477
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
6478
- /*
6479
  $name = __('Defer javascript', 'wp-photo-album-plus');
6480
  $desc = __('Put javascript near the end of the page.', 'wp-photo-album-plus');
6481
  $help = (__('If checkd: May fix layout problems and broken slideshows. May speed up or slow down page appearing.', 'wp-photo-album-plus'));
6482
  $slug = 'wppa_defer_javascript';
6483
  $html = wppa_checkbox($slug);
6484
  wppa_setting_new($slug, '11', $name, $desc, $html, $help);
6485
- */
6486
  global $wppa_setting_error;
6487
  $wppa_setting_error = true;
6488
 
6489
- /*
6490
  $name = __('Custom style', 'wp-photo-album-plus');
6491
  $desc = __('Enter custom style specs here.', 'wp-photo-album-plus');
6492
  $help = __('Please move custom css to the wp customizer. WPPA Custom css will be discontinued in a near future revision.', 'wp-photo-album-plus');
@@ -6535,7 +6643,7 @@ global $wppa_subtab_names;
6535
  $slug = 'wppa_custom_style_opera';
6536
  $html = wppa_textarea($slug, $name);
6537
  wppa_setting_new($slug, '19', $name, $desc, $html, $help, wppa_opt( 'custom_style_opera' ) != '' );
6538
- */
6539
  $wppa_setting_error = false;
6540
 
6541
  $name = __('Use customized style file', 'wp-photo-album-plus');
@@ -6745,13 +6853,6 @@ global $wppa_subtab_names;
6745
  $html = wppa_select($slug, $opts, $vals, '');
6746
  wppa_setting_new($slug, '42', $name, $desc, $html, $help);
6747
 
6748
- $name = __('Use wp_upload_dir()', 'wp-photo-album-plus');
6749
- $desc = __('Rely upon the information supplied by wp_upload_dir() for wppa file locations', 'wp-photo-album-plus');
6750
- $help = __('Switch this on only when you are using non-standard locations for uploads etc', 'wp-photo-album-plus');
6751
- $slug = 'wppa_use_wp_upload_dir_locations';
6752
- $html = wppa_checkbox($slug);
6753
- wppa_setting_new($slug, '43', $name, $desc, $html, $help);
6754
-
6755
  wppa_setting_box_footer_new();
6756
  }
6757
  }
@@ -10148,7 +10249,8 @@ global $wppa_subtab_names;
10148
  if ( function_exists( 'wppa_get_cloudinary_usage' ) && wppa_opt( 'cdn_cloud_name' ) ) {
10149
  $data = wppa_get_cloudinary_usage();
10150
  if ( is_array( $data ) ) {
10151
- $desc .= '<table id="wppa-cloudinary-table" ><tbody>';
 
10152
  foreach ( array_keys( $data ) as $i ) {
10153
  $item = $data[$i];
10154
  if ( is_array( $item ) ) {
@@ -10204,6 +10306,13 @@ global $wppa_subtab_names;
10204
 
10205
  if ( wppa_switch( 'fotomoto_on' ) ) {
10206
 
 
 
 
 
 
 
 
10207
  $name = __('Hide when running', 'wp-photo-album-plus');
10208
  $desc = __('Hide toolbar on running slideshows', 'wp-photo-album-plus');
10209
  $help = __('The Fotomoto toolbar will re-appear when the slideshow stops.', 'wp-photo-album-plus');
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.0.10.004
7
  *
8
  */
9
 
268
  wppa_ok_message('Done! wppa_delete_all_from_cloudinary');
269
  }
270
  else {
271
+ wppa_ok_message('Not yet Done! wppa_delete_all_from_cloudinary' .
272
+ '<br />Trying to continue...');
273
+ echo
274
+ '<script type="text/javascript" >' .
275
+ 'document.location=' .
276
+ 'document.location+"&' .
277
+ 'wppa-settings-submit=Doit&' .
278
+ 'wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&' .
279
+ 'wppa-key=' . $key . '"' .
280
+ '</script>';
281
  }
282
  break;
283
 
287
  wppa_ok_message('Done! wppa_delete_derived_from_cloudinary');
288
  }
289
  else {
290
+ wppa_ok_message('Not yet Done! wppa_delete_derived_from_cloudinary' .
291
+ '<br />Trying to continue...');
292
+ echo
293
+ '<script type="text/javascript" >' .
294
+ 'document.location=' .
295
+ 'document.location+"&' .
296
+ 'wppa-settings-submit=Doit&' .
297
+ 'wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&' .
298
+ 'wppa-key=' . $key . '"' .
299
+ '</script>';
300
  }
301
  break;
302
 
475
  // The nonce field
476
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce' );
477
 
478
+ // The css
479
+ {
480
+ echo '
481
+ <style>
482
+ .wppa-master-tabs {
483
+ position:relative;
484
+ top:24px;
485
+ }
486
+ .wppa-setting-tabs {
487
+ position:relative;
488
+ top:24px;
489
+ }
490
+ .wppa-setting-tabs li {
491
+ border-color: darkgrey;
492
+ border-width: 1px;
493
+ float: left;
494
+ background-color: white;
495
+ padding: 8px 10px;
496
+ font-size: 22px;
497
+ color: darkgrey;
498
+ border-style: solid;
499
+ text-align: center;
500
+ margin: 0 4px 0 0;
501
+ border-top-left-radius: 8px;
502
+ border-top-right-radius: 8px;
503
+ cursor: pointer;
504
+ }
505
+ .wppa-master-tabs li {
506
+ border-color: darkgrey;
507
+ border-width: 1px;
508
+ float: left;
509
+ background-color: white;
510
+ padding: 8px 10px;
511
+ font-size: 22px;
512
+ color: darkgrey;
513
+ border-style: solid;
514
+ text-align: center;
515
+ margin: 0 4px 6px 0;
516
+ border-radius: 8px;
517
+ cursor: pointer;
518
+ }
519
+ #wppa-setting-tab-99 {
520
+ float: right;
521
+ }
522
+ .wppa-tabdesc h3 {
523
+ margin: 0 0 9px 0;
524
+ padding: 6px 0 0 0;
525
+ }
526
+ .wppa-master-tabs .active {
527
+ color: black;
528
+ background-color:#dddddd;
529
+ }
530
+ .wppa-setting-tabs .active {
531
+ color: black;
532
+ border-bottom-color: white;
533
+ background-color:#dddddd;
534
+ }
535
+ #wppa-setting-content {
536
+ clear:both;
537
+ background-color: white;
538
+ border-left:1px solid black;
539
+ border-right:1px solid black;
540
+ border-bottom:1px solid black;
541
+ position:relative;
542
+ top:24px;
543
+ border-color:darkgrey;
544
+ margin-bottom:12px;
545
+ }
546
+ .wppa-colorbox {
547
+ height: 28px !important;
548
+ }
549
+ .wppa-doit-button {
550
+ float:left;
551
+ border-radius:3px;
552
+ font-size: 11px !important;
553
+ margin: 0 4px;
554
+ padding: 0 6px;
555
+ border: 1px solid darkgrey !important;
556
+ }
557
+ </style>';
558
+ }
559
+
560
  // Any tab set? else default general
561
  $tab = wppa_get( 'tab', 'general' );
562
  $subtab = wppa_get( 'subtab', '0' );
692
 
693
  // The js
694
  {
695
+ echo '
696
+ <script>
697
+ function wppaSettingTab(tab) {
698
  jQuery(".wppa-setting-tabs li").removeClass("active");
699
  jQuery("#wppa-setting-tab-"+tab).addClass("active");
700
  if ( tab == 99 ) {
786
  if (jQuery(".' . $subtab . '").attr("data-inactive") == "1") jQuery(".' . $subtab . '").trigger("click");
787
  },100)});' : ''
788
  ) .
789
+ ( $tab == 'watermark' ? 'jQuery(document).ready(function(){wppaCheckFontPreview();});' : '' ) . '
790
+ </script>';
 
791
  }
792
 
793
  // Open the content area
1347
  wppa_setting_new($slug, '9', $name, $desc, $html, $help);
1348
 
1349
  wppa_setting_box_footer_new();
1350
+ echo '
1351
+ <script type="text/javascript" >
1352
+ wppaAjaxGetSpinnerHtml( "normal", "wppa-spin-pre-1" );
1353
+ wppaAjaxGetSpinnerHtml( "lightbox", "wppa-spin-pre-2" );
1354
+ </script>';
1355
  }
1356
  // Multimedia icon and stubfile specifications
1357
  if ( wppa_switch( 'enable_audio' ) || wppa_switch( 'enable_video' ) || wppa_switch( 'enable_pdf' ) )
3748
  $html = wppa_select( $slug, $opts, $vals, $onchange ) .
3749
  '&nbsp;&nbsp;<img id="wppa-cursor" src="'.wppa_get_imgdir().wppa_opt( substr( $slug, 5 ) ).'" />';
3750
  wppa_setting_new($slug, '14', $name, $desc, $html, $help);
3751
+ echo '<script>'.$onchange.'</script>';
3752
 
3753
  $name = __('Border width', 'wp-photo-album-plus');
3754
  $desc = __('Border width for lightbox display.', 'wp-photo-album-plus');
3975
  $html = wppa_checkbox($slug);
3976
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
3977
 
3978
+ $name = __('Comment db agreement', 'wp-photo-album-plus');
3979
+ $desc = __('User needs to tick a checkbox to agree db storage', 'wp-photo-album-plus');
3980
+ $help = '';
3981
+ $slug = 'wppa_comment_need_db_agree';
3982
+ $html = wppa_checkbox($slug);
3983
+ wppa_setting_new($slug, '11', $name, $desc, $html, $help);
3984
+
3985
  $name = __('Comment needs vote', 'wp-photo-album-plus');
3986
  $desc = __('User needs to give a rating to get his comment published', 'wp-photo-album-plus');
3987
  $help = '';
5893
  $slug = 'wppa_ajax_upload_method';
5894
  $opts = array( __('normal', 'wp-photo-album-plus'),
5895
  __('backend', 'wp-photo-album-plus'),
5896
+ __('extern', 'wp-photo-album-plus'),
5897
  );
5898
+ $vals = array( 'normal', 'backend', 'extern' );
5899
  $html = wppa_select($slug, $opts, $vals);
5900
  wppa_setting_new($slug, '5.1', $name, $desc, $html, $help, wppa_switch( 'ajax_upload' ));
5901
 
6532
  $help = __('Only change this setting when there are links that do not work', 'wp-photo-album-plus');
6533
  $slug = 'wppa_ajax_method';
6534
  $opts = array( __('Normal', 'wp-photo-album-plus'),
6535
+ __('Classic', 'wp-photo-album-plus'),
6536
  // __('Frontend and Backend: Frontend method', 'wp-photo-album-plus'),
6537
  __('Frontend and Backend: Backend method', 'wp-photo-album-plus'),
6538
  __('Frontend: none, Backend: Backend method', 'wp-photo-album-plus'),
6539
  );
6540
  $vals = array( 'normal',
6541
+ 'extern',
6542
  // 'wppaajax',
6543
  'admin',
6544
  'none',
6584
  $vals = array('none', 'top', 'bottom', 'both');
6585
  $html = wppa_select($slug, $opts, $vals);
6586
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
6587
+
6588
  $name = __('Defer javascript', 'wp-photo-album-plus');
6589
  $desc = __('Put javascript near the end of the page.', 'wp-photo-album-plus');
6590
  $help = (__('If checkd: May fix layout problems and broken slideshows. May speed up or slow down page appearing.', 'wp-photo-album-plus'));
6591
  $slug = 'wppa_defer_javascript';
6592
  $html = wppa_checkbox($slug);
6593
  wppa_setting_new($slug, '11', $name, $desc, $html, $help);
6594
+
6595
  global $wppa_setting_error;
6596
  $wppa_setting_error = true;
6597
 
 
6598
  $name = __('Custom style', 'wp-photo-album-plus');
6599
  $desc = __('Enter custom style specs here.', 'wp-photo-album-plus');
6600
  $help = __('Please move custom css to the wp customizer. WPPA Custom css will be discontinued in a near future revision.', 'wp-photo-album-plus');
6643
  $slug = 'wppa_custom_style_opera';
6644
  $html = wppa_textarea($slug, $name);
6645
  wppa_setting_new($slug, '19', $name, $desc, $html, $help, wppa_opt( 'custom_style_opera' ) != '' );
6646
+
6647
  $wppa_setting_error = false;
6648
 
6649
  $name = __('Use customized style file', 'wp-photo-album-plus');
6853
  $html = wppa_select($slug, $opts, $vals, '');
6854
  wppa_setting_new($slug, '42', $name, $desc, $html, $help);
6855
 
 
 
 
 
 
 
 
6856
  wppa_setting_box_footer_new();
6857
  }
6858
  }
10249
  if ( function_exists( 'wppa_get_cloudinary_usage' ) && wppa_opt( 'cdn_cloud_name' ) ) {
10250
  $data = wppa_get_cloudinary_usage();
10251
  if ( is_array( $data ) ) {
10252
+ $desc = '<style type="text/css" scoped>table, tbody, tr, td { margin:0; padding:0; border:none; font-size: 9px; line-height: 11px; } td { height:11px; }</style>';
10253
+ $desc .= '<table style="margin:0;padding:0;border:none:" ><tbody>';
10254
  foreach ( array_keys( $data ) as $i ) {
10255
  $item = $data[$i];
10256
  if ( is_array( $item ) ) {
10306
 
10307
  if ( wppa_switch( 'fotomoto_on' ) ) {
10308
 
10309
+ $name = __('Fotomoto fontsize', 'wp-photo-album-plus');
10310
+ $desc = __('Fontsize for the Fotomoto toolbar.', 'wp-photo-album-plus');
10311
+ $help = __('If you set it here, it overrules a possible setting for font-size in .FotomotoToolbarClass on the Fotomoto dashboard.', 'wp-photo-album-plus');
10312
+ $slug = 'wppa_fotomoto_fontsize';
10313
+ $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus'));
10314
+ wppa_setting_new($slug, '10', $name, $desc, $html, $help);
10315
+
10316
  $name = __('Hide when running', 'wp-photo-album-plus');
10317
  $desc = __('Hide toolbar on running slideshows', 'wp-photo-album-plus');
10318
  $help = __('The Fotomoto toolbar will re-appear when the slideshow stops.', 'wp-photo-album-plus');
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 8.1.00.001
7
  *
8
  */
9
 
@@ -296,7 +296,6 @@ global $wppa_error;
296
  if ( $old_rev <= '8004004' ) {
297
  $wpdb->query( "UPDATE $wpdb->wppa_albums SET status = 'publish' WHERE status = ''" );
298
  }
299
-
300
  }
301
 
302
  // Check required directories
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 8.0.08.007
7
  *
8
  */
9
 
296
  if ( $old_rev <= '8004004' ) {
297
  $wpdb->query( "UPDATE $wpdb->wppa_albums SET status = 'publish' WHERE status = ''" );
298
  }
 
299
  }
300
 
301
  // Check required directories
wppa-slideshow.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
- * Version 8.1.00.005
8
  *
9
  */
10
 
@@ -487,7 +487,7 @@ function wppa_slide_frame() {
487
  'box-shadow:none;' .
488
  'cursor:default;' .
489
  '"' .
490
- ' onmouseover="function x(){if(wppaBbb)wppaBbb('.wppa( 'mocc' ).',\'l\',\'show\')}"' .
491
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'l\',\'hide\')"' .
492
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'l\',\'click\')"' .
493
  ' />' .
@@ -508,7 +508,7 @@ function wppa_slide_frame() {
508
  'box-shadow:none;' .
509
  'cursor:default;' .
510
  '"' .
511
- ' onmouseover="function x(){if(wppaBbb)wppaBbb('.wppa( 'mocc' ).',\'r\',\'show\')}"' .
512
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'r\',\'hide\')"' .
513
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'r\',\'click\')"' .
514
  ' />'
@@ -731,7 +731,13 @@ function wppa_slide_custom( $opt = '' ) {
731
  $f_on_this = ! wppa( 'in_widget' ) && fotomoto_page_enabled( wppa_get_the_ID() );
732
  }
733
  if ( wppa_switch( 'fotomoto_on' ) && $f_on_this ) {
 
 
 
 
 
734
  $content = str_replace( 'w#fotomoto',
 
735
  '<div' .
736
  ' id="wppa-fotomoto-container-'.wppa( 'mocc' ).'"' .
737
  ' class="wppa-fotomoto-container"' .
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
+ * Version 8.0.07.015
8
  *
9
  */
10
 
487
  'box-shadow:none;' .
488
  'cursor:default;' .
489
  '"' .
490
+ ' onmouseover="wppaBbb('.wppa( 'mocc' ).',\'l\',\'show\')"' .
491
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'l\',\'hide\')"' .
492
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'l\',\'click\')"' .
493
  ' />' .
508
  'box-shadow:none;' .
509
  'cursor:default;' .
510
  '"' .
511
+ ' onmouseover="wppaBbb('.wppa( 'mocc' ).',\'r\',\'show\')"' .
512
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'r\',\'hide\')"' .
513
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'r\',\'click\')"' .
514
  ' />'
731
  $f_on_this = ! wppa( 'in_widget' ) && fotomoto_page_enabled( wppa_get_the_ID() );
732
  }
733
  if ( wppa_switch( 'fotomoto_on' ) && $f_on_this ) {
734
+ $fontsize = wppa_opt( 'fotomoto_fontsize' );
735
+ if ( $fontsize ) {
736
+ $s = '<style>.FotomotoToolbarClass{font-size:' . wppa_opt( 'fotomoto_fontsize' ) . 'px !important;}</style>';
737
+ }
738
+ else $s = '';
739
  $content = str_replace( 'w#fotomoto',
740
+ $s .
741
  '<div' .
742
  ' id="wppa-fotomoto-container-'.wppa( 'mocc' ).'"' .
743
  ' class="wppa-fotomoto-container"' .
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 8.1.00.006
7
  /*
8
  */
9
 
@@ -12,7 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
12
  // Create dynamic css
13
  function wppa_create_wppa_dynamic_css() {
14
 
15
- $the_css = '
 
 
16
  .wppa-box { ' .
17
  ( wppa_opt( 'bwidth' ) > '0' ? 'border-style: solid; border-width:' . wppa_opt( 'bwidth' ) . 'px; ' : '' ) .
18
  ( wppa_opt( 'bradius' ) > '0' ? 'border-radius:' . wppa_opt( 'bradius' ) . 'px; -moz-border-radius:' . wppa_opt( 'bradius' ) . 'px; ' : '' ) .
@@ -75,11 +77,19 @@ function wppa_create_wppa_dynamic_css() {
75
 
76
  // Add miscellaneous styles
77
  if ( ! wppa_switch( 'show_pname' ) ) {
78
- $the_css .= '
79
  .bc-pname { display:none; }';
80
  }
81
 
82
- return $the_css;
 
 
 
 
 
 
 
 
83
 
84
  }
85
 
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 8.0.07.007
7
  /*
8
  */
9
 
12
  // Create dynamic css
13
  function wppa_create_wppa_dynamic_css() {
14
 
15
+ $result = '
16
+ <!-- WPPA+ dynamic css -->
17
+ <style type="text/css" >
18
  .wppa-box { ' .
19
  ( wppa_opt( 'bwidth' ) > '0' ? 'border-style: solid; border-width:' . wppa_opt( 'bwidth' ) . 'px; ' : '' ) .
20
  ( wppa_opt( 'bradius' ) > '0' ? 'border-radius:' . wppa_opt( 'bradius' ) . 'px; -moz-border-radius:' . wppa_opt( 'bradius' ) . 'px; ' : '' ) .
77
 
78
  // Add miscellaneous styles
79
  if ( ! wppa_switch( 'show_pname' ) ) {
80
+ $result .= '
81
  .bc-pname { display:none; }';
82
  }
83
 
84
+ // Add custom style
85
+ $result .= wppa_opt( 'custom_style' );
86
+
87
+ $result .= '
88
+ </style>
89
+ <!-- END WPPA+ dynamic css -->
90
+ ';
91
+
92
+ return $result;
93
 
94
  }
95
 
wppa-tinymce-common.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-tinymce-common.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.1.00.004
6
  *
7
  */
8
 
@@ -21,6 +21,80 @@ global $wpdb;
21
  $result =
22
  '<div id="wppaphoto-form" title="' . esc_attr( __( 'Insert photo', 'wp-photo-album-plus' ) ) . '" >';
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  // Open table
25
  $result .=
26
  '
@@ -44,8 +118,8 @@ global $wpdb;
44
  '<small class="wppamyphoto-photo" >'.
45
  __('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
46
  sprintf( __('You can select one of your photos from a maximum of %d most recently added', 'wp-photo-album-plus'), wppa_opt( 'generator_max' ) ).'<br />'.
47
- '</small>' .
48
- '</td>' .
49
  '</tr>' .
50
 
51
  // Photo selection max 100 of all photos
2
  /* wppa-tinymce-common.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 7.4.02
6
  *
7
  */
8
 
21
  $result =
22
  '<div id="wppaphoto-form" title="' . esc_attr( __( 'Insert photo', 'wp-photo-album-plus' ) ) . '" >';
23
 
24
+ // Front/back end dependant css
25
+ if ( $front ) {
26
+ $result .= '
27
+ <style>
28
+ #wppaphoto-table {
29
+ box-sizing:border-box; width:100% !important;
30
+ }
31
+ .wppa-bar {
32
+ background-color: #7f7;
33
+ width:0%;
34
+ height:18px;
35
+ border-radius: 3px;
36
+ line-height: 18px;
37
+ margin: 0;
38
+ }
39
+ .wppa-percent {
40
+ position:relative;
41
+ display:inline-block;
42
+ top:-19px;
43
+ font-size: 12px;
44
+ line-height: 18px;
45
+ margin: 0;
46
+ }
47
+ .wppa-message {
48
+ clear: both;
49
+ }
50
+ #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
51
+ padding: 2px; 0;
52
+ }
53
+ #wppaphoto-table th {
54
+ width:200px;
55
+ }
56
+ #wppaphoto-table input {
57
+ padding:4px;
58
+ }
59
+ #wppaphoto-table th, #wppaphoto-table td {
60
+ border:none;
61
+ }
62
+ #wppaphoto-shortcode-preview-container {
63
+ width:500px !important;
64
+ }
65
+ </style>';
66
+ }
67
+ else {
68
+ $result .= '
69
+ <style>
70
+ #TB_ajaxContent {
71
+ box-sizing:border-box; width:100% !important;
72
+ }
73
+ .wppa-bar {
74
+ background-color: #7f7;
75
+ width:0%;
76
+ height:18px;
77
+ border-radius: 3px;
78
+ line-height: 18px;
79
+ margin: 0;
80
+ }
81
+ .wppa-percent {
82
+ position:relative;
83
+ display:inline-block;
84
+ top:-19px;
85
+ font-size: 12px;
86
+ line-height: 18px;
87
+ margin: 0;
88
+ }
89
+ .wppa-message {
90
+ clear: both;
91
+ }
92
+ #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
93
+ padding: 2px; 0;
94
+ }
95
+ </style>';
96
+ }
97
+
98
  // Open table
99
  $result .=
100
  '
118
  '<small class="wppamyphoto-photo" >'.
119
  __('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
120
  sprintf( __('You can select one of your photos from a maximum of %d most recently added', 'wp-photo-album-plus'), wppa_opt( 'generator_max' ) ).'<br />'.
121
+ '</small>'.
122
+ '</td>'.
123
  '</tr>' .
124
 
125
  // Photo selection max 100 of all photos
wppa-tinymce-shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-tinymce-shortcodes.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.1.00.004
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) )
@@ -89,7 +89,23 @@ global $wpdb;
89
 
90
  // Make the html
91
  $result =
 
 
 
 
 
 
 
 
 
 
 
92
  '<div id="wppagallery-form" title="' . esc_attr( __( 'Insert gallery', 'wp-photo-album-plus' ) ) . '" >'.
 
 
 
 
 
93
  '<table id="wppagallery-table" class="form-table">'.
94
 
95
  // Top type selection
2
  /* wppa-tinymce-shortcodes.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.0.00.011
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) )
89
 
90
  // Make the html
91
  $result =
92
+ '<style>
93
+ #TB_ajaxContent {
94
+ box-sizing:border-box; width:100% !important;
95
+ }
96
+ #wppagallery-table select {
97
+ max-width:540px;
98
+ }
99
+ #wppagallery-table option {
100
+ color: #070;
101
+ }
102
+ </style>'.
103
  '<div id="wppagallery-form" title="' . esc_attr( __( 'Insert gallery', 'wp-photo-album-plus' ) ) . '" >'.
104
+ '<style type="text/css">'.
105
+ '#wppagallery-table tr, #wppagallery-table th, #wppagallery-table td {'.
106
+ 'padding: 2px; 0;'.
107
+ '}'.
108
+ '</style>'.
109
  '<table id="wppagallery-table" class="form-table">'.
110
 
111
  // Top type selection
wppa-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
- * Version 8.1.00.001
7
  *
8
  */
9
 
@@ -22,18 +22,25 @@ global $upload_album;
22
  $user = wppa_get_user();
23
 
24
  // Sanitize album input
25
- $upload_album = wppa_get( 'album', '0', 'int' );
 
 
 
 
 
26
 
27
  // Update watermark settings for the user if new values supplied
28
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
29
 
30
  // File
31
- if ( wppa_get( 'watermark-file' ) ) {
32
 
33
  // Sanitize input
34
- $watermark_file = sanitize_file_name( wppa_get( 'watermark-file' ), 'nil' );
35
- if ( stripos( $watermark_file, '.png' ) === false ) {
36
-
 
 
37
  if ( ! in_array( $watermark_file, array( '--- none ---', '---name---', '---filename---', '---description---', '---predef---' ) ) ) {
38
  $watermark_file = 'nil';
39
  }
@@ -44,11 +51,10 @@ global $upload_album;
44
  }
45
 
46
  // Position
47
- if ( wppa_get( 'watermark-pos' ) ) {
48
 
49
  // Sanitize input
50
- $watermark_pos = wppa_get( 'watermark-pos', 'nil' );
51
-
52
  if ( ! in_array( $watermark_pos, array( 'toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht' ) ) ) {
53
  $watermark_pos = 'nil';
54
  }
@@ -67,10 +73,11 @@ global $upload_album;
67
  }
68
 
69
  // Do the upload if requested
70
- if ( wppa_get( 'upload-multiple', false, 'bool' ) ) {
 
71
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
72
  wppa_upload_multiple();
73
- if ( wppa_get( 'go-edit-multiple', false, 'bool' ) ) {
74
  if ( current_user_can( 'wppa_admin' ) ) {
75
  wppa_ok_message( __( 'Connecting to edit album...' , 'wp-photo-album-plus' ) ); ?>
76
  <script type="text/javascript" >
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
+ * Version 8.0.09.001
7
  *
8
  */
9
 
22
  $user = wppa_get_user();
23
 
24
  // Sanitize album input
25
+ if ( isset( $_POST['wppa-album'] ) ) {
26
+ $upload_album = strval( intval( $_POST['wppa-album'] ) );
27
+ }
28
+ else {
29
+ $upload_album = null;
30
+ }
31
 
32
  // Update watermark settings for the user if new values supplied
33
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
34
 
35
  // File
36
+ if ( isset( $_POST['wppa-watermark-file'] ) ) {
37
 
38
  // Sanitize input
39
+ $watermark_file = $_POST['wppa-watermark-file'];
40
+ if ( stripos( $watermark_file, '.png' ) !== false ) {
41
+ $watermark_file = sanitize_file_name( $watermark_file );
42
+ }
43
+ else {
44
  if ( ! in_array( $watermark_file, array( '--- none ---', '---name---', '---filename---', '---description---', '---predef---' ) ) ) {
45
  $watermark_file = 'nil';
46
  }
51
  }
52
 
53
  // Position
54
+ if ( isset( $_POST['wppa-watermark-pos'] ) ) {
55
 
56
  // Sanitize input
57
+ $watermark_pos = $_POST['wppa-watermark-pos'];
 
58
  if ( ! in_array( $watermark_pos, array( 'toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht' ) ) ) {
59
  $watermark_pos = 'nil';
60
  }
73
  }
74
 
75
  // Do the upload if requested
76
+ // From BOX A
77
+ if ( isset( $_POST['wppa-upload-multiple'] ) ) {
78
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
79
  wppa_upload_multiple();
80
+ if ( isset( $_POST['wppa-go-edit-multiple'] ) ) {
81
  if ( current_user_can( 'wppa_admin' ) ) {
82
  wppa_ok_message( __( 'Connecting to edit album...' , 'wp-photo-album-plus' ) ); ?>
83
  <script type="text/javascript" >
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 8.1.00.007
7
  *
8
  */
9
 
@@ -191,10 +191,16 @@ global $wppa_supported_stereo_types;
191
  if ( wppa_is_stereo( $id ) ) {
192
 
193
  // Get type from cookie
194
- $st = wppa_get_cookie( 'stereotype', '_flat' );
 
 
 
195
 
196
  // Get glass from cookie
197
- $sg = ( wppa_get( 'stereoglass' ) == 'greenmagenta' ? 'gm' : 'rc' );
 
 
 
198
 
199
  // Create the file if not present
200
  if ( ! is_file( wppa_get_stereo_path( $id, $st, $sg ) ) ) {
@@ -315,22 +321,20 @@ global $wppa;
315
  $wppa['geo'] .= '<div id="geodiv-' . wppa( 'mocc' ) . '-' . $id . '" style="display:none;">' . $geo . '</div>';
316
  break;
317
  case 'wppa-plus-embedded':
318
- $the_js = '';
319
  if ( $wppa['geo'] == '' ) { // First
320
  $wppa['geo'] = '
321
- <div id="map-canvas-' . wppa( 'mocc' ).'"
322
- style="height:' . wppa_opt( 'map_height' ) . 'px; width:100%; padding:0; margin:0; font-size: 10px;" >
323
- </div>';
324
- $the_js .= '
325
- _wppaLat[' . wppa( 'mocc' ) . '] = [];
326
- _wppaLon[' . wppa( 'mocc' ) . '] = [];';
327
  } // End first
328
-
329
- $the_js .= '
330
- _wppaLat[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lat . ';
331
- _wppaLon[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lon . ';';
332
-
333
- wppa_js( $the_js );
334
  break; // End native
335
  case 'none':
336
  break;
@@ -3810,40 +3814,68 @@ function wppa_get_mime_type( $id ) {
3810
  return $result;
3811
  }
3812
 
3813
- // Test if a given url is to a photo file, possibly adjust url extension
3814
  function wppa_is_url_a_photo( &$url, $save = true ) {
3815
  global $wppa_supported_photo_extensions;
3816
  global $wppa_session;
3817
 
3818
- // Init
3819
- $result = true;
3820
- $ext = wppa_get_ext( $url );
3821
- $urlnoext = wppa_strip_ext( $url );
3822
 
3823
- // Try all supported extensions
3824
- foreach( $wppa_supported_photo_extensions as $ext ) {
 
 
 
 
3825
 
3826
- $url = $urlnoext . '.' . $ext;
 
 
3827
 
3828
- // Use wp HTTP API to retrieve the photo
3829
- $response = wp_remote_get( $url );
3830
- $result = wp_remote_retrieve_body( $response );
3831
- $httpcode = wp_remote_retrieve_response_code( $response );
 
 
3832
 
3833
- // Done, save image optionally
3834
- if ( $httpcode == 200 ) {
 
 
3835
 
3836
- if ( $save ) {
 
3837
 
3838
- $path = WPPA_DEPOT_PATH . '/' . basename( wppa_compress_tree_path( $url ) );
3839
- wppa_put_contents( $path, $result );
3840
- }
3841
- return true;
 
 
 
 
3842
  }
 
 
 
 
3843
  }
3844
 
3845
- // No
3846
- return false;
 
 
 
 
 
 
 
 
 
3847
  }
3848
 
3849
  function wppa_get_like_title_a( $id ) {
@@ -3934,33 +3966,43 @@ function wppa_create_qrcode_cache( $url, $size = '80' ) {
3934
 
3935
  // In cache already?
3936
  $key = md5( $qrsrc );
3937
- $qr_image_path = WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg';
3938
- $qr_image_url = WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3939
-
3940
- if ( is_file( $qr_image_path ) ) {
3941
 
3942
  // Bump cache found counter
3943
  update_option( 'wppa_qr_cache_hits', wppa_get_option( 'wppa_qr_cache_hits', 0 ) + 1 );
3944
- return $qr_image_url;
3945
  }
3946
 
3947
  // Bump cache miss counter
3948
  update_option( 'wppa_qr_cache_miss', wppa_get_option( 'wppa_qr_cache_miss', 0 ) + 1 );
3949
 
3950
  // Catch the qr image
3951
- $response = wp_remote_get( $qrsrc );
3952
- $contents = wp_remote_retrieve_body( $response );
3953
- $httpcode = wp_remote_retrieve_response_code( $response );
3954
-
3955
- // On success, save the image and return the url to the image
3956
- if ( $httpcode == 200 ) {
3957
-
3958
- wppa_put_contents( $qr_image_path, $contents );
3959
- return $qr_image_url;
 
 
 
 
 
 
 
 
 
3960
  }
3961
 
3962
- // Failed, return qr source url
3963
- return $qrsrc;
 
 
 
 
3964
  }
3965
 
3966
 
@@ -4831,6 +4873,46 @@ function wppa_is_panorama( $id ) {
4831
  return $result;
4832
  }
4833
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4834
  // Rename all files inside a tree to their sanitized name (recursive)
4835
  function wppa_rename_files_sanitized( $root ) {
4836
 
@@ -4948,6 +5030,7 @@ function wppa_compress_html( $txt ) {
4948
  $result = str_replace( " ", " ", $result );
4949
  $result = str_replace( '> <', '><', $result );
4950
  $result = str_replace( '<ul></ul>', '', $result );
 
4951
  $result = str_replace( '<!--', "\n<!--", $result );
4952
 
4953
  return $result;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 8.0.10.005
7
  *
8
  */
9
 
191
  if ( wppa_is_stereo( $id ) ) {
192
 
193
  // Get type from cookie
194
+ $st = isset( $_COOKIE["stereotype"] ) ? $_COOKIE["stereotype"] : 'color';
195
+ if ( ! in_array( $st, $wppa_supported_stereo_types ) ) {
196
+ $st = '_flat';
197
+ }
198
 
199
  // Get glass from cookie
200
+ $sg = 'rc';
201
+ if ( isset( $_COOKIE["stereoglass"] ) && $_COOKIE["stereoglass"] == 'greenmagenta' ) {
202
+ $sg = 'gm';
203
+ }
204
 
205
  // Create the file if not present
206
  if ( ! is_file( wppa_get_stereo_path( $id, $st, $sg ) ) ) {
321
  $wppa['geo'] .= '<div id="geodiv-' . wppa( 'mocc' ) . '-' . $id . '" style="display:none;">' . $geo . '</div>';
322
  break;
323
  case 'wppa-plus-embedded':
 
324
  if ( $wppa['geo'] == '' ) { // First
325
  $wppa['geo'] = '
326
+ <div id="map-canvas-' . wppa( 'mocc' ).'" style="height:' . wppa_opt( 'map_height' ) . 'px; width:100%; padding:0; margin:0; font-size: 10px;" ></div>
327
+ <script>
328
+ if ( typeof ( _wppaLat ) == "undefined" ) { var _wppaLat = new Array(); var _wppaLon = new Array(); }
329
+ if ( typeof ( _wppaRealId ) == "undefined" ) { var _wppaRealId = new Array(); }
330
+ _wppaLat[' . wppa( 'mocc' ) . '] = new Array(); _wppaLon[' . wppa( 'mocc' ) . '] = new Array();
331
+ </script>';
332
  } // End first
333
+ $wppa['geo'] .= '
334
+ <script>
335
+ _wppaLat[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lat . ';
336
+ _wppaLon[' . wppa( 'mocc' ) . '][' . $id.'] = ' . $lon . ';
337
+ </script>';
 
338
  break; // End native
339
  case 'none':
340
  break;
3814
  return $result;
3815
  }
3816
 
3817
+ // Test if a given url is to a photo file
3818
  function wppa_is_url_a_photo( &$url, $save = true ) {
3819
  global $wppa_supported_photo_extensions;
3820
  global $wppa_session;
3821
 
3822
+ // Been here before?
3823
+ if ( isset( $wppa_session['rem_url'][$url] ) ) {
3824
+ return $wppa_session['rem_url'][$url];
3825
+ }
3826
 
3827
+ // Check existence
3828
+ if ( ! wppa_remote_file_exists( $url, $save ) ) {
3829
+ $wppa_session['rem_url'][$url] = false;
3830
+ if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3831
+ return false;
3832
+ }
3833
 
3834
+ // Init
3835
+ $result = true;
3836
+ $ext = wppa_get_ext( $url );
3837
 
3838
+ // If the url does not have a valid photo extension, its not a photo file
3839
+ if ( ! in_array( $ext, $wppa_supported_photo_extensions ) ) {
3840
+ $wppa_session['rem_url'][$url] = false;
3841
+ if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3842
+ return false;
3843
+ }
3844
 
3845
+ // Using curl may be protected/limited
3846
+ // Use curl to see if the url is found to prevent a php warning
3847
+ /* experimental */
3848
+ if ( function_exists( 'curl_init' ) && false ) {
3849
 
3850
+ // Create a curl handle to the expected photofile
3851
+ $ch = curl_init( $url );
3852
 
3853
+ // Execute
3854
+ curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
3855
+ curl_setopt( $ch, CURLOPT_FAILONERROR, true );
3856
+ curl_exec( $ch );
3857
+
3858
+ // Check if HTTP code > 400 i.e. error 22 occurred
3859
+ if( curl_errno( $ch ) == 22 ) {
3860
+ $result = false;
3861
  }
3862
+
3863
+ // Close handle
3864
+ curl_close($ch);
3865
+
3866
  }
3867
 
3868
+ // No curl on system, or do not use curl
3869
+ else {
3870
+
3871
+ // getimagesize on a non imagefile produces a php warning
3872
+ $result = is_array( @ getimagesize( $url ) );
3873
+ }
3874
+
3875
+ // Done
3876
+ $wppa_session['rem_url'][$url] = $result;
3877
+ if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3878
+ return $result;
3879
  }
3880
 
3881
  function wppa_get_like_title_a( $id ) {
3966
 
3967
  // In cache already?
3968
  $key = md5( $qrsrc );
3969
+ if ( is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
 
 
 
3970
 
3971
  // Bump cache found counter
3972
  update_option( 'wppa_qr_cache_hits', wppa_get_option( 'wppa_qr_cache_hits', 0 ) + 1 );
3973
+ return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3974
  }
3975
 
3976
  // Bump cache miss counter
3977
  update_option( 'wppa_qr_cache_miss', wppa_get_option( 'wppa_qr_cache_miss', 0 ) + 1 );
3978
 
3979
  // Catch the qr image
3980
+ $curl = curl_init();
3981
+ curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
3982
+ curl_setopt( $curl, CURLOPT_URL, $qrsrc );
3983
+ $contents = curl_exec( $curl );
3984
+ curl_close( $curl );
3985
+
3986
+ // Save the image
3987
+ if ( strlen( $contents ) > 1000 ) {
3988
+
3989
+ wppa_put_contents( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', $contents );
3990
+
3991
+ /*
3992
+ $file = wppa _fopen( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', 'w' );
3993
+ if ( $file ) {
3994
+ fwrite( $file, $contents, strlen( $contents ) );
3995
+ fclose( $file );
3996
+ }
3997
+ */
3998
  }
3999
 
4000
+ if ( wppa_is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
4001
+ return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
4002
+ }
4003
+ else {
4004
+ return $qrsrc;
4005
+ }
4006
  }
4007
 
4008
 
4873
  return $result;
4874
  }
4875
 
4876
+ // See if a remote file exists
4877
+ function wppa_remote_file_exists( &$url, $save = true ) {
4878
+
4879
+ $orig_url = $url;
4880
+ $ext = wppa_get_ext( $url );
4881
+ $url_1 = wppa_strip_ext( $url );
4882
+ $exts = array( 'jpg', 'png', 'jpeg' );
4883
+
4884
+ for ( $i=1; $i<4; $i++ ) { // Give it four tries
4885
+ foreach( $exts as $ext ) { // Try all possible extensions
4886
+
4887
+ $url = $url_1 . '.' . $ext;
4888
+ $ch = curl_init( $url );
4889
+ $options = array(
4890
+ CURLOPT_NOBODY => true,
4891
+ CURLOPT_SSL_VERIFYPEER => true,
4892
+ );
4893
+ curl_setopt_array( $ch, $options );
4894
+ curl_exec( $ch );
4895
+ $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
4896
+ curl_close( $ch );
4897
+ wppa_log( 'dbg', 'curl_exec() returned {b}' . $httpCode . '{/b} for ' . $url );
4898
+ if ( $httpCode == 200 ) {
4899
+ $path = WPPA_DEPOT_PATH . '/' . basename( wppa_compress_tree_path( $url ) );
4900
+ if ( ! wppa_is_file( $path ) || ! wppa_filesize( $path ) ) {
4901
+ $data = file_get_contents( $url );
4902
+ if ( $save ) {
4903
+ file_put_contents( $path, $data );
4904
+ wppa_log( 'dbg', basename( $path ) . ' saved by wppa_remote_file_exists()' );
4905
+ }
4906
+ }
4907
+ return true;
4908
+ }
4909
+ }
4910
+ sleep( 1 ); // Wait a second, may help sometimes
4911
+ }
4912
+ $url = $orig_url;
4913
+ return false;
4914
+ }
4915
+
4916
  // Rename all files inside a tree to their sanitized name (recursive)
4917
  function wppa_rename_files_sanitized( $root ) {
4918
 
5030
  $result = str_replace( " ", " ", $result );
5031
  $result = str_replace( '> <', '><', $result );
5032
  $result = str_replace( '<ul></ul>', '', $result );
5033
+ $result = str_replace( '</script><script>', '', $result );
5034
  $result = str_replace( '<!--', "\n<!--", $result );
5035
 
5036
  return $result;
wppa-wrappers.php CHANGED
@@ -466,8 +466,7 @@ function wppa_put_contents( $path, $contents, $log = true ) {
466
  // Read an entire file
467
  function wppa_get_contents( $file ) {
468
 
469
- // May be inside wp-content, may not be remote
470
- if ( ! wppa_is_path_safe( $file, true, false ) ) {
471
  wppa_log( 'Err', 'Unsafe path detected in wppa_get_contents(): ' . wppa_shortpath( $path ), true );
472
  return false;
473
  }
@@ -498,7 +497,7 @@ function wppa_get_contents_array( $path, $log = true ) {
498
  }
499
 
500
  // Utility to check if a given full filepath is safe to manipulate upon
501
- function wppa_is_path_safe( $path, $wp_content = false, $may_remote = true ) {
502
  global $wppa_lang;
503
  global $wppa_log_file;
504
 
@@ -509,10 +508,10 @@ global $wppa_log_file;
509
 
510
  // Safe protocols
511
  if ( strpos( strtolower( $path ), 'http://' ) === 0 ) {
512
- return $may_remote;
513
  }
514
  if ( strpos( strtolower( $path ), 'https://' ) === 0 ) {
515
- return $may_remote;
516
  }
517
 
518
  // During activation/setup
466
  // Read an entire file
467
  function wppa_get_contents( $file ) {
468
 
469
+ if ( ! wppa_is_path_safe( $file ) ) {
 
470
  wppa_log( 'Err', 'Unsafe path detected in wppa_get_contents(): ' . wppa_shortpath( $path ), true );
471
  return false;
472
  }
497
  }
498
 
499
  // Utility to check if a given full filepath is safe to manipulate upon
500
+ function wppa_is_path_safe( $path, $wp_content = false ) {
501
  global $wppa_lang;
502
  global $wppa_log_file;
503
 
508
 
509
  // Safe protocols
510
  if ( strpos( strtolower( $path ), 'http://' ) === 0 ) {
511
+ return true;
512
  }
513
  if ( strpos( strtolower( $path ), 'https://' ) === 0 ) {
514
+ return true;
515
  }
516
 
517
  // During activation/setup
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: 8.1.00.007
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/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.1.00.007'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
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: 8.0.10.006
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/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.0.10.006'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30