About

A jQuery plug-in to display GitHub issues like UserVoice.

Examples

Defaults

Click here to view an example using the default options.

$('a.defaults').githubVoice('defunkt', 'github-issues');

Customization

Click here to view an example using custom options.

$('a.custom').githubVoice('defunkt', 'github-issues', {
  limit : 3,
  text  : {
    loading      : "Loading ideas...",
    description  : "Below are the top three ideas.",
    callToAction : "View feedback forum."
  }
});

Filtering

Click here to view an example using filters.

$('a.filter').githubVoice('defunkt', 'github-issues', {
  filter : {
    user : /defunkt/g
  }
});

Sorting

View the newest or the oldest as an example of using sorting.

// Sort by number instead of votes.
$('a.sort-desc').githubVoice('defunkt', 'github-issues', {
  sort : 'number'
});

// Sort by a custom function.
$('a.sort-asc').githubVoice('defunkt', 'github-issues', {
  sort : function(a, b) {
    return ((a.number < b.number) ? -1 : ((a.number > b.number) ? 1 : 0));
  }
});

Options

limit

The number of issues to display. (Default: 5)

filter

Gives you the ability to filter issues by any information returned by the API. At the time of writing the possible values are: number, votes, created_at, body, title, updated_at, user, state

sort

Provide a string it will sort by that property in descending order. Provide a function to use a custom sort. (Default: "votes")

text.description

The text displayed above the issue list. (Default: "We've setup a feedback forum so you can tell us what's on your mind. Please go there and be heard!")

text.loading

The text displayed while the issues are being loaded. (Default: "Loading...")

text.callToAction

The call-to-action text used for the link below the issues list. (Default: "&raquo; Go to our Feedback Forum")