Page scroll to id - Version 1.6.9

Version Description

  • Added warning message in plugin settings when the selector option value lacks quotes (invalid without jquery migrate or with jquery 3.x).
  • Fixed Uncaught TypeError of undefined data when actual page is inside an iframe - related issue.
  • Added 'Encode unicode characters on links URL' option in plugin settings help panel.
  • Extended "Prevent other scripts from handling plugins links" option function handler.
  • Replaced jQuery deprecated ready event in plugin script.
Download this release

Release Info

Developer malihu
Plugin Icon 128x128 Page scroll to id
Version 1.6.9
Comparing to
See all releases

Code changes from version 1.6.8 to 1.6.9

includes/help/plugin-settings.inc CHANGED
@@ -74,7 +74,8 @@ $help_plugin_settings_text=<<<EOD
74
  <p>
75
  <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced" target="_blank"><strong>Advanced options</strong></a> -
76
  If another plugin or a theme script handles page scrolling and conflicts with "Page scroll to id", try enabling <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-remove-other-click-events" target="_blank">Prevent other scripts from handling plugin’s links</a> option. <br />
77
- Enable <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced-normalize-targets" target="_blank">Normalize anchor-point targets</a> to normalize/reset the CSS properties (height, line-height, border etc.) of anchor-point targets.
 
78
  </p>
79
 
80
  EOD;
74
  <p>
75
  <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced" target="_blank"><strong>Advanced options</strong></a> -
76
  If another plugin or a theme script handles page scrolling and conflicts with "Page scroll to id", try enabling <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-remove-other-click-events" target="_blank">Prevent other scripts from handling plugin’s links</a> option. <br />
77
+ Enable <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced-normalize-targets" target="_blank">Normalize anchor-point targets</a> to normalize/reset the CSS properties (height, line-height, border etc.) of anchor-point targets. <br />
78
+ Enable <a href="http://manos.malihu.gr/page-scroll-to-id-for-wordpress/#plugin-settings-advanced-encode-links" target="_blank">Encode unicode characters on links URL</a> when having links with encoded unicode characters (e.g. on internationalized domain names) in their href/URL.
79
  </p>
80
 
81
  EOD;
js/admin.js CHANGED
@@ -156,6 +156,24 @@
156
  --------------------
