GithubHelp home page GithubHelp logo

imclab / commitment Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michael-lynch/commitment

0.0 2.0 0.0 249 KB

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

License: MIT License

JavaScript 100.00%

commitment's Introduction

#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);
		}
	});	
});

commitment's People

Contributors

fweber-de avatar

Watchers

 avatar  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.