nodeBB keyboard navigation shortcuts
-
Hi folks,
thanks to @MaxWaldorf the new forum comes with a plugin which allows easy “hands off the mouse” keyboard shortcuts for several forum functions.
Please find below the list of keyboard shortcuts I’ve been able to find so far, and please feel free to add any others you may come across.
Alt-t: open “tag” page
Alt-p: open “popular” page
Alt-g: open “groups” page
Alt-o: open “options” (profile) page?
Alt-s: open “users” page
Alt-h: open “home” / “categories” page
Alt-n: open “notifications” page“?”: open nodeBB keyboard plugin “Help” page
j / k: move up / down in the list of topics / replies
Alt-u: List of unread topics
Alt-r: List of recently changed topics
r: reload page
t / b: go to top / bottom of page
Alt-Enter: Reply to topic / postCtrl-Enter: Send reply (use in post editor)
Enter: enter / display topic
Backspace: Up one level (back to topic list)
Alt-c: Open chat screenIf you would like to remap these shortcuts to other keys (or maybe you have been using my greasemonkey script on the old forum pages for easy keyboard navigation), then I have good news for you: A customized version of this script is also available for greasemonkey / tampermonkey on all half-way modern browsers which will bring back all the old keyboard mappings to the way they worked on the old forum.
You can find the script here:
https://greasyfork.org/en/scripts/433433-nodebb-remap-shortcuts
I’ve also included the source code below (make sure to replace “hoover” with your username for the chat shortcut to work as described in the comment).
// ==UserScript== // @name nodeBB remap shortcuts // @namespace https://hoover.gplrank.de/ // @description remaps various nodeBB keyboard shortcuts to simple keypresses // @description author: hoover // @description You'll need to replace "hoover" with your forum username for the "chat" link to work below. // @include http*://forum.falcon-bms.com/* // // @version 0.0.2.20211018140000 // ==/UserScript== function findTopicLink() { var anchors = document.getElementsByTagName('a'); var href="/unread"; for (var i = 0 ; i < anchors.length ; i++) { href = anchors[i].getAttribute('href'); if (href) { if(href.match(/topic/)) { return(href); break ; } } } } var key_map = { "N" : "/unread", "R": "/recent", "P": "/popular", "H": "/", "C": "/user/hoover/chats", "S": "/search", "M": "/notifications", "G": findTopicLink() } // stolen shamelessly from userscript.org's facebook key navigation // Thanks to Droll Troll function OnKeyUp(e) { if (String.fromCharCode(e.keyCode) in key_map && (typeof e.target.type == "undefined" || (e.target.type != "text" && e.target.type != "textarea")) && !e.altKey && !e.ctrlKey && e.keyCode <= 90) { window.location.replace(key_map[String.fromCharCode(e.keyCode)]) } } window.addEventListener("keyup",function(event) { OnKeyUp(event); },false)
All the best & I hope you enjoy’ll enjoy easy, hands-off-the-mouse keyboard navigation from now on
Uwe
-
M MaxWaldorf pinned this topic on
-
I’d like to map the old “go to first unread post / thread” key (“g”) to work with nodeBB, but I’m afraid my JavaScript “skills” (basically copy & paste
) aren’t up to par for this. Can somebody point me in the right direction please?
Basically this would entail sending the keystrokes “j” and “ENTER” in a sequence, “j” activating the first topic in the list and “ENTER” displaying it.
Thanks in advance & all the best,
Uwe
-
o Added “?” which displays the keyboard plugins help page
-
Is there a help file / cheat-sheet for the markdown syntax?
I just did
backquotes
out of habit and was pleasantly surprised to see it highlight text as “code”. -
@airtex2019 I’m not aware of a cheatsheet per se, but there’s a plugin that will enable "proper " markdown to be used for composing posts:
https://github.com/julianlam/nodebb-plugin-markdown
All the best,
Uwe
-
PS: According to this post, the nodebb-markdown package is part of the distribution, so it should work out of the box:
The link above also contains another link to a proper markdown cheatsheet.
All the best, Uwe
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
-
@hoover Thanks … gee maybe it should occur to me that they probably have a good “forum” and I should go there to search…
tl/dr: sounds like it’s the Daring Fireball markdown standard
Or some strict subset of it? The help popup points here =>
https://commonmark.org/help/ -
M MaxWaldorf locked this topic on
-
M MaxWaldorf unpinned this topic on
-
Hi folks,
here’s a little update to my keyboard nav script which now contains the “g” key as an additional feature (map it to your liking).
The “g” key will take you to the first “/topic”-Link on the page, so it’s not necessary to first hit “j” then followed by “ENTER” in order to view the first unread post.
All the best,
Uwe
Source code:
// ==UserScript== // @name nodeBB remap shortcuts // @namespace https://hoover.gplrank.de/ // @description remaps various nodeBB keyboard shortcuts to simple keypresses // @description author: hoover // @description You'll need to replace "hoover" with your forum username for the "chat" link to work below. // @include http*://forum.falcon-bms.com/* // // @version 0.0.1.20211005082836 // ==/UserScript== function findTopicLink() { var anchors = document.getElementsByTagName('a'); var href="/unread"; for (var i = 0 ; i < anchors.length ; i++) { href = anchors[i].getAttribute('href'); if (href) { if(href.match(/topic/)) { return(href); break ; } } } } var key_map = { "N" : "/unread", "R": "/recent", "P": "/popular", "H": "/", "C": "/user/hoover/chats", "S": "/search", "M": "/notifications", "G": findTopicLink() } // stolen shamelessly from userscript.org's facebook key navigation // Thanks to Droll Troll function OnKeyUp(e) { if (String.fromCharCode(e.keyCode) in key_map && (typeof e.target.type == "undefined" || (e.target.type != "text" && e.target.type != "textarea")) && !e.altKey && !e.ctrlKey && e.keyCode <= 90) { window.location.replace(key_map[String.fromCharCode(e.keyCode)]) } } window.addEventListener("keyup",function(event) { OnKeyUp(event); },false)
You can install the script using tampermonkey or greasemonkey from this URL:
https://greasyfork.org/scripts/433433
Let me know if you find any issues, the script seems to be working well on my end.
-
M MaxWaldorf unlocked this topic on
-
M MaxWaldorf pinned this topic on
-
<p>Hi folks,<br /><br />I’ve updated the first post with a new version of the script that works with the new editor that @MaxWaldorf installed on the site a few days ago (the old version won’t work with this editor any longer).<br /><br />All the best, <br /><br />Uwe <br /></p>
-
I just updated the script to ignore any “temporary-fixes” URL that might appear on the top of the pages (like the one that’s stickied now for 4.36).
You can update your script version / install here:
https://greasyfork.org/en/scripts/439812-nodebb-remap-shortcuts-new-editor-version
Cheers, Uwe
-
The good news is that you can remap these shortcuts to other keys if you’d like to (or if you’ve been using my greasemonkey script on the previous forum pages to facilitate keyboard navigation). For all moderately modern browsers, including greasemonkey and tampermonkey, a customised version of this script is also available that will restore all previous keyboard mappings to their functionality on the old forum.