157
  */
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  $(".mPS2id-show-option-common-values").click(function(e){
160
  e.preventDefault();
161
  $(this).next("span").toggleClass("mPS2id-show");
156
  --------------------
157
  */
158
 
159
+ //check for selector without quotes which is invalid without jquery migrate or jquery 3.x and display a warning
160
+ var mps2idSelectorInput=$("input#page_scroll_to_id_0_selector"),
161
+ mps2idSelectorDesc=mps2idSelectorInput.parent().children(".description"),
162
+ mps2idExcludedSelectorInput=$("input#page_scroll_to_id_0_excludeSelector"),
163
+ mps2idExcludedSelectorDesc=mps2idExcludedSelectorInput.parent().children(".description");
164
+ if(mps2idSelectorInput.length && mps2idSelectorDesc.length){
165
+ if(mps2idSelectorInput.val().indexOf("a[href*=#]:not([href=#])") >= 0){
166
+ var mps2idSelectorInputQuoted=mps2idSelectorInput.val().replace("a[href*=#]:not([href=#])", "a[href*='#']:not([href='#'])");
167
+ mps2idSelectorDesc.prepend("<small style='color:red'>It seems that you're using an older selector which might cause issues with the latest versions of WordPress. If you have such issues, change \"Selector(s)\" option value to: </small><br /><code>"+mps2idSelectorInputQuoted+"</code><br />");
168
+ }
169
+ }
170
+ if(mps2idExcludedSelectorInput.length && mps2idExcludedSelectorDesc.length){
171
+ if(mps2idExcludedSelectorInput.val().indexOf("a[href*=#]:not([href=#])") >= 0){
172
+ var mps2idExcludedSelectorInputQuoted=mps2idExcludedSelectorInput.val().replace("a[href*=#]:not([href=#])", "a[href*='#']:not([href='#'])");
173
+ mps2idExcludedSelectorDesc.prepend("<small style='color:red'>It seems that you're using a selector which might cause issues with the latest versions of WordPress. If you have such issues, change \"selectors are excluded\" value to: </small><br /><code>"+mps2idExcludedSelectorInputQuoted+"</code><br />");
174
+ }
175
+ }
176
+
177
  $(".mPS2id-show-option-common-values").click(function(e){
178
  e.preventDefault();
179
  $(this).next("span").toggleClass("mPS2id-show");
js/jquery.malihu.PageScroll2id-init.js CHANGED
@@ -35,10 +35,14 @@
35
  for(var i=evt.click.length-1; i>=0; i--){
36
  var handler=evt.click[i];
37
  if(handler && handler.namespace != "mPS2id"){
38
- if(handler.selector==='a[href*="#"]'){
 
 
39
  handler.selector='a[href*="#"]:not(._mPS2id-h)';
40
  }else if(handler.selector==='a[href*=#]:not([href=#])'){
41
  handler.selector='a[href*=#]:not([href=#]):not(._mPS2id-h)';
 
 
42
  }else if(handler.selector && handler.selector.indexOf("mobmenu")!==-1){
43
  //special cases
44
  s.off("click");
@@ -49,7 +53,7 @@
49
  }
50
  },
51
  autoSelectors="a[data-ps2id-api='true'][href*='#'],.ps2id > a[href*='#'],a.ps2id[href*='#']";
52
- $(document).ready(function(){
53
  for(var k=0; k<_o.total_instances; k++){
54
  //generate id from class name (e.g. class ps2id-id-myid gives element the id myid)
55
  var c2iSel=$("[class*='ps2id-id-']");
@@ -91,8 +95,17 @@
91
  //WordPress TwentyTwenty theme introduced its own (anonymous) smooth scrolling function which we need to disable (later versions of TwentyTwenty use CSS scroll-behavior rule)
92
  if(window.twentytwenty && window.twentytwenty.smoothScroll) window.twentytwenty.smoothScroll=null;
93
  });
94
- $(window).on("load",function(){
95
  for(var i=0; i<_o.total_instances; i++){
 
 
 
 
 
 
 
 
 
96
  var sel=$(_o.instances[_p+"_instance_"+i]["selector"]+",."+shortcodeClass+","+autoSelectors),
97
  autoCorrectScrollOpt=_o.instances[_p+"_instance_"+i]["autoCorrectScroll"],autoCorrectScroll=0;
98
  //1.6.7
35
  for(var i=evt.click.length-1; i>=0; i--){
36
  var handler=evt.click[i];
37
  if(handler && handler.namespace != "mPS2id"){
38
+ if(handler.selector==='a[href*=#]'){
39
+ handler.selector='a[href*=#]:not(._mPS2id-h)';
40
+ }else if(handler.selector==='a[href*="#"]'){
41
  handler.selector='a[href*="#"]:not(._mPS2id-h)';
42
  }else if(handler.selector==='a[href*=#]:not([href=#])'){
43
  handler.selector='a[href*=#]:not([href=#]):not(._mPS2id-h)';
44
+ }else if(handler.selector==='a[href*="#"]:not([href="#"])'){
45
+ handler.selector='a[href*="#"]:not([href="#"]):not(._mPS2id-h)';
46
  }else if(handler.selector && handler.selector.indexOf("mobmenu")!==-1){
47
  //special cases
48
  s.off("click");
53
  }
54
  },
55
  autoSelectors="a[data-ps2id-api='true'][href*='#'],.ps2id > a[href*='#'],a.ps2id[href*='#']";
56
+ $(function(){ //doc ready
57
  for(var k=0; k<_o.total_instances; k++){
58
  //generate id from class name (e.g. class ps2id-id-myid gives element the id myid)
59
  var c2iSel=$("[class*='ps2id-id-']");
95
  //WordPress TwentyTwenty theme introduced its own (anonymous) smooth scrolling function which we need to disable (later versions of TwentyTwenty use CSS scroll-behavior rule)
96
  if(window.twentytwenty && window.twentytwenty.smoothScroll) window.twentytwenty.smoothScroll=null;
97
  });
98
+ $(window).on("load",function(){ //win load
99
  for(var i=0; i<_o.total_instances; i++){
100
+ //check for selector without quotes which is invalid without jquery migrate or jquery 3.x and display a warning
101
+ if(_o.instances[_p+"_instance_"+i]["selector"].indexOf("a[href*=#]:not([href=#])") >= 0){
102
+ //var quotedSel=_o.instances[_p+"_instance_"+i]["selector"].replace("a[href*=#]:not([href=#])", "a[href*='#']:not([href='#'])");
103
+ //_o.instances[_p+"_instance_"+i]["selector"]=quotedSel;
104
+ console.log("ps2id selector issue: a[href*=#]:not([href=#]) selector needs quotes");
105
+ }
106
+ if(_o.instances[_p+"_instance_"+i]["excludeSelector"].indexOf("a[href*=#]:not([href=#])") >= 0){
107
+ console.log("ps2id excluded selector issue: a[href*=#]:not([href=#]) selector needs quotes");
108
+ }
109
  var sel=$(_o.instances[_p+"_instance_"+i]["selector"]+",."+shortcodeClass+","+autoSelectors),
110
  autoCorrectScrollOpt=_o.instances[_p+"_instance_"+i]["autoCorrectScroll"],autoCorrectScroll=0;
111
  //1.6.7
js/jquery.malihu.PageScroll2id.js CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  == Page scroll to id ==
3
- Version: 1.6.4
4
  Plugin URI: http://manos.malihu.gr/page-scroll-to-id/
5
  Author: malihu
6
  Author URI: http://manos.malihu.gr
@@ -276,7 +276,8 @@ THE SOFTWARE.
276
  }
277
  hrefProp=(!hrefProp) ? href : hrefProp;
278
  var str=(hrefProp.indexOf("#/")!==-1) ? hrefProp.split("#/")[0] : hrefProp.split("#")[0],
279
- loc=window.location.toString().split("#")[0];
 
280
  return href!=="#" && href.indexOf("#")!==-1 && (str==="" || decodeURIComponent(str)===decodeURIComponent(loc));
281
  },
282
 
@@ -399,7 +400,9 @@ THE SOFTWARE.
399
  /* finds the element that should be highlighted */
400
 
401
  _findHighlight:function(id){
402
- var wLoc=window.location,loc=wLoc.toString().split("#")[0],locPath=wLoc.pathname;
 
 
403
  if(loc.indexOf("'")!==-1) loc=loc.replace("'","\\'");
404
  if(locPath.indexOf("'")!==-1) locPath=locPath.replace("'","\\'");
405
  loc=decodeURIComponent(loc);
@@ -466,6 +469,7 @@ THE SOFTWARE.
466
  /* checks if target element is in viewport */
467
 
468
  _currentTarget:function(t){
 
469
  var o=opt["target_"+t.data(pluginPfx).i],
470
  dataTarget=t.data("ps2id-target"),
471
  rect=dataTarget && $(dataTarget)[0] ? $(dataTarget)[0].getBoundingClientRect() : t[0].getBoundingClientRect();
1
  /*
2
  == Page scroll to id ==
3
+ Version: 1.6.5
4
  Plugin URI: http://manos.malihu.gr/page-scroll-to-id/
5
  Author: malihu
6
  Author URI: http://manos.malihu.gr
276
  }
277
  hrefProp=(!hrefProp) ? href : hrefProp;
278
  var str=(hrefProp.indexOf("#/")!==-1) ? hrefProp.split("#/")[0] : hrefProp.split("#")[0],
279
+ wloc=window.location !== window.parent.location ? window.parent.location : window.location,
280
+ loc=wloc.toString().split("#")[0];
281
  return href!=="#" && href.indexOf("#")!==-1 && (str==="" || decodeURIComponent(str)===decodeURIComponent(loc));
282
  },
283
 
400
  /* finds the element that should be highlighted */
401
 
402
  _findHighlight:function(id){
403
+ var wLoc=window.location !== window.parent.location ? window.parent.location : window.location,
404
+ loc=wLoc.toString().split("#")[0],
405
+ locPath=wLoc.pathname;
406
  if(loc.indexOf("'")!==-1) loc=loc.replace("'","\\'");
407
  if(locPath.indexOf("'")!==-1) locPath=locPath.replace("'","\\'");
408
  loc=decodeURIComponent(loc);
469
  /* checks if target element is in viewport */
470
 
471
  _currentTarget:function(t){
472
+ if(!t.data(pluginPfx)) return; //handle Uncaught TypeError (undefined data)
473
  var o=opt["target_"+t.data(pluginPfx).i],
474
  dataTarget=t.data("ps2id-target"),
475
  rect=dataTarget && $(dataTarget)[0] ? $(dataTarget)[0].getBoundingClientRect() : t[0].getBoundingClientRect();
js/page-scroll-to-id.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /* Page scroll to id - version 1.6.8 */
2
- !function(x,b,c,e){var n,I,a,s,l,i,o,r,h,u,t,d,g="mPageScroll2id",O="mPS2id",f={scrollSpeed:1e3,autoScrollSpeed:!0,scrollEasing:"easeInOutQuint",scrollingEasing:"easeOutQuint",pageEndSmoothScroll:!0,layout:"vertical",offset:0,highlightSelector:!1,clickedClass:O+"-clicked",targetClass:O+"-target",highlightClass:O+"-highlight",forceSingleHighlight:!1,keepHighlightUntilNext:!1,highlightByNextTarget:!1,disablePluginBelow:!1,clickEvents:!0,appendHash:!1,onStart:function(){},onComplete:function(){},defaultSelector:!1,live:!0,liveSelector:!1,excludeSelectors:!1,encodeLinks:!1},p=0,_={init:function(e){e=x.extend(!0,{},f,e);if(x(c).data(O,e),I=x(c).data(O),!this.selector){var t="__"+O;this.each(function(){var e=x(this);e.hasClass(t)||e.addClass(t)}),this.selector="."+t}I.liveSelector&&(this.selector+=","+I.liveSelector),n=n?n+","+this.selector:this.selector,I.defaultSelector&&("object"==typeof x(n)&&0!==x(n).length||(n=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id'],._ps2id")),I.clickEvents&&x(c).undelegate("."+O).delegate(n,"click."+O,function(e){if(w._isDisabled.call(null))w._removeClasses.call(null);else{var t=x(this),n=t.attr("href"),a=t.prop("href").baseVal||t.prop("href");I.excludeSelectors&&t.is(I.excludeSelectors)||n&&-1!==n.indexOf("#/")||(w._reset.call(null),u=t.data("ps2id-offset")||0,w._isValid.call(null,n,a)&&w._findTarget.call(null,n)&&(e.preventDefault(),s="selector",l=t,w._setClasses.call(null,!0),w._scrollTo.call(null)))}}),x(b).unbind("."+O).bind("scroll."+O+" resize."+O,function(){if(w._isDisabled.call(null))w._removeClasses.call(null);else{var s=x("._"+O+"-t");s.each(function(e){var t=x(this),n=t.attr("id"),a=w._findHighlight.call(null,n);w._setClasses.call(null,!1,t,a),e==s.length-1&&w._extendClasses.call(null)})}}),a=!0,w._setup.call(null),w._live.call(null)},scrollTo:function(e,t){if(w._isDisabled.call(null))w._removeClasses.call(null);else if(e&&void 0!==e){w._isInit.call(null);var n={layout:I.layout,offset:I.offset,clicked:!1};t=x.extend(!0,{},n,t);w._reset.call(null),r=t.layout,h=t.offset,e=-1!==e.indexOf("#")?e:"#"+e,w._isValid.call(null,e)&&w._findTarget.call(null,e)&&(s="scrollTo",(l=t.clicked)&&w._setClasses.call(null,!0),w._scrollTo.call(null))}},destroy:function(){x(b).unbind("."+O),x(c).undelegate("."+O).removeData(O),x("._"+O+"-t").removeData(O),w._removeClasses.call(null,!0)}},w={_isDisabled:function(){var e=b,t="inner",n=I.disablePluginBelow instanceof Array?[I.disablePluginBelow[0]||0,I.disablePluginBelow[1]||0]:[I.disablePluginBelow||0,0];return"innerWidth"in b||(t="client",e=c.documentElement||c.body),e[t+"Width"]<=n[0]||e[t+"Height"]<=n[1]},_isValid:function(e,t){if(e){var n=-1!==(t=t||e).indexOf("#/")?t.split("#/")[0]:t.split("#")[0],a=b.location.toString().split("#")[0];return"#"!==e&&-1!==e.indexOf("#")&&(""===n||decodeURIComponent(n)===decodeURIComponent(a))}},_setup:function(){var l=w._highlightSelector(),o=1,r=0;return x(l).each(function(){var e=x(this),t=e.attr("href"),n=e.prop("href").baseVal||e.prop("href");if(w._isValid.call(null,t,n)){if(I.excludeSelectors&&e.is(I.excludeSelectors))return;var a=-1!==t.indexOf("#/")?t.split("#/")[1]:t.split("#")[1],s=-1!==a.indexOf("%")?x(c.getElementById(a)):x("#"+a);if(0<s.length){I.highlightByNextTarget&&s!==r&&(r?r.data(O,{tn:s}):s.data(O,{tn:"0"}),r=s),s.hasClass("_"+O+"-t")||s.addClass("_"+O+"-t"),s.data(O,{i:o}),e.hasClass("_"+O+"-h")||e.addClass("_"+O+"-h");var i=w._findHighlight.call(null,a);w._setClasses.call(null,!1,s,i),p=o,++o==x(l).length&&w._extendClasses.call(null)}}})},_highlightSelector:function(){return I.highlightSelector&&""!==I.highlightSelector?I.highlightSelector:n},_findTarget:function(e){var t=-1!==e.indexOf("#/")?e.split("#/")[1]:e.split("#")[1],n=-1!==t.indexOf("%")?x(c.getElementById(t)):x("#"+t);if(n.length<1||"fixed"===n.css("position")){if("top"!==t)return;n=x("body")}return i=n,r||(r=I.layout),h=w._setOffset.call(null),(o=[(n.offset().top-h[0]).toString(),(n.offset().left-h[1]).toString()])[0]=o[0]<0?0:o[0],o[1]=o[1]<0?0:o[1],o},_setOffset:function(){var e,t,n,a;switch(h||(h=I.offset?I.offset:0),u&&(h=u),typeof h){case"object":case"string":0<(t=[(e=[h.y?h.y:h,h.x?h.x:h])[0]instanceof jQuery?e[0]:x(e[0]),e[1]instanceof jQuery?e[1]:x(e[1])])[0].length?(n=t[0].height(),"fixed"===t[0].css("position")&&(n+=t[0][0].offsetTop)):n=!isNaN(parseFloat(e[0]))&&isFinite(e[0])?parseInt(e[0]):0,0<t[1].length?(a=t[1].width(),"fixed"===t[1].css("position")&&(a+=t[1][0].offsetLeft)):a=!isNaN(parseFloat(e[1]))&&isFinite(e[1])?parseInt(e[1]):0;break;case"function":(e=h.call(null))instanceof Array?(n=e[0],a=e[1]):n=a=e;break;default:n=a=parseInt(h)}return[n,a]},_findHighlight:function(e){var t=b.location,n=t.toString().split("#")[0],a=t.pathname;if(-1!==n.indexOf("'")&&(n=n.replace("'","\\'")),-1!==a.indexOf("'")&&(a=a.replace("'","\\'")),n=decodeURIComponent(n),a=decodeURIComponent(a),I.encodeLinks){var s=encodeURI(n).toLowerCase(),i=encodeURI(a).toLowerCase();return x("._"+O+"-h[href='#"+e+"'],._"+O+"-h[href='"+n+"#"+e+"'],._"+O+"-h[href='"+a+"#"+e+"'],._"+O+"-h[href='#/"+e+"'],._"+O+"-h[href='"+n+"#/"+e+"'],._"+O+"-h[href='"+a+"#/"+e+"'],._"+O+"-h[href='"+s+"#/"+e+"'],._"+O+"-h[href='"+s+"#"+e+"'],._"+O+"-h[href='"+i+"#/"+e+"'],._"+O+"-h[href='"+i+"#"+e+"']")}return x("._"+O+"-h[href='#"+e+"'],._"+O+"-h[href='"+n+"#"+e+"'],._"+O+"-h[href='"+a+"#"+e+"'],._"+O+"-h[href='#/"+e+"'],._"+O+"-h[href='"+n+"#/"+e+"'],._"+O+"-h[href='"+a+"#/"+e+"']")},_setClasses:function(e,t,n){var a=I.clickedClass,s=I.targetClass,i=I.highlightClass;e&&a&&""!==a?(x("."+a).removeClass(a),l.addClass(a)):t&&s&&""!==s&&n&&i&&""!==i&&(w._currentTarget.call(null,t)?(t.addClass(s),n.addClass(i)):(!I.keepHighlightUntilNext||1<x("."+i).length)&&(t.removeClass(s),n.removeClass(i)))},_extendClasses:function(){var e=I.targetClass,t=I.highlightClass,n=x("."+e),a=x("."+t),s=e+"-first",i=e+"-last",l=t+"-first",o=t+"-last";x("._"+O+"-t").removeClass(s+" "+i),x("._"+O+"-h").removeClass(l+" "+o),I.forceSingleHighlight?I.keepHighlightUntilNext&&1<n.length?(n.slice(0,1).removeClass(e),a.slice(0,1).removeClass(t)):(n.slice(1).removeClass(e),a.slice(1).removeClass(t)):(n.slice(0,1).addClass(s).end().slice(-1).addClass(i),a.slice(0,1).addClass(l).end().slice(-1).addClass(o))},_removeClasses:function(e){x("."+I.clickedClass).removeClass(I.clickedClass),x("."+I.targetClass).removeClass(I.targetClass+" "+I.targetClass+"-first "+I.targetClass+"-last"),x("."+I.highlightClass).removeClass(I.highlightClass+" "+I.highlightClass+"-first "+I.highlightClass+"-last"),e&&(x("._"+O+"-t").removeClass("_"+O+"-t"),x("._"+O+"-h").removeClass("_"+O+"-h"))},_currentTarget:function(e){var t=I["target_"+e.data(O).i],n=e.data("ps2id-target"),a=n&&x(n)[0]?x(n)[0].getBoundingClientRect():e[0].getBoundingClientRect();if(void 0!==t){var s=e.offset().top,i=e.offset().left,l=t.from?t.from+s:s,o=t.to?t.to+s:s,r=t.fromX?t.fromX+i:i,c=t.toX?t.toX+i:i;return a.top>=o&&a.top<=l&&a.left>=c&&a.left<=r}var h=x(b).height(),u=x(b).width(),d=n?x(n).height():e.height(),g=n?x(n).width():e.width(),f=1+d/h,p=f,_=d<h?f*(h/d):f,w=1+g/u,m=w,S=g<u?w*(u/g):w,v=[a.top<=h/p,a.bottom>=h/_,a.left<=u/m,a.right>=u/S];if(I.highlightByNextTarget){var C=e.data(O).tn;if(C){var y=C[0].getBoundingClientRect();"vertical"===I.layout?v=[a.top<=h/2,y.top>h/2,1,1]:"horizontal"===I.layout&&(v=[1,1,a.left<=u/2,y.left>u/2])}}return v[0]&&v[1]&&v[2]&&v[3]},_scrollTo:function(){d=w._scrollSpeed.call(null),o=I.pageEndSmoothScroll?w._pageEndSmoothScroll.call(null):o;var e=x("html,body"),t=I.autoScrollSpeed?w._autoScrollSpeed.call(null):d,n=e.is(":animated")?I.scrollingEasing:I.scrollEasing,a=x(b).scrollTop(),s=x(b).scrollLeft();switch(r){case"horizontal":s!=o[1]&&(w._callbacks.call(null,"onStart"),e.stop().animate({scrollLeft:o[1]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")}));break;case"auto":var i;if(a!=o[0]||s!=o[1])if(w._callbacks.call(null,"onStart"),navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/))e.stop().animate({pageYOffset:o[0],pageXOffset:o[1]},{duration:t,easing:n,step:function(e,t){"pageXOffset"==t.prop?i=e:"pageYOffset"==t.prop&&b.scrollTo(i,e)}}).promise().then(function(){w._callbacks.call(null,"onComplete")});else e.stop().animate({scrollTop:o[0],scrollLeft:o[1]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")});break;default:a!=o[0]&&(w._callbacks.call(null,"onStart"),e.stop().animate({scrollTop:o[0]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")}))}},_pageEndSmoothScroll:function(){var e=x(c).height(),t=x(c).width(),n=x(b).height(),a=x(b).width();return[e-o[0]<n?e-n:o[0],t-o[1]<a?t-a:o[1]]},_scrollSpeed:function(){var a=I.scrollSpeed;return l&&l.length&&l.add(l.parent()).each(function(){var e=x(this);if(e.attr("class")){var t=e.attr("class").split(" ");for(var n in t)if(String(t[n]).match(/^ps2id-speed-\d+$/)){a=t[n].split("ps2id-speed-")[1];break}}}),parseInt(a)},_autoScrollSpeed:function(){var e=x(b).scrollTop(),t=x(b).scrollLeft(),n=x(c).height(),a=x(c).width(),s=[d+d*Math.floor(Math.abs(o[0]-e)/n*100)/100,d+d*Math.floor(Math.abs(o[1]-t)/a*100)/100];return Math.max.apply(Math,s)},_callbacks:function(e){if(I)switch(this[O]={trigger:s,clicked:l,target:i,scrollTo:{y:o[0],x:o[1]}},e){case"onStart":if(I.appendHash&&b.history&&b.history.pushState&&l&&l.length){var t="#"+l.attr("href").split("#")[1];t!==b.location.hash&&history.pushState("","",t)}I.onStart.call(null,this[O]);break;case"onComplete":I.onComplete.call(null,this[O])}},_reset:function(){r=h=u=!1},_isInit:function(){a||_.init.apply(this)},_live:function(){t=setTimeout(function(){I.live?x(w._highlightSelector()).length!==p&&w._setup.call(null):t&&clearTimeout(t),w._live.call(null)},1e3)},_easing:function(){function t(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}x.easing.easeInQuad=x.easing.easeInQuad||function(e){return e*e},x.easing.easeOutQuad=x.easing.easeOutQuad||function(e){return 1-(1-e)*(1-e)},x.easing.easeInOutQuad=x.easing.easeInOutQuad||function(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},x.easing.easeInCubic=x.easing.easeInCubic||function(e){return e*e*e},x.easing.easeOutCubic=x.easing.easeOutCubic||function(e){return 1-Math.pow(1-e,3)},x.easing.easeInOutCubic=x.easing.easeInOutCubic||function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},x.easing.easeInQuart=x.easing.easeInQuart||function(e){return e*e*e*e},x.easing.easeOutQuart=x.easing.easeOutQuart||function(e){return 1-Math.pow(1-e,4)},x.easing.easeInOutQuart=x.easing.easeInOutQuart||function(e){return e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2},x.easing.easeInQuint=x.easing.easeInQuint||function(e){return e*e*e*e*e},x.easing.easeOutQuint=x.easing.easeOutQuint||function(e){return 1-Math.pow(1-e,5)},x.easing.easeInOutQuint=x.easing.easeInOutQuint||function(e){return e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2},x.easing.easeInExpo=x.easing.easeInExpo||function(e){return 0===e?0:Math.pow(2,10*e-10)},x.easing.easeOutExpo=x.easing.easeOutExpo||function(e){return 1===e?1:1-Math.pow(2,-10*e)},x.easing.easeInOutExpo=x.easing.easeInOutExpo||function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2},x.easing.easeInSine=x.easing.easeInSine||function(e){return 1-Math.cos(e*Math.PI/2)},x.easing.easeOutSine=x.easing.easeOutSine||function(e){return Math.sin(e*Math.PI/2)},x.easing.easeInOutSine=x.easing.easeInOutSine||function(e){return-(Math.cos(Math.PI*e)-1)/2},x.easing.easeInCirc=x.easing.easeInCirc||function(e){return 1-Math.sqrt(1-Math.pow(e,2))},x.easing.easeOutCirc=x.easing.easeOutCirc||function(e){return Math.sqrt(1-Math.pow(e-1,2))},x.easing.easeInOutCirc=x.easing.easeInOutCirc||function(e){return e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2},x.easing.easeInElastic=x.easing.easeInElastic||function(e){return 0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*(2*Math.PI/3))},x.easing.easeOutElastic=x.easing.easeOutElastic||function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*(2*Math.PI/3))+1},x.easing.easeInOutElastic=x.easing.easeInOutElastic||function(e){return 0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2+1},x.easing.easeInBack=x.easing.easeInBack||function(e){return 2.70158*e*e*e-1.70158*e*e},x.easing.easeOutBack=x.easing.easeOutBack||function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)},x.easing.easeInOutBack=x.easing.easeInOutBack||function(e){return e<.5?Math.pow(2*e,2)*(7.189819*e-2.5949095)/2:(Math.pow(2*e-2,2)*(3.5949095*(2*e-2)+2.5949095)+2)/2},x.easing.easeInBounce=x.easing.easeInBounce||function(e){return 1-t(1-e)},x.easing.easeOutBounce=x.easing.easeOutBounce||t,x.easing.easeInOutBounce=x.easing.easeInOutBounce||function(e){return e<.5?(1-t(1-2*e))/2:(1+t(2*e-1))/2}}};w._easing.call(),x.fn[g]=function(e){return _[e]?_[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void x.error("Method "+e+" does not exist"):_.init.apply(this,arguments)},x[g]=function(e){return _[e]?_[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void x.error("Method "+e+" does not exist"):_.init.apply(this,arguments)},x[g].defaults=f}(jQuery,window,document),function(l){var o="mPS2id",r=mPS2id_params,c=r.shortcode_class,h=location.hash||null,u=function(e,t){try{l(e)}catch(e){return!1}return l(e).length&&(t||l("a[href*='"+e+"']").filter(function(){return 1==l(this).data(o+"Element")}).length)},d=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return{y:t[0]||"0",x:t[1]||"0"}},g=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return[t[0]||"0",t[1]||"0"]},f=function(e){"horizontal"!==e&&l(window).scrollTop(0),"vertical"!==e&&l(window).scrollLeft(0)},p=function(e,t){for(var n=e.click.length-1;0<=n;n--){var a=e.click[n];a&&"mPS2id"!=a.namespace&&('a[href*="#"]'===a.selector?a.selector='a[href*="#"]:not(._mPS2id-h)':"a[href*=#]:not([href=#])"===a.selector?a.selector="a[href*=#]:not([href=#]):not(._mPS2id-h)":a.selector&&-1!==a.selector.indexOf("mobmenu")?t.off("click"):t.off("click",a.handler))}},_="a[data-ps2id-api='true'][href*='#'],.ps2id > a[href*='#'],a.ps2id[href*='#']";l(document).ready(function(){for(var e=0;e<r.total_instances;e++){var t=l("[class*='ps2id-id-']");if(t.length&&t.each(function(){var e,t=l(this),n=t.attr("class").split(" ");if(!t.attr("id"))for(var a in n)if(String(n[a]).match(/^ps2id-id-\S+$/)){e=n[a].split("ps2id-id-")[1],l("#"+e).length||t.attr("id",e);break}}),"true"===r.instances[o+"_instance_"+e].scrollToHash&&h&&(l(r.instances[o+"_instance_"+e].selector+",."+c+","+_).not(r.instances[o+"_instance_"+e].excludeSelector).each(function(){l(this).data(o+"Element",!0)}),u(h,"true"===r.instances[o+"_instance_"+e].scrollToHashForAll))){var n="true"===r.instances[o+"_instance_"+e].scrollToHashRemoveUrlHash?window.location.href.replace(/#.*$/,""):window.location.href.replace(/#.*$/,"#");f(r.instances[o+"_instance_"+e].layout),window.history&&window.history.replaceState?window.history.replaceState("","",n):window.location.href=n}}l("html").css("scroll-behavior","auto"),window.twentytwenty&&window.twentytwenty.smoothScroll&&(window.twentytwenty.smoothScroll=null)}),l(window).on("load",function(){for(var e=0;e<r.total_instances;e++){var n=l(r.instances[o+"_instance_"+e].selector+",."+c+","+_),t=r.instances[o+"_instance_"+e].autoCorrectScroll,a=0;if(window.ps2id_special_params&&(window.ps2id_special_params.highlightSelector&&(r.instances[o+"_instance_"+e].highlightSelector=window.ps2id_special_params.highlightSelector),window.ps2id_special_params.scrollSpeed&&(r.instances[o+"_instance_"+e].scrollSpeed=window.ps2id_special_params.scrollSpeed),window.ps2id_special_params.scrollEasing&&(r.instances[o+"_instance_"+e].scrollEasing=window.ps2id_special_params.scrollEasing),void 0!==window.ps2id_special_params.forceSingleHighlight&&(r.instances[o+"_instance_"+e].forceSingleHighlight=window.ps2id_special_params.forceSingleHighlight),void 0!==window.ps2id_special_params.keepHighlightUntilNext&&(r.instances[o+"_instance_"+e].keepHighlightUntilNext=window.ps2id_special_params.keepHighlightUntilNext),void 0!==window.ps2id_special_params.appendHash&&(r.instances[o+"_instance_"+e].appendHash=window.ps2id_special_params.appendHash),window.ps2id_special_params.layout&&(r.instances[o+"_instance_"+e].layout=window.ps2id_special_params.layout),window.ps2id_special_params.offset&&(r.instances[o+"_instance_"+e].offset=window.ps2id_special_params.offset)),n.mPageScroll2id({scrollSpeed:r.instances[o+"_instance_"+e].scrollSpeed,autoScrollSpeed:"true"===r.instances[o+"_instance_"+e].autoScrollSpeed,scrollEasing:r.instances[o+"_instance_"+e].scrollEasing,scrollingEasing:r.instances[o+"_instance_"+e].scrollingEasing,pageEndSmoothScroll:"true"===r.instances[o+"_instance_"+e].pageEndSmoothScroll,layout:r.instances[o+"_instance_"+e].layout,offset:d(r.instances[o+"_instance_"+e].offset.toString()),highlightSelector:r.instances[o+"_instance_"+e].highlightSelector,clickedClass:r.instances[o+"_instance_"+e].clickedClass,targetClass:r.instances[o+"_instance_"+e].targetClass,highlightClass:r.instances[o+"_instance_"+e].highlightClass,forceSingleHighlight:"true"===r.instances[o+"_instance_"+e].forceSingleHighlight,keepHighlightUntilNext:"true"===r.instances[o+"_instance_"+e].keepHighlightUntilNext,highlightByNextTarget:"true"===r.instances[o+"_instance_"+e].highlightByNextTarget,disablePluginBelow:g(r.instances[o+"_instance_"+e].disablePluginBelow.toString()),appendHash:"true"===r.instances[o+"_instance_"+e].appendHash,onStart:function(){"true"===t&&"selector"===mPS2id.trigger&&a++},onComplete:function(){1==a&&(mPS2id.clicked.length&&mPS2id.clicked.trigger("click.mPS2id"),a=0)},excludeSelectors:r.instances[o+"_instance_"+e].excludeSelector,encodeLinks:"true"===r.instances[o+"_instance_"+e].encodeLinks,liveSelector:r.instances[o+"_instance_"+e].selector+",."+c+","+_}),"true"===r.instances[o+"_instance_"+e].scrollToHash&&h&&u(h,"true"===r.instances[o+"_instance_"+e].scrollToHashForAll)){f(r.instances[o+"_instance_"+e].layout);var s=r.instances[o+"_instance_"+e].scrollToHashUseElementData,i=l("a._mPS2id-h[href$='"+h+"'][data-ps2id-offset]:not([data-ps2id-offset=''])").last();setTimeout(function(){"true"===s&&i.length?i.trigger("click.mPS2id"):l.mPageScroll2id("scrollTo",h),-1!==window.location.href.indexOf("#")&&(window.history&&window.history.replaceState?window.history.replaceState("","",h):window.location.hash=h)},r.instances[o+"_instance_"+e].scrollToHashDelay)}"true"===r.instances[o+"_instance_"+e].unbindUnrelatedClickEvents&&setTimeout(function(){var e=n.length?l._data(n[0],"events"):null,t=n.length?l._data(l(document)[0],"events"):null;e&&p(e,n),t&&p(t,n)},300),"true"===r.instances[o+"_instance_"+e].normalizeAnchorPointTargets&&l("a._mPS2id-t[id]:empty").css({display:"inline-block","line-height":0,width:0,height:0,border:"none"}),"true"===r.instances[o+"_instance_"+e].stopScrollOnUserAction&&l(document).on("mousewheel DOMMouseScroll touchmove",function(){var e=l("html,body");e.is(":animated")&&e.stop()})}}),l.extend(l.expr[":"],{absolute:l.expr[":"].absolute||function(e){return"absolute"===l(e).css("position")},relative:l.expr[":"].relative||function(e){return"relative"===l(e).css("position")},static:l.expr[":"].static||function(e){return"static"===l(e).css("position")},fixed:l.expr[":"].fixed||function(e){return"fixed"===l(e).css("position")},width:l.expr[":"].width||function(e,t,n){var a=n[3].replace("&lt;","<").replace("&gt;",">");return!!a&&(">"===a.substr(0,1)?l(e).width()>a.substr(1):"<"===a.substr(0,1)?l(e).width()<a.substr(1):l(e).width()===parseInt(a))},height:l.expr[":"].height||function(e,t,n){var a=n[3].replace("&lt;","<").replace("&gt;",">");return!!a&&(">"===a.substr(0,1)?l(e).height()>a.substr(1):"<"===a.substr(0,1)?l(e).height()<a.substr(1):l(e).height()===parseInt(a))}})}(jQuery);
1
+ /* Page scroll to id - version 1.6.9 */
2
+ !function(y,O,c,e){var n,b,s,a,l,i,o,r,h,u,t,d,f="mPageScroll2id",I="mPS2id",g={scrollSpeed:1e3,autoScrollSpeed:!0,scrollEasing:"easeInOutQuint",scrollingEasing:"easeOutQuint",pageEndSmoothScroll:!0,layout:"vertical",offset:0,highlightSelector:!1,clickedClass:I+"-clicked",targetClass:I+"-target",highlightClass:I+"-highlight",forceSingleHighlight:!1,keepHighlightUntilNext:!1,highlightByNextTarget:!1,disablePluginBelow:!1,clickEvents:!0,appendHash:!1,onStart:function(){},onComplete:function(){},defaultSelector:!1,live:!0,liveSelector:!1,excludeSelectors:!1,encodeLinks:!1},p=0,_={init:function(e){e=y.extend(!0,{},g,e);if(y(c).data(I,e),b=y(c).data(I),!this.selector){var t="__"+I;this.each(function(){var e=y(this);e.hasClass(t)||e.addClass(t)}),this.selector="."+t}b.liveSelector&&(this.selector+=","+b.liveSelector),n=n?n+","+this.selector:this.selector,b.defaultSelector&&("object"==typeof y(n)&&0!==y(n).length||(n=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id'],._ps2id")),b.clickEvents&&y(c).undelegate("."+I).delegate(n,"click."+I,function(e){if(w._isDisabled.call(null))w._removeClasses.call(null);else{var t=y(this),n=t.attr("href"),s=t.prop("href").baseVal||t.prop("href");b.excludeSelectors&&t.is(b.excludeSelectors)||n&&-1!==n.indexOf("#/")||(w._reset.call(null),u=t.data("ps2id-offset")||0,w._isValid.call(null,n,s)&&w._findTarget.call(null,n)&&(e.preventDefault(),a="selector",l=t,w._setClasses.call(null,!0),w._scrollTo.call(null)))}}),y(O).unbind("."+I).bind("scroll."+I+" resize."+I,function(){if(w._isDisabled.call(null))w._removeClasses.call(null);else{var a=y("._"+I+"-t");a.each(function(e){var t=y(this),n=t.attr("id"),s=w._findHighlight.call(null,n);w._setClasses.call(null,!1,t,s),e==a.length-1&&w._extendClasses.call(null)})}}),s=!0,w._setup.call(null),w._live.call(null)},scrollTo:function(e,t){if(w._isDisabled.call(null))w._removeClasses.call(null);else if(e&&void 0!==e){w._isInit.call(null);var n={layout:b.layout,offset:b.offset,clicked:!1};t=y.extend(!0,{},n,t);w._reset.call(null),r=t.layout,h=t.offset,e=-1!==e.indexOf("#")?e:"#"+e,w._isValid.call(null,e)&&w._findTarget.call(null,e)&&(a="scrollTo",(l=t.clicked)&&w._setClasses.call(null,!0),w._scrollTo.call(null))}},destroy:function(){y(O).unbind("."+I),y(c).undelegate("."+I).removeData(I),y("._"+I+"-t").removeData(I),w._removeClasses.call(null,!0)}},w={_isDisabled:function(){var e=O,t="inner",n=b.disablePluginBelow instanceof Array?[b.disablePluginBelow[0]||0,b.disablePluginBelow[1]||0]:[b.disablePluginBelow||0,0];return"innerWidth"in O||(t="client",e=c.documentElement||c.body),e[t+"Width"]<=n[0]||e[t+"Height"]<=n[1]},_isValid:function(e,t){if(e){var n=-1!==(t=t||e).indexOf("#/")?t.split("#/")[0]:t.split("#")[0],s=(O.location!==O.parent.location?O.parent.location:O.location).toString().split("#")[0];return"#"!==e&&-1!==e.indexOf("#")&&(""===n||decodeURIComponent(n)===decodeURIComponent(s))}},_setup:function(){var l=w._highlightSelector(),o=1,r=0;return y(l).each(function(){var e=y(this),t=e.attr("href"),n=e.prop("href").baseVal||e.prop("href");if(w._isValid.call(null,t,n)){if(b.excludeSelectors&&e.is(b.excludeSelectors))return;var s=-1!==t.indexOf("#/")?t.split("#/")[1]:t.split("#")[1],a=-1!==s.indexOf("%")?y(c.getElementById(s)):y("#"+s);if(0<a.length){b.highlightByNextTarget&&a!==r&&(r?r.data(I,{tn:a}):a.data(I,{tn:"0"}),r=a),a.hasClass("_"+I+"-t")||a.addClass("_"+I+"-t"),a.data(I,{i:o}),e.hasClass("_"+I+"-h")||e.addClass("_"+I+"-h");var i=w._findHighlight.call(null,s);w._setClasses.call(null,!1,a,i),p=o,++o==y(l).length&&w._extendClasses.call(null)}}})},_highlightSelector:function(){return b.highlightSelector&&""!==b.highlightSelector?b.highlightSelector:n},_findTarget:function(e){var t=-1!==e.indexOf("#/")?e.split("#/")[1]:e.split("#")[1],n=-1!==t.indexOf("%")?y(c.getElementById(t)):y("#"+t);if(n.length<1||"fixed"===n.css("position")){if("top"!==t)return;n=y("body")}return i=n,r||(r=b.layout),h=w._setOffset.call(null),(o=[(n.offset().top-h[0]).toString(),(n.offset().left-h[1]).toString()])[0]=o[0]<0?0:o[0],o[1]=o[1]<0?0:o[1],o},_setOffset:function(){var e,t,n,s;switch(h||(h=b.offset?b.offset:0),u&&(h=u),typeof h){case"object":case"string":0<(t=[(e=[h.y?h.y:h,h.x?h.x:h])[0]instanceof jQuery?e[0]:y(e[0]),e[1]instanceof jQuery?e[1]:y(e[1])])[0].length?(n=t[0].height(),"fixed"===t[0].css("position")&&(n+=t[0][0].offsetTop)):n=!isNaN(parseFloat(e[0]))&&isFinite(e[0])?parseInt(e[0]):0,0<t[1].length?(s=t[1].width(),"fixed"===t[1].css("position")&&(s+=t[1][0].offsetLeft)):s=!isNaN(parseFloat(e[1]))&&isFinite(e[1])?parseInt(e[1]):0;break;case"function":(e=h.call(null))instanceof Array?(n=e[0],s=e[1]):n=s=e;break;default:n=s=parseInt(h)}return[n,s]},_findHighlight:function(e){var t=O.location!==O.parent.location?O.parent.location:O.location,n=t.toString().split("#")[0],s=t.pathname;if(-1!==n.indexOf("'")&&(n=n.replace("'","\\'")),-1!==s.indexOf("'")&&(s=s.replace("'","\\'")),n=decodeURIComponent(n),s=decodeURIComponent(s),b.encodeLinks){var a=encodeURI(n).toLowerCase(),i=encodeURI(s).toLowerCase();return y("._"+I+"-h[href='#"+e+"'],._"+I+"-h[href='"+n+"#"+e+"'],._"+I+"-h[href='"+s+"#"+e+"'],._"+I+"-h[href='#/"+e+"'],._"+I+"-h[href='"+n+"#/"+e+"'],._"+I+"-h[href='"+s+"#/"+e+"'],._"+I+"-h[href='"+a+"#/"+e+"'],._"+I+"-h[href='"+a+"#"+e+"'],._"+I+"-h[href='"+i+"#/"+e+"'],._"+I+"-h[href='"+i+"#"+e+"']")}return y("._"+I+"-h[href='#"+e+"'],._"+I+"-h[href='"+n+"#"+e+"'],._"+I+"-h[href='"+s+"#"+e+"'],._"+I+"-h[href='#/"+e+"'],._"+I+"-h[href='"+n+"#/"+e+"'],._"+I+"-h[href='"+s+"#/"+e+"']")},_setClasses:function(e,t,n){var s=b.clickedClass,a=b.targetClass,i=b.highlightClass;e&&s&&""!==s?(y("."+s).removeClass(s),l.addClass(s)):t&&a&&""!==a&&n&&i&&""!==i&&(w._currentTarget.call(null,t)?(t.addClass(a),n.addClass(i)):(!b.keepHighlightUntilNext||1<y("."+i).length)&&(t.removeClass(a),n.removeClass(i)))},_extendClasses:function(){var e=b.targetClass,t=b.highlightClass,n=y("."+e),s=y("."+t),a=e+"-first",i=e+"-last",l=t+"-first",o=t+"-last";y("._"+I+"-t").removeClass(a+" "+i),y("._"+I+"-h").removeClass(l+" "+o),b.forceSingleHighlight?b.keepHighlightUntilNext&&1<n.length?(n.slice(0,1).removeClass(e),s.slice(0,1).removeClass(t)):(n.slice(1).removeClass(e),s.slice(1).removeClass(t)):(n.slice(0,1).addClass(a).end().slice(-1).addClass(i),s.slice(0,1).addClass(l).end().slice(-1).addClass(o))},_removeClasses:function(e){y("."+b.clickedClass).removeClass(b.clickedClass),y("."+b.targetClass).removeClass(b.targetClass+" "+b.targetClass+"-first "+b.targetClass+"-last"),y("."+b.highlightClass).removeClass(b.highlightClass+" "+b.highlightClass+"-first "+b.highlightClass+"-last"),e&&(y("._"+I+"-t").removeClass("_"+I+"-t"),y("._"+I+"-h").removeClass("_"+I+"-h"))},_currentTarget:function(e){if(e.data(I)){var t=b["target_"+e.data(I).i],n=e.data("ps2id-target"),s=n&&y(n)[0]?y(n)[0].getBoundingClientRect():e[0].getBoundingClientRect();if(void 0!==t){var a=e.offset().top,i=e.offset().left,l=t.from?t.from+a:a,o=t.to?t.to+a:a,r=t.fromX?t.fromX+i:i,c=t.toX?t.toX+i:i;return s.top>=o&&s.top<=l&&s.left>=c&&s.left<=r}var h=y(O).height(),u=y(O).width(),d=n?y(n).height():e.height(),f=n?y(n).width():e.width(),g=1+d/h,p=g,_=d<h?g*(h/d):g,w=1+f/u,m=w,S=f<u?w*(u/f):w,v=[s.top<=h/p,s.bottom>=h/_,s.left<=u/m,s.right>=u/S];if(b.highlightByNextTarget){var C=e.data(I).tn;if(C){var x=C[0].getBoundingClientRect();"vertical"===b.layout?v=[s.top<=h/2,x.top>h/2,1,1]:"horizontal"===b.layout&&(v=[1,1,s.left<=u/2,x.left>u/2])}}return v[0]&&v[1]&&v[2]&&v[3]}},_scrollTo:function(){d=w._scrollSpeed.call(null),o=b.pageEndSmoothScroll?w._pageEndSmoothScroll.call(null):o;var e=y("html,body"),t=b.autoScrollSpeed?w._autoScrollSpeed.call(null):d,n=e.is(":animated")?b.scrollingEasing:b.scrollEasing,s=y(O).scrollTop(),a=y(O).scrollLeft();switch(r){case"horizontal":a!=o[1]&&(w._callbacks.call(null,"onStart"),e.stop().animate({scrollLeft:o[1]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")}));break;case"auto":var i;if(s!=o[0]||a!=o[1])if(w._callbacks.call(null,"onStart"),navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/))e.stop().animate({pageYOffset:o[0],pageXOffset:o[1]},{duration:t,easing:n,step:function(e,t){"pageXOffset"==t.prop?i=e:"pageYOffset"==t.prop&&O.scrollTo(i,e)}}).promise().then(function(){w._callbacks.call(null,"onComplete")});else e.stop().animate({scrollTop:o[0],scrollLeft:o[1]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")});break;default:s!=o[0]&&(w._callbacks.call(null,"onStart"),e.stop().animate({scrollTop:o[0]},t,n).promise().then(function(){w._callbacks.call(null,"onComplete")}))}},_pageEndSmoothScroll:function(){var e=y(c).height(),t=y(c).width(),n=y(O).height(),s=y(O).width();return[e-o[0]<n?e-n:o[0],t-o[1]<s?t-s:o[1]]},_scrollSpeed:function(){var s=b.scrollSpeed;return l&&l.length&&l.add(l.parent()).each(function(){var e=y(this);if(e.attr("class")){var t=e.attr("class").split(" ");for(var n in t)if(String(t[n]).match(/^ps2id-speed-\d+$/)){s=t[n].split("ps2id-speed-")[1];break}}}),parseInt(s)},_autoScrollSpeed:function(){var e=y(O).scrollTop(),t=y(O).scrollLeft(),n=y(c).height(),s=y(c).width(),a=[d+d*Math.floor(Math.abs(o[0]-e)/n*100)/100,d+d*Math.floor(Math.abs(o[1]-t)/s*100)/100];return Math.max.apply(Math,a)},_callbacks:function(e){if(b)switch(this[I]={trigger:a,clicked:l,target:i,scrollTo:{y:o[0],x:o[1]}},e){case"onStart":if(b.appendHash&&O.history&&O.history.pushState&&l&&l.length){var t="#"+l.attr("href").split("#")[1];t!==O.location.hash&&history.pushState("","",t)}b.onStart.call(null,this[I]);break;case"onComplete":b.onComplete.call(null,this[I])}},_reset:function(){r=h=u=!1},_isInit:function(){s||_.init.apply(this)},_live:function(){t=setTimeout(function(){b.live?y(w._highlightSelector()).length!==p&&w._setup.call(null):t&&clearTimeout(t),w._live.call(null)},1e3)},_easing:function(){function t(e){var t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375}y.easing.easeInQuad=y.easing.easeInQuad||function(e){return e*e},y.easing.easeOutQuad=y.easing.easeOutQuad||function(e){return 1-(1-e)*(1-e)},y.easing.easeInOutQuad=y.easing.easeInOutQuad||function(e){return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2},y.easing.easeInCubic=y.easing.easeInCubic||function(e){return e*e*e},y.easing.easeOutCubic=y.easing.easeOutCubic||function(e){return 1-Math.pow(1-e,3)},y.easing.easeInOutCubic=y.easing.easeInOutCubic||function(e){return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2},y.easing.easeInQuart=y.easing.easeInQuart||function(e){return e*e*e*e},y.easing.easeOutQuart=y.easing.easeOutQuart||function(e){return 1-Math.pow(1-e,4)},y.easing.easeInOutQuart=y.easing.easeInOutQuart||function(e){return e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2},y.easing.easeInQuint=y.easing.easeInQuint||function(e){return e*e*e*e*e},y.easing.easeOutQuint=y.easing.easeOutQuint||function(e){return 1-Math.pow(1-e,5)},y.easing.easeInOutQuint=y.easing.easeInOutQuint||function(e){return e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2},y.easing.easeInExpo=y.easing.easeInExpo||function(e){return 0===e?0:Math.pow(2,10*e-10)},y.easing.easeOutExpo=y.easing.easeOutExpo||function(e){return 1===e?1:1-Math.pow(2,-10*e)},y.easing.easeInOutExpo=y.easing.easeInOutExpo||function(e){return 0===e?0:1===e?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2},y.easing.easeInSine=y.easing.easeInSine||function(e){return 1-Math.cos(e*Math.PI/2)},y.easing.easeOutSine=y.easing.easeOutSine||function(e){return Math.sin(e*Math.PI/2)},y.easing.easeInOutSine=y.easing.easeInOutSine||function(e){return-(Math.cos(Math.PI*e)-1)/2},y.easing.easeInCirc=y.easing.easeInCirc||function(e){return 1-Math.sqrt(1-Math.pow(e,2))},y.easing.easeOutCirc=y.easing.easeOutCirc||function(e){return Math.sqrt(1-Math.pow(e-1,2))},y.easing.easeInOutCirc=y.easing.easeInOutCirc||function(e){return e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2},y.easing.easeInElastic=y.easing.easeInElastic||function(e){return 0===e?0:1===e?1:-Math.pow(2,10*e-10)*Math.sin((10*e-10.75)*(2*Math.PI/3))},y.easing.easeOutElastic=y.easing.easeOutElastic||function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin((10*e-.75)*(2*Math.PI/3))+1},y.easing.easeInOutElastic=y.easing.easeInOutElastic||function(e){return 0===e?0:1===e?1:e<.5?-Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2+1},y.easing.easeInBack=y.easing.easeInBack||function(e){return 2.70158*e*e*e-1.70158*e*e},y.easing.easeOutBack=y.easing.easeOutBack||function(e){return 1+2.70158*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)},y.easing.easeInOutBack=y.easing.easeInOutBack||function(e){return e<.5?Math.pow(2*e,2)*(7.189819*e-2.5949095)/2:(Math.pow(2*e-2,2)*(3.5949095*(2*e-2)+2.5949095)+2)/2},y.easing.easeInBounce=y.easing.easeInBounce||function(e){return 1-t(1-e)},y.easing.easeOutBounce=y.easing.easeOutBounce||t,y.easing.easeInOutBounce=y.easing.easeInOutBounce||function(e){return e<.5?(1-t(1-2*e))/2:(1+t(2*e-1))/2}}};w._easing.call(),y.fn[f]=function(e){return _[e]?_[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void y.error("Method "+e+" does not exist"):_.init.apply(this,arguments)},y[f]=function(e){return _[e]?_[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void y.error("Method "+e+" does not exist"):_.init.apply(this,arguments)},y[f].defaults=g}(jQuery,window,document),function(l){var o="mPS2id",r=mPS2id_params,c=r.shortcode_class,h=location.hash||null,u=function(e,t){try{l(e)}catch(e){return!1}return l(e).length&&(t||l("a[href*='"+e+"']").filter(function(){return 1==l(this).data(o+"Element")}).length)},d=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return{y:t[0]||"0",x:t[1]||"0"}},f=function(e){if(-1===e.indexOf(","))return e;var t=e.split(",");return[t[0]||"0",t[1]||"0"]},g=function(e){"horizontal"!==e&&l(window).scrollTop(0),"vertical"!==e&&l(window).scrollLeft(0)},p=function(e,t){for(var n=e.click.length-1;0<=n;n--){var s=e.click[n];s&&"mPS2id"!=s.namespace&&("a[href*=#]"===s.selector?s.selector="a[href*=#]:not(._mPS2id-h)":'a[href*="#"]'===s.selector?s.selector='a[href*="#"]:not(._mPS2id-h)':"a[href*=#]:not([href=#])"===s.selector?s.selector="a[href*=#]:not([href=#]):not(._mPS2id-h)":'a[href*="#"]:not([href="#"])'===s.selector?s.selector='a[href*="#"]:not([href="#"]):not(._mPS2id-h)':s.selector&&-1!==s.selector.indexOf("mobmenu")?t.off("click"):t.off("click",s.handler))}},_="a[data-ps2id-api='true'][href*='#'],.ps2id > a[href*='#'],a.ps2id[href*='#']";l(function(){for(var e=0;e<r.total_instances;e++){var t=l("[class*='ps2id-id-']");if(t.length&&t.each(function(){var e,t=l(this),n=t.attr("class").split(" ");if(!t.attr("id"))for(var s in n)if(String(n[s]).match(/^ps2id-id-\S+$/)){e=n[s].split("ps2id-id-")[1],l("#"+e).length||t.attr("id",e);break}}),"true"===r.instances[o+"_instance_"+e].scrollToHash&&h&&(l(r.instances[o+"_instance_"+e].selector+",."+c+","+_).not(r.instances[o+"_instance_"+e].excludeSelector).each(function(){l(this).data(o+"Element",!0)}),u(h,"true"===r.instances[o+"_instance_"+e].scrollToHashForAll))){var n="true"===r.instances[o+"_instance_"+e].scrollToHashRemoveUrlHash?window.location.href.replace(/#.*$/,""):window.location.href.replace(/#.*$/,"#");g(r.instances[o+"_instance_"+e].layout),window.history&&window.history.replaceState?window.history.replaceState("","",n):window.location.href=n}}l("html").css("scroll-behavior","auto"),window.twentytwenty&&window.twentytwenty.smoothScroll&&(window.twentytwenty.smoothScroll=null)}),l(window).on("load",function(){for(var e=0;e<r.total_instances;e++){0<=r.instances[o+"_instance_"+e].selector.indexOf("a[href*=#]:not([href=#])")&&console.log("ps2id selector issue: a[href*=#]:not([href=#]) selector needs quotes"),0<=r.instances[o+"_instance_"+e].excludeSelector.indexOf("a[href*=#]:not([href=#])")&&console.log("ps2id excluded selector issue: a[href*=#]:not([href=#]) selector needs quotes");var n=l(r.instances[o+"_instance_"+e].selector+",."+c+","+_),t=r.instances[o+"_instance_"+e].autoCorrectScroll,s=0;if(window.ps2id_special_params&&(window.ps2id_special_params.highlightSelector&&(r.instances[o+"_instance_"+e].highlightSelector=window.ps2id_special_params.highlightSelector),window.ps2id_special_params.scrollSpeed&&(r.instances[o+"_instance_"+e].scrollSpeed=window.ps2id_special_params.scrollSpeed),window.ps2id_special_params.scrollEasing&&(r.instances[o+"_instance_"+e].scrollEasing=window.ps2id_special_params.scrollEasing),void 0!==window.ps2id_special_params.forceSingleHighlight&&(r.instances[o+"_instance_"+e].forceSingleHighlight=window.ps2id_special_params.forceSingleHighlight),void 0!==window.ps2id_special_params.keepHighlightUntilNext&&(r.instances[o+"_instance_"+e].keepHighlightUntilNext=window.ps2id_special_params.keepHighlightUntilNext),void 0!==window.ps2id_special_params.appendHash&&(r.instances[o+"_instance_"+e].appendHash=window.ps2id_special_params.appendHash),window.ps2id_special_params.layout&&(r.instances[o+"_instance_"+e].layout=window.ps2id_special_params.layout),window.ps2id_special_params.offset&&(r.instances[o+"_instance_"+e].offset=window.ps2id_special_params.offset)),n.mPageScroll2id({scrollSpeed:r.instances[o+"_instance_"+e].scrollSpeed,autoScrollSpeed:"true"===r.instances[o+"_instance_"+e].autoScrollSpeed,scrollEasing:r.instances[o+"_instance_"+e].scrollEasing,scrollingEasing:r.instances[o+"_instance_"+e].scrollingEasing,pageEndSmoothScroll:"true"===r.instances[o+"_instance_"+e].pageEndSmoothScroll,layout:r.instances[o+"_instance_"+e].layout,offset:d(r.instances[o+"_instance_"+e].offset.toString()),highlightSelector:r.instances[o+"_instance_"+e].highlightSelector,clickedClass:r.instances[o+"_instance_"+e].clickedClass,targetClass:r.instances[o+"_instance_"+e].targetClass,highlightClass:r.instances[o+"_instance_"+e].highlightClass,forceSingleHighlight:"true"===r.instances[o+"_instance_"+e].forceSingleHighlight,keepHighlightUntilNext:"true"===r.instances[o+"_instance_"+e].keepHighlightUntilNext,highlightByNextTarget:"true"===r.instances[o+"_instance_"+e].highlightByNextTarget,disablePluginBelow:f(r.instances[o+"_instance_"+e].disablePluginBelow.toString()),appendHash:"true"===r.instances[o+"_instance_"+e].appendHash,onStart:function(){"true"===t&&"selector"===mPS2id.trigger&&s++},onComplete:function(){1==s&&(mPS2id.clicked.length&&mPS2id.clicked.trigger("click.mPS2id"),s=0)},excludeSelectors:r.instances[o+"_instance_"+e].excludeSelector,encodeLinks:"true"===r.instances[o+"_instance_"+e].encodeLinks,liveSelector:r.instances[o+"_instance_"+e].selector+",."+c+","+_}),"true"===r.instances[o+"_instance_"+e].scrollToHash&&h&&u(h,"true"===r.instances[o+"_instance_"+e].scrollToHashForAll)){g(r.instances[o+"_instance_"+e].layout);var a=r.instances[o+"_instance_"+e].scrollToHashUseElementData,i=l("a._mPS2id-h[href$='"+h+"'][data-ps2id-offset]:not([data-ps2id-offset=''])").last();setTimeout(function(){"true"===a&&i.length?i.trigger("click.mPS2id"):l.mPageScroll2id("scrollTo",h),-1!==window.location.href.indexOf("#")&&(window.history&&window.history.replaceState?window.history.replaceState("","",h):window.location.hash=h)},r.instances[o+"_instance_"+e].scrollToHashDelay)}"true"===r.instances[o+"_instance_"+e].unbindUnrelatedClickEvents&&setTimeout(function(){var e=n.length?l._data(n[0],"events"):null,t=n.length?l._data(l(document)[0],"events"):null;e&&p(e,n),t&&p(t,n)},300),"true"===r.instances[o+"_instance_"+e].normalizeAnchorPointTargets&&l("a._mPS2id-t[id]:empty").css({display:"inline-block","line-height":0,width:0,height:0,border:"none"}),"true"===r.instances[o+"_instance_"+e].stopScrollOnUserAction&&l(document).on("mousewheel DOMMouseScroll touchmove",function(){var e=l("html,body");e.is(":animated")&&e.stop()})}}),l.extend(l.expr[":"],{absolute:l.expr[":"].absolute||function(e){return"absolute"===l(e).css("position")},relative:l.expr[":"].relative||function(e){return"relative"===l(e).css("position")},static:l.expr[":"].static||function(e){return"static"===l(e).css("position")},fixed:l.expr[":"].fixed||function(e){return"fixed"===l(e).css("position")},width:l.expr[":"].width||function(e,t,n){var s=n[3].replace("&lt;","<").replace("&gt;",">");return!!s&&(">"===s.substr(0,1)?l(e).width()>s.substr(1):"<"===s.substr(0,1)?l(e).width()<s.substr(1):l(e).width()===parseInt(s))},height:l.expr[":"].height||function(e,t,n){var s=n[3].replace("&lt;","<").replace("&gt;",">");return!!s&&(">"===s.substr(0,1)?l(e).height()>s.substr(1):"<"===s.substr(0,1)?l(e).height()<s.substr(1):l(e).height()===parseInt(s))}})}(jQuery);
malihu-pagescroll2id.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Page scroll to id
4
  Plugin URI: http://manos.malihu.gr/page-scroll-to-id
5
  Description: Page scroll to id is an easy-to-use jQuery plugin that enables animated (smooth) page scrolling to specific id within the document.
6
- Version: 1.6.8
7
  Author: malihu
8
  Author URI: http://manos.malihu.gr
9
  License: MIT License (MIT)
@@ -47,7 +47,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
47
 
48
  class malihuPageScroll2id{ // --edit--
49
 
50
- protected $version='1.6.8'; // Plugin version --edit--
51
  protected $update_option=null;
52
 
53
  protected $plugin_name='Page scroll to id'; // Plugin name --edit--
3
  Plugin Name: Page scroll to id
4
  Plugin URI: http://manos.malihu.gr/page-scroll-to-id
5
  Description: Page scroll to id is an easy-to-use jQuery plugin that enables animated (smooth) page scrolling to specific id within the document.
6
+ Version: 1.6.9
7
  Author: malihu
8
  Author URI: http://manos.malihu.gr
9
  License: MIT License (MIT)
47
 
48
  class malihuPageScroll2id{ // --edit--
49
 
50
+ protected $version='1.6.9'; // Plugin version --edit--
51
  protected $update_option=null;
52
 
53
  protected $plugin_name='Page scroll to id'; // Plugin name --edit--
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: malihu
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
4
  Tags: page scrolling, page animation, smooth scroll, navigation, single-page navigation
5
  Requires at least: 3.3
6
- Tested up to: 5.4
7
- Stable tag: 1.6.8
8
  License: The MIT License (MIT)
9
  License URI: http://opensource.org/licenses/MIT
10
 
@@ -100,6 +100,14 @@ Because it works and it already has a ton of features. The plugin has little dep
100
 
101
  == Changelog ==
102
 
 
 
 
 
 
 
 
 
103
  = 1.6.8 =
104
 
105
  * Fixed PHP notice/warning regarding contextual_help being deprecated (https://wordpress.org/support/topic/deprecated-contextual_help-is-obsolete-since-version-3-3-0/).
@@ -256,6 +264,10 @@ Because it works and it already has a ton of features. The plugin has little dep
256
 
257
  == Upgrade Notice ==
258
 
 
 
 
 
259
  = 1.6.8 =
260
 
261
  Fixed PHP notice/warning regarding contextual_help, added new option 'Encode unicode characters on links URL', added support for newer jQuery versions (3.x) and the upcoming WordPress 5.6.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
4
  Tags: page scrolling, page animation, smooth scroll, navigation, single-page navigation
5
  Requires at least: 3.3
6
+ Tested up to: 5.5
7
+ Stable tag: 1.6.9
8
  License: The MIT License (MIT)
9
  License URI: http://opensource.org/licenses/MIT
10
 
100
 
101
  == Changelog ==
102
 
103
+ = 1.6.9 =
104
+
105
+ * Added warning message in plugin settings when the selector option value lacks quotes (invalid without jquery migrate or with jquery 3.x).
106
+ * Fixed Uncaught TypeError of undefined data when actual page is inside an iframe - [related issue](http://manos.malihu.gr/page-scroll-to-id-for-wordpress/comment-page-7/#comment-23715).
107
+ * Added 'Encode unicode characters on links URL' option in plugin settings help panel.
108
+ * Extended "Prevent other scripts from handling plugin’s links" option function handler.
109
+ * Replaced jQuery deprecated ready event in plugin script.
110
+
111
  = 1.6.8 =
112
 
113
  * Fixed PHP notice/warning regarding contextual_help being deprecated (https://wordpress.org/support/topic/deprecated-contextual_help-is-obsolete-since-version-3-3-0/).
264
 
265
  == Upgrade Notice ==
266
 
267
+ = 1.6.9 =
268
+
269
+ Added warning message in plugin settings when the selector option value lacks quotes, fixed Uncaught TypeError of undefined data when actual page is inside an iframe, Extended "Prevent other scripts from handling plugin’s links" option, updated help.
270
+
271
  = 1.6.8 =
272
 
273
  Fixed PHP notice/warning regarding contextual_help, added new option 'Encode unicode characters on links URL', added support for newer jQuery versions (3.x) and the upcoming WordPress 5.6.