luke saunders | 1 Jun 2005 01:17
Picon

Re: Object Error in IE with changeURL (was Re: getting started (dojo.io.bind))

Yes, checking out the rep has solved my problem as well. This is
absolutely brilliant. Thanks for your help.

Apologies for raising a bug that was already fixed.

-luke

On 5/31/05, Lelon Stoldt <lbstoldt <at> gmail.com> wrote:
> > Ok, it looks like I've fixed this with rev 690. Update your SVN repo and
> > let me know if it's fixed for you.
> 
> Just rebuilt and did a quick test with xmlhttp_package_test.html.
> Seems to be fixed.  This is great news.  Thanks.
> 
> --
> Lelon
> lelon <at> lelon.net
> _______________________________________________
> Dojo-interest mailing list
> Dojo-interest <at> dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
Scott J. Miles | 1 Jun 2005 04:26

Debug Issues

Two questions re: debug,

(1) In latest revision, when isDebug is true, I get a lot of informational
messages on my page in IE but not in FF. What is the intended behavior? If
possible, it would be nice if the messages could be appended rather than
prepended to my document.

(2) The dojo.hostenv.loadModule API is wonderful: it manages lots of nasty
dependency issues. However, it also borks debugging (all errors are said to
come from "line 536 on bootstrap1.js"). Is there a way I can include a
widget code-file directly without having to also manually insert all the JS
files it depends on?

Thanks!

Scott

--

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.3.2 - Release Date: 5/31/2005
Scott J. Miles | 1 Jun 2005 04:31

Positioning and isContainer

I made a button widget, and I wanted to position it absolutely. Is there a
way to apply styles to my placeholder object that will 'stick' to the
widget? 

E.g., how can I position this object:

<img src="images/button.png" dojoType="TurboButton" Caption="Drop Table"
Glyph="images/table_drop.gif"/>

I realize I could to enclose it in some container, but that seems needlessly
cumbersome.

Also, I was hoping somebody could explain in more detail what 'isContainer'
flag does.

Scott

--

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.3.2 - Release Date: 5/31/2005
David Schontzler | 1 Jun 2005 05:12
Picon

Re: Debug Issues

On 5/31/05, Scott J. Miles <sjmiles <at> turbophp.com> wrote:
> Two questions re: debug,
> 
> (1) In latest revision, when isDebug is true, I get a lot of informational
> messages on my page in IE but not in FF. What is the intended behavior? If
> possible, it would be nice if the messages could be appended rather than
> prepended to my document.

The problem there is that the debug statements are attempting to
append to the body and it isn't available yet, so the debug statements
get lost. I always changed the catch() to document.write it out, but I
didn't know if it was safe enough to commit that. Maybe I'll do that
anyhow?

> (2) The dojo.hostenv.loadModule API is wonderful: it manages lots of nasty
> dependency issues. However, it also borks debugging (all errors are said to
> come from "line 536 on bootstrap1.js"). Is there a way I can include a
> widget code-file directly without having to also manually insert all the JS
> files it depends on?

I tried to make something that'd do that, but I didn't have much luck
the first go-round. I may try to do it again though. I'll keep you
informed.

-David
Scott J. Miles | 1 Jun 2005 05:31

Preloading images

Some of my widgets support selecting a stylesheet on the fly. Is there a way
for me to detect image references in the stylesheet for preloading?

My first thought is to check the widget's properties after the sheet is
loaded, but would the style information be there before the page is
rendered? Perhaps a timeout call to preload the extra images after the
browser has a chance to think?

Also, does it make sense for Dojo to have a utility function that forces an
image into the cache? I don't know if this task is trivial across-browsers.

Thanks again,
Scott

--

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.3.2 - Release Date: 5/31/2005
Scott J. Miles | 1 Jun 2005 05:33

RE: Debug Issues

Thanks for the info. I'll stay tuned.

Scott

-----Original Message-----
From: dojo-interest-bounces <at> dojotoolkit.org
[mailto:dojo-interest-bounces <at> dojotoolkit.org] On Behalf Of David Schontzler
Sent: Tuesday, May 31, 2005 8:13 PM
To: dojo-interest <at> dojotoolkit.org
Subject: Re: [Dojo-interest] Debug Issues

On 5/31/05, Scott J. Miles <sjmiles <at> turbophp.com> wrote:
> Two questions re: debug,
> 
> (1) In latest revision, when isDebug is true, I get a lot of informational
> messages on my page in IE but not in FF. What is the intended behavior? If
> possible, it would be nice if the messages could be appended rather than
> prepended to my document.

The problem there is that the debug statements are attempting to
append to the body and it isn't available yet, so the debug statements
get lost. I always changed the catch() to document.write it out, but I
didn't know if it was safe enough to commit that. Maybe I'll do that
anyhow?

