Bob,
I agree with your reading. "" should append nothing. No parameter
or null should use default numbering. Any other value should append
that value. Your choice on the way we write the code, although compact
is sometimes very hard for people to read. I believe execution speed
is unaffected by whether it is written compactly or not.
I haven't got time to dig for the example, but I believe I've seen ""
being interpreted as null. If I finish my grading I will try to find
the example piece of code. This might cause us some problem.
Jonathan
On Nov 16, 2009, at 9:38 PM, Robert Hanson wrote:
> The main question is what our documentation says. If it says use 0,
> "", or "0" for the target implies "0", "1", "2" ..., then we should
> stick with that; if it says nothing, we should change it and then
> say that "" means "". That documentation now reads:
>
> nameSuffix (optional) needs only be specified if you want to
> explicitly control the name and id attributes used as part of the
> applet tag. The suffix which you supply will be appended to the
> string "jmolApplet", so if you specify "Foo" the attributes
> generated will be name='jmolAppletFoo' id='jmolAppletFoo'. In a
> database application where you are writing records to a table you
> can feel free to provide an integer as your suffix. If nameSuffix is
> not provided, applets will take by default the names jmolApplet0,
> jmolApplet1, etc., in the order they are inserted into the page.
>
> This implies, to my reading, that "" should produce
> name='jmolApplet' and "0" should produce name='jmolApplet0'
> regardless of the number of applets already on the page.
>
> So I would consider that a bug. I think we should change it, along
> with several other items there.
>
> Basically, I think
>
> undefined ==> It wasn't listed as a parameter
> null ==> It was listed as "null" meaning "use the default value"
>
> So there are lots of places where we see
>
> if (xxx == undefined || xxx == null)...
>
> and that's appropriate -- and necessary.
>
> Attached is my suggested change for Jmol.js. It also utilizes the
> newer(?) more compact form of if:
>
> if (xxx == undefined) xxx=yyy
>
> as
>
> xxx == undefined && (xxxx=yyy)
>
> same s
>
> xxx != undefined || (xxxx=yyy)
>
>
> Bob
>
> On Sun, Nov 15, 2009 at 5:05 PM, Jonathan Gutow <[email protected]>
> wrote:
> Bob,
> I think you're correct. The user may want no suffix for some
> reason. If I understand fully the way Jmol.js reponds now this will
> be changing the behavior. I believe passing "" for namesuffix now
> appends an automatic index to the applet. I still think it would be
> the most appropriate behavior.
>
> Jonathan
>
> PS. The "multi-touch" sounds neat. Unfortunately, I don't have
> anything to test it on.
>
>
> On Nov 15, 2009, at 12:25 PM, Robert Hanson wrote:
>
> > I think empty string should be accepted as such and not considered
> > undefined. The user then is saying, "I want no extension -- just
> > call it "jmolApplet".
> >
> >
> > 2009/11/14 Angel Herráez <[email protected]>
> > On 14 Nov 2009 at 10:05, Robert Hanson wrote:
> >
> > > if (nameSuffix == undefined) is correct. That's what you want.
> >
> > I thought I had tested that the parameter in a function call is
> > never undefined, but I see now it is not the case. The empty string
> > fails undefined, of course, so we need
> >
> > if (nameSuffix==undefined || nameSuffix==="")
> >
> > Right? Who does the change?
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> > 30-Day
> > trial. Simplify your report design, integration and deployment - and
> > focus on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now. http://p.sf.net/sfu/bobj-july
> > _______________________________________________
> > Jmol-developers mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jmol-developers
> >
> >
> >
> >
> > --
> > Robert M. Hanson
> > Professor of Chemistry
> > St. Olaf College
> > 1520 St. Olaf Ave.
> > Northfield, MN 55057
> > http://www.stolaf.edu/people/hansonr
> > phone: 507-786-3107
> >
> >
> > If nature does not answer first what we want,
> > it is better to take what answer we get.
> >
> > -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> >
> ------------------------------------------------------------------------------
> > Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> > 30-Day
> > trial. Simplify your report design, integration and deployment - and
> > focus on
> > what you do best, core application coding. Discover what's new with
> > Crystal Reports now. http://p.sf.net/sfu/bobj-july
> > _______________________________________________
> > Jmol-developers mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
> Dr. Jonathan H. Gutow
> Chemistry Department [email protected]
> UW-Oshkosh Office:
> 920-424-1326
> 800 Algoma Boulevard FAX:920-424-2042
> Oshkosh, WI 54901
> http://www.uwosh.edu/facstaff/gutow
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Jmol-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
>
>
> --
> Robert M. Hanson
> Professor of Chemistry
> St. Olaf College
> 1520 St. Olaf Ave.
> Northfield, MN 55057
> http://www.stolaf.edu/people/hansonr
> phone: 507-786-3107
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> <
> substitute
> .txt
> >
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Jmol-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
Dr. Jonathan H. Gutow
Chemistry Department [email protected]
UW-Oshkosh Office:920-424-1326
800 Algoma Boulevard FAX:920-424-2042
Oshkosh, WI 54901
http://www.uwosh.edu/facstaff/gutow
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers