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.

Where is the spoiler button?

RajioRajio
edited September 2014 in Vanilla 2.0 - 2.8

I'm running Beta 2 of Vanilla, and my forum is using HTML formatting. I have buttonbar and the spoilers addons enabled but i'm not seeing a spoiler button on my button bar when i go to leave a comment. any suggestions? I'm sure im missing something obvious here.

«1

Comments

  • it is disabled in buttonbar.. you can make the button appear by commmenting out lines in buttonbar.js that say ButtonBar.DisableButton that refer to spoiler.

    and the spoiler plugin is out of date. then your next step is to fix spoiler plugin itself

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

  • haha sounds like i should just avoid this mess alltogether for now.

    thanks peregrine. again. ill try what you suggeste to see if i can get it working to my liking.

  • peregrineperegrine MVP
    edited April 2014

    what you can do if you use Html as your main formatting, and bbcode just for the spoiler part.

    it is kind of a kluge.

    change

    PerformHtml: function(TextArea, Operation) {
             var htmlOpts = {
                opener: '<',
                closer: '>'
             }
    

    to

    PerformHtml: function(TextArea, Operation) {
             var htmlOpts = {
                opener: '<',
                closer: '>'
             }
    
              bbcodeOpts = {
                opener: '[',
                closer: ']'
             }
    

    change

    look for case 'spoiler':  in two places and change it to this.
    
     case 'spoiler':
                     $(TextArea).insertRoundTag('spoiler',bbcodeOpts);
                   break;
    
    
    and change
    
        ButtonBar.DisableButton(ButtonBarObj, 'spoiler');
    
    
    to
    

    // ButtonBar.DisableButton(ButtonBarObj, 'spoiler');

    in a couple places.
    

    then you will have a ? option in your buttonbar that you click on.
    it will insert

    and

    tags around your selected text. and you will have show and hide spoiler.

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

  • peregrineperegrine MVP
    edited April 2014

    although the same basic problem was here

    https://github.com/vanillaforums/Garden/issues/1581 which was closed :)

    you can look at this http://vanillaforums.org/discussion/comment/181005/#Comment_181005
    for an attached zip - BUT DON"T use the js in the zip, since the js has probably been updated with other changes. But it does show the updates I made above in its context. If you can understand all that.

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

  • peregrineperegrine MVP
    edited April 2014

    here is an example how to add pullquote addon to your buttonbar.

    same basic idea as doing the quotes.

    http://vanillaforums.org/discussion/25726/to-add-this-to-you-buttonbar

    and you can do the same thing for anything you want that put [] tags around a word - like premhide plugin.

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

  • @Rajio, did you succeed?

    Just took a short look, that plugin is in the Vanilla github repo and the JS has last been updated 10 months ago.

    Any idea if that one is working with 2.1 with buttonbar + Markdown + Emotify?

    Seems the list of things I want to check once I finally have some time left is getting longer by the day...

  • peregrineperegrine MVP
    edited June 2014

    Any idea if that one is working with 2.1 with buttonbar + Markdown + Emotify?

    C'mon, well, does it.

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

  • Will report back once I've tried it.

  • MasterOneMasterOne ✭✭
    edited June 2014

    It's working! :)

    The Spoiler plugin from github is v1.2 and is working as intended on Vanilla 2.1. See it in my test installation

    >>> here <<<

    To make the Spoiler button show up in ButtonBar with Markdown, the following patch as instructed by @hgtonight‌ is needed:

    --- plugins/ButtonBar/js/buttonbar.js.orig  2014-03-15 22:40:08.000000000 +0100
    +++ plugins/ButtonBar/js/buttonbar.js   2014-06-20 01:24:59.920666940 +0200
    @@ -329,7 +329,7 @@
    
           PrepareMarkdown: function(ButtonBarObj, TextArea) {
              ButtonBar.DisableButton(ButtonBarObj, 'underline');
    -         ButtonBar.DisableButton(ButtonBarObj, 'spoiler');
    +//         ButtonBar.DisableButton(ButtonBarObj, 'spoiler');
    
              var HelpText = gdn.definition('ButtonBarMarkdownHelpText', 'ButtonBar.MarkdownHelp');
              $("<div></div>")
    @@ -625,8 +625,7 @@
                    break;
    
                 case 'spoiler':
    -               // DISABLED
    -               return;
    +               $(TextArea).insertRoundTag('spoiler',{opener: '[', closer: ']'});
                    break;
    
                 case 'url':
    
  • peregrineperegrine MVP
    edited June 2014

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

  • @MasterOne said:
    It's working! :)

    I wish I could say the same. I manipulated the .js and ended up with a row of 'B's in place of usable buttons. It's my own fault, no doubt about that.

  • peregrineperegrine MVP
    edited September 2014

    with a row of 'B's

    if you get a row of B's, it means you introduces a js error.

    check you console. and post the error and the code changes you made with error line number.

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

  • peregrineperegrine MVP
    edited September 2014

    should look like this:

    around line 330

      PrepareMarkdown: function(ButtonBarObj, TextArea) {
             ButtonBar.DisableButton(ButtonBarObj, 'underline');
          //   ButtonBar.DisableButton(ButtonBarObj, 'spoiler');
    

    around line 627

      case 'spoiler':
            $(TextArea).insertRoundTag('spoiler',{opener: '[', closer: ']'});
            // DISABLED
             //  return;
               break;
    

    and make sure you are using spoilers plugin from github. ver 1.2

    https://github.com/vanilla/addons

    the spoilers plugin is another add-on that needs to be updated in the add-ons section -since the add-ons currently is http://vanillaforums.org/addon/577/spoilers version 0.1.1

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

  • Indeed, right now it's always best to check the github repo first.

  • I copied the code from spoilers.css and spoilers.js and the correct version number appears in my list of Plugins in the Dashboard.

    I also modified buttonbar.js to reflect the changes @peregrine‌ posted.


    Unfortunately, the text box still lacks the spoiler button.

    Please let me know if there's anything else I can offer in the way of information.

    Thank you.

  • peregrineperegrine MVP
    edited October 2014

    you are using simple html

    the suggestion you asked about was related to "Markdown" not simple html.

    or change your formatter to MarkDown

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

  • peregrineperegrine MVP
    edited October 2014

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

    for markdown see: http://vanillaforums.org/discussion/comment/216467/#Comment_216467

    @davidaprice


    for html as well to make the button appear
    $Configuration['Garden']['InputFormatter'] = 'Html';

    line 321 needs to be commented out.

           PrepareHtml: function(ButtonBarObj, TextArea) {
               //  ButtonBar.DisableButton(ButtonBarObj, 'spoiler');
    

    lines 516-518

        case 'spoiler':
                    $(TextArea).insertRoundTag('spoiler',{opener: '[', closer: ']'});
                   break;
    

    or see: where I originally mentioned another way to do it.
    http://vanillaforums.org/discussion/comment/204741/#Comment_204741

    and make sure you are using spoilers plugin from github. ver 1.2

    https://github.com/vanilla/addons

    the spoilers plugin is another add-on that needs to be updated in the add-ons section -since the add-ons currently is http://vanillaforums.org/addon/577/spoilers version 0.1.1

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

    you are using simple html

    the suggestion you asked about was related to "Markdown" not simple html.

    or change your formatter to MarkDown

    Ah. Showing that I'm completely out of my element.

    I thought I was simply running with the defaults and that's what Markdown was. That makes sense now.

  • hello. i am looking to find out how to add a spoiler tag button to my forums. it can be with or without button bar.

    i read all this but am still very confused. is there a simple way to do this?

Sign In or Register to comment.