> (2) The dojo.hostenv.loadModule API is wonderful: it manages lots of nasty
> dependency issues. However, it also borks debugging (all errors are said
to
> come from "line 536 on bootstrap1.js"). Is there a way I can include a
> widget code-file directly without having to also manually insert all the
(Continue reading)

Cameron Braid | 1 Jun 2005 05:50
Picon
Gravatar

Packaging Dojo / Custom Modules and Widgets

I am involved in the webwork project, and I am attempting to investigate how to package dojo and our custom extensions such that these things are possible :

 

1)       dojo widgets and modules are available

2)       webwork custom widgets and modules are available and separately deployable

3)       the user can use their own custom widgets and modules

 

I was hoping to be able to package our widgets modules into a separate build.  The reason for this is to allow the user to make their own dojo profile build, then include that instead of ours, and still be able to include our build.

 

I believe that currently dojo only supports a single baseRelativePath for loading modules and templates, which means that the widget templates and custom modules need to be packaged under a single parent folder.  Is it possible to change this, to support a more java classpath like idea ?

 

An example deployment scenario could be :

 

Deploy our bundled dojo profile build - __package.__.js and its src folder - into /webwork/dojo/profile

Deploy webwork custom dojo extensions – into /webwork/dojo/custom

            These can be packaged or deployed as individual files

WebWork User creates their custom widgets and modules and deploy into /widgets – either as a compressed __package__.js, or individual sources

 

The HTML file could could look like this :

 

<script type="text/javascript">

// Dojo configuration

djConfig = {

      // allow multiple resource loading paths for modules and widget resources

      baseRelativePaths: ["/webwork/dojo/profile", "/webwork/dojo/custom", "/dojoStuff"],

      isDebug: true

};

</script>

 

<!—- include the webwork bundled dojo profile build -->

<script language="JavaScript" type="text/javascript" src="/webwork/dojo/profile/__package__.js"></script>

 

<!—- use a webwork custom module from within webwork/dojo/custom -->

<script language="JavaScript" type="text/javascript">

dojo.hostenv.loadModule("webwork.util");

webwork.util.foo();

</script>

 

<!—- use the user’s custom module from within /dojoStuff -->

<script language="JavaScript" type="text/javascript">

dojo.hostenv.loadModule("project.utils");

      project.utils.bar();

</script>

 

To summarise and outline what would like :

 

1)       ClassPath like resource framework to be able to load resources from multiple resource paths – widget html / css / custom files

a.       This could even include the ability to package resources into the __package__.js file

2)       Provide a stand alone packager tool for dojo users to build their own packages

 

I would be happy with the ability to specify multiple base relative paths for the time being J

 

Cameron

_______________________________________________
Dojo-interest mailing list
Dojo-interest <at> dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest
David Schontzler | 1 Jun 2005 06:13
Picon

Re: Preloading images

On 5/31/05, Scott J. Miles <sjmiles <at> turbophp.com> wrote:
> Some of my widgets support selecting a stylesheet on the fly. Is there a way
> for me to detect image references in the stylesheet for preloading?

You could parse reference to images out of the stylesheet, but that
may incur some performance hit. On the other hand, you may be able to
use a little regex to grab URLs from the stylesheet if you pull it in
through the templateCSSPath.

Another option would be to create some dummy nodes that get the styles
of the to-be-shown images and just position them off screen somewhere.
Not sure if that's a good solution.

> My first thought is to check the widget's properties after the sheet is
> loaded, but would the style information be there before the page is
> rendered? Perhaps a timeout call to preload the extra images after the
> browser has a chance to think?

Sure, style info should be available for the widget. You may find 
dojo.xml.domUtil.getStyle(node, cssSelector) very useful in that case
(note: cssSelector is in style-case, i.e. "background-image" not
"backgroundImage").

> Also, does it make sense for Dojo to have a utility function that forces an
> image into the cache? I don't know if this task is trivial across-browsers.

If you do the following:

var img = new Image();
img.src = "path/to/image.gif";

It should get cached by the browser, unless, of course, you are on
https. (Side note: this is one technique for sending data to the
server, i.e. img.src = "not/really/an/image.php?somevar=foo".)

-David
David Schontzler | 1 Jun 2005 06:52
Picon

Re: Debug Issues

Alright, so I went ahead and made dj_debug do a doc.write as a last
resort. I think that this may be a bit little dangerous, since
document.write can clobber a page, but it first attempts to append
something to the document, which shouldn't fail if there is a page. If
anyone has problems with that, please let me know!

-David

