Page scroll to id - Version 1.5.3

Version Description

  • Extended Offset option to accept element selectors in addition to fixed pixels values.
  • Added ps2id shortcode for creating links in content editor.
  • Added the ability to define link specific offsets via the html data attribute: data-ps2id-offset.
  • Fixed some minor issues for WordPress versions lower than 3.5.
  • Updated help and external links.
  • Changed plugin license from LGPL to MIT.
Download this release

Release Info

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

Code changes from version 1.5.2 to 1.5.3

includes/admin.php CHANGED
@@ -2,7 +2,7 @@
2
  // --edit--
3
  $repeatables=false;
4
  $shortcodes=false;
5
- $plugin_info=__('<a href="#" class="mPS2id-open-help mPS2id-open-help-overview">Overview</a>&nbsp;&nbsp;&nbsp;<a href="#" class="mPS2id-open-help mPS2id-open-help-get-started">Get started</a>&nbsp;&nbsp;&nbsp;<a href="#" class="mPS2id-open-help mPS2id-open-help-plugin-settings">Plugin settings</a>', $this->plugin_slug);
6
  $btn_add=__('Add instance', $this->plugin_slug);
7
  $btn_more_actions=__('More actions', $this->plugin_slug);
8
  $btn_reset=($repeatables) ? __('Delete all and reset to default', $this->plugin_slug) : __('Reset to default', $this->plugin_slug);
@@ -25,7 +25,7 @@ $toggle_instance_title=__('Click to toggle', $this->plugin_slug);
25
  <?php include_once(plugin_dir_path( __FILE__ ).'help/overview.inc'); ?>
26
  <p>
27
  <strong>For more information</strong> <br />
28
- <a href="http://manos.malihu.gr" target="_blank">Plugin homepage</a>&nbsp;&nbsp;&nbsp;<a href="http://manos.malihu.gr" target="_blank">Plugin documentation</a>
29
  </p>
30
  </div>
31
  <div class="oldwp-plugin-help-section oldwp-plugin-help-section-get-started">
@@ -34,6 +34,9 @@ $toggle_instance_title=__('Click to toggle', $this->plugin_slug);
34
  <div class="oldwp-plugin-help-section oldwp-plugin-help-section-plugin-settings">
35
  <?php include_once(plugin_dir_path( __FILE__ ).'help/plugin-settings.inc'); ?>
36
  </div>
 
 
 
37
  </div>
38
  <?php endif; ?>
39
 
2
  // --edit--
3
  $repeatables=false;
4
  $shortcodes=false;
5
+ $plugin_info=__('<a href="#" class="mPS2id-open-help mPS2id-open-help-overview">Overview</a>&nbsp;&nbsp;&nbsp;<a href="#" class="mPS2id-open-help mPS2id-open-help-get-started">Get started</a>&nbsp;&nbsp;&nbsp;<a href="#" class="mPS2id-open-help mPS2id-open-help-plugin-settings">Plugin settings</a>&nbsp;&nbsp;&nbsp;<a href="#" class="mPS2id-open-help mPS2id-open-help-shortcodes">Shortcodes</a>', $this->plugin_slug);
6
  $btn_add=__('Add instance', $this->plugin_slug);
7
  $btn_more_actions=__('More actions', $this->plugin_slug);
8
  $btn_reset=($repeatables) ? __('Delete all and reset to default', $this->plugin_slug) : __('Reset to default', $this->plugin_slug);
25
  <?php include_once(plugin_dir_path( __FILE__ ).'help/overview.inc'); ?>
26
  <p>
27
  <strong>For more information</strong> <br />
28
+ <a href="http://manos.malihu.gr/page-scroll-to-id" target="_blank">Plugin homepage</a>&nbsp;&nbsp;&nbsp;<a href="http://manos.malihu.gr/page-scroll-to-id/2/" target="_blank">Code examples &amp; short tutorials</a>
29
  </p>
30
  </div>
31
  <div class="oldwp-plugin-help-section oldwp-plugin-help-section-get-started">
34
  <div class="oldwp-plugin-help-section oldwp-plugin-help-section-plugin-settings">
35
  <?php include_once(plugin_dir_path( __FILE__ ).'help/plugin-settings.inc'); ?>
36
  </div>
37
+ <div class="oldwp-plugin-help-section oldwp-plugin-help-section-shortcodes">
38
+ <?php include_once(plugin_dir_path( __FILE__ ).'help/shortcodes.inc'); ?>
39
+ </div>
40
  </div>
41
  <?php endif; ?>
42
 
includes/help/get-started.inc CHANGED
@@ -25,6 +25,10 @@ $help_get_started_text=<<<EOD
25
  <code>a.mPS2id-highlight{ background: #ff0; }</code> or <code>.menu-item a.mPS2id-highlight{ background: #ff0; }</code> for highlighting custom menus links only.
26
  </p>
27
 
 
 
 
 
28
  EOD;
29
  ?>
30
 
25
  <code>a.mPS2id-highlight{ background: #ff0; }</code> or <code>.menu-item a.mPS2id-highlight{ background: #ff0; }</code> for highlighting custom menus links only.
26
  </p>
27
 
28
+ <p>
29
+ If you have a fixed-positioned menu which overlaps your target's content when page scrolling is completed, insert your menu selector in the Offset field. For example, inserting <code>#navigation-menu</code> will offset the scroll-to position according to the height/width/position of the element with id <code>navigation-menu</code>.
30
+ </p>
31
+
32
  EOD;
33
  ?>
34
 
includes/help/plugin-settings.inc CHANGED
@@ -33,7 +33,9 @@ $help_plugin_settings_text=<<<EOD
33
 
34
  <p>
35
  <strong>Offset</strong> -
36
- Defines the amount of pixels to offset the scroll-to position. The value can a be a positive or negative number. For example, setting offset to 50 will stop page scrolling 50 pixels before reaching the target.
 
 
37
  </p>
38
 
39
  <p>
@@ -45,10 +47,16 @@ $help_plugin_settings_text=<<<EOD
45
 
46
  <p>
47
  <strong>Classes</strong> -
48
- Set the classes added to links by the plugin: <br />
49
- 1. The class name for the link that's been clicked <br />
50
- 2. The class name for the (current) target element<br />
51
- 3. The class name for the (current) highlighted link <br />
 
 
 
 
 
 
52
  By checking "Force single highlight", only one highlighted element is allowed at a time.
53
  </p>
54
 
33
 
34
  <p>
35
  <strong>Offset</strong> -
36
+ Defines the amount of pixels to offset the scroll-to position. The value can a be a positive or negative number, or a matching element in your html. For example, setting Offset to 50 will stop page scrolling 50 pixels before reaching the target. <br />
37
+ If you need to offset scroll-to position accoring to the height or width of some element (e.g. accoring to a responsive, fixed-positioned navigation menu), insert its selector in the Offset field. For example, if you have a fixed menu with id <code>navigation-menu</code>, set Offset to <code>#navigation-menu</code> in order to stop page scrolling below it and avoid overlapping your content. <br />
38
+ You may also define link specific offsets by using the <code>ps2id</code> shortcode in your content, e.g. <code>[ps2id url='#id' offset='100']link[/ps2id]</code>.
39
  </p>
40
 
41
  <p>
47
 
48
  <p>
49
  <strong>Classes</strong> -
50
+ Set the classes added to links by the plugin:
51
+ </p>
52
+
53
+ <ol>
54
+ <li>The class name for the link that's been clicked </li>
55
+ <li>The class name for the (current) target element </li>
56
+ <li>The class name for the (current) highlighted link </li>
57
+ </ol>
58
+
59
+ <p>
60
  By checking "Force single highlight", only one highlighted element is allowed at a time.
61
  </p>
62
 
includes/help/shortcodes.inc ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $help_shortcodes_text=<<<EOD
3
+
4
+ <p>
5
+ <strong>Create link</strong> - <code>[ps2id url='#id' offset='0']link[/ps2id]</code>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Create link shrotcode attributes</strong>
10
+ </p>
11
+
12
+ <ul>
13
+ <li>
14
+ <code>url</code> - target element id <br />
15
+ Examples: <br />
16
+ <code>[ps2id url='#some-id']link[/ps2id]</code> <br />
17
+ <code>[ps2id url='http://somesite.com/somepage/#some-id']link[/ps2id]</code>
18
+ </li>
19
+ <li>
20
+ <code>offset</code> - link specific offset <br />
21
+ Examples: <br />
22
+ <code>[ps2id url='#id' offset='100']link[/ps2id]</code> - offset by 100 pixels <br />
23
+ <code>[ps2id url='#id' offset='#navigation-menu']link[/ps2id]</code> - offset by element's height/width/position <br />
24
+ <code>[ps2id url='#id' offset='{"y":"100","x":"50"}']link[/ps2id]</code> - offset vertically by 100 pixels and horizontally by 50
25
+ </li>
26
+ </ul>
27
+
28
+ EOD;
29
+ ?>
30
+
31
+ <?php _e($help_shortcodes_text, $this->plugin_slug); ?>
js/admin.js CHANGED
@@ -176,6 +176,11 @@
176
  openHelp("plugin-settings");
177
  });
