vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Turn colors on/off (https://vborg.vbsupport.ru/showthread.php?t=163212)

Mazinger 11-19-2007 10:00 PM

Turn colors on/off
 
This modification allows users to turn on/off colors in the style (grayscale) - (works in IE Only).



Screenshot:

http://img119.imageshack.us/img119/2807/examplest9.gif

--------

Installation:

In Navbar, search for:

HTML Code:

</tr>
</table>
<!-- / breadcrumb, login, pm info -->

Above it, add:

HTML Code:

<!-- colors form -->
<td class="alt1">
<script language="JavaScript">
<!--
function ColorsOff()
{
 ht = document.getElementsByTagName("html");
 ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
}
function ColorsOn()
{
 ht = document.getElementsByTagName("html");
 ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)";
}
function changeButton()
{
 if (document.onoff.B1.value=='Colors Off')
 {
 document.onoff.B1.value='Colors On';
 ColorsOff()
 }
 else
 {
 document.onoff.B1.value='Colors Off';
 ColorsOn()
}
}
//-->

</script>
<form name="onoff">
  <input type="button" value="Colors Off" name="B1" class="button" style="width: 80px;" onClick="changeButton()" />
</form>
</td>
<!-- / colors form -->

Save the work.

--------

Credits: Thanks to Wayne Luke for his help in making this mod.

What's next: Looking for someway to save selected option with cookies.

daz1967 11-20-2007 06:54 PM

Interesting thanks

testebr 11-20-2007 07:37 PM

Work only in IE and it's very useless.

TigerWare 11-20-2007 07:56 PM

Quote:

Originally Posted by testebr (Post 1386453)
Work only in IE and it's very useless.

Think "People With Visual Impairments". It may actually be quite useful to the "usually forgotten minority". To be visually impaired is a huge problem for some surfers as they have great difficulty with certain colours. Having a button to swith off colours can be a huge asset on a specialist website. Not 'useless' at all.

Good job Mazinger!

lostgirl815 11-20-2007 08:06 PM

Oh, very nice! Tagging this for future use.

Mazinger 11-20-2007 08:07 PM

Quote:

Originally Posted by TigerWare (Post 1386470)
Think "People With Visual Impairments". It may actually be quite useful to the "usually forgotten minority". To be visually impaired is a huge problem for some surfers as they have great difficulty with certain colours. Having a button to swith off colours can be a huge asset on a specialist website. Not 'useless' at all.

Good job Mazinger!

Exactly! Thanks for the info. :)

Fungsten 11-20-2007 08:16 PM

It didn't work on my test board. BTW, the button appeared below the Navbar. 3.6.8 PL1. TIA.

Mazinger 11-20-2007 08:19 PM

I tested it on IE - not sure about FF, probably I can test it on FF this week.


@Fungsten, add the code above this:

HTML Code:

<!-- / breadcrumb, login, pm info -->

Fungsten 11-20-2007 08:21 PM

Quote:

Originally Posted by Mazinger (Post 1386485)
I tested it on IE - not sure about FF, probably I can test it on FF this week.


@Fungsten, add the code above this:

HTML Code:

<!-- / breadcrumb, login, pm info -->

Here's where I put it:

Quote:


</tr>
</table>
<!-- colors form -->
<td class="alt1">
<script language="JavaScript">
<!--
function ColorsOff()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(gray scale=1)";
}
function ColorsOn()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(gray scale=0)";
}
function changeButton()
{
if (document.onoff.B1.value=='Colors Off')
{
document.onoff.B1.value='Colors On';
ColorsOff()
}
else
{
document.onoff.B1.value='Colors Off';
ColorsOn()
}
}
//-->
</script>
<form name="onoff">
<input type="button" value="Colors Off" name="B1" class="button" style="width: 80px;" onClick="changeButton()" />
</form>
</td>
</tr>
</table>
<!-- / colors form -->
<!-- / breadcrumb, login, pm info -->


Mazinger 11-20-2007 09:24 PM

Add the code above the first two lines:

HTML Code:

</tr>
</table>



All times are GMT. The time now is 05:09 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01123 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete