Skip to content

A simple, lightweight jQuery plugin used to display commit messages for a specific Github repository.

License

Notifications You must be signed in to change notification settings

michael-lynch/commitment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Commitment

A simple, lightweight jQuery plugin used to display commit messages for a specific Github repository.

See a demo

##Instructions

Include jQuery and the plugin in the head or footer of your page.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    
<script src="/js/plugins/commitment.js"></script>

Create an ordered or unordered list and assign it a class or ID.

<ul id="commits"></ul>

Initialize the plugin targeting the class, ID or element that will contain the commit messages, and set the "user" and "repo" properties of the repository you wish to display the commit messages of.

$('#commits').commitment({
    user: 'michael-lynch',
    repo: 'reading-time'
});

####Options

user: string (required)
A string that defines the Github username (default: null).

repo: string (required)
A string that defines the Github repository (default: null).

filterBranch: string / sha
A string that defines either a branch name or SHA that will be used to filter the commit messages (default: null).

filterAuthor: string
A string that defines a Github username that will be used to filter the commit messages (default: null).

filterPath: string
A string that defines a path that is to be required in the commits being returned (default: null).

filterSince: ISO timestamp (YYYY-MM-DDTHH:MM:SSZ)
A timestamp that defines the start date of the commit messages being returned (default: null).

filterUntil: ISO timestamp (YYYY-MM-DDTHH:MM:SSZ)
A timestamp that defines the end date of the commit messages being returned (default: null).

makeCommitLink: boolean
A boolean value that indicates whether or not the commit message should be a link (default: false).

showCommitDate: boolean
A boolean value that indicates whether or not the date of the commit message should be displayed (default: true).

dateFormat: "dd/mm/yyyy"
A specific string that defines the format of the commit message date (default: null).

showCommitter: boolean
A boolean value that indicates whether or not the committer should be displayed (default: true).

showCommitterAvatar: boolean
A boolean value that indicates whether or not the commiter avatar should be displayed (default: true).
* showCommitter is required to be set to true to use showCommitterAvatar

success: function() {}
A function that runs after the plugin has successfully retrieved the commit messages. (default: function()).

error: function() {}
A function that runs if there was an error retrieving the commit messages. (default: function(message)).

#####Example:

$(function() {

	$('#commits').commitment({
		user: 'michael-lynch',
		repo: 'reading-time',
		success: function() {
		    console.log('Commit messages were successfuly retrieved from Github!');
		},
		error: function(message) {
		    console.log(message);
		}
	});	
});

About

A simple, lightweight jQuery plugin used to display commit messages for a specific Github repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published