[Dojo-interest] cross-domain build doesn't find NLS file
ben hockey
neonstalwart at gmail.com
Tue Aug 2 09:44:06 EDT 2011
in general you may find dojo 1.7 to be more amenable to what you're
trying to achieve. in fact i wouldn't suggest this to many people but
in your case i would highly recommend working from trunk. i know from
first hand experience that trying to build a web widget with anything
before dojo 1.7 is much more difficult. there are many features in dojo
1.7 that will make your life easier when building a web widget - most
(if not all) of these helpful features are related to the loader. i'm
not sure if there's anything specifically related to your question in
this thread but most of the "features" mentioned in the ticket you
linked to have changed or been replaced by a better option.
for example, if you grep the trunk source code you'll find no reference
to rePkg. also, scopeMap has been replaced by a completely different
mechanism that's configured in a different way. you may not like to
hear some of this but i'm telling you now so that you don't waste any
more time on something that is about to be obsolete.
i've faced a number of the difficulties you're facing with building a
web widget so if you'd like me to outline my approach then let me know
and i'll give you more details. to give you an idea of how i start, i
don't have the user include a script that directly links to my build of
dojo but instead i have them include a snippet like the google analytics
async snippet. for example:
<script>
(function () {
var el = document.createElement('script'),
s = document.getElementsByTagName('script')[0];
el.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') +
'myDomain.com/webWidget';
el.type = 'text/javascript';
el.async = true;
s.parentNode.insertBefore(el, s);
}());
</script>
alternatively, you could potentially have your users include the
following script tag if its sufficient for your needs
<script src="http://www.myDomain.com/webWidget"></script>
then the file at myDomain.com/webWidget is a reference to a bootstrap
that is still not yet dojo. this is a server "templated" file. this
allows the server to substitute values into certain places in the file
and the result is a javascript file that contains the following:
- dojo's baseUrl (injected by the server templating)
- a dojoConfig object (you could have parts of this templated by
the server)
- code to inject the styleSheet
- code to inject dojo.js
following this approach, you don't need to rename dojo.js because it
gets injected as dojo.js by the bootstrap.
anyhow, hopefully this helps and feel free to ask more about the details
of how i've approached this. i want to make sure you don't waste time
chasing a dead-end.
ben...
On 8/2/2011 3:43 AM, Felix E. Klee wrote:
> On Mon, Aug 1, 2011 at 6:10 PM, Felix E. Klee<felix.klee at inka.de>
> wrote:
>> * How do I make the base path relative to the position of the
>> cross-domain file?
> After looking at the source, I concluded that this is not possible. So I
> added a comment to ticket 8783:
>
> http://bugs.dojotoolkit.org/ticket/8783#comment:8
>
> Would it be possible that someone reopens that ticket as a feature
> request?
>
> Note that automatic detection of the base path is essential if one wants
> to use Dojo for building simple to use web-widgets.
> ________________________________________________________
> Dojotoolkit: http://dojotoolkit.org
> Reference Guide: http://dojotoolkit.org/reference-guide
> API Documentation: http://dojotoolkit.org/api
> Tutorials: http://dojotoolkit.org/documentation
>
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
More information about the Dojo-interest
mailing list