Last active
August 29, 2015 14:01
-
-
Save rlemon/083205e6db72bdb15f60 to your computer and use it in GitHub Desktop.
easy unstar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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