//>>built define("dojox/mobile/deviceTheme", [ "dojo/_base/array", "dojo/_base/config", "dojo/_base/lang", "dojo/_base/window", "dojo/dom-class", "dojo/dom-construct", "require" ], function(array, config, lang, win, domClass, domConstruct, require){ var dm = lang.getObject("dojox.mobile", true); /*===== var dm = dojox.mobile =====*/ // module: // dojox/mobile/deviceTheme // summary: // Automatic Theme Loader // description: // Detects the User Agent of the browser and loads appropriate theme files. // Simply dojo.require this module to enable the automatic theme loading. // For simulations, the user agent may be overridden by setting djConfig.mblUserAgent. // // By default, an all-in-one theme file (e.g. themes/iphone/iphone.css) is // loaded. The all-in-one theme files contain style sheets for all the // dojox.mobile widgets regardless of whether they are used in your // application or not. // If you want to choose what theme files to load, you can specify them // via djConfig as shown in the following example: // // | djConfig="parseOnLoad:true, mblThemeFiles:['base','Button']" // // Or you may want to use dojox.mobile.themeFiles as follows to get the // same result. Note that the assignment has to be done before loading // deviceTheme.js. // // | dojo.require("dojox.mobile"); // | dojox.mobile.themeFiles = ['base','Button']; // | dojo.require("dojox.mobile.deviceTheme"); // // In the case of this example, if iphone is detected, for example, the // following files will be loaded: // // | dojox/mobile/themes/iphone/base.css // | dojox/mobile/themes/iphone/Button.css // // If you want to load style sheets for your own custom widgets, you can // specify a package name along with a theme file name in an array. // // | ['base',['com.acme','MyWidget']] // // In this case, the following files will be loaded. // // | dojox/mobile/themes/iphone/base.css // | com/acme/themes/iphone/MyWidget.css // // If you specify '@theme' as a theme file name, it will be replaced with // the theme folder name (e.g. 'iphone'). For example, // // | ['@theme',['com.acme','MyWidget']] // // will load the following files. // // | dojox/mobile/themes/iphone/iphone.css // | com/acme/themes/iphone/MyWidget.css // // Note that the load of the theme files is performed asynchronously by // the browser, and thus you cannot assume the load has been completed // when your appliation is initialized. For example, if some widget in // your application uses node dimensions that cannot be determined // without CSS styles being applied to them to calculate its layout at // initialization, the layout calculation may fail. // Possible workaround for this problem is to use dojo.require to load // deviceTheme.js and place it in a separate // | // |