• @nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:

    A new version of the package nodebb-plugin-ns-spoiler (5.0.1) is available.

    Plugin updated to work with the latest changes (NodeBB 1.8.x). Also, the plugin should work better with a more complex post structure (multi-list, etc.)

    @Sam-Nguyen images should work well in v5.

    Thank you for this update, everything works fine at 1.9.0 🙂

  • Gamers

    @nicolas thank you very much for making it compatible with the latest releases


  • @nicolas said in [nodebb-plugin-ns-spoiler] NS Spoiler:

    A new version of the package nodebb-plugin-ns-spoiler (5.0.1) is available.
    @Sam-Nguyen images should work well in v5.

    Hi @nicolas There is still 4.1.0 in my ACP. I installed NodeBB v1.9.3 a week ago.

    0_1529892010787_Screenshot from 2018-06-25 11-59-47.png

  • GNU/Linux Gamers

    This post is deleted!
  • GNU/Linux Gamers

    @bulldozer I managed to get the latest version by deleting it from my admin panel and installing it manually with npm on shell.

  • Plugin & Theme Dev

    Version 6.0.0

    Summary: no new features, compatibility update only.

    • Changed compatibility to work with NodeBB 1.11.x
  • Plugin & Theme Dev

    Version 7.0.0

    Summary: no new features, compatibility update only.

    • Changed compatibility to work with NodeBB 1.12.x

  • @Nicolas Hello!, im trying install plugin at 1.12.2 and not work

    when i press button, i lost focus on textbox and not writer ::: and.. when i create manual, spoiler button not work

    T_T its a bug on 1.12.2?


  • @Nicolas Is this working with 1.13.1?


  • This plugin isn't working anymore on my forum since a couple of months.

    I'm on version 8.0.0 of the plugin, Nodebb version 1.19.1

    The problem is that the spoilered text isn't loading when pressing on the spoiler header.

    When turning on the JavaScript debugger, I get an

    Error has occurred, error: [[error:no-privileges]]

    in spoiler.js:50.

    The relevant JavaScript function that triggers the error is this one:

        function toggle($button) {
            var $spoiler = $button.parents(elements.MAIN),
                $content = $spoiler.find(elements.CONTENT),
                open     = $spoiler.attr('data-open') === 'true',
                postId   = parseInt($spoiler.attr('data-pid')),
                index    = parseInt($spoiler.attr('data-index')),
                icon     = $button.find('i');
    
            $spoiler.attr('data-open', !open);
    
            if (!open) {
                icon.removeClass(classes.OPEN_EYE).addClass(classes.CLOSE_EYE);
            } else {
                icon.removeClass(classes.CLOSE_EYE).addClass(classes.OPEN_EYE);
            }
    
            // Check if content is empty
            if ($content.html().length === 0) {
                socket.emit(
                    'plugins.ns-spoiler.getSpoilerContent',
                    {index: index, postId: postId},
                    function (error, content) {
                        if (error) {
                            return console.error('Error has occurred, error: %s', error.message);
                        }
                        $content.html(content);
                    }
                );
            }
    
        }
    

    The socket.emit call always yields the "no privilege" error.

    Any ideas?


  • Is there really no way to get a working spoiler plugin for the current version of NodeBB? All alternatives seem to be even more outdated than this one.


  • @Klaus6 said in [nodebb-plugin-ns-spoiler] NS Spoiler:

    Is there really no way to get a working spoiler plugin for the current version of NodeBB? All alternatives seem to be even more outdated than this one.

    Do you think you can switch to this one?

    https://github.com/prosas82/nodebb-plugin-btn-spoilers#readme

    this one works with 1.19.1 , I can confirm.


  • Thanks for the suggestion @crazycells ! That plugin works indeed (I used this version which seems to be more up to date). The only problem my users have with that plugin is that the spoiler content is displayed in the post preview. Any suggestions on how to block spoiler content in post previews?


  • @Klaus6 where exactly in the post previews? Do you mean when you hover the mouse over a post link? Because in this case I still see the spoiler. Do you mean in /categories page?


  • @crazycells On the main page with the listing of the posts, there is a preview that reveals the spoiler content.

    For instance, I put a spoiler with the text "Spoiler content" into a post, and on the post listing page the text is revealed.

    ad6c416e-4662-40fd-9028-85a33154c80d-image.png


  • @Klaus6 said in [nodebb-plugin-ns-spoiler] NS Spoiler:

    @crazycells On the main page with the listing of the posts, there is a preview that reveals the spoiler content.

    For instance, I put a spoiler with the text "Spoiler content" into a post, and on the post listing page the text is revealed.

    ad6c416e-4662-40fd-9028-85a33154c80d-image.png

    Yes, you are right. I do not know the exact reason, but probably it is plugin related. I believe markdown is working on the last post previews because some of the other text functions work; so I assume the plugin is not made to apply there...

    This is not a direct solution, but in our case, this shows differently because we customized our last posts to show the title first... It makes more sense from our perspective that the title is shown in the last post. Therefore "spoiler" does not have enough lines to reveal the content. In case you think you can use this, here is how to achieve this:

    Screen Shot 2022-02-12 at 11.03.03 AM.png

    To change the last post previews in categories page, use customize plugin to edit this file:

    partials/categories/lastpost.tpl

    change line 12-14
    from:

    		<div class="post-content">
    			{../content}
    		</div>
    

    to:

    		<div class="post-content">
    				<div class="title">
    			        <a href="{config.relative_path}/topic/{../topic.slug}<!-- IF ../index -->/{../index}<!-- ENDIF ../index -->">{../topic.title}</a>
    			    </div>
    			        {../content}
    		</div>
    

  • Thanks a ton, that looks interesting.

    I wonder, though: Shouldn't it be possible to just strip the spoiler content in the preview? That is, filter the content and remove the spoiler content for the preview? I don't know how NodeBB is programmed - maybe the template language supports some kind of transformation/filtering?


Suggested Topics

| |