diff --git a/phpgwapi/js/picker/img/logo.gif b/phpgwapi/js/picker/img/logo.gif new file mode 100644 index 0000000000..6b5397dd31 Binary files /dev/null and b/phpgwapi/js/picker/img/logo.gif differ diff --git a/phpgwapi/js/picker/img/pixel.gif b/phpgwapi/js/picker/img/pixel.gif new file mode 100644 index 0000000000..46a2cf086c Binary files /dev/null and b/phpgwapi/js/picker/img/pixel.gif differ diff --git a/phpgwapi/js/picker/img/sel.gif b/phpgwapi/js/picker/img/sel.gif new file mode 100644 index 0000000000..542801d193 Binary files /dev/null and b/phpgwapi/js/picker/img/sel.gif differ diff --git a/phpgwapi/js/picker/img/tcolorp.gif b/phpgwapi/js/picker/img/tcolorp.gif new file mode 100644 index 0000000000..8df0d17e40 Binary files /dev/null and b/phpgwapi/js/picker/img/tcolorp.gif differ diff --git a/phpgwapi/js/picker/index.html b/phpgwapi/js/picker/index.html new file mode 100644 index 0000000000..e594c1abd0 --- /dev/null +++ b/phpgwapi/js/picker/index.html @@ -0,0 +1,199 @@ + + + JavaScript Color Picker - Demo + + + + + + + + + + + + + + + + + + + + +
Tigra Color PickerSoftcomplex logo
+ + | About Us  + | Services  + | Download  + | Order  + | Support  + | + +
+ + + +
+ + + + + + + + + + +
Tigra Color Picker - Demo #1 
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Notes
+ On the right hand side there is a form with Tigra Color Picker attached to the fields. Note, that you can have multiple pickers on the same page independently. +
Advantages
+

Easy color input - With Tigra Color Picker color input is simple and intuitive. Visitors can select any color from three available palettes with few clicks. +

Cost Saving Component - Don't waste your time coding color convertors and validators all over again for each new project. Get the colors on server side ready for further processing. +

Professional Look - Simple great looking improvement to the user interface of your web application.

+
Links
+ + + +
Getting Started
+

The script is really easy to setup. To see an example just open this document with plain text editor and find comments. Didn't it help? Ask for help in Product Forum. +

Vote for the script
+ If you like the script, please vote for it. We do appreciate this much. +
+ + ScriptSearch.com : +   +
+ +
+ + HotScripts.com : +   +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
Try out the script with this demo form
Select color from Web safe palette: + + + + Click Here to Pick up the color +
Select color from Windows system palette: + + Click Here to Pick up the color +
Select color from grayscale palette: + + Click Here to Pick up the color +
Picker reads initial value from the input: + + Click Here to Pick up the color +
 
+
+ +
+
+ + + + + + + + +
Copyright ©2003 SoftComplex Inc. All rights reserved. + | company info + | privacy policy + | contact us + | +
+ + + + diff --git a/phpgwapi/js/picker/picker.html b/phpgwapi/js/picker/picker.html new file mode 100644 index 0000000000..962dda8ce7 --- /dev/null +++ b/phpgwapi/js/picker/picker.html @@ -0,0 +1,40 @@ + + + + + Tigra Color Picker + + + + + + + + +
+ +
+ +
+ + diff --git a/phpgwapi/js/picker/picker.js b/phpgwapi/js/picker/picker.js new file mode 100644 index 0000000000..2428a727d7 --- /dev/null +++ b/phpgwapi/js/picker/picker.js @@ -0,0 +1,137 @@ +// Title: Tigra Color Picker +// URL: http://www.softcomplex.com/products/tigra_color_picker/ +// Version: 1.1 +// Date: 06/26/2003 (mm/dd/yyyy) +// Note: Permission given to use this script in ANY kind of applications if +// header lines are left unchanged. +// Note: Script consists of two files: picker.js and picker.html + +var TCP = new TColorPicker(); + +function TCPopup(field, palette) { + this.field = field; + this.initPalette = !palette || palette > 2 ? 0 : palette; + var w = 194, h = 206, + move = screen ? + ',left=' + ((screen.width - w) >> 1) + ',top=' + ((screen.height - h) >> 1) : '', + o_colWindow = window.open('picker.html', null, "help=no,status=no,scrollbars=no,resizable=no" + move + ",width=" + w + ",height=" + h + ",dependent=yes", true); + o_colWindow.opener = window; + o_colWindow.focus(); +} + +function TCBuildCell (R, G, B, w, h) { + return ''; +} + +function TCSelect(c) { + this.field.value = '#' + c.toUpperCase(); + this.win.close(); +} + +function TCPaint(c, b_noPref) { + c = (b_noPref ? '' : '#') + c.toUpperCase(); + if (this.o_samp) + this.o_samp.innerHTML = '' + c +' ' + c + '' + if(this.doc.layers) + this.sample.bgColor = c; + else { + if (this.sample.backgroundColor != null) this.sample.backgroundColor = c; + else if (this.sample.background != null) this.sample.background = c; + } +} + +function TCGenerateSafe() { + var s = ''; + for (j = 0; j < 12; j ++) { + s += ""; + for (k = 0; k < 3; k ++) + for (i = 0; i <= 5; i ++) + s += this.bldCell(k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, i * 51, 8, 10); + s += ""; + } + return s; +} + +function TCGenerateWind() { + var s = ''; + for (j = 0; j < 12; j ++) { + s += ""; + for (k = 0; k < 3; k ++) + for (i = 0; i <= 5; i++) + s += this.bldCell(i * 51, k * 51 + (j % 2) * 51 * 3, Math.floor(j / 2) * 51, 8, 10); + s += ""; + } + return s +} + +function TCGenerateGray() { + var s = ''; + for (j = 0; j <= 15; j ++) { + s += ""; + for (k = 0; k <= 15; k ++) { + g = Math.floor((k + j * 16) % 256); + s += this.bldCell(g, g, g, 9, 7); + } + s += ''; + } + return s +} + +function TCDec2Hex(v) { + v = v.toString(16); + for(; v.length < 6; v = '0' + v); + return v; +} + +function TCChgMode(v) { + for (var k in this.divs) this.hide(k); + this.show(v); +} + +function TColorPicker(field) { + this.build0 = TCGenerateSafe; + this.build1 = TCGenerateWind; + this.build2 = TCGenerateGray; + this.show = document.layers ? + function (div) { this.divs[div].visibility = 'show' } : + function (div) { this.divs[div].visibility = 'visible' }; + this.hide = document.layers ? + function (div) { this.divs[div].visibility = 'hide' } : + function (div) { this.divs[div].visibility = 'hidden' }; + // event handlers + this.C = TCChgMode; + this.S = TCSelect; + this.P = TCPaint; + this.popup = TCPopup; + this.draw = TCDraw; + this.dec2hex = TCDec2Hex; + this.bldCell = TCBuildCell; + this.divs = []; +} + +function TCDraw(o_win, o_doc) { + this.win = o_win; + this.doc = o_doc; + var + s_tag_openT = o_doc.layers ? + 'layer visibility=hidden top=54 left=5 width=182' : + 'div style=visibility:hidden;position:absolute;left:6px;top:54px;width:182px;height:0', + s_tag_openS = o_doc.layers ? 'layer top=32 left=6' : 'div', + s_tag_close = o_doc.layers ? 'layer' : 'div' + + this.doc.write('<' + s_tag_openS + ' id=sam name=sam>
sample sample
'); + this.sample = o_doc.layers ? o_doc.layers['sam'] : + o_doc.getElementById ? o_doc.getElementById('sam').style : o_doc.all['sam'].style + + for (var k = 0; k < 3; k ++) { + this.doc.write('<' + s_tag_openT + ' id="p' + k + '" name="p' + k + '">' + this['build' + k]() + '
'); + this.divs[k] = o_doc.layers + ? o_doc.layers['p' + k] : o_doc.all + ? o_doc.all['p' + k].style : o_doc.getElementById('p' + k).style + } + if (!o_doc.layers && o_doc.body.innerHTML) + this.o_samp = o_doc.all + ? o_doc.all.samp : o_doc.getElementById('samp'); + this.C(this.initPalette); + if (this.field.value) this.P(this.field.value, true) +}