Hello everyone,
I am sorry to re-open this thread, but just got back from holidays trying to
make this work with all the feedback I got (thanks Paul, Rolf and Bob), but
I am not succeeding...
My aim is the following:
     -I have 2 php pages, each with a Jmol window where I can load different
protein structures and I give the possibility to change the display of such
proteins (cartoon, spacefill, trace, backbone), to highlight (in sticks)
different residues and give them a label.
     -I want to save the state information of the Jmol window in the first
page (which I have already done) and pass it to the second, where I can
restore it (where I have the problem).


I already have the following:

FIRST PHP:

$cont0 .= "<form name=\"PASARCOLORS\" action=\"MODshowCOLORS.php\"
method=\"POST\" onSubmit='var state=jmolGetPropertyAsString(\"stateInfo\");
document.PASARCOLORS.ESTADO.value=state;'>";
$cont0 .= "<input type=\"hidden\" name=\"ESTADO\"></form>";



SECOND PHP:

$ESTADO=$_POST["ESTADO"];
echo "<!-- /***** Jmol Embedded Script ****
?php echo $ESTADO; ?
**/  -->";
 $JMOL = "<script type=\"text/javascript\">
 jmolInitialize(\"Jmol-12new\", true);
 jmolSetAppletColor(\"white\");
var jmolcmds = [
\"load $ZIPtoUSE|$PREFIX-Models_$code/$PREFIX-$code.pdb\",
 \"set frank off; select all; hbonds off; spin off; wireframe off; spacefill
off; trace off; set ambient 40; set specpower 40; slab off; ribbons off;
cartoons off; label off; monitor off\",
 \"set isosurfacePropertySmoothing TRUE\",
\"set showAxes true\",
 \"set appendNew true\",
\"frame all\",
\"display all\",
 \"select 1.1; cartoon; set propertyColorScheme 'bwr'; color atoms property
temperature ABSOLUTE $range\",
\"script Jmol-12new/myJMOLfunctions.spt\"
 ];
jmolApplet([580,500], jmolcmds.join(\"; \"));
</script>";

$JMOL .= "<form><script>jmolButton(\"reset\", \"Original orientation\");
 jmolButton(\"move 360 0 0 0 0 0 0 0 20\", \"Rotate X axis\");
jmolButton(\"move 0 360 0 0 0 0 0 0 20\", \"Rotate Y axis\");
 jmolButton(\"write image.png\", \"Create image\");
</script>";
$JMOL .= '<script>function
restoreState(){jmolScript(document.body.innerHTML)};
jmolButton([restoreState], "RESTORE");</script></form>';



The last line is not working, but I don't know why, since the information is
correctly passed to $ESTADO (any idea Bob?). Besides, I would like that the
state is restored by default, so I guess I don't need "var jmolcmds" at all,
just restoring at the beginning with jmolScript... how should it be? Thanks
again to everyone!
Daniel
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to