Skip to content

Instantly share code, notes, and snippets.

@toolmantim
Created January 30, 2010 01:13
Show Gist options
  • Select an option

  • Save toolmantim/290315 to your computer and use it in GitHub Desktop.

Select an option

Save toolmantim/290315 to your computer and use it in GitHub Desktop.
(function () {
if (!window.fluid) return;
// Dock badge unread messages
setInterval(function() {
var m = document.title.match(/\((\d+)\)/);
window.fluid.dockBadge = m ? parseInt(m[1]) : '';
}, 1000);
// Bind Ctrl-A to the Archive button
document.addEventListener("keydown", function(e) {
var archiveButton = document.querySelector(".wd-focus [dc='archive']");
if (e.keyCode == 65 && e.ctrlKey && archiveButton) {
var click = document.createEvent("MouseEvents");
click.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
archiveButton.dispatchEvent(click);
}
}, false);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment