Skip to content

Instantly share code, notes, and snippets.

@rlemon
Last active August 29, 2015 14:01
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 rlemon/083205e6db72bdb15f60 to your computer and use it in GitHub Desktop.
Save rlemon/083205e6db72bdb15f60 to your computer and use it in GitHub Desktop.
easy unstar
// ==UserScript==
// @name Easy unstar
// @author Robert Lemon
// @version 0.42
// @namespace
// @description adds a button next to the message to unstar them
// @include http://chat.stackoverflow.com/rooms/*
// ==/UserScript==
function exec(fn) {
var script = document.createElement('script');
script.setAttribute('type', 'application/javascript');
script.textContent = '(' + fn + ')();';
document.body.appendChild(script); // run the script
}
exec(function () {
$('#chat').on('click', '.flash .img.vote', function(e) {
if( e.ctrlKey ) {
var id = $(this).parents('.message').get(0).id.split('-')[1];
$.post('/messages/' + id + '/unstar', fkey());
return false;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment