-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offset not working #114
Comments
Anything please? |
I am also having an issue with offsetStart working. Using offsetStart: 0 and offsetStart: 4 makes no difference. @sdepold please help! |
need fix code in line 131 to |
Also having this issue. Actually, its not entirely an "offset" that I want, but rather a way to fetch a small number of entries and expand this as the user scrolls down. The jQuery to implement this is pretty trivial if the offset feature was working, but it would be even better if there was a simple "fetch next XXX entries and add to container" type of call we could make where it appended to the container and kept track of it's own offset. I think this would be common enough to add to the library. |
HI guys, has anythying been done on this? the offset is very trivial error :( |
guys, I fixed it. Basically there is an index element missing in each function. Replace function generateHTMLForEntries, do this: and dont forget, offsetStart and offsetEnd have to be both numbers at the same time. this was done originally so I didn't change that logic. ` RSS.prototype.generateHTMLForEntries = function () {
};` |
can you open a pr?
kukoss <notifications@github.com> schrieb am Do. 18. Jan. 2018 um 10:39:
… guys, I fixed it. Basically there is an index element missing in each
function. Replace function generateHTMLForEntries, do this:
and dont forget, offsetStart and offsetEnd have to be both numbers at the
same time. this was done originally so I didn't change that logic.
` RSS.prototype.generateHTMLForEntries = function () {
var self = this;
var result = { entries: [], layout: null };
console.log("here are offsets")
console.log(self.options.offsetStart)
console.log(self.options.offsetEnd)
$(this.entries).each(function (index, elem) {
var entry = this;
var offsetStart = self.options.offsetStart;
var offsetEnd = self.options.offsetEnd;
var evaluatedString;
// offset required
if (offsetStart >= 0 && offsetEnd >= 0) {
if (index >= offsetStart && index <= offsetEnd) {
if (self.isRelevant(entry, result.entries)) {
evaluatedString = self.evaluateStringForEntry(
self.options.entryTemplate, entry
);
result.entries.push(evaluatedString);
}
}
} else {
// no offset
if (self.isRelevant(entry, result.entries)) {
evaluatedString = self.evaluateStringForEntry(
self.options.entryTemplate, entry
);
result.entries.push(evaluatedString);
}
}
});
if (!!this.options.entryTemplate) {
// we have an entryTemplate
result.layout = this.wrapContent(
this.options.layoutTemplate.replace('{entries}', '<entries></entries>')
);
} else {
// no entryTemplate available
result.layout = this.wrapContent('<div><entries></entries></div>');
}
return result;
};`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#114 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAE1OxlOiVwuE68P-c83p5GyTiuBmRisks5tLxFOgaJpZM4Jf6VU>
.
|
@sdepold what is pr? :) |
A Pull Request :) This way you can provide changes to my code base :) |
@kukoss PR = Pull Request. You have to fork the repository on github to your own, apply the changes you made to your fork, then you'll see a button to send a "pull request" to the original author. This allows the changes to be cleanly tracked, merged, and applied in a nice automated fashion. |
thanks guys. done....at least I hope so, I've done it correctly :) |
When I use the offset feature the RSS disappears entirely and the div is completely empty. My feed is http://news.bearingnet.net/feed/
Code
jQuery(function($) { $("#rss-feeds").rss("http://news.bearingnet.net/feed/", { offsetStart: 2, offsetEnd: 8, layoutTemplate: "<div class='feed-container'>{entries}</div>", entryTemplate: "<div class='rssEntry'><p class='padding-top'>{teaserImage}<a href='{url}' target='_blank'>{title}</a><br /> {date} <br />{shortBodyPlain}...<div class='text-right'></p><p><a href='{url}' target='_blank' class='btn main-bg'>Read more</a></p></div></div>", }) })
If i remove offsetEnd the feed reappears but doesn't seem to apply an offset
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: