On Sun, Jan 29, 2012 at 5:58 PM, Peter Bittner <[email protected]> wrote:
> Holy crap, I intended to make a nice litte contribution this morning,
> and look what happend ...
>
> Anyways, it looks like I don't fully get what you guys want with the
> pyjsbuild and the bootstrap_progress.js, this is all too much rocket
> for me. Or what?
> After lots of thinking I have decided to do what I intended and pushed
> some changes to the pyjs_site in the repo on SF. It's just a GIF file
> and some minor modification to index.html and pyjs.css, we can always
> undo it quickly. (I don't recommend reverting as I fixed some CSS and
> HTML flaws, I would manually remove what needs to go away.)

my intention wasn't to discourage a change to the pyjs.org site, only
to avoid adding a useless option to pyjsbuild (i know this was
unrelated to your original suggestion).

it's all good :-)

>> bootstrap file is responsible for getting the whole party started --
>> it searches for pygwt:module meta tags, loads the corresponding
>
> Aha, now I know that it was _just good_ that I didn't remove the
> pygwt:module meta tag from index.html that the W3C validator
> complained about! ;-)

pfft, validation schmalidation ... robust HTML/CSS never passes those
pointless hoops.

if your interested, you can actually do a little more with that meta
tag, like load the pygwt:module from a different directory ...
bootstrap file will detail it a bit more.

>> there is a module controller in that file that you can hook into, and
>> an empty function called __pygwt_earlyuser ... this function will be
>> called before anything else (essentially the very first thing done),
>> giving you a chance to use raw javascript to create a bootsplash/etc
>> ... whatever you want really.
>
> I see. But is there a real advantage compared to just adding an image
> and some CSS in the index.html document? Probably that there could be
> code used from the pyjamas framework itself, and so avoid reinventing
> the wheel (design/copy a spinner, add CSS code) for every web site /
> pyjamas application?

there is no advantage. the CSS/image as you suggested will work fine.
a `bootsplash` was just an obvious example to demonstrate use of the
modController callbacks within the early user function -- it wasn't
created specifically for that reason (it's the only way to have a real
progress bar though).  sometime in the future, i will add callbacks to
the modules themselves (vs. <script> tag) ... this way the loading
code works for apps that do not use --multi-file.  once that is done,
and maybe a couple other tweaks, it will be possible to have a generic
bootsplash_progress file with configurable image.

>> it was designed this way to avoid tons of options for minor changes --
>> simply add the custom code you want to the early user routine -- it's
>> sort of like an initramfs in linux.
>
> Looks very much elaborated.
>
> But help me understand: Does that mean I have to go into the
> JavaScript file and add custom JavaScript code in the
> __pygwt_earlyUser() function? For a loading spinner or a progress bar?
> Tell me this is made with Python somewhere else, please.

how can you run python at this point?  you are trying to show a
progress bar *while the python support system is initializing*.  a bit
of chicken-and-egg going on there.

> Please let me know how you like the startup progress bar on the
> pyjs_site.

the CSS/HTML route is the simplest and most effective, imo ... no
complaints there.  it's not a big deal at this point if it's not
removed.  if you want to add the code to handle that go for it,
otherwise it'll happen in due time.

like i said before, the early user code is just one way to do it, esp.
if you wan't more advanced/accurate loading/handling, eg. if the app
fails, the early code can actually catch this and react intelligently
vs. CSS-only), or if you need to do some javascripticus before the
pyjamas engine takes over.

> The GIF has a "Created with ajaxload.info" comment built-in (you can
> see it in the binary and, e.g., with GIMP). That's what it came with.

that's fine and doesn't relate to Copyright file.  per their site
"Generated gifs are totally free for use" ... they intend for you to
own the file, not them.

-- 

C Anthony

Reply via email to