Version Description
= 7.5.07 =
- This version addresses various bug fixes and feature requests.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 7.5.07.007 |
Comparing to | |
See all releases |
Code changes from version 7.5.07.004 to 7.5.07.007
- changelog.txt +4 -0
- js/wppa-admin-scripts.js +5 -5
- js/wppa-admin-scripts.min.js +1 -1
- js/wppa-all.js +1 -1
- js/wppa-zoom.js +14 -14
- js/wppa-zoom.min.js +1 -1
- wppa-ajax.php +10 -1
- wppa-cron.php +12 -3
- wppa-defaults.php +2 -2
- wppa-functions.php +7 -5
- wppa-mailing.php +11 -14
- wppa-settings-autosave.php +45 -11
- wppa-utils.php +1 -1
- wppa.php +2 -2
changelog.txt
CHANGED
@@ -5,6 +5,10 @@ WP Photo Album Plus Changelog
|
|
5 |
* Fixed a layout issue in lightbox.
|
6 |
* Fixed a compatibility issue with search plugins.
|
7 |
* Fullscreen lightbox will now initially display the zoomable image screen-filling with the capability of zooming out.
|
|
|
|
|
|
|
|
|
8 |
|
9 |
= 7.5.06 =
|
10 |
|
5 |
* Fixed a layout issue in lightbox.
|
6 |
* Fixed a compatibility issue with search plugins.
|
7 |
* Fullscreen lightbox will now initially display the zoomable image screen-filling with the capability of zooming out.
|
8 |
+
* Pertformance improvement for zoomable images.
|
9 |
+
* Fixed a problem in calculating related data causing db errors.
|
10 |
+
* Registering failed mails for retrying did not work. Fixed.
|
11 |
+
* Table IX-A10: Retry failed mails has been moved to Table IX-M100.
|
12 |
|
13 |
= 7.5.06 =
|
14 |
|
js/wppa-admin-scripts.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
-
/* Version 7.5.
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
@@ -242,7 +242,7 @@ function wppaInitSettings() {
|
|
242 |
wppaCheckSmWidgetLink();
|
243 |
|
244 |
var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
|
245 |
-
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M');
|
246 |
|
247 |
for (table=1; table<13; table++) {
|
248 |
var cookie = wppa_getCookie('table_'+table);
|
@@ -252,7 +252,7 @@ function wppaInitSettings() {
|
|
252 |
else {
|
253 |
wppaHideTable(table); // Refreshes cookie, so it 'never' forgets
|
254 |
}
|
255 |
-
for (subtab=0; subtab<
|
256 |
cookie = wppa_getCookie('table_'+tab[table-1]+'-'+sub[subtab]);
|
257 |
if (cookie == 'on') {
|
258 |
wppaToggleSubTable(tab[table-1],sub[subtab]);
|
@@ -265,7 +265,7 @@ function wppaInitSettings() {
|
|
265 |
// Quick sel on settings page will be released at version 5.5.0
|
266 |
function wppaQuickSel() {
|
267 |
var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
|
268 |
-
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','
|
269 |
var tag;
|
270 |
var _cls;
|
271 |
|
@@ -278,7 +278,7 @@ function wppaQuickSel() {
|
|
278 |
wppaHideTable(table); // Refreshes cookie, so it 'never' forgets
|
279 |
}
|
280 |
wppa_tablecookieoff(table);
|
281 |
-
for (subtab=0; subtab<
|
282 |
cookie = wppa_getCookie('table_'+tab[table-1]+'-'+sub[subtab]);
|
283 |
if (cookie == 'on') {
|
284 |
wppaToggleSubTable(tab[table-1],sub[subtab]);
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
+
/* Version 7.5.07
|
5 |
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
242 |
wppaCheckSmWidgetLink();
|
243 |
|
244 |
var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
|
245 |
+
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M','X','Y');
|
246 |
|
247 |
for (table=1; table<13; table++) {
|
248 |
var cookie = wppa_getCookie('table_'+table);
|
252 |
else {
|
253 |
wppaHideTable(table); // Refreshes cookie, so it 'never' forgets
|
254 |
}
|
255 |
+
for (subtab=0; subtab<15; subtab++) {
|
256 |
cookie = wppa_getCookie('table_'+tab[table-1]+'-'+sub[subtab]);
|
257 |
if (cookie == 'on') {
|
258 |
wppaToggleSubTable(tab[table-1],sub[subtab]);
|
265 |
// Quick sel on settings page will be released at version 5.5.0
|
266 |
function wppaQuickSel() {
|
267 |
var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
|
268 |
+
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M','X','Y');
|
269 |
var tag;
|
270 |
var _cls;
|
271 |
|
278 |
wppaHideTable(table); // Refreshes cookie, so it 'never' forgets
|
279 |
}
|
280 |
wppa_tablecookieoff(table);
|
281 |
+
for (subtab=0; subtab<15; subtab++) {
|
282 |
cookie = wppa_getCookie('table_'+tab[table-1]+'-'+sub[subtab]);
|
283 |
if (cookie == 'on') {
|
284 |
wppaToggleSubTable(tab[table-1],sub[subtab]);
|
js/wppa-admin-scripts.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album",wppaCropper=[];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,i,t,o){document.getElementById("wppa-re-up-form-"+i);var a=document.getElementById("wppa-re-up-file-"+i),r=document.getElementById("wppa-re-up-butn-"+i);e.preventDefault();var p=a.files[0];if(p.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+p.name);else if(p.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+i).css("display","none");r.value="Uploading...",r.style.color="black";var n=new FormData;n.append("photo",p,p.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+i+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+i).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.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>",o&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(a);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(p):jQuery("#photourl-"+i).attr("src",p),jQuery("#thumba-"+i).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+i).html(p),0<p.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+t+"-"+i).html(p)}r.value="Upload",jQuery("#re-up-"+i).css("display","none");break;case"99":document.getElementById("photoitem-"+i).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+i).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",r.value="Error occured",r.style.color="red"}}else alert("An error occurred!")},s.send(n)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckAlbumNavigatorWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M");for(table=1;table<13;table++){var a=wppa_getCookie("table_"+table);for(("on"==a?wppaShowTable:wppaHideTable)(table),subtab=0;subtab<13;subtab++)"on"==(a=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","Z");for(table=1;table<13;table++)for((table<13?wppaShowTable:wppaHideTable)(table),wppa_tablecookieoff(table),subtab=0;subtab<12;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var a=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<a.length&&(a.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){var a=e.substring(5);document.getElementById(a).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,a=wppaFontDirectory+"wmf"+e+"-"+t+".png",p=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",a),jQuery("#wm-type-preview").attr("src",p)}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 wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,a=document.getElementById("fullvalign").value;e!=t&&"default"!=a?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e,t=document.getElementById("show_bread_posts").checked,a=document.getElementById("show_bread_pages").checked;t||a?(jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display",""),"txt"==(e=document.getElementById("bc_separator").value)?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==e?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))):(jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckAlbumNavigatorWidgetLink(){var e=document.getElementById("album_navigator_widget_linktype").value;"lightbox"==e?jQuery(".wppa_anwlp").css("visibility","hidden"):jQuery(".wppa_anwlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_anwlb").css("visibility","hidden"):jQuery(".wppa_anwlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}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),a=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",a)}function checkAll(e,t){var a=document.getElementById(e);a&&(a.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 i=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,i.open("GET",o,!0),i.send(),i.onreadystatechange=function(){switch(i.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==i.status?("ER"==(e=wppaTrim(i.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 '+i.status+": "+i.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(){if(4==p.readyState)if(200==p.status){var e=wppaTrim(p.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("remark-"+t).innerHTML=e[2];break;default:document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"}}function wppaAjaxUpdateIptc(s,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+s+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");switch(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"99":jQuery("#photoitem-"+s).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);break;default:var n,i,o,r=JSON.parse(p[2]);for(n in r)switch(o=r[n],n){case"remark":o=(o=(o=o.replace(/</g,"<")).replace(/>/g,">")).replace(/\\/g,""),i="0"!=p[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+s).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(s,l,e,u,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");switch(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+p[2]+"</span>"+d);break;default:var n,i,o,r=JSON.parse(p[2]);for(n in r)switch(o=r[n],n){case"remark":o=(o=(o=o.replace(/</g,"<")).replace(/>/g,">")).replace(/\\/g,""),i="0"!=p[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",u&&(i+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none");break;default:jQuery("#"+n+"-"+s).html(o)}}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){u?document.location.reload(!0):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"),u&&setTimeout(function(){document.location.reload(!0)},200))}})}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",document.getElementById("wppa-dummy")))}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 i=wppaAlbumUpdateMatrix.length,o=0,r=!1,s=-1;o<i;)wppaAlbumUpdateMatrix[o][0]==e&&wppaAlbumUpdateMatrix[o][1]==t&&(r=!0,s=o),o++;r||(wppaAlbumUpdateMatrix[i]=[e,t,"undefined",!1,!1,p],s=i),wppaAlbumUpdateMatrix[s][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[s][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,s,l,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+s+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(l),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==s&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){var p=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(p[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+r).html='<span style="color:red">'+p[2]+" ("+p[1]+")</span>"}if(void 0!==p[3]&&wppaProcessFull(p[3],p[4]),c&&"0"==p[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"==s&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var n=0,i=-1,o=wppaAlbumUpdateMatrix.length;n<o;)wppaAlbumUpdateMatrix[n][0]==r&&wppaAlbumUpdateMatrix[n][1]==s&&(i=n),n++;wppaAlbumUpdateMatrix[i][2]=l||0,wppaAlbumUpdateMatrix[i][4]=!1,wppaAlbumUpdateMatrix[i][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},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(),n=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(){if(4==p.readyState)if(200==p.status){var e=wppaTrim(p.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#remark-"+t).html(e[2]);break;default:jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")}else jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")},p.open("GET",n,!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("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status)switch(e[1]){case"0":jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2]),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default: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))}else 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(n,e,o){if(!o&&!e&&"yes"==document.getElementById(n+"_continue").value)return document.getElementById(n+"_continue").value="no",document.getElementById(n+"_button").value="Start!",void(0<jQuery("#"+n+"_togo").html()&&(jQuery("#"+n+"_status").html("Pausing..."),jQuery("#"+n+"_button").css("display","none")));o||(document.getElementById(n+"_continue").value="yes",document.getElementById(n+"_button").value="Stop!",""==jQuery("#"+n+"_status").html()&&jQuery("#"+n+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+n+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(o?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],i=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),i=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),i||"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?o||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+n+", Error = "+a+", status = "+t,"force"),jQuery("#"+n+"_status").html("Server error #"+(11-wppaAlwaysContinue));var p=!1;--wppaAlwaysContinue<1&&(p=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(p||0<wppaAlwaysContinue)&&("wppa_remake"==n&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==n&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==n&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+n+"', 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,a,p,n,i=.9*wppaWindowWidth(),o=wppaGetXmlHttp(),r=wppaAjaxUrl,s="action=wppa&wppa-action=maintenancepopup&slug="+e;s+="&wppa-nonce="+document.getElementById("wppa-nonce").value,o.open("POST",r,!1),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(s),4==o.readyState&&200==o.status&&(a=(t=wppaEntityDecode(o.responseText).split("|"))[0],t[0]="",p=t.join("|").substring(1),n={modal:!0,resizable:!0,width:i,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(p).dialog(n).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:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText))}function wppaAjaxUpdateOptionValue(l,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(l)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+l,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0])alert("The server returned unexpected output:\n"+p[0]);else{switch(p[1]){case"0":jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),p[3]&&alert(p[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),p[3]&&alert(p[3])}if(jQuery("#img_"+l.replace("#","H")).attr("title",p[2]),p[4])for(var n,i,o,r=p[4].split(";"),s=0;s<r.length;)n=r[s].split(":"),i=jQuery("#"+n[0]).html(),o=n[1],""!=i&&""==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("#"+n[0]).html(o),s++}},error:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+l).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=l&&"icon_corner_style"!=l||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=l&&"svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=l&&"ovl_svg_bg_color"!=l||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 wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){var a=document.getElementById(t);e&&(a.value?a.value+=","+e:a.value=e,"-clear-"==e&&(a.value=""))}function wppaRefresh(e){var t=new String(document.location).split("#")[0]+"#"+e;document.location=t}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,i=-2,o=0,r=!1,s=0;s<e.length;)0!=(a=e[s].valueOf())&&(o=n,a==++o?r=!0:r?(p+=n==i?t+n+t+a:t+t+n+t+a,r=!1):p+=t+a,r||(i=a,i++),n=a),s++;for(r&&(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,i=0;for(t=t||".",a=jQuery(e),i=n=0;n<a.length;)a[n].selected&&(p[i]=a[n].value,i++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){var a=jQuery("#"+t).val();0==a.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+a}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){var p=e.split("||");"0"==p[1]?document.location=p[2]:alert("Error: "+p[1]+"\n\n"+p[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(o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+o,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("|");jQuery("#"+o+"_togo").html(p[0]);var n=jQuery("#"+o+"_status").html(),i=p[1];""!=n&&""==i&&(i='<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("#"+o+"_status").html(i),setTimeout(function(){wppaAjaxUpdateTogo(o)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}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:"9999"}),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-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,n){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){var p=e.split("|");jQuery("#"+n).html(p[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 i(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=i,document.onmousemove=n}}
|
1 |
+
var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album",wppaCropper=[];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,i,t,o){document.getElementById("wppa-re-up-form-"+i);var a=document.getElementById("wppa-re-up-file-"+i),r=document.getElementById("wppa-re-up-butn-"+i);e.preventDefault();var p=a.files[0];if(p.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+p.name);else if(p.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+i).css("display","none");r.value="Uploading...",r.style.color="black";var n=new FormData;n.append("photo",p,p.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+i+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+i).value;s.open("POST",wppaAjaxUrl+l,!0),s.onload=function(){if(200===s.status){var e=wppaTrim(s.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>",o&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(a);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(p):jQuery("#photourl-"+i).attr("src",p),jQuery("#thumba-"+i).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+i).html(p),0<p.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+t+"-"+i).html(p)}r.value="Upload",jQuery("#re-up-"+i).css("display","none");break;case"99":document.getElementById("photoitem-"+i).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+i).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",r.value="Error occured",r.style.color="red"}}else alert("An error occurred!")},s.send(n)}else alert("File is not an image file!")}function wppaInitSettings(){wppaCheckBreadcrumb(),wppaCheckFullHalign(),wppaCheckUseThumbOpacity(),wppaCheckUseCoverOpacity(),wppaCheckThumbType(),wppaCheckThumbLink(),wppaCheckTopTenLink(),wppaCheckFeaTenLink(),wppaCheckLasTenLink(),wppaCheckThumbnailWLink(),wppaCheckCommentLink(),wppaCheckXphotoLink(),wppaCheckMphotoLink(),wppaCheckSphotoLink(),wppaCheckSlidePhotoLink(),wppaCheckSlideOnlyLink(),wppaCheckAlbumWidgetLink(),wppaCheckAlbumNavigatorWidgetLink(),wppaCheckSlideLink(),wppaCheckCoverImg(),wppaCheckPotdLink(),wppaCheckTagLink(),wppaCheckRating(),wppaCheckComments(),wppaCheckCustom(),wppaCheckResize(),wppaCheckNumbar(),wppaCheckWatermark(),wppaCheckPopup(),wppaCheckGravatar(),wppaCheckUserUpload(),wppaCheckAjax(),wppaCheckFotomoto(),wppaCheckLinkPageErr("sphoto"),wppaCheckLinkPageErr("mphoto"),wppaCheckLinkPageErr("xphoto"),wppaCheckLinkPageErr("topten_widget"),wppaCheckLinkPageErr("slideonly_widget"),wppaCheckLinkPageErr("potd"),wppaCheckLinkPageErr("comment_widget"),wppaCheckLinkPageErr("thumbnail_widget"),wppaCheckLinkPageErr("lasten_widget"),wppaCheckLinkPageErr("album_widget"),wppaCheckLinkPageErr("tagcloud"),wppaCheckLinkPageErr("multitag"),wppaCheckLinkPageErr("super_view"),wppaCheckSplitNamedesc(),wppaCheckShares(),wppaCheckCoverType(),wppaCheckNewpag(),wppaCheckCDN(),wppaCheckAutoPage(),wppaCheckGps(),wppaCheckFontPreview(),wppaCheckCheck("wppa_enable_video","wppa-video"),wppaCheckCheck("wppa_custom_fields","custfields"),wppaCheckCheck("wppa_album_custom_fields","albumcustfields"),wppaCheckCheck("wppa_new_mod_label_is_text","nmtxt"),wppaCheckCheck("wppa_coverphoto_responsive","cvpr"),wppaCheckSmWidgetLink();var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","X","Y");for(table=1;table<13;table++){var a=wppa_getCookie("table_"+table);for(("on"==a?wppaShowTable:wppaHideTable)(table),subtab=0;subtab<15;subtab++)"on"==(a=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]))&&wppaToggleSubTable(e[table-1],t[subtab]);wppaToggleSubTable(e[table-1],"Z")}}function wppaQuickSel(){var e=new Array("O","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII"),t=new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","X","Y");for(table=1;table<13;table++)for((table<13?wppaShowTable:wppaHideTable)(table),wppa_tablecookieoff(table),subtab=0;subtab<15;subtab++){cookie=wppa_getCookie("table_"+e[table-1]+"-"+t[subtab]),"on"==cookie&&wppaToggleSubTable(e[table-1],t[subtab]);var a=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<a.length&&(a.removeClass("wppa-none"),wppaSubTabOn[e[table-1]+"-"+t[subtab]]=!1,wppa_tablecookieoff(e[table-1]+"-"+t[subtab]))}if(tag1=jQuery("#wppa-quick-selbox-1").val(),tag2=jQuery("#wppa-quick-selbox-2").val(),"-"==tag1&&"-"==tag2)for(jQuery("._wppatag-").addClass("wppa-none"),table=1;table<13;table++)wppaHideTable(table);else"-"!=tag1&&jQuery("._wppatag-"+tag1).addClass("wppa-none"),"-"!=tag2&&jQuery("._wppatag-"+tag2).addClass("wppa-none")}function wppaToggleTable(e){"none"==jQuery("#wppa_table_"+e).css("display")?(jQuery("#wppa_table_"+e).css("display","inline"),wppa_tablecookieon(e)):(jQuery("#wppa_table_"+e).css("display","none"),wppa_tablecookieoff(e))}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible()});var wppaSubTabOn=new Array;function wppaToggleSubTable(e,t){wppaSubTabOn[e+"-"+t]?(jQuery(".wppa-"+e+"-"+t).addClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-help").css("display","none"),wppaSubTabOn[e+"-"+t]=!1,wppa_tablecookieoff(e+"-"+t)):(jQuery(".wppa-"+e+"-"+t).removeClass("wppa-none"),jQuery(".wppa-"+e+"-"+t+"-h").css("display",""),wppaSubTabOn[e+"-"+t]=!0,wppa_tablecookieon(e+"-"+t))}function wppaHideTable(e){jQuery("#wppa_table_"+e).css("display","none"),jQuery("#wppa_tableHide-"+e).css("display","none"),jQuery("#wppa_tableShow-"+e).css("display","inline"),wppa_tablecookieoff(e)}function wppaShowTable(e){jQuery("#wppa_table_"+e).css("display","block"),jQuery("#wppa_tableHide-"+e).css("display","inline"),jQuery("#wppa_tableShow-"+e).css("display","none"),wppa_tablecookieon(e)}var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaFollow(e,t){jQuery("#"+e).prop("checked")?jQuery("."+t).css("display",""):jQuery("."+t).css("display","none")}function wppaCheckCheck(e,t){var a=e.substring(5);document.getElementById(a).checked?(jQuery("."+t).css("display",""),jQuery(".-"+t).css("display","none")):(jQuery("."+t).css("display","none"),jQuery(".-"+t).css("display",""))}function wppaCheckSlideVideoControls(){"none"!=document.getElementById("slideshow_linktype").value&&alert("Warning! \nYou can not have video controls on a videoslide when there is a link on the slide.\nThe videoslide will not show controls and will also not autoplay")}function wppaCheckFotomoto(){document.getElementById("fotomoto_on").checked?jQuery(".wppa_fotomoto").css("display",""):jQuery(".wppa_fotomoto").css("display","none")}function wppaCheckFontPreview(){var e=document.getElementById("textual_watermark_font").value,t=document.getElementById("textual_watermark_type").value,a=wppaFontDirectory+"wmf"+e+"-"+t+".png",p=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",a),jQuery("#wm-type-preview").attr("src",p)}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 wppaCheckFullHalign(){var e=document.getElementById("fullsize").value,t=document.getElementById("colwidth").value,a=document.getElementById("fullvalign").value;e!=t&&"default"!=a?jQuery(".wppa_ha").css("display",""):jQuery(".wppa_ha").css("display","none"),"auto"==t?jQuery(".wppa_init_resp_width").css("display",""):jQuery(".wppa_init_resp_width").css("display","none")}function wppaCheckCDN(){var e=document.getElementById("cdn_service").value;"cloudinary"==e||"cloudinarymaintenance"==e?jQuery(".cloudinary").css("display",""):jQuery(".cloudinary").css("display","none")}function wppaCheckGps(){"wppa-plus-embedded"==document.getElementById("gpx_implementation").value?(jQuery(".wppa_gpx_native").css("display",""),jQuery(".wppa_gpx_plugin").css("display","none")):(jQuery(".wppa_gpx_native").css("display","none"),jQuery(".wppa_gpx_plugin").css("display",""))}function wppaCheckThumbType(){var e=document.getElementById("thumbtype").value;"default"==e&&(jQuery(".tt_normal").css("display",""),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),wppaCheckUseThumbOpacity()),"ascovers"!=e&&"ascovers-mcr"!=e||(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display",""),jQuery(".tt_always").css("display","")),"masonry"==e&&(jQuery(".tt_normal").css("display","none"),jQuery(".tt_ascovers").css("display","none"),jQuery(".tt_always").css("display",""),jQuery(".tt_masonry").css("display",""))}function wppaCheckAutoPage(){document.getElementById("auto_page").checked?jQuery(".autopage").css("display",""):jQuery(".autopage").css("display","none")}function wppaCheckUseThumbOpacity(){document.getElementById("use_thumb_opacity").checked?(jQuery(".thumb_opacity").css("color","#333"),jQuery(".thumb_opacity_html").css("visibility","visible")):(jQuery(".thumb_opacity").css("color","#999"),jQuery(".thumb_opacity_html").css("visibility","hidden"))}function wppaCheckUseCoverOpacity(){document.getElementById("use_cover_opacity").checked?(jQuery(".cover_opacity").css("color","#333"),jQuery(".cover_opacity_html").css("visibility","visible")):(jQuery(".cover_opacity").css("color","#999"),jQuery(".cover_opacity_html").css("visibility","hidden"))}function wppaCheckBreadcrumb(){var e,t=document.getElementById("show_bread_posts").checked,a=document.getElementById("show_bread_pages").checked;t||a?(jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display",""),"txt"==(e=document.getElementById("bc_separator").value)?(jQuery(".wppa_bc_txt").css("display",""),jQuery(".wppa_bc_url").css("display","none"),jQuery(".wppa_bc_txt_html").css("display",""),jQuery(".wppa_bc_url_html").css("display","none")):"url"==e?(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display",""),jQuery(".wppa_bc_txt_html").css("display","none"),jQuery(".wppa_bc_url_html").css("display","")):(jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))):(jQuery(".wppa_bc").css("display","none"),jQuery(".wppa_bc_txt").css("display","none"),jQuery(".wppa_bc_url").css("display","none"))}function wppaCheckRating(){document.getElementById("rating_on").checked?(jQuery(".wppa_rating").css("color","#333"),jQuery(".wppa_rating_html").css("visibility","visible"),jQuery(".wppa_rating_").css("display","")):(jQuery(".wppa_rating").css("color","#999"),jQuery(".wppa_rating_html").css("visibility","hidden"),jQuery(".wppa_rating_").css("display","none"))}function wppaCheckComments(){document.getElementById("show_comments").checked?(jQuery(".wppa_comment").css("color","#333"),jQuery(".wppa_comment_html").css("visibility","visible"),jQuery(".wppa_comment_").css("display","")):(jQuery(".wppa_comment").css("color","#999"),jQuery(".wppa_comment_html").css("visibility","hidden"),jQuery(".wppa_comment_").css("display","none"))}function wppaCheckAjax(){document.getElementById("allow_ajax").checked?jQuery(".wppa_allow_ajax_").css("display",""):jQuery(".wppa_allow_ajax_").css("display","none")}function wppaCheckShares(){document.getElementById("share_on").checked||document.getElementById("share_on_widget").checked||document.getElementById("share_on_lightbox").checked||document.getElementById("share_on_thumbs").checked||document.getElementById("share_on_mphoto").checked?jQuery(".wppa_share").css("display",""):jQuery(".wppa_share").css("display","none")}function wppaCheckCoverType(){var e=document.getElementById("cover_type").value;document.getElementById("coverphoto_pos").value;"imagefactory"==e||"imagefactory-mcr"==e?jQuery(".wppa_imgfact_").css("display",""):jQuery(".wppa_imgfact_").css("display","none")}function wppaCheckNewpag(){document.getElementById("newpag_create").checked?jQuery(".wppa_newpag").css("display",""):jQuery(".wppa_newpag").css("display","none")}function wppaCheckCustom(){document.getElementById("custom_on").checked?(jQuery(".wppa_custom").css("color","#333"),jQuery(".wppa_custom_html").css("visibility","visible"),jQuery(".wppa_custom_").css("display","")):(jQuery(".wppa_custom").css("color","#999"),jQuery(".wppa_custom_html").css("visibility","hidden"),jQuery(".wppa_custom_").css("display","none"))}function wppaCheckWidgetLink(){"-1"==document.getElementById("wlp").value?(jQuery(".wppa_wlu").css("display",""),jQuery(".wppa_wlt").css("visibility","hidden")):(jQuery(".wppa_wlu").css("display","none"),jQuery(".wppa_wlt").css("visibility","visible"))}function wppaCheckSmWidgetLink(){"home"==document.getElementById("widget_sm_linktype").value?jQuery(".wppa_smrp").css("visibility","hidden"):jQuery(".wppa_smrp").css("visibility","")}function wppaCheckThumbLink(){var e=document.getElementById("thumb_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlp").css("visibility","hidden"):jQuery(".wppa_tlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tlb").css("visibility","hidden"):jQuery(".wppa_tlb").css("visibility","visible")}function wppaCheckTopTenLink(){var e=document.getElementById("topten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlp").css("visibility","hidden"):jQuery(".wppa_ttlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ttlb").css("visibility","hidden"):jQuery(".wppa_ttlb").css("visibility","visible")}function wppaCheckFeaTenLink(){var e=document.getElementById("featen_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlp").css("visibility","hidden"):jQuery(".wppa_ftlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ftlb").css("visibility","hidden"):jQuery(".wppa_ftlb").css("visibility","visible")}function wppaCheckLasTenLink(){var e=document.getElementById("lasten_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlp").css("visibility","hidden"):jQuery(".wppa_ltlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_ltlb").css("visibility","hidden"):jQuery(".wppa_ltlb").css("visibility","visible")}function wppaCheckThumbnailWLink(){var e=document.getElementById("thumbnail_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlp").css("visibility","hidden"):jQuery(".wppa_tnlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_tnlb").css("visibility","hidden"):jQuery(".wppa_tnlb").css("visibility","visible")}function wppaCheckCommentLink(){var e=document.getElementById("comment_widget_linktype").value;"none"==e||"file"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlp").css("visibility","hidden"):jQuery(".wppa_cmlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_cmlb").css("visibility","hidden"):jQuery(".wppa_cmlb").css("visibility","visible")}function wppaCheckSlideOnlyLink(){var e=document.getElementById("slideonly_widget_linktype").value;"none"==e||"file"==e||"widget"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solp").css("visibility","hidden"):jQuery(".wppa_solp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_solb").css("visibility","hidden"):jQuery(".wppa_solb").css("visibility","visible")}function wppaCheckAlbumWidgetLink(){var e=document.getElementById("album_widget_linktype").value;"lightbox"==e?jQuery(".wppa_awlp").css("visibility","hidden"):jQuery(".wppa_awlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_awlb").css("visibility","hidden"):jQuery(".wppa_awlb").css("visibility","visible")}function wppaCheckAlbumNavigatorWidgetLink(){var e=document.getElementById("album_navigator_widget_linktype").value;"lightbox"==e?jQuery(".wppa_anwlp").css("visibility","hidden"):jQuery(".wppa_anwlp").css("visibility","visible"),"lightbox"==e?jQuery(".wppa_anwlb").css("visibility","hidden"):jQuery(".wppa_anwlb").css("visibility","visible")}function wppaCheckSlideLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckCoverImg(){var e=document.getElementById("coverimg_linktype").value;"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_covimgbl").css("visibility","hidden"):jQuery(".wppa_covimgbl").css("visibility","visible")}function wppaCheckPotdLink(){var e=document.getElementById("potd_linktype").value;"none"==e||"lightbox"==e||"file"==e||"custom"==e?jQuery(".wppa_potdlp").css("visibility","hidden"):jQuery(".wppa_potdlp").css("visibility","visible"),"none"==e||"lightbox"==e||"fullpopup"==e?jQuery(".wppa_potdlb").css("visibility","hidden"):jQuery(".wppa_potdlb").css("visibility","visible")}function wppaCheckTagLink(){document.getElementById("tagcloud_linktype").value}function wppaCheckMTagLink(){document.getElementById("multitag_linktype").value}function wppaCheckXphotoLink(){var e=document.getElementById("xphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_xlp").css("visibility","hidden"):jQuery(".wppa_xlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_xlb").css("visibility","hidden"):jQuery(".wppa_xlb").css("visibility","visible")}function wppaCheckMphotoLink(){var e=document.getElementById("mphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_mlp").css("visibility","hidden"):jQuery(".wppa_mlp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_mlb").css("visibility","hidden"):jQuery(".wppa_mlb").css("visibility","visible")}function wppaCheckSphotoLink(){var e=document.getElementById("sphoto_linktype").value;"none"==e||"file"==e||"lightbox"==e?jQuery(".wppa_slp").css("visibility","hidden"):jQuery(".wppa_slp").css("visibility","visible"),"none"==e||"lightbox"==e?jQuery(".wppa_slb").css("visibility","hidden"):jQuery(".wppa_slb").css("visibility","visible")}function wppaCheckSlidePhotoLink(){var e=document.getElementById("slideshow_linktype").value;"none"==e||"file"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslp").css("visibility","hidden"):jQuery(".wppa_sslp").css("visibility","visible"),"none"==e||"lightbox"==e||"lightboxsingle"==e||"fullpopup"==e?jQuery(".wppa_sslb").css("visibility","hidden"):jQuery(".wppa_sslb").css("visibility","visible")}function wppaCheckResize(){document.getElementById("resize_on_upload").checked?jQuery(".re_up").css("display",""):jQuery(".re_up").css("display","none")}function wppaCheckNumbar(){document.getElementById("show_slideshownumbar").checked?jQuery(".wppa_numbar").css("display",""):jQuery(".wppa_numbar").css("display","none")}function wppaCheckWatermark(){document.getElementById("watermark_on").checked?jQuery(".wppa_watermark").css("display",""):jQuery(".wppa_watermark").css("display","none")}function wppaCheckPopup(){document.getElementById("use_thumb_popup").checked?jQuery(".wppa_popup").css("display",""):jQuery(".wppa_popup").css("display","none")}function wppaCheckGravatar(){document.getElementById("comment_gravatar")&&("url"==document.getElementById("comment_gravatar").value?jQuery(".wppa_grav").css("display",""):jQuery(".wppa_grav").css("display","none"))}function wppaCheckUserUpload(){document.getElementById("user_upload_on").checked?jQuery(".wppa_feup").css("display",""):jQuery(".wppa_feup").css("display","none")}function wppaCheckSplitNamedesc(){document.getElementById("split_namedesc").checked?(jQuery(".swap_namedesc").css("display","none"),jQuery(".hide_empty").css("display","")):(jQuery(".swap_namedesc").css("display",""),jQuery(".hide_empty").css("display","none"))}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),a=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",a)}function checkAll(e,t){var a=document.getElementById(e);a&&(a.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 i=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,i.open("GET",o,!0),i.send(),i.onreadystatechange=function(){switch(i.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==i.status?("ER"==(e=wppaTrim(i.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 '+i.status+": "+i.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(){if(4==p.readyState)if(200==p.status){var e=wppaTrim(p.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("remark-"+t).innerHTML=e[2];break;default:document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"}}function wppaAjaxUpdateIptc(s,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+s+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");switch(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"99":jQuery("#photoitem-"+s).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);break;default:var n,i,o,r=JSON.parse(p[2]);for(n in r)switch(o=r[n],n){case"remark":o=(o=(o=o.replace(/</g,"<")).replace(/>/g,">")).replace(/\\/g,""),i="0"!=p[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+s).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(s,l,e,u,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+s).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#remark-"+s).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");switch(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+p[2]+"</span>"+d);break;default:var n,i,o,r=JSON.parse(p[2]);for(n in r)switch(o=r[n],n){case"remark":o=(o=(o=o.replace(/</g,"<")).replace(/>/g,">")).replace(/\\/g,""),i="0"!=p[1]?'<span style="color:red;" >'+o+"</span>":'<span style="color:green;" >'+o+"</span>",u&&(i+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+s).html(i);break;case"photourl":wppaCropper[s]?wppaCropper[s].replace(o):jQuery("#photourl-"+s).attr("src",o),jQuery("#thumba-"+s).attr("href",o);break;case"thumburl":jQuery("#thumburl-"+s).attr("src",o);break;case"magickstack":jQuery("#magickstack-"+s).html(o),0<o.length?jQuery("#imstackbutton-"+s).css("display","inline"):jQuery("#imstackbutton-"+s).css("display","none");break;default:jQuery("#"+n+"-"+s).html(o)}}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){u?document.location.reload(!0):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"),u&&setTimeout(function(){document.location.reload(!0)},200))}})}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",document.getElementById("wppa-dummy")))}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 i=wppaAlbumUpdateMatrix.length,o=0,r=!1,s=-1;o<i;)wppaAlbumUpdateMatrix[o][0]==e&&wppaAlbumUpdateMatrix[o][1]==t&&(r=!0,s=o),o++;r||(wppaAlbumUpdateMatrix[i]=[e,t,"undefined",!1,!1,p],s=i),wppaAlbumUpdateMatrix[s][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[s][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,s,l,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+s+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(l),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==s&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){var p=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),p[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(p[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+r).html='<span style="color:red">'+p[2]+" ("+p[1]+")</span>"}if(void 0!==p[3]&&wppaProcessFull(p[3],p[4]),c&&"0"==p[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"==s&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var n=0,i=-1,o=wppaAlbumUpdateMatrix.length;n<o;)wppaAlbumUpdateMatrix[n][0]==r&&wppaAlbumUpdateMatrix[n][1]==s&&(i=n),n++;wppaAlbumUpdateMatrix[i][2]=l||0,wppaAlbumUpdateMatrix[i][4]=!1,wppaAlbumUpdateMatrix[i][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},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(),n=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(){if(4==p.readyState)if(200==p.status){var e=wppaTrim(p.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#remark-"+t).html(e[2]);break;default:jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")}else jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")},p.open("GET",n,!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("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status)switch(e[1]){case"0":jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2]),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default: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))}else 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(n,e,o){if(!o&&!e&&"yes"==document.getElementById(n+"_continue").value)return document.getElementById(n+"_continue").value="no",document.getElementById(n+"_button").value="Start!",void(0<jQuery("#"+n+"_togo").html()&&(jQuery("#"+n+"_status").html("Pausing..."),jQuery("#"+n+"_button").css("display","none")));o||(document.getElementById(n+"_continue").value="yes",document.getElementById(n+"_button").value="Stop!",""==jQuery("#"+n+"_status").html()&&jQuery("#"+n+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+n+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(o?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],i=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),i=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),i||"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?o||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+n+", Error = "+a+", status = "+t,"force"),jQuery("#"+n+"_status").html("Server error #"+(11-wppaAlwaysContinue));var p=!1;--wppaAlwaysContinue<1&&(p=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(p||0<wppaAlwaysContinue)&&("wppa_remake"==n&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==n&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==n&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+n+"', 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,a,p,n,i=.9*wppaWindowWidth(),o=wppaGetXmlHttp(),r=wppaAjaxUrl,s="action=wppa&wppa-action=maintenancepopup&slug="+e;s+="&wppa-nonce="+document.getElementById("wppa-nonce").value,o.open("POST",r,!1),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(s),4==o.readyState&&200==o.status&&(a=(t=wppaEntityDecode(o.responseText).split("|"))[0],t[0]="",p=t.join("|").substring(1),n={modal:!0,resizable:!0,width:i,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(p).dialog(n).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:"9999"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText))}function wppaAjaxUpdateOptionValue(l,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(l)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+l,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0])alert("The server returned unexpected output:\n"+p[0]);else{switch(p[1]){case"0":jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),p[3]&&alert(p[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),p[3]&&alert(p[3])}if(jQuery("#img_"+l.replace("#","H")).attr("title",p[2]),p[4])for(var n,i,o,r=p[4].split(";"),s=0;s<r.length;)n=r[s].split(":"),i=jQuery("#"+n[0]).html(),o=n[1],""!=i&&""==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("#"+n[0]).html(o),s++}},error:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+l).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=l&&"icon_corner_style"!=l||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=l&&"svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=l&&"ovl_svg_bg_color"!=l||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 wppaCheckLinkPageErr(e){var t="nil";document.getElementById(e+"_linktype")&&(t=document.getElementById(e+"_linktype").value),"0"!=document.getElementById(e+"_linkpage").value||"nil"!=t&&"photo"!=t&&"single"!=t&&"album"!=t&&"content"!=t&&"slide"!=t&&"plainpage"!=t?jQuery("#"+e+"-err").css({display:"none"}):jQuery("#"+e+"-err").css({display:""})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){var a=document.getElementById(t);e&&(a.value?a.value+=","+e:a.value=e,"-clear-"==e&&(a.value=""))}function wppaRefresh(e){var t=new String(document.location).split("#")[0]+"#"+e;document.location=t}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,i=-2,o=0,r=!1,s=0;s<e.length;)0!=(a=e[s].valueOf())&&(o=n,a==++o?r=!0:r?(p+=n==i?t+n+t+a:t+t+n+t+a,r=!1):p+=t+a,r||(i=a,i++),n=a),s++;for(r&&(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,i=0;for(t=t||".",a=jQuery(e),i=n=0;n<a.length;)a[n].selected&&(p[i]=a[n].value,i++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){var a=jQuery("#"+t).val();0==a.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+a}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){var p=e.split("||");"0"==p[1]?document.location=p[2]:alert("Error: "+p[1]+"\n\n"+p[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(o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+o,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("|");jQuery("#"+o+"_togo").html(p[0]);var n=jQuery("#"+o+"_status").html(),i=p[1];""!=n&&""==i&&(i='<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("#"+o+"_status").html(i),setTimeout(function(){wppaAjaxUpdateTogo(o)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||0==e)))}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:"9999"}),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-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,n){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){var p=e.split("|");jQuery("#"+n).html(p[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 i(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=i,document.onmousemove=n}}
|
js/wppa-all.js
CHANGED
@@ -13,4 +13,4 @@ var wppaJsPopupVersion="7.5.03";function wppaPopUp(p,t,e,r,a,i,o,n,d,s){var c,l,
|
|
13 |
// wppa-touch
|
14 |
var wppaJsTouchVersion="7.5.03",wppaTriggerElementID=null,wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaMinLength=72,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0,wppaMobileTimeStart=0;function wppaStartTime(){var p=(new Date).getTime();return wppaMobileTimeStart=p,!0}function wppaInTime(){return(new Date).getTime()-wppaMobileTimeStart<250}function wppaTapLink(p,e){wppaInTime()&&(_bumpClickCount(p),document.location.href=e)}function wppaTouchStart(p,e,a){-1==(wppaSwipeMocc=a)&&(wppaSwipeOnLightbox=!0,p.preventDefault()),1==(wppaFingerCount=p.touches.length)?(wppaStartX=p.touches[0].pageX,wppaStartY=p.touches[0].pageY,wppaTriggerElementID=e):wppaTouchCancel()}function wppaTouchMove(p){wppaSwipeOnLightbox&&p.preventDefault(),1==p.touches.length?(wppaCurX=p.touches[0].pageX,wppaCurY=p.touches[0].pageY):wppaTouchCancel()}function wppaTouchEnd(p){wppaSwipeOnLightbox&&p.preventDefault(),1==wppaFingerCount&&0!=wppaCurX&&(wppaSwipeLength=Math.round(Math.sqrt(Math.pow(wppaCurX-wppaStartX,2)+Math.pow(wppaCurY-wppaStartY,2))),wppaMinLength<=wppaSwipeLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaTriggerElementID=wppaSwipeDirection=wppaSwipeAngle=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=wppaSwipeLength=wppaVertDiff=wppaHorzDiff=wppaDeltaY=wppaDeltaX=wppaCurY=wppaCurX=wppaStartY=wppaStartX=wppaFingerCount=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,a=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));(wppaSwipeAngle=Math.round(180*a/Math.PI))<0&&(wppaSwipeAngle=360-Math.abs(wppaSwipeAngle))}function wppaDetermineSwipeDirection(){wppaSwipeDirection=wppaSwipeAngle<=45&&0<=wppaSwipeAngle||wppaSwipeAngle<=360&&315<=wppaSwipeAngle?"left":135<=wppaSwipeAngle&&wppaSwipeAngle<=225?"right":45<wppaSwipeAngle&&wppaSwipeAngle<135?"down":"up"}function wppaProcessingRoutine(){document.getElementById(wppaTriggerElementID);if(wppaSwipeOnLightbox)"left"==wppaSwipeDirection?wppaOvlShowNext():"right"==wppaSwipeDirection&&wppaOvlShowPrev();else{if("right"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]-1,idx<0){if(!wppaSlideWrap)return;idx=_wppaSlides[wppaSwipeMocc].length-1}wppaGotoKeepState(wppaSwipeMocc,idx)}if("left"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]+1,idx==_wppaSlides[wppaSwipeMocc].length){if(!wppaSlideWrap)return;idx=0}wppaGotoKeepState(wppaSwipeMocc,idx)}}wppaTouchCancel()}
|
15 |
// wppa-zoom
|
16 |
-
function wppaDoZoomPan(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=
|
13 |
// wppa-touch
|
14 |
var wppaJsTouchVersion="7.5.03",wppaTriggerElementID=null,wppaFingerCount=0,wppaStartX=0,wppaStartY=0,wppaCurX=0,wppaCurY=0,wppaDeltaX=0,wppaDeltaY=0,wppaHorzDiff=0,wppaVertDiff=0,wppaMinLength=72,wppaSwipeLength=0,wppaSwipeAngle=null,wppaSwipeDirection=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=0,wppaMobileTimeStart=0;function wppaStartTime(){var p=(new Date).getTime();return wppaMobileTimeStart=p,!0}function wppaInTime(){return(new Date).getTime()-wppaMobileTimeStart<250}function wppaTapLink(p,e){wppaInTime()&&(_bumpClickCount(p),document.location.href=e)}function wppaTouchStart(p,e,a){-1==(wppaSwipeMocc=a)&&(wppaSwipeOnLightbox=!0,p.preventDefault()),1==(wppaFingerCount=p.touches.length)?(wppaStartX=p.touches[0].pageX,wppaStartY=p.touches[0].pageY,wppaTriggerElementID=e):wppaTouchCancel()}function wppaTouchMove(p){wppaSwipeOnLightbox&&p.preventDefault(),1==p.touches.length?(wppaCurX=p.touches[0].pageX,wppaCurY=p.touches[0].pageY):wppaTouchCancel()}function wppaTouchEnd(p){wppaSwipeOnLightbox&&p.preventDefault(),1==wppaFingerCount&&0!=wppaCurX&&(wppaSwipeLength=Math.round(Math.sqrt(Math.pow(wppaCurX-wppaStartX,2)+Math.pow(wppaCurY-wppaStartY,2))),wppaMinLength<=wppaSwipeLength&&(wppaCalculateAngle(),wppaDetermineSwipeDirection(),wppaProcessingRoutine())),wppaTouchCancel()}function wppaTouchCancel(){wppaTriggerElementID=wppaSwipeDirection=wppaSwipeAngle=null,wppaSwipeOnLightbox=!1,wppaSwipeMocc=wppaSwipeLength=wppaVertDiff=wppaHorzDiff=wppaDeltaY=wppaDeltaX=wppaCurY=wppaCurX=wppaStartY=wppaStartX=wppaFingerCount=0}function wppaCalculateAngle(){var p=wppaStartX-wppaCurX,e=wppaCurY-wppaStartY,a=(Math.round(Math.sqrt(Math.pow(p,2)+Math.pow(e,2))),Math.atan2(e,p));(wppaSwipeAngle=Math.round(180*a/Math.PI))<0&&(wppaSwipeAngle=360-Math.abs(wppaSwipeAngle))}function wppaDetermineSwipeDirection(){wppaSwipeDirection=wppaSwipeAngle<=45&&0<=wppaSwipeAngle||wppaSwipeAngle<=360&&315<=wppaSwipeAngle?"left":135<=wppaSwipeAngle&&wppaSwipeAngle<=225?"right":45<wppaSwipeAngle&&wppaSwipeAngle<135?"down":"up"}function wppaProcessingRoutine(){document.getElementById(wppaTriggerElementID);if(wppaSwipeOnLightbox)"left"==wppaSwipeDirection?wppaOvlShowNext():"right"==wppaSwipeDirection&&wppaOvlShowPrev();else{if("right"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]-1,idx<0){if(!wppaSlideWrap)return;idx=_wppaSlides[wppaSwipeMocc].length-1}wppaGotoKeepState(wppaSwipeMocc,idx)}if("left"==wppaSwipeDirection){if(idx=_wppaCurIdx[wppaSwipeMocc]+1,idx==_wppaSlides[wppaSwipeMocc].length){if(!wppaSlideWrap)return;idx=0}wppaGotoKeepState(wppaSwipeMocc,idx)}}wppaTouchCancel()}
|
15 |
// wppa-zoom
|
16 |
+
function wppaDoZoomPan(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=1,r.busy=!1,r.abort=!1,r.itemid=r.mocc+"-"+r.id,r.div=h("#wppa-pan-div-"+r.itemid),r.canvas=document.getElementById("wppa-pan-canvas-"+r.itemid),r.left=h("#wppa-pctl-left-"+r.itemid),r.right=h("#wppa-pctl-right-"+r.itemid),r.up=h("#wppa-pctl-up-"+r.itemid),r.down=h("#wppa-pctl-down-"+r.itemid),r.zoomin=h("#wppa-pctl-zoomin-"+r.itemid),r.zoomout=h("#wppa-pctl-zoomout-"+r.itemid),r.prev=h("#wppa-pctl-prev-"+r.itemid),r.next=h("#wppa-pctl-next-"+r.itemid),r.canvasWidth=r.width,r.canvasHeight=r.height,r.savedCanvasX=0,r.savedCanvasY=0,r.fromHeight=r.image.height,r.fromWidth=r.image.width,r.imageRatio=r.image.width/r.image.height,r.fromX=0,r.fromY=0,r.centerX=r.fromX+r.fromWidth/2,r.centerY=r.fromY+r.fromHeight/2,r.ctx=null,r.buttondown=!1,r.enableManual=!0,wppaIsMobile?(r.right.on("touchstart",n),r.right.on("touchend",l),r.left.on("touchstart",i),r.left.on("touchend",l),r.up.on("touchstart",p),r.up.on("touchend",l),r.down.on("touchstart",s),r.down.on("touchend",l),r.zoomin.on("touchstart",c),r.zoomin.on("touchend",l),r.zoomout.on("touchstart",m),r.zoomout.on("touchend",l),r.canvas.addEventListener("touchstart",v)):(r.canvas.addEventListener("mousedown",f),r.canvas.addEventListener("mousemove",g),r.canvas.addEventListener("mouseup",b),r.canvas.addEventListener("mouseout",b),document.getElementById("wppa-pan-canvas-"+r.itemid).addEventListener("wheel",d),r.right.on("mousedown",n),r.right.on("mouseup",l),r.left.on("mousedown",i),r.left.on("mouseup",l),r.up.on("mousedown",p),r.up.on("mouseup",l),r.down.on("mousedown",s),r.down.on("mouseup",l),r.zoomin.on("mousedown",c),r.zoomin.on("mouseup",l),r.zoomout.on("mousedown",m),r.zoomout.on("mouseup",l)),r.isLightbox&&(h("#wppa-fulls-btn").on("click",function(){abort=!0}),r.prev&&(r.prev.on("click",o),r.next.on("click",e))),h(window).on("DOMContentLoaded load resize orientationchange",w),u(t),w(),r.initialized=!0):a=!0);function u(a){if((r=wppaZoomableData[a]).isLightbox&&(wppaOvlOpen||(r.abort=!0)),r.abort)return r.ctx=null,void(r.prevctx=null);var t,o,e,n,i;0!=r.run&&(r.busy||(r.busy=!0,r.manualControl||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,o=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(o-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=o,r.fromHeight=t)),r.fromX=Math.max(0,Math.min(r.image.width-r.fromWidth,r.fromX)),r.fromY=Math.max(0,Math.min(r.image.height-r.fromHeight,r.fromY)),e=screen.width/screen.height,n=(1-r.image.width/r.fromWidth)*r.canvas.width/2,i=(1-r.image.height/r.fromHeight)*r.canvas.height/2,r.ctx=r.canvas.getContext("2d"),e>r.imageRatio&&t>r.image.height&&wppaIsFs()||e<=r.imageRatio&&o>r.image.width&&wppaIsFs()?(r.enableManual=!1,r.ctx.clearRect(0,0,r.canvas.width,r.canvas.height),r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,n,i,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"default"})):(r.enableManual=!0,r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,0,0,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"grab"})),wppaIsFs()?(r.fsMaskTop=i-(r.canvas.height-screen.height)/2,r.fsMaskLeft=n-(r.canvas.width-screen.width)/2,r.fsMaskBottom=screen.height-r.fsMaskTop,r.fsMaskRight=screen.width-r.fsMaskLeft):(r.fsMaskTop=0,r.fsMaskLeft=0,r.fsMaskBottom=0,r.fsMaskRight=0),r.busy=!1,0<r.run&&(r.manualControl?setTimeout(function(){u(a)},25):r.buttondown&&setTimeout(function(){u(a)},5)),r.run<2&&r.run--,r.initializing&&(r.initializing=!1,r.run--),wppaAdjustControlbar()))}function o(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowPrev())}function e(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowNext())}function n(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaX=3,r.buttondown=!0,u(t))}function i(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaX=-3,r.buttondown=!0,u(t))}function p(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaY=-3,r.buttondown=!0,u(t))}function s(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaY=3,r.buttondown=!0,u(t))}function c(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaFactor=1.005,r.buttondown=!0,u(t))}function m(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaFactor=.995,r.buttondown=!0,u(t))}function d(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=1,wppaZoomableData[t].deltaFactor=1+a.deltaY*wppaZoomableData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),u(t),setTimeout(function(){wppaZoomableData[t].deltaFactor=1},25),a.stopPropagation())}function l(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].deltaX=0,wppaZoomableData[t].deltaY=0,wppaZoomableData[t].deltaFactor=1,wppaZoomableData[t].isLightbox?wppaZoomableData[t].run--:wppaZoomableData[t].run=1,r.buttondown=!1)}function w(a){for(var t,o,e,n,i,r,p,s,c,m,d,l=0;l<wppaZoomableData.length;l++){wppaZoomableData[l]&&wppaZoomableData[l].canvas&&!wppaZoomableData[l].abort&&(o=(t=wppaZoomableData[l]).imageRatio,t.isLightbox?(h("#wppa-overlay-ic").css("display",""),r=(n=!wppaIsFs())?(i=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(i=screen.width,screen.height),p=parseInt(p),s=parseInt(s),d=(m=8)+(t.controls?t.icsize+10:0)+10,n?(m+=2*t.borderWidth,d+=2*t.borderWidth):m=40,n?c=(e=(i-m)/o<r-d)?(r-(s=(p=i-m)/o)-d)/2+20:(p=o*(r-(t.controls?t.icsize:0)-24),n&&(p-=24),s=p/o,20):(screenRatio=screen.width/screen.height,(e=screenRatio<o)?(p=(s=screen.height)*o,screen.width,c=0):(s=(p=screen.width)/o,c=(screen.height-s)/2,0)),h("#wppa-ovl-pan-container").css({marginTop:c}),h("#wppa-overlay-ic").css({marginTop:0}),t.canvasWidth=p,t.canvasHeight=s,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight,n?(h("#wppa-ovl-pan-container").css({backgroundColor:t.backgroundColor,padding:t.padding,borderRadius:t.borderRadius,borderWidth:t.borderWidth,width:p,marginLeft:0}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}),e?h("#wppa-overlay-ic").css({left:4}):h("#wppa-overlay-ic").css({left:(i-p)/2})):(h("#wppa-overlay-ic").css({marginLeft:0}),h("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:p,left:(i-p)/2,position:"fixed"}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}))):(t.canvasWidth=h(t.div).parent().width(),t.canvasHeight=t.canvasWidth/o,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight),t.run=2,u(l))}}function f(a){a.preventDefault();var t,o,e,n=jQuery(this).attr("data-mocc");wppaZoomableData[n]&&(t=wppaZoomableData[n],wppaIsFs()&&(o=a.screenX,e=a.screenY,(o<t.fsMaskLeft||o>t.fsMaskRight||e<t.fsMaskTop||e>t.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click")),t.enableManual&&(t.manualControl=!0,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY,t.run=2,u(n)))}function v(a){if(!r.isLightbox)return!0;if(!wppaIsFs())return!0;var t=a.touches[0].screenX,o=a.touches[0].screenY;return(t<r.fsMaskLeft||t>r.fsMaskRight||o<r.fsMaskTop||o>r.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click"),!0}function g(a){var t,o,e,n,i=jQuery(this).attr("data-mocc");!wppaZoomableData[i]||(t=wppaZoomableData[i]).manualControl&&(o=t.canvas.width/t.fromWidth,e=(t.savedCanvasX-a.offsetX)/o+t.fromX,n=(t.savedCanvasY-a.offsetY)/o+t.fromY,0<e&&0<n&&e+t.fromWidth<t.image.width&&n+t.fromHeight<t.image.height&&(t.fromX=e,t.fromY=n,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY))}function b(a){var t,o=jQuery(this).attr("data-mocc");!wppaZoomableData[o]||(t=wppaZoomableData[o]).manualControl&&(t.run=1,t.manualControl=!1)}a?setTimeout(function(){wppaDoZoomPan()},300):h("#wppa-ovl-spin").hide()}
|
js/wppa-zoom.js
CHANGED
@@ -27,7 +27,7 @@ function wppaDoZoomPan() {
|
|
27 |
args.deltaX = 0;
|
28 |
args.deltaY = 0;
|
29 |
args.deltaFactor = 1.0;
|
30 |
-
args.run =
|
31 |
args.busy = false;
|
32 |
args.abort = false;
|
33 |
args.itemid = args.mocc + '-' + args.id;
|
@@ -231,7 +231,7 @@ function wppaDoZoomPan() {
|
|
231 |
setTimeout(function(){render(mocc)},5);
|
232 |
}
|
233 |
}
|
234 |
-
if(args.run<
|
235 |
if (args.initializing ) {
|
236 |
args.initializing=false;
|
237 |
args.run--;
|
@@ -277,7 +277,7 @@ function wppaDoZoomPan() {
|
|
277 |
if ( ! wppaZoomableData[mocc] ) return;
|
278 |
|
279 |
e.preventDefault();
|
280 |
-
wppaZoomableData[mocc].run=
|
281 |
wppaZoomableData[mocc].deltaX=3;
|
282 |
args.buttondown=true;
|
283 |
render(mocc);
|
@@ -290,7 +290,7 @@ function wppaDoZoomPan() {
|
|
290 |
if ( ! wppaZoomableData[mocc] ) return;
|
291 |
|
292 |
e.preventDefault();
|
293 |
-
wppaZoomableData[mocc].run=
|
294 |
wppaZoomableData[mocc].deltaX=-3;
|
295 |
args.buttondown=true;
|
296 |
render(mocc);
|
@@ -303,7 +303,7 @@ function wppaDoZoomPan() {
|
|
303 |
if ( ! wppaZoomableData[mocc] ) return;
|
304 |
|
305 |
e.preventDefault();
|
306 |
-
wppaZoomableData[mocc].run=
|
307 |
wppaZoomableData[mocc].deltaY=-3;
|
308 |
args.buttondown=true;
|
309 |
render(mocc);
|
@@ -316,7 +316,7 @@ function wppaDoZoomPan() {
|
|
316 |
if ( ! wppaZoomableData[mocc] ) return;
|
317 |
|
318 |
e.preventDefault();
|
319 |
-
wppaZoomableData[mocc].run=
|
320 |
wppaZoomableData[mocc].deltaY=3;
|
321 |
args.buttondown=true;
|
322 |
render(mocc);
|
@@ -329,7 +329,7 @@ function wppaDoZoomPan() {
|
|
329 |
if ( ! wppaZoomableData[mocc] ) return;
|
330 |
|
331 |
e.preventDefault();
|
332 |
-
wppaZoomableData[mocc].run=
|
333 |
wppaZoomableData[mocc].deltaFactor=1.005;
|
334 |
args.buttondown=true;
|
335 |
render(mocc);
|
@@ -342,7 +342,7 @@ function wppaDoZoomPan() {
|
|
342 |
if ( ! wppaZoomableData[mocc] ) return;
|
343 |
|
344 |
e.preventDefault();
|
345 |
-
wppaZoomableData[mocc].run=
|
346 |
wppaZoomableData[mocc].deltaFactor=0.995;
|
347 |
args.buttondown=true;
|
348 |
render(mocc);
|
@@ -355,7 +355,7 @@ function wppaDoZoomPan() {
|
|
355 |
if ( ! wppaZoomableData[mocc] ) return;
|
356 |
|
357 |
e.preventDefault();
|
358 |
-
wppaZoomableData[mocc].run=
|
359 |
wppaZoomableData[mocc].deltaFactor = 1 + e.deltaY * wppaZoomableData[mocc].zoomsensitivity / ( wppaIsChrome ? 10000 : 1000 );
|
360 |
render(mocc);
|
361 |
setTimeout(function(){wppaZoomableData[mocc].deltaFactor = 1}, 25);
|
@@ -373,7 +373,7 @@ function wppaDoZoomPan() {
|
|
373 |
wppaZoomableData[mocc].deltaY=0;
|
374 |
wppaZoomableData[mocc].deltaFactor=1;
|
375 |
if ( wppaZoomableData[mocc].isLightbox ) wppaZoomableData[mocc].run--;
|
376 |
-
else wppaZoomableData[mocc].run=
|
377 |
args.buttondown=false;
|
378 |
}
|
379 |
|
@@ -513,7 +513,7 @@ function wppaDoZoomPan() {
|
|
513 |
|
514 |
}
|
515 |
|
516 |
-
args.run=
|
517 |
render(mocc);
|
518 |
}
|
519 |
|
@@ -523,7 +523,7 @@ function wppaDoZoomPan() {
|
|
523 |
args.canvasHeight = args.canvasWidth / imageRatio;
|
524 |
args.canvas.width = args.canvasWidth;
|
525 |
args.canvas.height = args.canvasHeight;
|
526 |
-
args.run=
|
527 |
render(mocc);
|
528 |
}
|
529 |
}
|
@@ -553,7 +553,7 @@ function wppaDoZoomPan() {
|
|
553 |
args.manualControl = true;
|
554 |
args.savedCanvasX = e.offsetX;
|
555 |
args.savedCanvasY = e.offsetY;
|
556 |
-
args.run=
|
557 |
render(mocc);
|
558 |
}
|
559 |
|
@@ -605,7 +605,7 @@ function wppaDoZoomPan() {
|
|
605 |
var args = wppaZoomableData[mocc];
|
606 |
|
607 |
if ( args.manualControl ) {
|
608 |
-
args.run=
|
609 |
args.manualControl = false;
|
610 |
}
|
611 |
}
|
27 |
args.deltaX = 0;
|
28 |
args.deltaY = 0;
|
29 |
args.deltaFactor = 1.0;
|
30 |
+
args.run = 1;
|
31 |
args.busy = false;
|
32 |
args.abort = false;
|
33 |
args.itemid = args.mocc + '-' + args.id;
|
231 |
setTimeout(function(){render(mocc)},5);
|
232 |
}
|
233 |
}
|
234 |
+
if(args.run<2)args.run--;
|
235 |
if (args.initializing ) {
|
236 |
args.initializing=false;
|
237 |
args.run--;
|
277 |
if ( ! wppaZoomableData[mocc] ) return;
|
278 |
|
279 |
e.preventDefault();
|
280 |
+
wppaZoomableData[mocc].run=2;
|
281 |
wppaZoomableData[mocc].deltaX=3;
|
282 |
args.buttondown=true;
|
283 |
render(mocc);
|
290 |
if ( ! wppaZoomableData[mocc] ) return;
|
291 |
|
292 |
e.preventDefault();
|
293 |
+
wppaZoomableData[mocc].run=2;
|
294 |
wppaZoomableData[mocc].deltaX=-3;
|
295 |
args.buttondown=true;
|
296 |
render(mocc);
|
303 |
if ( ! wppaZoomableData[mocc] ) return;
|
304 |
|
305 |
e.preventDefault();
|
306 |
+
wppaZoomableData[mocc].run=2;
|
307 |
wppaZoomableData[mocc].deltaY=-3;
|
308 |
args.buttondown=true;
|
309 |
render(mocc);
|
316 |
if ( ! wppaZoomableData[mocc] ) return;
|
317 |
|
318 |
e.preventDefault();
|
319 |
+
wppaZoomableData[mocc].run=2;
|
320 |
wppaZoomableData[mocc].deltaY=3;
|
321 |
args.buttondown=true;
|
322 |
render(mocc);
|
329 |
if ( ! wppaZoomableData[mocc] ) return;
|
330 |
|
331 |
e.preventDefault();
|
332 |
+
wppaZoomableData[mocc].run=2;
|
333 |
wppaZoomableData[mocc].deltaFactor=1.005;
|
334 |
args.buttondown=true;
|
335 |
render(mocc);
|
342 |
if ( ! wppaZoomableData[mocc] ) return;
|
343 |
|
344 |
e.preventDefault();
|
345 |
+
wppaZoomableData[mocc].run=2;
|
346 |
wppaZoomableData[mocc].deltaFactor=0.995;
|
347 |
args.buttondown=true;
|
348 |
render(mocc);
|
355 |
if ( ! wppaZoomableData[mocc] ) return;
|
356 |
|
357 |
e.preventDefault();
|
358 |
+
wppaZoomableData[mocc].run=1;
|
359 |
wppaZoomableData[mocc].deltaFactor = 1 + e.deltaY * wppaZoomableData[mocc].zoomsensitivity / ( wppaIsChrome ? 10000 : 1000 );
|
360 |
render(mocc);
|
361 |
setTimeout(function(){wppaZoomableData[mocc].deltaFactor = 1}, 25);
|
373 |
wppaZoomableData[mocc].deltaY=0;
|
374 |
wppaZoomableData[mocc].deltaFactor=1;
|
375 |
if ( wppaZoomableData[mocc].isLightbox ) wppaZoomableData[mocc].run--;
|
376 |
+
else wppaZoomableData[mocc].run=1;
|
377 |
args.buttondown=false;
|
378 |
}
|
379 |
|
513 |
|
514 |
}
|
515 |
|
516 |
+
args.run=2;
|
517 |
render(mocc);
|
518 |
}
|
519 |
|
523 |
args.canvasHeight = args.canvasWidth / imageRatio;
|
524 |
args.canvas.width = args.canvasWidth;
|
525 |
args.canvas.height = args.canvasHeight;
|
526 |
+
args.run=2;
|
527 |
render(mocc);
|
528 |
}
|
529 |
}
|
553 |
args.manualControl = true;
|
554 |
args.savedCanvasX = e.offsetX;
|
555 |
args.savedCanvasY = e.offsetY;
|
556 |
+
args.run=2;
|
557 |
render(mocc);
|
558 |
}
|
559 |
|
605 |
var args = wppaZoomableData[mocc];
|
606 |
|
607 |
if ( args.manualControl ) {
|
608 |
+
args.run=1;
|
609 |
args.manualControl = false;
|
610 |
}
|
611 |
}
|
js/wppa-zoom.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function wppaDoZoomPan(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=
|
1 |
+
function wppaDoZoomPan(){for(var r,h=jQuery,a=!1,t=0;t<wppaZoomableData.length;t++)void 0!==wppaZoomableData[t]&&((r=wppaZoomableData[t]).image.complete?r.initialized||((r=wppaZoomableData[t]).manualControl=!1,r.deltaX=0,r.deltaY=0,r.deltaFactor=1,r.run=1,r.busy=!1,r.abort=!1,r.itemid=r.mocc+"-"+r.id,r.div=h("#wppa-pan-div-"+r.itemid),r.canvas=document.getElementById("wppa-pan-canvas-"+r.itemid),r.left=h("#wppa-pctl-left-"+r.itemid),r.right=h("#wppa-pctl-right-"+r.itemid),r.up=h("#wppa-pctl-up-"+r.itemid),r.down=h("#wppa-pctl-down-"+r.itemid),r.zoomin=h("#wppa-pctl-zoomin-"+r.itemid),r.zoomout=h("#wppa-pctl-zoomout-"+r.itemid),r.prev=h("#wppa-pctl-prev-"+r.itemid),r.next=h("#wppa-pctl-next-"+r.itemid),r.canvasWidth=r.width,r.canvasHeight=r.height,r.savedCanvasX=0,r.savedCanvasY=0,r.fromHeight=r.image.height,r.fromWidth=r.image.width,r.imageRatio=r.image.width/r.image.height,r.fromX=0,r.fromY=0,r.centerX=r.fromX+r.fromWidth/2,r.centerY=r.fromY+r.fromHeight/2,r.ctx=null,r.buttondown=!1,r.enableManual=!0,wppaIsMobile?(r.right.on("touchstart",n),r.right.on("touchend",l),r.left.on("touchstart",i),r.left.on("touchend",l),r.up.on("touchstart",p),r.up.on("touchend",l),r.down.on("touchstart",s),r.down.on("touchend",l),r.zoomin.on("touchstart",c),r.zoomin.on("touchend",l),r.zoomout.on("touchstart",m),r.zoomout.on("touchend",l),r.canvas.addEventListener("touchstart",v)):(r.canvas.addEventListener("mousedown",f),r.canvas.addEventListener("mousemove",g),r.canvas.addEventListener("mouseup",b),r.canvas.addEventListener("mouseout",b),document.getElementById("wppa-pan-canvas-"+r.itemid).addEventListener("wheel",d),r.right.on("mousedown",n),r.right.on("mouseup",l),r.left.on("mousedown",i),r.left.on("mouseup",l),r.up.on("mousedown",p),r.up.on("mouseup",l),r.down.on("mousedown",s),r.down.on("mouseup",l),r.zoomin.on("mousedown",c),r.zoomin.on("mouseup",l),r.zoomout.on("mousedown",m),r.zoomout.on("mouseup",l)),r.isLightbox&&(h("#wppa-fulls-btn").on("click",function(){abort=!0}),r.prev&&(r.prev.on("click",o),r.next.on("click",e))),h(window).on("DOMContentLoaded load resize orientationchange",w),u(t),w(),r.initialized=!0):a=!0);function u(a){if((r=wppaZoomableData[a]).isLightbox&&(wppaOvlOpen||(r.abort=!0)),r.abort)return r.ctx=null,void(r.prevctx=null);var t,o,e,n,i;0!=r.run&&(r.busy||(r.busy=!0,r.manualControl||(r.fromX+=r.deltaX,r.fromY+=r.deltaY,t=r.fromHeight/r.deltaFactor,o=r.fromWidth/r.deltaFactor,50<t&&1!=r.deltaFactor&&(wppaIsFs()||t<=r.image.height)&&(r.fromX-=(o-r.fromWidth)/2,r.fromY-=(t-r.fromHeight)/2,r.fromWidth=o,r.fromHeight=t)),r.fromX=Math.max(0,Math.min(r.image.width-r.fromWidth,r.fromX)),r.fromY=Math.max(0,Math.min(r.image.height-r.fromHeight,r.fromY)),e=screen.width/screen.height,n=(1-r.image.width/r.fromWidth)*r.canvas.width/2,i=(1-r.image.height/r.fromHeight)*r.canvas.height/2,r.ctx=r.canvas.getContext("2d"),e>r.imageRatio&&t>r.image.height&&wppaIsFs()||e<=r.imageRatio&&o>r.image.width&&wppaIsFs()?(r.enableManual=!1,r.ctx.clearRect(0,0,r.canvas.width,r.canvas.height),r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,n,i,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"default"})):(r.enableManual=!0,r.ctx.drawImage(r.image,r.fromX,r.fromY,r.fromWidth,r.fromHeight,0,0,r.canvas.width,r.canvas.height),jQuery(r.canvas).css({cursor:"grab"})),wppaIsFs()?(r.fsMaskTop=i-(r.canvas.height-screen.height)/2,r.fsMaskLeft=n-(r.canvas.width-screen.width)/2,r.fsMaskBottom=screen.height-r.fsMaskTop,r.fsMaskRight=screen.width-r.fsMaskLeft):(r.fsMaskTop=0,r.fsMaskLeft=0,r.fsMaskBottom=0,r.fsMaskRight=0),r.busy=!1,0<r.run&&(r.manualControl?setTimeout(function(){u(a)},25):r.buttondown&&setTimeout(function(){u(a)},5)),r.run<2&&r.run--,r.initializing&&(r.initializing=!1,r.run--),wppaAdjustControlbar()))}function o(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowPrev())}function e(a){var t;a.preventDefault(),this.abort=!0,t||(t=!0,h("#wppa-overlay-ic").css({display:"none"}),h("#wppa-ovl-spin").show(),wppaOvlShowNext())}function n(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaX=3,r.buttondown=!0,u(t))}function i(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaX=-3,r.buttondown=!0,u(t))}function p(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaY=-3,r.buttondown=!0,u(t))}function s(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaY=3,r.buttondown=!0,u(t))}function c(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaFactor=1.005,r.buttondown=!0,u(t))}function m(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=2,wppaZoomableData[t].deltaFactor=.995,r.buttondown=!0,u(t))}function d(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].run=1,wppaZoomableData[t].deltaFactor=1+a.deltaY*wppaZoomableData[t].zoomsensitivity/(wppaIsChrome?1e4:1e3),u(t),setTimeout(function(){wppaZoomableData[t].deltaFactor=1},25),a.stopPropagation())}function l(a){var t=jQuery(this).attr("data-mocc");wppaZoomableData[t]&&(a.preventDefault(),wppaZoomableData[t].deltaX=0,wppaZoomableData[t].deltaY=0,wppaZoomableData[t].deltaFactor=1,wppaZoomableData[t].isLightbox?wppaZoomableData[t].run--:wppaZoomableData[t].run=1,r.buttondown=!1)}function w(a){for(var t,o,e,n,i,r,p,s,c,m,d,l=0;l<wppaZoomableData.length;l++){wppaZoomableData[l]&&wppaZoomableData[l].canvas&&!wppaZoomableData[l].abort&&(o=(t=wppaZoomableData[l]).imageRatio,t.isLightbox?(h("#wppa-overlay-ic").css("display",""),r=(n=!wppaIsFs())?(i=window.innerWidth?window.innerWidth:screen.width,window.innerHeight?window.innerHeight:screen.height):(i=screen.width,screen.height),p=parseInt(p),s=parseInt(s),d=(m=8)+(t.controls?t.icsize+10:0)+10,n?(m+=2*t.borderWidth,d+=2*t.borderWidth):m=40,n?c=(e=(i-m)/o<r-d)?(r-(s=(p=i-m)/o)-d)/2+20:(p=o*(r-(t.controls?t.icsize:0)-24),n&&(p-=24),s=p/o,20):(screenRatio=screen.width/screen.height,(e=screenRatio<o)?(p=(s=screen.height)*o,screen.width,c=0):(s=(p=screen.width)/o,c=(screen.height-s)/2,0)),h("#wppa-ovl-pan-container").css({marginTop:c}),h("#wppa-overlay-ic").css({marginTop:0}),t.canvasWidth=p,t.canvasHeight=s,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight,n?(h("#wppa-ovl-pan-container").css({backgroundColor:t.backgroundColor,padding:t.padding,borderRadius:t.borderRadius,borderWidth:t.borderWidth,width:p,marginLeft:0}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}),e?h("#wppa-overlay-ic").css({left:4}):h("#wppa-overlay-ic").css({left:(i-p)/2})):(h("#wppa-overlay-ic").css({marginLeft:0}),h("#wppa-ovl-pan-container").css({backgroundColor:"transparent",padding:0,borderRadius:0,borderWidth:0,width:p,left:(i-p)/2,position:"fixed"}),h("#wppa-pctl-div-"+t.itemid).css({marginLeft:0}))):(t.canvasWidth=h(t.div).parent().width(),t.canvasHeight=t.canvasWidth/o,t.canvas.width=t.canvasWidth,t.canvas.height=t.canvasHeight),t.run=2,u(l))}}function f(a){a.preventDefault();var t,o,e,n=jQuery(this).attr("data-mocc");wppaZoomableData[n]&&(t=wppaZoomableData[n],wppaIsFs()&&(o=a.screenX,e=a.screenY,(o<t.fsMaskLeft||o>t.fsMaskRight||e<t.fsMaskTop||e>t.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click")),t.enableManual&&(t.manualControl=!0,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY,t.run=2,u(n)))}function v(a){if(!r.isLightbox)return!0;if(!wppaIsFs())return!0;var t=a.touches[0].screenX,o=a.touches[0].screenY;return(t<r.fsMaskLeft||t>r.fsMaskRight||o<r.fsMaskTop||o>r.fsMaskBottom)&&jQuery("#wppa-overlay-bg").trigger("click"),!0}function g(a){var t,o,e,n,i=jQuery(this).attr("data-mocc");!wppaZoomableData[i]||(t=wppaZoomableData[i]).manualControl&&(o=t.canvas.width/t.fromWidth,e=(t.savedCanvasX-a.offsetX)/o+t.fromX,n=(t.savedCanvasY-a.offsetY)/o+t.fromY,0<e&&0<n&&e+t.fromWidth<t.image.width&&n+t.fromHeight<t.image.height&&(t.fromX=e,t.fromY=n,t.savedCanvasX=a.offsetX,t.savedCanvasY=a.offsetY))}function b(a){var t,o=jQuery(this).attr("data-mocc");!wppaZoomableData[o]||(t=wppaZoomableData[o]).manualControl&&(t.run=1,t.manualControl=!1)}a?setTimeout(function(){wppaDoZoomPan()},300):h("#wppa-ovl-spin").hide()}
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 7.5.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -3771,6 +3771,15 @@ global $wppa_opt;
|
|
3771 |
$value = trim( wppa_sanitize_tags( $value ), ',' );
|
3772 |
wppa_clear_taglist();
|
3773 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3774 |
|
3775 |
default:
|
3776 |
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 7.5.07
|
6 |
*
|
7 |
*/
|
8 |
|
3771 |
$value = trim( wppa_sanitize_tags( $value ), ',' );
|
3772 |
wppa_clear_taglist();
|
3773 |
break;
|
3774 |
+
case 'wppa_retry_mails':
|
3775 |
+
$all = array_merge( get_option( 'wppa_failed_mails', array() ), get_option( 'wppa_perm_failed_mails', array() ) );
|
3776 |
+
$value = max( $value, '1' );
|
3777 |
+
foreach( array_keys( $all ) as $key ) {
|
3778 |
+
$all[$key]['retry'] = $value;
|
3779 |
+
}
|
3780 |
+
update_option( 'wppa_failed_mails', $all );
|
3781 |
+
update_option( 'wppa_perm_failed_mails', array() );
|
3782 |
+
break;
|
3783 |
|
3784 |
default:
|
3785 |
|
wppa-cron.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
-
* Version 7.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -227,7 +227,7 @@ global $wppa_endtime;
|
|
227 |
if ( wppa_opt( 'retry_mails' ) ) {
|
228 |
|
229 |
$failed_mails = wppa_get_option( 'wppa_failed_mails' );
|
230 |
-
if ( is_array( $failed_mails ) ) {
|
231 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} retrying failed mails.' );
|
232 |
|
233 |
foreach( array_keys( $failed_mails ) as $key ) {
|
@@ -238,6 +238,8 @@ global $wppa_endtime;
|
|
238 |
// Retry
|
239 |
if ( wp_mail( $mail['to'], $mail['subj'], $mess, $mail['headers'], $mail['att'] ) ) {
|
240 |
|
|
|
|
|
241 |
// Set counter to 0
|
242 |
$failed_mails[$key]['retry'] = '0';
|
243 |
}
|
@@ -245,7 +247,14 @@ global $wppa_endtime;
|
|
245 |
|
246 |
// Decrease retry counter
|
247 |
$failed_mails[$key]['retry']--;
|
248 |
-
wppa_log( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
}
|
250 |
}
|
251 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all cron functions
|
6 |
+
* Version 7.5.07
|
7 |
*
|
8 |
*
|
9 |
*/
|
227 |
if ( wppa_opt( 'retry_mails' ) ) {
|
228 |
|
229 |
$failed_mails = wppa_get_option( 'wppa_failed_mails' );
|
230 |
+
if ( is_array( $failed_mails ) && count( $failed_mails ) ) {
|
231 |
wppa_log( 'Cron', '{b}wppa_cleanup{/b} retrying failed mails.' );
|
232 |
|
233 |
foreach( array_keys( $failed_mails ) as $key ) {
|
238 |
// Retry
|
239 |
if ( wp_mail( $mail['to'], $mail['subj'], $mess, $mail['headers'], $mail['att'] ) ) {
|
240 |
|
241 |
+
wppa_log( 'Eml', 'Retried mail to ' . $mail['to'] . ' succeeded.' );
|
242 |
+
|
243 |
// Set counter to 0
|
244 |
$failed_mails[$key]['retry'] = '0';
|
245 |
}
|
247 |
|
248 |
// Decrease retry counter
|
249 |
$failed_mails[$key]['retry']--;
|
250 |
+
wppa_log( 'Eml', 'Retried mail to ' . $mail['to'] . ' failed. Tries to go = ' . $failed_mails[$key]['retry'] );
|
251 |
+
|
252 |
+
// If no tries left, add to permanently failed
|
253 |
+
if ( $failed_mails[$key]['retry'] < '1' ) {
|
254 |
+
$perm_fail = get_option( 'wppa_perm_failed_mails', array() );
|
255 |
+
$perm_fail[] = $failed_mails[$key];
|
256 |
+
update_option( 'wppa_perm_failed_mails', $perm_fail );
|
257 |
+
}
|
258 |
}
|
259 |
}
|
260 |
|
wppa-defaults.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
-
* Version 7.5.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1020,7 +1020,7 @@ horizrailenabled:false,";
|
|
1020 |
'wppa_log_tim' => 'no',
|
1021 |
'wppa_moderate_bulk' => 'no', // B20
|
1022 |
'wppa_generator_max' => '100', // B21
|
1023 |
-
'wppa_retry_mails' => '
|
1024 |
'wppa_minimum_tags' => '', // A11
|
1025 |
'wppa_predef_tags_only' => 'no',
|
1026 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains default settings
|
6 |
+
* Version 7.5.07
|
7 |
*
|
8 |
*/
|
9 |
|
1020 |
'wppa_log_tim' => 'no',
|
1021 |
'wppa_moderate_bulk' => 'no', // B20
|
1022 |
'wppa_generator_max' => '100', // B21
|
1023 |
+
'wppa_retry_mails' => '2', // M100
|
1024 |
'wppa_minimum_tags' => '', // A11
|
1025 |
'wppa_predef_tags_only' => 'no',
|
1026 |
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 7.5.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1031,8 +1031,11 @@ global $wpdb;
|
|
1031 |
$data = $wpdb->get_var( $wpdb->prepare( "SELECT post_content FROM $wpdb->posts WHERE ID = %d", $pagid ) );
|
1032 |
$data = str_replace( array( ' ', ',', '.', "\t", "\r", "0", "x0B", "\n" ), ';', $data );
|
1033 |
$data = strip_tags( $data );
|
|
|
1034 |
$data = strip_shortcodes( $data );
|
1035 |
-
$data =
|
|
|
|
|
1036 |
$data = trim( $data, "; \t\n\r\0\x0B" );
|
1037 |
return $data;
|
1038 |
}
|
@@ -2245,9 +2248,8 @@ global $wpdb;
|
|
2245 |
}
|
2246 |
|
2247 |
// Log query
|
2248 |
-
|
2249 |
-
|
2250 |
-
wppa_log( 'war', 'Long query: ' . substr( htmlspecialchars( $query ), 0, 100 ) . '...' , true );
|
2251 |
}
|
2252 |
|
2253 |
// Process extended duplicate removal
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 7.5.07
|
7 |
*
|
8 |
*/
|
9 |
|
1031 |
$data = $wpdb->get_var( $wpdb->prepare( "SELECT post_content FROM $wpdb->posts WHERE ID = %d", $pagid ) );
|
1032 |
$data = str_replace( array( ' ', ',', '.', "\t", "\r", "0", "x0B", "\n" ), ';', $data );
|
1033 |
$data = strip_tags( $data );
|
1034 |
+
$data = str_replace( array( '<', '>' ), ' ', $data );
|
1035 |
$data = strip_shortcodes( $data );
|
1036 |
+
$data = str_replace( array( '&', "'" ), '', $data );
|
1037 |
+
$data = str_replace( array( '(', ')', '[', ']', '{', '}', ':', '=' ), ' ', $data );
|
1038 |
+
$data = wppa_sanitize_tags( $data );
|
1039 |
$data = trim( $data, "; \t\n\r\0\x0B" );
|
1040 |
return $data;
|
1041 |
}
|
2248 |
}
|
2249 |
|
2250 |
// Log query
|
2251 |
+
if ( strlen( $query ) > 25000 ) {
|
2252 |
+
wppa_log( 'war', 'Long query: ' . strlen($query) . ' chars. ' . substr( htmlspecialchars( $query ), 0, 100 ) . '...' , true );
|
|
|
2253 |
}
|
2254 |
|
2255 |
// Process extended duplicate removal
|
wppa-mailing.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Contains mailing functions
|
6 |
*
|
7 |
-
* Version 7.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -562,8 +562,8 @@ global $wpdb;
|
|
562 |
$users = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT user FROM $wpdb->wppa_comments WHERE photo = %d", $pho ) );
|
563 |
|
564 |
// If the current author is in the list: remove him, he is most likely already notified
|
565 |
-
if ( isset( $
|
566 |
-
unset( $
|
567 |
}
|
568 |
|
569 |
// Any users left?
|
@@ -1002,12 +1002,14 @@ function wppa_send_mail( $args ) {
|
|
1002 |
// Failed
|
1003 |
if ( ! wppa_is_cron() ) {
|
1004 |
echo 'Mail sending Failed';
|
1005 |
-
wppa_process_failed_mail( $to,
|
1006 |
-
$subject,
|
1007 |
-
$message,
|
1008 |
-
$headers,
|
1009 |
-
'' );
|
1010 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1011 |
}
|
1012 |
|
1013 |
// Compute mail id
|
@@ -1068,12 +1070,7 @@ function wppa_process_failed_mail( $to = '', $subject = '', $message = '', $head
|
|
1068 |
$id = wppa_get_mail_hash( $to, $subject, $message, $headers, $att );
|
1069 |
|
1070 |
// Get stack of failed mails
|
1071 |
-
$failed_mails = wppa_get_option( 'wppa_failed_mails' );
|
1072 |
-
|
1073 |
-
// If no failed mails yet, create array
|
1074 |
-
if ( ! is_array( $failed_mails ) ) {
|
1075 |
-
$failed_mails = array();
|
1076 |
-
}
|
1077 |
|
1078 |
// See if this mail appears in the failed mails list
|
1079 |
$found = false;
|
4 |
*
|
5 |
* Contains mailing functions
|
6 |
*
|
7 |
+
* Version 7.5.07
|
8 |
*
|
9 |
*/
|
10 |
|
562 |
$users = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT user FROM $wpdb->wppa_comments WHERE photo = %d", $pho ) );
|
563 |
|
564 |
// If the current author is in the list: remove him, he is most likely already notified
|
565 |
+
if ( isset( $users[$comment['user']] ) ) {
|
566 |
+
unset( $users[$comment['user']] );
|
567 |
}
|
568 |
|
569 |
// Any users left?
|
1002 |
// Failed
|
1003 |
if ( ! wppa_is_cron() ) {
|
1004 |
echo 'Mail sending Failed';
|
|
|
|
|
|
|
|
|
|
|
1005 |
}
|
1006 |
+
|
1007 |
+
// Registee failed mail
|
1008 |
+
wppa_process_failed_mail( $to,
|
1009 |
+
$subject,
|
1010 |
+
$message,
|
1011 |
+
$headers,
|
1012 |
+
'' );
|
1013 |
}
|
1014 |
|
1015 |
// Compute mail id
|
1070 |
$id = wppa_get_mail_hash( $to, $subject, $message, $headers, $att );
|
1071 |
|
1072 |
// Get stack of failed mails
|
1073 |
+
$failed_mails = wppa_get_option( 'wppa_failed_mails', array() );
|
|
|
|
|
|
|
|
|
|
|
1074 |
|
1075 |
// See if this mail appears in the failed mails list
|
1076 |
$found = false;
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 7.5.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -27,7 +27,7 @@ global $wp_version;
|
|
27 |
global $wppa_supported_camara_brands;
|
28 |
|
29 |
// Start test area
|
30 |
-
|
31 |
// End test area
|
32 |
|
33 |
// Initialize
|
@@ -9104,15 +9104,6 @@ global $wppa_supported_camara_brands;
|
|
9104 |
$tags = 'system,mail';
|
9105 |
wppa_setting($slug, '9.7', $name, $desc, $html, $help, $clas, $tags);
|
9106 |
|
9107 |
-
$name = __('Retry failed mails', 'wp-photo-album-plus');
|
9108 |
-
$desc = __('Select number of retries for failed mails', 'wp-photo-album-plus');
|
9109 |
-
$help = (__('Retries occur at the background every hour', 'wp-photo-album-plus'));
|
9110 |
-
$slug = 'wppa_retry_mails';
|
9111 |
-
$html = wppa_number($slug, '0', '10');
|
9112 |
-
$clas = '';
|
9113 |
-
$tags = 'system,mail';
|
9114 |
-
wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
|
9115 |
-
|
9116 |
$name = __('Minimum tags', 'wp-photo-album-plus');
|
9117 |
$desc = __('These tags exist even when they do not occur in any photo.', 'wp-photo-album-plus');
|
9118 |
$help = (__('Enter tags, separated by comma\'s (,)', 'wp-photo-album-plus'));
|
@@ -11541,6 +11532,49 @@ global $wppa_supported_camara_brands;
|
|
11541 |
$tags = 'mail';
|
11542 |
wppa_setting($slug, '99', $name, $desc, $html, $help, $clas, $tags);
|
11543 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11544 |
}
|
11545 |
|
11546 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 7.5.07
|
7 |
*
|
8 |
*/
|
9 |
|
27 |
global $wppa_supported_camara_brands;
|
28 |
|
29 |
// Start test area
|
30 |
+
|
31 |
// End test area
|
32 |
|
33 |
// Initialize
|
9104 |
$tags = 'system,mail';
|
9105 |
wppa_setting($slug, '9.7', $name, $desc, $html, $help, $clas, $tags);
|
9106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9107 |
$name = __('Minimum tags', 'wp-photo-album-plus');
|
9108 |
$desc = __('These tags exist even when they do not occur in any photo.', 'wp-photo-album-plus');
|
9109 |
$help = (__('Enter tags, separated by comma\'s (,)', 'wp-photo-album-plus'));
|
11532 |
$tags = 'mail';
|
11533 |
wppa_setting($slug, '99', $name, $desc, $html, $help, $clas, $tags);
|
11534 |
|
11535 |
+
$name = __('Retry failed mails', 'wp-photo-album-plus');
|
11536 |
+
$desc = __('Select number of retries for failed mails', 'wp-photo-album-plus');
|
11537 |
+
$help = (__('Retries occur at the background every hour', 'wp-photo-album-plus'));
|
11538 |
+
$slug = 'wppa_retry_mails';
|
11539 |
+
$html = wppa_number($slug, '1', '24');
|
11540 |
+
$clas = '';
|
11541 |
+
$tags = 'mail';
|
11542 |
+
wppa_setting($slug, '100', $name, $desc, $html, $help, $clas, $tags);
|
11543 |
+
|
11544 |
+
$mails = get_option( 'wppa_failed_mails', array() );
|
11545 |
+
if ( count( $mails ) ) {
|
11546 |
+
wppa_setting_subheader( 'X', '1', __( 'Failed mails', 'wp-photo-album-plus' ) );
|
11547 |
+
$i = 0;
|
11548 |
+
foreach( $mails as $mail ) {
|
11549 |
+
$i++;
|
11550 |
+
echo '
|
11551 |
+
<tr class="wppa-setting wppa-IX-X" >
|
11552 |
+
<td>' . $i . '</td>
|
11553 |
+
<td>' . $mail['to'] . '</td>
|
11554 |
+
<td>' . $mail['subj'] . '</td>
|
11555 |
+
<td style="max-width:40%" >' . strip_tags( $mail['message'] ) . '</td>
|
11556 |
+
<td>' . $mail['retry'] . '</td>
|
11557 |
+
</tr>';
|
11558 |
+
}
|
11559 |
+
}
|
11560 |
+
|
11561 |
+
$mails = get_option( 'wppa_perm_failed_mails', array() );
|
11562 |
+
if ( count( $mails ) ) {
|
11563 |
+
wppa_setting_subheader( 'Y', '1', __( 'Permanently failed mails', 'wp-photo-album-plus' ) );
|
11564 |
+
$i = 0;
|
11565 |
+
foreach( $mails as $mail ) {
|
11566 |
+
$i++;
|
11567 |
+
echo '
|
11568 |
+
<tr class="wppa-setting wppa-IX-Y" >
|
11569 |
+
<td>' . $i . '</td>
|
11570 |
+
<td>' . $mail['to'] . '</td>
|
11571 |
+
<td>' . $mail['subj'] . '</td>
|
11572 |
+
<td style="max-width:40%" >' . strip_tags( $mail['message'] ) . '</td>
|
11573 |
+
<td>' . $mail['retry'] . '</td>
|
11574 |
+
</tr>';
|
11575 |
+
}
|
11576 |
+
}
|
11577 |
+
|
11578 |
}
|
11579 |
|
11580 |
|
wppa-utils.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
-
* Version 7.5.
|
7 |
*
|
8 |
*/
|
9 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
+
* Version 7.5.07
|
7 |
*
|
8 |
*/
|
9 |
|
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: 7.5.07.
|
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_revno; $wppa_revno = '7507'; // WPPA db version
|
27 |
-
global $wppa_api_version; $wppa_api_version = '7.5.07.
|
28 |
|
29 |
/* Init page js data */
|
30 |
global $wppa_js_page_data; $wppa_js_page_data = '';
|
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: 7.5.07.007
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
24 |
|
25 |
/* WPPA GLOBALS */
|
26 |
global $wppa_revno; $wppa_revno = '7507'; // WPPA db version
|
27 |
+
global $wppa_api_version; $wppa_api_version = '7.5.07.007'; // WPPA software version
|
28 |
|
29 |
/* Init page js data */
|
30 |
global $wppa_js_page_data; $wppa_js_page_data = '';
|