Studio Zero
« Add Colors in new cell »

Welcome Guest. Please Login or Register.
Sept 3, 2010, 4:32am





Studio Zero :: Web Development :: Code Storage :: Add Colors in new cell
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Add Colors in new cell (Read 1,166 times)
crazynarutard
Senior Studio Member
*****
Kay Has Grounded You
member is offline

[avatar]



Joined: Aug 2005
Gender: Male
Posts: 1,426
Location: Konoha
Karma: 29
 Add Colors in new cell
« Thread Started on Nov 18, 2005, 1:43am »

Global Footers

This code will add the colors normally in a drop down menu, in the posting area, in a new cell beneath the UBBC icons.
<script type="text/javascript">
/* Add colors in new cell - created by crAzY_J
do not redistribute this code without the creator's permission
global footers*/
var iCell
if( document.postForm )
{
   var colors = document.postForm.color;
   colors.style.display = 'none';
   var iRow = colors.parentNode.parentNode.parentNode.parentNode.insertRow(4);
   iCell = iRow.insertCell(0);
   iCell.width = '30%';iCell.className = 'windowbg2';iCell.innerHTML = '<font size="2">Add Colors</font>';
   iCell = iRow.insertCell(1);
   iCell.width = '70%';iCell.className= 'windowbg2';
   for( o = 0 ; o < colors.options.length ; o ++ )
   {
   iCell.innerHTML += '&nbsp;<font style="cursor:pointer;" color="'+colors.options[o].value+'" onClick=\'javascript:add("[color=' +colors.options[o].value+ ']","[/color]")\'>' +colors.options[o].value+ '</font>&nbsp;';
   }
}
</script>
« Last Edit: Nov 18, 2005, 1:46am by crazynarutard »Link to Post - Back to Top  IP: Logged
Curious George®
Senior Member
****
[p:70]
member is offline

[avatar]

Music Lover


[homepage]

Joined: Oct 2005
Gender: Male
Posts: 318
Location: A Place Called Heaven (Texas)
Karma: 3
 Re: Add Colors in new cell
« Reply #1 on Nov 18, 2005, 1:59am »

it works...lol
Link to Post - Back to Top  IP: Logged

Team Studio
Administrator
******
member is offline




[homepage]

Joined: Jun 2005
Gender: Male
Posts: 96
Karma: 4
 Re: Add Colors in new cell
« Reply #2 on Nov 18, 2005, 2:35am »

Hmm..it's similar to what we did in SZ...right? :P
Link to Post - Back to Top  IP: Logged

[image]
crazynarutard
Senior Studio Member
*****
Kay Has Grounded You
member is offline

[avatar]



Joined: Aug 2005
Gender: Male
Posts: 1,426
Location: Konoha
Karma: 29
 Re: Add Colors in new cell
« Reply #3 on Nov 18, 2005, 2:36am »


Quote:
Hmm..it's similar to what we did in SZ...right? :P

It's the same.
Because George requested it at SSD
Link to Post - Back to Top  IP: Logged
Bruce Banner
Head Coder
******
Click Click Boom
member is offline

[avatar]



Joined: Nov 2006
Gender: Male
Posts: 17,332
Location: Nebraska
Karma: 311
 Re: Add Colors in new cell
« Reply #4 on Nov 18, 2005, 2:47am »

Did you count for the extra slot for guests? ;)
Link to Post - Back to Top  IP: Logged

[image]
[image]

Coming soon(er or later) to SZ:
- [user] and [pmuser] UBBC tags
- Houdini
- CIv4
- Project Apocalypse
- Minimizer
crazynarutard
Senior Studio Member
*****
Kay Has Grounded You
member is offline

[avatar]



Joined: Aug 2005
Gender: Male
Posts: 1,426
Location: Konoha
Karma: 29
 Re: Add Colors in new cell
« Reply #5 on Nov 18, 2005, 3:51am »


Quote:
Did you count for the extra slot for guests? ;)

I guess it will go above the UBBC icons then :P
Link to Post - Back to Top  IP: Logged
Curious George®
Senior Member
****
[p:70]
member is offline

[avatar]

Music Lover


[homepage]

Joined: Oct 2005
Gender: Male
Posts: 318
Location: A Place Called Heaven (Texas)
Karma: 3
 Re: Add Colors in new cell
« Reply #6 on Nov 18, 2005, 2:25pm »

well i was hoping i could put it next to the text posting area like how CD has the smilies
Link to Post - Back to Top  IP: Logged

Curious George®
Senior Member
****
[p:70]
member is offline

[avatar]

Music Lover


[homepage]

Joined: Oct 2005
Gender: Male
Posts: 318
Location: A Place Called Heaven (Texas)
Karma: 3
 Re: Add Colors in new cell
« Reply #7 on Nov 23, 2005, 12:37am »

there is an error somewhere in this section
Code:
< colors.options.length ; o ++ )
{
iCell.innerHTML += '&nbsp;<font style="cursor:pointer;" color="'+colors.options[o].value+'" onClick=\'javascript:add("[color=' +colors.options[o].value+ ']","[/color]")\'>'


my webpage program says there is an empty tag
Link to Post - Back to Top  IP: Logged

chris™
New Member
*
[p:7]
member is offline

[avatar]



Joined: Aug 2005
Gender: Male
Posts: 8
Location: UK
Karma: -1
 Re: Add Colors in new cell
« Reply #8 on Apr 9, 2006, 8:26pm »

is there a way to make the colors into images? maybe using something like
Code:
' +colors.options[o].value+ '.jpg
Link to Post - Back to Top  IP: Logged
Nate
Official Member
**
member is offline

[avatar]



Joined: Jul 2007
Gender: Male
Posts: 84
Karma: 2
 Re: Add Colors in new cell
« Reply #9 on Apr 10, 2006, 12:39am »

Hehe nice CJ.
Try out [color=crap][/color] Works in IE XD
« Last Edit: Apr 10, 2006, 11:19pm by Nate »Link to Post - Back to Top  IP: Logged

[image]
chris™
New Member
*
[p:7]
member is offline

[avatar]



Joined: Aug 2005
Gender: Male
Posts: 8
Location: UK
Karma: -1
 Add Colors in new cell with images
« Reply #10 on Apr 10, 2006, 10:22am »

I managed to modify the code so it will show images now instead of text

Code:
<script type="text/javascript">
/* Add colors in new cell - created by crAzY_J
do not redistribute this code without the creator's permission
Modded for use with images by chris™
Global Footers */
//Change the following options
var imageDir = "http://www.mydirectory/Colours/"; //Directory to where the images are stored
var imageExt = ".gif"; //The file extension of the images
//No more editing needed
var iCell
if( document.postForm )
{
var colors = document.postForm.color;
colors.style.display = 'none';
var iRow = colors.parentNode.parentNode.parentNode.parentNode.insertRow(4);
iCell = iRow.insertCell(0);
iCell.width = '30%';iCell.className = 'windowbg2';iCell.innerHTML = '<font size="2">Add Colors:</font>';
iCell = iRow.insertCell(1);
iCell.width = '70%';iCell.className= 'windowbg2';
for( o = 0 ; o < colors.options.length ; o ++ )
{
iCell.innerHTML += ' <img src="' +imageDir+ '' +colors.options[o].value+ '' +imageExt+ '" alt="' +colors.options[o].value+ '" style="cursor:pointer;" onClick=\'javascript:add("[color=' +colors.options[o].value+ ']","[/color]")\'> ';
}
}
</script>

The images will be named:

Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen

followed by whatever extension you choose. Eg: Black.gif, Red.gif etc...

Note: Capitals must be used in filenames.
Link to Post - Back to Top  IP: Logged
grandma
Guest
 Re: Add Colors in new cell
« Reply #11 on Feb 13, 2008, 4:09pm »

I really like this code because I have a dark background and the users can see how the color will look before they use a specific color.

Thank you :)
Link to Post - Back to Top  IP: Logged
   [Search This Thread][Send Topic To Friend] [Print]


Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Report Abuse | Mobile