Last active
January 11, 2018 16:26
-
-
Save whispy/e620cdedfb03e84e02945b3a0d928f62 to your computer and use it in GitHub Desktop.
Revisions
-
whispy revised this gist
Jan 11, 2018 . 1 changed file with 9 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,12 @@ // ==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== @@ -22,9 +21,12 @@ function bulletList() { } } 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 } }; -
whispy revised this gist
Jan 11, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,8 @@ // @namespace http://tampermonkey.net/ // @version 0.1 // @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/* // @require https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.6.1/mousetrap.min.js -
whispy created this gist
Jan 11, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ // ==UserScript== // @name Basecamp - Keyboard Shortcuts // @namespace http://tampermonkey.net/ // @version 0.1 // @description This script adds some keyboard shortcuts to Basecamp. // @updateURL / // @downloadURL / // @author Dan Berkowitz // @match https://3.basecamp.com/* // @require https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.6.1/mousetrap.min.js // ==/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"); } } window.onload = function() { Mousetrap.bind(['ctrl+shift+.', function(e) { console.log('pressed'); }); };