A basic jQuery plugin for finding out who represents you in Canada
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist/js
example
src/js
.gitignore
Gruntfile.js
LICENSE
README.md
bower.json
package.json

README.md

Find Your Rep Widget: Canada

A basic jQuery plugin that renders a form into the specified target, geocoding input and displaying results from Open North's Represent API.

This plugin extends and reuses code from the Sunlight Foundation's jQuery Find-Your-Rep plugin.

For another take on this, check out The Tyee's plugin and demo.

Example

Try the demo (a good test address is A1A1A1 for St. John's, NL). The full example code is:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Find Your Rep example</title>
    <link rel="stylesheet" href="css/jquery.findyourrep.min.css" />
    <script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
    <script src="js/jquery.findyourrep-pack.min.js"></script>
    <script src="js/jquery.findyourrep.ca.min.js"></script>
</head>
<body>
    <script>
        $('body').append('<div class="fyr"></div>')
                 .find('div.fyr')
                 .findYourRep({apis: 'represent'});
    </script>
</body>
</html>

Usage

  1. Link, in this order:
  2. jQuery
  3. dist/js/jquery.findyourrep-pack.min.js from jQuery Find-Your-Rep
  4. dist/js/jquery.findyourrep.ca.min.js from this package
  5. Call findYourRep({apis: 'represent'}) on an element:
    $('.myDiv').findYourRep({apis: 'represent'});

For further documentation, see the jQuery Find-Your-Rep plugin.

Copyright (c) 2014 Open North Inc., released under the BSD3 license