TinyPortal

Development => Block Codes => Topic started by: Crip on October 10, 2006, 10:44:32 PM

Title: Color Picker HEX, RGB
Post by: Crip on October 10, 2006, 10:44:32 PM
COLOR PICKER FOR YOU!!
You'll want this on your Portal, very handy tool indeed!

Demo (http://www.cripcan.com/tst/index.php?page=6)

Unzip, upload all files, folders in order to your Forum Root!
Create a New Article: -
add in an IFrame -

<iframe src="demo.htm" width="!00%" height="850" border="0"></iframe>


You'll never go looking for a color chart again...


<h3>Customization</h3>
<p align="justify">While this script references multiple .js files, to integrate the color picker with your form in the fashion above, you do not need to be bothered with modifying any of these files. Instead, there are only two changes you need to make to the code of "demo.htm" to integrate the color picker into your page:</p>

1) Locate the code:

<p align="justify">ddcolorposter.fillcolorbox("colorfield1", "colorbox1") //PREFILL "colorbox1" with hex value from "colorfield1"</p>
<p align="justify">ddcolorposter.fillcolorbox("colorfield2", "colorbox2") //PREFILL "colorbox1" with hex value from "colorfield1"</p>



<p align="justify">These two lines are used to prefill the color boxes to the right of the form fields in question with the color currently inside the field when the page first loads. Without this code, when your page loads, the color boxes will not be initially filled with the color values inside the form fields.</p>

<p align="justify">There are two fields in the demo, hence two lines. The first parameter of fillcolorbox(), "colorfield1", should be the ID of the form field, while the second parameter, the ID of the matching color box.</p>

<p>See below for more information.</p>

2) Locate the code:

<form>
# <input type="text" id="colorfield1" onFocus="ddcolorposter.echocolor(this, 'colorbox1')"> <span id="colorbox1" class="colorbox">____</span>

# <input type="text" id="colorfield2" onFocus="ddcolorposter.echocolor(this, 'colorbox2')"> <span id="colorbox2" class="colorbox">____</span>
</form>



<p align="justify">This code demonstrates how to integrate the color picker with any form field on your page.</p>
<p align="justify">The key is the add the code:</p>
<p align="justify">onFocus="ddcolorposter.echocolor(this, 'colorbox1')" inside the desired form fields, where "colorbox1" is the ID of color box.</p>

<h2>That's it!</h2>


Title: Re: Color Picker HEX, RGB
Post by: G6Cad on October 10, 2006, 11:13:16 PM
Nice Crip, thank you :)
What have happend to your theme header ? all squashed to gether  ???
Title: Re: Color Picker HEX, RGB
Post by: Crip on October 10, 2006, 11:15:27 PM
it upshrinked is all..?
Title: Re: Color Picker HEX, RGB
Post by: G6Cad on October 10, 2006, 11:20:09 PM
The shrink doesent work for me on the article page, it stays down  ???
Title: Re: Color Picker HEX, RGB
Post by: RoarinRow on October 10, 2006, 11:36:48 PM
For some reason, it doesn't go to the width of the page even though the code says 100%.

Oh I see the problem, your 100% is !00%   :o
Title: Re: Color Picker HEX, RGB
Post by: Crip on October 11, 2006, 07:58:02 PM
If you view it on the Forum it's a tad bit wider.. Forum width is set on 82% ! @ RR 
Title: Re: Color Picker HEX, RGB
Post by: rbh on October 12, 2006, 05:04:27 AM
thanks for the useful script......and the new smiley. ;)
Title: Re: Color Picker HEX, RGB
Post by: RoarinRow on October 12, 2006, 05:22:13 AM
Quote from: crip on October 11, 2006, 07:58:02 PM
If you view it on the Forum it's a tad bit wider.. Forum width is set on 82% ! @ RR 

I left mine at 100% and disabled the left and right blocks when viewing the article.   :up:
Title: Re: Color Picker HEX, RGB
Post by: Crip on October 12, 2006, 01:39:43 PM
I just noticed something with this script, you can click and drag the color box anywhere within the Article.. :)
Title: Re: Color Picker HEX, RGB
Post by: copter on October 30, 2006, 04:43:54 PM
Hi

thats a great piece of work is that
Title: Re: Color Picker HEX, RGB
Post by: Hairy on October 30, 2007, 01:28:56 AM
This would be real handy for me but there's no download link anymore?
Title: Re: Color Picker HEX, RGB
Post by: bfeo on August 28, 2008, 12:59:44 AM
No download, and demo page no longer exists...
Title: Re: Color Picker HEX, RGB
Post by: IchBin on August 28, 2008, 06:05:20 AM
Perhaps you should consider the date it was posted?
«  on: 10/10/06: 03 »

yep, that is 2 years ago...