On Sun, Feb 26, 2012 at 10:45 PM, Peter Bittner <[email protected]> wrote: > One thing remains for me to understand pyjd and bootstrap.js:
yyup. what there is to understand is: there is nothing to understand about pyjd and bootstrap.js :) > 2012/2/26 lkcl luke <[email protected]>: >> yes. and as such should never interfere with the operation of the >> exact same application when run as a pyjd application, which will >> never run or execute or even have access to that javascript loader, >> whatsoever. > > We do have the pyjd setup line in the Pyjamas Desktop application, > e.g. for website.py this says to fire up index.html: > > pyjd.setup("http://127.0.0.1/pyjamas/doc/pyjs_site/public/index.html") > > Now, this index.html file _does_ include bootstrap.js, simply because > there is the following line in there: > > <script type="text/javascript" src="bootstrap.js"></script> yes. i know. it's a pain. > The only reason why this file may not be loaded with Pyjamas Desktop > is because bootstrap.js doesn't exist in ./public/ yyyep. absolutely. you got it. > (only in ./output/ > !). This said, it's all thanks to an Error 404 -- not even showing up > when running the application with pyjd. correct! > There's something wrong with the pyjd.setup versus the separation of > pyjs and pyjd. Or I'm missing some puzzle piece here. no, you've got it. the alternative to the above is to actually have *two* separate - but otherwise completely identical - html loader files. one with bootstrap.js script tag. one without. that's a bit... lame and massively inconvenient, so, given that nothing happens (you spotted that there's no 404 error :) it's been left as-is. plus, remember - people might *want* that bootstrap.js there! there's nothing to stop people putting an *entire* pyjs-compiled application into the public/ folder, is there? there's nothing to stop people putting an entire pyjs-compiled application into the public/ folder.... and then running a COMPLETELY DIFFERENT one via pyjd, is there? under such incredibly bizarre circumstances, you'd *need* bootstrap.js there because it would be loading the pyjs-pre-compiled application, wouldn't it? and that pyjs-pre-compiled application would have NOTHING TO DO WITH the complete and totally separate pyjd-based one, would it? however - i've got an idea. what about *removing* the requirement to have bootstrap.js (entirely) from the public/ loader files, and having the pyjs compiler actually go and parse the HTML and put it in, when the file gets copied into the output/ folder?? or perhaps having it commented-out <!-- <script .... --> and the pyjsbuild process removing the comments when copying to output/ ? or perhaps having a comment-marker <!-- PYJSBOOTSTRAP --> the advantage of substitution is that in the case where --progress-loader=blahblah it's done entirely from the command-line, there's no need to go editing public/{loader}.html l.

