Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Spoiler button?

Is there supposed to be one? I see it in the code but it's not showing up. Can I enable it somehow?

«13

Comments

  • what the heck is a spoiler button. I've seen it mentioned. i have no idea what it is though.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • It marks text as a spoiler, so you have to click on it to reveal the contents.

  • I can tell you how to make the spoiler visible in the buttonbar. But it was obviously disabled purposefully. Perhaps because it didn't function.

    I haven't checked how to make it functional.

    plugins/ButtonBar/js/buttonbar.js
    
    
    //comment out the lines with
    ButtonBar.DisableButton(ButtonBarObj, 'spoiler');
    
    
    
    or to make it appear
    change your config to 
    $Configuration['Garden']['InputFormatter'] = 'bbcode';
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Peregrine, "Spoiler button" is really usefull.

    Examples :

    Thread about Series or last Movie in Cinemas. U can talk into "Spoilers" and anyone see the coments about the movie, serie ect. Only when you open the "spoiler".

    Other use is in threads with so much Videos, from youtube, Vimeo, ect... So much People with "low Cpu" or Old Cpu, have so much problems for loads this threads. So u can use Spoiler for "Hide" this videos and only when you open the spoiler u CPU load this in memory. With this u can stop some problems from memory Leaks or overcharge rams memorys.

    PD: Turn ON Spoilers in this forum comunity is really GOOD idea cause we have so much CODE TEXTS, we can hide this code in spoilers and is win in space, cleary threads and we can have more pages for really usefull info. When for example u post 1 code so much long, we lost some space in "Screen" and when this code is hide, we can win in space.

    Once more sorry for my poor english, some good guy can try to explain my text more great :=)))

  • Right, I obviously want it functional. =)

    I already have the Spoilers plugin which marks text as a spoiler when surrounded by [spoiler][/spoiler]. Right now in Button Bar, the code for the spoiler button is:

    case 'spoiler':
    $(TextArea).insertRoundTag('div',htmlOpts,{'class':'Spoiler'});
    break;
    

    But I'm not sure how to convert that to use the [ ] tags.

  • hgtonighthgtonight ∞ · New Moderator

    @Celeste What version of vanilla are you running?

    I am running 2.0.18 with button bar and spoiler addons working together in tandem.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight 2.0.18.8. Nothing happens when I click the spoiler button.

  • It must have something to do with the content type. So Celeste has set it to 'BBCode' and hgtonight has set it to 'MarkDown'. I forgot the conf/config.php setting, but someone will most likely come up with it.
    As soon as you click the 'spoiler' button, check the FireFox FireBug or in Chrome there's a similar tool. You'll see what the response is and post that here.

    There was an error rendering this rich post.

  • Is mine set to BBCode? All the other buttons use < > which I thought was HTML? (Forgive my ignorance.)

    Here's what I get when I click the button:

    Uncaught ReferenceError: spoiler is not defined

  • if you look at the buttonbar

    right above Back to discussions

    you will see

    You can use BBCode in your post.

    or

    You can use Markdown in your post.

    or

    You can use Html in your post.

    for it to work with the spoiler plugin currently you need to use

    $Configuration['Garden']['InputFormatter'] = 'BBCode';

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight ∞ · New Moderator

    We use bbcode.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @peregrine OK yeah, it's set to HTML currently. Where in the config do I put that — just anywhere? Or am I replacing an existing line with that?

  • replace existing line. but it will be now using bbcode formatting.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • What line, though? I can't find any other reference to InputFormatter.

  • If I just add it, nothing changes — it still says "You can use Simple HTML in your post".

  • peregrineperegrine MVP
    edited April 2013

    @Celeste

    here is a fix for html

    just replace the code for buttonbar.js

    download the attached zip
    unzip it and replace the
    plugins/ButtonBar/js/buttonbar.js

    with the new version.

    the replacement buttonbar.js does work with Html

    use the replacement buttonbar.js and this
    $Configuration['Garden']['InputFormatter'] = 'Html';

    use the original buttonbar.js and this
    $Configuration['Garden']['InputFormatter'] = 'BBCode';

    I posted my mod on github #1581

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Oooh, I just saw in another thread that changing InputFormatter to BBCode doesn't change on existing posts. I made a new post and it seems to work now with BBCode, the spoiler button, & the Spoilers plugin. Thanks so much!

  • @Celeste said:
    I made a new post and it seems to work now with BBCode

    Ok, celeste, this one is gonna be fun.
    Look in the address bar. You can see the number of the discussion the BBCode is working in, right? Let's call it number 12345 just to be easy.

    I hope you know how to get to your phpMyAdmin.

    There is a way to set all your discussiontopics to the same type, so the BBCode will work for all your topics (that's what you want, right?)

    Go to your phpMyAdmin and open the 'Discussions' table.
    Search for your Discussion, number 12345.
    Look in the column 'Format' and write down that format type. I think it's BBCode, but not 99% sure.
    Now, browse all your discussions. Look at the Format column again. It says Html, right?

    Here comes the update statement you can execute:

    UPDATE Discussions SET Format='BBCode' WHERE Format = 'Html'

    I think your Discussions table has a prefix, but if you go to the SQL 'tab' of phpMyAdmin in your Discussions table, it will be pre-set for you.

    backup first
    Let us know how it went, ok.

    There was an error rendering this rich post.

  • CelesteCeleste New
    edited April 2013

    All future discussions will be set with BBCode now, though, right (without updating the database, I mean)? Our forum isn't actually live yet so my test posts which still show HTML are going to be deleted anyway. This could be very handy for the future, though, so thanks!

  • peregrineperegrine MVP
    edited April 2013

    the above zip I posted will allow you to use html without going through all the gyrations of changing to BBCode.

    and change your config to

    $Configuration['Garden']['InputFormatter'] = 'Html';

    it will use html code tags for everything (except for the case of spoilers it will use bbcode) which will be automatically changed by the spoiler plugin anyway. All you have to is install new js file.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.