summaryrefslogtreecommitdiff
path: root/swat/style/qooxdoo/widgets/managers/QxImageManager.js
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-05 19:11:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:20 -0500
commit8808465e5b70fd6388ed02a2cfda6015ffc914e5 (patch)
tree6e4428825fa1fd21f5e5938a3c0fb16710471852 /swat/style/qooxdoo/widgets/managers/QxImageManager.js
parentb99bca56570c0b146128bc243d770bb354ae0cd5 (diff)
downloadsamba-8808465e5b70fd6388ed02a2cfda6015ffc914e5.tar.gz
samba-8808465e5b70fd6388ed02a2cfda6015ffc914e5.tar.bz2
samba-8808465e5b70fd6388ed02a2cfda6015ffc914e5.zip
r9133: a huge import of the qooxdoo infrastructure. I decided to import all the widgets to make experimenting easy during development. We can trim this back later to only the pieces we use
(This used to be commit 631a56da39ed0daae46ca89e57c10b09cf41c718)
Diffstat (limited to 'swat/style/qooxdoo/widgets/managers/QxImageManager.js')
-rw-r--r--swat/style/qooxdoo/widgets/managers/QxImageManager.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/swat/style/qooxdoo/widgets/managers/QxImageManager.js b/swat/style/qooxdoo/widgets/managers/QxImageManager.js
new file mode 100644
index 0000000000..233a9017eb
--- /dev/null
+++ b/swat/style/qooxdoo/widgets/managers/QxImageManager.js
@@ -0,0 +1,2 @@
+/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
+function QxImageManager(){if(QxImageManager._instance){return QxImageManager._instance;};this.addIconTheme("Crystal SVG","crystalsvg");this.addIconTheme("Nuvola","nuvola");this.addWidgetTheme("Windows","windows");QxManager.call(this);QxImageManager._instance=this;};QxImageManager.extend(QxManager,"QxImageManager");QxImageManager.addProperty({ name : "path", type : String, defaultValue : "../../images/" });QxImageManager.addProperty({name:"iconTheme",type:String,defaultValue:"crystalsvg"});QxImageManager.addProperty({name:"widgetTheme",type:String,defaultValue:"windows"});proto._iconThemes={};proto._widgetThemes={};proto.getBlank=function(){return this.getPath()+"core/blank.gif";};proto.buildURI=function(vPath){switch(vPath.charAt(0)){case "/":case ".":return vPath;default:switch(vPath.substring(0,vPath.indexOf(":"))){case "http":case "https":case "file":return vPath;};if(vPath.indexOf("icons")==0){return this.getPath() + "icons/" + this.getIconTheme() + "/" + vPath.substring(6);}else if(vPath.indexOf("widgets")==0){return this.getPath() + "widgets/" + this.getWidgetTheme() + "/" + vPath.substring(8);};return this.getPath()+vPath;};};proto._updateImages=function(){var o;for(var i in this._objects){o=this._objects[i];o.setPreloader(new QxImagePreloader(this.buildURI(o.getSource())));};return true;};proto._modifyPath=function(_b1,_b2,_b3,_b4){return this._updateImages();};proto._checkIconTheme=function(_b1){if(this._iconThemes[_b1]){return _b1;};for(var i in this._iconThemes){if(this._iconThemes[i].title==_b1){return i;};};throw new Error("Invalid icon theme id/title:"+_b1+"!");};proto._modifyIconTheme=function(_b1,_b2,_b3,_b4){return this._updateImages();};proto.addIconTheme=function(vHash,vTitle,vId,vPath){if(isInvalidString(vTitle)){throw new Error("Please define the title of the new icon theme.");};if(isInvalidString(vId)){var vId=vTitle.toLowerCase();};if(this._iconThemes[vId]){throw new Error("Theme is already defined:"+vId);};this._iconThemes[vId]={title:vTitle,path:vPath?vPath:vId};};proto.removeIconTheme=function(vHash,vTitle,vId){if(isInvalidString(vTitle)){throw new Error("Please define the title of the icon theme which should be removed.");};if(isInvalidString(vId)){var vId=vTitle.toLowerCase();};if(this.getDefaultIconTheme()==vId){throw new Error("Could not remove default theme "+this.getDefaultIconTheme()+"!");};if(this.getIconTheme()==vId){this.resetIconTheme();};delete this._iconThemes[vId];};proto._checkWidgetTheme=function(_b1){if(this._widgetThemes[_b1]){return _b1;};for(var i in this._widgetThemes){if(this._widgetThemes[i].title==_b1){return i;};};throw new Error("Invalid widget theme id/title:"+_b1+"!");};proto._modifyWidgetTheme=function(_b1,_b2,_b3,_b4){return this._updateImages();};proto.addWidgetTheme=function(vHash,vTitle,vId,vPath){if(isInvalidString(vTitle)){throw new Error("Please define the title of the new widget theme.");};if(isInvalidString(vId)){var vId=vTitle.toLowerCase();};if(this._widgetThemes[vId]){throw new Error("Theme is already defined:"+vId);};this._widgetThemes[vId]={title:vTitle,path:vPath?vPath:vId};};proto.removeWidgetTheme=function(vHash,vTitle,vId){if(isInvalidString(vTitle)){throw new Error("Please define the title of the widget theme which should be removed.");};if(isInvalidString(vId)){var vId=vTitle.toLowerCase();};if(this.getDefaultWidgetTheme()==vId){throw new Error("Could not remove default theme "+this.getDefaultWidgetTheme()+"!");};if(this.getWidgetTheme()==vId){this.resetWidgetTheme();};delete this._widgetThemes[vId];}; \ No newline at end of file