GithubHelp home page GithubHelp logo

adn-timeline's People

Contributors

imathis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

adn-timeline's Issues

You might be able to user more jQuery builtins

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;

Custom render function spans

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:

Screenshot_3_5_13_11_45_AM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.