View Full Version : Spoiler Blocks Added
Tee See Em
02-08-2009, 03:33 AM
We're using the same sblock tag as Wizards does, rather than spoiler like we used to.
I'm also adding [c] tags for inline whitespace-preserved monosize text.
PariahKing
02-08-2009, 03:34 AM
This is a good idea. I'm just used to sblocking posts now.
Tee See Em
02-08-2009, 03:34 AM
Whoo, I can even have them act like noparse tags. Nifty. This is an example.
Cee Pee
02-08-2009, 06:06 AM
Lorem ipsum dolor sit amet.
Consectetur adipisicing elit.
Whitespace isn't preserved. :/
Tee See Em
02-08-2009, 11:51 AM
Lorem ipsum dolor sit amet.
Consectetur adipisicing elit.
Whitespace isn't preserved. :/Doh. I didn't actually test it, I just assumed that using a <code> tag with bbcode disabled would do that itself.
Oh well, nevermind.
Cee Pee
02-08-2009, 12:04 PM
Doh. I didn't actually test it, I just assumed that using a <code> tag with bbcode disabled would do that itself.
Oh well, nevermind.
You could style the whole thing with white-space: pre-wrap;, though that creates superfluous newlines due to the CSS system being stupid.
Tee See Em
02-08-2009, 12:35 PM
You could style the whole thing with white-space: pre-wrap;, though that creates superfluous newlines due to the CSS system being stupid.No, the problem isn't that, it's that vB is actually stripping extra whitespace out of posts when parsing them, so that whatever HTML I put there isn't going to have it to work with, I think.
This is a test.
This is a test.
This is a test.
Yeah, it makes an exception for stuff inside a [code] tag, but I don't think there's any way to apply that to my own tags without writing a plugin, which I don't feel like doing.
SizzlingStapleCider
02-08-2009, 12:55 PM
:V
Oh wow, I just quoted it and found an easier way to find the centre...
What I was going to say was that was totally worth it, but obviously not anymore...
Cee Pee
02-08-2009, 01:26 PM
No, the problem isn't that, it's that vB is actually stripping extra whitespace out of posts when parsing them, so that whatever HTML I put there isn't going to have it to work with, I think.
Yeah, it makes an exception for stuff inside a [code] tag, but I don't think there's any way to apply that to my own tags without writing a plugin, which I don't feel like doing.
I disagree though. This is my post in the HTML source:
<!-- message -->
<div id="post_message_184">
<code>Lorem ipsum dolor sit amet.<br />
<br />
Consectetur adipisicing elit.</code><br />
<br />
Whitespace isn't preserved. :/
</div>
<!-- / message -->
So technically, it's possible.
Tee See Em
02-08-2009, 02:32 PM
I disagree though. This is my post in the HTML source:
<!-- message -->
<div id="post_message_184">
<code>Lorem ipsum dolor sit amet.<br />
<br />
Consectetur adipisicing elit.</code><br />
<br />
Whitespace isn't preserved. :/
</div>
<!-- / message -->
So technically, it's possible.
Huh. I was pretty sure it wasn't doing that. I was basing it off the fact that when you go to edit or quote a post with excess whitespace, it's not there. Blah. So it'll probably screw up under those circumstances anyway.
But yeah, you're right, I'll go add code { white-space: pre-wrap; } to the css.
Tee See Em
02-08-2009, 02:34 PM
k, done, though unfortunately what I said in my last post does seem correct.
Cee Pee
02-08-2009, 02:37 PM
k, done, though unfortunately what I said in my last post does seem correct.
Well, it's cool anyway.
Tee See Em
02-08-2009, 05:40 PM
Testing.
Generic sblock
sblocked
http://tasteslikespam.com/images/again.jpg
http://tasteslikespam.com/images/again.jpg
Tee See Em
02-08-2009, 05:40 PM
Testing.
Generic sblock
sblocked
http://tasteslikespam.com/images/again.jpg
http://tasteslikespam.com/images/again.jpg
That is so far from the way it's supposed to work.
Tee See Em
02-08-2009, 05:43 PM
The "spoiler" label is being hidden by subsequent presses, isn't it? That makes sense. >_<
♥♥♥♥ that. I'm going to jquery this shit. Need to excuse to use it.
Tee See Em
02-08-2009, 05:43 PM
PK, I'm removing your hearts.
Tee See Em
02-08-2009, 05:44 PM
ffff, ffff, ffffing ffffed ffffed test ffff.
I'll fix the spoilers in a minute, it's diner now.
Cee Pee
02-08-2009, 05:45 PM
I think there is a parentNode too many, making it select only the first one, opening that one fail. That should be removed.
Edit: Well, things changed since I typed. Hmm. Also, add strikethrough. Also, jQuery fails.
The "spoiler" label is being hidden by subsequent presses, isn't it? That makes sense. >_<
♥♥♥♥ that. I'm going to jquery this shit. Need to excuse to use it.
I was about to post this.
Tee See Em
02-08-2009, 07:25 PM
Testing.
Generic sblock
sblocked
http://tasteslikespam.com/images/again.jpg
http://tasteslikespam.com/images/again.jpgThey're working properly now. Some stuff less nice than the old ones, but screw it, I like mine better.
Cee Pee
02-09-2009, 01:57 AM
Oh my, it like wraps open. Eek.
Cee Pee
02-09-2009, 08:59 AM
Problem: As with the spoiler of naga, not only does it lag terribly, it also opens all of them. Kind of defeats its purpose.
Tee See Em
02-09-2009, 10:50 AM
Problem: As with the spoiler of naga, not only does it lag terribly, it also opens all of them. Kind of defeats its purpose.
Woah nesting. That didn't occur to me. Can fix, it'll just take a moment, but that moment will come later.
Problem: As with the spoiler of naga, not only does it lag terribly, it also opens all of them. Kind of defeats its purpose.
Yes. It was for science.
Tee See Em
02-09-2009, 01:15 PM
Woah, I just realized that that dumb juggling thing is in the smilies box at the side. Oops. I didn't mean to do that.
:juggle::juggle::juggle:
I like jQuery, I just haven't had any excuse to use it so far. Here's the code for these spoiler boxes:
<style type="text/css">
.spoiler-loading {
font-style: italic;
}
.alt2.spoiler-item {
border: 1px inset;
margin: 0px;
padding: 6px;
}
.spoiler-loaded, .spoiler-item {
display: none;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
<script type="text/javascript">
// Yay spoilerboxes! MIT license, credit to Jeremy Banks <jeremy@jeremybanks.ca>
$(document).ready(function(){
$(".spoiler-box")
.find(".spoiler-loading").css({"display": "none"})
.end()
.find(".spoiler-loaded").css({"display": "block"});
$(".spoiler-toggle").toggle(function() {
$(this).siblings(".spoiler-item").show("fast");
$(this).get(0).value = "Hide";
}, function() {
$(this).siblings(".spoiler-item").hide("fast");
$(this).get(0).value = "Show";
});
});
</script>
vBulletin® v3.7.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.