Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 10-21-2006, 02:30 PM
DigitALL DigitALL is offline
 
Join Date: Dec 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to limit/select/edit the numbers of colors in BB Code ?

Hello,

I have searched this forum but could not find something related to the issue I have...

I have dark and light skins installed and when posting, if it is used the default text color, the post appears fine under each skin.
Here is my problem: for example, a member posts a text with grey color text to have a better contrast under the dark skin he prefers. But under a light skin where the background is light grey, the same text could be hardly seen.
Take for instance in this forum where the color palete/array is edited so if you want to write in "light grey" it will appear green.

I have currently disabled the "Allow Color BB Code" from ACP/Options/BB Code Settings so the members could post only in a default color. This looks fine but many members told me that they want the colors back, or at least few of them. I found that there are few colors that could be used under all skins.

How can I edit the color palette/array for text and use only the colors I want? I have searched in templates but it is not there... The palette/array has currently 40 colors. Is there a hack or info on how to control these colors, or better yet, make it to appear only 10 or 12 colors, please?
Reply With Quote
  #2  
Old 10-25-2006, 10:05 AM
DigitALL DigitALL is offline
 
Join Date: Dec 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump
Reply With Quote
  #3  
Old 10-25-2006, 03:16 PM
r007 r007 is offline
 
Join Date: Jan 2003
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey hey DigitALL -

You can adjust the colors listed in the editor window!

Open up your ./clientscript/vbulletin_textedit.js and find:
Code:
/**
* Define available color name options - keyed with hex value
*
* @var	array	Color options
*/
After that, there will be an array of colors that you can set!

Though... This only changes the dropdown box of colors... people can still use the BBCode [ COLOR=#XXXXXX ] [ /COLOR] to get a nonlisted color.
Reply With Quote
  #4  
Old 10-25-2006, 10:00 PM
DigitALL DigitALL is offline
 
Join Date: Dec 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much for your reply. I will definitely try it out.
Reply With Quote
  #5  
Old 10-27-2006, 03:46 PM
DigitALL DigitALL is offline
 
Join Date: Dec 2005
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Again, thank you for the info r007.
The collor palette provided by vBulletin contains many colors that probably are never used. It is nice of course to have plenty of colors but why not provide support on how to adjust the pallete for your needs? Even on the default skin, some colors are not readable.
Also, it amazes me that there is no hack or some info on any of the related forums on how to edit/change the color pallete.

Anyway, I did some trial and error and wish to share it, hopefully somebody will come with more complete info on how to do it, or why not, a nice hack. I will post it in other similar forums too.

So I edited the file suggested "vbulletin_textedit.js" and the current color HEX defintion is:

Code:
* Define available color name options - keyed with hex value
*
* @var	array	Color options
*/
var coloroptions = new Array();
coloroptions = {
	'#000000' : 'Black',
	'#A0522D' : 'Sienna',
	'#556B2F' : 'DarkOliveGreen',
	'#006400' : 'DarkGreen',
	'#483D8B' : 'DarkSlateBlue',
	'#000080' : 'Navy',
	'#4B0082' : 'Indigo',
	'#2F4F4F' : 'DarkSlateGray',
	'#8B0000' : 'DarkRed',
	'#FF8C00' : 'DarkOrange',
	'#808000' : 'Olive',
	'#008000' : 'Green',
	'#008080' : 'Teal',
	'#0000FF' : 'Blue',
	'#708090' : 'SlateGray',
	'#696969' : 'DimGray',
	'#FF0000' : 'Red',
	'#F4A460' : 'SandyBrown',
	'#9ACD32' : 'YellowGreen',
	'#2E8B57' : 'SeaGreen',
	'#48D1CC' : 'MediumTurquoise',
	'#4169E1' : 'RoyalBlue',
	'#800080' : 'Purple',
	'#808080' : 'Gray',
	'#FF00FF' : 'Magenta',
	'#FFA500' : 'Orange',
	'#FFFF00' : 'Yellow',
	'#00FF00' : 'Lime',
	'#00FFFF' : 'Cyan',
	'#00BFFF' : 'DeepSkyBlue',
	'#9932CC' : 'DarkOrchid',
	'#C0C0C0' : 'Silver',
	'#FFC0CB' : 'Pink',
	'#F5DEB3' : 'Wheat',
	'#FFFACD' : 'LemonChiffon',
	'#98FB98' : 'PaleGreen',
	'#AFEEEE' : 'PaleTurquoise',
	'#ADD8E6' : 'LightBlue',
	'#DDA0DD' : 'Plum',
	'#FFFFFF' : 'White'
};
I started to change the colors definiton and noticed the palette it still display 40 squares but some colors are the same. Then I replaced the word "White" with "DeepSkyBlue" but with the same HEX and noticed that instead of 40 colors palette, I have 39.
I went further with the mods and I currently have only 12 colors left. I realize that this is just trial and error.

I have finalized the script to this form:

Code:
* Define available color name options - keyed with hex value
*
* @var	array	Color options
*/
var coloroptions = new Array();
coloroptions = {
	'#708090' : 'Black',
	'#A0522D' : 'Sienna',
	'#696969' : 'DarkOliveGreen',
	'#008080' : 'DarkGreen',
	'#0000FF' : 'DarkSlateBlue',
	'#0000FF' : 'Navy',
	'#FF00FF' : 'Indigo',
	'#696969' : 'Black',
	'#FF0000' : 'DarkRed',
	'#FF8C00' : 'DarkOrange',
	'#808000' : 'Olive',
	'#008000' : 'Green',
	'#008080' : 'Teal',
	'#0000FF' : 'Blue',
	'#708090' : 'SlateGray',
	'#696969' : 'DimGray',
	'#FF0000' : 'Red',
	'#F4A460' : 'SandyBrown',
	'#9ACD32' : 'YellowGreen',
	'#2E8B57' : 'SeaGreen',
	'#48D1CC' : 'MediumTurquoise',
	'#4169E1' : 'RoyalBlue',
	'#FF00FF' : 'Purple',
	'#808080' : 'Gray',
	'#FF00FF' : 'Magenta',
	'#FF8C00' : 'Orange',
	'#9ACD32' : 'YellowGreen',
	'#9ACD32' : 'Lime',
	'#00FFFF' : 'RoyalBlue',
	'#00BFFF' : 'DeepSkyBlue',
	'#9932CC' : 'DarkOrchid',
	'#808080' : 'Blue',
	'#808080' : 'Pink',
	'#808080' : 'Wheat',
	'#808080' : 'LemonChiffon',
	'#808080' : 'Magenta',
	'#808080' : 'PaleTurquoise',
	'#808080' : 'SeaGreen',
	'#808080' : 'Plum',
	'#48D1CC' : 'DeepSkyBlue'
};
Obviously this script relates to another script. I wanted to get rid of black and in fact it is not in the pallete anymore but it still is in the reference color. See the final in the attached image. The colors are OK now to be used under multiple skins BUT the black still appears under "A" (color selection) and by just pressing the button without displying the palette, the black is still there.



Hopefully these changes will gives some ideas to others...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:26 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05564 seconds
  • Memory Usage 2,199KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete