Combattente
03-11-2010, 11:45 AM
I have this spoiler modification:
<div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px"> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName(' div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"> <b>Spoiler</b> </div> <div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"> <div style="display: none;">{param}</div> </div> </div>
I would like to know how to:
- Add a button in the post page which adds the tags
- Change the name of the button to {option} IF an option was provided (for example, instead of the button name "Spoiler" there would be text here inside the button if the spoiler was [spoiler="text here"]spoiler text) and the button would just say "Spoiler" if no option is provided, for example spoiler text).
Is that possible WITH MY CODE?
<div style="margin:20px; margin-top:5px"> <div class="smallfont" style="margin-bottom:2px"> <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName(' div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"> <b>Spoiler</b> </div> <div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"> <div style="display: none;">{param}</div> </div> </div>
I would like to know how to:
- Add a button in the post page which adds the tags
- Change the name of the button to {option} IF an option was provided (for example, instead of the button name "Spoiler" there would be text here inside the button if the spoiler was [spoiler="text here"]spoiler text) and the button would just say "Spoiler" if no option is provided, for example spoiler text).
Is that possible WITH MY CODE?