I find this script very nice. Indeed JavaScript can be very powerful to do such
things. I added some JavaScript support to the elogd server itself. If one opens
the "New" page like
http://localhost/demo/?cmd=New&js=test.js
then the JavaScript "test.js" (which has to be present in
themes/default/test.js) gets inserted into the page header and executed. This
can be used to add custom form validation, which is more powerful than the built
in checking if required attributes are present.
Then I tried to redo the bookmark script with the new method. A server-side
script has of course more space than just a bookmark. I started with a bookmark
like:
javascript:window.open("http://localhost/demo/?cmd=New&js=test.js");
which even works on IE6. The script "test.js" contains:
function a()
{
var d=opener.document;
alert("test.js");
alert(d.location.href);
alert(d.getSelection());
}
a();
While the first alert() works, the others fail. It seems like the "opener"
method does not correctly dereference the right window. If anybody has some
idea, please let me know.
The new version of elogd which supports the "js=" command can be found here:
http://midas.psi.ch/cgi-bin/cvsweb/elog/src/elogd.c?rev=1.235 |