Written by Jacques Guellec, jguellec@altavista.net. This program is an emailware, if you use it, please, send me a mail.
French version You can get http://perso.easynet.fr/~jguellec/program/perl/extern_link/extern_link_1.0.tar.gz.asc to check the integrity of the .tar.gz file. My PGP public key is in the html source of this document and on the PGP public key servers. Example: http://www.uk.pgp.net/pgpnet/wwwkeys.html
You may distibute Extern_Link under the terms of Artistic licence.
Download
During the test of an HTML tree structure being placed on a CDROM, the tester found that extern links (Internet) might be embarrassing. The fact of clicking on these links, if the computer is not connected to Internet is a cause of error or an attempt of connection by the computer.
So it has been decided that clicking on an extern link must opening a window that inform the user on the nature of the link and offer to continue or to stop. Example
A very simple JavaScript function do this job very well and the real work of Extern_Link software is to add this function in each HTML file of a complete tree structure and the call to this function in each link with http or ftp of each HTML file of a complete tree structure.
All this, works very well, excepted when the argument of the link is target=_blank. The reason is unknown.
Installation
Download the archive extern_link_1.0.tar.gz and untar it with a tar zxvf where you want. A extern_link_1.0 directory will be created.
Update your PATH for the new directory to be recognize by the system. In Linux the PATH is in the /etc/profile file.
What does Extern_Link do
The software goes through a tree structure or a directory ans scan all the HTML files. It begin by adding the JavaScript function and a signature at the right of a HTML closing tag. </head> or </title>. This signature avoid that another function been written by Extern_Link.
After that it go through the tree structure again and add a function call in each link with http or ftp.
If a link is for example like this:
<a href=http://perso.easynet.fr/~jguellec>Web des Lilas</a>
After Extern_Link it will be like that:
<a href=javascript:onClick=extern_link('http://perso.easynet.fr/~jguellec');">Web des Lilas</a>
If necessary, it will be possible to remove all the function call by running extern_link with -rmd or -rmt argument..
Set Extern_Link
There is one configuration file, extern_link.conf.
- The variables WINDOW_LINE1 WINDOW_LINE2 are the two lines of the JavaScript window that will be opended when the user will click on an external link.
- NEW_WINDOW This variable decide if the JavaScript function will contain the instruction fenetre=window.open(adresse, ''); or window.location.href=adresse In the first case, a new browser window will be opened, in the second one the Internet adress will be loaded in the same browser window.
- First case: NEW_WINDOW 1
- Second case NEW_WINDOW 0
- SIGNATURE_AREA This variable is the HTML tag where the signature of Extern_Link will be written. The software test it's presence to avoid to write a second JavaScript function. I think the best choices are title or head (capital or small letter) The software will write the signature at the right of the closing tag ex: </title>
- GROUP The name of Unix group of the processed files.
- DROIT The rights of the processed files.
Use
- If you wish to work only in one directory, you will run:
- extern_link -d name/of/the/start/directory
- If you wish work on a complete tree structure, you will run:
- extern_link -t name/of/the/start/directory
- If you wish to remove all the function call written by Extern_Link or the old version Liens_exterieurs just run:
Only in a directory: -rmd
- extern_link -rmd name/of/the/start/directory
In a complete tree structure: -rmt
- extern_link -rmt name/of/the/start/directory
In all cases, if you are in the place been processed, you can type:
- extern_link -arg .
The functions and the signature will stay, but it is not cumbersome.
© Lilas - 98 / 99