On 5/31/05, Scott J. Miles <sjmiles <at> turbophp.com> wrote:
> Thanks for the info. I'll stay tuned.
> 
> Scott
> 
> -----Original Message-----
> From: dojo-interest-bounces <at> dojotoolkit.org
> [mailto:dojo-interest-bounces <at> dojotoolkit.org] On Behalf Of David Schontzler
> Sent: Tuesday, May 31, 2005 8:13 PM
> To: dojo-interest <at> dojotoolkit.org
> Subject: Re: [Dojo-interest] Debug Issues
> 
> On 5/31/05, Scott J. Miles <sjmiles <at> turbophp.com> wrote:
> > Two questions re: debug,
> >
> > (1) In latest revision, when isDebug is true, I get a lot of informational
> > messages on my page in IE but not in FF. What is the intended behavior? If
> > possible, it would be nice if the messages could be appended rather than
> > prepended to my document.
> 
> The problem there is that the debug statements are attempting to
> append to the body and it isn't available yet, so the debug statements
> get lost. I always changed the catch() to document.write it out, but I
> didn't know if it was safe enough to commit that. Maybe I'll do that
> anyhow?
> 
> > (2) The dojo.hostenv.loadModule API is wonderful: it manages lots of nasty
> > dependency issues. However, it also borks debugging (all errors are said
> to
> > come from "line 536 on bootstrap1.js"). Is there a way I can include a
> > widget code-file directly without having to also manually insert all the
> JS
> > files it depends on?
> 
> I tried to make something that'd do that, but I didn't have much luck
> the first go-round. I may try to do it again though. I'll keep you
> informed.
> 
> -David
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.322 / Virus Database: 267.3.2 - Release Date: 5/31/2005
> 
> 
> _______________________________________________
> Dojo-interest mailing list
> Dojo-interest <at> dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
Cameron Braid | 1 Jun 2005 08:04
Picon
Gravatar

Widget writing issues

I have managed to create a widget, basing it on the code in
http://dojotoolkit.org/fast_widget_authoring.html - great work there :)

I created my new widget in the dojo.webui.widgets package.

Now, I wish to move it into my own package webwork.widgets, and I can't seem
to get it to work. I keep getting this : 

"DEBUG: TypeError: twidget has no properties"

And that's all - see the code below.

Also - some things that don't make sense to me are :

1) why does the SlideShow.js define two packages 
	a) dojo.webui.widgets.SlideShow
	b) dojo.webui.widgets.HTMLSlideShow

	then only create a class for dojo.webui.widgets.HTMLSlideShow

2) why do the class names have to start with HTML ?  I tried to create a
SlideShow2 widget, using the exact same code, except for not using the HTML
prefix, and I couldn't get it to work.  Is there an design decision here ?

3) is there something special about the 'dojo' package, since it doesn't
exist as a folder relative to the baseRelativePath.

4) do the templates for widgets have to exist in any particular package, or
can they be in any package ?

5) can I use a custom tag namespace 

	e.g.
dojo.webui.widgets.tags.addParseTreeHandler("webwork:remotediv")

6) why do I need to call both 

	dojo.webui.DomWidget.call(this) (from the constructor)
	dj_inherits(MYCLASS, dojo.webui.DomWidget);

Thanks for your great work on dojo.

Cameron.

------------------------------------------

Here is the code - note it doesn't do anything yet.. gotta get it to 'alert'
first.

dojo.hostenv.startPackage("webwork.RemoteDiv");
dojo.hostenv.startPackage("webwork.HTMLRemoteDiv");

dojo.hostenv.loadModule("dojo.event.*");
dojo.hostenv.loadModule("dojo.xml.*");
dojo.hostenv.loadModule("dojo.io.*");
dojo.hostenv.loadModule("dojo.webui.widgets.Parse");
dojo.hostenv.loadModule("dojo.webui.Widget");
dojo.hostenv.loadModule("dojo.webui.DomWidget");
dojo.hostenv.loadModule("dojo.webui.WidgetManager");

/*
 * Component to do remote updating of a DOM tree.
 */

webwork.HTMLRemoteDiv = function() {
	
	// is this needed as well as the dj_inherits calls below
	// this coppied from slideshow
	dojo.webui.Widget.call(this);
	dojo.webui.DomWidget.call(this, true);
	dojo.webui.HTMLWidget.call(this);

	this.templatePath = "webwork/HTMLRemoteDiv.html";

	this.isContainer = false;
	this.widgetType = "RemoteDiv";

	// dom node in the template that will contain the remote content
	this.contentDiv = null;
	
	// closure trickery
	var _this = this;
	
	this.fillInTemplate = function() {
		alert('fill it in');
	}

}

// is this needed as well as dojo.webui.Widget.call(this);
dj_inherits(webwork.HTMLRemoteDiv, dojo.webui.DomWidget);

// allow the markup parser to construct these widgets
dojo.webui.widgets.tags.addParseTreeHandler("webwork:remotediv");

template :

<div dojoAttachPoint='contentDiv'></div>

Gmane