[nodebb-plugin-smoothshorts] Short URLs built in...


  • GNU/Linux

    .. well, almost. It's a plugin, after all. :grinning:

    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:
    onTopic.png

    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:
    resolving.png

    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



  • Doesn't work on my edited Vanilla theme : (


  • GNU/Linux

    @leksar said:

    Doesn't work on my edited Vanilla theme : (

    Ouch. :frowning:

    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! :+1:



  • Same result here (Chrome 43.0.2357.130 m). Will wait for update to reinstall theme, maybe i'm doing something wrong :confused:


  • GNU/Linux

    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.



  • Ah. That's the point. I've tried to get hash from old topics. With new topics it works well, thank you.


  • GNU/Linux

    @leksar said:

    Ah. That's the point. I've tried to get hash from old topics. With new topics it works well, thank you.

    Yay! :clap: :relaxed:

    Nevertheless, your post enabled me to fix some things; Vanilla actually wasn't working before. Thanks again. :)



  • 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.


  • GNU/Linux

    Indeed a very good idea.
    Messenger got the best of me again, though. I fell a little bit behind, but this is noted for 0.0.3 then. :+1:

    I'm taking any suggestions/ideas/bugs also on GitHub. I would actually prefer it. :)


  • GNU/Linux

    0.1.0 is here! :eyes:

    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:
    acp-0.1.0.png



  • @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 in v1.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

    https://github.com/rbeer/nodebb-plugin-smoothshorts/issues/19


  • Admin

    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 :(


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.