Skip to content

Instantly share code, notes, and snippets.

@Ruxton
Forked from karlbright/github.com.js
Created May 22, 2012 03:37
Show Gist options
  • Save Ruxton/2766399 to your computer and use it in GitHub Desktop.
Save Ruxton/2766399 to your computer and use it in GitHub Desktop.
$(function(){
FRONTIER_REGEX = /^\/thefrontiergroup\//;
INBOX_GITHUB = /^\/inbox\/notifications/;
if(window.location.pathname.match(INBOX_GITHUB)){
var actions, button, markasread;
markasread = $('.list .minibutton');
button = $('<button>');
button.addClass('minibutton');
button.attr('tabindex',4);
button.css('margin-left','5px');
button.text('Delete all the things!');
$('.del a').click();
button.click(function(event){
event.stopImmediatePropagation();
$.each($('.del a'), function(){
this.click();
});
setTimeout('location.reload()', 1000);
});
button.insertAfter(markasread);
}
if(window.location.pathname.match(FRONTIER_REGEX)){
var actions, tip, button, commentForm, comment;
discussion = $('#discussion_bucket');
actions = discussion.find('div.form-actions');
commentForm = discussion.find('div.comment-form');
tip = discussion.find('.tip');
button = $('<button>');
comment = commentForm.find('textarea');
button.addClass('classy');
button.attr('tabindex',4);
button.css('float','left');
button.text('Looks good to me!');
button.bind('click',function(event){
event.stopImmediatePropagation();
comment.val(':thumbsup:');
});
button.insertAfter(tip);
tip.hide();
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment