Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Hidden Text 2

135

Comments

    • Message to Krak ->    Cool dudeNow I'll put the big stick away!Thanks
  • Thanks Krak!
  • Hi, just updated this and have a few problems - first of all none of the hidden text is actually hidden any more, but it still toggles when you click the (hide) button. Also, is there anyway to get more than one piece of hidden text per page/post please? I've got some text I use myself to do hidden text etc but I've no idea how to implement it into Vanilla :(
  • Bump, please - I'd really, really like to get this resolved if possible since it's ridiculously useful for our forum :-)
  • Upgraded from a previous version? Make sure the settings are correct (enabled) for the user role, and that it is enabled in your user settings. If thats all good, I'd try erasing the lines it adds in the /conf/settings.php file.

    $Configuration['HIDDEN_TEXT_MARKER'] = '(Hidden)'; $Configuration['HIDDEN_TEXT_SETUP'] = '1';
    I don't recall the changes I made from one version to the other, make sure the .js files were uploaded overwriting the old ones. As far as more than one hidden text per message, nope, not with this version. This would require an entirely new/different piece of JS, and I am not that great with JS.

    What do you mean by "'Ive got some text I use myself to do hidden text etc but I've no idea how to implement it into Vanilla." ?
  • A lot of people ask for multiple hidden texts per message. This script is fairly simple.

    function handleParent(parentId) { myParent = document.getElementById(parentId) if (myParent.style.display=='block') { myParent.style.display='none' } else { myParent.style.display='block' } }
    Thats the code that does the hidding. It simply changes the CSS display tag from block to none. So its always there (viewable from the source) it just changes its CSS display. The script grabs the posts row number and adds it to the hidden text code. The hidden text code has to have a number associated with it to distinguish one hidden text field from the other. If they were all the same, when you click "show hidden text" all the hidden text on the entire page would show, or hide. Giving it a number tells it to show/hide #3 or #6, etc. The number I use is already there, created by Vanilla for that particular post.

    To make multiple hidden texts per message you would have to append another number, or letter to that. So you would have to make the hidden texts for one message something like "hidden text 1a" and "hidden text 1b" or 1.1, 1.2, etc.. I have no idea how to do this. You would have to make it add the extra letter/number to the current one, and make sure you were not creating one with a number/letter combo already in use on the page or you would end up showing/hiding more than one set per message.

    I simply dont know how to do it, but I am sure it can be done.

    There are other ways to show/hide text as was discussed in the discussion before I made this, but I either, did not like the way it worked (too messy), I was unable to get it to work, or I was unable to use it because of the code needing a specific number attached.

    I get this request constantly, which I would love to have honestly. I just can't do it. Maybe this will help explain everything.
  • Many thanks for the reply - I've got it working again now and it's a great script :-) Like I said, incredibly useful and I appreciate you going through how it works - I'll at least have a look at doing multiple cases per post but I'm really not very good myself, my coding abilities are far below yours for sure! Would it be an idea to... I don't know, instead of going from the post number, have a loop that goes from 1 -> 100 (or whatever) and as soon as it can't find an element on that page with a number it'll return that particular number, or something? :(
  • Ive thought about a few things, I am just not sure how to implement them. One of my ideas was to use a random string. It doesn't matter what is used, just as long as it is attached to the hidden blurb and the link to show/hide that blurb. A random string would work perfectly I'm sure, what are the chances that it would duplicate on one page?

    Every once in a while I dig out the extension and fiddle with it to see if I can get it. Just waiting till one day I do, or someone comes along and points me in the right direction. I'm just horrible with JS.

    Glad you like it though!
  • Great news guys! I made Hidden Text 2!!

    Drum roll please..... now with multiple hidden elements! You can have as many hidden text blurbs as you want! I spent all day figuring it out. Thanks to Mootools what everyone has been asking for is here. I just have a few minor things to iron out and I will upload it. It has not been thoroughly tested, but most of the code is actually the same, I just substituted the current JS with Mootools and we are good to go. So I don't think there should be many bugs, except for all the ones that come along with Mootools.
  • w00t! Nice one, cheers Krak :-) Any idea when it'll be released?
  • I would imagine either today or this weekend. Just need to iron out one or two things. Mostly I am still trying to get it to work with the Mootools addon. For some reason I can't. Works just fine without it. And there is a little annoying issue with the fact that it adds <br />s after each hidden blurb. Works, just annoys me, and I haven't figured out how to get rid of em yet.
  • Uploaded version 2.0 of Hidden Text.
  • Here it is Hidden Text 2.0! Now you CAN have as many hidden blurbs within a single post as you want (well, in theory, I have only actually tested up to 5 but I don't see why you couldn't have 210). Thanks to Mootools this is now possible. All of the JS has changed, the code is 98% unchanged so I would not think there to be too many bugs. Also, currently the extension will load its own copy of mootools 1.11 (not a full set - file size @ 30kb). I am having issues getting it to work with the Mootools extension.

    Limitations: none that I currently know of other than the issues that affect the other Mootools addons (incompatibility with Mootools).

    Right now there are two links, unlike version 1. I plan to make the show/hide a toggle like before, I am just having issues figuring it out. Soon as I get it I'll repost (no estimated time frame on that).

    INSTALLATION: If you have NOT had any previous version installed, nothing special is required. If you HAVE had a previous version installed you must delete a few lines in /conf/settings.php. Delete:
    $Configuration['HIDDEN_TEXT_MARKER'] = '(Hidden)'; $Configuration['HIDDEN_TEXT_SETUP'] = '1';
    Then activate version 2.0, hit refresh, and everything "should" be OK. Let me know how it works out.
  • Wahey! Cheers Krak, going to install this as soon as I get home :)
  • Uploaded version 2.1 of Hidden Text 2.
  • The change from version 2.0 to 2.1 is minor. If you don't want to redownload the entire file you can manually update your default.php. Change the version from 2.0 to 2.1, comment (or delete) out lines 177-179 (old school method). And uncomment lines 183-189 (new school method). So lines 175-191 should now look like this.

    // Old school way of adding Stylesheet and JavaScript to Head Control #$Head->AddStyleSheet("extensions/HiddenText/style.css"); #$Head->AddScript('extensions/HiddenText/moo-hide.js'); #$Head->AddScript('extensions/HiddenText/hide.js'); // New school way to add stuff (for mootools) if(!function_exists('MT_AddComponent')) { $Head->AddScript('extensions/HiddenText/moo-hide.js'); } else { MT_AddComponent('Fx.Slide', 'Window.DomReady', 'Element.Selectors'); } $Head->AddStyleSheet("extensions/HiddenText/style.css"); $Head->AddScript('extensions/HiddenText/hide.js');
  • Notice: Apparently HT2 breaks when enabled along side of "Notify". No idea why, or how to fix it at the moment.
  • Works an absolute treat now, thank you so much Krak! Just curious what is HT2 though? Also, the 'hidden text' button doesn't actually do anything now, unless I've done something wrong. Cheers!
  • HT2 - Hidden Text 2, didn't feel like typing it all out ;)

    Hidden Text button, hmm, which/where? I could have forgotten/missed it.
Sign In or Register to comment.