WP Photo Album Plus - Version 6.9.05

Version Description

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

Release Info

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

Code changes from version 6.9.04 to 6.9.05

changelog.txt CHANGED
@@ -1,6 +1,24 @@
1
  WP Photo Album Plus Changelog
2
 
3
- = 6.9.04 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  = Bug Fixes =
6
 
1
  WP Photo Album Plus Changelog
2
 
3
+ = 6.9.05 =
4
+
5
+ = Bug Fixes =
6
+
7
+ * Uploading by shortcode withut album spec succeeded but resulted in a blank page. Fixed.
8
+ * Sub album cover links to empty albums caused division by zero errors. Fixed.
9
+
10
+ = New Features =
11
+
12
+ * Table I-C10: Thumbnail area max size. A number > 1 means pixels, a number < 1 means a fraction of the viewport height.
13
+ * Table I-C11: Use nicescroller. Use nicescroller on thumbnail area that has been limited in size due to Table I-C10.
14
+ * Table IV-A32: Nice scroll on window. Use nicescroller on the window.
15
+ * Table IV-A33: Nice scroll configuration options
16
+
17
+ = Other Changes =
18
+
19
+ * Admin will no longer receive notification emails reporting his own comments.
20
+
21
+ = 6.9.04 =
22
 
23
  = Bug Fixes =
24
 
img/wppa-logo-bw.jpg ADDED
Binary file
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 6.9.03
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -12,6 +12,14 @@ var wppaImageDirectory;
12
  var wppaAjaxUrl;
13
  var wppaUploadToThisAlbum = 'Upload to this album';
14
 
 
 
 
 
 
 
 
 
15
  /* Check if jQuery library revision is high enough, othewise give a message and uncheck checkbox elm */
16
  function checkjQueryRev(msg, elm, rev){
17
  var version = parseFloat(jQuery.fn.jquery);
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 6.9.05
5
  /* Various js routines used in admin pages
6
  */
7
 
12
  var wppaAjaxUrl;
13
  var wppaUploadToThisAlbum = 'Upload to this album';
14
 
15
+ // Init at dom ready
16
+ jQuery( document ).ready(function() {
17
+
18
+ // Make Lazy load images visible
19
+ jQuery(window).on('DOMContentLoaded load resize scroll', wppaMakeLazyVisible);
20
+ wppaMakeLazyVisible();
21
+ });
22
+
23
  /* Check if jQuery library revision is high enough, othewise give a message and uncheck checkbox elm */
24
  function checkjQueryRev(msg, elm, rev){
25
  var version = parseFloat(jQuery.fn.jquery);
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";function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).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":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}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(),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");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<12;subtab++)"on"==(p=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(table):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 p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.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))}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 p=e.substring(5);document.getElementById(p).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,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",a=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",a)}function wppaCheckWidgetMethod(){var e,t;if("4"==document.getElementById("wppa-wm").value){document.getElementById("wppa-wp").style.visibility="visible";var p=jQuery("#wppa-wp").val();"day-of-week"==p||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")}else document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden");if("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,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?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=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;if(e||t){jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display","");var p=document.getElementById("bc_separator").value;"txt"==p?(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"==p?(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"))}else 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 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),p=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",p)}function checkAll(e,t){var p=document.getElementById(e);p&&(p.checked?jQuery(t).prop("checked","checked"):jQuery(t).prop("checked",""))}function impUpd(e,t){e.checked?(jQuery(t).prop("value",wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).prop("value",wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",o="";a=e||'<div style="padding-left:5px;" >',p?o=p:aftrer="</div>",wppaFeAjaxLog("in");var n=wppaGetXmlHttp(),i=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==n.status){var e=wppaTrim(n.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==p.status){var e=wppaTrim(p.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(o+="&wppa-watermark-file="+e),p&&(o+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("photostatus-"+t).innerHTML=e[2];break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}var wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array;function wppaAjaxUpdatePhoto(e,t,p,a,o){var n=!1;o&&(n=0==jQuery("#wppaphotodesc"+o+":visible").length,jQuery("#wppaphotodesc"+o+"-html").click(),n&&jQuery("#wppaphotodesc"+o+"-tmce").click());for(var i=wppaPhotoUpdateMatrix.length,s=0,l=!1,r=-1;s<i;)wppaPhotoUpdateMatrix[s][0]==e&&wppaPhotoUpdateMatrix[s][1]==t&&(l=!0,r=s),s++;if(!l){wppaPhotoUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],r=i}wppaPhotoUpdateMatrix[r][3]="number"==typeof p?p:p.value,wppaPhotoUpdateMatrix[r][5]=a,wppaAjaxUpdatePhotoMonitor()}function wppaAjaxUpdateDelphoto(e,t,p){wppaAjaxUpdatePhoto(e,"del"+t,p)}function wppaAjaxUpdatePhotoMonitor(){for(var e=wppaPhotoUpdateMatrix.length,t=0;t<e;)wppaPhotoUpdateMatrix[t][2]==wppaPhotoUpdateMatrix[t][3]||wppaPhotoUpdateMatrix[t][4]||(wppaPhotoUpdateMatrix[t][4]=!0,_wppaAjaxUpdatePhoto(wppaPhotoUpdateMatrix[t][0],wppaPhotoUpdateMatrix[t][1],wppaPhotoUpdateMatrix[t][3],wppaPhotoUpdateMatrix[t][5])),t++}function _wppaAjaxUpdatePhoto(s,l,r,u,c,d){c||(c=""),d||(d="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[s]||(wppaAjaxPhotoCount[s]=0),wppaAjaxPhotoCount[s]++,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(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxPhotoCount[s]--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":var o;if(0==wppaAjaxPhotoCount[s]?jQuery("#photostatus-"+s).html(a[2]):jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")"),a[3])(o=jQuery("#fs-a-"+s).attr("href").split("="))[1]=parseInt(o[1])+1,jQuery("#fs-a-"+s).attr("href",o[0]+"="+o[1]),jQuery("#fs-img-"+s).attr("src",o[0]+"="+o[1]);if(a[4])(o=jQuery("#tnp-"+s).attr("src").split("="))[1]=parseInt(o[1])+1,jQuery("#tnp-"+s).attr("src",o[0]+"="+o[1]);void 0!==a[5]&&(jQuery("#imstack-"+s).html(a[5]),0<a[5].length?jQuery("#imstackbutton-"+s).css("display",""):jQuery("#imstackbutton-"+s).css("display","none")),void 0!==a[6]&&jQuery("#dispfileinfo-"+s).html(a[6]);break;case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);break;default:jQuery("#photostatus-"+s).html('<span style="color:red">'+a[2]+" ("+a[1]+")</span>")}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"});var n=0,i=-1;for(count=wppaPhotoUpdateMatrix.length;n<count;)wppaPhotoUpdateMatrix[n][0]==s&&wppaPhotoUpdateMatrix[n][1]==l&&(i=n),n++;if(wppaPhotoUpdateMatrix[i]&&(wppaPhotoUpdateMatrix[i][2]=r||0,wppaPhotoUpdateMatrix[i][4]=!1,wppaPhotoUpdateMatrix[i][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),u&&"0"==a[1])return jQuery("#photostatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+s)},1e3)},error:function(e,t,p){wppaAjaxPhotoCount[s]--,jQuery("#photostatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",document.getElementById("wppa-dummy")))}_wppaRefreshAfter=!1;var wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var o=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var n=wppaAlbumUpdateMatrix.length,i=0,s=!1,l=-1;i<n;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(s=!0,l=i),i++;if(!s){wppaAlbumUpdateMatrix[n]=[e,t,"undefined",!1,!1,a],l=n}wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(o)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(s,l,r,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+s).html(a[2]):jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+s).html='<span style="color:red">'+a[2]+" ("+a[1]+")</span>"}if(void 0!==a[3]&&wppaProcessFull(a[3],a[4]),c&&"0"==a[1])return jQuery("#albumstatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==l&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var o=0,n=-1,i=wppaAlbumUpdateMatrix.length;o<i;)wppaAlbumUpdateMatrix[o][0]==s&&wppaAlbumUpdateMatrix[o][1]==l&&(n=o),o++;wppaAlbumUpdateMatrix[n][2]=r||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}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,p,e){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]);break;default:jQuery("#photostatus-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")}else jQuery("#photostatus-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.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: "+p.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 = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(o,e,i){if(i);else if(!e&&"yes"==document.getElementById(o+"_continue").value)return document.getElementById(o+"_continue").value="no",document.getElementById(o+"_button").value="Start!",void(0<jQuery("#"+o+"_togo").html()&&(jQuery("#"+o+"_status").html("Pausing..."),jQuery("#"+o+"_button").css("display","none")));i||(document.getElementById(o+"_continue").value="yes",document.getElementById(o+"_button").value="Stop!",""==jQuery("#"+o+"_status").html()&&jQuery("#"+o+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+o+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(i?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),o=a[1],n=!1;return o?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),n=!0),jQuery("#"+o+"_status").html(a[2]),jQuery("#"+o+"_togo").html(a[3]),jQuery("#"+o+"_button").css("display",""),n||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+o+"', false)",20):void("yes"!=document.getElementById(o+"_continue").value?i||jQuery("#"+o+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+o+"', 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,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+o+", Error = "+p+", status = "+t,"force"),jQuery("#"+o+"_status").html("Server error #"+(11-wppaAlwaysContinue));var a=!1;--wppaAlwaysContinue<1&&(a=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(a||0<wppaAlwaysContinue)&&("wppa_remake"==o&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==o&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==o&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+o+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*jQuery(window).width(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=p.responseText,i={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(n).dialog(i).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"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(r,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(r)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+r,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0])alert("The server returned unexpected output:\n"+a[0]);else{switch(a[1]){case"0":jQuery("#img_"+r).attr("src",wppaImageDirectory+"tick.png"),a[3]&&alert(a[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),a[3]&&alert(a[3])}if(jQuery("#img_"+r).attr("title",a[2]),a[4])for(var o,n,i,s=a[4].split(";"),l=0;l<s.length;)o=s[l].split(":"),n=jQuery("#"+o[0]).html(),i=o[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[0]).html(i),l++}},error:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+r).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=r&&"icon_corner_style"!=r||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=r&&"svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=r&&"ovl_svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){var t;if(void 0!==e){if("number"==typeof e)return e;var p=(t=(t=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0;for(t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}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 window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=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 p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"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 p=document.getElementById(t);e&&(p.value?p.value+=","+e:p.value=e,"-clear-"==e&&(p.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 p,a="",o=-1,n=-2,i=0,s=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=o,p==++i?s=!0:s?(a+=o==n?t+o+t+p:t+t+o+t+p,s=!1):a+=t+p,s||(n=p,n++),o=p),l++;for(s&&(a+=".."+o);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}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 p,a=[],o=0,n=0;for(t||(t="."),p=jQuery(e),n=o=0;o<p.length;)p[o].selected&&(a[n]=p[o].value,n++),o++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){var p=jQuery("#"+t).val();0==p.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+p}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){var a=e.split("||");"0"==a[1]?document.location=a[2]:alert("Error: "+a[1]+"\n\n"+a[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(i){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+i,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+i+"_togo").html(a[0]);var o=jQuery("#"+i+"_status").html(),n=a[1];""!=o&&""==n&&(n='<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("#"+i+"_status").html(n),setTimeout(function(){wppaAjaxUpdateTogo(i)},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,o){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,p){var a=e.split("|");jQuery("#"+o).html(a[0])},error:function(e){},complete:function(e){}})}
1
+ var wppaImageDirectory,wppaAjaxUrl,wppa_moveup_url="#",wppa_import="Import",wppa_update="Update",wppaUploadToThisAlbum="Upload to this album";function checkjQueryRev(e,t,p){var a=parseFloat(jQuery.fn.jquery);t.checked&&a<p&&(alert(e+"\nThe version of your jQuery library: "+a+" is too low for this feature. It requires version "+p),t.checked="")}function wppaReUpload(e,t,p){document.getElementById("wppa-re-up-form-"+t);var a=document.getElementById("wppa-re-up-file-"+t),o=document.getElementById("wppa-re-up-butn-"+t);e.preventDefault();var n=a.files[0];if(n.type.match("image.*")){if(0==p.length)alert("Filename will be set to "+n.name);else if(n.name!=p&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+t).css("display","none");o.value="Uploading...",o.style.color="black";var i=new FormData;i.append("photo",n,n.name);var s=new XMLHttpRequest,l="?action=wppa&wppa-action=update-photo&photo-id="+t+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+t).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":jQuery("#photostatus-"+t).html(e[2]),o.value="Upload",jQuery("#re-up-"+t).css("display","none");break;case"99":document.getElementById("photoitem-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",o.value="Error occured",o.style.color="red"}}else alert("An error occurred!")},s.send(i)}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(),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");for(table=1;table<13;table++){var p=wppa_getCookie("table_"+table);for("on"==p?wppaShowTable(table):wppaHideTable(table),subtab=0;subtab<12;subtab++)"on"==(p=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(table):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 p=jQuery(".wppa-"+e[table-1]+"-"+t[subtab]);0<p.length&&(p.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 p=e.substring(5);document.getElementById(p).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,p=wppaFontDirectory+"wmf"+e+"-"+t+".png",a=wppaFontDirectory+"wmf"+t+"-"+e+".png";jQuery("#wm-font-preview").attr("src",p),jQuery("#wm-type-preview").attr("src",a)}function wppaCheckWidgetMethod(){var e,t;if("4"==document.getElementById("wppa-wm").value){document.getElementById("wppa-wp").style.visibility="visible";var p=jQuery("#wppa-wp").val();"day-of-week"==p||"day-of-month"==p||"day-of-year"==p?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")}else document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden");if("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,p=document.getElementById("fullvalign").value;e!=t&&"default"!=p?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=document.getElementById("show_bread_posts").checked,t=document.getElementById("show_bread_pages").checked;if(e||t){jQuery(".wppa_bc").css("display",""),jQuery(".wppa_bc_html").css("display","");var p=document.getElementById("bc_separator").value;"txt"==p?(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"==p?(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"))}else 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 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),p=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",p)}function checkAll(e,t){var p=document.getElementById(e);p&&(p.checked?jQuery(t).prop("checked","checked"):jQuery(t).prop("checked",""))}function impUpd(e,t){e.checked?(jQuery(t).prop("value",wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).prop("value",wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,p){var a="",o="";a=e||'<div style="padding-left:5px;" >',p?o=p:aftrer="</div>",wppaFeAjaxLog("in");var n=wppaGetXmlHttp(),i=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;i+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,n.open("GET",i,!0),n.send(),n.onreadystatechange=function(){switch(n.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==n.status){var e=wppaTrim(n.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=a+e[2]+o,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=a+'<span style="color:red;" >Comm error '+n.status+": "+n.statusText+"</span>"+o}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,p.open("GET",e,!0),p.send(),p.onreadystatechange=function(){switch(p.readyState){case 1:document.getElementById("photostatus-"+t).innerHTML="server connection established";break;case 2:document.getElementById("photostatus-"+t).innerHTML="request received";break;case 3:document.getElementById("photostatus-"+t).innerHTML="processing request";break;case 4:if(200==p.status){var e=wppaTrim(p.responseText).split("||");"ER"==e[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("photostatus-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")}else document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,p){wppaFeAjaxLog("in");var a=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var o="action=wppa&wppa-action=watermark-photo&photo-id="+t;o+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(o+="&wppa-watermark-file="+e),p&&(o+="&wppa-watermark-pos="+p),a.open("POST",wppaAjaxUrl,!0),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o),a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":document.getElementById("photostatus-"+t).innerHTML=e[2];break;default:document.getElementById("photostatus-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>"}jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")}else document.getElementById("photostatus-"+t).innerHTML='<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"}}var wppaAjaxPhotoCount=new Array,wppaPhotoUpdateMatrix=new Array;function wppaAjaxUpdatePhoto(e,t,p,a,o){var n=!1;o&&(n=0==jQuery("#wppaphotodesc"+o+":visible").length,jQuery("#wppaphotodesc"+o+"-html").click(),n&&jQuery("#wppaphotodesc"+o+"-tmce").click());for(var i=wppaPhotoUpdateMatrix.length,s=0,l=!1,r=-1;s<i;)wppaPhotoUpdateMatrix[s][0]==e&&wppaPhotoUpdateMatrix[s][1]==t&&(l=!0,r=s),s++;if(!l){wppaPhotoUpdateMatrix[i]=[e,t,"undefined",!1,!1,a],r=i}wppaPhotoUpdateMatrix[r][3]="number"==typeof p?p:p.value,wppaPhotoUpdateMatrix[r][5]=a,wppaAjaxUpdatePhotoMonitor()}function wppaAjaxUpdateDelphoto(e,t,p){wppaAjaxUpdatePhoto(e,"del"+t,p)}function wppaAjaxUpdatePhotoMonitor(){for(var e=wppaPhotoUpdateMatrix.length,t=0;t<e;)wppaPhotoUpdateMatrix[t][2]==wppaPhotoUpdateMatrix[t][3]||wppaPhotoUpdateMatrix[t][4]||(wppaPhotoUpdateMatrix[t][4]=!0,_wppaAjaxUpdatePhoto(wppaPhotoUpdateMatrix[t][0],wppaPhotoUpdateMatrix[t][1],wppaPhotoUpdateMatrix[t][3],wppaPhotoUpdateMatrix[t][5])),t++}function _wppaAjaxUpdatePhoto(s,l,r,u,c,d){c||(c=""),d||(d="");wppaFeAjaxLog("in"),wppaAjaxPhotoCount[s]||(wppaAjaxPhotoCount[s]=0),wppaAjaxPhotoCount[s]++,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(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxPhotoCount[s]--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":var o;if(0==wppaAjaxPhotoCount[s]?jQuery("#photostatus-"+s).html(a[2]):jQuery("#photostatus-"+s).html("Working, please wait... ("+wppaAjaxPhotoCount[s]+")"),a[3])(o=jQuery("#fs-a-"+s).attr("href").split("="))[1]=parseInt(o[1])+1,jQuery("#fs-a-"+s).attr("href",o[0]+"="+o[1]),jQuery("#fs-img-"+s).attr("src",o[0]+"="+o[1]);if(a[4])(o=jQuery("#tnp-"+s).attr("src").split("="))[1]=parseInt(o[1])+1,jQuery("#tnp-"+s).attr("src",o[0]+"="+o[1]);void 0!==a[5]&&(jQuery("#imstack-"+s).html(a[5]),0<a[5].length?jQuery("#imstackbutton-"+s).css("display",""):jQuery("#imstackbutton-"+s).css("display","none")),void 0!==a[6]&&jQuery("#dispfileinfo-"+s).html(a[6]);break;case"99":jQuery("#photoitem-"+s).html(c+'<span style="color:red">'+a[2]+"</span>"+d);break;default:jQuery("#photostatus-"+s).html('<span style="color:red">'+a[2]+" ("+a[1]+")</span>")}"description"==l&&jQuery("#wppa-photo-spin-"+s).css({visibility:"hidden"});var n=0,i=-1;for(count=wppaPhotoUpdateMatrix.length;n<count;)wppaPhotoUpdateMatrix[n][0]==s&&wppaPhotoUpdateMatrix[n][1]==l&&(i=n),n++;if(wppaPhotoUpdateMatrix[i]&&(wppaPhotoUpdateMatrix[i][2]=r||0,wppaPhotoUpdateMatrix[i][4]=!1,wppaPhotoUpdateMatrix[i][5]=!1),wppaFeAjaxLog("out"),wppaAjaxUpdatePhotoMonitor(),u&&"0"==a[1])return jQuery("#photostatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-photo-spin-"+s).css({visibility:"visible"}),void setTimeout(function(){wppaReload("#photo_"+s)},1e3)},error:function(e,t,p){wppaAjaxPhotoCount[s]--,jQuery("#photostatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdatePhoto failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",document.getElementById("wppa-dummy")))}_wppaRefreshAfter=!1;var wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,p,a){var o=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var n=wppaAlbumUpdateMatrix.length,i=0,s=!1,l=-1;i<n;)wppaAlbumUpdateMatrix[i][0]==e&&wppaAlbumUpdateMatrix[i][1]==t&&(s=!0,l=i),i++;if(!s){wppaAlbumUpdateMatrix[n]=[e,t,"undefined",!1,!1,a],l=n}wppaAlbumUpdateMatrix[l][3]="number"==typeof p?p:p.value,wppaAlbumUpdateMatrix[l][5]=a,wppaAjaxUpdateAlbumMonitor(o)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,p=0;p<t;)wppaAlbumUpdateMatrix[p][2]==wppaAlbumUpdateMatrix[p][3]||wppaAlbumUpdateMatrix[p][4]||(wppaAlbumUpdateMatrix[p][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[p][0],wppaAlbumUpdateMatrix[p][1],wppaAlbumUpdateMatrix[p][3],e,wppaAlbumUpdateMatrix[p][5])),p++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(s,l,r,u,c){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+s+"&item="+l+"&wppa-nonce="+document.getElementById("album-nonce-"+s).value+"&value="+wppaEncode(r),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,p){var a=wppaTrim(e).split("||");switch(wppaAjaxAlbumCount--,""!=a[0]&&alert("The server returned unexpected output:\n"+a[0]),a[1]){case"0":0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+s).html(a[2]):jQuery("#albumstatus-"+s).html("Working, please wait... ("+wppaAjaxAlbumCount+")");break;default:jQuery("#albumstatus-"+s).html='<span style="color:red">'+a[2]+" ("+a[1]+")</span>"}if(void 0!==a[3]&&wppaProcessFull(a[3],a[4]),c&&"0"==a[1])return jQuery("#albumstatus-"+s).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==l&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var o=0,n=-1,i=wppaAlbumUpdateMatrix.length;o<i;)wppaAlbumUpdateMatrix[o][0]==s&&wppaAlbumUpdateMatrix[o][1]==l&&(n=o),o++;wppaAlbumUpdateMatrix[n][2]=r||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(u)},error:function(e,t,p){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+s).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+p+", status = "+t,"force")},complete:function(e,t,p){}})}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,p,e){var a=wppaGetXmlHttp(),o=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+p+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;a.onreadystatechange=function(){if(4==a.readyState)if(200==a.status){var e=wppaTrim(a.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":jQuery("#photostatus-"+t).html(e[2]);break;default:jQuery("#photostatus-"+t).html('<span style="color:red">'+e[2]+"</span>")}jQuery("#wppa-comment-spin-"+p).css("visibility","hidden")}else jQuery("#photostatus-"+t).html('<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>")},a.open("GET",o,!0),a.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var p=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;a+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?a+="&value=yes":a+="&value=no",p.onreadystatechange=function(){switch(p.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(p.responseText).split("||");if(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=p.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: "+p.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 = "+p.status);wppaCheckInconsistencies()}},p.open("GET",a,!0),p.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(o,e,i){if(i);else if(!e&&"yes"==document.getElementById(o+"_continue").value)return document.getElementById(o+"_continue").value="no",document.getElementById(o+"_button").value="Start!",void(0<jQuery("#"+o+"_togo").html()&&(jQuery("#"+o+"_status").html("Pausing..."),jQuery("#"+o+"_button").css("display","none")));i||(document.getElementById(o+"_continue").value="yes",document.getElementById(o+"_button").value="Stop!",""==jQuery("#"+o+"_status").html()&&jQuery("#"+o+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+o+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(i?"&wppa-cron":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("||"),o=a[1],n=!1;return o?(10<a[0].length&&(alert("An error occurred:\n"+a[0]),n=!0),jQuery("#"+o+"_status").html(a[2]),jQuery("#"+o+"_togo").html(a[3]),jQuery("#"+o+"_button").css("display",""),n||"0"==a[3]?"reload"==a[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+o+"', false)",20):void("yes"!=document.getElementById(o+"_continue").value?i||jQuery("#"+o+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+o+"', 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,p){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+o+", Error = "+p+", status = "+t,"force"),jQuery("#"+o+"_status").html("Server error #"+(11-wppaAlwaysContinue));var a=!1;--wppaAlwaysContinue<1&&(a=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(a||0<wppaAlwaysContinue)&&("wppa_remake"==o&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==o&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==o&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+o+"', true)",2e3))},complete:function(e,t,p){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":"Search index table";break;case"wppa_list_errorlog":"WPPA+ Error log";break;case"wppa_list_rating":"Recent ratings";break;case"wppa_list_session":"Active sessions";break;case"wppa_list_comments":"Recent comments"}var t=.9*jQuery(window).width(),p=wppaGetXmlHttp(),a=wppaAjaxUrl,o="action=wppa&wppa-action=maintenancepopup&slug="+e;if(o+="&wppa-nonce="+document.getElementById("wppa-nonce").value,p.open("POST",a,!1),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(o),4==p.readyState&&200==p.status){var n=p.responseText,i={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText};jQuery("#wppa-modal-container").html(n).dialog(i).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"}),jQuery(".ui-button").attr("title",wppaCloseText)}}function wppaAjaxUpdateOptionValue(r,e,t){var p="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(r)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(p+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+r,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,p){var a=wppaTrim(e).split("||");if(""!=a[0])alert("The server returned unexpected output:\n"+a[0]);else{switch(a[1]){case"0":jQuery("#img_"+r).attr("src",wppaImageDirectory+"tick.png"),a[3]&&alert(a[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0));break;default:jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),a[3]&&alert(a[3])}if(jQuery("#img_"+r).attr("title",a[2]),a[4])for(var o,n,i,s=a[4].split(";"),l=0;l<s.length;)o=s[l].split(":"),n=jQuery("#"+o[0]).html(),i=o[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[0]).html(i),l++}},error:function(e){jQuery("#img_"+r).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+r).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=r&&"icon_corner_style"!=r||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=r&&"svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=r&&"ovl_svg_bg_color"!=r||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){var t;if(void 0!==e){if("number"==typeof e)return e;var p=(t=(t=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0;for(t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}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 window.XMLHttpRequest?xmlhttp=new XMLHttpRequest:xmlhttp=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 p=0;p<t.length;)"jpg"!=t[p]&&"JPG"!=t[p]||jQuery("#psdesc-"+e).css({display:""}),p++}"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 p=document.getElementById(t);e&&(p.value?p.value+=","+e:p.value=e,"-clear-"==e&&(p.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 p,a="",o=-1,n=-2,i=0,s=!1,l=0;l<e.length;)0!=(p=e[l].valueOf())&&(i=o,p==++i?s=!0:s?(a+=o==n?t+o+t+p:t+t+o+t+p,s=!1):a+=t+p,s||(n=p,n++),o=p),l++;for(s&&(a+=".."+o);"."==a.substr(0,1);)a=a.substr(1);for(;a.substr(0,1)==t;)a=a.substr(1);return a}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 p,a=[],o=0,n=0;for(t||(t="."),p=jQuery(e),n=o=0;o<p.length;)p[o].selected&&(a[n]=p[o].value,n++),o++;return wppaArrayToEnum(a,t)}function wppaEditSearch(e,t){var p=jQuery("#"+t).val();0==p.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+p}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+a,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+a+"-spin").css("display","inline")},success:function(e,t,p){var a=e.split("||");"0"==a[1]?document.location=a[2]:alert("Error: "+a[1]+"\n\n"+a[2])},error:function(e,t,p){alert("Export Db Table "+a+" failed. Error = "+p+", status = "+t)},complete:function(e,t,p){jQuery("#"+a+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(i){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+i,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,p){var a=e.split("|");jQuery("#"+i+"_togo").html(a[0]);var o=jQuery("#"+i+"_status").html(),n=a[1];""!=o&&""==n&&(n='<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("#"+i+"_status").html(n),setTimeout(function(){wppaAjaxUpdateTogo(i)},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,o){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,p){var a=e.split("|");jQuery("#"+o).html(a[0])},error:function(e){},complete:function(e){}})}
js/wppa-ajax-front.js CHANGED
@@ -3,7 +3,7 @@
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
- var wppaJsAjaxVersion = '6.8.08';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
@@ -171,7 +171,7 @@ function wppaDoAjaxRender( mocc, ajaxurl, newurl, add, waitfor, addHilite ) {
171
  jQuery( '#wppa-ajax-spin-'+mocc ).stop().fadeOut();
172
 
173
  // Fake resize
174
- setTimeout(function(){jQuery(window).trigger('resize')}, 250);
175
 
176
  // Hide rightclick optionally
177
  wppaProtect();
3
  // Contains frontend ajax modules
4
  // Dependancies: wppa.js and default wp jQuery library
5
  //
6
+ var wppaJsAjaxVersion = '6.9.05';
7
 
8
  var wppaRenderAdd = false;
9
  var wppaWaitForCounter = 0;
171
  jQuery( '#wppa-ajax-spin-'+mocc ).stop().fadeOut();
172
 
173
  // Fake resize
174
+ window.dispatchEvent(new Event('resize'));
175
 
176
  // Hide rightclick optionally
177
  wppaProtect();
js/wppa-ajax-front.min.js CHANGED
@@ -1 +1 @@
1
- var wppaJsAjaxVersion="6.8.08",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(a,p,e,t,o,r){parseInt(o)>0&&o!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+a+", '"+p+"', '"+e+"', '"+t+"', "+o+" )",100):(wppaRenderAdd=t,""!=wppaLang&&(p+="&lang="+wppaLang),wppaAutoColumnWidth[a]&&(p+="&resp=1"),r&&_wppaCurIdx[a]&&_wppaId[a][_wppaCurIdx[a]]&&(p+="&wppa-hilite="+_wppaId[a][_wppaCurIdx[a]]),wppaCanAjaxRender||!e?jQuery.ajax({url:p,async:!0,type:"GET",timeout:6e4,beforeSend:function(p){_wppaSSRuns[a]&&_wppaStop(a),jQuery("#wppa-ajax-spin-"+a).fadeIn()},success:function(p,t,o){if(wppaRenderAdd)jQuery(wppaRenderAdd+p).insertBefore("#wppa-container-"+a+"-end");else if(wppaRenderModal&&e){var r={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(p).dialog(r).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(a)})}else jQuery("#wppa-container-"+a).html(p),jQuery("#wppa-button-hide-"+a).show();if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++;try{history.pushState({page:wppaHis,occur:a,type:"html",html:p},"",e),wppaConsoleLog("Ajax rendering: History stack pushed","force")}catch(p){try{history.replaceState({page:wppaHis,occur:a,type:"html"},"",e),wppaConsoleLog("Ajax rendering: History stack updated","force")}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=a)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&(wppaConsoleLog("Ajax render asked qr code for "+e,"force"),wppaQRUpdate(e)),wppaColWidth[a]=0,_wppaDoAutocol(a);var n=p.indexOf("<script"),i=p.lastIndexOf("<script");-1==n?wppaConsoleLog("Ajax render did NOT contain a script tag","force"):wppaConsoleLog("Ajax render did contain a script tag at position "+n+" last at "+i,"force")},error:function(p,t,o){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+o+", status = "+t,"force"),document.location.href=e,wppaColWidth[a]=0,_wppaDoAutocol(a)},complete:function(p,e,t){wppaWaitForCounter++,wppaRenderModal||jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+a).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+a).stop().fadeOut(),setTimeout(function(){jQuery(window).trigger("resize")},250),wppaProtect()}}):(document.location.href=e,wppaColWidth[a]=0,_wppaDoAutocol(a)))}function wppaAjaxApprovePhoto(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p?jQuery(".wppa-approve-"+a).css("display","none"):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemovePhoto(a,p,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+p,async:!0,type:"GET",timeout:6e4,success:function(t,o,r){rtxt=t.split("||"),"OK"==rtxt[0]?e?(jQuery("#wppa-film-"+_wppaCurIdx[a]+"-"+a).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[a]+"-"+a).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[a]+"-"+a).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[a]+"-"+a).attr("alt","removed"),wppaNext(a)):(jQuery(".wppa-approve-"+p).css("display","none"),jQuery(".thumbnail-frame-photo-"+p).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+p).css("text-decoration","line-through")):alert(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxApproveComment(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p?jQuery(".wppa-approve-"+a).css("display","none"):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemoveComment(a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+a,async:!0,type:"GET",timeout:6e4,success:function(p,e,t){"OK"==p.split("||")[0]?(jQuery(".wppa-approve-"+a).css("display","none"),jQuery(".wppa-comment-"+a).css("display","none")):alert(p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxAddPhotoToZip(a,p,e){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+p,async:!0,type:"GET",timeout:6e4,success:function(t,o,r){var n=t.split("||");"OK"==n[0]?(jQuery("#admin-choice-"+p+"-"+a).html(n[1]),jQuery("#admin-choice-"+p+"-"+a).val(n[1]),jQuery("#admin-choice-"+p+"-"+a).prop("disabled",!0)):alert(t),e&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p,"force")}})}function wppaEditPhoto(a,p){var e,t=String(p),o="Edit Photo "+t,r=wppaEditPhotoWidth;screen.availWidth<r&&(r=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){if("classic"==wppaUploadEdit){(e=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+r+", height=512",!0)).document.write("<! DOCTYPE html>"),e.document.write("<html>"),e.document.write("<head>");var p='<meta name="viewport" content="width='+r+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><title>'+o+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>';e.document.write(p),e.document.write("</head>"),e.document.write("<body>")}},success:function(p,t,o){if("classic"==wppaUploadEdit&&e.document.write(p),"new"==wppaUploadEdit){var r={modal:!0,resizable:!0,width:wppaGetContainerWidth(a),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+a).html(p).dialog(r).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}},error:function(a,p,t){"classic"==wppaUploadEdit&&e.document.write(p+" "+t),wppaConsoleLog("wppaEditPhoto failed. Error = "+t+", status = "+p,"force")},complete:function(a,p,o){"classic"==wppaUploadEdit&&(e.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),e.document.write("</body>"),e.document.write("</html>"))}})}function wppaPrevTags(a,p,e,t){for(var o,r,n=jQuery("."+a),i=[],c=jQuery("#"+e).val(),u=0,s=0;u<n.length;)n[u].selected&&(i[s]=n[u].value,s++),u++;""!=(o=jQuery("#"+p).val())&&(i[s]=o),r=i.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+r+"&album="+c,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){wppaConsoleLog("_bumpClickCount success.")},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p,"force")}})}function _bumpViewCount(a){wppaBumpViewCount&&(wppaPhotoView[a]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(p,e,t){wppaPhotoView[a]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p,"force")}}))}function wppaVoteThumb(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+p+"&wppa-occur="+a+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(e,t,o){jQuery("#wppa-vote-button-"+a+"-"+p).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p,"force")}})}function _wppaRateIt(a,p){if(0!=p&&!_wppaSSRuns[a]){var e=_wppaId[a][_wppaCurIdx[a]],t=_wppaMyr[a][_wppaCurIdx[a]],o=_wppaWaitTexts[a][_wppaCurIdx[a]];o.length>0?alert(o):0!=t&&wppaRatingOnce||t<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+e+"&wppa-occur="+a+"&wppa-index="+_wppaCurIdx[a]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(e){jQuery("#wppa-rate-"+a+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+a+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"spinner.gif")},success:function(p,e,t){var o=p.split("||");if(0==o[0])900==o[1]?(alert(o[2]),_wppaSetRatingDisplay(a)):alert("Error Code="+o[1]+"\n\n"+o[2]);else{if(o[7]&&"likes"==o[7]){var r=o[4].split("|");jQuery("#wppa-like-"+a).attr("title",r[0]),jQuery("#wppa-liketext-"+a).html(r[1]),"1"==o[3]?jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+a).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[o[0]][o[2]]=o[3],_wppaAvg[o[0]][o[2]]=o[4]}else _wppaMyr[o[0]][o[2]]=o[3],_wppaAvg[o[0]][o[2]]=o[4],_wppaDisc[o[0]][o[2]]=o[5],_wppaSetRatingDisplay(a),wppaCommentRequiredAfterVote&&0==o[6]&&alert(o[7]);wppaNextOnCallback&&_wppaNextOnCallback(a)}},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p,"force")}}))}}function _wppaOvlRateIt(a,p,e,t){0!=p&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(t){jQuery(".wppa-rate-"+e+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+e+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(o,r,n){wppaConsoleLog(o,"force");var i=o.split("||");if(0==i[0])900==i[1]?alert(i[2]):alert("Error Code="+i[1]+"\n\n"+i[2]),jQuery(".wppa-rate-"+e+"-"+p).attr("src",wppaImageDirectory+"cross.png");else{if(i[7]&&"likes"==i[7]){var c=i[4].split("|");return jQuery("#wppa-like-0").attr("title",c[0]),jQuery("#wppa-liketext-0").html(c[1]),"1"==i[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+a+"-"+e).attr("title",c[0]),jQuery("#wppa-liketext-"+a+"-"+e).html(c[1]),void("1"==i[3]?jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+a+"-"+e).attr("src",wppaImageDirectory+"thumbup.png"))}if(_wppaSetRd(e,i[4],".wppa-avg-"),_wppaSetRd(e,i[3],".wppa-rate-"),t)return;wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");"0"==t[1]?wppaIsSafari?("file"==wppaArtMonkyLink&&(wppaWindowReference.location=t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):("file"==wppaArtMonkyLink&&window.open(t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+t[1]+"\n\n"+t[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+p,async:!0,type:"GET",timeout:6e4,beforeSend:function(e){jQuery("#dwnspin-"+a+"-"+p).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],n=t[2];3==t.length&&""!=n&&alert("Attention:\n\n"+n),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(e,t,o){jQuery("#dwnspin-"+a+"-"+p).css("display","none")}})}function wppaAjaxComment(a,p){if(_wppaValidateComment(a,p)){var e="action=wppa&wppa-action=do-comment&photo-id="+p+"&comname="+jQuery("#wppa-comname-"+a).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+a).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+a).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val()+"&moccur="+a;void 0!==jQuery("#wppa-comemail-"+a).val()&&(e+="&comemail="+jQuery("#wppa-comemail-"+a).val()),void 0!==jQuery("#wppa-comment-edit-"+a).val()&&(e+="&comment-edit="+jQuery("#wppa-comment-edit-"+a).val()),void 0!==jQuery("#wppa-returnurl-"+a).val()&&(e+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+a).val())),jQuery("#db-agree-"+a).prop("checked")&&(e+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:e,async:!0,type:"POST",timeout:6e4,beforeSend:function(p){jQuery("#wppa-comment-spin-"+a).css("display","inline")},success:function(p,e,t){p=p.replace(/\\/g,""),jQuery("#wppa-comments-"+a).html(p),_wppaCurIdx[a]&&(_wppaCommentHtml[a][_wppaCurIdx[a]]=p),wppaOpenComments(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p,"force")},complete:function(p,e,t){jQuery("#wppa-comment-spin-"+a).css("display","none")}})}}function wppaUpdatePhotoNew(a){for(var p=["name","description","tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],e="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<p.length;)void 0!==jQuery("#"+p[t]).val()&&(e+="&"+p[t]+"="+jQuery("#"+p[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:e,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){a.length>0&&alert(a)},error:function(a,p,e){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,p){if(wppaLastQrcodeUrl!=a){wppaLastQrcodeUrl=a;var e="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a);jQuery.ajax({url:wppaAjaxUrl,data:e,async:!0,type:"POST",timeout:1e4,success:function(a,e,t){document.getElementById(p).src=a,wppaConsoleLog("wppaAjaxSetQrCodeSrc put "+a+" into "+p)},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p,"force")}})}}wppaConsoleLog("wppa-ajax-front.js version "+wppaJsAjaxVersion+" loaded.","force");
1
+ var wppaJsAjaxVersion="6.9.05",wppaRenderAdd=!1,wppaWaitForCounter=0;function wppaDoAjaxRender(n,a,i,p,e,t){0<parseInt(e)&&e!=wppaWaitForCounter?setTimeout("wppaDoAjaxRender( "+n+", '"+a+"', '"+i+"', '"+p+"', "+e+" )",100):(wppaRenderAdd=p,""!=wppaLang&&(a+="&lang="+wppaLang),wppaAutoColumnWidth[n]&&(a+="&resp=1"),t&&_wppaCurIdx[n]&&_wppaId[n][_wppaCurIdx[n]]&&(a+="&wppa-hilite="+_wppaId[n][_wppaCurIdx[n]]),wppaCanAjaxRender||!i?jQuery.ajax({url:a,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){_wppaSSRuns[n]&&_wppaStop(n),jQuery("#wppa-ajax-spin-"+n).fadeIn()},success:function(a,p,e){if(wppaRenderAdd)jQuery(wppaRenderAdd+a).insertBefore("#wppa-container-"+n+"-end");else if(wppaRenderModal&&i){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(n),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+n).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-button").on("click",function(){_wppaStop(n)})}else jQuery("#wppa-container-"+n).html(a),jQuery("#wppa-button-hide-"+n).show();if(wppaCanPushState&&wppaUpdateAddressLine){wppaHis++;try{history.pushState({page:wppaHis,occur:n,type:"html",html:a},"",i),wppaConsoleLog("Ajax rendering: History stack pushed","force")}catch(a){try{history.replaceState({page:wppaHis,occur:n,type:"html"},"",i),wppaConsoleLog("Ajax rendering: History stack updated","force")}catch(a){wppaConsoleLog("Ajax rendering: History stack update failed","force")}}0==wppaFirstOccur&&(wppaFirstOccur=n)}wppaUpdateLightboxes(),"undefined"!=typeof wppaQRUpdate&&(wppaConsoleLog("Ajax render asked qr code for "+i,"force"),wppaQRUpdate(i)),wppaColWidth[n]=0,_wppaDoAutocol(n);var o=a.indexOf("<script"),r=a.lastIndexOf("<script");-1==o?wppaConsoleLog("Ajax render did NOT contain a script tag","force"):wppaConsoleLog("Ajax render did contain a script tag at position "+o+" last at "+r,"force")},error:function(a,p,e){wppaConsoleLog("wppaDoAjaxRender failed. Error = "+e+", status = "+p,"force"),document.location.href=i,wppaColWidth[n]=0,_wppaDoAutocol(n)},complete:function(a,p,e){wppaWaitForCounter++,wppaRenderModal||jQuery("html, body").animate({scrollTop:jQuery("#wppa-container-"+n).offset().top-32-wppaStickyHeaderHeight},1e3),jQuery("#wppa-ajax-spin-"+n).stop().fadeOut(),window.dispatchEvent(new Event("resize")),wppaProtect()}}):(document.location.href=i,wppaColWidth[n]=0,_wppaDoAutocol(n)))}function wppaAjaxApprovePhoto(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&photo-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApprovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemovePhoto(t,o,r){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&photo-id="+o,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){rtxt=a.split("||"),"OK"==rtxt[0]?r?(jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("src",""),jQuery("#wppa-film-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),jQuery("#wppa-pre-"+_wppaCurIdx[t]+"-"+t).attr("alt","removed"),wppaNext(t)):(jQuery(".wppa-approve-"+o).css("display","none"),jQuery(".thumbnail-frame-photo-"+o).css("display","none")):rtxt[3]?(alert(rtxt[3]),jQuery("#wppa-delete-"+o).css("text-decoration","line-through")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemovePhoto failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxApproveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=approve&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a?jQuery(".wppa-approve-"+t).css("display","none"):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxApproveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxRemoveComment(t){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=remove&comment-id="+t,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){"OK"==a.split("||")[0]?(jQuery(".wppa-approve-"+t).css("display","none"),jQuery(".wppa-comment-"+t).css("display","none")):alert(a)},error:function(a,p,e){wppaConsoleLog("wppaAjaxRemoveComment failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxAddPhotoToZip(o,r,n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=addtozip&photo-id="+r,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){var t=a.split("||");"OK"==t[0]?(jQuery("#admin-choice-"+r+"-"+o).html(t[1]),jQuery("#admin-choice-"+r+"-"+o).val(t[1]),jQuery("#admin-choice-"+r+"-"+o).prop("disabled",!0)):alert(a),n&&document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxAddPhotoToZip failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDeleteMyZip(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=delmyzip",async:!0,type:"GET",timeout:6e4,success:function(a,p,e){document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDeleteMyZip failed. Error = "+e+", status = "+p,"force")}})}function wppaEditPhoto(o,a){var r,t=String(a),e="Edit Photo "+t,n=wppaEditPhotoWidth;screen.availWidth<n&&(n=screen.availWidth),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=front-edit&photo-id="+t+"&moccur="+o,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){if("classic"==wppaUploadEdit){(r=window.open("","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width="+n+", height=512",!0)).document.write("<! DOCTYPE html>"),r.document.write("<html>"),r.document.write("<head>");var p='<meta name="viewport" content="width='+n+'" ><link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+"/wppa-admin-styles.css?ver="+wppaVersion+'" type="text/css" media="all" /><link rel="stylesheet" id="theme_style" href="'+wppaThemeStyles+'" type="text/css" media="all" /><style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style><script type="text/javascript" src="'+wppaIncludeUrl+"/js/jquery/jquery.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-utils.js?ver="+wppaVersion+'"><\/script><script type="text/javascript" src="'+wppaWppaUrl+"/js/wppa-admin-scripts.js?ver="+wppaVersion+'"><\/script><title>'+e+'</title><script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";<\/script>';r.document.write(p),r.document.write("</head>"),r.document.write("<body>")}},success:function(a,p,e){if("classic"==wppaUploadEdit&&r.document.write(a),"new"==wppaUploadEdit){var t={modal:!0,resizable:!0,width:wppaGetContainerWidth(o),show:{effect:"fadeIn",duration:400},closeText:""};jQuery("#wppa-modal-container-"+o).html(a).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close")}},error:function(a,p,e){"classic"==wppaUploadEdit&&r.document.write(p+" "+e),wppaConsoleLog("wppaEditPhoto failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){"classic"==wppaUploadEdit&&(r.document.write('<script>wppaPhotoStatusChange( "'+t+'" )<\/script>'),r.document.write("</body>"),r.document.write("</html>"))}})}function wppaPrevTags(a,p,e,t){for(var o,r,n=jQuery("."+a),i=[],c=jQuery("#"+e).val(),u=0,s=0;u<n.length;)n[u].selected&&(i[s]=n[u].value,s++),u++;""!=(o=jQuery("#"+p).val())&&(i[s]=o),r=i.join(),""==o&&""==e||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=sanitizetags&tags="+r+"&album="+c,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#"+t).html("Working...")},success:function(a,p,e){jQuery("#"+t).html(wppaTrim(a,","))},error:function(a,p,e){jQuery("#"+t).html('<span style="color:red" >'+e+"</span>"),wppaConsoleLog("wppaPrevTags failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxDestroyAlbum(a,p){return confirm("Are you sure you want to delete this album?")&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=destroyalbum&album="+a+"&nonce="+p,async:!0,type:"GET",timeout:6e4,success:function(a,p,e){alert(a+"\nPage will be reloaded"),document.location.reload(!0)},error:function(a,p,e){wppaConsoleLog("wppaAjaxDestroyAlbum failed. Error = "+e+", status = "+p,"force")}}),!1}function _bumpClickCount(a){wppaBumpClickCount&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpclickcount&wppa-photo="+a+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!1,type:"GET",timeout:6e4,success:function(a,p,e){wppaConsoleLog("_bumpClickCount success.")},error:function(a,p,e){wppaConsoleLog("_bumpClickCount failed. Error = "+e+", status = "+p,"force")}})}function _bumpViewCount(t){wppaBumpViewCount&&(wppaPhotoView[t]||jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=bumpviewcount&wppa-photo="+t+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){wppaPhotoView[t]=!0},error:function(a,p,e){wppaConsoleLog("_bumpViewCount failed. Error = "+e+", status = "+p,"force")}}))}function wppaVoteThumb(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating=1&wppa-rating-id="+o+"&wppa-occur="+t+"&wppa-index=0&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,success:function(a,p,e){jQuery("#wppa-vote-button-"+t+"-"+o).val(wppaVotedForMe)},error:function(a,p,e){wppaConsoleLog("wppaVoteThumb failed. Error = "+e+", status = "+p,"force")}})}function _wppaRateIt(r,p){if(0!=p&&!_wppaSSRuns[r]){var a=_wppaId[r][_wppaCurIdx[r]],e=_wppaMyr[r][_wppaCurIdx[r]],t=_wppaWaitTexts[r][_wppaCurIdx[r]];0<t.length?alert(t):0!=e&&wppaRatingOnce||e<0||(_wppaVoteInProgress=!0,jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+p+"&wppa-rating-id="+a+"&wppa-occur="+r+"&wppa-index="+_wppaCurIdx[r]+"&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#wppa-rate-"+r+"-"+p).attr("src",wppaImageDirectory+"tick.png"),jQuery("#wppa-rate-"+r+"-"+p).stop().fadeTo(100,1),jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){var t=a.split("||");if(0==t[0])900==t[1]?(alert(t[2]),_wppaSetRatingDisplay(r)):alert("Error Code="+t[1]+"\n\n"+t[2]);else{if(t[7]&&"likes"==t[7]){var o=t[4].split("|");jQuery("#wppa-like-"+r).attr("title",o[0]),jQuery("#wppa-liketext-"+r).html(o[1]),"1"==t[3]?jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+r).attr("src",wppaImageDirectory+"thumbup.png"),_wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4]}else _wppaMyr[t[0]][t[2]]=t[3],_wppaAvg[t[0]][t[2]]=t[4],_wppaDisc[t[0]][t[2]]=t[5],_wppaSetRatingDisplay(r),wppaCommentRequiredAfterVote&&0==t[6]&&alert(t[7]);wppaNextOnCallback&&_wppaNextOnCallback(r)}},error:function(a,p,e){wppaConsoleLog("_wppaRateIt failed. Error = "+e+", status = "+p,"force")}}))}}function _wppaOvlRateIt(r,n,i,c){0!=n&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=rate&wppa-rating="+n+"&wppa-rating-id="+r+"&wppa-occur=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery(".wppa-rate-"+i+"-"+n).attr("src",wppaImageDirectory+"tick.png"),jQuery(".wppa-rate-"+i+"-"+n).stop().fadeTo(100,1),jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"spinner.gif"),jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"spinner.gif")},success:function(a,p,e){wppaConsoleLog(a,"force");var t=a.split("||");if(0==t[0])900==t[1]?alert(t[2]):alert("Error Code="+t[1]+"\n\n"+t[2]),jQuery(".wppa-rate-"+i+"-"+n).attr("src",wppaImageDirectory+"cross.png");else{if(t[7]&&"likes"==t[7]){var o=t[4].split("|");return jQuery("#wppa-like-0").attr("title",o[0]),jQuery("#wppa-liketext-0").html(o[1]),"1"==t[3]?jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-0").attr("src",wppaImageDirectory+"thumbup.png"),jQuery("#wppa-like-"+r+"-"+i).attr("title",o[0]),jQuery("#wppa-liketext-"+r+"-"+i).html(o[1]),void("1"==t[3]?jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+r+"-"+i).attr("src",wppaImageDirectory+"thumbup.png"))}if(_wppaSetRd(i,t[4],".wppa-avg-"),_wppaSetRd(i,t[3],".wppa-rate-"),c)return;wppaNextOnCallback&&wppaOvlShowNext()}},error:function(a,p,e){wppaConsoleLog("_wppaOvlRateIt failed. Error = "+e+", status = "+p,"force")}})}function wppaAjaxMakeOrigName(a,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=makeorigname&photo-id="+p+"&from=fsname",async:!0,type:"GET",timeout:6e4,beforeSend:function(a){},success:function(a,p,e){var t=a.split("||");"0"==t[1]?(wppaIsSafari?"file"==wppaArtMonkyLink&&(wppaWindowReference.location=t[2]):"file"==wppaArtMonkyLink&&window.open(t[2]),"zip"==wppaArtMonkyLink&&(document.location=t[2])):(wppaIsSafari&&"file"==wppaArtMonkyLink&&wppaWindowReference.close(),alert("Error: "+t[1]+"\n\n"+t[2]))},error:function(a,p,e){wppaConsoleLog("wppaAjaxMakeOrigName failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}function wppaAjaxDownloadAlbum(t,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=downloadalbum&album-id="+o,async:!0,type:"GET",timeout:6e4,beforeSend:function(a){jQuery("#dwnspin-"+t+"-"+o).css("display","")},success:function(a,p,e){var t=a.split("||"),o=t[0],r=t[1],n=t[2];3==t.length&&""!=n&&alert("Attention:\n\n"+n),"OK"==r?document.location=o:alert("The server could not complete the request.\nPlease try again.")},error:function(a,p,e){alert("An error occurred:\n"+e+"\nPlease try again")},complete:function(a,p,e){jQuery("#dwnspin-"+t+"-"+o).css("display","none")}})}function wppaAjaxComment(t,a){if(_wppaValidateComment(t,a)){var p="action=wppa&wppa-action=do-comment&photo-id="+a+"&comname="+jQuery("#wppa-comname-"+t).val()+"&comment="+wppaEncode(jQuery("#wppa-comment-"+t).val())+"&wppa-captcha="+jQuery("#wppa-captcha-"+t).val()+"&wppa-nonce="+jQuery("#wppa-nonce-"+t).val()+"&moccur="+t;void 0!==jQuery("#wppa-comemail-"+t).val()&&(p+="&comemail="+jQuery("#wppa-comemail-"+t).val()),void 0!==jQuery("#wppa-comment-edit-"+t).val()&&(p+="&comment-edit="+jQuery("#wppa-comment-edit-"+t).val()),void 0!==jQuery("#wppa-returnurl-"+t).val()&&(p+="&returnurl="+encodeURIComponent(jQuery("#wppa-returnurl-"+t).val())),jQuery("#db-agree-"+t).prop("checked")&&(p+="&db-agree=yes"),jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:6e4,beforeSend:function(a){jQuery("#wppa-comment-spin-"+t).css("display","inline")},success:function(a,p,e){a=a.replace(/\\/g,""),jQuery("#wppa-comments-"+t).html(a),_wppaCurIdx[t]&&(_wppaCommentHtml[t][_wppaCurIdx[t]]=a),wppaOpenComments(t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxComment failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){jQuery("#wppa-comment-spin-"+t).css("display","none")}})}}function wppaUpdatePhotoNew(a){for(var p=["name","description","tags","custom_0","custom_1","custom_2","custom_3","custom_4","custom_5","custom_6","custom_7","custom_8","custom_9"],e="action=wppa&wppa-action=update-photo-new&photo-id="+a+"&wppa-nonce="+jQuery("#wppa-nonce-"+a).val(),t=0;t<p.length;)void 0!==jQuery("#"+p[t]).val()&&(e+="&"+p[t]+"="+jQuery("#"+p[t]).val()),t++;jQuery.ajax({url:wppaAjaxUrl,data:e,async:!1,type:"POST",timeout:1e4,beforeSend:function(a){},success:function(a,p,e){0<a.length&&alert(a)},error:function(a,p,e){alert(result),wppaConsoleLog("wppaUpdatePhotoNew failed. Error = "+e+", status = "+p,"force")},complete:function(a,p,e){}})}var wppaLastQrcodeUrl="";function wppaAjaxSetQrCodeSrc(a,t){if(wppaLastQrcodeUrl!=a){wppaLastQrcodeUrl=a;var p="action=wppa&wppa-action=getqrcode&wppa-qr-nonce="+jQuery("#wppa-qr-nonce").val()+"&url="+encodeURIComponent(a);jQuery.ajax({url:wppaAjaxUrl,data:p,async:!0,type:"POST",timeout:1e4,success:function(a,p,e){document.getElementById(t).src=a,wppaConsoleLog("wppaAjaxSetQrCodeSrc put "+a+" into "+t)},error:function(a,p,e){wppaConsoleLog("wppaAjaxSetQrCodeSrc failed. Error = "+e+", status = "+p,"force")}})}}wppaConsoleLog("wppa-ajax-front.js version "+wppaJsAjaxVersion+" loaded.","force");
js/wppa-utils.js CHANGED
@@ -2,7 +2,7 @@
2
  //
3
  // conatins common vars and functions
4
  //
5
- var wppaJsUtilsVersion = '6.9.04';
6
  var wppaDebug;
7
 
8
  // Trim
@@ -425,12 +425,12 @@ function wppaSvgHtml( image, height, isLightbox, border, none, light, medium, he
425
  return result;
426
  }
427
 
428
- jQuery(window).on('DOMContentLoaded load resize scroll', wppaMakeLazyVisible);
429
-
430
  function wppaMakeLazyVisible() {
431
-
 
432
  var src;
433
-
434
  jQuery( '.wppa-lazy' ).each( function() {
435
  src = jQuery( this ).attr( 'data-src' );
436
  if ( ! wppaLazyLoad || wppaIsElementInViewport( this ) ) {
@@ -449,15 +449,22 @@ function wppaIsElementInViewport( elm ) {
449
 
450
  if ( rect ) {
451
  result = rect.bottom > 0 && rect.right > 0 && rect.left < jQuery( window ).width() && rect.top < jQuery( window ).height();
452
- wppaConsoleLog( 'getBoundingClientRect() for '+jQuery(elm).attr('id')+' returned (tlbr) '+parseInt(rect.top)+' '+parseInt(rect.left)+' '+parseInt(rect.bottom)+' '+parseInt(rect.right)+' result='+(result?'true':'false'));
453
  }
454
  else {
455
- result = false;
456
- wppaConsoleLog( 'getBoundingClientRect() not found for '+jQuery(elm).attr('id') );
457
  }
458
 
459
  return result;
460
  }
461
 
 
 
 
 
 
 
 
 
 
462
  // Say we're in
463
  wppaConsoleLog( 'wppa-utils.js version '+wppaJsUtilsVersion+' loaded.', 'force' );
2
  //
3
  // conatins common vars and functions
4
  //
5
+ var wppaJsUtilsVersion = '6.9.05';
6
  var wppaDebug;
7
 
8
  // Trim
425
  return result;
426
  }
427
 
428
+ // Make lazy load images visible
 
429
  function wppaMakeLazyVisible() {
430
+
431
+ wppaConsoleLog( 'MakeLazyVisible()' );
432
  var src;
433
+
434
  jQuery( '.wppa-lazy' ).each( function() {
435
  src = jQuery( this ).attr( 'data-src' );
436
  if ( ! wppaLazyLoad || wppaIsElementInViewport( this ) ) {
449
 
450
  if ( rect ) {
451
  result = rect.bottom > 0 && rect.right > 0 && rect.left < jQuery( window ).width() && rect.top < jQuery( window ).height();
 
452
  }
453
  else {
454
+ result = true;
 
455
  }
456
 
457
  return result;
458
  }
459
 
460
+ // Size scrollable thumbnail areas
461
+ function wppaSizeThumbArea() {
462
+
463
+ if ( wppaThumbAreaMaxFrac > 0 && wppaThumbAreaMaxFrac < 1 ) {
464
+ wppaConsoleLog( 'SizeThumbArea()' );
465
+ jQuery('.wppa-thumb-area').css('max-height',(jQuery(window).height()*wppaThumbAreaMaxFrac));
466
+ }
467
+ }
468
+
469
  // Say we're in
470
  wppaConsoleLog( 'wppa-utils.js version '+wppaJsUtilsVersion+' loaded.', 'force' );
js/wppa-utils.min.js CHANGED
@@ -1 +1 @@
1
- var wppaDebug,wppaJsUtilsVersion="6.9.04";function wppaTrim(e,t){return wppaTrimRight(wppaTrimLeft(e,t),t)}function wppaTrimLeft(e,t){var r,a,o,n,s,i,l;switch(typeof t){case"string":for(a=(r=e).length,o=t.length;o<=a&&r.substr(0,o)==t;)a=(r=r.substr(o)).length;break;case"object":for(s=!1,l=e;!s;){for(n=0,i=l;n<t.length;)l=wppaTrimLeft(l,t[n]),n++;s=i==l}r=l;break;default:return e.replace(/^\s\s*/,"")}return r}function wppaTrimRight(e,t){var r,a,o,n,s,i,l;switch(typeof t){case"string":for(a=(r=e).length,o=t.length;o<=a&&r.substr(a-o)==t;)a=(r=r.substr(0,a-o)).length;break;case"object":for(s=!1,l=e;!s;){for(n=0,i=l;n<t.length;)l=wppaTrimRight(l,t[n]),n++;s=i==l}r=l;break;default:return e.replace(/\s\s*$/,"")}return r}function wppa_setCookie(e,t,r){var a=new Date;a.setDate(a.getDate()+r);var o=escape(t)+(null==r?"":"; expires="+a.toUTCString());document.cookie=e+"="+o}function wppa_getCookie(e){var t,r,a,o=document.cookie.split(";");for(t=0;t<o.length;t++)if(r=o[t].substr(0,o[t].indexOf("=")),a=o[t].substr(o[t].indexOf("=")+1),(r=r.replace(/^\s+|\s+$/g,""))==e)return unescape(a);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){if("undefined"!=typeof console&&(wppaDebug||"force"==t)){var r=(new Date).getTime()%864e5,a=Math.floor(r/36e5);r-=60*a*60*1e3;var o=Math.floor(r/6e4);r-=60*o*1e3;var n=Math.floor(r/1e3);r-=1e3*n,console.log("At: "+a+":"+o+":"+n+"."+r+" message: "+e)}}function wppaConvertScriptToShortcode(e,t){var r,a,o,n,s,l,p,c,u,g;if("string"!=typeof(r=jQuery("#"+e).val())||0==r.length)return jQuery("#"+t).val("No script found"),void jQuery("#"+t).css("color","red");if(workarr=r.split("%%"),"wppa"!=workarr[1]||workarr.length<3)return jQuery("#"+t).val("No %%wppa%% found"),void jQuery("#"+t).css("color","red");for(i=3;i<workarr.length;i+=2)if(o=(a=workarr[i].split("="))[0],n=a[1],o&&n)switch(o){case"size":c=n;break;case"align":u=n;break;case"photo":case"mphoto":case"slphoto":s=o,p=n;break;case"album":case"cover":case"slide":case"slideonly":case"slideonlyf":case"slidef":s=o,l=n;break;default:return jQuery("#"+t).val('Token "'+workarr[i]+'" not recognized'),void jQuery("#"+t).css("color","red")}g="[wppa",s&&0<s.length&&(g+=' type="'+s+'"'),l&&0<l.length&&(g+=' album="'+l+'"'),p&&0<p.length&&(g+=' photo="'+p+'"'),c&&0<c.length&&(g+=' size="'+c+'"'),u&&0<u.length&&(g+=' align="'+u+'"'),g+="][/wppa]",jQuery("#"+t).val(g),jQuery("#"+t).css("color","green"),document.getElementById(t).focus(),document.getElementById(t).select()}function wppaSvgHtml(e,t,r,a,o,n,s,i){var l,p,c;switch(o||(o="0"),n||(n="10"),s||(s="20"),i||(i="50"),wppaSvgCornerStyle){case"gif":case"none":radius=o;break;case"light":radius=n;break;case"medium":radius=s;break;case"heavy":radius=i}t||(t="32px"),r?(l=wppaOvlSvgFillcolor,p=wppaOvlSvgBgcolor):(l=wppaSvgFillcolor,p=wppaSvgBgcolor),c=wppaUseSvg?wppaImageDirectory+e+".svg":wppaImageDirectory+e+".png";if(wppaUseSvg&&"-1"!=jQuery.inArray(e,["Next-Button","Prev-Button","Backward-Button","Forward-Button","Pause-Button","Play-Button","Stop-Button","Eagle-1","Snail","Exit","Full-Screen","Exit-Full-Screen","Content-View"])){var u='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;'+(t?"height:"+t+";":"")+"fill:"+l+";background-color:"+p+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+(a?"border:2px solid "+p+";box-sizing:border-box;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":u+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":u+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":u+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":u+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":u+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":u+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Full-Screen":u+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Exit-Full-Screen":u+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;default:alert("Native svg "+e+" not implemented")}u+="</g></svg>"}else u='<img src="'+c+'"'+(wppaUseSvg?' class="wppa-svg"':"")+' style="height:'+t+";fill:"+l+";background-color:"+p+";"+(radius?"border-radius:"+radius+"%;":"")+(a?"border:2px solid "+p+";box-sizing:border-box;":"")+(wppaUseSvg?"display:none;":"")+'text-decoration:none !important;vertical-align:middle;" />';return u}function wppaMakeLazyVisible(){var e;jQuery(".wppa-lazy").each(function(){e=jQuery(this).attr("data-src"),wppaLazyLoad&&!wppaIsElementInViewport(this)||(jQuery(this).attr("src",e),jQuery(this).removeAttr("data-src"),jQuery(this).removeClass("wppa-lazy"))})}function wppaIsElementInViewport(e){var t,r=e.getBoundingClientRect();return r?(t=0<r.bottom&&0<r.right&&r.left<jQuery(window).width()&&r.top<jQuery(window).height(),wppaConsoleLog("getBoundingClientRect() for "+jQuery(e).attr("id")+" returned (tlbr) "+parseInt(r.top)+" "+parseInt(r.left)+" "+parseInt(r.bottom)+" "+parseInt(r.right)+" result="+(t?"true":"false"))):(t=!1,wppaConsoleLog("getBoundingClientRect() not found for "+jQuery(e).attr("id"))),t}jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaConsoleLog("wppa-utils.js version "+wppaJsUtilsVersion+" loaded.","force");
1
+ var wppaDebug,wppaJsUtilsVersion="6.9.05";function wppaTrim(e,a){return wppaTrimRight(wppaTrimLeft(e,a),a)}function wppaTrimLeft(e,a){var r,t,o,s,n,p,i;switch(typeof a){case"string":for(t=(r=e).length,o=a.length;o<=t&&r.substr(0,o)==a;)t=(r=r.substr(o)).length;break;case"object":for(n=!1,i=e;!n;){for(s=0,p=i;s<a.length;)i=wppaTrimLeft(i,a[s]),s++;n=p==i}r=i;break;default:return e.replace(/^\s\s*/,"")}return r}function wppaTrimRight(e,a){var r,t,o,s,n,p,i;switch(typeof a){case"string":for(t=(r=e).length,o=a.length;o<=t&&r.substr(t-o)==a;)t=(r=r.substr(0,t-o)).length;break;case"object":for(n=!1,i=e;!n;){for(s=0,p=i;s<a.length;)i=wppaTrimRight(i,a[s]),s++;n=p==i}r=i;break;default:return e.replace(/\s\s*$/,"")}return r}function wppa_setCookie(e,a,r){var t=new Date;t.setDate(t.getDate()+r);var o=escape(a)+(null==r?"":"; expires="+t.toUTCString());document.cookie=e+"="+o}function wppa_getCookie(e){var a,r,t,o=document.cookie.split(";");for(a=0;a<o.length;a++)if(r=o[a].substr(0,o[a].indexOf("=")),t=o[a].substr(o[a].indexOf("=")+1),(r=r.replace(/^\s+|\s+$/g,""))==e)return unescape(t);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,a){if("undefined"!=typeof console&&(wppaDebug||"force"==a)){var r=(new Date).getTime()%864e5,t=Math.floor(r/36e5);r-=60*t*60*1e3;var o=Math.floor(r/6e4);r-=60*o*1e3;var s=Math.floor(r/1e3);r-=1e3*s,console.log("At: "+t+":"+o+":"+s+"."+r+" message: "+e)}}function wppaConvertScriptToShortcode(e,a){var r,t,o,s,n,p,l,c,u,g;if("string"!=typeof(r=jQuery("#"+e).val())||0==r.length)return jQuery("#"+a).val("No script found"),void jQuery("#"+a).css("color","red");if(workarr=r.split("%%"),"wppa"!=workarr[1]||workarr.length<3)return jQuery("#"+a).val("No %%wppa%% found"),void jQuery("#"+a).css("color","red");for(i=3;i<workarr.length;i+=2)if(o=(t=workarr[i].split("="))[0],s=t[1],o&&s)switch(o){case"size":c=s;break;case"align":u=s;break;case"photo":case"mphoto":case"slphoto":n=o,l=s;break;case"album":case"cover":case"slide":case"slideonly":case"slideonlyf":case"slidef":n=o,p=s;break;default:return jQuery("#"+a).val('Token "'+workarr[i]+'" not recognized'),void jQuery("#"+a).css("color","red")}g="[wppa",n&&0<n.length&&(g+=' type="'+n+'"'),p&&0<p.length&&(g+=' album="'+p+'"'),l&&0<l.length&&(g+=' photo="'+l+'"'),c&&0<c.length&&(g+=' size="'+c+'"'),u&&0<u.length&&(g+=' align="'+u+'"'),g+="][/wppa]",jQuery("#"+a).val(g),jQuery("#"+a).css("color","green"),document.getElementById(a).focus(),document.getElementById(a).select()}function wppaSvgHtml(e,a,r,t,o,s,n,p){var i,l,c;switch(o||(o="0"),s||(s="10"),n||(n="20"),p||(p="50"),wppaSvgCornerStyle){case"gif":case"none":radius=o;break;case"light":radius=s;break;case"medium":radius=n;break;case"heavy":radius=p}a||(a="32px"),r?(i=wppaOvlSvgFillcolor,l=wppaOvlSvgBgcolor):(i=wppaSvgFillcolor,l=wppaSvgBgcolor),c=wppaUseSvg?wppaImageDirectory+e+".svg":wppaImageDirectory+e+".png";if(wppaUseSvg&&"-1"!=jQuery.inArray(e,["Next-Button","Prev-Button","Backward-Button","Forward-Button","Pause-Button","Play-Button","Stop-Button","Eagle-1","Snail","Exit","Full-Screen","Exit-Full-Screen","Content-View"])){var u='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;'+(a?"height:"+a+";":"")+"fill:"+i+";background-color:"+l+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+(t?"border:2px solid "+l+";box-sizing:border-box;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":u+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":u+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":u+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":u+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":u+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":u+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Full-Screen":u+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Exit-Full-Screen":u+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;default:alert("Native svg "+e+" not implemented")}u+="</g></svg>"}else u='<img src="'+c+'"'+(wppaUseSvg?' class="wppa-svg"':"")+' style="height:'+a+";fill:"+i+";background-color:"+l+";"+(radius?"border-radius:"+radius+"%;":"")+(t?"border:2px solid "+l+";box-sizing:border-box;":"")+(wppaUseSvg?"display:none;":"")+'text-decoration:none !important;vertical-align:middle;" />';return u}function wppaMakeLazyVisible(){var e;wppaConsoleLog("MakeLazyVisible()"),jQuery(".wppa-lazy").each(function(){e=jQuery(this).attr("data-src"),wppaLazyLoad&&!wppaIsElementInViewport(this)||(jQuery(this).attr("src",e),jQuery(this).removeAttr("data-src"),jQuery(this).removeClass("wppa-lazy"))})}function wppaIsElementInViewport(e){var a=e.getBoundingClientRect();return!a||0<a.bottom&&0<a.right&&a.left<jQuery(window).width()&&a.top<jQuery(window).height()}function wppaSizeThumbArea(){0<wppaThumbAreaMaxFrac&&wppaThumbAreaMaxFrac<1&&(wppaConsoleLog("SizeThumbArea()"),jQuery(".wppa-thumb-area").css("max-height",jQuery(window).height()*wppaThumbAreaMaxFrac))}wppaConsoleLog("wppa-utils.js version "+wppaJsUtilsVersion+" loaded.","force");
js/wppa.js CHANGED
@@ -2,7 +2,7 @@
2
  //
3
  // conatins common vars and functions
4
  //
5
- var wppaJsVersion = '6.9.04';
6
 
7
  // Important notice:
8
  // All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
@@ -157,6 +157,8 @@ var wppaUploadFailed = 'Upload failed';
157
  var wppaServerError = 'Server error';
158
  var wppaGeoZoom = 10;
159
  var wppaLazyLoad = true;
 
 
160
 
161
  // 'Internal' variables ( private )
162
  var _wppaId = [];
@@ -316,6 +318,15 @@ function wppaDoInit( autoOnly ) {
316
  }
317
  }, 3000 );
318
 
 
 
 
 
 
 
 
 
 
319
  wppaProtect();
320
  }
321
 
2
  //
3
  // conatins common vars and functions
4
  //
5
+ var wppaJsVersion = '6.9.05';
6
 
7
  // Important notice:
8
  // All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
157
  var wppaServerError = 'Server error';
158
  var wppaGeoZoom = 10;
159
  var wppaLazyLoad = true;
160
+ var wppaThumbAreaMaxFrac = 1.0;
161
+ var wppaNiceScroll = false;
162
 
163
  // 'Internal' variables ( private )
164
  var _wppaId = [];
318
  }
319
  }, 3000 );
320
 
321
+ // Size scrollable thumb areas
322
+ jQuery(window).on('DOMContentLoaded load resize scroll',wppaSizeThumbArea);
323
+ wppaSizeThumbArea();
324
+
325
+ // Make Lazy load images visible
326
+ jQuery(window).on('DOMContentLoaded load resize scroll', wppaMakeLazyVisible);
327
+ wppaMakeLazyVisible();
328
+
329
+ // Protect rightclick
330
  wppaProtect();
331
  }
332
 
js/wppa.min.js CHANGED
@@ -1 +1 @@
1
- var wppaJsVersion="6.9.04",wppaVersion="0",wppaIsIe=!1,wppaUseSvg=!0,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaAutoColumnWidth=[],wppaAutoColumnFrac=[],wppaThumbnailAreaDelta,wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaMiniTreshold=300,wppaStart="Start",wppaStop="Stop",wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth=[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaProcessing="Processing...",wppaDone="Done!",wppaUploadFailed="Upload failed",wppaServerError="Server error",wppaGeoZoom=10,wppaLazyLoad=!0,_wppaId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlTitles,wppaOvlAlts,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlModeInitial="normal",wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light";function wppaDoInit(p){var a=!1;for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc),a=!0);p||(_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),a&&jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc))})),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ajax-spin").stop().fadeOut()},1e3),jQuery(".wppa-ovl-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ovl-spin").stop().fadeOut()},1e3),setTimeout(function(){for(var p=1;p<wppaTopMoc;)jQuery("#ubb-"+p+"-l")&&(wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")),p++},3e3),wppaProtect()}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var a,e,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,e=0;e<3;)1==++e&&0!=p||(a=document.getElementById(t[e]))&&"function"==typeof a.pause&&(a.pause(),wppaConsoleLog("Video "+t[e]+" paused","force"))}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var a=jQuery("audio");if(0<a.length)for(var e=0;e<a.length;)"wppa"==jQuery(a[e]).attr("data-from")&&a[e].pause(),e++}}function wppaMakeFullsizeUrl(p){var a,e;(a=(p=p.replace("/thumbs/","/")).split("//"))[1]?(e=a[1].split("/"),p=a[0]+"//"):(e=a[0].split("/"),p="");for(var t=0;t<e.length;){var o=e[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var a=document.getElementById("wppa-container-"+p),e=0;if(!wppaAutoColumnWidth[p])return a.clientWidth;for(;0==e;)a=a.parentNode,e=jQuery(a).width();return parseInt(e*wppaAutoColumnFrac[p])}function _wppaDoAutocol(p){var a;if(wppaAutoColumnWidth[p]&&(a=wppaGetContainerWidth(p),wppaColWidth[p]!=a)){wppaConsoleLog("Doing autocol "+p),wppaColWidth[p]=a,jQuery(".wppa-container-"+p).css("width",a),wppaRenderModal&&(jQuery(".ui-dialog").css("width",a),jQuery(".ui-dialog").attr("height","auto")),wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-"+p).css("width",a-wppaTextFrameDelta),jQuery(".wppa-cover-box-"+p).css("width",a));var e,t=jQuery(".wppa-cover-box-mcr-"+p);if(1<t.length){var o=parseInt((a+8)/(wppaMaxCoverWidth+8))+1,r=o-1;e=parseInt((a+8)/o-8);for(var s=0;s<t.length;){switch(s%o){case 0:jQuery(t[s]).css({marginLeft:"0px",clear:"both",float:"left"});break;case r:jQuery(t[s]).css({marginLeft:"8px",clear:"none",float:"right"});break;default:jQuery(t[s]).css({marginLeft:"8px",clear:"none",float:"left"})}s++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",e-wppaTextFrameDelta),jQuery(".wppa-cover-box-mcr-"+p).css("width",e)}else if(wppaCoverImageResponsive[p]);else{jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",a-wppaTextFrameDelta);jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})}if(wppaThumbSpaceAuto){var i=parseInt(jQuery(".thumbnail-frame-"+p).css("width"));if(i){var n=a-wppaThumbnailAreaDelta-7,l=parseInt(n/(i+wppaMinThumbSpace)),w=parseInt(.5+(n-l*i)/(l+1));jQuery(".thumbnail-frame-"+p).css({marginLeft:w})}}jQuery(".thumbnail-frame-comalt-"+p).css("width",a-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",a-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,d=jQuery("#wppa-mas-h-"+c+"-"+p).attr("data-height-perc");d;)u=d*(a-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+p).css("height",u),c++,d=jQuery("#wppa-mas-h-"+c+"-"+p).attr("data-height-perc");wppaSetMasHorFrameWidthsForIeAndChrome(p),wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",a-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*a),wppaFilmStripLength[p]=a-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",a),jQuery(".wppa-simg-"+p).css("width",a-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",a+10),jQuery(".wppa-mimg-"+p).css("width",a),jQuery(".wppa-mimg-"+p).css("height",""),0<wppaSearchBoxSelItems[p]&&(a/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*a)}}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var a=jQuery(".wppa-mas-h-"+p),e=wppaMinThumbSpace,t=0;t<a.length;t++){var o=wppaGetChildI(a[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);var r=o.naturalWidth/o.naturalHeight*o.height+e;jQuery(a[t]).css({width:r})}}}function wppaGetChildI(p){var a,e=p.childNodes;for(a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;var o=wppaGetChildI(t);if(o)return o}return!1}jQuery(document).ready(function(){wppaDoInit(!1),setTimeout(function(){wppaDoInit(!0)},1e3)}),jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var a=1;a<=wppaMaxOccur;)wppaStartHtml[a]=jQuery("#wppa-container-"+a).html(),a++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,a){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(a),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,a)):(setTimeout("wppaFotomotoToolbar( "+p+',"'+a+'" )',200),wppaConsoleLog("Waiting for Fotomoto")))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaGetCurrentFullUrl(p,a){var e,t,o,r=document.location.href.split("?"),s="nil",i=0,n=!0;o=wppaShortQargs?"":"wppa-",r[1]&&(s=r[1].split("&"));var l=!1;if(e=r[0],"nil"!=s&&0<s.length)for(;i<s.length;)(t=s[i].split("="))[0]==o+"album"&&(l=!0),t[0]!=o+"photo"&&(e+=n?"?":"&",n=!1,e+=s[i]),i++;return l?(e+=n?"?":"&",e+=wppaUsePhotoNamesInUrls?o+"photo="+encodeURIComponent(_wppaNames[p][a]):o+"photo="+_wppaId[p][a]):""}function wppaStringContainsForbiddenChars(p){for(var a=["?","&","#","/",'"',"'"],e=0;e<a.length;){if(-1!=p.indexOf(a[e]))return!0;e++}return!1}function wppaPushStateSlide(p,a,e){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=e)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:a},"---",e),wppaConsoleLog("Slide history stack updated")}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace("&quot;",'"').replace('"]','">').replace("[/a]","</a>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var a=0;if(wppaCanPushState){if(p.state)switch(a=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+a).html(p.state.html);break;case"slide":_wppaGoto(a,p.state.slide)}else if(wppaUpdateAddressLine){if(a=wppaFirstOccur,jQuery("#wppa-container-"+a).html(wppaStartHtml[a]),(wppaFirstOccur=0)==a){var e=document.location.href.split("&wppa-occur=");a=parseInt(e[1])}e=document.location.href.split("&wppa-photo=");var t=parseInt(e[1]);if(0<t){for(var o=0;o<_wppaId[a].length&&_wppaId[a][o]!=t;)o++;o<_wppaId[a].length&&_wppaGoto(a,o)}}document.getElementById("theslide0-"+a)&&_wppaStop(a)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy?wppaConsoleLog("Fb Init busy"):"undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):(wppaConsoleLog("Fb wait"),setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,a){if(document.selection)p.focus(),sel=document.selection.createRange(),sel.text=a;else if(p.selectionStart||"0"==p.selectionStart){var e=p.selectionStart,t=p.selectionEnd;p.value=p.value.substring(0,e)+a+p.value.substring(t,p.value.length),p.selectionStart=e+a.length,p.selectionEnd=e+a.length}else p.value+=a}function wppaGeoInit(p,a,e){var t=new google.maps.LatLng(a,e),o={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:t},r=new google.maps.Map(document.getElementById("map-canvas-"+p),o),s=new google.maps.Marker({position:t,map:r,title:""});google.maps.event.addListener(r,"center_changed",function(){window.setTimeout(function(){r.panTo(s.getPosition())},1e3)})}function wppaEncode(p){var a;if(void 0!==p){var e=(a=(a=p.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),t=0;for(a="";t<e.length;)a+=e[t],++t<e.length&&(a+="||PLUS||");return a}}function wppaUrlToId(p){var a=p.split("/wppa/");return 1==a.length&&(a=p.split("/upload/")),1==a.length?0:a=(a=(a=(a=(a=(a=(a=a[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,a){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var e=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(e){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var s=jQuery(".wppa-ss-albumcat-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");s=jQuery(".wppa-ss-albumtext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");s=jQuery(".wppa-ss-phototag-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var i;s=jQuery(".wppa-ss-phototext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}if(a){var n=jQuery("#wppa-ss-pageurl-"+p).val();-1==n.indexOf("?")?n+="?":n+="&",n+="occur=1&wppa-supersearch="+e+","+t+","+o+","+r,document.location.href=n}}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,a){var e=jQuery(p).length;6<e&&(e=6),e<2&&(e=2),jQuery(a).attr("size",e)}function wppaUpdateSearchRoot(p,a){for(var e=jQuery(".wppa-search-root"),t=0;t<e.length;)jQuery(e[t]).html(p),t++;for(e=jQuery(".wppa-rootbox"),t=0;t<e.length;)a?(jQuery(e[t]).prop("checked",!1),jQuery(e[t]).prop("disabled",!1)):(jQuery(e[t]).prop("checked",!0),jQuery(e[t]).prop("disabled",!0)),t++;for(e=jQuery(".wppa-search-root-id"),t=0;t<e.length;)jQuery(e[t]).val(a),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),a=0;a<p.length;)jQuery(p[a]).html(""),a++;for(p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).attr("disabled","disabled"),a++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).removeAttr("disabled"),a++}function wppaDisplaySelectedFiles(p){for(var a=jQuery("#"+p),e=0,t="";e<a[0].files.length;)t+=a[0].files[e].name+" ",e++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,a,e,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}wppaConsoleLog("wppa.js version "+wppaJsVersion+" loaded.","force");
1
+ var wppaJsVersion="6.9.05",wppaVersion="0",wppaIsIe=!1,wppaUseSvg=!0,wppaDebug,wppaFullValign=[],wppaFullHalign=[],wppaFullFrameDelta=[],wppaAnimationSpeed,wppaImageDirectory,wppaAutoColumnWidth=[],wppaAutoColumnFrac=[],wppaThumbnailAreaDelta,wppaSlideShowTimeOut=2500,wppaFadeInAfterFadeOut=!1,wppaTextFrameDelta=0,wppaBoxDelta=0,wppaPreambule=[],wppaHideWhenEmpty=!1,wppaThumbnailPitch=[],wppaFilmStripLength=[],wppaFilmStripMargin=[],wppaFilmStripAreaDelta=[],wppaFilmShowGlue=!1,wppaIsMini=[],wppaPortraitOnly=[],wppaSlideShow,wppaPhoto,wppaOf,wppaNextPhoto,wppaPreviousPhoto,wppaNextP,wppaPrevP,wppaAvgRating,wppaMyRating,wppaAvgRat,wppaMyRat,wppaDislikeMsg,wppaMiniTreshold=300,wppaStart="Start",wppaStop="Stop",wppaPleaseName,wppaPleaseEmail,wppaPleaseComment,wppaRatingOnce=!0,wppaBGcolorNumbar="transparent",wppaBcolorNumbar="transparent",wppaBGcolorNumbarActive="transparent",wppaBcolorNumbarActive="transparent",wppaFontFamilyNumbar="",wppaFontSizeNumbar="",wppaFontColorNumbar="",wppaFontWeightNumbar="",wppaFontFamilyNumbarActive="",wppaFontSizeNumbarActive="",wppaFontColorNumbarActive="",wppaFontWeightNumbarActive="",wppaNumbarMax="10",wppaAjaxUrl="",wppaLang="",wppaNextOnCallback=!1,wppaStarOpacity=.2,wppaLightBox=[],wppaEmailRequired="required",wppaSlideBorderWidth=0,wppaSlideInitRunning=[],wppaAnimationType="fadeover",wppaSlidePause=[],wppaSlideBlank=[],wppaRatingMax=5,wppaRatingDisplayType="graphic",wppaRatingPrec=2,wppaFilmPageSize=[],wppaAspectRatio=[],wppaFullSize=[],wppaStretch=!1,wppaThumbSpaceAuto=!1,wppaMinThumbSpace=4,wppaMagnifierCursor="",wppaArtMonkyLink="none",wppaAutoOpenComments=!1,wppaUpdateAddressLine=!1,wppaFilmThumbTitle="",wppaClickToView="",wppaUploadUrl="",wppaVoteForMe="",wppaVotedForMe="",wppaSlideSwipe=!0,wppaLightboxSingle=[],wppaMaxCoverWidth=300,wppaDownLoad="Download",wppaSiteUrl="",wppaWppaUrl="",wppaIncludeUrl="",wppaSlideToFullpopup=!1,wppaComAltSize=75,wppaBumpViewCount=!0,wppaBumpClickCount=!1,wppaFotomoto=!1,wppaArtMonkeyButton=!0,wppaShortQargs=!1,wppaOvlHires=!1,wppaMasonryCols=[],wppaVideoPlaying=[],wppaAudioPlaying=[],wppaSlideVideoStart=!1,wppaSlideAudioStart=!1,wppaAudioHeight=28,wppaHis=0,wppaStartHtml=[],wppaCanAjaxRender=!1,wppaCanPushState=!1,wppaAllowAjax=!0,wppaMaxOccur=0,wppaFirstOccur=0,wppaUsePhotoNamesInUrls=!1,wppaShareHideWhenRunning=!1,wppaCommentRequiredAfterVote=!0,wppaTopMoc=0,wppaColWidth=[],wppaFotomotoHideWhenRunning=!1,wppaFotomotoMinWidth=400,wppaPhotoView=[],wppaBackgroundColorImage="",wppaPopupLinkType="",wppaPopupOnclick=[],wppaThumbTargetBlank=!1,wppaRel="rel",wppaEditPhotoWidth="960",wppaThemeStyles="",wppaStickyHeaderHeight=0,wppaRenderModal=!1,wppaModalBgColor="#ffffff",wppaBoxRadius=0,wppaModalQuitImg,wppaUploadEdit="none",wppaPageArg="",wppaSlideshowNavigationType="icons",wppaCoverImageResponsive=[],wppaSearchBoxSelItems=[],wppaSlideWrap=[],wppaHideRightClick=!1,wppaProcessing="Processing...",wppaDone="Done!",wppaUploadFailed="Upload failed",wppaServerError="Server error",wppaGeoZoom=10,wppaLazyLoad=!0,wppaThumbAreaMaxFrac=1,wppaNiceScroll=!1,_wppaId=[],_wppaAvg=[],_wppaDisc=[],_wppaMyr=[],_wppaVRU=[],_wppaLinkUrl=[],_wppaLinkTitle=[],_wppaLinkTarget=[],_wppaCommentHtml=[],_wppaIptcHtml=[],_wppaExifHtml=[],_wppaToTheSame=!1,_wppaSlides=[],_wppaNames=[],_wppaFullNames=[],_wppaDsc=[],_wppaOgDsc=[],_wppaCurIdx=[],_wppaNxtIdx=[],_wppaTimeOut=[],_wppaSSRuns=[],_wppaFg=[],_wppaTP=[],_wppaIsBusy=[],_wppaFirst=[],_wppaVoteInProgress=!1,_wppaTextDelay,_wppaUrl=[],_wppaSkipRated=[],_wppaLbTitle=[],_wppaStateCount=0,_wppaDidGoto=[],_wppaShareUrl=[],_wppaShareHtml=[],_wppaFilmNoMove=[],_wppaHiresUrl=[],_wppaIsVideo=[],_wppaVideoHtml=[],_wppaAudioHtml=[],_wppaVideoNatWidth=[],_wppaVideoNatHeight=[],_wppaWaitTexts=[],_wppaImageAlt=[],__wppaOverruleRun=!1,wppaOvlUrls,wppaOvlTitles,wppaOvlAlts,wppaOvlIdx=0,wppaOvlFirst=!0,wppaOvlKbHandler="",wppaOvlSizeHandler="",wppaOvlPadTop=5,wppaOvlIsSingle,wppaOvlRunning=!1,wppaOvlVideoHtmls,wppaOvlAudioHtmls,wppaOvlVideoNaturalWidths,wppaOvlVideoNaturalHeights,wppaOvlModeInitial="normal",wppaOvlVideoPlaying=!1,wppaOvlAudioPlaying=!1,wppaOvlShowLegenda=!0,wppaOvlShowStartStop=!0,wppaOvlRadius=0,wppaOvlBorderWidth=16,wppaOvlOpen=!1,wppaOvlTxtHeight=36,wppaOvlOpacity=.8,wppaOvlOnclickType="none",wppaOvlTheme="black",wppaOvlAnimSpeed=300,wppaOvlSlideSpeed=3e3,wppaVer4WindowWidth=800,wppaVer4WindowHeight=600,wppaOvlFontFamily="Helvetica",wppaOvlFontSize="10",wppaOvlFontColor="",wppaOvlFontWeight="bold",wppaOvlLineHeight="12",wppaOvlShowCounter=!0,wppaOvlIsVideo=!1,wppaShowLegenda="",wppaOvlFsPhotoId=0,wppaPhotoId=0,wppaOvlVideoStart=!1,wppaOvlAudioStart=!1,wppaLastIptc="",wppaLastExif="",wppaIsMobile=!1,wppaSvgFillcolor="gray",wppaSvgBgcolor="transparent",wppaSvgCornerStyle="light";function wppaDoInit(p){var a=!1;for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc),a=!0);p||(_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),a&&jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++)wppaAutoColumnWidth[mocc]&&(wppaColWidth[mocc]=0,_wppaDoAutocol(mocc))})),jQuery(".wppa-ajax-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ajax-spin").stop().fadeOut()},1e3),jQuery(".wppa-ovl-spin").stop().fadeOut(),setTimeout(function(){jQuery(".wppa-ovl-spin").stop().fadeOut()},1e3),setTimeout(function(){for(var p=1;p<wppaTopMoc;)jQuery("#ubb-"+p+"-l")&&(wppaUbb(p,"l","hide"),wppaUbb(p,"r","hide")),p++},3e3),jQuery(window).on("DOMContentLoaded load resize scroll",wppaSizeThumbArea),wppaSizeThumbArea(),jQuery(window).on("DOMContentLoaded load resize scroll",wppaMakeLazyVisible),wppaMakeLazyVisible(),wppaProtect()}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(p){return!1}),jQuery("video").bind("contextmenu",function(p){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(p){var a,e,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+p,t[3]="theimg1-"+p,e=0;e<3;)1==++e&&0!=p||(a=document.getElementById(t[e]))&&"function"==typeof a.pause&&(a.pause(),wppaConsoleLog("Video "+t[e]+" paused","force"))}function wppaStopAudio(p){if("number"==typeof p)jQuery("#audio-"+p).pause&&jQuery("#audio-"+p).pause();else{var a=jQuery("audio");if(0<a.length)for(var e=0;e<a.length;)"wppa"==jQuery(a[e]).attr("data-from")&&a[e].pause(),e++}}function wppaMakeFullsizeUrl(p){var a,e;(a=(p=p.replace("/thumbs/","/")).split("//"))[1]?(e=a[1].split("/"),p=a[0]+"//"):(e=a[0].split("/"),p="");for(var t=0;t<e.length;){var o=e[t];"w"!=o.split("_")[0]&&(0!=t&&(p+="/"),p+=o),t++}return p}function wppaGetContainerWidth(p){var a=document.getElementById("wppa-container-"+p),e=0;if(!wppaAutoColumnWidth[p])return a.clientWidth;for(;0==e;)a=a.parentNode,e=jQuery(a).width();return parseInt(e*wppaAutoColumnFrac[p])}function _wppaDoAutocol(p){var a;if(wppaAutoColumnWidth[p]&&(a=wppaGetContainerWidth(p),wppaColWidth[p]!=a)){wppaConsoleLog("Doing autocol "+p),wppaColWidth[p]=a,jQuery(".wppa-container-"+p).css("width",a),wppaRenderModal&&(jQuery(".ui-dialog").css("width",a),jQuery(".ui-dialog").attr("height","auto")),wppaCoverImageResponsive[p]||(jQuery(".wppa-asym-text-frame-"+p).css("width",a-wppaTextFrameDelta),jQuery(".wppa-cover-box-"+p).css("width",a));var e,t=jQuery(".wppa-cover-box-mcr-"+p);if(1<t.length){var o=parseInt((a+8)/(wppaMaxCoverWidth+8))+1,r=o-1;e=parseInt((a+8)/o-8);for(var s=0;s<t.length;){switch(s%o){case 0:jQuery(t[s]).css({marginLeft:"0px",clear:"both",float:"left"});break;case r:jQuery(t[s]).css({marginLeft:"8px",clear:"none",float:"right"});break;default:jQuery(t[s]).css({marginLeft:"8px",clear:"none",float:"left"})}s++}wppaCoverImageResponsive[p]||jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",e-wppaTextFrameDelta),jQuery(".wppa-cover-box-mcr-"+p).css("width",e)}else if(wppaCoverImageResponsive[p]);else{jQuery(".wppa-asym-text-frame-mcr-"+p).css("width",a-wppaTextFrameDelta);jQuery(".wppa-cover-box-mcr-"+p).css({marginLeft:"0px",float:"left"})}if(wppaThumbSpaceAuto){var i=parseInt(jQuery(".thumbnail-frame-"+p).css("width"));if(i){var n=a-wppaThumbnailAreaDelta-7,l=parseInt(n/(i+wppaMinThumbSpace)),w=parseInt(.5+(n-l*i)/(l+1));jQuery(".thumbnail-frame-"+p).css({marginLeft:w})}}jQuery(".thumbnail-frame-comalt-"+p).css("width",a-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+p).css("width",a-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,d=jQuery("#wppa-mas-h-"+c+"-"+p).attr("data-height-perc");d;)u=d*(a-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+p).css("height",u),c++,d=jQuery("#wppa-mas-h-"+c+"-"+p).attr("data-height-perc");wppaSetMasHorFrameWidthsForIeAndChrome(p),wppaFormatSlide(p),jQuery("#audio-slide-"+p).css("width",a-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+p).css("width",.7*a),wppaFilmStripLength[p]=a-wppaFilmStripAreaDelta[p],jQuery("#filmwindow-"+p).css("width",wppaFilmStripLength[p]),_wppaAdjustFilmstrip(p),wppaIsMini[p]||void 0===_wppaSlides[p]||(wppaColWidth[p]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat),jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating),jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length))),jQuery(".wppa-sphoto-"+p).css("width",a),jQuery(".wppa-simg-"+p).css("width",a-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+p).css("height",""),jQuery(".wppa-mphoto-"+p).css("width",a+10),jQuery(".wppa-mimg-"+p).css("width",a),jQuery(".wppa-mimg-"+p).css("height",""),0<wppaSearchBoxSelItems[p]&&(a/wppaSearchBoxSelItems[p]<125?jQuery(".wppa-searchsel-item-"+p).css("width","100%"):jQuery(".wppa-searchsel-item-"+p).css("width",100/wppaSearchBoxSelItems[p]+"%")),jQuery(".wppa-upload-album-"+p).css("maxWidth",.6*a)}}function wppaSetMasHorFrameWidthsForIeAndChrome(p){for(var a=jQuery(".wppa-mas-h-"+p),e=wppaMinThumbSpace,t=0;t<a.length;t++){var o=wppaGetChildI(a[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+p+" )",400);var r=o.naturalWidth/o.naturalHeight*o.height+e;jQuery(a[t]).css({width:r})}}}function wppaGetChildI(p){var a,e=p.childNodes;for(a=0;a<e.length;a++){var t=e[a];if(t.id&&"i-"==t.id.substr(0,2))return t;var o=wppaGetChildI(t);if(o)return o}return!1}jQuery(document).ready(function(){wppaDoInit(!1),setTimeout(function(){wppaDoInit(!0)},1e3)}),jQuery(document).ready(function(p){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var a=1;a<=wppaMaxOccur;)wppaStartHtml[a]=jQuery("#wppa-container-"+a).html(),a++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(p,a){if(!(wppaColWidth[p]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+p).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+p).css("display","none");jQuery("#wppa-fotomoto-container-"+p).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+p)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(a),wppaFotomotoToolbarIds[p]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+p,a)):(setTimeout("wppaFotomotoToolbar( "+p+',"'+a+'" )',200),wppaConsoleLog("Waiting for Fotomoto")))}function wppaFotomotoHide(p){jQuery("#wppa-fotomoto-container-"+p).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+p).css("display","none")}function wppaGetCurrentFullUrl(p,a){var e,t,o,r=document.location.href.split("?"),s="nil",i=0,n=!0;o=wppaShortQargs?"":"wppa-",r[1]&&(s=r[1].split("&"));var l=!1;if(e=r[0],"nil"!=s&&0<s.length)for(;i<s.length;)(t=s[i].split("="))[0]==o+"album"&&(l=!0),t[0]!=o+"photo"&&(e+=n?"?":"&",n=!1,e+=s[i]),i++;return l?(e+=n?"?":"&",e+=wppaUsePhotoNamesInUrls?o+"photo="+encodeURIComponent(_wppaNames[p][a]):o+"photo="+_wppaId[p][a]):""}function wppaStringContainsForbiddenChars(p){for(var a=["?","&","#","/",'"',"'"],e=0;e<a.length;){if(-1!=p.indexOf(a[e]))return!0;e++}return!1}function wppaPushStateSlide(p,a,e){if(!wppaIsMini[p]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=e)try{history.pushState({page:wppaHis,occur:p,type:"slide",slide:a},"---",e),wppaConsoleLog("Slide history stack updated")}catch(p){wppaConsoleLog("Slide history stack update failed")}}function wppaRepairScriptTags(p){if(void 0===p)return"";for(;-1!=p.indexOf("[script");)p=p.replace("[script","<script");for(;-1!=p.indexOf("[/script");)p=p.replace("[/script","</script");return p}function wppaRepairBrTags(p){return void 0===p?"":p.replace("[br /]","<br />").replace("[a","<a").replace("&quot;",'"').replace('"]','">').replace("[/a]","</a>")}function wppaTrimAlt(p){return void 0===p?"":13<p.length?p.substr(0,10)+"...":p}window.onpopstate=function(p){var a=0;if(wppaCanPushState){if(p.state)switch(a=p.state.occur,p.state.type){case"html":jQuery("#wppa-container-"+a).html(p.state.html);break;case"slide":_wppaGoto(a,p.state.slide)}else if(wppaUpdateAddressLine){if(a=wppaFirstOccur,jQuery("#wppa-container-"+a).html(wppaStartHtml[a]),(wppaFirstOccur=0)==a){var e=document.location.href.split("&wppa-occur=");a=parseInt(e[1])}e=document.location.href.split("&wppa-photo=");var t=parseInt(e[1]);if(0<t){for(var o=0;o<_wppaId[a].length&&_wppaId[a][o]!=t;)o++;o<_wppaId[a].length&&_wppaGoto(a,o)}}document.getElementById("theslide0-"+a)&&_wppaStop(a)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy?wppaConsoleLog("Fb Init busy"):"undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):(wppaConsoleLog("Fb wait"),setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(p,a){if(document.selection)p.focus(),sel=document.selection.createRange(),sel.text=a;else if(p.selectionStart||"0"==p.selectionStart){var e=p.selectionStart,t=p.selectionEnd;p.value=p.value.substring(0,e)+a+p.value.substring(t,p.value.length),p.selectionStart=e+a.length,p.selectionEnd=e+a.length}else p.value+=a}function wppaGeoInit(p,a,e){var t=new google.maps.LatLng(a,e),o={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:t},r=new google.maps.Map(document.getElementById("map-canvas-"+p),o),s=new google.maps.Marker({position:t,map:r,title:""});google.maps.event.addListener(r,"center_changed",function(){window.setTimeout(function(){r.panTo(s.getPosition())},1e3)})}function wppaEncode(p){var a;if(void 0!==p){var e=(a=(a=p.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),t=0;for(a="";t<e.length;)a+=e[t],++t<e.length&&(a+="||PLUS||");return a}}function wppaUrlToId(p){var a=p.split("/wppa/");return 1==a.length&&(a=p.split("/upload/")),1==a.length?0:a=(a=(a=(a=(a=(a=(a=a[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(p,a){jQuery("#wppa-ss-albumopt-"+p).css("display","none"),jQuery("#wppa-ss-albumcat-"+p).css("display","none"),jQuery("#wppa-ss-albumname-"+p).css("display","none"),jQuery("#wppa-ss-albumtext-"+p).css("display","none"),jQuery("#wppa-ss-photoopt-"+p).css("display","none"),jQuery("#wppa-ss-photoname-"+p).css("display","none"),jQuery("#wppa-ss-photoowner-"+p).css("display","none"),jQuery("#wppa-ss-phototag-"+p).css("display","none"),jQuery("#wppa-ss-phototext-"+p).css("display","none"),jQuery("#wppa-ss-photoexif-"+p).css("display","none"),jQuery("#wppa-ss-photoiptc-"+p).css("display","none"),jQuery("#wppa-ss-exifopts-"+p).css("display","none"),jQuery("#wppa-ss-iptcopts-"+p).css("display","none"),jQuery("#wppa-ss-spinner-"+p).css("display","none"),jQuery("#wppa-ss-button-"+p).css("display","none");var e=jQuery("#wppa-ss-pa-"+p).val(),t="",o="",r="";switch(e){case"a":switch(jQuery("#wppa-ss-albumopt-"+p).css("display",""),t=jQuery("#wppa-ss-albumopt-"+p).val()){case"c":jQuery("#wppa-ss-albumcat-"+p).css("display","");var s=jQuery(".wppa-ss-albumcat-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+p).css("display","");s=jQuery(".wppa-ss-albumtext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+p).css("display",""),t=jQuery("#wppa-ss-photoopt-"+p).val()){case"n":jQuery("#wppa-ss-photoname-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+p).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+p).val())&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+p).css("display","");s=jQuery(".wppa-ss-phototag-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+p).css("display","");var i;s=jQuery(".wppa-ss-phototext-"+p);for(r="",i=0;i<s.length;i++)"selected"==jQuery(s[i]).attr("selected")&&(r+="."+jQuery(s[i]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+p).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+p).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+p).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(p,o,"wppa-ss-iptcopts-"+p),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+p).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+p).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+p).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(p,o,"wppa-ss-exifopts-"+p),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+p).val())&&""!=r&&jQuery("#wppa-ss-button-"+p).css("display","")))}}if(a){var n=jQuery("#wppa-ss-pageurl-"+p).val();-1==n.indexOf("?")?n+="?":n+="&",n+="occur=1&wppa-supersearch="+e+","+t+","+o+","+r,document.location.href=n}}function wppaAjaxGetSsIptcList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssiptclist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-iptcopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-iptclist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsIptcList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaAjaxGetSsExifList(t,p,o){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=getssexiflist&tag="+p+"&moccur="+t,async:!0,type:"GET",timeout:1e4,beforeSend:function(p){jQuery("#wppa-ss-spinner-"+t).css("display","")},success:function(p,a,e){jQuery("#"+o).html(p),jQuery("#wppa-ss-exifopts-"+t).css("display",""),wppaSuperSearchSelect(t),setTimeout('wppaSetIptcExifSize( ".wppa-exiflist-'+t+'", "#'+o+'" )',10)},error:function(p,a,e){wppaConsoleLog("wppaAjaxGetSsExifList failed. Error = "+e+", status = "+a,"force")},complete:function(p,a,e){jQuery("#wppa-ss-spinner-"+t).css("display","none")}})}function wppaSetIptcExifSize(p,a){var e=jQuery(p).length;6<e&&(e=6),e<2&&(e=2),jQuery(a).attr("size",e)}function wppaUpdateSearchRoot(p,a){for(var e=jQuery(".wppa-search-root"),t=0;t<e.length;)jQuery(e[t]).html(p),t++;for(e=jQuery(".wppa-rootbox"),t=0;t<e.length;)a?(jQuery(e[t]).prop("checked",!1),jQuery(e[t]).prop("disabled",!1)):(jQuery(e[t]).prop("checked",!0),jQuery(e[t]).prop("disabled",!0)),t++;for(e=jQuery(".wppa-search-root-id"),t=0;t<e.length;)jQuery(e[t]).val(a),t++}function wppaSubboxChange(p){jQuery(p).prop("checked")&&jQuery(".wppa-rootbox").each(function(p){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var p=jQuery(".wppa-display-searchstring"),a=0;a<p.length;)jQuery(p[a]).html(""),a++;for(p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).attr("disabled","disabled"),a++}function wppaEnableSubsearch(){for(var p=jQuery(".wppa-search-sub-box"),a=0;a<p.length;)jQuery(p[a]).removeAttr("disabled"),a++}function wppaDisplaySelectedFiles(p){for(var a=jQuery("#"+p),e=0,t="";e<a[0].files.length;)t+=a[0].files[e].name+" ",e++;jQuery("#"+p+"-display").val(t)}function wppaIsEmpty(p){return null==p||(void 0===p||(""==p||(0==p||(0==p||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(p,a,e,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}wppaConsoleLog("wppa.js version "+wppaJsVersion+" loaded.","force");
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 6.9.04
6
- Stable tag: 6.9.03
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -137,6 +137,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
137
 
138
  == Upgrade Notice ==
139
 
 
 
 
 
140
  = 6.9.04 =
141
 
142
  * This version addresses various minor bug fixes and feature requests.
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 6.9.05
6
+ Stable tag: 6.9.04
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
137
 
138
  == Upgrade Notice ==
139
 
140
+ = 6.9.05 =
141
+
142
+ * This version addresses various minor bug fixes and feature requests.
143
+
144
  = 6.9.04 =
145
 
146
  * This version addresses various minor bug fixes and feature requests.
vendor/jquery-easing/jquery.easing.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],function($){return factory($)})}else if(typeof module==="object"&&typeof module.exports==="object"){exports=factory(require("jquery"))}else{factory(jQuery)}})(function($){$.easing["jswing"]=$.easing["swing"];var pow=Math.pow,sqrt=Math.sqrt,sin=Math.sin,cos=Math.cos,PI=Math.PI,c1=1.70158,c2=c1*1.525,c3=c1+1,c4=2*PI/3,c5=2*PI/4.5;function bounceOut(x){var n1=7.5625,d1=2.75;if(x<1/d1){return n1*x*x}else if(x<2/d1){return n1*(x-=1.5/d1)*x+.75}else if(x<2.5/d1){return n1*(x-=2.25/d1)*x+.9375}else{return n1*(x-=2.625/d1)*x+.984375}}$.extend($.easing,{def:"easeOutQuad",swing:function(x){return $.easing[$.easing.def](x)},easeInQuad:function(x){return x*x},easeOutQuad:function(x){return 1-(1-x)*(1-x)},easeInOutQuad:function(x){return x<.5?2*x*x:1-pow(-2*x+2,2)/2},easeInCubic:function(x){return x*x*x},easeOutCubic:function(x){return 1-pow(1-x,3)},easeInOutCubic:function(x){return x<.5?4*x*x*x:1-pow(-2*x+2,3)/2},easeInQuart:function(x){return x*x*x*x},easeOutQuart:function(x){return 1-pow(1-x,4)},easeInOutQuart:function(x){return x<.5?8*x*x*x*x:1-pow(-2*x+2,4)/2},easeInQuint:function(x){return x*x*x*x*x},easeOutQuint:function(x){return 1-pow(1-x,5)},easeInOutQuint:function(x){return x<.5?16*x*x*x*x*x:1-pow(-2*x+2,5)/2},easeInSine:function(x){return 1-cos(x*PI/2)},easeOutSine:function(x){return sin(x*PI/2)},easeInOutSine:function(x){return-(cos(PI*x)-1)/2},easeInExpo:function(x){return x===0?0:pow(2,10*x-10)},easeOutExpo:function(x){return x===1?1:1-pow(2,-10*x)},easeInOutExpo:function(x){return x===0?0:x===1?1:x<.5?pow(2,20*x-10)/2:(2-pow(2,-20*x+10))/2},easeInCirc:function(x){return 1-sqrt(1-pow(x,2))},easeOutCirc:function(x){return sqrt(1-pow(x-1,2))},easeInOutCirc:function(x){return x<.5?(1-sqrt(1-pow(2*x,2)))/2:(sqrt(1-pow(-2*x+2,2))+1)/2},easeInElastic:function(x){return x===0?0:x===1?1:-pow(2,10*x-10)*sin((x*10-10.75)*c4)},easeOutElastic:function(x){return x===0?0:x===1?1:pow(2,-10*x)*sin((x*10-.75)*c4)+1},easeInOutElastic:function(x){return x===0?0:x===1?1:x<.5?-(pow(2,20*x-10)*sin((20*x-11.125)*c5))/2:pow(2,-20*x+10)*sin((20*x-11.125)*c5)/2+1},easeInBack:function(x){return c3*x*x*x-c1*x*x},easeOutBack:function(x){return 1+c3*pow(x-1,3)+c1*pow(x-1,2)},easeInOutBack:function(x){return x<.5?pow(2*x,2)*((c2+1)*2*x-c2)/2:(pow(2*x-2,2)*((c2+1)*(x*2-2)+c2)+2)/2},easeInBounce:function(x){return 1-bounceOut(1-x)},easeOutBounce:bounceOut,easeInOutBounce:function(x){return x<.5?(1-bounceOut(1-2*x))/2:(1+bounceOut(2*x-1))/2}})});
vendor/nicescroll/MIT.LICENSE ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Open Source Initiative OSI - The MIT License (MIT):Licensing
2
+ [OSI Approved License]
3
+ The MIT License (MIT)
4
+
5
+ Copyright (c) 2011-17 InuYaksa
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
8
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
9
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
10
+ and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
17
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
vendor/nicescroll/README.txt ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # jQuery.NiceScroll
2
+ v. 3.7.6
3
+
4
+ ## The best nicescroll release ever - extremely smooth and consistent in modern browsers and mobile devices, with low resource usage
5
+
6
+ - [Web Site: nicescroll.areaaperta.com](https://nicescroll.areaaperta.com)
7
+ - [Repo: github.com/inuyaksa/jquery.nicescroll](https://github.com/inuyaksa/jquery.nicescroll)
8
+ - [Twitter: @nicescroll](https://twitter.com/nicescroll)
9
+
10
+ [![Join the chat at https://gitter.im/inuyaksa/jquery.nicescroll](https://badges.gitter.im/inuyaksa/jquery.nicescroll.svg)](https://gitter.im/inuyaksa/jquery.nicescroll?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
11
+
12
+ > Nicescroll as a Greasemonkey plugin: http://userscripts.org/scripts/show/119910 (freezed)
13
+
14
+
15
+ > Nicescroll is a jquery plugin, for nice scrollbars with a very similar ios/mobile style.
16
+
17
+ - HORIZONAL scrollbar support!
18
+ - It supports DIVs, IFrames, textarea, and document page (body) scrollbars.
19
+ - Compatible with all recent desktop browser and older: Chrome, Firefox, Edge, IE8+, Safari (win/mac), Opera. (all A-grade browsers)
20
+ - Compatible with mobile device: iPad/iPhone/iPod, Android 4+, Blackberry phones and Playbook (WebWorks/Table OS), Windows Phone 8 and 10.
21
+ - Compatible with all touch devices: iPad, Android tablets, Window Surface.
22
+ - Compabible with multi-input device (mouse with touch or pen): Window Surface, Chrome Desktop on touch notebook.
23
+ - Compatible with 2 directions mice: Apple Magic Mouse, Apple Mouser with 2-dir wheel, PC mouse with 2-dir wheel (if browser support it).
24
+
25
+ So you have customizable and scrollable divs with momentum for iPad and you have consistent scrollable areas for all desktop and mobile platforms.
26
+
27
+ Sexy zoom feature, you can "zoom-in" the content of any nicescroll'ed div.
28
+ Nice to use and nice to see, all the content of the div in fullscreen mode.
29
+ It works on desktop (double click on div) either in mobile/touch devices using pinch gesture.
30
+
31
+ On modern browsers hardware accelerated scrolling has implemented.
32
+ Using animationFrame for a smoothest and cpu-saving scrolling. (when browser supports)
33
+
34
+ "Use strict" tested script for maximum code quality.
35
+ Bower and AMD ready.
36
+
37
+ Warning for IE6/7 users (why do you uses yet? Please updgrade to a more stable and modern browser), support for your browser has deprecated.
38
+
39
+
40
+ ## FEATURES
41
+
42
+ - simple installation and activation, it works with NO modification of your code. (some exceptions can happen, so you can write to me)
43
+ - very stylish scrollbars, with no occupation on your window (original browser scrollbars need some of page space and reduces window/div usable width)
44
+ - you can style main document scrollbar (body) too!! (not all device/browser support this feature)
45
+ - on all browsers you can scroll: dragging the cursor, mouse wheel (speed customizable), keyboard navigation (cursor keys, pagup/down keys, home/end keys)
46
+ - scroll is smooth (as modern tablet browsing), speed is customizable
47
+ - zoom feature
48
+ - hardware accelerated scroll (where available)
49
+ - animation frame support for smoth scrolling and cpu-saving
50
+ - dragging scroll mode with scrolling momentum (as touch device)
51
+ - tested for all major browsers desktop and mobile versions
52
+ - support for touch devices
53
+ - support for multi-input devices (MSPointer/Pointer support)
54
+ - compatible with many other browsers and webkit derivated!
55
+ - scrollbar has a lot a customizable features
56
+ - native scroll events are working yet
57
+ - fully integrated with jQuery
58
+ - compatibile with jQuery UI, jQuery Touch, jQuery Mobile
59
+
60
+
61
+ ## DEPENDENCIES
62
+ >> It's a plugin for the jquery framework, you need to include jquery in your scripts.
63
+ >> it works with jQuery 1.x / 2.x / 3.x branch (slim version don't works)
64
+
65
+
66
+ * INSTALLATION
67
+ Put loading script tag after jquery script tag and loading the zoom image in the same folder of the script:
68
+
69
+ <script src="jquery.nicescroll.js"></script>
70
+
71
+ When you use zoom feature, copy image "zoomico.png" in the same folder of jquery.nicescroll.js.
72
+
73
+
74
+ * HOW TO USE
75
+
76
+ Initialize nicescroll ALWAYS in (document) ready statement.
77
+ ```javascript
78
+ // 1. Simple mode, it styles document scrollbar:
79
+ $(function() {
80
+ $("body").niceScroll();
81
+ });
82
+
83
+ // 2. Instance with object returned:
84
+ var nice = false;
85
+ $(function() {
86
+ nice = $("body").niceScroll();
87
+ });
88
+
89
+ // 3. Style a DIV and change cursor color:
90
+ $(function() {
91
+ $("#thisdiv").niceScroll({cursorcolor:"#00F"});
92
+ });
93
+
94
+ // 4. DIV with "wrapper", formed by two divs, the first is the vieport, the latter is the content:
95
+ $(function() {
96
+ $("#viewportdiv").niceScroll("#wrapperdiv",{cursorcolor:"#00F"});
97
+ });
98
+
99
+ // 5. Get nicescroll object:
100
+ var nice = $("#mydiv").getNiceScroll();
101
+
102
+ // 6. Hide scrollbars:
103
+ $("#mydiv").getNiceScroll().hide();
104
+
105
+ // 7. Check for scrollbars resize (when content or position have changed):
106
+ $("#mydiv").getNiceScroll().resize();
107
+
108
+ // 8. Scrolling to a position:
109
+ $("#mydiv").getNiceScroll(0).doScrollLeft(x, duration); // Scroll X Axis
110
+ $("#mydiv").getNiceScroll(0).doScrollTop(y, duration); // Scroll Y Axis
111
+ ```
112
+
113
+ ## CONFIGURATION PARAMETERS
114
+ When you call "niceScroll" you can pass some parameters to custom visual aspects:
115
+
116
+ ```javascript
117
+ $("#thisdiv").niceScroll({
118
+ cursorcolor: "#424242", // change cursor color in hex
119
+ cursoropacitymin: 0, // change opacity when cursor is inactive (scrollabar "hidden" state), range from 1 to 0
120
+ cursoropacitymax: 1, // change opacity when cursor is active (scrollabar "visible" state), range from 1 to 0
121
+ cursorwidth: "5px", // cursor width in pixel (you can also write "5px")
122
+ cursorborder: "1px solid #fff", // css definition for cursor border
123
+ cursorborderradius: "5px", // border radius in pixel for cursor
124
+ zindex: "auto" | [number], // change z-index for scrollbar div
125
+ scrollspeed: 60, // scrolling speed
126
+ mousescrollstep: 40, // scrolling speed with mouse wheel (pixel)
127
+ touchbehavior: false, // DEPRECATED!! use "emulatetouch"
128
+ emulatetouch: false, // enable cursor-drag scrolling like touch devices in desktop computer
129
+ hwacceleration: true, // use hardware accelerated scroll when supported
130
+ boxzoom: false, // enable zoom for box content
131
+ dblclickzoom: true, // (only when boxzoom=true) zoom activated when double click on box
132
+ gesturezoom: true, // (only when boxzoom=true and with touch devices) zoom activated when pinch out/in on box
133
+ grabcursorenabled: true // (only when touchbehavior=true) display "grab" icon
134
+ autohidemode: true, // how hide the scrollbar works, possible values:
135
+ true | // hide when no scrolling
136
+ "cursor" | // only cursor hidden
137
+ false | // do not hide,
138
+ "leave" | // hide only if pointer leaves content
139
+ "hidden" | // hide always
140
+ "scroll", // show only on scroll
141
+ background: "", // change css for rail background
142
+ iframeautoresize: true, // autoresize iframe on load event
143
+ cursorminheight: 32, // set the minimum cursor height (pixel)
144
+ preservenativescrolling: true, // you can scroll native scrollable areas with mouse, bubbling mouse wheel event
145
+ railoffset: false, // you can add offset top/left for rail position
146
+ bouncescroll: false, // (only hw accell) enable scroll bouncing at the end of content as mobile-like
147
+ spacebarenabled: true, // enable page down scrolling when space bar has pressed
148
+ railpadding: { top: 0, right: 0, left: 0, bottom: 0 }, // set padding for rail bar
149
+ disableoutline: true, // for chrome browser, disable outline (orange highlight) when selecting a div with nicescroll
150
+ horizrailenabled: true, // nicescroll can manage horizontal scroll
151
+ railalign: right, // alignment of vertical rail
152
+ railvalign: bottom, // alignment of horizontal rail
153
+ enabletranslate3d: true, // nicescroll can use css translate to scroll content
154
+ enablemousewheel: true, // nicescroll can manage mouse wheel events
155
+ enablekeyboard: true, // nicescroll can manage keyboard events
156
+ smoothscroll: true, // scroll with ease movement
157
+ sensitiverail: true, // click on rail make a scroll
158
+ enablemouselockapi: true, // can use mouse caption lock API (same issue on object dragging)
159
+ cursorfixedheight: false, // set fixed height for cursor in pixel
160
+ hidecursordelay: 400, // set the delay in microseconds to fading out scrollbars
161
+ directionlockdeadzone: 6, // dead zone in pixels for direction lock activation
162
+ nativeparentscrolling: true, // detect bottom of content and let parent to scroll, as native scroll does
163
+ enablescrollonselection: true, // enable auto-scrolling of content when selection text
164
+ cursordragspeed: 0.3, // speed of selection when dragged with cursor
165
+ rtlmode: "auto", // horizontal div scrolling starts at left side
166
+ cursordragontouch: false, // drag cursor in touch / touchbehavior mode also
167
+ oneaxismousemode: "auto", // it permits horizontal scrolling with mousewheel on horizontal only content, if false (vertical-only) mousewheel don't scroll horizontally, if value is auto detects two-axis mouse
168
+ scriptpath: "" // define custom path for boxmode icons ("" => same script path)
169
+ preventmultitouchscrolling: true // prevent scrolling on multitouch events
170
+ disablemutationobserver: false // force MutationObserver disabled,
171
+ enableobserver: true // enable DOM changing observer, it tries to resize/hide/show when parent or content div had changed
172
+ scrollbarid: false // set a custom ID for nicescroll bars
173
+ });
174
+ ```
175
+
176
+ Related projects
177
+ ----------------
178
+
179
+ * [Nicescroll for Angular](https://github.com/tushariscoolster/angular-nicescroll)
180
+
181
+ * LICENSE
182
+
183
+ ## Copyright 2011-17 InuYaksa
184
+
185
+ ###### Licensed under the MIT License, http://www.opensource.org/licenses/mit-license.php
186
+
187
+ ###### Images used for zoom icons have derived from OLPC interface, http://laptop.org/8.2.0/manual/Browse_ChangingView.html
vendor/nicescroll/jquery.nicescroll.iframehelper.js ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* iframe script helper for jquery.nicescroll
2
+ -- version 0.9.0
3
+ -- copyright 2017-06-18 InuYaksa*2017
4
+ -- licensed under the MIT
5
+ --
6
+ -- https://nicescroll.areaaperta.com/
7
+ -- https://github.com/inuyaksa/jquery.nicescroll
8
+ --
9
+ */
10
+
11
+ (function (document, window) {
12
+
13
+ var body = document.body;
14
+ var parent = window.parent;
15
+
16
+ if (parent && ("createEvent" in document)) {
17
+
18
+ var isoldie = ("documentMode" in document); // 11-
19
+ var ismsedge = ("msCredentials" in window); // MS Edge 14+
20
+
21
+ function onwheel (e) {
22
+
23
+ var evt = document.createEvent("MouseEvents");
24
+ evt.initEvent('wheel', true, true);
25
+ evt.deltaMode = e.deltaMode;
26
+ evt.deltaX = e.deltaX;
27
+ evt.deltaY = e.deltaY;
28
+ evt.deltaZ = e.deltaZ;
29
+ evt.wheelDelta = e.wheelDelta;
30
+ evt.wheelDeltaX = e.wheelDeltaX;
31
+ evt.wheelDeltaY = e.wheelDeltaY;
32
+
33
+ parent.dispatchEvent(evt);
34
+ }
35
+
36
+ body.addEventListener("wheel", onwheel);
37
+
38
+ }
39
+
40
+ if (window.addEventListener) {
41
+
42
+ // https://davidwalsh.name/add-rules-stylesheets
43
+ var sheet = (function () {
44
+ var style = document.createElement("style");
45
+ style.appendChild(document.createTextNode(""));
46
+ document.head.appendChild(style);
47
+ return style.sheet;
48
+ })();
49
+
50
+ var tmrscroll = false;
51
+ var lastiframe = null;
52
+ var lastiframeviewport = null;
53
+ var lastscroll = [];
54
+
55
+ window.addEventListener("scroll", function (e) {
56
+ if (lastiframeviewport) {
57
+ // var df = [ window.scrollX - lastscroll[0], window.scrollY - lastscroll[1] ];
58
+ window.scrollTo(lastscroll[0], lastscroll[1]);
59
+ // lastiframeviewport.scrollBy(df[0],df[1]);
60
+ // console.log(df);
61
+ }
62
+ });
63
+
64
+ function findNiceParent (t) {
65
+ do {
66
+ if ($.data(t, '__nicescroll') !== undefined) {
67
+ return t;
68
+ }
69
+ t = t.parentNode || false;
70
+ }
71
+ while (t);
72
+ return false;
73
+ }
74
+
75
+ window.addEventListener("load", function () {
76
+
77
+ var hasstyle = false;
78
+
79
+ $.nicescroll.each(function () {
80
+ var nice = this;
81
+ nice.scrollstart(function () {
82
+ if (! hasstyle) {
83
+ sheet.insertRule("iframe { pointer-events: none !important; }", 0);
84
+ }
85
+ hasstyle = true;
86
+ });
87
+ nice.scrollend(function () {
88
+ if (hasstyle) {
89
+ sheet.deleteRule(0);
90
+ }
91
+ hasstyle = false;
92
+ });
93
+ });
94
+
95
+ $("iframe").each(function () {
96
+ this.addEventListener("mouseenter", function (e) {
97
+ lastiframe = e.target;
98
+ var chk = findNiceParent(lastiframe);
99
+ lastiframeviewport = chk;
100
+ //if (chk) lastiframeviewport = $(chk).getNiceScroll();
101
+ lastscroll = [window.scrollX, window.scrollY];
102
+ });
103
+ this.addEventListener("mouseleave", function (e) {
104
+ lastiframe = lastiframeviewport = null;
105
+ });
106
+ });
107
+
108
+ });
109
+
110
+ }
111
+
112
+ })(document, window);
vendor/nicescroll/jquery.nicescroll.iframehelper.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* iframe helper for jquery.nicescroll v3.7.6 InuYaksa - MIT - https://nicescroll.areaaperta.com */
2
+ !function(e,t){function n(t){var n=e.createEvent("MouseEvents");n.initEvent("wheel",!0,!0),n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ,n.wheelDelta=t.wheelDelta,n.wheelDeltaX=t.wheelDeltaX,n.wheelDeltaY=t.wheelDeltaY,r.dispatchEvent(n)}function l(e){do{if(void 0!==$.data(e,"__nicescroll"))return e;e=e.parentNode||!1}while(e);return!1}var a=e.body,r=t.parent;if(r&&"createEvent"in e){a.addEventListener("wheel",n)}if(t.addEventListener){var i=function(){var t=e.createElement("style");return t.appendChild(e.createTextNode("")),e.head.appendChild(t),t.sheet}(),d=null,o=null,c=[];t.addEventListener("scroll",function(e){o&&t.scrollTo(c[0],c[1])}),t.addEventListener("load",function(){var e=!1;$.nicescroll.each(function(){var t=this;t.scrollstart(function(){e||i.insertRule("iframe { pointer-events: none !important; }",0),e=!0}),t.scrollend(function(){e&&i.deleteRule(0),e=!1})}),$("iframe").each(function(){this.addEventListener("mouseenter",function(e){var n=l(d=e.target);o=n,c=[t.scrollX,t.scrollY]}),this.addEventListener("mouseleave",function(e){d=o=null})})})}}(document,window);
vendor/nicescroll/jquery.nicescroll.js ADDED
@@ -0,0 +1,4365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* jquery.nicescroll
2
+ -- version 3.7.6
3
+ -- copyright 2017-07-19 InuYaksa*2017
4
+ -- licensed under the MIT
5
+ --
6
+ -- https://nicescroll.areaaperta.com/
7
+ -- https://github.com/inuyaksa/jquery.nicescroll
8
+ --
9
+ */
10
+
11
+ /* jshint expr: true */
12
+
13
+ (function (factory) {
14
+ if (typeof define === 'function' && define.amd) {
15
+ // AMD. Register as anonymous module.
16
+ define(['jquery'], factory);
17
+ }
18
+ else if (typeof exports === 'object') {
19
+ // Node/CommonJS.
20
+ module.exports = factory(require('jquery'));
21
+ }
22
+ else {
23
+ // Browser globals.
24
+ factory(jQuery);
25
+ }
26
+ }(function (jQuery) {
27
+
28
+ "use strict";
29
+
30
+ // globals
31
+ var domfocus = false,
32
+ mousefocus = false,
33
+ tabindexcounter = 0,
34
+ ascrailcounter = 2000,
35
+ globalmaxzindex = 0;
36
+
37
+ var $ = jQuery, // sandbox
38
+ _doc = document,
39
+ _win = window,
40
+ $window = $(_win);
41
+
42
+ var delegatevents = [];
43
+
44
+ // http://stackoverflow.com/questions/2161159/get-script-path
45
+ function getScriptPath () {
46
+ var scripts = _doc.currentScript || (function () {
47
+ var s = _doc.getElementsByTagName('script');
48
+ return (s.length) ? s[s.length - 1] : false;
49
+ })();
50
+ var path = scripts ? scripts.src.split('?')[0] : '';
51
+ return (path.split('/').length > 0) ? path.split('/').slice(0, - 1).join('/') + '/' : '';
52
+ }
53
+
54
+ // based on code by Paul Irish https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
55
+ var setAnimationFrame = _win.requestAnimationFrame || _win.webkitRequestAnimationFrame || _win.mozRequestAnimationFrame || false;
56
+ var clearAnimationFrame = _win.cancelAnimationFrame || _win.webkitCancelAnimationFrame || _win.mozCancelAnimationFrame || false;
57
+
58
+ if (! setAnimationFrame) {
59
+ var anilasttime = 0;
60
+ setAnimationFrame = function (callback, element) {
61
+ var currTime = new Date().getTime();
62
+ var timeToCall = Math.max(0, 16 - (currTime - anilasttime));
63
+ var id = _win.setTimeout(function () {
64
+ callback(currTime + timeToCall);
65
+ },
66
+ timeToCall);
67
+ anilasttime = currTime + timeToCall;
68
+ return id;
69
+ };
70
+ clearAnimationFrame = function (id) {
71
+ _win.clearTimeout(id);
72
+ };
73
+ }
74
+ else {
75
+ if (! _win.cancelAnimationFrame) {
76
+ clearAnimationFrame = function (id) {
77
+ };
78
+ }
79
+ }
80
+
81
+ var ClsMutationObserver = _win.MutationObserver || _win.WebKitMutationObserver || false;
82
+
83
+ var now = Date.now || function () {
84
+ return new Date().getTime();
85
+ };
86
+
87
+ var _globaloptions = {
88
+ zindex: "auto",
89
+ cursoropacitymin: 0,
90
+ cursoropacitymax: 1,
91
+ cursorcolor: "#424242",
92
+ cursorwidth: "6px",
93
+ cursorborder: "1px solid #fff",
94
+ cursorborderradius: "5px",
95
+ scrollspeed: 40,
96
+ mousescrollstep: 9 * 3,
97
+ touchbehavior: false, // deprecated
98
+ emulatetouch: false, // replacing touchbehavior
99
+ hwacceleration: true,
100
+ usetransition: true,
101
+ boxzoom: false,
102
+ dblclickzoom: true,
103
+ gesturezoom: true,
104
+ grabcursorenabled: true,
105
+ autohidemode: true,
106
+ background: "",
107
+ iframeautoresize: true,
108
+ cursorminheight: 32,
109
+ preservenativescrolling: true,
110
+ railoffset: false,
111
+ railhoffset: false,
112
+ bouncescroll: true,
113
+ spacebarenabled: true,
114
+ railpadding: {
115
+ top: 0,
116
+ right: 0,
117
+ left: 0,
118
+ bottom: 0
119
+ },
120
+ disableoutline: true,
121
+ horizrailenabled: true,
122
+ railalign: "right",
123
+ railvalign: "bottom",
124
+ enabletranslate3d: true,
125
+ enablemousewheel: true,
126
+ enablekeyboard: true,
127
+ smoothscroll: true,
128
+ sensitiverail: true,
129
+ enablemouselockapi: true,
130
+ // cursormaxheight:false,
131
+ cursorfixedheight: false,
132
+ directionlockdeadzone: 6,
133
+ hidecursordelay: 400,
134
+ nativeparentscrolling: true,
135
+ enablescrollonselection: true,
136
+ overflowx: true,
137
+ overflowy: true,
138
+ cursordragspeed: 0.3,
139
+ rtlmode: "auto",
140
+ cursordragontouch: false,
141
+ oneaxismousemode: "auto",
142
+ scriptpath: getScriptPath(),
143
+ preventmultitouchscrolling: true,
144
+ disablemutationobserver: false,
145
+ enableobserver: true,
146
+ scrollbarid: false
147
+ };
148
+
149
+ var browserdetected = false;
150
+
151
+ var getBrowserDetection = function () {
152
+
153
+ if (browserdetected) {
154
+ return browserdetected;
155
+ }
156
+
157
+ var _el = _doc.createElement('DIV'),
158
+ _style = _el.style,
159
+ _agent = navigator.userAgent,
160
+ _platform = navigator.platform,
161
+ d = {};
162
+
163
+ d.haspointerlock = "pointerLockElement" in _doc || "webkitPointerLockElement" in _doc || "mozPointerLockElement" in _doc;
164
+
165
+ d.isopera = ("opera" in _win); // 12-
166
+ d.isopera12 = (d.isopera && ("getUserMedia" in navigator));
167
+ d.isoperamini = (Object.prototype.toString.call(_win.operamini) === "[object OperaMini]");
168
+
169
+ d.isie = (("all" in _doc) && ("attachEvent" in _el) && ! d.isopera); //IE10-
170
+ d.isieold = (d.isie && ! ("msInterpolationMode" in _style)); // IE6 and older
171
+ d.isie7 = d.isie && ! d.isieold && (! ("documentMode" in _doc) || (_doc.documentMode === 7));
172
+ d.isie8 = d.isie && ("documentMode" in _doc) && (_doc.documentMode === 8);
173
+ d.isie9 = d.isie && ("performance" in _win) && (_doc.documentMode === 9);
174
+ d.isie10 = d.isie && ("performance" in _win) && (_doc.documentMode === 10);
175
+ d.isie11 = ("msRequestFullscreen" in _el) && (_doc.documentMode >= 11); // IE11+
176
+
177
+ d.ismsedge = ("msCredentials" in _win); // MS Edge 14+
178
+
179
+ d.ismozilla = ("MozAppearance" in _style);
180
+
181
+ d.iswebkit = ! d.ismsedge && ("WebkitAppearance" in _style);
182
+
183
+ d.ischrome = d.iswebkit && ("chrome" in _win);
184
+ d.ischrome38 = (d.ischrome && ("touchAction" in _style)); // behavior changed in touch emulation
185
+ d.ischrome22 = (! d.ischrome38) && (d.ischrome && d.haspointerlock);
186
+ d.ischrome26 = (! d.ischrome38) && (d.ischrome && ("transition" in _style)); // issue with transform detection (maintain prefix)
187
+
188
+ d.cantouch = ("ontouchstart" in _doc.documentElement) || ("ontouchstart" in _win); // with detection for Chrome Touch Emulation
189
+ d.hasw3ctouch = (_win.PointerEvent || false) && ((navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)); //IE11 pointer events, following W3C Pointer Events spec
190
+ d.hasmstouch = (! d.hasw3ctouch) && (_win.MSPointerEvent || false); // IE10 pointer events
191
+
192
+ d.ismac = /^mac$/i.test(_platform);
193
+
194
+ d.isios = d.cantouch && /iphone|ipad|ipod/i.test(_platform);
195
+ d.isios4 = d.isios && ! ("seal" in Object);
196
+ d.isios7 = d.isios && ("webkitHidden" in _doc); //iOS 7+
197
+ d.isios8 = d.isios && ("hidden" in _doc); //iOS 8+
198
+ d.isios10 = d.isios && _win.Proxy; //iOS 10+
199
+
200
+ d.isandroid = (/android/i.test(_agent));
201
+
202
+ d.haseventlistener = ("addEventListener" in _el);
203
+
204
+ d.trstyle = false;
205
+ d.hastransform = false;
206
+ d.hastranslate3d = false;
207
+ d.transitionstyle = false;
208
+ d.hastransition = false;
209
+ d.transitionend = false;
210
+
211
+ d.trstyle = "transform";
212
+ d.hastransform = ("transform" in _style) || (function () {
213
+ var check = ['msTransform', 'webkitTransform', 'MozTransform', 'OTransform'];
214
+ for (var a = 0, c = check.length ; a < c ; a ++) {
215
+ if (_style[check[a]] !== undefined) {
216
+ d.trstyle = check[a];
217
+ break;
218
+ }
219
+ }
220
+ d.hastransform = (! ! d.trstyle);
221
+ })();
222
+
223
+ if (d.hastransform) {
224
+ _style[d.trstyle] = "translate3d(1px,2px,3px)";
225
+ d.hastranslate3d = /translate3d/.test(_style[d.trstyle]);
226
+ }
227
+
228
+ d.transitionstyle = "transition";
229
+ d.prefixstyle = '';
230
+ d.transitionend = "transitionend";
231
+
232
+ d.hastransition = ("transition" in _style) || (function () {
233
+
234
+ d.transitionend = false;
235
+ var check = ['webkitTransition', 'msTransition', 'MozTransition', 'OTransition', 'OTransition', 'KhtmlTransition'];
236
+ var prefix = ['-webkit-', '-ms-', '-moz-', '-o-', '-o', '-khtml-'];
237
+ var evs = ['webkitTransitionEnd', 'msTransitionEnd', 'transitionend', 'otransitionend', 'oTransitionEnd', 'KhtmlTransitionEnd'];
238
+ for (var a = 0, c = check.length ; a < c ; a ++) {
239
+ if (check[a] in _style) {
240
+ d.transitionstyle = check[a];
241
+ d.prefixstyle = prefix[a];
242
+ d.transitionend = evs[a];
243
+ break;
244
+ }
245
+ }
246
+ if (d.ischrome26) {
247
+ d.prefixstyle = prefix[1];
248
+ } // always use prefix
249
+
250
+ d.hastransition = (d.transitionstyle);
251
+
252
+ })();
253
+
254
+ function detectCursorGrab () {
255
+ var lst = ['grab', '-webkit-grab', '-moz-grab'];
256
+ if ((d.ischrome && ! d.ischrome38) || d.isie) {
257
+ lst = [];
258
+ } // force setting for IE returns false positive and chrome cursor bug
259
+ for (var a = 0, l = lst.length ; a < l ; a ++) {
260
+ var p = lst[a];
261
+ _style.cursor = p;
262
+ if (_style.cursor == p) {
263
+ return p;
264
+ }
265
+ }
266
+ return 'url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize'; // thanks to https://cdnjs.com/ for the openhand cursor!
267
+ }
268
+
269
+ d.cursorgrabvalue = detectCursorGrab();
270
+
271
+ d.hasmousecapture = ("setCapture" in _el);
272
+
273
+ d.hasMutationObserver = (ClsMutationObserver !== false);
274
+
275
+ _el = null; //memory released
276
+
277
+ browserdetected = d;
278
+
279
+ return d;
280
+ };
281
+
282
+ var NiceScrollClass = function (myopt, me) {
283
+
284
+ var self = this;
285
+
286
+ this.version = '3.7.6';
287
+ this.name = 'nicescroll';
288
+
289
+ this.me = me;
290
+
291
+ var $body = $("body");
292
+
293
+ var opt = this.opt = {
294
+ doc: $body,
295
+ win: false
296
+ };
297
+
298
+ $.extend(opt, _globaloptions); // clone opts
299
+
300
+ // Options for internal use
301
+ opt.snapbackspeed = 80;
302
+
303
+ if (myopt || false) {
304
+ for (var a in opt) {
305
+ if (myopt[a] !== undefined) {
306
+ opt[a] = myopt[a];
307
+ }
308
+ }
309
+ }
310
+
311
+ if (opt.disablemutationobserver) {
312
+ ClsMutationObserver = false;
313
+ }
314
+
315
+ this.doc = opt.doc;
316
+ this.iddoc = (this.doc && this.doc[0]) ? this.doc[0].id || '' : '';
317
+ this.ispage = /^BODY|HTML/.test((opt.win) ? opt.win[0].nodeName : this.doc[0].nodeName);
318
+ this.haswrapper = (opt.win !== false);
319
+ this.win = opt.win || (this.ispage ? $window : this.doc);
320
+ this.docscroll = (this.ispage && ! this.haswrapper) ? $window : this.win;
321
+ this.body = $body;
322
+ this.viewport = false;
323
+
324
+ this.isfixed = false;
325
+
326
+ this.iframe = false;
327
+ this.isiframe = ((this.doc[0].nodeName == 'IFRAME') && (this.win[0].nodeName == 'IFRAME'));
328
+
329
+ this.istextarea = (this.win[0].nodeName == 'TEXTAREA');
330
+
331
+ this.forcescreen = false; //force to use screen position on events
332
+
333
+ this.canshowonmouseevent = (opt.autohidemode != "scroll");
334
+
335
+ // Events jump table
336
+ this.onmousedown = false;
337
+ this.onmouseup = false;
338
+ this.onmousemove = false;
339
+ this.onmousewheel = false;
340
+ this.onkeypress = false;
341
+ this.ongesturezoom = false;
342
+ this.onclick = false;
343
+
344
+ // Nicescroll custom events
345
+ this.onscrollstart = false;
346
+ this.onscrollend = false;
347
+ this.onscrollcancel = false;
348
+
349
+ this.onzoomin = false;
350
+ this.onzoomout = false;
351
+
352
+ // Let's start!
353
+ this.view = false;
354
+ this.page = false;
355
+
356
+ this.scroll = {
357
+ x: 0,
358
+ y: 0
359
+ };
360
+ this.scrollratio = {
361
+ x: 0,
362
+ y: 0
363
+ };
364
+ this.cursorheight = 20;
365
+ this.scrollvaluemax = 0;
366
+
367
+ // http://dev.w3.org/csswg/css-writing-modes-3/#logical-to-physical
368
+ // http://dev.w3.org/csswg/css-writing-modes-3/#svg-writing-mode
369
+ if (opt.rtlmode == "auto") {
370
+ var target = this.win[0] == _win ? this.body : this.win;
371
+ var writingMode = target.css("writing-mode") || target.css("-webkit-writing-mode") || target.css("-ms-writing-mode") || target.css("-moz-writing-mode");
372
+
373
+ if (writingMode == "horizontal-tb" || writingMode == "lr-tb" || writingMode === "") {
374
+ this.isrtlmode = (target.css("direction") == "rtl");
375
+ this.isvertical = false;
376
+ }
377
+ else {
378
+ this.isrtlmode = (writingMode == "vertical-rl" || writingMode == "tb" || writingMode == "tb-rl" || writingMode == "rl-tb");
379
+ this.isvertical = (writingMode == "vertical-rl" || writingMode == "tb" || writingMode == "tb-rl");
380
+ }
381
+ }
382
+ else {
383
+ this.isrtlmode = (opt.rtlmode === true);
384
+ this.isvertical = false;
385
+ }
386
+ // this.checkrtlmode = false;
387
+
388
+ this.scrollrunning = false;
389
+
390
+ this.scrollmom = false;
391
+
392
+ this.observer = false; // observer div changes
393
+ this.observerremover = false; // observer on parent for remove detection
394
+ this.observerbody = false; // observer on body for position change
395
+
396
+ if (opt.scrollbarid !== false) {
397
+ this.id = opt.scrollbarid;
398
+ }
399
+ else {
400
+ do {
401
+ this.id = "ascrail" + (ascrailcounter ++);
402
+ }
403
+ while (_doc.getElementById(this.id));
404
+ }
405
+
406
+ this.rail = false;
407
+ this.cursor = false;
408
+ this.cursorfreezed = false;
409
+ this.selectiondrag = false;
410
+
411
+ this.zoom = false;
412
+ this.zoomactive = false;
413
+
414
+ this.hasfocus = false;
415
+ this.hasmousefocus = false;
416
+
417
+ //this.visibility = true;
418
+ this.railslocked = false; // locked by resize
419
+ this.locked = false; // prevent lost of locked status sets by user
420
+ this.hidden = false; // rails always hidden
421
+ this.cursoractive = true; // user can interact with cursors
422
+
423
+ this.wheelprevented = false; //prevent mousewheel event
424
+
425
+ this.overflowx = opt.overflowx;
426
+ this.overflowy = opt.overflowy;
427
+
428
+ this.nativescrollingarea = false;
429
+ this.checkarea = 0;
430
+
431
+ this.events = []; // event list for unbind
432
+
433
+ this.saved = {}; // style saved
434
+
435
+ this.delaylist = {};
436
+ this.synclist = {};
437
+
438
+ this.lastdeltax = 0;
439
+ this.lastdeltay = 0;
440
+
441
+ this.detected = getBrowserDetection();
442
+
443
+ var cap = $.extend({}, this.detected);
444
+
445
+ this.canhwscroll = (cap.hastransform && opt.hwacceleration);
446
+ this.ishwscroll = (this.canhwscroll && self.haswrapper);
447
+
448
+ if (! this.isrtlmode) {
449
+ this.hasreversehr = false;
450
+ }
451
+ else if (this.isvertical) { // RTL mode with reverse horizontal axis
452
+ this.hasreversehr = ! (cap.iswebkit || cap.isie || cap.isie11);
453
+ }
454
+ else {
455
+ this.hasreversehr = ! (cap.iswebkit || (cap.isie && ! cap.isie10 && ! cap.isie11));
456
+ }
457
+
458
+ this.istouchcapable = false; // desktop devices with touch screen support
459
+
460
+ //## Check WebKit-based desktop with touch support
461
+ //## + Firefox 18 nightly build (desktop) false positive (or desktop with touch support)
462
+
463
+ if (! cap.cantouch && (cap.hasw3ctouch || cap.hasmstouch)) { // desktop device with multiple input
464
+ this.istouchcapable = true;
465
+ }
466
+ else if (cap.cantouch && ! cap.isios && ! cap.isandroid && (cap.iswebkit || cap.ismozilla)) {
467
+ this.istouchcapable = true;
468
+ }
469
+
470
+ //## disable MouseLock API on user request
471
+ if (! opt.enablemouselockapi) {
472
+ cap.hasmousecapture = false;
473
+ cap.haspointerlock = false;
474
+ }
475
+
476
+ this.debounced = function (name, fn, tm) {
477
+ if (! self) {
478
+ return;
479
+ }
480
+ var dd = self.delaylist[name] || false;
481
+ if (! dd) {
482
+ self.delaylist[name] = {
483
+ h: setAnimationFrame(function () {
484
+ self.delaylist[name].fn.call(self);
485
+ self.delaylist[name] = false;
486
+ }, tm)
487
+ };
488
+ fn.call(self);
489
+ }
490
+ self.delaylist[name].fn = fn;
491
+ };
492
+
493
+
494
+ this.synched = function (name, fn) {
495
+ if (self.synclist[name]) {
496
+ self.synclist[name] = fn;
497
+ }
498
+ else {
499
+ self.synclist[name] = fn;
500
+ setAnimationFrame(function () {
501
+ if (! self) {
502
+ return;
503
+ }
504
+ self.synclist[name] && self.synclist[name].call(self);
505
+ self.synclist[name] = null;
506
+ });
507
+ }
508
+ };
509
+
510
+ this.unsynched = function (name) {
511
+ if (self.synclist[name]) {
512
+ self.synclist[name] = false;
513
+ }
514
+ };
515
+
516
+ this.css = function (el, pars) { // save & set
517
+ for (var n in pars) {
518
+ self.saved.css.push([el, n, el.css(n)]);
519
+ el.css(n, pars[n]);
520
+ }
521
+ };
522
+
523
+ this.scrollTop = function (val) {
524
+ return (val === undefined) ? self.getScrollTop() : self.setScrollTop(val);
525
+ };
526
+
527
+ this.scrollLeft = function (val) {
528
+ return (val === undefined) ? self.getScrollLeft() : self.setScrollLeft(val);
529
+ };
530
+
531
+ // derived by by Dan Pupius www.pupius.net
532
+ var BezierClass = function (st, ed, spd, p1, p2, p3, p4) {
533
+
534
+ this.st = st;
535
+ this.ed = ed;
536
+ this.spd = spd;
537
+
538
+ this.p1 = p1 || 0;
539
+ this.p2 = p2 || 1;
540
+ this.p3 = p3 || 0;
541
+ this.p4 = p4 || 1;
542
+
543
+ this.ts = now();
544
+ this.df = ed - st;
545
+ };
546
+ BezierClass.prototype = {
547
+ B2: function (t) {
548
+ return 3 * (1 - t) * (1 - t) * t;
549
+ },
550
+ B3: function (t) {
551
+ return 3 * (1 - t) * t * t;
552
+ },
553
+ B4: function (t) {
554
+ return t * t * t;
555
+ },
556
+ getPos: function () {
557
+ return (now() - this.ts) / this.spd;
558
+ },
559
+ getNow: function () {
560
+ var pc = (now() - this.ts) / this.spd;
561
+ var bz = this.B2(pc) + this.B3(pc) + this.B4(pc);
562
+ return (pc >= 1) ? this.ed : this.st + (this.df * bz) | 0;
563
+ },
564
+ update: function (ed, spd) {
565
+ this.st = this.getNow();
566
+ this.ed = ed;
567
+ this.spd = spd;
568
+ this.ts = now();
569
+ this.df = this.ed - this.st;
570
+ return this;
571
+ }
572
+ };
573
+
574
+ //derived from http://stackoverflow.com/questions/11236090/
575
+ function getMatrixValues () {
576
+ var tr = self.doc.css(cap.trstyle);
577
+ if (tr && (tr.substr(0, 6) == "matrix")) {
578
+ return tr.replace(/^.*\((.*)\)$/g, "$1").replace(/px/g, '').split(/, +/);
579
+ }
580
+ return false;
581
+ }
582
+
583
+ if (this.ishwscroll) { // hw accelerated scroll
584
+
585
+ this.doc.translate = {
586
+ x: 0,
587
+ y: 0,
588
+ tx: "0px",
589
+ ty: "0px"
590
+ };
591
+
592
+ //this one can help to enable hw accel on ios6 http://indiegamr.com/ios6-html-hardware-acceleration-changes-and-how-to-fix-them/
593
+ if (cap.hastranslate3d && cap.isios) {
594
+ this.doc.css("-webkit-backface-visibility", "hidden");
595
+ } // prevent flickering http://stackoverflow.com/questions/3461441/
596
+
597
+ this.getScrollTop = function (last) {
598
+ if (! last) {
599
+ var mtx = getMatrixValues();
600
+ if (mtx) {
601
+ return (mtx.length == 16) ? - mtx[13] : - mtx[5];
602
+ } //matrix3d 16 on IE10
603
+ if (self.timerscroll && self.timerscroll.bz) {
604
+ return self.timerscroll.bz.getNow();
605
+ }
606
+ }
607
+ return self.doc.translate.y;
608
+ };
609
+
610
+ this.getScrollLeft = function (last) {
611
+ if (! last) {
612
+ var mtx = getMatrixValues();
613
+ if (mtx) {
614
+ return (mtx.length == 16) ? - mtx[12] : - mtx[4];
615
+ } //matrix3d 16 on IE10
616
+ if (self.timerscroll && self.timerscroll.bh) {
617
+ return self.timerscroll.bh.getNow();
618
+ }
619
+ }
620
+ return self.doc.translate.x;
621
+ };
622
+
623
+ this.notifyScrollEvent = function (el) {
624
+ var e = _doc.createEvent("UIEvents");
625
+ e.initUIEvent("scroll", false, false, _win, 1);
626
+ e.niceevent = true;
627
+ el.dispatchEvent(e);
628
+ };
629
+
630
+ var cxscrollleft = (this.isrtlmode) ? 1 : - 1;
631
+
632
+ if (cap.hastranslate3d && opt.enabletranslate3d) {
633
+ this.setScrollTop = function (val, silent) {
634
+ self.doc.translate.y = val;
635
+ self.doc.translate.ty = (val * - 1) + "px";
636
+ self.doc.css(cap.trstyle, "translate3d(" + self.doc.translate.tx + "," + self.doc.translate.ty + ",0)");
637
+ if (! silent) {
638
+ self.notifyScrollEvent(self.win[0]);
639
+ }
640
+ };
641
+ this.setScrollLeft = function (val, silent) {
642
+ self.doc.translate.x = val;
643
+ self.doc.translate.tx = (val * cxscrollleft) + "px";
644
+ self.doc.css(cap.trstyle, "translate3d(" + self.doc.translate.tx + "," + self.doc.translate.ty + ",0)");
645
+ if (! silent) {
646
+ self.notifyScrollEvent(self.win[0]);
647
+ }
648
+ };
649
+ }
650
+ else {
651
+ this.setScrollTop = function (val, silent) {
652
+ self.doc.translate.y = val;
653
+ self.doc.translate.ty = (val * - 1) + "px";
654
+ self.doc.css(cap.trstyle, "translate(" + self.doc.translate.tx + "," + self.doc.translate.ty + ")");
655
+ if (! silent) {
656
+ self.notifyScrollEvent(self.win[0]);
657
+ }
658
+ };
659
+ this.setScrollLeft = function (val, silent) {
660
+ self.doc.translate.x = val;
661
+ self.doc.translate.tx = (val * cxscrollleft) + "px";
662
+ self.doc.css(cap.trstyle, "translate(" + self.doc.translate.tx + "," + self.doc.translate.ty + ")");
663
+ if (! silent) {
664
+ self.notifyScrollEvent(self.win[0]);
665
+ }
666
+ };
667
+ }
668
+ }
669
+ else { // native scroll
670
+
671
+ this.getScrollTop = function () {
672
+ return self.docscroll.scrollTop();
673
+ };
674
+ this.setScrollTop = function (val) {
675
+ self.docscroll.scrollTop(val);
676
+ };
677
+
678
+ this.getScrollLeft = function () {
679
+ var val;
680
+ if (! self.hasreversehr) {
681
+ val = self.docscroll.scrollLeft();
682
+ }
683
+ else if (self.detected.ismozilla) {
684
+ val = self.page.maxw - Math.abs(self.docscroll.scrollLeft());
685
+ }
686
+ else {
687
+ val = self.page.maxw - self.docscroll.scrollLeft();
688
+ }
689
+ return val;
690
+ };
691
+ this.setScrollLeft = function (val) {
692
+ return setTimeout(function () {
693
+ if (! self) {
694
+ return;
695
+ }
696
+ if (self.hasreversehr) {
697
+ if (self.detected.ismozilla) {
698
+ val = - (self.page.maxw - val);
699
+ }
700
+ else {
701
+ val = self.page.maxw - val;
702
+ }
703
+ }
704
+ return self.docscroll.scrollLeft(val);
705
+ }, 1);
706
+ };
707
+ }
708
+
709
+ this.getTarget = function (e) {
710
+ if (! e) {
711
+ return false;
712
+ }
713
+ if (e.target) {
714
+ return e.target;
715
+ }
716
+ if (e.srcElement) {
717
+ return e.srcElement;
718
+ }
719
+ return false;
720
+ };
721
+
722
+ this.hasParent = function (e, id) {
723
+ if (! e) {
724
+ return false;
725
+ }
726
+ var el = e.target || e.srcElement || e || false;
727
+ while (el && el.id != id) {
728
+ el = el.parentNode || false;
729
+ }
730
+ return (el !== false);
731
+ };
732
+
733
+ function getZIndex () {
734
+ var dom = self.win;
735
+ if ("zIndex" in dom) {
736
+ return dom.zIndex();
737
+ } // use jQuery UI method when available
738
+ while (dom.length > 0) {
739
+ if (dom[0].nodeType == 9) {
740
+ return false;
741
+ }
742
+ var zi = dom.css('zIndex');
743
+ if (! isNaN(zi) && zi !== 0) {
744
+ return parseInt(zi);
745
+ }
746
+ dom = dom.parent();
747
+ }
748
+ return false;
749
+ }
750
+
751
+ //inspired by http://forum.jquery.com/topic/width-includes-border-width-when-set-to-thin-medium-thick-in-ie
752
+ var _convertBorderWidth = {
753
+ "thin": 1,
754
+ "medium": 3,
755
+ "thick": 5
756
+ };
757
+
758
+ function getWidthToPixel (dom, prop, chkheight) {
759
+ var wd = dom.css(prop);
760
+ var px = parseFloat(wd);
761
+ if (isNaN(px)) {
762
+ px = _convertBorderWidth[wd] || 0;
763
+ var brd = (px == 3) ? ((chkheight) ? (self.win.outerHeight() - self.win.innerHeight()) : (self.win.outerWidth() - self.win.innerWidth())) : 1; //DON'T TRUST CSS
764
+ if (self.isie8 && px) {
765
+ px += 1;
766
+ }
767
+ return (brd) ? px : 0;
768
+ }
769
+ return px;
770
+ }
771
+
772
+ this.getDocumentScrollOffset = function () {
773
+ return {
774
+ top: _win.pageYOffset || _doc.documentElement.scrollTop,
775
+ left: _win.pageXOffset || _doc.documentElement.scrollLeft
776
+ };
777
+ };
778
+
779
+ this.getOffset = function () {
780
+ if (self.isfixed) {
781
+ var ofs = self.win.offset(); // fix Chrome auto issue (when right/bottom props only)
782
+ var scrl = self.getDocumentScrollOffset();
783
+ ofs.top -= scrl.top;
784
+ ofs.left -= scrl.left;
785
+ return ofs;
786
+ }
787
+ var ww = self.win.offset();
788
+ if (! self.viewport) {
789
+ return ww;
790
+ }
791
+ var vp = self.viewport.offset();
792
+ return {
793
+ top: ww.top - vp.top,
794
+ left: ww.left - vp.left
795
+ };
796
+ };
797
+
798
+ this.updateScrollBar = function (len) {
799
+ var pos, off;
800
+ if (self.ishwscroll) {
801
+ self.rail.css({
802
+ height: self.win.innerHeight() - (opt.railpadding.top + opt.railpadding.bottom)
803
+ });
804
+ if (self.railh) {
805
+ self.railh.css({
806
+ width: self.win.innerWidth() - (opt.railpadding.left + opt.railpadding.right)
807
+ });
808
+ }
809
+ }
810
+ else {
811
+ var wpos = self.getOffset();
812
+ pos = {
813
+ top: wpos.top,
814
+ left: wpos.left - (opt.railpadding.left + opt.railpadding.right)
815
+ };
816
+ pos.top += getWidthToPixel(self.win, 'border-top-width', true);
817
+ pos.left += (self.rail.align) ? self.win.outerWidth() - getWidthToPixel(self.win, 'border-right-width') - self.rail.width : getWidthToPixel(self.win, 'border-left-width');
818
+
819
+ off = opt.railoffset;
820
+ if (off) {
821
+ if (off.top) {
822
+ pos.top += off.top;
823
+ }
824
+ if (off.left) {
825
+ pos.left += off.left;
826
+ }
827
+ }
828
+
829
+ if (! self.railslocked) {
830
+ self.rail.css({
831
+ top: pos.top,
832
+ left: pos.left,
833
+ height: ((len) ? len.h : self.win.innerHeight()) - (opt.railpadding.top + opt.railpadding.bottom)
834
+ });
835
+ }
836
+
837
+ if (self.zoom) {
838
+ self.zoom.css({
839
+ top: pos.top + 1,
840
+ left: (self.rail.align == 1) ? pos.left - 20 : pos.left + self.rail.width + 4
841
+ });
842
+ }
843
+
844
+ if (self.railh && ! self.railslocked) {
845
+ pos = {
846
+ top: wpos.top,
847
+ left: wpos.left
848
+ };
849
+ off = opt.railhoffset;
850
+ if (off) {
851
+ if (off.top) {
852
+ pos.top += off.top;
853
+ }
854
+ if (off.left) {
855
+ pos.left += off.left;
856
+ }
857
+ }
858
+ var y = (self.railh.align) ? pos.top + getWidthToPixel(self.win, 'border-top-width', true) + self.win.innerHeight() - self.railh.height : pos.top + getWidthToPixel(self.win, 'border-top-width', true);
859
+ var x = pos.left + getWidthToPixel(self.win, 'border-left-width');
860
+ self.railh.css({
861
+ top: y - (opt.railpadding.top + opt.railpadding.bottom),
862
+ left: x,
863
+ width: self.railh.width
864
+ });
865
+ }
866
+
867
+ }
868
+ };
869
+
870
+ this.doRailClick = function (e, dbl, hr) {
871
+ var fn, pg, cur, pos;
872
+
873
+ if (self.railslocked) {
874
+ return;
875
+ }
876
+
877
+ self.cancelEvent(e);
878
+
879
+ if (! ("pageY" in e)) {
880
+ e.pageX = e.clientX + _doc.documentElement.scrollLeft;
881
+ e.pageY = e.clientY + _doc.documentElement.scrollTop;
882
+ }
883
+
884
+ if (dbl) {
885
+ fn = (hr) ? self.doScrollLeft : self.doScrollTop;
886
+ cur = (hr) ? ((e.pageX - self.railh.offset().left - (self.cursorwidth / 2)) * self.scrollratio.x) : ((e.pageY - self.rail.offset().top - (self.cursorheight / 2)) * self.scrollratio.y);
887
+ self.unsynched("relativexy");
888
+ fn(cur | 0);
889
+ }
890
+ else {
891
+ fn = (hr) ? self.doScrollLeftBy : self.doScrollBy;
892
+ cur = (hr) ? self.scroll.x : self.scroll.y;
893
+ pos = (hr) ? e.pageX - self.railh.offset().left : e.pageY - self.rail.offset().top;
894
+ pg = (hr) ? self.view.w : self.view.h;
895
+ fn((cur >= pos) ? pg : - pg);
896
+ }
897
+
898
+ };
899
+
900
+ self.newscrolly = self.newscrollx = 0;
901
+
902
+ self.hasanimationframe = ("requestAnimationFrame" in _win);
903
+ self.hascancelanimationframe = ("cancelAnimationFrame" in _win);
904
+
905
+ self.hasborderbox = false;
906
+
907
+ this.init = function () {
908
+
909
+ self.saved.css = [];
910
+
911
+ if (cap.isoperamini) {
912
+ return true;
913
+ } // SORRY, DO NOT WORK!
914
+ if (cap.isandroid && ! ("hidden" in _doc)) {
915
+ return true;
916
+ } // Android 3- SORRY, DO NOT WORK!
917
+
918
+ opt.emulatetouch = opt.emulatetouch || opt.touchbehavior; // mantain compatibility with "touchbehavior"
919
+
920
+ self.hasborderbox = _win.getComputedStyle && (_win.getComputedStyle(_doc.body)['box-sizing'] === "border-box");
921
+
922
+ var _scrollyhidden = { 'overflow-y': 'hidden' };
923
+ if (cap.isie11 || cap.isie10) {
924
+ _scrollyhidden['-ms-overflow-style'] = 'none';
925
+ } // IE 10 & 11 is always a world apart!
926
+
927
+ if (self.ishwscroll) {
928
+ this.doc.css(cap.transitionstyle, cap.prefixstyle + 'transform 0ms ease-out');
929
+ if (cap.transitionend) {
930
+ self.bind(self.doc, cap.transitionend, self.onScrollTransitionEnd, false);
931
+ } //I have got to do something usefull!!
932
+ }
933
+
934
+ self.zindex = "auto";
935
+ if (! self.ispage && opt.zindex == "auto") {
936
+ self.zindex = getZIndex() || "auto";
937
+ }
938
+ else {
939
+ self.zindex = opt.zindex;
940
+ }
941
+
942
+ if (! self.ispage && self.zindex != "auto" && self.zindex > globalmaxzindex) {
943
+ globalmaxzindex = self.zindex;
944
+ }
945
+
946
+ if (self.isie && self.zindex === 0 && opt.zindex == "auto") { // fix IE auto == 0
947
+ self.zindex = "auto";
948
+ }
949
+
950
+ if (! self.ispage || ! cap.isieold) {
951
+
952
+ var cont = self.docscroll;
953
+ if (self.ispage) {
954
+ cont = (self.haswrapper) ? self.win : self.doc;
955
+ }
956
+
957
+ self.css(cont, _scrollyhidden);
958
+
959
+ if (self.ispage && (cap.isie11 || cap.isie)) { // IE 7-11
960
+ self.css($("html"), _scrollyhidden);
961
+ }
962
+
963
+ if (cap.isios && ! self.ispage && ! self.haswrapper) {
964
+ self.css($body, {
965
+ "-webkit-overflow-scrolling": "touch"
966
+ });
967
+ } //force hw acceleration
968
+
969
+ var cursor = $(_doc.createElement('div'));
970
+ cursor.css({
971
+ position: "relative",
972
+ top: 0,
973
+ "float": "right",
974
+ width: opt.cursorwidth,
975
+ height: 0,
976
+ 'background-color': opt.cursorcolor,
977
+ border: opt.cursorborder,
978
+ 'background-clip': 'padding-box',
979
+ '-webkit-border-radius': opt.cursorborderradius,
980
+ '-moz-border-radius': opt.cursorborderradius,
981
+ 'border-radius': opt.cursorborderradius
982
+ });
983
+
984
+ cursor.addClass('nicescroll-cursors');
985
+
986
+ self.cursor = cursor;
987
+
988
+ var rail = $(_doc.createElement('div'));
989
+ rail.attr('id', self.id);
990
+ rail.addClass('nicescroll-rails nicescroll-rails-vr');
991
+
992
+ var v, a, kp = ["left", "right", "top", "bottom"]; //**
993
+ for (var n in kp) {
994
+ a = kp[n];
995
+ v = opt.railpadding[a] || 0;
996
+ v && rail.css("padding-" + a, v + "px");
997
+ }
998
+
999
+ rail.append(cursor);
1000
+
1001
+ rail.width = Math.max(parseFloat(opt.cursorwidth), cursor.outerWidth());
1002
+ rail.css({
1003
+ width: rail.width + "px",
1004
+ zIndex: self.zindex,
1005
+ background: opt.background,
1006
+ cursor: "default"
1007
+ });
1008
+
1009
+ rail.visibility = true;
1010
+ rail.scrollable = true;
1011
+
1012
+ rail.align = (opt.railalign == "left") ? 0 : 1;
1013
+
1014
+ self.rail = rail;
1015
+
1016
+ self.rail.drag = false;
1017
+
1018
+ var zoom = false;
1019
+ if (opt.boxzoom && ! self.ispage && ! cap.isieold) {
1020
+ zoom = _doc.createElement('div');
1021
+
1022
+ self.bind(zoom, "click", self.doZoom);
1023
+ self.bind(zoom, "mouseenter", function () {
1024
+ self.zoom.css('opacity', opt.cursoropacitymax);
1025
+ });
1026
+ self.bind(zoom, "mouseleave", function () {
1027
+ self.zoom.css('opacity', opt.cursoropacitymin);
1028
+ });
1029
+
1030
+ self.zoom = $(zoom);
1031
+ self.zoom.css({
1032
+ cursor: "pointer",
1033
+ zIndex: self.zindex,
1034
+ backgroundImage: 'url(' + opt.scriptpath + 'zoomico.png)',
1035
+ height: 18,
1036
+ width: 18,
1037
+ backgroundPosition: '0 0'
1038
+ });
1039
+ if (opt.dblclickzoom) {
1040
+ self.bind(self.win, "dblclick", self.doZoom);
1041
+ }
1042
+ if (cap.cantouch && opt.gesturezoom) {
1043
+ self.ongesturezoom = function (e) {
1044
+ if (e.scale > 1.5) {
1045
+ self.doZoomIn(e);
1046
+ }
1047
+ if (e.scale < 0.8) {
1048
+ self.doZoomOut(e);
1049
+ }
1050
+ return self.cancelEvent(e);
1051
+ };
1052
+ self.bind(self.win, "gestureend", self.ongesturezoom);
1053
+ }
1054
+ }
1055
+
1056
+ // init HORIZ
1057
+
1058
+ self.railh = false;
1059
+ var railh;
1060
+
1061
+ if (opt.horizrailenabled) {
1062
+
1063
+ self.css(cont, {
1064
+ overflowX: 'hidden'
1065
+ });
1066
+
1067
+ cursor = $(_doc.createElement('div'));
1068
+ cursor.css({
1069
+ position: "absolute",
1070
+ top: 0,
1071
+ height: opt.cursorwidth,
1072
+ width: 0,
1073
+ backgroundColor: opt.cursorcolor,
1074
+ border: opt.cursorborder,
1075
+ backgroundClip: 'padding-box',
1076
+ '-webkit-border-radius': opt.cursorborderradius,
1077
+ '-moz-border-radius': opt.cursorborderradius,
1078
+ 'border-radius': opt.cursorborderradius
1079
+ });
1080
+
1081
+ if (cap.isieold) {
1082
+ cursor.css('overflow', 'hidden');
1083
+ } //IE6 horiz scrollbar issue
1084
+
1085
+ cursor.addClass('nicescroll-cursors');
1086
+
1087
+ self.cursorh = cursor;
1088
+
1089
+ railh = $(_doc.createElement('div'));
1090
+ railh.attr('id', self.id + '-hr');
1091
+ railh.addClass('nicescroll-rails nicescroll-rails-hr');
1092
+ railh.height = Math.max(parseFloat(opt.cursorwidth), cursor.outerHeight());
1093
+ railh.css({
1094
+ height: railh.height + "px",
1095
+ 'zIndex': self.zindex,
1096
+ "background": opt.background
1097
+ });
1098
+
1099
+ railh.append(cursor);
1100
+
1101
+ railh.visibility = true;
1102
+ railh.scrollable = true;
1103
+
1104
+ railh.align = (opt.railvalign == "top") ? 0 : 1;
1105
+
1106
+ self.railh = railh;
1107
+
1108
+ self.railh.drag = false;
1109
+
1110
+ }
1111
+
1112
+ if (self.ispage) {
1113
+
1114
+ rail.css({
1115
+ position: "fixed",
1116
+ top: 0,
1117
+ height: "100%"
1118
+ });
1119
+
1120
+ rail.css((rail.align) ? { right: 0 } : { left: 0 });
1121
+
1122
+ self.body.append(rail);
1123
+ if (self.railh) {
1124
+ railh.css({
1125
+ position: "fixed",
1126
+ left: 0,
1127
+ width: "100%"
1128
+ });
1129
+
1130
+ railh.css((railh.align) ? { bottom: 0 } : { top: 0 });
1131
+
1132
+ self.body.append(railh);
1133
+ }
1134
+ }
1135
+ else {
1136
+ if (self.ishwscroll) {
1137
+ if (self.win.css('position') == 'static') {
1138
+ self.css(self.win, { 'position': 'relative' });
1139
+ }
1140
+ var bd = (self.win[0].nodeName == 'HTML') ? self.body : self.win;
1141
+ $(bd).scrollTop(0).scrollLeft(0); // fix rail position if content already scrolled
1142
+ if (self.zoom) {
1143
+ self.zoom.css({
1144
+ position: "absolute",
1145
+ top: 1,
1146
+ right: 0,
1147
+ "margin-right": rail.width + 4
1148
+ });
1149
+ bd.append(self.zoom);
1150
+ }
1151
+ rail.css({
1152
+ position: "absolute",
1153
+ top: 0
1154
+ });
1155
+ rail.css((rail.align) ? { right: 0 } : { left: 0 });
1156
+ bd.append(rail);
1157
+ if (railh) {
1158
+ railh.css({
1159
+ position: "absolute",
1160
+ left: 0,
1161
+ bottom: 0
1162
+ });
1163
+ railh.css((railh.align) ? { bottom: 0 } : { top: 0 });
1164
+ bd.append(railh);
1165
+ }
1166
+ }
1167
+ else {
1168
+ self.isfixed = (self.win.css("position") == "fixed");
1169
+ var rlpos = (self.isfixed) ? "fixed" : "absolute";
1170
+
1171
+ if (! self.isfixed) {
1172
+ self.viewport = self.getViewport(self.win[0]);
1173
+ }
1174
+ if (self.viewport) {
1175
+ self.body = self.viewport;
1176
+ if (! (/fixed|absolute/.test(self.viewport.css("position")))) {
1177
+ self.css(self.viewport, {
1178
+ "position": "relative"
1179
+ });
1180
+ }
1181
+ }
1182
+
1183
+ rail.css({
1184
+ position: rlpos
1185
+ });
1186
+ if (self.zoom) {
1187
+ self.zoom.css({
1188
+ position: rlpos
1189
+ });
1190
+ }
1191
+ self.updateScrollBar();
1192
+ self.body.append(rail);
1193
+ if (self.zoom) {
1194
+ self.body.append(self.zoom);
1195
+ }
1196
+ if (self.railh) {
1197
+ railh.css({
1198
+ position: rlpos
1199
+ });
1200
+ self.body.append(railh);
1201
+ }
1202
+ }
1203
+
1204
+ if (cap.isios) {
1205
+ self.css(self.win, {
1206
+ '-webkit-tap-highlight-color': 'rgba(0,0,0,0)',
1207
+ '-webkit-touch-callout': 'none'
1208
+ });
1209
+ } // prevent grey layer on click
1210
+
1211
+ if (opt.disableoutline) {
1212
+ if (cap.isie) {
1213
+ self.win.attr("hideFocus", "true");
1214
+ } // IE, prevent dotted rectangle on focused div
1215
+ if (cap.iswebkit) {
1216
+ self.win.css('outline', 'none');
1217
+ } // Webkit outline
1218
+ }
1219
+
1220
+ }
1221
+
1222
+ if (opt.autohidemode === false) {
1223
+ self.autohidedom = false;
1224
+ self.rail.css({
1225
+ opacity: opt.cursoropacitymax
1226
+ });
1227
+ if (self.railh) {
1228
+ self.railh.css({
1229
+ opacity: opt.cursoropacitymax
1230
+ });
1231
+ }
1232
+ }
1233
+ else if ((opt.autohidemode === true) || (opt.autohidemode === "leave")) {
1234
+ self.autohidedom = $().add(self.rail);
1235
+ if (cap.isie8) {
1236
+ self.autohidedom = self.autohidedom.add(self.cursor);
1237
+ }
1238
+ if (self.railh) {
1239
+ self.autohidedom = self.autohidedom.add(self.railh);
1240
+ }
1241
+ if (self.railh && cap.isie8) {
1242
+ self.autohidedom = self.autohidedom.add(self.cursorh);
1243
+ }
1244
+ }
1245
+ else if (opt.autohidemode == "scroll") {
1246
+ self.autohidedom = $().add(self.rail);
1247
+ if (self.railh) {
1248
+ self.autohidedom = self.autohidedom.add(self.railh);
1249
+ }
1250
+ }
1251
+ else if (opt.autohidemode == "cursor") {
1252
+ self.autohidedom = $().add(self.cursor);
1253
+ if (self.railh) {
1254
+ self.autohidedom = self.autohidedom.add(self.cursorh);
1255
+ }
1256
+ }
1257
+ else if (opt.autohidemode == "hidden") {
1258
+ self.autohidedom = false;
1259
+ self.hide();
1260
+ self.railslocked = false;
1261
+ }
1262
+
1263
+ if (cap.cantouch || self.istouchcapable || opt.emulatetouch || cap.hasmstouch) {
1264
+
1265
+ self.scrollmom = new ScrollMomentumClass2D(self);
1266
+
1267
+ var delayedclick = null;
1268
+
1269
+ self.ontouchstart = function (e) {
1270
+
1271
+ if (self.locked) {
1272
+ return false;
1273
+ }
1274
+
1275
+ //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1276
+ if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) {
1277
+ return false;
1278
+ } // need test on surface!!
1279
+
1280
+ self.hasmoving = false;
1281
+
1282
+ if (self.scrollmom.timer) {
1283
+ self.triggerScrollEnd();
1284
+ self.scrollmom.stop();
1285
+ }
1286
+
1287
+ if (! self.railslocked) {
1288
+ var tg = self.getTarget(e);
1289
+
1290
+ if (tg) {
1291
+ var skp = (/INPUT/i.test(tg.nodeName)) && (/range/i.test(tg.type));
1292
+ if (skp) {
1293
+ return self.stopPropagation(e);
1294
+ }
1295
+ }
1296
+
1297
+ var ismouse = (e.type === "mousedown");
1298
+
1299
+ if (! ("clientX" in e) && ("changedTouches" in e)) {
1300
+ e.clientX = e.changedTouches[0].clientX;
1301
+ e.clientY = e.changedTouches[0].clientY;
1302
+ }
1303
+
1304
+ if (self.forcescreen) {
1305
+ var le = e;
1306
+ e = {
1307
+ "original": (e.original) ? e.original : e
1308
+ };
1309
+ e.clientX = le.screenX;
1310
+ e.clientY = le.screenY;
1311
+ }
1312
+
1313
+ self.rail.drag = {
1314
+ x: e.clientX,
1315
+ y: e.clientY,
1316
+ sx: self.scroll.x,
1317
+ sy: self.scroll.y,
1318
+ st: self.getScrollTop(),
1319
+ sl: self.getScrollLeft(),
1320
+ pt: 2,
1321
+ dl: false,
1322
+ tg: tg
1323
+ };
1324
+
1325
+ if (self.ispage || ! opt.directionlockdeadzone) {
1326
+
1327
+ self.rail.drag.dl = "f";
1328
+
1329
+ }
1330
+ else {
1331
+
1332
+ var view = {
1333
+ w: $window.width(),
1334
+ h: $window.height()
1335
+ };
1336
+
1337
+ var page = self.getContentSize();
1338
+
1339
+ var maxh = page.h - view.h;
1340
+ var maxw = page.w - view.w;
1341
+
1342
+ if (self.rail.scrollable && ! self.railh.scrollable) {
1343
+ self.rail.drag.ck = (maxh > 0) ? "v" : false;
1344
+ }
1345
+ else if (! self.rail.scrollable && self.railh.scrollable) {
1346
+ self.rail.drag.ck = (maxw > 0) ? "h" : false;
1347
+ }
1348
+ else {
1349
+ self.rail.drag.ck = false;
1350
+ }
1351
+
1352
+ }
1353
+
1354
+ if (opt.emulatetouch && self.isiframe && cap.isie) {
1355
+ var wp = self.win.position();
1356
+ self.rail.drag.x += wp.left;
1357
+ self.rail.drag.y += wp.top;
1358
+ }
1359
+
1360
+ self.hasmoving = false;
1361
+ self.lastmouseup = false;
1362
+ self.scrollmom.reset(e.clientX, e.clientY);
1363
+
1364
+ if (tg && ismouse) {
1365
+
1366
+ var ip = /INPUT|SELECT|BUTTON|TEXTAREA/i.test(tg.nodeName);
1367
+ if (! ip) {
1368
+ if (cap.hasmousecapture) {
1369
+ tg.setCapture();
1370
+ }
1371
+ if (opt.emulatetouch) {
1372
+ if (tg.onclick && ! (tg._onclick || false)) { // intercept DOM0 onclick event
1373
+ tg._onclick = tg.onclick;
1374
+ tg.onclick = function (e) {
1375
+ if (self.hasmoving) {
1376
+ return false;
1377
+ }
1378
+ tg._onclick.call(this, e);
1379
+ };
1380
+ }
1381
+ return self.cancelEvent(e);
1382
+ }
1383
+ return self.stopPropagation(e);
1384
+ }
1385
+
1386
+ if (/SUBMIT|CANCEL|BUTTON/i.test($(tg).attr('type'))) {
1387
+ self.preventclick = {
1388
+ "tg": tg,
1389
+ "click": false
1390
+ };
1391
+ }
1392
+
1393
+ }
1394
+ }
1395
+
1396
+ };
1397
+
1398
+ self.ontouchend = function (e) {
1399
+
1400
+ if (! self.rail.drag) {
1401
+ return true;
1402
+ }
1403
+
1404
+ if (self.rail.drag.pt == 2) {
1405
+ //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1406
+ if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) {
1407
+ return false;
1408
+ }
1409
+
1410
+ self.rail.drag = false;
1411
+
1412
+ var ismouse = (e.type === "mouseup");
1413
+
1414
+ if (self.hasmoving) {
1415
+ self.scrollmom.doMomentum();
1416
+ self.lastmouseup = true;
1417
+ self.hideCursor();
1418
+ if (cap.hasmousecapture) {
1419
+ _doc.releaseCapture();
1420
+ }
1421
+ if (ismouse) {
1422
+ return self.cancelEvent(e);
1423
+ }
1424
+ }
1425
+
1426
+ }
1427
+ else if (self.rail.drag.pt == 1) {
1428
+ return self.onmouseup(e);
1429
+ }
1430
+
1431
+ };
1432
+
1433
+ var moveneedoffset = (opt.emulatetouch && self.isiframe && ! cap.hasmousecapture);
1434
+
1435
+ var locktollerance = opt.directionlockdeadzone * 0.3 | 0;
1436
+
1437
+ self.ontouchmove = function (e, byiframe) {
1438
+
1439
+ if (! self.rail.drag) {
1440
+ return true;
1441
+ }
1442
+
1443
+ if (e.targetTouches && opt.preventmultitouchscrolling) {
1444
+ if (e.targetTouches.length > 1) {
1445
+ return true;
1446
+ } // multitouch
1447
+ }
1448
+
1449
+ //if (e.pointerType && e.pointerType != 2 && e.pointerType != "touch") return false;
1450
+ if (e.pointerType && (e.pointerType === 'mouse' || e.pointerType === e.MSPOINTER_TYPE_MOUSE)) {
1451
+ return true;
1452
+ }
1453
+
1454
+ if (self.rail.drag.pt == 2) {
1455
+
1456
+ if (("changedTouches" in e)) {
1457
+ e.clientX = e.changedTouches[0].clientX;
1458
+ e.clientY = e.changedTouches[0].clientY;
1459
+ }
1460
+
1461
+ var ofy, ofx;
1462
+ ofx = ofy = 0;
1463
+
1464
+ if (moveneedoffset && ! byiframe) {
1465
+ var wp = self.win.position();
1466
+ ofx = - wp.left;
1467
+ ofy = - wp.top;
1468
+ }
1469
+
1470
+ var fy = e.clientY + ofy;
1471
+ var my = (fy - self.rail.drag.y);
1472
+ var fx = e.clientX + ofx;
1473
+ var mx = (fx - self.rail.drag.x);
1474
+
1475
+ var ny = self.rail.drag.st - my;
1476
+
1477
+ if (self.ishwscroll && opt.bouncescroll) {
1478
+ if (ny < 0) {
1479
+ ny = Math.round(ny / 2);
1480
+ }
1481
+ else if (ny > self.page.maxh) {
1482
+ ny = self.page.maxh + Math.round((ny - self.page.maxh) / 2);
1483
+ }
1484
+ }
1485
+ else {
1486
+ if (ny < 0) {
1487
+ ny = 0;
1488
+ fy = 0;
1489
+ }
1490
+ else if (ny > self.page.maxh) {
1491
+ ny = self.page.maxh;
1492
+ fy = 0;
1493
+ }
1494
+ if (fy === 0 && ! self.hasmoving) {
1495
+ if (! self.ispage) {
1496
+ self.rail.drag = false;
1497
+ }
1498
+ return true;
1499
+ }
1500
+ }
1501
+
1502
+ var nx = self.getScrollLeft();
1503
+
1504
+ if (self.railh && self.railh.scrollable) {
1505
+ nx = (self.isrtlmode) ? mx - self.rail.drag.sl : self.rail.drag.sl - mx;
1506
+
1507
+ if (self.ishwscroll && opt.bouncescroll) {
1508
+ if (nx < 0) {
1509
+ nx = Math.round(nx / 2);
1510
+ }
1511
+ else if (nx > self.page.maxw) {
1512
+ nx = self.page.maxw + Math.round((nx - self.page.maxw) / 2);
1513
+ }
1514
+ }
1515
+ else {
1516
+ if (nx < 0) {
1517
+ nx = 0;
1518
+ fx = 0;
1519
+ }
1520
+ if (nx > self.page.maxw) {
1521
+ nx = self.page.maxw;
1522
+ fx = 0;
1523
+ }
1524
+ }
1525
+
1526
+ }
1527
+
1528
+
1529
+ if (! self.hasmoving) {
1530
+
1531
+ if (self.rail.drag.y === e.clientY && self.rail.drag.x === e.clientX) {
1532
+ return self.cancelEvent(e);
1533
+ } // prevent first useless move event
1534
+
1535
+ var ay = Math.abs(my);
1536
+ var ax = Math.abs(mx);
1537
+ var dz = opt.directionlockdeadzone;
1538
+
1539
+ if (! self.rail.drag.ck) {
1540
+ if (ay > dz && ax > dz) {
1541
+ self.rail.drag.dl = "f";
1542
+ }
1543
+ else if (ay > dz) {
1544
+ self.rail.drag.dl = (ax > locktollerance) ? "f" : "v";
1545
+ }
1546
+ else if (ax > dz) {
1547
+ self.rail.drag.dl = (ay > locktollerance) ? "f" : "h";
1548
+ }
1549
+ }
1550
+ else if (self.rail.drag.ck == "v") {
1551
+ if (ax > dz && ay <= locktollerance) {
1552
+ self.rail.drag = false;
1553
+ }
1554
+ else if (ay > dz) {
1555
+ self.rail.drag.dl = "v";
1556
+ }
1557
+
1558
+ }
1559
+ else if (self.rail.drag.ck == "h") {
1560
+
1561
+ if (ay > dz && ax <= locktollerance) {
1562
+ self.rail.drag = false;
1563
+ }
1564
+ else if (ax > dz) {
1565
+ self.rail.drag.dl = "h";
1566
+ }
1567
+
1568
+ }
1569
+
1570
+ if (! self.rail.drag.dl) {
1571
+ return self.cancelEvent(e);
1572
+ }
1573
+
1574
+ self.triggerScrollStart(e.clientX, e.clientY, 0, 0, 0);
1575
+ self.hasmoving = true;
1576
+ }
1577
+
1578
+ if (self.preventclick && ! self.preventclick.click) {
1579
+ self.preventclick.click = self.preventclick.tg.onclick || false;
1580
+ self.preventclick.tg.onclick = self.onpreventclick;
1581
+ }
1582
+
1583
+ if (self.rail.drag.dl) {
1584
+ if (self.rail.drag.dl == "v") {
1585
+ nx = self.rail.drag.sl;
1586
+ }
1587
+ else if (self.rail.drag.dl == "h") {
1588
+ ny = self.rail.drag.st;
1589
+ }
1590
+ }
1591
+
1592
+ self.synched("touchmove", function () {
1593
+ if (self.rail.drag && (self.rail.drag.pt == 2)) {
1594
+ if (self.prepareTransition) {
1595
+ self.resetTransition();
1596
+ }
1597
+ if (self.rail.scrollable) {
1598
+ self.setScrollTop(ny);
1599
+ }
1600
+ self.scrollmom.update(fx, fy);
1601
+ if (self.railh && self.railh.scrollable) {
1602
+ self.setScrollLeft(nx);
1603
+ self.showCursor(ny, nx);
1604
+ }
1605
+ else {
1606
+ self.showCursor(ny);
1607
+ }
1608
+ if (cap.isie10) {
1609
+ _doc.selection.clear();
1610
+ }
1611
+ }
1612
+ });
1613
+
1614
+ return self.cancelEvent(e);
1615
+
1616
+ }
1617
+ else if (self.rail.drag.pt == 1) { // drag on cursor
1618
+ return self.onmousemove(e);
1619
+ }
1620
+
1621
+ };
1622
+
1623
+ self.ontouchstartCursor = function (e, hronly) {
1624
+ if (self.rail.drag && self.rail.drag.pt != 3) {
1625
+ return;
1626
+ }
1627
+ if (self.locked) {
1628
+ return self.cancelEvent(e);
1629
+ }
1630
+ self.cancelScroll();
1631
+ self.rail.drag = {
1632
+ x: e.touches[0].clientX,
1633
+ y: e.touches[0].clientY,
1634
+ sx: self.scroll.x,
1635
+ sy: self.scroll.y,
1636
+ pt: 3,
1637
+ hr: (! ! hronly)
1638
+ };
1639
+ var tg = self.getTarget(e);
1640
+ if (! self.ispage && cap.hasmousecapture) {
1641
+ tg.setCapture();
1642
+ }
1643
+ if (self.isiframe && ! cap.hasmousecapture) {
1644
+ self.saved.csspointerevents = self.doc.css("pointer-events");
1645
+ self.css(self.doc, { "pointer-events": "none" });
1646
+ }
1647
+ return self.cancelEvent(e);
1648
+ };
1649
+
1650
+ self.ontouchendCursor = function (e) {
1651
+ if (self.rail.drag) {
1652
+ if (cap.hasmousecapture) {
1653
+ _doc.releaseCapture();
1654
+ }
1655
+ if (self.isiframe && ! cap.hasmousecapture) {
1656
+ self.doc.css("pointer-events", self.saved.csspointerevents);
1657
+ }
1658
+ if (self.rail.drag.pt != 3) {
1659
+ return;
1660
+ }
1661
+ self.rail.drag = false;
1662
+ return self.cancelEvent(e);
1663
+ }
1664
+ };
1665
+
1666
+ self.ontouchmoveCursor = function (e) {
1667
+ if (self.rail.drag) {
1668
+ if (self.rail.drag.pt != 3) {
1669
+ return;
1670
+ }
1671
+
1672
+ self.cursorfreezed = true;
1673
+
1674
+ if (self.rail.drag.hr) {
1675
+ self.scroll.x = self.rail.drag.sx + (e.touches[0].clientX - self.rail.drag.x);
1676
+ if (self.scroll.x < 0) {
1677
+ self.scroll.x = 0;
1678
+ }
1679
+ var mw = self.scrollvaluemaxw;
1680
+ if (self.scroll.x > mw) {
1681
+ self.scroll.x = mw;
1682
+ }
1683
+ }
1684
+ else {
1685
+ self.scroll.y = self.rail.drag.sy + (e.touches[0].clientY - self.rail.drag.y);
1686
+ if (self.scroll.y < 0) {
1687
+ self.scroll.y = 0;
1688
+ }
1689
+ var my = self.scrollvaluemax;
1690
+ if (self.scroll.y > my) {
1691
+ self.scroll.y = my;
1692
+ }
1693
+ }
1694
+
1695
+ self.synched('touchmove', function () {
1696
+ if (self.rail.drag && (self.rail.drag.pt == 3)) {
1697
+ self.showCursor();
1698
+ if (self.rail.drag.hr) {
1699
+ self.doScrollLeft(Math.round(self.scroll.x * self.scrollratio.x), opt.cursordragspeed);
1700
+ }
1701
+ else {
1702
+ self.doScrollTop(Math.round(self.scroll.y * self.scrollratio.y), opt.cursordragspeed);
1703
+ }
1704
+ }
1705
+ });
1706
+
1707
+ return self.cancelEvent(e);
1708
+ }
1709
+
1710
+ };
1711
+
1712
+ }
1713
+
1714
+ self.onmousedown = function (e, hronly) {
1715
+ if (self.rail.drag && self.rail.drag.pt != 1) {
1716
+ return;
1717
+ }
1718
+ if (self.railslocked) {
1719
+ return self.cancelEvent(e);
1720
+ }
1721
+ self.cancelScroll();
1722
+ self.rail.drag = {
1723
+ x: e.clientX,
1724
+ y: e.clientY,
1725
+ sx: self.scroll.x,
1726
+ sy: self.scroll.y,
1727
+ pt: 1,
1728
+ hr: hronly || false
1729
+ };
1730
+ var tg = self.getTarget(e);
1731
+
1732
+ if (cap.hasmousecapture) {
1733
+ tg.setCapture();
1734
+ }
1735
+ if (self.isiframe && ! cap.hasmousecapture) {
1736
+ self.saved.csspointerevents = self.doc.css("pointer-events");
1737
+ self.css(self.doc, {
1738
+ "pointer-events": "none"
1739
+ });
1740
+ }
1741
+ self.hasmoving = false;
1742
+ return self.cancelEvent(e);
1743
+ };
1744
+
1745
+ self.onmouseup = function (e) {
1746
+ if (self.rail.drag) {
1747
+ if (self.rail.drag.pt != 1) {
1748
+ return true;
1749
+ }
1750
+
1751
+ if (cap.hasmousecapture) {
1752
+ _doc.releaseCapture();
1753
+ }
1754
+ if (self.isiframe && ! cap.hasmousecapture) {
1755
+ self.doc.css("pointer-events", self.saved.csspointerevents);
1756
+ }
1757
+ self.rail.drag = false;
1758
+ self.cursorfreezed = false;
1759
+ if (self.hasmoving) {
1760
+ self.triggerScrollEnd();
1761
+ }
1762
+ return self.cancelEvent(e);
1763
+ }
1764
+ };
1765
+
1766
+ self.onmousemove = function (e) {
1767
+ if (self.rail.drag) {
1768
+ if (self.rail.drag.pt !== 1) {
1769
+ return;
1770
+ }
1771
+
1772
+ if (cap.ischrome && e.which === 0) {
1773
+ return self.onmouseup(e);
1774
+ }
1775
+
1776
+ self.cursorfreezed = true;
1777
+
1778
+ if (! self.hasmoving) {
1779
+ self.triggerScrollStart(e.clientX, e.clientY, 0, 0, 0);
1780
+ }
1781
+
1782
+ self.hasmoving = true;
1783
+
1784
+ if (self.rail.drag.hr) {
1785
+ self.scroll.x = self.rail.drag.sx + (e.clientX - self.rail.drag.x);
1786
+ if (self.scroll.x < 0) {
1787
+ self.scroll.x = 0;
1788
+ }
1789
+ var mw = self.scrollvaluemaxw;
1790
+ if (self.scroll.x > mw) {
1791
+ self.scroll.x = mw;
1792
+ }
1793
+ }
1794
+ else {
1795
+ self.scroll.y = self.rail.drag.sy + (e.clientY - self.rail.drag.y);
1796
+ if (self.scroll.y < 0) {
1797
+ self.scroll.y = 0;
1798
+ }
1799
+ var my = self.scrollvaluemax;
1800
+ if (self.scroll.y > my) {
1801
+ self.scroll.y = my;
1802
+ }
1803
+ }
1804
+
1805
+ self.synched('mousemove', function () {
1806
+
1807
+ if (self.cursorfreezed) {
1808
+ self.showCursor();
1809
+
1810
+ if (self.rail.drag.hr) {
1811
+ self.scrollLeft(Math.round(self.scroll.x * self.scrollratio.x));
1812
+ }
1813
+ else {
1814
+ self.scrollTop(Math.round(self.scroll.y * self.scrollratio.y));
1815
+ }
1816
+
1817
+ }
1818
+ });
1819
+
1820
+ return self.cancelEvent(e);
1821
+ }
1822
+ else {
1823
+ self.checkarea = 0;
1824
+ }
1825
+ };
1826
+
1827
+ if (cap.cantouch || opt.emulatetouch) {
1828
+
1829
+ self.onpreventclick = function (e) {
1830
+ if (self.preventclick) {
1831
+ self.preventclick.tg.onclick = self.preventclick.click;
1832
+ self.preventclick = false;
1833
+ return self.cancelEvent(e);
1834
+ }
1835
+ };
1836
+
1837
+ self.onclick = (cap.isios) ? false : function (e) { // it needs to check IE11 ???
1838
+ if (self.lastmouseup) {
1839
+ self.lastmouseup = false;
1840
+ return self.cancelEvent(e);
1841
+ }
1842
+ else {
1843
+ return true;
1844
+ }
1845
+ };
1846
+
1847
+ if (opt.grabcursorenabled && cap.cursorgrabvalue) {
1848
+ self.css((self.ispage) ? self.doc : self.win, {
1849
+ 'cursor': cap.cursorgrabvalue
1850
+ });
1851
+ self.css(self.rail, {
1852
+ 'cursor': cap.cursorgrabvalue
1853
+ });
1854
+ }
1855
+
1856
+ }
1857
+ else {
1858
+
1859
+ var checkSelectionScroll = function (e) {
1860
+ if (! self.selectiondrag) {
1861
+ return;
1862
+ }
1863
+
1864
+ if (e) {
1865
+ var ww = self.win.outerHeight();
1866
+ var df = (e.pageY - self.selectiondrag.top);
1867
+ if (df > 0 && df < ww) {
1868
+ df = 0;
1869
+ }
1870
+ if (df >= ww) {
1871
+ df -= ww;
1872
+ }
1873
+ self.selectiondrag.df = df;
1874
+ }
1875
+ if (self.selectiondrag.df === 0) {
1876
+ return;
1877
+ }
1878
+
1879
+ var rt = - (self.selectiondrag.df * 2 / 6) | 0;
1880
+ self.doScrollBy(rt);
1881
+
1882
+ self.debounced("doselectionscroll", function () {
1883
+ checkSelectionScroll();
1884
+ }, 50);
1885
+ };
1886
+
1887
+ if ("getSelection" in _doc) { // A grade - Major browsers
1888
+ self.hasTextSelected = function () {
1889
+ return (_doc.getSelection().rangeCount > 0);
1890
+ };
1891
+ }
1892
+ else if ("selection" in _doc) { //IE9-
1893
+ self.hasTextSelected = function () {
1894
+ return (_doc.selection.type != "None");
1895
+ };
1896
+ }
1897
+ else {
1898
+ self.hasTextSelected = function () { // no support
1899
+ return false;
1900
+ };
1901
+ }
1902
+
1903
+ self.onselectionstart = function (e) {
1904
+ // More testing - severe chrome issues
1905
+ /*
1906
+ if (!self.haswrapper&&(e.which&&e.which==2)) { // fool browser to manage middle button scrolling
1907
+ self.win.css({'overflow':'auto'});
1908
+ setTimeout(function(){
1909
+ self.win.css({'overflow':'hidden'});
1910
+ },10);
1911
+ return true;
1912
+ }
1913
+ */
1914
+ if (self.ispage) {
1915
+ return;
1916
+ }
1917
+ self.selectiondrag = self.win.offset();
1918
+ };
1919
+
1920
+ self.onselectionend = function (e) {
1921
+ self.selectiondrag = false;
1922
+ };
1923
+ self.onselectiondrag = function (e) {
1924
+ if (! self.selectiondrag) {
1925
+ return;
1926
+ }
1927
+ if (self.hasTextSelected()) {
1928
+ self.debounced("selectionscroll", function () {
1929
+ checkSelectionScroll(e);
1930
+ }, 250);
1931
+ }
1932
+ };
1933
+ }
1934
+
1935
+ if (cap.hasw3ctouch) { //IE11+
1936
+ self.css((self.ispage) ? $("html") : self.win, { 'touch-action': 'none' });
1937
+ self.css(self.rail, {
1938
+ 'touch-action': 'none'
1939
+ });
1940
+ self.css(self.cursor, {
1941
+ 'touch-action': 'none'
1942
+ });
1943
+ self.bind(self.win, "pointerdown", self.ontouchstart);
1944
+ self.bind(_doc, "pointerup", self.ontouchend);
1945
+ self.delegate(_doc, "pointermove", self.ontouchmove);
1946
+ }
1947
+ else if (cap.hasmstouch) { //IE10
1948
+ self.css((self.ispage) ? $("html") : self.win, { '-ms-touch-action': 'none' });
1949
+ self.css(self.rail, {
1950
+ '-ms-touch-action': 'none'
1951
+ });
1952
+ self.css(self.cursor, {
1953
+ '-ms-touch-action': 'none'
1954
+ });
1955
+ self.bind(self.win, "MSPointerDown", self.ontouchstart);
1956
+ self.bind(_doc, "MSPointerUp", self.ontouchend);
1957
+ self.delegate(_doc, "MSPointerMove", self.ontouchmove);
1958
+ self.bind(self.cursor, "MSGestureHold", function (e) {
1959
+ e.preventDefault();
1960
+ });
1961
+ self.bind(self.cursor, "contextmenu", function (e) {
1962
+ e.preventDefault();
1963
+ });
1964
+ }
1965
+ else if (cap.cantouch) { // smartphones/touch devices
1966
+ self.bind(self.win, "touchstart", self.ontouchstart, false, true);
1967
+ self.bind(_doc, "touchend", self.ontouchend, false, true);
1968
+ self.bind(_doc, "touchcancel", self.ontouchend, false, true);
1969
+ self.delegate(_doc, "touchmove", self.ontouchmove, false, true);
1970
+ }
1971
+
1972
+ if (opt.emulatetouch) {
1973
+ self.bind(self.win, "mousedown", self.ontouchstart, false, true);
1974
+ self.bind(_doc, "mouseup", self.ontouchend, false, true);
1975
+ self.bind(_doc, "mousemove", self.ontouchmove, false, true);
1976
+ }
1977
+
1978
+ if (opt.cursordragontouch || (! cap.cantouch && ! opt.emulatetouch)) {
1979
+
1980
+ self.rail.css({
1981
+ cursor: "default"
1982
+ });
1983
+ self.railh && self.railh.css({
1984
+ cursor: "default"
1985
+ });
1986
+
1987
+ self.jqbind(self.rail, "mouseenter", function () {
1988
+ if (! self.ispage && ! self.win.is(":visible")) {
1989
+ return false;
1990
+ }
1991
+ if (self.canshowonmouseevent) {
1992
+ self.showCursor();
1993
+ }
1994
+ self.rail.active = true;
1995
+ });
1996
+ self.jqbind(self.rail, "mouseleave", function () {
1997
+ self.rail.active = false;
1998
+ if (! self.rail.drag) {
1999
+ self.hideCursor();
2000
+ }
2001
+ });
2002
+
2003
+ if (opt.sensitiverail) {
2004
+ self.bind(self.rail, "click", function (e) {
2005
+ self.doRailClick(e, false, false);
2006
+ });
2007
+ self.bind(self.rail, "dblclick", function (e) {
2008
+ self.doRailClick(e, true, false);
2009
+ });
2010
+ self.bind(self.cursor, "click", function (e) {
2011
+ self.cancelEvent(e);
2012
+ });
2013
+ self.bind(self.cursor, "dblclick", function (e) {
2014
+ self.cancelEvent(e);
2015
+ });
2016
+ }
2017
+
2018
+ if (self.railh) {
2019
+ self.jqbind(self.railh, "mouseenter", function () {
2020
+ if (! self.ispage && ! self.win.is(":visible")) {
2021
+ return false;
2022
+ }
2023
+ if (self.canshowonmouseevent) {
2024
+ self.showCursor();
2025
+ }
2026
+ self.rail.active = true;
2027
+ });
2028
+ self.jqbind(self.railh, "mouseleave", function () {
2029
+ self.rail.active = false;
2030
+ if (! self.rail.drag) {
2031
+ self.hideCursor();
2032
+ }
2033
+ });
2034
+
2035
+ if (opt.sensitiverail) {
2036
+ self.bind(self.railh, "click", function (e) {
2037
+ self.doRailClick(e, false, true);
2038
+ });
2039
+ self.bind(self.railh, "dblclick", function (e) {
2040
+ self.doRailClick(e, true, true);
2041
+ });
2042
+ self.bind(self.cursorh, "click", function (e) {
2043
+ self.cancelEvent(e);
2044
+ });
2045
+ self.bind(self.cursorh, "dblclick", function (e) {
2046
+ self.cancelEvent(e);
2047
+ });
2048
+ }
2049
+
2050
+ }
2051
+
2052
+ }
2053
+
2054
+ if (opt.cursordragontouch && (this.istouchcapable || cap.cantouch)) {
2055
+ self.bind(self.cursor, "touchstart", self.ontouchstartCursor);
2056
+ self.bind(self.cursor, "touchmove", self.ontouchmoveCursor);
2057
+ self.bind(self.cursor, "touchend", self.ontouchendCursor);
2058
+ self.cursorh && self.bind(self.cursorh, "touchstart", function (e) {
2059
+ self.ontouchstartCursor(e, true);
2060
+ });
2061
+ self.cursorh && self.bind(self.cursorh, "touchmove", self.ontouchmoveCursor);
2062
+ self.cursorh && self.bind(self.cursorh, "touchend", self.ontouchendCursor);
2063
+ }
2064
+
2065
+ // if (!cap.cantouch && !opt.emulatetouch) {
2066
+ if (! opt.emulatetouch && ! cap.isandroid && ! cap.isios) {
2067
+
2068
+ self.bind((cap.hasmousecapture) ? self.win : _doc, "mouseup", self.onmouseup);
2069
+ self.bind(_doc, "mousemove", self.onmousemove);
2070
+ if (self.onclick) {
2071
+ self.bind(_doc, "click", self.onclick);
2072
+ }
2073
+
2074
+ self.bind(self.cursor, "mousedown", self.onmousedown);
2075
+ self.bind(self.cursor, "mouseup", self.onmouseup);
2076
+
2077
+ if (self.railh) {
2078
+ self.bind(self.cursorh, "mousedown", function (e) {
2079
+ self.onmousedown(e, true);
2080
+ });
2081
+ self.bind(self.cursorh, "mouseup", self.onmouseup);
2082
+ }
2083
+
2084
+ if (! self.ispage && opt.enablescrollonselection) {
2085
+ self.bind(self.win[0], "mousedown", self.onselectionstart);
2086
+ self.bind(_doc, "mouseup", self.onselectionend);
2087
+ self.bind(self.cursor, "mouseup", self.onselectionend);
2088
+ if (self.cursorh) {
2089
+ self.bind(self.cursorh, "mouseup", self.onselectionend);
2090
+ }
2091
+ self.bind(_doc, "mousemove", self.onselectiondrag);
2092
+ }
2093
+
2094
+ if (self.zoom) {
2095
+ self.jqbind(self.zoom, "mouseenter", function () {
2096
+ if (self.canshowonmouseevent) {
2097
+ self.showCursor();
2098
+ }
2099
+ self.rail.active = true;
2100
+ });
2101
+ self.jqbind(self.zoom, "mouseleave", function () {
2102
+ self.rail.active = false;
2103
+ if (! self.rail.drag) {
2104
+ self.hideCursor();
2105
+ }
2106
+ });
2107
+ }
2108
+
2109
+ }
2110
+ else {
2111
+
2112
+ self.bind((cap.hasmousecapture) ? self.win : _doc, "mouseup", self.ontouchend);
2113
+ if (self.onclick) {
2114
+ self.bind(_doc, "click", self.onclick);
2115
+ }
2116
+
2117
+ if (opt.cursordragontouch) {
2118
+ self.bind(self.cursor, "mousedown", self.onmousedown);
2119
+ self.bind(self.cursor, "mouseup", self.onmouseup);
2120
+ self.cursorh && self.bind(self.cursorh, "mousedown", function (e) {
2121
+ self.onmousedown(e, true);
2122
+ });
2123
+ self.cursorh && self.bind(self.cursorh, "mouseup", self.onmouseup);
2124
+ }
2125
+ else {
2126
+ self.bind(self.rail, "mousedown", function (e) {
2127
+ e.preventDefault();
2128
+ }); // prevent text selection
2129
+ self.railh && self.bind(self.railh, "mousedown", function (e) {
2130
+ e.preventDefault();
2131
+ });
2132
+ }
2133
+
2134
+ }
2135
+
2136
+
2137
+ if (opt.enablemousewheel) {
2138
+ if (! self.isiframe) {
2139
+ self.mousewheel((cap.isie && self.ispage) ? _doc : self.win, self.onmousewheel);
2140
+ }
2141
+ self.mousewheel(self.rail, self.onmousewheel);
2142
+ if (self.railh) {
2143
+ self.mousewheel(self.railh, self.onmousewheelhr);
2144
+ }
2145
+ }
2146
+
2147
+ if (! self.ispage && ! cap.cantouch && ! (/HTML|^BODY/.test(self.win[0].nodeName))) {
2148
+ if (! self.win.attr("tabindex")) {
2149
+ self.win.attr({
2150
+ "tabindex": ++ tabindexcounter
2151
+ });
2152
+ }
2153
+
2154
+ self.bind(self.win, "focus", function (e) { // better using native events
2155
+ domfocus = (self.getTarget(e)).id || self.getTarget(e) || false;
2156
+ self.hasfocus = true;
2157
+ if (self.canshowonmouseevent) {
2158
+ self.noticeCursor();
2159
+ }
2160
+ });
2161
+ self.bind(self.win, "blur", function (e) { // *
2162
+ domfocus = false;
2163
+ self.hasfocus = false;
2164
+ });
2165
+
2166
+ self.bind(self.win, "mouseenter", function (e) { // *
2167
+ mousefocus = (self.getTarget(e)).id || self.getTarget(e) || false;
2168
+ self.hasmousefocus = true;
2169
+ if (self.canshowonmouseevent) {
2170
+ self.noticeCursor();
2171
+ }
2172
+ });
2173
+ self.bind(self.win, "mouseleave", function (e) { // *
2174
+ mousefocus = false;
2175
+ self.hasmousefocus = false;
2176
+ if (! self.rail.drag) {
2177
+ self.hideCursor();
2178
+ }
2179
+ });
2180
+
2181
+ }
2182
+
2183
+
2184
+ //Thanks to http://www.quirksmode.org !!
2185
+ self.onkeypress = function (e) {
2186
+ if (self.railslocked && self.page.maxh === 0) {
2187
+ return true;
2188
+ }
2189
+
2190
+ e = e || _win.event;
2191
+ var tg = self.getTarget(e);
2192
+ if (tg && /INPUT|TEXTAREA|SELECT|OPTION/.test(tg.nodeName)) {
2193
+ var tp = tg.getAttribute('type') || tg.type || false;
2194
+ if ((! tp) || ! (/submit|button|cancel/i.tp)) {
2195
+ return true;
2196
+ }
2197
+ }
2198
+
2199
+ if ($(tg).attr('contenteditable')) {
2200
+ return true;
2201
+ }
2202
+
2203
+ if (self.hasfocus || (self.hasmousefocus && ! domfocus) || (self.ispage && ! domfocus && ! mousefocus)) {
2204
+ var key = e.keyCode;
2205
+
2206
+ if (self.railslocked && key != 27) {
2207
+ return self.cancelEvent(e);
2208
+ }
2209
+
2210
+ var ctrl = e.ctrlKey || false;
2211
+ var shift = e.shiftKey || false;
2212
+
2213
+ var ret = false;
2214
+ switch (key) {
2215
+ case 38:
2216
+ case 63233: //safari
2217
+ self.doScrollBy(24 * 3);
2218
+ ret = true;
2219
+ break;
2220
+ case 40:
2221
+ case 63235: //safari
2222
+ self.doScrollBy(- 24 * 3);
2223
+ ret = true;
2224
+ break;
2225
+ case 37:
2226
+ case 63232: //safari
2227
+ if (self.railh) {
2228
+ (ctrl) ? self.doScrollLeft(0) : self.doScrollLeftBy(24 * 3);
2229
+ ret = true;
2230
+ }
2231
+ break;
2232
+ case 39:
2233
+ case 63234: //safari
2234
+ if (self.railh) {
2235
+ (ctrl) ? self.doScrollLeft(self.page.maxw) : self.doScrollLeftBy(- 24 * 3);
2236
+ ret = true;
2237
+ }
2238
+ break;
2239
+ case 33:
2240
+ case 63276: // safari
2241
+ self.doScrollBy(self.view.h);
2242
+ ret = true;
2243
+ break;
2244
+ case 34:
2245
+ case 63277: // safari
2246
+ self.doScrollBy(- self.view.h);
2247
+ ret = true;
2248
+ break;
2249
+ case 36:
2250
+ case 63273: // safari
2251
+ (self.railh && ctrl) ? self.doScrollPos(0, 0) : self.doScrollTo(0);
2252
+ ret = true;
2253
+ break;
2254
+ case 35:
2255
+ case 63275: // safari
2256
+ (self.railh && ctrl) ? self.doScrollPos(self.page.maxw, self.page.maxh) : self.doScrollTo(self.page.maxh);
2257
+ ret = true;
2258
+ break;
2259
+ case 32:
2260
+ if (opt.spacebarenabled) {
2261
+ (shift) ? self.doScrollBy(self.view.h) : self.doScrollBy(- self.view.h);
2262
+ ret = true;
2263
+ }
2264
+ break;
2265
+ case 27: // ESC
2266
+ if (self.zoomactive) {
2267
+ self.doZoom();
2268
+ ret = true;
2269
+ }
2270
+ break;
2271
+ }
2272
+ if (ret) {
2273
+ return self.cancelEvent(e);
2274
+ }
2275
+ }
2276
+ };
2277
+
2278
+ if (opt.enablekeyboard) {
2279
+ self.bind(_doc, (cap.isopera && ! cap.isopera12) ? "keypress" : "keydown", self.onkeypress);
2280
+ }
2281
+
2282
+ self.bind(_doc, "keydown", function (e) {
2283
+ var ctrl = e.ctrlKey || false;
2284
+ if (ctrl) {
2285
+ self.wheelprevented = true;
2286
+ }
2287
+ });
2288
+ self.bind(_doc, "keyup", function (e) {
2289
+ var ctrl = e.ctrlKey || false;
2290
+ if (! ctrl) {
2291
+ self.wheelprevented = false;
2292
+ }
2293
+ });
2294
+ self.bind(_win, "blur", function (e) {
2295
+ self.wheelprevented = false;
2296
+ });
2297
+
2298
+ self.bind(_win, 'resize', self.onscreenresize);
2299
+ self.bind(_win, 'orientationchange', self.onscreenresize);
2300
+
2301
+ self.bind(_win, "load", self.lazyResize);
2302
+
2303
+ if (cap.ischrome && ! self.ispage && ! self.haswrapper) { //chrome void scrollbar bug - it persists in version 26
2304
+ var tmp = self.win.attr("style");
2305
+ var ww = parseFloat(self.win.css("width")) + 1;
2306
+ self.win.css('width', ww);
2307
+ self.synched("chromefix", function () {
2308
+ self.win.attr("style", tmp);
2309
+ });
2310
+ }
2311
+
2312
+
2313
+ // Trying a cross-browser implementation - good luck!
2314
+
2315
+ self.onAttributeChange = function (e) {
2316
+ self.lazyResize(self.isieold ? 250 : 30);
2317
+ };
2318
+
2319
+ if (opt.enableobserver) {
2320
+
2321
+ if ((! self.isie11) && (ClsMutationObserver !== false)) { // IE11 crashes #568
2322
+ self.observerbody = new ClsMutationObserver(function (mutations) {
2323
+ mutations.forEach(function (mut) {
2324
+ if (mut.type == "attributes") {
2325
+ return ($body.hasClass("modal-open") && $body.hasClass("modal-dialog") && ! $.contains($('.modal-dialog')[0], self.doc[0])) ? self.hide() : self.show(); // Support for Bootstrap modal; Added check if the nice scroll element is inside a modal
2326
+ }
2327
+ });
2328
+ if (self.me.clientWidth != self.page.width || self.me.clientHeight != self.page.height) {
2329
+ return self.lazyResize(30);
2330
+ }
2331
+ });
2332
+ self.observerbody.observe(_doc.body, {
2333
+ childList: true,
2334
+ subtree: true,
2335
+ characterData: false,
2336
+ attributes: true,
2337
+ attributeFilter: ['class']
2338
+ });
2339
+ }
2340
+
2341
+ if (! self.ispage && ! self.haswrapper) {
2342
+
2343
+ var _dom = self.win[0];
2344
+
2345
+ // redesigned MutationObserver for Chrome18+/Firefox14+/iOS6+ with support for: remove div, add/remove content
2346
+ if (ClsMutationObserver !== false) {
2347
+ self.observer = new ClsMutationObserver(function (mutations) {
2348
+ mutations.forEach(self.onAttributeChange);
2349
+ });
2350
+ self.observer.observe(_dom, {
2351
+ childList: true,
2352
+ characterData: false,
2353
+ attributes: true,
2354
+ subtree: false
2355
+ });
2356
+ self.observerremover = new ClsMutationObserver(function (mutations) {
2357
+ mutations.forEach(function (mo) {
2358
+ if (mo.removedNodes.length > 0) {
2359
+ for (var dd in mo.removedNodes) {
2360
+ if (! ! self && (mo.removedNodes[dd] === _dom)) {
2361
+ return self.remove();
2362
+ }
2363
+ }
2364
+ }
2365
+ });
2366
+ });
2367
+ self.observerremover.observe(_dom.parentNode, {
2368
+ childList: true,
2369
+ characterData: false,
2370
+ attributes: false,
2371
+ subtree: false
2372
+ });
2373
+ }
2374
+ else {
2375
+ self.bind(_dom, (cap.isie && ! cap.isie9) ? "propertychange" : "DOMAttrModified", self.onAttributeChange);
2376
+ if (cap.isie9) {
2377
+ _dom.attachEvent("onpropertychange", self.onAttributeChange);
2378
+ } //IE9 DOMAttrModified bug
2379
+ self.bind(_dom, "DOMNodeRemoved", function (e) {
2380
+ if (e.target === _dom) {
2381
+ self.remove();
2382
+ }
2383
+ });
2384
+ }
2385
+ }
2386
+
2387
+ }
2388
+
2389
+ //
2390
+
2391
+ if (! self.ispage && opt.boxzoom) {
2392
+ self.bind(_win, "resize", self.resizeZoom);
2393
+ }
2394
+ if (self.istextarea) {
2395
+ self.bind(self.win, "keydown", self.lazyResize);
2396
+ self.bind(self.win, "mouseup", self.lazyResize);
2397
+ }
2398
+
2399
+ self.lazyResize(30);
2400
+
2401
+ }
2402
+
2403
+ if (this.doc[0].nodeName == 'IFRAME') {
2404
+ var oniframeload = function () {
2405
+ self.iframexd = false;
2406
+ var doc;
2407
+ try {
2408
+ doc = 'contentDocument' in this ? this.contentDocument : this.contentWindow._doc;
2409
+ var a = doc.domain;
2410
+ }
2411
+ catch (e) {
2412
+ self.iframexd = true;
2413
+ doc = false;
2414
+ }
2415
+
2416
+ if (self.iframexd) {
2417
+ if ("console" in _win) {
2418
+ console.log('NiceScroll error: policy restriced iframe');
2419
+ }
2420
+ return true; //cross-domain - I can't manage this
2421
+ }
2422
+
2423
+ self.forcescreen = true;
2424
+
2425
+ if (self.isiframe) {
2426
+ self.iframe = {
2427
+ "doc": $(doc),
2428
+ "html": self.doc.contents().find('html')[0],
2429
+ "body": self.doc.contents().find('body')[0]
2430
+ };
2431
+ self.getContentSize = function () {
2432
+ return {
2433
+ w: Math.max(self.iframe.html.scrollWidth, self.iframe.body.scrollWidth),
2434
+ h: Math.max(self.iframe.html.scrollHeight, self.iframe.body.scrollHeight)
2435
+ };
2436
+ };
2437
+ self.docscroll = $(self.iframe.body);
2438
+ }
2439
+
2440
+ if (! cap.isios && opt.iframeautoresize && ! self.isiframe) {
2441
+ self.win.scrollTop(0); // reset position
2442
+ self.doc.height(""); //reset height to fix browser bug
2443
+ var hh = Math.max(doc.getElementsByTagName('html')[0].scrollHeight, doc.body.scrollHeight);
2444
+ self.doc.height(hh);
2445
+ }
2446
+ self.lazyResize(30);
2447
+
2448
+ self.css($(self.iframe.body), _scrollyhidden);
2449
+
2450
+ if (cap.isios && self.haswrapper) {
2451
+ self.css($(doc.body), {
2452
+ '-webkit-transform': 'translate3d(0,0,0)'
2453
+ }); // avoid iFrame content clipping - thanks to http://blog.derraab.com/2012/04/02/avoid-iframe-content-clipping-with-css-transform-on-ios/
2454
+ }
2455
+
2456
+ if ('contentWindow' in this) {
2457
+ self.bind(this.contentWindow, "scroll", self.onscroll); //IE8 & minor
2458
+ }
2459
+ else {
2460
+ self.bind(doc, "scroll", self.onscroll);
2461
+ }
2462
+
2463
+ if (opt.enablemousewheel) {
2464
+ self.mousewheel(doc, self.onmousewheel);
2465
+ }
2466
+
2467
+ if (opt.enablekeyboard) {
2468
+ self.bind(doc, (cap.isopera) ? "keypress" : "keydown", self.onkeypress);
2469
+ }
2470
+
2471
+ if (cap.cantouch) {
2472
+ self.bind(doc, "touchstart", self.ontouchstart);
2473
+ self.bind(doc, "touchmove", self.ontouchmove);
2474
+ }
2475
+ else if (opt.emulatetouch) {
2476
+ self.bind(doc, "mousedown", self.ontouchstart);
2477
+ self.bind(doc, "mousemove", function (e) {
2478
+ return self.ontouchmove(e, true);
2479
+ });
2480
+ if (opt.grabcursorenabled && cap.cursorgrabvalue) {
2481
+ self.css($(doc.body), {
2482
+ 'cursor': cap.cursorgrabvalue
2483
+ });
2484
+ }
2485
+ }
2486
+
2487
+ self.bind(doc, "mouseup", self.ontouchend);
2488
+
2489
+ if (self.zoom) {
2490
+ if (opt.dblclickzoom) {
2491
+ self.bind(doc, 'dblclick', self.doZoom);
2492
+ }
2493
+ if (self.ongesturezoom) {
2494
+ self.bind(doc, "gestureend", self.ongesturezoom);
2495
+ }
2496
+ }
2497
+ };
2498
+
2499
+ if (this.doc[0].readyState && this.doc[0].readyState === "complete") {
2500
+ setTimeout(function () {
2501
+ oniframeload.call(self.doc[0], false);
2502
+ }, 500);
2503
+ }
2504
+ self.bind(this.doc, "load", oniframeload);
2505
+
2506
+ }
2507
+
2508
+ };
2509
+
2510
+ this.showCursor = function (py, px) {
2511
+ if (self.cursortimeout) {
2512
+ clearTimeout(self.cursortimeout);
2513
+ self.cursortimeout = 0;
2514
+ }
2515
+ if (! self.rail) {
2516
+ return;
2517
+ }
2518
+ if (self.autohidedom) {
2519
+ self.autohidedom.stop().css({
2520
+ opacity: opt.cursoropacitymax
2521
+ });
2522
+ self.cursoractive = true;
2523
+ }
2524
+
2525
+ if (! self.rail.drag || self.rail.drag.pt != 1) {
2526
+ if (py !== undefined && py !== false) {
2527
+ self.scroll.y = (py / self.scrollratio.y) | 0;
2528
+ }
2529
+ if (px !== undefined) {
2530
+ self.scroll.x = (px / self.scrollratio.x) | 0;
2531
+ }
2532
+ }
2533
+
2534
+ self.cursor.css({
2535
+ height: self.cursorheight,
2536
+ top: self.scroll.y
2537
+ });
2538
+ if (self.cursorh) {
2539
+ var lx = (self.hasreversehr) ? self.scrollvaluemaxw - self.scroll.x : self.scroll.x;
2540
+ self.cursorh.css({
2541
+ width: self.cursorwidth,
2542
+ left: (! self.rail.align && self.rail.visibility) ? lx + self.rail.width : lx
2543
+ });
2544
+ self.cursoractive = true;
2545
+ }
2546
+
2547
+ if (self.zoom) {
2548
+ self.zoom.stop().css({
2549
+ opacity: opt.cursoropacitymax
2550
+ });
2551
+ }
2552
+ };
2553
+
2554
+ this.hideCursor = function (tm) {
2555
+ if (self.cursortimeout) {
2556
+ return;
2557
+ }
2558
+ if (! self.rail) {
2559
+ return;
2560
+ }
2561
+ if (! self.autohidedom) {
2562
+ return;
2563
+ }
2564
+
2565
+ if (self.hasmousefocus && opt.autohidemode === "leave") {
2566
+ return;
2567
+ }
2568
+ self.cursortimeout = setTimeout(function () {
2569
+ if (! self.rail.active || ! self.showonmouseevent) {
2570
+ self.autohidedom.stop().animate({
2571
+ opacity: opt.cursoropacitymin
2572
+ });
2573
+ if (self.zoom) {
2574
+ self.zoom.stop().animate({
2575
+ opacity: opt.cursoropacitymin
2576
+ });
2577
+ }
2578
+ self.cursoractive = false;
2579
+ }
2580
+ self.cursortimeout = 0;
2581
+ }, tm || opt.hidecursordelay);
2582
+ };
2583
+
2584
+ this.noticeCursor = function (tm, py, px) {
2585
+ self.showCursor(py, px);
2586
+ if (! self.rail.active) {
2587
+ self.hideCursor(tm);
2588
+ }
2589
+ };
2590
+
2591
+ this.getContentSize =
2592
+ (self.ispage) ?
2593
+ function () {
2594
+ return {
2595
+ w: Math.max(_doc.body.scrollWidth, _doc.documentElement.scrollWidth),
2596
+ h: Math.max(_doc.body.scrollHeight, _doc.documentElement.scrollHeight)
2597
+ };
2598
+ } : (self.haswrapper) ?
2599
+ function () {
2600
+ return {
2601
+ w: self.doc[0].offsetWidth,
2602
+ h: self.doc[0].offsetHeight
2603
+ };
2604
+ } : function () {
2605
+ return {
2606
+ w: self.docscroll[0].scrollWidth,
2607
+ h: self.docscroll[0].scrollHeight
2608
+ };
2609
+ };
2610
+
2611
+ this.onResize = function (e, page) {
2612
+
2613
+ if (! self || ! self.win) {
2614
+ return false;
2615
+ }
2616
+
2617
+ var premaxh = self.page.maxh,
2618
+ premaxw = self.page.maxw,
2619
+ previewh = self.view.h,
2620
+ previeww = self.view.w;
2621
+
2622
+ self.view = {
2623
+ w: (self.ispage) ? self.win.width() : self.win[0].clientWidth,
2624
+ h: (self.ispage) ? self.win.height() : self.win[0].clientHeight
2625
+ };
2626
+
2627
+ self.page = (page) ? page : self.getContentSize();
2628
+
2629
+ self.page.maxh = Math.max(0, self.page.h - self.view.h);
2630
+ self.page.maxw = Math.max(0, self.page.w - self.view.w);
2631
+
2632
+ if ((self.page.maxh == premaxh) && (self.page.maxw == premaxw) && (self.view.w == previeww) && (self.view.h == previewh)) {
2633
+ // test position
2634
+ if (! self.ispage) {
2635
+ var pos = self.win.offset();
2636
+ if (self.lastposition) {
2637
+ var lst = self.lastposition;
2638
+ if ((lst.top == pos.top) && (lst.left == pos.left)) {
2639
+ return self;
2640
+ } //nothing to do
2641
+ }
2642
+ self.lastposition = pos;
2643
+ }
2644
+ else {
2645
+ return self; //nothing to do
2646
+ }
2647
+ }
2648
+
2649
+ if (self.page.maxh === 0) {
2650
+ self.hideRail();
2651
+ self.scrollvaluemax = 0;
2652
+ self.scroll.y = 0;
2653
+ self.scrollratio.y = 0;
2654
+ self.cursorheight = 0;
2655
+ self.setScrollTop(0);
2656
+ if (self.rail) {
2657
+ self.rail.scrollable = false;
2658
+ }
2659
+ }
2660
+ else {
2661
+ self.page.maxh -= (opt.railpadding.top + opt.railpadding.bottom);
2662
+ self.rail.scrollable = true;
2663
+ }
2664
+
2665
+ if (self.page.maxw === 0) {
2666
+ self.hideRailHr();
2667
+ self.scrollvaluemaxw = 0;
2668
+ self.scroll.x = 0;
2669
+ self.scrollratio.x = 0;
2670
+ self.cursorwidth = 0;
2671
+ self.setScrollLeft(0);
2672
+ if (self.railh) {
2673
+ self.railh.scrollable = false;
2674
+ }
2675
+ }
2676
+ else {
2677
+ self.page.maxw -= (opt.railpadding.left + opt.railpadding.right);
2678
+ if (self.railh) {
2679
+ self.railh.scrollable = (opt.horizrailenabled);
2680
+ }
2681
+ }
2682
+
2683
+ self.railslocked = (self.locked) || ((self.page.maxh === 0) && (self.page.maxw === 0));
2684
+ if (self.railslocked) {
2685
+ if (! self.ispage) {
2686
+ self.updateScrollBar(self.view);
2687
+ }
2688
+ return false;
2689
+ }
2690
+
2691
+ if (! self.hidden) {
2692
+ if (! self.rail.visibility) {
2693
+ self.showRail();
2694
+ }
2695
+ if (self.railh && ! self.railh.visibility) {
2696
+ self.showRailHr();
2697
+ }
2698
+ }
2699
+
2700
+ if (self.istextarea && self.win.css('resize') && self.win.css('resize') != 'none') {
2701
+ self.view.h -= 20;
2702
+ }
2703
+
2704
+ self.cursorheight = Math.min(self.view.h, Math.round(self.view.h * (self.view.h / self.page.h)));
2705
+ self.cursorheight = (opt.cursorfixedheight) ? opt.cursorfixedheight : Math.max(opt.cursorminheight, self.cursorheight);
2706
+
2707
+ self.cursorwidth = Math.min(self.view.w, Math.round(self.view.w * (self.view.w / self.page.w)));
2708
+ self.cursorwidth = (opt.cursorfixedheight) ? opt.cursorfixedheight : Math.max(opt.cursorminheight, self.cursorwidth);
2709
+
2710
+ self.scrollvaluemax = self.view.h - self.cursorheight - (opt.railpadding.top + opt.railpadding.bottom);
2711
+ if (! self.hasborderbox) {
2712
+ self.scrollvaluemax -= self.cursor[0].offsetHeight - self.cursor[0].clientHeight;
2713
+ }
2714
+
2715
+ if (self.railh) {
2716
+ self.railh.width = (self.page.maxh > 0) ? (self.view.w - self.rail.width) : self.view.w;
2717
+ self.scrollvaluemaxw = self.railh.width - self.cursorwidth - (opt.railpadding.left + opt.railpadding.right);
2718
+ }
2719
+
2720
+ if (! self.ispage) {
2721
+ self.updateScrollBar(self.view);
2722
+ }
2723
+
2724
+ self.scrollratio = {
2725
+ x: (self.page.maxw / self.scrollvaluemaxw),
2726
+ y: (self.page.maxh / self.scrollvaluemax)
2727
+ };
2728
+
2729
+ var sy = self.getScrollTop();
2730
+ if (sy > self.page.maxh) {
2731
+ self.doScrollTop(self.page.maxh);
2732
+ }
2733
+ else {
2734
+ self.scroll.y = (self.getScrollTop() / self.scrollratio.y) | 0;
2735
+ self.scroll.x = (self.getScrollLeft() / self.scrollratio.x) | 0;
2736
+ if (self.cursoractive) {
2737
+ self.noticeCursor();
2738
+ }
2739
+ }
2740
+
2741
+ if (self.scroll.y && (self.getScrollTop() === 0)) {
2742
+ self.doScrollTo((self.scroll.y * self.scrollratio.y) | 0);
2743
+ }
2744
+
2745
+ return self;
2746
+ };
2747
+
2748
+ this.resize = self.onResize;
2749
+
2750
+ var hlazyresize = 0;
2751
+
2752
+ this.onscreenresize = function (e) {
2753
+ clearTimeout(hlazyresize);
2754
+
2755
+ var hiderails = (! self.ispage && ! self.haswrapper);
2756
+ if (hiderails) {
2757
+ self.hideRails();
2758
+ }
2759
+
2760
+ hlazyresize = setTimeout(function () {
2761
+ if (self) {
2762
+ if (hiderails) {
2763
+ self.showRails();
2764
+ }
2765
+ self.resize();
2766
+ }
2767
+ hlazyresize = 0;
2768
+ }, 120);
2769
+ };
2770
+
2771
+ this.lazyResize = function (tm) { // event debounce
2772
+
2773
+ clearTimeout(hlazyresize);
2774
+
2775
+ tm = isNaN(tm) ? 240 : tm;
2776
+
2777
+ hlazyresize = setTimeout(function () {
2778
+ self && self.resize();
2779
+ hlazyresize = 0;
2780
+ }, tm);
2781
+
2782
+ return self;
2783
+
2784
+ };
2785
+
2786
+ // derived by MDN https://developer.mozilla.org/en-US/docs/DOM/Mozilla_event_reference/wheel
2787
+ function _modernWheelEvent (dom, name, fn, bubble) {
2788
+ self._bind(dom, name, function (e) {
2789
+ e = e || _win.event;
2790
+ var event = {
2791
+ original: e,
2792
+ target: e.target || e.srcElement,
2793
+ type: "wheel",
2794
+ deltaMode: e.type == "MozMousePixelScroll" ? 0 : 1,
2795
+ deltaX: 0,
2796
+ deltaZ: 0,
2797
+ preventDefault: function () {
2798
+ e.preventDefault ? e.preventDefault() : e.returnValue = false;
2799
+ return false;
2800
+ },
2801
+ stopImmediatePropagation: function () {
2802
+ (e.stopImmediatePropagation) ? e.stopImmediatePropagation() : e.cancelBubble = true;
2803
+ }
2804
+ };
2805
+
2806
+ if (name == "mousewheel") {
2807
+ e.wheelDeltaX && (event.deltaX = - 1 / 40 * e.wheelDeltaX);
2808
+ e.wheelDeltaY && (event.deltaY = - 1 / 40 * e.wheelDeltaY);
2809
+ ! event.deltaY && ! event.deltaX && (event.deltaY = - 1 / 40 * e.wheelDelta);
2810
+ }
2811
+ else {
2812
+ event.deltaY = e.detail;
2813
+ }
2814
+
2815
+ return fn.call(dom, event);
2816
+ }, bubble);
2817
+ }
2818
+
2819
+
2820
+ this.jqbind = function (dom, name, fn) { // use jquery bind for non-native events (mouseenter/mouseleave)
2821
+ self.events.push({
2822
+ e: dom,
2823
+ n: name,
2824
+ f: fn,
2825
+ q: true
2826
+ });
2827
+ $(dom).on(name, fn);
2828
+ };
2829
+
2830
+ this.mousewheel = function (dom, fn, bubble) { // bind mousewheel
2831
+ var el = ("jquery" in dom) ? dom[0] : dom;
2832
+ if ("onwheel" in _doc.createElement("div")) { // Modern browsers support "wheel"
2833
+ self._bind(el, "wheel", fn, bubble || false);
2834
+ }
2835
+ else {
2836
+ var wname = (_doc.onmousewheel !== undefined) ? "mousewheel" : "DOMMouseScroll"; // older Webkit+IE support or older Firefox
2837
+ _modernWheelEvent(el, wname, fn, bubble || false);
2838
+ if (wname == "DOMMouseScroll") {
2839
+ _modernWheelEvent(el, "MozMousePixelScroll", fn, bubble || false);
2840
+ } // Firefox legacy
2841
+ }
2842
+ };
2843
+
2844
+ var passiveSupported = false;
2845
+
2846
+ if (cap.haseventlistener) { // W3C standard event model
2847
+
2848
+ // thanks to https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
2849
+ try {
2850
+ var options = Object.defineProperty({}, "passive", {
2851
+ get: function () {
2852
+ passiveSupported = ! 0;
2853
+ }
2854
+ });
2855
+ _win.addEventListener("test", null, options);
2856
+ }
2857
+ catch (err) {
2858
+ }
2859
+
2860
+ this.stopPropagation = function (e) {
2861
+ if (! e) {
2862
+ return false;
2863
+ }
2864
+ e = (e.original) ? e.original : e;
2865
+ e.stopPropagation();
2866
+ return false;
2867
+ };
2868
+
2869
+ this.cancelEvent = function (e) {
2870
+ if (e.cancelable) {
2871
+ e.preventDefault();
2872
+ }
2873
+ e.stopImmediatePropagation();
2874
+ if (e.preventManipulation) {
2875
+ e.preventManipulation();
2876
+ } // IE10+
2877
+ return false;
2878
+ };
2879
+
2880
+ }
2881
+ else {
2882
+
2883
+ // inspired from https://gist.github.com/jonathantneal/2415137
2884
+
2885
+ Event.prototype.preventDefault = function () {
2886
+ this.returnValue = false;
2887
+ };
2888
+
2889
+ Event.prototype.stopPropagation = function () {
2890
+ this.cancelBubble = true;
2891
+ };
2892
+
2893
+ _win.constructor.prototype.addEventListener = _doc.constructor.prototype.addEventListener = Element.prototype.addEventListener = function (type, listener, useCapture) {
2894
+ this.attachEvent("on" + type, listener);
2895
+ };
2896
+ _win.constructor.prototype.removeEventListener = _doc.constructor.prototype.removeEventListener = Element.prototype.removeEventListener = function (type, listener, useCapture) {
2897
+ this.detachEvent("on" + type, listener);
2898
+ };
2899
+
2900
+ // Thanks to http://www.switchonthecode.com !!
2901
+ this.cancelEvent = function (e) {
2902
+ e = e || _win.event;
2903
+ if (e) {
2904
+ e.cancelBubble = true;
2905
+ e.cancel = true;
2906
+ e.returnValue = false;
2907
+ }
2908
+ return false;
2909
+ };
2910
+
2911
+ this.stopPropagation = function (e) {
2912
+ e = e || _win.event;
2913
+ if (e) {
2914
+ e.cancelBubble = true;
2915
+ }
2916
+ return false;
2917
+ };
2918
+
2919
+ }
2920
+
2921
+ this.delegate = function (dom, name, fn, bubble, active) {
2922
+
2923
+ var de = delegatevents[name] || false;
2924
+
2925
+ if (! de) {
2926
+
2927
+ de = {
2928
+ a: [],
2929
+ l: [],
2930
+ f: function (e) {
2931
+ var lst = de.l, l = lst.length - 1;
2932
+ var r = false;
2933
+ for (var a = l ; a >= 0 ; a --) {
2934
+ r = lst[a].call(e.target, e);
2935
+ if (r === false) {
2936
+ return false;
2937
+ }
2938
+ }
2939
+ return r;
2940
+ }
2941
+ };
2942
+
2943
+ self.bind(dom, name, de.f, bubble, active);
2944
+
2945
+ delegatevents[name] = de;
2946
+
2947
+ }
2948
+
2949
+ if (self.ispage) {
2950
+ de.a = [self.id].concat(de.a);
2951
+ de.l = [fn].concat(de.l);
2952
+ }
2953
+ else {
2954
+ de.a.push(self.id);
2955
+ de.l.push(fn);
2956
+ }
2957
+
2958
+ };
2959
+
2960
+ this.undelegate = function (dom, name, fn, bubble, active) {
2961
+ var de = delegatevents[name] || false;
2962
+ if (de && de.l) { // quick fix #683
2963
+ for (var a = 0, l = de.l.length ; a < l ; a ++) {
2964
+ if (de.a[a] === self.id) {
2965
+ de.a.splice(a);
2966
+ de.l.splice(a);
2967
+ if (de.a.length === 0) {
2968
+ self._unbind(dom, name, de.l.f);
2969
+ delegatevents[name] = null;
2970
+ }
2971
+ }
2972
+ }
2973
+ }
2974
+ };
2975
+
2976
+ this.bind = function (dom, name, fn, bubble, active) {
2977
+ var el = ("jquery" in dom) ? dom[0] : dom;
2978
+ self._bind(el, name, fn, bubble || false, active || false);
2979
+ };
2980
+
2981
+ this._bind = function (el, name, fn, bubble, active) { // primitive bind
2982
+
2983
+ self.events.push({
2984
+ e: el,
2985
+ n: name,
2986
+ f: fn,
2987
+ b: bubble,
2988
+ q: false
2989
+ });
2990
+
2991
+ (passiveSupported && active) ? el.addEventListener(name, fn, {
2992
+ passive: false,
2993
+ capture: bubble
2994
+ }) : el.addEventListener(name, fn, bubble || false);
2995
+ };
2996
+
2997
+ this._unbind = function (el, name, fn, bub) { // primitive unbind
2998
+ if (delegatevents[name]) {
2999
+ self.undelegate(el, name, fn, bub);
3000
+ }
3001
+ else {
3002
+ el.removeEventListener(name, fn, bub);
3003
+ }
3004
+ };
3005
+
3006
+ this.unbindAll = function () {
3007
+ for (var a = 0 ; a < self.events.length ; a ++) {
3008
+ var r = self.events[a];
3009
+ (r.q) ? r.e.unbind(r.n, r.f) : self._unbind(r.e, r.n, r.f, r.b);
3010
+ }
3011
+ };
3012
+
3013
+ this.showRails = function () {
3014
+ return self.showRail().showRailHr();
3015
+ };
3016
+
3017
+ this.showRail = function () {
3018
+ if ((self.page.maxh !== 0) && (self.ispage || self.win.css('display') != 'none')) {
3019
+ //self.visibility = true;
3020
+ self.rail.visibility = true;
3021
+ self.rail.css('display', 'block');
3022
+ }
3023
+ return self;
3024
+ };
3025
+
3026
+ this.showRailHr = function () {
3027
+ if (self.railh) {
3028
+ if ((self.page.maxw !== 0) && (self.ispage || self.win.css('display') != 'none')) {
3029
+ self.railh.visibility = true;
3030
+ self.railh.css('display', 'block');
3031
+ }
3032
+ }
3033
+ return self;
3034
+ };
3035
+
3036
+ this.hideRails = function () {
3037
+ return self.hideRail().hideRailHr();
3038
+ };
3039
+
3040
+ this.hideRail = function () {
3041
+ //self.visibility = false;
3042
+ self.rail.visibility = false;
3043
+ self.rail.css('display', 'none');
3044
+ return self;
3045
+ };
3046
+
3047
+ this.hideRailHr = function () {
3048
+ if (self.railh) {
3049
+ self.railh.visibility = false;
3050
+ self.railh.css('display', 'none');
3051
+ }
3052
+ return self;
3053
+ };
3054
+
3055
+ this.show = function () {
3056
+ self.hidden = false;
3057
+ self.railslocked = false;
3058
+ return self.showRails();
3059
+ };
3060
+
3061
+ this.hide = function () {
3062
+ self.hidden = true;
3063
+ self.railslocked = true;
3064
+ return self.hideRails();
3065
+ };
3066
+
3067
+ this.toggle = function () {
3068
+ return (self.hidden) ? self.show() : self.hide();
3069
+ };
3070
+
3071
+ this.remove = function () {
3072
+ self.stop();
3073
+ if (self.cursortimeout) {
3074
+ clearTimeout(self.cursortimeout);
3075
+ }
3076
+ for (var n in self.delaylist) if (self.delaylist[n]) {
3077
+ clearAnimationFrame(self.delaylist[n].h);
3078
+ }
3079
+ self.doZoomOut();
3080
+ self.unbindAll();
3081
+
3082
+ if (cap.isie9) {
3083
+ self.win[0].detachEvent("onpropertychange", self.onAttributeChange);
3084
+ } //IE9 DOMAttrModified bug
3085
+
3086
+ if (self.observer !== false) {
3087
+ self.observer.disconnect();
3088
+ }
3089
+ if (self.observerremover !== false) {
3090
+ self.observerremover.disconnect();
3091
+ }
3092
+ if (self.observerbody !== false) {
3093
+ self.observerbody.disconnect();
3094
+ }
3095
+
3096
+ self.events = null;
3097
+
3098
+ if (self.cursor) {
3099
+ self.cursor.remove();
3100
+ }
3101
+ if (self.cursorh) {
3102
+ self.cursorh.remove();
3103
+ }
3104
+ if (self.rail) {
3105
+ self.rail.remove();
3106
+ }
3107
+ if (self.railh) {
3108
+ self.railh.remove();
3109
+ }
3110
+ if (self.zoom) {
3111
+ self.zoom.remove();
3112
+ }
3113
+ for (var a = 0 ; a < self.saved.css.length ; a ++) {
3114
+ var d = self.saved.css[a];
3115
+ d[0].css(d[1], (d[2] === undefined) ? '' : d[2]);
3116
+ }
3117
+ self.saved = false;
3118
+ self.me.data('__nicescroll', ''); //erase all traces
3119
+
3120
+ // memory leak fixed by GianlucaGuarini - thanks a lot!
3121
+ // remove the current nicescroll from the $.nicescroll array & normalize array
3122
+ var lst = $.nicescroll;
3123
+ lst.each(function (i) {
3124
+ if (! this) {
3125
+ return;
3126
+ }
3127
+ if (this.id === self.id) {
3128
+ delete lst[i];
3129
+ for (var b = ++ i ; b < lst.length ; b ++ , i ++) lst[i] = lst[b];
3130
+ lst.length --;
3131
+ if (lst.length) {
3132
+ delete lst[lst.length];
3133
+ }
3134
+ }
3135
+ });
3136
+
3137
+ for (var i in self) {
3138
+ self[i] = null;
3139
+ delete self[i];
3140
+ }
3141
+
3142
+ self = null;
3143
+
3144
+ };
3145
+
3146
+ this.scrollstart = function (fn) {
3147
+ this.onscrollstart = fn;
3148
+ return self;
3149
+ };
3150
+ this.scrollend = function (fn) {
3151
+ this.onscrollend = fn;
3152
+ return self;
3153
+ };
3154
+ this.scrollcancel = function (fn) {
3155
+ this.onscrollcancel = fn;
3156
+ return self;
3157
+ };
3158
+
3159
+ this.zoomin = function (fn) {
3160
+ this.onzoomin = fn;
3161
+ return self;
3162
+ };
3163
+ this.zoomout = function (fn) {
3164
+ this.onzoomout = fn;
3165
+ return self;
3166
+ };
3167
+
3168
+ this.isScrollable = function (e) {
3169
+ var dom = (e.target) ? e.target : e;
3170
+ if (dom.nodeName == 'OPTION') {
3171
+ return true;
3172
+ }
3173
+ while (dom && (dom.nodeType == 1) && (dom !== this.me[0]) && ! (/^BODY|HTML/.test(dom.nodeName))) {
3174
+ var dd = $(dom);
3175
+ var ov = dd.css('overflowY') || dd.css('overflowX') || dd.css('overflow') || '';
3176
+ if (/scroll|auto/.test(ov)) {
3177
+ return (dom.clientHeight != dom.scrollHeight);
3178
+ }
3179
+ dom = (dom.parentNode) ? dom.parentNode : false;
3180
+ }
3181
+ return false;
3182
+ };
3183
+
3184
+ this.getViewport = function (me) {
3185
+ var dom = (me && me.parentNode) ? me.parentNode : false;
3186
+ while (dom && (dom.nodeType == 1) && ! (/^BODY|HTML/.test(dom.nodeName))) {
3187
+ var dd = $(dom);
3188
+ if (/fixed|absolute/.test(dd.css("position"))) {
3189
+ return dd;
3190
+ }
3191
+ var ov = dd.css('overflowY') || dd.css('overflowX') || dd.css('overflow') || '';
3192
+ if ((/scroll|auto/.test(ov)) && (dom.clientHeight != dom.scrollHeight)) {
3193
+ return dd;
3194
+ }
3195
+ if (dd.getNiceScroll().length > 0) {
3196
+ return dd;
3197
+ }
3198
+ dom = (dom.parentNode) ? dom.parentNode : false;
3199
+ }
3200
+ return false;
3201
+ };
3202
+
3203
+ this.triggerScrollStart = function (cx, cy, rx, ry, ms) {
3204
+
3205
+ if (self.onscrollstart) {
3206
+ var info = {
3207
+ type: "scrollstart",
3208
+ current: {
3209
+ x: cx,
3210
+ y: cy
3211
+ },
3212
+ request: {
3213
+ x: rx,
3214
+ y: ry
3215
+ },
3216
+ end: {
3217
+ x: self.newscrollx,
3218
+ y: self.newscrolly
3219
+ },
3220
+ speed: ms
3221
+ };
3222
+ self.onscrollstart.call(self, info);
3223
+ }
3224
+
3225
+ };
3226
+
3227
+ this.triggerScrollEnd = function () {
3228
+ if (self.onscrollend) {
3229
+
3230
+ var px = self.getScrollLeft();
3231
+ var py = self.getScrollTop();
3232
+
3233
+ var info = {
3234
+ type: "scrollend",
3235
+ current: {
3236
+ x: px,
3237
+ y: py
3238
+ },
3239
+ end: {
3240
+ x: px,
3241
+ y: py
3242
+ }
3243
+ };
3244
+
3245
+ self.onscrollend.call(self, info);
3246
+
3247
+ }
3248
+
3249
+ };
3250
+
3251
+ var scrolldiry = 0, scrolldirx = 0, scrolltmr = 0, scrollspd = 1;
3252
+
3253
+ function doScrollRelative (px, py, chkscroll, iswheel) {
3254
+
3255
+ if (! self.scrollrunning) {
3256
+ self.newscrolly = self.getScrollTop();
3257
+ self.newscrollx = self.getScrollLeft();
3258
+ scrolltmr = now();
3259
+ }
3260
+
3261
+ var gap = (now() - scrolltmr);
3262
+ scrolltmr = now();
3263
+
3264
+ if (gap > 350) {
3265
+ scrollspd = 1;
3266
+ }
3267
+ else {
3268
+ scrollspd += (2 - scrollspd) / 10;
3269
+ }
3270
+
3271
+ px = px * scrollspd | 0;
3272
+ py = py * scrollspd | 0;
3273
+
3274
+ if (px) {
3275
+
3276
+ if (iswheel) { // mouse-only
3277
+ if (px < 0) { // fix apple magic mouse swipe back/forward
3278
+ if (self.getScrollLeft() >= self.page.maxw) {
3279
+ return true;
3280
+ }
3281
+ }
3282
+ else {
3283
+ if (self.getScrollLeft() <= 0) {
3284
+ return true;
3285
+ }
3286
+ }
3287
+ }
3288
+
3289
+ var dx = px > 0 ? 1 : - 1;
3290
+
3291
+ if (scrolldirx !== dx) {
3292
+ if (self.scrollmom) {
3293
+ self.scrollmom.stop();
3294
+ }
3295
+ self.newscrollx = self.getScrollLeft();
3296
+ scrolldirx = dx;
3297
+ }
3298
+
3299
+ self.lastdeltax -= px;
3300
+
3301
+ }
3302
+
3303
+ if (py) {
3304
+
3305
+ var chk = (function () {
3306
+ var top = self.getScrollTop();
3307
+ if (py < 0) {
3308
+ if (top >= self.page.maxh) {
3309
+ return true;
3310
+ }
3311
+ }
3312
+ else {
3313
+ if (top <= 0) {
3314
+ return true;
3315
+ }
3316
+ }
3317
+ })();
3318
+
3319
+ if (chk) {
3320
+ if (opt.nativeparentscrolling && chkscroll && ! self.ispage && ! self.zoomactive) {
3321
+ return true;
3322
+ }
3323
+ var ny = self.view.h >> 1;
3324
+ if (self.newscrolly < - ny) {
3325
+ self.newscrolly = - ny;
3326
+ py = - 1;
3327
+ }
3328
+ else if (self.newscrolly > self.page.maxh + ny) {
3329
+ self.newscrolly = self.page.maxh + ny;
3330
+ py = 1;
3331
+ }
3332
+ else {
3333
+ py = 0;
3334
+ }
3335
+ }
3336
+
3337
+ var dy = py > 0 ? 1 : - 1;
3338
+
3339
+ if (scrolldiry !== dy) {
3340
+ if (self.scrollmom) {
3341
+ self.scrollmom.stop();
3342
+ }
3343
+ self.newscrolly = self.getScrollTop();
3344
+ scrolldiry = dy;
3345
+ }
3346
+
3347
+ self.lastdeltay -= py;
3348
+
3349
+ }
3350
+
3351
+ if (py || px) {
3352
+ self.synched("relativexy", function () {
3353
+
3354
+ var dty = self.lastdeltay + self.newscrolly;
3355
+ self.lastdeltay = 0;
3356
+
3357
+ var dtx = self.lastdeltax + self.newscrollx;
3358
+ self.lastdeltax = 0;
3359
+
3360
+ if (! self.rail.drag) {
3361
+ self.doScrollPos(dtx, dty);
3362
+ }
3363
+
3364
+ });
3365
+ }
3366
+
3367
+ }
3368
+
3369
+ var hasparentscrollingphase = false;
3370
+
3371
+ function execScrollWheel (e, hr, chkscroll) {
3372
+ var px, py;
3373
+
3374
+ if (! chkscroll && hasparentscrollingphase) {
3375
+ return true;
3376
+ }
3377
+
3378
+ if (e.deltaMode === 0) { // PIXEL
3379
+ px = - (e.deltaX * (opt.mousescrollstep / (18 * 3))) | 0;
3380
+ py = - (e.deltaY * (opt.mousescrollstep / (18 * 3))) | 0;
3381
+ }
3382
+ else if (e.deltaMode === 1) { // LINE
3383
+ px = - (e.deltaX * opt.mousescrollstep * 50 / 80) | 0;
3384
+ py = - (e.deltaY * opt.mousescrollstep * 50 / 80) | 0;
3385
+ }
3386
+
3387
+ if (hr && opt.oneaxismousemode && (px === 0) && py) { // classic vertical-only mousewheel + browser with x/y support
3388
+ px = py;
3389
+ py = 0;
3390
+
3391
+ if (chkscroll) {
3392
+ var hrend = (px < 0) ? (self.getScrollLeft() >= self.page.maxw) : (self.getScrollLeft() <= 0);
3393
+ if (hrend) { // preserve vertical scrolling
3394
+ py = px;
3395
+ px = 0;
3396
+ }
3397
+ }
3398
+
3399
+ }
3400
+
3401
+ // invert horizontal direction for rtl mode
3402
+ if (self.isrtlmode) {
3403
+ px = - px;
3404
+ }
3405
+
3406
+ var chk = doScrollRelative(px, py, chkscroll, true);
3407
+
3408
+ if (chk) {
3409
+ if (chkscroll) {
3410
+ hasparentscrollingphase = true;
3411
+ }
3412
+ }
3413
+ else {
3414
+ hasparentscrollingphase = false;
3415
+ e.stopImmediatePropagation();
3416
+ return e.preventDefault();
3417
+ }
3418
+
3419
+ }
3420
+
3421
+ this.onmousewheel = function (e) {
3422
+ if (self.wheelprevented || self.locked) {
3423
+ return false;
3424
+ }
3425
+ if (self.railslocked) {
3426
+ self.debounced("checkunlock", self.resize, 250);
3427
+ return false;
3428
+ }
3429
+ if (self.rail.drag) {
3430
+ return self.cancelEvent(e);
3431
+ }
3432
+
3433
+ if (opt.oneaxismousemode === "auto" && e.deltaX !== 0) {
3434
+ opt.oneaxismousemode = false;
3435
+ } // check two-axis mouse support (not very elegant)
3436
+
3437
+ if (opt.oneaxismousemode && e.deltaX === 0) {
3438
+ if (! self.rail.scrollable) {
3439
+ if (self.railh && self.railh.scrollable) {
3440
+ return self.onmousewheelhr(e);
3441
+ }
3442
+ else {
3443
+ return true;
3444
+ }
3445
+ }
3446
+ }
3447
+
3448
+ var nw = now();
3449
+ var chk = false;
3450
+ if (opt.preservenativescrolling && ((self.checkarea + 600) < nw)) {
3451
+ self.nativescrollingarea = self.isScrollable(e);
3452
+ chk = true;
3453
+ }
3454
+ self.checkarea = nw;
3455
+ if (self.nativescrollingarea) {
3456
+ return true;
3457
+ } // this isn't my business
3458
+ var ret = execScrollWheel(e, false, chk);
3459
+ if (ret) {
3460
+ self.checkarea = 0;
3461
+ }
3462
+ return ret;
3463
+ };
3464
+
3465
+ this.onmousewheelhr = function (e) {
3466
+ if (self.wheelprevented) {
3467
+ return;
3468
+ }
3469
+ if (self.railslocked || ! self.railh.scrollable) {
3470
+ return true;
3471
+ }
3472
+ if (self.rail.drag) {
3473
+ return self.cancelEvent(e);
3474
+ }
3475
+
3476
+ var nw = now();
3477
+ var chk = false;
3478
+ if (opt.preservenativescrolling && ((self.checkarea + 600) < nw)) {
3479
+ self.nativescrollingarea = self.isScrollable(e);
3480
+ chk = true;
3481
+ }
3482
+ self.checkarea = nw;
3483
+ if (self.nativescrollingarea) {
3484
+ return true;
3485
+ } // this is not my business
3486
+ if (self.railslocked) {
3487
+ return self.cancelEvent(e);
3488
+ }
3489
+
3490
+ return execScrollWheel(e, true, chk);
3491
+ };
3492
+
3493
+ this.stop = function () {
3494
+ self.cancelScroll();
3495
+ if (self.scrollmon) {
3496
+ self.scrollmon.stop();
3497
+ }
3498
+ self.cursorfreezed = false;
3499
+ self.scroll.y = Math.round(self.getScrollTop() * (1 / self.scrollratio.y));
3500
+ self.noticeCursor();
3501
+ return self;
3502
+ };
3503
+
3504
+ this.getTransitionSpeed = function (dif) {
3505
+
3506
+ return 80 + (dif / 72) * opt.scrollspeed | 0;
3507
+
3508
+ };
3509
+
3510
+ if (! opt.smoothscroll) {
3511
+ this.doScrollLeft = function (x, spd) { //direct
3512
+ var y = self.getScrollTop();
3513
+ self.doScrollPos(x, y, spd);
3514
+ };
3515
+ this.doScrollTop = function (y, spd) { //direct
3516
+ var x = self.getScrollLeft();
3517
+ self.doScrollPos(x, y, spd);
3518
+ };
3519
+ this.doScrollPos = function (x, y, spd) { //direct
3520
+ var nx = (x > self.page.maxw) ? self.page.maxw : x;
3521
+ if (nx < 0) {
3522
+ nx = 0;
3523
+ }
3524
+ var ny = (y > self.page.maxh) ? self.page.maxh : y;
3525
+ if (ny < 0) {
3526
+ ny = 0;
3527
+ }
3528
+ self.synched('scroll', function () {
3529
+ self.setScrollTop(ny);
3530
+ self.setScrollLeft(nx);
3531
+ });
3532
+ };
3533
+ this.cancelScroll = function () {
3534
+ }; // direct
3535
+
3536
+ }
3537
+ else if (self.ishwscroll && cap.hastransition && opt.usetransition && ! ! opt.smoothscroll) {
3538
+
3539
+ var lasttransitionstyle = '';
3540
+
3541
+ this.resetTransition = function () {
3542
+ lasttransitionstyle = '';
3543
+ self.doc.css(cap.prefixstyle + 'transition-duration', '0ms');
3544
+ };
3545
+
3546
+ this.prepareTransition = function (dif, istime) {
3547
+ var ex = (istime) ? dif : self.getTransitionSpeed(dif);
3548
+ var trans = ex + 'ms';
3549
+ if (lasttransitionstyle !== trans) {
3550
+ lasttransitionstyle = trans;
3551
+ self.doc.css(cap.prefixstyle + 'transition-duration', trans);
3552
+ }
3553
+ return ex;
3554
+ };
3555
+
3556
+ this.doScrollLeft = function (x, spd) { //trans
3557
+ var y = (self.scrollrunning) ? self.newscrolly : self.getScrollTop();
3558
+ self.doScrollPos(x, y, spd);
3559
+ };
3560
+
3561
+ this.doScrollTop = function (y, spd) { //trans
3562
+ var x = (self.scrollrunning) ? self.newscrollx : self.getScrollLeft();
3563
+ self.doScrollPos(x, y, spd);
3564
+ };
3565
+
3566
+ this.cursorupdate = {
3567
+ running: false,
3568
+ start: function () {
3569
+ var m = this;
3570
+
3571
+ if (m.running) {
3572
+ return;
3573
+ }
3574
+ m.running = true;
3575
+
3576
+ var loop = function () {
3577
+ if (m.running) {
3578
+ setAnimationFrame(loop);
3579
+ }
3580
+ self.showCursor(self.getScrollTop(), self.getScrollLeft());
3581
+ self.notifyScrollEvent(self.win[0]);
3582
+ };
3583
+
3584
+ setAnimationFrame(loop);
3585
+ },
3586
+ stop: function () {
3587
+ this.running = false;
3588
+ }
3589
+ };
3590
+
3591
+ this.doScrollPos = function (x, y, spd) { //trans
3592
+
3593
+ var py = self.getScrollTop();
3594
+ var px = self.getScrollLeft();
3595
+
3596
+ if (((self.newscrolly - py) * (y - py) < 0) || ((self.newscrollx - px) * (x - px) < 0)) {
3597
+ self.cancelScroll();
3598
+ } //inverted movement detection
3599
+
3600
+ if (! opt.bouncescroll) {
3601
+ if (y < 0) {
3602
+ y = 0;
3603
+ }
3604
+ else if (y > self.page.maxh) {
3605
+ y = self.page.maxh;
3606
+ }
3607
+ if (x < 0) {
3608
+ x = 0;
3609
+ }
3610
+ else if (x > self.page.maxw) {
3611
+ x = self.page.maxw;
3612
+ }
3613
+ }
3614
+ else {
3615
+ if (y < 0) {
3616
+ y = y / 2 | 0;
3617
+ }
3618
+ else if (y > self.page.maxh) {
3619
+ y = self.page.maxh + (y - self.page.maxh) / 2 | 0;
3620
+ }
3621
+ if (x < 0) {
3622
+ x = x / 2 | 0;
3623
+ }
3624
+ else if (x > self.page.maxw) {
3625
+ x = self.page.maxw + (x - self.page.maxw) / 2 | 0;
3626
+ }
3627
+ }
3628
+
3629
+ if (self.scrollrunning && x == self.newscrollx && y == self.newscrolly) {
3630
+ return false;
3631
+ }
3632
+
3633
+ self.newscrolly = y;
3634
+ self.newscrollx = x;
3635
+
3636
+ var top = self.getScrollTop();
3637
+ var lft = self.getScrollLeft();
3638
+
3639
+ var dst = {};
3640
+ dst.x = x - lft;
3641
+ dst.y = y - top;
3642
+
3643
+ var dd = Math.sqrt((dst.x * dst.x) + (dst.y * dst.y)) | 0;
3644
+
3645
+ var ms = self.prepareTransition(dd);
3646
+
3647
+ if (! self.scrollrunning) {
3648
+ self.scrollrunning = true;
3649
+ self.triggerScrollStart(lft, top, x, y, ms);
3650
+ self.cursorupdate.start();
3651
+ }
3652
+
3653
+ self.scrollendtrapped = true;
3654
+
3655
+ if (! cap.transitionend) {
3656
+ if (self.scrollendtrapped) {
3657
+ clearTimeout(self.scrollendtrapped);
3658
+ }
3659
+ self.scrollendtrapped = setTimeout(self.onScrollTransitionEnd, ms); // simulate transitionend event
3660
+ }
3661
+
3662
+ self.setScrollTop(self.newscrolly);
3663
+ self.setScrollLeft(self.newscrollx);
3664
+
3665
+ };
3666
+
3667
+ this.cancelScroll = function () {
3668
+ if (! self.scrollendtrapped) {
3669
+ return true;
3670
+ }
3671
+ var py = self.getScrollTop();
3672
+ var px = self.getScrollLeft();
3673
+ self.scrollrunning = false;
3674
+ if (! cap.transitionend) {
3675
+ clearTimeout(cap.transitionend);
3676
+ }
3677
+ self.scrollendtrapped = false;
3678
+ self.resetTransition();
3679
+ self.setScrollTop(py); // fire event onscroll
3680
+ if (self.railh) {
3681
+ self.setScrollLeft(px);
3682
+ }
3683
+ if (self.timerscroll && self.timerscroll.tm) {
3684
+ clearInterval(self.timerscroll.tm);
3685
+ }
3686
+ self.timerscroll = false;
3687
+
3688
+ self.cursorfreezed = false;
3689
+
3690
+ self.cursorupdate.stop();
3691
+ self.showCursor(py, px);
3692
+ return self;
3693
+ };
3694
+
3695
+ this.onScrollTransitionEnd = function () {
3696
+
3697
+ if (! self.scrollendtrapped) {
3698
+ return;
3699
+ }
3700
+
3701
+ var py = self.getScrollTop();
3702
+ var px = self.getScrollLeft();
3703
+
3704
+ if (py < 0) {
3705
+ py = 0;
3706
+ }
3707
+ else if (py > self.page.maxh) {
3708
+ py = self.page.maxh;
3709
+ }
3710
+ if (px < 0) {
3711
+ px = 0;
3712
+ }
3713
+ else if (px > self.page.maxw) {
3714
+ px = self.page.maxw;
3715
+ }
3716
+ if ((py != self.newscrolly) || (px != self.newscrollx)) {
3717
+ return self.doScrollPos(px, py, opt.snapbackspeed);
3718
+ }
3719
+
3720
+ if (self.scrollrunning) {
3721
+ self.triggerScrollEnd();
3722
+ }
3723
+ self.scrollrunning = false;
3724
+
3725
+ self.scrollendtrapped = false;
3726
+ self.resetTransition();
3727
+ self.timerscroll = false;
3728
+ self.setScrollTop(py); // fire event onscroll
3729
+ if (self.railh) {
3730
+ self.setScrollLeft(px);
3731
+ } // fire event onscroll left
3732
+
3733
+ self.cursorupdate.stop();
3734
+ self.noticeCursor(false, py, px);
3735
+
3736
+ self.cursorfreezed = false;
3737
+
3738
+ };
3739
+
3740
+ }
3741
+ else {
3742
+
3743
+ this.doScrollLeft = function (x, spd) { //no-trans
3744
+ var y = (self.scrollrunning) ? self.newscrolly : self.getScrollTop();
3745
+ self.doScrollPos(x, y, spd);
3746
+ };
3747
+
3748
+ this.doScrollTop = function (y, spd) { //no-trans
3749
+ var x = (self.scrollrunning) ? self.newscrollx : self.getScrollLeft();
3750
+ self.doScrollPos(x, y, spd);
3751
+ };
3752
+
3753
+ this.doScrollPos = function (x, y, spd) { //no-trans
3754
+
3755
+ var py = self.getScrollTop();
3756
+ var px = self.getScrollLeft();
3757
+
3758
+ if (((self.newscrolly - py) * (y - py) < 0) || ((self.newscrollx - px) * (x - px) < 0)) {
3759
+ self.cancelScroll();
3760
+ } //inverted movement detection
3761
+
3762
+ var clipped = false;
3763
+
3764
+ if (! self.bouncescroll || ! self.rail.visibility) {
3765
+ if (y < 0) {
3766
+ y = 0;
3767
+ clipped = true;
3768
+ }
3769
+ else if (y > self.page.maxh) {
3770
+ y = self.page.maxh;
3771
+ clipped = true;
3772
+ }
3773
+ }
3774
+ if (! self.bouncescroll || ! self.railh.visibility) {
3775
+ if (x < 0) {
3776
+ x = 0;
3777
+ clipped = true;
3778
+ }
3779
+ else if (x > self.page.maxw) {
3780
+ x = self.page.maxw;
3781
+ clipped = true;
3782
+ }
3783
+ }
3784
+
3785
+ if (self.scrollrunning && (self.newscrolly === y) && (self.newscrollx === x)) {
3786
+ return true;
3787
+ }
3788
+
3789
+ self.newscrolly = y;
3790
+ self.newscrollx = x;
3791
+
3792
+ self.dst = {};
3793
+ self.dst.x = x - px;
3794
+ self.dst.y = y - py;
3795
+ self.dst.px = px;
3796
+ self.dst.py = py;
3797
+
3798
+ var dd = Math.sqrt((self.dst.x * self.dst.x) + (self.dst.y * self.dst.y)) | 0;
3799
+ var ms = self.getTransitionSpeed(dd);
3800
+
3801
+ self.bzscroll = {};
3802
+
3803
+ var p3 = (clipped) ? 1 : 0.58;
3804
+ self.bzscroll.x = new BezierClass(px, self.newscrollx, ms, 0, 0, p3, 1);
3805
+ self.bzscroll.y = new BezierClass(py, self.newscrolly, ms, 0, 0, p3, 1);
3806
+
3807
+ var loopid = now();
3808
+
3809
+ var loop = function () {
3810
+
3811
+ if (! self.scrollrunning) {
3812
+ return;
3813
+ }
3814
+ var x = self.bzscroll.y.getPos();
3815
+
3816
+ self.setScrollLeft(self.bzscroll.x.getNow());
3817
+ self.setScrollTop(self.bzscroll.y.getNow());
3818
+
3819
+ if (x <= 1) {
3820
+ self.timer = setAnimationFrame(loop);
3821
+ }
3822
+ else {
3823
+ self.scrollrunning = false;
3824
+ self.timer = 0;
3825
+ self.triggerScrollEnd();
3826
+ }
3827
+
3828
+ };
3829
+
3830
+ if (! self.scrollrunning) {
3831
+ self.triggerScrollStart(px, py, x, y, ms);
3832
+ self.scrollrunning = true;
3833
+ self.timer = setAnimationFrame(loop);
3834
+ }
3835
+
3836
+ };
3837
+
3838
+ this.cancelScroll = function () {
3839
+ if (self.timer) {
3840
+ clearAnimationFrame(self.timer);
3841
+ }
3842
+ self.timer = 0;
3843
+ self.bzscroll = false;
3844
+ self.scrollrunning = false;
3845
+ return self;
3846
+ };
3847
+
3848
+ }
3849
+
3850
+ this.doScrollBy = function (stp, relative) {
3851
+ doScrollRelative(0, stp);
3852
+ };
3853
+
3854
+ this.doScrollLeftBy = function (stp, relative) {
3855
+ doScrollRelative(stp, 0);
3856
+ };
3857
+
3858
+ this.doScrollTo = function (pos, relative) {
3859
+ var ny = (relative) ? Math.round(pos * self.scrollratio.y) : pos;
3860
+ if (ny < 0) {
3861
+ ny = 0;
3862
+ }
3863
+ else if (ny > self.page.maxh) {
3864
+ ny = self.page.maxh;
3865
+ }
3866
+ self.cursorfreezed = false;
3867
+ self.doScrollTop(pos);
3868
+ };
3869
+
3870
+ this.checkContentSize = function () {
3871
+ var pg = self.getContentSize();
3872
+ if ((pg.h != self.page.h) || (pg.w != self.page.w)) {
3873
+ self.resize(false, pg);
3874
+ }
3875
+ };
3876
+
3877
+ self.onscroll = function (e) {
3878
+ if (self.rail.drag) {
3879
+ return;
3880
+ }
3881
+ if (! self.cursorfreezed) {
3882
+ self.synched('scroll', function () {
3883
+ self.scroll.y = Math.round(self.getScrollTop() / self.scrollratio.y);
3884
+ if (self.railh) {
3885
+ self.scroll.x = Math.round(self.getScrollLeft() / self.scrollratio.x);
3886
+ }
3887
+ self.noticeCursor();
3888
+ });
3889
+ }
3890
+ };
3891
+ self.bind(self.docscroll, "scroll", self.onscroll);
3892
+
3893
+ this.doZoomIn = function (e) {
3894
+ if (self.zoomactive) {
3895
+ return;
3896
+ }
3897
+ self.zoomactive = true;
3898
+
3899
+ self.zoomrestore = {
3900
+ style: {}
3901
+ };
3902
+ var lst = ['position', 'top', 'left', 'zIndex', 'backgroundColor', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight'];
3903
+ var win = self.win[0].style;
3904
+ for (var a in lst) {
3905
+ var pp = lst[a];
3906
+ self.zoomrestore.style[pp] = (win[pp] !== undefined) ? win[pp] : '';
3907
+ }
3908
+
3909
+ self.zoomrestore.style.width = self.win.css('width');
3910
+ self.zoomrestore.style.height = self.win.css('height');
3911
+
3912
+ self.zoomrestore.padding = {
3913
+ w: self.win.outerWidth() - self.win.width(),
3914
+ h: self.win.outerHeight() - self.win.height()
3915
+ };
3916
+
3917
+ if (cap.isios4) {
3918
+ self.zoomrestore.scrollTop = $window.scrollTop();
3919
+ $window.scrollTop(0);
3920
+ }
3921
+
3922
+ self.win.css({
3923
+ position: (cap.isios4) ? "absolute" : "fixed",
3924
+ top: 0,
3925
+ left: 0,
3926
+ zIndex: globalmaxzindex + 100,
3927
+ margin: 0
3928
+ });
3929
+ var bkg = self.win.css("backgroundColor");
3930
+ if ("" === bkg || /transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(bkg)) {
3931
+ self.win.css("backgroundColor", "#fff");
3932
+ }
3933
+ self.rail.css({
3934
+ zIndex: globalmaxzindex + 101
3935
+ });
3936
+ self.zoom.css({
3937
+ zIndex: globalmaxzindex + 102
3938
+ });
3939
+ self.zoom.css('backgroundPosition', '0 -18px');
3940
+ self.resizeZoom();
3941
+
3942
+ if (self.onzoomin) {
3943
+ self.onzoomin.call(self);
3944
+ }
3945
+
3946
+ return self.cancelEvent(e);
3947
+ };
3948
+
3949
+ this.doZoomOut = function (e) {
3950
+ if (! self.zoomactive) {
3951
+ return;
3952
+ }
3953
+ self.zoomactive = false;
3954
+
3955
+ self.win.css("margin", "");
3956
+ self.win.css(self.zoomrestore.style);
3957
+
3958
+ if (cap.isios4) {
3959
+ $window.scrollTop(self.zoomrestore.scrollTop);
3960
+ }
3961
+
3962
+ self.rail.css({
3963
+ "z-index": self.zindex
3964
+ });
3965
+ self.zoom.css({
3966
+ "z-index": self.zindex
3967
+ });
3968
+ self.zoomrestore = false;
3969
+ self.zoom.css('backgroundPosition', '0 0');
3970
+ self.onResize();
3971
+
3972
+ if (self.onzoomout) {
3973
+ self.onzoomout.call(self);
3974
+ }
3975
+
3976
+ return self.cancelEvent(e);
3977
+ };
3978
+
3979
+ this.doZoom = function (e) {
3980
+ return (self.zoomactive) ? self.doZoomOut(e) : self.doZoomIn(e);
3981
+ };
3982
+
3983
+ this.resizeZoom = function () {
3984
+ if (! self.zoomactive) {
3985
+ return;
3986
+ }
3987
+
3988
+ var py = self.getScrollTop(); //preserve scrolling position
3989
+ self.win.css({
3990
+ width: $window.width() - self.zoomrestore.padding.w + "px",
3991
+ height: $window.height() - self.zoomrestore.padding.h + "px"
3992
+ });
3993
+ self.onResize();
3994
+
3995
+ self.setScrollTop(Math.min(self.page.maxh, py));
3996
+ };
3997
+
3998
+ this.init();
3999
+
4000
+ $.nicescroll.push(this);
4001
+
4002
+ };
4003
+
4004
+ // Inspired by the work of Kin Blas
4005
+ // http://webpro.host.adobe.com/people/jblas/momentum/includes/jquery.momentum.0.7.js
4006
+ var ScrollMomentumClass2D = function (nc) {
4007
+ var self = this;
4008
+ this.nc = nc;
4009
+
4010
+ this.lastx = 0;
4011
+ this.lasty = 0;
4012
+ this.speedx = 0;
4013
+ this.speedy = 0;
4014
+ this.lasttime = 0;
4015
+ this.steptime = 0;
4016
+ this.snapx = false;
4017
+ this.snapy = false;
4018
+ this.demulx = 0;
4019
+ this.demuly = 0;
4020
+
4021
+ this.lastscrollx = - 1;
4022
+ this.lastscrolly = - 1;
4023
+
4024
+ this.chkx = 0;
4025
+ this.chky = 0;
4026
+
4027
+ this.timer = 0;
4028
+
4029
+ this.reset = function (px, py) {
4030
+ self.stop();
4031
+ self.steptime = 0;
4032
+ self.lasttime = now();
4033
+ self.speedx = 0;
4034
+ self.speedy = 0;
4035
+ self.lastx = px;
4036
+ self.lasty = py;
4037
+ self.lastscrollx = - 1;
4038
+ self.lastscrolly = - 1;
4039
+ };
4040
+
4041
+ this.update = function (px, py) {
4042
+ var tm = now();
4043
+ self.steptime = tm - self.lasttime;
4044
+ self.lasttime = tm;
4045
+ var dy = py - self.lasty;
4046
+ var dx = px - self.lastx;
4047
+ var sy = self.nc.getScrollTop();
4048
+ var sx = self.nc.getScrollLeft();
4049
+ var newy = sy + dy;
4050
+ var newx = sx + dx;
4051
+ self.snapx = (newx < 0) || (newx > self.nc.page.maxw);
4052
+ self.snapy = (newy < 0) || (newy > self.nc.page.maxh);
4053
+ self.speedx = dx;
4054
+ self.speedy = dy;
4055
+ self.lastx = px;
4056
+ self.lasty = py;
4057
+ };
4058
+
4059
+ this.stop = function () {
4060
+ self.nc.unsynched("domomentum2d");
4061
+ if (self.timer) {
4062
+ clearTimeout(self.timer);
4063
+ }
4064
+ self.timer = 0;
4065
+ self.lastscrollx = - 1;
4066
+ self.lastscrolly = - 1;
4067
+ };
4068
+
4069
+ this.doSnapy = function (nx, ny) {
4070
+ var snap = false;
4071
+
4072
+ if (ny < 0) {
4073
+ ny = 0;
4074
+ snap = true;
4075
+ }
4076
+ else if (ny > self.nc.page.maxh) {
4077
+ ny = self.nc.page.maxh;
4078
+ snap = true;
4079
+ }
4080
+
4081
+ if (nx < 0) {
4082
+ nx = 0;
4083
+ snap = true;
4084
+ }
4085
+ else if (nx > self.nc.page.maxw) {
4086
+ nx = self.nc.page.maxw;
4087
+ snap = true;
4088
+ }
4089
+
4090
+ (snap) ? self.nc.doScrollPos(nx, ny, self.nc.opt.snapbackspeed) : self.nc.triggerScrollEnd();
4091
+ };
4092
+
4093
+ this.doMomentum = function (gp) {
4094
+ var t = now();
4095
+ var l = (gp) ? t + gp : self.lasttime;
4096
+
4097
+ var sl = self.nc.getScrollLeft();
4098
+ var st = self.nc.getScrollTop();
4099
+
4100
+ var pageh = self.nc.page.maxh;
4101
+ var pagew = self.nc.page.maxw;
4102
+
4103
+ self.speedx = (pagew > 0) ? Math.min(60, self.speedx) : 0;
4104
+ self.speedy = (pageh > 0) ? Math.min(60, self.speedy) : 0;
4105
+
4106
+ var chk = l && (t - l) <= 60;
4107
+
4108
+ if ((st < 0) || (st > pageh) || (sl < 0) || (sl > pagew)) {
4109
+ chk = false;
4110
+ }
4111
+
4112
+ var sy = (self.speedy && chk) ? self.speedy : false;
4113
+ var sx = (self.speedx && chk) ? self.speedx : false;
4114
+
4115
+ if (sy || sx) {
4116
+ var tm = Math.max(16, self.steptime); //timeout granularity
4117
+
4118
+ if (tm > 50) { // do smooth
4119
+ var xm = tm / 50;
4120
+ self.speedx *= xm;
4121
+ self.speedy *= xm;
4122
+ tm = 50;
4123
+ }
4124
+
4125
+ self.demulxy = 0;
4126
+
4127
+ self.lastscrollx = self.nc.getScrollLeft();
4128
+ self.chkx = self.lastscrollx;
4129
+ self.lastscrolly = self.nc.getScrollTop();
4130
+ self.chky = self.lastscrolly;
4131
+
4132
+ var nx = self.lastscrollx;
4133
+ var ny = self.lastscrolly;
4134
+
4135
+ var onscroll = function () {
4136
+ var df = ((now() - t) > 600) ? 0.04 : 0.02;
4137
+
4138
+ if (self.speedx) {
4139
+ nx = Math.floor(self.lastscrollx - (self.speedx * (1 - self.demulxy)));
4140
+ self.lastscrollx = nx;
4141
+ if ((nx < 0) || (nx > pagew)) {
4142
+ df = 0.10;
4143
+ }
4144
+ }
4145
+
4146
+ if (self.speedy) {
4147
+ ny = Math.floor(self.lastscrolly - (self.speedy * (1 - self.demulxy)));
4148
+ self.lastscrolly = ny;
4149
+ if ((ny < 0) || (ny > pageh)) {
4150
+ df = 0.10;
4151
+ }
4152
+ }
4153
+
4154
+ self.demulxy = Math.min(1, self.demulxy + df);
4155
+
4156
+ self.nc.synched("domomentum2d", function () {
4157
+
4158
+ if (self.speedx) {
4159
+ var scx = self.nc.getScrollLeft();
4160
+ // if (scx != self.chkx) self.stop();
4161
+ self.chkx = nx;
4162
+ self.nc.setScrollLeft(nx);
4163
+ }
4164
+
4165
+ if (self.speedy) {
4166
+ var scy = self.nc.getScrollTop();
4167
+ // if (scy != self.chky) self.stop();
4168
+ self.chky = ny;
4169
+ self.nc.setScrollTop(ny);
4170
+ }
4171
+
4172
+ if (! self.timer) {
4173
+ self.nc.hideCursor();
4174
+ self.doSnapy(nx, ny);
4175
+ }
4176
+
4177
+ });
4178
+
4179
+ if (self.demulxy < 1) {
4180
+ self.timer = setTimeout(onscroll, tm);
4181
+ }
4182
+ else {
4183
+ self.stop();
4184
+ self.nc.hideCursor();
4185
+ self.doSnapy(nx, ny);
4186
+ }
4187
+ };
4188
+
4189
+ onscroll();
4190
+
4191
+ }
4192
+ else {
4193
+ self.doSnapy(self.nc.getScrollLeft(), self.nc.getScrollTop());
4194
+ }
4195
+
4196
+ };
4197
+
4198
+ };
4199
+
4200
+
4201
+ // override jQuery scrollTop
4202
+ var _scrollTop = jQuery.fn.scrollTop; // preserve original function
4203
+
4204
+ jQuery.cssHooks.pageYOffset = {
4205
+ get: function (elem, computed, extra) {
4206
+ var nice = $.data(elem, '__nicescroll') || false;
4207
+ return (nice && nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(elem);
4208
+ },
4209
+ set: function (elem, value) {
4210
+ var nice = $.data(elem, '__nicescroll') || false;
4211
+ (nice && nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call(elem, value);
4212
+ return this;
4213
+ }
4214
+ };
4215
+
4216
+ jQuery.fn.scrollTop = function (value) {
4217
+ if (value === undefined) {
4218
+ var nice = (this[0]) ? $.data(this[0], '__nicescroll') || false : false;
4219
+ return (nice && nice.ishwscroll) ? nice.getScrollTop() : _scrollTop.call(this);
4220
+ }
4221
+ else {
4222
+ return this.each(function () {
4223
+ var nice = $.data(this, '__nicescroll') || false;
4224
+ (nice && nice.ishwscroll) ? nice.setScrollTop(parseInt(value)) : _scrollTop.call($(this), value);
4225
+ });
4226
+ }
4227
+ };
4228
+
4229
+ // override jQuery scrollLeft
4230
+ var _scrollLeft = jQuery.fn.scrollLeft; // preserve original function
4231
+
4232
+ $.cssHooks.pageXOffset = {
4233
+ get: function (elem, computed, extra) {
4234
+ var nice = $.data(elem, '__nicescroll') || false;
4235
+ return (nice && nice.ishwscroll) ? nice.getScrollLeft() : _scrollLeft.call(elem);
4236
+ },
4237
+ set: function (elem, value) {
4238
+ var nice = $.data(elem, '__nicescroll') || false;
4239
+ (nice && nice.ishwscroll) ? nice.setScrollLeft(parseInt(value)) : _scrollLeft.call(elem, value);
4240
+ return this;
4241
+ }
4242
+ };
4243
+
4244
+ jQuery.fn.scrollLeft = function (value) {
4245
+ if (value === undefined) {
4246
+ var nice = (this[0]) ? $.data(this[0], '__nicescroll') || false : false;
4247
+ return (nice && nice.ishwscroll) ? nice.getScrollLeft() : _scrollLeft.call(this);
4248
+ }
4249
+ else {
4250
+ return this.each(function () {
4251
+ var nice = $.data(this, '__nicescroll') || false;
4252
+ (nice && nice.ishwscroll) ? nice.setScrollLeft(parseInt(value)) : _scrollLeft.call($(this), value);
4253
+ });
4254
+ }
4255
+ };
4256
+
4257
+ var NiceScrollArray = function (doms) {
4258
+ var self = this;
4259
+ this.length = 0;
4260
+ this.name = "nicescrollarray";
4261
+
4262
+ this.each = function (fn) {
4263
+ $.each(self, fn);
4264
+ return self;
4265
+ };
4266
+
4267
+ this.push = function (nice) {
4268
+ self[self.length] = nice;
4269
+ self.length ++;
4270
+ };
4271
+
4272
+ this.eq = function (idx) {
4273
+ return self[idx];
4274
+ };
4275
+
4276
+ if (doms) {
4277
+ for (var a = 0 ; a < doms.length ; a ++) {
4278
+ var nice = $.data(doms[a], '__nicescroll') || false;
4279
+ if (nice) {
4280
+ this[this.length] = nice;
4281
+ this.length ++;
4282
+ }
4283
+ }
4284
+ }
4285
+
4286
+ return this;
4287
+ };
4288
+
4289
+ function mplex (el, lst, fn) {
4290
+ for (var a = 0, l = lst.length ; a < l ; a ++) fn(el, lst[a]);
4291
+ }
4292
+
4293
+ mplex(
4294
+ NiceScrollArray.prototype, ['show', 'hide', 'toggle', 'onResize', 'resize', 'remove', 'stop', 'doScrollPos'],
4295
+ function (e, n) {
4296
+ e[n] = function () {
4297
+ var args = arguments;
4298
+ return this.each(function () {
4299
+ this[n].apply(this, args);
4300
+ });
4301
+ };
4302
+ }
4303
+ );
4304
+
4305
+ jQuery.fn.getNiceScroll = function (index) {
4306
+ if (index === undefined) {
4307
+ return new NiceScrollArray(this);
4308
+ }
4309
+ else {
4310
+ return this[index] && $.data(this[index], '__nicescroll') || false;
4311
+ }
4312
+ };
4313
+
4314
+ var pseudos = jQuery.expr.pseudos || jQuery.expr[':']; // jQuery 3 migration
4315
+ pseudos.nicescroll = function (a) {
4316
+ return $.data(a, '__nicescroll') !== undefined;
4317
+ };
4318
+
4319
+ $.fn.niceScroll = function (wrapper, _opt) {
4320
+ if (_opt === undefined && typeof wrapper == "object" && ! ("jquery" in wrapper)) {
4321
+ _opt = wrapper;
4322
+ wrapper = false;
4323
+ }
4324
+
4325
+ var ret = new NiceScrollArray();
4326
+
4327
+ this.each(function () {
4328
+ var $this = $(this);
4329
+
4330
+ var opt = $.extend({}, _opt); // cloning
4331
+
4332
+ if (wrapper || false) {
4333
+ var wrp = $(wrapper);
4334
+ opt.doc = (wrp.length > 1) ? $(wrapper, $this) : wrp;
4335
+ opt.win = $this;
4336
+ }
4337
+ var docundef = ! ("doc" in opt);
4338
+ if (! docundef && ! ("win" in opt)) {
4339
+ opt.win = $this;
4340
+ }
4341
+
4342
+ var nice = $this.data('__nicescroll') || false;
4343
+ if (! nice) {
4344
+ opt.doc = opt.doc || $this;
4345
+ nice = new NiceScrollClass(opt, $this);
4346
+ $this.data('__nicescroll', nice);
4347
+ }
4348
+ ret.push(nice);
4349
+ });
4350
+
4351
+ return (ret.length === 1) ? ret[0] : ret;
4352
+ };
4353
+
4354
+ _win.NiceScroll = {
4355
+ getjQuery: function () {
4356
+ return jQuery;
4357
+ }
4358
+ };
4359
+
4360
+ if (! $.nicescroll) {
4361
+ $.nicescroll = new NiceScrollArray();
4362
+ $.nicescroll.options = _globaloptions;
4363
+ }
4364
+
4365
+ }));
vendor/nicescroll/jquery.nicescroll.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* jquery.nicescroll v3.7.6 InuYaksa - MIT - https://nicescroll.areaaperta.com */
2
+ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";var o=!1,t=!1,r=0,i=2e3,s=0,n=e,l=document,a=window,c=n(a),d=[],u=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||!1,h=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.mozCancelAnimationFrame||!1;if(u)a.cancelAnimationFrame||(h=function(e){});else{var p=0;u=function(e,o){var t=(new Date).getTime(),r=Math.max(0,16-(t-p)),i=a.setTimeout(function(){e(t+r)},r);return p=t+r,i},h=function(e){a.clearTimeout(e)}}var m=a.MutationObserver||a.WebKitMutationObserver||!1,f=Date.now||function(){return(new Date).getTime()},g={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var e=l.currentScript||function(){var e=l.getElementsByTagName("script");return!!e.length&&e[e.length-1]}(),o=e?e.src.split("?")[0]:"";return o.split("/").length>0?o.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1},v=!1,w=function(){if(v)return v;var e=l.createElement("DIV"),o=e.style,t=navigator.userAgent,r=navigator.platform,i={};return i.haspointerlock="pointerLockElement"in l||"webkitPointerLockElement"in l||"mozPointerLockElement"in l,i.isopera="opera"in a,i.isopera12=i.isopera&&"getUserMedia"in navigator,i.isoperamini="[object OperaMini]"===Object.prototype.toString.call(a.operamini),i.isie="all"in l&&"attachEvent"in e&&!i.isopera,i.isieold=i.isie&&!("msInterpolationMode"in o),i.isie7=i.isie&&!i.isieold&&(!("documentMode"in l)||7===l.documentMode),i.isie8=i.isie&&"documentMode"in l&&8===l.documentMode,i.isie9=i.isie&&"performance"in a&&9===l.documentMode,i.isie10=i.isie&&"performance"in a&&10===l.documentMode,i.isie11="msRequestFullscreen"in e&&l.documentMode>=11,i.ismsedge="msCredentials"in a,i.ismozilla="MozAppearance"in o,i.iswebkit=!i.ismsedge&&"WebkitAppearance"in o,i.ischrome=i.iswebkit&&"chrome"in a,i.ischrome38=i.ischrome&&"touchAction"in o,i.ischrome22=!i.ischrome38&&i.ischrome&&i.haspointerlock,i.ischrome26=!i.ischrome38&&i.ischrome&&"transition"in o,i.cantouch="ontouchstart"in l.documentElement||"ontouchstart"in a,i.hasw3ctouch=(a.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),i.hasmstouch=!i.hasw3ctouch&&(a.MSPointerEvent||!1),i.ismac=/^mac$/i.test(r),i.isios=i.cantouch&&/iphone|ipad|ipod/i.test(r),i.isios4=i.isios&&!("seal"in Object),i.isios7=i.isios&&"webkitHidden"in l,i.isios8=i.isios&&"hidden"in l,i.isios10=i.isios&&a.Proxy,i.isandroid=/android/i.test(t),i.haseventlistener="addEventListener"in e,i.trstyle=!1,i.hastransform=!1,i.hastranslate3d=!1,i.transitionstyle=!1,i.hastransition=!1,i.transitionend=!1,i.trstyle="transform",i.hastransform="transform"in o||function(){for(var e=["msTransform","webkitTransform","MozTransform","OTransform"],t=0,r=e.length;t<r;t++)if(void 0!==o[e[t]]){i.trstyle=e[t];break}i.hastransform=!!i.trstyle}(),i.hastransform&&(o[i.trstyle]="translate3d(1px,2px,3px)",i.hastranslate3d=/translate3d/.test(o[i.trstyle])),i.transitionstyle="transition",i.prefixstyle="",i.transitionend="transitionend",i.hastransition="transition"in o||function(){i.transitionend=!1;for(var e=["webkitTransition","msTransition","MozTransition","OTransition","OTransition","KhtmlTransition"],t=["-webkit-","-ms-","-moz-","-o-","-o","-khtml-"],r=["webkitTransitionEnd","msTransitionEnd","transitionend","otransitionend","oTransitionEnd","KhtmlTransitionEnd"],s=0,n=e.length;s<n;s++)if(e[s]in o){i.transitionstyle=e[s],i.prefixstyle=t[s],i.transitionend=r[s];break}i.ischrome26&&(i.prefixstyle=t[1]),i.hastransition=i.transitionstyle}(),i.cursorgrabvalue=function(){var e=["grab","-webkit-grab","-moz-grab"];(i.ischrome&&!i.ischrome38||i.isie)&&(e=[]);for(var t=0,r=e.length;t<r;t++){var s=e[t];if(o.cursor=s,o.cursor==s)return s}return"url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize"}(),i.hasmousecapture="setCapture"in e,i.hasMutationObserver=!1!==m,e=null,v=i,i},b=function(e,p){function v(){var e=T.doc.css(P.trstyle);return!(!e||"matrix"!=e.substr(0,6))&&e.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)}function b(){var e=T.win;if("zIndex"in e)return e.zIndex();for(;e.length>0;){if(9==e[0].nodeType)return!1;var o=e.css("zIndex");if(!isNaN(o)&&0!==o)return parseInt(o);e=e.parent()}return!1}function x(e,o,t){var r=e.css(o),i=parseFloat(r);if(isNaN(i)){var s=3==(i=I[r]||0)?t?T.win.outerHeight()-T.win.innerHeight():T.win.outerWidth()-T.win.innerWidth():1;return T.isie8&&i&&(i+=1),s?i:0}return i}function S(e,o,t,r){T._bind(e,o,function(r){var i={original:r=r||a.event,target:r.target||r.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==r.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return r.preventDefault?r.preventDefault():r.returnValue=!1,!1},stopImmediatePropagation:function(){r.stopImmediatePropagation?r.stopImmediatePropagation():r.cancelBubble=!0}};return"mousewheel"==o?(r.wheelDeltaX&&(i.deltaX=-.025*r.wheelDeltaX),r.wheelDeltaY&&(i.deltaY=-.025*r.wheelDeltaY),!i.deltaY&&!i.deltaX&&(i.deltaY=-.025*r.wheelDelta)):i.deltaY=r.detail,t.call(e,i)},r)}function z(e,o,t,r){T.scrollrunning||(T.newscrolly=T.getScrollTop(),T.newscrollx=T.getScrollLeft(),D=f());var i=f()-D;if(D=f(),i>350?A=1:A+=(2-A)/10,e=e*A|0,o=o*A|0,e){if(r)if(e<0){if(T.getScrollLeft()>=T.page.maxw)return!0}else if(T.getScrollLeft()<=0)return!0;var s=e>0?1:-1;X!==s&&(T.scrollmom&&T.scrollmom.stop(),T.newscrollx=T.getScrollLeft(),X=s),T.lastdeltax-=e}if(o){if(function(){var e=T.getScrollTop();if(o<0){if(e>=T.page.maxh)return!0}else if(e<=0)return!0}()){if(M.nativeparentscrolling&&t&&!T.ispage&&!T.zoomactive)return!0;var n=T.view.h>>1;T.newscrolly<-n?(T.newscrolly=-n,o=-1):T.newscrolly>T.page.maxh+n?(T.newscrolly=T.page.maxh+n,o=1):o=0}var l=o>0?1:-1;B!==l&&(T.scrollmom&&T.scrollmom.stop(),T.newscrolly=T.getScrollTop(),B=l),T.lastdeltay-=o}(o||e)&&T.synched("relativexy",function(){var e=T.lastdeltay+T.newscrolly;T.lastdeltay=0;var o=T.lastdeltax+T.newscrollx;T.lastdeltax=0,T.rail.drag||T.doScrollPos(o,e)})}function k(e,o,t){var r,i;return!(t||!q)||(0===e.deltaMode?(r=-e.deltaX*(M.mousescrollstep/54)|0,i=-e.deltaY*(M.mousescrollstep/54)|0):1===e.deltaMode&&(r=-e.deltaX*M.mousescrollstep*50/80|0,i=-e.deltaY*M.mousescrollstep*50/80|0),o&&M.oneaxismousemode&&0===r&&i&&(r=i,i=0,t&&(r<0?T.getScrollLeft()>=T.page.maxw:T.getScrollLeft()<=0)&&(i=r,r=0)),T.isrtlmode&&(r=-r),z(r,i,t,!0)?void(t&&(q=!0)):(q=!1,e.stopImmediatePropagation(),e.preventDefault()))}var T=this;this.version="3.7.6",this.name="nicescroll",this.me=p;var E=n("body"),M=this.opt={doc:E,win:!1};if(n.extend(M,g),M.snapbackspeed=80,e)for(var L in M)void 0!==e[L]&&(M[L]=e[L]);if(M.disablemutationobserver&&(m=!1),this.doc=M.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/^BODY|HTML/.test(M.win?M.win[0].nodeName:this.doc[0].nodeName),this.haswrapper=!1!==M.win,this.win=M.win||(this.ispage?c:this.doc),this.docscroll=this.ispage&&!this.haswrapper?c:this.win,this.body=E,this.viewport=!1,this.isfixed=!1,this.iframe=!1,this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName,this.istextarea="TEXTAREA"==this.win[0].nodeName,this.forcescreen=!1,this.canshowonmouseevent="scroll"!=M.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,"auto"==M.rtlmode){var C=this.win[0]==a?this.body:this.win,N=C.css("writing-mode")||C.css("-webkit-writing-mode")||C.css("-ms-writing-mode")||C.css("-moz-writing-mode");"horizontal-tb"==N||"lr-tb"==N||""===N?(this.isrtlmode="rtl"==C.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==N||"tb"==N||"tb-rl"==N||"rl-tb"==N,this.isvertical="vertical-rl"==N||"tb"==N||"tb-rl"==N)}else this.isrtlmode=!0===M.rtlmode,this.isvertical=!1;if(this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,this.observerbody=!1,!1!==M.scrollbarid)this.id=M.scrollbarid;else do{this.id="ascrail"+i++}while(l.getElementById(this.id));this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=M.overflowx,this.overflowy=M.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=w();var P=n.extend({},this.detected);this.canhwscroll=P.hastransform&&M.hwacceleration,this.ishwscroll=this.canhwscroll&&T.haswrapper,this.isrtlmode?this.isvertical?this.hasreversehr=!(P.iswebkit||P.isie||P.isie11):this.hasreversehr=!(P.iswebkit||P.isie&&!P.isie10&&!P.isie11):this.hasreversehr=!1,this.istouchcapable=!1,P.cantouch||!P.hasw3ctouch&&!P.hasmstouch?!P.cantouch||P.isios||P.isandroid||!P.iswebkit&&!P.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0,M.enablemouselockapi||(P.hasmousecapture=!1,P.haspointerlock=!1),this.debounced=function(e,o,t){T&&(T.delaylist[e]||!1||(T.delaylist[e]={h:u(function(){T.delaylist[e].fn.call(T),T.delaylist[e]=!1},t)},o.call(T)),T.delaylist[e].fn=o)},this.synched=function(e,o){T.synclist[e]?T.synclist[e]=o:(T.synclist[e]=o,u(function(){T&&(T.synclist[e]&&T.synclist[e].call(T),T.synclist[e]=null)}))},this.unsynched=function(e){T.synclist[e]&&(T.synclist[e]=!1)},this.css=function(e,o){for(var t in o)T.saved.css.push([e,t,e.css(t)]),e.css(t,o[t])},this.scrollTop=function(e){return void 0===e?T.getScrollTop():T.setScrollTop(e)},this.scrollLeft=function(e){return void 0===e?T.getScrollLeft():T.setScrollLeft(e)};var R=function(e,o,t,r,i,s,n){this.st=e,this.ed=o,this.spd=t,this.p1=r||0,this.p2=i||1,this.p3=s||0,this.p4=n||1,this.ts=f(),this.df=o-e};if(R.prototype={B2:function(e){return 3*(1-e)*(1-e)*e},B3:function(e){return 3*(1-e)*e*e},B4:function(e){return e*e*e},getPos:function(){return(f()-this.ts)/this.spd},getNow:function(){var e=(f()-this.ts)/this.spd,o=this.B2(e)+this.B3(e)+this.B4(e);return e>=1?this.ed:this.st+this.df*o|0},update:function(e,o){return this.st=this.getNow(),this.ed=e,this.spd=o,this.ts=f(),this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},P.hastranslate3d&&P.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(e){if(!e){var o=v();if(o)return 16==o.length?-o[13]:-o[5];if(T.timerscroll&&T.timerscroll.bz)return T.timerscroll.bz.getNow()}return T.doc.translate.y},this.getScrollLeft=function(e){if(!e){var o=v();if(o)return 16==o.length?-o[12]:-o[4];if(T.timerscroll&&T.timerscroll.bh)return T.timerscroll.bh.getNow()}return T.doc.translate.x},this.notifyScrollEvent=function(e){var o=l.createEvent("UIEvents");o.initUIEvent("scroll",!1,!1,a,1),o.niceevent=!0,e.dispatchEvent(o)};var _=this.isrtlmode?1:-1;P.hastranslate3d&&M.enabletranslate3d?(this.setScrollTop=function(e,o){T.doc.translate.y=e,T.doc.translate.ty=-1*e+"px",T.doc.css(P.trstyle,"translate3d("+T.doc.translate.tx+","+T.doc.translate.ty+",0)"),o||T.notifyScrollEvent(T.win[0])},this.setScrollLeft=function(e,o){T.doc.translate.x=e,T.doc.translate.tx=e*_+"px",T.doc.css(P.trstyle,"translate3d("+T.doc.translate.tx+","+T.doc.translate.ty+",0)"),o||T.notifyScrollEvent(T.win[0])}):(this.setScrollTop=function(e,o){T.doc.translate.y=e,T.doc.translate.ty=-1*e+"px",T.doc.css(P.trstyle,"translate("+T.doc.translate.tx+","+T.doc.translate.ty+")"),o||T.notifyScrollEvent(T.win[0])},this.setScrollLeft=function(e,o){T.doc.translate.x=e,T.doc.translate.tx=e*_+"px",T.doc.css(P.trstyle,"translate("+T.doc.translate.tx+","+T.doc.translate.ty+")"),o||T.notifyScrollEvent(T.win[0])})}else this.getScrollTop=function(){return T.docscroll.scrollTop()},this.setScrollTop=function(e){T.docscroll.scrollTop(e)},this.getScrollLeft=function(){return T.hasreversehr?T.detected.ismozilla?T.page.maxw-Math.abs(T.docscroll.scrollLeft()):T.page.maxw-T.docscroll.scrollLeft():T.docscroll.scrollLeft()},this.setScrollLeft=function(e){return setTimeout(function(){if(T)return T.hasreversehr&&(e=T.detected.ismozilla?-(T.page.maxw-e):T.page.maxw-e),T.docscroll.scrollLeft(e)},1)};this.getTarget=function(e){return!!e&&(e.target?e.target:!!e.srcElement&&e.srcElement)},this.hasParent=function(e,o){if(!e)return!1;for(var t=e.target||e.srcElement||e||!1;t&&t.id!=o;)t=t.parentNode||!1;return!1!==t};var I={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:a.pageYOffset||l.documentElement.scrollTop,left:a.pageXOffset||l.documentElement.scrollLeft}},this.getOffset=function(){if(T.isfixed){var e=T.win.offset(),o=T.getDocumentScrollOffset();return e.top-=o.top,e.left-=o.left,e}var t=T.win.offset();if(!T.viewport)return t;var r=T.viewport.offset();return{top:t.top-r.top,left:t.left-r.left}},this.updateScrollBar=function(e){var o,t;if(T.ishwscroll)T.rail.css({height:T.win.innerHeight()-(M.railpadding.top+M.railpadding.bottom)}),T.railh&&T.railh.css({width:T.win.innerWidth()-(M.railpadding.left+M.railpadding.right)});else{var r=T.getOffset();if(o={top:r.top,left:r.left-(M.railpadding.left+M.railpadding.right)},o.top+=x(T.win,"border-top-width",!0),o.left+=T.rail.align?T.win.outerWidth()-x(T.win,"border-right-width")-T.rail.width:x(T.win,"border-left-width"),(t=M.railoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left)),T.railslocked||T.rail.css({top:o.top,left:o.left,height:(e?e.h:T.win.innerHeight())-(M.railpadding.top+M.railpadding.bottom)}),T.zoom&&T.zoom.css({top:o.top+1,left:1==T.rail.align?o.left-20:o.left+T.rail.width+4}),T.railh&&!T.railslocked){o={top:r.top,left:r.left},(t=M.railhoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left));var i=T.railh.align?o.top+x(T.win,"border-top-width",!0)+T.win.innerHeight()-T.railh.height:o.top+x(T.win,"border-top-width",!0),s=o.left+x(T.win,"border-left-width");T.railh.css({top:i-(M.railpadding.top+M.railpadding.bottom),left:s,width:T.railh.width})}}},this.doRailClick=function(e,o,t){var r,i,s,n;T.railslocked||(T.cancelEvent(e),"pageY"in e||(e.pageX=e.clientX+l.documentElement.scrollLeft,e.pageY=e.clientY+l.documentElement.scrollTop),o?(r=t?T.doScrollLeft:T.doScrollTop,s=t?(e.pageX-T.railh.offset().left-T.cursorwidth/2)*T.scrollratio.x:(e.pageY-T.rail.offset().top-T.cursorheight/2)*T.scrollratio.y,T.unsynched("relativexy"),r(0|s)):(r=t?T.doScrollLeftBy:T.doScrollBy,s=t?T.scroll.x:T.scroll.y,n=t?e.pageX-T.railh.offset().left:e.pageY-T.rail.offset().top,i=t?T.view.w:T.view.h,r(s>=n?i:-i)))},T.newscrolly=T.newscrollx=0,T.hasanimationframe="requestAnimationFrame"in a,T.hascancelanimationframe="cancelAnimationFrame"in a,T.hasborderbox=!1,this.init=function(){if(T.saved.css=[],P.isoperamini)return!0;if(P.isandroid&&!("hidden"in l))return!0;M.emulatetouch=M.emulatetouch||M.touchbehavior,T.hasborderbox=a.getComputedStyle&&"border-box"===a.getComputedStyle(l.body)["box-sizing"];var e={"overflow-y":"hidden"};if((P.isie11||P.isie10)&&(e["-ms-overflow-style"]="none"),T.ishwscroll&&(this.doc.css(P.transitionstyle,P.prefixstyle+"transform 0ms ease-out"),P.transitionend&&T.bind(T.doc,P.transitionend,T.onScrollTransitionEnd,!1)),T.zindex="auto",T.ispage||"auto"!=M.zindex?T.zindex=M.zindex:T.zindex=b()||"auto",!T.ispage&&"auto"!=T.zindex&&T.zindex>s&&(s=T.zindex),T.isie&&0===T.zindex&&"auto"==M.zindex&&(T.zindex="auto"),!T.ispage||!P.isieold){var i=T.docscroll;T.ispage&&(i=T.haswrapper?T.win:T.doc),T.css(i,e),T.ispage&&(P.isie11||P.isie)&&T.css(n("html"),e),!P.isios||T.ispage||T.haswrapper||T.css(E,{"-webkit-overflow-scrolling":"touch"});var d=n(l.createElement("div"));d.css({position:"relative",top:0,float:"right",width:M.cursorwidth,height:0,"background-color":M.cursorcolor,border:M.cursorborder,"background-clip":"padding-box","-webkit-border-radius":M.cursorborderradius,"-moz-border-radius":M.cursorborderradius,"border-radius":M.cursorborderradius}),d.addClass("nicescroll-cursors"),T.cursor=d;var u=n(l.createElement("div"));u.attr("id",T.id),u.addClass("nicescroll-rails nicescroll-rails-vr");var h,p,f=["left","right","top","bottom"];for(var g in f)p=f[g],(h=M.railpadding[p]||0)&&u.css("padding-"+p,h+"px");u.append(d),u.width=Math.max(parseFloat(M.cursorwidth),d.outerWidth()),u.css({width:u.width+"px",zIndex:T.zindex,background:M.background,cursor:"default"}),u.visibility=!0,u.scrollable=!0,u.align="left"==M.railalign?0:1,T.rail=u,T.rail.drag=!1;var v=!1;!M.boxzoom||T.ispage||P.isieold||(v=l.createElement("div"),T.bind(v,"click",T.doZoom),T.bind(v,"mouseenter",function(){T.zoom.css("opacity",M.cursoropacitymax)}),T.bind(v,"mouseleave",function(){T.zoom.css("opacity",M.cursoropacitymin)}),T.zoom=n(v),T.zoom.css({cursor:"pointer",zIndex:T.zindex,backgroundImage:"url("+M.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),M.dblclickzoom&&T.bind(T.win,"dblclick",T.doZoom),P.cantouch&&M.gesturezoom&&(T.ongesturezoom=function(e){return e.scale>1.5&&T.doZoomIn(e),e.scale<.8&&T.doZoomOut(e),T.cancelEvent(e)},T.bind(T.win,"gestureend",T.ongesturezoom))),T.railh=!1;var w;if(M.horizrailenabled&&(T.css(i,{overflowX:"hidden"}),(d=n(l.createElement("div"))).css({position:"absolute",top:0,height:M.cursorwidth,width:0,backgroundColor:M.cursorcolor,border:M.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":M.cursorborderradius,"-moz-border-radius":M.cursorborderradius,"border-radius":M.cursorborderradius}),P.isieold&&d.css("overflow","hidden"),d.addClass("nicescroll-cursors"),T.cursorh=d,(w=n(l.createElement("div"))).attr("id",T.id+"-hr"),w.addClass("nicescroll-rails nicescroll-rails-hr"),w.height=Math.max(parseFloat(M.cursorwidth),d.outerHeight()),w.css({height:w.height+"px",zIndex:T.zindex,background:M.background}),w.append(d),w.visibility=!0,w.scrollable=!0,w.align="top"==M.railvalign?0:1,T.railh=w,T.railh.drag=!1),T.ispage)u.css({position:"fixed",top:0,height:"100%"}),u.css(u.align?{right:0}:{left:0}),T.body.append(u),T.railh&&(w.css({position:"fixed",left:0,width:"100%"}),w.css(w.align?{bottom:0}:{top:0}),T.body.append(w));else{if(T.ishwscroll){"static"==T.win.css("position")&&T.css(T.win,{position:"relative"});var x="HTML"==T.win[0].nodeName?T.body:T.win;n(x).scrollTop(0).scrollLeft(0),T.zoom&&(T.zoom.css({position:"absolute",top:1,right:0,"margin-right":u.width+4}),x.append(T.zoom)),u.css({position:"absolute",top:0}),u.css(u.align?{right:0}:{left:0}),x.append(u),w&&(w.css({position:"absolute",left:0,bottom:0}),w.css(w.align?{bottom:0}:{top:0}),x.append(w))}else{T.isfixed="fixed"==T.win.css("position");var S=T.isfixed?"fixed":"absolute";T.isfixed||(T.viewport=T.getViewport(T.win[0])),T.viewport&&(T.body=T.viewport,/fixed|absolute/.test(T.viewport.css("position"))||T.css(T.viewport,{position:"relative"})),u.css({position:S}),T.zoom&&T.zoom.css({position:S}),T.updateScrollBar(),T.body.append(u),T.zoom&&T.body.append(T.zoom),T.railh&&(w.css({position:S}),T.body.append(w))}P.isios&&T.css(T.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),M.disableoutline&&(P.isie&&T.win.attr("hideFocus","true"),P.iswebkit&&T.win.css("outline","none"))}if(!1===M.autohidemode?(T.autohidedom=!1,T.rail.css({opacity:M.cursoropacitymax}),T.railh&&T.railh.css({opacity:M.cursoropacitymax})):!0===M.autohidemode||"leave"===M.autohidemode?(T.autohidedom=n().add(T.rail),P.isie8&&(T.autohidedom=T.autohidedom.add(T.cursor)),T.railh&&(T.autohidedom=T.autohidedom.add(T.railh)),T.railh&&P.isie8&&(T.autohidedom=T.autohidedom.add(T.cursorh))):"scroll"==M.autohidemode?(T.autohidedom=n().add(T.rail),T.railh&&(T.autohidedom=T.autohidedom.add(T.railh))):"cursor"==M.autohidemode?(T.autohidedom=n().add(T.cursor),T.railh&&(T.autohidedom=T.autohidedom.add(T.cursorh))):"hidden"==M.autohidemode&&(T.autohidedom=!1,T.hide(),T.railslocked=!1),P.cantouch||T.istouchcapable||M.emulatetouch||P.hasmstouch){T.scrollmom=new y(T);T.ontouchstart=function(e){if(T.locked)return!1;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;if(T.hasmoving=!1,T.scrollmom.timer&&(T.triggerScrollEnd(),T.scrollmom.stop()),!T.railslocked){var o=T.getTarget(e);if(o&&/INPUT/i.test(o.nodeName)&&/range/i.test(o.type))return T.stopPropagation(e);var t="mousedown"===e.type;if(!("clientX"in e)&&"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY),T.forcescreen){var r=e;(e={original:e.original?e.original:e}).clientX=r.screenX,e.clientY=r.screenY}if(T.rail.drag={x:e.clientX,y:e.clientY,sx:T.scroll.x,sy:T.scroll.y,st:T.getScrollTop(),sl:T.getScrollLeft(),pt:2,dl:!1,tg:o},T.ispage||!M.directionlockdeadzone)T.rail.drag.dl="f";else{var i={w:c.width(),h:c.height()},s=T.getContentSize(),l=s.h-i.h,a=s.w-i.w;T.rail.scrollable&&!T.railh.scrollable?T.rail.drag.ck=l>0&&"v":!T.rail.scrollable&&T.railh.scrollable?T.rail.drag.ck=a>0&&"h":T.rail.drag.ck=!1}if(M.emulatetouch&&T.isiframe&&P.isie){var d=T.win.position();T.rail.drag.x+=d.left,T.rail.drag.y+=d.top}if(T.hasmoving=!1,T.lastmouseup=!1,T.scrollmom.reset(e.clientX,e.clientY),o&&t){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(o.nodeName))return P.hasmousecapture&&o.setCapture(),M.emulatetouch?(o.onclick&&!o._onclick&&(o._onclick=o.onclick,o.onclick=function(e){if(T.hasmoving)return!1;o._onclick.call(this,e)}),T.cancelEvent(e)):T.stopPropagation(e);/SUBMIT|CANCEL|BUTTON/i.test(n(o).attr("type"))&&(T.preventclick={tg:o,click:!1})}}},T.ontouchend=function(e){if(!T.rail.drag)return!0;if(2==T.rail.drag.pt){if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!1;T.rail.drag=!1;var o="mouseup"===e.type;if(T.hasmoving&&(T.scrollmom.doMomentum(),T.lastmouseup=!0,T.hideCursor(),P.hasmousecapture&&l.releaseCapture(),o))return T.cancelEvent(e)}else if(1==T.rail.drag.pt)return T.onmouseup(e)};var z=M.emulatetouch&&T.isiframe&&!P.hasmousecapture,k=.3*M.directionlockdeadzone|0;T.ontouchmove=function(e,o){if(!T.rail.drag)return!0;if(e.targetTouches&&M.preventmultitouchscrolling&&e.targetTouches.length>1)return!0;if(e.pointerType&&("mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return!0;if(2==T.rail.drag.pt){"changedTouches"in e&&(e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY);var t,r;if(r=t=0,z&&!o){var i=T.win.position();r=-i.left,t=-i.top}var s=e.clientY+t,n=s-T.rail.drag.y,a=e.clientX+r,c=a-T.rail.drag.x,d=T.rail.drag.st-n;if(T.ishwscroll&&M.bouncescroll)d<0?d=Math.round(d/2):d>T.page.maxh&&(d=T.page.maxh+Math.round((d-T.page.maxh)/2));else if(d<0?(d=0,s=0):d>T.page.maxh&&(d=T.page.maxh,s=0),0===s&&!T.hasmoving)return T.ispage||(T.rail.drag=!1),!0;var u=T.getScrollLeft();if(T.railh&&T.railh.scrollable&&(u=T.isrtlmode?c-T.rail.drag.sl:T.rail.drag.sl-c,T.ishwscroll&&M.bouncescroll?u<0?u=Math.round(u/2):u>T.page.maxw&&(u=T.page.maxw+Math.round((u-T.page.maxw)/2)):(u<0&&(u=0,a=0),u>T.page.maxw&&(u=T.page.maxw,a=0))),!T.hasmoving){if(T.rail.drag.y===e.clientY&&T.rail.drag.x===e.clientX)return T.cancelEvent(e);var h=Math.abs(n),p=Math.abs(c),m=M.directionlockdeadzone;if(T.rail.drag.ck?"v"==T.rail.drag.ck?p>m&&h<=k?T.rail.drag=!1:h>m&&(T.rail.drag.dl="v"):"h"==T.rail.drag.ck&&(h>m&&p<=k?T.rail.drag=!1:p>m&&(T.rail.drag.dl="h")):h>m&&p>m?T.rail.drag.dl="f":h>m?T.rail.drag.dl=p>k?"f":"v":p>m&&(T.rail.drag.dl=h>k?"f":"h"),!T.rail.drag.dl)return T.cancelEvent(e);T.triggerScrollStart(e.clientX,e.clientY,0,0,0),T.hasmoving=!0}return T.preventclick&&!T.preventclick.click&&(T.preventclick.click=T.preventclick.tg.onclick||!1,T.preventclick.tg.onclick=T.onpreventclick),T.rail.drag.dl&&("v"==T.rail.drag.dl?u=T.rail.drag.sl:"h"==T.rail.drag.dl&&(d=T.rail.drag.st)),T.synched("touchmove",function(){T.rail.drag&&2==T.rail.drag.pt&&(T.prepareTransition&&T.resetTransition(),T.rail.scrollable&&T.setScrollTop(d),T.scrollmom.update(a,s),T.railh&&T.railh.scrollable?(T.setScrollLeft(u),T.showCursor(d,u)):T.showCursor(d),P.isie10&&l.selection.clear())}),T.cancelEvent(e)}return 1==T.rail.drag.pt?T.onmousemove(e):void 0},T.ontouchstartCursor=function(e,o){if(!T.rail.drag||3==T.rail.drag.pt){if(T.locked)return T.cancelEvent(e);T.cancelScroll(),T.rail.drag={x:e.touches[0].clientX,y:e.touches[0].clientY,sx:T.scroll.x,sy:T.scroll.y,pt:3,hr:!!o};var t=T.getTarget(e);return!T.ispage&&P.hasmousecapture&&t.setCapture(),T.isiframe&&!P.hasmousecapture&&(T.saved.csspointerevents=T.doc.css("pointer-events"),T.css(T.doc,{"pointer-events":"none"})),T.cancelEvent(e)}},T.ontouchendCursor=function(e){if(T.rail.drag){if(P.hasmousecapture&&l.releaseCapture(),T.isiframe&&!P.hasmousecapture&&T.doc.css("pointer-events",T.saved.csspointerevents),3!=T.rail.drag.pt)return;return T.rail.drag=!1,T.cancelEvent(e)}},T.ontouchmoveCursor=function(e){if(T.rail.drag){if(3!=T.rail.drag.pt)return;if(T.cursorfreezed=!0,T.rail.drag.hr){T.scroll.x=T.rail.drag.sx+(e.touches[0].clientX-T.rail.drag.x),T.scroll.x<0&&(T.scroll.x=0);var o=T.scrollvaluemaxw;T.scroll.x>o&&(T.scroll.x=o)}else{T.scroll.y=T.rail.drag.sy+(e.touches[0].clientY-T.rail.drag.y),T.scroll.y<0&&(T.scroll.y=0);var t=T.scrollvaluemax;T.scroll.y>t&&(T.scroll.y=t)}return T.synched("touchmove",function(){T.rail.drag&&3==T.rail.drag.pt&&(T.showCursor(),T.rail.drag.hr?T.doScrollLeft(Math.round(T.scroll.x*T.scrollratio.x),M.cursordragspeed):T.doScrollTop(Math.round(T.scroll.y*T.scrollratio.y),M.cursordragspeed))}),T.cancelEvent(e)}}}if(T.onmousedown=function(e,o){if(!T.rail.drag||1==T.rail.drag.pt){if(T.railslocked)return T.cancelEvent(e);T.cancelScroll(),T.rail.drag={x:e.clientX,y:e.clientY,sx:T.scroll.x,sy:T.scroll.y,pt:1,hr:o||!1};var t=T.getTarget(e);return P.hasmousecapture&&t.setCapture(),T.isiframe&&!P.hasmousecapture&&(T.saved.csspointerevents=T.doc.css("pointer-events"),T.css(T.doc,{"pointer-events":"none"})),T.hasmoving=!1,T.cancelEvent(e)}},T.onmouseup=function(e){if(T.rail.drag)return 1!=T.rail.drag.pt||(P.hasmousecapture&&l.releaseCapture(),T.isiframe&&!P.hasmousecapture&&T.doc.css("pointer-events",T.saved.csspointerevents),T.rail.drag=!1,T.cursorfreezed=!1,T.hasmoving&&T.triggerScrollEnd(),T.cancelEvent(e))},T.onmousemove=function(e){if(T.rail.drag){if(1!==T.rail.drag.pt)return;if(P.ischrome&&0===e.which)return T.onmouseup(e);if(T.cursorfreezed=!0,T.hasmoving||T.triggerScrollStart(e.clientX,e.clientY,0,0,0),T.hasmoving=!0,T.rail.drag.hr){T.scroll.x=T.rail.drag.sx+(e.clientX-T.rail.drag.x),T.scroll.x<0&&(T.scroll.x=0);var o=T.scrollvaluemaxw;T.scroll.x>o&&(T.scroll.x=o)}else{T.scroll.y=T.rail.drag.sy+(e.clientY-T.rail.drag.y),T.scroll.y<0&&(T.scroll.y=0);var t=T.scrollvaluemax;T.scroll.y>t&&(T.scroll.y=t)}return T.synched("mousemove",function(){T.cursorfreezed&&(T.showCursor(),T.rail.drag.hr?T.scrollLeft(Math.round(T.scroll.x*T.scrollratio.x)):T.scrollTop(Math.round(T.scroll.y*T.scrollratio.y)))}),T.cancelEvent(e)}T.checkarea=0},P.cantouch||M.emulatetouch)T.onpreventclick=function(e){if(T.preventclick)return T.preventclick.tg.onclick=T.preventclick.click,T.preventclick=!1,T.cancelEvent(e)},T.onclick=!P.isios&&function(e){return!T.lastmouseup||(T.lastmouseup=!1,T.cancelEvent(e))},M.grabcursorenabled&&P.cursorgrabvalue&&(T.css(T.ispage?T.doc:T.win,{cursor:P.cursorgrabvalue}),T.css(T.rail,{cursor:P.cursorgrabvalue}));else{var L=function(e){if(T.selectiondrag){if(e){var o=T.win.outerHeight(),t=e.pageY-T.selectiondrag.top;t>0&&t<o&&(t=0),t>=o&&(t-=o),T.selectiondrag.df=t}if(0!==T.selectiondrag.df){var r=-2*T.selectiondrag.df/6|0;T.doScrollBy(r),T.debounced("doselectionscroll",function(){L()},50)}}};T.hasTextSelected="getSelection"in l?function(){return l.getSelection().rangeCount>0}:"selection"in l?function(){return"None"!=l.selection.type}:function(){return!1},T.onselectionstart=function(e){T.ispage||(T.selectiondrag=T.win.offset())},T.onselectionend=function(e){T.selectiondrag=!1},T.onselectiondrag=function(e){T.selectiondrag&&T.hasTextSelected()&&T.debounced("selectionscroll",function(){L(e)},250)}}if(P.hasw3ctouch?(T.css(T.ispage?n("html"):T.win,{"touch-action":"none"}),T.css(T.rail,{"touch-action":"none"}),T.css(T.cursor,{"touch-action":"none"}),T.bind(T.win,"pointerdown",T.ontouchstart),T.bind(l,"pointerup",T.ontouchend),T.delegate(l,"pointermove",T.ontouchmove)):P.hasmstouch?(T.css(T.ispage?n("html"):T.win,{"-ms-touch-action":"none"}),T.css(T.rail,{"-ms-touch-action":"none"}),T.css(T.cursor,{"-ms-touch-action":"none"}),T.bind(T.win,"MSPointerDown",T.ontouchstart),T.bind(l,"MSPointerUp",T.ontouchend),T.delegate(l,"MSPointerMove",T.ontouchmove),T.bind(T.cursor,"MSGestureHold",function(e){e.preventDefault()}),T.bind(T.cursor,"contextmenu",function(e){e.preventDefault()})):P.cantouch&&(T.bind(T.win,"touchstart",T.ontouchstart,!1,!0),T.bind(l,"touchend",T.ontouchend,!1,!0),T.bind(l,"touchcancel",T.ontouchend,!1,!0),T.delegate(l,"touchmove",T.ontouchmove,!1,!0)),M.emulatetouch&&(T.bind(T.win,"mousedown",T.ontouchstart,!1,!0),T.bind(l,"mouseup",T.ontouchend,!1,!0),T.bind(l,"mousemove",T.ontouchmove,!1,!0)),(M.cursordragontouch||!P.cantouch&&!M.emulatetouch)&&(T.rail.css({cursor:"default"}),T.railh&&T.railh.css({cursor:"default"}),T.jqbind(T.rail,"mouseenter",function(){if(!T.ispage&&!T.win.is(":visible"))return!1;T.canshowonmouseevent&&T.showCursor(),T.rail.active=!0}),T.jqbind(T.rail,"mouseleave",function(){T.rail.active=!1,T.rail.drag||T.hideCursor()}),M.sensitiverail&&(T.bind(T.rail,"click",function(e){T.doRailClick(e,!1,!1)}),T.bind(T.rail,"dblclick",function(e){T.doRailClick(e,!0,!1)}),T.bind(T.cursor,"click",function(e){T.cancelEvent(e)}),T.bind(T.cursor,"dblclick",function(e){T.cancelEvent(e)})),T.railh&&(T.jqbind(T.railh,"mouseenter",function(){if(!T.ispage&&!T.win.is(":visible"))return!1;T.canshowonmouseevent&&T.showCursor(),T.rail.active=!0}),T.jqbind(T.railh,"mouseleave",function(){T.rail.active=!1,T.rail.drag||T.hideCursor()}),M.sensitiverail&&(T.bind(T.railh,"click",function(e){T.doRailClick(e,!1,!0)}),T.bind(T.railh,"dblclick",function(e){T.doRailClick(e,!0,!0)}),T.bind(T.cursorh,"click",function(e){T.cancelEvent(e)}),T.bind(T.cursorh,"dblclick",function(e){T.cancelEvent(e)})))),M.cursordragontouch&&(this.istouchcapable||P.cantouch)&&(T.bind(T.cursor,"touchstart",T.ontouchstartCursor),T.bind(T.cursor,"touchmove",T.ontouchmoveCursor),T.bind(T.cursor,"touchend",T.ontouchendCursor),T.cursorh&&T.bind(T.cursorh,"touchstart",function(e){T.ontouchstartCursor(e,!0)}),T.cursorh&&T.bind(T.cursorh,"touchmove",T.ontouchmoveCursor),T.cursorh&&T.bind(T.cursorh,"touchend",T.ontouchendCursor)),M.emulatetouch||P.isandroid||P.isios?(T.bind(P.hasmousecapture?T.win:l,"mouseup",T.ontouchend),T.onclick&&T.bind(l,"click",T.onclick),M.cursordragontouch?(T.bind(T.cursor,"mousedown",T.onmousedown),T.bind(T.cursor,"mouseup",T.onmouseup),T.cursorh&&T.bind(T.cursorh,"mousedown",function(e){T.onmousedown(e,!0)}),T.cursorh&&T.bind(T.cursorh,"mouseup",T.onmouseup)):(T.bind(T.rail,"mousedown",function(e){e.preventDefault()}),T.railh&&T.bind(T.railh,"mousedown",function(e){e.preventDefault()}))):(T.bind(P.hasmousecapture?T.win:l,"mouseup",T.onmouseup),T.bind(l,"mousemove",T.onmousemove),T.onclick&&T.bind(l,"click",T.onclick),T.bind(T.cursor,"mousedown",T.onmousedown),T.bind(T.cursor,"mouseup",T.onmouseup),T.railh&&(T.bind(T.cursorh,"mousedown",function(e){T.onmousedown(e,!0)}),T.bind(T.cursorh,"mouseup",T.onmouseup)),!T.ispage&&M.enablescrollonselection&&(T.bind(T.win[0],"mousedown",T.onselectionstart),T.bind(l,"mouseup",T.onselectionend),T.bind(T.cursor,"mouseup",T.onselectionend),T.cursorh&&T.bind(T.cursorh,"mouseup",T.onselectionend),T.bind(l,"mousemove",T.onselectiondrag)),T.zoom&&(T.jqbind(T.zoom,"mouseenter",function(){T.canshowonmouseevent&&T.showCursor(),T.rail.active=!0}),T.jqbind(T.zoom,"mouseleave",function(){T.rail.active=!1,T.rail.drag||T.hideCursor()}))),M.enablemousewheel&&(T.isiframe||T.mousewheel(P.isie&&T.ispage?l:T.win,T.onmousewheel),T.mousewheel(T.rail,T.onmousewheel),T.railh&&T.mousewheel(T.railh,T.onmousewheelhr)),T.ispage||P.cantouch||/HTML|^BODY/.test(T.win[0].nodeName)||(T.win.attr("tabindex")||T.win.attr({tabindex:++r}),T.bind(T.win,"focus",function(e){o=T.getTarget(e).id||T.getTarget(e)||!1,T.hasfocus=!0,T.canshowonmouseevent&&T.noticeCursor()}),T.bind(T.win,"blur",function(e){o=!1,T.hasfocus=!1}),T.bind(T.win,"mouseenter",function(e){t=T.getTarget(e).id||T.getTarget(e)||!1,T.hasmousefocus=!0,T.canshowonmouseevent&&T.noticeCursor()}),T.bind(T.win,"mouseleave",function(e){t=!1,T.hasmousefocus=!1,T.rail.drag||T.hideCursor()})),T.onkeypress=function(e){if(T.railslocked&&0===T.page.maxh)return!0;e=e||a.event;var r=T.getTarget(e);if(r&&/INPUT|TEXTAREA|SELECT|OPTION/.test(r.nodeName)&&(!(r.getAttribute("type")||r.type||!1)||!/submit|button|cancel/i.tp))return!0;if(n(r).attr("contenteditable"))return!0;if(T.hasfocus||T.hasmousefocus&&!o||T.ispage&&!o&&!t){var i=e.keyCode;if(T.railslocked&&27!=i)return T.cancelEvent(e);var s=e.ctrlKey||!1,l=e.shiftKey||!1,c=!1;switch(i){case 38:case 63233:T.doScrollBy(72),c=!0;break;case 40:case 63235:T.doScrollBy(-72),c=!0;break;case 37:case 63232:T.railh&&(s?T.doScrollLeft(0):T.doScrollLeftBy(72),c=!0);break;case 39:case 63234:T.railh&&(s?T.doScrollLeft(T.page.maxw):T.doScrollLeftBy(-72),c=!0);break;case 33:case 63276:T.doScrollBy(T.view.h),c=!0;break;case 34:case 63277:T.doScrollBy(-T.view.h),c=!0;break;case 36:case 63273:T.railh&&s?T.doScrollPos(0,0):T.doScrollTo(0),c=!0;break;case 35:case 63275:T.railh&&s?T.doScrollPos(T.page.maxw,T.page.maxh):T.doScrollTo(T.page.maxh),c=!0;break;case 32:M.spacebarenabled&&(l?T.doScrollBy(T.view.h):T.doScrollBy(-T.view.h),c=!0);break;case 27:T.zoomactive&&(T.doZoom(),c=!0)}if(c)return T.cancelEvent(e)}},M.enablekeyboard&&T.bind(l,P.isopera&&!P.isopera12?"keypress":"keydown",T.onkeypress),T.bind(l,"keydown",function(e){(e.ctrlKey||!1)&&(T.wheelprevented=!0)}),T.bind(l,"keyup",function(e){e.ctrlKey||!1||(T.wheelprevented=!1)}),T.bind(a,"blur",function(e){T.wheelprevented=!1}),T.bind(a,"resize",T.onscreenresize),T.bind(a,"orientationchange",T.onscreenresize),T.bind(a,"load",T.lazyResize),P.ischrome&&!T.ispage&&!T.haswrapper){var C=T.win.attr("style"),N=parseFloat(T.win.css("width"))+1;T.win.css("width",N),T.synched("chromefix",function(){T.win.attr("style",C)})}if(T.onAttributeChange=function(e){T.lazyResize(T.isieold?250:30)},M.enableobserver&&(T.isie11||!1===m||(T.observerbody=new m(function(e){if(e.forEach(function(e){if("attributes"==e.type)return E.hasClass("modal-open")&&E.hasClass("modal-dialog")&&!n.contains(n(".modal-dialog")[0],T.doc[0])?T.hide():T.show()}),T.me.clientWidth!=T.page.width||T.me.clientHeight!=T.page.height)return T.lazyResize(30)}),T.observerbody.observe(l.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!T.ispage&&!T.haswrapper)){var R=T.win[0];!1!==m?(T.observer=new m(function(e){e.forEach(T.onAttributeChange)}),T.observer.observe(R,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),T.observerremover=new m(function(e){e.forEach(function(e){if(e.removedNodes.length>0)for(var o in e.removedNodes)if(T&&e.removedNodes[o]===R)return T.remove()})}),T.observerremover.observe(R.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(T.bind(R,P.isie&&!P.isie9?"propertychange":"DOMAttrModified",T.onAttributeChange),P.isie9&&R.attachEvent("onpropertychange",T.onAttributeChange),T.bind(R,"DOMNodeRemoved",function(e){e.target===R&&T.remove()}))}!T.ispage&&M.boxzoom&&T.bind(a,"resize",T.resizeZoom),T.istextarea&&(T.bind(T.win,"keydown",T.lazyResize),T.bind(T.win,"mouseup",T.lazyResize)),T.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var _=function(){T.iframexd=!1;var o;try{(o="contentDocument"in this?this.contentDocument:this.contentWindow._doc).domain}catch(e){T.iframexd=!0,o=!1}if(T.iframexd)return"console"in a&&console.log("NiceScroll error: policy restriced iframe"),!0;if(T.forcescreen=!0,T.isiframe&&(T.iframe={doc:n(o),html:T.doc.contents().find("html")[0],body:T.doc.contents().find("body")[0]},T.getContentSize=function(){return{w:Math.max(T.iframe.html.scrollWidth,T.iframe.body.scrollWidth),h:Math.max(T.iframe.html.scrollHeight,T.iframe.body.scrollHeight)}},T.docscroll=n(T.iframe.body)),!P.isios&&M.iframeautoresize&&!T.isiframe){T.win.scrollTop(0),T.doc.height("");var t=Math.max(o.getElementsByTagName("html")[0].scrollHeight,o.body.scrollHeight);T.doc.height(t)}T.lazyResize(30),T.css(n(T.iframe.body),e),P.isios&&T.haswrapper&&T.css(n(o.body),{"-webkit-transform":"translate3d(0,0,0)"}),"contentWindow"in this?T.bind(this.contentWindow,"scroll",T.onscroll):T.bind(o,"scroll",T.onscroll),M.enablemousewheel&&T.mousewheel(o,T.onmousewheel),M.enablekeyboard&&T.bind(o,P.isopera?"keypress":"keydown",T.onkeypress),P.cantouch?(T.bind(o,"touchstart",T.ontouchstart),T.bind(o,"touchmove",T.ontouchmove)):M.emulatetouch&&(T.bind(o,"mousedown",T.ontouchstart),T.bind(o,"mousemove",function(e){return T.ontouchmove(e,!0)}),M.grabcursorenabled&&P.cursorgrabvalue&&T.css(n(o.body),{cursor:P.cursorgrabvalue})),T.bind(o,"mouseup",T.ontouchend),T.zoom&&(M.dblclickzoom&&T.bind(o,"dblclick",T.doZoom),T.ongesturezoom&&T.bind(o,"gestureend",T.ongesturezoom))};this.doc[0].readyState&&"complete"===this.doc[0].readyState&&setTimeout(function(){_.call(T.doc[0],!1)},500),T.bind(this.doc,"load",_)}},this.showCursor=function(e,o){if(T.cursortimeout&&(clearTimeout(T.cursortimeout),T.cursortimeout=0),T.rail){if(T.autohidedom&&(T.autohidedom.stop().css({opacity:M.cursoropacitymax}),T.cursoractive=!0),T.rail.drag&&1==T.rail.drag.pt||(void 0!==e&&!1!==e&&(T.scroll.y=e/T.scrollratio.y|0),void 0!==o&&(T.scroll.x=o/T.scrollratio.x|0)),T.cursor.css({height:T.cursorheight,top:T.scroll.y}),T.cursorh){var t=T.hasreversehr?T.scrollvaluemaxw-T.scroll.x:T.scroll.x;T.cursorh.css({width:T.cursorwidth,left:!T.rail.align&&T.rail.visibility?t+T.rail.width:t}),T.cursoractive=!0}T.zoom&&T.zoom.stop().css({opacity:M.cursoropacitymax})}},this.hideCursor=function(e){T.cursortimeout||T.rail&&T.autohidedom&&(T.hasmousefocus&&"leave"===M.autohidemode||(T.cursortimeout=setTimeout(function(){T.rail.active&&T.showonmouseevent||(T.autohidedom.stop().animate({opacity:M.cursoropacitymin}),T.zoom&&T.zoom.stop().animate({opacity:M.cursoropacitymin}),T.cursoractive=!1),T.cursortimeout=0},e||M.hidecursordelay)))},this.noticeCursor=function(e,o,t){T.showCursor(o,t),T.rail.active||T.hideCursor(e)},this.getContentSize=T.ispage?function(){return{w:Math.max(l.body.scrollWidth,l.documentElement.scrollWidth),h:Math.max(l.body.scrollHeight,l.documentElement.scrollHeight)}}:T.haswrapper?function(){return{w:T.doc[0].offsetWidth,h:T.doc[0].offsetHeight}}:function(){return{w:T.docscroll[0].scrollWidth,h:T.docscroll[0].scrollHeight}},this.onResize=function(e,o){if(!T||!T.win)return!1;var t=T.page.maxh,r=T.page.maxw,i=T.view.h,s=T.view.w;if(T.view={w:T.ispage?T.win.width():T.win[0].clientWidth,h:T.ispage?T.win.height():T.win[0].clientHeight},T.page=o||T.getContentSize(),T.page.maxh=Math.max(0,T.page.h-T.view.h),T.page.maxw=Math.max(0,T.page.w-T.view.w),T.page.maxh==t&&T.page.maxw==r&&T.view.w==s&&T.view.h==i){if(T.ispage)return T;var n=T.win.offset();if(T.lastposition){var l=T.lastposition;if(l.top==n.top&&l.left==n.left)return T}T.lastposition=n}return 0===T.page.maxh?(T.hideRail(),T.scrollvaluemax=0,T.scroll.y=0,T.scrollratio.y=0,T.cursorheight=0,T.setScrollTop(0),T.rail&&(T.rail.scrollable=!1)):(T.page.maxh-=M.railpadding.top+M.railpadding.bottom,T.rail.scrollable=!0),0===T.page.maxw?(T.hideRailHr(),T.scrollvaluemaxw=0,T.scroll.x=0,T.scrollratio.x=0,T.cursorwidth=0,T.setScrollLeft(0),T.railh&&(T.railh.scrollable=!1)):(T.page.maxw-=M.railpadding.left+M.railpadding.right,T.railh&&(T.railh.scrollable=M.horizrailenabled)),T.railslocked=T.locked||0===T.page.maxh&&0===T.page.maxw,T.railslocked?(T.ispage||T.updateScrollBar(T.view),!1):(T.hidden||(T.rail.visibility||T.showRail(),T.railh&&!T.railh.visibility&&T.showRailHr()),T.istextarea&&T.win.css("resize")&&"none"!=T.win.css("resize")&&(T.view.h-=20),T.cursorheight=Math.min(T.view.h,Math.round(T.view.h*(T.view.h/T.page.h))),T.cursorheight=M.cursorfixedheight?M.cursorfixedheight:Math.max(M.cursorminheight,T.cursorheight),T.cursorwidth=Math.min(T.view.w,Math.round(T.view.w*(T.view.w/T.page.w))),T.cursorwidth=M.cursorfixedheight?M.cursorfixedheight:Math.max(M.cursorminheight,T.cursorwidth),T.scrollvaluemax=T.view.h-T.cursorheight-(M.railpadding.top+M.railpadding.bottom),T.hasborderbox||(T.scrollvaluemax-=T.cursor[0].offsetHeight-T.cursor[0].clientHeight),T.railh&&(T.railh.width=T.page.maxh>0?T.view.w-T.rail.width:T.view.w,T.scrollvaluemaxw=T.railh.width-T.cursorwidth-(M.railpadding.left+M.railpadding.right)),T.ispage||T.updateScrollBar(T.view),T.scrollratio={x:T.page.maxw/T.scrollvaluemaxw,y:T.page.maxh/T.scrollvaluemax},T.getScrollTop()>T.page.maxh?T.doScrollTop(T.page.maxh):(T.scroll.y=T.getScrollTop()/T.scrollratio.y|0,T.scroll.x=T.getScrollLeft()/T.scrollratio.x|0,T.cursoractive&&T.noticeCursor()),T.scroll.y&&0===T.getScrollTop()&&T.doScrollTo(T.scroll.y*T.scrollratio.y|0),T)},this.resize=T.onResize;var O=0;this.onscreenresize=function(e){clearTimeout(O);var o=!T.ispage&&!T.haswrapper;o&&T.hideRails(),O=setTimeout(function(){T&&(o&&T.showRails(),T.resize()),O=0},120)},this.lazyResize=function(e){return clearTimeout(O),e=isNaN(e)?240:e,O=setTimeout(function(){T&&T.resize(),O=0},e),T},this.jqbind=function(e,o,t){T.events.push({e:e,n:o,f:t,q:!0}),n(e).on(o,t)},this.mousewheel=function(e,o,t){var r="jquery"in e?e[0]:e;if("onwheel"in l.createElement("div"))T._bind(r,"wheel",o,t||!1);else{var i=void 0!==l.onmousewheel?"mousewheel":"DOMMouseScroll";S(r,i,o,t||!1),"DOMMouseScroll"==i&&S(r,"MozMousePixelScroll",o,t||!1)}};var Y=!1;if(P.haseventlistener){try{var H=Object.defineProperty({},"passive",{get:function(){Y=!0}});a.addEventListener("test",null,H)}catch(e){}this.stopPropagation=function(e){return!!e&&((e=e.original?e.original:e).stopPropagation(),!1)},this.cancelEvent=function(e){return e.cancelable&&e.preventDefault(),e.stopImmediatePropagation(),e.preventManipulation&&e.preventManipulation(),!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},a.constructor.prototype.addEventListener=l.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(e,o,t){this.attachEvent("on"+e,o)},a.constructor.prototype.removeEventListener=l.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(e,o,t){this.detachEvent("on"+e,o)},this.cancelEvent=function(e){return(e=e||a.event)&&(e.cancelBubble=!0,e.cancel=!0,e.returnValue=!1),!1},this.stopPropagation=function(e){return(e=e||a.event)&&(e.cancelBubble=!0),!1};this.delegate=function(e,o,t,r,i){var s=d[o]||!1;s||(s={a:[],l:[],f:function(e){for(var o=s.l,t=!1,r=o.length-1;r>=0;r--)if(!1===(t=o[r].call(e.target,e)))return!1;return t}},T.bind(e,o,s.f,r,i),d[o]=s),T.ispage?(s.a=[T.id].concat(s.a),s.l=[t].concat(s.l)):(s.a.push(T.id),s.l.push(t))},this.undelegate=function(e,o,t,r,i){var s=d[o]||!1;if(s&&s.l)for(var n=0,l=s.l.length;n<l;n++)s.a[n]===T.id&&(s.a.splice(n),s.l.splice(n),0===s.a.length&&(T._unbind(e,o,s.l.f),d[o]=null))},this.bind=function(e,o,t,r,i){var s="jquery"in e?e[0]:e;T._bind(s,o,t,r||!1,i||!1)},this._bind=function(e,o,t,r,i){T.events.push({e:e,n:o,f:t,b:r,q:!1}),Y&&i?e.addEventListener(o,t,{passive:!1,capture:r}):e.addEventListener(o,t,r||!1)},this._unbind=function(e,o,t,r){d[o]?T.undelegate(e,o,t,r):e.removeEventListener(o,t,r)},this.unbindAll=function(){for(var e=0;e<T.events.length;e++){var o=T.events[e];o.q?o.e.unbind(o.n,o.f):T._unbind(o.e,o.n,o.f,o.b)}},this.showRails=function(){return T.showRail().showRailHr()},this.showRail=function(){return 0===T.page.maxh||!T.ispage&&"none"==T.win.css("display")||(T.rail.visibility=!0,T.rail.css("display","block")),T},this.showRailHr=function(){return T.railh&&(0===T.page.maxw||!T.ispage&&"none"==T.win.css("display")||(T.railh.visibility=!0,T.railh.css("display","block"))),T},this.hideRails=function(){return T.hideRail().hideRailHr()},this.hideRail=function(){return T.rail.visibility=!1,T.rail.css("display","none"),T},this.hideRailHr=function(){return T.railh&&(T.railh.visibility=!1,T.railh.css("display","none")),T},this.show=function(){return T.hidden=!1,T.railslocked=!1,T.showRails()},this.hide=function(){return T.hidden=!0,T.railslocked=!0,T.hideRails()},this.toggle=function(){return T.hidden?T.show():T.hide()},this.remove=function(){T.stop(),T.cursortimeout&&clearTimeout(T.cursortimeout);for(var e in T.delaylist)T.delaylist[e]&&h(T.delaylist[e].h);T.doZoomOut(),T.unbindAll(),P.isie9&&T.win[0].detachEvent("onpropertychange",T.onAttributeChange),!1!==T.observer&&T.observer.disconnect(),!1!==T.observerremover&&T.observerremover.disconnect(),!1!==T.observerbody&&T.observerbody.disconnect(),T.events=null,T.cursor&&T.cursor.remove(),T.cursorh&&T.cursorh.remove(),T.rail&&T.rail.remove(),T.railh&&T.railh.remove(),T.zoom&&T.zoom.remove();for(var o=0;o<T.saved.css.length;o++){var t=T.saved.css[o];t[0].css(t[1],void 0===t[2]?"":t[2])}T.saved=!1,T.me.data("__nicescroll","");var r=n.nicescroll;r.each(function(e){if(this&&this.id===T.id){delete r[e];for(var o=++e;o<r.length;o++,e++)r[e]=r[o];--r.length&&delete r[r.length]}});for(var i in T)T[i]=null,delete T[i];T=null},this.scrollstart=function(e){return this.onscrollstart=e,T},this.scrollend=function(e){return this.onscrollend=e,T},this.scrollcancel=function(e){return this.onscrollcancel=e,T},this.zoomin=function(e){return this.onzoomin=e,T},this.zoomout=function(e){return this.onzoomout=e,T},this.isScrollable=function(e){var o=e.target?e.target:e;if("OPTION"==o.nodeName)return!0;for(;o&&1==o.nodeType&&o!==this.me[0]&&!/^BODY|HTML/.test(o.nodeName);){var t=n(o),r=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(r))return o.clientHeight!=o.scrollHeight;o=!!o.parentNode&&o.parentNode}return!1},this.getViewport=function(e){for(var o=!(!e||!e.parentNode)&&e.parentNode;o&&1==o.nodeType&&!/^BODY|HTML/.test(o.nodeName);){var t=n(o);if(/fixed|absolute/.test(t.css("position")))return t;var r=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(r)&&o.clientHeight!=o.scrollHeight)return t;if(t.getNiceScroll().length>0)return t;o=!!o.parentNode&&o.parentNode}return!1},this.triggerScrollStart=function(e,o,t,r,i){if(T.onscrollstart){var s={type:"scrollstart",current:{x:e,y:o},request:{x:t,y:r},end:{x:T.newscrollx,y:T.newscrolly},speed:i};T.onscrollstart.call(T,s)}},this.triggerScrollEnd=function(){if(T.onscrollend){var e=T.getScrollLeft(),o=T.getScrollTop(),t={type:"scrollend",current:{x:e,y:o},end:{x:e,y:o}};T.onscrollend.call(T,t)}};var B=0,X=0,D=0,A=1,q=!1;if(this.onmousewheel=function(e){if(T.wheelprevented||T.locked)return!1;if(T.railslocked)return T.debounced("checkunlock",T.resize,250),!1;if(T.rail.drag)return T.cancelEvent(e);if("auto"===M.oneaxismousemode&&0!==e.deltaX&&(M.oneaxismousemode=!1),M.oneaxismousemode&&0===e.deltaX&&!T.rail.scrollable)return!T.railh||!T.railh.scrollable||T.onmousewheelhr(e);var o=f(),t=!1;if(M.preservenativescrolling&&T.checkarea+600<o&&(T.nativescrollingarea=T.isScrollable(e),t=!0),T.checkarea=o,T.nativescrollingarea)return!0;var r=k(e,!1,t);return r&&(T.checkarea=0),r},this.onmousewheelhr=function(e){if(!T.wheelprevented){if(T.railslocked||!T.railh.scrollable)return!0;if(T.rail.drag)return T.cancelEvent(e);var o=f(),t=!1;return M.preservenativescrolling&&T.checkarea+600<o&&(T.nativescrollingarea=T.isScrollable(e),t=!0),T.checkarea=o,!!T.nativescrollingarea||(T.railslocked?T.cancelEvent(e):k(e,!0,t))}},this.stop=function(){return T.cancelScroll(),T.scrollmon&&T.scrollmon.stop(),T.cursorfreezed=!1,T.scroll.y=Math.round(T.getScrollTop()*(1/T.scrollratio.y)),T.noticeCursor(),T},this.getTransitionSpeed=function(e){return 80+e/72*M.scrollspeed|0},M.smoothscroll)if(T.ishwscroll&&P.hastransition&&M.usetransition&&M.smoothscroll){var j="";this.resetTransition=function(){j="",T.doc.css(P.prefixstyle+"transition-duration","0ms")},this.prepareTransition=function(e,o){var t=o?e:T.getTransitionSpeed(e),r=t+"ms";return j!==r&&(j=r,T.doc.css(P.prefixstyle+"transition-duration",r)),t},this.doScrollLeft=function(e,o){var t=T.scrollrunning?T.newscrolly:T.getScrollTop();T.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=T.scrollrunning?T.newscrollx:T.getScrollLeft();T.doScrollPos(t,e,o)},this.cursorupdate={running:!1,start:function(){var e=this;if(!e.running){e.running=!0;var o=function(){e.running&&u(o),T.showCursor(T.getScrollTop(),T.getScrollLeft()),T.notifyScrollEvent(T.win[0])};u(o)}},stop:function(){this.running=!1}},this.doScrollPos=function(e,o,t){var r=T.getScrollTop(),i=T.getScrollLeft();if(((T.newscrolly-r)*(o-r)<0||(T.newscrollx-i)*(e-i)<0)&&T.cancelScroll(),M.bouncescroll?(o<0?o=o/2|0:o>T.page.maxh&&(o=T.page.maxh+(o-T.page.maxh)/2|0),e<0?e=e/2|0:e>T.page.maxw&&(e=T.page.maxw+(e-T.page.maxw)/2|0)):(o<0?o=0:o>T.page.maxh&&(o=T.page.maxh),e<0?e=0:e>T.page.maxw&&(e=T.page.maxw)),T.scrollrunning&&e==T.newscrollx&&o==T.newscrolly)return!1;T.newscrolly=o,T.newscrollx=e;var s=T.getScrollTop(),n=T.getScrollLeft(),l={};l.x=e-n,l.y=o-s;var a=0|Math.sqrt(l.x*l.x+l.y*l.y),c=T.prepareTransition(a);T.scrollrunning||(T.scrollrunning=!0,T.triggerScrollStart(n,s,e,o,c),T.cursorupdate.start()),T.scrollendtrapped=!0,P.transitionend||(T.scrollendtrapped&&clearTimeout(T.scrollendtrapped),T.scrollendtrapped=setTimeout(T.onScrollTransitionEnd,c)),T.setScrollTop(T.newscrolly),T.setScrollLeft(T.newscrollx)},this.cancelScroll=function(){if(!T.scrollendtrapped)return!0;var e=T.getScrollTop(),o=T.getScrollLeft();return T.scrollrunning=!1,P.transitionend||clearTimeout(P.transitionend),T.scrollendtrapped=!1,T.resetTransition(),T.setScrollTop(e),T.railh&&T.setScrollLeft(o),T.timerscroll&&T.timerscroll.tm&&clearInterval(T.timerscroll.tm),T.timerscroll=!1,T.cursorfreezed=!1,T.cursorupdate.stop(),T.showCursor(e,o),T},this.onScrollTransitionEnd=function(){if(T.scrollendtrapped){var e=T.getScrollTop(),o=T.getScrollLeft();if(e<0?e=0:e>T.page.maxh&&(e=T.page.maxh),o<0?o=0:o>T.page.maxw&&(o=T.page.maxw),e!=T.newscrolly||o!=T.newscrollx)return T.doScrollPos(o,e,M.snapbackspeed);T.scrollrunning&&T.triggerScrollEnd(),T.scrollrunning=!1,T.scrollendtrapped=!1,T.resetTransition(),T.timerscroll=!1,T.setScrollTop(e),T.railh&&T.setScrollLeft(o),T.cursorupdate.stop(),T.noticeCursor(!1,e,o),T.cursorfreezed=!1}}}else this.doScrollLeft=function(e,o){var t=T.scrollrunning?T.newscrolly:T.getScrollTop();T.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=T.scrollrunning?T.newscrollx:T.getScrollLeft();T.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=T.getScrollTop(),i=T.getScrollLeft();((T.newscrolly-r)*(o-r)<0||(T.newscrollx-i)*(e-i)<0)&&T.cancelScroll();var s=!1;if(T.bouncescroll&&T.rail.visibility||(o<0?(o=0,s=!0):o>T.page.maxh&&(o=T.page.maxh,s=!0)),T.bouncescroll&&T.railh.visibility||(e<0?(e=0,s=!0):e>T.page.maxw&&(e=T.page.maxw,s=!0)),T.scrollrunning&&T.newscrolly===o&&T.newscrollx===e)return!0;T.newscrolly=o,T.newscrollx=e,T.dst={},T.dst.x=e-i,T.dst.y=o-r,T.dst.px=i,T.dst.py=r;var n=0|Math.sqrt(T.dst.x*T.dst.x+T.dst.y*T.dst.y),l=T.getTransitionSpeed(n);T.bzscroll={};var a=s?1:.58;T.bzscroll.x=new R(i,T.newscrollx,l,0,0,a,1),T.bzscroll.y=new R(r,T.newscrolly,l,0,0,a,1);f();var c=function(){if(T.scrollrunning){var e=T.bzscroll.y.getPos();T.setScrollLeft(T.bzscroll.x.getNow()),T.setScrollTop(T.bzscroll.y.getNow()),e<=1?T.timer=u(c):(T.scrollrunning=!1,T.timer=0,T.triggerScrollEnd())}};T.scrollrunning||(T.triggerScrollStart(i,r,e,o,l),T.scrollrunning=!0,T.timer=u(c))},this.cancelScroll=function(){return T.timer&&h(T.timer),T.timer=0,T.bzscroll=!1,T.scrollrunning=!1,T};else this.doScrollLeft=function(e,o){var t=T.getScrollTop();T.doScrollPos(e,t,o)},this.doScrollTop=function(e,o){var t=T.getScrollLeft();T.doScrollPos(t,e,o)},this.doScrollPos=function(e,o,t){var r=e>T.page.maxw?T.page.maxw:e;r<0&&(r=0);var i=o>T.page.maxh?T.page.maxh:o;i<0&&(i=0),T.synched("scroll",function(){T.setScrollTop(i),T.setScrollLeft(r)})},this.cancelScroll=function(){};this.doScrollBy=function(e,o){z(0,e)},this.doScrollLeftBy=function(e,o){z(e,0)},this.doScrollTo=function(e,o){var t=o?Math.round(e*T.scrollratio.y):e;t<0?t=0:t>T.page.maxh&&(t=T.page.maxh),T.cursorfreezed=!1,T.doScrollTop(e)},this.checkContentSize=function(){var e=T.getContentSize();e.h==T.page.h&&e.w==T.page.w||T.resize(!1,e)},T.onscroll=function(e){T.rail.drag||T.cursorfreezed||T.synched("scroll",function(){T.scroll.y=Math.round(T.getScrollTop()/T.scrollratio.y),T.railh&&(T.scroll.x=Math.round(T.getScrollLeft()/T.scrollratio.x)),T.noticeCursor()})},T.bind(T.docscroll,"scroll",T.onscroll),this.doZoomIn=function(e){if(!T.zoomactive){T.zoomactive=!0,T.zoomrestore={style:{}};var o=["position","top","left","zIndex","backgroundColor","marginTop","marginBottom","marginLeft","marginRight"],t=T.win[0].style;for(var r in o){var i=o[r];T.zoomrestore.style[i]=void 0!==t[i]?t[i]:""}T.zoomrestore.style.width=T.win.css("width"),T.zoomrestore.style.height=T.win.css("height"),T.zoomrestore.padding={w:T.win.outerWidth()-T.win.width(),h:T.win.outerHeight()-T.win.height()},P.isios4&&(T.zoomrestore.scrollTop=c.scrollTop(),c.scrollTop(0)),T.win.css({position:P.isios4?"absolute":"fixed",top:0,left:0,zIndex:s+100,margin:0});var n=T.win.css("backgroundColor");return(""===n||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(n))&&T.win.css("backgroundColor","#fff"),T.rail.css({zIndex:s+101}),T.zoom.css({zIndex:s+102}),T.zoom.css("backgroundPosition","0 -18px"),T.resizeZoom(),T.onzoomin&&T.onzoomin.call(T),T.cancelEvent(e)}},this.doZoomOut=function(e){if(T.zoomactive)return T.zoomactive=!1,T.win.css("margin",""),T.win.css(T.zoomrestore.style),P.isios4&&c.scrollTop(T.zoomrestore.scrollTop),T.rail.css({"z-index":T.zindex}),T.zoom.css({"z-index":T.zindex}),T.zoomrestore=!1,T.zoom.css("backgroundPosition","0 0"),T.onResize(),T.onzoomout&&T.onzoomout.call(T),T.cancelEvent(e)},this.doZoom=function(e){return T.zoomactive?T.doZoomOut(e):T.doZoomIn(e)},this.resizeZoom=function(){if(T.zoomactive){var e=T.getScrollTop();T.win.css({width:c.width()-T.zoomrestore.padding.w+"px",height:c.height()-T.zoomrestore.padding.h+"px"}),T.onResize(),T.setScrollTop(Math.min(T.page.maxh,e))}},this.init(),n.nicescroll.push(this)},y=function(e){var o=this;this.nc=e,this.lastx=0,this.lasty=0,this.speedx=0,this.speedy=0,this.lasttime=0,this.steptime=0,this.snapx=!1,this.snapy=!1,this.demulx=0,this.demuly=0,this.lastscrollx=-1,this.lastscrolly=-1,this.chkx=0,this.chky=0,this.timer=0,this.reset=function(e,t){o.stop(),o.steptime=0,o.lasttime=f(),o.speedx=0,o.speedy=0,o.lastx=e,o.lasty=t,o.lastscrollx=-1,o.lastscrolly=-1},this.update=function(e,t){var r=f();o.steptime=r-o.lasttime,o.lasttime=r;var i=t-o.lasty,s=e-o.lastx,n=o.nc.getScrollTop()+i,l=o.nc.getScrollLeft()+s;o.snapx=l<0||l>o.nc.page.maxw,o.snapy=n<0||n>o.nc.page.maxh,o.speedx=s,o.speedy=i,o.lastx=e,o.lasty=t},this.stop=function(){o.nc.unsynched("domomentum2d"),o.timer&&clearTimeout(o.timer),o.timer=0,o.lastscrollx=-1,o.lastscrolly=-1},this.doSnapy=function(e,t){var r=!1;t<0?(t=0,r=!0):t>o.nc.page.maxh&&(t=o.nc.page.maxh,r=!0),e<0?(e=0,r=!0):e>o.nc.page.maxw&&(e=o.nc.page.maxw,r=!0),r?o.nc.doScrollPos(e,t,o.nc.opt.snapbackspeed):o.nc.triggerScrollEnd()},this.doMomentum=function(e){var t=f(),r=e?t+e:o.lasttime,i=o.nc.getScrollLeft(),s=o.nc.getScrollTop(),n=o.nc.page.maxh,l=o.nc.page.maxw;o.speedx=l>0?Math.min(60,o.speedx):0,o.speedy=n>0?Math.min(60,o.speedy):0;var a=r&&t-r<=60;(s<0||s>n||i<0||i>l)&&(a=!1);var c=!(!o.speedy||!a)&&o.speedy,d=!(!o.speedx||!a)&&o.speedx;if(c||d){var u=Math.max(16,o.steptime);if(u>50){var h=u/50;o.speedx*=h,o.speedy*=h,u=50}o.demulxy=0,o.lastscrollx=o.nc.getScrollLeft(),o.chkx=o.lastscrollx,o.lastscrolly=o.nc.getScrollTop(),o.chky=o.lastscrolly;var p=o.lastscrollx,m=o.lastscrolly,g=function(){var e=f()-t>600?.04:.02;o.speedx&&(p=Math.floor(o.lastscrollx-o.speedx*(1-o.demulxy)),o.lastscrollx=p,(p<0||p>l)&&(e=.1)),o.speedy&&(m=Math.floor(o.lastscrolly-o.speedy*(1-o.demulxy)),o.lastscrolly=m,(m<0||m>n)&&(e=.1)),o.demulxy=Math.min(1,o.demulxy+e),o.nc.synched("domomentum2d",function(){if(o.speedx){o.nc.getScrollLeft();o.chkx=p,o.nc.setScrollLeft(p)}if(o.speedy){o.nc.getScrollTop();o.chky=m,o.nc.setScrollTop(m)}o.timer||(o.nc.hideCursor(),o.doSnapy(p,m))}),o.demulxy<1?o.timer=setTimeout(g,u):(o.stop(),o.nc.hideCursor(),o.doSnapy(p,m))};g()}else o.doSnapy(o.nc.getScrollLeft(),o.nc.getScrollTop())}},x=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(e,o,t){var r=n.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollTop():x.call(e)},set:function(e,o){var t=n.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollTop(parseInt(o)):x.call(e,o),this}},e.fn.scrollTop=function(e){if(void 0===e){var o=!!this[0]&&(n.data(this[0],"__nicescroll")||!1);return o&&o.ishwscroll?o.getScrollTop():x.call(this)}return this.each(function(){var o=n.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollTop(parseInt(e)):x.call(n(this),e)})};var S=e.fn.scrollLeft;n.cssHooks.pageXOffset={get:function(e,o,t){var r=n.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getScrollLeft():S.call(e)},set:function(e,o){var t=n.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setScrollLeft(parseInt(o)):S.call(e,o),this}},e.fn.scrollLeft=function(e){if(void 0===e){var o=!!this[0]&&(n.data(this[0],"__nicescroll")||!1);return o&&o.ishwscroll?o.getScrollLeft():S.call(this)}return this.each(function(){var o=n.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollLeft(parseInt(e)):S.call(n(this),e)})};var z=function(e){var o=this;if(this.length=0,this.name="nicescrollarray",this.each=function(e){return n.each(o,e),o},this.push=function(e){o[o.length]=e,o.length++},this.eq=function(e){return o[e]},e)for(var t=0;t<e.length;t++){var r=n.data(e[t],"__nicescroll")||!1;r&&(this[this.length]=r,this.length++)}return this};!function(e,o,t){for(var r=0,i=o.length;r<i;r++)t(e,o[r])}(z.prototype,["show","hide","toggle","onResize","resize","remove","stop","doScrollPos"],function(e,o){e[o]=function(){var e=arguments;return this.each(function(){this[o].apply(this,e)})}}),e.fn.getNiceScroll=function(e){return void 0===e?new z(this):this[e]&&n.data(this[e],"__nicescroll")||!1},(e.expr.pseudos||e.expr[":"]).nicescroll=function(e){return void 0!==n.data(e,"__nicescroll")},n.fn.niceScroll=function(e,o){void 0!==o||"object"!=typeof e||"jquery"in e||(o=e,e=!1);var t=new z;return this.each(function(){var r=n(this),i=n.extend({},o);if(e){var s=n(e);i.doc=s.length>1?n(e,r):s,i.win=r}!("doc"in i)||"win"in i||(i.win=r);var l=r.data("__nicescroll")||!1;l||(i.doc=i.doc||r,l=new b(i,r),r.data("__nicescroll",l)),t.push(l)}),1===t.length?t[0]:t},a.NiceScroll={getjQuery:function(){return e}},n.nicescroll||(n.nicescroll=new z,n.nicescroll.options=g)});
vendor/nicescroll/zoomico.png ADDED
Binary file
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 6.9.02
6
  *
7
  */
8
 
@@ -2576,19 +2576,22 @@ global $wppa_log_file;
2576
  }
2577
  break;
2578
  case 'wppa_imgfact_count':
2579
- wppa_ajax_check_range( $value, false, '1', '24', __( 'Number of coverphotos' , 'wp-photo-album-plus') );
2580
  break;
2581
  case 'wppa_dislike_value':
2582
- wppa_ajax_check_range( $value, false, '-10', '0', __( 'Dislike value' , 'wp-photo-album-plus') );
2583
  break;
2584
  case 'wppa_slideshow_pagesize':
2585
- wppa_ajax_check_range( $value, false, '0', false, __( 'Slideshow pagesize' , 'wp-photo-album-plus') );
2586
  break;
2587
  case 'wppa_slideonly_max':
2588
- wppa_ajax_check_range( $value, false, '0', false, __( 'Slideonly max', 'wp-photo-album-plus') );
2589
  break;
2590
  case 'wppa_pagelinks_max':
2591
- wppa_ajax_check_range( $value, false, '0', false, __( 'Max Pagelinks' , 'wp-photo-album-plus') );
 
 
 
2592
  break;
2593
  /*
2594
  case 'wppa_start_pause_symbol_size':
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 6.9.05
6
  *
7
  */
8
 
2576
  }
2577
  break;
2578
  case 'wppa_imgfact_count':
2579
+ wppa_ajax_check_range( $value, false, '1', '24', __( 'Number of coverphotos', 'wp-photo-album-plus' ) );
2580
  break;
2581
  case 'wppa_dislike_value':
2582
+ wppa_ajax_check_range( $value, false, '-10', '0', __( 'Dislike value', 'wp-photo-album-plus' ) );
2583
  break;
2584
  case 'wppa_slideshow_pagesize':
2585
+ wppa_ajax_check_range( $value, false, '0', false, __( 'Slideshow pagesize', 'wp-photo-album-plus' ) );
2586
  break;
2587
  case 'wppa_slideonly_max':
2588
+ wppa_ajax_check_range( $value, false, '0', false, __( 'Slideonly max', 'wp-photo-album-plus' ) );
2589
  break;
2590
  case 'wppa_pagelinks_max':
2591
+ wppa_ajax_check_range( $value, false, '0', false, __( 'Max Pagelinks', 'wp-photo-album-plus' ) );
2592
+ break;
2593
+ case 'wppa_thumb_area_size':
2594
+ wppa_ajax_check_range( $value, false, '0', false, __( 'Thumbnail area max size', 'wp-photo-album-plus' ) );
2595
  break;
2596
  /*
2597
  case 'wppa_start_pause_symbol_size':
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 6.9.03
7
  *
8
  */
9
 
@@ -1798,8 +1798,8 @@ global $wpdb;
1798
  break;
1799
  case 'microthumbs':
1800
  $coverphoto_id = wppa_get_coverphoto_id( $album['id'] );
1801
- $x = wppa_get_photo_item( $coverphoto_id, 'thumbx' );
1802
- $y = wppa_get_photo_item( $coverphoto_id, 'thumby' );
1803
  if ( $x > ( $y * 2 ) ) { // x limits
1804
  $f = $x / 100;
1805
  $x = 100;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 6.9.05
7
  *
8
  */
9
 
1798
  break;
1799
  case 'microthumbs':
1800
  $coverphoto_id = wppa_get_coverphoto_id( $album['id'] );
1801
+ $x = max( '1', wppa_get_thumbx( $coverphoto_id ) );
1802
+ $y = max( '1', wppa_get_thumby( $coverphoto_id ) );
1803
  if ( $x > ( $y * 2 ) ) { // x limits
1804
  $f = $x / 100;
1805
  $x = 100;
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.9.04
7
  *
8
  */
9
 
@@ -16,6 +16,8 @@ function wppa_thumb_area( $action ) {
16
  $result = '';
17
  $mocc = wppa( 'mocc' );
18
  $alt = wppa( 'alt' );
 
 
19
 
20
  // Open thumbnail area box
21
  if ( $action == 'open' ) {
@@ -38,7 +40,8 @@ function wppa_thumb_area( $action ) {
38
  ' style="' .
39
  wppa_wcs( 'wppa-box' ) .
40
  wppa_wcs( 'wppa-' . $alt ) .
41
- // ( wppa_is_mobile() ? '' : 'width:' . wppa_get_thumbnail_area_width() . 'px;' ) .
 
42
  '"' .
43
  ' onscroll="wppaMakeLazyVisible();" ' .
44
  ' >';
@@ -48,6 +51,11 @@ function wppa_thumb_area( $action ) {
48
  }
49
  }
50
 
 
 
 
 
 
51
  // Toggle alt/even
52
  wppa_toggle_alt();
53
 
@@ -61,7 +69,7 @@ function wppa_thumb_area( $action ) {
61
 
62
  }
63
 
64
- // Cloase thumbnail area box
65
  elseif ( $action == 'close' ) {
66
 
67
  // Display create subalbum and upload photo links conditionally
@@ -75,6 +83,17 @@ function wppa_thumb_area( $action ) {
75
  // Clear both
76
  $result .= '<div class="wppa-clear" style="' . wppa_wis( 'clear:both;' ) . '" ></div>';
77
 
 
 
 
 
 
 
 
 
 
 
 
78
  // Close the thumbnail box
79
  $result .= '</div>';
80
  }
@@ -2177,7 +2196,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2177
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide the Edit link
2178
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$alb) . '-' . $mocc . '\' ).css( \'display\',\'none\' );'. // Hide catogory
2179
  'jQuery( \'#_wppa-cr-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show backlink
2180
- '_wppaDoAutocol( ' . $mocc . ' )'. // Trigger autocol
2181
  '"' .
2182
  ' style="float:left;cursor:pointer;"' .
2183
  '> ' .
@@ -2193,7 +2212,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2193
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show the Edit link
2194
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$alb) . '-' . $mocc . '\' ).css( \'display\',\'block\' );'. // Show catogory
2195
  'jQuery( \'#_wppa-cr-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide backlink
2196
- '_wppaDoAutocol( ' . $mocc . ' )'. // Trigger autocol
2197
  '"' .
2198
  ' style="float:right;cursor:pointer;display:none;padding-right:6px;"' .
2199
  ' >' .
@@ -2531,7 +2550,7 @@ static $albums_granted;
2531
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide the Edit link
2532
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$yalb) . '-' . $mocc . '\' ).css( \'display\',\'none\' );'. // Hide catogory
2533
  'jQuery( \'#_wppa-up-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show backlink
2534
- '_wppaDoAutocol( ' . $mocc . ' )' . // Trigger autocol
2535
  '"' .
2536
  ' style="float:left; cursor:pointer;' .
2537
  '" >' .
@@ -2547,7 +2566,7 @@ static $albums_granted;
2547
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show the Edit link
2548
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$yalb) . '-' . $mocc . '\' ).css( \'display\',\'block\' );'. // Show catogory
2549
  'jQuery( \'#_wppa-up-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide backlink
2550
- '_wppaDoAutocol( ' . $mocc . ' )' . // Trigger autocol
2551
  '"' .
2552
  ' style="float:right; cursor:pointer;display:none;padding-right:6px;' .
2553
  '" >' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.9.05
7
  *
8
  */
9
 
16
  $result = '';
17
  $mocc = wppa( 'mocc' );
18
  $alt = wppa( 'alt' );
19
+ $maxh = wppa_opt( 'thumb_area_size' );
20
+ $nice = false;
21
 
22
  // Open thumbnail area box
23
  if ( $action == 'open' ) {
40
  ' style="' .
41
  wppa_wcs( 'wppa-box' ) .
42
  wppa_wcs( 'wppa-' . $alt ) .
43
+ ( $maxh > '1' ? 'max-height:' . $maxh . 'px;' : '' ) .
44
+ ( $nice ? 'overflow:hidden;' : 'overflow:auto;' ) .
45
  '"' .
46
  ' onscroll="wppaMakeLazyVisible();" ' .
47
  ' >';
51
  }
52
  }
53
 
54
+ // Use nicescroller?
55
+ if ( wppa_switch( 'nicescroll' ) ) {
56
+ $result .= '<div class="wppa-nicewrap" >';
57
+ }
58
+
59
  // Toggle alt/even
60
  wppa_toggle_alt();
61
 
69
 
70
  }
71
 
72
+ // Close thumbnail area box
73
  elseif ( $action == 'close' ) {
74
 
75
  // Display create subalbum and upload photo links conditionally
83
  // Clear both
84
  $result .= '<div class="wppa-clear" style="' . wppa_wis( 'clear:both;' ) . '" ></div>';
85
 
86
+ // Nicescroller
87
+ if ( wppa_switch( 'nicescroll' ) ) {
88
+ $result .=
89
+ '<script type="text/javascript" >' .
90
+ 'jQuery(document).ready(function(){' .
91
+ 'jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});' .
92
+ '});' .
93
+ '</script>' .
94
+ '</div>';
95
+ }
96
+
97
  // Close the thumbnail box
98
  $result .= '</div>';
99
  }
2196
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide the Edit link
2197
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$alb) . '-' . $mocc . '\' ).css( \'display\',\'none\' );'. // Hide catogory
2198
  'jQuery( \'#_wppa-cr-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show backlink
2199
+ 'window.dispatchEvent(new Event(\'resize\'));'.
2200
  '"' .
2201
  ' style="float:left;cursor:pointer;"' .
2202
  '> ' .
2212
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show the Edit link
2213
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$alb) . '-' . $mocc . '\' ).css( \'display\',\'block\' );'. // Show catogory
2214
  'jQuery( \'#_wppa-cr-'.str_replace('.','-',$alb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide backlink
2215
+ 'window.dispatchEvent(new Event(\'resize\'));'.
2216
  '"' .
2217
  ' style="float:right;cursor:pointer;display:none;padding-right:6px;"' .
2218
  ' >' .
2550
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide the Edit link
2551
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$yalb) . '-' . $mocc . '\' ).css( \'display\',\'none\' );'. // Hide catogory
2552
  'jQuery( \'#_wppa-up-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show backlink
2553
+ 'window.dispatchEvent(new Event(\'resize\'));'.
2554
  '"' .
2555
  ' style="float:left; cursor:pointer;' .
2556
  '" >' .
2566
  'jQuery( \'#wppa-ea-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'block\' );'. // Show the Edit link
2567
  'jQuery( \'#wppa-cats-' . str_replace('.','-',$yalb) . '-' . $mocc . '\' ).css( \'display\',\'block\' );'. // Show catogory
2568
  'jQuery( \'#_wppa-up-'.str_replace('.','-',$yalb).'-'.$mocc.'\' ).css( \'display\',\'none\' );'. // Hide backlink
2569
+ 'window.dispatchEvent(new Event(\'resize\'));'.
2570
  '"' .
2571
  ' style="float:right; cursor:pointer;display:none;padding-right:6px;' .
2572
  '" >' .
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 6.9.02
7
  *
8
  */
9
 
@@ -193,6 +193,9 @@ global $wppa_revno;
193
  else {
194
  $wppa['start_album'] = $atts['album'];
195
  }
 
 
 
196
  $wppa['is_upload'] = true;
197
  break;
198
  case 'multitag':
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 6.9.05
7
  *
8
  */
9
 
193
  else {
194
  $wppa['start_album'] = $atts['album'];
195
  }
196
+ if ( ! $wppa['start_album'] ) {
197
+ $wppa['start_album'] = '0';
198
+ }
199
  $wppa['is_upload'] = true;
200
  break;
201
  case 'multitag':
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 6.9.03
7
  *
8
  */
9
 
@@ -2560,24 +2560,38 @@ global $wppa_done;
2560
  if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
2561
  if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
2562
  $cont['5'] = __( 'You receive this email as you are assigned to moderate' , 'wp-photo-album-plus');
2563
- // Send!
2564
- wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
 
 
 
 
 
2565
  $sentto[] = $moduser->user_login;
2566
  }
2567
  if ( wppa_opt( 'comment_notify' ) == 'admin' || wppa_opt( 'comment_notify' ) == 'both' || wppa_opt( 'comment_notify' ) == 'upadmin' ) {
 
2568
  // Mail admin
2569
  $moduser = wppa_get_user_by( 'id', '1' );
2570
  if ( ! in_array( $moduser->user_login, $sentto ) ) { // Already sent him?
2571
  $to = get_bloginfo( 'admin_email' );
2572
- $cont['3'] = $cont2;
2573
- $cont['4'] = $cont3;
2574
- $cont['5'] = __( 'You receive this email as administrator of the site' , 'wp-photo-album-plus');
2575
- // Send!
2576
- wppa_send_mail( $to, $subj, $cont, $photo, $email, $returnurl );
 
 
 
 
 
 
 
2577
  $sentto[] = $moduser->user_login;
2578
  }
2579
  }
2580
  if ( wppa_opt( 'comment_notify' ) == 'upload' || wppa_opt( 'comment_notify' ) == 'upadmin' || wppa_opt( 'comment_notify' ) == 'upowner' ) {
 
2581
  // Mail uploader
2582
  $uploader = $wpdb->get_var( $wpdb->prepare( "SELECT `owner` FROM `".WPPA_PHOTOS."` WHERE `id` = %d", $id ) );
2583
  $moduser = wppa_get_user_by( 'login', $uploader );
@@ -2589,8 +2603,11 @@ global $wppa_done;
2589
  elseif ( wppa_may_user_fe_edit( $photo ) ) $cont['4'] = $cont3a;
2590
  else $cont['4'] = '';
2591
  $cont['5'] = __( 'You receive this email as uploader of the photo' , 'wp-photo-album-plus');
 
2592
  // Send!
2593
- wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
 
 
2594
  $sentto[] = $moduser->user_login;
2595
  }
2596
  }
@@ -2606,8 +2623,11 @@ global $wppa_done;
2606
  if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
2607
  if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
2608
  $cont['5'] = __( 'You receive this email as owner of the album' , 'wp-photo-album-plus');
 
2609
  // Send!
2610
- wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
 
 
2611
  $sentto[] = $moduser->user_login;
2612
  }
2613
  }
@@ -2623,8 +2643,11 @@ global $wppa_done;
2623
  $cont['3'] = '';
2624
  $cont['4'] = '';
2625
  $cont['5'] = __( 'You receive this email because you commented this photo earlier.' , 'wp-photo-album-plus');
 
2626
  // Send!
2627
- wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
 
 
2628
  $sentto[] = $to;
2629
  }
2630
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 6.9.05
7
  *
8
  */
9
 
2560
  if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
2561
  if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
2562
  $cont['5'] = __( 'You receive this email as you are assigned to moderate' , 'wp-photo-album-plus');
2563
+
2564
+ // Send, but not to the commenter himself
2565
+ if ( $to != $email ) {
2566
+ wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
2567
+ }
2568
+
2569
+ // Remember if we sent him or skipped him because its his own comment
2570
  $sentto[] = $moduser->user_login;
2571
  }
2572
  if ( wppa_opt( 'comment_notify' ) == 'admin' || wppa_opt( 'comment_notify' ) == 'both' || wppa_opt( 'comment_notify' ) == 'upadmin' ) {
2573
+
2574
  // Mail admin
2575
  $moduser = wppa_get_user_by( 'id', '1' );
2576
  if ( ! in_array( $moduser->user_login, $sentto ) ) { // Already sent him?
2577
  $to = get_bloginfo( 'admin_email' );
2578
+
2579
+ // only when he is not the commenter himself
2580
+ if ( $to != $email ) {
2581
+ $cont['3'] = $cont2;
2582
+ $cont['4'] = $cont3;
2583
+ $cont['5'] = __( 'You receive this email as administrator of the site' , 'wp-photo-album-plus');
2584
+
2585
+ // Send!
2586
+ wppa_send_mail( $to, $subj, $cont, $photo, $email, $returnurl );
2587
+ }
2588
+
2589
+ // Remember if we sent him or skipped him because its his own comment
2590
  $sentto[] = $moduser->user_login;
2591
  }
2592
  }
2593
  if ( wppa_opt( 'comment_notify' ) == 'upload' || wppa_opt( 'comment_notify' ) == 'upadmin' || wppa_opt( 'comment_notify' ) == 'upowner' ) {
2594
+
2595
  // Mail uploader
2596
  $uploader = $wpdb->get_var( $wpdb->prepare( "SELECT `owner` FROM `".WPPA_PHOTOS."` WHERE `id` = %d", $id ) );
2597
  $moduser = wppa_get_user_by( 'login', $uploader );
2603
  elseif ( wppa_may_user_fe_edit( $photo ) ) $cont['4'] = $cont3a;
2604
  else $cont['4'] = '';
2605
  $cont['5'] = __( 'You receive this email as uploader of the photo' , 'wp-photo-album-plus');
2606
+
2607
  // Send!
2608
+ if ( $to != $email ) {
2609
+ wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
2610
+ }
2611
  $sentto[] = $moduser->user_login;
2612
  }
2613
  }
2623
  if ( user_can( $moduser, 'wppa_comments' ) ) $cont['3'] = $cont2; else $cont['3'] = '';
2624
  if ( user_can( $moduser, 'wppa_admin' ) ) $cont['4'] = $cont3; else $cont['4'] = '';
2625
  $cont['5'] = __( 'You receive this email as owner of the album' , 'wp-photo-album-plus');
2626
+
2627
  // Send!
2628
+ if ( $to != $email ) {
2629
+ wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
2630
+ }
2631
  $sentto[] = $moduser->user_login;
2632
  }
2633
  }
2643
  $cont['3'] = '';
2644
  $cont['4'] = '';
2645
  $cont['5'] = __( 'You receive this email because you commented this photo earlier.' , 'wp-photo-album-plus');
2646
+
2647
  // Send!
2648
+ if ( $to != $email ) {
2649
+ wppa_send_mail( $to, $subj, $cont, $photo, ( wppa_switch( 'mail_upl_email' ) ? $email : 'void' ), $returnurl );
2650
+ }
2651
  $sentto[] = $to;
2652
  }
2653
  }
wppa-non-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
- * Version 6.9.02
7
  *
8
  */
9
 
@@ -347,6 +347,7 @@ global $wppa_opt;
347
  'wppa-popup',
348
  'wppa-touch',
349
  'wppa-utils',
 
350
  );
351
 
352
  $js_dept1 = array( 'jquery', 'jquery-form', 'wppa-utils' );
@@ -361,6 +362,7 @@ global $wppa_opt;
361
  array( 'jquery' ),
362
  array( 'jquery' ),
363
  array( 'jquery' ),
 
364
  );
365
 
366
  $js_doits = array ( true,
@@ -370,6 +372,7 @@ global $wppa_opt;
370
  true,
371
  wppa_switch( 'slide_swipe' ) || $any_lightbox,
372
  true,
 
373
  );
374
 
375
  $js_footer = array ( $footer,
@@ -379,6 +382,7 @@ global $wppa_opt;
379
  $footer,
380
  $footer,
381
  $footer,
 
382
  );
383
 
384
  foreach ( array_keys( $js_files ) as $idx ) {
@@ -401,6 +405,29 @@ global $wppa_opt;
401
  wp_enqueue_script( 'wppa-geo', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', '', $wppa_api_version, $footer );
402
  }
403
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  // wppa-init
405
  if ( ! file_exists( WPPA_PATH.'/wppa-init.'.$wppa_lang.'.js' ) ) {
406
  wppa_create_wppa_init_js();
@@ -409,6 +436,7 @@ global $wppa_opt;
409
  if ( file_exists( WPPA_PATH.'/wppa-init.'.$wppa_lang.'.js' ) ) {
410
  wp_enqueue_script( 'wppa-init', WPPA_URL.'/wppa-init.'.$wppa_lang.'.js', array( 'wppa' ), get_option( 'wppa_ini_js_version_'.$wppa_lang, $footer ) );
411
  }
 
412
  // wppa.pagedata
413
  if ( $footer ) {
414
  wp_enqueue_script( 'wppa-pagedata', str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $wppa_js_page_data_file ), array( 'wppa-init' ), rand( 0,4711 ), $footer );
@@ -632,6 +660,15 @@ global $wppa_js_page_data_file;
632
  // Done
633
  echo '
634
  <!-- Done user upload -->';
 
 
 
 
 
 
 
 
 
635
  }
636
 
637
  /* FACEBOOK COMMENTS */
@@ -993,6 +1030,8 @@ global $wppa_init_js_data;
993
  wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '";
994
  wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ';
995
  wppaLazyLoad = ' . ( wppa_switch( 'lazy' ) ? 'true' : 'false' ) . ';
 
 
996
  ';
997
 
998
  // Open file
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 6.9.05
7
  *
8
  */
9
 
347
  'wppa-popup',
348
  'wppa-touch',
349
  'wppa-utils',
350
+ // 'jquery.nicescroll',
351
  );
352
 
353
  $js_dept1 = array( 'jquery', 'jquery-form', 'wppa-utils' );
362
  array( 'jquery' ),
363
  array( 'jquery' ),
364
  array( 'jquery' ),
365
+ // array( 'jquery' ),
366
  );
367
 
368
  $js_doits = array ( true,
372
  true,
373
  wppa_switch( 'slide_swipe' ) || $any_lightbox,
374
  true,
375
+ // wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ),
376
  );
377
 
378
  $js_footer = array ( $footer,
382
  $footer,
383
  $footer,
384
  $footer,
385
+ // $footer,
386
  );
387
 
388
  foreach ( array_keys( $js_files ) as $idx ) {
405
  wp_enqueue_script( 'wppa-geo', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', '', $wppa_api_version, $footer );
406
  }
407
  }
408
+
409
+ // Nicescroller
410
+ if ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) ) {
411
+
412
+ // jQuery Easing
413
+ $easing_url = 'https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.js';
414
+ $easing_cdn = wp_remote_get( $easing_url );
415
+ if( (int) wp_remote_retrieve_response_code( $easing_cdn ) !== 200 ) {
416
+
417
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
418
+ }
419
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, array( 'jquery' ), 'all' );
420
+
421
+ // Nicescroll Library
422
+ $nice_url = 'https://cdnjs.cloudflare.com/ajax/libs/jquery.nicescroll/3.7.6/jquery.nicescroll.min.js';
423
+ $nice_cdn = wp_remote_get( $nice_url );
424
+ if( (int) wp_remote_retrieve_response_code( $nice_cdn ) !== 200 ) {
425
+
426
+ $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
427
+ }
428
+ wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, array( 'jquery', 'nicescrollr-easing-min-js' ), 'all' );
429
+ }
430
+
431
  // wppa-init
432
  if ( ! file_exists( WPPA_PATH.'/wppa-init.'.$wppa_lang.'.js' ) ) {
433
  wppa_create_wppa_init_js();
436
  if ( file_exists( WPPA_PATH.'/wppa-init.'.$wppa_lang.'.js' ) ) {
437
  wp_enqueue_script( 'wppa-init', WPPA_URL.'/wppa-init.'.$wppa_lang.'.js', array( 'wppa' ), get_option( 'wppa_ini_js_version_'.$wppa_lang, $footer ) );
438
  }
439
+
440
  // wppa.pagedata
441
  if ( $footer ) {
442
  wp_enqueue_script( 'wppa-pagedata', str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $wppa_js_page_data_file ), array( 'wppa-init' ), rand( 0,4711 ), $footer );
660
  // Done
661
  echo '
662
  <!-- Done user upload -->';
663
+
664
+ // Window nicescroller
665
+ if ( wppa_switch( 'nicescroll_window' ) ) {
666
+ echo '
667
+ <!-- Nice scroller on window, by wppa -->
668
+ <script type="text/javascript" >
669
+ jQuery("body").niceScroll({' . wppa_opt( 'nicescroll_opts' ) . '});
670
+ </script>';
671
+ }
672
  }
673
 
674
  /* FACEBOOK COMMENTS */
1030
  wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '";
1031
  wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ';
1032
  wppaLazyLoad = ' . ( wppa_switch( 'lazy' ) ? 'true' : 'false' ) . ';
1033
+ wppaThumbAreaMaxFrac = ' . ( wppa_opt( 'thumb_area_size' ) < 1 ? wppa_opt( 'thumb_area_size' ) : 1.0 ) . ';
1034
+ wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) ? 'true' : 'false' ) . ';
1035
  ';
1036
 
1037
  // Open file
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.9.04
7
  *
8
  */
9
 
@@ -1138,8 +1138,27 @@ echo '<input type="button" vaue="Click me" onclick="wppaTimedConfirm( \'My Text\
1138
  $clas = '';
1139
  $tags = 'thumb,system';
1140
  wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1141
  }
1142
- wppa_setting_subheader( 'D', '1', __( 'Album cover related size settings' , 'wp-photo-album-plus') );
1143
  {
1144
  $name = __('Max Cover width', 'wp-photo-album-plus');
1145
  $desc = __('Maximum width for a album cover display.', 'wp-photo-album-plus');
@@ -3979,6 +3998,30 @@ echo '<input type="button" vaue="Click me" onclick="wppaTimedConfirm( \'My Text\
3979
  $tags = 'system';
3980
  wppa_setting($slug, '31', $name, $desc, $html, $help, $clas, $tags);
3981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3982
  }
3983
  wppa_setting_subheader( 'B', '1', __( 'Slideshow related settings' , 'wp-photo-album-plus') );
3984
  {
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.9.05
7
  *
8
  */
9
 
1138
  $clas = '';
1139
  $tags = 'thumb,system';
1140
  wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
1141
+
1142
+ $name = __('Thumbnail area max size', 'wp-photo-album-plus');
1143
+ $desc = __('The max height of the thumbnais area', 'wp-photo-album-plus');
1144
+ $help = __('A number > 1 is pixelsize, a number < 1 is fraction of the viewport height, 0 is no limit', 'wp-photo-album-plus');
1145
+ $slug = 'wppa_thumb_area_size';
1146
+ $html = wppa_input($slug, '40px', '', __('pixels / fraction', 'wp-photo-album-plus'));
1147
+ $clas = '';
1148
+ $tags = 'thumb,system';
1149
+ wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags);
1150
+
1151
+ $name = __('Use nicescroller', 'wp-photo-album-plus');
1152
+ $desc = __('Use nice scrollbars on thumbnail area', 'wp-photo-album-plus');
1153
+ $help = '';
1154
+ $slug = 'wppa_nicescroll';
1155
+ $html = wppa_checkbox($slug);
1156
+ $clas = '';
1157
+ $tags = 'thumb,system';
1158
+ wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags);
1159
+
1160
  }
1161
+ wppa_setting_subheader( 'D', '1', __( 'Album cover related size settings' , 'wp-photo-album-plus') );
1162
  {
1163
  $name = __('Max Cover width', 'wp-photo-album-plus');
1164
  $desc = __('Maximum width for a album cover display.', 'wp-photo-album-plus');
3998
  $tags = 'system';
3999
  wppa_setting($slug, '31', $name, $desc, $html, $help, $clas, $tags);
4000
 
4001
+ $name = __('Nice scroll on window', 'wp-photo-album-plus');
4002
+ $desc = __('Apply the nice scroller on the browserwindow', 'wp-photo-album-plus');
4003
+ $help = '';
4004
+ $slug = 'wppa_nicescroll_window';
4005
+ $html = wppa_checkbox( $slug );
4006
+ $clas = '';
4007
+ $tags = 'system';
4008
+ wppa_setting($slug, '32', $name, $desc, $html, $help, $clas, $tags);
4009
+
4010
+ $name = __('Nice scroller options', 'wp-photo-album-plus');
4011
+ $desc = __('The nice scroller configuration options', 'wp-photo-album-plus');
4012
+ $help = __('Enter options, one per line, seperated by commas(,).', 'wp-photo-album-plus');
4013
+ $help .= '<br />' .
4014
+ sprintf( __('Click %s here %s for documentation and a full list of available options', 'wp-photo-album-plus'),
4015
+ '<a href="' . WPPA_URL . '/vendor/nicescroll/README.txt" target="_blank" >',
4016
+ '</a>'
4017
+ ) .
4018
+ '<br />';
4019
+ $slug = 'wppa_nicescroll_opts';
4020
+ $html = wppa_textarea( $slug );
4021
+ $clas = '';
4022
+ $tags = 'system';
4023
+ wppa_setting($slug, '33', $name, $desc, $html, $help, $clas, $tags);
4024
+
4025
  }
4026
  wppa_setting_subheader( 'B', '1', __( 'Slideshow related settings' , 'wp-photo-album-plus') );
4027
  {
wppa-setup.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
- * Version 6.9.02
7
  *
8
  */
9
 
@@ -727,6 +727,20 @@ Hide Camera info
727
  </table>
728
  </div>';
729
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
730
  $wppa_defaults = array ( 'wppa_revision' => '100',
731
  'wppa_prevrev' => '100',
732
  'wppa_max_users' => '1000',
@@ -789,6 +803,8 @@ Hide Camera info
789
  'wppa_thumb_page_size' => '0', // 7
790
  'wppa_popupsize' => '150', // 8
791
  'wppa_use_thumbs_if_fit' => 'yes', // 9
 
 
792
 
793
  // D Covers
794
  'wppa_max_cover_width' => '1024', // 1
@@ -1193,6 +1209,9 @@ Hide Camera info
1193
  'wppa_enable_admins_choice' => 'no',
1194
  'wppa_owner_to_name' => 'no',
1195
 
 
 
 
1196
  // B Full size and Slideshow
1197
  'wppa_fullvalign' => 'center',
1198
  'wppa_fullhalign' => 'center',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.9.05
7
  *
8
  */
9
 
727
  </table>
728
  </div>';
729
 
730
+ // Nice scroll options
731
+ $nso = "cursorwidth:8,
732
+ cursoropacitymin:0.4,
733
+ cursorcolor:'#777777',
734
+ cursorborder:'none',
735
+ cursorborderradius:6,
736
+ autohidemode:'leave',
737
+ nativeparentscrolling:false,
738
+ preservenativescrolling:false,
739
+ bouncescroll:false,
740
+ smoothscroll:true,
741
+ cursorborder:'2px solid transparent',";
742
+
743
+
744
  $wppa_defaults = array ( 'wppa_revision' => '100',
745
  'wppa_prevrev' => '100',
746
  'wppa_max_users' => '1000',
803
  'wppa_thumb_page_size' => '0', // 7
804
  'wppa_popupsize' => '150', // 8
805
  'wppa_use_thumbs_if_fit' => 'yes', // 9
806
+ 'wppa_thumb_area_size' => '0', // 10
807
+ 'wppa_nicescroll' => 'no', // 11
808
 
809
  // D Covers
810
  'wppa_max_cover_width' => '1024', // 1
1209
  'wppa_enable_admins_choice' => 'no',
1210
  'wppa_owner_to_name' => 'no',
1211
 
1212
+ 'wppa_nicescroll_window' => 'no',
1213
+ 'wppa_nicescroll_opts' => $nso,
1214
+
1215
  // B Full size and Slideshow
1216
  'wppa_fullvalign' => 'center',
1217
  'wppa_fullhalign' => 'center',
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 6.9.04.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/
@@ -22,8 +22,8 @@ global $wpdb;
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
- global $wppa_revno; $wppa_revno = '6904'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '6-9-04-007'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 6.9.05.009
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
22
  global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
+ global $wppa_revno; $wppa_revno = '6905'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '6-9-05-009'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );