[nodebb-plugin-smoothshorts] Short URLs built in...
-
.. well, almost. It's a plugin, after all.
npm install nodebb-plugin-smoothshorts
Features
(README.md)
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 formhttps://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
mousedown
event. 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!)Changelog
0.1.0
- Added ACP page.
- Settings
- Create missing hashs topics/posts.
- Added modifier key (ctrl, alt or shift) to replace urls.
- Added ability to change domain for short urls.
(https://prettylongdomain.org/topic/2/slug/ -> https://short.org/ss/hash)
- Added ACP page.
-
@leksar said:
Doesn't work on my edited Vanilla theme : (
Ouch.
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.So i want people who comes to metagamers.ru to get the short link with mtgm.ru as domain.
-
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.3
and 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.
Thank you.
-
anyone got this working with v1.0.4?
-
@chrismccoy @rbeer has been doing a TREMENDOUS job updating his plugin. I am still running
v1.0.2
so cannot attest to how it behaves inv1.0.4
but if you care to check out his git repository and install his current master. Totally amazing work. -
tried this with 1.1.2, crashes nodebb, getting the error
crash on startup ยท Issue #19 ยท rbeer/nodebb-plugin-smoothshorts
TypeError: Cannot read property 'useDomain' of null at upgrade (/home/saas/nodebb/node_modules/nodebb-plugin-smoothshorts/lib/settings.js:47:13) at /home/saas/nodebb/node_modules/nodebb-plugin-smoothshorts/lib/settings.js:33:5 at handleC...
GitHub (github.com)
-
Unfortunately I don't think @rbeer has been around awhile. This might need to be forked to our community repository to keep it alive, sadly