MouseWheel Smooth Scroll - Version 4.0

Version Description

  • generate JS file instead of PHP
  • optimized for cache
  • optimized for translator plugins
Download this release

Release Info

Developer kubiq
Plugin Icon 128x128 MouseWheel Smooth Scroll
Version 4.0
Comparing to
See all releases

Code changes from version 3.0 to 4.0

js/wpmss.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(){function e(){z.keyboardSupport&&m("keydown",a)}function t(){if(!Y&&document.body){Y=!0;var t=document.body,o=document.documentElement,n=window.innerHeight,r=t.scrollHeight;if(A=document.compatMode.indexOf("CSS")>=0?o:t,D=t,e(),top!=self)O=!0;else if(te&&r>n&&(t.offsetHeight<=n||o.offsetHeight<=n)){var a=document.createElement("div");a.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+A.scrollHeight+"px",document.body.appendChild(a);var i;T=function(){i||(i=setTimeout(function(){L||(a.style.height="0",a.style.height=A.scrollHeight+"px",i=null)},500))},setTimeout(T,10),m("resize",T);var l={attributes:!0,childList:!0,characterData:!1};if(M=new W(T),M.observe(t,l),A.offsetHeight<=n){var c=document.createElement("div");c.style.clear="both",t.appendChild(c)}}z.fixedBackground||L||(t.style.backgroundAttachment="scroll",o.style.backgroundAttachment="scroll")}}function o(){M&&M.disconnect(),w(I,r),w("mousedown",i),w("keydown",a),w("resize",T),w("load",t)}function n(e,t,o){if(p(t,o),1!=z.accelerationMax){var n=Date.now(),r=n-q;if(r<z.accelerationDelta){var a=(1+50/r)/2;a>1&&(a=Math.min(a,z.accelerationMax),t*=a,o*=a)}q=Date.now()}if(R.push({x:t,y:o,lastX:t<0?.99:-.99,lastY:o<0?.99:-.99,start:Date.now()}),!j){var i=e===document.body,l=function(n){for(var r=Date.now(),a=0,c=0,u=0;u<R.length;u++){var d=R[u],s=r-d.start,f=s>=z.animationTime,m=f?1:s/z.animationTime;z.pulseAlgorithm&&(m=x(m));var w=d.x*m-d.lastX>>0,h=d.y*m-d.lastY>>0;a+=w,c+=h,d.lastX+=w,d.lastY+=h,f&&(R.splice(u,1),u--)}i?window.scrollBy(a,c):(a&&(e.scrollLeft+=a),c&&(e.scrollTop+=c)),t||o||(R=[]),R.length?_(l,e,1e3/z.frameRate+1):j=!1};_(l,e,0),j=!0}}function r(e){Y||t();var o=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(h(D,"embed")||h(o,"embed")&&/\.pdf/i.test(o.src)||h(D,"object")||o.shadowRoot)return!0;var r=-e.wheelDeltaX||e.deltaX||0,a=-e.wheelDeltaY||e.deltaY||0;N&&(e.wheelDeltaX&&y(e.wheelDeltaX,120)&&(r=-120*(e.wheelDeltaX/Math.abs(e.wheelDeltaX))),e.wheelDeltaY&&y(e.wheelDeltaY,120)&&(a=-120*(e.wheelDeltaY/Math.abs(e.wheelDeltaY)))),r||a||(a=-e.wheelDelta||0),1===e.deltaMode&&(r*=40,a*=40);var i=u(o);return i?!!v(a)||(Math.abs(r)>1.2&&(r*=z.stepSize/120),Math.abs(a)>1.2&&(a*=z.stepSize/120),n(i,r,a),e.preventDefault(),void l()):!O||!J||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function a(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==K.spacebar;document.body.contains(D)||(D=document.activeElement);var r=/^(textarea|select|embed|object)$/i,a=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||r.test(t.nodeName)||h(t,"input")&&!a.test(t.type)||h(D,"video")||g(e)||t.isContentEditable||o)return!0;if((h(t,"button")||h(t,"input")&&a.test(t.type))&&e.keyCode===K.spacebar)return!0;if(h(t,"input")&&"radio"==t.type&&P[e.keyCode])return!0;var i,c=0,d=0,s=u(D);if(!s)return!O||!J||parent.keydown(e);var f=s.clientHeight;switch(s==document.body&&(f=window.innerHeight),e.keyCode){case K.up:d=-z.arrowScroll;break;case K.down:d=z.arrowScroll;break;case K.spacebar:i=e.shiftKey?1:-1,d=-i*f*.9;break;case K.pageup:d=.9*-f;break;case K.pagedown:d=.9*f;break;case K.home:d=-s.scrollTop;break;case K.end:var m=s.scrollHeight-s.scrollTop,w=m-f;d=w>0?w+10:0;break;case K.left:c=-z.arrowScroll;break;case K.right:c=z.arrowScroll;break;default:return!0}n(s,c,d),e.preventDefault(),l()}function i(e){D=e.target}function l(){clearTimeout(E),E=setInterval(function(){F={}},1e3)}function c(e,t){for(var o=e.length;o--;)F[V(e[o])]=t;return t}function u(e){var t=[],o=document.body,n=A.scrollHeight;do{var r=F[V(e)];if(r)return c(t,r);if(t.push(e),n===e.scrollHeight){var a=s(A)&&s(o),i=a||f(A);if(O&&d(A)||!O&&i)return c(t,$())}else if(d(e)&&f(e))return c(t,e)}while(e=e.parentElement)}function d(e){return e.clientHeight+10<e.scrollHeight}function s(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"hidden"!==t}function f(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function m(e,t){window.addEventListener(e,t,!1)}function w(e,t){window.removeEventListener(e,t,!1)}function h(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function p(e,t){e=e>0?1:-1,t=t>0?1:-1,X.x===e&&X.y===t||(X.x=e,X.y=t,R=[],q=0)}function v(e){if(e)return B.length||(B=[e,e,e]),e=Math.abs(e),B.push(e),B.shift(),clearTimeout(C),C=setTimeout(function(){try{localStorage.SS_deltaBuffer=B.join(",")}catch(e){}},1e3),!b(120)&&!b(100)}function y(e,t){return Math.floor(e/t)==e/t}function b(e){return y(B[0],e)&&y(B[1],e)&&y(B[2],e)}function g(e){var t=e.target,o=!1;if(document.URL.indexOf("www.youtube.com/watch")!=-1)do if(o=t.classList&&t.classList.contains("html5-video-controls"))break;while(t=t.parentNode);return o}function S(e){var t,o,n;return e*=z.pulseScale,e<1?t=e-(1-Math.exp(-e)):(o=Math.exp(-1),e-=1,n=1-Math.exp(-e),t=o+n*(1-o)),t*z.pulseNormalize}function x(e){return e>=1?1:e<=0?0:(1==z.pulseNormalize&&(z.pulseNormalize/=S(1)),S(e))}function k(e){for(var t in e)H.hasOwnProperty(t)&&(z[t]=e[t])}var D,M,T,E,C,H={frameRate:150,animationTime:1000,stepSize:100,pulseAlgorithm:!0,pulseScale:4,pulseNormalize:1,accelerationDelta:50,accelerationMax:3,keyboardSupport:!0,arrowScroll:50,fixedBackground:!0,excluded:""},z=H,L=!1,O=!1,X={x:0,y:0},Y=!1,A=document.documentElement,B=[],N=/^Mac/.test(navigator.platform),K={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},P={37:1,38:1,39:1,40:1},R=[],j=!1,q=Date.now(),V=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),F={};if(window.localStorage&&localStorage.SS_deltaBuffer)try{B=localStorage.SS_deltaBuffer.split(",")}catch(e){}var I,_=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)}}(),W=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,$=function(){var e;return function(){if(!e){var t=document.createElement("div");t.style.cssText="height:10000px;width:1px;",document.body.appendChild(t);var o=document.body.scrollTop;document.documentElement.scrollTop;window.scrollBy(0,3),e=document.body.scrollTop!=o?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(t)}return e}}(),U=window.navigator.userAgent,G=/Edge/.test(U),J=/chrome/i.test(U)&&!G,Q=/safari/i.test(U)&&!G,Z=/mobile/i.test(U),ee=/Windows NT 6.1/i.test(U)&&/rv:11/i.test(U),te=Q&&(/Version\/8/i.test(U)||/Version\/9/i.test(U)),oe=(J||Q||ee)&&!Z;"onwheel"in document.createElement("div")?I="wheel":"onmousewheel"in document.createElement("div")&&(I="mousewheel"),I&&oe&&(m(I,r),m("mousedown",i),m("load",t)),k.destroy=o,window.SmoothScrollOptions&&k(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return k}):"object"==typeof exports?module.exports=k:window.SmoothScroll=k}();
js/wpmss.php DELETED
@@ -1 +0,0 @@
1
- <?php header("content-type: application/x-javascript"); ?>!function(){function e(){z.keyboardSupport&&m("keydown",a)}function t(){if(!Y&&document.body){Y=!0;var t=document.body,o=document.documentElement,n=window.innerHeight,r=t.scrollHeight;if(A=document.compatMode.indexOf("CSS")>=0?o:t,D=t,e(),top!=self)O=!0;else if(te&&r>n&&(t.offsetHeight<=n||o.offsetHeight<=n)){var a=document.createElement("div");a.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+A.scrollHeight+"px",document.body.appendChild(a);var i;T=function(){i||(i=setTimeout(function(){L||(a.style.height="0",a.style.height=A.scrollHeight+"px",i=null)},500))},setTimeout(T,10),m("resize",T);var l={attributes:!0,childList:!0,characterData:!1};if(M=new W(T),M.observe(t,l),A.offsetHeight<=n){var c=document.createElement("div");c.style.clear="both",t.appendChild(c)}}z.fixedBackground||L||(t.style.backgroundAttachment="scroll",o.style.backgroundAttachment="scroll")}}function o(){M&&M.disconnect(),w(I,r),w("mousedown",i),w("keydown",a),w("resize",T),w("load",t)}function n(e,t,o){if(p(t,o),1!=z.accelerationMax){var n=Date.now(),r=n-q;if(r<z.accelerationDelta){var a=(1+50/r)/2;a>1&&(a=Math.min(a,z.accelerationMax),t*=a,o*=a)}q=Date.now()}if(R.push({x:t,y:o,lastX:t<0?.99:-.99,lastY:o<0?.99:-.99,start:Date.now()}),!j){var i=e===document.body,l=function(n){for(var r=Date.now(),a=0,c=0,u=0;u<R.length;u++){var d=R[u],s=r-d.start,f=s>=z.animationTime,m=f?1:s/z.animationTime;z.pulseAlgorithm&&(m=x(m));var w=d.x*m-d.lastX>>0,h=d.y*m-d.lastY>>0;a+=w,c+=h,d.lastX+=w,d.lastY+=h,f&&(R.splice(u,1),u--)}i?window.scrollBy(a,c):(a&&(e.scrollLeft+=a),c&&(e.scrollTop+=c)),t||o||(R=[]),R.length?_(l,e,1e3/z.frameRate+1):j=!1};_(l,e,0),j=!0}}function r(e){Y||t();var o=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(h(D,"embed")||h(o,"embed")&&/\.pdf/i.test(o.src)||h(D,"object")||o.shadowRoot)return!0;var r=-e.wheelDeltaX||e.deltaX||0,a=-e.wheelDeltaY||e.deltaY||0;N&&(e.wheelDeltaX&&y(e.wheelDeltaX,120)&&(r=-120*(e.wheelDeltaX/Math.abs(e.wheelDeltaX))),e.wheelDeltaY&&y(e.wheelDeltaY,120)&&(a=-120*(e.wheelDeltaY/Math.abs(e.wheelDeltaY)))),r||a||(a=-e.wheelDelta||0),1===e.deltaMode&&(r*=40,a*=40);var i=u(o);return i?!!v(a)||(Math.abs(r)>1.2&&(r*=z.stepSize/120),Math.abs(a)>1.2&&(a*=z.stepSize/120),n(i,r,a),e.preventDefault(),void l()):!O||!J||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function a(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==K.spacebar;document.body.contains(D)||(D=document.activeElement);var r=/^(textarea|select|embed|object)$/i,a=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||r.test(t.nodeName)||h(t,"input")&&!a.test(t.type)||h(D,"video")||g(e)||t.isContentEditable||o)return!0;if((h(t,"button")||h(t,"input")&&a.test(t.type))&&e.keyCode===K.spacebar)return!0;if(h(t,"input")&&"radio"==t.type&&P[e.keyCode])return!0;var i,c=0,d=0,s=u(D);if(!s)return!O||!J||parent.keydown(e);var f=s.clientHeight;switch(s==document.body&&(f=window.innerHeight),e.keyCode){case K.up:d=-z.arrowScroll;break;case K.down:d=z.arrowScroll;break;case K.spacebar:i=e.shiftKey?1:-1,d=-i*f*.9;break;case K.pageup:d=.9*-f;break;case K.pagedown:d=.9*f;break;case K.home:d=-s.scrollTop;break;case K.end:var m=s.scrollHeight-s.scrollTop,w=m-f;d=w>0?w+10:0;break;case K.left:c=-z.arrowScroll;break;case K.right:c=z.arrowScroll;break;default:return!0}n(s,c,d),e.preventDefault(),l()}function i(e){D=e.target}function l(){clearTimeout(E),E=setInterval(function(){F={}},1e3)}function c(e,t){for(var o=e.length;o--;)F[V(e[o])]=t;return t}function u(e){var t=[],o=document.body,n=A.scrollHeight;do{var r=F[V(e)];if(r)return c(t,r);if(t.push(e),n===e.scrollHeight){var a=s(A)&&s(o),i=a||f(A);if(O&&d(A)||!O&&i)return c(t,$())}else if(d(e)&&f(e))return c(t,e)}while(e=e.parentElement)}function d(e){return e.clientHeight+10<e.scrollHeight}function s(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"hidden"!==t}function f(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function m(e,t){window.addEventListener(e,t,!1)}function w(e,t){window.removeEventListener(e,t,!1)}function h(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function p(e,t){e=e>0?1:-1,t=t>0?1:-1,X.x===e&&X.y===t||(X.x=e,X.y=t,R=[],q=0)}function v(e){if(e)return B.length||(B=[e,e,e]),e=Math.abs(e),B.push(e),B.shift(),clearTimeout(C),C=setTimeout(function(){try{localStorage.SS_deltaBuffer=B.join(",")}catch(e){}},1e3),!b(120)&&!b(100)}function y(e,t){return Math.floor(e/t)==e/t}function b(e){return y(B[0],e)&&y(B[1],e)&&y(B[2],e)}function g(e){var t=e.target,o=!1;if(document.URL.indexOf("www.youtube.com/watch")!=-1)do if(o=t.classList&&t.classList.contains("html5-video-controls"))break;while(t=t.parentNode);return o}function S(e){var t,o,n;return e*=z.pulseScale,e<1?t=e-(1-Math.exp(-e)):(o=Math.exp(-1),e-=1,n=1-Math.exp(-e),t=o+n*(1-o)),t*z.pulseNormalize}function x(e){return e>=1?1:e<=0?0:(1==z.pulseNormalize&&(z.pulseNormalize/=S(1)),S(e))}function k(e){for(var t in e)H.hasOwnProperty(t)&&(z[t]=e[t])}var D,M,T,E,C,H={frameRate:<?php echo intval($_GET['frameRate']) ?>,animationTime:<?php echo intval($_GET['animationTime']) ?>,stepSize:<?php echo intval($_GET['stepSize']) ?>,pulseAlgorithm:!0,pulseScale:<?php echo intval($_GET['pulseScale']) ?>,pulseNormalize:<?php echo intval($_GET['pulseNormalize']) ?>,accelerationDelta:<?php echo intval($_GET['accelerationDelta']) ?>,accelerationMax:<?php echo intval($_GET['accelerationMax']) ?>,keyboardSupport:!0,arrowScroll:<?php echo intval($_GET['arrowScroll']) ?>,fixedBackground:!0,excluded:""},z=H,L=!1,O=!1,X={x:0,y:0},Y=!1,A=document.documentElement,B=[],N=/^Mac/.test(navigator.platform),K={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},P={37:1,38:1,39:1,40:1},R=[],j=!1,q=Date.now(),V=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),F={};if(window.localStorage&&localStorage.SS_deltaBuffer)try{B=localStorage.SS_deltaBuffer.split(",")}catch(e){}var I,_=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)}}(),W=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,$=function(){var e;return function(){if(!e){var t=document.createElement("div");t.style.cssText="height:10000px;width:1px;",document.body.appendChild(t);var o=document.body.scrollTop;document.documentElement.scrollTop;window.scrollBy(0,3),e=document.body.scrollTop!=o?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(t)}return e}}(),U=window.navigator.userAgent,G=/Edge/.test(U),J=/chrome/i.test(U)&&!G,Q=/safari/i.test(U)&&!G,Z=/mobile/i.test(U),ee=/Windows NT 6.1/i.test(U)&&/rv:11/i.test(U),te=Q&&(/Version\/8/i.test(U)||/Version\/9/i.test(U)),oe=(J||Q||ee)&&!Z;"onwheel"in document.createElement("div")?I="wheel":"onmousewheel"in document.createElement("div")&&(I="mousewheel"),I&&oe&&(m(I,r),m("mousedown",i),m("load",t)),k.destroy=o,window.SmoothScrollOptions&&k(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return k}):"object"==typeof exports?module.exports=k:window.SmoothScroll=k}();
 