178
 
 
 
 
 
 
179
  function openHelp(tab){
180
  if(wpVersion>=3.6){ //WP Contextual Help
181
  if(tab){
176
  openHelp("plugin-settings");
177
  });
178
 
179
+ $(".mPS2id-open-help-shortcodes").click(function(e){
180
+ e.preventDefault();
181
+ openHelp("shortcodes");
182
+ });
183
+
184
  function openHelp(tab){
185
  if(wpVersion>=3.6){ //WP Contextual Help
186
  if(tab){
js/jquery.malihu.PageScroll2id-init.js CHANGED
@@ -3,7 +3,9 @@
3
  var _p="mPS2id",
4
  _o=mPS2id_params;
5
  for(i=0; i<_o.total_instances; i++){
6
- $(_o.instances[_p+"_instance_"+i]["selector"]["value"]).mPageScroll2id({
 
 
7
  scrollSpeed:_o.instances[_p+"_instance_"+i]["scrollSpeed"]["value"],
8
  autoScrollSpeed:(_o.instances[_p+"_instance_"+i]["autoScrollSpeed"]["value"] === "true") ? true : false,
9
  scrollEasing:_o.instances[_p+"_instance_"+i]["scrollEasing"]["value"],
3
  var _p="mPS2id",
4
  _o=mPS2id_params;
5
  for(i=0; i<_o.total_instances; i++){
6
+ var shortcodeClass=_o.shortcode_class; // Shortcode without suffix
7
+ //var shortcodeClass=_o.shortcode_class+"_"+(i+1); // Shortcode with suffix
8
+ $(_o.instances[_p+"_instance_"+i]["selector"]["value"]+",."+shortcodeClass).mPageScroll2id({
9
  scrollSpeed:_o.instances[_p+"_instance_"+i]["scrollSpeed"]["value"],
10
  autoScrollSpeed:(_o.instances[_p+"_instance_"+i]["autoScrollSpeed"]["value"] === "true") ? true : false,
11
  scrollEasing:_o.instances[_p+"_instance_"+i]["scrollEasing"]["value"],
js/jquery.malihu.PageScroll2id.js CHANGED
@@ -1 +1 @@
1
- (function(d,h,l,e){var c="mPageScroll2id",i="mPS2id",s=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id']",j={scrollSpeed:1300,autoScrollSpeed:true,scrollEasing:"easeInOutExpo",scrollingEasing:"easeInOutCirc",pageEndSmoothScroll:true,layout:"vertical",offset:0,highlightSelector:false,clickedClass:i+"-clicked",targetClass:i+"-target",highlightClass:i+"-highlight",forceSingleHighlight:false,clickEvents:true,onStart:function(){},onComplete:function(){},defaultSelector:false},p,b,g,a,q,f,n,o,m,r={init:function(t){var t=d.extend(true,{},j,t);d(l).data(i,t);b=d(l).data(i);p=(!p)?this.selector:p+","+this.selector;if(b.defaultSelector){if(typeof d(p)!=="object"||d(p).length===0){p=s}}if(b.clickEvents){d(l).undelegate("."+i).delegate(p,"click."+i,function(w){var v=d(this),u=v.attr("href"),x=v.prop("href");if(u&&u.indexOf("#/")!==-1){return}k._reset.call(null);if(k._isValid.call(null,u,x)&&k._findTarget.call(null,u)){w.preventDefault();a="selector";q=v;k._setClasses.call(null,true);k._scrollTo.call(null)}})}d(h).unbind("."+i).bind("scroll."+i+" resize."+i,function(){var u=d("._"+i+"-t");u.each(function(){var v=d(this),x=v.attr("id"),w=k._findHighlight.call(null,x);k._setClasses.call(null,false,v,w)})});g=true;k._setup.call(null)},scrollTo:function(v,t){if(v&&typeof v!=="undefined"){k._isInit.call(null);var u={layout:b.layout,offset:b.offset,clicked:false},t=d.extend(true,{},u,t);k._reset.call(null);o=t.layout;m=t.offset;v=(v.indexOf("#")!==-1)?v:"#"+v;if(k._isValid.call(null,v)&&k._findTarget.call(null,v)){a="scrollTo";q=t.clicked;if(q){k._setClasses.call(null,true)}k._scrollTo.call(null)}}},destroy:function(){d(h).unbind("."+i);d(l).undelegate("."+i).removeData(i);d("."+b.clickedClass).removeClass(b.clickedClass);d("."+b.targetClass).removeClass(b.targetClass);d("."+b.highlightClass).removeClass(b.highlightClass);d("._"+i+"-t").removeData(i).removeClass("_"+i+"-t");d("._"+i+"-h").removeClass("_"+i+"-h")}},k={_isValid:function(t,w){if(!t){return}w=(!w)?t:w;var v=(w.indexOf("#/")!==-1)?w.split("#/")[0]:w.split("#")[0],u=h.location.toString().split("#")[0];return t!=="#"&&t.indexOf("#")!==-1&&(v===""||v===u)},_setup:function(){var u=(b.highlightSelector&&b.highlightSelector!=="")?b.highlightSelector:p,t=1;return d(u).each(function(){var y=d(this),v=y.attr("href"),A=y.prop("href");if(k._isValid.call(null,v,A)){var z=(v.indexOf("#/")!==-1)?v.split("#/")[1]:v.split("#")[1],w=d("#"+z);if(w.length>0){if(!w.hasClass("_"+i+"-t")){w.addClass("_"+i+"-t").data(i,{i:t})}if(!y.hasClass("_"+i+"-h")){y.addClass("_"+i+"-h")}var x=k._findHighlight.call(null,z);k._setClasses.call(null,false,w,x);t++}}})},_findTarget:function(v){var u=(v.indexOf("#/")!==-1)?v.split("#/")[1]:v.split("#")[1],t=d("#"+u);if(t.length<1||t.css("position")==="fixed"){if(u==="top"){t=d("body")}else{return}}f=t;if(!o){o=b.layout}if(!m){m=(b.offset)?b.offset:0}n=[(t.offset().top-parseInt(m)).toString(),(t.offset().left-parseInt(m)).toString()];n[0]=(n[0]<0)?0:n[0];n[1]=(n[1]<0)?0:n[1];return n},_findHighlight:function(y){var x=h.location.toString().split("#")[0],u=d("._"+i+"-h[href='#"+y+"']"),v=d("._"+i+"-h[href='"+x+"#"+y+"']"),t=d("._"+i+"-h[href='#/"+y+"']"),w=d("._"+i+"-h[href='"+x+"#/"+y+"']");u=(u.length>0)?u:v;t=(t.length>0)?t:w;return(t.length>0)?t:u},_setClasses:function(z,v,w){var y=b.clickedClass,u=b.targetClass,x=b.highlightClass;if(z&&y&&y!==""){d("."+y).removeClass(y);q.addClass(y)}else{if(v&&u&&u!==""&&w&&x&&x!==""){if(k._currentTarget.call(null,v)){if(b.forceSingleHighlight){d("."+x).removeClass(x)}v.addClass(u);w.addClass(x)}else{v.removeClass(u);w.removeClass(x)}}}},_currentTarget:function(H){var K=b["target_"+H.data(i).i],w=H[0].getBoundingClientRect();if(typeof K!=="undefined"){var F=H.offset().top,G=H.offset().left,L=(K.from)?K.from+F:F,z=(K.to)?K.to+F:F,I=(K.fromX)?K.fromX+G:G,v=(K.toX)?K.toX+G:G;return(w.top>=z&&w.top<=L&&w.left>=v&&w.left<=I)}else{var D=d(h).height(),O=d(h).width(),C=H.height(),N=H.width(),B=1+(C/D),J=B,E=(C<D)?B*(D/C):B,u=1+(N/O),A=u,M=(N<O)?u*(O/N):u;return(w.top<=D/J&&w.bottom>=D/E&&w.left<=O/A&&w.right>=O/M)}},_scrollTo:function(){b.scrollSpeed=parseInt(b.scrollSpeed);n=(b.pageEndSmoothScroll)?k._pageEndSmoothScroll.call(null):n;var u=d("html,body"),w=(b.autoScrollSpeed)?k._autoScrollSpeed.call(null):b.scrollSpeed,y=(u.is(":animated"))?b.scrollingEasing:b.scrollEasing,v=d(h).scrollTop(),t=d(h).scrollLeft();switch(o){case"horizontal":if(t!=n[1]){k._callbacks.call(null,"onStart");u.stop().animate({scrollLeft:n[1]},w,y).promise().then(function(){k._callbacks.call(null,"onComplete")})}break;case"auto":if(v!=n[0]||t!=n[1]){k._callbacks.call(null,"onStart");if(navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)){var x;u.stop().animate({pageYOffset:n[0],pageXOffset:n[1]},{duration:w,easing:y,step:function(z,A){if(A.prop=="pageXOffset"){x=z}else{if(A.prop=="pageYOffset"){h.scrollTo(x,z)}}}}).promise().then(function(){k._callbacks.call(null,"onComplete")})}else{u.stop().animate({scrollTop:n[0],scrollLeft:n[1]},w,y).promise().then(function(){k._callbacks.call(null,"onComplete")})}}break;default:if(v!=n[0]){k._callbacks.call(null,"onStart");u.stop().animate({scrollTop:n[0]},w,y).promise().then(function(){k._callbacks.call(null,"onComplete")})}}},_pageEndSmoothScroll:function(){var t=d(l).height(),w=d(l).width(),v=d(h).height(),u=d(h).width();return[((t-n[0])<v)?t-v:n[0],((w-n[1])<u)?w-u:n[1]]},_autoScrollSpeed:function(){var v=d(h).scrollTop(),u=d(h).scrollLeft(),w=d(l).height(),t=d(l).width(),x=[b.scrollSpeed+((b.scrollSpeed*(Math.floor((Math.abs(n[0]-v)/w)*100)))/100),b.scrollSpeed+((b.scrollSpeed*(Math.floor((Math.abs(n[1]-u)/t)*100)))/100)];return Math.max.apply(Math,x)},_callbacks:function(t){if(!b){return}this[i]={trigger:a,clicked:q,target:f,scrollTo:{y:n[0],x:n[1]}};switch(t){case"onStart":b.onStart.call(null,this[i]);break;case"onComplete":b.onComplete.call(null,this[i]);break}},_reset:function(){o=m=false},_isInit:function(){if(!g){r.init.apply(this)}},_easing:function(){d.easing.easeInQuad=d.easing.easeInQuad||function(v,w,u,z,y){return z*(w/=y)*w+u};d.easing.easeOutQuad=d.easing.easeOutQuad||function(v,w,u,z,y){return -z*(w/=y)*(w-2)+u};d.easing.easeInOutQuad=d.easing.easeInOutQuad||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w+u}return -z/2*((--w)*(w-2)-1)+u};d.easing.easeInCubic=d.easing.easeInCubic||function(v,w,u,z,y){return z*(w/=y)*w*w+u};d.easing.easeOutCubic=d.easing.easeOutCubic||function(v,w,u,z,y){return z*((w=w/y-1)*w*w+1)+u};d.easing.easeInOutCubic=d.easing.easeInOutCubic||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w+u}return z/2*((w-=2)*w*w+2)+u};d.easing.easeInQuart=d.easing.easeInQuart||function(v,w,u,z,y){return z*(w/=y)*w*w*w+u};d.easing.easeOutQuart=d.easing.easeOutQuart||function(v,w,u,z,y){return -z*((w=w/y-1)*w*w*w-1)+u};d.easing.easeInOutQuart=d.easing.easeInOutQuart||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w*w+u}return -z/2*((w-=2)*w*w*w-2)+u};d.easing.easeInQuint=d.easing.easeInQuint||function(v,w,u,z,y){return z*(w/=y)*w*w*w*w+u};d.easing.easeOutQuint=d.easing.easeOutQuint||function(v,w,u,z,y){return z*((w=w/y-1)*w*w*w*w+1)+u};d.easing.easeInOutQuint=d.easing.easeInOutQuint||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w*w*w+u}return z/2*((w-=2)*w*w*w*w+2)+u};d.easing.easeInExpo=d.easing.easeInExpo||function(v,w,u,z,y){return(w==0)?u:z*Math.pow(2,10*(w/y-1))+u};d.easing.easeOutExpo=d.easing.easeOutExpo||function(v,w,u,z,y){return(w==y)?u+z:z*(-Math.pow(2,-10*w/y)+1)+u};d.easing.easeInOutExpo=d.easing.easeInOutExpo||function(v,w,u,z,y){if(w==0){return u}if(w==y){return u+z}if((w/=y/2)<1){return z/2*Math.pow(2,10*(w-1))+u}return z/2*(-Math.pow(2,-10*--w)+2)+u};d.easing.easeInSine=d.easing.easeInSine||function(v,w,u,z,y){return -z*Math.cos(w/y*(Math.PI/2))+z+u};d.easing.easeOutSine=d.easing.easeOutSine||function(v,w,u,z,y){return z*Math.sin(w/y*(Math.PI/2))+u};d.easing.easeInOutSine=d.easing.easeInOutSine||function(v,w,u,z,y){return -z/2*(Math.cos(Math.PI*w/y)-1)+u};d.easing.easeInCirc=d.easing.easeInCirc||function(v,w,u,z,y){return -z*(Math.sqrt(1-(w/=y)*w)-1)+u};d.easing.easeOutCirc=d.easing.easeOutCirc||function(v,w,u,z,y){return z*Math.sqrt(1-(w=w/y-1)*w)+u};d.easing.easeInOutCirc=d.easing.easeInOutCirc||function(v,w,u,z,y){if((w/=y/2)<1){return -z/2*(Math.sqrt(1-w*w)-1)+u}return z/2*(Math.sqrt(1-(w-=2)*w)+1)+u};d.easing.easeInElastic=d.easing.easeInElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B)==1){return u+C}if(!A){A=B*0.3}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}return -(w*Math.pow(2,10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A))+u};d.easing.easeOutElastic=d.easing.easeOutElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B)==1){return u+C}if(!A){A=B*0.3}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}return w*Math.pow(2,-10*y)*Math.sin((y*B-z)*(2*Math.PI)/A)+C+u};d.easing.easeInOutElastic=d.easing.easeInOutElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B/2)==2){return u+C}if(!A){A=B*(0.3*1.5)}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}if(y<1){return -0.5*(w*Math.pow(2,10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A))+u}return w*Math.pow(2,-10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A)*0.5+C+u};d.easing.easeInBack=d.easing.easeInBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}return A*(w/=z)*w*((y+1)*w-y)+u};d.easing.easeOutBack=d.easing.easeOutBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}return A*((w=w/z-1)*w*((y+1)*w+y)+1)+u};d.easing.easeInOutBack=d.easing.easeInOutBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}if((w/=z/2)<1){return A/2*(w*w*(((y*=(1.525))+1)*w-y))+u}return A/2*((w-=2)*w*(((y*=(1.525))+1)*w+y)+2)+u};d.easing.easeInBounce=d.easing.easeInBounce||function(v,w,u,z,y){return z-d.easing.easeOutBounce(v,y-w,0,z,y)+u};d.easing.easeOutBounce=d.easing.easeOutBounce||function(v,w,u,z,y){if((w/=y)<(1/2.75)){return z*(7.5625*w*w)+u}else{if(w<(2/2.75)){return z*(7.5625*(w-=(1.5/2.75))*w+0.75)+u}else{if(w<(2.5/2.75)){return z*(7.5625*(w-=(2.25/2.75))*w+0.9375)+u}else{return z*(7.5625*(w-=(2.625/2.75))*w+0.984375)+u}}}};d.easing.easeInOutBounce=d.easing.easeInOutBounce||function(v,w,u,z,y){if(w<y/2){return d.easing.easeInBounce(v,w*2,0,z,y)*0.5+u}return d.easing.easeOutBounce(v,w*2-y,0,z,y)*0.5+z*0.5+u}}};k._easing.call();d.fn[c]=function(t){if(r[t]){return r[t].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof t==="object"||!t){return r.init.apply(this,arguments)}else{d.error("Method "+t+" does not exist")}}};d[c]=function(t){if(r[t]){return r[t].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof t==="object"||!t){return r.init.apply(this,arguments)}else{d.error("Method "+t+" does not exist")}}};d[c].defaults=j})(jQuery,window,document);
1
+ (function(d,h,l,e){var c="mPageScroll2id",i="mPS2id",t=".m_PageScroll2id,a[rel~='m_PageScroll2id'],.page-scroll-to-id,a[rel~='page-scroll-to-id']",j={scrollSpeed:1300,autoScrollSpeed:true,scrollEasing:"easeInOutExpo",scrollingEasing:"easeInOutCirc",pageEndSmoothScroll:true,layout:"vertical",offset:0,highlightSelector:false,clickedClass:i+"-clicked",targetClass:i+"-target",highlightClass:i+"-highlight",forceSingleHighlight:false,clickEvents:true,onStart:function(){},onComplete:function(){},defaultSelector:false},p,b,g,a,q,f,n,o,m,r,s={init:function(u){var u=d.extend(true,{},j,u);d(l).data(i,u);b=d(l).data(i);p=(!p)?this.selector:p+","+this.selector;if(b.defaultSelector){if(typeof d(p)!=="object"||d(p).length===0){p=t}}if(b.clickEvents){d(l).undelegate("."+i).delegate(p,"click."+i,function(x){var w=d(this),v=w.attr("href"),y=w.prop("href");if(v&&v.indexOf("#/")!==-1){return}k._reset.call(null);r=w.data("ps2id-offset")||0;if(k._isValid.call(null,v,y)&&k._findTarget.call(null,v)){x.preventDefault();a="selector";q=w;k._setClasses.call(null,true);k._scrollTo.call(null)}})}d(h).unbind("."+i).bind("scroll."+i+" resize."+i,function(){var v=d("._"+i+"-t");v.each(function(){var w=d(this),y=w.attr("id"),x=k._findHighlight.call(null,y);k._setClasses.call(null,false,w,x)})});g=true;k._setup.call(null)},scrollTo:function(w,u){if(w&&typeof w!=="undefined"){k._isInit.call(null);var v={layout:b.layout,offset:b.offset,clicked:false},u=d.extend(true,{},v,u);k._reset.call(null);o=u.layout;m=u.offset;w=(w.indexOf("#")!==-1)?w:"#"+w;if(k._isValid.call(null,w)&&k._findTarget.call(null,w)){a="scrollTo";q=u.clicked;if(q){k._setClasses.call(null,true)}k._scrollTo.call(null)}}},destroy:function(){d(h).unbind("."+i);d(l).undelegate("."+i).removeData(i);d("."+b.clickedClass).removeClass(b.clickedClass);d("."+b.targetClass).removeClass(b.targetClass);d("."+b.highlightClass).removeClass(b.highlightClass);d("._"+i+"-t").removeData(i).removeClass("_"+i+"-t");d("._"+i+"-h").removeClass("_"+i+"-h")}},k={_isValid:function(u,x){if(!u){return}x=(!x)?u:x;var w=(x.indexOf("#/")!==-1)?x.split("#/")[0]:x.split("#")[0],v=h.location.toString().split("#")[0];return u!=="#"&&u.indexOf("#")!==-1&&(w===""||w===v)},_setup:function(){var v=(b.highlightSelector&&b.highlightSelector!=="")?b.highlightSelector:p,u=1;return d(v).each(function(){var z=d(this),w=z.attr("href"),B=z.prop("href");if(k._isValid.call(null,w,B)){var A=(w.indexOf("#/")!==-1)?w.split("#/")[1]:w.split("#")[1],x=d("#"+A);if(x.length>0){if(!x.hasClass("_"+i+"-t")){x.addClass("_"+i+"-t").data(i,{i:u})}if(!z.hasClass("_"+i+"-h")){z.addClass("_"+i+"-h")}var y=k._findHighlight.call(null,A);k._setClasses.call(null,false,x,y);u++}}})},_findTarget:function(w){var v=(w.indexOf("#/")!==-1)?w.split("#/")[1]:w.split("#")[1],u=d("#"+v);if(u.length<1||u.css("position")==="fixed"){if(v==="top"){u=d("body")}else{return}}f=u;if(!o){o=b.layout}m=k._setOffset.call(null);n=[(u.offset().top-m[0]).toString(),(u.offset().left-m[1]).toString()];n[0]=(n[0]<0)?0:n[0];n[1]=(n[1]<0)?0:n[1];return n},_setOffset:function(){if(!m){m=(b.offset)?b.offset:0}if(r){m=r}var w,v,z,u;switch(typeof m){case"object":case"string":w=[(m.y)?m.y:m,(m.x)?m.x:m];v=[(w[0] instanceof jQuery)?w[0]:d(w[0]),(w[1] instanceof jQuery)?w[1]:d(w[1])];if(v[0].length>0){z=v[0].height();if(v[0].css("position")==="fixed"){z+=v[0][0].offsetTop}}else{if(!isNaN(parseFloat(w[0]))&&isFinite(w[0])){z=parseInt(w[0])}else{z=0}}if(v[1].length>0){u=v[1].width();if(v[1].css("position")==="fixed"){u+=v[1][0].offsetLeft}}else{if(!isNaN(parseFloat(w[1]))&&isFinite(w[1])){u=parseInt(w[1])}else{u=0}}break;case"function":w=m.call(null);if(w instanceof Array){z=w[0];u=w[1]}else{z=u=w}break;default:z=u=parseInt(m)}return[z,u]},_findHighlight:function(z){var y=h.location.toString().split("#")[0],v=d("._"+i+"-h[href='#"+z+"']"),w=d("._"+i+"-h[href='"+y+"#"+z+"']"),u=d("._"+i+"-h[href='#/"+z+"']"),x=d("._"+i+"-h[href='"+y+"#/"+z+"']");v=(v.length>0)?v:w;u=(u.length>0)?u:x;return(u.length>0)?u:v},_setClasses:function(z,v,w){var y=b.clickedClass,u=b.targetClass,x=b.highlightClass;if(z&&y&&y!==""){d("."+y).removeClass(y);q.addClass(y)}else{if(v&&u&&u!==""&&w&&x&&x!==""){if(k._currentTarget.call(null,v)){if(b.forceSingleHighlight){d("."+x).removeClass(x)}v.addClass(u);w.addClass(x)}else{v.removeClass(u);w.removeClass(x)}}}},_currentTarget:function(H){var K=b["target_"+H.data(i).i],w=H[0].getBoundingClientRect();if(typeof K!=="undefined"){var F=H.offset().top,G=H.offset().left,L=(K.from)?K.from+F:F,z=(K.to)?K.to+F:F,I=(K.fromX)?K.fromX+G:G,v=(K.toX)?K.toX+G:G;return(w.top>=z&&w.top<=L&&w.left>=v&&w.left<=I)}else{var D=d(h).height(),O=d(h).width(),C=H.height(),N=H.width(),B=1+(C/D),J=B,E=(C<D)?B*(D/C):B,u=1+(N/O),A=u,M=(N<O)?u*(O/N):u;return(w.top<=D/J&&w.bottom>=D/E&&w.left<=O/A&&w.right>=O/M)}},_scrollTo:function(){b.scrollSpeed=parseInt(b.scrollSpeed);n=(b.pageEndSmoothScroll)?k._pageEndSmoothScroll.call(null):n;var v=d("html,body"),x=(b.autoScrollSpeed)?k._autoScrollSpeed.call(null):b.scrollSpeed,z=(v.is(":animated"))?b.scrollingEasing:b.scrollEasing,w=d(h).scrollTop(),u=d(h).scrollLeft();switch(o){case"horizontal":if(u!=n[1]){k._callbacks.call(null,"onStart");v.stop().animate({scrollLeft:n[1]},x,z).promise().then(function(){k._callbacks.call(null,"onComplete")})}break;case"auto":if(w!=n[0]||u!=n[1]){k._callbacks.call(null,"onStart");if(navigator.userAgent.match(/(iPod|iPhone|iPad|Android)/)){var y;v.stop().animate({pageYOffset:n[0],pageXOffset:n[1]},{duration:x,easing:z,step:function(A,B){if(B.prop=="pageXOffset"){y=A}else{if(B.prop=="pageYOffset"){h.scrollTo(y,A)}}}}).promise().then(function(){k._callbacks.call(null,"onComplete")})}else{v.stop().animate({scrollTop:n[0],scrollLeft:n[1]},x,z).promise().then(function(){k._callbacks.call(null,"onComplete")})}}break;default:if(w!=n[0]){k._callbacks.call(null,"onStart");v.stop().animate({scrollTop:n[0]},x,z).promise().then(function(){k._callbacks.call(null,"onComplete")})}}},_pageEndSmoothScroll:function(){var u=d(l).height(),x=d(l).width(),w=d(h).height(),v=d(h).width();return[((u-n[0])<w)?u-w:n[0],((x-n[1])<v)?x-v:n[1]]},_autoScrollSpeed:function(){var w=d(h).scrollTop(),v=d(h).scrollLeft(),x=d(l).height(),u=d(l).width(),y=[b.scrollSpeed+((b.scrollSpeed*(Math.floor((Math.abs(n[0]-w)/x)*100)))/100),b.scrollSpeed+((b.scrollSpeed*(Math.floor((Math.abs(n[1]-v)/u)*100)))/100)];return Math.max.apply(Math,y)},_callbacks:function(u){if(!b){return}this[i]={trigger:a,clicked:q,target:f,scrollTo:{y:n[0],x:n[1]}};switch(u){case"onStart":b.onStart.call(null,this[i]);break;case"onComplete":b.onComplete.call(null,this[i]);break}},_reset:function(){o=m=r=false},_isInit:function(){if(!g){s.init.apply(this)}},_easing:function(){d.easing.easeInQuad=d.easing.easeInQuad||function(v,w,u,z,y){return z*(w/=y)*w+u};d.easing.easeOutQuad=d.easing.easeOutQuad||function(v,w,u,z,y){return -z*(w/=y)*(w-2)+u};d.easing.easeInOutQuad=d.easing.easeInOutQuad||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w+u}return -z/2*((--w)*(w-2)-1)+u};d.easing.easeInCubic=d.easing.easeInCubic||function(v,w,u,z,y){return z*(w/=y)*w*w+u};d.easing.easeOutCubic=d.easing.easeOutCubic||function(v,w,u,z,y){return z*((w=w/y-1)*w*w+1)+u};d.easing.easeInOutCubic=d.easing.easeInOutCubic||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w+u}return z/2*((w-=2)*w*w+2)+u};d.easing.easeInQuart=d.easing.easeInQuart||function(v,w,u,z,y){return z*(w/=y)*w*w*w+u};d.easing.easeOutQuart=d.easing.easeOutQuart||function(v,w,u,z,y){return -z*((w=w/y-1)*w*w*w-1)+u};d.easing.easeInOutQuart=d.easing.easeInOutQuart||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w*w+u}return -z/2*((w-=2)*w*w*w-2)+u};d.easing.easeInQuint=d.easing.easeInQuint||function(v,w,u,z,y){return z*(w/=y)*w*w*w*w+u};d.easing.easeOutQuint=d.easing.easeOutQuint||function(v,w,u,z,y){return z*((w=w/y-1)*w*w*w*w+1)+u};d.easing.easeInOutQuint=d.easing.easeInOutQuint||function(v,w,u,z,y){if((w/=y/2)<1){return z/2*w*w*w*w*w+u}return z/2*((w-=2)*w*w*w*w+2)+u};d.easing.easeInExpo=d.easing.easeInExpo||function(v,w,u,z,y){return(w==0)?u:z*Math.pow(2,10*(w/y-1))+u};d.easing.easeOutExpo=d.easing.easeOutExpo||function(v,w,u,z,y){return(w==y)?u+z:z*(-Math.pow(2,-10*w/y)+1)+u};d.easing.easeInOutExpo=d.easing.easeInOutExpo||function(v,w,u,z,y){if(w==0){return u}if(w==y){return u+z}if((w/=y/2)<1){return z/2*Math.pow(2,10*(w-1))+u}return z/2*(-Math.pow(2,-10*--w)+2)+u};d.easing.easeInSine=d.easing.easeInSine||function(v,w,u,z,y){return -z*Math.cos(w/y*(Math.PI/2))+z+u};d.easing.easeOutSine=d.easing.easeOutSine||function(v,w,u,z,y){return z*Math.sin(w/y*(Math.PI/2))+u};d.easing.easeInOutSine=d.easing.easeInOutSine||function(v,w,u,z,y){return -z/2*(Math.cos(Math.PI*w/y)-1)+u};d.easing.easeInCirc=d.easing.easeInCirc||function(v,w,u,z,y){return -z*(Math.sqrt(1-(w/=y)*w)-1)+u};d.easing.easeOutCirc=d.easing.easeOutCirc||function(v,w,u,z,y){return z*Math.sqrt(1-(w=w/y-1)*w)+u};d.easing.easeInOutCirc=d.easing.easeInOutCirc||function(v,w,u,z,y){if((w/=y/2)<1){return -z/2*(Math.sqrt(1-w*w)-1)+u}return z/2*(Math.sqrt(1-(w-=2)*w)+1)+u};d.easing.easeInElastic=d.easing.easeInElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B)==1){return u+C}if(!A){A=B*0.3}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}return -(w*Math.pow(2,10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A))+u};d.easing.easeOutElastic=d.easing.easeOutElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B)==1){return u+C}if(!A){A=B*0.3}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}return w*Math.pow(2,-10*y)*Math.sin((y*B-z)*(2*Math.PI)/A)+C+u};d.easing.easeInOutElastic=d.easing.easeInOutElastic||function(v,y,u,C,B){var z=1.70158;var A=0;var w=C;if(y==0){return u}if((y/=B/2)==2){return u+C}if(!A){A=B*(0.3*1.5)}if(w<Math.abs(C)){w=C;var z=A/4}else{var z=A/(2*Math.PI)*Math.asin(C/w)}if(y<1){return -0.5*(w*Math.pow(2,10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A))+u}return w*Math.pow(2,-10*(y-=1))*Math.sin((y*B-z)*(2*Math.PI)/A)*0.5+C+u};d.easing.easeInBack=d.easing.easeInBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}return A*(w/=z)*w*((y+1)*w-y)+u};d.easing.easeOutBack=d.easing.easeOutBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}return A*((w=w/z-1)*w*((y+1)*w+y)+1)+u};d.easing.easeInOutBack=d.easing.easeInOutBack||function(v,w,u,A,z,y){if(y==e){y=1.70158}if((w/=z/2)<1){return A/2*(w*w*(((y*=(1.525))+1)*w-y))+u}return A/2*((w-=2)*w*(((y*=(1.525))+1)*w+y)+2)+u};d.easing.easeInBounce=d.easing.easeInBounce||function(v,w,u,z,y){return z-d.easing.easeOutBounce(v,y-w,0,z,y)+u};d.easing.easeOutBounce=d.easing.easeOutBounce||function(v,w,u,z,y){if((w/=y)<(1/2.75)){return z*(7.5625*w*w)+u}else{if(w<(2/2.75)){return z*(7.5625*(w-=(1.5/2.75))*w+0.75)+u}else{if(w<(2.5/2.75)){return z*(7.5625*(w-=(2.25/2.75))*w+0.9375)+u}else{return z*(7.5625*(w-=(2.625/2.75))*w+0.984375)+u}}}};d.easing.easeInOutBounce=d.easing.easeInOutBounce||function(v,w,u,z,y){if(w<y/2){return d.easing.easeInBounce(v,w*2,0,z,y)*0.5+u}return d.easing.easeOutBounce(v,w*2-y,0,z,y)*0.5+z*0.5+u}}};k._easing.call();d.fn[c]=function(u){if(s[u]){return s[u].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof u==="object"||!u){return s.init.apply(this,arguments)}else{d.error("Method "+u+" does not exist")}}};d[c]=function(u){if(s[u]){return s[u].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof u==="object"||!u){return s.init.apply(this,arguments)}else{d.error("Method "+u+" does not exist")}}};d[c].defaults=j})(jQuery,window,document);
license.txt CHANGED
@@ -1,674 +1,19 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- <one line to give the program's name and a brief idea of what it does.>
635
- Copyright (C) <year> <name of author>
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ The MIT License (MIT)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
malihu-pagescroll2id.php CHANGED
@@ -3,30 +3,35 @@
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 page scrolling to specific id within the document.
6
- Version: 1.5.2
7
  Author: malihu
