Giter Club home page Giter Club logo

polymer-twitter-timeline's Introduction

<twitter-timeline> Polymer (ES6)

Build status Bower version JavaScript Style Guide Dependency Status

Wrapper of Twitter Widget.js as a customizable Polymer 1.0 WebComponent in ES6 syntax.

Why

<link rel="import" href="[your_bower_folder]/polymer-twitter-timeline/twitter-timeline.html">

<twitter-timeline data-widget-id="[yourId]"></twitter-timeline>

Forget to import any library, just import the component and polifylls if needed (webcomponentsjs just for Polymer) and you are ready to go.

Install

$ bower install polymer-twitter-timeline

Default Properties

{
  /** Twtt istance **/
  Twtt: {
    type: Function
  },
  uniqueId: {
    type: String,
    value: 'twitterTimelinePolymerLibLoader'
  },
  /**
   * Twitter data-id to feed the timeline
   * - Create a new widget: https://twitter.com/settings/widgets/new
   * - Get the data from whatever source you want
   * - Get the data-widget-id
   *
   */
  dataWidgetId: {
    type: String
  },
  /**
   * Specifies `width` and `height` of the widget
   *
   * @type {{width: string, height: string}}
   */
  size: {
    type: Object,
    value: () => {
      return {
        width: "400",
        height: "400"
      }
    }
  },
  /**
   * Value for `data-chrome` (https://dev.twitter.com/web/embedded-timelines#customize-widget-components)
   *
   * @type 'noheader,nofooter,noborders,noscrollbar,transparent'
  */
  chrome: {
    type: String,
    value: ''
  }
}

API

.loadTimeline(widgetId)

widgetId (optional)

Type: string
Will load (or reload) the timeline with the widget id passed or with the this.dataWidgetId property if setted.

Twitter data-id to feed the timeline:


.removeTimeline()

Remove current timeline.


Events

on-timeline-loaded

After the correct initialization of the library and the timeline

Twtt instance

The Twtt instance is available as this.Twtt

Other references

polymer-lib-loader - for loading the library

Develop

Clone the repository inside a folder (ex: sandbox-twitter-timeline/twitter-timeline) and inside the twitter-timeline folder:

$ npm install && bower install

Developing mode: watch on base files and Babel that transpiles (http://localhost:8080/twitter-timeline/demo)

$ npm start

Build: only the Babel action simply run

$ npm run build

Test

Standard for coding style and WCT for unit test:

$ npm test

License

MIT © LasaleFamine

polymer-twitter-timeline's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

e111077

polymer-twitter-timeline's Issues

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.