wu :: forums
« wu :: forums - the [hideb] tag »

Welcome, Guest. Please Login or Register.
Nov 27th, 2024, 2:17pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   suggestions, help, and FAQ
(Moderators: william wu, Grimbal, ThudnBlunder, Eigenray, SMQ, towr, Icarus)
   the [hideb] tag
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: the [hideb] tag  (Read 5198 times)
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
the [hideb] tag  
« on: Jun 18th, 2005, 12:29pm »
Quote Quote Modify 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
*****





134688278 134688278   rmsgrey   rmsgrey


Gender: male
Posts: 2873
Re: the [hideb] tag  
« Reply #1 on: Jun 19th, 2005, 10:04am »
Quote Quote Modify 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 Quote Modify 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: male
Posts: 13730
Re: the [hideb] tag  
« Reply #3 on: Jun 19th, 2005, 12:44pm »
Quote Quote Modify Modify

I must admit I hardly ever let hidden text stop me from reading it immediately Tongue
 
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: male
Posts: 13730
Re: the [hideb] tag  
« Reply #4 on: Jun 23rd, 2005, 5:17am »
Quote Quote Modify 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
Sir Col
Uberpuzzler
*****




impudens simia et macrologus profundus fabulae

   
WWW

Gender: male
Posts: 1825
Re: the [hideb] tag  
« Reply #5 on: Jun 23rd, 2005, 2:17pm »
Quote Quote Modify Modify

That is very useful and impressive, towr; bravo!
 
And, of course, the following code will hide it again:
 
Code:
javascript: function qawsedrf(node) {  while (node)  {    if ( node.tagName=='SPAN' ) node.style.background='#b8860b';  child = node.firstChild;    qawsedrf(child);    node = node.nextSibling;  }};qawsedrf(document);

 
 
[e]Edited: the code above will only restore the hidden property to the standard hide tag, not the hide block. It will also "hide" (change the background colour of) the glow tag.[/e]
 
testing testing testing testing testing testing testing testing testing testing testing testing testing testing

 
hidden:
second test
« Last Edit: Jun 23rd, 2005, 3:31pm by Sir Col » IP Logged

mathschallenge.net / projecteuler.net
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: the [hideb] tag  
« Reply #6 on: Jun 23rd, 2005, 3:14pm »
Quote Quote Modify 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 Tongue
« 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 Quote Modify 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: male
Posts: 13730
Re: the [hideb] tag  
« Reply #8 on: Jun 24th, 2005, 12:27am »
Quote Quote Modify 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: male
Posts: 7527
Re: the [hideb] tag  
« Reply #9 on: Jun 24th, 2005, 1:26am »
Quote Quote Modify Modify

Can I hide all post that contain "GRY" or "3 doors"?   Grin
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: the [hideb] tag  
« Reply #10 on: Jun 24th, 2005, 1:43am »
Quote Quote Modify Modify

on Jun 24th, 2005, 1:26am, Grimbal wrote:
Can I hide all post that contain "GRY" or "3 doors"?   Grin
Sure Tongue
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 Quote Modify 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.  
 Cool
IP Logged
Sir Col
Uberpuzzler
*****




impudens simia et macrologus profundus fabulae

   
WWW

Gender: male
Posts: 1825
Re: the [hideb] tag  
« Reply #12 on: Jun 25th, 2005, 10:03am »
Quote Quote Modify 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: male
Posts: 13730
Re: the [hideb] tag  
« Reply #13 on: Jun 25th, 2005, 10:19am »
Quote Quote Modify 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
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board