a month later

Version 1.2

  • Now only external links are targeted which makes more sense (IMO).
  • Conflicts with my Pop Up BBCode and SM2 Audio extension fixed.
  • Any external link in your forum will now have the class "External-link" added. This is to make point number one work, but also you now have a way to target external links with CSS/LESS should you want to make external links look different.
To update:

composer update zerosonesfun/link-decisions

See original post for instructions on how to customize (which includes using another language).

    Littlegolden I'll be very honest. It's not likely that will happen any time soon.

    Short story: See this post.

    Long story: I don't have a proper developer environment at this time. So, I can only code online via a basic text editor (very old-school). I was able to do this latest update because of the fact that all I needed to do was add some extra JavaScript; which can be done online right in GitHub. But, anything more complex (such as the transpilation required to make extensions more Flarumized) requires a better set up than what I've got. Although, I did it once using tools in the cloud provided by Google - still it wasn't the best set up.

    • FBI likes this.

    Would be cool if you made a feature that allowed admins or users to chose whether the want the link to be opened in a new page by default or ask every time.

    010101 it's not working and just refreshing the page when i click the link (tested on localhost).

    Edit: it was looking for the resources at the base URL rather than Flarum forum itself so i fixed it and still not working. No errors, no nothing.

      Kylo Yeah, that’s true. I made this for my forum originally and my forum is installed at the main domain level. As in at myforum.com.

      But if you updated that and the URLs are now pointing to the resources correctly then it sounds like a caching issue?

      • Kylo replied to this.

        Kylo Oh, if you’ve completely redone the extension then I definitely can’t help. It could be the way the JavaScript is being loaded in your version of the extension.

        Unless you’re saying that your version does work. Then that’s cool. If it works and folks would rather use your version then yes, this thread can be marked as dev. Then you may start a new thread tagged extension; that’s cool with me. I’m happy to turn the keys over to you so to speak. 😎

        However, my version isn’t broken and works. Folks may see it working here:
        https://www.sitbreathe.be/d/15-audio-heart-lotus-by-shindhu

          010101 i have no intention like STEALING your extension so be cool, i fixed it added locale support and created a pull request on GitHub because THIS IS THE WAY HOW OPEN SOURCE WORKS. So merge it or not, it's completely up to you, i'm okay with my own version.

            Kylo You should probably release your fork as separate extension, since it fixes some fundamental issues with upstream version. This is also the way how open source works. 🙂

            010101 However, my version isn’t broken and works. Folks may see it working here:
            https://www.sitbreathe.be/d/15-audio-heart-lotus-by-shindhu

            Well, it does no work for me on Firefox - it always opens links in current tab.

              rob006 sorry, that's not gonna happen. I won't support my fork anyways.

              Kylo 🙂I know how open source works. But, I wouldn’t be able to maintain your version. So if it’s better, your version should become “the” version. I was being sincere. You should take over if that version works better. But, if you don’t want to, that’s cool too. I’ll test your version later and make it the “official” version if it works ok. But again, I won’t be able to update or do much with it.

              rob006 Well, it does no work for me on Firefox - it always opens links in current tab.

              Are you sure? I don’t have a PC so I can’t test a windows version of Firefox, but I just tested with Firefox for iPhone and it works great. Green button opens site in a new tab/window.

              Also, I don’t think the new version Kylo made would fix that unless the JavaScript was completely rewritten? I could be wrong though.

              • Kylo replied to this.

                010101 i just fixed the calls, didn't touch the function.

                  Kylo Thanks! So if anyone wants to confirm if it works in Firefox or not let me know. That part is pretty basic. The green button adds target _blank to the link, the small text above the buttons uses _self as the target. In Chrome, Safari, and Firefox iOS it is working. That would be a real head scratcher if it didn’t work in some other recent version of Firefox. But, I know it’s possible. There could be even just one version of Firefox that doesn’t like it.

                  LOL - weird. Version 2.0 worked when I first tested, now it's not working for me. JavaScript probably isn't being loaded in a way Sweet Alerts likes or something. Hmm.

                  Troubleshooting done so far:

                  • The class "External-link" is being added to external links which is a good sign. That part of the JavaScript is working... just not the sweet alert.

                  It may be some kind of race condition. Now it is working for me on Firefox, but not on Chrome. 😃

                  Tested on most recent versions of Firefox & Chrome with success.

                    Kylo

                    I reverted back to the previous version. Instantly it works at my forum. I'm going to stick with that version since my forum seems to like it better for some reason.

                    @jordanjay29 I think this can stay marked as an "extension." In the end, it shouldn't matter how an extension is done, as long as it works for many people, and doesn't have a huge security issue. In the replies above there was talk about maybe marking this as "dev" instead of as an "extension," because the current version wasn't done in the "Flarum way." And so there aren't things like translation support. But, with other CMS extensions/plugins, not all have translation support (thinking about WordPress as one example).

                    I've tested this on a laptop and on my iPhone in three different browsers and it works. Will it not work in some browsers? Maybe. Will it work for every single Flarum installation scenario? Maybe not, I'm actually not sure. But, so far, with a standard installation, it works for me.