I've been playing with web page that can build an uncompressed dojo.js
by just calling into the JS files we use for a normal command line
build (I suggest trying in FF 2.0 if you are going to try it):

http://dojotoolkit.org/~jburke/wbuild/trunk/buildscripts/makeDojoJs.html
Click the Go button.

This page does not use any server-side scripts/processes to generate
the dojo.js contents. I can generate the dojo.js contents in a JS
variable, but the trick is getting the JS contents saved to the local
disk by the browser. I've tried the following approaches
unsuccessfully. If this issue can't be solved, then we'll need a
server process to generate the builds.

Things I've tried, that have been unsuccessful in FF 2.0:
1) window.open("javascript:opener.webbuild.getDojoContents()");
This is what the page currently does. FF 2.0 wraps the JS content in
some HTML tags.

2) window.open("data:text/javascript;" + webbuild.dojoContents);
When doing File, Save, some extra text gunk is saved at the beginning
of the file.

3) window.open("dojo.js.html");, then dojo.js.html does a
document.write() to write out the content: window.onload =
function(){
//Same problem if application/octet-stream is used.
document.open("text/javascript");
document.write(opener.webbuild.dojoContents);
document.close();
}
When doing File, Save, the saved page is the original HTML file with
the document.write() statements and not the JS content.

Anyone have any ideas?

Thanks,
James

Search Discussions

  • Alex Russell at Jan 8, 2007 at 10:21 pm

    On Monday 08 January 2007 9:12 pm, James Burke wrote:
    I've been playing with web page that can build an uncompressed
    dojo.js by just calling into the JS files we use for a normal command
    line build (I suggest trying in FF 2.0 if you are going to try it):

    http://dojotoolkit.org/~jburke/wbuild/trunk/buildscripts/makeDojoJs.h
    tml Click the Go button. [ snip ]
    2) window.open("data:text/javascript;" + webbuild.dojoContents);
    When doing File, Save, some extra text gunk is saved at the beginning
    of the file.
    What if you add "Content-Disposition: attachment;filename=dojo.js" or
    something similar to the beginning of this?

    Regards

    --
    Alex Russell
    alex@sitepen.com A99F 8785 F491 D5FD 04D7 ACD9 4158 FFDF 2894 6876
    alex@dojotoolkit.org BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: not available
    Type: application/pgp-signature
    Size: 186 bytes
    Desc: not available
    Url : http://dojotoolkit.org/pipermail/dojo-contributors/attachments/20070108/964b10a9/attachment.pgp
  • James Burke at Jan 8, 2007 at 10:32 pm

    On 1/8/07, Alex Russell wrote:
    On Monday 08 January 2007 9:12 pm, James Burke wrote:
    I've been playing with web page that can build an uncompressed
    dojo.js by just calling into the JS files we use for a normal command
    line build (I suggest trying in FF 2.0 if you are going to try it):

    http://dojotoolkit.org/~jburke/wbuild/trunk/buildscripts/makeDojoJs.h
    tml Click the Go button. [ snip ]
    2) window.open("data:text/javascript;" + webbuild.dojoContents);
    When doing File, Save, some extra text gunk is saved at the beginning
    of the file.
    What if you add "Content-Disposition: attachment;filename=dojo.js" or
    something similar to the beginning of this?
    When looking at what I believe to be the spec for data urls:
    http://www.ietf.org/rfc/rfc2397.txt

    I didn't see any room for other "headers" (just a mime type and a
    base64 flag). I tried the following, but didn't work:

    window.open("data:text/javascript;Content-Disposition:
    attachment;filename=dojo.js;" + webbuild.dojoContents);

    window.open("data:Content-Disposition:
    attachment;filename=dojo.js;text/javascript;" +
    webbuild.dojoContents);

    This site also didn't give me warm fuzzies about using data: urls;
    http://en.wikipedia.org/wiki/Data:_URI_scheme

    James
  • Paul Sowden at Jan 9, 2007 at 5:44 pm

    On 8 Jan 2007, at 21:12, James Burke wrote:

    Anyone have any ideas?
    I would suggest trying to write it as application/octet-stream so
    that the browser doesn't try to display it as opposed to text/
    javascript which some browsers will happily display.

    --
    Paul Sowden

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdojo-contributors @
categoriesdojo
postedJan 8, '07 at 10:11p
activeJan 9, '07 at 5:44p
posts4
users3
websitedojotoolkit.org

People

Translate

site design / logo © 2022 Grokbase