Or to be more precise: these are all separate SSO plugins. Just search for sso in plugins 🙂
[nodebb-plugin-smoothshorts] Short URLs built in...
.. well, almost. It's a plugin, after all.
npm install nodebb-plugin-smoothshorts
Once a user opens the browser's context menu upon a topic link, the href value of that link gets replaced with its assigned hash:
This also works on posts (theme-persona; couldn't find post links in theme-lavender).
The now copied address is one of the form
https://yourNodeBB.org/ss/HASH. Visiting it will set some logic in motion, finding the associated post or topic and redirecting accordingly:
The original address is restored on any next
mousedownevent. This way, even if the just hashed and copied link is clicked, the user will be visiting that original, since the event is processed before the browser attempts to follow the link. (Tested in FireFox 38.05 and Chrome 43.0; please let me know if your browser doesn't work!)
Doesn't work on my edited Vanilla theme : (
I indeed did some bad checks there. I just made some changes and tested against the original Vanilla. Does it help if you replace the frontend file (https://github.com/rbeer/nodebb-plugin-smoothshorts/blob/master/static/lib/smoothshorts_fe.js)?
I'm gonna bump to 0.0.2 some time tonight, when I got the ACP stuff ready to go. Then you could update via npm.
Thanks for your feedback!
Do you get any errors in chrome's console (Ctrl+Shift+J) ?
Oh, and: The link you are trying to copy, is the topic an old one or created after you activated the plugin? Because the hashs are generated and saved in the DB whenever you create a topic or post. Old ones just wouldn't have a hash to build the URL from.
Creating hashs for already existing topics/posts will be part of the ACP/patch tonight.
I have an idea/question for your plugin.
Is it possible to add feature to also change domain name in short url ?
I have two domains,
first - metagamers.ru, it contains the full name of my community and sometimes i would prefer to give a link with full name (for better memorizing).
second - mtgm.ru, it's a shorter name, better for linking topics in skype as example.
0.1.0 is here!
Added ACP page, hashing old topics/posts and different domain for short urls.
As well as the ability to use a modifier key for replacing urls. I highly suggest to use this feature, since the context menu offers more options than just copying links.
Here's a preview of the ACP page:
@rbeer Resurrecting this old thread. What is your plan for versions
0.9.3and greater? I did look at your open Github issues and see two entries relating to versions 0.8.x and 0.9.x. There is no content though in those issue entries.
I'd love to get shortlinks going on my forum and am willing to experiment and test for you.
tried this with 1.1.2, crashes nodebb, getting the error