Author |
Topic: the [hideb] tag (Read 5198 times) |
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
the [hideb] tag
« on: Jun 18th, 2005, 12:29pm » |
Quote Modify
|
I got an idea. The hide block says "Hidden:". It would be nice if you could specify the label to appear, to make it "Hint:", "Spoiler:", "Solution:", "Explanations:" or whatever. We could have: [hideb label=Hint] yabada [/hideb] That would appear as: Hint: #################### ####################
|
|
IP Logged |
|
|
|
rmsgrey
Uberpuzzler
Gender:
Posts: 2873
|
|
Re: the [hideb] tag
« Reply #1 on: Jun 19th, 2005, 10:04am » |
Quote Modify
|
Wouldthis be more appropriate to the Suggestions, Help and FAQ board? That said, I agree it would be a nice piece of added functionality, but would prefer to see the math symbols back first - at present you can get the same functionality by saying "Hint: [hideb..." And if you want to do it, I'd tend towards doing it as "[hideb={label}]..." as more consistent with other tags (possibly from other boards)
|
|
IP Logged |
|
|
|
SWF
Uberpuzzler
Posts: 879
|
|
Re: the [hideb] tag
« Reply #2 on: Jun 19th, 2005, 12:36pm » |
Quote Modify
|
I don't know how other feel, but I find those hide tags to be more of an annoyance than useful. If somebody does not want to see the answer, he shouldn't read ahead- no need to hide anything. If somebody wants clues he can stop reading when he has seen enough. It is especially frustrating, in the 'What Am I' and 'What Happened' forums when so many people hide wild guesses that aren't even close to the answer. I usually don't bother reading the hidden text, because so often it isn't worth the effort needed to click on it. Doing a "Select All" works to display all the hidden text, but is not pleasant to read when the entire page is highlighted. Rather than adding new kinds of hide tags, a more useful feature would be a way to disable all hide tags.
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: the [hideb] tag
« Reply #3 on: Jun 19th, 2005, 12:44pm » |
Quote Modify
|
I must admit I hardly ever let hidden text stop me from reading it immediately But I like the suggestions so far. -Changing the label for hide blocks -First restoring math symbols -Some way to disable all hiding at once. I'll see if I can find.make a piece of javascript that could do the last. I've been plugging all sorts of javascript links on the bookmark-bar of my browser; fun stuff that.
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: the [hideb] tag
« Reply #4 on: Jun 23rd, 2005, 5:17am » |
Quote Modify
|
For unhiding the following works (for firefox and IE): Code:javascript: function qawsedrf(node) { while (node) { if ( ( node.tagName=='SPAN') || (node.tagName=='TD' && node.attributes['bgColor'] && node.attributes['bgColor'].value == "#b8860b" )) node.style.background='none'; child = node.firstChild; qawsedrf(child); node = node.nextSibling; }};qawsedrf(document); |
| You can put it as a bookmark on your browsers' linkbar It removes the background color for all SPAN elements and for all TD elements with the given background color. You could also change the textcolor if you want, but I left it as it is. [edit]third update of code-snippet[/edit]
|
« Last Edit: Jun 23rd, 2005, 7:28am by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: the [hideb] tag
« Reply #6 on: Jun 23rd, 2005, 3:14pm » |
Quote Modify
|
Hmm.. I'm somewhat surprised it does also work for TDs, since your still checking for bgcolor, and it was just set to none with the unhide code. I suppose changing the style doesn't change the bgcolor attribute. Still, it would be a neater solution if every element had a class to identify what they're used for. Rather then use attributes like bgcolor
|
« Last Edit: Jun 23rd, 2005, 3:17pm by towr » |
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
SWF
Uberpuzzler
Posts: 879
|
|
Re: the [hideb] tag
« Reply #7 on: Jun 23rd, 2005, 10:07pm » |
Quote Modify
|
Great job, towr! I had no idea you could do something like that with javascript. That will really help reduce the frustration of all those unnecessary hide tags.
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: the [hideb] tag
« Reply #8 on: Jun 24th, 2005, 12:27am » |
Quote Modify
|
on Jun 23rd, 2005, 10:07pm, SWF wrote:Great job, towr! I had no idea you could do something like that with javascript. |
| You can essentially chance the whole document content. You could probably even do something like search&replace on specific words if you really wanted (or highlight them, or maybe add a dictionary-link for each word, or reverse each word).
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
Re: the [hideb] tag
« Reply #9 on: Jun 24th, 2005, 1:26am » |
Quote Modify
|
Can I hide all post that contain "GRY" or "3 doors"?
|
|
IP Logged |
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: the [hideb] tag
« Reply #10 on: Jun 24th, 2005, 1:43am » |
Quote Modify
|
on Jun 24th, 2005, 1:26am, Grimbal wrote:Can I hide all post that contain "GRY" or "3 doors"? |
| Sure You'd still first have to click a link. But it's possible with some work. (Just examine for all elements with an innerHTML attribute whether it contains "gry" or "3 doors", and if so, set the innerHTML to empty)
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
SWF
Uberpuzzler
Posts: 879
|
|
Re: the [hideb] tag
« Reply #11 on: Jun 25th, 2005, 6:56am » |
Quote Modify
|
That works as advertised with Firefox, but on IE it has the side effect of stopping animated GIFs. Why does that happen? As animated GIFs can be distracting, that may be considered a bonus. Can it be made to stop animated GIFs in Firefox? I know IE has an setting to stop animiations, but I don't see such a setting in Firefox. Sir Col, I won't be using your command to re-hide , but those who love the hiding feature so much may appreciatie a macro that will hide everything, not just previously hidden words.
|
|
IP Logged |
|
|
|
Sir Col
Uberpuzzler
impudens simia et macrologus profundus fabulae
Gender:
Posts: 1825
|
|
Re: the [hideb] tag
« Reply #12 on: Jun 25th, 2005, 10:03am » |
Quote Modify
|
It's perhaps a little severe, SWF, but the following code will hide all .gif images on the page: Code:javascript: function hide_img(node) { while (node) { if ( node.tagName=='IMG' && node.src.indexOf('.gif')>0 ) node.style.visibility='hidden'; child=node.firstChild; hide_img(child); node=node.nextSibling; }}; hide_img(document); |
| If you want to hide all images just remove "&& node.src.indexOf('.gif')>0". The nice thing about this method is that it won't mess up the appearance of the page as the images are on the page, just not visible. Thanks for the recursive routine/template, towr; this is so much fun!
|
« Last Edit: Jun 25th, 2005, 10:30am by Sir Col » |
IP Logged |
mathschallenge.net / projecteuler.net
|
|
|
towr
wu::riddles Moderator Uberpuzzler
Some people are average, some are just mean.
Gender:
Posts: 13730
|
|
Re: the [hideb] tag
« Reply #13 on: Jun 25th, 2005, 10:19am » |
Quote Modify
|
Firefox has a nice extension that allows you to hide images, and other objects (although the latest firefox update broke the object hiding, I think). I'm not sure what it's called (it's on my home computer), but shouldn't be too hard to find.
|
|
IP Logged |
Wikipedia, Google, Mathworld, Integer sequence DB
|
|
|
|