Discussion Forums  >  Self Hosted Control Panels

Replies: 5    Views: 96

chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
04/30/13 10:31 AM (12 years ago)

Self-hosted and the color picker screen

This has been a minor annoyance of mine for a while, so I finally got around to fixing it on my self-hosted control panel. If you're self-hosted, you may have noticed that the color picker screen has really small, hard-to-see, color panels. On mine, they're the proper width, but have a really tiny height. Fortunately, it's an easy fix. Open up the /BT-server/bt_v15/bt_app/bt_pickerColor.php file. Around line 74 you should see the main Javascript script. (It starts with <script> ). Replace that entire script with this one and save back to your server: <script language="javascript"> fixed="B"; left="R"; upper="G"; value=Array; value[0]="N/A"; value[1]="00"; value[2]="33"; value[3]="66"; value[4]="99"; value[5]="CC"; value[6]="FF"; for (fixedamount=1; fixedamount<=6;fixedamount=fixedamount+1) { fixedvalue=value[fixedamount]; document.write("<table border='0' style='width:100%;'><tr><td>"); for (row=0; row<=6;row=row+1) { document.write("<tr>"); for (table=1; table<=3; table=table+1) { if (table==1) {fixed="B"; left="R"; upper="G";} if (table==2) {fixed="R"; left="G"; upper="B";} if (table==3) {fixed="G"; left="B"; upper="R";} for (column=0; column<=6; column=column+1) { if (fixed=="R") {redvalue=fixedvalue; fixedcolor="#CC0000"}; if (fixed=="G") {greenvalue=fixedvalue; fixedcolor="#009900"}; if (fixed=="B") {bluevalue=fixedvalue; fixedcolor="#0000CC"}; if (left=="R") {redvalue=value[row]; leftcolor="#CC0000"}; if (left=="G") {greenvalue=value[row]; leftcolor="#009900"}; if (left=="B") {bluevalue=value[row]; leftcolor="#0000CC"}; if (upper=="R") {redvalue=value[column]; uppercolor="#CC0000"}; if (upper=="G") {greenvalue=value[column]; uppercolor="#009900"}; if (upper=="B") {bluevalue=value[column]; uppercolor="#0000CC"}; if (column==0 && row==0) {document.write("<td bgColor="+fixedcolor+"><font face='Verdana' size=1 color='#FFFFFF' size='1'>" + value[fixedamount] + "</font></td>")}; if (column==0 && row!=0) {document.write("<td bgColor="+leftcolor+" ><font face='Verdana' size=1 color='#FFFFFF' size='1'>" + value[row] + "</font></td>")}; if (column!=0 && row==0) {document.write("<td bgColor="+uppercolor+" ><font face='Verdana' size=1 color='#FFFFFF' size='1'>" + value[column] + "</font></td>")}; styleclause="cursor:pointer;width:20px;height:20px;background-color:#" + redvalue + greenvalue + bluevalue + ";"; onclickclause="returnColor("#" + redvalue + greenvalue + bluevalue + "");"; if (column != 0 && row != 0){document.write("<td><button value=' ' style='" + styleclause + "' onClick='" + onclickclause + "' title='#" + redvalue + greenvalue + bluevalue + "'></td>")}; } if (table < 3) {document.write("<td bgColor=#FFFFF4>&nbsp;&nbsp;&nbsp;&nbsp;</td>")}; } document.write("</font></tr>"); } document.write("</td></tr></table>"); } </script>
 
Joe Sprott
Code is Art
Profile
Posts: 414
Reg: Aug 20, 2011
Melbourne, FL
10,290
like
04/30/13 10:56 AM (12 years ago)
nice job
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
04/30/13 10:57 AM (12 years ago)
Nice, thanks!
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
04/30/13 11:20 AM (12 years ago)
Copy/pasted the above code, result was a blank screen. Changed the cursor pointer width/height in my existing php file and it was ok. Maybe the non-formating on the forum breaks the script?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/30/13 11:23 AM (12 years ago)
probably. You can also get the source code of the Buzztouch.com file (which is what I did in the first place): https://www.buzztouch.com/app/cp_v20/bt_app/bt_pickerColor.php
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
04/30/13 12:17 PM (12 years ago)
Thank you @chris1! I thought it was just me..lol LA
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.