2023-08-22, 11:05 AM
Trying to create spoiler option in posts by old good recipe.
regexp:
replacement:
It works pretty well in the testbox of visual MyCode editor on admin CP but doesn't work in real posts. The text into the spoiler tag just invisible and nothing shows like the post is absolutely empty. Maybe anyone tryied this and knows how to adjust it?
Or maybe there are some other ways to put spoiler option in the latest version of myBB.
regexp:
\[spoiler\](.*?)\[/spoiler\]
replacement:
<div style="padding: 3px; background-color: #FFFFFF; border: 1px solid #d8d8d8; font-size: 1em; width: 100%;" ><div style="text-transform: uppercase; border-bottom: 1px solid #CCCCCC; margin-bottom: 3px; font-size: 0.8em; font-weight: bold; display: block;"><span onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerHTML = '<b>Spoiler </b><a href=\'#\' onClick=\'return false;\'>Hide</a>'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerHTML = '<b>Spoiler </b><a href=\'#\' onClick=\'return false;\'>Show</a>'; }" /><b>Spoiler </b><a href="#" onClick="return false;">Show</a></span> </div><div class="quotecontent"><div style="display: none;">$1</div></div></div>
It works pretty well in the testbox of visual MyCode editor on admin CP but doesn't work in real posts. The text into the spoiler tag just invisible and nothing shows like the post is absolutely empty. Maybe anyone tryied this and knows how to adjust it?
Or maybe there are some other ways to put spoiler option in the latest version of myBB.