nodeBB keyboard navigation shortcuts
-
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/ -
-
-
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.
-
-
-
-
<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.