Hi,
I'm not sure this kind of email is the best way to share this code.
Petr, why not put that on qooxdoo contrib or sourceforge or whatever
you prefer so we could have a versioning system ?
I extracted the list if js files to load outside the main html file.
I'm thinking to this section :
qxscripts =
[
// Qooxdoo
qxsettings["qx.path"] + "/script/qx-" + qxsettings["qx.mode"]
+ ".js",
// Add here your scripts to load, you can use qxsettings[]
for base paths, etc...
];
is now an external js file, so the HTML file won't be specific to a
qooxdoo application and I could share it accross application.
Note : the <script type="text/javascript"> are outside the body and
this is important. Also the order of section are important.
This ensure qxsettings is defined first, then the file loader.js and
finally the javascript for the bar.
Here is the file loader.js placed at the same folder level as the html
file :
qxscripts =
[
// Qooxdoo
qxsettings["qx.path"] + "/script/qx-" + qxsettings["qx.mode"]
+ ".js",
// Add here your scripts to load, you can use qxsettings[]
for base paths, etc...
];
Here are the changes to the HTML file :
// No change before the /body
</body>
<script type="text/javascript">
// [Qooxdoo Settings]
qxsettings = {
// Application
"qx.application" : "novlog.ComposerBootstrap",
// Mode ("build" or "debug")
"qx.mode": "debug",
// Theme class to use
"qx.theme" : "qx.theme.Modern",
// Path to qooxdoo script files
"qx.path": "/qooxdoo-0.8.2",
// DEPRECATED
// Resources and script uri. If you are planning to have
qooxdoo in
// special uri (browser path), you can specify it here. There
is
// no rebuild process needed while changing qxsettings here!
"qx.resourcesUri": "./resource",
// Script uri
"qx.scriptUri": "./script"
};
</script>
<script type="text/javascript" src="./loader.js"></script>
<script type="text/javascript">
// [Script Loader]
//
// There is simple progress bar that can be customized. It's
important to
// remove it from DOM when loading is finished.
(function() {
// var w = 00;
var h = 50;
var totalFile = qxscripts.length;
var loadedFile = 0;
var body = document.getElementsByTagName("body")[0];
var bar = document.getElementById("bar");
var pbarcontainer = document.getElementById("pbarcontainer");
var ptext = document.getElementById("ptext");
var pbor = document.createElement("div");
var pbar = document.createElement("div");
pbor.style.position = "relative";
pbor.style.marginLeft = "15%";
pbor.style.marginRight = "15%";
pbor.style.border = "solid 1px #000000";
pbor.style.background = "#FFFFFF";
pbor.style.width = "70%";
pbor.style.height = h + "px";
pbar.style.position = "absolute";
pbar.style.border = "0px";
pbar.style.background = "#24ACF6";
pbar.style.width = "0px";
pbar.style.height = h + "px";
ScriptLoader.load({
scripts: qxscripts,
start: function() {
pbarcontainer.appendChild(pbor);
pbor.appendChild(pbar);
},
finish: function() {
pbor.removeChild(pbar);
pbarcontainer.removeChild(pbor);
body.removeChild(bar);
},
progress: function(percent, file) {
loadedFile++;
pbar.style.width = "" + Math.floor(percent * 100) +
"%";
ptext.innerHTML = "Loading file " + loadedFile + " /
" + totalFile;
}
});
}());
</script>
</html>------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel