dojo._xdResourceLoaded(function(dojo, dijit, dojox){ dojo.loadInit(function(){ // Since loaderInit can be fired before any dojo.provide/require calls, // make sure the dojox.gfx object exists and only run this logic if dojox.gfx.renderer // has not been defined yet. var gfx = dojo.getObject("dojox.gfx", true), sl, flag, match; while(!gfx.renderer){ // Have a way to force a GFX renderer, if so desired. // Useful for being able to serialize GFX data in a particular format. if(dojo.config.forceGfxRenderer){ dojox.gfx.renderer = dojo.config.forceGfxRenderer; break; } var renderers = (typeof dojo.config.gfxRenderer == "string" ? dojo.config.gfxRenderer : "svg,vml,canvas,silverlight").split(","); for(var i = 0; i < renderers.length; ++i){ switch(renderers[i]){ case "svg": // the next test is from https://github.com/phiggins42/has.js if("SVGAngle" in dojo.global){ dojox.gfx.renderer = "svg"; } break; case "vml": if(dojo.isIE){ dojox.gfx.renderer = "vml"; } break; case "silverlight": try{ if(dojo.isIE){ sl = new ActiveXObject("AgControl.AgControl"); if(sl && sl.IsVersionSupported("1.0")){ flag = true; } }else{ if(navigator.plugins["Silverlight Plug-In"]){ flag = true; } } }catch(e){ flag = false; }finally{ sl = null; } if(flag){ dojox.gfx.renderer = "silverlight"; } break; case "canvas": if(dojo.global.CanvasRenderingContext2D){ dojox.gfx.renderer = "canvas"; } break; } if(gfx.renderer){ break; } } break; } if(dojo.config.isDebug){ console.log("gfx renderer = " + gfx.renderer); } // load & initialize renderer if(gfx[gfx.renderer]){ // already loaded gfx.switchTo(gfx.renderer); }else{ // load gfx.loadAndSwitch = gfx.renderer; dojo["require"]("dojox.gfx." + gfx.renderer); } }); return {depends: [["provide", "dijit._base.manager"], ["provide", "dojo.Stateful"], ["provide", "dijit._WidgetBase"], ["provide", "dojo.window"], ["provide", "dijit._base.focus"], ["provide", "dojo.AdapterRegistry"], ["provide", "dijit._base.place"], ["provide", "dijit._base.window"], ["provide", "dijit._base.popup"], ["provide", "dijit._base.scroll"], ["provide", "dojo.uacss"], ["provide", "dijit._base.sniff"], ["provide", "dijit._base.typematic"], ["provide", "dijit._base.wai"], ["provide", "dijit._base"], ["provide", "dijit._Widget"], ["provide", "dojox.gfx.matrix"], ["provide", "dojox.gfx._base"], ["provide", "dojox.gfx"], ["provide", "dojox.lang.functional.lambda"], ["provide", "dojox.lang.functional.array"], ["provide", "dojox.lang.functional.object"], ["provide", "dojox.lang.functional"], ["provide", "dojox.lang.functional.fold"], ["provide", "dojox.lang.functional.reversed"], ["provide", "dojox.charting.Element"], ["provide", "dojo.colors"], ["provide", "dojox.color._base"], ["provide", "dojox.color"], ["provide", "dojox.color.Palette"], ["provide", "dojox.lang.utils"], ["provide", "dojox.gfx.gradutils"], ["provide", "dojox.charting.Theme"], ["provide", "dojox.charting.Series"], ["provide", "dojox.charting.axis2d.common"], ["provide", "dojox.charting.Chart"], ["provide", "dojox.charting.widget.Chart"], ["provide", "dojo.fx.easing"], ["provide", "dojox.gfx.fx"], ["provide", "dojox.charting.action2d.Base"], ["provide", "dojox.charting.action2d.Highlight"], ["provide", "dojo.fx.Toggler"], ["provide", "dojo.fx"], ["provide", "dojox.charting.action2d.Magnify"], ["provide", "dojox.lang.functional.scan"], ["provide", "dojox.charting.action2d.MoveSlice"], ["provide", "dojox.charting.action2d.Shake"], ["provide", "dojo.string"], ["provide", "dojo.date.stamp"], ["provide", "dojo.parser"], ["provide", "dojo.cache"], ["provide", "dijit._Templated"], ["provide", "dijit.Tooltip"], ["provide", "dojox.charting.action2d.Tooltip"], ["provide", "dojox.charting.scaler.common"], ["provide", "dojox.charting.scaler.linear"], ["provide", "dojox.charting.axis2d.Base"], ["provide", "dojox.charting.axis2d.Invisible"], ["provide", "dojox.charting.axis2d.Default"], ["provide", "dojox.charting.plot2d.common"], ["provide", "dojox.charting.scaler.primitive"], ["provide", "dojox.charting.plot2d._PlotEvents"], ["provide", "dojox.charting.plot2d.Base"], ["provide", "dojox.charting.plot2d.Default"], ["provide", "dojox.charting.plot2d.Lines"], ["provide", "dojox.charting.plot2d.Areas"], ["provide", "dojox.charting.plot2d.Markers"], ["provide", "dojox.charting.plot2d.MarkersOnly"], ["provide", "dojox.charting.plot2d.Scatter"], ["provide", "dojox.lang.functional.sequence"], ["provide", "dojox.charting.plot2d.Stacked"], ["provide", "dojox.charting.plot2d.StackedLines"], ["provide", "dojox.charting.plot2d.StackedAreas"], ["provide", "dojox.charting.plot2d.Columns"], ["provide", "dojox.charting.plot2d.StackedColumns"], ["provide", "dojox.charting.plot2d.ClusteredColumns"], ["provide", "dojox.charting.plot2d.Bars"], ["provide", "dojox.charting.plot2d.StackedBars"], ["provide", "dojox.charting.plot2d.ClusteredBars"], ["provide", "dojox.charting.plot2d.Grid"], ["provide", "dojox.charting.plot2d.Pie"], ["provide", "dojox.charting.plot2d.Bubble"], ["provide", "dojox.charting.plot2d.Candlesticks"], ["provide", "dojox.charting.plot2d.OHLC"], ["provide", "dojox.charting.plot2d.Spider"], ["provide", "dojox.charting.Chart2D"], ["provide", "dojox.charting.widget.Chart2D"], ["provide", "dojox.charting.themes.GreySkies"], ["provide", "dojox.charting.widget.Sparkline"], ["provide", "dojox.charting.widget.Legend"]], defineResource: function(dojo, dijit, dojox){/* Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ /* This is an optimized version of Dojo, built for deployment and not for development. To get sources and documentation, please visit: http://dojotoolkit.org */ if(!dojo._hasResource["dijit._base.manager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dijit._base.manager"] = true; dojo.provide("dijit._base.manager"); dojo.declare("dijit.WidgetSet", null, { // summary: // A set of widgets indexed by id. A default instance of this class is // available as `dijit.registry` // // example: // Create a small list of widgets: // | var ws = new dijit.WidgetSet(); // | ws.add(dijit.byId("one")); // | ws.add(dijit.byId("two")); // | // destroy both: // | ws.forEach(function(w){ w.destroy(); }); // // example: // Using dijit.registry: // | dijit.registry.forEach(function(w){ /* do something */ }); constructor: function(){ this._hash = {}; this.length = 0; }, add: function(/*dijit._Widget*/ widget){ // summary: // Add a widget to this list. If a duplicate ID is detected, a error is thrown. // // widget: dijit._Widget // Any dijit._Widget subclass. if(this._hash[widget.id]){ throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered"); } this._hash[widget.id] = widget; this.length++; }, remove: function(/*String*/ id){ // summary: // Remove a widget from this WidgetSet. Does not destroy the widget; simply // removes the reference. if(this._hash[id]){ delete this._hash[id]; this.length--; } }, forEach: function(/*Function*/ func, /* Object? */thisObj){ // summary: // Call specified function for each widget in this set. // // func: // A callback function to run for each item. Is passed the widget, the index // in the iteration, and the full hash, similar to `dojo.forEach`. // // thisObj: // An optional scope parameter // // example: // Using the default `dijit.registry` instance: // | dijit.registry.forEach(function(widget){ // | console.log(widget.declaredClass); // | }); // // returns: // Returns self, in order to allow for further chaining. thisObj = thisObj || dojo.global; var i = 0, id; for(id in this._hash){ func.call(thisObj, this._hash[id], i++, this._hash); } return this; // dijit.WidgetSet }, filter: function(/*Function*/ filter, /* Object? */thisObj){ // summary: // Filter down this WidgetSet to a smaller new WidgetSet // Works the same as `dojo.filter` and `dojo.NodeList.filter` // // filter: // Callback function to test truthiness. Is passed the widget // reference and the pseudo-index in the object. // // thisObj: Object? // Option scope to use for the filter function. // // example: // Arbitrary: select the odd widgets in this list // | dijit.registry.filter(function(w, i){ // | return i % 2 == 0; // | }).forEach(function(w){ /* odd ones */ }); thisObj = thisObj || dojo.global; var res = new dijit.WidgetSet(), i = 0, id; for(id in this._hash){ var w = this._hash[id]; if(filter.call(thisObj, w, i++, this._hash)){ res.add(w); } } return res; // dijit.WidgetSet }, byId: function(/*String*/ id){ // summary: // Find a widget in this list by it's id. // example: // Test if an id is in a particular WidgetSet // | var ws = new dijit.WidgetSet(); // | ws.add(dijit.byId("bar")); // | var t = ws.byId("bar") // returns a widget // | var x = ws.byId("foo"); // returns undefined return this._hash[id]; // dijit._Widget }, byClass: function(/*String*/ cls){ // summary: // Reduce this widgetset to a new WidgetSet of a particular `declaredClass` // // cls: String // The Class to scan for. Full dot-notated string. // // example: // Find all `dijit.TitlePane`s in a page: // | dijit.registry.byClass("dijit.TitlePane").forEach(function(tp){ tp.close(); }); var res = new dijit.WidgetSet(), id, widget; for(id in this._hash){ widget = this._hash[id]; if(widget.declaredClass == cls){ res.add(widget); } } return res; // dijit.WidgetSet }, toArray: function(){ // summary: // Convert this WidgetSet into a true Array // // example: // Work with the widget .domNodes in a real Array // | dojo.map(dijit.registry.toArray(), function(w){ return w.domNode; }); var ar = []; for(var id in this._hash){ ar.push(this._hash[id]); } return ar; // dijit._Widget[] }, map: function(/* Function */func, /* Object? */thisObj){ // summary: // Create a new Array from this WidgetSet, following the same rules as `dojo.map` // example: // | var nodes = dijit.registry.map(function(w){ return w.domNode; }); // // returns: // A new array of the returned values. return dojo.map(this.toArray(), func, thisObj); // Array }, every: function(func, thisObj){ // summary: // A synthetic clone of `dojo.every` acting explicitly on this WidgetSet // // func: Function // A callback function run for every widget in this list. Exits loop // when the first false return is encountered. // // thisObj: Object? // Optional scope parameter to use for the callback thisObj = thisObj || dojo.global; var x = 0, i; for(i in this._hash){ if(!func.call(thisObj, this._hash[i], x++, this._hash)){ return false; // Boolean } } return true; // Boolean }, some: function(func, thisObj){ // summary: // A synthetic clone of `dojo.some` acting explictly on this WidgetSet // // func: Function // A callback function run for every widget in this list. Exits loop // when the first true return is encountered. // // thisObj: Object? // Optional scope parameter to use for the callback thisObj = thisObj || dojo.global; var x = 0, i; for(i in this._hash){ if(func.call(thisObj, this._hash[i], x++, this._hash)){ return true; // Boolean } } return false; // Boolean } }); (function(){ /*===== dijit.registry = { // summary: // A list of widgets on a page. // description: // Is an instance of `dijit.WidgetSet` }; =====*/ dijit.registry = new dijit.WidgetSet(); var hash = dijit.registry._hash, attr = dojo.attr, hasAttr = dojo.hasAttr, style = dojo.style; dijit.byId = function(/*String|dijit._Widget*/ id){ // summary: // Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId()) return typeof id == "string" ? hash[id] : id; // dijit._Widget }; var _widgetTypeCtr = {}; dijit.getUniqueId = function(/*String*/widgetType){ // summary: // Generates a unique id for a given widgetType var id; do{ id = widgetType + "_" + (widgetType in _widgetTypeCtr ? ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0); }while(hash[id]); return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String }; dijit.findWidgets = function(/*DomNode*/ root){ // summary: // Search subtree under root returning widgets found. // Doesn't search for nested widgets (ie, widgets inside other widgets). var outAry = []; function getChildrenHelper(root){ for(var node = root.firstChild; node; node = node.nextSibling){ if(node.nodeType == 1){ var widgetId = node.getAttribute("widgetId"); if(widgetId){ var widget = hash[widgetId]; if(widget){ // may be null on page w/multiple dojo's loaded outAry.push(widget); } }else{ getChildrenHelper(node); } } } } getChildrenHelper(root); return outAry; }; dijit._destroyAll = function(){ // summary: // Code to destroy all widgets and do other cleanup on page unload // Clean up focus manager lingering references to widgets and nodes dijit._curFocus = null; dijit._prevFocus = null; dijit._activeStack = []; // Destroy all the widgets, top down dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){ // Avoid double destroy of widgets like Menu that are attached to
// even though they are logically children of other widgets. if(!widget._destroyed){ if(widget.destroyRecursive){ widget.destroyRecursive(); }else if(widget.destroy){ widget.destroy(); } } }); }; if(dojo.isIE){ // Only run _destroyAll() for IE because we think it's only necessary in that case, // and because it causes problems on FF. See bug #3531 for details. dojo.addOnWindowUnload(function(){ dijit._destroyAll(); }); } dijit.byNode = function(/*DOMNode*/ node){ // summary: // Returns the widget corresponding to the given DOMNode return hash[node.getAttribute("widgetId")]; // dijit._Widget }; dijit.getEnclosingWidget = function(/*DOMNode*/ node){ // summary: // Returns the widget whose DOM tree contains the specified DOMNode, or null if // the node is not contained within the DOM tree of any widget while(node){ var id = node.getAttribute && node.getAttribute("widgetId"); if(id){ return hash[id]; } node = node.parentNode; } return null; }; var shown = (dijit._isElementShown = function(/*Element*/ elem){ var s = style(elem); return (s.visibility != "hidden") && (s.visibility != "collapsed") && (s.display != "none") && (attr(elem, "type") != "hidden"); }); dijit.hasDefaultTabStop = function(/*Element*/ elem){ // summary: // Tests if element is tab-navigable even without an explicit tabIndex setting // No explicit tabIndex setting, need to investigate node type switch(elem.nodeName.toLowerCase()){ case "a": // An w/out a tabindex is only navigable if it has an href return hasAttr(elem, "href"); case "area": case "button": case "input": case "object": case "select": case "textarea": // These are navigable by default return true; case "iframe": // If it's an editor