Version Description
= 8.0.10 =
- This version addresses various bug fixes, feature requests and security fixes.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 8.1.00.004 |
Comparing to | |
See all releases |
Code changes from version 8.1.00.003 to 8.1.00.004
- changelog.txt +4 -1
- js/sortable.js +1550 -0
- js/sortable.min.js +9 -0
- js/wppa-admin-scripts.js +151 -30
- js/wppa-admin-scripts.min.js +1 -1
- theme/wppa-style.css +2 -1
- wppa-admin.php +6 -3
- wppa-album-admin-autosave.php +4 -4
- wppa-album-navigator-widget.php +1 -10
- wppa-comment-admin.php +2 -13
- wppa-defaults.php +2 -2
- wppa-filter.php +5 -9
- wppa-maintenance.php +5 -12
- wppa-photo-admin-autosave.php +63 -182
- wppa-scripts.php +8 -11
- wppa-settings-autosave.php +2 -2
- wppa-slideshow.php +3 -3
- wppa.php +2 -2
changelog.txt
CHANGED
@@ -2,7 +2,10 @@ WP Photo Album Plus Changelog
|
|
2 |
|
3 |
= 8.1.00 =
|
4 |
|
5 |
-
*
|
|
|
|
|
|
|
6 |
|
7 |
= 8.0.10 =
|
8 |
|
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 |
|
10 |
= 8.0.10 =
|
11 |
|
js/sortable.js
ADDED
@@ -0,0 +1,1550 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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> </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
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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> </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.
|
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) {
|
@@ -1266,6 +1266,14 @@ function wppaAjaxPopupWindow( slug ) {
|
|
1266 |
jQuery( '.ui-widget-overlay' ).css({
|
1267 |
backgroundColor: 'transparent',
|
1268 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1269 |
}
|
1270 |
}
|
1271 |
|
@@ -1377,7 +1385,6 @@ function wppaEncode(xtext) {
|
|
1377 |
if (idx < temp.length) result += '||PLUS||';
|
1378 |
}
|
1379 |
|
1380 |
-
// alert('encoded result='+result);
|
1381 |
return result;
|
1382 |
}
|
1383 |
|
@@ -1405,6 +1412,7 @@ function wppaGetXmlHttp() {
|
|
1405 |
}
|
1406 |
|
1407 |
function wppaPhotoStatusChange(id) {
|
|
|
1408 |
// Init
|
1409 |
jQuery('#psdesc-'+id).css({display: 'none'});
|
1410 |
if ( ! jQuery('#status-'+id) ) return;
|
@@ -1505,25 +1513,7 @@ function wppaReload(arg) {
|
|
1505 |
document.location.reload( true );
|
1506 |
}
|
1507 |
}
|
1508 |
-
|
1509 |
-
function wppaTrim (str, chr) {
|
1510 |
-
if ( ! chr ) {
|
1511 |
-
*/
|
1512 |
-
// return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
1513 |
-
/* }
|
1514 |
-
else {
|
1515 |
-
// Ltrim
|
1516 |
-
while ( str.substr( 0,1 ) == chr ) {
|
1517 |
-
str = str.substr( 1 );
|
1518 |
-
}
|
1519 |
-
// Rtrim
|
1520 |
-
while ( str.substr( str.length-1, 1 ) == chr ) {
|
1521 |
-
str = str.substr( 0, str.length-1 );
|
1522 |
-
}
|
1523 |
-
}
|
1524 |
-
return str;
|
1525 |
-
}
|
1526 |
-
*/
|
1527 |
var wppaFeCount = 0;
|
1528 |
function wppaFeAjaxLog(key) {
|
1529 |
|
@@ -1818,7 +1808,7 @@ function wppaTimedConfirm( text ) {
|
|
1818 |
}
|
1819 |
|
1820 |
function wppaAjaxGetSpinnerHtml( type, target ) {
|
1821 |
-
|
1822 |
jQuery.ajax( { url: wppaAjaxUrl,
|
1823 |
data: 'action=wppa' +
|
1824 |
'&wppa-action=update-option' +
|
@@ -1831,7 +1821,7 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
|
|
1831 |
beforeSend: function( xhr ) {
|
1832 |
},
|
1833 |
success: function( result, status, xhr ) {
|
1834 |
-
|
1835 |
// Split status and data
|
1836 |
var data = result.split('|');
|
1837 |
|
@@ -1840,10 +1830,10 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
|
|
1840 |
|
1841 |
},
|
1842 |
error: function( xhr ) {
|
1843 |
-
|
1844 |
},
|
1845 |
complete: function( xhr ) {
|
1846 |
-
|
1847 |
}
|
1848 |
} );
|
1849 |
}
|
@@ -1852,7 +1842,6 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
|
|
1852 |
// Movable horizon on photo admin page
|
1853 |
function wppaDragHorizon(elmnt) {
|
1854 |
|
1855 |
-
// var pos1 = 0, pos3 = 0;
|
1856 |
var pos2 = 0, pos4 = 0;
|
1857 |
|
1858 |
elmnt.onmousedown = dragMouseDown;
|
@@ -1893,6 +1882,127 @@ function wppaDragHorizon(elmnt) {
|
|
1893 |
}
|
1894 |
}
|
1895 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1896 |
// Replace log
|
1897 |
function wppaAjaxReplaceLog() {
|
1898 |
|
@@ -1917,16 +2027,27 @@ function wppaAjaxReplaceLog() {
|
|
1917 |
});
|
1918 |
}
|
1919 |
|
1920 |
-
// Hide admin spinner
|
1921 |
jQuery(document).ready( function() {
|
1922 |
setTimeout( "wppaTestAdminReady()", 200 );
|
1923 |
});
|
1924 |
function wppaTestAdminReady() {
|
1925 |
if ( document.readyState === "complete" ) {
|
1926 |
jQuery( "#wppa-admin-spinner" ).fadeOut();
|
1927 |
-
}
|
1928 |
-
else {
|
1929 |
setTimeout( "wppaTestAdminReady()", 200 );
|
1930 |
}
|
1931 |
}
|
1932 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
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) {
|
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 |
if (idx < temp.length) result += '||PLUS||';
|
1386 |
}
|
1387 |
|
|
|
1388 |
return result;
|
1389 |
}
|
1390 |
|
1412 |
}
|
1413 |
|
1414 |
function wppaPhotoStatusChange(id) {
|
1415 |
+
|
1416 |
// Init
|
1417 |
jQuery('#psdesc-'+id).css({display: 'none'});
|
1418 |
if ( ! jQuery('#status-'+id) ) return;
|
1513 |
document.location.reload( true );
|
1514 |
}
|
1515 |
}
|
1516 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1517 |
var wppaFeCount = 0;
|
1518 |
function wppaFeAjaxLog(key) {
|
1519 |
|
1808 |
}
|
1809 |
|
1810 |
function wppaAjaxGetSpinnerHtml( type, target ) {
|
1811 |
+
|
1812 |
jQuery.ajax( { url: wppaAjaxUrl,
|
1813 |
data: 'action=wppa' +
|
1814 |
'&wppa-action=update-option' +
|
1821 |
beforeSend: function( xhr ) {
|
1822 |
},
|
1823 |
success: function( result, status, xhr ) {
|
1824 |
+
|
1825 |
// Split status and data
|
1826 |
var data = result.split('|');
|
1827 |
|
1830 |
|
1831 |
},
|
1832 |
error: function( xhr ) {
|
1833 |
+
|
1834 |
},
|
1835 |
complete: function( xhr ) {
|
1836 |
+
|
1837 |
}
|
1838 |
} );
|
1839 |
}
|
1842 |
// Movable horizon on photo admin page
|
1843 |
function wppaDragHorizon(elmnt) {
|
1844 |
|
|
|
1845 |
var pos2 = 0, pos4 = 0;
|
1846 |
|
1847 |
elmnt.onmousedown = dragMouseDown;
|
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 |
|
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 |
+
}
|
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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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"}))}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 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)}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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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(/</g,"<")).replace(/>/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)});
|
theme/wppa-style.css
CHANGED
@@ -529,7 +529,7 @@ display:none;
|
|
529 |
font-weight:bold;
|
530 |
}
|
531 |
.wppa-real-calendar-caption {
|
532 |
-
|
533 |
font-size:1.4em;
|
534 |
}
|
535 |
.wppa-real-calendar-days {
|
@@ -644,3 +644,4 @@ display:none;
|
|
644 |
text-align:right !important;
|
645 |
padding-right: 2% !important;
|
646 |
}
|
|
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 |
text-align:right !important;
|
645 |
padding-right: 2% !important;
|
646 |
}
|
647 |
+
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -106,7 +106,7 @@ global $wppa_api_version;
|
|
106 |
|
107 |
$depts = array(
|
108 |
'jquery',
|
109 |
-
'jquery-ui-sortable',
|
110 |
'jquery-ui-dialog',
|
111 |
'jquery-form',
|
112 |
'jquery-masonry',
|
@@ -116,7 +116,7 @@ global $wppa_api_version;
|
|
116 |
wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.min.js', $depts, $wppa_api_version, true );
|
117 |
}
|
118 |
else {
|
119 |
-
|
120 |
}
|
121 |
wp_enqueue_script( 'wppa-upload', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version, true );
|
122 |
wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js',$depts, $wppa_api_version );
|
@@ -131,6 +131,9 @@ global $wppa_api_version;
|
|
131 |
}
|
132 |
|
133 |
wp_enqueue_style( 'wp-jquery-ui-dialog' );
|
|
|
|
|
|
|
134 |
}
|
135 |
|
136 |
add_action( 'admin_head', 'wppa_inject_css' );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 8.1.00.004
|
7 |
*
|
8 |
*/
|
9 |
|
106 |
|
107 |
$depts = array(
|
108 |
'jquery',
|
109 |
+
// 'jquery-ui-sortable', // does not work in 5.9RC2
|
110 |
'jquery-ui-dialog',
|
111 |
'jquery-form',
|
112 |
'jquery-masonry',
|
116 |
wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.min.js', $depts, $wppa_api_version, true );
|
117 |
}
|
118 |
else {
|
119 |
+
wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.js', $depts, $wppa_api_version, true );
|
120 |
}
|
121 |
wp_enqueue_script( 'wppa-upload', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version, true );
|
122 |
wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js',$depts, $wppa_api_version );
|
131 |
}
|
132 |
|
133 |
wp_enqueue_style( 'wp-jquery-ui-dialog' );
|
134 |
+
|
135 |
+
// jQuery sortable 1.13.0 fails, 1.12.1 works. Tested on 5.9RC2 vs 5.8
|
136 |
+
wp_enqueue_script( 'wppa-jquery-sortable', WPPA_URL . '/js/sortable.min.js', $depts );
|
137 |
}
|
138 |
|
139 |
add_action( 'admin_head', 'wppa_inject_css' );
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -3447,9 +3447,9 @@ global $wpdb;
|
|
3447 |
switch ( ArrValues[1] ) {
|
3448 |
case "0": // No error
|
3449 |
var i = seqno - 1;
|
3450 |
-
var descend =
|
3451 |
if ( descend ) {
|
3452 |
-
i =
|
3453 |
}
|
3454 |
jQuery( "#wppa-album-seqno-" + album ).html( seqno );
|
3455 |
if ( wppaRenumberPending ) {
|
@@ -3463,7 +3463,7 @@ global $wpdb;
|
|
3463 |
}
|
3464 |
break;
|
3465 |
default: // Any error
|
3466 |
-
jQuery( "#wppa-album-seqno-" + album ).html( "<span style
|
3467 |
break;
|
3468 |
}
|
3469 |
wppaAjaxInProgress--;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* create, edit and delete albums
|
6 |
+
* Version 8.1.00.004
|
7 |
*
|
8 |
*/
|
9 |
|
3447 |
switch ( ArrValues[1] ) {
|
3448 |
case "0": // No error
|
3449 |
var i = seqno - 1;
|
3450 |
+
var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
|
3451 |
if ( descend ) {
|
3452 |
+
i = ' . count( $albums ) . ' - seqno;
|
3453 |
}
|
3454 |
jQuery( "#wppa-album-seqno-" + album ).html( seqno );
|
3455 |
if ( wppaRenumberPending ) {
|
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--;
|
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.
|
7 |
*/
|
8 |
|
9 |
class AlbumNavigatorWidget extends WP_Widget {
|
@@ -366,15 +366,6 @@ 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 );
|
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 |
}
|
367 |
}
|
368 |
$result .= '</ul>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
}
|
370 |
$level--;
|
371 |
return wppa_compress_html( $result );
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -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="
|
122 |
' >' .
|
123 |
stripslashes( $item['comment'] ) .
|
124 |
'</textarea>' .
|
@@ -353,17 +353,6 @@ function _wppa_comment_admin() {
|
|
353 |
// Open page
|
354 |
echo
|
355 |
'<div class="wrap">
|
356 |
-
<script type="text/javascript" >
|
357 |
-
function wppaUpdateHref( id ) {
|
358 |
-
var val = encodeURIComponent(jQuery(\'#commenttext-\'+id).val());
|
359 |
-
var href = jQuery(\'#href-\'+id).attr(\'href\');
|
360 |
-
var arr = href.split(\'commenttext=\');
|
361 |
-
arr[1] = val;
|
362 |
-
href = arr[0] + \'commenttext=\' + arr[1];
|
363 |
-
jQuery(\'#href-\'+id).attr(\'href\', href);
|
364 |
-
jQuery(\'#href-\'+id).css(\'display\',\'inline\');
|
365 |
-
}
|
366 |
-
</script>
|
367 |
<style type="text/css" >
|
368 |
.column-photo {
|
369 |
width:180px;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all comments
|
6 |
+
* Version 8.1.00.004
|
7 |
*
|
8 |
*/
|
9 |
|
118 |
'<textarea' .
|
119 |
' id="commenttext-' . $item['id'] . '"' .
|
120 |
' style="width:98%;"' .
|
121 |
+
' onchange="wppaCommentAdminUpdateHref(\'' . $item['id'] . '\')"' .
|
122 |
' >' .
|
123 |
stripslashes( $item['comment'] ) .
|
124 |
'</textarea>' .
|
353 |
// Open page
|
354 |
echo
|
355 |
'<div class="wrap">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
356 |
<style type="text/css" >
|
357 |
.column-photo {
|
358 |
width:180px;
|
wppa-defaults.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
-
* Version 8.1.00.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -482,7 +482,7 @@ horizrailenabled:false,";
|
|
482 |
'wppa_auto_page' => 'no',
|
483 |
'wppa_auto_page_type' => 'photo',
|
484 |
'wppa_auto_page_links' => 'bottom',
|
485 |
-
|
486 |
'wppa_custom_style' => '',
|
487 |
'wppa_custom_style_chrome' => '',
|
488 |
'wppa_custom_style_firefox' => '',
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
+
* Version 8.1.00.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' => '',
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -101,14 +101,10 @@ global $wppa_current_shortcode_atts;
|
|
101 |
( $nices ? '</div>': '' ) .
|
102 |
'</div>';
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
jQuery("#wppa-div-' . $seqno . '").niceScroll(".wppa-divnicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});' .
|
109 |
-
'});
|
110 |
-
</script>';
|
111 |
-
}
|
112 |
|
113 |
return $result;
|
114 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* get the albums via shortcode handler
|
6 |
+
* Version 8.1.00.004
|
7 |
*
|
8 |
*/
|
9 |
|
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 |
}
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1617,19 +1617,12 @@ global $wppa_log_file;
|
|
1617 |
$result = 'Error: Unimplemented slug: ' . $slug . ' in wppa_do_maintenance_popup()';
|
1618 |
}
|
1619 |
|
1620 |
-
// End nicescroller wrapper
|
1621 |
$result .= '
|
1622 |
-
|
1623 |
-
if ( jQuery("#wppa-maintenance-list").niceScroll ) {
|
1624 |
-
jQuery(document).ready(function(){
|
1625 |
-
jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
|
1626 |
-
});
|
1627 |
-
}
|
1628 |
-
</script>
|
1629 |
-
</div>';
|
1630 |
|
1631 |
-
|
1632 |
-
'
|
|
|
1633 |
|
1634 |
return htmlspecialchars( $header ) . '|' . $result;
|
1635 |
}
|
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.004
|
7 |
*
|
8 |
*/
|
9 |
|
1617 |
$result = 'Error: Unimplemented slug: ' . $slug . ' in wppa_do_maintenance_popup()';
|
1618 |
}
|
1619 |
|
|
|
1620 |
$result .= '
|
1621 |
+
</div></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1622 |
|
1623 |
+
// Activate nicescroller on wrapper
|
1624 |
+
// $the_js = 'if (jQuery("#wppa-maintenance-list").niceScroll) {jQuery(document).ready(function(){jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});});};';
|
1625 |
+
// wp_add_inline_script( 'wppa-admin', $the_js );
|
1626 |
|
1627 |
return htmlspecialchars( $header ) . '|' . $result;
|
1628 |
}
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -300,23 +300,22 @@ global $wpdb;
|
|
300 |
// There are photos to display for editing
|
301 |
else {
|
302 |
|
303 |
-
// Local js functions
|
304 |
-
|
305 |
-
<script>
|
306 |
function wppaTryMove( id, video ) {
|
307 |
|
308 |
var query;
|
309 |
|
310 |
if ( ! jQuery( '#target-' + id ).val() ) {
|
311 |
-
alert( '
|
312 |
return false;
|
313 |
}
|
314 |
|
315 |
if ( video ) {
|
316 |
-
query = '
|
317 |
}
|
318 |
else {
|
319 |
-
query = '
|
320 |
}
|
321 |
|
322 |
if ( confirm( query ) ) {
|
@@ -329,15 +328,15 @@ function wppaTryCopy( id, video ) {
|
|
329 |
var query;
|
330 |
|
331 |
if ( ! jQuery( '#target-' + id ).val() ) {
|
332 |
-
alert( '
|
333 |
return false;
|
334 |
}
|
335 |
|
336 |
if ( video ) {
|
337 |
-
query = '
|
338 |
}
|
339 |
else {
|
340 |
-
query = '
|
341 |
}
|
342 |
|
343 |
if ( confirm( query ) ) {
|
@@ -350,10 +349,10 @@ function wppaTryDelete( id, video ) {
|
|
350 |
var query;
|
351 |
|
352 |
if ( video ) {
|
353 |
-
query = '
|
354 |
}
|
355 |
else {
|
356 |
-
query = '
|
357 |
}
|
358 |
|
359 |
if ( confirm( query ) ) {
|
@@ -368,7 +367,7 @@ function wppaTryUndelete ( id ) {
|
|
368 |
|
369 |
function wppaTryRotLeft( id ) {
|
370 |
|
371 |
-
var query = '
|
372 |
|
373 |
if ( confirm( query ) ) {
|
374 |
wppaAjaxUpdatePhoto( id, 'rotleft', 0 );
|
@@ -377,7 +376,7 @@ function wppaTryRotLeft( id ) {
|
|
377 |
|
378 |
function wppaTryRot180( id ) {
|
379 |
|
380 |
-
var query = '
|
381 |
|
382 |
if ( confirm( query ) ) {
|
383 |
wppaAjaxUpdatePhoto( id, 'rot180', 0 );
|
@@ -386,7 +385,7 @@ function wppaTryRot180( id ) {
|
|
386 |
|
387 |
function wppaTryRotRight( id ) {
|
388 |
|
389 |
-
var query = '
|
390 |
|
391 |
if ( confirm( query ) ) {
|
392 |
wppaAjaxUpdatePhoto( id, 'rotright', 0 );
|
@@ -395,7 +394,7 @@ function wppaTryRotRight( id ) {
|
|
395 |
|
396 |
function wppaTryFlip( id ) {
|
397 |
|
398 |
-
var query = '
|
399 |
|
400 |
if ( confirm( query ) ) {
|
401 |
wppaAjaxUpdatePhoto( id, 'flip', 0 );
|
@@ -404,7 +403,7 @@ function wppaTryFlip( id ) {
|
|
404 |
|
405 |
function wppaTryFlop( id ) {
|
406 |
|
407 |
-
var query = '
|
408 |
|
409 |
if ( confirm( query ) ) {
|
410 |
wppaAjaxUpdatePhoto( id, 'flop', 0 );
|
@@ -416,22 +415,22 @@ function wppaTryWatermark( id, hasSource, canRemove ) {
|
|
416 |
var query;
|
417 |
var wmFile = jQuery( '#wmfsel_' + id ).val();
|
418 |
if ( wmFile == '--- none ---' ) {
|
419 |
-
alert( '
|
420 |
return;
|
421 |
}
|
422 |
if ( hasSource ) {
|
423 |
-
query = '
|
424 |
-
query += '
|
425 |
-
query += '
|
426 |
if ( canRemove ) {
|
427 |
-
query += '
|
428 |
-
query += '
|
429 |
}
|
430 |
}
|
431 |
else {
|
432 |
-
query = '
|
433 |
-
query += '
|
434 |
-
query += '
|
435 |
}
|
436 |
|
437 |
if ( confirm( query ) ) {
|
@@ -445,7 +444,7 @@ function wppaTryMagick( id, slug, value ) {
|
|
445 |
value = 0;
|
446 |
}
|
447 |
|
448 |
-
var query = '
|
449 |
|
450 |
if ( true || confirm( query ) ) {
|
451 |
jQuery( '#wppa-admin-spinner' ).css( 'display', 'inline' );
|
@@ -476,11 +475,11 @@ function wppaToggleIptc( id, count ) {
|
|
476 |
|
477 |
if ( jQuery( '#wppa-iptc-' + id ).css( 'display' ) == 'none' ) {
|
478 |
jQuery( '#wppa-iptc-' + id ).show();
|
479 |
-
jQuery( '#wppa-iptc-button-' + id ).val( '
|
480 |
}
|
481 |
else {
|
482 |
jQuery( '#wppa-iptc-' + id ).hide();
|
483 |
-
jQuery( '#wppa-iptc-button-' + id ).val( '
|
484 |
}
|
485 |
}
|
486 |
|
@@ -488,17 +487,15 @@ function wppaToggleExif( id, count ) {
|
|
488 |
|
489 |
if ( jQuery( '#wppa-exif-' + id ).css( 'display' ) == 'none' ) {
|
490 |
jQuery( '#wppa-exif-' + id ).show();
|
491 |
-
jQuery( '#wppa-exif-button-' + id ).val( '
|
492 |
}
|
493 |
else {
|
494 |
jQuery( '#wppa-exif-' + id ).hide();
|
495 |
-
jQuery( '#wppa-exif-button-' + id ).val( '
|
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,10 +515,9 @@ function wppaToggleExif( id, count ) {
|
|
518 |
<hr
|
519 |
style="position:relative;top:5px;left:0px;border:none;background-color:black;height:1px;width:100%;"
|
520 |
/>
|
521 |
-
</div>
|
522 |
-
|
523 |
-
|
524 |
-
</script>';
|
525 |
|
526 |
// Albun name if moderate
|
527 |
static $modalbum;
|
@@ -1833,8 +1829,9 @@ function wppaToggleExif( id, count ) {
|
|
1833 |
else {
|
1834 |
$value = $dflt;
|
1835 |
}
|
1836 |
-
|
1837 |
-
'
|
|
|
1838 |
|
1839 |
echo
|
1840 |
'</td>' .
|
@@ -1873,12 +1870,12 @@ function wppaToggleExif( id, count ) {
|
|
1873 |
' style="float:left;max-width:100%;" ' .
|
1874 |
' />';
|
1875 |
|
1876 |
-
|
1877 |
-
|
1878 |
window.addEventListener("DOMContentLoaded", function () {
|
1879 |
|
1880 |
/* Responive does not always works correcly, */
|
1881 |
-
/* so we do a manual
|
1882 |
window.addEventListener("resize", function(){
|
1883 |
var c = wppaCropper[' . $id . '];
|
1884 |
var url = document.getElementById("fs-img-' . $id . '").src;
|
@@ -1902,9 +1899,8 @@ function wppaToggleExif( id, count ) {
|
|
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>';
|
@@ -2464,6 +2460,7 @@ function wppaToggleExif( id, count ) {
|
|
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,8 +2479,7 @@ function wppaToggleExif( id, count ) {
|
|
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
|
@@ -2691,150 +2687,32 @@ function wppa_album_photos_bulk( $album ) {
|
|
2691 |
if ( $photos ) {
|
2692 |
$plink = $link . '&next-after=' . $next_after;
|
2693 |
wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
|
2694 |
-
?>
|
2695 |
-
<script type="text/javascript" >
|
2696 |
-
function wppaBulkActionChange( elm, id ) {
|
2697 |
-
wppa_setCookie( 'wppa_bulk_action',elm.value,365 );
|
2698 |
-
if ( elm.value == 'wppa-bulk-move-to' || elm.value == 'wppa-bulk-copy-to' ) jQuery( '#wppa-bulk-album' ).css( 'display', 'inline' );
|
2699 |
-
else jQuery( '#wppa-bulk-album' ).css( 'display', 'none' );
|
2700 |
-
if ( elm.value == 'wppa-bulk-status' ) jQuery( '#wppa-bulk-status' ).css( 'display', 'inline' );
|
2701 |
-
else jQuery( '#wppa-bulk-status' ).css( 'display', 'none' );
|
2702 |
-
if ( elm.value == 'wppa-bulk-owner' ) jQuery( '#wppa-bulk-owner' ).css( 'display', 'inline' );
|
2703 |
-
else jQuery( '#wppa-bulk-owner' ).css( 'display', 'none' );
|
2704 |
-
}
|
2705 |
-
function wppaBulkDoitOnClick() {
|
2706 |
-
var photos = jQuery( '.wppa-bulk-photo' );
|
2707 |
-
var count=0;
|
2708 |
-
for ( i=0; i< photos.length; i++ ) {
|
2709 |
-
var photo = photos[i];
|
2710 |
-
if ( photo.checked ) count++;
|
2711 |
-
}
|
2712 |
-
if ( count == 0 ) {
|
2713 |
-
alert( 'No photos selected' );
|
2714 |
-
return false;
|
2715 |
-
}
|
2716 |
-
var action = document.getElementById( 'wppa-bulk-action' ).value;
|
2717 |
-
switch ( action ) {
|
2718 |
-
case '':
|
2719 |
-
alert( 'No action selected' );
|
2720 |
-
return false;
|
2721 |
-
break;
|
2722 |
-
case 'wppa-bulk-delete':
|
2723 |
-
break;
|
2724 |
-
case 'wppa-bulk-move-to':
|
2725 |
-
case 'wppa-bulk-copy-to':
|
2726 |
-
var album = document.getElementById( 'wppa-bulk-album' ).value;
|
2727 |
-
if ( album == 0 ) {
|
2728 |
-
alert( 'No album selected' );
|
2729 |
-
return false;
|
2730 |
-
}
|
2731 |
-
break;
|
2732 |
-
case 'wppa-bulk-status':
|
2733 |
-
var status = document.getElementById( 'wppa-bulk-status' ).value;
|
2734 |
-
if ( status == 0 ) {
|
2735 |
-
alert( 'No status selected' );
|
2736 |
-
return false;
|
2737 |
-
}
|
2738 |
-
break;
|
2739 |
-
case 'wppa-bulk-owner':
|
2740 |
-
var owner = documnet.getElementById( 'wppa-bulk-owner' ).value;
|
2741 |
-
if ( owner == 0 ) {
|
2742 |
-
alert( 'No new owner selected' );
|
2743 |
-
return false;
|
2744 |
-
}
|
2745 |
-
break;
|
2746 |
-
default:
|
2747 |
-
alert( 'Unimplemented action requested: '+action );
|
2748 |
-
return false;
|
2749 |
-
break;
|
2750 |
|
2751 |
-
|
2752 |
-
return true;
|
2753 |
-
}
|
2754 |
-
function wppaSetThumbsize( elm ) {
|
2755 |
-
var thumbsize = elm.value;
|
2756 |
-
wppa_setCookie( 'wppa_bulk_thumbsize',thumbsize,365 );
|
2757 |
-
jQuery( '.wppa-bulk-thumb' ).css( 'max-width', thumbsize+'px' );
|
2758 |
-
jQuery( '.wppa-bulk-thumb' ).css( 'max-height', ( thumbsize/2 )+'px' );
|
2759 |
-
jQuery( '.wppa-bulk-dec' ).css( 'height', ( thumbsize/2 )+'px' );
|
2760 |
-
}
|
2761 |
-
jQuery(document).ready( function() {
|
2762 |
-
var action = wppa_getCookie( 'wppa_bulk_action' );
|
2763 |
-
document.getElementById( 'wppa-bulk-action' ).value = action;
|
2764 |
-
if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) {
|
2765 |
-
jQuery( '#wppa-bulk-album' ).css( 'display','inline' );
|
2766 |
-
document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' );
|
2767 |
-
}
|
2768 |
-
if ( action == 'wppa-bulk-status' ) {
|
2769 |
-
jQuery( '#wppa-bulk-status' ).css( 'display','inline' );
|
2770 |
-
document.getElementById( 'wppa-bulk-status' ).value = wppa_getCookie( 'wppa_bulk_status' );
|
2771 |
-
}
|
2772 |
-
if ( action == 'wppa-bulk-owner' ) {
|
2773 |
-
jQuery( '#wppa-bulk-owner' ).css( 'display','inline' );
|
2774 |
-
document.getElementById( 'wppa-bulk-owner' ).value = wppa_getCookie( 'wppa_bulk_owner' );
|
2775 |
-
}
|
2776 |
-
} );
|
2777 |
function wppaTryMove( id, video ) {
|
2778 |
|
2779 |
var query;
|
2780 |
|
2781 |
if ( ! jQuery( '#target-' + id ).val() ) {
|
2782 |
-
alert( '
|
2783 |
return false;
|
2784 |
}
|
2785 |
|
2786 |
if ( video ) {
|
2787 |
-
query = '
|
2788 |
}
|
2789 |
else {
|
2790 |
-
query = '
|
2791 |
}
|
2792 |
|
2793 |
if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
|
2794 |
-
jQuery( '#moving-' + id ).html( '
|
2795 |
-
wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan
|
2796 |
}
|
2797 |
-
}
|
|
|
2798 |
|
2799 |
-
|
2800 |
-
var status = jQuery( elm ).prop( 'checked' );
|
2801 |
-
if ( status ) {
|
2802 |
-
wppa_setCookie( 'wppaConfirmDelete', 'checked', 365 );
|
2803 |
-
}
|
2804 |
-
else {
|
2805 |
-
wppa_setCookie( 'wppaConfirmDelete', 'unchecked', 365 );
|
2806 |
-
}
|
2807 |
-
}
|
2808 |
-
function wppaToggleConfirmMove( elm ) {
|
2809 |
-
var status = jQuery( elm ).prop( 'checked' );
|
2810 |
-
if ( status ) {
|
2811 |
-
wppa_setCookie( 'wppaConfirmMove', 'checked', 365 );
|
2812 |
-
}
|
2813 |
-
else {
|
2814 |
-
wppa_setCookie( 'wppaConfirmMove', 'unchecked', 365 );
|
2815 |
-
}
|
2816 |
-
}
|
2817 |
-
function wppaSetConfirmDelete( id ) {
|
2818 |
-
var status = wppa_getCookie( 'wppaConfirmDelete' );
|
2819 |
-
if ( status == 'checked' ) {
|
2820 |
-
jQuery( '#' + id ).prop( 'checked', true );
|
2821 |
-
}
|
2822 |
-
else {
|
2823 |
-
jQuery( '#' + id ).prop( 'checked', false );
|
2824 |
-
}
|
2825 |
-
}
|
2826 |
-
function wppaSetConfirmMove( id ) {
|
2827 |
-
var status = wppa_getCookie( 'wppaConfirmMove' );
|
2828 |
-
if ( status == 'checked' ) {
|
2829 |
-
jQuery( '#' + id ).prop( 'checked', true );
|
2830 |
-
}
|
2831 |
-
else {
|
2832 |
-
jQuery( '#' + id ).prop( 'checked', false );
|
2833 |
-
}
|
2834 |
-
}
|
2835 |
-
|
2836 |
-
</script>
|
2837 |
-
<?php /**/ ?>
|
2838 |
<form action="<?php echo $link.'&wppa-page='.$page.'#manage-photos' ?>" method="post" >
|
2839 |
<?php wp_nonce_field( 'wppa-bulk','wppa-bulk' ) ?>
|
2840 |
<h3>
|
@@ -2935,13 +2813,16 @@ function wppaSetConfirmMove( id ) {
|
|
2935 |
/>
|
2936 |
<?php _e('Confirm move', 'wp-photo-album-plus') ?>
|
2937 |
|
2938 |
-
<?php echo '<small style="float:right;" > (' . count( $photos ) . ')</small>';
|
2939 |
-
|
|
|
2940 |
jQuery(document).ready( function() {
|
2941 |
-
wppaSetConfirmDelete(
|
2942 |
-
wppaSetConfirmMove(
|
2943 |
-
});
|
2944 |
-
|
|
|
|
|
2945 |
</h3>
|
2946 |
<?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
|
2947 |
<table class="widefat" >
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 8.1.00.004
|
7 |
*
|
8 |
*/
|
9 |
|
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 |
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 |
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 |
|
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 |
|
377 |
function wppaTryRot180( id ) {
|
378 |
|
379 |
+
var query = '" . esc_js( __( 'Are you sure you want to rotate this photo 180°?', 'wp-photo-album-plus' ) ) . "';
|
380 |
|
381 |
if ( confirm( query ) ) {
|
382 |
wppaAjaxUpdatePhoto( id, 'rot180', 0 );
|
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 |
|
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 |
|
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 |
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 |
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 |
|
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 |
|
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 |
<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 |
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 |
' 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 |
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 |
'<style>.cropper-drag-box{background-color:transparent;}img{max-width:100%}</style>';
|
2460 |
'<td style="padding:0 4px;" >' .
|
2461 |
'<select' .
|
2462 |
' id="com-stat-' . $comment['id'] . '"' .
|
2463 |
+
' style="background-color:' . ( $comment['status'] == 'approved' ? '#ffffe0' : '#ffebe8' ) . '"' .
|
2464 |
' onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ');"' .
|
2465 |
' >' .
|
2466 |
'<option value="pending" '.$p.'>'.__( 'Pending' , 'wp-photo-album-plus').'</option>' .
|
2479 |
echo '</td>';
|
2480 |
}
|
2481 |
echo '<td style="padding:0 4px;" >'.$comment['comment'].'</td>
|
2482 |
+
</tr>';
|
|
|
2483 |
}
|
2484 |
|
2485 |
echo
|
2687 |
if ( $photos ) {
|
2688 |
$plink = $link . '&next-after=' . $next_after;
|
2689 |
wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2690 |
|
2691 |
+
$the_js = "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2692 |
function wppaTryMove( id, video ) {
|
2693 |
|
2694 |
var query;
|
2695 |
|
2696 |
if ( ! jQuery( '#target-' + id ).val() ) {
|
2697 |
+
alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
|
2698 |
return false;
|
2699 |
}
|
2700 |
|
2701 |
if ( video ) {
|
2702 |
+
query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
|
2703 |
}
|
2704 |
else {
|
2705 |
+
query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
|
2706 |
}
|
2707 |
|
2708 |
if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
|
2709 |
+
jQuery( '#moving-' + id ).html( '". __( 'Moving...', 'wp-photo-album-plus' ) . "' );
|
2710 |
+
wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan=\'8\' >', '</td>' );
|
2711 |
}
|
2712 |
+
}";
|
2713 |
+
wp_add_inline_script( 'wppa-admin', $the_js );
|
2714 |
|
2715 |
+
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2716 |
<form action="<?php echo $link.'&wppa-page='.$page.'#manage-photos' ?>" method="post" >
|
2717 |
<?php wp_nonce_field( 'wppa-bulk','wppa-bulk' ) ?>
|
2718 |
<h3>
|
2813 |
/>
|
2814 |
<?php _e('Confirm move', 'wp-photo-album-plus') ?>
|
2815 |
|
2816 |
+
<?php echo '<small style="float:right;" > (' . count( $photos ) . ')</small>';
|
2817 |
+
|
2818 |
+
$the_js = '
|
2819 |
jQuery(document).ready( function() {
|
2820 |
+
wppaSetConfirmDelete( "confirm-delete" );
|
2821 |
+
wppaSetConfirmMove( "confirm-move" );
|
2822 |
+
});';
|
2823 |
+
wp_add_inline_script( 'wppa_admin', $the_js );
|
2824 |
+
|
2825 |
+
?>
|
2826 |
</h3>
|
2827 |
<?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
|
2828 |
<table class="widefat" >
|
wppa-scripts.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* This file contains all functions for activating javascript
|
6 |
*
|
7 |
-
* Version 8.
|
8 |
*/
|
9 |
|
10 |
// Place all wppa related js declarations in the header, both admin and frontend
|
@@ -552,7 +552,7 @@ global $wppa_opt;
|
|
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, $footer );
|
556 |
}
|
557 |
|
558 |
// No all file, do them one by one
|
@@ -581,9 +581,6 @@ global $wppa_opt;
|
|
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' );
|
@@ -597,26 +594,24 @@ global $wppa_opt;
|
|
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,
|
601 |
$easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
|
602 |
-
wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url,
|
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,
|
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,
|
616 |
}
|
617 |
|
618 |
-
// End other (vendor) js files
|
619 |
-
|
620 |
}
|
621 |
|
622 |
// Add script to the page specific data. Input text should have no <script> tag
|
@@ -700,6 +695,8 @@ function wppa_compress_js( $txt ) {
|
|
700 |
// Decide if we do defer js
|
701 |
function wppa_is_defer() {
|
702 |
|
|
|
|
|
703 |
if ( is_admin() ) return true;
|
704 |
if ( ! wppa_switch( 'defer_javascript' ) ) return false;
|
705 |
if ( wppa( 'ajax' ) ) return false;
|
4 |
*
|
5 |
* This file contains all functions for activating javascript
|
6 |
*
|
7 |
+
* Version 8.1.00.004
|
8 |
*/
|
9 |
|
10 |
// Place all wppa related js declarations in the header, both admin and frontend
|
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, $footer );
|
556 |
}
|
557 |
|
558 |
// No all file, do them one by one
|
581 |
}
|
582 |
}
|
583 |
|
|
|
|
|
|
|
584 |
// google maps
|
585 |
if ( wppa_switch( 'save_gpx' ) && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false ) {
|
586 |
$key = wppa_opt( 'map_apikey' );
|
594 |
// Nicescroller
|
595 |
if ( ! wppa_is_mobile() && ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) ) {
|
596 |
$nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
|
597 |
+
wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, $js_depts, $wppa_api_version, $footer );
|
598 |
$easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
|
599 |
+
wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
|
600 |
}
|
601 |
|
602 |
// Easing we need, borrow it from nicescroller if not already loaded
|
603 |
else {
|
604 |
$easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
|
605 |
+
wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
|
606 |
}
|
607 |
|
608 |
// Panorama
|
609 |
if ( wppa_switch( 'enable_panorama' ) ) {
|
610 |
$three_url = WPPA_URL . '/vendor/three/three.min.js';
|
611 |
$ver = '122';
|
612 |
+
wp_enqueue_script( 'wppa-three-min-js', $three_url, $js_depts, $wppa_api_version, $footer );
|
613 |
}
|
614 |
|
|
|
|
|
615 |
}
|
616 |
|
617 |
// Add script to the page specific data. Input text should have no <script> tag
|
695 |
// Decide if we do defer js
|
696 |
function wppa_is_defer() {
|
697 |
|
698 |
+
return true;
|
699 |
+
|
700 |
if ( is_admin() ) return true;
|
701 |
if ( ! wppa_switch( 'defer_javascript' ) ) return false;
|
702 |
if ( wppa( 'ajax' ) ) return false;
|
wppa-settings-autosave.php
CHANGED
@@ -6557,14 +6557,14 @@ global $wppa_subtab_names;
|
|
6557 |
$vals = array('none', 'top', 'bottom', 'both');
|
6558 |
$html = wppa_select($slug, $opts, $vals);
|
6559 |
wppa_setting_new($slug, '10', $name, $desc, $html, $help);
|
6560 |
-
|
6561 |
$name = __('Defer javascript', 'wp-photo-album-plus');
|
6562 |
$desc = __('Put javascript near the end of the page.', 'wp-photo-album-plus');
|
6563 |
$help = (__('If checkd: May fix layout problems and broken slideshows. May speed up or slow down page appearing.', 'wp-photo-album-plus'));
|
6564 |
$slug = 'wppa_defer_javascript';
|
6565 |
$html = wppa_checkbox($slug);
|
6566 |
wppa_setting_new($slug, '11', $name, $desc, $html, $help);
|
6567 |
-
|
6568 |
global $wppa_setting_error;
|
6569 |
$wppa_setting_error = true;
|
6570 |
|
6557 |
$vals = array('none', 'top', 'bottom', 'both');
|
6558 |
$html = wppa_select($slug, $opts, $vals);
|
6559 |
wppa_setting_new($slug, '10', $name, $desc, $html, $help);
|
6560 |
+
/*
|
6561 |
$name = __('Defer javascript', 'wp-photo-album-plus');
|
6562 |
$desc = __('Put javascript near the end of the page.', 'wp-photo-album-plus');
|
6563 |
$help = (__('If checkd: May fix layout problems and broken slideshows. May speed up or slow down page appearing.', 'wp-photo-album-plus'));
|
6564 |
$slug = 'wppa_defer_javascript';
|
6565 |
$html = wppa_checkbox($slug);
|
6566 |
wppa_setting_new($slug, '11', $name, $desc, $html, $help);
|
6567 |
+
*/
|
6568 |
global $wppa_setting_error;
|
6569 |
$wppa_setting_error = true;
|
6570 |
|
wppa-slideshow.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
*
|
7 |
-
* Version 8.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -487,7 +487,7 @@ function wppa_slide_frame() {
|
|
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,7 +508,7 @@ function wppa_slide_frame() {
|
|
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 |
' />'
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
*
|
7 |
+
* Version 8.1.00.004
|
8 |
*
|
9 |
*/
|
10 |
|
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 |
'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 |
' />'
|
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.
|
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.
|
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.1.00.004
|
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.1.00.004'; // WPPA software version
|
28 |
global $wppa_revno;
|
29 |
$wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
|
30 |
|