languages/wpmss-sk_SK.mo DELETED
Binary file
languages/wpmss-sk_SK.po DELETED
@@ -1,196 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: woocommerce-heureka\n"
4
- "POT-Creation-Date: 2017-12-19 10:14+0100\n"
5
- "PO-Revision-Date: 2017-12-19 10:15+0100\n"
6
- "Last-Translator: Ing. Jakub Novák <info@kubiq.sk>\n"
7
- "Language-Team: KubiQ <info@kubiq.sk>\n"
8
- "Language: sk_SK\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 2.0.4\n"
13
- "X-Poedit-Basepath: .\n"
14
- "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __;_e\n"
17
- "X-Poedit-SearchPath-0: .\n"
18
- "X-Poedit-SearchPath-1: ./..\n"
19
-
20
- #: ../mousewheel-smooth-scroll.php:28
21
- msgid "Settings"
22
- msgstr "Nastavenia"
23
-
24
- #: ../mousewheel-smooth-scroll.php:36 ../mousewheel-smooth-scroll.php:37
25
- #: ../mousewheel-smooth-scroll.php:79
26
- msgid "MouseWheel Smooth Scroll"
27
- msgstr "MouseWheel Smooth Scroll"
28
-
29
- #: ../mousewheel-smooth-scroll.php:65
30
- msgid "General"
31
- msgstr "Všeobecné"
32
-
33
- #: ../mousewheel-smooth-scroll.php:65
34
- msgid "Help"
35
- msgstr "Pomoc"
36
-
37
- #: ../mousewheel-smooth-scroll.php:80
38
- msgid "Settings saved."
39
- msgstr "Nastavenia boli uložené."
40
-
41
- #: ../mousewheel-smooth-scroll.php:97
42
- msgid ""
43
- "Feel free to experiment with these settings, you can simply reset them to "
44
- "defaults by deleting fields values"
45
- msgstr ""
46
- "Nebojte sa experimentovať s nastaveniami, viete ich kedykoľvek resetovať "
47
- "tým, že vymažete hodnotu z políčka."
48
-
49
- #: ../mousewheel-smooth-scroll.php:101
50
- msgid "Scrolling Core"
51
- msgstr "Základné nastavenia"
52
-
53
- #: ../mousewheel-smooth-scroll.php:106
54
- msgid "frameRate"
55
- msgstr ""
56
-
57
- #: ../mousewheel-smooth-scroll.php:115
58
- msgid "animationTime"
59
- msgstr ""
60
-
61
- #: ../mousewheel-smooth-scroll.php:124
62
- msgid "stepSize"
63
- msgstr ""
64
-
65
- #: ../mousewheel-smooth-scroll.php:134
66
- msgid "Pulse (less tweakable)<br>ratio of \"tail\" to \"acceleration\""
67
- msgstr ""
68
-
69
- #: ../mousewheel-smooth-scroll.php:139
70
- msgid "pulseScale"
71
- msgstr ""
72
-
73
- #: ../mousewheel-smooth-scroll.php:147
74
- msgid "pulseNormalize"
75
- msgstr ""
76
-
77
- #: ../mousewheel-smooth-scroll.php:156
78
- msgid "Acceleration"
79
- msgstr "Zrýchlenie"
80
-
81
- #: ../mousewheel-smooth-scroll.php:161
82
- msgid "accelerationDelta"
83
- msgstr ""
84
-
85
- #: ../mousewheel-smooth-scroll.php:169
86
- msgid "accelerationMax"
87
- msgstr ""
88
-
89
- #: ../mousewheel-smooth-scroll.php:178
90
- msgid "Keyboard Settings"
91
- msgstr "Nastavenia klávesnice"
92
-
93
- #: ../mousewheel-smooth-scroll.php:183
94
- msgid "arrowScroll"
95
- msgstr ""
96
-
97
- #: ../mousewheel-smooth-scroll.php:191
98
- msgid "Save"
99
- msgstr "Uložiť"
100
-
101
- #: ../mousewheel-smooth-scroll.php:195
102
- msgid "Any ideas, problems, issues?"
103
- msgstr "Objavili ste chybu, máte nejaký problém alebo otázky k tomuto pluginu?"
104
-
105
- #~ msgid "Step:"
106
- #~ msgstr "Krok:"
107
-
108
- #~ msgid "Speed:"
109
- #~ msgstr "Rýchlosť:"
110
-
111
- #~ msgid "Ease:"
112
- #~ msgstr "Animácia:"
113
-
114
- #~ msgid "try easings"
115
- #~ msgstr "pozrieť animácie"
116
-
117
- #~ msgid "Enable for MAC and non-WebKit browsers (experimental)"
118
- #~ msgstr "Povoliť pre Mac a prehliadače, ktoré nemajú WebKit (experiment)"
119
-
120
- #~ msgid "Don't load (dequeue) jQuery Easing library"
121
- #~ msgstr "Nenačítavať (odpojiť) jQuery Easing knižnicu"
122
-
123
- #~ msgid "if you don't need it, or it's already loaded by another plugin"
124
- #~ msgstr "ak ju nepotrebujete, alebo je už načítaná iným modulom"
125
-
126
- #~ msgid "Enable mousewheel smooth scroll"
127
- #~ msgstr "Povoliť plugin"
128
-
129
- #~ msgid "HTML5 History"
130
- #~ msgstr "HTML5 History"
131
-
132
- #~ msgid "Element with content:"
133
- #~ msgstr "Element s obsahom"
134
-
135
- #~ msgid "Your settings have been saved."
136
- #~ msgstr "Vaše nastavenia boli uložené."
137
-
138
- #~ msgid "Heureka export"
139
- #~ msgstr "Heureka export"
140
-
141
- #~ msgid "Categories"
142
- #~ msgstr "Kategórie"
143
-
144
- #~ msgid "Shipping"
145
- #~ msgstr "Doprava"
146
-
147
- #~ msgid "Heureka XML export"
148
- #~ msgstr "Heureka XML export"
149
-
150
- #~ msgid "Product in stock is delivered in X days:"
151
- #~ msgstr "Ak je produkt skladom, dodanie trvá (dni):"
152
-
153
- #~ msgid "Product out of stock is delivered in X days:"
154
- #~ msgstr "Ak produkt nie je skladom, dodanie trvá (dni):"
155
-
156
- #~ msgid "Manufacturer"
157
- #~ msgstr "Výrobca"
158
-
159
- #~ msgid "This is attribute where manufacturer is stored"
160
- #~ msgstr "Táto vlastnosť je výrobca produktu"
161
-
162
- #~ msgid "Add manufacturer at the beginning of product name in XML export"
163
- #~ msgstr "Pridať výrobcu pred názov produtku v exporte do XML"
164
-
165
- #~ msgid "Attributes"
166
- #~ msgstr "Vlastnosti"
167
-
168
- #~ msgid "Attributes to display in export"
169
- #~ msgstr "Vlastnosti zobrazené v exporte"
170
-
171
- #~ msgid "Category"
172
- #~ msgstr "Kategória"
173
-
174
- #~ msgid "Price per click"
175
- #~ msgstr "Cena za preklik"
176
-
177
- #~ msgid "Shipping method"
178
- #~ msgstr "Spôsob dopravy"
179
-
180
- #~ msgid "Price"
181
- #~ msgstr "Cena"
182
-
183
- #~ msgid "Price COD"
184
- #~ msgstr "Cena na dobierku"
185
-
186
- #~ msgid "XML export for Heureka.sk:"
187
- #~ msgstr "XML export pre Heureka.sk:"
188
-
189
- #~ msgid "Settings saved succesfully"
190
- #~ msgstr "Nastavenia boli úspešne uložené"
191
-
192
- #~ msgid "Advanced"
193
- #~ msgstr "Pokročilé"
194
-
195
- #~ msgid "OSCommerce Database Settings"
196
- #~ msgstr "OSCommerce Database Settings"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/wpmss.pot ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: MouseWheel Smooth Scroll\n"
5
+ "POT-Creation-Date: 2018-08-11 18:09+0000\n"
6
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
+ "Last-Translator: Ing. Jakub Novák <info@kubiq.sk>\n"
8
+ "Language-Team: KubiQ <info@kubiq.sk>\n"
9
+ "Language: \n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Loco https://localise.biz/\n"
14
+ "X-Poedit-Basepath: .\n"
15
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+ "X-Poedit-SearchPath-1: ./.."
20
+
21
+ #: mousewheel-smooth-scroll.php:38 mousewheel-smooth-scroll.php:39
22
+ msgid "Smooth Scroll"
23
+ msgstr ""
24
+
25
+ #: mousewheel-smooth-scroll.php:109
26
+ msgid "MouseWheel Smooth Scroll"
27
+ msgstr ""
28
+
29
+ #: mousewheel-smooth-scroll.php:128
30
+ msgid ""
31
+ "Feel free to experiment with these settings, you can simply reset them to "
32
+ "defaults by deleting fields values"
33
+ msgstr ""
34
+
35
+ #: mousewheel-smooth-scroll.php:132
36
+ msgid "Scrolling Core"
37
+ msgstr ""
38
+
39
+ #: mousewheel-smooth-scroll.php:137
40
+ msgid "frameRate"
41
+ msgstr ""
42
+
43
+ #: mousewheel-smooth-scroll.php:146
44
+ msgid "animationTime"
45
+ msgstr ""
46
+
47
+ #: mousewheel-smooth-scroll.php:155
48
+ msgid "stepSize"
49
+ msgstr ""
50
+
51
+ #: mousewheel-smooth-scroll.php:165
52
+ msgid "Pulse (less tweakable)<br>ratio of \"tail\" to \"acceleration\""
53
+ msgstr ""
54
+
55
+ #: mousewheel-smooth-scroll.php:170
56
+ msgid "pulseScale"
57
+ msgstr ""
58
+
59
+ #: mousewheel-smooth-scroll.php:178
60
+ msgid "pulseNormalize"
61
+ msgstr ""
62
+
63
+ #: mousewheel-smooth-scroll.php:187
64
+ msgid "Acceleration"
65
+ msgstr ""
66
+
67
+ #: mousewheel-smooth-scroll.php:192
68
+ msgid "accelerationDelta"
69
+ msgstr ""
70
+
71
+ #: mousewheel-smooth-scroll.php:200
72
+ msgid "accelerationMax"
73
+ msgstr ""
74
+
75
+ #: mousewheel-smooth-scroll.php:209
76
+ msgid "Keyboard Settings"
77
+ msgstr ""
78
+
79
+ #: mousewheel-smooth-scroll.php:214
80
+ msgid "arrowScroll"
81
+ msgstr ""
82
+
83
+ #: mousewheel-smooth-scroll.php:226
84
+ msgid "Any ideas, problems, issues?"
85
+ msgstr ""
86
+
87
+ #. Description of the plugin
88
+ msgid "MouseWheel smooth scrolling for your WordPress website"
89
+ msgstr ""
90
+
91
+ #. URI of the plugin
92
+ #. Author URI of the plugin
93
+ msgid "https://kubiq.sk"
94
+ msgstr ""
95
+
96
+ #. Author of the plugin
97
+ msgid "KubiQ"
98
+ msgstr ""
mousewheel-smooth-scroll.php CHANGED
@@ -3,47 +3,53 @@
3
  Plugin Name: MouseWheel Smooth Scroll
