--- Benoit Marchant <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> First of all, that generateBlueprint(0 feature is
> really cool and very  
> valuable !
> 
> I have some questions about the inline stuff.
> We tried to avoid having to do an
> insertInlineLayers() in the thread  
> round about inline layers, so I'm not sure what the
> benefit is ?

I had orginally used insertAllchildren() with two new
params: asInline and ignoreInline which would look
like:

insertAllchildren(asInline,ignoreInline)

This however would cause me to add much overhead to
the existing insertAllChildren() function.

I later then deceided to use insertBluePrint(src),
insertAllChildrenAsBlueprints(src) or
insertInlineLayers(src);

(everyone) Which method do you prefer? 

Blueprints are similar to inline layers. The only
difference is that you don't have to set the id of the
layers. It uses the same id structure generated by
dynapi plus it does not _importInlineValues as they
already exist within the dynlayer objects.

One other advantage of blueprint is that it does not
require the user to alter there existing code. They
can design the pages as the normally would with
dynlayers, widgets, etc. When finsihed with the design
they can then generate a blueprint and use that
blueprint improve the page's loading time. 

Blueprints are not meant for widget
designers/developers, it is meant for
application/webpage developers. It can however be used
to aid in the creation of widgets.

> Plus the way it is, if you mixed inline layers and
> non inline layers,  
> then it would lead to issues.
> In insertInlineLayers:
>   what is the purpose of sending
> DynElement._flagEvent(c,'precreate'); ?

Many widgets uses this flag to create last minute
values and objects just before the layers are created.
I had thought about removing it but I them decided
that it's will be of some use to other developers and
to some widgets.

> what is the purpose of the
> dynapi.frame.document.write ?

In my preliminary test I found out that <layers> are
much faster than <divs> when used inside ns4. So I
wanted a way to get the most out of ns4. for this
reason I added the src agrument to allow a user  to
insert a javascript which would contain the necessary
codes for either ns4 or dom/ie browsers:

if(!dynapi.ua.ns4)
dynapi.document.insertInlineLayers('speedtest.dynlayer.inline-basic-blueprint_def.js');
else
dynapi.document.insertInlineLayers('speedtest.dynlayer.inline-basic-blueprint_ns4.js');

So in truth and in fact users can
generateBlueprints(true) for ns4 or dom/ie browsers,
save it to a javascript file and then use
insertInlineLayers() to load the script for the
specified browser.

> Then, I don't see a way to call _importInlineValues
> later on if needed.

_importInlineValues is not used when blueprints are
created. The _noInlineValues property is set to true
for all child layers, thus bypassing the
_importInlineValues() function. We can however modify
insertInlineLayers() to bypass layers that already
have an inline is assign to them.
 
> I have a question about keeping variables for
> x,y,width etc ... past  
> creation in the dynlayers as these values are in the
> dom anyway. Is it  
> because it is a fact that accessing this.x is faster
> than  
> this.elm.style.offsetLeft ?

Yes

> I think it might be better to take the route of
> lazily mapping the  
> values, if there's really a benefit to map.
> The 2 benefit I see is first speed, you don't pay
> the price of  
> initializing values of layers that the user might
> not use, and second  
> it's transparency to the developer.
> 
> And for the layers created by dynapi code, it
> doesn't make a difference  
> since in that scenario, the variables would be
> mapped anyway.
> 
> Then it means that we don't use this.elm anymore,
> but this.getElm()  
> instead to ensure proper loading.
> For example for the dom case :
> 
> p.getDoc=function() {
>       if(!this.doc) {
>               this.doc = this.parent.getDoc();
>       }
>       return this.doc;
> }
> 
> p.getElm=function() {
>       if(!this.elm && this.id && this.isInline) {
>               this.elm = this.getDoc().getElementById(this.id);
>       }
>       return this.elm;
> };
> 
> p.getCSS=function() {
>       if(!this.css) {
>               this.css = this.getElm().style;
>       }
>       return this.css;
> };
> 
> p.getX=function() {
>       if(!this.x) {
>               this.x = this.getElm().offsetLeft;
>       }
>       return this.x||0
> };

Well, I have tested the scripts without calling
DynLayer._assignElemnts() and it's of little or no
benifit at all. It's kinda like "6 of one" and
"half-dozen of the other". The code found in
dyndocument line 106 offers major improvements when
assigning the elms after the page loads, making it as
fast as if they were they where never assing. For
example we can assing hundreds of elm within a few
milliseconds.
 
> Skipping the _importInlineValues part really does
> speed thing up. So  
> what do we do ?

Based on a suggestion you've made some time ago I've
added an ignoreInlineValues() function to dynlayers,
but I guess we could add this to setID(), correct?

A shortcut method would be to do the following:

var lyr=new DynLayer(null,100,100,100,100,'blue');
lyr._noInlinevalues=true;

--
Raymond Irving


> Benoit
> 
> 
> 
> 
> On Monday, March 17, 2003, at 09:24  PM, Raymond
> Irving wrote:
> 
> > Hello Everyone,
> >
> > I'm very happy to present to you the results of a
> > recent test I've done with a new inline feature I
> > called blueprint. The results are nothing but
> > fantastic:
> >
> > IE (Basic) = 200 @ 250ms, average 180ms
> > IE (Deep_Nest) = 100 @ 180ms, average 140ms
> >
> > How it works:
> >
> > The trick is to have dynapi generate the entire
> > blueprint or inline layers for the application
> you're
> > going to load. To do this you'll have to use the
> > dynapi.document.generateBlueprint() function. This
> > will display the inline layers inside the debugger
> > window. You must however remember to remove the
> > dynapi.document.generateBlueprint() and the debug
> > library once you're finshed.
> >
> > Now that you have the inline code you can insert
> it
> > into the document or a .js script. The next step
> is to
> > use dynapi.document.insertInlineLayers() function
> to
> > load the inline layers.
> >
> > New/modified functions:
> >
> > DynLayer._importInlineValues
> > DynLayer.prototype.ignoreInlineValues
> > dynapi.document.generateBlueprint
> > dynapi.document.insertInlineLayers
> >
> > You can download the files here:
> >
> >
>
http://www24.brinkster.com/dyntools/next/dynapi3x.zip
> >
> > See the online examples here:
> >
> > http://www24.brinkster.com/dyntools/next/examples/
> 
> > speedtest.dynlayer.inline-basic.html
> >
> > http://www24.brinkster.com/dyntools/next/examples/
> 
> > speedtest.dynlayer.inline-basic-dom.html
> >
> > http://www24.brinkster.com/dyntools/next/examples/
> 
> > speedtest.dynlayer.inline-deep_nest-dom.html
> >
> > Any comments?
> >
> >
> > Benoit,
> >
> > I hope this will solve the speed issue with inline
> > automation. Correct?
> >
> >
> >
> > --
> > Raymond Irving
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your desktop!
> > http://platinum.yahoo.com
> >
> >
> >
>
-------------------------------------------------------
> > This SF.net email is sponsored by:Crypto Challenge
> is now open!
> > Get cracking and register here for some mind
> boggling fun and
> > the chance of winning an Apple iPod:
> >
>
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> > _______________________________________________
> > Dynapi-Dev mailing list
> > [EMAIL PROTECTED]
> >
>
http://www.mail-archive.com/[EMAIL PROTECTED]/
> >
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by: Tablet PC.  
Does your code think in ink? You could win a Tablet PC. 
Get a free Tablet PC hat just for playing. What are you waiting for? 
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to