news_reader 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/.vscode/settings.json +3 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +97 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/news-reader +6 -0
- data/bin/setup +8 -0
- data/fixtures/.DS_Store +0 -0
- data/fixtures/blog/index.html +200 -0
- data/fixtures/blog/index_files/Box.css +29 -0
- data/fixtures/blog/index_files/Java_Box.js +89 -0
- data/fixtures/blog/index_files/ModuleStyleSheets.css +1655 -0
- data/fixtures/blog/index_files/black.css +11 -0
- data/fixtures/blog/index_files/blog-jive.jpg +0 -0
- data/fixtures/blog/index_files/blog-musolfs.jpg +0 -0
- data/fixtures/blog/index_files/blog-poolpak.jpg +0 -0
- data/fixtures/blog/index_files/blog-portalaudit.png +0 -0
- data/fixtures/blog/index_files/blog-semicolon1.jpg +0 -0
- data/fixtures/blog/index_files/blog-semicolon2.jpg +0 -0
- data/fixtures/blog/index_files/blog-spa1.jpg +0 -0
- data/fixtures/blog/index_files/blog-spa2.jpg +0 -0
- data/fixtures/blog/index_files/blog-statera.jpg +0 -0
- data/fixtures/blog/index_files/blue.css +11 -0
- data/fixtures/blog/index_files/common.js +149 -0
- data/fixtures/blog/index_files/dark.css +31 -0
- data/fixtures/blog/index_files/featherlight.min.css +8 -0
- data/fixtures/blog/index_files/featherlight.min.js +8 -0
- data/fixtures/blog/index_files/font-awesome.min.css +4 -0
- data/fixtures/blog/index_files/green.css +11 -0
- data/fixtures/blog/index_files/isotope.css +64 -0
- data/fixtures/blog/index_files/jquery-ui.min.js +5 -0
- data/fixtures/blog/index_files/jquery.carouFredSel-6.2.1-packed.js +16 -0
- data/fixtures/blog/index_files/jquery.contentcarousel.js +137 -0
- data/fixtures/blog/index_files/jquery.easing.1.3.js +205 -0
- data/fixtures/blog/index_files/jquery.form.js +1121 -0
- data/fixtures/blog/index_files/jquery.hoverdir.js +220 -0
- data/fixtures/blog/index_files/jquery.inview.js +60 -0
- data/fixtures/blog/index_files/jquery.isotope.min.js +11 -0
- data/fixtures/blog/index_files/jquery.magnific-popup.js +2046 -0
- data/fixtures/blog/index_files/jquery.mb.YTPlayer.js +1041 -0
- data/fixtures/blog/index_files/jquery.min.js +5 -0
- data/fixtures/blog/index_files/jquery.nav.js +223 -0
- data/fixtures/blog/index_files/jquery.smoothwheel.js +153 -0
- data/fixtures/blog/index_files/jquery.sticky.js +129 -0
- data/fixtures/blog/index_files/jquery.superslides.js +656 -0
- data/fixtures/blog/index_files/jquery.validate.js +1231 -0
- data/fixtures/blog/index_files/jquery.vegas.css +34 -0
- data/fixtures/blog/index_files/js +201 -0
- data/fixtures/blog/index_files/loading.gif +0 -0
- data/fixtures/blog/index_files/magnific-popup.css +365 -0
- data/fixtures/blog/index_files/main.css +301 -0
- data/fixtures/blog/index_files/main.js +26 -0
- data/fixtures/blog/index_files/modernizr-2.6.2.min.js +4 -0
- data/fixtures/blog/index_files/normalize.css +533 -0
- data/fixtures/blog/index_files/ohp3fra.js +44 -0
- data/fixtures/blog/index_files/orange.css +11 -0
- data/fixtures/blog/index_files/paralax.js +525 -0
- data/fixtures/blog/index_files/paralaxNEW4.css +2730 -0
- data/fixtures/blog/index_files/plugins.js +221 -0
- data/fixtures/blog/index_files/portfolio.js +142 -0
- data/fixtures/blog/index_files/purple.css +11 -0
- data/fixtures/blog/index_files/red.css +11 -0
- data/fixtures/blog/index_files/responsive3.css +329 -0
- data/fixtures/blog/index_files/superslides.css +65 -0
- data/fixtures/blog/index_files/turquoise.css +11 -0
- data/fixtures/blog/index_files/util.js +287 -0
- data/fixtures/blog/index_files/yellow.css +11 -0
- data/lib/news_reader/article.rb +60 -0
- data/lib/news_reader/cli.rb +41 -0
- data/lib/news_reader/scraper.rb +17 -0
- data/lib/news_reader/version.rb +3 -0
- data/lib/news_reader.rb +4 -0
- data/news_reader.gemspec +40 -0
- metadata +209 -0
@@ -0,0 +1,129 @@
|
|
1
|
+
// Sticky Plugin v1.0.0 for jQuery
|
2
|
+
// =============
|
3
|
+
// Author: Anthony Garand
|
4
|
+
// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
|
5
|
+
// Improvements by Leonardo C. Daronco (daronco)
|
6
|
+
// Created: 2/14/2011
|
7
|
+
// Date: 2/12/2012
|
8
|
+
// Website: http://labs.anthonygarand.com/sticky
|
9
|
+
// Description: Makes an element on the page stick on the screen as you scroll
|
10
|
+
// It will only set the 'top' and 'position' of your element, you
|
11
|
+
// might need to adjust the width in some cases.
|
12
|
+
|
13
|
+
(function($) {
|
14
|
+
var defaults = {
|
15
|
+
topSpacing: 0,
|
16
|
+
bottomSpacing: 0,
|
17
|
+
className: 'is-sticky',
|
18
|
+
wrapperClassName: 'sticky-wrapper',
|
19
|
+
center: false,
|
20
|
+
getWidthFrom: ''
|
21
|
+
},
|
22
|
+
$window = $(window),
|
23
|
+
$document = $(document),
|
24
|
+
sticked = [],
|
25
|
+
windowHeight = $window.height(),
|
26
|
+
scroller = function() {
|
27
|
+
var scrollTop = $window.scrollTop(),
|
28
|
+
documentHeight = $document.height(),
|
29
|
+
dwh = documentHeight - windowHeight,
|
30
|
+
extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
|
31
|
+
|
32
|
+
for (var i = 0; i < sticked.length; i++) {
|
33
|
+
var s = sticked[i],
|
34
|
+
elementTop = s.stickyWrapper.offset().top,
|
35
|
+
etse = elementTop - s.topSpacing - extra;
|
36
|
+
|
37
|
+
if (scrollTop <= etse) {
|
38
|
+
if (s.currentTop !== null) {
|
39
|
+
s.stickyElement
|
40
|
+
.css('position', '')
|
41
|
+
.css('top', '');
|
42
|
+
s.stickyElement.parent().removeClass(s.className);
|
43
|
+
s.currentTop = null;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
var newTop = documentHeight - s.stickyElement.outerHeight()
|
48
|
+
- s.topSpacing - s.bottomSpacing - scrollTop - extra;
|
49
|
+
if (newTop < 0) {
|
50
|
+
newTop = newTop + s.topSpacing;
|
51
|
+
} else {
|
52
|
+
newTop = s.topSpacing;
|
53
|
+
}
|
54
|
+
if (s.currentTop != newTop) {
|
55
|
+
s.stickyElement
|
56
|
+
.css('position', 'fixed')
|
57
|
+
.css('top', newTop);
|
58
|
+
|
59
|
+
if (typeof s.getWidthFrom !== 'undefined') {
|
60
|
+
s.stickyElement.css('width', $(s.getWidthFrom).width());
|
61
|
+
}
|
62
|
+
|
63
|
+
s.stickyElement.parent().addClass(s.className);
|
64
|
+
s.currentTop = newTop;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
},
|
69
|
+
resizer = function() {
|
70
|
+
windowHeight = $window.height();
|
71
|
+
},
|
72
|
+
methods = {
|
73
|
+
init: function(options) {
|
74
|
+
var o = $.extend(defaults, options);
|
75
|
+
return this.each(function() {
|
76
|
+
var stickyElement = $(this);
|
77
|
+
|
78
|
+
var stickyId = stickyElement.attr('id');
|
79
|
+
var wrapper = $('<div></div>')
|
80
|
+
.attr('id', stickyId + '-sticky-wrapper')
|
81
|
+
.addClass(o.wrapperClassName);
|
82
|
+
stickyElement.wrapAll(wrapper);
|
83
|
+
|
84
|
+
if (o.center) {
|
85
|
+
stickyElement.parent().css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
|
86
|
+
}
|
87
|
+
|
88
|
+
if (stickyElement.css("float") == "right") {
|
89
|
+
stickyElement.css({"float":"none"}).parent().css({"float":"right"});
|
90
|
+
}
|
91
|
+
|
92
|
+
var stickyWrapper = stickyElement.parent();
|
93
|
+
stickyWrapper.css('height', stickyElement.outerHeight());
|
94
|
+
sticked.push({
|
95
|
+
topSpacing: o.topSpacing,
|
96
|
+
bottomSpacing: o.bottomSpacing,
|
97
|
+
stickyElement: stickyElement,
|
98
|
+
currentTop: null,
|
99
|
+
stickyWrapper: stickyWrapper,
|
100
|
+
className: o.className,
|
101
|
+
getWidthFrom: o.getWidthFrom
|
102
|
+
});
|
103
|
+
});
|
104
|
+
},
|
105
|
+
update: scroller
|
106
|
+
};
|
107
|
+
|
108
|
+
// should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
|
109
|
+
if (window.addEventListener) {
|
110
|
+
window.addEventListener('scroll', scroller, false);
|
111
|
+
window.addEventListener('resize', resizer, false);
|
112
|
+
} else if (window.attachEvent) {
|
113
|
+
window.attachEvent('onscroll', scroller);
|
114
|
+
window.attachEvent('onresize', resizer);
|
115
|
+
}
|
116
|
+
|
117
|
+
$.fn.sticky = function(method) {
|
118
|
+
if (methods[method]) {
|
119
|
+
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
120
|
+
} else if (typeof method === 'object' || !method ) {
|
121
|
+
return methods.init.apply( this, arguments );
|
122
|
+
} else {
|
123
|
+
$.error('Method ' + method + ' does not exist on jQuery.sticky');
|
124
|
+
}
|
125
|
+
};
|
126
|
+
$(function() {
|
127
|
+
setTimeout(scroller, 0);
|
128
|
+
});
|
129
|
+
})(jQuery);
|