4
  Plugin URI: https://kubiq.sk
5
  Description: MouseWheel smooth scrolling for your WordPress website
6
- Version: 3.0
7
  Author: KubiQ
8
  Author URI: https://kubiq.sk
 
 
9
  */
10
 
11
- if (!class_exists('wpmss')) {
12
  class wpmss {
13
- var $domain = 'wpmss';
14
  var $plugin_admin_page;
15
  var $settings;
16
  var $tab;
17
 
18
- function wpmss_func(){ $this->__construct(); }
19
-
20
  function __construct(){
21
- $mo = plugin_dir_path(__FILE__) . 'languages/' . $this->domain . '-' . get_locale() . '.mo';
22
- load_textdomain($this->domain, $mo);
23
  add_action( 'admin_menu', array( &$this, 'plugin_menu_link' ) );
24
- add_action( 'init', array( &$this, "plugin_init" ) );
 
 
 
 
25
  }
26
 
27
- function filter_plugin_actions($links, $file) {
28
- $settings_link = '<a href="options-general.php?page=' . basename(__FILE__) . '">' . __('Settings') . '</a>';
29
  array_unshift( $links, $settings_link );
30
  return $links;
31
  }
32
 
33
- function plugin_menu_link() {
34
  $this->plugin_admin_page = add_submenu_page(
35
  'options-general.php',
36
- __( 'Smooth Scroll', $this->domain ),
37
- __( 'Smooth Scroll', $this->domain ),
38
  'manage_options',
39
- basename(__FILE__),
40
  array( $this, 'admin_options_page' )
41
  );
42
- add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array($this, 'filter_plugin_actions'), 10, 2 );
43
  }
44
 
45
  function plugin_init(){
46
  $this->settings = get_option('wpmss_settings');
 
 
 
 
47
  $this->settings['general']['frameRate'] = isset( $this->settings['general']['frameRate'] ) && trim( $this->settings['general']['frameRate'] ) ? intval( $this->settings['general']['frameRate'] ) : 150;
48
  $this->settings['general']['animationTime'] = isset( $this->settings['general']['animationTime'] ) && trim( $this->settings['general']['animationTime'] ) ? intval( $this->settings['general']['animationTime'] ) : 1000;
49
  $this->settings['general']['stepSize'] = isset( $this->settings['general']['stepSize'] ) && trim( $this->settings['general']['stepSize'] ) ? intval( $this->settings['general']['stepSize'] ) : 100;
@@ -52,48 +58,64 @@ if (!class_exists('wpmss')) {
52
  $this->settings['general']['accelerationDelta'] = isset( $this->settings['general']['accelerationDelta'] ) && trim( $this->settings['general']['accelerationDelta'] ) ? intval( $this->settings['general']['accelerationDelta'] ) : 50;
53
  $this->settings['general']['accelerationMax'] = isset( $this->settings['general']['accelerationMax'] ) && trim( $this->settings['general']['accelerationMax'] ) ? intval( $this->settings['general']['accelerationMax'] ) : 3;
54
  $this->settings['general']['arrowScroll'] = isset( $this->settings['general']['arrowScroll'] ) && trim( $this->settings['general']['arrowScroll'] ) ? intval( $this->settings['general']['arrowScroll'] ) : 50;
55
- add_action( 'wp_enqueue_scripts', array($this, 'plugin_scripts_load') );
56
  }
57
 
58
  function plugin_scripts_load() {
59
- $options = array(
60
- 'frameRate' => $this->settings['general']['frameRate'],
61
- 'animationTime' => $this->settings['general']['animationTime'],
62
- 'stepSize' => $this->settings['general']['stepSize'],
63
- 'pulseScale' => $this->settings['general']['pulseScale'],
64
- 'pulseNormalize' => $this->settings['general']['pulseNormalize'],
65
- 'accelerationDelta' => $this->settings['general']['accelerationDelta'],
66
- 'accelerationMax' => $this->settings['general']['accelerationMax'],
67
- 'arrowScroll' => $this->settings['general']['arrowScroll'],
68
- );
69
- wp_enqueue_script( 'wpmss_scroll_scripts', plugins_url( 'js/wpmss.php?' . http_build_query($options), __FILE__ ), array('jquery'), 1, 1 );
70
  }
71
 
72
  function plugin_admin_tabs( $current = 'general' ) {
73
  $tabs = array( 'general' => __('General'), 'info' => __('Help') ); ?>
74
  <h2 class="nav-tab-wrapper">
75
  <?php foreach( $tabs as $tab => $name ){ ?>
76
- <a class="nav-tab <?php echo ( $tab == $current ) ? "nav-tab-active" : "" ?>" href="?page=<?php echo basename(__FILE__) ?>&amp;tab=<?php echo $tab ?>"><?php echo $name ?></a>
77
  <?php } ?>
78
  </h2><br><?php
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  function admin_options_page() {
82
- if ( get_current_screen()->id != $this->plugin_admin_page ) return;
83
- $this->tab = ( isset( $_GET['tab'] ) ) ? $_GET['tab'] : 'general';
84
- if(isset($_POST['plugin_sent'])) $this->settings[ $this->tab ] = $_POST;
85
- update_option( "wpmss_settings", $this->settings ); ?>
 
 
 
86
  <div class="wrap">
87
- <h2><?php _e( 'MouseWheel Smooth Scroll', $this->domain ); ?></h2>
88
  <?php if(isset($_POST['plugin_sent'])) echo '<div id="message" class="below-h2 updated"><p>'.__( 'Settings saved.' ).'</p></div>'; ?>
89
- <form method="post" action="<?php admin_url( 'options-general.php?page=' . basename(__FILE__) ); ?>">
90
  <input type="hidden" name="plugin_sent" value="1"><?php
91
  $this->plugin_admin_tabs( $this->tab );
92
- switch ( $this->tab ) :
93
- case 'general' :
94
  $this->plugin_general_options();
95
  break;
96
- case 'info' :
97
  $this->plugin_info_options();
98
  break;
99
  endswitch; ?>
@@ -102,110 +124,113 @@ if (!class_exists('wpmss')) {
102
  }
103
 
104
  function plugin_general_options(){ ?>
105
- <h3><?php _e("Feel free to experiment with these settings, you can simply reset them to defaults by deleting fields values", $this->domain) ?></h3>
 
106
  <table class="form-table">
107
  <tr>
108
  <th colspan="2">
109
- <h3><?php _e("Scrolling Core", $this->domain) ?></h3>
110
  </th>
111
  </tr>
112
  <tr>
113
  <th>
114
- <label for="q_field_1"><?php _e("frameRate", $this->domain) ?>:</label> 
115
  </th>
116
  <td>
117
- <input type="number" name="frameRate" placeholder="150" value="<?php echo $this->settings[ $this->tab ]["frameRate"]; ?>" id="q_field_1">
118
  [Hz]
119
  </td>
120
  </tr>
121
  <tr>
122
  <th>
123
- <label for="q_field_2"><?php _e("animationTime", $this->domain) ?>:</label> 
124
  </th>
125
  <td>
126
- <input type="number" name="animationTime" placeholder="1000" value="<?php echo $this->settings[ $this->tab ]["animationTime"]; ?>" id="q_field_2">
127
  [ms]
128
  </td>
129
  </tr>
130
  <tr>
131
  <th>
132
- <label for="q_field_3"><?php _e("stepSize", $this->domain) ?>:</label> 
133
  </th>
134
  <td>
135
- <input type="number" name="stepSize" placeholder="100" value="<?php echo $this->settings[ $this->tab ]["stepSize"]; ?>" id="q_field_3">
136
  [px]
137
  </td>
138
  </tr>
139
 
140
  <tr>
141
  <th colspan="2">
142
- <h3><?php _e('Pulse (less tweakable)<br>ratio of "tail" to "acceleration"', $this->domain) ?></h3>
143
  </th>
144
  </tr>
145
  <tr>
146
  <th>
147
- <label for="q_field_4"><?php _e("pulseScale", $this->domain) ?>:</label> 
148
  </th>
149
  <td>
150
- <input type="number" name="pulseScale" placeholder="4" value="<?php echo $this->settings[ $this->tab ]["pulseScale"]; ?>" id="q_field_4">
151
  </td>
152
  </tr>
153
  <tr>
154
  <th>
155
- <label for="q_field_5"><?php _e("pulseNormalize", $this->domain) ?>:</label> 
156
  </th>
157
  <td>
158
- <input type="number" name="pulseNormalize" placeholder="1" value="<?php echo $this->settings[ $this->tab ]["pulseNormalize"]; ?>" id="q_field_5">
159
  </td>
160
  </tr>
161
 
162
  <tr>
163
  <th colspan="2">
164
- <h3><?php _e('Acceleration', $this->domain) ?></h3>
165
  </th>
166
  </tr>
167
  <tr>
168
  <th>
169
- <label for="q_field_6"><?php _e("accelerationDelta", $this->domain) ?>:</label> 
170
  </th>
171
  <td>
172
- <input type="number" name="accelerationDelta" placeholder="50" value="<?php echo $this->settings[ $this->tab ]["accelerationDelta"]; ?>" id="q_field_6">
173
  </td>
174
  </tr>
175
  <tr>
176
  <th>
177
- <label for="q_field_7"><?php _e("accelerationMax", $this->domain) ?>:</label> 
178
  </th>
179
  <td>
180
- <input type="number" name="accelerationMax" placeholder="3" value="<?php echo $this->settings[ $this->tab ]["accelerationMax"]; ?>" id="q_field_7">
181
  </td>
182
  </tr>
183
 
184
  <tr>
185
  <th colspan="2">
186
- <h3><?php _e('Keyboard Settings', $this->domain) ?></h3>
187
  </th>
188
  </tr>
189
  <tr>
190
  <th>
191
- <label for="q_field_8"><?php _e("arrowScroll", $this->domain) ?>:</label> 
192
  </th>
193
  <td>
194
- <input type="number" name="arrowScroll" placeholder="50" value="<?php echo $this->settings[ $this->tab ]["arrowScroll"]; ?>" id="q_field_8">
195
  [px]
196
  </td>
197
  </tr>
198
  </table>
199
- <p class="submit"><input type="submit" class="button button-primary button-large" value="<?php _e( 'Save' ) ?>"></p><?php
200
  }
201
 
202
  function plugin_info_options(){ ?>
203
- <p><?php _e('Any ideas, problems, issues?', $this->domain) ?></p>
204
  <p>Ing. Jakub Novák</p>
205
  <p><a href="mailto:info@kubiq.sk" target="_blank">info@kubiq.sk</a></p>
206
- <p><a href="http://kubiq.sk/" target="_blank">https://kubiq.sk</a></p><?php
207
  }
208
  }
 
209
 
210
- $wpmss_var = new wpmss();
 
211
  }
3
  Plugin Name: MouseWheel Smooth Scroll
4
  Plugin URI: https://kubiq.sk
5
  Description: MouseWheel smooth scrolling for your WordPress website
6
+ Version: 4.0
7
  Author: KubiQ
8
  Author URI: https://kubiq.sk
9
+ Text Domain: wpmss
10
+ Domain Path: /languages
11
  */
12
 
13
+ if( ! class_exists('wpmss') ){
14
  class wpmss {
 
15
  var $plugin_admin_page;
16
  var $settings;
17
  var $tab;
18
 
 
 
19
  function __construct(){
20
+ add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
 
21
  add_action( 'admin_menu', array( &$this, 'plugin_menu_link' ) );
22
+ add_action( 'init', array( &$this, 'plugin_init' ) );
23
+ }
24
+
25
+ function plugins_loaded(){
26
+ load_plugin_textdomain( 'wpmss', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
27
  }
28
 
29
+ function filter_plugin_actions( $links, $file ){
30
+ $settings_link = '<a href="options-general.php?page=' . basename( __FILE__ ) . '">' . __('Settings') . '</a>';
31
  array_unshift( $links, $settings_link );
32
  return $links;
33
  }
34
 
35
+ function plugin_menu_link(){
36
  $this->plugin_admin_page = add_submenu_page(
37
  'options-general.php',
38
+ __( 'Smooth Scroll', 'wpmss' ),
39
+ __( 'Smooth Scroll', 'wpmss' ),
40
  'manage_options',
41
+ basename( __FILE__ ),
42
  array( $this, 'admin_options_page' )
43
  );
44
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'filter_plugin_actions' ), 10, 2 );
45
  }
46
 
47
  function plugin_init(){
48
  $this->settings = get_option('wpmss_settings');
49
+ if( ! isset( $this->settings['general']['timestamp'] ) ){
50
+ $this->settings['general']['timestamp'] = time();
51
+ update_option( 'wpmss_settings', $this->settings );
52
+ }
53
  $this->settings['general']['frameRate'] = isset( $this->settings['general']['frameRate'] ) && trim( $this->settings['general']['frameRate'] ) ? intval( $this->settings['general']['frameRate'] ) : 150;
54
  $this->settings['general']['animationTime'] = isset( $this->settings['general']['animationTime'] ) && trim( $this->settings['general']['animationTime'] ) ? intval( $this->settings['general']['animationTime'] ) : 1000;
55
  $this->settings['general']['stepSize'] = isset( $this->settings['general']['stepSize'] ) && trim( $this->settings['general']['stepSize'] ) ? intval( $this->settings['general']['stepSize'] ) : 100;
58
  $this->settings['general']['accelerationDelta'] = isset( $this->settings['general']['accelerationDelta'] ) && trim( $this->settings['general']['accelerationDelta'] ) ? intval( $this->settings['general']['accelerationDelta'] ) : 50;
59
  $this->settings['general']['accelerationMax'] = isset( $this->settings['general']['accelerationMax'] ) && trim( $this->settings['general']['accelerationMax'] ) ? intval( $this->settings['general']['accelerationMax'] ) : 3;
60
  $this->settings['general']['arrowScroll'] = isset( $this->settings['general']['arrowScroll'] ) && trim( $this->settings['general']['arrowScroll'] ) ? intval( $this->settings['general']['arrowScroll'] ) : 50;
61
+ add_action( 'wp_enqueue_scripts', array( $this, 'plugin_scripts_load' ) );
62
  }
63
 
64
  function plugin_scripts_load() {
65
+ wp_enqueue_script( 'wpmss_script', plugins_url( 'js/wpmss.min.js', __FILE__ ), array('jquery'), $this->settings['general']['timestamp'], 1 );
 
 
 
 
 
 
 
 
 
 
66
  }
67
 
68
  function plugin_admin_tabs( $current = 'general' ) {
69
  $tabs = array( 'general' => __('General'), 'info' => __('Help') ); ?>
70
  <h2 class="nav-tab-wrapper">
71
  <?php foreach( $tabs as $tab => $name ){ ?>
72
+ <a class="nav-tab <?php echo ( $tab == $current ) ? "nav-tab-active" : "" ?>" href="?page=<?php echo basename( __FILE__ ) ?>&amp;tab=<?php echo $tab ?>"><?php echo $name ?></a>
73
  <?php } ?>
74
  </h2><br><?php
75
  }
76
 
77
+ function save_as_js(){
78
+ global $wp_filesystem;
79
+
80
+ $content = sprintf(
81
+ '!function(){function e(){z.keyboardSupport&&m("keydown",a)}function t(){if(!Y&&document.body){Y=!0;var t=document.body,o=document.documentElement,n=window.innerHeight,r=t.scrollHeight;if(A=document.compatMode.indexOf("CSS")>=0?o:t,D=t,e(),top!=self)O=!0;else if(te&&r>n&&(t.offsetHeight<=n||o.offsetHeight<=n)){var a=document.createElement("div");a.style.cssText="position:absolute; z-index:-10000; top:0; left:0; right:0; height:"+A.scrollHeight+"px",document.body.appendChild(a);var i;T=function(){i||(i=setTimeout(function(){L||(a.style.height="0",a.style.height=A.scrollHeight+"px",i=null)},500))},setTimeout(T,10),m("resize",T);var l={attributes:!0,childList:!0,characterData:!1};if(M=new W(T),M.observe(t,l),A.offsetHeight<=n){var c=document.createElement("div");c.style.clear="both",t.appendChild(c)}}z.fixedBackground||L||(t.style.backgroundAttachment="scroll",o.style.backgroundAttachment="scroll")}}function o(){M&&M.disconnect(),w(I,r),w("mousedown",i),w("keydown",a),w("resize",T),w("load",t)}function n(e,t,o){if(p(t,o),1!=z.accelerationMax){var n=Date.now(),r=n-q;if(r<z.accelerationDelta){var a=(1+50/r)/2;a>1&&(a=Math.min(a,z.accelerationMax),t*=a,o*=a)}q=Date.now()}if(R.push({x:t,y:o,lastX:t<0?.99:-.99,lastY:o<0?.99:-.99,start:Date.now()}),!j){var i=e===document.body,l=function(n){for(var r=Date.now(),a=0,c=0,u=0;u<R.length;u++){var d=R[u],s=r-d.start,f=s>=z.animationTime,m=f?1:s/z.animationTime;z.pulseAlgorithm&&(m=x(m));var w=d.x*m-d.lastX>>0,h=d.y*m-d.lastY>>0;a+=w,c+=h,d.lastX+=w,d.lastY+=h,f&&(R.splice(u,1),u--)}i?window.scrollBy(a,c):(a&&(e.scrollLeft+=a),c&&(e.scrollTop+=c)),t||o||(R=[]),R.length?_(l,e,1e3/z.frameRate+1):j=!1};_(l,e,0),j=!0}}function r(e){Y||t();var o=e.target;if(e.defaultPrevented||e.ctrlKey)return!0;if(h(D,"embed")||h(o,"embed")&&/\.pdf/i.test(o.src)||h(D,"object")||o.shadowRoot)return!0;var r=-e.wheelDeltaX||e.deltaX||0,a=-e.wheelDeltaY||e.deltaY||0;N&&(e.wheelDeltaX&&y(e.wheelDeltaX,120)&&(r=-120*(e.wheelDeltaX/Math.abs(e.wheelDeltaX))),e.wheelDeltaY&&y(e.wheelDeltaY,120)&&(a=-120*(e.wheelDeltaY/Math.abs(e.wheelDeltaY)))),r||a||(a=-e.wheelDelta||0),1===e.deltaMode&&(r*=40,a*=40);var i=u(o);return i?!!v(a)||(Math.abs(r)>1.2&&(r*=z.stepSize/120),Math.abs(a)>1.2&&(a*=z.stepSize/120),n(i,r,a),e.preventDefault(),void l()):!O||!J||(Object.defineProperty(e,"target",{value:window.frameElement}),parent.wheel(e))}function a(e){var t=e.target,o=e.ctrlKey||e.altKey||e.metaKey||e.shiftKey&&e.keyCode!==K.spacebar;document.body.contains(D)||(D=document.activeElement);var r=/^(textarea|select|embed|object)$/i,a=/^(button|submit|radio|checkbox|file|color|image)$/i;if(e.defaultPrevented||r.test(t.nodeName)||h(t,"input")&&!a.test(t.type)||h(D,"video")||g(e)||t.isContentEditable||o)return!0;if((h(t,"button")||h(t,"input")&&a.test(t.type))&&e.keyCode===K.spacebar)return!0;if(h(t,"input")&&"radio"==t.type&&P[e.keyCode])return!0;var i,c=0,d=0,s=u(D);if(!s)return!O||!J||parent.keydown(e);var f=s.clientHeight;switch(s==document.body&&(f=window.innerHeight),e.keyCode){case K.up:d=-z.arrowScroll;break;case K.down:d=z.arrowScroll;break;case K.spacebar:i=e.shiftKey?1:-1,d=-i*f*.9;break;case K.pageup:d=.9*-f;break;case K.pagedown:d=.9*f;break;case K.home:d=-s.scrollTop;break;case K.end:var m=s.scrollHeight-s.scrollTop,w=m-f;d=w>0?w+10:0;break;case K.left:c=-z.arrowScroll;break;case K.right:c=z.arrowScroll;break;default:return!0}n(s,c,d),e.preventDefault(),l()}function i(e){D=e.target}function l(){clearTimeout(E),E=setInterval(function(){F={}},1e3)}function c(e,t){for(var o=e.length;o--;)F[V(e[o])]=t;return t}function u(e){var t=[],o=document.body,n=A.scrollHeight;do{var r=F[V(e)];if(r)return c(t,r);if(t.push(e),n===e.scrollHeight){var a=s(A)&&s(o),i=a||f(A);if(O&&d(A)||!O&&i)return c(t,$())}else if(d(e)&&f(e))return c(t,e)}while(e=e.parentElement)}function d(e){return e.clientHeight+10<e.scrollHeight}function s(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"hidden"!==t}function f(e){var t=getComputedStyle(e,"").getPropertyValue("overflow-y");return"scroll"===t||"auto"===t}function m(e,t){window.addEventListener(e,t,!1)}function w(e,t){window.removeEventListener(e,t,!1)}function h(e,t){return(e.nodeName||"").toLowerCase()===t.toLowerCase()}function p(e,t){e=e>0?1:-1,t=t>0?1:-1,X.x===e&&X.y===t||(X.x=e,X.y=t,R=[],q=0)}function v(e){if(e)return B.length||(B=[e,e,e]),e=Math.abs(e),B.push(e),B.shift(),clearTimeout(C),C=setTimeout(function(){try{localStorage.SS_deltaBuffer=B.join(",")}catch(e){}},1e3),!b(120)&&!b(100)}function y(e,t){return Math.floor(e/t)==e/t}function b(e){return y(B[0],e)&&y(B[1],e)&&y(B[2],e)}function g(e){var t=e.target,o=!1;if(document.URL.indexOf("www.youtube.com/watch")!=-1)do if(o=t.classList&&t.classList.contains("html5-video-controls"))break;while(t=t.parentNode);return o}function S(e){var t,o,n;return e*=z.pulseScale,e<1?t=e-(1-Math.exp(-e)):(o=Math.exp(-1),e-=1,n=1-Math.exp(-e),t=o+n*(1-o)),t*z.pulseNormalize}function x(e){return e>=1?1:e<=0?0:(1==z.pulseNormalize&&(z.pulseNormalize/=S(1)),S(e))}function k(e){for(var t in e)H.hasOwnProperty(t)&&(z[t]=e[t])}var D,M,T,E,C,H={frameRate:%d,animationTime:%d,stepSize:%d,pulseAlgorithm:!0,pulseScale:%d,pulseNormalize:%d,accelerationDelta:%d,accelerationMax:%d,keyboardSupport:!0,arrowScroll:%d,fixedBackground:!0,excluded:""},z=H,L=!1,O=!1,X={x:0,y:0},Y=!1,A=document.documentElement,B=[],N=/^Mac/.test(navigator.platform),K={left:37,up:38,right:39,down:40,spacebar:32,pageup:33,pagedown:34,end:35,home:36},P={37:1,38:1,39:1,40:1},R=[],j=!1,q=Date.now(),V=function(){var e=0;return function(t){return t.uniqueID||(t.uniqueID=e++)}}(),F={};if(window.localStorage&&localStorage.SS_deltaBuffer)try{B=localStorage.SS_deltaBuffer.split(",")}catch(e){}var I,_=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e,t,o){window.setTimeout(e,o||1e3/60)}}(),W=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,$=function(){var e;return function(){if(!e){var t=document.createElement("div");t.style.cssText="height:10000px;width:1px;",document.body.appendChild(t);var o=document.body.scrollTop;document.documentElement.scrollTop;window.scrollBy(0,3),e=document.body.scrollTop!=o?document.body:document.documentElement,window.scrollBy(0,-3),document.body.removeChild(t)}return e}}(),U=window.navigator.userAgent,G=/Edge/.test(U),J=/chrome/i.test(U)&&!G,Q=/safari/i.test(U)&&!G,Z=/mobile/i.test(U),ee=/Windows NT 6.1/i.test(U)&&/rv:11/i.test(U),te=Q&&(/Version\/8/i.test(U)||/Version\/9/i.test(U)),oe=(J||Q||ee)&&!Z;"onwheel"in document.createElement("div")?I="wheel":"onmousewheel"in document.createElement("div")&&(I="mousewheel"),I&&oe&&(m(I,r),m("mousedown",i),m("load",t)),k.destroy=o,window.SmoothScrollOptions&&k(window.SmoothScrollOptions),"function"==typeof define&&define.amd?define(function(){return k}):"object"==typeof exports?module.exports=k:window.SmoothScroll=k}();',
82
+ intval( $this->settings['general']['frameRate'] ),
83
+ intval( $this->settings['general']['animationTime'] ),
84
+ intval( $this->settings['general']['stepSize'] ),
85
+ intval( $this->settings['general']['pulseScale'] ),
86
+ intval( $this->settings['general']['pulseNormalize'] ),
87
+ intval( $this->settings['general']['accelerationDelta'] ),
88
+ intval( $this->settings['general']['accelerationMax'] ),
89
+ intval( $this->settings['general']['arrowScroll'] )
90
+ );
91
+
92
+ if( empty( $wp_filesystem ) ){
93
+ require_once( ABSPATH .'/wp-admin/includes/file.php' );
94
+ WP_Filesystem();
95
+ }
96
+
97
+ $wp_filesystem->put_contents( __DIR__ . '/js/wpmss.min.js', $content, FS_CHMOD_FILE );
98
+ }
99
+
100
  function admin_options_page() {
101
+ if( get_current_screen()->id != $this->plugin_admin_page ) return;
102
+ $this->tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'general';
103
+ if( isset( $_POST['plugin_sent'] ) ){
104
+ $this->settings[ $this->tab ] = $_POST;
105
+ update_option( 'wpmss_settings', $this->settings );
106
+ $this->save_as_js();
107
+ } ?>
108
  <div class="wrap">
109
+ <h2><?php _e( 'MouseWheel Smooth Scroll', 'wpmss' ); ?></h2>
110
  <?php if(isset($_POST['plugin_sent'])) echo '<div id="message" class="below-h2 updated"><p>'.__( 'Settings saved.' ).'</p></div>'; ?>
111
+ <form method="post" action="<?php admin_url( 'options-general.php?page=' . basename( __FILE__ ) ); ?>">
112
  <input type="hidden" name="plugin_sent" value="1"><?php
113
  $this->plugin_admin_tabs( $this->tab );
114
+ switch( $this->tab ):
115
+ case 'general':
116
  $this->plugin_general_options();
117
  break;
118
+ case 'info':
119
  $this->plugin_info_options();
120
  break;
121
  endswitch; ?>
124
  }
125
 
126
  function plugin_general_options(){ ?>
127
+ <input type="hidden" name="timestamp" value="<?php echo time() ?>">
128
+ <h3><?php _e( 'Feel free to experiment with these settings, you can simply reset them to defaults by deleting fields values', 'wpmss' ) ?></h3>
129
  <table class="form-table">
130
  <tr>
131
  <th colspan="2">
132
+ <h3><?php _e( 'Scrolling Core', 'wpmss' ) ?></h3>
133
  </th>
134
  </tr>
135
  <tr>
136
  <th>
137
+ <label for="q_field_1"><?php _e( 'frameRate', 'wpmss' ) ?>:</label> 
138
  </th>
139
  <td>
140
+ <input type="number" name="frameRate" placeholder="150" value="<?php echo $this->settings[ $this->tab ]['frameRate'] ?>" id="q_field_1">
141
  [Hz]
142
  </td>
143
  </tr>
144
  <tr>
145
  <th>
146
+ <label for="q_field_2"><?php _e( 'animationTime', 'wpmss' ) ?>:</label> 
147
  </th>
148
  <td>
149
+ <input type="number" name="animationTime" placeholder="1000" value="<?php echo $this->settings[ $this->tab ]['animationTime'] ?>" id="q_field_2">
150
  [ms]
151
  </td>
152
  </tr>
153
  <tr>
154
  <th>
155
+ <label for="q_field_3"><?php _e( 'stepSize', 'wpmss' ) ?>:</label> 
156
  </th>
157
  <td>
158
+ <input type="number" name="stepSize" placeholder="100" value="<?php echo $this->settings[ $this->tab ]['stepSize'] ?>" id="q_field_3">
159
  [px]
160
  </td>
161
  </tr>
162
 
163
  <tr>
164
  <th colspan="2">
165
+ <h3><?php _e( 'Pulse (less tweakable)<br>ratio of "tail" to "acceleration"', 'wpmss' ) ?></h3>
166
  </th>
167
  </tr>
168
  <tr>
169
  <th>
170
+ <label for="q_field_4"><?php _e( 'pulseScale', 'wpmss' ) ?>:</label> 
171
  </th>
172
  <td>
173
+ <input type="number" name="pulseScale" placeholder="4" value="<?php echo $this->settings[ $this->tab ]['pulseScale'] ?>" id="q_field_4">
174
  </td>
175
  </tr>
176
  <tr>
177
  <th>
178
+ <label for="q_field_5"><?php _e( 'pulseNormalize', 'wpmss' ) ?>:</label> 
179
  </th>
180
  <td>
181
+ <input type="number" name="pulseNormalize" placeholder="1" value="<?php echo $this->settings[ $this->tab ]['pulseNormalize'] ?>" id="q_field_5">
182
  </td>
183
  </tr>
184
 
185
  <tr>
186
  <th colspan="2">
187
+ <h3><?php _e( 'Acceleration', 'wpmss' ) ?></h3>
188
  </th>
189
  </tr>
190
  <tr>
191
  <th>
192
+ <label for="q_field_6"><?php _e( 'accelerationDelta', 'wpmss' ) ?>:</label> 
193
  </th>
194
  <td>
195
+ <input type="number" name="accelerationDelta" placeholder="50" value="<?php echo $this->settings[ $this->tab ]['accelerationDelta'] ?>" id="q_field_6">
196
  </td>
197
  </tr>
198
  <tr>
199
  <th>
200
+ <label for="q_field_7"><?php _e( 'accelerationMax', 'wpmss' ) ?>:</label> 
201
  </th>
202
  <td>
203
+ <input type="number" name="accelerationMax" placeholder="3" value="<?php echo $this->settings[ $this->tab ]['accelerationMax'] ?>" id="q_field_7">
204
  </td>
205
  </tr>
206
 
207
  <tr>
208
  <th colspan="2">
209
+ <h3><?php _e( 'Keyboard Settings', 'wpmss' ) ?></h3>
210
  </th>
211
  </tr>
212
  <tr>
213
  <th>
214
+ <label for="q_field_8"><?php _e( 'arrowScroll', 'wpmss' ) ?>:</label> 
215
  </th>
216
  <td>
217
+ <input type="number" name="arrowScroll" placeholder="50" value="<?php echo $this->settings[ $this->tab ]['arrowScroll'] ?>" id="q_field_8">
218
  [px]
219
  </td>
220
  </tr>
221
  </table>
222
+ <p class="submit"><input type="submit" class="button button-primary button-large" value="<?php _e('Save') ?>"></p><?php
223
  }
224
 
225
  function plugin_info_options(){ ?>
226
+ <p><?php _e( 'Any ideas, problems, issues?', 'wpmss' ) ?></p>
227
  <p>Ing. Jakub Novák</p>
228
  <p><a href="mailto:info@kubiq.sk" target="_blank">info@kubiq.sk</a></p>
229
+ <p><a href="http://kubiq.sk" target="_blank">https://kubiq.sk</a></p><?php
230
  }
231
  }
232
+ }
233
 
234
+ if( class_exists('wpmss') ){
235
+ $wpmss = new wpmss();
236
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: KubiQ
3
  Donate link: https://kubiq.sk
4
  Tags: smooth scroll, mousewheel scroll, scrolling
5
  Requires at least: 3.0.1
6
- Tested up to: 4.9.1
7
- Stable tag: 3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -76,4 +76,9 @@ Replace basic website scrolling "effect" with nice smooth scroll using mousewhee
76
 
77
  = 3.0 =
78
  * completely new scrolling script
79
- * new options
 
 
 
 
 
3
  Donate link: https://kubiq.sk
4
  Tags: smooth scroll, mousewheel scroll, scrolling
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.9.8
7
+ Stable tag: 4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
76
 
77
  = 3.0 =
78
  * completely new scrolling script
79
+ * new options
80
+
81
+ = 4.0 =
82
+ * generate JS file instead of PHP
83
+ * optimized for cache
84
+ * optimized for translator plugins