jekyll-theme-so-simple 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/LICENSE +49 -49
- data/README.md +15 -2
- data/_data/authors.yml +16 -16
- data/_data/navigation.yml +16 -14
- data/_data/text.yml +36 -36
- data/_includes/disqus-comments.html +19 -19
- data/_includes/documents-collection.html +19 -19
- data/_includes/entry-date.html +6 -6
- data/_includes/entry.html +41 -39
- data/_includes/footer-custom.html +3 -3
- data/_includes/footer.html +24 -24
- data/_includes/google-analytics.html +9 -9
- data/_includes/head-custom.html +5 -5
- data/_includes/head-feed.html +1 -1
- data/_includes/head-seo.html +1 -1
- data/_includes/head.html +50 -50
- data/_includes/lunr-search-scripts.html +106 -106
- data/_includes/masthead.html +13 -13
- data/_includes/navigation.html +17 -17
- data/_includes/page-author.html +37 -37
- data/_includes/page-categories.html +14 -14
- data/_includes/page-date.html +4 -4
- data/_includes/page-image.html +14 -14
- data/_includes/page-pagination.html +19 -19
- data/_includes/page-tags.html +14 -14
- data/_includes/posts-all.html +3 -3
- data/_includes/posts-category.html +3 -3
- data/_includes/posts-paginated.html +74 -74
- data/_includes/posts-tag.html +3 -3
- data/_includes/read-time.html +16 -16
- data/_includes/responsive-embed +16 -16
- data/_includes/scripts.html +1 -3
- data/_includes/skip-links.html +8 -8
- data/_includes/social-share.html +6 -6
- data/_includes/toc +9 -9
- data/_layouts/categories.html +48 -48
- data/_layouts/category.html +9 -9
- data/_layouts/collection.html +9 -9
- data/_layouts/default.html +1 -1
- data/_layouts/home.html +17 -17
- data/_layouts/page.html +30 -30
- data/_layouts/post.html +41 -41
- data/_layouts/posts.html +29 -29
- data/_layouts/search.html +1 -1
- data/_layouts/tag.html +9 -9
- data/_layouts/tags.html +48 -48
- data/_sass/so-simple.scss +1 -1
- data/_sass/so-simple/_author.scss +45 -45
- data/_sass/so-simple/_base.scss +112 -112
- data/_sass/so-simple/_buttons.scss +92 -92
- data/_sass/so-simple/_entries.scss +182 -182
- data/_sass/so-simple/_functions.scss +4 -4
- data/_sass/so-simple/_global.scss +393 -393
- data/_sass/so-simple/_icons.scss +43 -43
- data/_sass/so-simple/_mixins.scss +5 -5
- data/_sass/so-simple/_notices.scss +93 -93
- data/_sass/so-simple/_page.scss +287 -282
- data/_sass/so-simple/_reset.scss +523 -523
- data/_sass/so-simple/_syntax-highlighting.scss +334 -334
- data/_sass/so-simple/_tables.scss +34 -34
- data/_sass/so-simple/_utilities.scss +7 -7
- data/_sass/so-simple/_variables.scss +132 -132
- data/_sass/so-simple/functions/_color.scss +21 -21
- data/_sass/so-simple/functions/_em.scss +7 -7
- data/_sass/so-simple/functions/_fluid-type.scss +33 -33
- data/_sass/so-simple/functions/_yiq.scss +38 -38
- data/_sass/so-simple/mixins/_clearfix.scss +32 -32
- data/_sass/so-simple/mixins/_float.scss +15 -15
- data/_sass/so-simple/mixins/_image.scss +38 -38
- data/_sass/so-simple/mixins/_lists.scss +9 -9
- data/_sass/so-simple/mixins/_text-truncate.scss +10 -10
- data/_sass/so-simple/utilities/_accessibility.scss +43 -43
- data/_sass/so-simple/utilities/_align.scss +60 -60
- data/_sass/so-simple/utilities/_animations.scss +99 -99
- data/_sass/so-simple/utilities/_clearfix.scss +7 -7
- data/_sass/so-simple/utilities/_float.scss +7 -7
- data/_sass/so-simple/utilities/_responsive-embed.scss +66 -66
- data/_sass/so-simple/utilities/_text.scss +48 -48
- data/_sass/so-simple/vendor/breakpoint/_breakpoint.scss +114 -114
- data/_sass/so-simple/vendor/breakpoint/_context.scss +94 -94
- data/_sass/so-simple/vendor/breakpoint/_helpers.scss +151 -151
- data/_sass/so-simple/vendor/breakpoint/_legacy-settings.scss +49 -49
- data/_sass/so-simple/vendor/breakpoint/_no-query.scss +15 -15
- data/_sass/so-simple/vendor/breakpoint/_parsers.scss +215 -215
- data/_sass/so-simple/vendor/breakpoint/_respond-to.scss +82 -82
- data/_sass/so-simple/vendor/breakpoint/_settings.scss +70 -70
- data/_sass/so-simple/vendor/breakpoint/parsers/_double.scss +33 -33
- data/_sass/so-simple/vendor/breakpoint/parsers/_query.scss +82 -82
- data/_sass/so-simple/vendor/breakpoint/parsers/_resolution.scss +31 -31
- data/_sass/so-simple/vendor/breakpoint/parsers/_single.scss +26 -26
- data/_sass/so-simple/vendor/breakpoint/parsers/_triple.scss +36 -36
- data/_sass/so-simple/vendor/breakpoint/parsers/double/_default-pair.scss +21 -21
- data/_sass/so-simple/vendor/breakpoint/parsers/double/_default.scss +22 -22
- data/_sass/so-simple/vendor/breakpoint/parsers/double/_double-string.scss +21 -21
- data/_sass/so-simple/vendor/breakpoint/parsers/resolution/_resolution.scss +60 -60
- data/_sass/so-simple/vendor/breakpoint/parsers/single/_default.scss +13 -13
- data/_sass/so-simple/vendor/breakpoint/parsers/triple/_default.scss +18 -18
- data/_sass/so-simple/vendor/lity/_lity.scss +221 -221
- data/assets/css/main.scss +7 -7
- data/assets/js/lunr/lunr.da.min.js +17 -17
- data/assets/js/lunr/lunr.de.min.js +17 -17
- data/assets/js/lunr/lunr.du.min.js +17 -17
- data/assets/js/lunr/lunr.es.min.js +17 -17
- data/assets/js/lunr/lunr.fi.min.js +17 -17
- data/assets/js/lunr/lunr.fr.min.js +17 -17
- data/assets/js/lunr/lunr.hu.min.js +17 -17
- data/assets/js/lunr/lunr.it.min.js +17 -17
- data/assets/js/lunr/lunr.jp.min.js +1 -1
- data/assets/js/lunr/lunr.min.js +6 -6
- data/assets/js/lunr/lunr.no.min.js +17 -17
- data/assets/js/lunr/lunr.pt.min.js +17 -17
- data/assets/js/lunr/lunr.ro.min.js +17 -17
- data/assets/js/lunr/lunr.ru.min.js +17 -17
- data/assets/js/lunr/lunr.sv.min.js +17 -17
- data/assets/js/lunr/lunr.tr.min.js +17 -17
- data/assets/js/main.js +17 -15
- data/assets/js/main.min.js +2 -2
- data/assets/js/plugins/jquery.smooth-scroll.js +358 -358
- data/assets/js/plugins/jquery.smooth-scroll.min.js +8 -8
- data/assets/js/plugins/lity.js +655 -655
- data/assets/js/plugins/lity.min.js +4 -4
- data/assets/js/plugins/table-of-contents.js +59 -59
- data/assets/js/search-data.json +43 -27
- metadata +3 -3
@@ -1,18 +1,18 @@
|
|
1
|
-
/*!
|
2
|
-
* Lunr languages, `Swedish` language
|
3
|
-
* https://github.com/MihaiValentin/lunr-languages
|
4
|
-
*
|
5
|
-
* Copyright 2014, Mihai Valentin
|
6
|
-
* http://www.mozilla.org/MPL/
|
7
|
-
*/
|
8
|
-
/*!
|
9
|
-
* based on
|
10
|
-
* Snowball JavaScript Library v0.3
|
11
|
-
* http://code.google.com/p/urim/
|
12
|
-
* http://snowball.tartarus.org/
|
13
|
-
*
|
14
|
-
* Copyright 2010, Oleg Mazko
|
15
|
-
* http://www.mozilla.org/MPL/
|
16
|
-
*/
|
17
|
-
|
1
|
+
/*!
|
2
|
+
* Lunr languages, `Swedish` language
|
3
|
+
* https://github.com/MihaiValentin/lunr-languages
|
4
|
+
*
|
5
|
+
* Copyright 2014, Mihai Valentin
|
6
|
+
* http://www.mozilla.org/MPL/
|
7
|
+
*/
|
8
|
+
/*!
|
9
|
+
* based on
|
10
|
+
* Snowball JavaScript Library v0.3
|
11
|
+
* http://code.google.com/p/urim/
|
12
|
+
* http://snowball.tartarus.org/
|
13
|
+
*
|
14
|
+
* Copyright 2010, Oleg Mazko
|
15
|
+
* http://www.mozilla.org/MPL/
|
16
|
+
*/
|
17
|
+
|
18
18
|
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if("undefined"==typeof e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if("undefined"==typeof e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o<a&&(o=a)}}function t(){var e,r=w.limit_backward;if(w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});
|
@@ -1,18 +1,18 @@
|
|
1
|
-
/*!
|
2
|
-
* Lunr languages, `Turkish` language
|
3
|
-
* https://github.com/MihaiValentin/lunr-languages
|
4
|
-
*
|
5
|
-
* Copyright 2014, Mihai Valentin
|
6
|
-
* http://www.mozilla.org/MPL/
|
7
|
-
*/
|
8
|
-
/*!
|
9
|
-
* based on
|
10
|
-
* Snowball JavaScript Library v0.3
|
11
|
-
* http://code.google.com/p/urim/
|
12
|
-
* http://snowball.tartarus.org/
|
13
|
-
*
|
14
|
-
* Copyright 2010, Oleg Mazko
|
15
|
-
* http://www.mozilla.org/MPL/
|
16
|
-
*/
|
17
|
-
|
1
|
+
/*!
|
2
|
+
* Lunr languages, `Turkish` language
|
3
|
+
* https://github.com/MihaiValentin/lunr-languages
|
4
|
+
*
|
5
|
+
* Copyright 2014, Mihai Valentin
|
6
|
+
* http://www.mozilla.org/MPL/
|
7
|
+
*/
|
8
|
+
/*!
|
9
|
+
* based on
|
10
|
+
* Snowball JavaScript Library v0.3
|
11
|
+
* http://code.google.com/p/urim/
|
12
|
+
* http://snowball.tartarus.org/
|
13
|
+
*
|
14
|
+
* Copyright 2010, Oleg Mazko
|
15
|
+
* http://www.mozilla.org/MPL/
|
16
|
+
*/
|
17
|
+
|
18
18
|
!function(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if("undefined"==typeof r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if("undefined"==typeof r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWordFilter,r.tr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.tr.stemmer))},r.tr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.tr.trimmer=r.trimmerSupport.generateTrimmer(r.tr.wordCharacters),r.Pipeline.registerFunction(r.tr.trimmer,"trimmer-tr"),r.tr.stemmer=function(){var i=r.stemmerSupport.Among,e=r.stemmerSupport.SnowballProgram,n=new function(){function r(r,i,e){for(;;){var n=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(r,i,e)){Dr.cursor=Dr.limit-n;break}if(Dr.cursor=Dr.limit-n,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function n(){var i,e;i=Dr.limit-Dr.cursor,r(Wr,97,305);for(var n=0;n<Br.length;n++){e=Dr.limit-Dr.cursor;var t=Br[n];if(Dr.eq_s_b(1,t[0])&&r(t[1],t[2],t[3]))return Dr.cursor=Dr.limit-i,!0;Dr.cursor=Dr.limit-e}return Dr.cursor=Dr.limit-e,!(!Dr.eq_s_b(1,"ü")||!r(Zr,246,252))&&(Dr.cursor=Dr.limit-i,!0)}function t(r,i){var e,n=Dr.limit-Dr.cursor;return r()&&(Dr.cursor=Dr.limit-n,Dr.cursor>Dr.limit_backward&&(Dr.cursor--,e=Dr.limit-Dr.cursor,i()))?(Dr.cursor=Dr.limit-e,!0):(Dr.cursor=Dr.limit-n,r()?(Dr.cursor=Dr.limit-n,!1):(Dr.cursor=Dr.limit-n,!(Dr.cursor<=Dr.limit_backward)&&(Dr.cursor--,!!i()&&(Dr.cursor=Dr.limit-n,!0))))}function u(r){return t(r,function(){return Dr.in_grouping_b(Wr,97,305)})}function o(){return u(function(){return Dr.eq_s_b(1,"n")})}function s(){return u(function(){return Dr.eq_s_b(1,"s")})}function c(){return u(function(){return Dr.eq_s_b(1,"y")})}function l(){return t(function(){return Dr.in_grouping_b(Lr,105,305)},function(){return Dr.out_grouping_b(Wr,97,305)})}function a(){return Dr.find_among_b(ur,10)&&l()}function m(){return n()&&Dr.in_grouping_b(Lr,105,305)&&s()}function d(){return Dr.find_among_b(or,2)}function f(){return n()&&Dr.in_grouping_b(Lr,105,305)&&c()}function b(){return n()&&Dr.find_among_b(sr,4)}function w(){return n()&&Dr.find_among_b(cr,4)&&o()}function _(){return n()&&Dr.find_among_b(lr,2)&&c()}function k(){return n()&&Dr.find_among_b(ar,2)}function p(){return n()&&Dr.find_among_b(mr,4)}function g(){return n()&&Dr.find_among_b(dr,2)}function y(){return n()&&Dr.find_among_b(fr,4)}function z(){return n()&&Dr.find_among_b(br,2)}function h(){return n()&&Dr.find_among_b(wr,2)&&c()}function v(){return Dr.eq_s_b(2,"ki")}function q(){return n()&&Dr.find_among_b(_r,2)&&o()}function C(){return n()&&Dr.find_among_b(kr,4)&&c()}function P(){return n()&&Dr.find_among_b(pr,4)}function F(){return n()&&Dr.find_among_b(gr,4)&&c()}function S(){return Dr.find_among_b(yr,4)}function W(){return n()&&Dr.find_among_b(zr,2)}function L(){return n()&&Dr.find_among_b(hr,4)}function x(){return n()&&Dr.find_among_b(vr,8)}function A(){return Dr.find_among_b(qr,2)}function E(){return n()&&Dr.find_among_b(Cr,32)&&c()}function j(){return Dr.find_among_b(Pr,8)&&c()}function T(){return n()&&Dr.find_among_b(Fr,4)&&c()}function Z(){return Dr.eq_s_b(3,"ken")&&c()}function B(){var r=Dr.limit-Dr.cursor;return!(T()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,Z()))))}function D(){if(A()){var r=Dr.limit-Dr.cursor;if(S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T())return!1}return!0}function G(){if(W()){Dr.bra=Dr.cursor,Dr.slice_del();var r=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,x()||(Dr.cursor=Dr.limit-r,E()||(Dr.cursor=Dr.limit-r,j()||(Dr.cursor=Dr.limit-r,T()||(Dr.cursor=Dr.limit-r)))),nr=!1,!1}return!0}function H(){if(!L())return!0;var r=Dr.limit-Dr.cursor;return!E()&&(Dr.cursor=Dr.limit-r,!j())}function I(){var r,i=Dr.limit-Dr.cursor;return!(S()||(Dr.cursor=Dr.limit-i,F()||(Dr.cursor=Dr.limit-i,P()||(Dr.cursor=Dr.limit-i,C()))))||(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,T()||(Dr.cursor=Dr.limit-r),!1)}function J(){var r,i=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,nr=!0,B()&&(Dr.cursor=Dr.limit-i,D()&&(Dr.cursor=Dr.limit-i,G()&&(Dr.cursor=Dr.limit-i,H()&&(Dr.cursor=Dr.limit-i,I()))))){if(Dr.cursor=Dr.limit-i,!x())return;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,S()||(Dr.cursor=Dr.limit-r,W()||(Dr.cursor=Dr.limit-r,C()||(Dr.cursor=Dr.limit-r,P()||(Dr.cursor=Dr.limit-r,F()||(Dr.cursor=Dr.limit-r))))),T()||(Dr.cursor=Dr.limit-r)}Dr.bra=Dr.cursor,Dr.slice_del()}function K(){var r,i,e,n;if(Dr.ket=Dr.cursor,v()){if(r=Dr.limit-Dr.cursor,p())return Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,a()&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))),!0;if(Dr.cursor=Dr.limit-r,w()){if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,e=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-e,!m()&&(Dr.cursor=Dr.limit-e,!K())))return!0;Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}return!0}if(Dr.cursor=Dr.limit-r,g()){if(n=Dr.limit-Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-n,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-n,!K())return!1;return!0}}return!1}function M(r){if(Dr.ket=Dr.cursor,!g()&&(Dr.cursor=Dr.limit-r,!k()))return!1;var i=Dr.limit-Dr.cursor;if(d())Dr.bra=Dr.cursor,Dr.slice_del();else if(Dr.cursor=Dr.limit-i,m())Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K());else if(Dr.cursor=Dr.limit-i,!K())return!1;return!0}function N(r){if(Dr.ket=Dr.cursor,!z()&&(Dr.cursor=Dr.limit-r,!b()))return!1;var i=Dr.limit-Dr.cursor;return!(!m()&&(Dr.cursor=Dr.limit-i,!d()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)}function O(){var r,i=Dr.limit-Dr.cursor;return Dr.ket=Dr.cursor,!(!w()&&(Dr.cursor=Dr.limit-i,!h()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,!(!W()||(Dr.bra=Dr.cursor,Dr.slice_del(),!K()))||(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!(a()||(Dr.cursor=Dr.limit-r,m()||(Dr.cursor=Dr.limit-r,K())))||(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()),!0)))}function Q(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,!p()&&(Dr.cursor=Dr.limit-e,!f()&&(Dr.cursor=Dr.limit-e,!_())))return!1;if(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,r=Dr.limit-Dr.cursor,a())Dr.bra=Dr.cursor,Dr.slice_del(),i=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,W()||(Dr.cursor=Dr.limit-i);else if(Dr.cursor=Dr.limit-r,!W())return!0;return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,K(),!0}function R(){var r,i,e=Dr.limit-Dr.cursor;if(Dr.ket=Dr.cursor,W())return Dr.bra=Dr.cursor,Dr.slice_del(),void K();if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,q())if(Dr.bra=Dr.cursor,Dr.slice_del(),r=Dr.limit-Dr.cursor,Dr.ket=Dr.cursor,d())Dr.bra=Dr.cursor,Dr.slice_del();else{if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!a()&&(Dr.cursor=Dr.limit-r,!m())){if(Dr.cursor=Dr.limit-r,Dr.ket=Dr.cursor,!W())return;if(Dr.bra=Dr.cursor,Dr.slice_del(),!K())return}Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())}else if(Dr.cursor=Dr.limit-e,!M(e)&&(Dr.cursor=Dr.limit-e,!N(e))){if(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,y())return Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,i=Dr.limit-Dr.cursor,void(a()?(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K())):(Dr.cursor=Dr.limit-i,W()?(Dr.bra=Dr.cursor,Dr.slice_del(),K()):(Dr.cursor=Dr.limit-i,K())));if(Dr.cursor=Dr.limit-e,!O()){if(Dr.cursor=Dr.limit-e,d())return Dr.bra=Dr.cursor,void Dr.slice_del();Dr.cursor=Dr.limit-e,K()||(Dr.cursor=Dr.limit-e,Q()||(Dr.cursor=Dr.limit-e,Dr.ket=Dr.cursor,(a()||(Dr.cursor=Dr.limit-e,m()))&&(Dr.bra=Dr.cursor,Dr.slice_del(),Dr.ket=Dr.cursor,W()&&(Dr.bra=Dr.cursor,Dr.slice_del(),K()))))}}}function U(){var r;if(Dr.ket=Dr.cursor,r=Dr.find_among_b(Sr,4))switch(Dr.bra=Dr.cursor,r){case 1:Dr.slice_from("p");break;case 2:Dr.slice_from("ç");break;case 3:Dr.slice_from("t");break;case 4:Dr.slice_from("k")}}function V(){for(;;){var r=Dr.limit-Dr.cursor;if(Dr.in_grouping_b(Wr,97,305)){Dr.cursor=Dr.limit-r;break}if(Dr.cursor=Dr.limit-r,Dr.cursor<=Dr.limit_backward)return!1;Dr.cursor--}return!0}function X(r,i,e){if(Dr.cursor=Dr.limit-r,V()){var n=Dr.limit-Dr.cursor;if(!Dr.eq_s_b(1,i)&&(Dr.cursor=Dr.limit-n,!Dr.eq_s_b(1,e)))return!0;Dr.cursor=Dr.limit-r;var t=Dr.cursor;return Dr.insert(Dr.cursor,Dr.cursor,e),Dr.cursor=t,!1}return!0}function Y(){var r=Dr.limit-Dr.cursor;(Dr.eq_s_b(1,"d")||(Dr.cursor=Dr.limit-r,Dr.eq_s_b(1,"g")))&&X(r,"a","ı")&&X(r,"e","i")&&X(r,"o","u")&&X(r,"ö","ü")}function $(){for(var r,i=Dr.cursor,e=2;;){for(r=Dr.cursor;!Dr.in_grouping(Wr,97,305);){if(Dr.cursor>=Dr.limit)return Dr.cursor=r,!(e>0)&&(Dr.cursor=i,!0);Dr.cursor++}e--}}function rr(r,i,e){for(;!Dr.eq_s(i,e);){if(Dr.cursor>=Dr.limit)return!0;Dr.cursor++}return tr=i,tr!=Dr.limit||(Dr.cursor=r,!1)}function ir(){var r=Dr.cursor;return!rr(r,2,"ad")||(Dr.cursor=r,!rr(r,5,"soyad"))}function er(){var r=Dr.cursor;return!ir()&&(Dr.limit_backward=r,Dr.cursor=Dr.limit,Y(),Dr.cursor=Dr.limit,U(),!0)}var nr,tr,ur=[new i("m",-1,-1),new i("n",-1,-1),new i("miz",-1,-1),new i("niz",-1,-1),new i("muz",-1,-1),new i("nuz",-1,-1),new i("müz",-1,-1),new i("nüz",-1,-1),new i("mız",-1,-1),new i("nız",-1,-1)],or=[new i("leri",-1,-1),new i("ları",-1,-1)],sr=[new i("ni",-1,-1),new i("nu",-1,-1),new i("nü",-1,-1),new i("nı",-1,-1)],cr=[new i("in",-1,-1),new i("un",-1,-1),new i("ün",-1,-1),new i("ın",-1,-1)],lr=[new i("a",-1,-1),new i("e",-1,-1)],ar=[new i("na",-1,-1),new i("ne",-1,-1)],mr=[new i("da",-1,-1),new i("ta",-1,-1),new i("de",-1,-1),new i("te",-1,-1)],dr=[new i("nda",-1,-1),new i("nde",-1,-1)],fr=[new i("dan",-1,-1),new i("tan",-1,-1),new i("den",-1,-1),new i("ten",-1,-1)],br=[new i("ndan",-1,-1),new i("nden",-1,-1)],wr=[new i("la",-1,-1),new i("le",-1,-1)],_r=[new i("ca",-1,-1),new i("ce",-1,-1)],kr=[new i("im",-1,-1),new i("um",-1,-1),new i("üm",-1,-1),new i("ım",-1,-1)],pr=[new i("sin",-1,-1),new i("sun",-1,-1),new i("sün",-1,-1),new i("sın",-1,-1)],gr=[new i("iz",-1,-1),new i("uz",-1,-1),new i("üz",-1,-1),new i("ız",-1,-1)],yr=[new i("siniz",-1,-1),new i("sunuz",-1,-1),new i("sünüz",-1,-1),new i("sınız",-1,-1)],zr=[new i("lar",-1,-1),new i("ler",-1,-1)],hr=[new i("niz",-1,-1),new i("nuz",-1,-1),new i("nüz",-1,-1),new i("nız",-1,-1)],vr=[new i("dir",-1,-1),new i("tir",-1,-1),new i("dur",-1,-1),new i("tur",-1,-1),new i("dür",-1,-1),new i("tür",-1,-1),new i("dır",-1,-1),new i("tır",-1,-1)],qr=[new i("casına",-1,-1),new i("cesine",-1,-1)],Cr=[new i("di",-1,-1),new i("ti",-1,-1),new i("dik",-1,-1),new i("tik",-1,-1),new i("duk",-1,-1),new i("tuk",-1,-1),new i("dük",-1,-1),new i("tük",-1,-1),new i("dık",-1,-1),new i("tık",-1,-1),new i("dim",-1,-1),new i("tim",-1,-1),new i("dum",-1,-1),new i("tum",-1,-1),new i("düm",-1,-1),new i("tüm",-1,-1),new i("dım",-1,-1),new i("tım",-1,-1),new i("din",-1,-1),new i("tin",-1,-1),new i("dun",-1,-1),new i("tun",-1,-1),new i("dün",-1,-1),new i("tün",-1,-1),new i("dın",-1,-1),new i("tın",-1,-1),new i("du",-1,-1),new i("tu",-1,-1),new i("dü",-1,-1),new i("tü",-1,-1),new i("dı",-1,-1),new i("tı",-1,-1)],Pr=[new i("sa",-1,-1),new i("se",-1,-1),new i("sak",-1,-1),new i("sek",-1,-1),new i("sam",-1,-1),new i("sem",-1,-1),new i("san",-1,-1),new i("sen",-1,-1)],Fr=[new i("miş",-1,-1),new i("muş",-1,-1),new i("müş",-1,-1),new i("mış",-1,-1)],Sr=[new i("b",-1,1),new i("c",-1,2),new i("d",-1,3),new i("ğ",-1,4)],Wr=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,8,0,0,0,0,0,0,1],Lr=[1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,1],xr=[1,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],Ar=[17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130],Er=[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],jr=[17],Tr=[65],Zr=[65],Br=[["a",xr,97,305],["e",Ar,101,252],["ı",Er,97,305],["i",jr,101,105],["o",Tr,111,117],["ö",Zr,246,252],["u",Tr,111,117]],Dr=new e;this.setCurrent=function(r){Dr.setCurrent(r)},this.getCurrent=function(){return Dr.getCurrent()},this.stem=function(){return!!($()&&(Dr.limit_backward=Dr.cursor,Dr.cursor=Dr.limit,J(),Dr.cursor=Dr.limit,nr&&(R(),Dr.cursor=Dr.limit_backward,er())))}};return function(r){return"function"==typeof r.update?r.update(function(r){return n.setCurrent(r),n.stem(),n.getCurrent()}):(n.setCurrent(r),n.stem(),n.getCurrent())}}(),r.Pipeline.registerFunction(r.tr.stemmer,"stemmer-tr"),r.tr.stopWordFilter=r.generateStopWordFilter("acaba altmış altı ama ancak arada aslında ayrıca bana bazı belki ben benden beni benim beri beş bile bin bir biri birkaç birkez birçok birşey birşeyi biz bizden bize bizi bizim bu buna bunda bundan bunlar bunları bunların bunu bunun burada böyle böylece da daha dahi de defa değil diye diğer doksan dokuz dolayı dolayısıyla dört edecek eden ederek edilecek ediliyor edilmesi ediyor elli en etmesi etti ettiği ettiğini eğer gibi göre halen hangi hatta hem henüz hep hepsi her herhangi herkesin hiç hiçbir iki ile ilgili ise itibaren itibariyle için işte kadar karşın katrilyon kendi kendilerine kendini kendisi kendisine kendisini kez ki kim kimden kime kimi kimse kırk milyar milyon mu mü mı nasıl ne neden nedenle nerde nerede nereye niye niçin o olan olarak oldu olduklarını olduğu olduğunu olmadı olmadığı olmak olması olmayan olmaz olsa olsun olup olur olursa oluyor on ona ondan onlar onlardan onları onların onu onun otuz oysa pek rağmen sadece sanki sekiz seksen sen senden seni senin siz sizden sizi sizin tarafından trilyon tüm var vardı ve veya ya yani yapacak yapmak yaptı yaptıkları yaptığı yaptığını yapılan yapılması yapıyor yedi yerine yetmiş yine yirmi yoksa yüz zaten çok çünkü öyle üzere üç şey şeyden şeyi şeyler şu şuna şunda şundan şunları şunu şöyle".split(" ")),r.Pipeline.registerFunction(r.tr.stopWordFilter,"stopWordFilter-tr")}});
|
data/assets/js/main.js
CHANGED
@@ -1,15 +1,17 @@
|
|
1
|
-
$(document).ready(function() {
|
2
|
-
// main menu toggle
|
3
|
-
var toggleButton = document.getElementById("menu-toggle");
|
4
|
-
var menu = document.getElementById("primary-nav");
|
5
|
-
|
6
|
-
toggleButton
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
$(document).ready(function() {
|
2
|
+
// main menu toggle
|
3
|
+
var toggleButton = document.getElementById("menu-toggle");
|
4
|
+
var menu = document.getElementById("primary-nav");
|
5
|
+
|
6
|
+
if (toggleButton && menu) {
|
7
|
+
toggleButton.addEventListener("click", function() {
|
8
|
+
menu.classList.toggle("js-menu-is-open");
|
9
|
+
});
|
10
|
+
}
|
11
|
+
|
12
|
+
// initialize smooth scroll
|
13
|
+
$("a").smoothScroll({ offset: -20 });
|
14
|
+
|
15
|
+
// add lightbox class to all image links
|
16
|
+
$("a[href$='.jpg'], a[href$='.png'], a[href$='.gif']").attr("data-lity", "");
|
17
|
+
});
|
data/assets/js/main.min.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* So Simple Jekyll Theme 3.1.
|
2
|
+
* So Simple Jekyll Theme 3.1.1 by Michael Rose
|
3
3
|
* Copyright 2013-2018 Michael Rose - mademistakes.com | @mmistakes
|
4
4
|
* Licensed under MIT
|
5
5
|
*/
|
6
|
-
function showToc(e){var t=function(){e.style.display="block";var t=e.scrollHeight+"px";return e.style.disply="",t}();e.classList.add("js-toc-is-open"),e.style.height=t,window.setTimeout(function(){e.style.height=""},350)}function hideToc(e){e.style.height=e.scrollHeight+"px",window.setTimeout(function(){e.style.height="0"},1),window.setTimeout(function(){e.classList.remove("js-toc-is-open")},350)}function toggleToc(e){if(tocToggle.classList.toggle("js-toc-is-open"),e.classList.contains("js-toc-is-open"))return void hideToc(e);showToc(e)}!function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e){var t=O();return M&&e.length?(e.one(M,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function o(e,n,o){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===o)return void 0===e[n]?null:e[n];e[n]=o}else t.extend(e,n);return this}function i(e){var t=e.indexOf("?");t>-1&&(e=e.substr(t+1));for(var n,o=decodeURI(e.split("#")[0]).split("&"),i={},l=0,r=o.length;l<r;l++)o[l]&&(n=o[l].split("="),i[n[0]]=n[1]);return i}function l(e,n){if(!n)return e;if("string"===t.type(n)&&(n=i(n)),e.indexOf("?")>-1){var o=e.split("?");e=o.shift(),n=t.extend({},i(o[0]),n)}return e+"?"+t.param(n)}function r(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function s(e,t,n,o){return t&&t.element().addClass("lity-iframe"),n&&(e=l(e,n)),o&&(e=r(o,e)),'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function a(e){return t('<span class="lity-error"/>').append(e)}function c(e,n){var o=n.opener()&&n.opener().data("lity-desc")||"Image with no description",i=t('<img src="'+e+'" alt="'+o+'"/>'),l=O(),r=function(){l.reject(a("Failed loading image"))};return i.on("load",function(){if(0===this.naturalWidth)return r();l.resolve(i)}).on("error",r),l.promise()}function d(e,n){var o,i,l;try{o=t(e)}catch(e){return!1}return!!o.length&&(i=t('<i style="display:none !important"/>'),l=o.hasClass("lity-hide"),n.element().one("lity:remove",function(){i.before(o).remove(),l&&!o.closest(".lity-content").length&&o.addClass("lity-hide")}),o.removeClass("lity-hide").after(i))}function u(e,t){var n=H.exec(e);return!!n&&s("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4]+"?autoplay=1",t,n[5],e)}function f(e,t){var n=P.exec(e);return!!n&&s("https://player.vimeo.com/video/"+n[3]+"?autoplay=1",t,n[4],e)}function h(e,t){var n=F.exec(e);return!!n&&(0!==e.indexOf("http")&&(e="https:"+e),s("https://www.facebook.com/plugins/video.php?href="+e+"&autoplay=1",t,n[4],e))}function m(e,t){var n=W.exec(e);return!!n&&s("https://www.google."+n[3]+"/maps?"+n[6],t,{output:n[6].indexOf("layer=c")>0?"svembed":"embed"},e)}function p(e,t){return s(e,t)}function v(){return j.documentElement.clientHeight?j.documentElement.clientHeight:Math.round(C.height())}function g(e){var t=T();t&&(27===e.keyCode&&t.options("esc")&&t.close(),9===e.keyCode&&y(e,t))}function y(e,t){var n=t.element().find(B),o=n.index(j.activeElement);e.shiftKey&&o<=0?(n.get(n.length-1).focus(),e.preventDefault()):e.shiftKey||o!==n.length-1||(n.get(0).focus(),e.preventDefault())}function x(){t.each($,function(e,t){t.resize()})}function b(e){1===$.unshift(e)&&(D.addClass("lity-active"),C.on({resize:x,keydown:g})),t("body > *").not(e.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(z)&&e.data(z,e.attr(L)||null)}).attr(L,"true")}function w(e){var n;e.element().attr(L,"true"),1===$.length&&(D.removeClass("lity-active"),C.off({resize:x,keydown:g})),$=t.grep($,function(t){return e!==t}),n=$.length?$[0].element():t(".lity-hidden"),n.removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(z);n?e.attr(L,n):e.removeAttr(L),e.removeData(z)})}function T(){return 0===$.length?null:$[0]}function k(e,n,o,i){var l,r="inline",s=t.extend({},o);return i&&s[i]?(l=s[i](e,n),r=i):(t.each(["inline","iframe"],function(e,t){delete s[t],s[t]=o[t]}),t.each(s,function(t,o){return!o||(!(!o.test||o.test(e,n))||(l=o(e,n),!1!==l?(r=t,!1):void 0))})),{handler:r,content:l||""}}function E(e,i,l,r){function s(e){d=t(e).css("max-height",v()+"px"),c.find(".lity-loader").each(function(){var e=t(this);n(e).always(function(){e.remove()})}),c.removeClass("lity-loading").find(".lity-content").empty().append(d),f=!0,d.trigger("lity:ready",[u])}var a,c,d,u=this,f=!1,h=!1;i=t.extend({},I,i),c=t(i.template),u.element=function(){return c},u.opener=function(){return l},u.content=function(){return d},u.options=t.proxy(o,u,i),u.handlers=t.proxy(o,u,i.handlers),u.resize=function(){f&&!h&&d.css("max-height",v()+"px").trigger("lity:resize",[u])},u.close=function(){if(f&&!h){h=!0,w(u);var e=O();if(r&&(j.activeElement===c[0]||t.contains(c[0],j.activeElement)))try{r.focus()}catch(e){}return d.trigger("lity:close",[u]),c.removeClass("lity-opened").addClass("lity-closed"),n(d.add(c)).always(function(){d.trigger("lity:remove",[u]),c.remove(),c=void 0,e.resolve()}),e.promise()}},a=k(e,u,i.handlers,i.handler),c.attr(L,"false").addClass("lity-loading lity-opened lity-"+a.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&u.close()}).trigger("lity:open",[u]),b(u),t.when(a.content).always(s)}function S(e,n,o){e.preventDefault?(e.preventDefault(),o=t(this),e=o.data("lity-target")||o.attr("href")||o.attr("src")):o=t(o);var i=new E(e,t.extend({},o.data("lity-options")||o.data("lity"),n),o,j.activeElement);if(!e.preventDefault)return i}var j=e.document,C=t(e),O=t.Deferred,D=t("html"),$=[],L="aria-hidden",z="lity-"+L,B='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',I={esc:!0,handler:null,handlers:{image:c,inline:d,youtube:u,vimeo:f,googlemaps:m,facebookvideo:h,iframe:p},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>×</button></div></div></div>'},q=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,H=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,P=/(vimeo(pro)?\.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,W=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,F=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,M=function(){var e=j.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return t[n];return!1}();return c.test=function(e){return q.test(e)},S.version="3.0.0-dev",S.options=t.proxy(o,S,I),S.handlers=t.proxy(o,S,I.handlers),S.current=T,S.iframe=s,t(j).on("click.lity","[data-lity]",S),S}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(e){var t={},n={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,autoFocus:!1,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},o=function(t){var n=[],o=!1,i=t.dir&&"left"===t.dir?"scrollLeft":"scrollTop";return this.each(function(){var t=e(this);if(this!==document&&this!==window)return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(t[i]()>0?n.push(this):(t[i](1),o=t[i]()>0,o&&n.push(this),t[i](0))):(n.push(document.scrollingElement),!1)}),n.length||this.each(function(){this===document.documentElement&&"smooth"===e(this).css("scrollBehavior")&&(n=[this]),n.length||"BODY"!==this.nodeName||(n=[this])}),"first"===t.el&&n.length>1&&(n=[n[0]]),n},i=/^([\-\+]=)(\d+)/;e.fn.extend({scrollable:function(e){var t=o.call(this,{dir:e});return this.pushStack(t)},firstScrollable:function(e){var t=o.call(this,{el:"first",dir:e});return this.pushStack(t)},smoothScroll:function(t,n){if("options"===(t=t||{}))return n?this.each(function(){var t=e(this),o=e.extend(t.data("ssOpts")||{},n);e(this).data("ssOpts",o)}):this.first().data("ssOpts");var o=e.extend({},e.fn.smoothScroll.defaults,t),i=function(t){var n=function(e){return e.replace(/(:|\.|\/)/g,"\\$1")},i=this,l=e(this),r=e.extend({},o,l.data("ssOpts")||{}),s=o.exclude,a=r.excludeWithin,c=0,d=0,u=!0,f={},h=e.smoothScroll.filterPath(location.pathname),m=e.smoothScroll.filterPath(i.pathname),p=location.hostname===i.hostname||!i.hostname,v=r.scrollTarget||m===h,g=n(i.hash);if(g&&!e(g).length&&(u=!1),r.scrollTarget||p&&v&&g){for(;u&&c<s.length;)l.is(n(s[c++]))&&(u=!1);for(;u&&d<a.length;)l.closest(a[d++]).length&&(u=!1)}else u=!1;u&&(r.preventDefault&&t.preventDefault(),e.extend(f,r,{scrollTarget:r.scrollTarget||g,link:i}),e.smoothScroll(f))};return null!==t.delegateSelector?this.off("click.smoothscroll",t.delegateSelector).on("click.smoothscroll",t.delegateSelector,i):this.off("click.smoothscroll").on("click.smoothscroll",i),this}});var l=function(e){var t={relative:""},n="string"==typeof e&&i.exec(e);return"number"==typeof e?t.px=e:n&&(t.relative=n[1],t.px=parseFloat(n[2])||0),t},r=function(t){var n=e(t.scrollTarget);t.autoFocus&&n.length&&(n[0].focus(),n.is(document.activeElement)||(n.prop({tabIndex:-1}),n[0].focus())),t.afterScroll.call(t.link,t)};e.smoothScroll=function(n,o){if("options"===n&&"object"==typeof o)return e.extend(t,o);var i,s,a,c,d=l(n),u={},f=0,h="offset",m="scrollTop",p={},v={};d.px?i=e.extend({link:null},e.fn.smoothScroll.defaults,t):(i=e.extend({link:null},e.fn.smoothScroll.defaults,n||{},t),i.scrollElement&&(h="position","static"===i.scrollElement.css("position")&&i.scrollElement.css("position","relative")),o&&(d=l(o))),m="left"===i.direction?"scrollLeft":m,i.scrollElement?(s=i.scrollElement,d.px||/^(?:HTML|BODY)$/.test(s[0].nodeName)||(f=s[m]())):s=e("html, body").firstScrollable(i.direction),i.beforeScroll.call(s,i),u=d.px?d:{relative:"",px:e(i.scrollTarget)[h]()&&e(i.scrollTarget)[h]()[i.direction]||0},p[m]=u.relative+(u.px+f+i.offset),a=i.speed,"auto"===a&&(c=Math.abs(p[m]-s[m]()),a=c/i.autoCoefficient),v={duration:a,easing:i.easing,complete:function(){r(i)}},i.step&&(v.step=i.step),s.length?s.stop().animate(p,v):r(i)},e.smoothScroll.version="2.2.0",e.smoothScroll.filterPath=function(e){return e=e||"",e.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},e.fn.smoothScroll.defaults=n});var tocToggle=document.getElementById("toc-toggle"),tableOfContents=document.getElementById("markdown-toc");tocToggle&&tocToggle.addEventListener("click",function(e){toggleToc(tableOfContents)}),$(document).ready(function(){var e=document.getElementById("menu-toggle"),t=document.getElementById("primary-nav");e.addEventListener("click",function(){t.classList.toggle("js-menu-is-open")}),$("a").smoothScroll({offset:-20}),$("a[href$='.jpg'], a[href$='.png'], a[href$='.gif']").attr("data-lity","")});
|
6
|
+
function showToc(e){var t=function(){e.style.display="block";var t=e.scrollHeight+"px";return e.style.disply="",t}();e.classList.add("js-toc-is-open"),e.style.height=t,window.setTimeout(function(){e.style.height=""},350)}function hideToc(e){e.style.height=e.scrollHeight+"px",window.setTimeout(function(){e.style.height="0"},1),window.setTimeout(function(){e.classList.remove("js-toc-is-open")},350)}function toggleToc(e){if(tocToggle.classList.toggle("js-toc-is-open"),e.classList.contains("js-toc-is-open"))return void hideToc(e);showToc(e)}!function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(n){return t(e,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,require("jquery")):e.lity=t(e,e.jQuery||e.Zepto)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e){var t=O();return M&&e.length?(e.one(M,t.resolve),setTimeout(t.resolve,500)):t.resolve(),t.promise()}function o(e,n,o){if(1===arguments.length)return t.extend({},e);if("string"==typeof n){if(void 0===o)return void 0===e[n]?null:e[n];e[n]=o}else t.extend(e,n);return this}function i(e){var t=e.indexOf("?");t>-1&&(e=e.substr(t+1));for(var n,o=decodeURI(e.split("#")[0]).split("&"),i={},l=0,r=o.length;l<r;l++)o[l]&&(n=o[l].split("="),i[n[0]]=n[1]);return i}function l(e,n){if(!n)return e;if("string"===t.type(n)&&(n=i(n)),e.indexOf("?")>-1){var o=e.split("?");e=o.shift(),n=t.extend({},i(o[0]),n)}return e+"?"+t.param(n)}function r(e,t){var n=e.indexOf("#");return-1===n?t:(n>0&&(e=e.substr(n)),t+e)}function s(e,t,n,o){return t&&t.element().addClass("lity-iframe"),n&&(e=l(e,n)),o&&(e=r(o,e)),'<div class="lity-iframe-container"><iframe frameborder="0" allowfullscreen src="'+e+'"/></div>'}function a(e){return t('<span class="lity-error"/>').append(e)}function c(e,n){var o=n.opener()&&n.opener().data("lity-desc")||"Image with no description",i=t('<img src="'+e+'" alt="'+o+'"/>'),l=O(),r=function(){l.reject(a("Failed loading image"))};return i.on("load",function(){if(0===this.naturalWidth)return r();l.resolve(i)}).on("error",r),l.promise()}function d(e,n){var o,i,l;try{o=t(e)}catch(e){return!1}return!!o.length&&(i=t('<i style="display:none !important"/>'),l=o.hasClass("lity-hide"),n.element().one("lity:remove",function(){i.before(o).remove(),l&&!o.closest(".lity-content").length&&o.addClass("lity-hide")}),o.removeClass("lity-hide").after(i))}function u(e,t){var n=H.exec(e);return!!n&&s("https://www.youtube"+(n[2]||"")+".com/embed/"+n[4]+"?autoplay=1",t,n[5],e)}function f(e,t){var n=P.exec(e);return!!n&&s("https://player.vimeo.com/video/"+n[3]+"?autoplay=1",t,n[4],e)}function h(e,t){var n=F.exec(e);return!!n&&(0!==e.indexOf("http")&&(e="https:"+e),s("https://www.facebook.com/plugins/video.php?href="+e+"&autoplay=1",t,n[4],e))}function m(e,t){var n=W.exec(e);return!!n&&s("https://www.google."+n[3]+"/maps?"+n[6],t,{output:n[6].indexOf("layer=c")>0?"svembed":"embed"},e)}function p(e,t){return s(e,t)}function v(){return j.documentElement.clientHeight?j.documentElement.clientHeight:Math.round(C.height())}function g(e){var t=T();t&&(27===e.keyCode&&t.options("esc")&&t.close(),9===e.keyCode&&y(e,t))}function y(e,t){var n=t.element().find(B),o=n.index(j.activeElement);e.shiftKey&&o<=0?(n.get(n.length-1).focus(),e.preventDefault()):e.shiftKey||o!==n.length-1||(n.get(0).focus(),e.preventDefault())}function x(){t.each($,function(e,t){t.resize()})}function b(e){1===$.unshift(e)&&(D.addClass("lity-active"),C.on({resize:x,keydown:g})),t("body > *").not(e.element()).addClass("lity-hidden").each(function(){var e=t(this);void 0===e.data(z)&&e.data(z,e.attr(L)||null)}).attr(L,"true")}function w(e){var n;e.element().attr(L,"true"),1===$.length&&(D.removeClass("lity-active"),C.off({resize:x,keydown:g})),$=t.grep($,function(t){return e!==t}),n=$.length?$[0].element():t(".lity-hidden"),n.removeClass("lity-hidden").each(function(){var e=t(this),n=e.data(z);n?e.attr(L,n):e.removeAttr(L),e.removeData(z)})}function T(){return 0===$.length?null:$[0]}function k(e,n,o,i){var l,r="inline",s=t.extend({},o);return i&&s[i]?(l=s[i](e,n),r=i):(t.each(["inline","iframe"],function(e,t){delete s[t],s[t]=o[t]}),t.each(s,function(t,o){return!o||(!(!o.test||o.test(e,n))||(l=o(e,n),!1!==l?(r=t,!1):void 0))})),{handler:r,content:l||""}}function E(e,i,l,r){function s(e){d=t(e).css("max-height",v()+"px"),c.find(".lity-loader").each(function(){var e=t(this);n(e).always(function(){e.remove()})}),c.removeClass("lity-loading").find(".lity-content").empty().append(d),f=!0,d.trigger("lity:ready",[u])}var a,c,d,u=this,f=!1,h=!1;i=t.extend({},I,i),c=t(i.template),u.element=function(){return c},u.opener=function(){return l},u.content=function(){return d},u.options=t.proxy(o,u,i),u.handlers=t.proxy(o,u,i.handlers),u.resize=function(){f&&!h&&d.css("max-height",v()+"px").trigger("lity:resize",[u])},u.close=function(){if(f&&!h){h=!0,w(u);var e=O();if(r&&(j.activeElement===c[0]||t.contains(c[0],j.activeElement)))try{r.focus()}catch(e){}return d.trigger("lity:close",[u]),c.removeClass("lity-opened").addClass("lity-closed"),n(d.add(c)).always(function(){d.trigger("lity:remove",[u]),c.remove(),c=void 0,e.resolve()}),e.promise()}},a=k(e,u,i.handlers,i.handler),c.attr(L,"false").addClass("lity-loading lity-opened lity-"+a.handler).appendTo("body").focus().on("click","[data-lity-close]",function(e){t(e.target).is("[data-lity-close]")&&u.close()}).trigger("lity:open",[u]),b(u),t.when(a.content).always(s)}function S(e,n,o){e.preventDefault?(e.preventDefault(),o=t(this),e=o.data("lity-target")||o.attr("href")||o.attr("src")):o=t(o);var i=new E(e,t.extend({},o.data("lity-options")||o.data("lity"),n),o,j.activeElement);if(!e.preventDefault)return i}var j=e.document,C=t(e),O=t.Deferred,D=t("html"),$=[],L="aria-hidden",z="lity-"+L,B='a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])',I={esc:!0,handler:null,handlers:{image:c,inline:d,youtube:u,vimeo:f,googlemaps:m,facebookvideo:h,iframe:p},template:'<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>×</button></div></div></div>'},q=/(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i,H=/(youtube(-nocookie)?\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11})(.*)?/i,P=/(vimeo(pro)?\.com)\/(?:[^\d]+)?(\d+)\??(.*)?$/,W=/((maps|www)\.)?google\.([^\/\?]+)\/?((maps\/?)?\?)(.*)/i,F=/(facebook\.com)\/([a-z0-9_-]*)\/videos\/([0-9]*)(.*)?$/i,M=function(){var e=j.createElement("div"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return t[n];return!1}();return c.test=function(e){return q.test(e)},S.version="3.0.0-dev",S.options=t.proxy(o,S,I),S.handlers=t.proxy(o,S,I.handlers),S.current=T,S.iframe=s,t(j).on("click.lity","[data-lity]",S),S}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(e){var t={},n={exclude:[],excludeWithin:[],offset:0,direction:"top",delegateSelector:null,scrollElement:null,scrollTarget:null,autoFocus:!1,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficient:2,preventDefault:!0},o=function(t){var n=[],o=!1,i=t.dir&&"left"===t.dir?"scrollLeft":"scrollTop";return this.each(function(){var t=e(this);if(this!==document&&this!==window)return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(t[i]()>0?n.push(this):(t[i](1),o=t[i]()>0,o&&n.push(this),t[i](0))):(n.push(document.scrollingElement),!1)}),n.length||this.each(function(){this===document.documentElement&&"smooth"===e(this).css("scrollBehavior")&&(n=[this]),n.length||"BODY"!==this.nodeName||(n=[this])}),"first"===t.el&&n.length>1&&(n=[n[0]]),n},i=/^([\-\+]=)(\d+)/;e.fn.extend({scrollable:function(e){var t=o.call(this,{dir:e});return this.pushStack(t)},firstScrollable:function(e){var t=o.call(this,{el:"first",dir:e});return this.pushStack(t)},smoothScroll:function(t,n){if("options"===(t=t||{}))return n?this.each(function(){var t=e(this),o=e.extend(t.data("ssOpts")||{},n);e(this).data("ssOpts",o)}):this.first().data("ssOpts");var o=e.extend({},e.fn.smoothScroll.defaults,t),i=function(t){var n=function(e){return e.replace(/(:|\.|\/)/g,"\\$1")},i=this,l=e(this),r=e.extend({},o,l.data("ssOpts")||{}),s=o.exclude,a=r.excludeWithin,c=0,d=0,u=!0,f={},h=e.smoothScroll.filterPath(location.pathname),m=e.smoothScroll.filterPath(i.pathname),p=location.hostname===i.hostname||!i.hostname,v=r.scrollTarget||m===h,g=n(i.hash);if(g&&!e(g).length&&(u=!1),r.scrollTarget||p&&v&&g){for(;u&&c<s.length;)l.is(n(s[c++]))&&(u=!1);for(;u&&d<a.length;)l.closest(a[d++]).length&&(u=!1)}else u=!1;u&&(r.preventDefault&&t.preventDefault(),e.extend(f,r,{scrollTarget:r.scrollTarget||g,link:i}),e.smoothScroll(f))};return null!==t.delegateSelector?this.off("click.smoothscroll",t.delegateSelector).on("click.smoothscroll",t.delegateSelector,i):this.off("click.smoothscroll").on("click.smoothscroll",i),this}});var l=function(e){var t={relative:""},n="string"==typeof e&&i.exec(e);return"number"==typeof e?t.px=e:n&&(t.relative=n[1],t.px=parseFloat(n[2])||0),t},r=function(t){var n=e(t.scrollTarget);t.autoFocus&&n.length&&(n[0].focus(),n.is(document.activeElement)||(n.prop({tabIndex:-1}),n[0].focus())),t.afterScroll.call(t.link,t)};e.smoothScroll=function(n,o){if("options"===n&&"object"==typeof o)return e.extend(t,o);var i,s,a,c,d=l(n),u={},f=0,h="offset",m="scrollTop",p={},v={};d.px?i=e.extend({link:null},e.fn.smoothScroll.defaults,t):(i=e.extend({link:null},e.fn.smoothScroll.defaults,n||{},t),i.scrollElement&&(h="position","static"===i.scrollElement.css("position")&&i.scrollElement.css("position","relative")),o&&(d=l(o))),m="left"===i.direction?"scrollLeft":m,i.scrollElement?(s=i.scrollElement,d.px||/^(?:HTML|BODY)$/.test(s[0].nodeName)||(f=s[m]())):s=e("html, body").firstScrollable(i.direction),i.beforeScroll.call(s,i),u=d.px?d:{relative:"",px:e(i.scrollTarget)[h]()&&e(i.scrollTarget)[h]()[i.direction]||0},p[m]=u.relative+(u.px+f+i.offset),a=i.speed,"auto"===a&&(c=Math.abs(p[m]-s[m]()),a=c/i.autoCoefficient),v={duration:a,easing:i.easing,complete:function(){r(i)}},i.step&&(v.step=i.step),s.length?s.stop().animate(p,v):r(i)},e.smoothScroll.version="2.2.0",e.smoothScroll.filterPath=function(e){return e=e||"",e.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},e.fn.smoothScroll.defaults=n});var tocToggle=document.getElementById("toc-toggle"),tableOfContents=document.getElementById("markdown-toc");tocToggle&&tocToggle.addEventListener("click",function(e){toggleToc(tableOfContents)}),$(document).ready(function(){var e=document.getElementById("menu-toggle"),t=document.getElementById("primary-nav");e&&t&&e.addEventListener("click",function(){t.classList.toggle("js-menu-is-open")}),$("a").smoothScroll({offset:-20}),$("a[href$='.jpg'], a[href$='.png'], a[href$='.gif']").attr("data-lity","")});
|
@@ -1,358 +1,358 @@
|
|
1
|
-
/*!
|
2
|
-
* jQuery Smooth Scroll - v2.2.0 - 2017-05-05
|
3
|
-
* https://github.com/kswedberg/jquery-smooth-scroll
|
4
|
-
* Copyright (c) 2017 Karl Swedberg
|
5
|
-
* Licensed MIT
|
6
|
-
*/
|
7
|
-
|
8
|
-
(function(factory) {
|
9
|
-
if (typeof define === 'function' && define.amd) {
|
10
|
-
// AMD. Register as an anonymous module.
|
11
|
-
define(['jquery'], factory);
|
12
|
-
} else if (typeof module === 'object' && module.exports) {
|
13
|
-
// CommonJS
|
14
|
-
factory(require('jquery'));
|
15
|
-
} else {
|
16
|
-
// Browser globals
|
17
|
-
factory(jQuery);
|
18
|
-
}
|
19
|
-
}(function($) {
|
20
|
-
|
21
|
-
var version = '2.2.0';
|
22
|
-
var optionOverrides = {};
|
23
|
-
var defaults = {
|
24
|
-
exclude: [],
|
25
|
-
excludeWithin: [],
|
26
|
-
offset: 0,
|
27
|
-
|
28
|
-
// one of 'top' or 'left'
|
29
|
-
direction: 'top',
|
30
|
-
|
31
|
-
// if set, bind click events through delegation
|
32
|
-
// supported since jQuery 1.4.2
|
33
|
-
delegateSelector: null,
|
34
|
-
|
35
|
-
// jQuery set of elements you wish to scroll (for $.smoothScroll).
|
36
|
-
// if null (default), $('html, body').firstScrollable() is used.
|
37
|
-
scrollElement: null,
|
38
|
-
|
39
|
-
// only use if you want to override default behavior
|
40
|
-
scrollTarget: null,
|
41
|
-
|
42
|
-
// automatically focus the target element after scrolling to it
|
43
|
-
autoFocus: false,
|
44
|
-
|
45
|
-
// fn(opts) function to be called before scrolling occurs.
|
46
|
-
// `this` is the element(s) being scrolled
|
47
|
-
beforeScroll: function() {},
|
48
|
-
|
49
|
-
// fn(opts) function to be called after scrolling occurs.
|
50
|
-
// `this` is the triggering element
|
51
|
-
afterScroll: function() {},
|
52
|
-
|
53
|
-
// easing name. jQuery comes with "swing" and "linear." For others, you'll need an easing plugin
|
54
|
-
// from jQuery UI or elsewhere
|
55
|
-
easing: 'swing',
|
56
|
-
|
57
|
-
// speed can be a number or 'auto'
|
58
|
-
// if 'auto', the speed will be calculated based on the formula:
|
59
|
-
// (current scroll position - target scroll position) / autoCoeffic
|
60
|
-
speed: 400,
|
61
|
-
|
62
|
-
// coefficient for "auto" speed
|
63
|
-
autoCoefficient: 2,
|
64
|
-
|
65
|
-
// $.fn.smoothScroll only: whether to prevent the default click action
|
66
|
-
preventDefault: true
|
67
|
-
};
|
68
|
-
|
69
|
-
var getScrollable = function(opts) {
|
70
|
-
var scrollable = [];
|
71
|
-
var scrolled = false;
|
72
|
-
var dir = opts.dir && opts.dir === 'left' ? 'scrollLeft' : 'scrollTop';
|
73
|
-
|
74
|
-
this.each(function() {
|
75
|
-
var el = $(this);
|
76
|
-
|
77
|
-
if (this === document || this === window) {
|
78
|
-
return;
|
79
|
-
}
|
80
|
-
|
81
|
-
if (document.scrollingElement && (this === document.documentElement || this === document.body)) {
|
82
|
-
scrollable.push(document.scrollingElement);
|
83
|
-
|
84
|
-
return false;
|
85
|
-
}
|
86
|
-
|
87
|
-
if (el[dir]() > 0) {
|
88
|
-
scrollable.push(this);
|
89
|
-
} else {
|
90
|
-
// if scroll(Top|Left) === 0, nudge the element 1px and see if it moves
|
91
|
-
el[dir](1);
|
92
|
-
scrolled = el[dir]() > 0;
|
93
|
-
|
94
|
-
if (scrolled) {
|
95
|
-
scrollable.push(this);
|
96
|
-
}
|
97
|
-
// then put it back, of course
|
98
|
-
el[dir](0);
|
99
|
-
}
|
100
|
-
});
|
101
|
-
|
102
|
-
if (!scrollable.length) {
|
103
|
-
this.each(function() {
|
104
|
-
// If no scrollable elements and <html> has scroll-behavior:smooth because
|
105
|
-
// "When this property is specified on the root element, it applies to the viewport instead."
|
106
|
-
// and "The scroll-behavior property of the … body element is *not* propagated to the viewport."
|
107
|
-
// → https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
|
108
|
-
if (this === document.documentElement && $(this).css('scrollBehavior') === 'smooth') {
|
109
|
-
scrollable = [this];
|
110
|
-
}
|
111
|
-
|
112
|
-
// If still no scrollable elements, fall back to <body>,
|
113
|
-
// if it's in the jQuery collection
|
114
|
-
// (doing this because Safari sets scrollTop async,
|
115
|
-
// so can't set it to 1 and immediately get the value.)
|
116
|
-
if (!scrollable.length && this.nodeName === 'BODY') {
|
117
|
-
scrollable = [this];
|
118
|
-
}
|
119
|
-
});
|
120
|
-
}
|
121
|
-
|
122
|
-
// Use the first scrollable element if we're calling firstScrollable()
|
123
|
-
if (opts.el === 'first' && scrollable.length > 1) {
|
124
|
-
scrollable = [scrollable[0]];
|
125
|
-
}
|
126
|
-
|
127
|
-
return scrollable;
|
128
|
-
};
|
129
|
-
|
130
|
-
var rRelative = /^([\-\+]=)(\d+)/;
|
131
|
-
|
132
|
-
$.fn.extend({
|
133
|
-
scrollable: function(dir) {
|
134
|
-
var scrl = getScrollable.call(this, {dir: dir});
|
135
|
-
|
136
|
-
return this.pushStack(scrl);
|
137
|
-
},
|
138
|
-
firstScrollable: function(dir) {
|
139
|
-
var scrl = getScrollable.call(this, {el: 'first', dir: dir});
|
140
|
-
|
141
|
-
return this.pushStack(scrl);
|
142
|
-
},
|
143
|
-
|
144
|
-
smoothScroll: function(options, extra) {
|
145
|
-
options = options || {};
|
146
|
-
|
147
|
-
if (options === 'options') {
|
148
|
-
if (!extra) {
|
149
|
-
return this.first().data('ssOpts');
|
150
|
-
}
|
151
|
-
|
152
|
-
return this.each(function() {
|
153
|
-
var $this = $(this);
|
154
|
-
var opts = $.extend($this.data('ssOpts') || {}, extra);
|
155
|
-
|
156
|
-
$(this).data('ssOpts', opts);
|
157
|
-
});
|
158
|
-
}
|
159
|
-
|
160
|
-
var opts = $.extend({}, $.fn.smoothScroll.defaults, options);
|
161
|
-
|
162
|
-
var clickHandler = function(event) {
|
163
|
-
var escapeSelector = function(str) {
|
164
|
-
return str.replace(/(:|\.|\/)/g, '\\$1');
|
165
|
-
};
|
166
|
-
|
167
|
-
var link = this;
|
168
|
-
var $link = $(this);
|
169
|
-
var thisOpts = $.extend({}, opts, $link.data('ssOpts') || {});
|
170
|
-
var exclude = opts.exclude;
|
171
|
-
var excludeWithin = thisOpts.excludeWithin;
|
172
|
-
var elCounter = 0;
|
173
|
-
var ewlCounter = 0;
|
174
|
-
var include = true;
|
175
|
-
var clickOpts = {};
|
176
|
-
var locationPath = $.smoothScroll.filterPath(location.pathname);
|
177
|
-
var linkPath = $.smoothScroll.filterPath(link.pathname);
|
178
|
-
var hostMatch = location.hostname === link.hostname || !link.hostname;
|
179
|
-
var pathMatch = thisOpts.scrollTarget || (linkPath === locationPath);
|
180
|
-
var thisHash = escapeSelector(link.hash);
|
181
|
-
|
182
|
-
if (thisHash && !$(thisHash).length) {
|
183
|
-
include = false;
|
184
|
-
}
|
185
|
-
|
186
|
-
if (!thisOpts.scrollTarget && (!hostMatch || !pathMatch || !thisHash)) {
|
187
|
-
include = false;
|
188
|
-
} else {
|
189
|
-
while (include && elCounter < exclude.length) {
|
190
|
-
if ($link.is(escapeSelector(exclude[elCounter++]))) {
|
191
|
-
include = false;
|
192
|
-
}
|
193
|
-
}
|
194
|
-
|
195
|
-
while (include && ewlCounter < excludeWithin.length) {
|
196
|
-
if ($link.closest(excludeWithin[ewlCounter++]).length) {
|
197
|
-
include = false;
|
198
|
-
}
|
199
|
-
}
|
200
|
-
}
|
201
|
-
|
202
|
-
if (include) {
|
203
|
-
if (thisOpts.preventDefault) {
|
204
|
-
event.preventDefault();
|
205
|
-
}
|
206
|
-
|
207
|
-
$.extend(clickOpts, thisOpts, {
|
208
|
-
scrollTarget: thisOpts.scrollTarget || thisHash,
|
209
|
-
link: link
|
210
|
-
});
|
211
|
-
|
212
|
-
$.smoothScroll(clickOpts);
|
213
|
-
}
|
214
|
-
};
|
215
|
-
|
216
|
-
if (options.delegateSelector !== null) {
|
217
|
-
this
|
218
|
-
.off('click.smoothscroll', options.delegateSelector)
|
219
|
-
.on('click.smoothscroll', options.delegateSelector, clickHandler);
|
220
|
-
} else {
|
221
|
-
this
|
222
|
-
.off('click.smoothscroll')
|
223
|
-
.on('click.smoothscroll', clickHandler);
|
224
|
-
}
|
225
|
-
|
226
|
-
return this;
|
227
|
-
}
|
228
|
-
});
|
229
|
-
|
230
|
-
var getExplicitOffset = function(val) {
|
231
|
-
var explicit = {relative: ''};
|
232
|
-
var parts = typeof val === 'string' && rRelative.exec(val);
|
233
|
-
|
234
|
-
if (typeof val === 'number') {
|
235
|
-
explicit.px = val;
|
236
|
-
} else if (parts) {
|
237
|
-
explicit.relative = parts[1];
|
238
|
-
explicit.px = parseFloat(parts[2]) || 0;
|
239
|
-
}
|
240
|
-
|
241
|
-
return explicit;
|
242
|
-
};
|
243
|
-
|
244
|
-
var onAfterScroll = function(opts) {
|
245
|
-
var $tgt = $(opts.scrollTarget);
|
246
|
-
|
247
|
-
if (opts.autoFocus && $tgt.length) {
|
248
|
-
$tgt[0].focus();
|
249
|
-
|
250
|
-
if (!$tgt.is(document.activeElement)) {
|
251
|
-
$tgt.prop({tabIndex: -1});
|
252
|
-
$tgt[0].focus();
|
253
|
-
}
|
254
|
-
}
|
255
|
-
|
256
|
-
opts.afterScroll.call(opts.link, opts);
|
257
|
-
};
|
258
|
-
|
259
|
-
$.smoothScroll = function(options, px) {
|
260
|
-
if (options === 'options' && typeof px === 'object') {
|
261
|
-
return $.extend(optionOverrides, px);
|
262
|
-
}
|
263
|
-
var opts, $scroller, speed, delta;
|
264
|
-
var explicitOffset = getExplicitOffset(options);
|
265
|
-
var scrollTargetOffset = {};
|
266
|
-
var scrollerOffset = 0;
|
267
|
-
var offPos = 'offset';
|
268
|
-
var scrollDir = 'scrollTop';
|
269
|
-
var aniProps = {};
|
270
|
-
var aniOpts = {};
|
271
|
-
|
272
|
-
if (explicitOffset.px) {
|
273
|
-
opts = $.extend({link: null}, $.fn.smoothScroll.defaults, optionOverrides);
|
274
|
-
} else {
|
275
|
-
opts = $.extend({link: null}, $.fn.smoothScroll.defaults, options || {}, optionOverrides);
|
276
|
-
|
277
|
-
if (opts.scrollElement) {
|
278
|
-
offPos = 'position';
|
279
|
-
|
280
|
-
if (opts.scrollElement.css('position') === 'static') {
|
281
|
-
opts.scrollElement.css('position', 'relative');
|
282
|
-
}
|
283
|
-
}
|
284
|
-
|
285
|
-
if (px) {
|
286
|
-
explicitOffset = getExplicitOffset(px);
|
287
|
-
}
|
288
|
-
}
|
289
|
-
|
290
|
-
scrollDir = opts.direction === 'left' ? 'scrollLeft' : scrollDir;
|
291
|
-
|
292
|
-
if (opts.scrollElement) {
|
293
|
-
$scroller = opts.scrollElement;
|
294
|
-
|
295
|
-
if (!explicitOffset.px && !(/^(?:HTML|BODY)$/).test($scroller[0].nodeName)) {
|
296
|
-
scrollerOffset = $scroller[scrollDir]();
|
297
|
-
}
|
298
|
-
} else {
|
299
|
-
$scroller = $('html, body').firstScrollable(opts.direction);
|
300
|
-
}
|
301
|
-
|
302
|
-
// beforeScroll callback function must fire before calculating offset
|
303
|
-
opts.beforeScroll.call($scroller, opts);
|
304
|
-
|
305
|
-
scrollTargetOffset = explicitOffset.px ? explicitOffset : {
|
306
|
-
relative: '',
|
307
|
-
px: ($(opts.scrollTarget)[offPos]() && $(opts.scrollTarget)[offPos]()[opts.direction]) || 0
|
308
|
-
};
|
309
|
-
|
310
|
-
aniProps[scrollDir] = scrollTargetOffset.relative + (scrollTargetOffset.px + scrollerOffset + opts.offset);
|
311
|
-
|
312
|
-
speed = opts.speed;
|
313
|
-
|
314
|
-
// automatically calculate the speed of the scroll based on distance / coefficient
|
315
|
-
if (speed === 'auto') {
|
316
|
-
|
317
|
-
// $scroller[scrollDir]() is position before scroll, aniProps[scrollDir] is position after
|
318
|
-
// When delta is greater, speed will be greater.
|
319
|
-
delta = Math.abs(aniProps[scrollDir] - $scroller[scrollDir]());
|
320
|
-
|
321
|
-
// Divide the delta by the coefficient
|
322
|
-
speed = delta / opts.autoCoefficient;
|
323
|
-
}
|
324
|
-
|
325
|
-
aniOpts = {
|
326
|
-
duration: speed,
|
327
|
-
easing: opts.easing,
|
328
|
-
complete: function() {
|
329
|
-
onAfterScroll(opts);
|
330
|
-
}
|
331
|
-
};
|
332
|
-
|
333
|
-
if (opts.step) {
|
334
|
-
aniOpts.step = opts.step;
|
335
|
-
}
|
336
|
-
|
337
|
-
if ($scroller.length) {
|
338
|
-
$scroller.stop().animate(aniProps, aniOpts);
|
339
|
-
} else {
|
340
|
-
onAfterScroll(opts);
|
341
|
-
}
|
342
|
-
};
|
343
|
-
|
344
|
-
$.smoothScroll.version = version;
|
345
|
-
$.smoothScroll.filterPath = function(string) {
|
346
|
-
string = string || '';
|
347
|
-
|
348
|
-
return string
|
349
|
-
.replace(/^\//, '')
|
350
|
-
.replace(/(?:index|default).[a-zA-Z]{3,4}$/, '')
|
351
|
-
.replace(/\/$/, '');
|
352
|
-
};
|
353
|
-
|
354
|
-
// default options
|
355
|
-
$.fn.smoothScroll.defaults = defaults;
|
356
|
-
|
357
|
-
}));
|
358
|
-
|
1
|
+
/*!
|
2
|
+
* jQuery Smooth Scroll - v2.2.0 - 2017-05-05
|
3
|
+
* https://github.com/kswedberg/jquery-smooth-scroll
|
4
|
+
* Copyright (c) 2017 Karl Swedberg
|
5
|
+
* Licensed MIT
|
6
|
+
*/
|
7
|
+
|
8
|
+
(function(factory) {
|
9
|
+
if (typeof define === 'function' && define.amd) {
|
10
|
+
// AMD. Register as an anonymous module.
|
11
|
+
define(['jquery'], factory);
|
12
|
+
} else if (typeof module === 'object' && module.exports) {
|
13
|
+
// CommonJS
|
14
|
+
factory(require('jquery'));
|
15
|
+
} else {
|
16
|
+
// Browser globals
|
17
|
+
factory(jQuery);
|
18
|
+
}
|
19
|
+
}(function($) {
|
20
|
+
|
21
|
+
var version = '2.2.0';
|
22
|
+
var optionOverrides = {};
|
23
|
+
var defaults = {
|
24
|
+
exclude: [],
|
25
|
+
excludeWithin: [],
|
26
|
+
offset: 0,
|
27
|
+
|
28
|
+
// one of 'top' or 'left'
|
29
|
+
direction: 'top',
|
30
|
+
|
31
|
+
// if set, bind click events through delegation
|
32
|
+
// supported since jQuery 1.4.2
|
33
|
+
delegateSelector: null,
|
34
|
+
|
35
|
+
// jQuery set of elements you wish to scroll (for $.smoothScroll).
|
36
|
+
// if null (default), $('html, body').firstScrollable() is used.
|
37
|
+
scrollElement: null,
|
38
|
+
|
39
|
+
// only use if you want to override default behavior
|
40
|
+
scrollTarget: null,
|
41
|
+
|
42
|
+
// automatically focus the target element after scrolling to it
|
43
|
+
autoFocus: false,
|
44
|
+
|
45
|
+
// fn(opts) function to be called before scrolling occurs.
|
46
|
+
// `this` is the element(s) being scrolled
|
47
|
+
beforeScroll: function() {},
|
48
|
+
|
49
|
+
// fn(opts) function to be called after scrolling occurs.
|
50
|
+
// `this` is the triggering element
|
51
|
+
afterScroll: function() {},
|
52
|
+
|
53
|
+
// easing name. jQuery comes with "swing" and "linear." For others, you'll need an easing plugin
|
54
|
+
// from jQuery UI or elsewhere
|
55
|
+
easing: 'swing',
|
56
|
+
|
57
|
+
// speed can be a number or 'auto'
|
58
|
+
// if 'auto', the speed will be calculated based on the formula:
|
59
|
+
// (current scroll position - target scroll position) / autoCoeffic
|
60
|
+
speed: 400,
|
61
|
+
|
62
|
+
// coefficient for "auto" speed
|
63
|
+
autoCoefficient: 2,
|
64
|
+
|
65
|
+
// $.fn.smoothScroll only: whether to prevent the default click action
|
66
|
+
preventDefault: true
|
67
|
+
};
|
68
|
+
|
69
|
+
var getScrollable = function(opts) {
|
70
|
+
var scrollable = [];
|
71
|
+
var scrolled = false;
|
72
|
+
var dir = opts.dir && opts.dir === 'left' ? 'scrollLeft' : 'scrollTop';
|
73
|
+
|
74
|
+
this.each(function() {
|
75
|
+
var el = $(this);
|
76
|
+
|
77
|
+
if (this === document || this === window) {
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
|
81
|
+
if (document.scrollingElement && (this === document.documentElement || this === document.body)) {
|
82
|
+
scrollable.push(document.scrollingElement);
|
83
|
+
|
84
|
+
return false;
|
85
|
+
}
|
86
|
+
|
87
|
+
if (el[dir]() > 0) {
|
88
|
+
scrollable.push(this);
|
89
|
+
} else {
|
90
|
+
// if scroll(Top|Left) === 0, nudge the element 1px and see if it moves
|
91
|
+
el[dir](1);
|
92
|
+
scrolled = el[dir]() > 0;
|
93
|
+
|
94
|
+
if (scrolled) {
|
95
|
+
scrollable.push(this);
|
96
|
+
}
|
97
|
+
// then put it back, of course
|
98
|
+
el[dir](0);
|
99
|
+
}
|
100
|
+
});
|
101
|
+
|
102
|
+
if (!scrollable.length) {
|
103
|
+
this.each(function() {
|
104
|
+
// If no scrollable elements and <html> has scroll-behavior:smooth because
|
105
|
+
// "When this property is specified on the root element, it applies to the viewport instead."
|
106
|
+
// and "The scroll-behavior property of the … body element is *not* propagated to the viewport."
|
107
|
+
// → https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
|
108
|
+
if (this === document.documentElement && $(this).css('scrollBehavior') === 'smooth') {
|
109
|
+
scrollable = [this];
|
110
|
+
}
|
111
|
+
|
112
|
+
// If still no scrollable elements, fall back to <body>,
|
113
|
+
// if it's in the jQuery collection
|
114
|
+
// (doing this because Safari sets scrollTop async,
|
115
|
+
// so can't set it to 1 and immediately get the value.)
|
116
|
+
if (!scrollable.length && this.nodeName === 'BODY') {
|
117
|
+
scrollable = [this];
|
118
|
+
}
|
119
|
+
});
|
120
|
+
}
|
121
|
+
|
122
|
+
// Use the first scrollable element if we're calling firstScrollable()
|
123
|
+
if (opts.el === 'first' && scrollable.length > 1) {
|
124
|
+
scrollable = [scrollable[0]];
|
125
|
+
}
|
126
|
+
|
127
|
+
return scrollable;
|
128
|
+
};
|
129
|
+
|
130
|
+
var rRelative = /^([\-\+]=)(\d+)/;
|
131
|
+
|
132
|
+
$.fn.extend({
|
133
|
+
scrollable: function(dir) {
|
134
|
+
var scrl = getScrollable.call(this, {dir: dir});
|
135
|
+
|
136
|
+
return this.pushStack(scrl);
|
137
|
+
},
|
138
|
+
firstScrollable: function(dir) {
|
139
|
+
var scrl = getScrollable.call(this, {el: 'first', dir: dir});
|
140
|
+
|
141
|
+
return this.pushStack(scrl);
|
142
|
+
},
|
143
|
+
|
144
|
+
smoothScroll: function(options, extra) {
|
145
|
+
options = options || {};
|
146
|
+
|
147
|
+
if (options === 'options') {
|
148
|
+
if (!extra) {
|
149
|
+
return this.first().data('ssOpts');
|
150
|
+
}
|
151
|
+
|
152
|
+
return this.each(function() {
|
153
|
+
var $this = $(this);
|
154
|
+
var opts = $.extend($this.data('ssOpts') || {}, extra);
|
155
|
+
|
156
|
+
$(this).data('ssOpts', opts);
|
157
|
+
});
|
158
|
+
}
|
159
|
+
|
160
|
+
var opts = $.extend({}, $.fn.smoothScroll.defaults, options);
|
161
|
+
|
162
|
+
var clickHandler = function(event) {
|
163
|
+
var escapeSelector = function(str) {
|
164
|
+
return str.replace(/(:|\.|\/)/g, '\\$1');
|
165
|
+
};
|
166
|
+
|
167
|
+
var link = this;
|
168
|
+
var $link = $(this);
|
169
|
+
var thisOpts = $.extend({}, opts, $link.data('ssOpts') || {});
|
170
|
+
var exclude = opts.exclude;
|
171
|
+
var excludeWithin = thisOpts.excludeWithin;
|
172
|
+
var elCounter = 0;
|
173
|
+
var ewlCounter = 0;
|
174
|
+
var include = true;
|
175
|
+
var clickOpts = {};
|
176
|
+
var locationPath = $.smoothScroll.filterPath(location.pathname);
|
177
|
+
var linkPath = $.smoothScroll.filterPath(link.pathname);
|
178
|
+
var hostMatch = location.hostname === link.hostname || !link.hostname;
|
179
|
+
var pathMatch = thisOpts.scrollTarget || (linkPath === locationPath);
|
180
|
+
var thisHash = escapeSelector(link.hash);
|
181
|
+
|
182
|
+
if (thisHash && !$(thisHash).length) {
|
183
|
+
include = false;
|
184
|
+
}
|
185
|
+
|
186
|
+
if (!thisOpts.scrollTarget && (!hostMatch || !pathMatch || !thisHash)) {
|
187
|
+
include = false;
|
188
|
+
} else {
|
189
|
+
while (include && elCounter < exclude.length) {
|
190
|
+
if ($link.is(escapeSelector(exclude[elCounter++]))) {
|
191
|
+
include = false;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
while (include && ewlCounter < excludeWithin.length) {
|
196
|
+
if ($link.closest(excludeWithin[ewlCounter++]).length) {
|
197
|
+
include = false;
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
if (include) {
|
203
|
+
if (thisOpts.preventDefault) {
|
204
|
+
event.preventDefault();
|
205
|
+
}
|
206
|
+
|
207
|
+
$.extend(clickOpts, thisOpts, {
|
208
|
+
scrollTarget: thisOpts.scrollTarget || thisHash,
|
209
|
+
link: link
|
210
|
+
});
|
211
|
+
|
212
|
+
$.smoothScroll(clickOpts);
|
213
|
+
}
|
214
|
+
};
|
215
|
+
|
216
|
+
if (options.delegateSelector !== null) {
|
217
|
+
this
|
218
|
+
.off('click.smoothscroll', options.delegateSelector)
|
219
|
+
.on('click.smoothscroll', options.delegateSelector, clickHandler);
|
220
|
+
} else {
|
221
|
+
this
|
222
|
+
.off('click.smoothscroll')
|
223
|
+
.on('click.smoothscroll', clickHandler);
|
224
|
+
}
|
225
|
+
|
226
|
+
return this;
|
227
|
+
}
|
228
|
+
});
|
229
|
+
|
230
|
+
var getExplicitOffset = function(val) {
|
231
|
+
var explicit = {relative: ''};
|
232
|
+
var parts = typeof val === 'string' && rRelative.exec(val);
|
233
|
+
|
234
|
+
if (typeof val === 'number') {
|
235
|
+
explicit.px = val;
|
236
|
+
} else if (parts) {
|
237
|
+
explicit.relative = parts[1];
|
238
|
+
explicit.px = parseFloat(parts[2]) || 0;
|
239
|
+
}
|
240
|
+
|
241
|
+
return explicit;
|
242
|
+
};
|
243
|
+
|
244
|
+
var onAfterScroll = function(opts) {
|
245
|
+
var $tgt = $(opts.scrollTarget);
|
246
|
+
|
247
|
+
if (opts.autoFocus && $tgt.length) {
|
248
|
+
$tgt[0].focus();
|
249
|
+
|
250
|
+
if (!$tgt.is(document.activeElement)) {
|
251
|
+
$tgt.prop({tabIndex: -1});
|
252
|
+
$tgt[0].focus();
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
opts.afterScroll.call(opts.link, opts);
|
257
|
+
};
|
258
|
+
|
259
|
+
$.smoothScroll = function(options, px) {
|
260
|
+
if (options === 'options' && typeof px === 'object') {
|
261
|
+
return $.extend(optionOverrides, px);
|
262
|
+
}
|
263
|
+
var opts, $scroller, speed, delta;
|
264
|
+
var explicitOffset = getExplicitOffset(options);
|
265
|
+
var scrollTargetOffset = {};
|
266
|
+
var scrollerOffset = 0;
|
267
|
+
var offPos = 'offset';
|
268
|
+
var scrollDir = 'scrollTop';
|
269
|
+
var aniProps = {};
|
270
|
+
var aniOpts = {};
|
271
|
+
|
272
|
+
if (explicitOffset.px) {
|
273
|
+
opts = $.extend({link: null}, $.fn.smoothScroll.defaults, optionOverrides);
|
274
|
+
} else {
|
275
|
+
opts = $.extend({link: null}, $.fn.smoothScroll.defaults, options || {}, optionOverrides);
|
276
|
+
|
277
|
+
if (opts.scrollElement) {
|
278
|
+
offPos = 'position';
|
279
|
+
|
280
|
+
if (opts.scrollElement.css('position') === 'static') {
|
281
|
+
opts.scrollElement.css('position', 'relative');
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
if (px) {
|
286
|
+
explicitOffset = getExplicitOffset(px);
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
scrollDir = opts.direction === 'left' ? 'scrollLeft' : scrollDir;
|
291
|
+
|
292
|
+
if (opts.scrollElement) {
|
293
|
+
$scroller = opts.scrollElement;
|
294
|
+
|
295
|
+
if (!explicitOffset.px && !(/^(?:HTML|BODY)$/).test($scroller[0].nodeName)) {
|
296
|
+
scrollerOffset = $scroller[scrollDir]();
|
297
|
+
}
|
298
|
+
} else {
|
299
|
+
$scroller = $('html, body').firstScrollable(opts.direction);
|
300
|
+
}
|
301
|
+
|
302
|
+
// beforeScroll callback function must fire before calculating offset
|
303
|
+
opts.beforeScroll.call($scroller, opts);
|
304
|
+
|
305
|
+
scrollTargetOffset = explicitOffset.px ? explicitOffset : {
|
306
|
+
relative: '',
|
307
|
+
px: ($(opts.scrollTarget)[offPos]() && $(opts.scrollTarget)[offPos]()[opts.direction]) || 0
|
308
|
+
};
|
309
|
+
|
310
|
+
aniProps[scrollDir] = scrollTargetOffset.relative + (scrollTargetOffset.px + scrollerOffset + opts.offset);
|
311
|
+
|
312
|
+
speed = opts.speed;
|
313
|
+
|
314
|
+
// automatically calculate the speed of the scroll based on distance / coefficient
|
315
|
+
if (speed === 'auto') {
|
316
|
+
|
317
|
+
// $scroller[scrollDir]() is position before scroll, aniProps[scrollDir] is position after
|
318
|
+
// When delta is greater, speed will be greater.
|
319
|
+
delta = Math.abs(aniProps[scrollDir] - $scroller[scrollDir]());
|
320
|
+
|
321
|
+
// Divide the delta by the coefficient
|
322
|
+
speed = delta / opts.autoCoefficient;
|
323
|
+
}
|
324
|
+
|
325
|
+
aniOpts = {
|
326
|
+
duration: speed,
|
327
|
+
easing: opts.easing,
|
328
|
+
complete: function() {
|
329
|
+
onAfterScroll(opts);
|
330
|
+
}
|
331
|
+
};
|
332
|
+
|
333
|
+
if (opts.step) {
|
334
|
+
aniOpts.step = opts.step;
|
335
|
+
}
|
336
|
+
|
337
|
+
if ($scroller.length) {
|
338
|
+
$scroller.stop().animate(aniProps, aniOpts);
|
339
|
+
} else {
|
340
|
+
onAfterScroll(opts);
|
341
|
+
}
|
342
|
+
};
|
343
|
+
|
344
|
+
$.smoothScroll.version = version;
|
345
|
+
$.smoothScroll.filterPath = function(string) {
|
346
|
+
string = string || '';
|
347
|
+
|
348
|
+
return string
|
349
|
+
.replace(/^\//, '')
|
350
|
+
.replace(/(?:index|default).[a-zA-Z]{3,4}$/, '')
|
351
|
+
.replace(/\/$/, '');
|
352
|
+
};
|
353
|
+
|
354
|
+
// default options
|
355
|
+
$.fn.smoothScroll.defaults = defaults;
|
356
|
+
|
357
|
+
}));
|
358
|
+
|