8
  Author URI: http://manos.malihu.gr
9
- License: GNU GENERAL PUBLIC LICENSE Version 3
10
  */
11
 
12
  /*
13
  Copyright 2013 malihu (email: manos@malihu.gr)
14
 
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License, version 3, as
17
- published by the Free Software Foundation.
 
 
 
18
 
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
 
24
- You should have received a copy of the GNU General Public License
25
- along with this program; if not, write to the Free Software
26
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
 
 
 
27
  */
28
 
29
- if(basename($_SERVER['SCRIPT_NAME'])==basename(__FILE__))exit(':)');
30
 
31
  if(!class_exists('malihuPageScroll2id')){ // --edit--
32
 
@@ -40,14 +45,14 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
40
 
41
  class malihuPageScroll2id{ // --edit--
42
 
43
- protected $version='1.5.2'; // Plugin version --edit--
44
  protected $update_option=null;
45
 
46
  protected $plugin_name='Page scroll to id'; // Plugin name --edit--
47
  protected $plugin_slug='page-scroll-to-id'; // Plugin slug --edit--
48
  protected $db_prefix='page_scroll_to_id_'; // Database field plugin prefix --edit--
49
  protected $pl_pfx='mPS2id_'; // Plugin prefix --edit--
50
- protected $sc_pfx='ps2id'; // Shortcode prefix (remove trailing "-" for single shortcode) --edit--
51
 
52
  protected static $instance=null;
53
  protected $plugin_screen_hook_suffix=null;
@@ -91,20 +96,13 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
91
  if(null==self::$instance){
92
  self::$instance=new self;
93
  }
 
94
  return self::$instance;
95
  }
96
 
97
- public static function activate(){
98
- // TODO: Define activation functionality here
99
- }
100
-
101
- public static function deactivate(){
102
- // TODO: Define deactivation functionality here
103
- }
104
-
105
  // WP version notice
106
  public function admin_notice_wp_version(){
107
- _e('<div class="error"><p>'.$this->plugin_name.' requires WordPress version 3.3 or higher. Deactivate the plugin and reactivate when WordPress is updated.</p></div>', $this->plugin_slug);
108
  }
109
 
110
  // Plugin localization (load plugin textdomain)
@@ -153,6 +151,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
153
  wp_register_script($this->plugin_slug.'-plugin-init-script', plugins_url('js/'.$this->plugin_init_script, __FILE__), array('jquery', $this->plugin_slug.'-plugin-script'), $this->version, 1);
154
  wp_enqueue_script($this->plugin_slug.'-plugin-init-script');
155
  $this->plugin_fn_call();
 
156
  }
