imathis / adn-timeline Goto Github PK
View Code? Open in Web Editor NEWA javascript timeline fetcher for App.net
A javascript timeline fetcher for App.net
If you are using jQuery, and I know you might not always, you could take advantage of more of of the built in jQuery utilities.
How I would do defaults
var defaults: {
el: '.adn-timeline',
count: 4,
replies: false,
reposts: false,
cookie: 'adn-timeline'
};
var function (options) {
options = $.extend({}, defaults, options);
};
Regarding Data attributes and jQuery, if you checkout the docs http://api.jquery.com/data/#data-html5 you can see that much of your parse could could be replaced by relying on jQuerys builtin.
For example
<div class='adn-timeline' data-username='imathis' data-replies='true' data-count='4'></div>
$(el).data('username') === 'imathis';
$(el).data('replies') === true;
$(el).data('count') === 4;
You're linking to https://alpha-app.net/username at the top of the feed, but it should be http://alpha.app.net/username :)
I'm using a custom render function and it's great.
I was wondering if there might be an ability to turn off the spans when I refer to post.text. According to the readme, the text attribute looks like this:
text: post.html (with trimmed display urls and auto-linked mentions and hashtags)
which is great. When it renders it though, it includes some spans like so:
<p>
<a href="https://alpha.app.net/duff/post/3530726">7m</a>
<span itemscope="https://app.net/schemas/Post">
Now using the excellent adn-timeline from
<span itemprop="mention" data-mention-id="5700" data-mention-name="imathis">
<a class="adn-username" href="https://alpha.app.net/imathis">@imathis</a>
</span>
on <a href="http://duffomelia.com">duffomelia.com</a> to show app dot net posts in the sidebar.<br><br><a href="https://github.com/imathis/adn-timeline">github.com/imathis/adn-timeline</a>
</span>
</p>
I was thinking that if those spans were removed, then it would render wonderfully for me. I'm not sure if there's a better way to do it (like styling the spans somehow).
As you can see here, the reference to @imathis is out of place:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.