Toblerone
Dienstag, 7. Januar 2003

how to enable the colorpicker

currently the antville colorpicker is out of order due to the virtual domains each weblog is hosted at.

because the colorpicker and its scripts are located at www.antville.org but the document (whose objects the colorpicker wants to access by a script) is located at e.g. tobi.antville.org, a browser detects a security violation (aka cross-domain scripting) each time the colorpicker's "accept" link is clicked.

to prevent this, the colorpicker javascript code has now moved into the virtual domain of a weblog. however, one might need to take a few steps to really restore the colorpicker's functionality:

  1. check your weblog's javascript links. do this by checking whether you have set the following lines in the "main" skin of your weblog: <script type="text/javascript" src="<% site.url %>safescripts"></script> <script type="text/javascript" src="<% site.url %>javascript"></script> (please note the "site.url" in the first line embedding the "safescripts" file; recently, this was set to "root.url" and thus the colorpicker did not work!)
  2. update the javascript code. if you have customized the "javascript" skin you should take care that it does not contain one of the following functions: openColorPicker, setBg, setColorPreview and parseColor. all these functions are now contained by the "safescripts" file.
  3. update your stylesheet. be sure to have the following line included in the "stylesheet" skin: .colorpickerWidget {border: 1px solid #cccccc;} (you certainly can make any stylish changes to the three values if you think that's necessary.)
  4. make shift reload. at least three times :)
now try out the colorpicker at the preferences page. it should work if you haven't done anything wrong. otherwise i recommend you to carefully go through the steps once again. if the colorpicker still is defunct and you believe it's not your fault feel free to post a comment here.
Sie sind nicht angemeldet