GithubHelp home page GithubHelp logo

imclab / jquery-findyourrep Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sunlightlabs/jquery-findyourrep

0.0 1.0 0.0 417 KB

A basic jQuery plugin for finding out who represents you in federal and state legislatures

Home Page: http://sunlightlabs.github.io/jquery-findyourrep/

License: BSD 3-Clause "New" or "Revised" License

jquery-findyourrep's Introduction

Find Your Rep Widget

A Basic jQuery plugin that renders a form into the specified target, geocoding input and displaying results from Sunlight's Congress and Open States APIs.

Usage:

  1. Link jQuery and dist/jquery.findyourrep-pack.min.js on your page (in that order).
  2. Call findYourRep() on an element:
    $('.myDiv').findYourRep({
        apikey: 'your-key'
    });

Options:

Passed as a javascript object to the constructor, just like any jQ plugin.

  • apikey: Your Sunlight Labs API key (required)
  • apis: A comma-delimited list of apis to query.
    For U.S. Congress only, use apis: 'congress'
    For U.S. and State Legislatures, use apis: 'congress, openstates'
    Default is 'congress, openstates'.
  • title: The title of the widget. Default is 'Find Your Representatives'
  • text: The text that displays above the textarea for the user's address.
    Default is 'Enter your address to see who represents you.'
  • action: The text of the button that finds your reps. Default is 'Go!'

Default Styles:

There's an included stylesheet which you can add to your page to add some basic style.

By default, all CSS is scoped to a container classname, .fyr-container. There's a scss source file available in the src/css folder which you can edit to add your own style.

Screenshots:

Enter your address screen

Result Screen

Caveats

  • The Open States API does not support HTTPS, so queries to it will not be made when the embedding page is viewed securely.

Contributing:

  1. Fork this repo
  2. Install Node.js if you don't have it
  3. Run npm install && bower install && grunt demo
  4. Commit your changes and send a pull request

License:

BSD3

jquery-findyourrep's People

Contributors

drinks avatar konklone avatar

Watchers

JT5D avatar

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.