jumbo-jekyll-theme 3.0.34 → 3.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/disqus-comments.html +50 -14
- data/assets/js/vendor/disqus-loader.js +87 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ef3a4f81452f4f290a23f14f8e9994114ff3a1f7006b413b0507ef4ba30cc01
|
4
|
+
data.tar.gz: 9fea78edad2864f3c8ec210fb6d951c9f2853df3c0bc6ba4aab1124b55033eb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 951d2fbf94e9176344dc56010f0d52b2894c45c5ea7eee10996a4ed17462524c051aee81beef1d2bbc8f5516c6117dd31b695533d15c6461079d95afdb87d3f2
|
7
|
+
data.tar.gz: fd4b9d72ab9bf60e328b49089867d44c3602af7ffd52d50be400caebbd9f3fca10af23f4ddfaa93a9c929526052c236e5a8a1260e0896af0ce76ce09814ebeb6
|
@@ -1,20 +1,56 @@
|
|
1
1
|
{% unless page.comments == false %}
|
2
2
|
<section id="comments-section">
|
3
3
|
<h3>Comments</h3>
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
4
|
+
<div class="disqus"></div>
|
5
|
+
<script type="text/javascript">
|
6
|
+
$(document).ready(function(){
|
7
|
+
var disqus_shortname = '{{ site.data.settings.disqus.shortname }}';
|
8
|
+
var options =
|
9
|
+
{
|
10
|
+
scriptUrl: '//' + disqus_shortname + '.disqus.com/embed.js',
|
11
|
+
/*
|
12
|
+
@type: string (url)
|
13
|
+
@default: none
|
14
|
+
@required
|
15
|
+
URL of Disqus' executive JS file. The value is memorized on the first function call
|
16
|
+
and ignored otherwise because Disqus allows only one instance per page at the time.
|
17
|
+
*/
|
18
|
+
|
19
|
+
laziness: 1,
|
20
|
+
/*
|
21
|
+
@type: int (>=0)
|
22
|
+
@default: 1
|
23
|
+
Sets the laziness of loading the widget: (viewport height) * laziness . For example:
|
24
|
+
0 - widget load starts when at the least a tiny part of it gets in the viewport;
|
25
|
+
1 - widget load starts when the distance between the widget zone and the viewport is no more than the height of the viewport;
|
26
|
+
2 - 2x viewports, etc.
|
27
|
+
*/
|
28
|
+
|
29
|
+
throttle: 250,
|
30
|
+
/*
|
31
|
+
@type: int (milliseconds)
|
32
|
+
@default: 250
|
33
|
+
Defines how often the plugin should make calculations during the
|
34
|
+
processes such as resize of a browser's window or viewport scroll.
|
35
|
+
250 = 4 times in a second.
|
36
|
+
*/
|
37
|
+
|
38
|
+
/*
|
39
|
+
@type: function
|
40
|
+
@default: none
|
41
|
+
Disqus-native options. Check Disqus' manual for more information.
|
42
|
+
*/
|
43
|
+
disqusConfig: function()
|
44
|
+
{
|
45
|
+
this.page.title = '{{page.title}}';
|
46
|
+
this.page.url = '{{site.url}}{{page.url}}';
|
47
|
+
this.page.identifier = '{{page.url}}';
|
48
|
+
}
|
49
|
+
};
|
50
|
+
// jQuery
|
51
|
+
$.disqusLoader( '.disqus', options);
|
52
|
+
});
|
53
|
+
</script>
|
18
54
|
</section>
|
19
55
|
{% endunless %}
|
20
56
|
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/*
|
2
|
+
disqusLoader.js v1.0
|
3
|
+
A JavaScript plugin for lazy-loading Disqus comments widget.
|
4
|
+
-
|
5
|
+
By Osvaldas Valutis, www.osvaldas.info
|
6
|
+
Available for use under the MIT License
|
7
|
+
*/
|
8
|
+
|
9
|
+
;( function( $, window, document, undefined )
|
10
|
+
{
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
var $win = $( window ),
|
14
|
+
throttle = function(a,b){var c,d;return function(){var e=this,f=arguments,g=+new Date;c&&g<c+a?(clearTimeout(d),d=setTimeout(function(){c=g,b.apply(e,f)},a)):(c=g,b.apply(e,f))}},
|
15
|
+
|
16
|
+
throttleTO = false,
|
17
|
+
laziness = false,
|
18
|
+
disqusConfig = false,
|
19
|
+
scriptUrl = false,
|
20
|
+
|
21
|
+
scriptStatus = 'unloaded',
|
22
|
+
$instance = $(),
|
23
|
+
|
24
|
+
init = function()
|
25
|
+
{
|
26
|
+
if( !$instance.length || $instance.data( 'disqusLoaderStatus' ) == 'loaded' )
|
27
|
+
return true;
|
28
|
+
|
29
|
+
var winST = $win.scrollTop();
|
30
|
+
|
31
|
+
// if the element is too far below || too far above
|
32
|
+
if( $instance.offset().top - winST > $win.height() * laziness || winST - $instance.offset().top - $instance.outerHeight() - ( $win.height() * laziness ) > 0 )
|
33
|
+
return true;
|
34
|
+
|
35
|
+
$( '#disqus_thread' ).removeAttr( 'id' );
|
36
|
+
$instance.attr( 'id', 'disqus_thread' ).data( 'disqusLoaderStatus', 'loaded' );
|
37
|
+
|
38
|
+
if( scriptStatus == 'loaded' )
|
39
|
+
{
|
40
|
+
DISQUS.reset({ reload: true, config: disqusConfig });
|
41
|
+
}
|
42
|
+
else // unloaded | loading
|
43
|
+
{
|
44
|
+
window.disqus_config = disqusConfig;
|
45
|
+
if( scriptStatus == 'unloaded' )
|
46
|
+
{
|
47
|
+
scriptStatus = 'loading';
|
48
|
+
$.ajax(
|
49
|
+
{
|
50
|
+
url: scriptUrl,
|
51
|
+
async: true,
|
52
|
+
cache: true,
|
53
|
+
dataType: 'script',
|
54
|
+
success: function()
|
55
|
+
{
|
56
|
+
scriptStatus = 'loaded';
|
57
|
+
}
|
58
|
+
});
|
59
|
+
}
|
60
|
+
}
|
61
|
+
};
|
62
|
+
|
63
|
+
$win.on( 'scroll resize', throttle( throttleTO, init ));
|
64
|
+
|
65
|
+
$.disqusLoader = function( element, options )
|
66
|
+
{
|
67
|
+
options = $.extend({},
|
68
|
+
{
|
69
|
+
laziness: 1,
|
70
|
+
throttle: 250,
|
71
|
+
scriptUrl: false,
|
72
|
+
disqusConfig: false,
|
73
|
+
|
74
|
+
}, options );
|
75
|
+
|
76
|
+
laziness = options.laziness + 1;
|
77
|
+
throttleTO = options.throttle;
|
78
|
+
disqusConfig = options.disqusConfig;
|
79
|
+
scriptUrl = scriptUrl === false ? options.scriptUrl : scriptUrl; // set it only once
|
80
|
+
$instance = ( typeof element == 'string' ? $( element ) : element ).eq( 0 );
|
81
|
+
|
82
|
+
$instance.data( 'disqusLoaderStatus', 'unloaded' );
|
83
|
+
|
84
|
+
init();
|
85
|
+
};
|
86
|
+
|
87
|
+
})( jQuery, window, document );
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jumbo-jekyll-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Kirkby
|
@@ -546,6 +546,7 @@ files:
|
|
546
546
|
- assets/js/vendor/bootstrap.js
|
547
547
|
- assets/js/vendor/cognito.js
|
548
548
|
- assets/js/vendor/cookieconsent.js
|
549
|
+
- assets/js/vendor/disqus-loader.js
|
549
550
|
- assets/js/vendor/featherlight.js
|
550
551
|
- assets/js/vendor/jquery.js
|
551
552
|
- assets/js/vendor/jquery.rss.js
|