Modify image paths
The new qooxdoo version changes the image handling behavior compared to previous 0.1x versions.
Changes
Most important change: the property path was remove from QxImageManager. Therefore you can not use setPath anymore to customize your image locations.
But there is a replacement:
setCorePath() setIconPath() setWidgetPath()
All of these methods will automatically update already existing images when the corresponding properties change. Compared to the previous qooxdoo 0.1.x versions you must remove the slash at the end:
setPath("http://myserver.com/qx/images/");
will now be
setCorePath("http://myserver.com/qx/images/core"); setIconPath("http://myserver.com/qx/images/icons"); setWidgetPath("http://myserver.com/qx/images/widgets");
Redefine the default values
You can define the defaults of these values using the constants in QxSettings.js and recompile your qooxdoo.js afterwards:
imageCorePath : "../../images" imageIconPath : "../../themes/icons" imageWidgetPath : "../../themes/widgets"
Changing the paths using QxSettings
Starting with qooxdoo 0.5 you are able to define a QxSettings hash object before including any qooxdoo code into your page. Your definitions will then be merged with the default settings.
Include this for example before the script block which loads qooxdoo:
var QxSettings = { imageCorePath : "http://server/qooxdoo/images/core" imageIconPath : "http://server/qooxdoo/themes/icons" imageWidgetPath : "http://server/qooxdoo/themes/widgets" };
Changing the paths without QxSettings
If you don’t want to modify your QxSettings.js file, I would suggest you do the changes inside your window.application.pre (pre!) method. This will be executed before the rest of qooxdoo starts. If you do this later qooxdoo will update all images again (which will costs more resources/time) and should be omitted.
These three variables allows you to move the three icons to different structures of your web root or even different web hosts or domains.
Define own aliases
Also there are some new exiting features. You can now define aliases for image paths yourself. Which means instead of previously defining this:
var i1 = new QxImage("http://some-server.com/img/foo1.gif"); var i2 = new QxImage("http://some-server.com/img/foo2.gif");
you can now do:
QxImageManager.defineAlias("cache", "http://some-server.com/img"); var i1 = new QxImage("cache/foo1.gif"); var i2 = new QxImage("cache/foo2.gif");
