Greeves, Nick wrote:
> Bob now has this working beautifully on many of his pages but I can't
> see how to create a "normal" Jmol button or type something into the
> cmd: box on Bob's page
> http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new0.htm
> that achieves the same result as clicking "new resizable Window".
>
> I'm quite prepared to admit I don't know how to do this but I would
> like to!
>
> It clearly relies on Jmol.js and newAppletWindow() but I can't put
> them together and the source code for Bob's page reveals nothing about
> "new resizable Window".
>
Someone please tell me why the commented code does not show in Firefox,
and you can't print that window, either, becauese the browser thinks the
page is still loading.
function newAppletWindow() {
var state = jmolGetPropertyAsString("stateInfo") + "zoomLarge=false;"
state = state.replace(/\"/g,""").replace(/\n/g,";")
var html = '<html><head><script type="text/javascript"
src="Jmol.js"></script></head>'
+'<body>'
// +'<h3>xxxthis code should be here </h3><p>'
+'<script
type="text/javascript">jmolApplet("100%","'+state+'")</script></p>'
// +'<h3>pexxxthis code should be here </h3><p>'
+'</body></html>'
dowritenew(html)
}
woptions="menubar=yes,resizable=1,scrollbars,alwaysRaised,width=700,height=600,left=50"
function dowritenew(s){
var sm=""+Math.random()
sm=sm.substring(2,10)
var newwin=open("","jmol_"+sm,woptions)
newwin.document.write(s)
newwin.document.close()
}
> Can anyone advise what code would produce a Jmol button or the command
> required for Console?
>
> All the best
> Nick
>
>
> -----Original Message-----
>
> Date: Wed, 07 Mar 2007 14:38:14 +0100
> From: Rolf Huehne <[EMAIL PROTECTED]>
> Subject: Re: [Jmol-users] New Window with resizable applet command?
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Bob Hanson wrote:
> > right! I got mixed up in all the negatives. This is better:
> > function _jmolGetAppletSize(size) {
> > var width, height;
> > var type = typeof size;
> > if (type == "object" && size != null) {
> > width = size[0]; height = size[1];
> > } else {
> > width = height = size;
> > }
> > if (typeof width == "number") {
> > width = (width >= 25 && width <= 2000 ? width + "px"
> > : width < 1 && width > 0 ? (width * 100)+"%":"300px")
> > }
> > if (typeof height == "number") {
> > height = (height >= 25 && height <= 2000 ? height + "px"
> > : height < 1 && height > 0 ? (height * 100)+"%":"300px")
> > }
> > return [width, height];
> > }
> >
> >
> Hi Bob,
>
> I noticed that you allow in your subroutine only a maximum value of 2000
> pixels. This seems to be unnecessary. With your example resizable applet
> window I could get an applet with >6000 pixels without any obvious
> problem. Therefore the 2000 pixels seem to be just an unnecessary (?)
> restriction of the code setting the initial applet size.
>
> Your resizing example at
> "http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm"
> works well in Firefox 1.5.0.9 and Konqueror 3.4.0 on SuSE Linux 9.3. The
> visible molecule part is always the same, only the size changes (as
> expected). But if I set the size to a specific value the applet content
> is only adapted if it is enlarged. If the applet size is reduced, no
> adaptation is done (as reported a few days ago on the developers list)
> and most of the content is invisible afterwards.
>
> Q: Is there a way to force Jmol to do this adaptation using script
> commands (without changing other things like orientation etc.)?
>
> Regards,
> Rolf
>
>
>
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users