157
 
158
  public function add_plugin_admin_menu(){
@@ -176,7 +175,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
176
  add_settings_section(
177
  $this->db_prefix.'settings_section'.$this->index,
178
  null,
179
- null,
180
  $this->plugin_slug
181
  );
182
  // Add settings fields for each section
@@ -291,11 +290,32 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
291
  $params=array(
292
  'instances' => $instances,
293
  'total_instances' => count($instances),
294
- 'shortcode_class' => $this->sc_pfx
295
  );
296
  wp_localize_script($this->plugin_slug.'-plugin-init-script', $this->pl_pfx.'params', $params);
297
  }
298
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  public function validate_plugin_settings(){
300
  if(!empty($_POST)){
301
  if($_POST[$this->db_prefix.'reset']==='true' ){
@@ -315,18 +335,18 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
315
 
316
  public function sanitize_input($type, $val, $def){
317
  switch($type){
318
- case 'text':
319
  $val=(empty($val)) ? $def : sanitize_text_field($val);
320
  break;
321
- case 'number':
322
  $val=(int) preg_replace('/\D/', '', $val);
323
  break;
324
- case 'integer':
325
  $s=strpos($val, '-');
326
  $n=(int) preg_replace('/\D/', '', $val);
327
  $val=($s===false) ? $n : '-'.$n;
328
  break;
329
- case 'class':
330
  $val=sanitize_html_class($val, $def);
331
  break;
332
  }
@@ -387,7 +407,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
387
  delete_option('malihu_pagescroll2id_layout');
388
  }
389
 
390
- public function debug_to_console($data){
391
  /*
392
  This is just a helper function that sends debug code to the Javascript console
393
  Usage: $this->debug_to_console('hello world');
@@ -413,6 +433,10 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
413
  $help_plugin_settings=ob_get_contents();
414
  ob_end_clean();
415
  ob_start();
 
 
 
 
416
  include_once(plugin_dir_path( __FILE__ ).'includes/help/sidebar.inc');
417
  $help_sidebar=ob_get_contents();
418
  ob_end_clean();
@@ -432,6 +456,11 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
432
  'title' => 'Plugin settings',
433
  'content' => $help_plugin_settings,
434
  ));
 
 
 
 
 
435
  $screen->set_help_sidebar($help_sidebar);
436
  }
437
  return $contextual_help;
@@ -466,7 +495,7 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
466
  $v4=$_POST[$this->db_prefix.$i.'_scrollingEasing'];
467
  $v5=(isset($_POST[$this->db_prefix.$i.'_pageEndSmoothScroll'])) ? 'true' : 'false';
468
  $v6=$_POST[$this->db_prefix.$i.'_layout'];
469
- $v7=$this->sanitize_input('integer', $_POST[$this->db_prefix.$i.'_offset'], $d7);
470
  $v8=(empty($_POST[$this->db_prefix.$i.'_highlightSelector'])) ? $d8 : $this->sanitize_input('text', $_POST[$this->db_prefix.$i.'_highlightSelector'], $d8);
471
  $v9=$this->sanitize_input('class', $_POST[$this->db_prefix.$i.'_clickedClass'], $d9);
472
  $v10=$this->sanitize_input('class', $_POST[$this->db_prefix.$i.'_targetClass'], $d10);
@@ -616,12 +645,12 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
616
  'value' => $v7,
617
  'values' => null,
618
  'id' => $this->db_prefix.$i.'_offset',
619
- 'field_type' => 'text-integer',
620
  'label' => 'Offset',
621
  'checkbox_label' => null,
622
  'radio_labels' => null,
623
  'field_info' => 'pixels',
624
- 'description' => 'Offset scroll-to position by x amount of pixels (positive or negative)',
625
  'wrapper' => null
626
  ),
627
  'highlightSelector' => array(
@@ -692,9 +721,6 @@ if(!class_exists('malihuPageScroll2id')){ // --edit--
692
  }
693
 
694
  if(class_exists('malihuPageScroll2id')){ // --edit--
695
-
696
- register_activation_hook(__FILE__, array('malihu-plugin', 'activate')); // --edit--
697
- register_deactivation_hook(__FILE__, array('malihu-plugin', 'deactivate')); // --edit--
698
 
699
  malihuPageScroll2id::get_instance(); // --edit--
700
 
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 page scrolling to specific id within the document.
6
+ Version: 1.5.3
7
  Author: malihu
8
  Author URI: http://manos.malihu.gr
9
+ License: MIT License (MIT)
10
  */
11
 
12
  /*
13
  Copyright 2013 malihu (email: manos@malihu.gr)
14
 
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
 
22
+ The above copyright notice and this permission notice shall be included in
23
+ all copies or substantial portions of the Software.
 
 
24
 
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31
+ THE SOFTWARE.
32
  */
33
 
34
+ if(!defined('WPINC')){ die; } // Abort if file is called directly
35
 
36
  if(!class_exists('malihuPageScroll2id')){ // --edit--
37
 
45
 
46
  class malihuPageScroll2id{ // --edit--
47
 
48
+ protected $version='1.5.3'; // Plugin version --edit--
49
  protected $update_option=null;
50
 
51
  protected $plugin_name='Page scroll to id'; // Plugin name --edit--
52
  protected $plugin_slug='page-scroll-to-id'; // Plugin slug --edit--
53
  protected $db_prefix='page_scroll_to_id_'; // Database field plugin prefix --edit--
54
  protected $pl_pfx='mPS2id_'; // Plugin prefix --edit--
55
+ protected $sc_pfx='ps2id'; // Shortcode prefix --edit--
56
 
57
  protected static $instance=null;
58
  protected $plugin_screen_hook_suffix=null;
96
  if(null==self::$instance){
97
  self::$instance=new self;
98
  }
99
+
100
  return self::$instance;
101
  }
102
 
 
 
 
 
 
 
 
 
103
  // WP version notice
104
  public function admin_notice_wp_version(){
105
+ _e('<div class="error"><p><strong>'.$this->plugin_name.'</strong> requires WordPress version <strong>3.3</strong> or higher. Deactivate the plugin and reactivate when WordPress is updated.</p></div>', $this->plugin_slug);
106
  }
107
 
108
  // Plugin localization (load plugin textdomain)
151
  wp_register_script($this->plugin_slug.'-plugin-init-script', plugins_url('js/'.$this->plugin_init_script, __FILE__), array('jquery', $this->plugin_slug.'-plugin-script'), $this->version, 1);
152
  wp_enqueue_script($this->plugin_slug.'-plugin-init-script');
153
  $this->plugin_fn_call();
154
+ $this->add_plugin_shortcode(); // Remove/comment for plugin without any shortcodes --edit--
155
  }
156
 
157
  public function add_plugin_admin_menu(){
175
  add_settings_section(
176
  $this->db_prefix.'settings_section'.$this->index,
177
  null,
178
+ '__return_false', // instead of null to avoid wp <3.4.1 warnings (https://core.trac.wordpress.org/ticket/21630)
179
  $this->plugin_slug
180
  );
181
  // Add settings fields for each section
290
  $params=array(
291
  'instances' => $instances,
292
  'total_instances' => count($instances),
293
+ 'shortcode_class' => '_'.$this->sc_pfx
294
  );
295
  wp_localize_script($this->plugin_slug.'-plugin-init-script', $this->pl_pfx.'params', $params);
296
  }
297
 
298
+ public function add_plugin_shortcode(){
299
+ $pl_shortcodes=array();
300
+ $instances=get_option($this->db_prefix.'instances');
301
+ for($i=1; $i<=count($instances); $i++){
302
+ $pl_shortcodes[]='pl_shortcode_fn_'.$i;
303
+ // --edit--
304
+ $tag=$shortcode_class=$this->sc_pfx; // Shortcode without suffix
305
+ //$tag=$shortcode_class=$this->sc_pfx.'_'.$i; // Shortcode with suffix
306
+ $pl_shortcodes[$i]=create_function('$atts,$content=null','
307
+ extract(shortcode_atts(array(
308
+ "i" => "'.$i.'",
309
+ "shortcode_class" => "_'.$shortcode_class.'",
310
+ "url" => "",
311
+ "offset" => "",
312
+ ), $atts));
313
+ return "<a href=\"".$url."\" class=\"".$shortcode_class."\" data-ps2id-offset=\"".esc_attr($offset)."\">".do_shortcode($content)."</a>";
314
+ ');
315
+ add_shortcode($tag, $pl_shortcodes[$i]);
316
+ }
317
+ }
318
+
319
  public function validate_plugin_settings(){
320
  if(!empty($_POST)){
321
  if($_POST[$this->db_prefix.'reset']==='true' ){
335
 
336
  public function sanitize_input($type, $val, $def){
337
  switch($type){
338
+ case 'text': // General
339
  $val=(empty($val)) ? $def : sanitize_text_field($val);
340
  break;
341
+ case 'number': // Positive number
342
  $val=(int) preg_replace('/\D/', '', $val);
343
  break;
344
+ case 'integer': // Positive or negative number
345
  $s=strpos($val, '-');
346
  $n=(int) preg_replace('/\D/', '', $val);
347
  $val=($s===false) ? $n : '-'.$n;
348
  break;
349
+ case 'class': // Class name
350
  $val=sanitize_html_class($val, $def);
351
  break;
352
  }
407
  delete_option('malihu_pagescroll2id_layout');
408
  }
409
 
410
+ private function debug_to_console($data){
411
  /*
412
  This is just a helper function that sends debug code to the Javascript console
413
  Usage: $this->debug_to_console('hello world');
433
  $help_plugin_settings=ob_get_contents();
434
  ob_end_clean();
435
  ob_start();
436
+ include_once(plugin_dir_path( __FILE__ ).'includes/help/shortcodes.inc');
437
+ $help_plugin_shortcodes=ob_get_contents();
438
+ ob_end_clean();
439
+ ob_start();
440
  include_once(plugin_dir_path( __FILE__ ).'includes/help/sidebar.inc');
441
  $help_sidebar=ob_get_contents();
442
  ob_end_clean();
456
  'title' => 'Plugin settings',
457
  'content' => $help_plugin_settings,
458
  ));
459
+ $screen->add_help_tab(array(
460
+ 'id' => $this->plugin_slug.'shortcodes',
461
+ 'title' => 'Shortcodes',
462
+ 'content' => $help_plugin_shortcodes,
463
+ ));
464
  $screen->set_help_sidebar($help_sidebar);
465
  }
466
  return $contextual_help;
495
  $v4=$_POST[$this->db_prefix.$i.'_scrollingEasing'];
496
  $v5=(isset($_POST[$this->db_prefix.$i.'_pageEndSmoothScroll'])) ? 'true' : 'false';
497
  $v6=$_POST[$this->db_prefix.$i.'_layout'];
498
+ $v7=$this->sanitize_input('text', $_POST[$this->db_prefix.$i.'_offset'], $d7);
499
  $v8=(empty($_POST[$this->db_prefix.$i.'_highlightSelector'])) ? $d8 : $this->sanitize_input('text', $_POST[$this->db_prefix.$i.'_highlightSelector'], $d8);
500
  $v9=$this->sanitize_input('class', $_POST[$this->db_prefix.$i.'_clickedClass'], $d9);
501
  $v10=$this->sanitize_input('class', $_POST[$this->db_prefix.$i.'_targetClass'], $d10);
645
  'value' => $v7,
646
  'values' => null,
647
  'id' => $this->db_prefix.$i.'_offset',
648
+ 'field_type' => 'text',
649
  'label' => 'Offset',
650
  'checkbox_label' => null,
651
  'radio_labels' => null,
652
  'field_info' => 'pixels',
653
+ 'description' => 'Offset scroll-to position by x amount of pixels (positive or negative) or by selector (e.g. <code>#navigation-menu</code>)',
654
  'wrapper' => null
655
  ),
656
  'highlightSelector' => array(
721
  }
722
 
723
  if(class_exists('malihuPageScroll2id')){ // --edit--
 
 
 
724
 
725
  malihuPageScroll2id::get_instance(); // --edit--
726
 
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
  === Page scroll to id ===
 
2
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28
3
  Tags: page scrolling, page animation, navigation, single-page navigation
4
  Requires at least: 3.3
5
  Tested up to: 3.8
6
- Stable tag: 1.5.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -17,7 +18,8 @@ The plugin replaces the default browser behaviour of "jumping" to page sections
17
  * Advanced animation easings
18
  * Vertical and/or horizontal scrolling
19
  * Links and targets highlighting via ready-to-use classes
20
- * Auto-adjustable Scroll-to position and user defined offset
 
21
 
22
  = Demo =
23
 
@@ -64,7 +66,7 @@ Configure plugin options by clicking 'Settings' or through the 'Settings > Page
64
 
65
  = How to use the plugin with WP custom/native menus? =
66
 
67
- While on the 'Menus' admin page, click 'Screen Options' and check 'Link Relationship (XFN)'. To enable the plugin on a menu item, click the arrow on the right of the item and insert `m_PageScroll2id` in the 'Link Relationship (XFN)' field (assuming your menu contains links with `URL` value in the form of `#id`).
68
 
69
  = How to use the plugin without editing my theme's markup? =
70
 
@@ -76,12 +78,16 @@ You can add the `m_PageScroll2id` in your link's rel attribute (along with the o
76
 
77
  = How do I highlight current menu items? =
78
 
79
- The plugin provides a ready-to-use class for styling highlighted links (the links whose target element is considered to be within the viewport). The default highlight class is `mPS2id-highlight`, so you can use it in your theme's CSS to style current menu items, e.g. `.menu-item a.mPS2id-highlight{ background: #ff0; }`
80
 
81
  = When I click the link, nothing happens... =
82
 
83
  Make sure your link has href value `#` with the id of the section you want to scroll-to (e.g. `<a href="#id" rel="m_PageScroll2id">link</a>`) and a section with such an id exists in your page (e.g. `<div id="id">target</div>`).
84
 
 
 
 
 
85
  = The page doesn't scroll exactly where I want =
86
 
87
  The scroll-to position is the top position of your target element. Your target's top position does not include its margins, so make sure to check your element's actual position via your browser's developer tools and change your CSS if needed. You can also offset the scroll-to position by setting an `offset` value (in pixels) in plugin's settings.
@@ -90,6 +96,14 @@ The scroll-to position is the top position of your target element. Your target's
90
 
91
  Your target element is probably not at the very top (check its position via your browser's developer tools). If your link has href value `#top` and no target with id `top` exists in your page, the plugin will automatically scroll the page to the very top (the position of the `body` tag).
92
 
 
 
 
 
 
 
 
 
93
  = Can I use the plugin to scroll an overflowed div? =
94
 
95
  No. The plugin scrolls the entire page (the document's root element) so it works correctly highlighting links, alongside deep linking plugins etc. with mouse and touch events.
@@ -110,12 +124,20 @@ Yes but you probably need to implement the plugin in your theme **manually**. Se
110
 
111
  == Changelog ==
112
 
 
 
 
 
 
 
 
 
113
  = 1.5.2 =
114
- * Minor code tweaks
115
 
116
  = 1.5.1 =
117
- * Minor code tweaks
118
- * Minified scripts
119
 
120
  = 1.5.0 =
121
  * Dropped jQuery UI dependency (jQuery UI is no longer required for the plugin to work).
@@ -142,19 +164,26 @@ Yes but you probably need to implement the plugin in your theme **manually**. Se
142
 
143
  == Upgrade Notice ==
144
 
 
 
 
 
145
  = 1.5.0 =
146
 
147
  Dropped jQuery UI dependency, fixed bugs, added links highlighting, optimized scripts and extended documentation.
148
 
149
  == License ==
150
 
151
- GPLv3
152
 
153
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
154
-
155
- You should have received a copy of the GNU General Public License along with this program.
156
- If not, see <http://www.gnu.org/licenses/>.
157
 
158
  == Donate ==
159
 
160
- If you like this plugin and find it useful, consider making a [donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28) :).
 
 
 
 
 
1
  === Page scroll to id ===
2
+ 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, navigation, single-page navigation
5
  Requires at least: 3.3
6
  Tested up to: 3.8
7
+ Stable tag: 1.5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
18
  * Advanced animation easings
19
  * Vertical and/or horizontal scrolling
20
  * Links and targets highlighting via ready-to-use classes
21
+ * Auto-adjustable scroll-to position
22
+ * Advanced scroll-to position offset (by pixels, by element selector, link specific offsets etc.)
23
 
24
  = Demo =
25
 
66
 
67
  = How to use the plugin with WP custom/native menus? =
68
 
69
+ While on the 'Menus' admin page, click 'Screen Options' and check 'Link Relationship (XFN)'. To enable the plugin on a menu item, click the arrow on the right of the item and insert `m_PageScroll2id` in the 'Link Relationship (XFN)' field (assuming your menu contains links with `URL` value in the form of `#id` or `/somepage/#id`).
70
 
71
  = How to use the plugin without editing my theme's markup? =
72
 
78
 
79
  = How do I highlight current menu items? =
80
 
81
+ The plugin provides a ready-to-use class for styling highlighted links (the links whose target element is considered to be within the viewport). The default highlight class is `mPS2id-highlight`, so you can use it in your theme's CSS to style current menu items, e.g. `.menu-item a.mPS2id-highlight{ background: #ff0; }`.
82
 
83
  = When I click the link, nothing happens... =
84
 
85
  Make sure your link has href value `#` with the id of the section you want to scroll-to (e.g. `<a href="#id" rel="m_PageScroll2id">link</a>`) and a section with such an id exists in your page (e.g. `<div id="id">target</div>`).
86
 
87
+ = How do I make my links work from other/different pages? =
88
+
89
+ To make your links work from any page, you need to add the full (or absolute) address in your links href (instead of just the hash with the id). For example, you'll need to change `<a href="#id" rel="m_PageScroll2id">link</a>` to something like `<a href="http://mysite.com/some-page/#id" rel="m_PageScroll2id">link</a>`. The same applies for your WP custom menus. You'll need to insert the full address in the `URL` field.
90
+
91
  = The page doesn't scroll exactly where I want =
92
 
93
  The scroll-to position is the top position of your target element. Your target's top position does not include its margins, so make sure to check your element's actual position via your browser's developer tools and change your CSS if needed. You can also offset the scroll-to position by setting an `offset` value (in pixels) in plugin's settings.
96
 
97
  Your target element is probably not at the very top (check its position via your browser's developer tools). If your link has href value `#top` and no target with id `top` exists in your page, the plugin will automatically scroll the page to the very top (the position of the `body` tag).
98
 
99
+ = How to prevent my fixed navigation menu overlapping the content? =
100
+
101
+ Insert your menu selector in the Offset field in plugin settings. For example, if you have a fixed menu with id `navigation-menu`, set Offset to `#navigation-menu` in order to stop page scrolling below it and avoid overlapping your content.
102
+
103
+ = Can I specify link specific offset values? =
104
+
105
+ Yes, by adding the html attribute `data-ps2id-offset` to a link. For example, `<a href="#id" rel="m_PageScroll2id" data-ps2id-offset="100">link</a>` will offset scroll-to position by 100 pixels. You may also use the `ps2id` shortcode to create links with specific offsets, e.g. `[ps2id url='#id' offset='100']link[/ps2id]`.
106
+
107
  = Can I use the plugin to scroll an overflowed div? =
108
 
109
  No. The plugin scrolls the entire page (the document's root element) so it works correctly highlighting links, alongside deep linking plugins etc. with mouse and touch events.
124
 
125
  == Changelog ==
126
 
127
+ = 1.5.3 =
128
+ * Extended Offset option to accept element selectors in addition to fixed pixels values.
129
+ * Added `ps2id` shortcode for creating links in content editor.
130
+ * Added the ability to define link specific offsets via the html data attribute: `data-ps2id-offset`.
131
+ * Fixed some minor issues for WordPress versions lower than 3.5.
132
+ * Updated help and external links.
133
+ * Changed plugin license from LGPL to MIT.
134
+
135
  = 1.5.2 =
136
+ * Minor code tweaks.
137
 
138
  = 1.5.1 =
139
+ * Minor code tweaks.
140
+ * Minified scripts.
141
 
142
  = 1.5.0 =
143
  * Dropped jQuery UI dependency (jQuery UI is no longer required for the plugin to work).
164
 
165
  == Upgrade Notice ==
166
 
167
+ = 1.5.3 =
168
+
169
+ Extended Offset option, added shortcodes for link creation, updated documentation and added more external resources.
170
+
171
  = 1.5.0 =
172
 
173
  Dropped jQuery UI dependency, fixed bugs, added links highlighting, optimized scripts and extended documentation.
174
 
175
  == License ==
176
 
177
+ MIT
178
 
179
+ You should have received a copy of the MIT License along with this program.
180
+ If not, see <http://opensource.org/licenses/MIT>.
 
 
181
 
182
  == Donate ==
183
 
184
+ If you like this plugin and find it useful, consider making a [donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UYJ5G65M6ZA28) :).
185
+
186
+ == External resources ==
187
+
188
+ * [Smooth scrolling between page sections using Page scroll to id](http://sridharkatakam.com/smooth-scrolling-page-sections-using-page-scroll-id/)
189
+ * [Video tutorial: How to create a single page WordPress website](http://www.pootlepress.com/2013/02/video-tutorial-a-beginners-guide-on-how-to-create-a-single-page-wordpress-website/)