Apologies, that first replacement is supposed to be
var applet = _jmolGetApplet((arguments[2] ? arguments[2] : 0));
Best,
Dave
2009/6/13 N David Brown <[email protected]>
> I just realised, having re-read my code example, that jmolResize(w,h)
> doesn't have a targetSuffix parameter. Looking at the implementation, they
> call '_jmolGetApplet(0) inside the function' - you simply need to add an
> _optional_ targetSuffix parameter to the jmolResize function, so no other
> calls to it will be broken. Basically you should replace the line
> var applet = _jmolGetApplet(0);
>
> with
>
> var applet = arguments[2] ? arguments[2] : 0;
>
> Then change the line in my earlier code example from
>
> jmolResize(new_width, new_height);
>
> to
>
> jmolResize(new_width, new_height, targetSuffix);
>
> HTH.
>
> Dave
>
>
> 2009/6/13 N David Brown <[email protected]>
>
>> ..oh, and just to clarify - you need only wrap e.g. jmolScript(..) to
>> achieve what you want. Something like:
>> function myJmolScript(script, targetSuffix)
>> {
>> jmolScript(script, targetSuffix); // execute script as usual
>> var load_cmd_pos = script.search(/load/i); // case insensitive search
>> for load command
>> if (load_cmd_pos != -1) // if load command is find in script
>> {
>> var new_height = ...; // to be defined
>> var new_width = ...; // to be defined
>> jmolResize(new_width, new_height); // resize accordingly
>> }
>> }
>>
>> Observe that the above formation won't consider whether there are multiple
>> LOAD commands.
>>
>> Best,
>>
>> Dave
>>
>>
>> 2009/6/13 N David Brown <[email protected]>
>>
>> A quick case insensitive search in Jmol.js for 'resize' gives function
>>> jmolResize(width, height); . I've just tested it, it works great.
>>> For example, try this in your page:
>>>
>>> <form><input type="button" value="Resize"
>>> onclick="jmolResize(100, 100);"></form>
>>>
>>> Best,
>>>
>>> Dave
>>>
>>>
>>>
>>> 2009/6/13 Thomas Stout <[email protected]>
>>>
>>> It'd be neat if it could be tied to the size of the bounding box of the
>>>> loading molecule...
>>>>
>>>> -Tom
>>>>
>>>>
>>>> On Jun 12, 2009, at 3:45 PM, "Greeves, Nick" <[email protected]>
>>>> wrote:
>>>>
>>>> While displaying polymer chains, we have been wondering if it is
>>>> possible to change the shape and size of the applet as a new structure
>>>> loads?
>>>> So for example, starting with a horizontal letterbox shape which becomes
>>>> a traditional square as a subsequent view loads.
>>>> I have used the resizable window feature before but this only changes
>>>> when the window is resized. Can the applet shape be controlled by a button
>>>> or link?
>>>>
>>>> All the best
>>>> Nick
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Crystal Reports - New Free Runtime and 30 Day Trial
>>>> Check out the new simplified licensing option that enables unlimited
>>>> royalty-free distribution of the report engine for externally facing
>>>> server and web deployment.
>>>> http://p.sf.net/sfu/businessobjects
>>>>
>>>> _______________________________________________
>>>> Jmol-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Crystal Reports - New Free Runtime and 30 Day Trial
>>>> Check out the new simplified licensing option that enables unlimited
>>>> royalty-free distribution of the report engine for externally facing
>>>> server and web deployment.
>>>> http://p.sf.net/sfu/businessobjects
>>>> _______________________________________________
>>>> Jmol-users mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> - N David Brown
>>>
>>
>>
>>
>> --
>>
>> - N David Brown
>>
>
>
>
> --
>
> - N David Brown
>
--
- N David Brown
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users