Giter VIP home page Giter VIP logo

re_tumblr.js's Introduction

re_tumblr

A javscript-badge that handles these post types (all available as of 2008/11/20): audio, conversation, link, photo, quote, regular, video

Requirements: Prototype.

It produces basically the same html structure as the standard tumblr javascript produces but adds additional date and the tag divs. It also links photos to the post itself. Click-through links aren't supported by the API (yet?).

The used css classes are (for your reference):

tumblr_posts, tumblr_post, tumblr_[type]_post,
tumblr_date*, tumblr_tags*,
tumblr_title,
tumblr_photo, tumblr_photo_link*,
tumblr_link, tumblr_video, tumblr_audio,
tumblr_caption, tumblr_body, tumblr_label,
tumblr_open_quote, tumblr_close_quote, tumblr_quote, tumblr_source,

*(new classes)

to use it, you just call the javascript like that:

tumblrPosts({})

or with some options:

tumblrPosts( {"username" : "restorm-news", "num" : 1} )

At the moment, there are just 3 functions:

  • tumblrPosts() to add a whole feed
  • tumblrLastPostDate() to output the date of the latest post
  • tumblrPostsAppend() only used internally for a budget pagination: it only adds posts to the bottom

All three have their callback counterparts, which actually insert the content after the data is loaded:

  • tumblrInsertPosts()
  • tumblrInsertLastPostDate()
  • tumblrInsertPostsAppend()

The actual content is inserted into divs with css-classes and ids deriving from the callback:

  • class = "tumblrInsertLastPostDate_container" p.e. for all tumblrLastPostDate inserts and
  • id = sanitized tumblr username + classname

You can style the containers to prevent shifts in the layout while the tumblr content loads.

re_tumblr.js's People

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.