Skip to content

Instantly share code, notes, and snippets.

@bumbu
Created March 16, 2014 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bumbu/9584032 to your computer and use it in GitHub Desktop.
Save bumbu/9584032 to your computer and use it in GitHub Desktop.
Allows editing of GitHub contributions graph
$('#calendar-graph').clone().attr('id', 'cg2').insertAfter($('#calendar-graph').hide());
$('#cg2 .day').off('click').click(function(ev){
ev.preventDefault()
ev.stopPropagation()
var $this = $(this)
var colors = ['1e6823', '44a340', '44a340', '8cc665', '8cc665', '8cc665', 'd6e685', 'd6e685', 'd6e685', 'd6e685']
if($this.attr('style') == 'fill: #eeeeee;') {
var color = colors[Math.floor(Math.random() * colors.length)]
$(this).attr('style', "fill: #"+color+";")
} else {
$(this).attr('style', "fill: #eeeeee;")
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment