inherit
121254
0
Jun 1, 2016 7:27:22 GMT -8
atalkingfish
331
March 2008
atalkingfish
|
Post by atalkingfish on Apr 7, 2011 18:44:12 GMT -8
I am using Todge's wonderfully updated spoiler code. I was wondering if it could be modified so that instead of creating a line break before and after the spoiler, if it could just go right with the text. For example: My favorite part of the movie is when . I love that part. ...would turn into... My favorite part of the movie is when Ash catches Pikachu. I love that part. (note: the "Ash catches Pikachu" would be in the color decided by the code, as before) (second note: I know Ash never actually catches Pikachu, and I know that it was never even in a movie) EDIT: To further separate it from the surrounding text, could there also be brackets around whatever title is chosen for it?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Apr 8, 2011 11:23:14 GMT -8
That would require a completely new code.. Do you want spoiler title's name optional, or keep it as ' '?
|
|
inherit
121254
0
Jun 1, 2016 7:27:22 GMT -8
atalkingfish
331
March 2008
atalkingfish
|
Post by atalkingfish on Apr 8, 2011 14:00:27 GMT -8
Could you have it so it'd automatically be , but someone could change it? Kind of like the URL tag. If you clicked the spoiler button, it'd just put tags up, and it'd just say in the post, but members could make it if they wanted to.
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Apr 9, 2011 13:35:01 GMT -8
|
|
inherit
121254
0
Jun 1, 2016 7:27:22 GMT -8
atalkingfish
331
March 2008
atalkingfish
|
Post by atalkingfish on Apr 9, 2011 18:53:59 GMT -8
Unfortunately, my forum uses spoiler codes for (1) hiding paragraphs that could spoil storylines for any reason, (2) images that -would- stretch out the page.
And I feel like that one wouldn't work well for photos (while the first one doesn't work well for text)
|
|
inherit
King Oligochaete
126470
0
Feb 24, 2021 12:23:15 GMT -8
Wormopolis
Stop rating plugins with 1 star that dont deserve it.
20,002
June 2008
tbserialkillers
Wormo's Mini-Profile
|
Post by Wormopolis on Apr 10, 2011 0:24:55 GMT -8
it will actually allow images to appear inthe tangent div that pops up, but if you want to wait for todge to rewrite a new spoiler code, you will have to be patient.
|
|
inherit
121254
0
Jun 1, 2016 7:27:22 GMT -8
atalkingfish
331
March 2008
atalkingfish
|
Post by atalkingfish on Apr 10, 2011 6:48:48 GMT -8
Oh, no worries, I can be patient, I have no problem with that.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Apr 17, 2011 7:56:16 GMT -8
Here ya go, try this in your footer...
<style type="text/css"> <!-- .spoiler { color: black; font-weight: bold; cursor: pointer; } .hidden { display: none; color: blue; } --> </style>
<script type="text/javascript"> <!-- /* Inline Spoiler tags by Todge Copyright © 2011 Please keep this header intact Global or Board Footer */
var spButton = 'http://images.proboards.com/new/shocked.gif';
// Add spoiler button to posting page..
function addspoil() { var bname = prompt("what would you like the spoiler to be called?","Spoiler"); add('[spoiler='+bname+']','[/spoiler]'); return; }
if(document.postForm) { var spb = document.createElement('a'); spb.innerHTML = '<img src="'+spButton+'" border="0">'; spb.href = 'javascript:addspoil()'; document.postForm.color.parentNode.appendChild(spb); }
// Find and create spoilers..
if(pb_action.match(/(display|preview|(modify)?post|search2)/) ) { var posts = document.getElementsByTagName('font'); for(p=0; p<posts.length; p++) { if(posts[p].innerHTML.match(/google_ad_section_start/) || (posts[p].size == '1' && pb_action.match(/preview|(modify)?post/))) { if(document.postForm) { var qPost = document.postForm.message.value; } var spCell = '<font class="spoiler" onclick="this.style.display=\'none\'; this.nextSibling.style.display=\'inline\';">[$1]</font>'; spCell += '<font class="hidden"><font style="cursor: pointer" onclick="this.parentNode.style.display=\'none\';'; spCell += ' this.parentNode.previousSibling.style.display=\'inline\';">*</font>'; posts[p].innerHTML = posts[p].innerHTML.replace(/\[spoiler=((\?|\.|\w|\s|-|\/)+)*\]/g,spCell).replace(/\[\/spoiler\]/g,'</font></font>'); if(document.postForm) { document.postForm.message.value = qPost; } }}} // --> </script>
Be aware though, that it will not work with the previous code.. Only one or the other.
|
|
inherit
121254
0
Jun 1, 2016 7:27:22 GMT -8
atalkingfish
331
March 2008
atalkingfish
|
Post by atalkingfish on Apr 17, 2011 9:14:13 GMT -8
It works. Just a couple things... Instead of just saying spoiler, could it at brackets around whatever title is chosen? So if someone typed in "spoiler", it would show up as . Also, when one clicks on the spoiler text, there is no way to hide the text again, so could you maybe at a * or something to the beginning of the content to make it collapse again? So it would go like... "I love " to "I love *cake" so it could be collapsed again?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Apr 17, 2011 11:02:27 GMT -8
Try the code above now..
|
|
inherit
121254
0
Jun 1, 2016 7:27:22 GMT -8
atalkingfish
331
March 2008
atalkingfish
|
Post by atalkingfish on Apr 17, 2011 12:05:21 GMT -8
I realized that by clicking on any of the spoiler content, it hid itself again. Was that how it was before? (if so, then the asterisk thing shouldn't have been requested, I just didn't realize it)
Also, whether or not that is the case, is there a way to make it so that you can only hide the content again by clicking on the asterisk, as opposed to all the text. My reason for this is this is that this method makes it very difficult to copy/paste text that's inside the spoiler. (if you highlight a group of text inside it, it all goes away)
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Apr 17, 2011 12:14:19 GMT -8
Nope, originally you couldn't re-hide the text once opened, I added that just now as you requested.. I'll change the code so that is only occurs when clicking the asterisk.. Watch this space..
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Apr 17, 2011 12:19:37 GMT -8
OK.. Try the code above now..
|
|
inherit
121254
0
Jun 1, 2016 7:27:22 GMT -8
atalkingfish
331
March 2008
atalkingfish
|
Post by atalkingfish on Apr 17, 2011 15:02:56 GMT -8
It works perfectly. The only awkward thing is that the cursor doesn't change from the standard text hover when hovering over the asterisk (like it does when you hover over the spoiler tag), but that is by no means necessary to make the code work like I want it to.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Apr 17, 2011 16:13:09 GMT -8
Ooops, sorry, I forgot that.. Try the code above now
|
|