Question on the bootstrap-loader implementation: How do I create a custom bootstrap (with progress indicator) for my project correctly?
*) After compilation with pyjs there is a 'bootstrap.js' and a 'bootstrap_progress.js' in the output/ folder. This is just for the developer's convenience, right? One of them (bootstrap_progress.js) is not used by default; 'bootstrap_progress.js' is just an _example_ of how to implement a bootstrap startup animation. *) The pyjsbuild command has a parameter --bootstrap-file=BOOTSTRAP_FILE *) So, I'm expected to take one of the two bootstrap Javascript files, customize the function __pygwt_earlyUser(), save the customized bootstrap.js file (preferably in the application base folder, _not_ in public/) and run 'pyjsbuild --bootstrap-file=bootstrap.js <app_name>.py' everytime I want to build the Javascript code for deployment. Is this correct? 2012/2/25 lkcl luke <[email protected]>: >> So, if you really really by all means want that in the bootstrap >> loader, what shall I do? > > what i would suggest is this (documented, of course): > > * look for a div with an id of "bootstrap-loader". > * if it doesn't exist, create one, and add it with a "float" and a > higher z-index, perhaps centre it etc. etc. > * add the gif image to it (again, using DOM appendChild) > * run the usual stuff > * after everything's loaded, remove the div. All those steps (bullets from above) are expected to happen in the bootstrap.js __pygwt_earlyUser() function, correct? > in this way, the operation of the bootstrap loader does *not* > interfere with pyjd. Interestingly, all this is already in there (as a static implementation in index.html) with the only difference that the z-index is -1 and the bootstrap-loader div is therefore covered by the elements that the website.py application creates (i.e. the violet/pink header). What's missing is that the div is removed after all loading is completed. Just for curiosity's sake: The bootstrap.js is not (supposed to be) executed when running the app with pyjd? What's so important about that? Why, as we're happy with a dumb animation and are not looḱing for a sophisticated full-featured progress bar show the percentage of completion, why do we strictly want the image to be inserted into the DOM by Javascript? What if loading the bootstrap javascript file fails? (Note: _that_ is the weak link!) Nothing would be displayed; typically a _blank_ page would show up, ouch! I do understand that, as for semantics, showing the loading progress sort of "belongs to" the javascript activities. Peter

