Hi Paul,
Many thanks for your suggestions.
After major assistance from Bob Hanson and much trial and error, I now
have Image Maps working in my wiki sandbox
http://osxs.ch.liv.ac.uk/~ng/wiki/index.php/Test_area3 - not all the
maps areas are in place. I also note that the applet resizes with the
window.
The code that works is
} else if (preg_match( '/^\[jmol:([^\]"]*+) \] \w* $ /x', $link,
$m )) {
# this says, "starting with [ and ending with ] and not containing a
double quote character
# and any amount of white space, store what is in between the [ ] into
$m[1]."
$path = $m[1];
# don't allow the Jmol javascript command
if (preg_match( '/javascript/i', $link))
return self::error( 'imagemap_invalid_desc', "Jmol script
contains JavaScript call" );
$title = 'javascript:jmolScript(' .
Xml::encodeJsVar($path) . ');';
$alt = $url;
$externLink = true;
The "snip" issue was a misunderstanding!
The next issue was the path to the file to be loaded - this works.
rect 3 14 103 96 [jmol: load /~ng/external/model/pericyclic/
claisen58.xyz;wireframe 0.1;spacefill 20%;]
If anyone would like the full version of my patched ImageMap-body.php
file, just let me know.
Message: 4
Date: Tue, 13 May 2008 11:31:27 +0200
From: Paul Pillot <[EMAIL PROTECTED]>
Subject: Re: [Jmol-users] Image Maps in Jmol wiki
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
Hi Nick,
in PHP the error log can be confusing... T_VARIABLE just states that
there is a missing parentheses or semi colon nearby line 137.
I believe that the first 2 lines are now correct after what you added.
There might be something wrong with the $title part : there is no
closing parenthesis to the strtr function. I don't know what the
';snip;' is for ?
IMHO you should give a try to :
$title = 'javascript:jmolScript(' .
Xml::encodeJsVar(
'load ' . strtr(
$path,
array( ';' => '', ' ' => '' )) .
'; snip;'
) . ');';
Paul
All the best
Nick
--
3D Organic Animations http://www.chemtube3d.com
Tel: +44 (0)151-794-3506 (3500 secretary)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users