// ==UserScript== // @name Basecamp - Keyboard Shortcuts // @namespace http://tampermonkey.net/ // @version 0.2 // @description This script adds some keyboard shortcuts to Basecamp. // @updateURL https://gist.github.com/whispy/e620cdedfb03e84e02945b3a0d928f62/raw/basecamp-keyboard-shortcuts.user.js // @downloadURL https://gist.github.com/whispy/e620cdedfb03e84e02945b3a0d928f62/raw/basecamp-keyboard-shortcuts.user.js // @author Dan Berkowitz // @match https://3.basecamp.com/* // ==/UserScript== function bulletList() { var trix = document.querySelector("trix-editor"); var bulletedButton = document.querySelector('.trix-button--icon-bullet-list'); if (bulletedButton.hasAttribute('data-trix-active')) { trix.editor.deactivateAttribute("bullet"); } else { trix.editor.activateAttribute("bullet"); } } var map = {}; // Create empty map to be filled with keycodes on keydown onkeydown = onkeyup = function(e){ e = e || event; // to deal with IE map[e.keyCode] = e.type == 'keydown'; if(map[17] && map[16] && map[190]){ // If map contains keycodes for CTRL+SHIFT+. //console.log(map); bulletList(); // toggle bulleted list } };