diff options
| author | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
|---|---|---|
| committer | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
| commit | b62676ca5d3d6f6ba3f019ea3f99722e165a98d8 (patch) | |
| tree | 86722cb80f07d4569f90088eeaea2fc2f6e2ef94 /js/dojo-1.6/dojox/widget | |
Diffstat (limited to 'js/dojo-1.6/dojox/widget')
317 files changed, 27857 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/widget/AnalogGauge.js b/js/dojo-1.6/dojox/widget/AnalogGauge.js new file mode 100644 index 0000000..7b270db --- /dev/null +++ b/js/dojo-1.6/dojox/widget/AnalogGauge.js @@ -0,0 +1,366 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.AnalogGauge"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.AnalogGauge"] = true;
+dojo.provide("dojox.widget.AnalogGauge");
+
+dojo.require("dojox.gfx");
+dojo.require("dojox.widget.gauge._Gauge");
+
+dojo.experimental("dojox.widget.AnalogGauge");
+
+dojo.declare("dojox.widget.gauge.AnalogLineIndicator",[dojox.widget.gauge._Indicator],{
+ _getShapes: function(){
+ // summary:
+ // Private function for generating the shapes for this indicator. An indicator that behaves the
+ // same might override this one and simply replace the shapes (such as ArrowIndicator).
+ return [this._gauge.surface.createLine({x1: 0, y1: -this.offset,
+ x2: 0, y2: -this.length-this.offset})
+ .setStroke({color: this.color, width: this.width})];
+ },
+ draw: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget.gauge._Indicator.draw
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ if(this.shapes){
+ this._move(dontAnimate);
+ }else{
+ if(this.text){
+ this._gauge.surface.rawNode.removeChild(this.text);
+ this.text = null;
+ }
+ var a = this._gauge._getAngle(Math.min(Math.max(this.value, this._gauge.min), this._gauge.max));
+
+ this.color = this.color || '#000000';
+ this.length = this.length || this._gauge.radius;
+ this.width = this.width || 1;
+ this.offset = this.offset || 0;
+ this.highlight = this.highlight || '#D0D0D0';
+
+ this.shapes = this._getShapes(this._gauge, this);
+
+ if(this.shapes){
+ for(var s = 0; s < this.shapes.length; s++){
+ this.shapes[s].setTransform([{dx:this._gauge.cx,dy:this._gauge.cy}, dojox.gfx.matrix.rotateg(a)]);
+ if(this.hover){
+ this.shapes[s].getEventSource().setAttribute('hover',this.hover);
+ }
+ if(this.onDragMove && !this.noChange){
+ //TODO
+ this._gauge.connect(this.shapes[s].getEventSource(), 'onmousedown', this._gauge.handleMouseDown);
+ this.shapes[s].getEventSource().style.cursor = 'pointer';
+ }
+ }
+ }
+
+ if(this.label){
+ var len=this.length+this.offset,
+ rad=this._gauge._getRadians(a),
+ x=this._gauge.cx+(len+5)*Math.sin(rad),
+ y=this._gauge.cy-(len+5)*Math.cos(rad),
+ align = 'start',
+ aa = Math.abs(a)
+ ;
+ if(a <= -10){align = 'end';}
+ if(aa < 10){align='middle';}
+ var vAlign = 'bottom';
+ if(aa > 90){vAlign = 'top';}
+ this.text = this._gauge.drawText(''+this.label, x, y, align, vAlign, this.color, this.font);
+ }
+ this.currentValue = this.value;
+ }
+ },
+ _move: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Moves this indicator (since it's already been drawn once)
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ var v = Math.min(Math.max(this.value, this._gauge.min), this._gauge.max),
+ c = this.currentValue
+ ;
+ if(dontAnimate){
+ var angle = this._gauge._getAngle(v);
+ for(var i in this.shapes){
+ this.shapes[i].setTransform([{dx:this._gauge.cx,dy:this._gauge.cy}, dojox.gfx.matrix.rotateg(angle)]);
+ if(this.hover){
+ this.shapes[i].getEventSource().setAttribute('hover',this.hover);
+ }
+ }
+ }else{
+ if(c!=v){
+ var anim = new dojo.Animation({curve: [c, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, function(step){
+ for(var i in this.shapes){
+ this.shapes[i].setTransform([{dx:this._gauge.cx,dy:this._gauge.cy}, dojox.gfx.matrix.rotateg(this._gauge._getAngle(step))]);
+ if(this.hover){
+ this.shapes[i].getEventSource().setAttribute('hover',this.hover);
+ }
+ }
+ this.currentValue = step;
+ }));
+ anim.play();
+ }
+ }
+ }
+});
+dojo.declare("dojox.widget.AnalogGauge",dojox.widget.gauge._Gauge,{
+ // summary:
+ // a gauge built using the dojox.gfx package.
+ //
+ // description:
+ // using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
+ // builds a gauge component, used to display numerical data in a familiar format
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.AnalogGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.AnalogGauge"
+ // id="testGauge"
+ // width="300"
+ // height="200"
+ // cx=150
+ // cy=175
+ // radius=125
+ // image="gaugeOverlay.png"
+ // imageOverlay="false"
+ // imageWidth="280"
+ // imageHeight="155"
+ // imageX="12"
+ // imageY="38">
+ // </div>
+
+ // startAngle: Number
+ // angle (in degrees) for start of gauge (default is -90)
+ startAngle: -90,
+
+ // endAngle: Number
+ // angle (in degrees) for end of gauge (default is 90)
+ endAngle: 90,
+
+ // cx: Number
+ // center of gauge x coordinate (default is gauge width / 2)
+ cx: 0,
+
+ // cy: Number
+ // center of gauge x coordinate (default is gauge height / 2)
+ cy: 0,
+
+ // radius: Number
+ // radius of gauge (default is smaller of cx-25 or cy-25)
+ radius: 0,
+
+ // _defaultIndicator: override of dojox.widget._Gauge._defaultIndicator
+ _defaultIndicator: dojox.widget.gauge.AnalogLineIndicator,
+
+ startup: function(){
+ // handle settings from HTML by making sure all the options are
+ // converted correctly to numbers and that we calculate defaults
+ // for cx, cy and radius
+ // also connects mouse handling events
+
+ if(this.getChildren){
+ dojo.forEach(this.getChildren(), function(child){ child.startup(); });
+ }
+
+ this.startAngle = Number(this.startAngle);
+ this.endAngle = Number(this.endAngle);
+
+ this.cx = Number(this.cx);
+ if(!this.cx){this.cx = this.width/2;}
+ this.cy = Number(this.cy);
+ if(!this.cy){this.cy = this.height/2;}
+ this.radius = Number(this.radius);
+ if(!this.radius){this.radius = Math.min(this.cx,this.cy) - 25;}
+ this._oppositeMiddle = (this.startAngle+this.endAngle)/2+180;
+
+ this.inherited(arguments);
+ },
+
+ _getAngle: function(/*Number*/value){
+ // summary:
+ // This is a helper function used to determine the angle that represents
+ // a given value on the gauge
+ // value: Number
+ // A value to be converted to an angle for this gauage.
+ return (value - this.min)/(this.max - this.min)*(this.endAngle - this.startAngle) + this.startAngle;
+ },
+
+ _getValueForAngle: function(/*Number*/angle){
+ // summary:
+ // This is a helper function used to determie the value represented by a
+ // given angle on the gauge
+ // angle: Number
+ // A angle to be converted to a value for this gauge.
+ if(angle > this._oppositeMiddle){ angle -= 360; }
+ return (angle - this.startAngle)*(this.max - this.min)/(this.endAngle - this.startAngle) + this.min;
+ },
+
+ _getRadians: function(/*Number*/angle){
+ // summary:
+ // This is a helper function than converts degrees to radians
+ // angle: Number
+ // An angle, in degrees, to be converted to radians.
+ return angle*Math.PI/180;
+ },
+
+ _getDegrees: function(/*Number*/radians){
+ // summary:
+ // This is a helper function that converts radians to degrees
+ // radians: Number
+ // An angle, in radians, to be converted to degrees.
+ return radians*180/Math.PI;
+ },
+
+ draw: function(){
+ // summary:
+ // This function is used to draw (or redraw) the gauge.
+ // description:
+ // Draws the gauge by drawing the surface, the ranges, and the indicators.
+ var i;
+ if(this._rangeData){
+ for(i=0; i<this._rangeData.length; i++){
+ this.drawRange(this._rangeData[i]);
+ }
+ if(this._img && this.image.overlay){
+ this._img.moveToFront();
+ }
+ }
+ if(this._indicatorData){
+ for(i=0; i<this._indicatorData.length; i++){
+ this._indicatorData[i].draw();
+ }
+ }
+ },
+
+ drawRange: function(/*Object*/range){
+ // summary:
+ // This function is used to draw (or redraw) a range
+ // description:
+ // Draws a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is a dojox.widget.gauge.Range or an object
+ // with similar parameters (low, high, hover, etc.).
+ var path;
+ if(range.shape){
+ this.surface.remove(range.shape);
+ range.shape = null;
+ }
+ var a1, a2;
+ if((range.low == this.min) && (range.high == this.max) && ((this.endAngle - this.startAngle) == 360)){
+ path = this.surface.createCircle({cx: this.cx, cy: this.cy, r: this.radius});
+ }else{
+ a1 = this._getRadians(this._getAngle(range.low));
+ a2 = this._getRadians(this._getAngle(range.high));
+ var x1=this.cx+this.radius*Math.sin(a1),
+ y1=this.cy-this.radius*Math.cos(a1),
+ x2=this.cx+this.radius*Math.sin(a2),
+ y2=this.cy-this.radius*Math.cos(a2),
+ big=0
+ ;
+ if((a2-a1)>Math.PI){big=1;}
+
+ path = this.surface.createPath();
+ if(range.size){
+ path.moveTo(this.cx+(this.radius-range.size)*Math.sin(a1),
+ this.cy-(this.radius-range.size)*Math.cos(a1));
+ }else{
+ path.moveTo(this.cx,this.cy);
+ }
+ path.lineTo(x1,y1);
+ path.arcTo(this.radius,this.radius,0,big,1,x2,y2);
+ if(range.size){
+ path.lineTo(this.cx+(this.radius-range.size)*Math.sin(a2),
+ this.cy-(this.radius-range.size)*Math.cos(a2));
+ path.arcTo((this.radius-range.size),(this.radius-range.size),0,big,0,
+ this.cx+(this.radius-range.size)*Math.sin(a1),
+ this.cy-(this.radius-range.size)*Math.cos(a1));
+ }
+ path.closePath();
+ }
+
+ if(dojo.isArray(range.color) || dojo.isString(range.color)){
+ path.setStroke({color: range.color});
+ path.setFill(range.color);
+ }else if(range.color.type){
+ // Color is a gradient
+ a1 = this._getRadians(this._getAngle(range.low));
+ a2 = this._getRadians(this._getAngle(range.high));
+ range.color.x1 = this.cx+(this.radius*Math.sin(a1))/2;
+ range.color.x2 = this.cx+(this.radius*Math.sin(a2))/2;
+ range.color.y1 = this.cy-(this.radius*Math.cos(a1))/2;
+ range.color.y2 = this.cy-(this.radius*Math.cos(a2))/2;
+ path.setFill(range.color);
+ path.setStroke({color: range.color.colors[0].color});
+ }else{
+ // We've defined a style rather than an explicit color
+ path.setStroke({color: "green"}); // Arbitrary color, just have to indicate
+ path.setFill("green"); // that we want it filled
+ path.getEventSource().setAttribute("class", range.color.style);
+ }
+ if(range.hover){
+ path.getEventSource().setAttribute('hover',range.hover);
+ }
+ range.shape = path;
+ },
+
+ getRangeUnderMouse: function(/*Object*/event){
+ // summary:
+ // Determines which range the mouse is currently over
+ // event: Object
+ // The event object as received by the mouse handling functions below.
+ var range = null,
+ pos = dojo.coords(this.gaugeContent),
+ x = event.clientX - pos.x,
+ y = event.clientY - pos.y,
+ r = Math.sqrt((y - this.cy)*(y - this.cy) + (x - this.cx)*(x - this.cx))
+ ;
+ if(r < this.radius){
+ var angle = this._getDegrees(Math.atan2(y - this.cy, x - this.cx) + Math.PI/2),
+ //if(angle > this.endAngle){angle = angle - 360;}
+ value = this._getValueForAngle(angle)
+ ;
+ if(this._rangeData){
+ for(var i=0; (i<this._rangeData.length) && !range; i++){
+ if((Number(this._rangeData[i].low) <= value) && (Number(this._rangeData[i].high) >= value)){
+ range = this._rangeData[i];
+ }
+ }
+ }
+ }
+ return range;
+ },
+
+ _dragIndicator: function(/*Object*/ widget, /*Object*/ event){
+ // summary:
+ // Handles the dragging of an indicator, including moving/re-drawing
+ // get angle for mouse position
+ var pos = dojo.coords(widget.gaugeContent),
+ x = event.clientX - pos.x,
+ y = event.clientY - pos.y,
+ angle = widget._getDegrees(Math.atan2(y - widget.cy, x - widget.cx) + Math.PI/2),
+ //if(angle > widget.endAngle){angle = angle - 360;}
+ // get value and restrict to our min/max
+ value = widget._getValueForAngle(angle)
+ ;
+ value = Math.min(Math.max(value, widget.min), widget.max);
+ // update the indicator
+ widget._drag.value = widget._drag.currentValue = value;
+ // callback
+ widget._drag.onDragMove(widget._drag);
+ // rotate indicator
+ widget._drag.draw(true);
+ dojo.stopEvent(event);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/AnalogGauge.xd.js b/js/dojo-1.6/dojox/widget/AnalogGauge.xd.js new file mode 100644 index 0000000..c72090e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/AnalogGauge.xd.js @@ -0,0 +1,372 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.AnalogGauge"],
+["require", "dojox.gfx"],
+["require", "dojox.widget.gauge._Gauge"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.AnalogGauge"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.AnalogGauge"] = true;
+dojo.provide("dojox.widget.AnalogGauge");
+
+dojo.require("dojox.gfx");
+dojo.require("dojox.widget.gauge._Gauge");
+
+dojo.experimental("dojox.widget.AnalogGauge");
+
+dojo.declare("dojox.widget.gauge.AnalogLineIndicator",[dojox.widget.gauge._Indicator],{
+ _getShapes: function(){
+ // summary:
+ // Private function for generating the shapes for this indicator. An indicator that behaves the
+ // same might override this one and simply replace the shapes (such as ArrowIndicator).
+ return [this._gauge.surface.createLine({x1: 0, y1: -this.offset,
+ x2: 0, y2: -this.length-this.offset})
+ .setStroke({color: this.color, width: this.width})];
+ },
+ draw: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget.gauge._Indicator.draw
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ if(this.shapes){
+ this._move(dontAnimate);
+ }else{
+ if(this.text){
+ this._gauge.surface.rawNode.removeChild(this.text);
+ this.text = null;
+ }
+ var a = this._gauge._getAngle(Math.min(Math.max(this.value, this._gauge.min), this._gauge.max));
+
+ this.color = this.color || '#000000';
+ this.length = this.length || this._gauge.radius;
+ this.width = this.width || 1;
+ this.offset = this.offset || 0;
+ this.highlight = this.highlight || '#D0D0D0';
+
+ this.shapes = this._getShapes(this._gauge, this);
+
+ if(this.shapes){
+ for(var s = 0; s < this.shapes.length; s++){
+ this.shapes[s].setTransform([{dx:this._gauge.cx,dy:this._gauge.cy}, dojox.gfx.matrix.rotateg(a)]);
+ if(this.hover){
+ this.shapes[s].getEventSource().setAttribute('hover',this.hover);
+ }
+ if(this.onDragMove && !this.noChange){
+ //TODO
+ this._gauge.connect(this.shapes[s].getEventSource(), 'onmousedown', this._gauge.handleMouseDown);
+ this.shapes[s].getEventSource().style.cursor = 'pointer';
+ }
+ }
+ }
+
+ if(this.label){
+ var len=this.length+this.offset,
+ rad=this._gauge._getRadians(a),
+ x=this._gauge.cx+(len+5)*Math.sin(rad),
+ y=this._gauge.cy-(len+5)*Math.cos(rad),
+ align = 'start',
+ aa = Math.abs(a)
+ ;
+ if(a <= -10){align = 'end';}
+ if(aa < 10){align='middle';}
+ var vAlign = 'bottom';
+ if(aa > 90){vAlign = 'top';}
+ this.text = this._gauge.drawText(''+this.label, x, y, align, vAlign, this.color, this.font);
+ }
+ this.currentValue = this.value;
+ }
+ },
+ _move: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Moves this indicator (since it's already been drawn once)
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ var v = Math.min(Math.max(this.value, this._gauge.min), this._gauge.max),
+ c = this.currentValue
+ ;
+ if(dontAnimate){
+ var angle = this._gauge._getAngle(v);
+ for(var i in this.shapes){
+ this.shapes[i].setTransform([{dx:this._gauge.cx,dy:this._gauge.cy}, dojox.gfx.matrix.rotateg(angle)]);
+ if(this.hover){
+ this.shapes[i].getEventSource().setAttribute('hover',this.hover);
+ }
+ }
+ }else{
+ if(c!=v){
+ var anim = new dojo.Animation({curve: [c, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, function(step){
+ for(var i in this.shapes){
+ this.shapes[i].setTransform([{dx:this._gauge.cx,dy:this._gauge.cy}, dojox.gfx.matrix.rotateg(this._gauge._getAngle(step))]);
+ if(this.hover){
+ this.shapes[i].getEventSource().setAttribute('hover',this.hover);
+ }
+ }
+ this.currentValue = step;
+ }));
+ anim.play();
+ }
+ }
+ }
+});
+dojo.declare("dojox.widget.AnalogGauge",dojox.widget.gauge._Gauge,{
+ // summary:
+ // a gauge built using the dojox.gfx package.
+ //
+ // description:
+ // using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
+ // builds a gauge component, used to display numerical data in a familiar format
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.AnalogGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.AnalogGauge"
+ // id="testGauge"
+ // width="300"
+ // height="200"
+ // cx=150
+ // cy=175
+ // radius=125
+ // image="gaugeOverlay.png"
+ // imageOverlay="false"
+ // imageWidth="280"
+ // imageHeight="155"
+ // imageX="12"
+ // imageY="38">
+ // </div>
+
+ // startAngle: Number
+ // angle (in degrees) for start of gauge (default is -90)
+ startAngle: -90,
+
+ // endAngle: Number
+ // angle (in degrees) for end of gauge (default is 90)
+ endAngle: 90,
+
+ // cx: Number
+ // center of gauge x coordinate (default is gauge width / 2)
+ cx: 0,
+
+ // cy: Number
+ // center of gauge x coordinate (default is gauge height / 2)
+ cy: 0,
+
+ // radius: Number
+ // radius of gauge (default is smaller of cx-25 or cy-25)
+ radius: 0,
+
+ // _defaultIndicator: override of dojox.widget._Gauge._defaultIndicator
+ _defaultIndicator: dojox.widget.gauge.AnalogLineIndicator,
+
+ startup: function(){
+ // handle settings from HTML by making sure all the options are
+ // converted correctly to numbers and that we calculate defaults
+ // for cx, cy and radius
+ // also connects mouse handling events
+
+ if(this.getChildren){
+ dojo.forEach(this.getChildren(), function(child){ child.startup(); });
+ }
+
+ this.startAngle = Number(this.startAngle);
+ this.endAngle = Number(this.endAngle);
+
+ this.cx = Number(this.cx);
+ if(!this.cx){this.cx = this.width/2;}
+ this.cy = Number(this.cy);
+ if(!this.cy){this.cy = this.height/2;}
+ this.radius = Number(this.radius);
+ if(!this.radius){this.radius = Math.min(this.cx,this.cy) - 25;}
+ this._oppositeMiddle = (this.startAngle+this.endAngle)/2+180;
+
+ this.inherited(arguments);
+ },
+
+ _getAngle: function(/*Number*/value){
+ // summary:
+ // This is a helper function used to determine the angle that represents
+ // a given value on the gauge
+ // value: Number
+ // A value to be converted to an angle for this gauage.
+ return (value - this.min)/(this.max - this.min)*(this.endAngle - this.startAngle) + this.startAngle;
+ },
+
+ _getValueForAngle: function(/*Number*/angle){
+ // summary:
+ // This is a helper function used to determie the value represented by a
+ // given angle on the gauge
+ // angle: Number
+ // A angle to be converted to a value for this gauge.
+ if(angle > this._oppositeMiddle){ angle -= 360; }
+ return (angle - this.startAngle)*(this.max - this.min)/(this.endAngle - this.startAngle) + this.min;
+ },
+
+ _getRadians: function(/*Number*/angle){
+ // summary:
+ // This is a helper function than converts degrees to radians
+ // angle: Number
+ // An angle, in degrees, to be converted to radians.
+ return angle*Math.PI/180;
+ },
+
+ _getDegrees: function(/*Number*/radians){
+ // summary:
+ // This is a helper function that converts radians to degrees
+ // radians: Number
+ // An angle, in radians, to be converted to degrees.
+ return radians*180/Math.PI;
+ },
+
+ draw: function(){
+ // summary:
+ // This function is used to draw (or redraw) the gauge.
+ // description:
+ // Draws the gauge by drawing the surface, the ranges, and the indicators.
+ var i;
+ if(this._rangeData){
+ for(i=0; i<this._rangeData.length; i++){
+ this.drawRange(this._rangeData[i]);
+ }
+ if(this._img && this.image.overlay){
+ this._img.moveToFront();
+ }
+ }
+ if(this._indicatorData){
+ for(i=0; i<this._indicatorData.length; i++){
+ this._indicatorData[i].draw();
+ }
+ }
+ },
+
+ drawRange: function(/*Object*/range){
+ // summary:
+ // This function is used to draw (or redraw) a range
+ // description:
+ // Draws a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is a dojox.widget.gauge.Range or an object
+ // with similar parameters (low, high, hover, etc.).
+ var path;
+ if(range.shape){
+ this.surface.remove(range.shape);
+ range.shape = null;
+ }
+ var a1, a2;
+ if((range.low == this.min) && (range.high == this.max) && ((this.endAngle - this.startAngle) == 360)){
+ path = this.surface.createCircle({cx: this.cx, cy: this.cy, r: this.radius});
+ }else{
+ a1 = this._getRadians(this._getAngle(range.low));
+ a2 = this._getRadians(this._getAngle(range.high));
+ var x1=this.cx+this.radius*Math.sin(a1),
+ y1=this.cy-this.radius*Math.cos(a1),
+ x2=this.cx+this.radius*Math.sin(a2),
+ y2=this.cy-this.radius*Math.cos(a2),
+ big=0
+ ;
+ if((a2-a1)>Math.PI){big=1;}
+
+ path = this.surface.createPath();
+ if(range.size){
+ path.moveTo(this.cx+(this.radius-range.size)*Math.sin(a1),
+ this.cy-(this.radius-range.size)*Math.cos(a1));
+ }else{
+ path.moveTo(this.cx,this.cy);
+ }
+ path.lineTo(x1,y1);
+ path.arcTo(this.radius,this.radius,0,big,1,x2,y2);
+ if(range.size){
+ path.lineTo(this.cx+(this.radius-range.size)*Math.sin(a2),
+ this.cy-(this.radius-range.size)*Math.cos(a2));
+ path.arcTo((this.radius-range.size),(this.radius-range.size),0,big,0,
+ this.cx+(this.radius-range.size)*Math.sin(a1),
+ this.cy-(this.radius-range.size)*Math.cos(a1));
+ }
+ path.closePath();
+ }
+
+ if(dojo.isArray(range.color) || dojo.isString(range.color)){
+ path.setStroke({color: range.color});
+ path.setFill(range.color);
+ }else if(range.color.type){
+ // Color is a gradient
+ a1 = this._getRadians(this._getAngle(range.low));
+ a2 = this._getRadians(this._getAngle(range.high));
+ range.color.x1 = this.cx+(this.radius*Math.sin(a1))/2;
+ range.color.x2 = this.cx+(this.radius*Math.sin(a2))/2;
+ range.color.y1 = this.cy-(this.radius*Math.cos(a1))/2;
+ range.color.y2 = this.cy-(this.radius*Math.cos(a2))/2;
+ path.setFill(range.color);
+ path.setStroke({color: range.color.colors[0].color});
+ }else{
+ // We've defined a style rather than an explicit color
+ path.setStroke({color: "green"}); // Arbitrary color, just have to indicate
+ path.setFill("green"); // that we want it filled
+ path.getEventSource().setAttribute("class", range.color.style);
+ }
+ if(range.hover){
+ path.getEventSource().setAttribute('hover',range.hover);
+ }
+ range.shape = path;
+ },
+
+ getRangeUnderMouse: function(/*Object*/event){
+ // summary:
+ // Determines which range the mouse is currently over
+ // event: Object
+ // The event object as received by the mouse handling functions below.
+ var range = null,
+ pos = dojo.coords(this.gaugeContent),
+ x = event.clientX - pos.x,
+ y = event.clientY - pos.y,
+ r = Math.sqrt((y - this.cy)*(y - this.cy) + (x - this.cx)*(x - this.cx))
+ ;
+ if(r < this.radius){
+ var angle = this._getDegrees(Math.atan2(y - this.cy, x - this.cx) + Math.PI/2),
+ //if(angle > this.endAngle){angle = angle - 360;}
+ value = this._getValueForAngle(angle)
+ ;
+ if(this._rangeData){
+ for(var i=0; (i<this._rangeData.length) && !range; i++){
+ if((Number(this._rangeData[i].low) <= value) && (Number(this._rangeData[i].high) >= value)){
+ range = this._rangeData[i];
+ }
+ }
+ }
+ }
+ return range;
+ },
+
+ _dragIndicator: function(/*Object*/ widget, /*Object*/ event){
+ // summary:
+ // Handles the dragging of an indicator, including moving/re-drawing
+ // get angle for mouse position
+ var pos = dojo.coords(widget.gaugeContent),
+ x = event.clientX - pos.x,
+ y = event.clientY - pos.y,
+ angle = widget._getDegrees(Math.atan2(y - widget.cy, x - widget.cx) + Math.PI/2),
+ //if(angle > widget.endAngle){angle = angle - 360;}
+ // get value and restrict to our min/max
+ value = widget._getValueForAngle(angle)
+ ;
+ value = Math.min(Math.max(value, widget.min), widget.max);
+ // update the indicator
+ widget._drag.value = widget._drag.currentValue = value;
+ // callback
+ widget._drag.onDragMove(widget._drag);
+ // rotate indicator
+ widget._drag.draw(true);
+ dojo.stopEvent(event);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/AutoRotator.js b/js/dojo-1.6/dojox/widget/AutoRotator.js new file mode 100644 index 0000000..3e8a3a9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/AutoRotator.js @@ -0,0 +1,228 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.AutoRotator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.AutoRotator"] = true;
+dojo.provide("dojox.widget.AutoRotator");
+dojo.require("dojox.widget.Rotator");
+
+(function(d){
+
+ d.declare("dojox.widget.AutoRotator", dojox.widget.Rotator, {
+ // summary:
+ // A rotator that automatically transitions between child nodes.
+ //
+ // description:
+ // Adds automatic rotating to the dojox.widget.Rotator. The
+ // AutoRotator has parameters that control how user input can
+ // affect the rotator including a suspend when hovering over the
+ // rotator and pausing when the user manually advances to another
+ // pane.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.AutoRotator" duration="3000">
+ // | <div>
+ // | Pane 1!
+ // | </div>
+ // | <div duration="5000">
+ // | Pane 2 with an overrided duration!
+ // | </div>
+ // | </div>
+
+ // suspendOnHover: boolean
+ // Pause the rotator when the mouse hovers over it.
+ suspendOnHover: false,
+
+ // duration: int
+ // The time in milliseconds before transitioning to the next pane. The
+ // default value is 4000 (4 seconds).
+ duration: 4000,
+
+ // autoStart: boolean
+ // Starts the timer to transition children upon creation.
+ autoStart: true,
+
+ // pauseOnManualChange: boolean
+ // Pause the rotator when the pane is changed or a controller's next or
+ // previous buttons are clicked.
+ pauseOnManualChange: false,
+
+ // cycles: int
+ // Number of cycles before pausing.
+ cycles: -1,
+
+ // random: boolean
+ // Determines if the panes should cycle randomly.
+ random: false,
+
+ // reverse: boolean
+ // Causes the rotator to rotate in reverse order.
+ reverse: false,
+
+ constructor: function(){
+ // summary:
+ // Initializes the timer and connect to the rotator.
+
+ var _t = this;
+
+ // validate the cycles counter
+ if(_t.cycles-0 == _t.cycles && _t.cycles > 0){
+ // we need to add 1 because we decrement cycles before the animation starts
+ _t.cycles++;
+ }else{
+ _t.cycles = _t.cycles ? -1 : 0;
+ }
+
+ // wire up the mouse hover events
+ _t._connects = [
+ d.connect(_t._domNode, "onmouseover", function(){
+ // temporarily suspend the cycling, but don't officially pause
+ // it and don't allow suspending if we're transitioning
+ if(_t.suspendOnHover && !_t.anim && !_t.wfe){
+ var t = _t._endTime,
+ n = _t._now();
+ _t._suspended = true;
+ _t._resetTimer();
+ _t._resumeDuration = t > n ? t - n : 0.01;
+ }
+ }),
+
+ d.connect(_t._domNode, "onmouseout", function(){
+ // if we were playing, resume playback unless were in the
+ // middle of a transition
+ if(_t.suspendOnHover && !_t.anim){
+ _t._suspended = false;
+ if(_t.playing && !_t.wfe){
+ _t.play(true);
+ }
+ }
+ })
+ ];
+
+ // everything is ready, so start
+ if(_t.autoStart && _t.panes.length > 1){
+ // start playing
+ _t.play();
+ }else{
+ // since we're not playing, lets pause
+ _t.pause();
+ }
+ },
+
+ destroy: function(){
+ // summary:
+ // Disconnect the AutoRotator's events.
+ d.forEach(this._connects, d.disconnect);
+ this.inherited(arguments);
+ },
+
+ play: function(/*boolean?*/skipCycleDecrement, /*boolean?*/skipDuration){
+ // summary:
+ // Sets the state to "playing" and schedules the next cycle to run.
+ this.playing = true;
+ this._resetTimer();
+
+ // don't decrement the count if we're resuming play
+ if(skipCycleDecrement !== true && this.cycles > 0){
+ this.cycles--;
+ }
+
+ if(this.cycles == 0){
+ // we have reached the number of cycles, so pause
+ this.pause();
+ }else if(!this._suspended){
+ this.onUpdate("play");
+ // if we haven't been suspended, then grab the duration for this pane and
+ // schedule a cycle to be run
+ if(skipDuration){
+ this._cycle();
+ }else{
+ var r = (this._resumeDuration || 0)-0,
+ u = (r > 0 ? r : (this.panes[this.idx].duration || this.duration))-0;
+ // call _cycle() after a duration and pass in false so it isn't manual
+ this._resumeDuration = 0;
+ this._endTime = this._now() + u;
+ this._timer = setTimeout(d.hitch(this, "_cycle", false), u);
+ }
+ }
+ },
+
+ pause: function(){
+ // summary:
+ // Sets the state to "not playing" and clears the cycle timer.
+ this.playing = this._suspended = false;
+ this.cycles = -1;
+ this._resetTimer();
+
+ // notify the controllers we're paused
+ this.onUpdate("pause");
+ },
+
+ _now: function(){
+ // summary:
+ // Helper function to return the current system time in milliseconds.
+ return (new Date()).getTime(); /*int*/
+ },
+
+ _resetTimer: function(){
+ // summary:
+ // Resets the timer used to schedule the next transition.
+ clearTimeout(this._timer);
+ },
+
+ _cycle: function(/*boolean|int?*/manual){
+ // summary:
+ // Cycles the rotator to the next/previous pane.
+ var _t = this,
+ i = _t.idx,
+ j;
+
+ if(_t.random){
+ // make sure we don't randomly pick the pane we're already on
+ do{
+ j = Math.floor(Math.random() * _t.panes.length + 1);
+ }while(j == i);
+ }else{
+ j = i + (_t.reverse ? -1 : 1)
+ }
+
+ // rotate!
+ var def = _t.go(j);
+
+ if(def){
+ def.addCallback(function(/*boolean?*/skipDuration){
+ _t.onUpdate("cycle");
+ if(_t.playing){
+ _t.play(false, skipDuration);
+ }
+ });
+ }
+ },
+
+ onManualChange: function(/*string*/action){
+ // summary:
+ // Override the Rotator's onManualChange so we can pause.
+
+ this.cycles = -1;
+
+ // obviously we don't want to pause if play was just clicked
+ if(action != "play"){
+ this._resetTimer();
+ if(this.pauseOnManualChange){
+ this.pause();
+ }
+ }
+
+ if(this.playing){
+ this.play();
+ }
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/AutoRotator.xd.js b/js/dojo-1.6/dojox/widget/AutoRotator.xd.js new file mode 100644 index 0000000..3157aba --- /dev/null +++ b/js/dojo-1.6/dojox/widget/AutoRotator.xd.js @@ -0,0 +1,233 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.AutoRotator"],
+["require", "dojox.widget.Rotator"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.AutoRotator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.AutoRotator"] = true;
+dojo.provide("dojox.widget.AutoRotator");
+dojo.require("dojox.widget.Rotator");
+
+(function(d){
+
+ d.declare("dojox.widget.AutoRotator", dojox.widget.Rotator, {
+ // summary:
+ // A rotator that automatically transitions between child nodes.
+ //
+ // description:
+ // Adds automatic rotating to the dojox.widget.Rotator. The
+ // AutoRotator has parameters that control how user input can
+ // affect the rotator including a suspend when hovering over the
+ // rotator and pausing when the user manually advances to another
+ // pane.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.AutoRotator" duration="3000">
+ // | <div>
+ // | Pane 1!
+ // | </div>
+ // | <div duration="5000">
+ // | Pane 2 with an overrided duration!
+ // | </div>
+ // | </div>
+
+ // suspendOnHover: boolean
+ // Pause the rotator when the mouse hovers over it.
+ suspendOnHover: false,
+
+ // duration: int
+ // The time in milliseconds before transitioning to the next pane. The
+ // default value is 4000 (4 seconds).
+ duration: 4000,
+
+ // autoStart: boolean
+ // Starts the timer to transition children upon creation.
+ autoStart: true,
+
+ // pauseOnManualChange: boolean
+ // Pause the rotator when the pane is changed or a controller's next or
+ // previous buttons are clicked.
+ pauseOnManualChange: false,
+
+ // cycles: int
+ // Number of cycles before pausing.
+ cycles: -1,
+
+ // random: boolean
+ // Determines if the panes should cycle randomly.
+ random: false,
+
+ // reverse: boolean
+ // Causes the rotator to rotate in reverse order.
+ reverse: false,
+
+ constructor: function(){
+ // summary:
+ // Initializes the timer and connect to the rotator.
+
+ var _t = this;
+
+ // validate the cycles counter
+ if(_t.cycles-0 == _t.cycles && _t.cycles > 0){
+ // we need to add 1 because we decrement cycles before the animation starts
+ _t.cycles++;
+ }else{
+ _t.cycles = _t.cycles ? -1 : 0;
+ }
+
+ // wire up the mouse hover events
+ _t._connects = [
+ d.connect(_t._domNode, "onmouseover", function(){
+ // temporarily suspend the cycling, but don't officially pause
+ // it and don't allow suspending if we're transitioning
+ if(_t.suspendOnHover && !_t.anim && !_t.wfe){
+ var t = _t._endTime,
+ n = _t._now();
+ _t._suspended = true;
+ _t._resetTimer();
+ _t._resumeDuration = t > n ? t - n : 0.01;
+ }
+ }),
+
+ d.connect(_t._domNode, "onmouseout", function(){
+ // if we were playing, resume playback unless were in the
+ // middle of a transition
+ if(_t.suspendOnHover && !_t.anim){
+ _t._suspended = false;
+ if(_t.playing && !_t.wfe){
+ _t.play(true);
+ }
+ }
+ })
+ ];
+
+ // everything is ready, so start
+ if(_t.autoStart && _t.panes.length > 1){
+ // start playing
+ _t.play();
+ }else{
+ // since we're not playing, lets pause
+ _t.pause();
+ }
+ },
+
+ destroy: function(){
+ // summary:
+ // Disconnect the AutoRotator's events.
+ d.forEach(this._connects, d.disconnect);
+ this.inherited(arguments);
+ },
+
+ play: function(/*boolean?*/skipCycleDecrement, /*boolean?*/skipDuration){
+ // summary:
+ // Sets the state to "playing" and schedules the next cycle to run.
+ this.playing = true;
+ this._resetTimer();
+
+ // don't decrement the count if we're resuming play
+ if(skipCycleDecrement !== true && this.cycles > 0){
+ this.cycles--;
+ }
+
+ if(this.cycles == 0){
+ // we have reached the number of cycles, so pause
+ this.pause();
+ }else if(!this._suspended){
+ this.onUpdate("play");
+ // if we haven't been suspended, then grab the duration for this pane and
+ // schedule a cycle to be run
+ if(skipDuration){
+ this._cycle();
+ }else{
+ var r = (this._resumeDuration || 0)-0,
+ u = (r > 0 ? r : (this.panes[this.idx].duration || this.duration))-0;
+ // call _cycle() after a duration and pass in false so it isn't manual
+ this._resumeDuration = 0;
+ this._endTime = this._now() + u;
+ this._timer = setTimeout(d.hitch(this, "_cycle", false), u);
+ }
+ }
+ },
+
+ pause: function(){
+ // summary:
+ // Sets the state to "not playing" and clears the cycle timer.
+ this.playing = this._suspended = false;
+ this.cycles = -1;
+ this._resetTimer();
+
+ // notify the controllers we're paused
+ this.onUpdate("pause");
+ },
+
+ _now: function(){
+ // summary:
+ // Helper function to return the current system time in milliseconds.
+ return (new Date()).getTime(); /*int*/
+ },
+
+ _resetTimer: function(){
+ // summary:
+ // Resets the timer used to schedule the next transition.
+ clearTimeout(this._timer);
+ },
+
+ _cycle: function(/*boolean|int?*/manual){
+ // summary:
+ // Cycles the rotator to the next/previous pane.
+ var _t = this,
+ i = _t.idx,
+ j;
+
+ if(_t.random){
+ // make sure we don't randomly pick the pane we're already on
+ do{
+ j = Math.floor(Math.random() * _t.panes.length + 1);
+ }while(j == i);
+ }else{
+ j = i + (_t.reverse ? -1 : 1)
+ }
+
+ // rotate!
+ var def = _t.go(j);
+
+ if(def){
+ def.addCallback(function(/*boolean?*/skipDuration){
+ _t.onUpdate("cycle");
+ if(_t.playing){
+ _t.play(false, skipDuration);
+ }
+ });
+ }
+ },
+
+ onManualChange: function(/*string*/action){
+ // summary:
+ // Override the Rotator's onManualChange so we can pause.
+
+ this.cycles = -1;
+
+ // obviously we don't want to pause if play was just clicked
+ if(action != "play"){
+ this._resetTimer();
+ if(this.pauseOnManualChange){
+ this.pause();
+ }
+ }
+
+ if(this.playing){
+ this.play();
+ }
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/BarGauge.js b/js/dojo-1.6/dojox/widget/BarGauge.js new file mode 100644 index 0000000..fd274b6 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/BarGauge.js @@ -0,0 +1,303 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.BarGauge"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.BarGauge"] = true;
+dojo.provide("dojox.widget.BarGauge");
+
+dojo.require("dojox.gfx");
+dojo.require("dojox.widget.gauge._Gauge");
+
+dojo.experimental("dojox.widget.BarGauge");
+
+dojo.declare("dojox.widget.gauge.BarLineIndicator",[dojox.widget.gauge._Indicator],{
+ width: 1,
+ _getShapes: function(){
+ // summary:
+ // Private function for generating the shapes for this indicator. An indicator that behaves the
+ // same might override this one and simply replace the shapes (such as BarIndicator).
+ if(!this._gauge){
+ return null;
+ }
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ var pos = this._gauge._getPosition(v);
+ var shapes = [];
+ if(this.width > 1){
+ shapes[0] = this._gauge.surface.createRect({
+ x:pos,
+ y:this._gauge.dataY + this.offset,
+ width:this.width,
+ height:this.length
+ });
+ shapes[0].setStroke({color: this.color});
+ shapes[0].setFill(this.color);
+ }else{
+ shapes[0] = this._gauge.surface.createLine({
+ x1:pos,
+ y1:this._gauge.dataY + this.offset,
+ x2:pos,
+ y2:this._gauge.dataY + this.offset + this.length
+ });
+ shapes[0].setStroke({color: this.color});
+ }
+ return shapes;
+ },
+ draw: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget.gauge._Indicator.draw
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ var i;
+ if(this.shapes){
+ this._move(dontAnimate);
+ }else{
+ if(this.shapes){
+ for(i=0; i<this.shapes.length; i++){
+ this._gauge.surface.remove(this.shapes[i]);
+ }
+ this.shapes = null;
+ }
+ if(this.text){
+ this._gauge.surface.rawNode.removeChild(this.text);
+ this.text = null;
+ }
+
+ this.color = this.color || '#000000';
+ this.length = this.length || this._gauge.dataHeight;
+ this.width = this.width || 3;
+ this.offset = this.offset || 0;
+ this.highlight = this.highlight || '#4D4D4D';
+ this.highlight2 = this.highlight2 || '#A3A3A3';
+
+ this.shapes = this._getShapes(this._gauge, this);
+ if(this.label){
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ var pos = this._gauge._getPosition(v);
+ this.text = this._gauge.drawText(''+this.label, pos, this._gauge.dataY + this.offset - 5, 'middle','top', this.color, this.font);
+ }
+
+ for(i=0; i<this.shapes.length; i++){
+ if(this.hover){
+ this.shapes[i].getEventSource().setAttribute('hover',this.hover);
+ }
+ if(this.onDragMove && !this.noChange){
+ this._gauge.connect(this.shapes[i].getEventSource(), 'onmousedown', this._gauge.handleMouseDown);
+ this.shapes[i].getEventSource().style.cursor = 'pointer';
+ }
+ }
+ this.currentValue = this.value;
+ }
+ },
+ _move: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Moves this indicator (since it's already been drawn once)
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ var v = this.value ;
+ if(v < this.min){v = this.min;}
+ if(v > this.max){v = this.max;}
+ var c = this._gauge._getPosition(this.currentValue);
+ this.currentValue = v;
+ v = this._gauge._getPosition(v)-this._gauge.dataX;
+ if(dontAnimate){
+ this.shapes[0].applyTransform(dojox.gfx.matrix.translate(v-(this.shapes[0].matrix?this.shapes[0].matrix.dx:0),0));
+ }else{
+ var anim = new dojo.Animation({curve: [c, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, function(jump){
+ this.shapes[0].applyTransform(dojox.gfx.matrix.translate(jump-(this.shapes[0].matrix?this.shapes[0].matrix.dx:0),0));
+ }));
+ anim.play();
+ }
+ }
+});
+dojo.declare("dojox.widget.BarGauge",dojox.widget.gauge._Gauge,{
+ // summary:
+ // a bar graph built using the dojox.gfx package.
+ //
+ // description:
+ // using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
+ // builds a bar graph component, used to display numerical data in a familiar format.
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.BarGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.BarGauge"
+ // id="testBarGauge"
+ // barGaugeHeight="55"
+ // dataY="25"
+ // dataHeight="25"
+ // dataWidth="225">
+ // </div>
+
+ // dataX: Number
+ // x position of data area (default 5)
+ dataX: 5,
+
+ // dataY: Number
+ // y position of data area (default 5)
+ dataY: 5,
+
+ // dataWidth: Number
+ // width of data area (default is bar graph width - 10)
+ dataWidth: 0,
+
+ // dataHeight: Number
+ // height of data area (default is bar graph width - 10)
+ dataHeight: 0,
+
+ // _defaultIndicator: override of dojox.widget._Gauge._defaultIndicator
+ _defaultIndicator: dojox.widget.gauge.BarLineIndicator,
+
+ startup: function(){
+ // handle settings from HTML by making sure all the options are
+ // converted correctly to numbers
+ //
+ // also connects mouse handling events
+
+ if(this.getChildren){
+ dojo.forEach(this.getChildren(), function(child){ child.startup(); });
+ }
+
+ if(!this.dataWidth){this.dataWidth = this.gaugeWidth - 10;}
+ if(!this.dataHeight){this.dataHeight = this.gaugeHeight - 10;}
+
+ this.inherited(arguments);
+ },
+
+ _getPosition: function(/*Number*/value){
+ // summary:
+ // This is a helper function used to determine the position that represents
+ // a given value on the bar graph
+ // value: Number
+ // A value to be converted to a position for this bar graph.
+
+ return this.dataX + Math.floor((value - this.min)/(this.max - this.min)*this.dataWidth);
+ },
+
+ _getValueForPosition: function(/*Number*/pos){
+ // summary:
+ // This is a helper function used to determine the value represented by
+ // a position on the bar graph
+ // pos: Number
+ // A position to be converted to a value.
+ return (pos - this.dataX)*(this.max - this.min)/this.dataWidth + this.min;
+ },
+
+ draw: function(){
+ // summary:
+ // This function is used to draw (or redraw) the bar graph
+ // description:
+ // Draws the bar graph by drawing the surface, the ranges, and the indicators.
+
+ if(!this.surface){this.createSurface();}
+
+ var i;
+ if(this._rangeData){
+ for(i=0; i<this._rangeData.length; i++){
+ this.drawRange(this._rangeData[i]);
+ }
+ if(this._img && this.image.overlay){
+ this._img.moveToFront();
+ }
+ }
+ if(this._indicatorData){
+ for(i=0; i<this._indicatorData.length; i++){
+ this._indicatorData[i].draw();
+ }
+ }
+ },
+
+ drawRange: function(/*Object*/range){
+ // summary:
+ // This function is used to draw (or redraw) a range
+ // description:
+ // Draws a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is either a dojox.widget.gauge.Range or an object
+ // with similar parameters (low, high, hover, etc.).
+ if(range.shape){
+ this.surface.remove(range.shape);
+ range.shape = null;
+ }
+
+ var x1 = this._getPosition(range.low);
+ var x2 = this._getPosition(range.high);
+ var path = this.surface.createRect({x:x1,
+ y:this.dataY,
+ width:x2-x1,
+ height:this.dataHeight});
+ if(dojo.isArray(range.color) || dojo.isString(range.color)){
+ path.setStroke({color: range.color});
+ path.setFill(range.color);
+ }else if(range.color.type){
+ // Color is a gradient
+ var y = this.dataY + this.dataHeight/2;
+ range.color.x1 = x1;
+ range.color.x2 = x2;
+ range.color.y1 = y;
+ range.color.y2 = y;
+ path.setFill(range.color);
+ path.setStroke({color: range.color.colors[0].color});
+ }else{
+ // We've defined a style rather than an explicit color
+ path.setStroke({color: "green"}); // Arbitrary color, just have to indicate
+ path.setFill("green"); // that we want it filled
+ path.getEventSource().setAttribute("class", range.color.style);
+ }
+ if(range.hover){
+ path.getEventSource().setAttribute('hover',range.hover);
+ }
+ range.shape = path;
+ },
+
+ getRangeUnderMouse: function(/*Object*/event){
+ // summary:
+ // Determines which range the mouse is currently over
+ // event: Object
+ // The event object as received by the mouse handling functions below.
+ var range = null;
+ var pos = dojo.coords(this.gaugeContent);
+ var x = event.clientX - pos.x;
+ var value = this._getValueForPosition(x);
+ if(this._rangeData){
+ for(var i=0; (i<this._rangeData.length) && !range; i++){
+ if((Number(this._rangeData[i].low) <= value) && (Number(this._rangeData[i].high) >= value)){
+ range = this._rangeData[i];
+ }
+ }
+ }
+ return range;
+ },
+
+ _dragIndicator: function(/*Object*/ widget, /*Object*/ event){
+ // summary:
+ // Handles the dragging of an indicator, including moving/re-drawing
+ // get new value based on mouse position
+ var pos = dojo.coords(widget.gaugeContent);
+ var x = event.clientX - pos.x;
+ var value = widget._getValueForPosition(x);
+ if(value < widget.min){value = widget.min;}
+ if(value > widget.max){value = widget.max;}
+ // update the indicator
+ widget._drag.value = value;
+ // callback
+ widget._drag.onDragMove(widget._drag);
+ // redraw/move indicator(s)
+ widget._drag.draw(true);
+ dojo.stopEvent(event);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/BarGauge.xd.js b/js/dojo-1.6/dojox/widget/BarGauge.xd.js new file mode 100644 index 0000000..5a1668f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/BarGauge.xd.js @@ -0,0 +1,309 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.BarGauge"],
+["require", "dojox.gfx"],
+["require", "dojox.widget.gauge._Gauge"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.BarGauge"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.BarGauge"] = true;
+dojo.provide("dojox.widget.BarGauge");
+
+dojo.require("dojox.gfx");
+dojo.require("dojox.widget.gauge._Gauge");
+
+dojo.experimental("dojox.widget.BarGauge");
+
+dojo.declare("dojox.widget.gauge.BarLineIndicator",[dojox.widget.gauge._Indicator],{
+ width: 1,
+ _getShapes: function(){
+ // summary:
+ // Private function for generating the shapes for this indicator. An indicator that behaves the
+ // same might override this one and simply replace the shapes (such as BarIndicator).
+ if(!this._gauge){
+ return null;
+ }
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ var pos = this._gauge._getPosition(v);
+ var shapes = [];
+ if(this.width > 1){
+ shapes[0] = this._gauge.surface.createRect({
+ x:pos,
+ y:this._gauge.dataY + this.offset,
+ width:this.width,
+ height:this.length
+ });
+ shapes[0].setStroke({color: this.color});
+ shapes[0].setFill(this.color);
+ }else{
+ shapes[0] = this._gauge.surface.createLine({
+ x1:pos,
+ y1:this._gauge.dataY + this.offset,
+ x2:pos,
+ y2:this._gauge.dataY + this.offset + this.length
+ });
+ shapes[0].setStroke({color: this.color});
+ }
+ return shapes;
+ },
+ draw: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget.gauge._Indicator.draw
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ var i;
+ if(this.shapes){
+ this._move(dontAnimate);
+ }else{
+ if(this.shapes){
+ for(i=0; i<this.shapes.length; i++){
+ this._gauge.surface.remove(this.shapes[i]);
+ }
+ this.shapes = null;
+ }
+ if(this.text){
+ this._gauge.surface.rawNode.removeChild(this.text);
+ this.text = null;
+ }
+
+ this.color = this.color || '#000000';
+ this.length = this.length || this._gauge.dataHeight;
+ this.width = this.width || 3;
+ this.offset = this.offset || 0;
+ this.highlight = this.highlight || '#4D4D4D';
+ this.highlight2 = this.highlight2 || '#A3A3A3';
+
+ this.shapes = this._getShapes(this._gauge, this);
+ if(this.label){
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ var pos = this._gauge._getPosition(v);
+ this.text = this._gauge.drawText(''+this.label, pos, this._gauge.dataY + this.offset - 5, 'middle','top', this.color, this.font);
+ }
+
+ for(i=0; i<this.shapes.length; i++){
+ if(this.hover){
+ this.shapes[i].getEventSource().setAttribute('hover',this.hover);
+ }
+ if(this.onDragMove && !this.noChange){
+ this._gauge.connect(this.shapes[i].getEventSource(), 'onmousedown', this._gauge.handleMouseDown);
+ this.shapes[i].getEventSource().style.cursor = 'pointer';
+ }
+ }
+ this.currentValue = this.value;
+ }
+ },
+ _move: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Moves this indicator (since it's already been drawn once)
+ // dontAnimate: Boolean
+ // Indicates if the drawing should not be animated (vs. the default of doing an animation)
+ var v = this.value ;
+ if(v < this.min){v = this.min;}
+ if(v > this.max){v = this.max;}
+ var c = this._gauge._getPosition(this.currentValue);
+ this.currentValue = v;
+ v = this._gauge._getPosition(v)-this._gauge.dataX;
+ if(dontAnimate){
+ this.shapes[0].applyTransform(dojox.gfx.matrix.translate(v-(this.shapes[0].matrix?this.shapes[0].matrix.dx:0),0));
+ }else{
+ var anim = new dojo.Animation({curve: [c, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, function(jump){
+ this.shapes[0].applyTransform(dojox.gfx.matrix.translate(jump-(this.shapes[0].matrix?this.shapes[0].matrix.dx:0),0));
+ }));
+ anim.play();
+ }
+ }
+});
+dojo.declare("dojox.widget.BarGauge",dojox.widget.gauge._Gauge,{
+ // summary:
+ // a bar graph built using the dojox.gfx package.
+ //
+ // description:
+ // using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
+ // builds a bar graph component, used to display numerical data in a familiar format.
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.BarGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.BarGauge"
+ // id="testBarGauge"
+ // barGaugeHeight="55"
+ // dataY="25"
+ // dataHeight="25"
+ // dataWidth="225">
+ // </div>
+
+ // dataX: Number
+ // x position of data area (default 5)
+ dataX: 5,
+
+ // dataY: Number
+ // y position of data area (default 5)
+ dataY: 5,
+
+ // dataWidth: Number
+ // width of data area (default is bar graph width - 10)
+ dataWidth: 0,
+
+ // dataHeight: Number
+ // height of data area (default is bar graph width - 10)
+ dataHeight: 0,
+
+ // _defaultIndicator: override of dojox.widget._Gauge._defaultIndicator
+ _defaultIndicator: dojox.widget.gauge.BarLineIndicator,
+
+ startup: function(){
+ // handle settings from HTML by making sure all the options are
+ // converted correctly to numbers
+ //
+ // also connects mouse handling events
+
+ if(this.getChildren){
+ dojo.forEach(this.getChildren(), function(child){ child.startup(); });
+ }
+
+ if(!this.dataWidth){this.dataWidth = this.gaugeWidth - 10;}
+ if(!this.dataHeight){this.dataHeight = this.gaugeHeight - 10;}
+
+ this.inherited(arguments);
+ },
+
+ _getPosition: function(/*Number*/value){
+ // summary:
+ // This is a helper function used to determine the position that represents
+ // a given value on the bar graph
+ // value: Number
+ // A value to be converted to a position for this bar graph.
+
+ return this.dataX + Math.floor((value - this.min)/(this.max - this.min)*this.dataWidth);
+ },
+
+ _getValueForPosition: function(/*Number*/pos){
+ // summary:
+ // This is a helper function used to determine the value represented by
+ // a position on the bar graph
+ // pos: Number
+ // A position to be converted to a value.
+ return (pos - this.dataX)*(this.max - this.min)/this.dataWidth + this.min;
+ },
+
+ draw: function(){
+ // summary:
+ // This function is used to draw (or redraw) the bar graph
+ // description:
+ // Draws the bar graph by drawing the surface, the ranges, and the indicators.
+
+ if(!this.surface){this.createSurface();}
+
+ var i;
+ if(this._rangeData){
+ for(i=0; i<this._rangeData.length; i++){
+ this.drawRange(this._rangeData[i]);
+ }
+ if(this._img && this.image.overlay){
+ this._img.moveToFront();
+ }
+ }
+ if(this._indicatorData){
+ for(i=0; i<this._indicatorData.length; i++){
+ this._indicatorData[i].draw();
+ }
+ }
+ },
+
+ drawRange: function(/*Object*/range){
+ // summary:
+ // This function is used to draw (or redraw) a range
+ // description:
+ // Draws a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is either a dojox.widget.gauge.Range or an object
+ // with similar parameters (low, high, hover, etc.).
+ if(range.shape){
+ this.surface.remove(range.shape);
+ range.shape = null;
+ }
+
+ var x1 = this._getPosition(range.low);
+ var x2 = this._getPosition(range.high);
+ var path = this.surface.createRect({x:x1,
+ y:this.dataY,
+ width:x2-x1,
+ height:this.dataHeight});
+ if(dojo.isArray(range.color) || dojo.isString(range.color)){
+ path.setStroke({color: range.color});
+ path.setFill(range.color);
+ }else if(range.color.type){
+ // Color is a gradient
+ var y = this.dataY + this.dataHeight/2;
+ range.color.x1 = x1;
+ range.color.x2 = x2;
+ range.color.y1 = y;
+ range.color.y2 = y;
+ path.setFill(range.color);
+ path.setStroke({color: range.color.colors[0].color});
+ }else{
+ // We've defined a style rather than an explicit color
+ path.setStroke({color: "green"}); // Arbitrary color, just have to indicate
+ path.setFill("green"); // that we want it filled
+ path.getEventSource().setAttribute("class", range.color.style);
+ }
+ if(range.hover){
+ path.getEventSource().setAttribute('hover',range.hover);
+ }
+ range.shape = path;
+ },
+
+ getRangeUnderMouse: function(/*Object*/event){
+ // summary:
+ // Determines which range the mouse is currently over
+ // event: Object
+ // The event object as received by the mouse handling functions below.
+ var range = null;
+ var pos = dojo.coords(this.gaugeContent);
+ var x = event.clientX - pos.x;
+ var value = this._getValueForPosition(x);
+ if(this._rangeData){
+ for(var i=0; (i<this._rangeData.length) && !range; i++){
+ if((Number(this._rangeData[i].low) <= value) && (Number(this._rangeData[i].high) >= value)){
+ range = this._rangeData[i];
+ }
+ }
+ }
+ return range;
+ },
+
+ _dragIndicator: function(/*Object*/ widget, /*Object*/ event){
+ // summary:
+ // Handles the dragging of an indicator, including moving/re-drawing
+ // get new value based on mouse position
+ var pos = dojo.coords(widget.gaugeContent);
+ var x = event.clientX - pos.x;
+ var value = widget._getValueForPosition(x);
+ if(value < widget.min){value = widget.min;}
+ if(value > widget.max){value = widget.max;}
+ // update the indicator
+ widget._drag.value = value;
+ // callback
+ widget._drag.onDragMove(widget._drag);
+ // redraw/move indicator(s)
+ widget._drag.draw(true);
+ dojo.stopEvent(event);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Calendar.js b/js/dojo-1.6/dojox/widget/Calendar.js new file mode 100644 index 0000000..f669641 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar.js @@ -0,0 +1,945 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Calendar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Calendar"] = true;
+dojo.provide("dojox.widget.Calendar");
+dojo.experimental("dojox.widget.Calendar");
+
+dojo.require("dijit.Calendar");
+dojo.require("dijit._Container");
+
+dojo.declare("dojox.widget._CalendarBase", [dijit._Widget, dijit._Templated, dijit._Container], {
+ // summary:
+ // The Root class for all _Calendar extensions
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/Calendar.html", "<div class=\"dojoxCalendar\">\r\n <div tabindex=\"0\" class=\"dojoxCalendarContainer\" style=\"visibility: visible;\" dojoAttachPoint=\"container\">\r\n\t\t<div style=\"display:none\">\r\n\t\t\t<div dojoAttachPoint=\"previousYearLabelNode\"></div>\r\n\t\t\t<div dojoAttachPoint=\"nextYearLabelNode\"></div>\r\n\t\t\t<div dojoAttachPoint=\"monthLabelSpacer\"></div>\r\n\t\t</div>\r\n <div class=\"dojoxCalendarHeader\">\r\n <div>\r\n <div class=\"dojoxCalendarDecrease\" dojoAttachPoint=\"decrementMonth\"></div>\r\n </div>\r\n <div class=\"\">\r\n <div class=\"dojoxCalendarIncrease\" dojoAttachPoint=\"incrementMonth\"></div>\r\n </div>\r\n <div class=\"dojoxCalendarTitle\" dojoAttachPoint=\"header\" dojoAttachEvent=\"onclick: onHeaderClick\">\r\n </div>\r\n </div>\r\n <div class=\"dojoxCalendarBody\" dojoAttachPoint=\"containerNode\"></div>\r\n <div class=\"\">\r\n <div class=\"dojoxCalendarFooter\" dojoAttachPoint=\"footer\"> \r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n"),
+
+ // _views: Array
+ // The list of mixin views available on this calendar.
+ _views: null,
+
+ // useFx: Boolean
+ // Specifies if visual effects should be applied to the widget.
+ // The default behavior of the widget does not contain any effects.
+ // The dojox.widget.CalendarFx package is needed for these.
+ useFx: true,
+
+ // widgetsInTemplate: Boolean
+ // This widget is a container of other widgets, so this is true.
+ widgetsInTemplate: true,
+
+ // value: Date
+ // The currently selected Date
+ value: new Date(),
+
+ constraints: null,
+
+ // footerFormat: String
+ // The date format of the date displayed in the footer. Can be
+ // 'short', 'medium', and 'long'
+ footerFormat: "medium",
+
+ constructor: function(){
+ this._views = [];
+ this.value = new Date();
+ },
+
+ postMixInProperties: function(){
+ var c = this.constraints;
+ if(c){
+ var fromISO = dojo.date.stamp.fromISOString;
+ if(typeof c.min == "string"){
+ c.min = fromISO(c.min);
+ }
+ if(typeof c.max == "string"){
+ c.max = fromISO(c.max);
+ }
+ }
+ this.value = this.parseInitialValue(this.value);
+ },
+
+ parseInitialValue: function(value){
+ if (!value || value === -1){
+ return new Date();
+ }else if(value.getFullYear){
+ return value;
+ }else if (!isNaN(value)) {
+ if (typeof this.value == "string") {
+ value = parseInt(value);
+ }
+ value = this._makeDate(value);
+ }
+ return value;
+ },
+
+ _makeDate: function(value){
+ return value;//new Date(value);
+ },
+
+ postCreate: function(){
+ // summary:
+ // Instantiates the mixin views
+
+ this.displayMonth = new Date(this.get('value'));
+
+ if(this._isInvalidDate(this.displayMonth)){
+ this.displayMonth = new Date();
+ }
+
+ var mixin = {
+ parent: this,
+ _getValueAttr: dojo.hitch(this, function(){return new Date(this._internalValue || this.value);}),
+ _getDisplayMonthAttr: dojo.hitch(this, function(){return new Date(this.displayMonth);}),
+ _getConstraintsAttr: dojo.hitch(this, function(){return this.constraints;}),
+ getLang: dojo.hitch(this, function(){return this.lang;}),
+ isDisabledDate: dojo.hitch(this, this.isDisabledDate),
+ getClassForDate: dojo.hitch(this, this.getClassForDate),
+ addFx: this.useFx ? dojo.hitch(this, this.addFx) : function(){}
+ };
+
+ //Add the mixed in views.
+ dojo.forEach(this._views, function(widgetType){
+ var widget = new widgetType(mixin, dojo.create('div'));
+ this.addChild(widget);
+
+ var header = widget.getHeader();
+ if(header){
+ //place the views's header node in the header of the main widget
+ this.header.appendChild(header);
+
+ //hide the header node of the widget
+ dojo.style(header, "display", "none");
+ }
+ //Hide all views
+ dojo.style(widget.domNode, "visibility", "hidden");
+
+ //Listen for the values in a view to be selected
+ dojo.connect(widget, "onValueSelected", this, "_onDateSelected");
+ widget.set("value", this.get('value'));
+ }, this);
+
+ if(this._views.length < 2){
+ dojo.style(this.header, "cursor", "auto");
+ }
+
+ this.inherited(arguments);
+
+ // Cache the list of children widgets.
+ this._children = this.getChildren();
+
+ this._currentChild = 0;
+
+ //Populate the footer with today's date.
+ var today = new Date();
+
+ this.footer.innerHTML = "Today: "
+ + dojo.date.locale.format(today, {
+ formatLength:this.footerFormat,
+ selector:'date',
+ locale:this.lang});
+
+ dojo.connect(this.footer, "onclick", this, "goToToday");
+
+ var first = this._children[0];
+
+ dojo.style(first.domNode, "top", "0px");
+ dojo.style(first.domNode, "visibility", "visible");
+
+ var header = first.getHeader();
+ if(header){
+ dojo.style(first.getHeader(), "display", "");
+ }
+
+ dojo[first.useHeader ? "removeClass" : "addClass"](this.container, "no-header");
+
+ first.onDisplay();
+
+ var _this = this;
+
+ var typematic = function(nodeProp, dateProp, adj){
+ dijit.typematic.addMouseListener(_this[nodeProp], _this, function(count){
+ if(count >= 0){ _this._adjustDisplay(dateProp, adj);}
+ }, 0.8, 500);
+ };
+ typematic("incrementMonth", "month", 1);
+ typematic("decrementMonth", "month", -1);
+ this._updateTitleStyle();
+ },
+
+ addFx: function(query, fromNode){
+ // Stub function than can be overridden to add effects.
+ },
+
+ _isInvalidDate: function(/*Date*/ value){
+ // summary:
+ // Runs various tests on the value, checking for invalid conditions
+ // tags:
+ // private
+ return !value || isNaN(value) || typeof value != "object" || value.toString() == this._invalidDate;
+ },
+
+ _setValueAttr: function(/*Date*/ value){
+ // summary:
+ // Set the current date and update the UI. If the date is disabled, the selection will
+ // not change, but the display will change to the corresponding month.
+ if(!value){
+ value = new Date();
+ }
+ if(!value["getFullYear"]){
+ value = dojo.date.stamp.fromISOString(value + "");
+ }
+ if(this._isInvalidDate(value)){
+ return false;
+ }
+ if(!this.value || dojo.date.compare(value, this.value)){
+ value = new Date(value);
+ this.displayMonth = new Date(value);
+ this._internalValue = value;
+ if(!this.isDisabledDate(value, this.lang) && this._currentChild == 0){
+ this.value = value;
+ this.onChange(value);
+ }
+ if (this._children && this._children.length > 0) {
+ this._children[this._currentChild].set("value", this.value);
+ }
+ return true;
+ }
+ return false;
+ },
+
+ isDisabledDate: function(/*Date*/date, /*String?*/locale){
+ // summary:
+ // May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
+ var c = this.constraints;
+ var compare = dojo.date.compare;
+ return c && (c.min && (compare(c.min, date, "date") > 0) ||
+ (c.max && compare(c.max, date, "date") < 0));
+ },
+
+ onValueSelected: function(/*Date*/date){
+ // summary:
+ // A date cell was selected. It may be the same as the previous value.
+ },
+
+ _onDateSelected: function(date, formattedValue, force){
+ this.displayMonth = date;
+
+ this.set("value", date)
+ //Only change the selected value if it was chosen from the
+ //first child.
+ if(!this._transitionVert(-1)){
+ if(!formattedValue && formattedValue !== 0){
+ formattedValue = this.get('value');
+ }
+ this.onValueSelected(formattedValue);
+ }
+
+ },
+
+ onChange: function(/*Date*/date){
+ // summary:
+ // Called only when the selected date has changed
+ },
+
+ onHeaderClick: function(e){
+ // summary:
+ // Transitions to the next view.
+ this._transitionVert(1);
+ },
+
+ goToToday: function(){
+ this.set("value", new Date());
+ this.onValueSelected(this.get('value'));
+ },
+
+ _transitionVert: function(/*Number*/direction){
+ // summary:
+ // Animates the views to show one and hide another, in a
+ // vertical direction.
+ // If 'direction' is 1, then the views slide upwards.
+ // If 'direction' is -1, the views slide downwards.
+ var curWidget = this._children[this._currentChild];
+ var nextWidget = this._children[this._currentChild + direction];
+ if(!nextWidget){return false;}
+
+ dojo.style(nextWidget.domNode, "visibility", "visible");
+
+ var height = dojo.style(this.containerNode, "height");
+ nextWidget.set("value", this.displayMonth);
+
+ if(curWidget.header){
+ dojo.style(curWidget.header, "display", "none");
+ }
+ if(nextWidget.header){
+ dojo.style(nextWidget.header, "display", "");
+ }
+ dojo.style(nextWidget.domNode, "top", (height * -1) + "px");
+ dojo.style(nextWidget.domNode, "visibility", "visible");
+
+ this._currentChild += direction;
+
+ var height1 = height * direction;
+ var height2 = 0;
+ dojo.style(nextWidget.domNode, "top", (height1 * -1) + "px");
+
+ // summary: Slides two nodes vertically.
+ var anim1 = dojo.animateProperty({
+ node: curWidget.domNode,
+ properties: {top: height1},
+ onEnd: function(){
+ dojo.style(curWidget.domNode, "visibility", "hidden");
+ }
+ });
+ var anim2 = dojo.animateProperty({
+ node: nextWidget.domNode,
+ properties: {top: height2},
+ onEnd: function(){
+ nextWidget.onDisplay();
+ }
+ });
+
+ dojo[nextWidget.useHeader ? "removeClass" : "addClass"](this.container, "no-header");
+
+ anim1.play();
+ anim2.play();
+ curWidget.onBeforeUnDisplay()
+ nextWidget.onBeforeDisplay();
+
+ this._updateTitleStyle();
+ return true;
+ },
+
+ _updateTitleStyle: function(){
+ dojo[this._currentChild < this._children.length -1 ? "addClass" : "removeClass"](this.header, "navToPanel");
+ },
+
+ _slideTable: function(/*String*/widget, /*Number*/direction, /*Function*/callback){
+ // summary:
+ // Animates the horizontal sliding of a table.
+ var table = widget.domNode;
+
+ //Clone the existing table
+ var newTable = table.cloneNode(true);
+ var left = dojo.style(table, "width");
+
+ table.parentNode.appendChild(newTable);
+
+ //Place the existing node either to the left or the right of the new node,
+ //depending on which direction it is to slide.
+ dojo.style(table, "left", (left * direction) + "px");
+
+ //Call the function that generally populates the new cloned node with new data.
+ //It may also attach event listeners.
+ callback();
+
+ //Animate the two nodes.
+ var anim1 = dojo.animateProperty({node: newTable, properties:{left: left * direction * -1}, duration: 500, onEnd: function(){
+ newTable.parentNode.removeChild(newTable);
+ }});
+ var anim2 = dojo.animateProperty({node: table, properties:{left: 0}, duration: 500});
+
+ anim1.play();
+ anim2.play();
+ },
+
+ _addView: function(view){
+ //Insert the view at the start of the array.
+ this._views.push(view);
+ },
+
+ getClassForDate: function(/*Date*/dateObject, /*String?*/locale){
+ // summary:
+ // May be overridden to return CSS classes to associate with the date entry for the given dateObject,
+ // for example to indicate a holiday in specified locale.
+
+/*=====
+ return ""; // String
+=====*/
+ },
+
+ _adjustDisplay: function(/*String*/part, /*int*/amount, noSlide){
+ // summary:
+ // This function overrides the base function defined in dijit.Calendar.
+ // It changes the displayed years, months and days depending on the inputs.
+ var child = this._children[this._currentChild];
+
+ var month = this.displayMonth = child.adjustDate(this.displayMonth, amount);
+
+ this._slideTable(child, amount, function(){
+ child.set("value", month);
+ });
+ }
+});
+
+dojo.declare("dojox.widget._CalendarView", dijit._Widget, {
+ // summary:
+ // Base implementation for all view mixins.
+ // All calendar views should extend this widget.
+ headerClass: "",
+
+ useHeader: true,
+
+ cloneClass: function(clazz, n, before){
+ // summary:
+ // Clones all nodes with the class 'clazz' in a widget
+ var template = dojo.query(clazz, this.domNode)[0];
+ var i;
+ if(!before){
+ for(i = 0; i < n; i++){
+ template.parentNode.appendChild(template.cloneNode(true));
+ }
+ }else{
+ var bNode = dojo.query(clazz, this.domNode)[0];
+ for(i = 0; i < n; i++){
+ template.parentNode.insertBefore(template.cloneNode(true), bNode);
+ }
+ }
+ },
+
+ _setText: function(node, text){
+ // summary:
+ // Sets the text inside a node
+ if(node.innerHTML != text){
+ dojo.empty(node);
+ node.appendChild(dojo.doc.createTextNode(text));
+ }
+ },
+
+ getHeader: function(){
+ // summary:
+ // Returns the header node of a view. If none exists,
+ // an empty DIV is created and returned.
+ return this.header || (this.header = this.header = dojo.create("span", { "class":this.headerClass }));
+ },
+
+ onValueSelected: function(date){
+ //Stub function called when a date is selected
+ },
+
+ adjustDate: function(date, amount){
+ // summary:
+ // Adds or subtracts values from a date.
+ // The unit, e.g. "day", "month" or "year", is
+ // specified in the "datePart" property of the
+ // calendar view mixin.
+ return dojo.date.add(date, this.datePart, amount);
+ },
+
+ onDisplay: function(){
+ // summary:
+ // Stub function that can be used to tell a view when it is shown.
+ },
+
+ onBeforeDisplay: function(){
+ // summary:
+ // Stub function that can be used to tell a view it is about to be shown.
+ },
+
+ onBeforeUnDisplay: function(){
+ // summary:
+ // Stub function that can be used to tell
+ // a view when it is no longer shown.
+ }
+});
+
+dojo.declare("dojox.widget._CalendarDay", null, {
+ // summary:
+ // Mixin for the dojox.widget.Calendar which provides
+ // the standard day-view. A single month is shown at a time.
+ parent: null,
+
+ constructor: function(){
+ this._addView(dojox.widget._CalendarDayView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarDayView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary: View class for the dojox.widget.Calendar.
+ // Adds a view showing every day of a single month to the calendar.
+ // This should not be mixed in directly with dojox.widget._CalendarBase.
+ // Instead, use dojox.widget._CalendarDay
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarDay.html", "<div class=\"dijitCalendarDayLabels\" style=\"left: 0px;\" dojoAttachPoint=\"dayContainer\">\r\n\t<div dojoAttachPoint=\"header\">\r\n\t\t<div dojoAttachPoint=\"monthAndYearHeader\">\r\n\t\t\t<span dojoAttachPoint=\"monthLabelNode\" class=\"dojoxCalendarMonthLabelNode\"></span>\r\n\t\t\t<span dojoAttachPoint=\"headerComma\" class=\"dojoxCalendarComma\">,</span>\r\n\t\t\t<span dojoAttachPoint=\"yearLabelNode\" class=\"dojoxCalendarDayYearLabel\"></span>\r\n\t\t</div>\r\n\t</div>\r\n\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\r\n\t\t<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dijitCalendarDayLabelTemplate\"><div class=\"dijitCalendarDayLabel\"></div></td>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tbody dojoAttachEvent=\"onclick: _onDayClick\">\r\n\t\t\t<tr class=\"dijitCalendarWeekTemplate\">\r\n\t\t\t\t<td class=\"dojoxCalendarNextMonth dijitCalendarDateTemplate\">\r\n\t\t\t\t\t<div class=\"dijitCalendarDateLabel\"></div>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n</div>\r\n"),
+
+ // datePart: String
+ // Specifies how much to increment the displayed date when the user
+ // clicks the array button to increment of decrement the view.
+ datePart: "month",
+
+ // dayWidth: String
+ // Specifies the type of day name to display. "narrow" causes just one letter to be shown.
+ dayWidth: "narrow",
+
+ postCreate: function(){
+ // summary:
+ // Constructs the calendar view.
+ this.cloneClass(".dijitCalendarDayLabelTemplate", 6);
+ this.cloneClass(".dijitCalendarDateTemplate", 6);
+
+ // now make 6 week rows
+ this.cloneClass(".dijitCalendarWeekTemplate", 5);
+
+ // insert localized day names in the header
+ var dayNames = dojo.date.locale.getNames('days', this.dayWidth, 'standAlone', this.getLang());
+ var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.getLang());
+
+ // Set the text of the day labels.
+ dojo.query(".dijitCalendarDayLabel", this.domNode).forEach(function(label, i){
+ this._setText(label, dayNames[(i + dayOffset) % 7]);
+ }, this);
+ },
+
+ onDisplay: function(){
+ if(!this._addedFx){
+ // Add visual effects to the view, if any has been specified.
+ this._addedFx = true;
+ this.addFx(".dijitCalendarDateTemplate div", this.domNode);
+ }
+ },
+
+ _onDayClick: function(e){
+ // summary:
+ // Executed when a day value is clicked.
+
+ // If the user somehow clicked the TR, rather than a
+ // cell, ignore it.
+ if(typeof(e.target._date) == "undefined"){return;}
+
+ var date = new Date(this.get("displayMonth"));
+
+ var p = e.target.parentNode;
+ var c = "dijitCalendar";
+ var d = dojo.hasClass(p, c + "PreviousMonth") ? -1 :
+ (dojo.hasClass(p, c + "NextMonth") ? 1 : 0);
+ if(d){date = dojo.date.add(date, "month", d)}
+ date.setDate(e.target._date);
+
+ // If the day is disabled, ignore it
+ if(this.isDisabledDate(date)){
+ dojo.stopEvent(e);
+ return;
+ }
+ this.parent._onDateSelected(date);
+ },
+
+ _setValueAttr: function(value){
+ //Change the day values
+ this._populateDays();
+ },
+
+ _populateDays: function(){
+ // summary:
+ // Fills the days of the current month.
+
+ var currentDate = new Date(this.get("displayMonth"));
+ currentDate.setDate(1);
+ var firstDay = currentDate.getDay();
+ var daysInMonth = dojo.date.getDaysInMonth(currentDate);
+ var daysInPreviousMonth = dojo.date.getDaysInMonth(dojo.date.add(currentDate, "month", -1));
+ var today = new Date();
+ var selected = this.get('value');
+
+ var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.getLang());
+ if(dayOffset > firstDay){ dayOffset -= 7; }
+
+ var compareDate = dojo.date.compare;
+ var templateCls = ".dijitCalendarDateTemplate";
+ var selectedCls = "dijitCalendarSelectedDate";
+
+ var oldDate = this._lastDate;
+ var redrawRequired = oldDate == null
+ || oldDate.getMonth() != currentDate.getMonth()
+ || oldDate.getFullYear() != currentDate.getFullYear();
+ this._lastDate = currentDate;
+
+ // If still showing the same month, it's much faster to not redraw,
+ // and just change the selected date.
+ if(!redrawRequired){
+ dojo.query(templateCls, this.domNode)
+ .removeClass(selectedCls)
+ .filter(function(node){
+ return node.className.indexOf("dijitCalendarCurrent") > -1
+ && node._date == selected.getDate();
+ })
+ .addClass(selectedCls);
+ return;
+ }
+
+ // Iterate through dates in the calendar and fill in date numbers and style info
+ dojo.query(templateCls, this.domNode).forEach(function(template, i){
+ i += dayOffset;
+ var date = new Date(currentDate);
+ var number, clazz = "dijitCalendar", adj = 0;
+
+ if(i < firstDay){
+ number = daysInPreviousMonth - firstDay + i + 1;
+ adj = -1;
+ clazz += "Previous";
+ }else if(i >= (firstDay + daysInMonth)){
+ number = i - firstDay - daysInMonth + 1;
+ adj = 1;
+ clazz += "Next";
+ }else{
+ number = i - firstDay + 1;
+ clazz += "Current";
+ }
+
+ if(adj){
+ date = dojo.date.add(date, "month", adj);
+ }
+ date.setDate(number);
+
+ if(!compareDate(date, today, "date")){
+ clazz = "dijitCalendarCurrentDate " + clazz;
+ }
+
+ if(!compareDate(date, selected, "date")
+ && !compareDate(date, selected, "month")
+ && !compareDate(date, selected, "year") ){
+ clazz = selectedCls + " " + clazz;
+ }
+
+ if(this.isDisabledDate(date, this.getLang())){
+ clazz = " dijitCalendarDisabledDate " + clazz;
+ }
+
+ var clazz2 = this.getClassForDate(date, this.getLang());
+ if(clazz2){
+ clazz = clazz2 + " " + clazz;
+ }
+
+ template.className = clazz + "Month dijitCalendarDateTemplate";
+ template.dijitDateValue = date.valueOf();
+ var label = dojo.query(".dijitCalendarDateLabel", template)[0];
+
+ this._setText(label, date.getDate());
+
+ label._date = label.parentNode._date = date.getDate();
+ }, this);
+
+ // Fill in localized month name
+ var monthNames = dojo.date.locale.getNames('months', 'wide', 'standAlone', this.getLang());
+ this._setText(this.monthLabelNode, monthNames[currentDate.getMonth()]);
+ this._setText(this.yearLabelNode, currentDate.getFullYear());
+ }
+});
+
+
+dojo.declare("dojox.widget._CalendarMonthYear", null, {
+ // summary:
+ // Mixin class for adding a view listing all 12
+ // months of the year to the dojox.widget._CalendarBase
+
+ constructor: function(){
+ // summary:
+ // Adds a dojox.widget._CalendarMonthView view to the calendar widget.
+ this._addView(dojox.widget._CalendarMonthYearView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarMonthYearView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary:
+ // A Calendar view listing the 12 months of the year
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarMonthYear.html", "<div class=\"dojoxCal-MY-labels\" style=\"left: 0px;\"\t\r\n\tdojoAttachPoint=\"myContainer\" dojoAttachEvent=\"onclick: onClick\">\r\n\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr class=\"dojoxCal-MY-G-Template\">\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-M-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarMonthLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-M-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarMonthLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-Y-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarYearLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-Y-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarYearLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t <tr class=\"dojoxCal-MY-btns\">\r\n\t\t\t\t\t\t \t <td class=\"dojoxCal-MY-btns\" colspan=\"4\">\r\n\t\t\t\t\t\t \t\t <span class=\"dijitReset dijitInline dijitButtonNode ok-btn\" dojoAttachEvent=\"onclick: onOk\" dojoAttachPoint=\"okBtn\">\r\n\t\t\t\t\t\t \t \t \t <button\tclass=\"dijitReset dijitStretch dijitButtonContents\">OK</button>\r\n\t\t\t\t\t\t\t\t </span>\r\n\t\t\t\t\t\t\t\t <span class=\"dijitReset dijitInline dijitButtonNode cancel-btn\" dojoAttachEvent=\"onclick: onCancel\" dojoAttachPoint=\"cancelBtn\">\r\n\t\t\t\t\t\t \t \t\t <button\tclass=\"dijitReset dijitStretch dijitButtonContents\">Cancel</button>\r\n\t\t\t\t\t\t\t\t </span>\r\n\t\t\t\t\t\t \t </td>\r\n\t\t\t\t\t\t </tr>\r\n\t\t\t\t</tbody>\r\n\t\t</table>\r\n</div>\r\n"),
+
+ // datePart: String
+ // Specifies how much to increment the displayed date when the user
+ // clicks the array button to increment of decrement the view.
+ datePart: "year",
+
+ // displayedYears: Number
+ // The number of years to display at once.
+ displayedYears: 10,
+
+ useHeader: false,
+
+ postCreate: function(){
+ this.cloneClass(".dojoxCal-MY-G-Template", 5, ".dojoxCal-MY-btns");
+ this.monthContainer = this.yearContainer = this.myContainer;
+
+ var yClass = "dojoxCalendarYearLabel";
+ var dClass = "dojoxCalendarDecrease";
+ var iClass = "dojoxCalendarIncrease";
+
+ dojo.query("." + yClass, this.myContainer).forEach(function(node, idx){
+ var clazz = iClass;
+ switch(idx){
+ case 0:
+ clazz = dClass;
+ case 1:
+ dojo.removeClass(node, yClass);
+ dojo.addClass(node, clazz);
+ break;
+ }
+ });
+ // Get the year increment and decrement buttons.
+ this._decBtn = dojo.query('.' + dClass, this.myContainer)[0];
+ this._incBtn = dojo.query('.' + iClass, this.myContainer)[0];
+
+ dojo.query(".dojoxCal-MY-M-Template", this.domNode)
+ .filter(function(item){
+ return item.cellIndex == 1;
+ })
+ .addClass("dojoxCal-MY-M-last");
+
+ dojo.connect(this, "onBeforeDisplay", dojo.hitch(this, function(){
+ this._cachedDate = new Date(this.get("value").getTime());
+ this._populateYears(this._cachedDate.getFullYear());
+ this._populateMonths();
+ this._updateSelectedMonth();
+ this._updateSelectedYear();
+ }));
+
+ dojo.connect(this, "_populateYears", dojo.hitch(this, function(){
+ this._updateSelectedYear();
+ }));
+ dojo.connect(this, "_populateMonths", dojo.hitch(this, function(){
+ this._updateSelectedMonth();
+ }));
+
+ this._cachedDate = this.get("value");
+
+ this._populateYears();
+ this._populateMonths();
+
+ // Add visual effects to the view, if any have been mixed in
+ this.addFx(".dojoxCalendarMonthLabel,.dojoxCalendarYearLabel ", this.myContainer);
+ },
+
+ _setValueAttr: function(value){
+ if (value && value.getFullYear()) {
+ this._populateYears(value.getFullYear());
+ }
+ },
+
+ getHeader: function(){
+ return null;
+ },
+
+ _getMonthNames: function(format){
+ // summary:
+ // Returns localized month names
+ this._monthNames = this._monthNames || dojo.date.locale.getNames('months', format, 'standAlone', this.getLang());
+ return this._monthNames;
+ },
+
+ _populateMonths: function(){
+ // summary:
+ // Populate the month names using the localized values.
+ var monthNames = this._getMonthNames('abbr');
+ dojo.query(".dojoxCalendarMonthLabel", this.monthContainer).forEach(dojo.hitch(this, function(node, cnt){
+ this._setText(node, monthNames[cnt]);
+ }));
+ var constraints = this.get('constraints');
+
+ if(constraints){
+ var date = new Date();
+ date.setFullYear(this._year);
+ var min = -1, max = 12;
+ if(constraints.min){
+ var minY = constraints.min.getFullYear();
+ if(minY > this._year){
+ min = 12;
+ }else if(minY == this._year){
+ min = constraints.min.getMonth();
+ }
+ }
+ if(constraints.max){
+ var maxY = constraints.max.getFullYear();
+ if(maxY < this._year){
+ max = -1;
+ }else if(maxY == this._year){
+ max = constraints.max.getMonth();
+ }
+ }
+
+ dojo.query(".dojoxCalendarMonthLabel", this.monthContainer)
+ .forEach(dojo.hitch(this, function(node, cnt){
+ dojo[(cnt < min || cnt > max) ? "addClass" : "removeClass"]
+ (node, 'dijitCalendarDisabledDate');
+ }));
+ }
+
+ var h = this.getHeader();
+ if(h){
+ this._setText(this.getHeader(), this.get("value").getFullYear());
+ }
+ },
+
+ _populateYears: function(year){
+ // summary:
+ // Fills the list of years with a range of 12 numbers, with the current year
+ // being the 6th number.
+ var constraints = this.get('constraints');
+ var dispYear = year || this.get("value").getFullYear();
+ var firstYear = dispYear - Math.floor(this.displayedYears/2);
+ var min = constraints && constraints.min ? constraints.min.getFullYear() : firstYear -10000;
+ firstYear = Math.max(min, firstYear);
+
+ // summary: Writes the years to display to the view
+ this._displayedYear = dispYear;
+
+ var yearLabels = dojo.query(".dojoxCalendarYearLabel", this.yearContainer);
+
+ var max = constraints && constraints.max ? constraints.max.getFullYear() - firstYear : yearLabels.length;
+ var disabledClass = 'dijitCalendarDisabledDate';
+
+ yearLabels.forEach(dojo.hitch(this, function(node, cnt){
+ if(cnt <= max){
+ this._setText(node, firstYear + cnt);
+ dojo.removeClass(node, disabledClass);
+ }else{
+ dojo.addClass(node, disabledClass);
+ }
+ }));
+
+ if(this._incBtn){
+ dojo[max < yearLabels.length ? "addClass" : "removeClass"](this._incBtn, disabledClass);
+ }
+ if(this._decBtn){
+ dojo[min >= firstYear ? "addClass" : "removeClass"](this._decBtn, disabledClass);
+ }
+
+ var h = this.getHeader();
+ if(h){
+ this._setText(this.getHeader(), firstYear + " - " + (firstYear + 11));
+ }
+ },
+
+ _updateSelectedYear: function(){
+ this._year = String((this._cachedDate || this.get("value")).getFullYear());
+ this._updateSelectedNode(".dojoxCalendarYearLabel", dojo.hitch(this, function(node, idx){
+ return this._year !== null && node.innerHTML == this._year;
+ }));
+ },
+
+ _updateSelectedMonth: function(){
+ var month = (this._cachedDate || this.get("value")).getMonth();
+ this._month = month;
+ this._updateSelectedNode(".dojoxCalendarMonthLabel", function(node, idx){
+ return idx == month;
+ });
+ },
+
+ _updateSelectedNode: function(query, filter){
+ var sel = "dijitCalendarSelectedDate";
+ dojo.query(query, this.domNode)
+ .forEach(function(node, idx, array){
+ dojo[filter(node, idx, array) ? "addClass" : "removeClass"](node.parentNode, sel);
+ });
+ var selMonth = dojo.query('.dojoxCal-MY-M-Template div', this.myContainer)
+ .filter(function(node){
+ return dojo.hasClass(node.parentNode, sel);
+ })[0];
+ if(!selMonth){return;}
+ var disabled = dojo.hasClass(selMonth, 'dijitCalendarDisabledDate');
+
+ dojo[disabled ? 'addClass' : 'removeClass'](this.okBtn, "dijitDisabled");
+ },
+
+ onClick: function(evt){
+ // summary:
+ // Handles clicks on month names
+ var clazz;
+ var _this = this;
+ var sel = "dijitCalendarSelectedDate";
+ function hc(c){
+ return dojo.hasClass(evt.target, c);
+ }
+
+ if(hc('dijitCalendarDisabledDate')){
+ dojo.stopEvent(evt);
+ return false;
+ }
+
+ if(hc("dojoxCalendarMonthLabel")){
+ clazz = "dojoxCal-MY-M-Template";
+ this._month = evt.target.parentNode.cellIndex + (evt.target.parentNode.parentNode.rowIndex * 2);
+ this._cachedDate.setMonth(this._month);
+ this._updateSelectedMonth();
+ }else if(hc( "dojoxCalendarYearLabel")){
+ clazz = "dojoxCal-MY-Y-Template";
+ this._year = Number(evt.target.innerHTML);
+ this._cachedDate.setYear(this._year);
+ this._populateMonths();
+ this._updateSelectedYear();
+ }else if(hc("dojoxCalendarDecrease")){
+ this._populateYears(this._displayedYear - 10);
+ return true;
+ }else if(hc("dojoxCalendarIncrease")){
+ this._populateYears(this._displayedYear + 10);
+ return true;
+ }else{
+ return true;
+ }
+ dojo.stopEvent(evt);
+ return false;
+ },
+
+ onOk: function(evt){
+ dojo.stopEvent(evt);
+ if(dojo.hasClass(this.okBtn, "dijitDisabled")){
+ return false;
+ }
+ this.onValueSelected(this._cachedDate);
+ return false;
+ },
+
+ onCancel: function(evt){
+ dojo.stopEvent(evt);
+ this.onValueSelected(this.get("value"));
+ return false;
+ }
+});
+
+dojo.declare("dojox.widget.Calendar2Pane",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay,
+ dojox.widget._CalendarMonthYear], {
+ // summary: A Calendar withtwo panes, the second one
+ // containing both month and year
+ }
+);
+
+dojo.declare("dojox.widget.Calendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay,
+ dojox.widget._CalendarMonthYear], {
+ // summary: The standard Calendar. It includes day and month/year views.
+ // No visual effects are included.
+ }
+);
+
+dojo.declare("dojox.widget.DailyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay], {
+ // summary: A calendar withonly a daily view.
+ _makeDate: function(value){
+ var now = new Date();
+ now.setDate(value);
+ return now;
+ }
+ }
+
+);
+
+dojo.declare("dojox.widget.MonthAndYearlyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarMonthYear], {
+ // summary: A calendar withonly a daily view.
+ }
+);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Calendar.xd.js b/js/dojo-1.6/dojox/widget/Calendar.xd.js new file mode 100644 index 0000000..a114ae0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar.xd.js @@ -0,0 +1,951 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Calendar"],
+["require", "dijit.Calendar"],
+["require", "dijit._Container"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Calendar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Calendar"] = true;
+dojo.provide("dojox.widget.Calendar");
+dojo.experimental("dojox.widget.Calendar");
+
+dojo.require("dijit.Calendar");
+dojo.require("dijit._Container");
+
+dojo.declare("dojox.widget._CalendarBase", [dijit._Widget, dijit._Templated, dijit._Container], {
+ // summary:
+ // The Root class for all _Calendar extensions
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/Calendar.html", "<div class=\"dojoxCalendar\">\r\n <div tabindex=\"0\" class=\"dojoxCalendarContainer\" style=\"visibility: visible;\" dojoAttachPoint=\"container\">\r\n\t\t<div style=\"display:none\">\r\n\t\t\t<div dojoAttachPoint=\"previousYearLabelNode\"></div>\r\n\t\t\t<div dojoAttachPoint=\"nextYearLabelNode\"></div>\r\n\t\t\t<div dojoAttachPoint=\"monthLabelSpacer\"></div>\r\n\t\t</div>\r\n <div class=\"dojoxCalendarHeader\">\r\n <div>\r\n <div class=\"dojoxCalendarDecrease\" dojoAttachPoint=\"decrementMonth\"></div>\r\n </div>\r\n <div class=\"\">\r\n <div class=\"dojoxCalendarIncrease\" dojoAttachPoint=\"incrementMonth\"></div>\r\n </div>\r\n <div class=\"dojoxCalendarTitle\" dojoAttachPoint=\"header\" dojoAttachEvent=\"onclick: onHeaderClick\">\r\n </div>\r\n </div>\r\n <div class=\"dojoxCalendarBody\" dojoAttachPoint=\"containerNode\"></div>\r\n <div class=\"\">\r\n <div class=\"dojoxCalendarFooter\" dojoAttachPoint=\"footer\"> \r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n"),
+
+ // _views: Array
+ // The list of mixin views available on this calendar.
+ _views: null,
+
+ // useFx: Boolean
+ // Specifies if visual effects should be applied to the widget.
+ // The default behavior of the widget does not contain any effects.
+ // The dojox.widget.CalendarFx package is needed for these.
+ useFx: true,
+
+ // widgetsInTemplate: Boolean
+ // This widget is a container of other widgets, so this is true.
+ widgetsInTemplate: true,
+
+ // value: Date
+ // The currently selected Date
+ value: new Date(),
+
+ constraints: null,
+
+ // footerFormat: String
+ // The date format of the date displayed in the footer. Can be
+ // 'short', 'medium', and 'long'
+ footerFormat: "medium",
+
+ constructor: function(){
+ this._views = [];
+ this.value = new Date();
+ },
+
+ postMixInProperties: function(){
+ var c = this.constraints;
+ if(c){
+ var fromISO = dojo.date.stamp.fromISOString;
+ if(typeof c.min == "string"){
+ c.min = fromISO(c.min);
+ }
+ if(typeof c.max == "string"){
+ c.max = fromISO(c.max);
+ }
+ }
+ this.value = this.parseInitialValue(this.value);
+ },
+
+ parseInitialValue: function(value){
+ if (!value || value === -1){
+ return new Date();
+ }else if(value.getFullYear){
+ return value;
+ }else if (!isNaN(value)) {
+ if (typeof this.value == "string") {
+ value = parseInt(value);
+ }
+ value = this._makeDate(value);
+ }
+ return value;
+ },
+
+ _makeDate: function(value){
+ return value;//new Date(value);
+ },
+
+ postCreate: function(){
+ // summary:
+ // Instantiates the mixin views
+
+ this.displayMonth = new Date(this.get('value'));
+
+ if(this._isInvalidDate(this.displayMonth)){
+ this.displayMonth = new Date();
+ }
+
+ var mixin = {
+ parent: this,
+ _getValueAttr: dojo.hitch(this, function(){return new Date(this._internalValue || this.value);}),
+ _getDisplayMonthAttr: dojo.hitch(this, function(){return new Date(this.displayMonth);}),
+ _getConstraintsAttr: dojo.hitch(this, function(){return this.constraints;}),
+ getLang: dojo.hitch(this, function(){return this.lang;}),
+ isDisabledDate: dojo.hitch(this, this.isDisabledDate),
+ getClassForDate: dojo.hitch(this, this.getClassForDate),
+ addFx: this.useFx ? dojo.hitch(this, this.addFx) : function(){}
+ };
+
+ //Add the mixed in views.
+ dojo.forEach(this._views, function(widgetType){
+ var widget = new widgetType(mixin, dojo.create('div'));
+ this.addChild(widget);
+
+ var header = widget.getHeader();
+ if(header){
+ //place the views's header node in the header of the main widget
+ this.header.appendChild(header);
+
+ //hide the header node of the widget
+ dojo.style(header, "display", "none");
+ }
+ //Hide all views
+ dojo.style(widget.domNode, "visibility", "hidden");
+
+ //Listen for the values in a view to be selected
+ dojo.connect(widget, "onValueSelected", this, "_onDateSelected");
+ widget.set("value", this.get('value'));
+ }, this);
+
+ if(this._views.length < 2){
+ dojo.style(this.header, "cursor", "auto");
+ }
+
+ this.inherited(arguments);
+
+ // Cache the list of children widgets.
+ this._children = this.getChildren();
+
+ this._currentChild = 0;
+
+ //Populate the footer with today's date.
+ var today = new Date();
+
+ this.footer.innerHTML = "Today: "
+ + dojo.date.locale.format(today, {
+ formatLength:this.footerFormat,
+ selector:'date',
+ locale:this.lang});
+
+ dojo.connect(this.footer, "onclick", this, "goToToday");
+
+ var first = this._children[0];
+
+ dojo.style(first.domNode, "top", "0px");
+ dojo.style(first.domNode, "visibility", "visible");
+
+ var header = first.getHeader();
+ if(header){
+ dojo.style(first.getHeader(), "display", "");
+ }
+
+ dojo[first.useHeader ? "removeClass" : "addClass"](this.container, "no-header");
+
+ first.onDisplay();
+
+ var _this = this;
+
+ var typematic = function(nodeProp, dateProp, adj){
+ dijit.typematic.addMouseListener(_this[nodeProp], _this, function(count){
+ if(count >= 0){ _this._adjustDisplay(dateProp, adj);}
+ }, 0.8, 500);
+ };
+ typematic("incrementMonth", "month", 1);
+ typematic("decrementMonth", "month", -1);
+ this._updateTitleStyle();
+ },
+
+ addFx: function(query, fromNode){
+ // Stub function than can be overridden to add effects.
+ },
+
+ _isInvalidDate: function(/*Date*/ value){
+ // summary:
+ // Runs various tests on the value, checking for invalid conditions
+ // tags:
+ // private
+ return !value || isNaN(value) || typeof value != "object" || value.toString() == this._invalidDate;
+ },
+
+ _setValueAttr: function(/*Date*/ value){
+ // summary:
+ // Set the current date and update the UI. If the date is disabled, the selection will
+ // not change, but the display will change to the corresponding month.
+ if(!value){
+ value = new Date();
+ }
+ if(!value["getFullYear"]){
+ value = dojo.date.stamp.fromISOString(value + "");
+ }
+ if(this._isInvalidDate(value)){
+ return false;
+ }
+ if(!this.value || dojo.date.compare(value, this.value)){
+ value = new Date(value);
+ this.displayMonth = new Date(value);
+ this._internalValue = value;
+ if(!this.isDisabledDate(value, this.lang) && this._currentChild == 0){
+ this.value = value;
+ this.onChange(value);
+ }
+ if (this._children && this._children.length > 0) {
+ this._children[this._currentChild].set("value", this.value);
+ }
+ return true;
+ }
+ return false;
+ },
+
+ isDisabledDate: function(/*Date*/date, /*String?*/locale){
+ // summary:
+ // May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
+ var c = this.constraints;
+ var compare = dojo.date.compare;
+ return c && (c.min && (compare(c.min, date, "date") > 0) ||
+ (c.max && compare(c.max, date, "date") < 0));
+ },
+
+ onValueSelected: function(/*Date*/date){
+ // summary:
+ // A date cell was selected. It may be the same as the previous value.
+ },
+
+ _onDateSelected: function(date, formattedValue, force){
+ this.displayMonth = date;
+
+ this.set("value", date)
+ //Only change the selected value if it was chosen from the
+ //first child.
+ if(!this._transitionVert(-1)){
+ if(!formattedValue && formattedValue !== 0){
+ formattedValue = this.get('value');
+ }
+ this.onValueSelected(formattedValue);
+ }
+
+ },
+
+ onChange: function(/*Date*/date){
+ // summary:
+ // Called only when the selected date has changed
+ },
+
+ onHeaderClick: function(e){
+ // summary:
+ // Transitions to the next view.
+ this._transitionVert(1);
+ },
+
+ goToToday: function(){
+ this.set("value", new Date());
+ this.onValueSelected(this.get('value'));
+ },
+
+ _transitionVert: function(/*Number*/direction){
+ // summary:
+ // Animates the views to show one and hide another, in a
+ // vertical direction.
+ // If 'direction' is 1, then the views slide upwards.
+ // If 'direction' is -1, the views slide downwards.
+ var curWidget = this._children[this._currentChild];
+ var nextWidget = this._children[this._currentChild + direction];
+ if(!nextWidget){return false;}
+
+ dojo.style(nextWidget.domNode, "visibility", "visible");
+
+ var height = dojo.style(this.containerNode, "height");
+ nextWidget.set("value", this.displayMonth);
+
+ if(curWidget.header){
+ dojo.style(curWidget.header, "display", "none");
+ }
+ if(nextWidget.header){
+ dojo.style(nextWidget.header, "display", "");
+ }
+ dojo.style(nextWidget.domNode, "top", (height * -1) + "px");
+ dojo.style(nextWidget.domNode, "visibility", "visible");
+
+ this._currentChild += direction;
+
+ var height1 = height * direction;
+ var height2 = 0;
+ dojo.style(nextWidget.domNode, "top", (height1 * -1) + "px");
+
+ // summary: Slides two nodes vertically.
+ var anim1 = dojo.animateProperty({
+ node: curWidget.domNode,
+ properties: {top: height1},
+ onEnd: function(){
+ dojo.style(curWidget.domNode, "visibility", "hidden");
+ }
+ });
+ var anim2 = dojo.animateProperty({
+ node: nextWidget.domNode,
+ properties: {top: height2},
+ onEnd: function(){
+ nextWidget.onDisplay();
+ }
+ });
+
+ dojo[nextWidget.useHeader ? "removeClass" : "addClass"](this.container, "no-header");
+
+ anim1.play();
+ anim2.play();
+ curWidget.onBeforeUnDisplay()
+ nextWidget.onBeforeDisplay();
+
+ this._updateTitleStyle();
+ return true;
+ },
+
+ _updateTitleStyle: function(){
+ dojo[this._currentChild < this._children.length -1 ? "addClass" : "removeClass"](this.header, "navToPanel");
+ },
+
+ _slideTable: function(/*String*/widget, /*Number*/direction, /*Function*/callback){
+ // summary:
+ // Animates the horizontal sliding of a table.
+ var table = widget.domNode;
+
+ //Clone the existing table
+ var newTable = table.cloneNode(true);
+ var left = dojo.style(table, "width");
+
+ table.parentNode.appendChild(newTable);
+
+ //Place the existing node either to the left or the right of the new node,
+ //depending on which direction it is to slide.
+ dojo.style(table, "left", (left * direction) + "px");
+
+ //Call the function that generally populates the new cloned node with new data.
+ //It may also attach event listeners.
+ callback();
+
+ //Animate the two nodes.
+ var anim1 = dojo.animateProperty({node: newTable, properties:{left: left * direction * -1}, duration: 500, onEnd: function(){
+ newTable.parentNode.removeChild(newTable);
+ }});
+ var anim2 = dojo.animateProperty({node: table, properties:{left: 0}, duration: 500});
+
+ anim1.play();
+ anim2.play();
+ },
+
+ _addView: function(view){
+ //Insert the view at the start of the array.
+ this._views.push(view);
+ },
+
+ getClassForDate: function(/*Date*/dateObject, /*String?*/locale){
+ // summary:
+ // May be overridden to return CSS classes to associate with the date entry for the given dateObject,
+ // for example to indicate a holiday in specified locale.
+
+/*=====
+ return ""; // String
+=====*/
+ },
+
+ _adjustDisplay: function(/*String*/part, /*int*/amount, noSlide){
+ // summary:
+ // This function overrides the base function defined in dijit.Calendar.
+ // It changes the displayed years, months and days depending on the inputs.
+ var child = this._children[this._currentChild];
+
+ var month = this.displayMonth = child.adjustDate(this.displayMonth, amount);
+
+ this._slideTable(child, amount, function(){
+ child.set("value", month);
+ });
+ }
+});
+
+dojo.declare("dojox.widget._CalendarView", dijit._Widget, {
+ // summary:
+ // Base implementation for all view mixins.
+ // All calendar views should extend this widget.
+ headerClass: "",
+
+ useHeader: true,
+
+ cloneClass: function(clazz, n, before){
+ // summary:
+ // Clones all nodes with the class 'clazz' in a widget
+ var template = dojo.query(clazz, this.domNode)[0];
+ var i;
+ if(!before){
+ for(i = 0; i < n; i++){
+ template.parentNode.appendChild(template.cloneNode(true));
+ }
+ }else{
+ var bNode = dojo.query(clazz, this.domNode)[0];
+ for(i = 0; i < n; i++){
+ template.parentNode.insertBefore(template.cloneNode(true), bNode);
+ }
+ }
+ },
+
+ _setText: function(node, text){
+ // summary:
+ // Sets the text inside a node
+ if(node.innerHTML != text){
+ dojo.empty(node);
+ node.appendChild(dojo.doc.createTextNode(text));
+ }
+ },
+
+ getHeader: function(){
+ // summary:
+ // Returns the header node of a view. If none exists,
+ // an empty DIV is created and returned.
+ return this.header || (this.header = this.header = dojo.create("span", { "class":this.headerClass }));
+ },
+
+ onValueSelected: function(date){
+ //Stub function called when a date is selected
+ },
+
+ adjustDate: function(date, amount){
+ // summary:
+ // Adds or subtracts values from a date.
+ // The unit, e.g. "day", "month" or "year", is
+ // specified in the "datePart" property of the
+ // calendar view mixin.
+ return dojo.date.add(date, this.datePart, amount);
+ },
+
+ onDisplay: function(){
+ // summary:
+ // Stub function that can be used to tell a view when it is shown.
+ },
+
+ onBeforeDisplay: function(){
+ // summary:
+ // Stub function that can be used to tell a view it is about to be shown.
+ },
+
+ onBeforeUnDisplay: function(){
+ // summary:
+ // Stub function that can be used to tell
+ // a view when it is no longer shown.
+ }
+});
+
+dojo.declare("dojox.widget._CalendarDay", null, {
+ // summary:
+ // Mixin for the dojox.widget.Calendar which provides
+ // the standard day-view. A single month is shown at a time.
+ parent: null,
+
+ constructor: function(){
+ this._addView(dojox.widget._CalendarDayView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarDayView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary: View class for the dojox.widget.Calendar.
+ // Adds a view showing every day of a single month to the calendar.
+ // This should not be mixed in directly with dojox.widget._CalendarBase.
+ // Instead, use dojox.widget._CalendarDay
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarDay.html", "<div class=\"dijitCalendarDayLabels\" style=\"left: 0px;\" dojoAttachPoint=\"dayContainer\">\r\n\t<div dojoAttachPoint=\"header\">\r\n\t\t<div dojoAttachPoint=\"monthAndYearHeader\">\r\n\t\t\t<span dojoAttachPoint=\"monthLabelNode\" class=\"dojoxCalendarMonthLabelNode\"></span>\r\n\t\t\t<span dojoAttachPoint=\"headerComma\" class=\"dojoxCalendarComma\">,</span>\r\n\t\t\t<span dojoAttachPoint=\"yearLabelNode\" class=\"dojoxCalendarDayYearLabel\"></span>\r\n\t\t</div>\r\n\t</div>\r\n\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\r\n\t\t<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dijitCalendarDayLabelTemplate\"><div class=\"dijitCalendarDayLabel\"></div></td>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tbody dojoAttachEvent=\"onclick: _onDayClick\">\r\n\t\t\t<tr class=\"dijitCalendarWeekTemplate\">\r\n\t\t\t\t<td class=\"dojoxCalendarNextMonth dijitCalendarDateTemplate\">\r\n\t\t\t\t\t<div class=\"dijitCalendarDateLabel\"></div>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n</div>\r\n"),
+
+ // datePart: String
+ // Specifies how much to increment the displayed date when the user
+ // clicks the array button to increment of decrement the view.
+ datePart: "month",
+
+ // dayWidth: String
+ // Specifies the type of day name to display. "narrow" causes just one letter to be shown.
+ dayWidth: "narrow",
+
+ postCreate: function(){
+ // summary:
+ // Constructs the calendar view.
+ this.cloneClass(".dijitCalendarDayLabelTemplate", 6);
+ this.cloneClass(".dijitCalendarDateTemplate", 6);
+
+ // now make 6 week rows
+ this.cloneClass(".dijitCalendarWeekTemplate", 5);
+
+ // insert localized day names in the header
+ var dayNames = dojo.date.locale.getNames('days', this.dayWidth, 'standAlone', this.getLang());
+ var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.getLang());
+
+ // Set the text of the day labels.
+ dojo.query(".dijitCalendarDayLabel", this.domNode).forEach(function(label, i){
+ this._setText(label, dayNames[(i + dayOffset) % 7]);
+ }, this);
+ },
+
+ onDisplay: function(){
+ if(!this._addedFx){
+ // Add visual effects to the view, if any has been specified.
+ this._addedFx = true;
+ this.addFx(".dijitCalendarDateTemplate div", this.domNode);
+ }
+ },
+
+ _onDayClick: function(e){
+ // summary:
+ // Executed when a day value is clicked.
+
+ // If the user somehow clicked the TR, rather than a
+ // cell, ignore it.
+ if(typeof(e.target._date) == "undefined"){return;}
+
+ var date = new Date(this.get("displayMonth"));
+
+ var p = e.target.parentNode;
+ var c = "dijitCalendar";
+ var d = dojo.hasClass(p, c + "PreviousMonth") ? -1 :
+ (dojo.hasClass(p, c + "NextMonth") ? 1 : 0);
+ if(d){date = dojo.date.add(date, "month", d)}
+ date.setDate(e.target._date);
+
+ // If the day is disabled, ignore it
+ if(this.isDisabledDate(date)){
+ dojo.stopEvent(e);
+ return;
+ }
+ this.parent._onDateSelected(date);
+ },
+
+ _setValueAttr: function(value){
+ //Change the day values
+ this._populateDays();
+ },
+
+ _populateDays: function(){
+ // summary:
+ // Fills the days of the current month.
+
+ var currentDate = new Date(this.get("displayMonth"));
+ currentDate.setDate(1);
+ var firstDay = currentDate.getDay();
+ var daysInMonth = dojo.date.getDaysInMonth(currentDate);
+ var daysInPreviousMonth = dojo.date.getDaysInMonth(dojo.date.add(currentDate, "month", -1));
+ var today = new Date();
+ var selected = this.get('value');
+
+ var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.getLang());
+ if(dayOffset > firstDay){ dayOffset -= 7; }
+
+ var compareDate = dojo.date.compare;
+ var templateCls = ".dijitCalendarDateTemplate";
+ var selectedCls = "dijitCalendarSelectedDate";
+
+ var oldDate = this._lastDate;
+ var redrawRequired = oldDate == null
+ || oldDate.getMonth() != currentDate.getMonth()
+ || oldDate.getFullYear() != currentDate.getFullYear();
+ this._lastDate = currentDate;
+
+ // If still showing the same month, it's much faster to not redraw,
+ // and just change the selected date.
+ if(!redrawRequired){
+ dojo.query(templateCls, this.domNode)
+ .removeClass(selectedCls)
+ .filter(function(node){
+ return node.className.indexOf("dijitCalendarCurrent") > -1
+ && node._date == selected.getDate();
+ })
+ .addClass(selectedCls);
+ return;
+ }
+
+ // Iterate through dates in the calendar and fill in date numbers and style info
+ dojo.query(templateCls, this.domNode).forEach(function(template, i){
+ i += dayOffset;
+ var date = new Date(currentDate);
+ var number, clazz = "dijitCalendar", adj = 0;
+
+ if(i < firstDay){
+ number = daysInPreviousMonth - firstDay + i + 1;
+ adj = -1;
+ clazz += "Previous";
+ }else if(i >= (firstDay + daysInMonth)){
+ number = i - firstDay - daysInMonth + 1;
+ adj = 1;
+ clazz += "Next";
+ }else{
+ number = i - firstDay + 1;
+ clazz += "Current";
+ }
+
+ if(adj){
+ date = dojo.date.add(date, "month", adj);
+ }
+ date.setDate(number);
+
+ if(!compareDate(date, today, "date")){
+ clazz = "dijitCalendarCurrentDate " + clazz;
+ }
+
+ if(!compareDate(date, selected, "date")
+ && !compareDate(date, selected, "month")
+ && !compareDate(date, selected, "year") ){
+ clazz = selectedCls + " " + clazz;
+ }
+
+ if(this.isDisabledDate(date, this.getLang())){
+ clazz = " dijitCalendarDisabledDate " + clazz;
+ }
+
+ var clazz2 = this.getClassForDate(date, this.getLang());
+ if(clazz2){
+ clazz = clazz2 + " " + clazz;
+ }
+
+ template.className = clazz + "Month dijitCalendarDateTemplate";
+ template.dijitDateValue = date.valueOf();
+ var label = dojo.query(".dijitCalendarDateLabel", template)[0];
+
+ this._setText(label, date.getDate());
+
+ label._date = label.parentNode._date = date.getDate();
+ }, this);
+
+ // Fill in localized month name
+ var monthNames = dojo.date.locale.getNames('months', 'wide', 'standAlone', this.getLang());
+ this._setText(this.monthLabelNode, monthNames[currentDate.getMonth()]);
+ this._setText(this.yearLabelNode, currentDate.getFullYear());
+ }
+});
+
+
+dojo.declare("dojox.widget._CalendarMonthYear", null, {
+ // summary:
+ // Mixin class for adding a view listing all 12
+ // months of the year to the dojox.widget._CalendarBase
+
+ constructor: function(){
+ // summary:
+ // Adds a dojox.widget._CalendarMonthView view to the calendar widget.
+ this._addView(dojox.widget._CalendarMonthYearView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarMonthYearView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary:
+ // A Calendar view listing the 12 months of the year
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarMonthYear.html", "<div class=\"dojoxCal-MY-labels\" style=\"left: 0px;\"\t\r\n\tdojoAttachPoint=\"myContainer\" dojoAttachEvent=\"onclick: onClick\">\r\n\t\t<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t\t<tr class=\"dojoxCal-MY-G-Template\">\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-M-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarMonthLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-M-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarMonthLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-Y-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarYearLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td class=\"dojoxCal-MY-Y-Template\">\r\n\t\t\t\t\t\t\t\t\t\t<div class=\"dojoxCalendarYearLabel\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t </tr>\r\n\t\t\t\t\t\t <tr class=\"dojoxCal-MY-btns\">\r\n\t\t\t\t\t\t \t <td class=\"dojoxCal-MY-btns\" colspan=\"4\">\r\n\t\t\t\t\t\t \t\t <span class=\"dijitReset dijitInline dijitButtonNode ok-btn\" dojoAttachEvent=\"onclick: onOk\" dojoAttachPoint=\"okBtn\">\r\n\t\t\t\t\t\t \t \t \t <button\tclass=\"dijitReset dijitStretch dijitButtonContents\">OK</button>\r\n\t\t\t\t\t\t\t\t </span>\r\n\t\t\t\t\t\t\t\t <span class=\"dijitReset dijitInline dijitButtonNode cancel-btn\" dojoAttachEvent=\"onclick: onCancel\" dojoAttachPoint=\"cancelBtn\">\r\n\t\t\t\t\t\t \t \t\t <button\tclass=\"dijitReset dijitStretch dijitButtonContents\">Cancel</button>\r\n\t\t\t\t\t\t\t\t </span>\r\n\t\t\t\t\t\t \t </td>\r\n\t\t\t\t\t\t </tr>\r\n\t\t\t\t</tbody>\r\n\t\t</table>\r\n</div>\r\n"),
+
+ // datePart: String
+ // Specifies how much to increment the displayed date when the user
+ // clicks the array button to increment of decrement the view.
+ datePart: "year",
+
+ // displayedYears: Number
+ // The number of years to display at once.
+ displayedYears: 10,
+
+ useHeader: false,
+
+ postCreate: function(){
+ this.cloneClass(".dojoxCal-MY-G-Template", 5, ".dojoxCal-MY-btns");
+ this.monthContainer = this.yearContainer = this.myContainer;
+
+ var yClass = "dojoxCalendarYearLabel";
+ var dClass = "dojoxCalendarDecrease";
+ var iClass = "dojoxCalendarIncrease";
+
+ dojo.query("." + yClass, this.myContainer).forEach(function(node, idx){
+ var clazz = iClass;
+ switch(idx){
+ case 0:
+ clazz = dClass;
+ case 1:
+ dojo.removeClass(node, yClass);
+ dojo.addClass(node, clazz);
+ break;
+ }
+ });
+ // Get the year increment and decrement buttons.
+ this._decBtn = dojo.query('.' + dClass, this.myContainer)[0];
+ this._incBtn = dojo.query('.' + iClass, this.myContainer)[0];
+
+ dojo.query(".dojoxCal-MY-M-Template", this.domNode)
+ .filter(function(item){
+ return item.cellIndex == 1;
+ })
+ .addClass("dojoxCal-MY-M-last");
+
+ dojo.connect(this, "onBeforeDisplay", dojo.hitch(this, function(){
+ this._cachedDate = new Date(this.get("value").getTime());
+ this._populateYears(this._cachedDate.getFullYear());
+ this._populateMonths();
+ this._updateSelectedMonth();
+ this._updateSelectedYear();
+ }));
+
+ dojo.connect(this, "_populateYears", dojo.hitch(this, function(){
+ this._updateSelectedYear();
+ }));
+ dojo.connect(this, "_populateMonths", dojo.hitch(this, function(){
+ this._updateSelectedMonth();
+ }));
+
+ this._cachedDate = this.get("value");
+
+ this._populateYears();
+ this._populateMonths();
+
+ // Add visual effects to the view, if any have been mixed in
+ this.addFx(".dojoxCalendarMonthLabel,.dojoxCalendarYearLabel ", this.myContainer);
+ },
+
+ _setValueAttr: function(value){
+ if (value && value.getFullYear()) {
+ this._populateYears(value.getFullYear());
+ }
+ },
+
+ getHeader: function(){
+ return null;
+ },
+
+ _getMonthNames: function(format){
+ // summary:
+ // Returns localized month names
+ this._monthNames = this._monthNames || dojo.date.locale.getNames('months', format, 'standAlone', this.getLang());
+ return this._monthNames;
+ },
+
+ _populateMonths: function(){
+ // summary:
+ // Populate the month names using the localized values.
+ var monthNames = this._getMonthNames('abbr');
+ dojo.query(".dojoxCalendarMonthLabel", this.monthContainer).forEach(dojo.hitch(this, function(node, cnt){
+ this._setText(node, monthNames[cnt]);
+ }));
+ var constraints = this.get('constraints');
+
+ if(constraints){
+ var date = new Date();
+ date.setFullYear(this._year);
+ var min = -1, max = 12;
+ if(constraints.min){
+ var minY = constraints.min.getFullYear();
+ if(minY > this._year){
+ min = 12;
+ }else if(minY == this._year){
+ min = constraints.min.getMonth();
+ }
+ }
+ if(constraints.max){
+ var maxY = constraints.max.getFullYear();
+ if(maxY < this._year){
+ max = -1;
+ }else if(maxY == this._year){
+ max = constraints.max.getMonth();
+ }
+ }
+
+ dojo.query(".dojoxCalendarMonthLabel", this.monthContainer)
+ .forEach(dojo.hitch(this, function(node, cnt){
+ dojo[(cnt < min || cnt > max) ? "addClass" : "removeClass"]
+ (node, 'dijitCalendarDisabledDate');
+ }));
+ }
+
+ var h = this.getHeader();
+ if(h){
+ this._setText(this.getHeader(), this.get("value").getFullYear());
+ }
+ },
+
+ _populateYears: function(year){
+ // summary:
+ // Fills the list of years with a range of 12 numbers, with the current year
+ // being the 6th number.
+ var constraints = this.get('constraints');
+ var dispYear = year || this.get("value").getFullYear();
+ var firstYear = dispYear - Math.floor(this.displayedYears/2);
+ var min = constraints && constraints.min ? constraints.min.getFullYear() : firstYear -10000;
+ firstYear = Math.max(min, firstYear);
+
+ // summary: Writes the years to display to the view
+ this._displayedYear = dispYear;
+
+ var yearLabels = dojo.query(".dojoxCalendarYearLabel", this.yearContainer);
+
+ var max = constraints && constraints.max ? constraints.max.getFullYear() - firstYear : yearLabels.length;
+ var disabledClass = 'dijitCalendarDisabledDate';
+
+ yearLabels.forEach(dojo.hitch(this, function(node, cnt){
+ if(cnt <= max){
+ this._setText(node, firstYear + cnt);
+ dojo.removeClass(node, disabledClass);
+ }else{
+ dojo.addClass(node, disabledClass);
+ }
+ }));
+
+ if(this._incBtn){
+ dojo[max < yearLabels.length ? "addClass" : "removeClass"](this._incBtn, disabledClass);
+ }
+ if(this._decBtn){
+ dojo[min >= firstYear ? "addClass" : "removeClass"](this._decBtn, disabledClass);
+ }
+
+ var h = this.getHeader();
+ if(h){
+ this._setText(this.getHeader(), firstYear + " - " + (firstYear + 11));
+ }
+ },
+
+ _updateSelectedYear: function(){
+ this._year = String((this._cachedDate || this.get("value")).getFullYear());
+ this._updateSelectedNode(".dojoxCalendarYearLabel", dojo.hitch(this, function(node, idx){
+ return this._year !== null && node.innerHTML == this._year;
+ }));
+ },
+
+ _updateSelectedMonth: function(){
+ var month = (this._cachedDate || this.get("value")).getMonth();
+ this._month = month;
+ this._updateSelectedNode(".dojoxCalendarMonthLabel", function(node, idx){
+ return idx == month;
+ });
+ },
+
+ _updateSelectedNode: function(query, filter){
+ var sel = "dijitCalendarSelectedDate";
+ dojo.query(query, this.domNode)
+ .forEach(function(node, idx, array){
+ dojo[filter(node, idx, array) ? "addClass" : "removeClass"](node.parentNode, sel);
+ });
+ var selMonth = dojo.query('.dojoxCal-MY-M-Template div', this.myContainer)
+ .filter(function(node){
+ return dojo.hasClass(node.parentNode, sel);
+ })[0];
+ if(!selMonth){return;}
+ var disabled = dojo.hasClass(selMonth, 'dijitCalendarDisabledDate');
+
+ dojo[disabled ? 'addClass' : 'removeClass'](this.okBtn, "dijitDisabled");
+ },
+
+ onClick: function(evt){
+ // summary:
+ // Handles clicks on month names
+ var clazz;
+ var _this = this;
+ var sel = "dijitCalendarSelectedDate";
+ function hc(c){
+ return dojo.hasClass(evt.target, c);
+ }
+
+ if(hc('dijitCalendarDisabledDate')){
+ dojo.stopEvent(evt);
+ return false;
+ }
+
+ if(hc("dojoxCalendarMonthLabel")){
+ clazz = "dojoxCal-MY-M-Template";
+ this._month = evt.target.parentNode.cellIndex + (evt.target.parentNode.parentNode.rowIndex * 2);
+ this._cachedDate.setMonth(this._month);
+ this._updateSelectedMonth();
+ }else if(hc( "dojoxCalendarYearLabel")){
+ clazz = "dojoxCal-MY-Y-Template";
+ this._year = Number(evt.target.innerHTML);
+ this._cachedDate.setYear(this._year);
+ this._populateMonths();
+ this._updateSelectedYear();
+ }else if(hc("dojoxCalendarDecrease")){
+ this._populateYears(this._displayedYear - 10);
+ return true;
+ }else if(hc("dojoxCalendarIncrease")){
+ this._populateYears(this._displayedYear + 10);
+ return true;
+ }else{
+ return true;
+ }
+ dojo.stopEvent(evt);
+ return false;
+ },
+
+ onOk: function(evt){
+ dojo.stopEvent(evt);
+ if(dojo.hasClass(this.okBtn, "dijitDisabled")){
+ return false;
+ }
+ this.onValueSelected(this._cachedDate);
+ return false;
+ },
+
+ onCancel: function(evt){
+ dojo.stopEvent(evt);
+ this.onValueSelected(this.get("value"));
+ return false;
+ }
+});
+
+dojo.declare("dojox.widget.Calendar2Pane",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay,
+ dojox.widget._CalendarMonthYear], {
+ // summary: A Calendar withtwo panes, the second one
+ // containing both month and year
+ }
+);
+
+dojo.declare("dojox.widget.Calendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay,
+ dojox.widget._CalendarMonthYear], {
+ // summary: The standard Calendar. It includes day and month/year views.
+ // No visual effects are included.
+ }
+);
+
+dojo.declare("dojox.widget.DailyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay], {
+ // summary: A calendar withonly a daily view.
+ _makeDate: function(value){
+ var now = new Date();
+ now.setDate(value);
+ return now;
+ }
+ }
+
+);
+
+dojo.declare("dojox.widget.MonthAndYearlyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarMonthYear], {
+ // summary: A calendar withonly a daily view.
+ }
+);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Calendar/Calendar.css b/js/dojo-1.6/dojox/widget/Calendar/Calendar.css new file mode 100644 index 0000000..5a49e02 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar/Calendar.css @@ -0,0 +1,303 @@ +.dojoxCalendar { + width: 182px; +} +.dojoxCalendarContainer { + cursor: default; + font-family: tahoma, verdana, helvetica; + font-size: 11px; + padding: 0px; + text-align: center; + width: 180px; + overflow: hidden; +} + +.dojoxCalendarBody { + height: 138px; + overflow: hidden; + position: relative; + margin: auto; + width: 180px; +} +.dojoxCalendar .no-header .dojoxCalendarBody { + height: 162px; +} + +.dojoxCalendar .dijitCalendarDayLabels, .dojoxCalendarMonthLabels, .dojoxCalendarYearLabels, .dojoxCal-MY-labels { + width: 180px; + height: 138px; + top: 0px; + position: absolute; + left: 0px; + margin: auto; + text-align: center; +} + +.dojoxCalendar .dojoxCalendarBody > div { + width: 180px; +} + +.dojoxCalendar .dijitCalendarDateTemplate { + padding: 0 1px 0 0 !important; +} + +.nihilo .dojoxCalendar .dijitCalendarDateTemplate, +.soria .dojoxCalendar .dijitCalendarDateTemplate { + border: 0px none !important; +} + +.soria tr.dojoxCal-MY-btns { + background: url(../../../dijit/themes/soria/images/tabBottomHoverC.gif) repeat-x scroll 0px -21px; +} + +.dojoxCalendar .noPointer, .dojoxCalendar .noPointer * { + cursor: auto; +} + +.dojoxCalendarContainer table { + font-size: 11px; + border-bottom: 4px solid white; +} + +.dojoxCalendarHeader { + height: 20px; + width: 172px; + padding: 4px 4px 0; +} +.dojoxCalendar .no-header .dojoxCalendarHeader { + display: none; +} + +.soria .dojoxCalendarHeader { + background: #BED7F0 url(../../../dijit/themes/soria/images/titleBar.png) repeat-x scroll center top; +} + + +.dojoxCalendarDecrease, .dojoxCalendarIncrease { + height: 15px; + width: 15px; + cursor: pointer; +} + +.dojoxCalendarDecrease { + background: transparent url(../../../dijit/themes/nihilo/images/spriteRoundedIconsSmall.png) no-repeat scroll left top; + float: left; +} + +.dojoxCalendarIncrease { + background: transparent url(../../../dijit/themes/nihilo/images/spriteRoundedIconsSmall.png) no-repeat scroll -30px top; + float: right; +} + + +.dojoxCalendarMonthLabel { + cursor: pointer; + height: 35px; + width: 41px; + overflow: hidden; + text-align: center; + padding-top: 10px; +} + +.dojoxCalendarYearLabel { + cursor: pointer; + height: 35px; + width: 41px; + overflow: hidden; + text-align: center; + padding-top: 10px; +} + +.dojoxCalendarTitle { + cursor: pointer; + font-weight: bold; +} + +.dojoxCalendar .navToPanel .dojoxCalendarDayYearLabel, +.dojoxCalendar .navToPanel .dojoxCalendarYearHeader, +.dojoxCalendar .navToPanel .dojoxCalendarMonthHeader { + padding-right: 15px; + background: url(../../../dijit/themes/tundra/images/comboArrowDown.gif) right no-repeat; +} + +.dojoxCalendar .dijitCalendarDateLabel { + height: 17px; + width: 17px; + padding: 1px 3px 0px 3px; + text-align: center; + border: 1px solid white; +} + +.dojoxCalendar .dijitCalendarDayLabel { + cursor: pointer; + height: 17px; + width: 18px; + padding: 0pt 2px; + text-align: center; +} + + +.dojoxCalendar .dojoxCalendarContainer { + background-color: white; + border: 1px solid #656565; + color: black; +} + +.dojoxCalendar .dijitCalendarDisabledDate { + text-decoration:line-through !important; + cursor:default !important; +} + +.dojoxCalendar .dojoxCalendarFooter { + border-top: 1px solid #F4F4F4; + height: 15px; + padding-top: 4px; + cursor: pointer; +} + +.soria .dojoxCalendar .dojoxCalendarFooter { + border-top: 0px none; + padding-top: 5px; + background: white url(../../../dijit/themes/soria/images/titleBar.png) repeat-x scroll center top +} + +.dojoxCalendar .dojoxCalendarMonthLabel { + border: 1px solid white; +} + +.dojoxCalendar .dojoxCalendarYearLabel { + border: 1px solid white; +} + +.dojoxCalendar .dijitCalendarNextMonth .dijitCalendarDateLabel, +.dojoxCalendar .dijitCalendarPreviousMonth .dijitCalendarDateLabel { + border: 0px; + color: #646464; + padding-left: 0px; + padding-right: 0px; +} + +.dojoxCalendar .dijitCalendarNextMonth, .dojoxCalendar .dijitCalendarPreviousMonth { + background-color: #E4E4E4; +} + +.dojoxCalendar .dijitCalendarNextMonth .dojoxCalendarYearLabel, +.dojoxCalendar .dijitCalendarPreviousMonth .dojoxCalendarYearLabel { + background-color: white; + border-color: white; + color: #646464; +} +.dojoxCalendar .dijitCalendarSelectedDate, +.tundra .dojoxCalendar .dijitCalendarSelectedDate, +.nihilo .dojoxCalendar .dijitCalendarSelectedDate { + /* cell for the selected date */ + background-color:#ffe284 !important; + color:black !important; + border:#f5b93c solid 1px !important; +} + + +.soria .dojoxCalendar td.dijitCalendarSelectedDate { + background-color: #B9CBF1 !important; + color: black !important; + border: 1px solid #4B5AAA !important; +} + +.soria .dojoxCalendar .dijitCalendarSelectedDate div { + /* cell for the selected date */ + background-color: #B9CBF1 !important; + border: none !important; +} +.dojoxCalendar .dijitCalendarSelectedDate div { + /* cell for the selected date */ + background-color: #FFE284 !important; + border: none !important; +} +div.dojoxCalendar tr.dojoxCal-MY-G-Template td.dijitCalendarSelectedDate { + background-color: transparent; + width: 43px; +} + +.dojoxCalendar tr.dojoxCal-MY-G-Template td { + width: 45px; +} + +.dojoxCalendar .dijitCalendarSelectedDate div.dijitCalendarDateLabel { + padding: 1px 1px 0px 3px; +} + +.dojoxCalendar .monthOnly .dijitCalendarDayLabels, +.dojoxCalendar .yearOnly .dijitCalendarDayLabels, +.dojoxCalendar .monthOnly .dojoxCalendarComma, +.dojoxCalendar .yearOnly .dojoxCalendarComma, +.dojoxCalendar .monthOnly .dojoxCalendarFooter, +.dojoxCalendar .yearOnly .dojoxCalendarFooter, +.dojoxCalendar .monthOnly .dojoxCalendarYearHeader, +.dojoxCalendar .monthOnly .dojoxCalendarIncrease, +.dojoxCalendar .monthOnly .dojoxCalendarDecrease, +.dojoxCalendar .yearOnly .dojoxCalendarMonthLabelNode { + display: none; +} + +.dojoxCal-MY-labels .dojoxCalendarMonthLabel, +.dojoxCal-MY-labels .dojoxCalendarYearLabel { + height: 13px; + padding-top: 4px; + padding-bottom: 3px; +} + +.dojoxCal-MY-labels td.dojoxCal-MY-btns { + padding-top: 2px; + border-top: 1px solid grey; + text-align: center; +} + +.dojoxCal-MY-labels { + background-color: white; +} + +.dojoxCal-MY-labels .dojoxCalendarIncrease, +.dojoxCal-MY-labels .dojoxCalendarDecrease { + float: none; + margin-left: 14px; +} + +.dojoxCal-MY-btns button { + font-size: 8pt; +} +.dojoxCalendar .dojoxCal-MY-btns .dijitDisabled button { + color: #999; +} +.dojoxCal-hidden { + visibility: hidden; +} +.dojoxCalendar .dojoxCal-MY-labels { + height: 164px; +} +.dojoxCalendar .dojoxCal-MY-labels .dijitCalendarSelectedDate div { + padding-top: 3px; + padding-bottom: 2px; +} +.soria .dojoxCal-MY-labels .dijitCalendarSelectedDate div { + padding-top: 4px; + padding-bottom: 3px; +} +.dojoxCal-MY-labels .dojoxCalendarMonthLabel { + width: 38px; +} +.dojoxCal-MY-labels .dojoxCal-MY-M-last { + border-right: 1px grey solid; +} +.soria .dojoxCal-MY-labels .dojoxCal-MY-M-last { + border-right: 1px #B9CBF1 solid; +} +.dojoxCal-MY-labels .dojoxCal-MY-M-last .dojoxCalendarMonthLabel, +.dojoxCal-MY-labels .dojoxCal-MY-G-Template div.dojoxCalendarYearLabel { + width: 42px; +} + +.dojoxCalendar .cancel-btn { + margin-left: 11px; +} +.dojoxCalendar .ok-btn { + margin-left: 15px; +} diff --git a/js/dojo-1.6/dojox/widget/Calendar/Calendar.html b/js/dojo-1.6/dojox/widget/Calendar/Calendar.html new file mode 100644 index 0000000..7aafc40 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar/Calendar.html @@ -0,0 +1,24 @@ +<div class="dojoxCalendar"> + <div tabindex="0" class="dojoxCalendarContainer" style="visibility: visible;" dojoAttachPoint="container"> + <div style="display:none"> + <div dojoAttachPoint="previousYearLabelNode"></div> + <div dojoAttachPoint="nextYearLabelNode"></div> + <div dojoAttachPoint="monthLabelSpacer"></div> + </div> + <div class="dojoxCalendarHeader"> + <div> + <div class="dojoxCalendarDecrease" dojoAttachPoint="decrementMonth"></div> + </div> + <div class=""> + <div class="dojoxCalendarIncrease" dojoAttachPoint="incrementMonth"></div> + </div> + <div class="dojoxCalendarTitle" dojoAttachPoint="header" dojoAttachEvent="onclick: onHeaderClick"> + </div> + </div> + <div class="dojoxCalendarBody" dojoAttachPoint="containerNode"></div> + <div class=""> + <div class="dojoxCalendarFooter" dojoAttachPoint="footer"> + </div> + </div> + </div> +</div> diff --git a/js/dojo-1.6/dojox/widget/Calendar/CalendarDay.html b/js/dojo-1.6/dojox/widget/Calendar/CalendarDay.html new file mode 100644 index 0000000..1180d6f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar/CalendarDay.html @@ -0,0 +1,23 @@ +<div class="dijitCalendarDayLabels" style="left: 0px;" dojoAttachPoint="dayContainer"> + <div dojoAttachPoint="header"> + <div dojoAttachPoint="monthAndYearHeader"> + <span dojoAttachPoint="monthLabelNode" class="dojoxCalendarMonthLabelNode"></span> + <span dojoAttachPoint="headerComma" class="dojoxCalendarComma">,</span> + <span dojoAttachPoint="yearLabelNode" class="dojoxCalendarDayYearLabel"></span> + </div> + </div> + <table cellspacing="0" cellpadding="0" border="0" style="margin: auto;"> + <thead> + <tr> + <td class="dijitCalendarDayLabelTemplate"><div class="dijitCalendarDayLabel"></div></td> + </tr> + </thead> + <tbody dojoAttachEvent="onclick: _onDayClick"> + <tr class="dijitCalendarWeekTemplate"> + <td class="dojoxCalendarNextMonth dijitCalendarDateTemplate"> + <div class="dijitCalendarDateLabel"></div> + </td> + </tr> + </tbody> + </table> +</div> diff --git a/js/dojo-1.6/dojox/widget/Calendar/CalendarMonth.html b/js/dojo-1.6/dojox/widget/Calendar/CalendarMonth.html new file mode 100644 index 0000000..f0bc3e8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar/CalendarMonth.html @@ -0,0 +1,12 @@ +<div class="dojoxCalendarMonthLabels" style="left: 0px;" + dojoAttachPoint="monthContainer" dojoAttachEvent="onclick: onClick"> + <table cellspacing="0" cellpadding="0" border="0" style="margin: auto;"> + <tbody> + <tr class="dojoxCalendarMonthGroupTemplate"> + <td class="dojoxCalendarMonthTemplate"> + <div class="dojoxCalendarMonthLabel"></div> + </td> + </tr> + </tbody> + </table> +</div> diff --git a/js/dojo-1.6/dojox/widget/Calendar/CalendarMonthYear.html b/js/dojo-1.6/dojox/widget/Calendar/CalendarMonthYear.html new file mode 100644 index 0000000..f87a09d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar/CalendarMonthYear.html @@ -0,0 +1,31 @@ +<div class="dojoxCal-MY-labels" style="left: 0px;" + dojoAttachPoint="myContainer" dojoAttachEvent="onclick: onClick"> + <table cellspacing="0" cellpadding="0" border="0" style="margin: auto;"> + <tbody> + <tr class="dojoxCal-MY-G-Template"> + <td class="dojoxCal-MY-M-Template"> + <div class="dojoxCalendarMonthLabel"></div> + </td> + <td class="dojoxCal-MY-M-Template"> + <div class="dojoxCalendarMonthLabel"></div> + </td> + <td class="dojoxCal-MY-Y-Template"> + <div class="dojoxCalendarYearLabel"></div> + </td> + <td class="dojoxCal-MY-Y-Template"> + <div class="dojoxCalendarYearLabel"></div> + </td> + </tr> + <tr class="dojoxCal-MY-btns"> + <td class="dojoxCal-MY-btns" colspan="4"> + <span class="dijitReset dijitInline dijitButtonNode ok-btn" dojoAttachEvent="onclick: onOk" dojoAttachPoint="okBtn"> + <button class="dijitReset dijitStretch dijitButtonContents">OK</button> + </span> + <span class="dijitReset dijitInline dijitButtonNode cancel-btn" dojoAttachEvent="onclick: onCancel" dojoAttachPoint="cancelBtn"> + <button class="dijitReset dijitStretch dijitButtonContents">Cancel</button> + </span> + </td> + </tr> + </tbody> + </table> +</div> diff --git a/js/dojo-1.6/dojox/widget/Calendar/CalendarYear.html b/js/dojo-1.6/dojox/widget/Calendar/CalendarYear.html new file mode 100644 index 0000000..08ca429 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Calendar/CalendarYear.html @@ -0,0 +1,12 @@ +<div class="dojoxCalendarYearLabels" style="left: 0px;" dojoAttachPoint="yearContainer"> + <table cellspacing="0" cellpadding="0" border="0" style="margin: auto;" dojoAttachEvent="onclick: onClick"> + <tbody> + <tr class="dojoxCalendarYearGroupTemplate"> + <td class="dojoxCalendarNextMonth dojoxCalendarYearTemplate"> + <div class="dojoxCalendarYearLabel"> + </div> + </td> + </tr> + </tbody> + </table> +</div> diff --git a/js/dojo-1.6/dojox/widget/CalendarFx.js b/js/dojo-1.6/dojox/widget/CalendarFx.js new file mode 100644 index 0000000..7d61f1e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/CalendarFx.js @@ -0,0 +1,37 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.CalendarFx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.CalendarFx"] = true;
+dojo.provide("dojox.widget.CalendarFx");
+dojo.require("dojox.widget.FisheyeLite");
+
+dojo.declare("dojox.widget._FisheyeFX",null, {
+ // summary
+ // A mixin to add a FisheyeLite effect to the calendar
+ addFx: function(query, fromNode) {
+ //Use the query and base node passed from the calendar view mixin
+ //to select the nodes to attach the event to.
+ dojo.query(query, fromNode).forEach(function(node){
+ new dojox.widget.FisheyeLite({
+ properties: {
+ fontSize: 1.1
+ }
+ }, node);
+ });
+ }
+});
+
+dojo.declare("dojox.widget.CalendarFisheye",
+ [dojox.widget.Calendar,
+ dojox.widget._FisheyeFX], {
+ // summary: The standard Calendar. It includes day, month and year views.
+ // FisheyeLite effects are included.
+ }
+);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/CalendarFx.xd.js b/js/dojo-1.6/dojox/widget/CalendarFx.xd.js new file mode 100644 index 0000000..75e24ea --- /dev/null +++ b/js/dojo-1.6/dojox/widget/CalendarFx.xd.js @@ -0,0 +1,42 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.CalendarFx"],
+["require", "dojox.widget.FisheyeLite"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.CalendarFx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.CalendarFx"] = true;
+dojo.provide("dojox.widget.CalendarFx");
+dojo.require("dojox.widget.FisheyeLite");
+
+dojo.declare("dojox.widget._FisheyeFX",null, {
+ // summary
+ // A mixin to add a FisheyeLite effect to the calendar
+ addFx: function(query, fromNode) {
+ //Use the query and base node passed from the calendar view mixin
+ //to select the nodes to attach the event to.
+ dojo.query(query, fromNode).forEach(function(node){
+ new dojox.widget.FisheyeLite({
+ properties: {
+ fontSize: 1.1
+ }
+ }, node);
+ });
+ }
+});
+
+dojo.declare("dojox.widget.CalendarFisheye",
+ [dojox.widget.Calendar,
+ dojox.widget._FisheyeFX], {
+ // summary: The standard Calendar. It includes day, month and year views.
+ // FisheyeLite effects are included.
+ }
+);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/CalendarViews.js b/js/dojo-1.6/dojox/widget/CalendarViews.js new file mode 100644 index 0000000..6007267 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/CalendarViews.js @@ -0,0 +1,160 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.CalendarViews"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.CalendarViews"] = true;
+dojo.provide("dojox.widget.CalendarViews");
+dojo.experimental("dojox.widget.CalendarViews");
+
+dojo.require("dojox.widget.Calendar");
+
+
+dojo.declare("dojox.widget._CalendarMonth", null, {
+ // summary: Mixin class for adding a view listing all 12 months of the year to the
+ // dojox.widget._CalendarBase
+
+
+ constructor: function(){
+ // summary: Adds a dojox.widget._CalendarMonthView view to the calendar widget.
+ this._addView(dojox.widget._CalendarMonthView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarMonthView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary: A Calendar view listing the 12 months of the year
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarMonth.html", "<div class=\"dojoxCalendarMonthLabels\" style=\"left: 0px;\" \r\n\tdojoAttachPoint=\"monthContainer\" dojoAttachEvent=\"onclick: onClick\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\r\n <tbody>\r\n <tr class=\"dojoxCalendarMonthGroupTemplate\">\r\n <td class=\"dojoxCalendarMonthTemplate\">\r\n <div class=\"dojoxCalendarMonthLabel\"></div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n"),
+
+ // datePart: String
+ // Specifies how much to increment the displayed date when the user
+ // clicks the array button to increment of decrement the view.
+ datePart: "year",
+
+ // headerClass: String
+ // Specifies the CSS class to apply to the header node for this view.
+ headerClass: "dojoxCalendarMonthHeader",
+
+ postCreate: function(){
+ // summary: Constructs the view
+ this.cloneClass(".dojoxCalendarMonthTemplate", 3);
+ this.cloneClass(".dojoxCalendarMonthGroupTemplate", 2);
+ this._populateMonths();
+
+ // Add visual effects to the view, if any have been mixed in
+ this.addFx(".dojoxCalendarMonthLabel", this.domNode);
+ },
+
+ _setValueAttr: function(value){
+ this.header.innerHTML = value.getFullYear();
+ },
+
+ _getMonthNames: dojox.widget._CalendarMonthYearView.prototype._getMonthNames,
+
+ _populateMonths: dojox.widget._CalendarMonthYearView.prototype._populateMonths,
+
+ onClick: function(evt){
+ // summary: Handles clicks on month names
+ if(!dojo.hasClass(evt.target, "dojoxCalendarMonthLabel")){dojo.stopEvent(evt); return;}
+ var parentNode = evt.target.parentNode;
+ var month = parentNode.cellIndex + (parentNode.parentNode.rowIndex * 4);
+ var date = this.get("value");
+
+ // Seeing a really strange bug in FF3.6 where this has to be called twice
+ // in order to take affect
+ date.setMonth(month);
+ date.setMonth(month);
+ this.onValueSelected(date, month);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarYear", null, {
+ // summary: Mixin class for adding a view listing 12 years to the
+ // dojox.widget._CalendarBase
+ parent: null,
+
+ constructor: function(){
+ // summary: Adds a dojox.widget._CalendarYearView view to the
+ // dojo.widget._CalendarBase widget.
+ this._addView(dojox.widget._CalendarYearView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarYearView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary: A Calendar view listing 12 years
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarYear.html", "<div class=\"dojoxCalendarYearLabels\" style=\"left: 0px;\" dojoAttachPoint=\"yearContainer\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\" dojoAttachEvent=\"onclick: onClick\">\r\n <tbody>\r\n <tr class=\"dojoxCalendarYearGroupTemplate\">\r\n <td class=\"dojoxCalendarNextMonth dojoxCalendarYearTemplate\">\r\n <div class=\"dojoxCalendarYearLabel\">\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n"),
+
+ displayedYears: 6,
+
+ postCreate: function(){
+ // summary: Constructs the view
+ this.cloneClass(".dojoxCalendarYearTemplate", 3);
+ this.cloneClass(".dojoxCalendarYearGroupTemplate", 2);
+ this._populateYears();
+ this.addFx(".dojoxCalendarYearLabel", this.domNode);
+ },
+
+ _setValueAttr: function(value){
+ this._populateYears(value.getFullYear());
+ },
+
+ _populateYears: dojox.widget._CalendarMonthYearView.prototype._populateYears,
+
+ adjustDate: function(date, amount){
+ // summary: Adjusts the value of a date. It moves it by 12 years each time.
+ return dojo.date.add(date, "year", amount * 12);
+ },
+
+ onClick: function(evt){
+ // summary: Handles clicks on year values.
+ if(!dojo.hasClass(evt.target, "dojoxCalendarYearLabel")){dojo.stopEvent(evt); return;}
+ var year = Number(evt.target.innerHTML);
+ var date = this.get("value");
+ date.setYear(year);
+ this.onValueSelected(date, year);
+ }
+});
+
+
+dojo.declare("dojox.widget.Calendar3Pane",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay,
+ dojox.widget._CalendarMonth,
+ dojox.widget._CalendarYear], {
+ // summary: The Calendar includes day, month and year views.
+ // No visual effects are included.
+ }
+);
+
+dojo.declare("dojox.widget.MonthlyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarMonth], {
+ // summary: A calendar with only a month view.
+ _makeDate: function(value){
+ var now = new Date();
+ now.setMonth(value);
+ return now;
+ }
+ }
+);
+dojo.declare("dojox.widget.YearlyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarYear], {
+ // summary: A calendar with only a year view.
+ _makeDate: function(value){
+ var now = new Date();
+ now.setFullYear(value);
+ return now;
+ }
+ }
+);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/CalendarViews.xd.js b/js/dojo-1.6/dojox/widget/CalendarViews.xd.js new file mode 100644 index 0000000..0408ce0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/CalendarViews.xd.js @@ -0,0 +1,165 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.CalendarViews"],
+["require", "dojox.widget.Calendar"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.CalendarViews"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.CalendarViews"] = true;
+dojo.provide("dojox.widget.CalendarViews");
+dojo.experimental("dojox.widget.CalendarViews");
+
+dojo.require("dojox.widget.Calendar");
+
+
+dojo.declare("dojox.widget._CalendarMonth", null, {
+ // summary: Mixin class for adding a view listing all 12 months of the year to the
+ // dojox.widget._CalendarBase
+
+
+ constructor: function(){
+ // summary: Adds a dojox.widget._CalendarMonthView view to the calendar widget.
+ this._addView(dojox.widget._CalendarMonthView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarMonthView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary: A Calendar view listing the 12 months of the year
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarMonth.html", "<div class=\"dojoxCalendarMonthLabels\" style=\"left: 0px;\" \r\n\tdojoAttachPoint=\"monthContainer\" dojoAttachEvent=\"onclick: onClick\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\">\r\n <tbody>\r\n <tr class=\"dojoxCalendarMonthGroupTemplate\">\r\n <td class=\"dojoxCalendarMonthTemplate\">\r\n <div class=\"dojoxCalendarMonthLabel\"></div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n"),
+
+ // datePart: String
+ // Specifies how much to increment the displayed date when the user
+ // clicks the array button to increment of decrement the view.
+ datePart: "year",
+
+ // headerClass: String
+ // Specifies the CSS class to apply to the header node for this view.
+ headerClass: "dojoxCalendarMonthHeader",
+
+ postCreate: function(){
+ // summary: Constructs the view
+ this.cloneClass(".dojoxCalendarMonthTemplate", 3);
+ this.cloneClass(".dojoxCalendarMonthGroupTemplate", 2);
+ this._populateMonths();
+
+ // Add visual effects to the view, if any have been mixed in
+ this.addFx(".dojoxCalendarMonthLabel", this.domNode);
+ },
+
+ _setValueAttr: function(value){
+ this.header.innerHTML = value.getFullYear();
+ },
+
+ _getMonthNames: dojox.widget._CalendarMonthYearView.prototype._getMonthNames,
+
+ _populateMonths: dojox.widget._CalendarMonthYearView.prototype._populateMonths,
+
+ onClick: function(evt){
+ // summary: Handles clicks on month names
+ if(!dojo.hasClass(evt.target, "dojoxCalendarMonthLabel")){dojo.stopEvent(evt); return;}
+ var parentNode = evt.target.parentNode;
+ var month = parentNode.cellIndex + (parentNode.parentNode.rowIndex * 4);
+ var date = this.get("value");
+
+ // Seeing a really strange bug in FF3.6 where this has to be called twice
+ // in order to take affect
+ date.setMonth(month);
+ date.setMonth(month);
+ this.onValueSelected(date, month);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarYear", null, {
+ // summary: Mixin class for adding a view listing 12 years to the
+ // dojox.widget._CalendarBase
+ parent: null,
+
+ constructor: function(){
+ // summary: Adds a dojox.widget._CalendarYearView view to the
+ // dojo.widget._CalendarBase widget.
+ this._addView(dojox.widget._CalendarYearView);
+ }
+});
+
+dojo.declare("dojox.widget._CalendarYearView", [dojox.widget._CalendarView, dijit._Templated], {
+ // summary: A Calendar view listing 12 years
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "Calendar/CalendarYear.html", "<div class=\"dojoxCalendarYearLabels\" style=\"left: 0px;\" dojoAttachPoint=\"yearContainer\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin: auto;\" dojoAttachEvent=\"onclick: onClick\">\r\n <tbody>\r\n <tr class=\"dojoxCalendarYearGroupTemplate\">\r\n <td class=\"dojoxCalendarNextMonth dojoxCalendarYearTemplate\">\r\n <div class=\"dojoxCalendarYearLabel\">\r\n </div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n"),
+
+ displayedYears: 6,
+
+ postCreate: function(){
+ // summary: Constructs the view
+ this.cloneClass(".dojoxCalendarYearTemplate", 3);
+ this.cloneClass(".dojoxCalendarYearGroupTemplate", 2);
+ this._populateYears();
+ this.addFx(".dojoxCalendarYearLabel", this.domNode);
+ },
+
+ _setValueAttr: function(value){
+ this._populateYears(value.getFullYear());
+ },
+
+ _populateYears: dojox.widget._CalendarMonthYearView.prototype._populateYears,
+
+ adjustDate: function(date, amount){
+ // summary: Adjusts the value of a date. It moves it by 12 years each time.
+ return dojo.date.add(date, "year", amount * 12);
+ },
+
+ onClick: function(evt){
+ // summary: Handles clicks on year values.
+ if(!dojo.hasClass(evt.target, "dojoxCalendarYearLabel")){dojo.stopEvent(evt); return;}
+ var year = Number(evt.target.innerHTML);
+ var date = this.get("value");
+ date.setYear(year);
+ this.onValueSelected(date, year);
+ }
+});
+
+
+dojo.declare("dojox.widget.Calendar3Pane",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarDay,
+ dojox.widget._CalendarMonth,
+ dojox.widget._CalendarYear], {
+ // summary: The Calendar includes day, month and year views.
+ // No visual effects are included.
+ }
+);
+
+dojo.declare("dojox.widget.MonthlyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarMonth], {
+ // summary: A calendar with only a month view.
+ _makeDate: function(value){
+ var now = new Date();
+ now.setMonth(value);
+ return now;
+ }
+ }
+);
+dojo.declare("dojox.widget.YearlyCalendar",
+ [dojox.widget._CalendarBase,
+ dojox.widget._CalendarYear], {
+ // summary: A calendar with only a year view.
+ _makeDate: function(value){
+ var now = new Date();
+ now.setFullYear(value);
+ return now;
+ }
+ }
+);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/ColorPicker.js b/js/dojo-1.6/dojox/widget/ColorPicker.js new file mode 100644 index 0000000..bf6532d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker.js @@ -0,0 +1,582 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.ColorPicker"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.ColorPicker"] = true;
+dojo.provide("dojox.widget.ColorPicker");
+dojo.experimental("dojox.widget.ColorPicker"); // level: beta //TODO: which?
+
+dojo.requireLocalization("dojox.widget","ColorPicker", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
+dojo.requireLocalization("dojo.cldr","number", null, "ROOT,ar,ca,cs,da,de,el,en,en-au,en-gb,es,fi,fr,fr-ch,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-hant,zh-hk");
+
+dojo.require("dijit.form._FormWidget");
+dojo.require("dojo.dnd.move");
+dojo.require("dojo.fx");
+dojo.require("dojox.color");
+dojo.require("dojo.i18n");
+
+(function(d){
+
+ var webSafeFromHex = function(hex){
+ // stub, this is planned later:
+ return hex;
+ };
+
+ dojo.declare("dojox.widget.ColorPicker",
+ dijit.form._FormWidget,
+ {
+ // summary: a HSV color picker - similar to Photoshop picker
+ //
+ // description:
+ // Provides an interactive HSV ColorPicker similar to
+ // PhotoShop's color selction tool. This is an enhanced
+ // version of the default dijit.ColorPalette, though provides
+ // no accessibility.
+ //
+ // example:
+ // | var picker = new dojox.widget.ColorPicker({
+ // | // a couple of example toggles:
+ // | animatePoint:false,
+ // | showHsv: false,
+ // | webSafe: false,
+ // | showRgb: false
+ // | });
+ //
+ // example:
+ // | <!-- markup: -->
+ // | <div dojoType="dojox.widget.ColorPicker"></div>
+ //
+ // showRgb: Boolean
+ // show/update RGB input nodes
+ showRgb: true,
+
+ // showHsv: Boolean
+ // show/update HSV input nodes
+ showHsv: true,
+
+ // showHex: Boolean
+ // show/update Hex value field
+ showHex: true,
+
+ // webSafe: Boolean
+ // deprecated? or just use a toggle to show/hide that node, too?
+ webSafe: true,
+
+ // animatePoint: Boolean
+ // toggle to use slideTo (true) or just place the cursor (false) on click
+ animatePoint: true,
+
+ // slideDuration: Integer
+ // time in ms picker node will slide to next location (non-dragging) when animatePoint=true
+ slideDuration: 250,
+
+ // liveUpdate: Boolean
+ // Set to true to fire onChange in an indeterminate way
+ liveUpdate: false,
+
+ // PICKER_HUE_H: int
+ // Height of the hue picker, used to calculate positions
+ PICKER_HUE_H: 150,
+
+ // PICKER_SAT_VAL_H: int
+ // Height of the 2d picker, used to calculate positions
+ PICKER_SAT_VAL_H: 150,
+
+ // PICKER_SAT_VAL_W: int
+ // Width of the 2d picker, used to calculate positions
+ PICKER_SAT_VAL_W: 150,
+
+ // PICKER_HUE_SELECTOR_H: int
+ // Height of the hue selector DOM node, used to calc offsets so that selection
+ // is center of the image node.
+ PICKER_HUE_SELECTOR_H: 8,
+
+ // PICKER_SAT_SELECTOR_H: int
+ // Height of the saturation selector DOM node, used to calc offsets so that selection
+ // is center of the image node.
+ PICKER_SAT_SELECTOR_H: 10,
+
+ // PICKER_SAT_SELECTOR_W: int
+ // Width of the saturation selector DOM node, used to calc offsets so that selection
+ // is center of the image node.
+ PICKER_SAT_SELECTOR_W: 10,
+
+ // value: String
+ // Default color for this component. Only hex values are accepted as incoming/returned
+ // values. Adjust this value with `.attr`, eg: dijit.byId("myPicker").attr("value", "#ededed");
+ // to cause the points to adjust and the values to reflect the current color.
+ value: "#ffffff",
+
+ _underlay: d.moduleUrl("dojox.widget","ColorPicker/images/underlay.png"),
+
+ _hueUnderlay: d.moduleUrl("dojox.widget","ColorPicker/images/hue.png"),
+
+ _pickerPointer: d.moduleUrl("dojox.widget","ColorPicker/images/pickerPointer.png"),
+
+ _huePickerPointer: d.moduleUrl("dojox.widget","ColorPicker/images/hueHandle.png"),
+
+ _huePickerPointerAlly: d.moduleUrl("dojox.widget","ColorPicker/images/hueHandleA11y.png"),
+
+ // don't change to d.moduleUrl, build won't intern it.
+ templateString: dojo.cache("dojox.widget", "ColorPicker/ColorPicker.html", "<table class=\"dojoxColorPicker\" dojoAttachEvent=\"onkeypress: _handleKey\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t<tr>\r\n\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\r\n\t\t\t<div class=\"dojoxColorPickerBox\">\r\n\t\t\t\t<!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. -->\r\n\t\t\t\t<img role=\"status\" title=\"${saturationPickerTitle}\" alt=\"${saturationPickerTitle}\" class=\"dojoxColorPickerPoint\" src=\"${_pickerPointer}\" tabIndex=\"0\" dojoAttachPoint=\"cursorNode\" style=\"position: absolute; top: 0px; left: 0px;\">\r\n\t\t\t\t<img role=\"presentation\" alt=\"\" dojoAttachPoint=\"colorUnderlay\" dojoAttachEvent=\"onclick: _setPoint, onmousedown: _stopDrag\" class=\"dojoxColorPickerUnderlay\" src=\"${_underlay}\" ondragstart=\"return false\">\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\r\n\t\t\t<div class=\"dojoxHuePicker\">\r\n\t\t\t\t<!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. -->\r\n\t\t\t\t<img role=\"status\" dojoAttachPoint=\"hueCursorNode\" tabIndex=\"0\" class=\"dojoxHuePickerPoint\" title=\"${huePickerTitle}\" alt=\"${huePickerTitle}\" src=\"${_huePickerPointer}\" style=\"position: absolute; top: 0px; left: 0px;\">\r\n\t\t\t\t<div class=\"dojoxHuePickerUnderlay\" dojoAttachPoint=\"hueNode\">\r\n\t\t\t\t <img role=\"presentation\" alt=\"\" dojoAttachEvent=\"onclick: _setHuePoint, onmousedown: _stopDrag\" src=\"${_hueUnderlay}\">\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t\t<td valign=\"top\">\r\n\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td valign=\"top\" class=\"dojoxColorPickerPreviewContainer\">\r\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\r\n\t\t\t\t\t\t\t\t\t<div dojoAttachPoint=\"previewNode\" class=\"dojoxColorPickerPreview\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td valign=\"top\">\r\n\t\t\t\t\t\t\t\t\t<div dojoAttachPoint=\"safePreviewNode\" class=\"dojoxColorPickerWebSafePreview\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td valign=\"bottom\">\r\n\t\t\t\t\t\t<table class=\"dojoxColorPickerOptional\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t<div class=\"dijitInline dojoxColorPickerRgb\" dojoAttachPoint=\"rgbNode\">\r\n\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"1\" cellspacing=\"1\">\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_r\">${redLabel}</label></td><td><input id=\"${_uId}_r\" dojoAttachPoint=\"Rval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_g\">${greenLabel}</label></td><td><input id=\"${_uId}_g\" dojoAttachPoint=\"Gval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_b\">${blueLabel}</label></td><td><input id=\"${_uId}_b\" dojoAttachPoint=\"Bval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\r\n\t\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t<div class=\"dijitInline dojoxColorPickerHsv\" dojoAttachPoint=\"hsvNode\">\r\n\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"1\" cellspacing=\"1\">\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_h\">${hueLabel}</label></td><td><input id=\"${_uId}_h\" dojoAttachPoint=\"Hval\"size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${degLabel}</td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_s\">${saturationLabel}</label></td><td><input id=\"${_uId}_s\" dojoAttachPoint=\"Sval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${percentSign}</td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_v\">${valueLabel}</label></td><td><input id=\"${_uId}_v\" dojoAttachPoint=\"Vval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${percentSign}</td></tr>\r\n\t\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td colspan=\"2\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"dojoxColorPickerHex\" dojoAttachPoint=\"hexNode\" aria-live=\"polite\">\t\r\n\t\t\t\t\t\t\t\t\t\t<label for=\"${_uId}_hex\"> ${hexLabel} </label><input id=\"${_uId}_hex\" dojoAttachPoint=\"hexCode, focusNode, valueNode\" size=\"6\" class=\"dojoxColorPickerHexCode\" dojoAttachEvent=\"onchange: _colorInputChange\">\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n"),
+
+ postMixInProperties: function(){
+ if(dojo.hasClass(dojo.body(), "dijit_a11y")){
+ // Use the pointer that will show up in high contrast.
+ this._huePickerPointer = this._huePickerPointerAlly;
+ }
+ this._uId = dijit.getUniqueId(this.id);
+ dojo.mixin(this, dojo.i18n.getLocalization("dojox.widget", "ColorPicker"));
+ dojo.mixin(this, dojo.i18n.getLocalization("dojo.cldr", "number"));
+ this.inherited(arguments);
+ },
+
+ postCreate: function(){
+ // summary:
+ // As quickly as we can, set up ie6 alpha-filter support for our
+ // underlay. we don't do image handles (done in css), just the 'core'
+ // of this widget: the underlay.
+ this.inherited(arguments);
+ if(d.isIE < 7){
+ this.colorUnderlay.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._underlay+"', sizingMethod='scale')";
+ this.colorUnderlay.src = this._blankGif.toString();
+ }
+ // hide toggle-able nodes:
+ if(!this.showRgb){ this.rgbNode.style.visibility = "hidden"; }
+ if(!this.showHsv){ this.hsvNode.style.visibility = "hidden"; }
+ if(!this.showHex){ this.hexNode.style.visibility = "hidden"; }
+ if(!this.webSafe){ this.safePreviewNode.style.visibility = "hidden"; }
+ },
+
+ startup: function(){
+ if(this._started){
+ return;
+ }
+ this._started = true;
+ this.set("value", this.value);
+ this._mover = new d.dnd.move.boxConstrainedMoveable(this.cursorNode, {
+ box: {
+ t: -(this.PICKER_SAT_SELECTOR_H/2),
+ l: -(this.PICKER_SAT_SELECTOR_W/2),
+ w:this.PICKER_SAT_VAL_W,
+ h:this.PICKER_SAT_VAL_H
+ }
+ });
+
+ this._hueMover = new d.dnd.move.boxConstrainedMoveable(this.hueCursorNode, {
+ box: {
+ t: -(this.PICKER_HUE_SELECTOR_H/2),
+ l:0,
+ w:0,
+ h:this.PICKER_HUE_H
+ }
+ });
+
+ this._subs = [];
+ // no dnd/move/move published ... use a timer:
+ this._subs.push(d.subscribe("/dnd/move/stop", d.hitch(this, "_clearTimer")));
+ this._subs.push(d.subscribe("/dnd/move/start", d.hitch(this, "_setTimer")));
+
+ // Bind to up, down, left and right arrows on the hue and saturation nodes.
+ this._keyListeners = [];
+ this._connects.push(dijit.typematic.addKeyListener(this.hueCursorNode,{
+ charOrCode: dojo.keys.UP_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateHueCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.hueCursorNode,{
+ charOrCode: dojo.keys.DOWN_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateHueCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.UP_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.DOWN_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.LEFT_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.RIGHT_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ },
+
+ _setValueAttr: function(value){
+ if(!this._started){ return; }
+ this.setColor(value, true);
+ },
+
+ setColor: function(/* String */color, force){
+ // summary: Set a color on a picker. Usually used to set
+ // initial color as an alternative to passing defaultColor option
+ // to the constructor.
+ var col = dojox.color.fromString(color);
+ this._updatePickerLocations(col);
+ this._updateColorInputs(col);
+ this._updateValue(col, force);
+ },
+
+ _setTimer: function(/* d.dnd.Mover */mover){
+ // FIXME: should I assume this? focus on mouse down so on mouse up
+ dijit.focus(mover.node);
+ d.setSelectable(this.domNode,false);
+ this._timer = setInterval(d.hitch(this, "_updateColor"), 45);
+ },
+
+ _clearTimer: function(/* d.dnd.Mover */mover){
+ clearInterval(this._timer);
+ this._timer = null;
+ this.onChange(this.value);
+ d.setSelectable(this.domNode,true);
+ },
+
+ _setHue: function(/* Decimal */h){
+ // summary:
+ // Sets a natural color background for the
+ // underlay image against closest hue value (full saturation)
+ // h: 0..360
+ d.style(this.colorUnderlay, "backgroundColor", dojox.color.fromHsv(h,100,100).toHex());
+
+ },
+
+ _updateHueCursorNode: function(count, node, e){
+ // summary:
+ // Function used by the typematic code to handle cursor position and update
+ // via keyboard.
+ // count:
+ // -1 means stop, anything else is just how many times it was called.
+ // node:
+ // The node generating the event.
+ // e:
+ // The event.
+ if(count !== -1){
+ var y = dojo.style(this.hueCursorNode, "top");
+ var selCenter = (this.PICKER_HUE_SELECTOR_H/2);
+
+ // Account for our offset
+ y += selCenter;
+ var update = false;
+ if(e.charOrCode == dojo.keys.UP_ARROW){
+ if(y > 0){
+ y -= 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.DOWN_ARROW){
+ if(y < this.PICKER_HUE_H){
+ y += 1;
+ update = true;
+ }
+ }
+ y -= selCenter;
+ if(update){
+ dojo.style(this.hueCursorNode, "top", y + "px");
+ }
+ }else{
+ this._updateColor(true);
+ }
+ },
+
+ _updateCursorNode: function(count, node, e){
+ // summary:
+ // Function used by the typematic code to handle cursor position and update
+ // via keyboard.
+ // count:
+ // -1 means stop, anything else is just how many times it was called.
+ // node:
+ // The node generating the event.
+ // e:
+ // The event.
+ var selCenterH = this.PICKER_SAT_SELECTOR_H/2;
+ var selCenterW = this.PICKER_SAT_SELECTOR_W/2;
+
+ if(count !== -1){
+ var y = dojo.style(this.cursorNode, "top");
+ var x = dojo.style(this.cursorNode, "left");
+
+ // Account for our offsets to center
+ y += selCenterH;
+ x += selCenterW;
+
+ var update = false;
+ if(e.charOrCode == dojo.keys.UP_ARROW){
+ if(y > 0){
+ y -= 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.DOWN_ARROW){
+ if(y < this.PICKER_SAT_VAL_H){
+ y += 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.LEFT_ARROW){
+ if(x > 0){
+ x -= 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.RIGHT_ARROW){
+ if(x < this.PICKER_SAT_VAL_W){
+ x += 1;
+ update = true;
+ }
+ }
+ if(update){
+ // Account for our offsets to center
+ y -= selCenterH;
+ x -= selCenterW;
+ dojo.style(this.cursorNode, "top", y + "px");
+ dojo.style(this.cursorNode, "left", x + "px");
+ }
+ }else{
+ this._updateColor(true);
+ }
+ },
+
+ _updateColor: function(){
+ // summary: update the previewNode color, and input values [optional]
+
+ var hueSelCenter = this.PICKER_HUE_SELECTOR_H/2,
+ satSelCenterH = this.PICKER_SAT_SELECTOR_H/2,
+ satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
+
+ var _huetop = d.style(this.hueCursorNode,"top") + hueSelCenter,
+ _pickertop = d.style(this.cursorNode,"top") + satSelCenterH,
+ _pickerleft = d.style(this.cursorNode,"left") + satSelCenterW,
+ h = Math.round(360 - (_huetop / this.PICKER_HUE_H * 360)),
+ col = dojox.color.fromHsv(h, _pickerleft / this.PICKER_SAT_VAL_W * 100, 100 - (_pickertop / this.PICKER_SAT_VAL_H * 100))
+ ;
+
+ this._updateColorInputs(col);
+ this._updateValue(col, true);
+
+ // update hue, not all the pickers
+ if (h!=this._hue) {
+ this._setHue(h);
+ }
+ },
+
+ _colorInputChange: function(e){
+ //summary: updates picker position and inputs
+ // according to rgb, hex or hsv input changes
+ var col, hasit = false;
+ switch (e.target) {
+ //transform to hsv to pixels
+
+ case this.hexCode:
+ col = dojox.color.fromString(e.target.value);
+ hasit = true;
+
+ break;
+ case this.Rval:
+ case this.Gval:
+ case this.Bval:
+ col = dojox.color.fromArray([this.Rval.value, this.Gval.value, this.Bval.value]);
+ hasit = true;
+ break;
+ case this.Hval:
+ case this.Sval:
+ case this.Vval:
+ col = dojox.color.fromHsv(this.Hval.value, this.Sval.value, this.Vval.value);
+ hasit = true;
+ break;
+ }
+
+ if(hasit){
+ this._updatePickerLocations(col);
+ this._updateColorInputs(col);
+ this._updateValue(col, true);
+ }
+
+ },
+
+ _updateValue: function(/* dojox.color.Color */col, /* Boolean */fireChange){
+ // summary: updates the value of the widget
+ // can cancel reverse onChange by specifying second param
+ var hex = col.toHex();
+
+ this.value = this.valueNode.value = hex;
+
+ // anytime we muck with the color, fire onChange?
+ if(fireChange && (!this._timer || this.liveUpdate)) {
+ this.onChange(hex);
+ }
+ },
+
+ _updatePickerLocations: function(/* dojox.color.Color */col){
+ //summary: update handles on the pickers acording to color values
+ //
+ var hueSelCenter = this.PICKER_HUE_SELECTOR_H/2,
+ satSelCenterH = this.PICKER_SAT_SELECTOR_H/2,
+ satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
+
+ var hsv = col.toHsv(),
+ ypos = Math.round(this.PICKER_HUE_H - hsv.h / 360 * this.PICKER_HUE_H) - hueSelCenter,
+ newLeft = Math.round(hsv.s / 100 * this.PICKER_SAT_VAL_W) - satSelCenterW,
+ newTop = Math.round(this.PICKER_SAT_VAL_H - hsv.v / 100 * this.PICKER_SAT_VAL_H) - satSelCenterH
+ ;
+
+ if (this.animatePoint) {
+ d.fx.slideTo({
+ node: this.hueCursorNode,
+ duration: this.slideDuration,
+ top: ypos,
+ left: 0
+ }).play();
+
+ d.fx.slideTo({
+ node: this.cursorNode,
+ duration: this.slideDuration,
+ top: newTop,
+ left: newLeft
+ }).play();
+
+ }
+ else {
+ d.style(this.hueCursorNode, "top", ypos + "px");
+ d.style(this.cursorNode, {
+ left: newLeft + "px",
+ top: newTop + "px"
+ });
+ }
+
+ // limit hue calculations to only when it changes
+ if (hsv.h != this._hue) {
+ this._setHue(hsv.h);
+ }
+
+ },
+
+ _updateColorInputs: function(/* dojox.color.Color */col){
+ //summary: updates color inputs that were changed through other inputs
+ //or by clicking on the picker
+
+ var hex = col.toHex();
+
+ if (this.showRgb) {
+ this.Rval.value = col.r;
+ this.Gval.value = col.g;
+ this.Bval.value = col.b;
+ }
+
+ if (this.showHsv) {
+ var hsv = col.toHsv();
+ this.Hval.value = Math.round((hsv.h)); // convert to 0..360
+ this.Sval.value = Math.round(hsv.s);
+ this.Vval.value = Math.round(hsv.v);
+ }
+
+ if (this.showHex) {
+ this.hexCode.value = hex;
+ }
+
+ this.previewNode.style.backgroundColor = hex;
+
+ if (this.webSafe) {
+ this.safePreviewNode.style.backgroundColor = webSafeFromHex(hex);
+ }
+ },
+
+ _setHuePoint: function(/* Event */evt){
+ // summary: set the hue picker handle on relative y coordinates
+ var selCenter = (this.PICKER_HUE_SELECTOR_H/2);
+ var ypos = evt.layerY - selCenter;
+ if(this.animatePoint){
+ d.fx.slideTo({
+ node: this.hueCursorNode,
+ duration:this.slideDuration,
+ top: ypos,
+ left: 0,
+ onEnd: d.hitch(this, function() {this._updateColor(true); dijit.focus(this.hueCursorNode);})
+ }).play();
+ }else{
+ d.style(this.hueCursorNode, "top", ypos + "px");
+ this._updateColor(false);
+ }
+ },
+
+ _setPoint: function(/* Event */evt){
+ // summary: set our picker point based on relative x/y coordinates
+ // evt.preventDefault();
+ var satSelCenterH = this.PICKER_SAT_SELECTOR_H/2;
+ var satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
+ var newTop = evt.layerY - satSelCenterH;
+ var newLeft = evt.layerX - satSelCenterW;
+
+ if(evt){ dijit.focus(evt.target); }
+
+ if(this.animatePoint){
+ d.fx.slideTo({
+ node: this.cursorNode,
+ duration: this.slideDuration,
+ top: newTop,
+ left: newLeft,
+ onEnd: d.hitch(this, function() {this._updateColor(true); dijit.focus(this.cursorNode);})
+ }).play();
+ }else{
+ d.style(this.cursorNode, {
+ left: newLeft + "px",
+ top: newTop + "px"
+ });
+ this._updateColor(false);
+ }
+ },
+
+ _handleKey: function(/* Event */e){
+ // FIXME: not implemented YET
+ // var keys = d.keys;
+ },
+
+ focus: function(){
+ // summary:
+ // Put focus on this widget, only if focus isn't set on it already.
+ if(!this._focused){
+ dijit.focus(this.focusNode);
+ }
+ },
+
+ _stopDrag: function(e){
+ // summary:
+ // Function to hald the mouse down default
+ // to disable draggong of images out of the color
+ // picker.
+ dojo.stopEvent(e);
+ },
+
+ destroy: function(){
+ // summary:
+ // Over-ride to clean up subscriptions, etc.
+ this.inherited(arguments);
+ dojo.forEach(this._subs, function(sub){
+ dojo.unsubscribe(sub);
+ });
+ delete this._subs;
+ }
+ });
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/ColorPicker.xd.js new file mode 100644 index 0000000..73aaa57 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker.xd.js @@ -0,0 +1,593 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.ColorPicker"],
+["requireLocalization", "dojox.widget","ColorPicker", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw", "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"],
+["requireLocalization", "dojo.cldr","number", null, "ROOT,ar,ca,cs,da,de,el,en,en-au,en-gb,es,fi,fr,fr-ch,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-hant,zh-hk", "ROOT,ar,ca,cs,da,de,el,en,en-au,en-gb,es,fi,fr,fr-ch,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-hant,zh-hk"],
+["require", "dijit.form._FormWidget"],
+["require", "dojo.dnd.move"],
+["require", "dojo.fx"],
+["require", "dojox.color"],
+["require", "dojo.i18n"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.ColorPicker"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.ColorPicker"] = true;
+dojo.provide("dojox.widget.ColorPicker");
+dojo.experimental("dojox.widget.ColorPicker"); // level: beta //TODO: which?
+
+;
+;
+
+dojo.require("dijit.form._FormWidget");
+dojo.require("dojo.dnd.move");
+dojo.require("dojo.fx");
+dojo.require("dojox.color");
+dojo.require("dojo.i18n");
+
+(function(d){
+
+ var webSafeFromHex = function(hex){
+ // stub, this is planned later:
+ return hex;
+ };
+
+ dojo.declare("dojox.widget.ColorPicker",
+ dijit.form._FormWidget,
+ {
+ // summary: a HSV color picker - similar to Photoshop picker
+ //
+ // description:
+ // Provides an interactive HSV ColorPicker similar to
+ // PhotoShop's color selction tool. This is an enhanced
+ // version of the default dijit.ColorPalette, though provides
+ // no accessibility.
+ //
+ // example:
+ // | var picker = new dojox.widget.ColorPicker({
+ // | // a couple of example toggles:
+ // | animatePoint:false,
+ // | showHsv: false,
+ // | webSafe: false,
+ // | showRgb: false
+ // | });
+ //
+ // example:
+ // | <!-- markup: -->
+ // | <div dojoType="dojox.widget.ColorPicker"></div>
+ //
+ // showRgb: Boolean
+ // show/update RGB input nodes
+ showRgb: true,
+
+ // showHsv: Boolean
+ // show/update HSV input nodes
+ showHsv: true,
+
+ // showHex: Boolean
+ // show/update Hex value field
+ showHex: true,
+
+ // webSafe: Boolean
+ // deprecated? or just use a toggle to show/hide that node, too?
+ webSafe: true,
+
+ // animatePoint: Boolean
+ // toggle to use slideTo (true) or just place the cursor (false) on click
+ animatePoint: true,
+
+ // slideDuration: Integer
+ // time in ms picker node will slide to next location (non-dragging) when animatePoint=true
+ slideDuration: 250,
+
+ // liveUpdate: Boolean
+ // Set to true to fire onChange in an indeterminate way
+ liveUpdate: false,
+
+ // PICKER_HUE_H: int
+ // Height of the hue picker, used to calculate positions
+ PICKER_HUE_H: 150,
+
+ // PICKER_SAT_VAL_H: int
+ // Height of the 2d picker, used to calculate positions
+ PICKER_SAT_VAL_H: 150,
+
+ // PICKER_SAT_VAL_W: int
+ // Width of the 2d picker, used to calculate positions
+ PICKER_SAT_VAL_W: 150,
+
+ // PICKER_HUE_SELECTOR_H: int
+ // Height of the hue selector DOM node, used to calc offsets so that selection
+ // is center of the image node.
+ PICKER_HUE_SELECTOR_H: 8,
+
+ // PICKER_SAT_SELECTOR_H: int
+ // Height of the saturation selector DOM node, used to calc offsets so that selection
+ // is center of the image node.
+ PICKER_SAT_SELECTOR_H: 10,
+
+ // PICKER_SAT_SELECTOR_W: int
+ // Width of the saturation selector DOM node, used to calc offsets so that selection
+ // is center of the image node.
+ PICKER_SAT_SELECTOR_W: 10,
+
+ // value: String
+ // Default color for this component. Only hex values are accepted as incoming/returned
+ // values. Adjust this value with `.attr`, eg: dijit.byId("myPicker").attr("value", "#ededed");
+ // to cause the points to adjust and the values to reflect the current color.
+ value: "#ffffff",
+
+ _underlay: d.moduleUrl("dojox.widget","ColorPicker/images/underlay.png"),
+
+ _hueUnderlay: d.moduleUrl("dojox.widget","ColorPicker/images/hue.png"),
+
+ _pickerPointer: d.moduleUrl("dojox.widget","ColorPicker/images/pickerPointer.png"),
+
+ _huePickerPointer: d.moduleUrl("dojox.widget","ColorPicker/images/hueHandle.png"),
+
+ _huePickerPointerAlly: d.moduleUrl("dojox.widget","ColorPicker/images/hueHandleA11y.png"),
+
+ // don't change to d.moduleUrl, build won't intern it.
+ templateString: dojo.cache("dojox.widget", "ColorPicker/ColorPicker.html", "<table class=\"dojoxColorPicker\" dojoAttachEvent=\"onkeypress: _handleKey\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t<tr>\r\n\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\r\n\t\t\t<div class=\"dojoxColorPickerBox\">\r\n\t\t\t\t<!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. -->\r\n\t\t\t\t<img role=\"status\" title=\"${saturationPickerTitle}\" alt=\"${saturationPickerTitle}\" class=\"dojoxColorPickerPoint\" src=\"${_pickerPointer}\" tabIndex=\"0\" dojoAttachPoint=\"cursorNode\" style=\"position: absolute; top: 0px; left: 0px;\">\r\n\t\t\t\t<img role=\"presentation\" alt=\"\" dojoAttachPoint=\"colorUnderlay\" dojoAttachEvent=\"onclick: _setPoint, onmousedown: _stopDrag\" class=\"dojoxColorPickerUnderlay\" src=\"${_underlay}\" ondragstart=\"return false\">\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\r\n\t\t\t<div class=\"dojoxHuePicker\">\r\n\t\t\t\t<!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. -->\r\n\t\t\t\t<img role=\"status\" dojoAttachPoint=\"hueCursorNode\" tabIndex=\"0\" class=\"dojoxHuePickerPoint\" title=\"${huePickerTitle}\" alt=\"${huePickerTitle}\" src=\"${_huePickerPointer}\" style=\"position: absolute; top: 0px; left: 0px;\">\r\n\t\t\t\t<div class=\"dojoxHuePickerUnderlay\" dojoAttachPoint=\"hueNode\">\r\n\t\t\t\t <img role=\"presentation\" alt=\"\" dojoAttachEvent=\"onclick: _setHuePoint, onmousedown: _stopDrag\" src=\"${_hueUnderlay}\">\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t\t<td valign=\"top\">\r\n\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td valign=\"top\" class=\"dojoxColorPickerPreviewContainer\">\r\n\t\t\t\t\t\t<table cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td valign=\"top\" class=\"dojoxColorPickerRightPad\">\r\n\t\t\t\t\t\t\t\t\t<div dojoAttachPoint=\"previewNode\" class=\"dojoxColorPickerPreview\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td valign=\"top\">\r\n\t\t\t\t\t\t\t\t\t<div dojoAttachPoint=\"safePreviewNode\" class=\"dojoxColorPickerWebSafePreview\"></div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td valign=\"bottom\">\r\n\t\t\t\t\t\t<table class=\"dojoxColorPickerOptional\" cellpadding=\"0\" cellspacing=\"0\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t<div class=\"dijitInline dojoxColorPickerRgb\" dojoAttachPoint=\"rgbNode\">\r\n\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"1\" cellspacing=\"1\">\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_r\">${redLabel}</label></td><td><input id=\"${_uId}_r\" dojoAttachPoint=\"Rval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_g\">${greenLabel}</label></td><td><input id=\"${_uId}_g\" dojoAttachPoint=\"Gval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_b\">${blueLabel}</label></td><td><input id=\"${_uId}_b\" dojoAttachPoint=\"Bval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"></td></tr>\r\n\t\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t\t\t<div class=\"dijitInline dojoxColorPickerHsv\" dojoAttachPoint=\"hsvNode\">\r\n\t\t\t\t\t\t\t\t\t\t<table cellpadding=\"1\" cellspacing=\"1\">\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_h\">${hueLabel}</label></td><td><input id=\"${_uId}_h\" dojoAttachPoint=\"Hval\"size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${degLabel}</td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_s\">${saturationLabel}</label></td><td><input id=\"${_uId}_s\" dojoAttachPoint=\"Sval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${percentSign}</td></tr>\r\n\t\t\t\t\t\t\t\t\t\t<tr><td><label for=\"${_uId}_v\">${valueLabel}</label></td><td><input id=\"${_uId}_v\" dojoAttachPoint=\"Vval\" size=\"1\" dojoAttachEvent=\"onchange: _colorInputChange\"> ${percentSign}</td></tr>\r\n\t\t\t\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td colspan=\"2\">\r\n\t\t\t\t\t\t\t\t\t<div class=\"dojoxColorPickerHex\" dojoAttachPoint=\"hexNode\" aria-live=\"polite\">\t\r\n\t\t\t\t\t\t\t\t\t\t<label for=\"${_uId}_hex\"> ${hexLabel} </label><input id=\"${_uId}_hex\" dojoAttachPoint=\"hexCode, focusNode, valueNode\" size=\"6\" class=\"dojoxColorPickerHexCode\" dojoAttachEvent=\"onchange: _colorInputChange\">\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t</td>\r\n\t</tr>\r\n</table>\r\n\r\n"),
+
+ postMixInProperties: function(){
+ if(dojo.hasClass(dojo.body(), "dijit_a11y")){
+ // Use the pointer that will show up in high contrast.
+ this._huePickerPointer = this._huePickerPointerAlly;
+ }
+ this._uId = dijit.getUniqueId(this.id);
+ dojo.mixin(this, dojo.i18n.getLocalization("dojox.widget", "ColorPicker"));
+ dojo.mixin(this, dojo.i18n.getLocalization("dojo.cldr", "number"));
+ this.inherited(arguments);
+ },
+
+ postCreate: function(){
+ // summary:
+ // As quickly as we can, set up ie6 alpha-filter support for our
+ // underlay. we don't do image handles (done in css), just the 'core'
+ // of this widget: the underlay.
+ this.inherited(arguments);
+ if(d.isIE < 7){
+ this.colorUnderlay.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._underlay+"', sizingMethod='scale')";
+ this.colorUnderlay.src = this._blankGif.toString();
+ }
+ // hide toggle-able nodes:
+ if(!this.showRgb){ this.rgbNode.style.visibility = "hidden"; }
+ if(!this.showHsv){ this.hsvNode.style.visibility = "hidden"; }
+ if(!this.showHex){ this.hexNode.style.visibility = "hidden"; }
+ if(!this.webSafe){ this.safePreviewNode.style.visibility = "hidden"; }
+ },
+
+ startup: function(){
+ if(this._started){
+ return;
+ }
+ this._started = true;
+ this.set("value", this.value);
+ this._mover = new d.dnd.move.boxConstrainedMoveable(this.cursorNode, {
+ box: {
+ t: -(this.PICKER_SAT_SELECTOR_H/2),
+ l: -(this.PICKER_SAT_SELECTOR_W/2),
+ w:this.PICKER_SAT_VAL_W,
+ h:this.PICKER_SAT_VAL_H
+ }
+ });
+
+ this._hueMover = new d.dnd.move.boxConstrainedMoveable(this.hueCursorNode, {
+ box: {
+ t: -(this.PICKER_HUE_SELECTOR_H/2),
+ l:0,
+ w:0,
+ h:this.PICKER_HUE_H
+ }
+ });
+
+ this._subs = [];
+ // no dnd/move/move published ... use a timer:
+ this._subs.push(d.subscribe("/dnd/move/stop", d.hitch(this, "_clearTimer")));
+ this._subs.push(d.subscribe("/dnd/move/start", d.hitch(this, "_setTimer")));
+
+ // Bind to up, down, left and right arrows on the hue and saturation nodes.
+ this._keyListeners = [];
+ this._connects.push(dijit.typematic.addKeyListener(this.hueCursorNode,{
+ charOrCode: dojo.keys.UP_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateHueCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.hueCursorNode,{
+ charOrCode: dojo.keys.DOWN_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateHueCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.UP_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.DOWN_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.LEFT_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ this._connects.push(dijit.typematic.addKeyListener(this.cursorNode,{
+ charOrCode: dojo.keys.RIGHT_ARROW,
+ shiftKey: false,
+ metaKey: false,
+ ctrlKey: false,
+ altKey: false
+ }, this, dojo.hitch(this, this._updateCursorNode), 25, 25));
+ },
+
+ _setValueAttr: function(value){
+ if(!this._started){ return; }
+ this.setColor(value, true);
+ },
+
+ setColor: function(/* String */color, force){
+ // summary: Set a color on a picker. Usually used to set
+ // initial color as an alternative to passing defaultColor option
+ // to the constructor.
+ var col = dojox.color.fromString(color);
+ this._updatePickerLocations(col);
+ this._updateColorInputs(col);
+ this._updateValue(col, force);
+ },
+
+ _setTimer: function(/* d.dnd.Mover */mover){
+ // FIXME: should I assume this? focus on mouse down so on mouse up
+ dijit.focus(mover.node);
+ d.setSelectable(this.domNode,false);
+ this._timer = setInterval(d.hitch(this, "_updateColor"), 45);
+ },
+
+ _clearTimer: function(/* d.dnd.Mover */mover){
+ clearInterval(this._timer);
+ this._timer = null;
+ this.onChange(this.value);
+ d.setSelectable(this.domNode,true);
+ },
+
+ _setHue: function(/* Decimal */h){
+ // summary:
+ // Sets a natural color background for the
+ // underlay image against closest hue value (full saturation)
+ // h: 0..360
+ d.style(this.colorUnderlay, "backgroundColor", dojox.color.fromHsv(h,100,100).toHex());
+
+ },
+
+ _updateHueCursorNode: function(count, node, e){
+ // summary:
+ // Function used by the typematic code to handle cursor position and update
+ // via keyboard.
+ // count:
+ // -1 means stop, anything else is just how many times it was called.
+ // node:
+ // The node generating the event.
+ // e:
+ // The event.
+ if(count !== -1){
+ var y = dojo.style(this.hueCursorNode, "top");
+ var selCenter = (this.PICKER_HUE_SELECTOR_H/2);
+
+ // Account for our offset
+ y += selCenter;
+ var update = false;
+ if(e.charOrCode == dojo.keys.UP_ARROW){
+ if(y > 0){
+ y -= 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.DOWN_ARROW){
+ if(y < this.PICKER_HUE_H){
+ y += 1;
+ update = true;
+ }
+ }
+ y -= selCenter;
+ if(update){
+ dojo.style(this.hueCursorNode, "top", y + "px");
+ }
+ }else{
+ this._updateColor(true);
+ }
+ },
+
+ _updateCursorNode: function(count, node, e){
+ // summary:
+ // Function used by the typematic code to handle cursor position and update
+ // via keyboard.
+ // count:
+ // -1 means stop, anything else is just how many times it was called.
+ // node:
+ // The node generating the event.
+ // e:
+ // The event.
+ var selCenterH = this.PICKER_SAT_SELECTOR_H/2;
+ var selCenterW = this.PICKER_SAT_SELECTOR_W/2;
+
+ if(count !== -1){
+ var y = dojo.style(this.cursorNode, "top");
+ var x = dojo.style(this.cursorNode, "left");
+
+ // Account for our offsets to center
+ y += selCenterH;
+ x += selCenterW;
+
+ var update = false;
+ if(e.charOrCode == dojo.keys.UP_ARROW){
+ if(y > 0){
+ y -= 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.DOWN_ARROW){
+ if(y < this.PICKER_SAT_VAL_H){
+ y += 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.LEFT_ARROW){
+ if(x > 0){
+ x -= 1;
+ update = true;
+ }
+ }else if(e.charOrCode == dojo.keys.RIGHT_ARROW){
+ if(x < this.PICKER_SAT_VAL_W){
+ x += 1;
+ update = true;
+ }
+ }
+ if(update){
+ // Account for our offsets to center
+ y -= selCenterH;
+ x -= selCenterW;
+ dojo.style(this.cursorNode, "top", y + "px");
+ dojo.style(this.cursorNode, "left", x + "px");
+ }
+ }else{
+ this._updateColor(true);
+ }
+ },
+
+ _updateColor: function(){
+ // summary: update the previewNode color, and input values [optional]
+
+ var hueSelCenter = this.PICKER_HUE_SELECTOR_H/2,
+ satSelCenterH = this.PICKER_SAT_SELECTOR_H/2,
+ satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
+
+ var _huetop = d.style(this.hueCursorNode,"top") + hueSelCenter,
+ _pickertop = d.style(this.cursorNode,"top") + satSelCenterH,
+ _pickerleft = d.style(this.cursorNode,"left") + satSelCenterW,
+ h = Math.round(360 - (_huetop / this.PICKER_HUE_H * 360)),
+ col = dojox.color.fromHsv(h, _pickerleft / this.PICKER_SAT_VAL_W * 100, 100 - (_pickertop / this.PICKER_SAT_VAL_H * 100))
+ ;
+
+ this._updateColorInputs(col);
+ this._updateValue(col, true);
+
+ // update hue, not all the pickers
+ if (h!=this._hue) {
+ this._setHue(h);
+ }
+ },
+
+ _colorInputChange: function(e){
+ //summary: updates picker position and inputs
+ // according to rgb, hex or hsv input changes
+ var col, hasit = false;
+ switch (e.target) {
+ //transform to hsv to pixels
+
+ case this.hexCode:
+ col = dojox.color.fromString(e.target.value);
+ hasit = true;
+
+ break;
+ case this.Rval:
+ case this.Gval:
+ case this.Bval:
+ col = dojox.color.fromArray([this.Rval.value, this.Gval.value, this.Bval.value]);
+ hasit = true;
+ break;
+ case this.Hval:
+ case this.Sval:
+ case this.Vval:
+ col = dojox.color.fromHsv(this.Hval.value, this.Sval.value, this.Vval.value);
+ hasit = true;
+ break;
+ }
+
+ if(hasit){
+ this._updatePickerLocations(col);
+ this._updateColorInputs(col);
+ this._updateValue(col, true);
+ }
+
+ },
+
+ _updateValue: function(/* dojox.color.Color */col, /* Boolean */fireChange){
+ // summary: updates the value of the widget
+ // can cancel reverse onChange by specifying second param
+ var hex = col.toHex();
+
+ this.value = this.valueNode.value = hex;
+
+ // anytime we muck with the color, fire onChange?
+ if(fireChange && (!this._timer || this.liveUpdate)) {
+ this.onChange(hex);
+ }
+ },
+
+ _updatePickerLocations: function(/* dojox.color.Color */col){
+ //summary: update handles on the pickers acording to color values
+ //
+ var hueSelCenter = this.PICKER_HUE_SELECTOR_H/2,
+ satSelCenterH = this.PICKER_SAT_SELECTOR_H/2,
+ satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
+
+ var hsv = col.toHsv(),
+ ypos = Math.round(this.PICKER_HUE_H - hsv.h / 360 * this.PICKER_HUE_H) - hueSelCenter,
+ newLeft = Math.round(hsv.s / 100 * this.PICKER_SAT_VAL_W) - satSelCenterW,
+ newTop = Math.round(this.PICKER_SAT_VAL_H - hsv.v / 100 * this.PICKER_SAT_VAL_H) - satSelCenterH
+ ;
+
+ if (this.animatePoint) {
+ d.fx.slideTo({
+ node: this.hueCursorNode,
+ duration: this.slideDuration,
+ top: ypos,
+ left: 0
+ }).play();
+
+ d.fx.slideTo({
+ node: this.cursorNode,
+ duration: this.slideDuration,
+ top: newTop,
+ left: newLeft
+ }).play();
+
+ }
+ else {
+ d.style(this.hueCursorNode, "top", ypos + "px");
+ d.style(this.cursorNode, {
+ left: newLeft + "px",
+ top: newTop + "px"
+ });
+ }
+
+ // limit hue calculations to only when it changes
+ if (hsv.h != this._hue) {
+ this._setHue(hsv.h);
+ }
+
+ },
+
+ _updateColorInputs: function(/* dojox.color.Color */col){
+ //summary: updates color inputs that were changed through other inputs
+ //or by clicking on the picker
+
+ var hex = col.toHex();
+
+ if (this.showRgb) {
+ this.Rval.value = col.r;
+ this.Gval.value = col.g;
+ this.Bval.value = col.b;
+ }
+
+ if (this.showHsv) {
+ var hsv = col.toHsv();
+ this.Hval.value = Math.round((hsv.h)); // convert to 0..360
+ this.Sval.value = Math.round(hsv.s);
+ this.Vval.value = Math.round(hsv.v);
+ }
+
+ if (this.showHex) {
+ this.hexCode.value = hex;
+ }
+
+ this.previewNode.style.backgroundColor = hex;
+
+ if (this.webSafe) {
+ this.safePreviewNode.style.backgroundColor = webSafeFromHex(hex);
+ }
+ },
+
+ _setHuePoint: function(/* Event */evt){
+ // summary: set the hue picker handle on relative y coordinates
+ var selCenter = (this.PICKER_HUE_SELECTOR_H/2);
+ var ypos = evt.layerY - selCenter;
+ if(this.animatePoint){
+ d.fx.slideTo({
+ node: this.hueCursorNode,
+ duration:this.slideDuration,
+ top: ypos,
+ left: 0,
+ onEnd: d.hitch(this, function() {this._updateColor(true); dijit.focus(this.hueCursorNode);})
+ }).play();
+ }else{
+ d.style(this.hueCursorNode, "top", ypos + "px");
+ this._updateColor(false);
+ }
+ },
+
+ _setPoint: function(/* Event */evt){
+ // summary: set our picker point based on relative x/y coordinates
+ // evt.preventDefault();
+ var satSelCenterH = this.PICKER_SAT_SELECTOR_H/2;
+ var satSelCenterW = this.PICKER_SAT_SELECTOR_W/2;
+ var newTop = evt.layerY - satSelCenterH;
+ var newLeft = evt.layerX - satSelCenterW;
+
+ if(evt){ dijit.focus(evt.target); }
+
+ if(this.animatePoint){
+ d.fx.slideTo({
+ node: this.cursorNode,
+ duration: this.slideDuration,
+ top: newTop,
+ left: newLeft,
+ onEnd: d.hitch(this, function() {this._updateColor(true); dijit.focus(this.cursorNode);})
+ }).play();
+ }else{
+ d.style(this.cursorNode, {
+ left: newLeft + "px",
+ top: newTop + "px"
+ });
+ this._updateColor(false);
+ }
+ },
+
+ _handleKey: function(/* Event */e){
+ // FIXME: not implemented YET
+ // var keys = d.keys;
+ },
+
+ focus: function(){
+ // summary:
+ // Put focus on this widget, only if focus isn't set on it already.
+ if(!this._focused){
+ dijit.focus(this.focusNode);
+ }
+ },
+
+ _stopDrag: function(e){
+ // summary:
+ // Function to hald the mouse down default
+ // to disable draggong of images out of the color
+ // picker.
+ dojo.stopEvent(e);
+ },
+
+ destroy: function(){
+ // summary:
+ // Over-ride to clean up subscriptions, etc.
+ this.inherited(arguments);
+ dojo.forEach(this._subs, function(sub){
+ dojo.unsubscribe(sub);
+ });
+ delete this._subs;
+ }
+ });
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/ColorPicker/ColorPicker.css b/js/dojo-1.6/dojox/widget/ColorPicker/ColorPicker.css new file mode 100644 index 0000000..a7b8fa9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker/ColorPicker.css @@ -0,0 +1,118 @@ +.dojoxColorPicker { + padding:8px; + -moz-border-radius:4pt; + -webkit-border-radius:5pt; + -webkit-drop-shadow:3pt; +} + +.dojoxColorPickerRightPad { + padding-right: 8px; +} + +.tundra .dojoxColorPicker { + background:#ededed; + border:1px solid #ccc; +} + +.dojoxColorPickerBox { + position:relative; + width:150px; + height:150px; + margin:0; + padding:0; +} + +.dojoxColorPickerUnderlay { + position:relative; + top:0; left:0; + width:150px; + height:150px; + z-index:1; +} +.tundra .dojoxColorPickerUnderlay { + border:1px solid #a0a0a0; +} + +.claro .dojoxColorPicker { + background:#ededed; + border:1px solid #cdcdcd; +} + +.claro .dojoxColorPickerUnderlay { + border:1px solid #cccccc; +} + +.dojoxHuePickerUnderlay { + position:relative; + top:0; left:0; + height:150px; + width:20px; + z-index:1; + text-align: center; +} + +.dojoxHuePicker { position:relative; top: 0px; left: 0px; padding: 0px;} + +.dojoxHuePickerPoint { + position:absolute; + top:0; left:0; + width:20px; + height:8px; + z-index:3; + cursor:move; +} + +.dojoxColorPickerPoint { + position:absolute; + width:10px; + height:10px; + border:0; + z-index:3; + cursor:move; +} + +.dojoxColorPickerPreview { + display:block; + width:45px; + height:45px; + border:1px solid #333; + background-color:#fff; + position:relative; + top: 0px; + left: 0px; +} +.dojoxColorPickerWebSafePreview { + display:block; + width:25px; + height:25px; + position:relative; + top: 0px; + left: 0px; + border:1px solid #333; +} + +.dojoxColorPickerOptional { + position:relative; + top: 0px; + left: 0px; + height: 100%; +} + +.dojoxColorPickerOptional table { + border-spacing: 4px; +} + +.dojoxColorPickerPreviewContainer table { + border-spacing: 6px 0px; +} + +.dojoxColorPickerOptional input { + border:1px solid #a7a7a7; + width:25px; + padding:1px 3px 1px 3px; + line-height:1.1em; +} + +.dojoxColorPickerHex input { + width:55px; +} diff --git a/js/dojo-1.6/dojox/widget/ColorPicker/ColorPicker.html b/js/dojo-1.6/dojox/widget/ColorPicker/ColorPicker.html new file mode 100644 index 0000000..2939ac6 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker/ColorPicker.html @@ -0,0 +1,72 @@ +<table class="dojoxColorPicker" dojoAttachEvent="onkeypress: _handleKey" cellpadding="0" cellspacing="0"> + <tr> + <td valign="top" class="dojoxColorPickerRightPad"> + <div class="dojoxColorPickerBox"> + <!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. --> + <img role="status" title="${saturationPickerTitle}" alt="${saturationPickerTitle}" class="dojoxColorPickerPoint" src="${_pickerPointer}" tabIndex="0" dojoAttachPoint="cursorNode" style="position: absolute; top: 0px; left: 0px;"> + <img role="presentation" alt="" dojoAttachPoint="colorUnderlay" dojoAttachEvent="onclick: _setPoint, onmousedown: _stopDrag" class="dojoxColorPickerUnderlay" src="${_underlay}" ondragstart="return false"> + </div> + </td> + <td valign="top" class="dojoxColorPickerRightPad"> + <div class="dojoxHuePicker"> + <!-- Forcing ABS in style attr due to dojo DND issue with not picking it up form the class. --> + <img role="status" dojoAttachPoint="hueCursorNode" tabIndex="0" class="dojoxHuePickerPoint" title="${huePickerTitle}" alt="${huePickerTitle}" src="${_huePickerPointer}" style="position: absolute; top: 0px; left: 0px;"> + <div class="dojoxHuePickerUnderlay" dojoAttachPoint="hueNode"> + <img role="presentation" alt="" dojoAttachEvent="onclick: _setHuePoint, onmousedown: _stopDrag" src="${_hueUnderlay}"> + </div> + </div> + </td> + <td valign="top"> + <table cellpadding="0" cellspacing="0"> + <tr> + <td valign="top" class="dojoxColorPickerPreviewContainer"> + <table cellpadding="0" cellspacing="0"> + <tr> + <td valign="top" class="dojoxColorPickerRightPad"> + <div dojoAttachPoint="previewNode" class="dojoxColorPickerPreview"></div> + </td> + <td valign="top"> + <div dojoAttachPoint="safePreviewNode" class="dojoxColorPickerWebSafePreview"></div> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td valign="bottom"> + <table class="dojoxColorPickerOptional" cellpadding="0" cellspacing="0"> + <tr> + <td> + <div class="dijitInline dojoxColorPickerRgb" dojoAttachPoint="rgbNode"> + <table cellpadding="1" cellspacing="1"> + <tr><td><label for="${_uId}_r">${redLabel}</label></td><td><input id="${_uId}_r" dojoAttachPoint="Rval" size="1" dojoAttachEvent="onchange: _colorInputChange"></td></tr> + <tr><td><label for="${_uId}_g">${greenLabel}</label></td><td><input id="${_uId}_g" dojoAttachPoint="Gval" size="1" dojoAttachEvent="onchange: _colorInputChange"></td></tr> + <tr><td><label for="${_uId}_b">${blueLabel}</label></td><td><input id="${_uId}_b" dojoAttachPoint="Bval" size="1" dojoAttachEvent="onchange: _colorInputChange"></td></tr> + </table> + </div> + </td> + <td> + <div class="dijitInline dojoxColorPickerHsv" dojoAttachPoint="hsvNode"> + <table cellpadding="1" cellspacing="1"> + <tr><td><label for="${_uId}_h">${hueLabel}</label></td><td><input id="${_uId}_h" dojoAttachPoint="Hval"size="1" dojoAttachEvent="onchange: _colorInputChange"> ${degLabel}</td></tr> + <tr><td><label for="${_uId}_s">${saturationLabel}</label></td><td><input id="${_uId}_s" dojoAttachPoint="Sval" size="1" dojoAttachEvent="onchange: _colorInputChange"> ${percentSign}</td></tr> + <tr><td><label for="${_uId}_v">${valueLabel}</label></td><td><input id="${_uId}_v" dojoAttachPoint="Vval" size="1" dojoAttachEvent="onchange: _colorInputChange"> ${percentSign}</td></tr> + </table> + </div> + </td> + </tr> + <tr> + <td colspan="2"> + <div class="dojoxColorPickerHex" dojoAttachPoint="hexNode" aria-live="polite"> + <label for="${_uId}_hex"> ${hexLabel} </label><input id="${_uId}_hex" dojoAttachPoint="hexCode, focusNode, valueNode" size="6" class="dojoxColorPickerHexCode" dojoAttachEvent="onchange: _colorInputChange"> + </div> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> +</table> + diff --git a/js/dojo-1.6/dojox/widget/ColorPicker/images/hue.png b/js/dojo-1.6/dojox/widget/ColorPicker/images/hue.png Binary files differnew file mode 100644 index 0000000..2746235 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker/images/hue.png diff --git a/js/dojo-1.6/dojox/widget/ColorPicker/images/hueHandle.png b/js/dojo-1.6/dojox/widget/ColorPicker/images/hueHandle.png Binary files differnew file mode 100644 index 0000000..c7b56e8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker/images/hueHandle.png diff --git a/js/dojo-1.6/dojox/widget/ColorPicker/images/hueHandleA11y.png b/js/dojo-1.6/dojox/widget/ColorPicker/images/hueHandleA11y.png Binary files differnew file mode 100644 index 0000000..58c648d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker/images/hueHandleA11y.png diff --git a/js/dojo-1.6/dojox/widget/ColorPicker/images/pickerPointer.png b/js/dojo-1.6/dojox/widget/ColorPicker/images/pickerPointer.png Binary files differnew file mode 100644 index 0000000..28a3c81 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker/images/pickerPointer.png diff --git a/js/dojo-1.6/dojox/widget/ColorPicker/images/underlay.png b/js/dojo-1.6/dojox/widget/ColorPicker/images/underlay.png Binary files differnew file mode 100644 index 0000000..0f5eb7c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/ColorPicker/images/underlay.png diff --git a/js/dojo-1.6/dojox/widget/DataPresentation.js b/js/dojo-1.6/dojox/widget/DataPresentation.js new file mode 100644 index 0000000..32d8556 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DataPresentation.js @@ -0,0 +1,908 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.DataPresentation"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DataPresentation"] = true;
+dojo.provide("dojox.widget.DataPresentation");
+dojo.experimental("dojox.widget.DataPresentation");
+
+dojo.require("dojox.grid.DataGrid");
+dojo.require("dojox.charting.Chart2D");
+dojo.require("dojox.charting.widget.Legend");
+dojo.require("dojox.charting.action2d.Tooltip");
+dojo.require("dojox.charting.action2d.Highlight");
+dojo.require("dojo.colors");
+dojo.require("dojo.data.ItemFileWriteStore");
+
+(function(){
+
+ // sort out the labels for the independent axis of the chart
+ var getLabels = function(range, labelMod, charttype, domNode){
+
+ // prepare labels for the independent axis
+ var labels = [];
+ // add empty label, hack
+ labels[0] = {value: 0, text: ''};
+
+ var nlabels = range.length;
+
+ // auto-set labelMod for horizontal charts if the labels will otherwise collide
+ if((charttype !== "ClusteredBars") && (charttype !== "StackedBars")){
+ var cwid = domNode.offsetWidth;
+ var tmp = ("" + range[0]).length * range.length * 7; // *assume* 7 pixels width per character ( was 9 )
+
+ if(labelMod == 1){
+ for(var z = 1; z < 500; ++z){
+ if((tmp / z) < cwid){
+ break;
+ }
+ ++labelMod;
+ }
+ }
+ }
+
+ // now set the labels
+ for(var i = 0; i < nlabels; i++){
+ //sparse labels
+ labels.push({
+ value: i + 1,
+ text: (!labelMod || i % labelMod) ? "" : range[i]
+ });
+ }
+
+ // add empty label again, hack
+ labels.push({value: nlabels + 1, text:''});
+
+ return labels;
+ };
+
+ // get the configuration of an independent axis for the chart
+ var getIndependentAxisArgs = function(charttype, labels){
+
+ var args = { vertical: false, labels: labels, min: 0, max: labels.length-1, majorTickStep: 1, minorTickStep: 1 };
+
+ // clustered or stacked bars have a vertical independent axis
+ if((charttype === "ClusteredBars") || (charttype === "StackedBars")){
+ args.vertical = true;
+ }
+
+ // lines, areas and stacked areas don't need the extra slots at each end
+ if((charttype === "Lines") || (charttype === "Areas") || (charttype === "StackedAreas")){
+ args.min++;
+ args.max--;
+ }
+
+ return args;
+ };
+
+ // get the configuration of a dependent axis for the chart
+ var getDependentAxisArgs = function(charttype, axistype, minval, maxval){
+
+ var args = { vertical: true, fixLower: "major", fixUpper: "major", natural: true };
+
+ // secondary dependent axis is not left-bottom
+ if(axistype === "secondary"){
+ args.leftBottom = false;
+ }
+
+ // clustered or stacked bars have horizontal dependent axes
+ if((charttype === "ClusteredBars") || (charttype === "StackedBars")){
+ args.vertical = false;
+ }
+
+ // ensure axis does not "collapse" for flat series
+ if(minval == maxval){
+ args.min = minval - 1;
+ args.max = maxval + 1;
+ }
+
+ return args;
+ };
+
+ // get the configuration of a plot for the chart
+ var getPlotArgs = function(charttype, axistype, animate){
+
+ var args = { type: charttype, hAxis: "independent", vAxis: "dependent-" + axistype, gap: 4, lines: false, areas: false, markers: false };
+
+ // clustered or stacked bars have horizontal dependent axes
+ if((charttype === "ClusteredBars") || (charttype === "StackedBars")){
+ args.hAxis = args.vAxis;
+ args.vAxis = "independent";
+ }
+
+ // turn on lines for Lines, Areas and StackedAreas
+ if((charttype === "Lines") || (charttype === "Hybrid-Lines") || (charttype === "Areas") || (charttype === "StackedAreas")){
+ args.lines = true;
+ }
+
+ // turn on areas for Areas and StackedAreas
+ if((charttype === "Areas") || (charttype === "StackedAreas")){
+ args.areas = true;
+ }
+
+ // turn on markers and shadow for Lines
+ if(charttype === "Lines"){
+ args.markers = true;
+ }
+
+ // turn on shadow for Hybrid-Lines
+ // also, Hybrid-Lines is not a true chart type: use Lines for the actual plot
+ if(charttype === "Hybrid-Lines"){
+ args.shadows = {dx: 2, dy: 2, dw: 2};
+ args.type = "Lines";
+ }
+
+ // also, Hybrid-ClusteredColumns is not a true chart type: use ClusteredColumns for the actual plot
+ if(charttype === "Hybrid-ClusteredColumns"){
+ args.type = "ClusteredColumns";
+ }
+
+ // enable animation on the plot if animation is requested
+ if(animate){
+ args.animate = animate;
+ }
+
+ return args;
+ };
+
+ // set up a chart presentation
+ var setupChart = function(/*DomNode*/domNode, /*Object?*/chart, /*String*/type, /*Boolean*/reverse, /*Object*/animate, /*Integer*/labelMod, /*String*/theme, /*String*/tooltip, /*Object?*/store, /*String?*/query, /*String?*/queryOptions){
+ var _chart = chart;
+
+ if(!_chart){
+ domNode.innerHTML = ""; // any other content in the node disrupts the chart rendering
+ _chart = new dojox.charting.Chart2D(domNode);
+ }
+
+ // set the theme
+ if(theme){
+
+ // workaround for a theme bug: its _clone method
+ // does not transfer the markers, so we repair
+ // that omission here
+ // FIXME this should be removed once the theme bug is fixed
+ theme._clone = function(){
+ var result = new dojox.charting.Theme({
+ chart: this.chart,
+ plotarea: this.plotarea,
+ axis: this.axis,
+ series: this.series,
+ marker: this.marker,
+ antiAlias: this.antiAlias,
+ assignColors: this.assignColors,
+ assignMarkers: this.assigneMarkers,
+ colors: dojo.delegate(this.colors)
+ });
+
+ result.markers = this.markers;
+ result._buildMarkerArray();
+
+ return result;
+ };
+
+ _chart.setTheme(theme);
+ }
+
+ var range = store.series_data[0].slice(0);
+
+ // reverse the labels if requested
+ if(reverse){
+ range.reverse();
+ }
+
+ var labels = getLabels(range, labelMod, type, domNode);
+
+ // collect details of whether primary and/or secondary axes are required
+ // and what plots we have instantiated using each type of axis
+ var plots = {};
+
+ // collect maximum and minimum data values
+ var maxval = null;
+ var minval = null;
+
+ var seriestoremove = {};
+ for(var sname in _chart.runs){
+ seriestoremove[sname] = true;
+ }
+
+ // set x values & max data value
+ var nseries = store.series_name.length;
+ for(var i = 0; i < nseries; i++){
+ // only include series with chart=true and with some data values in
+ if(store.series_chart[i] && (store.series_data[i].length > 0)){
+
+ var charttype = type;
+ var axistype = store.series_axis[i];
+
+ if(charttype == "Hybrid"){
+ if(store.series_charttype[i] == 'line'){
+ charttype = "Hybrid-Lines";
+ }else{
+ charttype = "Hybrid-ClusteredColumns";
+ }
+ }
+
+ // ensure we have recorded that we are using this axis type
+ if(!plots[axistype]){
+ plots[axistype] = {};
+ }
+
+ // ensure we have the correct type of plot for this series
+ if(!plots[axistype][charttype]){
+ var axisname = axistype + "-" + charttype;
+
+ // create the plot and enable tooltips
+ _chart.addPlot(axisname, getPlotArgs(charttype, axistype, animate));
+
+ var tooltipArgs = {};
+ if(typeof tooltip == 'string'){
+ tooltipArgs.text = function(o){
+ var substitutions = [o.element, o.run.name, range[o.index], ((charttype === "ClusteredBars") || (charttype === "StackedBars")) ? o.x : o.y];
+ return dojo.replace(tooltip, substitutions); // from Dojo 1.4 onward
+ //return tooltip.replace(/\{([^\}]+)\}/g, function(_, token){ return dojo.getObject(token, false, substitutions); }); // prior to Dojo 1.4
+ }
+ }else if(typeof tooltip == 'function'){
+ tooltipArgs.text = tooltip;
+ }
+ new dojox.charting.action2d.Tooltip(_chart, axisname, tooltipArgs);
+
+ // add highlighting, except for lines
+ if(charttype !== "Lines" && charttype !== "Hybrid-Lines"){
+ new dojox.charting.action2d.Highlight(_chart, axisname);
+ }
+
+ // record that this plot type is now created
+ plots[axistype][charttype] = true;
+ }
+
+ // extract the series values
+ var xvals = [];
+ var valen = store.series_data[i].length;
+ for(var j = 0; j < valen; j++){
+ var val = store.series_data[i][j];
+ xvals.push(val);
+ if(maxval === null || val > maxval){
+ maxval = val;
+ }
+ if(minval === null || val < minval){
+ minval = val;
+ }
+ }
+
+ // reverse the values if requested
+ if(reverse){
+ xvals.reverse();
+ }
+
+ var seriesargs = { plot: axistype + "-" + charttype };
+ if(store.series_linestyle[i]){
+ seriesargs.stroke = { style: store.series_linestyle[i] };
+ }
+
+ _chart.addSeries(store.series_name[i], xvals, seriesargs);
+ delete seriestoremove[store.series_name[i]];
+ }
+ }
+
+ // remove any series that are no longer needed
+ for(sname in seriestoremove){
+ _chart.removeSeries(sname);
+ }
+
+ // create axes
+ _chart.addAxis("independent", getIndependentAxisArgs(type, labels));
+ _chart.addAxis("dependent-primary", getDependentAxisArgs(type, "primary", minval, maxval));
+ _chart.addAxis("dependent-secondary", getDependentAxisArgs(type, "secondary", minval, maxval));
+
+ return _chart;
+ };
+
+ // set up a legend presentation
+ var setupLegend = function(/*DomNode*/domNode, /*Legend*/legend, /*Chart2D*/chart, /*Boolean*/horizontal){
+ // destroy any existing legend and recreate
+ var _legend = legend;
+
+ if(!_legend){
+ _legend = new dojox.charting.widget.Legend({ chart: chart, horizontal: horizontal }, domNode);
+ }else{
+ _legend.refresh();
+ }
+
+ return _legend;
+ };
+
+ // set up a grid presentation
+ var setupGrid = function(/*DomNode*/domNode, /*Object?*/grid, /*Object?*/store, /*String?*/query, /*String?*/queryOptions){
+ var _grid = grid || new dojox.grid.DataGrid({}, domNode);
+ _grid.startup();
+ _grid.setStore(store, query, queryOptions);
+
+ var structure = [];
+ for(var ser = 0; ser < store.series_name.length; ser++){
+ // only include series with grid=true and with some data values in
+ if(store.series_grid[ser] && (store.series_data[ser].length > 0)){
+ structure.push({ field: "data." + ser, name: store.series_name[ser], width: "auto", formatter: store.series_gridformatter[ser] });
+ }
+ }
+
+ _grid.setStructure(structure);
+
+ return _grid;
+ };
+
+ // set up a title presentation
+ var setupTitle = function(/*DomNode*/domNode, /*object*/store){
+ if(store.title){
+ domNode.innerHTML = store.title;
+ }
+ };
+
+ // set up a footer presentation
+ var setupFooter = function(/*DomNode*/domNode, /*object*/store){
+ if(store.footer){
+ domNode.innerHTML = store.footer;
+ }
+ };
+
+ // obtain a subfield from a field specifier which may contain
+ // multiple levels (eg, "child.foo[36].manacle")
+ var getSubfield = function(/*Object*/object, /*String*/field){
+ var result = object;
+
+ if(field){
+ var fragments = field.split(/[.\[\]]+/);
+ for(var frag = 0, l = fragments.length; frag < l; frag++){
+ if(result){
+ result = result[fragments[frag]];
+ }
+ }
+ }
+
+ return result;
+ };
+
+ dojo.declare("dojox.widget.DataPresentation", null, {
+ // summary:
+ //
+ // DataPresentation
+ //
+ // A widget that connects to a data store in a simple manner,
+ // and also provides some additional convenience mechanisms
+ // for connecting to common data sources without needing to
+ // explicitly construct a Dojo data store. The widget can then
+ // present the data in several forms: as a graphical chart,
+ // as a tabular grid, or as display panels presenting meta-data
+ // (title, creation information, etc) from the data. The
+ // widget can also create and manage several of these forms
+ // in one simple construction.
+ //
+ // Note: this is a first experimental draft and any/all details
+ // are subject to substantial change in later drafts.
+ //
+ // example:
+ //
+ // var pres = new dojox.data.DataPresentation("myChartNode", {
+ // type: "chart",
+ // url: "/data/mydata",
+ // gridNode: "myGridNode"
+ // });
+ //
+ // properties:
+ //
+ // store: Object
+ // Dojo data store used to supply data to be presented. This may
+ // be supplied on construction or created implicitly based on
+ // other construction parameters ('data', 'url').
+ //
+ // query: String
+ // Query to apply to the Dojo data store used to supply data to
+ // be presented.
+ //
+ // queryOptions: String
+ // Query options to apply to the Dojo data store used to supply
+ // data to be presented.
+ //
+ // data: Object
+ // Data to be presented. If supplied on construction this property
+ // will override any value supplied for the 'store' property.
+ //
+ // url: String
+ // URL to fetch data from in JSON format. If supplied on
+ // construction this property will override any values supplied
+ // for the 'store' and/or 'data' properties. Note that the data
+ // can also be comment-filtered JSON, although this will trigger
+ // a warning message in the console unless djConfig.useCommentedJson
+ // has been set to true.
+ //
+ // urlContent: Object
+ // Content to be passed to the URL when fetching data. If a URL has
+ // not been supplied, this value is ignored.
+ //
+ // urlError: function
+ // A function to be called if an error is encountered when fetching
+ // data from the supplied URL. This function will be supplied with
+ // two parameters exactly as the error function supplied to the
+ // dojo.xhrGet function. This function may be called multiple times
+ // if a refresh interval has been supplied.
+ //
+ // refreshInterval: Number
+ // the time interval in milliseconds after which the data supplied
+ // via the 'data' property or fetched from a URL via the 'url'
+ // property should be regularly refreshed. This property is
+ // ignored if neither the 'data' nor 'url' property has been
+ // supplied. If the refresh interval is zero, no regular refresh is done.
+ //
+ // refreshIntervalPending:
+ // the JavaScript set interval currently in progress, if any
+ //
+ // series: Array
+ // an array of objects describing the data series to be included
+ // in the data presentation. Each object may contain the
+ // following fields:
+ // datapoints: the name of the field from the source data which
+ // contains an array of the data points for this data series.
+ // If not supplied, the source data is assumed to be an array
+ // of data points to be used.
+ // field: the name of the field within each data point which
+ // contains the data for this data series. If not supplied,
+ // each data point is assumed to be the value for the series.
+ // name: a name for the series, used in the legend and grid headings
+ // namefield: the name of the field from the source data which
+ // contains the name the series, used in the legend and grid
+ // headings. If both name and namefield are supplied, name takes
+ // precedence. If neither are supplied, a default name is used.
+ // chart: true if the series should be included in a chart presentation (default: true)
+ // charttype: the type of presentation of the series in the chart, which can be
+ // "range", "line", "bar" (default: "bar")
+ // linestyle: the stroke style for lines (if applicable) (default: "Solid")
+ // axis: the dependant axis to which the series will be attached in the chart,
+ // which can be "primary" or "secondary"
+ // grid: true if the series should be included in a data grid presentation (default: true)
+ // gridformatter: an optional formatter to use for this series in the data grid
+ //
+ // a call-back function may alternatively be supplied. The function takes
+ // a single parameter, which will be the data (from the 'data' field or
+ // loaded from the value in the 'url' field), and should return the array
+ // of objects describing the data series to be included in the data
+ // presentation. This enables the series structures to be built dynamically
+ // after data load, and rebuilt if necessary on data refresh. The call-back
+ // function will be called each time new data is set, loaded or refreshed.
+ // A call-back function cannot be used if the data is supplied directly
+ // from a Dojo data store.
+ //
+ // type: String
+ // the type of presentation to be applied at the DOM attach point.
+ // This can be 'chart', 'legend', 'grid', 'title', 'footer'. The
+ // default type is 'chart'.
+ type: "chart",
+ //
+ // chartType: String
+ // the type of chart to display. This can be 'clusteredbars',
+ // 'areas', 'stackedcolumns', 'stackedbars', 'stackedareas',
+ // 'lines', 'hybrid'. The default type is 'bar'.
+ chartType: "clusteredBars",
+ //
+ // reverse: Boolean
+ // true if the chart independant axis should be reversed.
+ reverse: false,
+ //
+ // animate: Object
+ // if an object is supplied, then the chart bars or columns will animate
+ // into place. If the object contains a field 'duration' then the value
+ // supplied is the duration of the animation in milliseconds, otherwise
+ // a default duration is used. A boolean value true can alternatively be
+ // supplied to enable animation with the default duration.
+ // The default is null (no animation).
+ animate: null,
+ //
+ // labelMod: Integer
+ // the frequency of label annotations to be included on the
+ // independent axis. 1=every label. 0=no labels. The default is 1.
+ labelMod: 1,
+ //
+ // tooltip: String | Function
+ // a string pattern defining the tooltip text to be applied to chart
+ // data points, or a function which takes a single parameter and returns
+ // the tooltip text to be applied to chart data points. The string pattern
+ // will have the following substitutions applied:
+ // {0} - the type of chart element ('bar', 'surface', etc)
+ // {1} - the name of the data series
+ // {2} - the independent axis value at the tooltip data point
+ // {3} - the series value at the tooltip data point point
+ // The function, if supplied, will receive a single parameter exactly
+ // as per the dojox.charting.action2D.Tooltip class. The default value
+ // is to apply the default tooltip as defined by the
+ // dojox.charting.action2D.Tooltip class.
+ //
+ // legendHorizontal: Boolean | Number
+ // true if the legend should be rendered horizontally, or a number if
+ // the legend should be rendered as horizontal rows with that number of
+ // items in each row, or false if the legend should be rendered
+ // vertically (same as specifying 1). The default is true (legend
+ // rendered horizontally).
+ legendHorizontal: true,
+ //
+ // theme: String|Theme
+ // a theme to use for the chart, or the name of a theme.
+ //
+ // chartNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // chart presentation of the data. Supply only when a chart is
+ // required and the type is not 'chart'; when the type is
+ // 'chart' this property will be set to the widget attach point.
+ //
+ // legendNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // chart legend for the data. Supply only when a legend is
+ // required and the type is not 'legend'; when the type is
+ // 'legend' this property will be set to the widget attach point.
+ //
+ // gridNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // grid presentation of the data. Supply only when a grid is
+ // required and the type is not 'grid'; when the type is
+ // 'grid' this property will be set to the widget attach point.
+ //
+ // titleNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // title for the data. Supply only when a title is
+ // required and the type is not 'title'; when the type is
+ // 'title' this property will be set to the widget attach point.
+ //
+ // footerNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // footer presentation of the data. Supply only when a footer is
+ // required and the type is not 'footer'; when the type is
+ // 'footer' this property will be set to the widget attach point.
+ //
+ // chartWidget: Object
+ // the chart widget, if any
+ //
+ // legendWidget: Object
+ // the legend widget, if any
+ //
+ // gridWidget: Object
+ // the grid widget, if any
+
+ constructor: function(node, args){
+ // summary:
+ // Set up properties and initialize.
+ //
+ // arguments:
+ // node: DomNode
+ // The node to attach the data presentation to.
+ // kwArgs: Object (see above)
+
+ // apply arguments directly
+ dojo.mixin(this, args);
+
+ // store our DOM attach point
+ this.domNode = dojo.byId(node);
+
+ // also apply the DOM attach point as the node for the presentation type
+ this[this.type + "Node"] = this.domNode;
+
+ // load the theme if provided by name
+ if(typeof this.theme == 'string'){
+ this.theme = dojo.getObject(this.theme);
+ }
+
+ // resolve any the nodes that were supplied as ids
+ this.chartNode = dojo.byId(this.chartNode);
+ this.legendNode = dojo.byId(this.legendNode);
+ this.gridNode = dojo.byId(this.gridNode);
+ this.titleNode = dojo.byId(this.titleNode);
+ this.footerNode = dojo.byId(this.footerNode);
+
+ // we used to support a 'legendVertical' so for now
+ // at least maintain backward compatibility
+ if(this.legendVertical){
+ this.legendHorizontal = !this.legendVertical;
+ }
+
+ if(this.url){
+ this.setURL(null, null, this.refreshInterval);
+ }
+ else{
+ if(this.data){
+ this.setData(null, this.refreshInterval);
+ }
+ else{
+ this.setStore();
+ }
+ }
+ },
+
+ setURL: function(/*String?*/url, /*Object?*/ urlContent, /*Number?*/refreshInterval){
+ // summary:
+ // Sets the URL to fetch data from, with optional content
+ // supplied with the request, and an optional
+ // refresh interval in milliseconds (0=no refresh)
+
+ // if a refresh interval is supplied we will start a fresh
+ // refresh after storing the supplied url
+ if(refreshInterval){
+ this.cancelRefresh();
+ }
+
+ this.url = url || this.url;
+ this.urlContent = urlContent || this.urlContent;
+ this.refreshInterval = refreshInterval || this.refreshInterval;
+
+ var me = this;
+
+ dojo.xhrGet({
+ url: this.url,
+ content: this.urlContent,
+ handleAs: 'json-comment-optional',
+ load: function(response, ioArgs){
+ me.setData(response);
+ },
+ error: function(xhr, ioArgs){
+ if(me.urlError && (typeof me.urlError == "function")){
+ me.urlError(xhr, ioArgs);
+ }
+ }
+ });
+
+ if(refreshInterval && (this.refreshInterval > 0)){
+ this.refreshIntervalPending = setInterval(function(){
+ me.setURL();
+ }, this.refreshInterval);
+ }
+ },
+
+ setData: function(/*Object?*/data, /*Number?*/refreshInterval){
+ // summary:
+ // Sets the data to be presented, and an optional
+ // refresh interval in milliseconds (0=no refresh)
+
+ // if a refresh interval is supplied we will start a fresh
+ // refresh after storing the supplied data reference
+ if(refreshInterval){
+ this.cancelRefresh();
+ }
+
+ this.data = data || this.data;
+ this.refreshInterval = refreshInterval || this.refreshInterval;
+
+ // TODO if no 'series' property was provided, build one intelligently here
+ // (until that is done, a 'series' property must be supplied)
+
+ var _series = (typeof this.series == 'function') ? this.series(this.data) : this.series;
+
+ var datasets = [],
+ series_data = [],
+ series_name = [],
+ series_chart = [],
+ series_charttype = [],
+ series_linestyle = [],
+ series_axis = [],
+ series_grid = [],
+ series_gridformatter = [],
+ maxlen = 0;
+
+ // identify the dataset arrays in which series values can be found
+ for(var ser = 0; ser < _series.length; ser++){
+ datasets[ser] = getSubfield(this.data, _series[ser].datapoints);
+ if(datasets[ser] && (datasets[ser].length > maxlen)){
+ maxlen = datasets[ser].length;
+ }
+
+ series_data[ser] = [];
+ // name can be specified in series structure, or by field in series structure, otherwise use a default
+ series_name[ser] = _series[ser].name || (_series[ser].namefield ? getSubfield(this.data, _series[ser].namefield) : null) || ("series " + ser);
+ series_chart[ser] = (_series[ser].chart !== false);
+ series_charttype[ser] = _series[ser].charttype || "bar";
+ series_linestyle[ser] = _series[ser].linestyle;
+ series_axis[ser] = _series[ser].axis || "primary";
+ series_grid[ser] = (_series[ser].grid !== false);
+ series_gridformatter[ser] = _series[ser].gridformatter;
+ }
+
+ // create an array of data points by sampling the series
+ // and an array of series arrays by collecting the series
+ // each data point has an 'index' item containing a sequence number
+ // and items named "data.0", "data.1", ... containing the series samples
+ // and the first data point also has items named "name.0", "name.1", ... containing the series names
+ // and items named "series.0", "series.1", ... containing arrays with the complete series in
+ var point, datapoint, datavalue, fdatavalue;
+ var datapoints = [];
+
+ for(point = 0; point < maxlen; point++){
+ datapoint = { index: point };
+ for(ser = 0; ser < _series.length; ser++){
+ if(datasets[ser] && (datasets[ser].length > point)){
+ datavalue = getSubfield(datasets[ser][point], _series[ser].field);
+
+ if(series_chart[ser]){
+ // convert the data value to a float if possible
+ fdatavalue = parseFloat(datavalue);
+ if(!isNaN(fdatavalue)){
+ datavalue = fdatavalue;
+ }
+ }
+
+ datapoint["data." + ser] = datavalue;
+ series_data[ser].push(datavalue);
+ }
+ }
+ datapoints.push(datapoint);
+ }
+
+ if(maxlen <= 0){
+ datapoints.push({index: 0});
+ }
+
+ // now build a prepared store from the data points we've constructed
+ var store = new dojo.data.ItemFileWriteStore({ data: { identifier: 'index', items: datapoints }});
+ if(this.data.title){
+ store.title = this.data.title;
+ }
+ if(this.data.footer){
+ store.footer = this.data.footer;
+ }
+
+ store.series_data = series_data;
+ store.series_name = series_name;
+ store.series_chart = series_chart;
+ store.series_charttype = series_charttype;
+ store.series_linestyle = series_linestyle;
+ store.series_axis = series_axis;
+ store.series_grid = series_grid;
+ store.series_gridformatter = series_gridformatter;
+
+ this.setPreparedStore(store);
+
+ if(refreshInterval && (this.refreshInterval > 0)){
+ var me = this;
+ this.refreshIntervalPending = setInterval(function(){
+ me.setData();
+ }, this.refreshInterval);
+ }
+ },
+
+ refresh: function(){
+ // summary:
+ // If a URL or data has been supplied, refreshes the
+ // presented data from the URL or data. If a refresh
+ // interval is also set, the periodic refresh is
+ // restarted. If a URL or data was not supplied, this
+ // method has no effect.
+ if(this.url){
+ this.setURL(this.url, this.urlContent, this.refreshInterval);
+ }else if(this.data){
+ this.setData(this.data, this.refreshInterval);
+ }
+ },
+
+ cancelRefresh: function(){
+ // summary:
+ // Cancels any and all outstanding data refreshes
+ if(this.refreshIntervalPending){
+ // cancel existing refresh
+ clearInterval(this.refreshIntervalPending);
+ this.refreshIntervalPending = undefined;
+ }
+ },
+
+ setStore: function(/*Object?*/store, /*String?*/query, /*Object?*/queryOptions){
+ // FIXME build a prepared store properly -- this requires too tight a convention to be followed to be useful
+ this.setPreparedStore(store, query, queryOptions);
+ },
+
+ setPreparedStore: function(/*Object?*/store, /*String?*/query, /*Object?*/queryOptions){
+ // summary:
+ // Sets the store and query.
+ //
+ this.preparedstore = store || this.store;
+ this.query = query || this.query;
+ this.queryOptions = queryOptions || this.queryOptions;
+
+ if(this.preparedstore){
+ if(this.chartNode){
+ this.chartWidget = setupChart(this.chartNode, this.chartWidget, this.chartType, this.reverse, this.animate, this.labelMod, this.theme, this.tooltip, this.preparedstore, this.query, this,queryOptions);
+ this.renderChartWidget();
+ }
+ if(this.legendNode){
+ this.legendWidget = setupLegend(this.legendNode, this.legendWidget, this.chartWidget, this.legendHorizontal);
+ }
+ if(this.gridNode){
+ this.gridWidget = setupGrid(this.gridNode, this.gridWidget, this.preparedstore, this.query, this.queryOptions);
+ this.renderGridWidget();
+ }
+ if(this.titleNode){
+ setupTitle(this.titleNode, this.preparedstore);
+ }
+ if(this.footerNode){
+ setupFooter(this.footerNode, this.preparedstore);
+ }
+ }
+ },
+
+ renderChartWidget: function(){
+ // summary:
+ // Renders the chart widget (if any). This method is
+ // called whenever a chart widget is created or
+ // configured, and may be connected to.
+ if(this.chartWidget){
+ this.chartWidget.render();
+ }
+ },
+
+ renderGridWidget: function(){
+ // summary:
+ // Renders the grid widget (if any). This method is
+ // called whenever a grid widget is created or
+ // configured, and may be connected to.
+ if(this.gridWidget){
+ this.gridWidget.render();
+ }
+ },
+
+ getChartWidget: function(){
+ // summary:
+ // Returns the chart widget (if any) created if the type
+ // is "chart" or the "chartNode" property was supplied.
+ return this.chartWidget;
+ },
+
+ getGridWidget: function(){
+ // summary:
+ // Returns the grid widget (if any) created if the type
+ // is "grid" or the "gridNode" property was supplied.
+ return this.gridWidget;
+ },
+
+ destroy: function(){
+ // summary:
+ // Destroys the widget and all components and resources.
+
+ // cancel any outstanding refresh requests
+ this.cancelRefresh();
+
+ if(this.chartWidget){
+ this.chartWidget.destroy();
+ delete this.chartWidget;
+ }
+
+ if(this.legendWidget){
+ // no legend.destroy()
+ delete this.legendWidget;
+ }
+
+ if(this.gridWidget){
+ // no grid.destroy()
+ delete this.gridWidget;
+ }
+
+ if(this.chartNode){
+ this.chartNode.innerHTML = "";
+ }
+
+ if(this.legendNode){
+ this.legendNode.innerHTML = "";
+ }
+
+ if(this.gridNode){
+ this.gridNode.innerHTML = "";
+ }
+
+ if(this.titleNode){
+ this.titleNode.innerHTML = "";
+ }
+
+ if(this.footerNode){
+ this.footerNode.innerHTML = "";
+ }
+ }
+
+ });
+
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/widget/DataPresentation.xd.js b/js/dojo-1.6/dojox/widget/DataPresentation.xd.js new file mode 100644 index 0000000..ec8d0d5 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DataPresentation.xd.js @@ -0,0 +1,919 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.DataPresentation"],
+["require", "dojox.grid.DataGrid"],
+["require", "dojox.charting.Chart2D"],
+["require", "dojox.charting.widget.Legend"],
+["require", "dojox.charting.action2d.Tooltip"],
+["require", "dojox.charting.action2d.Highlight"],
+["require", "dojo.colors"],
+["require", "dojo.data.ItemFileWriteStore"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.DataPresentation"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DataPresentation"] = true;
+dojo.provide("dojox.widget.DataPresentation");
+dojo.experimental("dojox.widget.DataPresentation");
+
+dojo.require("dojox.grid.DataGrid");
+dojo.require("dojox.charting.Chart2D");
+dojo.require("dojox.charting.widget.Legend");
+dojo.require("dojox.charting.action2d.Tooltip");
+dojo.require("dojox.charting.action2d.Highlight");
+dojo.require("dojo.colors");
+dojo.require("dojo.data.ItemFileWriteStore");
+
+(function(){
+
+ // sort out the labels for the independent axis of the chart
+ var getLabels = function(range, labelMod, charttype, domNode){
+
+ // prepare labels for the independent axis
+ var labels = [];
+ // add empty label, hack
+ labels[0] = {value: 0, text: ''};
+
+ var nlabels = range.length;
+
+ // auto-set labelMod for horizontal charts if the labels will otherwise collide
+ if((charttype !== "ClusteredBars") && (charttype !== "StackedBars")){
+ var cwid = domNode.offsetWidth;
+ var tmp = ("" + range[0]).length * range.length * 7; // *assume* 7 pixels width per character ( was 9 )
+
+ if(labelMod == 1){
+ for(var z = 1; z < 500; ++z){
+ if((tmp / z) < cwid){
+ break;
+ }
+ ++labelMod;
+ }
+ }
+ }
+
+ // now set the labels
+ for(var i = 0; i < nlabels; i++){
+ //sparse labels
+ labels.push({
+ value: i + 1,
+ text: (!labelMod || i % labelMod) ? "" : range[i]
+ });
+ }
+
+ // add empty label again, hack
+ labels.push({value: nlabels + 1, text:''});
+
+ return labels;
+ };
+
+ // get the configuration of an independent axis for the chart
+ var getIndependentAxisArgs = function(charttype, labels){
+
+ var args = { vertical: false, labels: labels, min: 0, max: labels.length-1, majorTickStep: 1, minorTickStep: 1 };
+
+ // clustered or stacked bars have a vertical independent axis
+ if((charttype === "ClusteredBars") || (charttype === "StackedBars")){
+ args.vertical = true;
+ }
+
+ // lines, areas and stacked areas don't need the extra slots at each end
+ if((charttype === "Lines") || (charttype === "Areas") || (charttype === "StackedAreas")){
+ args.min++;
+ args.max--;
+ }
+
+ return args;
+ };
+
+ // get the configuration of a dependent axis for the chart
+ var getDependentAxisArgs = function(charttype, axistype, minval, maxval){
+
+ var args = { vertical: true, fixLower: "major", fixUpper: "major", natural: true };
+
+ // secondary dependent axis is not left-bottom
+ if(axistype === "secondary"){
+ args.leftBottom = false;
+ }
+
+ // clustered or stacked bars have horizontal dependent axes
+ if((charttype === "ClusteredBars") || (charttype === "StackedBars")){
+ args.vertical = false;
+ }
+
+ // ensure axis does not "collapse" for flat series
+ if(minval == maxval){
+ args.min = minval - 1;
+ args.max = maxval + 1;
+ }
+
+ return args;
+ };
+
+ // get the configuration of a plot for the chart
+ var getPlotArgs = function(charttype, axistype, animate){
+
+ var args = { type: charttype, hAxis: "independent", vAxis: "dependent-" + axistype, gap: 4, lines: false, areas: false, markers: false };
+
+ // clustered or stacked bars have horizontal dependent axes
+ if((charttype === "ClusteredBars") || (charttype === "StackedBars")){
+ args.hAxis = args.vAxis;
+ args.vAxis = "independent";
+ }
+
+ // turn on lines for Lines, Areas and StackedAreas
+ if((charttype === "Lines") || (charttype === "Hybrid-Lines") || (charttype === "Areas") || (charttype === "StackedAreas")){
+ args.lines = true;
+ }
+
+ // turn on areas for Areas and StackedAreas
+ if((charttype === "Areas") || (charttype === "StackedAreas")){
+ args.areas = true;
+ }
+
+ // turn on markers and shadow for Lines
+ if(charttype === "Lines"){
+ args.markers = true;
+ }
+
+ // turn on shadow for Hybrid-Lines
+ // also, Hybrid-Lines is not a true chart type: use Lines for the actual plot
+ if(charttype === "Hybrid-Lines"){
+ args.shadows = {dx: 2, dy: 2, dw: 2};
+ args.type = "Lines";
+ }
+
+ // also, Hybrid-ClusteredColumns is not a true chart type: use ClusteredColumns for the actual plot
+ if(charttype === "Hybrid-ClusteredColumns"){
+ args.type = "ClusteredColumns";
+ }
+
+ // enable animation on the plot if animation is requested
+ if(animate){
+ args.animate = animate;
+ }
+
+ return args;
+ };
+
+ // set up a chart presentation
+ var setupChart = function(/*DomNode*/domNode, /*Object?*/chart, /*String*/type, /*Boolean*/reverse, /*Object*/animate, /*Integer*/labelMod, /*String*/theme, /*String*/tooltip, /*Object?*/store, /*String?*/query, /*String?*/queryOptions){
+ var _chart = chart;
+
+ if(!_chart){
+ domNode.innerHTML = ""; // any other content in the node disrupts the chart rendering
+ _chart = new dojox.charting.Chart2D(domNode);
+ }
+
+ // set the theme
+ if(theme){
+
+ // workaround for a theme bug: its _clone method
+ // does not transfer the markers, so we repair
+ // that omission here
+ // FIXME this should be removed once the theme bug is fixed
+ theme._clone = function(){
+ var result = new dojox.charting.Theme({
+ chart: this.chart,
+ plotarea: this.plotarea,
+ axis: this.axis,
+ series: this.series,
+ marker: this.marker,
+ antiAlias: this.antiAlias,
+ assignColors: this.assignColors,
+ assignMarkers: this.assigneMarkers,
+ colors: dojo.delegate(this.colors)
+ });
+
+ result.markers = this.markers;
+ result._buildMarkerArray();
+
+ return result;
+ };
+
+ _chart.setTheme(theme);
+ }
+
+ var range = store.series_data[0].slice(0);
+
+ // reverse the labels if requested
+ if(reverse){
+ range.reverse();
+ }
+
+ var labels = getLabels(range, labelMod, type, domNode);
+
+ // collect details of whether primary and/or secondary axes are required
+ // and what plots we have instantiated using each type of axis
+ var plots = {};
+
+ // collect maximum and minimum data values
+ var maxval = null;
+ var minval = null;
+
+ var seriestoremove = {};
+ for(var sname in _chart.runs){
+ seriestoremove[sname] = true;
+ }
+
+ // set x values & max data value
+ var nseries = store.series_name.length;
+ for(var i = 0; i < nseries; i++){
+ // only include series with chart=true and with some data values in
+ if(store.series_chart[i] && (store.series_data[i].length > 0)){
+
+ var charttype = type;
+ var axistype = store.series_axis[i];
+
+ if(charttype == "Hybrid"){
+ if(store.series_charttype[i] == 'line'){
+ charttype = "Hybrid-Lines";
+ }else{
+ charttype = "Hybrid-ClusteredColumns";
+ }
+ }
+
+ // ensure we have recorded that we are using this axis type
+ if(!plots[axistype]){
+ plots[axistype] = {};
+ }
+
+ // ensure we have the correct type of plot for this series
+ if(!plots[axistype][charttype]){
+ var axisname = axistype + "-" + charttype;
+
+ // create the plot and enable tooltips
+ _chart.addPlot(axisname, getPlotArgs(charttype, axistype, animate));
+
+ var tooltipArgs = {};
+ if(typeof tooltip == 'string'){
+ tooltipArgs.text = function(o){
+ var substitutions = [o.element, o.run.name, range[o.index], ((charttype === "ClusteredBars") || (charttype === "StackedBars")) ? o.x : o.y];
+ return dojo.replace(tooltip, substitutions); // from Dojo 1.4 onward
+ //return tooltip.replace(/\{([^\}]+)\}/g, function(_, token){ return dojo.getObject(token, false, substitutions); }); // prior to Dojo 1.4
+ }
+ }else if(typeof tooltip == 'function'){
+ tooltipArgs.text = tooltip;
+ }
+ new dojox.charting.action2d.Tooltip(_chart, axisname, tooltipArgs);
+
+ // add highlighting, except for lines
+ if(charttype !== "Lines" && charttype !== "Hybrid-Lines"){
+ new dojox.charting.action2d.Highlight(_chart, axisname);
+ }
+
+ // record that this plot type is now created
+ plots[axistype][charttype] = true;
+ }
+
+ // extract the series values
+ var xvals = [];
+ var valen = store.series_data[i].length;
+ for(var j = 0; j < valen; j++){
+ var val = store.series_data[i][j];
+ xvals.push(val);
+ if(maxval === null || val > maxval){
+ maxval = val;
+ }
+ if(minval === null || val < minval){
+ minval = val;
+ }
+ }
+
+ // reverse the values if requested
+ if(reverse){
+ xvals.reverse();
+ }
+
+ var seriesargs = { plot: axistype + "-" + charttype };
+ if(store.series_linestyle[i]){
+ seriesargs.stroke = { style: store.series_linestyle[i] };
+ }
+
+ _chart.addSeries(store.series_name[i], xvals, seriesargs);
+ delete seriestoremove[store.series_name[i]];
+ }
+ }
+
+ // remove any series that are no longer needed
+ for(sname in seriestoremove){
+ _chart.removeSeries(sname);
+ }
+
+ // create axes
+ _chart.addAxis("independent", getIndependentAxisArgs(type, labels));
+ _chart.addAxis("dependent-primary", getDependentAxisArgs(type, "primary", minval, maxval));
+ _chart.addAxis("dependent-secondary", getDependentAxisArgs(type, "secondary", minval, maxval));
+
+ return _chart;
+ };
+
+ // set up a legend presentation
+ var setupLegend = function(/*DomNode*/domNode, /*Legend*/legend, /*Chart2D*/chart, /*Boolean*/horizontal){
+ // destroy any existing legend and recreate
+ var _legend = legend;
+
+ if(!_legend){
+ _legend = new dojox.charting.widget.Legend({ chart: chart, horizontal: horizontal }, domNode);
+ }else{
+ _legend.refresh();
+ }
+
+ return _legend;
+ };
+
+ // set up a grid presentation
+ var setupGrid = function(/*DomNode*/domNode, /*Object?*/grid, /*Object?*/store, /*String?*/query, /*String?*/queryOptions){
+ var _grid = grid || new dojox.grid.DataGrid({}, domNode);
+ _grid.startup();
+ _grid.setStore(store, query, queryOptions);
+
+ var structure = [];
+ for(var ser = 0; ser < store.series_name.length; ser++){
+ // only include series with grid=true and with some data values in
+ if(store.series_grid[ser] && (store.series_data[ser].length > 0)){
+ structure.push({ field: "data." + ser, name: store.series_name[ser], width: "auto", formatter: store.series_gridformatter[ser] });
+ }
+ }
+
+ _grid.setStructure(structure);
+
+ return _grid;
+ };
+
+ // set up a title presentation
+ var setupTitle = function(/*DomNode*/domNode, /*object*/store){
+ if(store.title){
+ domNode.innerHTML = store.title;
+ }
+ };
+
+ // set up a footer presentation
+ var setupFooter = function(/*DomNode*/domNode, /*object*/store){
+ if(store.footer){
+ domNode.innerHTML = store.footer;
+ }
+ };
+
+ // obtain a subfield from a field specifier which may contain
+ // multiple levels (eg, "child.foo[36].manacle")
+ var getSubfield = function(/*Object*/object, /*String*/field){
+ var result = object;
+
+ if(field){
+ var fragments = field.split(/[.\[\]]+/);
+ for(var frag = 0, l = fragments.length; frag < l; frag++){
+ if(result){
+ result = result[fragments[frag]];
+ }
+ }
+ }
+
+ return result;
+ };
+
+ dojo.declare("dojox.widget.DataPresentation", null, {
+ // summary:
+ //
+ // DataPresentation
+ //
+ // A widget that connects to a data store in a simple manner,
+ // and also provides some additional convenience mechanisms
+ // for connecting to common data sources without needing to
+ // explicitly construct a Dojo data store. The widget can then
+ // present the data in several forms: as a graphical chart,
+ // as a tabular grid, or as display panels presenting meta-data
+ // (title, creation information, etc) from the data. The
+ // widget can also create and manage several of these forms
+ // in one simple construction.
+ //
+ // Note: this is a first experimental draft and any/all details
+ // are subject to substantial change in later drafts.
+ //
+ // example:
+ //
+ // var pres = new dojox.data.DataPresentation("myChartNode", {
+ // type: "chart",
+ // url: "/data/mydata",
+ // gridNode: "myGridNode"
+ // });
+ //
+ // properties:
+ //
+ // store: Object
+ // Dojo data store used to supply data to be presented. This may
+ // be supplied on construction or created implicitly based on
+ // other construction parameters ('data', 'url').
+ //
+ // query: String
+ // Query to apply to the Dojo data store used to supply data to
+ // be presented.
+ //
+ // queryOptions: String
+ // Query options to apply to the Dojo data store used to supply
+ // data to be presented.
+ //
+ // data: Object
+ // Data to be presented. If supplied on construction this property
+ // will override any value supplied for the 'store' property.
+ //
+ // url: String
+ // URL to fetch data from in JSON format. If supplied on
+ // construction this property will override any values supplied
+ // for the 'store' and/or 'data' properties. Note that the data
+ // can also be comment-filtered JSON, although this will trigger
+ // a warning message in the console unless djConfig.useCommentedJson
+ // has been set to true.
+ //
+ // urlContent: Object
+ // Content to be passed to the URL when fetching data. If a URL has
+ // not been supplied, this value is ignored.
+ //
+ // urlError: function
+ // A function to be called if an error is encountered when fetching
+ // data from the supplied URL. This function will be supplied with
+ // two parameters exactly as the error function supplied to the
+ // dojo.xhrGet function. This function may be called multiple times
+ // if a refresh interval has been supplied.
+ //
+ // refreshInterval: Number
+ // the time interval in milliseconds after which the data supplied
+ // via the 'data' property or fetched from a URL via the 'url'
+ // property should be regularly refreshed. This property is
+ // ignored if neither the 'data' nor 'url' property has been
+ // supplied. If the refresh interval is zero, no regular refresh is done.
+ //
+ // refreshIntervalPending:
+ // the JavaScript set interval currently in progress, if any
+ //
+ // series: Array
+ // an array of objects describing the data series to be included
+ // in the data presentation. Each object may contain the
+ // following fields:
+ // datapoints: the name of the field from the source data which
+ // contains an array of the data points for this data series.
+ // If not supplied, the source data is assumed to be an array
+ // of data points to be used.
+ // field: the name of the field within each data point which
+ // contains the data for this data series. If not supplied,
+ // each data point is assumed to be the value for the series.
+ // name: a name for the series, used in the legend and grid headings
+ // namefield: the name of the field from the source data which
+ // contains the name the series, used in the legend and grid
+ // headings. If both name and namefield are supplied, name takes
+ // precedence. If neither are supplied, a default name is used.
+ // chart: true if the series should be included in a chart presentation (default: true)
+ // charttype: the type of presentation of the series in the chart, which can be
+ // "range", "line", "bar" (default: "bar")
+ // linestyle: the stroke style for lines (if applicable) (default: "Solid")
+ // axis: the dependant axis to which the series will be attached in the chart,
+ // which can be "primary" or "secondary"
+ // grid: true if the series should be included in a data grid presentation (default: true)
+ // gridformatter: an optional formatter to use for this series in the data grid
+ //
+ // a call-back function may alternatively be supplied. The function takes
+ // a single parameter, which will be the data (from the 'data' field or
+ // loaded from the value in the 'url' field), and should return the array
+ // of objects describing the data series to be included in the data
+ // presentation. This enables the series structures to be built dynamically
+ // after data load, and rebuilt if necessary on data refresh. The call-back
+ // function will be called each time new data is set, loaded or refreshed.
+ // A call-back function cannot be used if the data is supplied directly
+ // from a Dojo data store.
+ //
+ // type: String
+ // the type of presentation to be applied at the DOM attach point.
+ // This can be 'chart', 'legend', 'grid', 'title', 'footer'. The
+ // default type is 'chart'.
+ type: "chart",
+ //
+ // chartType: String
+ // the type of chart to display. This can be 'clusteredbars',
+ // 'areas', 'stackedcolumns', 'stackedbars', 'stackedareas',
+ // 'lines', 'hybrid'. The default type is 'bar'.
+ chartType: "clusteredBars",
+ //
+ // reverse: Boolean
+ // true if the chart independant axis should be reversed.
+ reverse: false,
+ //
+ // animate: Object
+ // if an object is supplied, then the chart bars or columns will animate
+ // into place. If the object contains a field 'duration' then the value
+ // supplied is the duration of the animation in milliseconds, otherwise
+ // a default duration is used. A boolean value true can alternatively be
+ // supplied to enable animation with the default duration.
+ // The default is null (no animation).
+ animate: null,
+ //
+ // labelMod: Integer
+ // the frequency of label annotations to be included on the
+ // independent axis. 1=every label. 0=no labels. The default is 1.
+ labelMod: 1,
+ //
+ // tooltip: String | Function
+ // a string pattern defining the tooltip text to be applied to chart
+ // data points, or a function which takes a single parameter and returns
+ // the tooltip text to be applied to chart data points. The string pattern
+ // will have the following substitutions applied:
+ // {0} - the type of chart element ('bar', 'surface', etc)
+ // {1} - the name of the data series
+ // {2} - the independent axis value at the tooltip data point
+ // {3} - the series value at the tooltip data point point
+ // The function, if supplied, will receive a single parameter exactly
+ // as per the dojox.charting.action2D.Tooltip class. The default value
+ // is to apply the default tooltip as defined by the
+ // dojox.charting.action2D.Tooltip class.
+ //
+ // legendHorizontal: Boolean | Number
+ // true if the legend should be rendered horizontally, or a number if
+ // the legend should be rendered as horizontal rows with that number of
+ // items in each row, or false if the legend should be rendered
+ // vertically (same as specifying 1). The default is true (legend
+ // rendered horizontally).
+ legendHorizontal: true,
+ //
+ // theme: String|Theme
+ // a theme to use for the chart, or the name of a theme.
+ //
+ // chartNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // chart presentation of the data. Supply only when a chart is
+ // required and the type is not 'chart'; when the type is
+ // 'chart' this property will be set to the widget attach point.
+ //
+ // legendNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // chart legend for the data. Supply only when a legend is
+ // required and the type is not 'legend'; when the type is
+ // 'legend' this property will be set to the widget attach point.
+ //
+ // gridNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // grid presentation of the data. Supply only when a grid is
+ // required and the type is not 'grid'; when the type is
+ // 'grid' this property will be set to the widget attach point.
+ //
+ // titleNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // title for the data. Supply only when a title is
+ // required and the type is not 'title'; when the type is
+ // 'title' this property will be set to the widget attach point.
+ //
+ // footerNode: String|DomNode
+ // an optional DOM node or the id of a DOM node to receive a
+ // footer presentation of the data. Supply only when a footer is
+ // required and the type is not 'footer'; when the type is
+ // 'footer' this property will be set to the widget attach point.
+ //
+ // chartWidget: Object
+ // the chart widget, if any
+ //
+ // legendWidget: Object
+ // the legend widget, if any
+ //
+ // gridWidget: Object
+ // the grid widget, if any
+
+ constructor: function(node, args){
+ // summary:
+ // Set up properties and initialize.
+ //
+ // arguments:
+ // node: DomNode
+ // The node to attach the data presentation to.
+ // kwArgs: Object (see above)
+
+ // apply arguments directly
+ dojo.mixin(this, args);
+
+ // store our DOM attach point
+ this.domNode = dojo.byId(node);
+
+ // also apply the DOM attach point as the node for the presentation type
+ this[this.type + "Node"] = this.domNode;
+
+ // load the theme if provided by name
+ if(typeof this.theme == 'string'){
+ this.theme = dojo.getObject(this.theme);
+ }
+
+ // resolve any the nodes that were supplied as ids
+ this.chartNode = dojo.byId(this.chartNode);
+ this.legendNode = dojo.byId(this.legendNode);
+ this.gridNode = dojo.byId(this.gridNode);
+ this.titleNode = dojo.byId(this.titleNode);
+ this.footerNode = dojo.byId(this.footerNode);
+
+ // we used to support a 'legendVertical' so for now
+ // at least maintain backward compatibility
+ if(this.legendVertical){
+ this.legendHorizontal = !this.legendVertical;
+ }
+
+ if(this.url){
+ this.setURL(null, null, this.refreshInterval);
+ }
+ else{
+ if(this.data){
+ this.setData(null, this.refreshInterval);
+ }
+ else{
+ this.setStore();
+ }
+ }
+ },
+
+ setURL: function(/*String?*/url, /*Object?*/ urlContent, /*Number?*/refreshInterval){
+ // summary:
+ // Sets the URL to fetch data from, with optional content
+ // supplied with the request, and an optional
+ // refresh interval in milliseconds (0=no refresh)
+
+ // if a refresh interval is supplied we will start a fresh
+ // refresh after storing the supplied url
+ if(refreshInterval){
+ this.cancelRefresh();
+ }
+
+ this.url = url || this.url;
+ this.urlContent = urlContent || this.urlContent;
+ this.refreshInterval = refreshInterval || this.refreshInterval;
+
+ var me = this;
+
+ dojo.xhrGet({
+ url: this.url,
+ content: this.urlContent,
+ handleAs: 'json-comment-optional',
+ load: function(response, ioArgs){
+ me.setData(response);
+ },
+ error: function(xhr, ioArgs){
+ if(me.urlError && (typeof me.urlError == "function")){
+ me.urlError(xhr, ioArgs);
+ }
+ }
+ });
+
+ if(refreshInterval && (this.refreshInterval > 0)){
+ this.refreshIntervalPending = setInterval(function(){
+ me.setURL();
+ }, this.refreshInterval);
+ }
+ },
+
+ setData: function(/*Object?*/data, /*Number?*/refreshInterval){
+ // summary:
+ // Sets the data to be presented, and an optional
+ // refresh interval in milliseconds (0=no refresh)
+
+ // if a refresh interval is supplied we will start a fresh
+ // refresh after storing the supplied data reference
+ if(refreshInterval){
+ this.cancelRefresh();
+ }
+
+ this.data = data || this.data;
+ this.refreshInterval = refreshInterval || this.refreshInterval;
+
+ // TODO if no 'series' property was provided, build one intelligently here
+ // (until that is done, a 'series' property must be supplied)
+
+ var _series = (typeof this.series == 'function') ? this.series(this.data) : this.series;
+
+ var datasets = [],
+ series_data = [],
+ series_name = [],
+ series_chart = [],
+ series_charttype = [],
+ series_linestyle = [],
+ series_axis = [],
+ series_grid = [],
+ series_gridformatter = [],
+ maxlen = 0;
+
+ // identify the dataset arrays in which series values can be found
+ for(var ser = 0; ser < _series.length; ser++){
+ datasets[ser] = getSubfield(this.data, _series[ser].datapoints);
+ if(datasets[ser] && (datasets[ser].length > maxlen)){
+ maxlen = datasets[ser].length;
+ }
+
+ series_data[ser] = [];
+ // name can be specified in series structure, or by field in series structure, otherwise use a default
+ series_name[ser] = _series[ser].name || (_series[ser].namefield ? getSubfield(this.data, _series[ser].namefield) : null) || ("series " + ser);
+ series_chart[ser] = (_series[ser].chart !== false);
+ series_charttype[ser] = _series[ser].charttype || "bar";
+ series_linestyle[ser] = _series[ser].linestyle;
+ series_axis[ser] = _series[ser].axis || "primary";
+ series_grid[ser] = (_series[ser].grid !== false);
+ series_gridformatter[ser] = _series[ser].gridformatter;
+ }
+
+ // create an array of data points by sampling the series
+ // and an array of series arrays by collecting the series
+ // each data point has an 'index' item containing a sequence number
+ // and items named "data.0", "data.1", ... containing the series samples
+ // and the first data point also has items named "name.0", "name.1", ... containing the series names
+ // and items named "series.0", "series.1", ... containing arrays with the complete series in
+ var point, datapoint, datavalue, fdatavalue;
+ var datapoints = [];
+
+ for(point = 0; point < maxlen; point++){
+ datapoint = { index: point };
+ for(ser = 0; ser < _series.length; ser++){
+ if(datasets[ser] && (datasets[ser].length > point)){
+ datavalue = getSubfield(datasets[ser][point], _series[ser].field);
+
+ if(series_chart[ser]){
+ // convert the data value to a float if possible
+ fdatavalue = parseFloat(datavalue);
+ if(!isNaN(fdatavalue)){
+ datavalue = fdatavalue;
+ }
+ }
+
+ datapoint["data." + ser] = datavalue;
+ series_data[ser].push(datavalue);
+ }
+ }
+ datapoints.push(datapoint);
+ }
+
+ if(maxlen <= 0){
+ datapoints.push({index: 0});
+ }
+
+ // now build a prepared store from the data points we've constructed
+ var store = new dojo.data.ItemFileWriteStore({ data: { identifier: 'index', items: datapoints }});
+ if(this.data.title){
+ store.title = this.data.title;
+ }
+ if(this.data.footer){
+ store.footer = this.data.footer;
+ }
+
+ store.series_data = series_data;
+ store.series_name = series_name;
+ store.series_chart = series_chart;
+ store.series_charttype = series_charttype;
+ store.series_linestyle = series_linestyle;
+ store.series_axis = series_axis;
+ store.series_grid = series_grid;
+ store.series_gridformatter = series_gridformatter;
+
+ this.setPreparedStore(store);
+
+ if(refreshInterval && (this.refreshInterval > 0)){
+ var me = this;
+ this.refreshIntervalPending = setInterval(function(){
+ me.setData();
+ }, this.refreshInterval);
+ }
+ },
+
+ refresh: function(){
+ // summary:
+ // If a URL or data has been supplied, refreshes the
+ // presented data from the URL or data. If a refresh
+ // interval is also set, the periodic refresh is
+ // restarted. If a URL or data was not supplied, this
+ // method has no effect.
+ if(this.url){
+ this.setURL(this.url, this.urlContent, this.refreshInterval);
+ }else if(this.data){
+ this.setData(this.data, this.refreshInterval);
+ }
+ },
+
+ cancelRefresh: function(){
+ // summary:
+ // Cancels any and all outstanding data refreshes
+ if(this.refreshIntervalPending){
+ // cancel existing refresh
+ clearInterval(this.refreshIntervalPending);
+ this.refreshIntervalPending = undefined;
+ }
+ },
+
+ setStore: function(/*Object?*/store, /*String?*/query, /*Object?*/queryOptions){
+ // FIXME build a prepared store properly -- this requires too tight a convention to be followed to be useful
+ this.setPreparedStore(store, query, queryOptions);
+ },
+
+ setPreparedStore: function(/*Object?*/store, /*String?*/query, /*Object?*/queryOptions){
+ // summary:
+ // Sets the store and query.
+ //
+ this.preparedstore = store || this.store;
+ this.query = query || this.query;
+ this.queryOptions = queryOptions || this.queryOptions;
+
+ if(this.preparedstore){
+ if(this.chartNode){
+ this.chartWidget = setupChart(this.chartNode, this.chartWidget, this.chartType, this.reverse, this.animate, this.labelMod, this.theme, this.tooltip, this.preparedstore, this.query, this,queryOptions);
+ this.renderChartWidget();
+ }
+ if(this.legendNode){
+ this.legendWidget = setupLegend(this.legendNode, this.legendWidget, this.chartWidget, this.legendHorizontal);
+ }
+ if(this.gridNode){
+ this.gridWidget = setupGrid(this.gridNode, this.gridWidget, this.preparedstore, this.query, this.queryOptions);
+ this.renderGridWidget();
+ }
+ if(this.titleNode){
+ setupTitle(this.titleNode, this.preparedstore);
+ }
+ if(this.footerNode){
+ setupFooter(this.footerNode, this.preparedstore);
+ }
+ }
+ },
+
+ renderChartWidget: function(){
+ // summary:
+ // Renders the chart widget (if any). This method is
+ // called whenever a chart widget is created or
+ // configured, and may be connected to.
+ if(this.chartWidget){
+ this.chartWidget.render();
+ }
+ },
+
+ renderGridWidget: function(){
+ // summary:
+ // Renders the grid widget (if any). This method is
+ // called whenever a grid widget is created or
+ // configured, and may be connected to.
+ if(this.gridWidget){
+ this.gridWidget.render();
+ }
+ },
+
+ getChartWidget: function(){
+ // summary:
+ // Returns the chart widget (if any) created if the type
+ // is "chart" or the "chartNode" property was supplied.
+ return this.chartWidget;
+ },
+
+ getGridWidget: function(){
+ // summary:
+ // Returns the grid widget (if any) created if the type
+ // is "grid" or the "gridNode" property was supplied.
+ return this.gridWidget;
+ },
+
+ destroy: function(){
+ // summary:
+ // Destroys the widget and all components and resources.
+
+ // cancel any outstanding refresh requests
+ this.cancelRefresh();
+
+ if(this.chartWidget){
+ this.chartWidget.destroy();
+ delete this.chartWidget;
+ }
+
+ if(this.legendWidget){
+ // no legend.destroy()
+ delete this.legendWidget;
+ }
+
+ if(this.gridWidget){
+ // no grid.destroy()
+ delete this.gridWidget;
+ }
+
+ if(this.chartNode){
+ this.chartNode.innerHTML = "";
+ }
+
+ if(this.legendNode){
+ this.legendNode.innerHTML = "";
+ }
+
+ if(this.gridNode){
+ this.gridNode.innerHTML = "";
+ }
+
+ if(this.titleNode){
+ this.titleNode.innerHTML = "";
+ }
+
+ if(this.footerNode){
+ this.footerNode.innerHTML = "";
+ }
+ }
+
+ });
+
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Dialog.js b/js/dojo-1.6/dojox/widget/Dialog.js new file mode 100644 index 0000000..ddd61bc --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Dialog.js @@ -0,0 +1,256 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource['dojox.widget.Dialog']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.Dialog'] = true;
+dojo.provide('dojox.widget.Dialog');
+dojo.experimental('dojox.widget.Dialog');
+
+dojo.require("dojo.window");
+dojo.require('dojox.fx');
+dojo.require("dojox.widget.DialogSimple");
+
+dojo.declare('dojox.widget.Dialog', dojox.widget.DialogSimple,
+ {
+ // summary:
+ // A Lightbox-like Modal-dialog for HTML Content
+ //
+ // description:
+ // An HTML-capable Dialog widget with advanced sizing
+ // options, animated show/hide and other useful options.
+ //
+ // This Dialog is also very easy to apply custom styles to.
+ //
+ // It works identically to a `dijit.Dialog` with several
+ // additional parameters.
+
+ templateString: dojo.cache("dojox.widget", "Dialog/Dialog.html", "<div class=\"dojoxDialog\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"${id}_title\">\r\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoxDialogTitleBar\">\r\n\t\t<span dojoAttachPoint=\"titleNode\" class=\"dojoxDialogTitle\" id=\"${id}_title\">${title}</span>\r\n\t</div>\r\n\t<div dojoAttachPoint=\"dojoxDialogWrapper\">\r\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dojoxDialogPaneContent\"></div>\r\n\t</div>\r\n\t<div dojoAttachPoint=\"closeButtonNode\" class=\"dojoxDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\">\r\n\t\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\">x</span>\r\n\t</div>\r\n</div>\r\n"),
+
+ // sizeToViewport: Boolean
+ // If true, fix the size of the dialog to the Viewport based on
+ // viewportPadding value rather than the calculated or natural
+ // stlye. If false, base the size on a passed dimension attribute.
+ // Eitherway, the viewportPadding value is used if the the content
+ // extends beyond the viewport size for whatever reason.
+ sizeToViewport: false,
+
+ // viewportPadding: Integer
+ // If sizeToViewport="true", this is the amount of padding in pixels to leave
+ // between the dialog border and the viewport edge.
+ // This value is also used when sizeToViewport="false" and dimensions exceeded
+ // by dialog content to ensure dialog does not go outside viewport boundary
+ viewportPadding: 35,
+
+ // dimensions: Array
+ // A two-element array of [widht,height] to animate the Dialog to if sizeToViewport="false"
+ // Defaults to [300,300]
+ dimensions: null,
+
+ // easing: Function?|String?
+ // An easing function to apply to the sizing animation.
+ easing: null,
+
+ // sizeDuration: Integer
+ // Time (in ms) to use in the Animation for sizing.
+ sizeDuration: dijit._defaultDuration,
+
+ // sizeMethod: String
+ // To be passed to dojox.fx.sizeTo, one of "chain" or "combine" to effect
+ // the animation sequence.
+ sizeMethod: "chain",
+
+ // showTitle: Boolean
+ // Toogle to show or hide the Title area. Can only be set at startup.
+ showTitle: false,
+
+ // draggable: Boolean
+ // Make the pane draggable. Differs from dijit.Dialog by setting default to false
+ draggable: false, // simply over-ride the default from dijit.Dialog
+
+ // modal: Boolean
+ // If true, this Dialog instance will be truly modal and prevent closing until
+ // explicitly told to by calling hide() - Defaults to false to preserve previous
+ // behaviors.
+ modal: false,
+
+ constructor: function(props, node){
+ this.easing = props.easing || dojo._defaultEasing;
+ this.dimensions = props.dimensions || [300, 300];
+ },
+
+ _setup: function(){
+ // summary: Piggyback on dijit.Dialog's _setup for load-time options, deferred to
+
+ this.inherited(arguments);
+ if(!this._alreadyInitialized){
+ this._navIn = dojo.fadeIn({ node: this.closeButtonNode });
+ this._navOut = dojo.fadeOut({ node: this.closeButtonNode });
+ if(!this.showTitle){
+ dojo.addClass(this.domNode,"dojoxDialogNoTitle");
+ }
+ }
+ },
+
+ layout: function(e){
+ this._setSize();
+ this.inherited(arguments);
+ },
+
+ _setSize: function(){
+ // summary: cache and set our desired end position
+ this._vp = dojo.window.getBox();
+ var tc = this.containerNode,
+ vpSized = this.sizeToViewport
+ ;
+ return this._displaysize = {
+ w: vpSized ? tc.scrollWidth : this.dimensions[0],
+ h: vpSized ? tc.scrollHeight : this.dimensions[1]
+ }; // Object
+ },
+
+ show: function(){
+ if(this.open){ return; }
+
+ this._setSize();
+ dojo.style(this.closeButtonNode,"opacity", 0);
+ dojo.style(this.domNode, {
+ overflow: "hidden",
+ opacity: 0,
+ width: "1px",
+ height: "1px"
+ });
+ dojo.style(this.containerNode, {
+ opacity: 0,
+ overflow: "hidden"
+ });
+
+ this.inherited(arguments);
+
+ if(this.modal){
+ // prevent escape key from closing dialog
+ // connect to body to trap this event from the Dialog a11y code, and stop escape key
+ // from doing anything in the modal:true case:
+ this._modalconnects.push(dojo.connect(dojo.body(), "onkeypress", function(e){
+ if(e.charOrCode == dojo.keys.ESCAPE){
+ dojo.stopEvent(e);
+ }
+ }));
+ }else{
+ // otherwise, allow clicking on the underlay to close
+ this._modalconnects.push(dojo.connect(dijit._underlay.domNode, "onclick", this, "onCancel"));
+ }
+ this._modalconnects.push(dojo.connect(this.domNode,"onmouseenter",this,"_handleNav"));
+ this._modalconnects.push(dojo.connect(this.domNode,"onmouseleave",this,"_handleNav"));
+
+ },
+
+ _handleNav: function(e){
+ // summary: Handle's showing or hiding the close icon
+
+ var navou = "_navOut",
+ navin = "_navIn",
+ animou = (e.type == "mouseout" ? navin : navou),
+ animin = (e.type == "mouseout" ? navou : navin)
+ ;
+
+ this[animou].stop();
+ this[animin].play();
+
+ },
+
+ // an experiment in a quicksilver-like hide. too choppy for me.
+ /*
+ hide: function(){
+ // summary: Hide the dialog
+
+ // if we haven't been initialized yet then we aren't showing and we can just return
+ if(!this._alreadyInitialized){
+ return;
+ }
+
+ this._fadeIn && this._fadeIn.stop();
+
+ if (this._scrollConnected){
+ this._scrollConnected = false;
+ }
+ dojo.forEach(this._modalconnects, dojo.disconnect);
+ this._modalconnects = [];
+ if(this.refocus){
+ this.connect(this._fadeOut,"onEnd",dojo.hitch(dijit,"focus",this._savedFocus));
+ }
+ if(this._relativePosition){
+ delete this._relativePosition;
+ }
+
+ dojox.fx.sizeTo({
+ node: this.domNode,
+ duration:this.sizeDuration || this.duration,
+ width: this._vp.w - 1,
+ height: 5,
+ onBegin: dojo.hitch(this,function(){
+ this._fadeOut.play(this.sizeDuration / 2);
+ })
+ }).play();
+
+ this.open = false;
+ }, */
+
+ _position: function(){
+
+ if(!this._started){ return; } // prevent content: from firing this anim #8914
+
+ if(this._sizing){
+ this._sizing.stop();
+ this.disconnect(this._sizingConnect);
+ delete this._sizing;
+ }
+
+ this.inherited(arguments);
+
+ if(!this.open){ dojo.style(this.containerNode, "opacity", 0); }
+ var pad = this.viewportPadding * 2;
+
+ var props = {
+ node: this.domNode,
+ duration: this.sizeDuration || dijit._defaultDuration,
+ easing: this.easing,
+ method: this.sizeMethod
+ };
+
+ var ds = this._displaysize || this._setSize();
+ props['width'] = ds.w = (ds.w + pad >= this._vp.w || this.sizeToViewport)
+ ? this._vp.w - pad : ds.w;
+
+ props['height'] = ds.h = (ds.h + pad >= this._vp.h || this.sizeToViewport)
+ ? this._vp.h - pad : ds.h;
+
+ this._sizing = dojox.fx.sizeTo(props);
+ this._sizingConnect = this.connect(this._sizing,"onEnd","_showContent");
+ this._sizing.play();
+
+ },
+
+ _showContent: function(e){
+ // summary: Show the inner container after sizing animation
+
+ var container = this.containerNode;
+ dojo.style(this.domNode, {
+ overflow: "visible",
+ opacity: 1
+ });
+ dojo.style(this.closeButtonNode,"opacity",1);
+ dojo.style(container, {
+ height: this._displaysize.h - this.titleNode.offsetHeight + "px",
+ width: this._displaysize.w + "px",
+ overflow:"auto"
+ });
+ dojo.anim(container, { opacity:1 });
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Dialog.xd.js b/js/dojo-1.6/dojox/widget/Dialog.xd.js new file mode 100644 index 0000000..bf75e18 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Dialog.xd.js @@ -0,0 +1,263 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", 'dojox.widget.Dialog'],
+["require", "dojo.window"],
+["require", 'dojox.fx'],
+["require", "dojox.widget.DialogSimple"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource['dojox.widget.Dialog']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.Dialog'] = true;
+dojo.provide('dojox.widget.Dialog');
+dojo.experimental('dojox.widget.Dialog');
+
+dojo.require("dojo.window");
+dojo.require('dojox.fx');
+dojo.require("dojox.widget.DialogSimple");
+
+dojo.declare('dojox.widget.Dialog', dojox.widget.DialogSimple,
+ {
+ // summary:
+ // A Lightbox-like Modal-dialog for HTML Content
+ //
+ // description:
+ // An HTML-capable Dialog widget with advanced sizing
+ // options, animated show/hide and other useful options.
+ //
+ // This Dialog is also very easy to apply custom styles to.
+ //
+ // It works identically to a `dijit.Dialog` with several
+ // additional parameters.
+
+ templateString: dojo.cache("dojox.widget", "Dialog/Dialog.html", "<div class=\"dojoxDialog\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"${id}_title\">\r\n\t<div dojoAttachPoint=\"titleBar\" class=\"dojoxDialogTitleBar\">\r\n\t\t<span dojoAttachPoint=\"titleNode\" class=\"dojoxDialogTitle\" id=\"${id}_title\">${title}</span>\r\n\t</div>\r\n\t<div dojoAttachPoint=\"dojoxDialogWrapper\">\r\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dojoxDialogPaneContent\"></div>\r\n\t</div>\r\n\t<div dojoAttachPoint=\"closeButtonNode\" class=\"dojoxDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\">\r\n\t\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\">x</span>\r\n\t</div>\r\n</div>\r\n"),
+
+ // sizeToViewport: Boolean
+ // If true, fix the size of the dialog to the Viewport based on
+ // viewportPadding value rather than the calculated or natural
+ // stlye. If false, base the size on a passed dimension attribute.
+ // Eitherway, the viewportPadding value is used if the the content
+ // extends beyond the viewport size for whatever reason.
+ sizeToViewport: false,
+
+ // viewportPadding: Integer
+ // If sizeToViewport="true", this is the amount of padding in pixels to leave
+ // between the dialog border and the viewport edge.
+ // This value is also used when sizeToViewport="false" and dimensions exceeded
+ // by dialog content to ensure dialog does not go outside viewport boundary
+ viewportPadding: 35,
+
+ // dimensions: Array
+ // A two-element array of [widht,height] to animate the Dialog to if sizeToViewport="false"
+ // Defaults to [300,300]
+ dimensions: null,
+
+ // easing: Function?|String?
+ // An easing function to apply to the sizing animation.
+ easing: null,
+
+ // sizeDuration: Integer
+ // Time (in ms) to use in the Animation for sizing.
+ sizeDuration: dijit._defaultDuration,
+
+ // sizeMethod: String
+ // To be passed to dojox.fx.sizeTo, one of "chain" or "combine" to effect
+ // the animation sequence.
+ sizeMethod: "chain",
+
+ // showTitle: Boolean
+ // Toogle to show or hide the Title area. Can only be set at startup.
+ showTitle: false,
+
+ // draggable: Boolean
+ // Make the pane draggable. Differs from dijit.Dialog by setting default to false
+ draggable: false, // simply over-ride the default from dijit.Dialog
+
+ // modal: Boolean
+ // If true, this Dialog instance will be truly modal and prevent closing until
+ // explicitly told to by calling hide() - Defaults to false to preserve previous
+ // behaviors.
+ modal: false,
+
+ constructor: function(props, node){
+ this.easing = props.easing || dojo._defaultEasing;
+ this.dimensions = props.dimensions || [300, 300];
+ },
+
+ _setup: function(){
+ // summary: Piggyback on dijit.Dialog's _setup for load-time options, deferred to
+
+ this.inherited(arguments);
+ if(!this._alreadyInitialized){
+ this._navIn = dojo.fadeIn({ node: this.closeButtonNode });
+ this._navOut = dojo.fadeOut({ node: this.closeButtonNode });
+ if(!this.showTitle){
+ dojo.addClass(this.domNode,"dojoxDialogNoTitle");
+ }
+ }
+ },
+
+ layout: function(e){
+ this._setSize();
+ this.inherited(arguments);
+ },
+
+ _setSize: function(){
+ // summary: cache and set our desired end position
+ this._vp = dojo.window.getBox();
+ var tc = this.containerNode,
+ vpSized = this.sizeToViewport
+ ;
+ return this._displaysize = {
+ w: vpSized ? tc.scrollWidth : this.dimensions[0],
+ h: vpSized ? tc.scrollHeight : this.dimensions[1]
+ }; // Object
+ },
+
+ show: function(){
+ if(this.open){ return; }
+
+ this._setSize();
+ dojo.style(this.closeButtonNode,"opacity", 0);
+ dojo.style(this.domNode, {
+ overflow: "hidden",
+ opacity: 0,
+ width: "1px",
+ height: "1px"
+ });
+ dojo.style(this.containerNode, {
+ opacity: 0,
+ overflow: "hidden"
+ });
+
+ this.inherited(arguments);
+
+ if(this.modal){
+ // prevent escape key from closing dialog
+ // connect to body to trap this event from the Dialog a11y code, and stop escape key
+ // from doing anything in the modal:true case:
+ this._modalconnects.push(dojo.connect(dojo.body(), "onkeypress", function(e){
+ if(e.charOrCode == dojo.keys.ESCAPE){
+ dojo.stopEvent(e);
+ }
+ }));
+ }else{
+ // otherwise, allow clicking on the underlay to close
+ this._modalconnects.push(dojo.connect(dijit._underlay.domNode, "onclick", this, "onCancel"));
+ }
+ this._modalconnects.push(dojo.connect(this.domNode,"onmouseenter",this,"_handleNav"));
+ this._modalconnects.push(dojo.connect(this.domNode,"onmouseleave",this,"_handleNav"));
+
+ },
+
+ _handleNav: function(e){
+ // summary: Handle's showing or hiding the close icon
+
+ var navou = "_navOut",
+ navin = "_navIn",
+ animou = (e.type == "mouseout" ? navin : navou),
+ animin = (e.type == "mouseout" ? navou : navin)
+ ;
+
+ this[animou].stop();
+ this[animin].play();
+
+ },
+
+ // an experiment in a quicksilver-like hide. too choppy for me.
+ /*
+ hide: function(){
+ // summary: Hide the dialog
+
+ // if we haven't been initialized yet then we aren't showing and we can just return
+ if(!this._alreadyInitialized){
+ return;
+ }
+
+ this._fadeIn && this._fadeIn.stop();
+
+ if (this._scrollConnected){
+ this._scrollConnected = false;
+ }
+ dojo.forEach(this._modalconnects, dojo.disconnect);
+ this._modalconnects = [];
+ if(this.refocus){
+ this.connect(this._fadeOut,"onEnd",dojo.hitch(dijit,"focus",this._savedFocus));
+ }
+ if(this._relativePosition){
+ delete this._relativePosition;
+ }
+
+ dojox.fx.sizeTo({
+ node: this.domNode,
+ duration:this.sizeDuration || this.duration,
+ width: this._vp.w - 1,
+ height: 5,
+ onBegin: dojo.hitch(this,function(){
+ this._fadeOut.play(this.sizeDuration / 2);
+ })
+ }).play();
+
+ this.open = false;
+ }, */
+
+ _position: function(){
+
+ if(!this._started){ return; } // prevent content: from firing this anim #8914
+
+ if(this._sizing){
+ this._sizing.stop();
+ this.disconnect(this._sizingConnect);
+ delete this._sizing;
+ }
+
+ this.inherited(arguments);
+
+ if(!this.open){ dojo.style(this.containerNode, "opacity", 0); }
+ var pad = this.viewportPadding * 2;
+
+ var props = {
+ node: this.domNode,
+ duration: this.sizeDuration || dijit._defaultDuration,
+ easing: this.easing,
+ method: this.sizeMethod
+ };
+
+ var ds = this._displaysize || this._setSize();
+ props['width'] = ds.w = (ds.w + pad >= this._vp.w || this.sizeToViewport)
+ ? this._vp.w - pad : ds.w;
+
+ props['height'] = ds.h = (ds.h + pad >= this._vp.h || this.sizeToViewport)
+ ? this._vp.h - pad : ds.h;
+
+ this._sizing = dojox.fx.sizeTo(props);
+ this._sizingConnect = this.connect(this._sizing,"onEnd","_showContent");
+ this._sizing.play();
+
+ },
+
+ _showContent: function(e){
+ // summary: Show the inner container after sizing animation
+
+ var container = this.containerNode;
+ dojo.style(this.domNode, {
+ overflow: "visible",
+ opacity: 1
+ });
+ dojo.style(this.closeButtonNode,"opacity",1);
+ dojo.style(container, {
+ height: this._displaysize.h - this.titleNode.offsetHeight + "px",
+ width: this._displaysize.w + "px",
+ overflow:"auto"
+ });
+ dojo.anim(container, { opacity:1 });
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Dialog/Dialog.css b/js/dojo-1.6/dojox/widget/Dialog/Dialog.css new file mode 100644 index 0000000..fd41fce --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Dialog/Dialog.css @@ -0,0 +1,112 @@ + +.dojoxDialog { + position: absolute; + z-index: 999; + outline:0; +} + +.dojoxDialog .closeText { + display:none; + /* for the onhover border in high contrast on IE: */ + position:absolute; +} + +.dojoxDialogFixed div.dojoxDialogTitleBar { + cursor:default; +} + +.dojoxDialogWrapper { + left: 0; + top: 0; +} + +.dojoxDialog { + background: #fff; + -webkit-box-shadow: 0px 5px 10px #adadad; + -moz-border-radius:9pt; + -webkit-border-radius:8pt; + border:1px solid #b7b7b7; + padding:1.5em 3px 3px 3px; +} + +.dojoxDialogFocused { + border:1px solid #ccc; +} + +.dojoxDialog .dojoxDialogPaneContent { + border:none; + padding:0; +} + +.dojoxDialogTitleBar { + /* outer container for the titlebar of the dialog */ + cursor:move; + top:0; + left:0; + right:0; + background:#ededed; + height:1.5em; + outline:0; /* remove this line if keyboard focus on dialog startup is an issue. tab still takes you to first focusable element */ + -moz-border-radius-topleft:8pt; + -moz-border-radius-topright:8pt; + -webkik-border-radius-topleft:7pt; + -webkit-border-radius-topright:7pt; +} +.dj_webkit .dojoxDialogTitleBar { + border:1px solid #ccc; +} + +.dojoxDialogNoTitle .dojoxDialogTitleBar { + display:none; +} + +.dojoxDialogContent { + /* the body of the dialog */ + padding: 3px; + margin-top:1.2em; +} + +/* pseudo-tundra-like */ + +.dojoxDialogTitle { + font-weight: bold; + padding: 8px 12px 8px 12px; + outline:0; + border-bottom:#b7b7b7; +} + +div.dojoxDialogNoTitle { + padding-top:9px; +} + +.dojoxDialogCloseIcon, .dojoxDialogCloseIconHover { + background : url("images/dialogCloseButton.png") no-repeat top right; + position: absolute; + vertical-align: middle; + left: -19px; + top: -19px; + height: 29px; + width: 29px; + cursor: pointer; + z-index: 999; +} +.dj_ie6 .dojoxDialogCloseIcon { + background-image: url("images/dialogCloseButton.gif"); +} + +.dojoxDialog div.dijitDialogCloseIconHover, +.dojoxDialog div.dijitDialogCloseIconActive { + background-position:0 0; +} + +.dojoxDialog .dijitDialogCloseIconHover { + background-image: url("images/dialogCloseButton.png"); +} +.dj_ie6 .dojoxDialog .dijitDialogCloseIconHover { + background-image: url("images/dialogCloseButton.gif"); +} + +.dojoxDialogNoTitle .dojoxDialogCloseIcon { + top: -15px; + left: -15px; +} diff --git a/js/dojo-1.6/dojox/widget/Dialog/Dialog.html b/js/dojo-1.6/dojox/widget/Dialog/Dialog.html new file mode 100644 index 0000000..dad17de --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Dialog/Dialog.html @@ -0,0 +1,11 @@ +<div class="dojoxDialog" tabindex="-1" role="dialog" aria-labelledby="${id}_title"> + <div dojoAttachPoint="titleBar" class="dojoxDialogTitleBar"> + <span dojoAttachPoint="titleNode" class="dojoxDialogTitle" id="${id}_title">${title}</span> + </div> + <div dojoAttachPoint="dojoxDialogWrapper"> + <div dojoAttachPoint="containerNode" class="dojoxDialogPaneContent"></div> + </div> + <div dojoAttachPoint="closeButtonNode" class="dojoxDialogCloseIcon" dojoAttachEvent="onclick: onCancel"> + <span dojoAttachPoint="closeText" class="closeText">x</span> + </div> +</div> diff --git a/js/dojo-1.6/dojox/widget/Dialog/images/dialogCloseButton.gif b/js/dojo-1.6/dojox/widget/Dialog/images/dialogCloseButton.gif Binary files differnew file mode 100644 index 0000000..1f45a5c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Dialog/images/dialogCloseButton.gif diff --git a/js/dojo-1.6/dojox/widget/Dialog/images/dialogCloseButton.png b/js/dojo-1.6/dojox/widget/Dialog/images/dialogCloseButton.png Binary files differnew file mode 100644 index 0000000..9d2f423 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Dialog/images/dialogCloseButton.png diff --git a/js/dojo-1.6/dojox/widget/DialogSimple.js b/js/dojo-1.6/dojox/widget/DialogSimple.js new file mode 100644 index 0000000..a2f1c1b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DialogSimple.js @@ -0,0 +1,21 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.DialogSimple"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DialogSimple"] = true;
+dojo.provide("dojox.widget.DialogSimple");
+
+dojo.require('dijit.Dialog');
+dojo.require("dojox.layout.ContentPane");
+
+dojo.declare("dojox.widget.DialogSimple", [dojox.layout.ContentPane, dijit._DialogBase], {
+ // summary: A Simple Dialog Mixing the `dojox.layout.ContentPane` functionality over
+ // top of a vanilla `dijit.Dialog`. See `dojox.widget.Dialog` for a more flexible
+ // dialog option allowing animations and different styles/theme support.
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/DialogSimple.xd.js b/js/dojo-1.6/dojox/widget/DialogSimple.xd.js new file mode 100644 index 0000000..94fbbaa --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DialogSimple.xd.js @@ -0,0 +1,27 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.DialogSimple"],
+["require", 'dijit.Dialog'],
+["require", "dojox.layout.ContentPane"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.DialogSimple"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DialogSimple"] = true;
+dojo.provide("dojox.widget.DialogSimple");
+
+dojo.require('dijit.Dialog');
+dojo.require("dojox.layout.ContentPane");
+
+dojo.declare("dojox.widget.DialogSimple", [dojox.layout.ContentPane, dijit._DialogBase], {
+ // summary: A Simple Dialog Mixing the `dojox.layout.ContentPane` functionality over
+ // top of a vanilla `dijit.Dialog`. See `dojox.widget.Dialog` for a more flexible
+ // dialog option allowing animations and different styles/theme support.
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/DocTester.js b/js/dojo-1.6/dojox/widget/DocTester.js new file mode 100644 index 0000000..81a4edf --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DocTester.js @@ -0,0 +1,97 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.DocTester"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DocTester"] = true;
+dojo.provide("dojox.widget.DocTester");
+
+dojo.require("dojo.string");
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dojox.form.BusyButton");
+dojo.require("dojox.testing.DocTest");
+
+dojo.declare('dojox.widget.DocTester',
+ [dijit._Widget, dijit._Templated],
+ {
+ // summary: A widget to run DocTests inside an HTML page.
+ //
+ templateString: dojo.cache("dojox.widget", "DocTester/DocTester.html", "<div dojoAttachPoint=\"domNode\" class=\"dojoxDocTester\">\r\n\t<div dojoAttachPoint=\"containerNode\"></div>\r\n\t<button dojoType=\"dojox.form.BusyButton\" busyLabel=\"Testing...\" dojoAttachPoint=\"runButtonNode\">Run tests</button>\r\n\t<button dojoType=\"dijit.form.Button\" dojoAttachPoint=\"resetButtonNode\" style=\"display:none;\">Reset</button>\r\n\t<span>\r\n\t\t<span dojoAttachPoint=\"numTestsNode\">0</span> tests,\r\n\t\t<span dojoAttachPoint=\"numTestsOkNode\">0</span> passed,\r\n\t\t<span dojoAttachPoint=\"numTestsNokNode\">0</span> failed\r\n\t</span>\r\n</div>\r\n"),
+ widgetsInTemplate: true,
+
+ _fillContent:function(/*DomNode*/source){
+ // summary: Overridden from _Templates.js, which actually just takes care of filling the containerNode.
+ var src = source.innerHTML;
+ this.doctests = new dojox.testing.DocTest();
+ this.tests = this.doctests.getTestsFromString(this._unescapeHtml(src));
+ var lineNumbers = dojo.map(this.tests, 'return item.line-1');
+ var lines = src.split("\n");
+ var actualResultHtml = '<div class="actualResult">FAILED, actual result was: <span class="result"></span></div>';
+ var content = '<pre class="testCase testNum0 odd">';
+ for (var i=0; i<lines.length; i++){
+ var index = dojo.indexOf(lineNumbers, i);
+ if (index>0 && index!=-1){
+ var evenOdd = index%2 ? "even" : "odd";
+ content += actualResultHtml;
+ content += '</pre><pre class="testCase testNum'+ index +' '+evenOdd+'">';
+ }
+ content += lines[i].replace(/^\s+/, "")+"\n";
+ }
+ content += actualResultHtml + '</pre>';
+ this.containerNode.innerHTML = content;
+ },
+
+ postCreate:function(){
+ this.inherited("postCreate", arguments);
+ dojo.connect(this.runButtonNode, "onClick", dojo.hitch(this, "runTests"));
+ dojo.connect(this.resetButtonNode, "onClick", dojo.hitch(this, "reset"));
+ this.numTestsNode.innerHTML = this.tests.length;
+ },
+
+ runTests:function(){
+ var results = {ok:0, nok:0};
+ for (var i=0; i<this.tests.length; i++){
+ var ret = this.doctests.runTest(this.tests[i].commands, this.tests[i].expectedResult);
+ dojo.query(".testNum"+i, this.domNode).addClass(ret.success ? "resultOk" : "resultNok");
+ if (!ret.success){
+ results.nok++;
+ this.numTestsNokNode.innerHTML = results.nok;
+ var act = dojo.query(".testNum"+i+" .actualResult", this.domNode)[0];
+ dojo.style(act, "display", "inline");
+ dojo.query(".result", act)[0].innerHTML = dojo.toJson(ret.actualResult);
+ } else {
+ results.ok++;
+ this.numTestsOkNode.innerHTML = results.ok;
+ }
+ }
+ this.runButtonNode.cancel();
+ dojo.style(this.runButtonNode.domNode, "display", "none");
+ dojo.style(this.resetButtonNode.domNode, "display", "");
+ },
+
+ reset:function(){
+ // summary: Reset the DocTester visuals and enable the "Run tests" button again.
+ dojo.style(this.runButtonNode.domNode, "display", "");
+ dojo.style(this.resetButtonNode.domNode, "display", "none");
+ this.numTestsOkNode.innerHTML = "0";
+ this.numTestsNokNode.innerHTML = "0";
+ dojo.query(".actualResult", this.domNode).style("display", "none");
+ dojo.query(".testCase", this.domNode).removeClass("resultOk").removeClass("resultNok");
+ },
+
+ _unescapeHtml:function(/*string*/str){
+ // TODO Should become dojo.html.unentities() or so, when exists use instead
+ // summary:
+ // Adds escape sequences for special characters in XML: &<>"'
+ str = String(str).replace(/&/gm, "&").replace(/</gm, "<")
+ .replace(/>/gm, ">").replace(/"/gm, '"');
+ return str; // string
+ }
+ }
+);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/DocTester.xd.js b/js/dojo-1.6/dojox/widget/DocTester.xd.js new file mode 100644 index 0000000..1d759b9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DocTester.xd.js @@ -0,0 +1,106 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.DocTester"],
+["require", "dojo.string"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"],
+["require", "dojox.form.BusyButton"],
+["require", "dojox.testing.DocTest"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.DocTester"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DocTester"] = true;
+dojo.provide("dojox.widget.DocTester");
+
+dojo.require("dojo.string");
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dojox.form.BusyButton");
+dojo.require("dojox.testing.DocTest");
+
+dojo.declare('dojox.widget.DocTester',
+ [dijit._Widget, dijit._Templated],
+ {
+ // summary: A widget to run DocTests inside an HTML page.
+ //
+ templateString: dojo.cache("dojox.widget", "DocTester/DocTester.html", "<div dojoAttachPoint=\"domNode\" class=\"dojoxDocTester\">\r\n\t<div dojoAttachPoint=\"containerNode\"></div>\r\n\t<button dojoType=\"dojox.form.BusyButton\" busyLabel=\"Testing...\" dojoAttachPoint=\"runButtonNode\">Run tests</button>\r\n\t<button dojoType=\"dijit.form.Button\" dojoAttachPoint=\"resetButtonNode\" style=\"display:none;\">Reset</button>\r\n\t<span>\r\n\t\t<span dojoAttachPoint=\"numTestsNode\">0</span> tests,\r\n\t\t<span dojoAttachPoint=\"numTestsOkNode\">0</span> passed,\r\n\t\t<span dojoAttachPoint=\"numTestsNokNode\">0</span> failed\r\n\t</span>\r\n</div>\r\n"),
+ widgetsInTemplate: true,
+
+ _fillContent:function(/*DomNode*/source){
+ // summary: Overridden from _Templates.js, which actually just takes care of filling the containerNode.
+ var src = source.innerHTML;
+ this.doctests = new dojox.testing.DocTest();
+ this.tests = this.doctests.getTestsFromString(this._unescapeHtml(src));
+ var lineNumbers = dojo.map(this.tests, 'return item.line-1');
+ var lines = src.split("\n");
+ var actualResultHtml = '<div class="actualResult">FAILED, actual result was: <span class="result"></span></div>';
+ var content = '<pre class="testCase testNum0 odd">';
+ for (var i=0; i<lines.length; i++){
+ var index = dojo.indexOf(lineNumbers, i);
+ if (index>0 && index!=-1){
+ var evenOdd = index%2 ? "even" : "odd";
+ content += actualResultHtml;
+ content += '</pre><pre class="testCase testNum'+ index +' '+evenOdd+'">';
+ }
+ content += lines[i].replace(/^\s+/, "")+"\n";
+ }
+ content += actualResultHtml + '</pre>';
+ this.containerNode.innerHTML = content;
+ },
+
+ postCreate:function(){
+ this.inherited("postCreate", arguments);
+ dojo.connect(this.runButtonNode, "onClick", dojo.hitch(this, "runTests"));
+ dojo.connect(this.resetButtonNode, "onClick", dojo.hitch(this, "reset"));
+ this.numTestsNode.innerHTML = this.tests.length;
+ },
+
+ runTests:function(){
+ var results = {ok:0, nok:0};
+ for (var i=0; i<this.tests.length; i++){
+ var ret = this.doctests.runTest(this.tests[i].commands, this.tests[i].expectedResult);
+ dojo.query(".testNum"+i, this.domNode).addClass(ret.success ? "resultOk" : "resultNok");
+ if (!ret.success){
+ results.nok++;
+ this.numTestsNokNode.innerHTML = results.nok;
+ var act = dojo.query(".testNum"+i+" .actualResult", this.domNode)[0];
+ dojo.style(act, "display", "inline");
+ dojo.query(".result", act)[0].innerHTML = dojo.toJson(ret.actualResult);
+ } else {
+ results.ok++;
+ this.numTestsOkNode.innerHTML = results.ok;
+ }
+ }
+ this.runButtonNode.cancel();
+ dojo.style(this.runButtonNode.domNode, "display", "none");
+ dojo.style(this.resetButtonNode.domNode, "display", "");
+ },
+
+ reset:function(){
+ // summary: Reset the DocTester visuals and enable the "Run tests" button again.
+ dojo.style(this.runButtonNode.domNode, "display", "");
+ dojo.style(this.resetButtonNode.domNode, "display", "none");
+ this.numTestsOkNode.innerHTML = "0";
+ this.numTestsNokNode.innerHTML = "0";
+ dojo.query(".actualResult", this.domNode).style("display", "none");
+ dojo.query(".testCase", this.domNode).removeClass("resultOk").removeClass("resultNok");
+ },
+
+ _unescapeHtml:function(/*string*/str){
+ // TODO Should become dojo.html.unentities() or so, when exists use instead
+ // summary:
+ // Adds escape sequences for special characters in XML: &<>"'
+ str = String(str).replace(/&/gm, "&").replace(/</gm, "<")
+ .replace(/>/gm, ">").replace(/"/gm, '"');
+ return str; // string
+ }
+ }
+);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/DocTester/DocTester.css b/js/dojo-1.6/dojox/widget/DocTester/DocTester.css new file mode 100644 index 0000000..04dac19 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DocTester/DocTester.css @@ -0,0 +1,32 @@ +.dojoxDocTester pre.testCase{ + border:0; + padding:0.3em; + padding-left:2em; +} +.dojoxDocTester pre.odd{ + background-color:#E3E3E3; +} +.dojoxDocTester pre.odd.resultOk{ + background-color:#C3FFC3; +} +.dojoxDocTester pre.odd.resultNok{ + background-color:#FFC3C3; +} + +.dojoxDocTester pre.even{ + background-color:#F3F3F3; +} +.dojoxDocTester pre.even.resultOk{ + background-color:#DFFFDF; +} +.dojoxDocTester pre.even.resultNok{ + background-color:#FFCFCF; +} + +.dojoxDocTester .actualResult{ + display:none; + font-weight:bold; +} +.dojoxDocTester .actualResult .result{ + color:red; +} diff --git a/js/dojo-1.6/dojox/widget/DocTester/DocTester.html b/js/dojo-1.6/dojox/widget/DocTester/DocTester.html new file mode 100644 index 0000000..fbb7a6b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DocTester/DocTester.html @@ -0,0 +1,10 @@ +<div dojoAttachPoint="domNode" class="dojoxDocTester"> + <div dojoAttachPoint="containerNode"></div> + <button dojoType="dojox.form.BusyButton" busyLabel="Testing..." dojoAttachPoint="runButtonNode">Run tests</button> + <button dojoType="dijit.form.Button" dojoAttachPoint="resetButtonNode" style="display:none;">Reset</button> + <span> + <span dojoAttachPoint="numTestsNode">0</span> tests, + <span dojoAttachPoint="numTestsOkNode">0</span> passed, + <span dojoAttachPoint="numTestsNokNode">0</span> failed + </span> +</div>
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/DynamicTooltip.js b/js/dojo-1.6/dojox/widget/DynamicTooltip.js new file mode 100644 index 0000000..ffcade2 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DynamicTooltip.js @@ -0,0 +1,118 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.DynamicTooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DynamicTooltip"] = true;
+dojo.provide("dojox.widget.DynamicTooltip");
+dojo.experimental("dojox.widget.DynamicTooltip");
+
+dojo.require("dijit.Tooltip");
+dojo.requireLocalization("dijit", "loading", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
+
+dojo.declare("dojox.widget.DynamicTooltip", dijit.Tooltip,
+ {
+ // summary:
+ // Extention of dijit.Tooltip providing content set via XHR
+ // request via href param
+
+ // hasLoaded: Boolean
+ // false if the contents are yet to be loaded from the HTTP request
+ hasLoaded: false,
+
+ // href: String
+ // location from where to fetch the contents
+ href: "",
+
+ // label: String
+ // contents to diplay in the tooltip. Initialized to a loading icon.
+ label: "",
+
+ // preventCache: Boolean
+ // Cache content retreived externally
+ preventCache: false,
+
+ postMixInProperties: function(){
+ this.inherited(arguments);
+ this._setLoadingLabel();
+ },
+
+ _setLoadingLabel: function(){
+ // summary:
+ // Changes the tooltip label / contents to loading message, only if
+ // there's an href param, otherwise acts as normal tooltip
+
+ if(this.href){
+ this.label = dojo.i18n.getLocalization("dijit", "loading", this.lang).loadingState;
+ }
+ },
+
+ // MOW: this is a new widget, do we really need a deprecated stub?
+ // setHref: function(/*String|Uri*/ href){
+ // // summary:
+ // // Deprecated. Use set('href', ...) instead.
+ // dojo.deprecated("dojox.widget.DynamicTooltip.setHref() is deprecated. Use set('href', ...) instead.", "", "2.0");
+ // return this.set("href", href);
+ // },
+
+ _setHrefAttr: function(/*String|Uri*/ href){
+ // summary:
+ // Hook so attr("href", ...) works.
+ // description:
+ // resets so next show loads new href
+ // href:
+ // url to the content you want to show, must be within the same domain as your mainpage
+
+ this.href = href;
+ this.hasLoaded = false;
+ },
+
+ loadContent: function(node){
+ // summary:
+ // Download contents of href via XHR and display
+ // description:
+ // 1. checks if content already loaded
+ // 2. if not, sends XHR to download new data
+ if(!this.hasLoaded && this.href){
+ this._setLoadingLabel();
+ this.hasLoaded = true;
+
+ dojo.xhrGet({
+ url: this.href,
+ handleAs: "text",
+ tooltipWidget: this,
+ load: function(response, ioArgs){
+ this.tooltipWidget.label = response;
+ this.tooltipWidget.close();
+ this.tooltipWidget.open(node);
+ },
+ preventCache: this.preventCache
+ });
+ }
+ },
+
+ refresh: function(){
+ // summary:
+ // Allows re-download of contents of href and display
+ // Useful with preventCache = true
+
+ this.hasLoaded = false;
+ },
+
+ open: function(/*DomNode*/ target){
+ // summary:
+ // Display the tooltip; usually not called directly.
+
+ target = target || (this._connectNodes && this._connectNodes[0]);
+ if(!target){ return; }
+
+ this.loadContent(target);
+ this.inherited(arguments);
+ }
+ }
+);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/DynamicTooltip.xd.js b/js/dojo-1.6/dojox/widget/DynamicTooltip.xd.js new file mode 100644 index 0000000..46e3ee1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/DynamicTooltip.xd.js @@ -0,0 +1,124 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.DynamicTooltip"],
+["require", "dijit.Tooltip"],
+["requireLocalization", "dijit", "loading", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw", "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.DynamicTooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.DynamicTooltip"] = true;
+dojo.provide("dojox.widget.DynamicTooltip");
+dojo.experimental("dojox.widget.DynamicTooltip");
+
+dojo.require("dijit.Tooltip");
+;
+
+dojo.declare("dojox.widget.DynamicTooltip", dijit.Tooltip,
+ {
+ // summary:
+ // Extention of dijit.Tooltip providing content set via XHR
+ // request via href param
+
+ // hasLoaded: Boolean
+ // false if the contents are yet to be loaded from the HTTP request
+ hasLoaded: false,
+
+ // href: String
+ // location from where to fetch the contents
+ href: "",
+
+ // label: String
+ // contents to diplay in the tooltip. Initialized to a loading icon.
+ label: "",
+
+ // preventCache: Boolean
+ // Cache content retreived externally
+ preventCache: false,
+
+ postMixInProperties: function(){
+ this.inherited(arguments);
+ this._setLoadingLabel();
+ },
+
+ _setLoadingLabel: function(){
+ // summary:
+ // Changes the tooltip label / contents to loading message, only if
+ // there's an href param, otherwise acts as normal tooltip
+
+ if(this.href){
+ this.label = dojo.i18n.getLocalization("dijit", "loading", this.lang).loadingState;
+ }
+ },
+
+ // MOW: this is a new widget, do we really need a deprecated stub?
+ // setHref: function(/*String|Uri*/ href){
+ // // summary:
+ // // Deprecated. Use set('href', ...) instead.
+ // dojo.deprecated("dojox.widget.DynamicTooltip.setHref() is deprecated. Use set('href', ...) instead.", "", "2.0");
+ // return this.set("href", href);
+ // },
+
+ _setHrefAttr: function(/*String|Uri*/ href){
+ // summary:
+ // Hook so attr("href", ...) works.
+ // description:
+ // resets so next show loads new href
+ // href:
+ // url to the content you want to show, must be within the same domain as your mainpage
+
+ this.href = href;
+ this.hasLoaded = false;
+ },
+
+ loadContent: function(node){
+ // summary:
+ // Download contents of href via XHR and display
+ // description:
+ // 1. checks if content already loaded
+ // 2. if not, sends XHR to download new data
+ if(!this.hasLoaded && this.href){
+ this._setLoadingLabel();
+ this.hasLoaded = true;
+
+ dojo.xhrGet({
+ url: this.href,
+ handleAs: "text",
+ tooltipWidget: this,
+ load: function(response, ioArgs){
+ this.tooltipWidget.label = response;
+ this.tooltipWidget.close();
+ this.tooltipWidget.open(node);
+ },
+ preventCache: this.preventCache
+ });
+ }
+ },
+
+ refresh: function(){
+ // summary:
+ // Allows re-download of contents of href and display
+ // Useful with preventCache = true
+
+ this.hasLoaded = false;
+ },
+
+ open: function(/*DomNode*/ target){
+ // summary:
+ // Display the tooltip; usually not called directly.
+
+ target = target || (this._connectNodes && this._connectNodes[0]);
+ if(!target){ return; }
+
+ this.loadContent(target);
+ this.inherited(arguments);
+ }
+ }
+);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/FeedPortlet.js b/js/dojo-1.6/dojox/widget/FeedPortlet.js new file mode 100644 index 0000000..95128c8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FeedPortlet.js @@ -0,0 +1,450 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.FeedPortlet"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FeedPortlet"] = true;
+dojo.provide("dojox.widget.FeedPortlet");
+dojo.require("dojox.widget.Portlet");
+dojo.require("dijit.Tooltip");
+dojo.require("dijit.form.TextBox");
+dojo.require("dijit.form.Button");
+dojo.require("dojox.data.GoogleFeedStore");
+
+dojo.declare("dojox.widget.FeedPortlet", dojox.widget.Portlet, {
+ // summary:
+ // A Portlet that loads a XML feed.
+ // description: The feed is displayed as
+ // an unordered list of links. When a link is hovered over
+ // by the mouse, it displays a summary in a tooltip.
+
+ // local: Boolean
+ // Specifies whether the feed is to be loaded from the same domain as the
+ // page, or a remote domain. If local is true, then the feed must be an
+ // Atom feed. If it is false, it can be an Atom or RSS feed.
+ local: false,
+
+ // maxResults: Number
+ // The number of results to display from the feed.
+ maxResults: 5,
+
+ // url: String
+ // The URL of the feed to load. If this is different to the domain
+ // of the HTML page, local should be set to false.
+ url: "",
+
+ // openNew: Boolean
+ // If true, when a link is clicked it will open in a new window.
+ // If false, it will not.
+ openNew: true,
+
+ // useFeedTitle: Boolean
+ // If true, the title of the loaded feed is displayed in the title bar of the portlet.
+ // If false, the title remains unchanged.
+ showFeedTitle: true,
+
+ postCreate: function(){
+ this.inherited(arguments);
+ if(this.local && !dojox.data.AtomReadStore){
+ throw Error(this.declaredClass + ": To use local feeds, you must include dojox.data.AtomReadStore on the page.");
+ }
+ },
+
+ onFeedError: function(){
+ // summary:
+ // Called when a feed fails to load successfully.
+ this.containerNode.innerHTML = "Error accessing the feed."
+ },
+
+ addChild: function(child){
+ this.inherited(arguments);
+ var url = child.attr("feedPortletUrl");
+ if(url){
+ this.set("url", url);
+ }
+ },
+
+ _getTitle: function(item){
+ // summary:
+ // Gets the title of a feed item.
+ var t = this.store.getValue(item, "title");
+ return this.local ? t.text : t;
+ },
+
+ _getLink: function(item){
+ // summary:
+ // Gets the href link of a feed item.
+ var l = this.store.getValue(item, "link");
+ return this.local ? l.href : l;
+ },
+
+ _getContent: function(item){
+ // summary:
+ // Gets the summary of a feed item.
+ var c = this.store.getValue(item, "summary");
+ if(!c){
+ return null;
+ }
+ if(this.local){
+ c = c.text;
+ }
+ // Filter out any sneaky scripts in the code
+ c = c.split("<script").join("<!--").split("</script>").join("-->");
+ c = c.split("<iframe").join("<!--").split("</iframe>").join("-->");
+ return c;
+
+ },
+
+ _setUrlAttr: function(url){
+ // summary:
+ // Sets the URL to load.
+ this.url = url;
+ if(this._started){
+ this.load();
+ }
+ },
+
+ startup: function(){
+ // summary:
+ // Loads the widget.
+ if(this.started || this._started){return;}
+
+ this.inherited(arguments);
+
+ if(!this.url || this.url == ""){
+ throw new Error(this.id + ": A URL must be specified for the feed portlet");
+ }
+ if(this.url && this.url != ""){
+ this.load();
+ }
+ },
+
+ load: function(){
+ // summary:
+ // Loads the feed.
+ if(this._resultList){
+ dojo.destroy(this._resultList);
+ }
+ var store, query;
+
+ // If the feed is on the same domain, use the AtomReadStore,
+ // as we cannot be guaranteed that it will be available to
+ // Google services.
+ if(this.local){
+ store = new dojox.data.AtomReadStore({
+ url: this.url
+ });
+ query = {};
+
+ }else{
+ store = new dojox.data.GoogleFeedStore();
+ query = {url: this.url};
+ }
+ var request = {
+ query: query,
+ count: this.maxResults,
+ onComplete: dojo.hitch(this, function(items){
+ if (this.showFeedTitle && store.getFeedValue) {
+ var title = this.store.getFeedValue("title");
+ if(title){
+ this.set("title", title.text ? title.text : title);
+ }
+ }
+ this.generateResults(items);
+ }),
+ onError: dojo.hitch(this, "onFeedError")
+ };
+
+ this.store = store;
+ store.fetch(request);
+ },
+
+ generateResults: function (items){
+ // summary:
+ // Generates a list of hyperlinks and displays a tooltip
+ // containing a summary when the mouse hovers over them.
+ var store = this.store;
+ var timer;
+ var ul = (this._resultList =
+ dojo.create("ul", {"class" : "dojoxFeedPortletList"}, this.containerNode));
+
+ dojo.forEach(items, dojo.hitch(this, function(item){
+ var li = dojo.create("li", {
+ innerHTML: '<a href="'
+ + this._getLink(item)
+ + '"'
+ + (this.openNew ? ' target="_blank"' : '')
+ +'>'
+ + this._getTitle(item) + '</a>'
+ },ul);
+
+ dojo.connect(li, "onmouseover", dojo.hitch(this, function(evt){
+ if(timer){
+ clearTimeout(timer);
+ }
+
+ // Show the tooltip after the mouse has been hovering
+ // for a short time.
+ timer = setTimeout(dojo.hitch(this, function(){
+ timer = null;
+ var summary = this._getContent(item);
+ if(!summary){return;}
+ var content = '<div class="dojoxFeedPortletPreview">'
+ + summary + '</div>'
+
+ dojo.query("li", ul).forEach(function(item){
+ if(item != evt.target){
+ dijit.hideTooltip(item);
+ }
+ });
+
+ // Hover the tooltip over the anchor tag
+ dijit.showTooltip(content, li.firstChild, !this.isLeftToRight());
+ }), 500);
+
+
+ }));
+
+ // Hide the tooltip when the mouse leaves a list item.
+ dojo.connect(li, "onmouseout", function(){
+ if(timer){
+ clearTimeout(timer);
+ timer = null;
+ }
+ dijit.hideTooltip(li.firstChild);
+ });
+ }));
+
+ this.resize();
+ }
+});
+
+dojo.declare("dojox.widget.ExpandableFeedPortlet", dojox.widget.FeedPortlet, {
+ // summary:
+ // A FeedPortlet that uses an list of expandable links to display
+ // a feed. An icon is placed to the left of each item
+ // which, when clicked, toggles the visible state
+ // of the item summary.
+
+ // onlyOpenOne: Boolean
+ // If true, only a single item can be expanded at any given time.
+ onlyOpenOne: false,
+
+ generateResults: function(items){
+ // summary:
+ // Generates a list of items, and places an icon beside them that
+ // can be used to show or hide a summary of that item.
+
+ var store = this.store;
+ var iconCls = "dojoxPortletToggleIcon";
+ var collapsedCls = "dojoxPortletItemCollapsed";
+ var expandedCls = "dojoxPortletItemOpen";
+
+ var timer;
+ var ul = (this._resultList = dojo.create("ul", {
+ "class": "dojoxFeedPortletExpandableList"
+ }, this.containerNode));
+
+ // Create the LI elements. Each LI has two DIV elements, the
+ // top DIV contains the toggle icon and title, and the bottom
+ // div contains the extended summary.
+ dojo.forEach(items, dojo.hitch(this, dojo.hitch(this, function(item){
+ var li = dojo.create("li", {"class": collapsedCls}, ul);
+ var upper = dojo.create("div", {style: "width: 100%;"}, li);
+ var lower = dojo.create("div", {"class": "dojoxPortletItemSummary", innerHTML: this._getContent(item)}, li);
+ dojo.create("span", {
+ "class": iconCls,
+ innerHTML: "<img src='" + dojo.config.baseUrl + "/resources/blank.gif'>"}, upper);
+ var a = dojo.create("a", {href: this._getLink(item), innerHTML: this._getTitle(item) }, upper);
+
+ if(this.openNew){
+ dojo.attr(a, "target", "_blank");
+ }
+ })));
+
+ // Catch all clicks on the list. If a toggle icon is clicked,
+ // toggle the visible state of the summary DIV.
+ dojo.connect(ul, "onclick", dojo.hitch(this, function(evt){
+ if(dojo.hasClass(evt.target, iconCls) || dojo.hasClass(evt.target.parentNode, iconCls)){
+ dojo.stopEvent(evt);
+ var li = evt.target.parentNode;
+ while(li.tagName != "LI"){
+ li = li.parentNode;
+ }
+ if(this.onlyOpenOne){
+ dojo.query("li", ul).filter(function(item){
+ return item != li;
+ }).removeClass(expandedCls).addClass(collapsedCls);
+ }
+ var isExpanded = dojo.hasClass(li, expandedCls);
+ dojo.toggleClass(li, expandedCls, !isExpanded);
+ dojo.toggleClass(li, collapsedCls, isExpanded);
+ }
+ }));
+ }
+});
+
+
+dojo.declare("dojox.widget.PortletFeedSettings",
+ dojox.widget.PortletSettings, {
+
+ // summary:
+ // A Settings widget designed to be used with a dojox.widget.FeedPortlet
+ // description:
+ // It provides form items that the user can use to change the URL
+ // for a feed to load into the FeedPortlet.
+ // There are two forms that it can take. <br>
+ // The first is to display a text field, with Load and Cancel buttons,
+ // which is prepopulated with the enclosing FeedPortlet's URL.
+ // If a <select> DOM node is used as the source node for this widget,
+ // it displays a list of predefined URLs that the user can select from
+ // to load into the enclosing FeedPortlet.
+ //
+ // example:
+ // <div dojoType="dojox.widget.PortletFeedSettings"></div>
+ //
+ // example:
+ // <select dojoType="dojox.widget.PortletFeedSettings">
+ // <option>http://www.dojotoolkit.org/aggregator/rss</option>
+ // <option>http://dojocampus.org/content/category/podcast/feed/</option>
+ // </select>
+
+ "class" : "dojoxPortletFeedSettings",
+
+ // urls: Array
+ // An array of JSON object specifying URLs to display in the
+ // PortletFeedSettings object. Each object contains a 'url' and 'label'
+ // attribute, e.g.
+ // [{url:'http:google.com', label:'Google'}, {url:'http://dojotoolkit.org', label: 'Dojo'}]
+ urls: null,
+
+ // selectedIndex: Number
+ // The selected URL. Defaults to zero.
+ selectedIndex: 0,
+
+ buildRendering: function(){
+ // If JSON URLs have been specified, create a SELECT DOM node,
+ // and insert the required OPTION elements.
+ var s;
+ if(this.urls && this.urls.length > 0){
+ console.log(this.id + " -> creating select with urls ", this.urls)
+ s = dojo.create("select");
+ if(this.srcNodeRef){
+ dojo.place(s, this.srcNodeRef, "before");
+ dojo.destroy(this.srcNodeRef);
+ }
+ this.srcNodeRef = s;
+ dojo.forEach(this.urls, function(url){
+ dojo.create("option", {value: url.url || url, innerHTML: url.label || url}, s);
+ });
+ }
+
+ // If the srcNodeRef is a SELECT node, then replace it with a DIV, and insert
+ // the SELECT node into that div.
+ if(this.srcNodeRef.tagName == "SELECT"){
+ this.text = this.srcNodeRef;
+ var div = dojo.create("div", {}, this.srcNodeRef, "before");
+ div.appendChild(this.text);
+ this.srcNodeRef = div;
+ dojo.query("option", this.text).filter("return !item.value;").forEach("item.value = item.innerHTML");
+ if(!this.text.value){
+ if(this.content && this.text.options.length == 0){
+ this.text.appendChild(this.content);
+ }
+ dojo.attr(s || this.text, "value", this.text.options[this.selectedIndex].value);
+ }
+ }
+ this.inherited(arguments);
+ },
+
+ _setContentAttr: function(){
+
+ },
+
+ postCreate: function(){
+ console.log(this.id + " -> postCreate");
+ if(!this.text){
+ // If a select node is not being used, create a new TextBox to
+ // edit the URL.
+ var text = this.text = new dijit.form.TextBox({});
+ dojo.create("span", {
+ innerHTML: "Choose Url: "
+ }, this.domNode);
+ this.addChild(text);
+ }
+
+ // Add a LOAD button
+ this.addChild(new dijit.form.Button({
+ label: "Load",
+ onClick: dojo.hitch(this, function(){
+ // Set the URL of the containing Portlet with the selected URL.
+ this.portlet.attr("url",
+ (this.text.tagName == "SELECT") ? this.text.value : this.text.attr('value'));
+ if(this.text.tagName == "SELECT"){
+ // Set the selected index on the Select node.
+ dojo.some(this.text.options, dojo.hitch(this, function(opt, idx){
+ if(opt.selected){
+ this.set("selectedIndex", idx);
+ return true;
+ }
+ return false;
+ }));
+ }
+ // Hide the widget.
+ this.toggle();
+ })
+ }));
+
+ // Add a CANCEL button, which hides this widget
+ this.addChild(new dijit.form.Button({
+ label: "Cancel",
+ onClick: dojo.hitch(this, "toggle")
+ }));
+ this.inherited(arguments);
+ },
+
+ startup: function(){
+ // summary:
+ // Sets the portlet associated with this PortletSettings object.
+ if(this._started){return;}
+ console.log(this.id + " -> startup");
+ this.inherited(arguments);
+
+ if(!this.portlet){
+ throw Error(this.declaredClass + ": A PortletFeedSettings widget cannot exist without a Portlet.");
+ }
+ if(this.text.tagName == "SELECT"){
+ // Set the initial selected option.
+ dojo.forEach(this.text.options, dojo.hitch(this, function(opt, index){
+ dojo.attr(opt, "selected", index == this.selectedIndex);
+ }));
+ }
+ var url = this.portlet.attr("url");
+ if(url){
+ // If a SELECT node is used to choose a URL, ensure that the Portlet's URL
+ // is one of the options.
+ if(this.text.tagName == "SELECT"){
+ if(!this.urls && dojo.query("option[value='" + url + "']", this.text).length < 1){
+ dojo.place(dojo.create("option", {
+ value: url,
+ innerHTML: url,
+ selected: "true"
+ }), this.text, "first");
+ }
+ }else{
+ this.text.attr("value", url);
+ }
+ }else{
+ this.portlet.attr("url", this.get("feedPortletUrl"));
+ }
+ },
+
+ _getFeedPortletUrlAttr: function(){
+ return this.text.value;
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/FeedPortlet.xd.js b/js/dojo-1.6/dojox/widget/FeedPortlet.xd.js new file mode 100644 index 0000000..4c7c21d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FeedPortlet.xd.js @@ -0,0 +1,459 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.FeedPortlet"],
+["require", "dojox.widget.Portlet"],
+["require", "dijit.Tooltip"],
+["require", "dijit.form.TextBox"],
+["require", "dijit.form.Button"],
+["require", "dojox.data.GoogleFeedStore"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.FeedPortlet"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FeedPortlet"] = true;
+dojo.provide("dojox.widget.FeedPortlet");
+dojo.require("dojox.widget.Portlet");
+dojo.require("dijit.Tooltip");
+dojo.require("dijit.form.TextBox");
+dojo.require("dijit.form.Button");
+dojo.require("dojox.data.GoogleFeedStore");
+
+dojo.declare("dojox.widget.FeedPortlet", dojox.widget.Portlet, {
+ // summary:
+ // A Portlet that loads a XML feed.
+ // description: The feed is displayed as
+ // an unordered list of links. When a link is hovered over
+ // by the mouse, it displays a summary in a tooltip.
+
+ // local: Boolean
+ // Specifies whether the feed is to be loaded from the same domain as the
+ // page, or a remote domain. If local is true, then the feed must be an
+ // Atom feed. If it is false, it can be an Atom or RSS feed.
+ local: false,
+
+ // maxResults: Number
+ // The number of results to display from the feed.
+ maxResults: 5,
+
+ // url: String
+ // The URL of the feed to load. If this is different to the domain
+ // of the HTML page, local should be set to false.
+ url: "",
+
+ // openNew: Boolean
+ // If true, when a link is clicked it will open in a new window.
+ // If false, it will not.
+ openNew: true,
+
+ // useFeedTitle: Boolean
+ // If true, the title of the loaded feed is displayed in the title bar of the portlet.
+ // If false, the title remains unchanged.
+ showFeedTitle: true,
+
+ postCreate: function(){
+ this.inherited(arguments);
+ if(this.local && !dojox.data.AtomReadStore){
+ throw Error(this.declaredClass + ": To use local feeds, you must include dojox.data.AtomReadStore on the page.");
+ }
+ },
+
+ onFeedError: function(){
+ // summary:
+ // Called when a feed fails to load successfully.
+ this.containerNode.innerHTML = "Error accessing the feed."
+ },
+
+ addChild: function(child){
+ this.inherited(arguments);
+ var url = child.attr("feedPortletUrl");
+ if(url){
+ this.set("url", url);
+ }
+ },
+
+ _getTitle: function(item){
+ // summary:
+ // Gets the title of a feed item.
+ var t = this.store.getValue(item, "title");
+ return this.local ? t.text : t;
+ },
+
+ _getLink: function(item){
+ // summary:
+ // Gets the href link of a feed item.
+ var l = this.store.getValue(item, "link");
+ return this.local ? l.href : l;
+ },
+
+ _getContent: function(item){
+ // summary:
+ // Gets the summary of a feed item.
+ var c = this.store.getValue(item, "summary");
+ if(!c){
+ return null;
+ }
+ if(this.local){
+ c = c.text;
+ }
+ // Filter out any sneaky scripts in the code
+ c = c.split("<script").join("<!--").split("</script>").join("-->");
+ c = c.split("<iframe").join("<!--").split("</iframe>").join("-->");
+ return c;
+
+ },
+
+ _setUrlAttr: function(url){
+ // summary:
+ // Sets the URL to load.
+ this.url = url;
+ if(this._started){
+ this.load();
+ }
+ },
+
+ startup: function(){
+ // summary:
+ // Loads the widget.
+ if(this.started || this._started){return;}
+
+ this.inherited(arguments);
+
+ if(!this.url || this.url == ""){
+ throw new Error(this.id + ": A URL must be specified for the feed portlet");
+ }
+ if(this.url && this.url != ""){
+ this.load();
+ }
+ },
+
+ load: function(){
+ // summary:
+ // Loads the feed.
+ if(this._resultList){
+ dojo.destroy(this._resultList);
+ }
+ var store, query;
+
+ // If the feed is on the same domain, use the AtomReadStore,
+ // as we cannot be guaranteed that it will be available to
+ // Google services.
+ if(this.local){
+ store = new dojox.data.AtomReadStore({
+ url: this.url
+ });
+ query = {};
+
+ }else{
+ store = new dojox.data.GoogleFeedStore();
+ query = {url: this.url};
+ }
+ var request = {
+ query: query,
+ count: this.maxResults,
+ onComplete: dojo.hitch(this, function(items){
+ if (this.showFeedTitle && store.getFeedValue) {
+ var title = this.store.getFeedValue("title");
+ if(title){
+ this.set("title", title.text ? title.text : title);
+ }
+ }
+ this.generateResults(items);
+ }),
+ onError: dojo.hitch(this, "onFeedError")
+ };
+
+ this.store = store;
+ store.fetch(request);
+ },
+
+ generateResults: function (items){
+ // summary:
+ // Generates a list of hyperlinks and displays a tooltip
+ // containing a summary when the mouse hovers over them.
+ var store = this.store;
+ var timer;
+ var ul = (this._resultList =
+ dojo.create("ul", {"class" : "dojoxFeedPortletList"}, this.containerNode));
+
+ dojo.forEach(items, dojo.hitch(this, function(item){
+ var li = dojo.create("li", {
+ innerHTML: '<a href="'
+ + this._getLink(item)
+ + '"'
+ + (this.openNew ? ' target="_blank"' : '')
+ +'>'
+ + this._getTitle(item) + '</a>'
+ },ul);
+
+ dojo.connect(li, "onmouseover", dojo.hitch(this, function(evt){
+ if(timer){
+ clearTimeout(timer);
+ }
+
+ // Show the tooltip after the mouse has been hovering
+ // for a short time.
+ timer = setTimeout(dojo.hitch(this, function(){
+ timer = null;
+ var summary = this._getContent(item);
+ if(!summary){return;}
+ var content = '<div class="dojoxFeedPortletPreview">'
+ + summary + '</div>'
+
+ dojo.query("li", ul).forEach(function(item){
+ if(item != evt.target){
+ dijit.hideTooltip(item);
+ }
+ });
+
+ // Hover the tooltip over the anchor tag
+ dijit.showTooltip(content, li.firstChild, !this.isLeftToRight());
+ }), 500);
+
+
+ }));
+
+ // Hide the tooltip when the mouse leaves a list item.
+ dojo.connect(li, "onmouseout", function(){
+ if(timer){
+ clearTimeout(timer);
+ timer = null;
+ }
+ dijit.hideTooltip(li.firstChild);
+ });
+ }));
+
+ this.resize();
+ }
+});
+
+dojo.declare("dojox.widget.ExpandableFeedPortlet", dojox.widget.FeedPortlet, {
+ // summary:
+ // A FeedPortlet that uses an list of expandable links to display
+ // a feed. An icon is placed to the left of each item
+ // which, when clicked, toggles the visible state
+ // of the item summary.
+
+ // onlyOpenOne: Boolean
+ // If true, only a single item can be expanded at any given time.
+ onlyOpenOne: false,
+
+ generateResults: function(items){
+ // summary:
+ // Generates a list of items, and places an icon beside them that
+ // can be used to show or hide a summary of that item.
+
+ var store = this.store;
+ var iconCls = "dojoxPortletToggleIcon";
+ var collapsedCls = "dojoxPortletItemCollapsed";
+ var expandedCls = "dojoxPortletItemOpen";
+
+ var timer;
+ var ul = (this._resultList = dojo.create("ul", {
+ "class": "dojoxFeedPortletExpandableList"
+ }, this.containerNode));
+
+ // Create the LI elements. Each LI has two DIV elements, the
+ // top DIV contains the toggle icon and title, and the bottom
+ // div contains the extended summary.
+ dojo.forEach(items, dojo.hitch(this, dojo.hitch(this, function(item){
+ var li = dojo.create("li", {"class": collapsedCls}, ul);
+ var upper = dojo.create("div", {style: "width: 100%;"}, li);
+ var lower = dojo.create("div", {"class": "dojoxPortletItemSummary", innerHTML: this._getContent(item)}, li);
+ dojo.create("span", {
+ "class": iconCls,
+ innerHTML: "<img src='" + dojo.config.baseUrl + "/resources/blank.gif'>"}, upper);
+ var a = dojo.create("a", {href: this._getLink(item), innerHTML: this._getTitle(item) }, upper);
+
+ if(this.openNew){
+ dojo.attr(a, "target", "_blank");
+ }
+ })));
+
+ // Catch all clicks on the list. If a toggle icon is clicked,
+ // toggle the visible state of the summary DIV.
+ dojo.connect(ul, "onclick", dojo.hitch(this, function(evt){
+ if(dojo.hasClass(evt.target, iconCls) || dojo.hasClass(evt.target.parentNode, iconCls)){
+ dojo.stopEvent(evt);
+ var li = evt.target.parentNode;
+ while(li.tagName != "LI"){
+ li = li.parentNode;
+ }
+ if(this.onlyOpenOne){
+ dojo.query("li", ul).filter(function(item){
+ return item != li;
+ }).removeClass(expandedCls).addClass(collapsedCls);
+ }
+ var isExpanded = dojo.hasClass(li, expandedCls);
+ dojo.toggleClass(li, expandedCls, !isExpanded);
+ dojo.toggleClass(li, collapsedCls, isExpanded);
+ }
+ }));
+ }
+});
+
+
+dojo.declare("dojox.widget.PortletFeedSettings",
+ dojox.widget.PortletSettings, {
+
+ // summary:
+ // A Settings widget designed to be used with a dojox.widget.FeedPortlet
+ // description:
+ // It provides form items that the user can use to change the URL
+ // for a feed to load into the FeedPortlet.
+ // There are two forms that it can take. <br>
+ // The first is to display a text field, with Load and Cancel buttons,
+ // which is prepopulated with the enclosing FeedPortlet's URL.
+ // If a <select> DOM node is used as the source node for this widget,
+ // it displays a list of predefined URLs that the user can select from
+ // to load into the enclosing FeedPortlet.
+ //
+ // example:
+ // <div dojoType="dojox.widget.PortletFeedSettings"></div>
+ //
+ // example:
+ // <select dojoType="dojox.widget.PortletFeedSettings">
+ // <option>http://www.dojotoolkit.org/aggregator/rss</option>
+ // <option>http://dojocampus.org/content/category/podcast/feed/</option>
+ // </select>
+
+ "class" : "dojoxPortletFeedSettings",
+
+ // urls: Array
+ // An array of JSON object specifying URLs to display in the
+ // PortletFeedSettings object. Each object contains a 'url' and 'label'
+ // attribute, e.g.
+ // [{url:'http:google.com', label:'Google'}, {url:'http://dojotoolkit.org', label: 'Dojo'}]
+ urls: null,
+
+ // selectedIndex: Number
+ // The selected URL. Defaults to zero.
+ selectedIndex: 0,
+
+ buildRendering: function(){
+ // If JSON URLs have been specified, create a SELECT DOM node,
+ // and insert the required OPTION elements.
+ var s;
+ if(this.urls && this.urls.length > 0){
+ console.log(this.id + " -> creating select with urls ", this.urls)
+ s = dojo.create("select");
+ if(this.srcNodeRef){
+ dojo.place(s, this.srcNodeRef, "before");
+ dojo.destroy(this.srcNodeRef);
+ }
+ this.srcNodeRef = s;
+ dojo.forEach(this.urls, function(url){
+ dojo.create("option", {value: url.url || url, innerHTML: url.label || url}, s);
+ });
+ }
+
+ // If the srcNodeRef is a SELECT node, then replace it with a DIV, and insert
+ // the SELECT node into that div.
+ if(this.srcNodeRef.tagName == "SELECT"){
+ this.text = this.srcNodeRef;
+ var div = dojo.create("div", {}, this.srcNodeRef, "before");
+ div.appendChild(this.text);
+ this.srcNodeRef = div;
+ dojo.query("option", this.text).filter("return !item.value;").forEach("item.value = item.innerHTML");
+ if(!this.text.value){
+ if(this.content && this.text.options.length == 0){
+ this.text.appendChild(this.content);
+ }
+ dojo.attr(s || this.text, "value", this.text.options[this.selectedIndex].value);
+ }
+ }
+ this.inherited(arguments);
+ },
+
+ _setContentAttr: function(){
+
+ },
+
+ postCreate: function(){
+ console.log(this.id + " -> postCreate");
+ if(!this.text){
+ // If a select node is not being used, create a new TextBox to
+ // edit the URL.
+ var text = this.text = new dijit.form.TextBox({});
+ dojo.create("span", {
+ innerHTML: "Choose Url: "
+ }, this.domNode);
+ this.addChild(text);
+ }
+
+ // Add a LOAD button
+ this.addChild(new dijit.form.Button({
+ label: "Load",
+ onClick: dojo.hitch(this, function(){
+ // Set the URL of the containing Portlet with the selected URL.
+ this.portlet.attr("url",
+ (this.text.tagName == "SELECT") ? this.text.value : this.text.attr('value'));
+ if(this.text.tagName == "SELECT"){
+ // Set the selected index on the Select node.
+ dojo.some(this.text.options, dojo.hitch(this, function(opt, idx){
+ if(opt.selected){
+ this.set("selectedIndex", idx);
+ return true;
+ }
+ return false;
+ }));
+ }
+ // Hide the widget.
+ this.toggle();
+ })
+ }));
+
+ // Add a CANCEL button, which hides this widget
+ this.addChild(new dijit.form.Button({
+ label: "Cancel",
+ onClick: dojo.hitch(this, "toggle")
+ }));
+ this.inherited(arguments);
+ },
+
+ startup: function(){
+ // summary:
+ // Sets the portlet associated with this PortletSettings object.
+ if(this._started){return;}
+ console.log(this.id + " -> startup");
+ this.inherited(arguments);
+
+ if(!this.portlet){
+ throw Error(this.declaredClass + ": A PortletFeedSettings widget cannot exist without a Portlet.");
+ }
+ if(this.text.tagName == "SELECT"){
+ // Set the initial selected option.
+ dojo.forEach(this.text.options, dojo.hitch(this, function(opt, index){
+ dojo.attr(opt, "selected", index == this.selectedIndex);
+ }));
+ }
+ var url = this.portlet.attr("url");
+ if(url){
+ // If a SELECT node is used to choose a URL, ensure that the Portlet's URL
+ // is one of the options.
+ if(this.text.tagName == "SELECT"){
+ if(!this.urls && dojo.query("option[value='" + url + "']", this.text).length < 1){
+ dojo.place(dojo.create("option", {
+ value: url,
+ innerHTML: url,
+ selected: "true"
+ }), this.text, "first");
+ }
+ }else{
+ this.text.attr("value", url);
+ }
+ }else{
+ this.portlet.attr("url", this.get("feedPortletUrl"));
+ }
+ },
+
+ _getFeedPortletUrlAttr: function(){
+ return this.text.value;
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/FilePicker.js b/js/dojo-1.6/dojox/widget/FilePicker.js new file mode 100644 index 0000000..bc1cf15 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FilePicker.js @@ -0,0 +1,234 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.FilePicker"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FilePicker"] = true;
+dojo.provide("dojox.widget.FilePicker");
+
+dojo.require("dojox.widget.RollingList");
+
+dojo.require("dojo.i18n");
+dojo.requireLocalization("dojox.widget", "FilePicker", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
+
+dojo.declare("dojox.widget._FileInfoPane",
+ [dojox.widget._RollingListPane], {
+ // summary: a pane to display the information for the currently-selected
+ // file
+
+ // templateString: string
+ // delete our template string
+ templateString: "",
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "FilePicker/_FileInfoPane.html", "<div class=\"dojoxFileInfoPane\">\r\n\t<table>\r\n\t\t<tbody>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dojoxFileInfoLabel dojoxFileInfoNameLabel\">${_messages.name}</td>\r\n\t\t\t\t<td class=\"dojoxFileInfoName\" dojoAttachPoint=\"nameNode\"></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dojoxFileInfoLabel dojoxFileInfoPathLabel\">${_messages.path}</td>\r\n\t\t\t\t<td class=\"dojoxFileInfoPath\" dojoAttachPoint=\"pathNode\"></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dojoxFileInfoLabel dojoxFileInfoSizeLabel\">${_messages.size}</td>\r\n\t\t\t\t<td class=\"dojoxFileInfoSize\" dojoAttachPoint=\"sizeNode\"></td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n\t<div dojoAttachPoint=\"containerNode\" style=\"display:none;\"></div>\r\n</div>\r\n"),
+
+ postMixInProperties: function(){
+ this._messages = dojo.i18n.getLocalization("dojox.widget", "FilePicker", this.lang);
+ this.inherited(arguments);
+ },
+
+ onItems: function(){
+ // summary:
+ // called after a fetch or load - at this point, this.items should be
+ // set and loaded.
+ var store = this.store, item = this.items[0];
+ if(!item){
+ this._onError("Load", new Error("No item defined"));
+ }else{
+ this.nameNode.innerHTML = store.getLabel(item);
+ this.pathNode.innerHTML = store.getIdentity(item);
+ this.sizeNode.innerHTML = store.getValue(item, "size");
+ this.parentWidget.scrollIntoView(this);
+ this.inherited(arguments);
+ }
+ }
+});
+
+dojo.declare("dojox.widget.FilePicker", dojox.widget.RollingList, {
+ // summary: a specialized version of RollingList that handles file information
+ // in a store
+
+ className: "dojoxFilePicker",
+
+ // pathSeparator: string
+ // Our file separator - it will be guessed if not set
+ pathSeparator: "",
+
+ // topDir: string
+ // The top directory string - it will be guessed if not set
+ topDir: "",
+
+ // parentAttr: string
+ // the attribute to read for finding our parent directory
+ parentAttr: "parentDir",
+
+ // pathAttr: string
+ // the attribute to read for getting the full path of our file
+ pathAttr: "path",
+
+ // preloadItems: boolean or int
+ // Set this to a sane number - since we expect to mostly be using the
+ // dojox.data.FileStore - which doesn't like loading lots of items
+ // all at once.
+ preloadItems: 50,
+
+ // selectDirectories: boolean
+ // whether or not we allow selection of directories - that is, whether or
+ // our value can be set to a directory.
+ selectDirectories: true,
+
+ // selectFiles: boolean
+ // whether or not we allow selection of files - that is, we will disable
+ // the file entries.
+ selectFiles: true,
+
+ _itemsMatch: function(/*item*/ item1, /*item*/ item2){
+ // Summary: returns whether or not the two items match - checks ID if
+ // they aren't the exact same object - ignoring trailing slashes
+ if(!item1 && !item2){
+ return true;
+ }else if(!item1 || !item2){
+ return false;
+ }else if(item1 == item2){
+ return true;
+ }else if (this._isIdentity){
+ var iArr = [ this.store.getIdentity(item1), this.store.getIdentity(item2) ];
+ dojo.forEach(iArr, function(i, idx){
+ if(i.lastIndexOf(this.pathSeparator) == (i.length - 1)){
+ iArr[idx] = i.substring(0, i.length - 1);
+ }else{
+ }
+ }, this);
+ return (iArr[0] == iArr[1]);
+ }
+ return false;
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ this.inherited(arguments);
+ // Figure out our file separator if we don't have it yet
+ var conn, child = this.getChildren()[0];
+ var setSeparator = dojo.hitch(this, function(){
+ if(conn){
+ this.disconnect(conn);
+ }
+ delete conn;
+ var item = child.items[0];
+ if(item){
+ var store = this.store;
+ var parent = store.getValue(item, this.parentAttr);
+ var path = store.getValue(item, this.pathAttr);
+ this.pathSeparator = this.pathSeparator || store.pathSeparator;
+ if(!this.pathSeparator){
+ this.pathSeparator = path.substring(parent.length, parent.length + 1);
+ }
+ if(!this.topDir){
+ this.topDir = parent;
+ if(this.topDir.lastIndexOf(this.pathSeparator) != (this.topDir.length - 1)){
+ this.topDir += this.pathSeparator;
+ }
+ }
+ }
+ });
+ if(!this.pathSeparator || !this.topDir){
+ if(!child.items){
+ conn = this.connect(child, "onItems", setSeparator);
+ }else{
+ setSeparator();
+ }
+ }
+ },
+
+ getChildItems: function(item){
+ var ret = this.inherited(arguments);
+ if(!ret && this.store.getValue(item, "directory")){
+ // It's an empty directory - so pass through an empty array
+ ret = [];
+ }
+ return ret;
+ },
+
+ getMenuItemForItem: function(/*item*/ item, /* dijit._Contained */ parentPane, /* item[]? */ children){
+ var menuOptions = {iconClass: "dojoxDirectoryItemIcon"};
+ if(!this.store.getValue(item, "directory")){
+ menuOptions.iconClass = "dojoxFileItemIcon";
+ var l = this.store.getLabel(item), idx = l.lastIndexOf(".");
+ if(idx >= 0){
+ menuOptions.iconClass += " dojoxFileItemIcon_" + l.substring(idx + 1);
+ }
+ if(!this.selectFiles){
+ menuOptions.disabled = true;
+ }
+ }
+ var ret = new dijit.MenuItem(menuOptions);
+ return ret;
+ },
+
+ getPaneForItem: function(/*item*/ item, /* dijit._Contained */ parentPane, /* item[]? */ children){
+ var ret = null;
+ if(!item || (this.store.isItem(item) && this.store.getValue(item, "directory"))){
+ ret = new dojox.widget._RollingListGroupPane({});
+ }else if(this.store.isItem(item) && !this.store.getValue(item, "directory")){
+ ret = new dojox.widget._FileInfoPane({});
+ }
+ return ret;
+ },
+
+ _setPathValueAttr: function(/*string*/ path, /*boolean?*/ resetLastExec, /*function?*/ onSet){
+ // Summary: sets the value of this widget based off the given path
+ if(!path){
+ this.set("value", null);
+ return;
+ }
+ if(path.lastIndexOf(this.pathSeparator) == (path.length - 1)){
+ path = path.substring(0, path.length - 1);
+ }
+ this.store.fetchItemByIdentity({identity: path,
+ onItem: function(v){
+ if(resetLastExec){
+ this._lastExecutedValue = v;
+ }
+ this.set("value", v);
+ if(onSet){ onSet(); }
+ },
+ scope: this});
+ },
+
+ _getPathValueAttr: function(/*item?*/val){
+ // summary: returns the path value of the given value (or current value
+ // if not passed a value)
+ if(!val){
+ val = this.value;
+ }
+ if(val && this.store.isItem(val)){
+ return this.store.getValue(val, this.pathAttr);
+ }else{
+ return "";
+ }
+ },
+
+ _setValue: function(/* item */ value){
+ // summary: internally sets the value and fires onchange
+ delete this._setInProgress;
+ var store = this.store;
+ if(value && store.isItem(value)){
+ var isDirectory = this.store.getValue(value, "directory");
+ if((isDirectory && !this.selectDirectories) ||
+ (!isDirectory && !this.selectFiles)){ return; }
+ }else{
+ value = null;
+ }
+ if(!this._itemsMatch(this.value, value)){
+ this.value = value;
+ this._onChange(value);
+ }
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/FilePicker.xd.js new file mode 100644 index 0000000..e0b20a4 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FilePicker.xd.js @@ -0,0 +1,241 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.FilePicker"],
+["require", "dojox.widget.RollingList"],
+["require", "dojo.i18n"],
+["requireLocalization", "dojox.widget", "FilePicker", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw", "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.FilePicker"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FilePicker"] = true;
+dojo.provide("dojox.widget.FilePicker");
+
+dojo.require("dojox.widget.RollingList");
+
+dojo.require("dojo.i18n");
+;
+
+dojo.declare("dojox.widget._FileInfoPane",
+ [dojox.widget._RollingListPane], {
+ // summary: a pane to display the information for the currently-selected
+ // file
+
+ // templateString: string
+ // delete our template string
+ templateString: "",
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "FilePicker/_FileInfoPane.html", "<div class=\"dojoxFileInfoPane\">\r\n\t<table>\r\n\t\t<tbody>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dojoxFileInfoLabel dojoxFileInfoNameLabel\">${_messages.name}</td>\r\n\t\t\t\t<td class=\"dojoxFileInfoName\" dojoAttachPoint=\"nameNode\"></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dojoxFileInfoLabel dojoxFileInfoPathLabel\">${_messages.path}</td>\r\n\t\t\t\t<td class=\"dojoxFileInfoPath\" dojoAttachPoint=\"pathNode\"></td>\r\n\t\t\t</tr>\r\n\t\t\t<tr>\r\n\t\t\t\t<td class=\"dojoxFileInfoLabel dojoxFileInfoSizeLabel\">${_messages.size}</td>\r\n\t\t\t\t<td class=\"dojoxFileInfoSize\" dojoAttachPoint=\"sizeNode\"></td>\r\n\t\t\t</tr>\r\n\t\t</tbody>\r\n\t</table>\r\n\t<div dojoAttachPoint=\"containerNode\" style=\"display:none;\"></div>\r\n</div>\r\n"),
+
+ postMixInProperties: function(){
+ this._messages = dojo.i18n.getLocalization("dojox.widget", "FilePicker", this.lang);
+ this.inherited(arguments);
+ },
+
+ onItems: function(){
+ // summary:
+ // called after a fetch or load - at this point, this.items should be
+ // set and loaded.
+ var store = this.store, item = this.items[0];
+ if(!item){
+ this._onError("Load", new Error("No item defined"));
+ }else{
+ this.nameNode.innerHTML = store.getLabel(item);
+ this.pathNode.innerHTML = store.getIdentity(item);
+ this.sizeNode.innerHTML = store.getValue(item, "size");
+ this.parentWidget.scrollIntoView(this);
+ this.inherited(arguments);
+ }
+ }
+});
+
+dojo.declare("dojox.widget.FilePicker", dojox.widget.RollingList, {
+ // summary: a specialized version of RollingList that handles file information
+ // in a store
+
+ className: "dojoxFilePicker",
+
+ // pathSeparator: string
+ // Our file separator - it will be guessed if not set
+ pathSeparator: "",
+
+ // topDir: string
+ // The top directory string - it will be guessed if not set
+ topDir: "",
+
+ // parentAttr: string
+ // the attribute to read for finding our parent directory
+ parentAttr: "parentDir",
+
+ // pathAttr: string
+ // the attribute to read for getting the full path of our file
+ pathAttr: "path",
+
+ // preloadItems: boolean or int
+ // Set this to a sane number - since we expect to mostly be using the
+ // dojox.data.FileStore - which doesn't like loading lots of items
+ // all at once.
+ preloadItems: 50,
+
+ // selectDirectories: boolean
+ // whether or not we allow selection of directories - that is, whether or
+ // our value can be set to a directory.
+ selectDirectories: true,
+
+ // selectFiles: boolean
+ // whether or not we allow selection of files - that is, we will disable
+ // the file entries.
+ selectFiles: true,
+
+ _itemsMatch: function(/*item*/ item1, /*item*/ item2){
+ // Summary: returns whether or not the two items match - checks ID if
+ // they aren't the exact same object - ignoring trailing slashes
+ if(!item1 && !item2){
+ return true;
+ }else if(!item1 || !item2){
+ return false;
+ }else if(item1 == item2){
+ return true;
+ }else if (this._isIdentity){
+ var iArr = [ this.store.getIdentity(item1), this.store.getIdentity(item2) ];
+ dojo.forEach(iArr, function(i, idx){
+ if(i.lastIndexOf(this.pathSeparator) == (i.length - 1)){
+ iArr[idx] = i.substring(0, i.length - 1);
+ }else{
+ }
+ }, this);
+ return (iArr[0] == iArr[1]);
+ }
+ return false;
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ this.inherited(arguments);
+ // Figure out our file separator if we don't have it yet
+ var conn, child = this.getChildren()[0];
+ var setSeparator = dojo.hitch(this, function(){
+ if(conn){
+ this.disconnect(conn);
+ }
+ delete conn;
+ var item = child.items[0];
+ if(item){
+ var store = this.store;
+ var parent = store.getValue(item, this.parentAttr);
+ var path = store.getValue(item, this.pathAttr);
+ this.pathSeparator = this.pathSeparator || store.pathSeparator;
+ if(!this.pathSeparator){
+ this.pathSeparator = path.substring(parent.length, parent.length + 1);
+ }
+ if(!this.topDir){
+ this.topDir = parent;
+ if(this.topDir.lastIndexOf(this.pathSeparator) != (this.topDir.length - 1)){
+ this.topDir += this.pathSeparator;
+ }
+ }
+ }
+ });
+ if(!this.pathSeparator || !this.topDir){
+ if(!child.items){
+ conn = this.connect(child, "onItems", setSeparator);
+ }else{
+ setSeparator();
+ }
+ }
+ },
+
+ getChildItems: function(item){
+ var ret = this.inherited(arguments);
+ if(!ret && this.store.getValue(item, "directory")){
+ // It's an empty directory - so pass through an empty array
+ ret = [];
+ }
+ return ret;
+ },
+
+ getMenuItemForItem: function(/*item*/ item, /* dijit._Contained */ parentPane, /* item[]? */ children){
+ var menuOptions = {iconClass: "dojoxDirectoryItemIcon"};
+ if(!this.store.getValue(item, "directory")){
+ menuOptions.iconClass = "dojoxFileItemIcon";
+ var l = this.store.getLabel(item), idx = l.lastIndexOf(".");
+ if(idx >= 0){
+ menuOptions.iconClass += " dojoxFileItemIcon_" + l.substring(idx + 1);
+ }
+ if(!this.selectFiles){
+ menuOptions.disabled = true;
+ }
+ }
+ var ret = new dijit.MenuItem(menuOptions);
+ return ret;
+ },
+
+ getPaneForItem: function(/*item*/ item, /* dijit._Contained */ parentPane, /* item[]? */ children){
+ var ret = null;
+ if(!item || (this.store.isItem(item) && this.store.getValue(item, "directory"))){
+ ret = new dojox.widget._RollingListGroupPane({});
+ }else if(this.store.isItem(item) && !this.store.getValue(item, "directory")){
+ ret = new dojox.widget._FileInfoPane({});
+ }
+ return ret;
+ },
+
+ _setPathValueAttr: function(/*string*/ path, /*boolean?*/ resetLastExec, /*function?*/ onSet){
+ // Summary: sets the value of this widget based off the given path
+ if(!path){
+ this.set("value", null);
+ return;
+ }
+ if(path.lastIndexOf(this.pathSeparator) == (path.length - 1)){
+ path = path.substring(0, path.length - 1);
+ }
+ this.store.fetchItemByIdentity({identity: path,
+ onItem: function(v){
+ if(resetLastExec){
+ this._lastExecutedValue = v;
+ }
+ this.set("value", v);
+ if(onSet){ onSet(); }
+ },
+ scope: this});
+ },
+
+ _getPathValueAttr: function(/*item?*/val){
+ // summary: returns the path value of the given value (or current value
+ // if not passed a value)
+ if(!val){
+ val = this.value;
+ }
+ if(val && this.store.isItem(val)){
+ return this.store.getValue(val, this.pathAttr);
+ }else{
+ return "";
+ }
+ },
+
+ _setValue: function(/* item */ value){
+ // summary: internally sets the value and fires onchange
+ delete this._setInProgress;
+ var store = this.store;
+ if(value && store.isItem(value)){
+ var isDirectory = this.store.getValue(value, "directory");
+ if((isDirectory && !this.selectDirectories) ||
+ (!isDirectory && !this.selectFiles)){ return; }
+ }else{
+ value = null;
+ }
+ if(!this._itemsMatch(this.value, value)){
+ this.value = value;
+ this._onChange(value);
+ }
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/FilePicker/FilePicker.css b/js/dojo-1.6/dojox/widget/FilePicker/FilePicker.css new file mode 100644 index 0000000..fefea25 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FilePicker/FilePicker.css @@ -0,0 +1,76 @@ +@import url("../RollingList/RollingList.css"); + +.dojoxFileInfoPane *{ + white-space: normal; +} + +.dojoxFileInfoLabel { + font-weight: bold; + white-space: nowrap; +} + +.dojoxFileInfoPane { + width: 20em; +} + +.tundra .dojoxFilePickerItem .dijitMenuItemIcon { + background-image: url("images/tundraFileIcons.gif"); + background-repeat: no-repeat; +} +.tundra .dojoxFilePickerItem .dojoxEmpty { + background-image: none; +} +.tundra .dojoxFilePickerItem .dojoxDirectoryItemIcon { + background-position: 0px; +} +.tundra .dojoxFilePickerItemSelected .dojoxDirectoryItemIcon { + background-position: -16px; +} +.tundra .dojoxFilePickerItem .dojoxFileItemIcon { + background-position: -32px; +} +.tundra .dojoxFilePickerItemSelected .dojoxFileItemIcon { + background-position: -48px; +} + +.soria .dojoxFilePickerItem .dijitMenuItemIcon { + background-image: url("images/soriaFileIcons.gif"); + background-repeat: no-repeat; +} +.soria .dojoxFilePickerItem .dojoxEmpty { + background-image: none; +} +.soria .dojoxFilePickerItem .dojoxDirectoryItemIcon { + background-position: 0px; +} +.soria .dojoxFilePickerItemSelected .dojoxDirectoryItemIcon { + background-position: -16px; +} +.soria .dojoxFilePickerItem .dojoxFileItemIcon { + background-position: -32px; +} +.soria .dojoxFilePickerItemSelected .dojoxFileItemIcon { + background-position: -48px; +} + + +.nihilo .dojoxFilePickerItem .dijitMenuItemIcon { + background-image: url("images/nihiloFileIcons.gif"); + background-repeat: no-repeat; +} +.nihilo .dojoxFilePickerItem .dojoxEmpty { + background-image: none; +} +.nihilo .dojoxFilePickerItem .dojoxDirectoryItemIcon { + background-position: 0px; +} +.nihilo .dojoxFilePickerItemSelected .dojoxDirectoryItemIcon { + background-position: -16px; +} +.nihilo .dojoxFilePickerItem .dojoxFileItemIcon { + background-position: -32px; +} +.nihilo .dojoxFilePickerItemSelected .dojoxFileItemIcon { + background-position: -48px; +} + diff --git a/js/dojo-1.6/dojox/widget/FilePicker/_FileInfoPane.html b/js/dojo-1.6/dojox/widget/FilePicker/_FileInfoPane.html new file mode 100644 index 0000000..4a45e61 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FilePicker/_FileInfoPane.html @@ -0,0 +1,19 @@ +<div class="dojoxFileInfoPane"> + <table> + <tbody> + <tr> + <td class="dojoxFileInfoLabel dojoxFileInfoNameLabel">${_messages.name}</td> + <td class="dojoxFileInfoName" dojoAttachPoint="nameNode"></td> + </tr> + <tr> + <td class="dojoxFileInfoLabel dojoxFileInfoPathLabel">${_messages.path}</td> + <td class="dojoxFileInfoPath" dojoAttachPoint="pathNode"></td> + </tr> + <tr> + <td class="dojoxFileInfoLabel dojoxFileInfoSizeLabel">${_messages.size}</td> + <td class="dojoxFileInfoSize" dojoAttachPoint="sizeNode"></td> + </tr> + </tbody> + </table> + <div dojoAttachPoint="containerNode" style="display:none;"></div> +</div>
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/FilePicker/images/nihiloFileIcons.gif b/js/dojo-1.6/dojox/widget/FilePicker/images/nihiloFileIcons.gif Binary files differnew file mode 100644 index 0000000..f029204 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FilePicker/images/nihiloFileIcons.gif diff --git a/js/dojo-1.6/dojox/widget/FilePicker/images/soriaFileIcons.gif b/js/dojo-1.6/dojox/widget/FilePicker/images/soriaFileIcons.gif Binary files differnew file mode 100644 index 0000000..8087146 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FilePicker/images/soriaFileIcons.gif diff --git a/js/dojo-1.6/dojox/widget/FilePicker/images/tundraFileIcons.gif b/js/dojo-1.6/dojox/widget/FilePicker/images/tundraFileIcons.gif Binary files differnew file mode 100644 index 0000000..744525e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FilePicker/images/tundraFileIcons.gif diff --git a/js/dojo-1.6/dojox/widget/FisheyeList.js b/js/dojo-1.6/dojox/widget/FisheyeList.js new file mode 100644 index 0000000..de3987e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FisheyeList.js @@ -0,0 +1,720 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.FisheyeList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FisheyeList"] = true;
+dojo.provide("dojox.widget.FisheyeList");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dijit._Container");
+dojo.require("dijit._Contained");
+
+dojo.declare("dojox.widget.FisheyeList", [dijit._Widget, dijit._Templated, dijit._Container], {
+ // summary:
+ // Menu similar to the fish eye menu on the Mac OS
+ // example:
+ // | <div dojoType="FisheyeList"
+ // | itemWidth="40" itemHeight="40"
+ // | itemMaxWidth="150" itemMaxHeight="150"
+ // | orientation="horizontal"
+ // | effectUnits="2"
+ // | itemPadding="10"
+ // | attachEdge="center"
+ // | labelEdge="bottom">
+ // |
+ // | <div dojoType="FisheyeListItem"
+ // | id="item1"
+ // | onclick="alert('click on' + this.label + '(from widget id ' + this.widgetId + ')!');"
+ // | label="Item 1"
+ // | iconSrc="images/fisheye_1.png">
+ // | </div>
+ // | ...
+ // | </div>
+ //
+ constructor: function(){
+ //
+ // TODO
+ // fix really long labels in vertical mode
+ //
+
+ this.pos = {'x': -1, 'y': -1}; // current cursor position, relative to the grid
+
+ // for conservative trigger mode, when triggered, timerScale is gradually increased from 0 to 1
+ this.timerScale = 1.0;
+
+ },
+
+ EDGE: {
+ CENTER: 0,
+ LEFT: 1,
+ RIGHT: 2,
+ TOP: 3,
+ BOTTOM: 4
+ },
+
+ templateString: '<div class="dojoxFisheyeListBar" dojoAttachPoint="containerNode"></div>',
+
+ snarfChildDomOutput: true,
+
+ // itemWidth: Integer
+ // width of menu item (in pixels) in it's dormant state (when the mouse is far away)
+ itemWidth: 40,
+
+ // itemHeight: Integer
+ // height of menu item (in pixels) in it's dormant state (when the mouse is far away)
+ itemHeight: 40,
+
+ // itemMaxWidth: Integer
+ // width of menu item (in pixels) in it's fully enlarged state (when the mouse is directly over it)
+ itemMaxWidth: 150,
+
+ // itemMaxHeight: Integer
+ // height of menu item (in pixels) in it's fully enlarged state (when the mouse is directly over it)
+ itemMaxHeight: 150,
+
+ imgNode: null,
+
+ // orientation: String
+ // orientation of the menu, either "horizontal" or "vertical"
+ orientation: 'horizontal',
+
+ // isFixed: Boolean
+ // toggle to enable additional listener (window scroll) if FisheyeList is in a fixed postion
+ isFixed: false,
+
+ // conservativeTrigger: Boolean
+ // if true, don't start enlarging menu items until mouse is over an image;
+ // if false, start enlarging menu items as the mouse moves near them.
+ conservativeTrigger: false,
+
+ // effectUnits: Number
+ // controls how much reaction the menu makes, relative to the distance of the mouse from the menu
+ effectUnits: 2,
+
+ // itemPadding: Integer
+ // padding (in pixels) betweeen each menu item
+ itemPadding: 10,
+
+ // attachEdge: String
+ // controls the border that the menu items don't expand past;
+ // for example, if set to "top", then the menu items will drop downwards as they expand.
+ // values
+ // "center", "left", "right", "top", "bottom".
+ attachEdge: 'center',
+
+ // labelEdge: String
+ // controls were the labels show up in relation to the menu item icons
+ // values
+ // "center", "left", "right", "top", "bottom".
+ labelEdge: 'bottom',
+
+ postCreate: function(){
+ var e = this.EDGE;
+ dojo.setSelectable(this.domNode, false);
+
+ var isHorizontal = this.isHorizontal = (this.orientation == 'horizontal');
+ this.selectedNode = -1;
+
+ this.isOver = false;
+ this.hitX1 = -1;
+ this.hitY1 = -1;
+ this.hitX2 = -1;
+ this.hitY2 = -1;
+
+ //
+ // only some edges make sense...
+ //
+ this.anchorEdge = this._toEdge(this.attachEdge, e.CENTER);
+ this.labelEdge = this._toEdge(this.labelEdge, e.TOP);
+
+ if(this.labelEdge == e.CENTER){ this.labelEdge = e.TOP; }
+
+ if(isHorizontal){
+ if(this.anchorEdge == e.LEFT){ this.anchorEdge = e.CENTER; }
+ if(this.anchorEdge == e.RIGHT){ this.anchorEdge = e.CENTER; }
+ if(this.labelEdge == e.LEFT){ this.labelEdge = e.TOP; }
+ if(this.labelEdge == e.RIGHT){ this.labelEdge = e.TOP; }
+ }else{
+ if(this.anchorEdge == e.TOP){ this.anchorEdge = e.CENTER; }
+ if(this.anchorEdge == e.BOTTOM){ this.anchorEdge = e.CENTER; }
+ if(this.labelEdge == e.TOP){ this.labelEdge = e.LEFT; }
+ if(this.labelEdge == e.BOTTOM){ this.labelEdge = e.LEFT; }
+ }
+
+ //
+ // figure out the proximity size
+ //
+ var effectUnits = this.effectUnits;
+ this.proximityLeft = this.itemWidth * (effectUnits - 0.5);
+ this.proximityRight = this.itemWidth * (effectUnits - 0.5);
+ this.proximityTop = this.itemHeight * (effectUnits - 0.5);
+ this.proximityBottom = this.itemHeight * (effectUnits - 0.5);
+
+ if(this.anchorEdge == e.LEFT){
+ this.proximityLeft = 0;
+ }
+ if(this.anchorEdge == e.RIGHT){
+ this.proximityRight = 0;
+ }
+ if(this.anchorEdge == e.TOP){
+ this.proximityTop = 0;
+ }
+ if(this.anchorEdge == e.BOTTOM){
+ this.proximityBottom = 0;
+ }
+ if(this.anchorEdge == e.CENTER){
+ this.proximityLeft /= 2;
+ this.proximityRight /= 2;
+ this.proximityTop /= 2;
+ this.proximityBottom /= 2;
+ }
+ },
+
+ startup: function(){
+ // summary: create our connections and setup our FisheyeList
+ this.children = this.getChildren();
+ //original postCreate() --tk
+ this._initializePositioning();
+
+ //
+ // in liberal trigger mode, activate menu whenever mouse is close
+ //
+ if(!this.conservativeTrigger){
+ this._onMouseMoveHandle = dojo.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
+ }
+ if(this.isFixed){
+ this._onScrollHandle = dojo.connect(document,"onscroll",this,"_onScroll");
+ }
+
+ // Deactivate the menu if mouse is moved off screen (doesn't work for FF?)
+ this._onMouseOutHandle = dojo.connect(document.documentElement, "onmouseout", this, "_onBodyOut");
+ this._addChildHandle = dojo.connect(this, "addChild", this, "_initializePositioning");
+ this._onResizeHandle = dojo.connect(window,"onresize", this, "_initializePositioning");
+ },
+
+ _initializePositioning: function(){
+ this.itemCount = this.children.length;
+
+ this.barWidth = (this.isHorizontal ? this.itemCount : 1) * this.itemWidth;
+ this.barHeight = (this.isHorizontal ? 1 : this.itemCount) * this.itemHeight;
+
+ this.totalWidth = this.proximityLeft + this.proximityRight + this.barWidth;
+ this.totalHeight = this.proximityTop + this.proximityBottom + this.barHeight;
+
+ //
+ // calculate effect ranges for each item
+ //
+
+ for(var i=0; i<this.children.length; i++){
+
+ this.children[i].posX = this.itemWidth * (this.isHorizontal ? i : 0);
+ this.children[i].posY = this.itemHeight * (this.isHorizontal ? 0 : i);
+
+ this.children[i].cenX = this.children[i].posX + (this.itemWidth / 2);
+ this.children[i].cenY = this.children[i].posY + (this.itemHeight / 2);
+
+ var isz = this.isHorizontal ? this.itemWidth : this.itemHeight;
+ var r = this.effectUnits * isz;
+ var c = this.isHorizontal ? this.children[i].cenX : this.children[i].cenY;
+ var lhs = this.isHorizontal ? this.proximityLeft : this.proximityTop;
+ var rhs = this.isHorizontal ? this.proximityRight : this.proximityBottom;
+ var siz = this.isHorizontal ? this.barWidth : this.barHeight;
+
+ var range_lhs = r;
+ var range_rhs = r;
+
+ if(range_lhs > c+lhs){ range_lhs = c+lhs; }
+ if(range_rhs > (siz-c+rhs)){ range_rhs = siz-c+rhs; }
+
+ this.children[i].effectRangeLeft = range_lhs / isz;
+ this.children[i].effectRangeRght = range_rhs / isz;
+
+ //dojo.debug('effect range for '+i+' is '+range_lhs+'/'+range_rhs);
+ }
+
+ //
+ // create the bar
+ //
+ this.domNode.style.width = this.barWidth + 'px';
+ this.domNode.style.height = this.barHeight + 'px';
+
+ //
+ // position the items
+ //
+ for(i=0; i<this.children.length; i++){
+ var itm = this.children[i];
+ var elm = itm.domNode;
+ elm.style.left = itm.posX + 'px';
+ elm.style.top = itm.posY + 'px';
+ elm.style.width = this.itemWidth + 'px';
+ elm.style.height = this.itemHeight + 'px';
+
+ itm.imgNode.style.left = this.itemPadding+'%';
+ itm.imgNode.style.top = this.itemPadding+'%';
+ itm.imgNode.style.width = (100 - 2 * this.itemPadding) + '%';
+ itm.imgNode.style.height = (100 - 2 * this.itemPadding) + '%';
+ }
+
+ //
+ // calc the grid
+ //
+ this._calcHitGrid();
+ },
+
+ _overElement: function(/* DomNode|String */node, /* Event */e){
+ // summary:
+ // Returns whether the mouse is over the passed element.
+ // Node: Must must be display:block (ie, not a <span>)
+ node = dojo.byId(node);
+ var mouse = {x: e.pageX, y: e.pageY};
+ var bb = dojo._getBorderBox(node);
+ var absolute = dojo.coords(node, true);
+ var top = absolute.y;
+ var bottom = top + bb.h;
+ var left = absolute.x;
+ var right = left + bb.w;
+
+ return (mouse.x >= left
+ && mouse.x <= right
+ && mouse.y >= top
+ && mouse.y <= bottom
+ ); // boolean
+ },
+
+ _onBodyOut: function(/*Event*/ e){
+ // clicking over an object inside of body causes this event to fire; ignore that case
+ if( this._overElement(dojo.body(), e) ){
+ return;
+ }
+ this._setDormant(e);
+ },
+
+ _setDormant: function(/*Event*/ e){
+ // summary: called when mouse moves out of menu's range
+
+ if(!this.isOver){ return; } // already dormant?
+ this.isOver = false;
+
+ if(this.conservativeTrigger){
+ // user can't re-trigger the menu expansion
+ // until he mouses over a icon again
+ dojo.disconnect(this._onMouseMoveHandle);
+ }
+ this._onGridMouseMove(-1, -1);
+ },
+
+ _setActive: function(/*Event*/ e){
+ // summary: called when mouse is moved into menu's range
+
+ if(this.isOver){ return; } // already activated?
+ this.isOver = true;
+
+ if(this.conservativeTrigger){
+ // switch event handlers so that we handle mouse events from anywhere near
+ // the menu
+ this._onMouseMoveHandle = dojo.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
+
+ this.timerScale=0.0;
+
+ // call mouse handler to do some initial necessary calculations/positioning
+ this._onMouseMove(e);
+
+ // slowly expand the icon size so it isn't jumpy
+ this._expandSlowly();
+ }
+ },
+
+ _onMouseMove: function(/*Event*/ e){
+ // summary: called when mouse is moved
+ if( (e.pageX >= this.hitX1) && (e.pageX <= this.hitX2) &&
+ (e.pageY >= this.hitY1) && (e.pageY <= this.hitY2) ){
+ if(!this.isOver){
+ this._setActive(e);
+ }
+ this._onGridMouseMove(e.pageX-this.hitX1, e.pageY-this.hitY1);
+ }else{
+ if(this.isOver){
+ this._setDormant(e);
+ }
+ }
+ },
+
+ _onScroll: function(){
+ this._calcHitGrid();
+ },
+
+ onResized: function(){
+ this._calcHitGrid();
+ },
+
+ _onGridMouseMove: function(x, y){
+ // summary: called when mouse is moved in the vicinity of the menu
+ this.pos = {x:x, y:y};
+ this._paint();
+ },
+
+ _paint: function(){
+ var x=this.pos.x;
+ var y=this.pos.y;
+
+ if(this.itemCount <= 0){ return; }
+
+ //
+ // figure out our main index
+ //
+ var pos = this.isHorizontal ? x : y;
+ var prx = this.isHorizontal ? this.proximityLeft : this.proximityTop;
+ var siz = this.isHorizontal ? this.itemWidth : this.itemHeight;
+ var sim = this.isHorizontal ?
+ (1.0-this.timerScale)*this.itemWidth + this.timerScale*this.itemMaxWidth :
+ (1.0-this.timerScale)*this.itemHeight + this.timerScale*this.itemMaxHeight ;
+
+ var cen = ((pos - prx) / siz) - 0.5;
+ var max_off_cen = (sim / siz) - 0.5;
+
+ if(max_off_cen > this.effectUnits){ max_off_cen = this.effectUnits; }
+
+ //
+ // figure out our off-axis weighting
+ //
+ var off_weight = 0, cen2;
+
+ if(this.anchorEdge == this.EDGE.BOTTOM){
+ cen2 = (y - this.proximityTop) / this.itemHeight;
+ off_weight = (cen2 > 0.5) ? 1 : y / (this.proximityTop + (this.itemHeight / 2));
+ }
+ if(this.anchorEdge == this.EDGE.TOP){
+ cen2 = (y - this.proximityTop) / this.itemHeight;
+ off_weight = (cen2 < 0.5) ? 1 : (this.totalHeight - y) / (this.proximityBottom + (this.itemHeight / 2));
+ }
+ if(this.anchorEdge == this.EDGE.RIGHT){
+ cen2 = (x - this.proximityLeft) / this.itemWidth;
+ off_weight = (cen2 > 0.5) ? 1 : x / (this.proximityLeft + (this.itemWidth / 2));
+ }
+ if(this.anchorEdge == this.EDGE.LEFT){
+ cen2 = (x - this.proximityLeft) / this.itemWidth;
+ off_weight = (cen2 < 0.5) ? 1 : (this.totalWidth - x) / (this.proximityRight + (this.itemWidth / 2));
+ }
+ if(this.anchorEdge == this.EDGE.CENTER){
+ if(this.isHorizontal){
+ off_weight = y / (this.totalHeight);
+ }else{
+ off_weight = x / (this.totalWidth);
+ }
+
+ if(off_weight > 0.5){
+ off_weight = 1 - off_weight;
+ }
+
+ off_weight *= 2;
+ }
+
+ //
+ // set the sizes
+ //
+ for(var i=0; i<this.itemCount; i++){
+ var weight = this._weighAt(cen, i);
+ if(weight < 0){weight = 0;}
+ this._setItemSize(i, weight * off_weight);
+ }
+
+ //
+ // set the positions
+ //
+
+ var main_p = Math.round(cen);
+ var offset = 0;
+
+ if(cen < 0){
+
+ main_p = 0;
+
+ }else if(cen > this.itemCount - 1){
+
+ main_p = this.itemCount -1;
+
+ }else{
+
+ offset = (cen - main_p) * ((this.isHorizontal ? this.itemWidth : this.itemHeight) - this.children[main_p].sizeMain);
+ }
+
+ this._positionElementsFrom(main_p, offset);
+ },
+
+ _weighAt: function(/*Integer*/ cen, /*Integer*/ i){
+ var dist = Math.abs(cen - i);
+ var limit = ((cen - i) > 0) ? this.children[i].effectRangeRght : this.children[i].effectRangeLeft;
+ return (dist > limit) ? 0 : (1 - dist / limit); // Integer
+ },
+
+ _setItemSize: function(p, scale){
+ if(this.children[p].scale == scale){ return; }
+ this.children[p].scale = scale;
+
+ scale *= this.timerScale;
+ var w = Math.round(this.itemWidth + ((this.itemMaxWidth - this.itemWidth ) * scale));
+ var h = Math.round(this.itemHeight + ((this.itemMaxHeight - this.itemHeight) * scale));
+
+ if(this.isHorizontal){
+
+ this.children[p].sizeW = w;
+ this.children[p].sizeH = h;
+
+ this.children[p].sizeMain = w;
+ this.children[p].sizeOff = h;
+
+ var y = 0;
+ if(this.anchorEdge == this.EDGE.TOP){
+ y = (this.children[p].cenY - (this.itemHeight / 2));
+ }else if(this.anchorEdge == this.EDGE.BOTTOM){
+ y = (this.children[p].cenY - (h - (this.itemHeight / 2)));
+ }else{
+ y = (this.children[p].cenY - (h / 2));
+ }
+
+ this.children[p].usualX = Math.round(this.children[p].cenX - (w / 2));
+ this.children[p].domNode.style.top = y + 'px';
+ this.children[p].domNode.style.left = this.children[p].usualX + 'px';
+
+ }else{
+
+ this.children[p].sizeW = w;
+ this.children[p].sizeH = h;
+
+ this.children[p].sizeOff = w;
+ this.children[p].sizeMain = h;
+
+ var x = 0;
+ if(this.anchorEdge == this.EDGE.LEFT){
+ x = this.children[p].cenX - (this.itemWidth / 2);
+ }else if(this.anchorEdge == this.EDGE.RIGHT){
+ x = this.children[p].cenX - (w - (this.itemWidth / 2));
+ }else{
+ x = this.children[p].cenX - (w / 2);
+ }
+
+ this.children[p].domNode.style.left = x + 'px';
+ this.children[p].usualY = Math.round(this.children[p].cenY - (h / 2));
+
+ this.children[p].domNode.style.top = this.children[p].usualY + 'px';
+ }
+
+ this.children[p].domNode.style.width = w + 'px';
+ this.children[p].domNode.style.height = h + 'px';
+
+ if(this.children[p].svgNode){
+ this.children[p].svgNode.setSize(w, h);
+ }
+ },
+
+ _positionElementsFrom: function(p, offset){
+ var pos = 0;
+
+ var usual, start;
+ if(this.isHorizontal){
+ usual = "usualX";
+ start = "left";
+ }else{
+ usual = "usualY";
+ start = "top";
+ }
+ pos = Math.round(this.children[p][usual] + offset);
+ if(this.children[p].domNode.style[start] != (pos + 'px')){
+ this.children[p].domNode.style[start] = pos + 'px';
+ this._positionLabel(this.children[p]);
+ }
+
+ // position before
+ var bpos = pos;
+ for(var i=p-1; i>=0; i--){
+ bpos -= this.children[i].sizeMain;
+
+ if(this.children[p].domNode.style[start] != (bpos + 'px')){
+ this.children[i].domNode.style[start] = bpos + 'px';
+ this._positionLabel(this.children[i]);
+ }
+ }
+
+ // position after
+ var apos = pos;
+ for(i=p+1; i<this.itemCount; i++){
+ apos += this.children[i-1].sizeMain;
+ if(this.children[p].domNode.style[start] != (apos + 'px')){
+ this.children[i].domNode.style[start] = apos + 'px';
+ this._positionLabel(this.children[i]);
+ }
+ }
+
+ },
+
+ _positionLabel: function(itm){
+ var x = 0;
+ var y = 0;
+
+ var mb = dojo.marginBox(itm.lblNode);
+
+ if(this.labelEdge == this.EDGE.TOP){
+ x = Math.round((itm.sizeW / 2) - (mb.w / 2));
+ y = -mb.h;
+ }
+
+ if(this.labelEdge == this.EDGE.BOTTOM){
+ x = Math.round((itm.sizeW / 2) - (mb.w / 2));
+ y = itm.sizeH;
+ }
+
+ if(this.labelEdge == this.EDGE.LEFT){
+ x = -mb.w;
+ y = Math.round((itm.sizeH / 2) - (mb.h / 2));
+ }
+
+ if(this.labelEdge == this.EDGE.RIGHT){
+ x = itm.sizeW;
+ y = Math.round((itm.sizeH / 2) - (mb.h / 2));
+ }
+
+ itm.lblNode.style.left = x + 'px';
+ itm.lblNode.style.top = y + 'px';
+ },
+
+ _calcHitGrid: function(){
+
+ var pos = dojo.coords(this.domNode, true);
+
+ this.hitX1 = pos.x - this.proximityLeft;
+ this.hitY1 = pos.y - this.proximityTop;
+ this.hitX2 = this.hitX1 + this.totalWidth;
+ this.hitY2 = this.hitY1 + this.totalHeight;
+
+ },
+
+ _toEdge: function(inp, def){
+ return this.EDGE[inp.toUpperCase()] || def;
+ },
+
+ _expandSlowly: function(){
+ // summary: slowly expand the image to user specified max size
+ if(!this.isOver){ return; }
+ this.timerScale += 0.2;
+ this._paint();
+ if(this.timerScale<1.0){
+ setTimeout(dojo.hitch(this, "_expandSlowly"), 10);
+ }
+ },
+
+ destroyRecursive: function(){
+ // need to disconnect when we destroy
+ dojo.disconnect(this._onMouseOutHandle);
+ dojo.disconnect(this._onMouseMoveHandle);
+ dojo.disconnect(this._addChildHandle);
+ if(this.isFixed){ dojo.disconnect(this._onScrollHandle); }
+ dojo.disconnect(this._onResizeHandle);
+ this.inherited("destroyRecursive",arguments);
+ }
+});
+
+dojo.declare("dojox.widget.FisheyeListItem", [dijit._Widget, dijit._Templated, dijit._Contained], {
+ /*
+ * summary
+ * Menu item inside of a FisheyeList.
+ * See FisheyeList documentation for details on usage.
+ */
+
+ // iconSrc: String
+ // pathname to image file (jpg, gif, png, etc.) of icon for this menu item
+ iconSrc: "",
+
+ // label: String
+ // label to print next to the icon, when it is moused-over
+ label: "",
+
+ // id: String
+ // will be set to the id of the orginal div element
+ id: "",
+
+ templateString:
+ '<div class="dojoxFisheyeListItem">' +
+ ' <img class="dojoxFisheyeListItemImage" dojoAttachPoint="imgNode" dojoAttachEvent="onmouseover:onMouseOver,onmouseout:onMouseOut,onclick:onClick">' +
+ ' <div class="dojoxFisheyeListItemLabel" dojoAttachPoint="lblNode"></div>' +
+ '</div>',
+
+ _isNode: function(/* object */wh){
+ // summary:
+ // checks to see if wh is actually a node.
+ if(typeof Element == "function"){
+ try{
+ return wh instanceof Element; // boolean
+ }catch(e){}
+ }else{
+ // best-guess
+ return wh && !isNaN(wh.nodeType); // boolean
+ }
+ return false;
+ },
+
+ _hasParent: function(/*Node*/node){
+ // summary:
+ // returns whether or not node is a child of another node.
+ return Boolean(node && node.parentNode && this._isNode(node.parentNode)); // boolean
+ },
+
+ postCreate: function(){
+
+ // set image
+ var parent;
+ if((this.iconSrc.toLowerCase().substring(this.iconSrc.length-4)==".png") && dojo.isIE < 7){
+ /* we set the id of the new fisheyeListItem to the id of the div defined in the HTML */
+ if(this._hasParent(this.imgNode) && this.id != ""){
+ parent = this.imgNode.parentNode;
+ parent.setAttribute("id", this.id);
+ }
+ this.imgNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.iconSrc+"', sizingMethod='scale')";
+ this.imgNode.src = this._blankGif.toString();
+ }else{
+ if(this._hasParent(this.imgNode) && this.id != ""){
+ parent = this.imgNode.parentNode;
+ parent.setAttribute("id", this.id);
+ }
+ this.imgNode.src = this.iconSrc;
+ }
+
+ // Label
+ if(this.lblNode){
+ this.lblNode.appendChild(document.createTextNode(this.label));
+ }
+ dojo.setSelectable(this.domNode, false);
+ this.startup();
+ },
+
+ startup: function(){
+ this.parent = this.getParent();
+ },
+
+ onMouseOver: function(/*Event*/ e){
+ // summary: callback when user moves mouse over this menu item
+ // in conservative mode, don't activate the menu until user mouses over an icon
+ if(!this.parent.isOver){
+ this.parent._setActive(e);
+ }
+ if(this.label != "" ){
+ dojo.addClass(this.lblNode, "dojoxFishSelected");
+ this.parent._positionLabel(this);
+ }
+ },
+
+ onMouseOut: function(/*Event*/ e){
+ // summary: callback when user moves mouse off of this menu item
+ dojo.removeClass(this.lblNode, "dojoxFishSelected");
+ },
+
+ onClick: function(/*Event*/ e){
+ // summary: user overridable callback when user clicks this menu item
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/FisheyeList.xd.js b/js/dojo-1.6/dojox/widget/FisheyeList.xd.js new file mode 100644 index 0000000..45f1e87 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FisheyeList.xd.js @@ -0,0 +1,728 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.FisheyeList"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"],
+["require", "dijit._Container"],
+["require", "dijit._Contained"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.FisheyeList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FisheyeList"] = true;
+dojo.provide("dojox.widget.FisheyeList");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dijit._Container");
+dojo.require("dijit._Contained");
+
+dojo.declare("dojox.widget.FisheyeList", [dijit._Widget, dijit._Templated, dijit._Container], {
+ // summary:
+ // Menu similar to the fish eye menu on the Mac OS
+ // example:
+ // | <div dojoType="FisheyeList"
+ // | itemWidth="40" itemHeight="40"
+ // | itemMaxWidth="150" itemMaxHeight="150"
+ // | orientation="horizontal"
+ // | effectUnits="2"
+ // | itemPadding="10"
+ // | attachEdge="center"
+ // | labelEdge="bottom">
+ // |
+ // | <div dojoType="FisheyeListItem"
+ // | id="item1"
+ // | onclick="alert('click on' + this.label + '(from widget id ' + this.widgetId + ')!');"
+ // | label="Item 1"
+ // | iconSrc="images/fisheye_1.png">
+ // | </div>
+ // | ...
+ // | </div>
+ //
+ constructor: function(){
+ //
+ // TODO
+ // fix really long labels in vertical mode
+ //
+
+ this.pos = {'x': -1, 'y': -1}; // current cursor position, relative to the grid
+
+ // for conservative trigger mode, when triggered, timerScale is gradually increased from 0 to 1
+ this.timerScale = 1.0;
+
+ },
+
+ EDGE: {
+ CENTER: 0,
+ LEFT: 1,
+ RIGHT: 2,
+ TOP: 3,
+ BOTTOM: 4
+ },
+
+ templateString: '<div class="dojoxFisheyeListBar" dojoAttachPoint="containerNode"></div>',
+
+ snarfChildDomOutput: true,
+
+ // itemWidth: Integer
+ // width of menu item (in pixels) in it's dormant state (when the mouse is far away)
+ itemWidth: 40,
+
+ // itemHeight: Integer
+ // height of menu item (in pixels) in it's dormant state (when the mouse is far away)
+ itemHeight: 40,
+
+ // itemMaxWidth: Integer
+ // width of menu item (in pixels) in it's fully enlarged state (when the mouse is directly over it)
+ itemMaxWidth: 150,
+
+ // itemMaxHeight: Integer
+ // height of menu item (in pixels) in it's fully enlarged state (when the mouse is directly over it)
+ itemMaxHeight: 150,
+
+ imgNode: null,
+
+ // orientation: String
+ // orientation of the menu, either "horizontal" or "vertical"
+ orientation: 'horizontal',
+
+ // isFixed: Boolean
+ // toggle to enable additional listener (window scroll) if FisheyeList is in a fixed postion
+ isFixed: false,
+
+ // conservativeTrigger: Boolean
+ // if true, don't start enlarging menu items until mouse is over an image;
+ // if false, start enlarging menu items as the mouse moves near them.
+ conservativeTrigger: false,
+
+ // effectUnits: Number
+ // controls how much reaction the menu makes, relative to the distance of the mouse from the menu
+ effectUnits: 2,
+
+ // itemPadding: Integer
+ // padding (in pixels) betweeen each menu item
+ itemPadding: 10,
+
+ // attachEdge: String
+ // controls the border that the menu items don't expand past;
+ // for example, if set to "top", then the menu items will drop downwards as they expand.
+ // values
+ // "center", "left", "right", "top", "bottom".
+ attachEdge: 'center',
+
+ // labelEdge: String
+ // controls were the labels show up in relation to the menu item icons
+ // values
+ // "center", "left", "right", "top", "bottom".
+ labelEdge: 'bottom',
+
+ postCreate: function(){
+ var e = this.EDGE;
+ dojo.setSelectable(this.domNode, false);
+
+ var isHorizontal = this.isHorizontal = (this.orientation == 'horizontal');
+ this.selectedNode = -1;
+
+ this.isOver = false;
+ this.hitX1 = -1;
+ this.hitY1 = -1;
+ this.hitX2 = -1;
+ this.hitY2 = -1;
+
+ //
+ // only some edges make sense...
+ //
+ this.anchorEdge = this._toEdge(this.attachEdge, e.CENTER);
+ this.labelEdge = this._toEdge(this.labelEdge, e.TOP);
+
+ if(this.labelEdge == e.CENTER){ this.labelEdge = e.TOP; }
+
+ if(isHorizontal){
+ if(this.anchorEdge == e.LEFT){ this.anchorEdge = e.CENTER; }
+ if(this.anchorEdge == e.RIGHT){ this.anchorEdge = e.CENTER; }
+ if(this.labelEdge == e.LEFT){ this.labelEdge = e.TOP; }
+ if(this.labelEdge == e.RIGHT){ this.labelEdge = e.TOP; }
+ }else{
+ if(this.anchorEdge == e.TOP){ this.anchorEdge = e.CENTER; }
+ if(this.anchorEdge == e.BOTTOM){ this.anchorEdge = e.CENTER; }
+ if(this.labelEdge == e.TOP){ this.labelEdge = e.LEFT; }
+ if(this.labelEdge == e.BOTTOM){ this.labelEdge = e.LEFT; }
+ }
+
+ //
+ // figure out the proximity size
+ //
+ var effectUnits = this.effectUnits;
+ this.proximityLeft = this.itemWidth * (effectUnits - 0.5);
+ this.proximityRight = this.itemWidth * (effectUnits - 0.5);
+ this.proximityTop = this.itemHeight * (effectUnits - 0.5);
+ this.proximityBottom = this.itemHeight * (effectUnits - 0.5);
+
+ if(this.anchorEdge == e.LEFT){
+ this.proximityLeft = 0;
+ }
+ if(this.anchorEdge == e.RIGHT){
+ this.proximityRight = 0;
+ }
+ if(this.anchorEdge == e.TOP){
+ this.proximityTop = 0;
+ }
+ if(this.anchorEdge == e.BOTTOM){
+ this.proximityBottom = 0;
+ }
+ if(this.anchorEdge == e.CENTER){
+ this.proximityLeft /= 2;
+ this.proximityRight /= 2;
+ this.proximityTop /= 2;
+ this.proximityBottom /= 2;
+ }
+ },
+
+ startup: function(){
+ // summary: create our connections and setup our FisheyeList
+ this.children = this.getChildren();
+ //original postCreate() --tk
+ this._initializePositioning();
+
+ //
+ // in liberal trigger mode, activate menu whenever mouse is close
+ //
+ if(!this.conservativeTrigger){
+ this._onMouseMoveHandle = dojo.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
+ }
+ if(this.isFixed){
+ this._onScrollHandle = dojo.connect(document,"onscroll",this,"_onScroll");
+ }
+
+ // Deactivate the menu if mouse is moved off screen (doesn't work for FF?)
+ this._onMouseOutHandle = dojo.connect(document.documentElement, "onmouseout", this, "_onBodyOut");
+ this._addChildHandle = dojo.connect(this, "addChild", this, "_initializePositioning");
+ this._onResizeHandle = dojo.connect(window,"onresize", this, "_initializePositioning");
+ },
+
+ _initializePositioning: function(){
+ this.itemCount = this.children.length;
+
+ this.barWidth = (this.isHorizontal ? this.itemCount : 1) * this.itemWidth;
+ this.barHeight = (this.isHorizontal ? 1 : this.itemCount) * this.itemHeight;
+
+ this.totalWidth = this.proximityLeft + this.proximityRight + this.barWidth;
+ this.totalHeight = this.proximityTop + this.proximityBottom + this.barHeight;
+
+ //
+ // calculate effect ranges for each item
+ //
+
+ for(var i=0; i<this.children.length; i++){
+
+ this.children[i].posX = this.itemWidth * (this.isHorizontal ? i : 0);
+ this.children[i].posY = this.itemHeight * (this.isHorizontal ? 0 : i);
+
+ this.children[i].cenX = this.children[i].posX + (this.itemWidth / 2);
+ this.children[i].cenY = this.children[i].posY + (this.itemHeight / 2);
+
+ var isz = this.isHorizontal ? this.itemWidth : this.itemHeight;
+ var r = this.effectUnits * isz;
+ var c = this.isHorizontal ? this.children[i].cenX : this.children[i].cenY;
+ var lhs = this.isHorizontal ? this.proximityLeft : this.proximityTop;
+ var rhs = this.isHorizontal ? this.proximityRight : this.proximityBottom;
+ var siz = this.isHorizontal ? this.barWidth : this.barHeight;
+
+ var range_lhs = r;
+ var range_rhs = r;
+
+ if(range_lhs > c+lhs){ range_lhs = c+lhs; }
+ if(range_rhs > (siz-c+rhs)){ range_rhs = siz-c+rhs; }
+
+ this.children[i].effectRangeLeft = range_lhs / isz;
+ this.children[i].effectRangeRght = range_rhs / isz;
+
+ //dojo.debug('effect range for '+i+' is '+range_lhs+'/'+range_rhs);
+ }
+
+ //
+ // create the bar
+ //
+ this.domNode.style.width = this.barWidth + 'px';
+ this.domNode.style.height = this.barHeight + 'px';
+
+ //
+ // position the items
+ //
+ for(i=0; i<this.children.length; i++){
+ var itm = this.children[i];
+ var elm = itm.domNode;
+ elm.style.left = itm.posX + 'px';
+ elm.style.top = itm.posY + 'px';
+ elm.style.width = this.itemWidth + 'px';
+ elm.style.height = this.itemHeight + 'px';
+
+ itm.imgNode.style.left = this.itemPadding+'%';
+ itm.imgNode.style.top = this.itemPadding+'%';
+ itm.imgNode.style.width = (100 - 2 * this.itemPadding) + '%';
+ itm.imgNode.style.height = (100 - 2 * this.itemPadding) + '%';
+ }
+
+ //
+ // calc the grid
+ //
+ this._calcHitGrid();
+ },
+
+ _overElement: function(/* DomNode|String */node, /* Event */e){
+ // summary:
+ // Returns whether the mouse is over the passed element.
+ // Node: Must must be display:block (ie, not a <span>)
+ node = dojo.byId(node);
+ var mouse = {x: e.pageX, y: e.pageY};
+ var bb = dojo._getBorderBox(node);
+ var absolute = dojo.coords(node, true);
+ var top = absolute.y;
+ var bottom = top + bb.h;
+ var left = absolute.x;
+ var right = left + bb.w;
+
+ return (mouse.x >= left
+ && mouse.x <= right
+ && mouse.y >= top
+ && mouse.y <= bottom
+ ); // boolean
+ },
+
+ _onBodyOut: function(/*Event*/ e){
+ // clicking over an object inside of body causes this event to fire; ignore that case
+ if( this._overElement(dojo.body(), e) ){
+ return;
+ }
+ this._setDormant(e);
+ },
+
+ _setDormant: function(/*Event*/ e){
+ // summary: called when mouse moves out of menu's range
+
+ if(!this.isOver){ return; } // already dormant?
+ this.isOver = false;
+
+ if(this.conservativeTrigger){
+ // user can't re-trigger the menu expansion
+ // until he mouses over a icon again
+ dojo.disconnect(this._onMouseMoveHandle);
+ }
+ this._onGridMouseMove(-1, -1);
+ },
+
+ _setActive: function(/*Event*/ e){
+ // summary: called when mouse is moved into menu's range
+
+ if(this.isOver){ return; } // already activated?
+ this.isOver = true;
+
+ if(this.conservativeTrigger){
+ // switch event handlers so that we handle mouse events from anywhere near
+ // the menu
+ this._onMouseMoveHandle = dojo.connect(document.documentElement, "onmousemove", this, "_onMouseMove");
+
+ this.timerScale=0.0;
+
+ // call mouse handler to do some initial necessary calculations/positioning
+ this._onMouseMove(e);
+
+ // slowly expand the icon size so it isn't jumpy
+ this._expandSlowly();
+ }
+ },
+
+ _onMouseMove: function(/*Event*/ e){
+ // summary: called when mouse is moved
+ if( (e.pageX >= this.hitX1) && (e.pageX <= this.hitX2) &&
+ (e.pageY >= this.hitY1) && (e.pageY <= this.hitY2) ){
+ if(!this.isOver){
+ this._setActive(e);
+ }
+ this._onGridMouseMove(e.pageX-this.hitX1, e.pageY-this.hitY1);
+ }else{
+ if(this.isOver){
+ this._setDormant(e);
+ }
+ }
+ },
+
+ _onScroll: function(){
+ this._calcHitGrid();
+ },
+
+ onResized: function(){
+ this._calcHitGrid();
+ },
+
+ _onGridMouseMove: function(x, y){
+ // summary: called when mouse is moved in the vicinity of the menu
+ this.pos = {x:x, y:y};
+ this._paint();
+ },
+
+ _paint: function(){
+ var x=this.pos.x;
+ var y=this.pos.y;
+
+ if(this.itemCount <= 0){ return; }
+
+ //
+ // figure out our main index
+ //
+ var pos = this.isHorizontal ? x : y;
+ var prx = this.isHorizontal ? this.proximityLeft : this.proximityTop;
+ var siz = this.isHorizontal ? this.itemWidth : this.itemHeight;
+ var sim = this.isHorizontal ?
+ (1.0-this.timerScale)*this.itemWidth + this.timerScale*this.itemMaxWidth :
+ (1.0-this.timerScale)*this.itemHeight + this.timerScale*this.itemMaxHeight ;
+
+ var cen = ((pos - prx) / siz) - 0.5;
+ var max_off_cen = (sim / siz) - 0.5;
+
+ if(max_off_cen > this.effectUnits){ max_off_cen = this.effectUnits; }
+
+ //
+ // figure out our off-axis weighting
+ //
+ var off_weight = 0, cen2;
+
+ if(this.anchorEdge == this.EDGE.BOTTOM){
+ cen2 = (y - this.proximityTop) / this.itemHeight;
+ off_weight = (cen2 > 0.5) ? 1 : y / (this.proximityTop + (this.itemHeight / 2));
+ }
+ if(this.anchorEdge == this.EDGE.TOP){
+ cen2 = (y - this.proximityTop) / this.itemHeight;
+ off_weight = (cen2 < 0.5) ? 1 : (this.totalHeight - y) / (this.proximityBottom + (this.itemHeight / 2));
+ }
+ if(this.anchorEdge == this.EDGE.RIGHT){
+ cen2 = (x - this.proximityLeft) / this.itemWidth;
+ off_weight = (cen2 > 0.5) ? 1 : x / (this.proximityLeft + (this.itemWidth / 2));
+ }
+ if(this.anchorEdge == this.EDGE.LEFT){
+ cen2 = (x - this.proximityLeft) / this.itemWidth;
+ off_weight = (cen2 < 0.5) ? 1 : (this.totalWidth - x) / (this.proximityRight + (this.itemWidth / 2));
+ }
+ if(this.anchorEdge == this.EDGE.CENTER){
+ if(this.isHorizontal){
+ off_weight = y / (this.totalHeight);
+ }else{
+ off_weight = x / (this.totalWidth);
+ }
+
+ if(off_weight > 0.5){
+ off_weight = 1 - off_weight;
+ }
+
+ off_weight *= 2;
+ }
+
+ //
+ // set the sizes
+ //
+ for(var i=0; i<this.itemCount; i++){
+ var weight = this._weighAt(cen, i);
+ if(weight < 0){weight = 0;}
+ this._setItemSize(i, weight * off_weight);
+ }
+
+ //
+ // set the positions
+ //
+
+ var main_p = Math.round(cen);
+ var offset = 0;
+
+ if(cen < 0){
+
+ main_p = 0;
+
+ }else if(cen > this.itemCount - 1){
+
+ main_p = this.itemCount -1;
+
+ }else{
+
+ offset = (cen - main_p) * ((this.isHorizontal ? this.itemWidth : this.itemHeight) - this.children[main_p].sizeMain);
+ }
+
+ this._positionElementsFrom(main_p, offset);
+ },
+
+ _weighAt: function(/*Integer*/ cen, /*Integer*/ i){
+ var dist = Math.abs(cen - i);
+ var limit = ((cen - i) > 0) ? this.children[i].effectRangeRght : this.children[i].effectRangeLeft;
+ return (dist > limit) ? 0 : (1 - dist / limit); // Integer
+ },
+
+ _setItemSize: function(p, scale){
+ if(this.children[p].scale == scale){ return; }
+ this.children[p].scale = scale;
+
+ scale *= this.timerScale;
+ var w = Math.round(this.itemWidth + ((this.itemMaxWidth - this.itemWidth ) * scale));
+ var h = Math.round(this.itemHeight + ((this.itemMaxHeight - this.itemHeight) * scale));
+
+ if(this.isHorizontal){
+
+ this.children[p].sizeW = w;
+ this.children[p].sizeH = h;
+
+ this.children[p].sizeMain = w;
+ this.children[p].sizeOff = h;
+
+ var y = 0;
+ if(this.anchorEdge == this.EDGE.TOP){
+ y = (this.children[p].cenY - (this.itemHeight / 2));
+ }else if(this.anchorEdge == this.EDGE.BOTTOM){
+ y = (this.children[p].cenY - (h - (this.itemHeight / 2)));
+ }else{
+ y = (this.children[p].cenY - (h / 2));
+ }
+
+ this.children[p].usualX = Math.round(this.children[p].cenX - (w / 2));
+ this.children[p].domNode.style.top = y + 'px';
+ this.children[p].domNode.style.left = this.children[p].usualX + 'px';
+
+ }else{
+
+ this.children[p].sizeW = w;
+ this.children[p].sizeH = h;
+
+ this.children[p].sizeOff = w;
+ this.children[p].sizeMain = h;
+
+ var x = 0;
+ if(this.anchorEdge == this.EDGE.LEFT){
+ x = this.children[p].cenX - (this.itemWidth / 2);
+ }else if(this.anchorEdge == this.EDGE.RIGHT){
+ x = this.children[p].cenX - (w - (this.itemWidth / 2));
+ }else{
+ x = this.children[p].cenX - (w / 2);
+ }
+
+ this.children[p].domNode.style.left = x + 'px';
+ this.children[p].usualY = Math.round(this.children[p].cenY - (h / 2));
+
+ this.children[p].domNode.style.top = this.children[p].usualY + 'px';
+ }
+
+ this.children[p].domNode.style.width = w + 'px';
+ this.children[p].domNode.style.height = h + 'px';
+
+ if(this.children[p].svgNode){
+ this.children[p].svgNode.setSize(w, h);
+ }
+ },
+
+ _positionElementsFrom: function(p, offset){
+ var pos = 0;
+
+ var usual, start;
+ if(this.isHorizontal){
+ usual = "usualX";
+ start = "left";
+ }else{
+ usual = "usualY";
+ start = "top";
+ }
+ pos = Math.round(this.children[p][usual] + offset);
+ if(this.children[p].domNode.style[start] != (pos + 'px')){
+ this.children[p].domNode.style[start] = pos + 'px';
+ this._positionLabel(this.children[p]);
+ }
+
+ // position before
+ var bpos = pos;
+ for(var i=p-1; i>=0; i--){
+ bpos -= this.children[i].sizeMain;
+
+ if(this.children[p].domNode.style[start] != (bpos + 'px')){
+ this.children[i].domNode.style[start] = bpos + 'px';
+ this._positionLabel(this.children[i]);
+ }
+ }
+
+ // position after
+ var apos = pos;
+ for(i=p+1; i<this.itemCount; i++){
+ apos += this.children[i-1].sizeMain;
+ if(this.children[p].domNode.style[start] != (apos + 'px')){
+ this.children[i].domNode.style[start] = apos + 'px';
+ this._positionLabel(this.children[i]);
+ }
+ }
+
+ },
+
+ _positionLabel: function(itm){
+ var x = 0;
+ var y = 0;
+
+ var mb = dojo.marginBox(itm.lblNode);
+
+ if(this.labelEdge == this.EDGE.TOP){
+ x = Math.round((itm.sizeW / 2) - (mb.w / 2));
+ y = -mb.h;
+ }
+
+ if(this.labelEdge == this.EDGE.BOTTOM){
+ x = Math.round((itm.sizeW / 2) - (mb.w / 2));
+ y = itm.sizeH;
+ }
+
+ if(this.labelEdge == this.EDGE.LEFT){
+ x = -mb.w;
+ y = Math.round((itm.sizeH / 2) - (mb.h / 2));
+ }
+
+ if(this.labelEdge == this.EDGE.RIGHT){
+ x = itm.sizeW;
+ y = Math.round((itm.sizeH / 2) - (mb.h / 2));
+ }
+
+ itm.lblNode.style.left = x + 'px';
+ itm.lblNode.style.top = y + 'px';
+ },
+
+ _calcHitGrid: function(){
+
+ var pos = dojo.coords(this.domNode, true);
+
+ this.hitX1 = pos.x - this.proximityLeft;
+ this.hitY1 = pos.y - this.proximityTop;
+ this.hitX2 = this.hitX1 + this.totalWidth;
+ this.hitY2 = this.hitY1 + this.totalHeight;
+
+ },
+
+ _toEdge: function(inp, def){
+ return this.EDGE[inp.toUpperCase()] || def;
+ },
+
+ _expandSlowly: function(){
+ // summary: slowly expand the image to user specified max size
+ if(!this.isOver){ return; }
+ this.timerScale += 0.2;
+ this._paint();
+ if(this.timerScale<1.0){
+ setTimeout(dojo.hitch(this, "_expandSlowly"), 10);
+ }
+ },
+
+ destroyRecursive: function(){
+ // need to disconnect when we destroy
+ dojo.disconnect(this._onMouseOutHandle);
+ dojo.disconnect(this._onMouseMoveHandle);
+ dojo.disconnect(this._addChildHandle);
+ if(this.isFixed){ dojo.disconnect(this._onScrollHandle); }
+ dojo.disconnect(this._onResizeHandle);
+ this.inherited("destroyRecursive",arguments);
+ }
+});
+
+dojo.declare("dojox.widget.FisheyeListItem", [dijit._Widget, dijit._Templated, dijit._Contained], {
+ /*
+ * summary
+ * Menu item inside of a FisheyeList.
+ * See FisheyeList documentation for details on usage.
+ */
+
+ // iconSrc: String
+ // pathname to image file (jpg, gif, png, etc.) of icon for this menu item
+ iconSrc: "",
+
+ // label: String
+ // label to print next to the icon, when it is moused-over
+ label: "",
+
+ // id: String
+ // will be set to the id of the orginal div element
+ id: "",
+
+ templateString:
+ '<div class="dojoxFisheyeListItem">' +
+ ' <img class="dojoxFisheyeListItemImage" dojoAttachPoint="imgNode" dojoAttachEvent="onmouseover:onMouseOver,onmouseout:onMouseOut,onclick:onClick">' +
+ ' <div class="dojoxFisheyeListItemLabel" dojoAttachPoint="lblNode"></div>' +
+ '</div>',
+
+ _isNode: function(/* object */wh){
+ // summary:
+ // checks to see if wh is actually a node.
+ if(typeof Element == "function"){
+ try{
+ return wh instanceof Element; // boolean
+ }catch(e){}
+ }else{
+ // best-guess
+ return wh && !isNaN(wh.nodeType); // boolean
+ }
+ return false;
+ },
+
+ _hasParent: function(/*Node*/node){
+ // summary:
+ // returns whether or not node is a child of another node.
+ return Boolean(node && node.parentNode && this._isNode(node.parentNode)); // boolean
+ },
+
+ postCreate: function(){
+
+ // set image
+ var parent;
+ if((this.iconSrc.toLowerCase().substring(this.iconSrc.length-4)==".png") && dojo.isIE < 7){
+ /* we set the id of the new fisheyeListItem to the id of the div defined in the HTML */
+ if(this._hasParent(this.imgNode) && this.id != ""){
+ parent = this.imgNode.parentNode;
+ parent.setAttribute("id", this.id);
+ }
+ this.imgNode.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.iconSrc+"', sizingMethod='scale')";
+ this.imgNode.src = this._blankGif.toString();
+ }else{
+ if(this._hasParent(this.imgNode) && this.id != ""){
+ parent = this.imgNode.parentNode;
+ parent.setAttribute("id", this.id);
+ }
+ this.imgNode.src = this.iconSrc;
+ }
+
+ // Label
+ if(this.lblNode){
+ this.lblNode.appendChild(document.createTextNode(this.label));
+ }
+ dojo.setSelectable(this.domNode, false);
+ this.startup();
+ },
+
+ startup: function(){
+ this.parent = this.getParent();
+ },
+
+ onMouseOver: function(/*Event*/ e){
+ // summary: callback when user moves mouse over this menu item
+ // in conservative mode, don't activate the menu until user mouses over an icon
+ if(!this.parent.isOver){
+ this.parent._setActive(e);
+ }
+ if(this.label != "" ){
+ dojo.addClass(this.lblNode, "dojoxFishSelected");
+ this.parent._positionLabel(this);
+ }
+ },
+
+ onMouseOut: function(/*Event*/ e){
+ // summary: callback when user moves mouse off of this menu item
+ dojo.removeClass(this.lblNode, "dojoxFishSelected");
+ },
+
+ onClick: function(/*Event*/ e){
+ // summary: user overridable callback when user clicks this menu item
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/FisheyeList/FisheyeList.css b/js/dojo-1.6/dojox/widget/FisheyeList/FisheyeList.css new file mode 100644 index 0000000..82469d8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FisheyeList/FisheyeList.css @@ -0,0 +1,28 @@ +.dojoxFisheyeListItemLabel { + font-family: Arial, Helvetica, sans-serif; + background-color: #eee; + border: 2px solid #666; + padding: 2px; + text-align: center; + position: absolute; + display: none; + white-space:pre; +} + +.dojoxFisheyeListItemLabel.dojoxFishSelected { + display: block; +} + +.dojoxFisheyeListItemImage { + border: 0px; + position: absolute; +} + +.dojoxFisheyeListItem { + position: absolute; + z-index: 2; +} + +.dojoxFisheyeListBar { + position: relative; +} diff --git a/js/dojo-1.6/dojox/widget/FisheyeLite.js b/js/dojo-1.6/dojox/widget/FisheyeLite.js new file mode 100644 index 0000000..b9eb970 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FisheyeLite.js @@ -0,0 +1,160 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.FisheyeLite"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FisheyeLite"] = true;
+dojo.provide("dojox.widget.FisheyeLite");
+dojo.experimental("dojox.widget.FisheyeLite");
+
+dojo.require("dijit._Widget");
+dojo.require("dojo.fx.easing");
+
+dojo.declare("dojox.widget.FisheyeLite",
+ dijit._Widget,
+ {
+ // summary: A Light-weight Fisheye Component, or an exhanced version
+ // of dojo.fx.Toggler ...
+ //
+ // description:
+ // A Simple FisheyeList-like widget which (in the interest of
+ // performance) relies on well-styled content for positioning,
+ // and natural page layout for rendering.
+ //
+ // use position:absolute/relative nodes to prevent layout
+ // changes, and use caution when seleting properties to
+ // scale. Negative scaling works, but some properties
+ // react poorly to being set to negative values, IE being
+ // particularly annoying in that regard.
+ //
+ // quirk: uses the domNode as the target of the animation
+ // unless it finds a node class="fisheyeTarget" in the container
+ // being turned into a FisheyeLite instance
+ //
+ // example:
+ // | // make all the LI's in a node Fisheye's:
+ // | dojo.query("#node li").forEach(function(n){
+ // | new dojox.widget.FisheyeLite({},n);
+ // | });
+ //
+ //
+ // example:
+ // | new dojox.widget.FisheyeLite({
+ // | properties:{
+ // | // height is literal, width is multiplied
+ // | height:{ end: 200 }, width:2.3
+ // | }
+ // | }, "someNode");
+ //
+ // duationIn: Integer
+ // The time (in ms) the run the show animation
+ durationIn: 350,
+
+ // easeIn: Function
+ // An easing function to use for the show animation
+ easeIn: dojo.fx.easing.backOut,
+
+ // durationOut: Integer
+ // The Time (in ms) to run the hide animation
+ durationOut: 1420,
+
+ // easeOut: Function
+ // An easing function to use for the hide animation
+ easeOut: dojo.fx.easing.elasticOut,
+
+ // properties: Object
+ // An object of "property":scale pairs, or "property":{} pairs.
+ // defaults to font-size with a scale of 2.75
+ // If a named property is an integer or float, the "scale multiplier"
+ // is used. If the named property is an object, that object is mixed
+ // into the animation directly. eg: height:{ end:20, units:"em" }
+ properties: null,
+
+ // units: String
+ // Sometimes, you need to specify a unit. Should be part of
+ // properties attrib, but was trying to shorthand the logic there
+ units:"px",
+
+ constructor: function(props, node){
+ this.properties = props.properties || {
+ fontSize: 2.75
+ }
+ },
+
+ postCreate: function(){
+
+ this.inherited(arguments);
+ this._target = dojo.query(".fisheyeTarget", this.domNode)[0] || this.domNode;
+ this._makeAnims();
+
+ this.connect(this.domNode, "onmouseover", "show");
+ this.connect(this.domNode, "onmouseout", "hide");
+ this.connect(this._target, "onclick", "onClick");
+
+ },
+
+ show: function(){
+ // summary:
+ // Show this Fisheye item.
+ this._runningOut.stop();
+ this._runningIn.play();
+ },
+
+ hide: function(){
+ // summary:
+ // Hide this fisheye item on mouse leave
+ this._runningIn.stop();
+ this._runningOut.play();
+ },
+
+ _makeAnims: function(){
+ // summary:
+ // Pre-generate the animations
+
+ // create two properties: objects, one for each "state"
+ var _in = {}, _out = {}, cs = dojo.getComputedStyle(this._target);
+ for(var p in this.properties){
+ var prop = this.properties[p],
+ deep = dojo.isObject(prop),
+ v = parseInt(cs[p])
+ ;
+ // note: do not set negative scale for [a list of properties] for IE support
+ // note: filter:'s are your own issue, too ;)
+ // FIXME: this.unit here is bad, likely. d._toPixelValue ?
+ _out[p] = { end: v, units:this.units };
+ _in[p] = deep ? prop : { end: prop * v, units:this.units };
+ }
+
+ this._runningIn = dojo.animateProperty({
+ node: this._target,
+ easing: this.easeIn,
+ duration: this.durationIn,
+ properties: _in
+ });
+
+ this._runningOut = dojo.animateProperty({
+ node: this._target,
+ duration: this.durationOut,
+ easing: this.easeOut,
+ properties: _out
+ });
+
+ this.connect(this._runningIn, "onEnd", dojo.hitch(this, "onSelected", this));
+ },
+
+ onClick: function(/* Event */e){
+ // summary: stub function fired when target is clicked
+ // connect or override to use.
+ },
+
+ onSelected: function(/* Object */e){
+ // summary: stub function fired when Fisheye Item is fully visible and
+ // hovered. connect or override use.
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/FisheyeLite.xd.js b/js/dojo-1.6/dojox/widget/FisheyeLite.xd.js new file mode 100644 index 0000000..82241f1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/FisheyeLite.xd.js @@ -0,0 +1,166 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.FisheyeLite"],
+["require", "dijit._Widget"],
+["require", "dojo.fx.easing"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.FisheyeLite"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.FisheyeLite"] = true;
+dojo.provide("dojox.widget.FisheyeLite");
+dojo.experimental("dojox.widget.FisheyeLite");
+
+dojo.require("dijit._Widget");
+dojo.require("dojo.fx.easing");
+
+dojo.declare("dojox.widget.FisheyeLite",
+ dijit._Widget,
+ {
+ // summary: A Light-weight Fisheye Component, or an exhanced version
+ // of dojo.fx.Toggler ...
+ //
+ // description:
+ // A Simple FisheyeList-like widget which (in the interest of
+ // performance) relies on well-styled content for positioning,
+ // and natural page layout for rendering.
+ //
+ // use position:absolute/relative nodes to prevent layout
+ // changes, and use caution when seleting properties to
+ // scale. Negative scaling works, but some properties
+ // react poorly to being set to negative values, IE being
+ // particularly annoying in that regard.
+ //
+ // quirk: uses the domNode as the target of the animation
+ // unless it finds a node class="fisheyeTarget" in the container
+ // being turned into a FisheyeLite instance
+ //
+ // example:
+ // | // make all the LI's in a node Fisheye's:
+ // | dojo.query("#node li").forEach(function(n){
+ // | new dojox.widget.FisheyeLite({},n);
+ // | });
+ //
+ //
+ // example:
+ // | new dojox.widget.FisheyeLite({
+ // | properties:{
+ // | // height is literal, width is multiplied
+ // | height:{ end: 200 }, width:2.3
+ // | }
+ // | }, "someNode");
+ //
+ // duationIn: Integer
+ // The time (in ms) the run the show animation
+ durationIn: 350,
+
+ // easeIn: Function
+ // An easing function to use for the show animation
+ easeIn: dojo.fx.easing.backOut,
+
+ // durationOut: Integer
+ // The Time (in ms) to run the hide animation
+ durationOut: 1420,
+
+ // easeOut: Function
+ // An easing function to use for the hide animation
+ easeOut: dojo.fx.easing.elasticOut,
+
+ // properties: Object
+ // An object of "property":scale pairs, or "property":{} pairs.
+ // defaults to font-size with a scale of 2.75
+ // If a named property is an integer or float, the "scale multiplier"
+ // is used. If the named property is an object, that object is mixed
+ // into the animation directly. eg: height:{ end:20, units:"em" }
+ properties: null,
+
+ // units: String
+ // Sometimes, you need to specify a unit. Should be part of
+ // properties attrib, but was trying to shorthand the logic there
+ units:"px",
+
+ constructor: function(props, node){
+ this.properties = props.properties || {
+ fontSize: 2.75
+ }
+ },
+
+ postCreate: function(){
+
+ this.inherited(arguments);
+ this._target = dojo.query(".fisheyeTarget", this.domNode)[0] || this.domNode;
+ this._makeAnims();
+
+ this.connect(this.domNode, "onmouseover", "show");
+ this.connect(this.domNode, "onmouseout", "hide");
+ this.connect(this._target, "onclick", "onClick");
+
+ },
+
+ show: function(){
+ // summary:
+ // Show this Fisheye item.
+ this._runningOut.stop();
+ this._runningIn.play();
+ },
+
+ hide: function(){
+ // summary:
+ // Hide this fisheye item on mouse leave
+ this._runningIn.stop();
+ this._runningOut.play();
+ },
+
+ _makeAnims: function(){
+ // summary:
+ // Pre-generate the animations
+
+ // create two properties: objects, one for each "state"
+ var _in = {}, _out = {}, cs = dojo.getComputedStyle(this._target);
+ for(var p in this.properties){
+ var prop = this.properties[p],
+ deep = dojo.isObject(prop),
+ v = parseInt(cs[p])
+ ;
+ // note: do not set negative scale for [a list of properties] for IE support
+ // note: filter:'s are your own issue, too ;)
+ // FIXME: this.unit here is bad, likely. d._toPixelValue ?
+ _out[p] = { end: v, units:this.units };
+ _in[p] = deep ? prop : { end: prop * v, units:this.units };
+ }
+
+ this._runningIn = dojo.animateProperty({
+ node: this._target,
+ easing: this.easeIn,
+ duration: this.durationIn,
+ properties: _in
+ });
+
+ this._runningOut = dojo.animateProperty({
+ node: this._target,
+ duration: this.durationOut,
+ easing: this.easeOut,
+ properties: _out
+ });
+
+ this.connect(this._runningIn, "onEnd", dojo.hitch(this, "onSelected", this));
+ },
+
+ onClick: function(/* Event */e){
+ // summary: stub function fired when target is clicked
+ // connect or override to use.
+ },
+
+ onSelected: function(/* Object */e){
+ // summary: stub function fired when Fisheye Item is fully visible and
+ // hovered. connect or override use.
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Iterator.js b/js/dojo-1.6/dojox/widget/Iterator.js new file mode 100644 index 0000000..d43cf14 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Iterator.js @@ -0,0 +1,184 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Iterator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Iterator"] = true;
+dojo.provide("dojox.widget.Iterator");
+dojo.require("dijit.Declaration");
+
+dojo.experimental("dojox.widget.Iterator"); // level: prototype, designed for dijit.chat.demo
+
+/*
+ example:
+ from markup:
+ | <span dojoType="dojo.data.ItemFileReadStore"
+ | jsId="cstore" url="countries.json"></span>
+ |
+ | <div>
+ | <div dojoType="dojox.widget.Iterator" store="cstore"
+ | query="{ name: 'A*'}">
+ | ${name} is a ${type}
+ | </div>
+ | </div>
+
+ example:
+ programmatic:
+ | var store = new dojo.data.ItemFileReadStore({ url: "countries.json" });
+ |
+ | var iter = new dojox.widget.Iterator({
+ | store: store,
+ | template: ""
+ | });
+ |
+
+ example:
+ programmatic from an array of objects:
+ | var dataArr = [
+ | { name: "foo", valueAttr: "bar" },
+ | { name: "thinger", valueAttr: "blah" }
+ | ];
+ |
+ | var iter = new dojox.widget.Iterator({
+ | data: dataArr,
+ | template: ""
+ | });
+
+ example:
+ programmatic from an array of strings:
+ | var dataArr = [
+ | { name: "foo", valueAttr: "bar" },
+ | { name: "thinger", valueAttr: "blah" }
+ | ];
+ |
+ | var iter = new dojox.widget.Iterator({
+ | data: dataArr,
+ | template: ""
+ | });
+
+*/
+
+
+dojo.declare("dojox.widget.Iterator",
+ [ dijit.Declaration ],
+ {
+
+ constructor: (function(){
+ var ctr = 0;
+ return function(){
+ this.attrs = [];
+ this.children = [];
+ this.widgetClass = "dojox.widget.Iterator._classes._"+(ctr++);
+ }
+ })(),
+
+ start: 0,
+ fetchMax: 1000,
+ query: { name: "*" },
+ attrs: [],
+ defaultValue: "",
+ widgetCtor: null,
+ dataValues: [], // an array of strings
+ data: null, // should be a reference to an Array
+ store: null,
+ _srcIndex: 0,
+ _srcParent: null,
+
+ _setSrcIndex: function(s){
+ this._srcIndex = 0;
+ this._srcParent = s.parentNode;
+ var ts = s;
+ while(ts.previousSibling){
+ this._srcIndex++;
+ ts = ts.previousSibling;
+ };
+ },
+
+ postscript: function(p, s){
+ // figure out the position of the source node in it's parent
+ this._setSrcIndex(s);
+ // this._srcIndex = dojo.query(">", this._srcParent).indexOf(s);
+
+ this.inherited("postscript", arguments);
+ var wc = this.widgetCtor = dojo.getObject(this.widgetClass);
+
+ this.attrs = dojo.map(
+ wc.prototype.templateString.match(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g),
+ function(s){ return s.slice(2, -1); }
+ );
+ dojo.forEach(
+ this.attrs,
+ function(m){ wc.prototype[m] = ""; }
+ );
+ this.update();
+ },
+
+ clear: function(){
+ if(this.children.length){
+ this._setSrcIndex(this.children[0].domNode);
+ }
+ dojo.forEach(this.children, "item.destroy();");
+ this.children = [];
+ },
+
+ update: function(){
+ if(this.store){
+ // we're executing a query
+ this.fetch();
+ }else{
+ // we came from an array of objects. Easier!
+ this.onDataAvailable(this.data||this.dataValues);
+ }
+ },
+
+ _addItem: function(/*Object*/config, idx){
+ if(dojo.isString(config)){
+ config = { value: config };
+ }
+ var widget = new this.widgetCtor(config);
+ this.children.push(widget);
+ dojo.place(widget.domNode, this._srcParent, this._srcIndex+idx);
+ },
+
+ getAttrValuesObj: function(item){
+ var obj = {};
+ if(dojo.isString(item)){
+ dojo.forEach(this.attrs, function(attr){
+ obj[attr] = (attr == "value") ? item : this.defaultValue;
+ }, this);
+ }else{
+ dojo.forEach(this.attrs, function(attr){
+ if(this.store){
+ obj[attr] = this.store.getValue(item, attr)||this.defaultValue;
+ }else{
+ obj[attr] = item[attr]||this.defaultValue;
+ }
+ }, this);
+ }
+ return obj;
+ },
+
+ onDataAvailable: function(data){
+ this.clear();
+ // console.debug(data);
+ dojo.forEach(data, function(item, idx){
+ this._addItem(this.getAttrValuesObj(item), idx);
+ }, this);
+ },
+
+ fetch: function(query, start, end){
+ this.store.fetch({
+ query: query||this.query,
+ start: start||this.start,
+ count: end||this.fetchMax,
+ onComplete: dojo.hitch(this,"onDataAvailable")
+ });
+ }
+});
+
+dojox.widget.Iterator._classes = {};
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Iterator.xd.js b/js/dojo-1.6/dojox/widget/Iterator.xd.js new file mode 100644 index 0000000..d0f390a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Iterator.xd.js @@ -0,0 +1,189 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Iterator"],
+["require", "dijit.Declaration"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Iterator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Iterator"] = true;
+dojo.provide("dojox.widget.Iterator");
+dojo.require("dijit.Declaration");
+
+dojo.experimental("dojox.widget.Iterator"); // level: prototype, designed for dijit.chat.demo
+
+/*
+ example:
+ from markup:
+ | <span dojoType="dojo.data.ItemFileReadStore"
+ | jsId="cstore" url="countries.json"></span>
+ |
+ | <div>
+ | <div dojoType="dojox.widget.Iterator" store="cstore"
+ | query="{ name: 'A*'}">
+ | ${name} is a ${type}
+ | </div>
+ | </div>
+
+ example:
+ programmatic:
+ | var store = new dojo.data.ItemFileReadStore({ url: "countries.json" });
+ |
+ | var iter = new dojox.widget.Iterator({
+ | store: store,
+ | template: ""
+ | });
+ |
+
+ example:
+ programmatic from an array of objects:
+ | var dataArr = [
+ | { name: "foo", valueAttr: "bar" },
+ | { name: "thinger", valueAttr: "blah" }
+ | ];
+ |
+ | var iter = new dojox.widget.Iterator({
+ | data: dataArr,
+ | template: ""
+ | });
+
+ example:
+ programmatic from an array of strings:
+ | var dataArr = [
+ | { name: "foo", valueAttr: "bar" },
+ | { name: "thinger", valueAttr: "blah" }
+ | ];
+ |
+ | var iter = new dojox.widget.Iterator({
+ | data: dataArr,
+ | template: ""
+ | });
+
+*/
+
+
+dojo.declare("dojox.widget.Iterator",
+ [ dijit.Declaration ],
+ {
+
+ constructor: (function(){
+ var ctr = 0;
+ return function(){
+ this.attrs = [];
+ this.children = [];
+ this.widgetClass = "dojox.widget.Iterator._classes._"+(ctr++);
+ }
+ })(),
+
+ start: 0,
+ fetchMax: 1000,
+ query: { name: "*" },
+ attrs: [],
+ defaultValue: "",
+ widgetCtor: null,
+ dataValues: [], // an array of strings
+ data: null, // should be a reference to an Array
+ store: null,
+ _srcIndex: 0,
+ _srcParent: null,
+
+ _setSrcIndex: function(s){
+ this._srcIndex = 0;
+ this._srcParent = s.parentNode;
+ var ts = s;
+ while(ts.previousSibling){
+ this._srcIndex++;
+ ts = ts.previousSibling;
+ };
+ },
+
+ postscript: function(p, s){
+ // figure out the position of the source node in it's parent
+ this._setSrcIndex(s);
+ // this._srcIndex = dojo.query(">", this._srcParent).indexOf(s);
+
+ this.inherited("postscript", arguments);
+ var wc = this.widgetCtor = dojo.getObject(this.widgetClass);
+
+ this.attrs = dojo.map(
+ wc.prototype.templateString.match(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g),
+ function(s){ return s.slice(2, -1); }
+ );
+ dojo.forEach(
+ this.attrs,
+ function(m){ wc.prototype[m] = ""; }
+ );
+ this.update();
+ },
+
+ clear: function(){
+ if(this.children.length){
+ this._setSrcIndex(this.children[0].domNode);
+ }
+ dojo.forEach(this.children, "item.destroy();");
+ this.children = [];
+ },
+
+ update: function(){
+ if(this.store){
+ // we're executing a query
+ this.fetch();
+ }else{
+ // we came from an array of objects. Easier!
+ this.onDataAvailable(this.data||this.dataValues);
+ }
+ },
+
+ _addItem: function(/*Object*/config, idx){
+ if(dojo.isString(config)){
+ config = { value: config };
+ }
+ var widget = new this.widgetCtor(config);
+ this.children.push(widget);
+ dojo.place(widget.domNode, this._srcParent, this._srcIndex+idx);
+ },
+
+ getAttrValuesObj: function(item){
+ var obj = {};
+ if(dojo.isString(item)){
+ dojo.forEach(this.attrs, function(attr){
+ obj[attr] = (attr == "value") ? item : this.defaultValue;
+ }, this);
+ }else{
+ dojo.forEach(this.attrs, function(attr){
+ if(this.store){
+ obj[attr] = this.store.getValue(item, attr)||this.defaultValue;
+ }else{
+ obj[attr] = item[attr]||this.defaultValue;
+ }
+ }, this);
+ }
+ return obj;
+ },
+
+ onDataAvailable: function(data){
+ this.clear();
+ // console.debug(data);
+ dojo.forEach(data, function(item, idx){
+ this._addItem(this.getAttrValuesObj(item), idx);
+ }, this);
+ },
+
+ fetch: function(query, start, end){
+ this.store.fetch({
+ query: query||this.query,
+ start: start||this.start,
+ count: end||this.fetchMax,
+ onComplete: dojo.hitch(this,"onDataAvailable")
+ });
+ }
+});
+
+dojox.widget.Iterator._classes = {};
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Loader.js b/js/dojo-1.6/dojox/widget/Loader.js new file mode 100644 index 0000000..4e7b385 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Loader.js @@ -0,0 +1,117 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Loader"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Loader"] = true;
+dojo.provide("dojox.widget.Loader");
+dojo.deprecated("dojox.widget.Loader", "", "2.0");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+dojo.declare("dojox.widget.Loader", [dijit._Widget,dijit._Templated], {
+ // summary: a configurable global xhr-listener to display
+ // a loading message during running xhr's or to simply provide
+ // base-level topic to subscribe to for custom loading messages
+ //
+ // loadIcon: String
+ // location to the icon used.
+ loadIcon: dojo.moduleUrl("dojox.widget.Loader","icons/loading.gif"),
+
+ // loadMessage: String
+ // string to use for progress loading
+ loadMessage: 'Loading ...',
+
+ // hasVisuals: Boolean
+ // true to display a fixed loading message in TR cornder, false to unly provide
+ // "Loader" topic to subscribe to for your own custom loading message.
+ hasVisuals: true,
+
+ // attachToPointer
+ // true to use visual indicator where cursor is
+ attachToPointer: true,
+
+ // duration: Integer
+ // time in ms to toggle in/out the visual load indicator
+ duration: 125,
+
+ // _offset: Integer
+ // distance in px from the mouse pointer to show attachToPointer avatar
+ _offset: 16,
+
+ // holder for mousemove connection
+ _pointerConnect: null,
+ _xhrStart: null,
+ _xhrEnd: null,
+
+ templateString: '<div dojoAttachPoint="loadNode" class="dojoxLoader">'
+ +'<img src="${loadIcon}" class="dojoxLoaderIcon"> <span dojoAttachPoint="loadMessageNode" class="dojoxLoaderMessage"></span>'
+ +'</div>',
+
+ postCreate: function(){
+ // summary: setup the loader
+
+ if(!this.hasVisuals){
+ this.loadNode.style.display = "none"; // _destroy()?
+ }else{
+ if(this.attachToPointer){
+ dojo.removeClass(this.loadNode,"dojoxLoader");
+ dojo.addClass(this.loadNode,"dojoxLoaderPointer");
+ }
+ this._hide();
+ }
+ this._setMessage(this.loadMessage);
+
+ // FIXME: create our connections. would be easier, and this might be redundant
+ // if Deferred published something. XHR published stuff. FIXME to use that.
+ this._xhrStart = this.connect(dojo,"_ioSetArgs","_show");
+ this._xhrEnd = this.connect(dojo.Deferred.prototype,"_fire","_hide");
+
+ },
+
+ _setMessage: function(/* String */ message){
+ // summary: set's the message in the loader
+ this.loadMessageNode.innerHTML = message;
+ },
+
+ _putLoader: function(/* Event */ e){
+ // summary: place the floating loading element based on mousemove connection position
+ dijit.placeOnScreen(this.loadNode,{ x: e.clientX+this._offset, y:e.clientY+this._offset }, ["TL","BR"]);
+ },
+
+ _show: function(){
+ // summary: publish and show progress indicator
+ dojo.publish("Loader",[{ message: 'started' }]);
+ if(this.hasVisuals){
+ if(this.attachToPointer){
+ this._pointerConnect = this.connect(document,"onmousemove","_putLoader");
+ }
+ dojo.style(this.loadNode, {
+ opacity:0, display:""
+ });
+ dojo.fadeIn({ node: this.loadNode, duration:this.duration }).play();
+ }
+ },
+
+ _hide: function(){
+ // summary: publish "xhr ended" and hide progress indicator
+ dojo.publish("Loader",[{ message: 'ended' }]);
+ if(this.hasVisuals){
+ if(this.attachToPointer){
+ this.disconnect(this._pointerConnect);
+ }
+ dojo.fadeOut({
+ node: this.loadNode,
+ duration:this.duration,
+ onEnd: dojo.partial(dojo.style, this.loadNode, "display", "none")
+ }).play();
+ }
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Loader.xd.js b/js/dojo-1.6/dojox/widget/Loader.xd.js new file mode 100644 index 0000000..2923de1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Loader.xd.js @@ -0,0 +1,123 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Loader"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Loader"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Loader"] = true;
+dojo.provide("dojox.widget.Loader");
+dojo.deprecated("dojox.widget.Loader", "", "2.0");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+dojo.declare("dojox.widget.Loader", [dijit._Widget,dijit._Templated], {
+ // summary: a configurable global xhr-listener to display
+ // a loading message during running xhr's or to simply provide
+ // base-level topic to subscribe to for custom loading messages
+ //
+ // loadIcon: String
+ // location to the icon used.
+ loadIcon: dojo.moduleUrl("dojox.widget.Loader","icons/loading.gif"),
+
+ // loadMessage: String
+ // string to use for progress loading
+ loadMessage: 'Loading ...',
+
+ // hasVisuals: Boolean
+ // true to display a fixed loading message in TR cornder, false to unly provide
+ // "Loader" topic to subscribe to for your own custom loading message.
+ hasVisuals: true,
+
+ // attachToPointer
+ // true to use visual indicator where cursor is
+ attachToPointer: true,
+
+ // duration: Integer
+ // time in ms to toggle in/out the visual load indicator
+ duration: 125,
+
+ // _offset: Integer
+ // distance in px from the mouse pointer to show attachToPointer avatar
+ _offset: 16,
+
+ // holder for mousemove connection
+ _pointerConnect: null,
+ _xhrStart: null,
+ _xhrEnd: null,
+
+ templateString: '<div dojoAttachPoint="loadNode" class="dojoxLoader">'
+ +'<img src="${loadIcon}" class="dojoxLoaderIcon"> <span dojoAttachPoint="loadMessageNode" class="dojoxLoaderMessage"></span>'
+ +'</div>',
+
+ postCreate: function(){
+ // summary: setup the loader
+
+ if(!this.hasVisuals){
+ this.loadNode.style.display = "none"; // _destroy()?
+ }else{
+ if(this.attachToPointer){
+ dojo.removeClass(this.loadNode,"dojoxLoader");
+ dojo.addClass(this.loadNode,"dojoxLoaderPointer");
+ }
+ this._hide();
+ }
+ this._setMessage(this.loadMessage);
+
+ // FIXME: create our connections. would be easier, and this might be redundant
+ // if Deferred published something. XHR published stuff. FIXME to use that.
+ this._xhrStart = this.connect(dojo,"_ioSetArgs","_show");
+ this._xhrEnd = this.connect(dojo.Deferred.prototype,"_fire","_hide");
+
+ },
+
+ _setMessage: function(/* String */ message){
+ // summary: set's the message in the loader
+ this.loadMessageNode.innerHTML = message;
+ },
+
+ _putLoader: function(/* Event */ e){
+ // summary: place the floating loading element based on mousemove connection position
+ dijit.placeOnScreen(this.loadNode,{ x: e.clientX+this._offset, y:e.clientY+this._offset }, ["TL","BR"]);
+ },
+
+ _show: function(){
+ // summary: publish and show progress indicator
+ dojo.publish("Loader",[{ message: 'started' }]);
+ if(this.hasVisuals){
+ if(this.attachToPointer){
+ this._pointerConnect = this.connect(document,"onmousemove","_putLoader");
+ }
+ dojo.style(this.loadNode, {
+ opacity:0, display:""
+ });
+ dojo.fadeIn({ node: this.loadNode, duration:this.duration }).play();
+ }
+ },
+
+ _hide: function(){
+ // summary: publish "xhr ended" and hide progress indicator
+ dojo.publish("Loader",[{ message: 'ended' }]);
+ if(this.hasVisuals){
+ if(this.attachToPointer){
+ this.disconnect(this._pointerConnect);
+ }
+ dojo.fadeOut({
+ node: this.loadNode,
+ duration:this.duration,
+ onEnd: dojo.partial(dojo.style, this.loadNode, "display", "none")
+ }).play();
+ }
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Loader/Loader.css b/js/dojo-1.6/dojox/widget/Loader/Loader.css new file mode 100644 index 0000000..4b2d19c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Loader/Loader.css @@ -0,0 +1,27 @@ +.dojoxLoaderPointer { + position:absolute; + z-index:999; +} + +.dojoxLoader { + float:right; + position:fixed; + height:25px; + width:100px; + top:0; + right:0; + padding:3px; + border:1px solid #ccc; + background:#fff; + min-width:42px; +} + +.dojoxLoaderIcon { + height:22px; width:22px; + vertical-align:middle; +} + +.dojoxLoaderMessage { + font:8pt Arial,san-serif; + color:#666; +} diff --git a/js/dojo-1.6/dojox/widget/Loader/icons/loading.gif b/js/dojo-1.6/dojox/widget/Loader/icons/loading.gif Binary files differnew file mode 100644 index 0000000..6e7c8e5 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Loader/icons/loading.gif diff --git a/js/dojo-1.6/dojox/widget/Pager.js b/js/dojo-1.6/dojox/widget/Pager.js new file mode 100644 index 0000000..8e57d89 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager.js @@ -0,0 +1,561 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Pager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Pager"] = true;
+dojo.provide("dojox.widget.Pager");
+dojo.experimental("dojox.widget.Pager");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dojo.fx");
+
+dojo.declare("dojox.widget.Pager",
+ [dijit._Widget, dijit._Templated],
+ {
+ // summary: A Pager, displaying a list of sized nodes
+
+
+ templateString: dojo.cache("dojox.widget", "Pager/Pager.html", "<div dojoAttachPoint=\"pagerContainer\" tabIndex=\"0\" dojoAttachEvent=\"onkeypress: _handleKey, onfocus: _a11yStyle, onblur:_a11yStyle\" class=\"${orientation}PagerContainer\">\r\n <div class=\"pagerContainer\">\r\n\t\t<div dojoAttachPoint=\"pagerContainerStatus\" class=\"${orientation}PagerStatus\"></div>\r\n\t\t<div dojoAttachPoint=\"pagerContainerView\" class=\"${orientation}PagerView\">\r\n\t\t <div dojoAttachPoint=\"pagerItemContainer\"><ul dojoAttachPoint=\"pagerItems\" class=\"pagerItems\"></ul></div>\r\n\t\t</div>\r\n\t\t<div dojoAttachPoint=\"pagerContainerPager\" class=\"${orientation}PagerPager\">\r\n\t\t\t<div tabIndex=\"0\" dojoAttachPoint=\"pagerNext\" class=\"pagerIconContainer\" dojoAttachEvent=\"onclick: _pagerNext\"><img dojoAttachPoint=\"pagerIconNext\" src=\"${iconNext}\" alt=\"Next\" /></div>\r\n\t\t\t<div tabIndex=\"0\" dojoAttachPoint=\"pagerPrevious\" class=\"pagerIconContainer\" dojoAttachEvent=\"onclick: _pagerPrevious\"><img dojoAttachPoint=\"pagerIconPrevious\" src=\"${iconPrevious}\" alt=\"Previous\" /></div>\r\n\t\t</div>\r\n </div>\r\n\t<div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div>\r\n</div>\r\n"),
+
+/*=====
+ // iconPrevious: String?
+ // The url of the previous page icon
+ iconPrevious: "",
+
+ // iconNext: String?
+ // The url of the next page icon
+ iconNext: "",
+=====*/
+
+ iconPage: dojo.moduleUrl("dojox.widget", "Pager/images/pageInactive.png"),
+ iconPageActive: dojo.moduleUrl("dojox.widget", "Pager/images/pageActive.png"),
+
+ // store: Object
+ // A dojo.data Data store
+ store: null, // data store for items
+
+ // orientation: String
+ // Either "horizontal or "vertical" to define the direction the pages will slide
+ orientation: "horizontal", // or vertical
+
+ // statusPos: String
+ // A string describing where to put the Pager "current page" indicator. Options are
+ // "leading" or "trailing". In the case of horiztonal orientation, "leading" indicates
+ // positioned above the PageItems. In the case of vertical, "leading" indicates "before".
+ statusPos: "leading",
+
+ // pagerPos: String
+ // TODOC
+ pagerPos: "center",
+
+ // duration: Integer
+ // Time in milliseconds to transition the pages
+ duration: 500,
+
+ // itemSpace: Integer
+ // Spacing between items? TODOC
+ itemSpace: 2,
+
+ // resizeChildren: Boolean
+ // TODOC
+ resizeChildren: true,
+
+ // itemClass: String
+ // The full dotted named of a Class to use for the internal Pager Items.
+ itemClass: "dojox.widget._PagerItem",
+
+ // itemsPage: Integer
+ // The numbers of items to display in each "Page"
+ itemsPage: 3,
+
+ postMixInProperties: function(){
+ var h = (this.orientation == "horizontal");
+ dojo.mixin(this,{
+ _totalPages:0,
+ _currentPage:1,
+ dirClass: "pager" + (h ? "Horizontal" : "Vertical"),
+ iconNext: dojo.moduleUrl("dojox.widget", "Pager/images/" + (h ? "h" : "v") + "Next.png"),
+ iconPrevious: dojo.moduleUrl("dojox.widget", "Pager/images/" + (h ? "h" : "v") + "Previous.png")
+ });
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ //this.connect(this.domNode,"onkeypress","_handleKey");
+ this.store.fetch({
+ onComplete: dojo.hitch(this, "_init")
+ });
+
+ },
+
+ _a11yStyle: function(e){
+ // summary: top level onfocus/onblur listen to set a class "pagerFocus" on some node
+ // and remove it onblur
+ dojo[(e.type == "focus" ? "addClass" : "removeClass")](e.target,"pagerFocus");
+ },
+
+ _handleKey: function(e){
+ // summary: Handle keyboard navigation internally
+
+ var dk = dojo.keys;
+ var key = (e.charCode == dk.SPACE ? dk.SPACE : e.keyCode);
+ switch(key){
+
+ case dk.UP_ARROW:
+ case dk.RIGHT_ARROW:
+ case 110:
+ case 78: // key "n"
+ e.preventDefault();
+ this._pagerNext();
+ break;
+
+ case dk.DOWN_ARROW:
+ case dk.LEFT_ARROW:
+ case 112:
+ case 80: // key "p"
+ e.preventDefault();
+ this._pagerPrevious();
+ break;
+
+ case dk.ENTER:
+ switch(e.target){
+ case this.pagerNext : this._pagerNext(); break;
+ case this.pagerPrevious : this._pagerPrevious(); break;
+ }
+ break;
+ }
+ },
+
+ _init: function(items) {
+ this.items = items;
+ this._renderPages();
+ this._renderStatus();
+ this._renderPager();
+ },
+
+ _renderPages: function(){
+ var pcv = this.pagerContainerView;
+ var _h = (this.orientation == "horizontal");
+ var style = dojo.style;
+ if(_h){
+
+ var pagerH = dojo.marginBox(this.pagerContainerPager).h;
+ var statusH = dojo.marginBox(this.pagerContainerStatus).h;
+ if (this.pagerPos != 'center'){
+ var addonHeight = pagerH+statusH;
+ }else{
+ var addonHeight = statusH;
+ var widthSub = this.pagerIconNext.width;
+ var containerWidth = style(pcv, 'width');
+ var newWidth = containerWidth-(2*widthSub);
+ style(pcv, {
+ width: newWidth+'px',
+ marginLeft: this.pagerIconNext.width+'px',
+ marginRight: this.pagerIconNext.width+'px'
+ });
+ }
+ var totalH = style(this.pagerContainer, 'height') - addonHeight;
+ style(this.pagerContainerView, 'height', totalH+'px');
+
+ var itemSpace = Math.floor(style(pcv, 'width') / this.itemsPage);
+ if(this.statusPos == 'trailing'){
+ if(this.pagerPos != 'center'){
+ style(pcv, 'marginTop', pagerH+'px');
+ }
+ style(pcv, 'marginBottom', statusH+'px');
+ }else{
+ style(pcv, 'marginTop', statusH+'px');
+ if (this.pagerPos != 'center'){
+ style(pcv, 'marginTop', pagerH+'px');
+ }
+ }
+
+ }else{
+
+ var pagerW = dojo.marginBox(this.pagerContainerPager).w;
+ var statusW = dojo.marginBox(this.pagerContainerStatus).w;
+ var containerW = style(this.pagerContainer, 'width');
+ if(this.pagerPos != 'center'){
+ var addonWidth = pagerW + statusW;
+ }else{
+ var addonWidth = statusW;
+ var heightSub = this.pagerIconNext.height;
+ var containerHeight = style(pcv, 'height');
+ var newHeight = containerHeight - (2 * heightSub);
+ style(pcv,{
+ height: newHeight+'px',
+ marginTop: this.pagerIconNext.height+'px',
+ marginBottom: this.pagerIconNext.height+'px'
+ });
+ }
+ var totalW = style(this.pagerContainer, 'width') - addonWidth;
+ style(pcv, 'width', totalW+'px');
+
+ var itemSpace = Math.floor(style(pcv, 'height') / this.itemsPage);
+ if(this.statusPos == 'trailing'){
+ if (this.pagerPos != 'center'){
+ style(pcv, 'marginLeft', pagerW + 'px');
+ }
+ style(pcv, 'marginRight', statusW + 'px');
+ }else{
+ style(pcv, 'marginLeft', statusW + 'px');
+ if(this.pagerPos != 'center'){
+ style(pcv, 'marginRight', pagerW+'px');
+ }
+ }
+ }
+
+ var _PagerItem = dojo.getObject(this.itemClass);
+ var paddingLead = "padding" + (_h ? "Left" : "Top");
+ var paddingTrail = "padding" + (_h ? "Right" : "Bottom");
+
+ dojo.forEach(this.items, function(item, cnt){
+
+ var contentContainer = dojo.create('div', {
+ innerHTML: item.content
+ });
+
+ var pagerItem = new _PagerItem({
+ id: this.id + '-item-' + (cnt + 1)
+ }, contentContainer);
+
+ this.pagerItems.appendChild(pagerItem.domNode);
+
+ var containerProps = {};
+ containerProps[(_h ? "width" : "height")] = (itemSpace - this.itemSpace) + "px";
+ var p = (_h ? "height" : "width");
+ containerProps[p] = style(pcv, p) + "px";
+ style(pagerItem.containerNode, containerProps);
+
+ if(this.resizeChildren){
+ pagerItem.resizeChildren();
+ }
+ pagerItem.parseChildren();
+
+ // only display amount of items as defined in itemsPage
+ style(pagerItem.domNode, "position", "absolute");
+
+ if (cnt < this.itemsPage){
+ var pos = (cnt) * itemSpace;
+ var trailingDir = (_h ? "left" : "top");
+ var dir = (_h ? "top" : "left");
+ style(pagerItem.domNode, dir, "0px");
+ style(pagerItem.domNode, trailingDir, pos+"px");
+ }else{
+ style(pagerItem.domNode, "top", "-1000px");
+ style(pagerItem.domNode, "left", "-1000px");
+ }
+
+ style(pagerItem.domNode, paddingTrail, (this.itemSpace/2)+"px");
+ style(pagerItem.domNode, paddingLead, (this.itemSpace/2)+"px");
+
+ }, this);
+ },
+
+ _renderPager: function() {
+ var tcp = this.pagerContainerPager;
+ var zero = "0px";
+ var _h = (this.orientation == "horizontal");
+ if(_h){
+
+ if(this.statusPos == 'center'){
+
+ }else if (this.statusPos == 'trailing'){
+ dojo.style(tcp, 'top', zero);
+ }else{
+ dojo.style(tcp, 'bottom', zero);
+ }
+ dojo.style(this.pagerNext, 'right', zero);
+ dojo.style(this.pagerPrevious, 'left', zero);
+
+ }else{
+
+ if (this.statusPos == 'trailing'){
+ dojo.style(tcp, 'left', zero);
+ }else{
+ dojo.style(tcp, 'right', zero);
+ }
+ dojo.style(this.pagerNext, 'bottom', zero);
+ dojo.style(this.pagerPrevious, 'top', zero);
+ }
+
+ },
+
+ _renderStatus: function() {
+ this._totalPages = Math.ceil(this.items.length / this.itemsPage);
+ // FIXME!!
+ this.iconWidth = 0;
+ this.iconHeight = 0;
+ this.iconsLoaded = 0;
+ this._iconConnects = [];
+
+ for (var i = 1; i <= this._totalPages; i++){
+ var icon = new Image();
+
+ var pointer = i;
+ dojo.connect(icon, 'onclick', dojo.hitch(this, function(pointer) {
+ this._pagerSkip(pointer);
+ }, pointer));
+
+ this._iconConnects[pointer] = dojo.connect(icon, 'onload', dojo.hitch(this,function(pointer){
+ this.iconWidth += icon.width;
+ this.iconHeight += icon.height;
+ this.iconsLoaded++;
+
+ if (this._totalPages == this.iconsLoaded){
+ if (this.orientation == "horizontal"){
+ if (this.statusPos == 'trailing'){
+ if (this.pagerPos == 'center'){
+ var containerHeight = dojo.style(this.pagerContainer, 'height');
+ var statusHeight = dojo.style(this.pagerContainerStatus, 'height');
+ dojo.style(this.pagerContainerPager, 'top', ((containerHeight/2)-(statusHeight/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'bottom', '0px');
+ }else{
+ if (this.pagerPos == 'center'){
+ var containerHeight = dojo.style(this.pagerContainer, 'height');
+ var statusHeight = dojo.style(this.pagerContainerStatus, 'height');
+ dojo.style(this.pagerContainerPager, 'bottom', ((containerHeight/2)-(statusHeight/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'top', '0px');
+ }
+
+ var position = (dojo.style(this.pagerContainer, 'width')/2)-(this.iconWidth/2);
+ dojo.style(this.pagerContainerStatus, 'paddingLeft', position+'px');
+ }else{
+ if (this.statusPos == 'trailing'){
+ if (this.pagerPos == 'center'){
+ var containerWidth = dojo.style(this.pagerContainer, 'width');
+ var statusWidth = dojo.style(this.pagerContainerStatus, 'width');
+ dojo.style(this.pagerContainerPager, 'left', ((containerWidth/2)-(statusWidth/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'right', '0px');
+ }else{
+ if (this.pagerPos == 'center'){
+ var containerWidth = dojo.style(this.pagerContainer, 'width');
+ var statusWidth = dojo.style(this.pagerContainerStatus, 'width');
+ dojo.style(this.pagerContainerPager, 'right', ((containerWidth/2)-(statusWidth/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'left', '0px');
+ }
+ var position = (dojo.style(this.pagerContainer, 'height')/2)-(this.iconHeight/2);
+ dojo.style(this.pagerContainerStatus, 'paddingTop', position+'px');
+ }
+ }
+ dojo.disconnect(this._iconConnects[pointer]);
+ }, pointer));
+
+ if (i==this._currentPage){
+ icon.src=this.iconPageActive;
+ }else{
+ icon.src=this.iconPage;
+ }
+ var pointer = i;
+
+ dojo.addClass(icon, this.orientation+'PagerIcon');
+ dojo.attr(icon, 'id', this.id+'-status-'+i);
+ this.pagerContainerStatus.appendChild(icon);
+
+ if (this.orientation == "vertical"){
+ dojo.style(icon, 'display', 'block');
+ }
+ }
+ },
+
+ _pagerSkip: function(page){
+ if (this._currentPage == page){
+ return;
+ }else{
+ // calculate whether to go left or right, take shortest way
+ var distanceP; var distanceN;
+ if (page < this._currentPage){
+ distanceP = this._currentPage - page;
+ distanceN = (this._totalPages + page) - this._currentPage;
+ }else{
+ distanceP = (this._totalPages + this._currentPage) - page;
+ distanceN = page - this._currentPage;
+ }
+
+ var b = (distanceN > distanceP);
+ this._toScroll = (b ? distanceP : distanceN);
+ var cmd = (b ? "_pagerPrevious" : "_pagerNext");
+ var connect = this.connect(this, "onScrollEnd", function(){
+ this._toScroll--;
+ if(this._toScroll < 1){
+ this.disconnect(connect);
+ }else{
+ this[cmd]();
+ }
+ });
+ this[cmd]();
+
+ }
+ },
+
+ _pagerNext: function(){
+ if(this._anim) return;
+
+ /**
+ * fade slide out current items
+ * make sure that next items are ligned up nicely before sliding them in
+ */
+ var _anims = [];
+ for (var i = this._currentPage * this.itemsPage; i > (this._currentPage - 1) * this.itemsPage; i--){
+ if (!dojo.byId(this.id+'-item-'+i)) continue;
+
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+ if (this.orientation == "horizontal") {
+ var move = marginBox.l - (this.itemsPage * marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ var move = marginBox.t - (this.itemsPage * marginBox.h);
+ _anims.push(dojo.fx.slideTo({node: currentItem, top: move, duration: this.duration}));
+ }
+
+ }
+ var previousPage = this._currentPage;
+ if (this._currentPage == this._totalPages){
+ this._currentPage = 1;
+ }else{
+ this._currentPage++;
+ }
+
+ var cnt = this.itemsPage;
+ for (var i=this._currentPage*this.itemsPage; i>(this._currentPage-1)*this.itemsPage; i--){
+ if (dojo.byId(this.id+'-item-'+i)){
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+ if (this.orientation == "horizontal") {
+ var newPos = (dojo.style(this.pagerContainerView, 'width')+((cnt-1)*marginBox.w))-1;
+ dojo.style(currentItem, 'left', newPos+'px');
+ dojo.style(currentItem, 'top', '0px');
+
+ var move = newPos-(this.itemsPage*marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ newPos = (dojo.style(this.pagerContainerView, 'height')+((cnt-1)*marginBox.h))-1;
+ dojo.style(currentItem, 'top', newPos+'px');
+ dojo.style(currentItem, 'left', '0px');
+
+ var move = newPos-(this.itemsPage*marginBox.h);
+ _anims.push(dojo.fx.slideTo({ node: currentItem, top: move, duration: this.duration}));
+ }
+ }
+ cnt--;
+ }
+
+ this._anim = dojo.fx.combine(_anims);
+ var animConnect = this.connect(this._anim, "onEnd", function(){
+ delete this._anim;
+ this.onScrollEnd();
+ this.disconnect(animConnect);
+ });
+ this._anim.play();
+
+ // set pager icons
+ dojo.byId(this.id+'-status-'+previousPage).src = this.iconPage;
+ dojo.byId(this.id+'-status-'+this._currentPage).src = this.iconPageActive;
+ },
+
+ _pagerPrevious: function(){
+ if(this._anim) return;
+
+ var _anims = [];
+ for (var i=this._currentPage*this.itemsPage; i>(this._currentPage-1)*this.itemsPage; i--){
+ if (!dojo.byId(this.id+'-item-'+i)) continue;
+
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+ if (this.orientation == "horizontal") {
+ var move = dojo.style(currentItem, 'left')+(this.itemsPage*marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ var move = dojo.style(currentItem, 'top')+(this.itemsPage*marginBox.h);
+ _anims.push(dojo.fx.slideTo({node: currentItem, top: move, duration: this.duration}));
+ }
+ }
+
+ var previousPage = this._currentPage;
+ if (this._currentPage == 1){
+ this._currentPage = this._totalPages;
+ }else{
+ this._currentPage--;
+ }
+
+ var cnt = this.itemsPage;
+ var j=1;
+ for (var i=this._currentPage*this.itemsPage; i>(this._currentPage-1)*this.itemsPage; i--){
+ if(dojo.byId(this.id+'-item-'+i)){
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+
+ if (this.orientation == "horizontal") {
+ var newPos = -(j * marginBox.w) + 1;
+ dojo.style(currentItem, 'left', newPos+'px');
+ dojo.style(currentItem, 'top', '0px');
+
+ var move = ((cnt - 1) * marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+
+ var move = newPos+(this.itemsPage * marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ newPos = -((j * marginBox.h) + 1);
+ dojo.style(currentItem, 'top', newPos+'px');
+ dojo.style(currentItem, 'left', '0px');
+
+ var move = ((cnt - 1) * marginBox.h);
+ _anims.push(dojo.fx.slideTo({node: currentItem, top: move, duration: this.duration}));
+ }
+
+ }
+ cnt--;
+ j++;
+ }
+
+ this._anim = dojo.fx.combine(_anims);
+ var animConnect = dojo.connect(this._anim, "onEnd", dojo.hitch(this, function(){
+ delete this._anim;
+ this.onScrollEnd();
+ dojo.disconnect(animConnect);
+ }));
+ this._anim.play();
+
+ // set pager icons
+ dojo.byId(this.id + '-status-' + previousPage).src = this.iconPage;
+ dojo.byId(this.id + '-status-' + this._currentPage).src = this.iconPageActive;
+
+ },
+
+ onScrollEnd: function(){
+ // summary: Stub Function. Fired after the slide is complete. Override or connect.
+ }
+
+});
+
+dojo.declare("dojox.widget._PagerItem",
+ [dijit._Widget, dijit._Templated],
+ {
+
+ templateString: '<li class="pagerItem" dojoAttachPoint="containerNode"></li>',
+
+ resizeChildren: function(){
+ var box = dojo.marginBox(this.containerNode);
+ dojo.style(this.containerNode.firstChild, {
+ width: box.w +'px',
+ height: box.h + 'px'
+ });
+ },
+
+ parseChildren: function(){
+ dojo.parser.parse(this.containerNode);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Pager.xd.js b/js/dojo-1.6/dojox/widget/Pager.xd.js new file mode 100644 index 0000000..ea18477 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager.xd.js @@ -0,0 +1,568 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Pager"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Pager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Pager"] = true;
+dojo.provide("dojox.widget.Pager");
+dojo.experimental("dojox.widget.Pager");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dojo.fx");
+
+dojo.declare("dojox.widget.Pager",
+ [dijit._Widget, dijit._Templated],
+ {
+ // summary: A Pager, displaying a list of sized nodes
+
+
+ templateString: dojo.cache("dojox.widget", "Pager/Pager.html", "<div dojoAttachPoint=\"pagerContainer\" tabIndex=\"0\" dojoAttachEvent=\"onkeypress: _handleKey, onfocus: _a11yStyle, onblur:_a11yStyle\" class=\"${orientation}PagerContainer\">\r\n <div class=\"pagerContainer\">\r\n\t\t<div dojoAttachPoint=\"pagerContainerStatus\" class=\"${orientation}PagerStatus\"></div>\r\n\t\t<div dojoAttachPoint=\"pagerContainerView\" class=\"${orientation}PagerView\">\r\n\t\t <div dojoAttachPoint=\"pagerItemContainer\"><ul dojoAttachPoint=\"pagerItems\" class=\"pagerItems\"></ul></div>\r\n\t\t</div>\r\n\t\t<div dojoAttachPoint=\"pagerContainerPager\" class=\"${orientation}PagerPager\">\r\n\t\t\t<div tabIndex=\"0\" dojoAttachPoint=\"pagerNext\" class=\"pagerIconContainer\" dojoAttachEvent=\"onclick: _pagerNext\"><img dojoAttachPoint=\"pagerIconNext\" src=\"${iconNext}\" alt=\"Next\" /></div>\r\n\t\t\t<div tabIndex=\"0\" dojoAttachPoint=\"pagerPrevious\" class=\"pagerIconContainer\" dojoAttachEvent=\"onclick: _pagerPrevious\"><img dojoAttachPoint=\"pagerIconPrevious\" src=\"${iconPrevious}\" alt=\"Previous\" /></div>\r\n\t\t</div>\r\n </div>\r\n\t<div dojoAttachPoint=\"containerNode\" style=\"display:none\"></div>\r\n</div>\r\n"),
+
+/*=====
+ // iconPrevious: String?
+ // The url of the previous page icon
+ iconPrevious: "",
+
+ // iconNext: String?
+ // The url of the next page icon
+ iconNext: "",
+=====*/
+
+ iconPage: dojo.moduleUrl("dojox.widget", "Pager/images/pageInactive.png"),
+ iconPageActive: dojo.moduleUrl("dojox.widget", "Pager/images/pageActive.png"),
+
+ // store: Object
+ // A dojo.data Data store
+ store: null, // data store for items
+
+ // orientation: String
+ // Either "horizontal or "vertical" to define the direction the pages will slide
+ orientation: "horizontal", // or vertical
+
+ // statusPos: String
+ // A string describing where to put the Pager "current page" indicator. Options are
+ // "leading" or "trailing". In the case of horiztonal orientation, "leading" indicates
+ // positioned above the PageItems. In the case of vertical, "leading" indicates "before".
+ statusPos: "leading",
+
+ // pagerPos: String
+ // TODOC
+ pagerPos: "center",
+
+ // duration: Integer
+ // Time in milliseconds to transition the pages
+ duration: 500,
+
+ // itemSpace: Integer
+ // Spacing between items? TODOC
+ itemSpace: 2,
+
+ // resizeChildren: Boolean
+ // TODOC
+ resizeChildren: true,
+
+ // itemClass: String
+ // The full dotted named of a Class to use for the internal Pager Items.
+ itemClass: "dojox.widget._PagerItem",
+
+ // itemsPage: Integer
+ // The numbers of items to display in each "Page"
+ itemsPage: 3,
+
+ postMixInProperties: function(){
+ var h = (this.orientation == "horizontal");
+ dojo.mixin(this,{
+ _totalPages:0,
+ _currentPage:1,
+ dirClass: "pager" + (h ? "Horizontal" : "Vertical"),
+ iconNext: dojo.moduleUrl("dojox.widget", "Pager/images/" + (h ? "h" : "v") + "Next.png"),
+ iconPrevious: dojo.moduleUrl("dojox.widget", "Pager/images/" + (h ? "h" : "v") + "Previous.png")
+ });
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ //this.connect(this.domNode,"onkeypress","_handleKey");
+ this.store.fetch({
+ onComplete: dojo.hitch(this, "_init")
+ });
+
+ },
+
+ _a11yStyle: function(e){
+ // summary: top level onfocus/onblur listen to set a class "pagerFocus" on some node
+ // and remove it onblur
+ dojo[(e.type == "focus" ? "addClass" : "removeClass")](e.target,"pagerFocus");
+ },
+
+ _handleKey: function(e){
+ // summary: Handle keyboard navigation internally
+
+ var dk = dojo.keys;
+ var key = (e.charCode == dk.SPACE ? dk.SPACE : e.keyCode);
+ switch(key){
+
+ case dk.UP_ARROW:
+ case dk.RIGHT_ARROW:
+ case 110:
+ case 78: // key "n"
+ e.preventDefault();
+ this._pagerNext();
+ break;
+
+ case dk.DOWN_ARROW:
+ case dk.LEFT_ARROW:
+ case 112:
+ case 80: // key "p"
+ e.preventDefault();
+ this._pagerPrevious();
+ break;
+
+ case dk.ENTER:
+ switch(e.target){
+ case this.pagerNext : this._pagerNext(); break;
+ case this.pagerPrevious : this._pagerPrevious(); break;
+ }
+ break;
+ }
+ },
+
+ _init: function(items) {
+ this.items = items;
+ this._renderPages();
+ this._renderStatus();
+ this._renderPager();
+ },
+
+ _renderPages: function(){
+ var pcv = this.pagerContainerView;
+ var _h = (this.orientation == "horizontal");
+ var style = dojo.style;
+ if(_h){
+
+ var pagerH = dojo.marginBox(this.pagerContainerPager).h;
+ var statusH = dojo.marginBox(this.pagerContainerStatus).h;
+ if (this.pagerPos != 'center'){
+ var addonHeight = pagerH+statusH;
+ }else{
+ var addonHeight = statusH;
+ var widthSub = this.pagerIconNext.width;
+ var containerWidth = style(pcv, 'width');
+ var newWidth = containerWidth-(2*widthSub);
+ style(pcv, {
+ width: newWidth+'px',
+ marginLeft: this.pagerIconNext.width+'px',
+ marginRight: this.pagerIconNext.width+'px'
+ });
+ }
+ var totalH = style(this.pagerContainer, 'height') - addonHeight;
+ style(this.pagerContainerView, 'height', totalH+'px');
+
+ var itemSpace = Math.floor(style(pcv, 'width') / this.itemsPage);
+ if(this.statusPos == 'trailing'){
+ if(this.pagerPos != 'center'){
+ style(pcv, 'marginTop', pagerH+'px');
+ }
+ style(pcv, 'marginBottom', statusH+'px');
+ }else{
+ style(pcv, 'marginTop', statusH+'px');
+ if (this.pagerPos != 'center'){
+ style(pcv, 'marginTop', pagerH+'px');
+ }
+ }
+
+ }else{
+
+ var pagerW = dojo.marginBox(this.pagerContainerPager).w;
+ var statusW = dojo.marginBox(this.pagerContainerStatus).w;
+ var containerW = style(this.pagerContainer, 'width');
+ if(this.pagerPos != 'center'){
+ var addonWidth = pagerW + statusW;
+ }else{
+ var addonWidth = statusW;
+ var heightSub = this.pagerIconNext.height;
+ var containerHeight = style(pcv, 'height');
+ var newHeight = containerHeight - (2 * heightSub);
+ style(pcv,{
+ height: newHeight+'px',
+ marginTop: this.pagerIconNext.height+'px',
+ marginBottom: this.pagerIconNext.height+'px'
+ });
+ }
+ var totalW = style(this.pagerContainer, 'width') - addonWidth;
+ style(pcv, 'width', totalW+'px');
+
+ var itemSpace = Math.floor(style(pcv, 'height') / this.itemsPage);
+ if(this.statusPos == 'trailing'){
+ if (this.pagerPos != 'center'){
+ style(pcv, 'marginLeft', pagerW + 'px');
+ }
+ style(pcv, 'marginRight', statusW + 'px');
+ }else{
+ style(pcv, 'marginLeft', statusW + 'px');
+ if(this.pagerPos != 'center'){
+ style(pcv, 'marginRight', pagerW+'px');
+ }
+ }
+ }
+
+ var _PagerItem = dojo.getObject(this.itemClass);
+ var paddingLead = "padding" + (_h ? "Left" : "Top");
+ var paddingTrail = "padding" + (_h ? "Right" : "Bottom");
+
+ dojo.forEach(this.items, function(item, cnt){
+
+ var contentContainer = dojo.create('div', {
+ innerHTML: item.content
+ });
+
+ var pagerItem = new _PagerItem({
+ id: this.id + '-item-' + (cnt + 1)
+ }, contentContainer);
+
+ this.pagerItems.appendChild(pagerItem.domNode);
+
+ var containerProps = {};
+ containerProps[(_h ? "width" : "height")] = (itemSpace - this.itemSpace) + "px";
+ var p = (_h ? "height" : "width");
+ containerProps[p] = style(pcv, p) + "px";
+ style(pagerItem.containerNode, containerProps);
+
+ if(this.resizeChildren){
+ pagerItem.resizeChildren();
+ }
+ pagerItem.parseChildren();
+
+ // only display amount of items as defined in itemsPage
+ style(pagerItem.domNode, "position", "absolute");
+
+ if (cnt < this.itemsPage){
+ var pos = (cnt) * itemSpace;
+ var trailingDir = (_h ? "left" : "top");
+ var dir = (_h ? "top" : "left");
+ style(pagerItem.domNode, dir, "0px");
+ style(pagerItem.domNode, trailingDir, pos+"px");
+ }else{
+ style(pagerItem.domNode, "top", "-1000px");
+ style(pagerItem.domNode, "left", "-1000px");
+ }
+
+ style(pagerItem.domNode, paddingTrail, (this.itemSpace/2)+"px");
+ style(pagerItem.domNode, paddingLead, (this.itemSpace/2)+"px");
+
+ }, this);
+ },
+
+ _renderPager: function() {
+ var tcp = this.pagerContainerPager;
+ var zero = "0px";
+ var _h = (this.orientation == "horizontal");
+ if(_h){
+
+ if(this.statusPos == 'center'){
+
+ }else if (this.statusPos == 'trailing'){
+ dojo.style(tcp, 'top', zero);
+ }else{
+ dojo.style(tcp, 'bottom', zero);
+ }
+ dojo.style(this.pagerNext, 'right', zero);
+ dojo.style(this.pagerPrevious, 'left', zero);
+
+ }else{
+
+ if (this.statusPos == 'trailing'){
+ dojo.style(tcp, 'left', zero);
+ }else{
+ dojo.style(tcp, 'right', zero);
+ }
+ dojo.style(this.pagerNext, 'bottom', zero);
+ dojo.style(this.pagerPrevious, 'top', zero);
+ }
+
+ },
+
+ _renderStatus: function() {
+ this._totalPages = Math.ceil(this.items.length / this.itemsPage);
+ // FIXME!!
+ this.iconWidth = 0;
+ this.iconHeight = 0;
+ this.iconsLoaded = 0;
+ this._iconConnects = [];
+
+ for (var i = 1; i <= this._totalPages; i++){
+ var icon = new Image();
+
+ var pointer = i;
+ dojo.connect(icon, 'onclick', dojo.hitch(this, function(pointer) {
+ this._pagerSkip(pointer);
+ }, pointer));
+
+ this._iconConnects[pointer] = dojo.connect(icon, 'onload', dojo.hitch(this,function(pointer){
+ this.iconWidth += icon.width;
+ this.iconHeight += icon.height;
+ this.iconsLoaded++;
+
+ if (this._totalPages == this.iconsLoaded){
+ if (this.orientation == "horizontal"){
+ if (this.statusPos == 'trailing'){
+ if (this.pagerPos == 'center'){
+ var containerHeight = dojo.style(this.pagerContainer, 'height');
+ var statusHeight = dojo.style(this.pagerContainerStatus, 'height');
+ dojo.style(this.pagerContainerPager, 'top', ((containerHeight/2)-(statusHeight/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'bottom', '0px');
+ }else{
+ if (this.pagerPos == 'center'){
+ var containerHeight = dojo.style(this.pagerContainer, 'height');
+ var statusHeight = dojo.style(this.pagerContainerStatus, 'height');
+ dojo.style(this.pagerContainerPager, 'bottom', ((containerHeight/2)-(statusHeight/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'top', '0px');
+ }
+
+ var position = (dojo.style(this.pagerContainer, 'width')/2)-(this.iconWidth/2);
+ dojo.style(this.pagerContainerStatus, 'paddingLeft', position+'px');
+ }else{
+ if (this.statusPos == 'trailing'){
+ if (this.pagerPos == 'center'){
+ var containerWidth = dojo.style(this.pagerContainer, 'width');
+ var statusWidth = dojo.style(this.pagerContainerStatus, 'width');
+ dojo.style(this.pagerContainerPager, 'left', ((containerWidth/2)-(statusWidth/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'right', '0px');
+ }else{
+ if (this.pagerPos == 'center'){
+ var containerWidth = dojo.style(this.pagerContainer, 'width');
+ var statusWidth = dojo.style(this.pagerContainerStatus, 'width');
+ dojo.style(this.pagerContainerPager, 'right', ((containerWidth/2)-(statusWidth/2))+'px');
+ }
+ dojo.style(this.pagerContainerStatus, 'left', '0px');
+ }
+ var position = (dojo.style(this.pagerContainer, 'height')/2)-(this.iconHeight/2);
+ dojo.style(this.pagerContainerStatus, 'paddingTop', position+'px');
+ }
+ }
+ dojo.disconnect(this._iconConnects[pointer]);
+ }, pointer));
+
+ if (i==this._currentPage){
+ icon.src=this.iconPageActive;
+ }else{
+ icon.src=this.iconPage;
+ }
+ var pointer = i;
+
+ dojo.addClass(icon, this.orientation+'PagerIcon');
+ dojo.attr(icon, 'id', this.id+'-status-'+i);
+ this.pagerContainerStatus.appendChild(icon);
+
+ if (this.orientation == "vertical"){
+ dojo.style(icon, 'display', 'block');
+ }
+ }
+ },
+
+ _pagerSkip: function(page){
+ if (this._currentPage == page){
+ return;
+ }else{
+ // calculate whether to go left or right, take shortest way
+ var distanceP; var distanceN;
+ if (page < this._currentPage){
+ distanceP = this._currentPage - page;
+ distanceN = (this._totalPages + page) - this._currentPage;
+ }else{
+ distanceP = (this._totalPages + this._currentPage) - page;
+ distanceN = page - this._currentPage;
+ }
+
+ var b = (distanceN > distanceP);
+ this._toScroll = (b ? distanceP : distanceN);
+ var cmd = (b ? "_pagerPrevious" : "_pagerNext");
+ var connect = this.connect(this, "onScrollEnd", function(){
+ this._toScroll--;
+ if(this._toScroll < 1){
+ this.disconnect(connect);
+ }else{
+ this[cmd]();
+ }
+ });
+ this[cmd]();
+
+ }
+ },
+
+ _pagerNext: function(){
+ if(this._anim) return;
+
+ /**
+ * fade slide out current items
+ * make sure that next items are ligned up nicely before sliding them in
+ */
+ var _anims = [];
+ for (var i = this._currentPage * this.itemsPage; i > (this._currentPage - 1) * this.itemsPage; i--){
+ if (!dojo.byId(this.id+'-item-'+i)) continue;
+
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+ if (this.orientation == "horizontal") {
+ var move = marginBox.l - (this.itemsPage * marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ var move = marginBox.t - (this.itemsPage * marginBox.h);
+ _anims.push(dojo.fx.slideTo({node: currentItem, top: move, duration: this.duration}));
+ }
+
+ }
+ var previousPage = this._currentPage;
+ if (this._currentPage == this._totalPages){
+ this._currentPage = 1;
+ }else{
+ this._currentPage++;
+ }
+
+ var cnt = this.itemsPage;
+ for (var i=this._currentPage*this.itemsPage; i>(this._currentPage-1)*this.itemsPage; i--){
+ if (dojo.byId(this.id+'-item-'+i)){
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+ if (this.orientation == "horizontal") {
+ var newPos = (dojo.style(this.pagerContainerView, 'width')+((cnt-1)*marginBox.w))-1;
+ dojo.style(currentItem, 'left', newPos+'px');
+ dojo.style(currentItem, 'top', '0px');
+
+ var move = newPos-(this.itemsPage*marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ newPos = (dojo.style(this.pagerContainerView, 'height')+((cnt-1)*marginBox.h))-1;
+ dojo.style(currentItem, 'top', newPos+'px');
+ dojo.style(currentItem, 'left', '0px');
+
+ var move = newPos-(this.itemsPage*marginBox.h);
+ _anims.push(dojo.fx.slideTo({ node: currentItem, top: move, duration: this.duration}));
+ }
+ }
+ cnt--;
+ }
+
+ this._anim = dojo.fx.combine(_anims);
+ var animConnect = this.connect(this._anim, "onEnd", function(){
+ delete this._anim;
+ this.onScrollEnd();
+ this.disconnect(animConnect);
+ });
+ this._anim.play();
+
+ // set pager icons
+ dojo.byId(this.id+'-status-'+previousPage).src = this.iconPage;
+ dojo.byId(this.id+'-status-'+this._currentPage).src = this.iconPageActive;
+ },
+
+ _pagerPrevious: function(){
+ if(this._anim) return;
+
+ var _anims = [];
+ for (var i=this._currentPage*this.itemsPage; i>(this._currentPage-1)*this.itemsPage; i--){
+ if (!dojo.byId(this.id+'-item-'+i)) continue;
+
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+ if (this.orientation == "horizontal") {
+ var move = dojo.style(currentItem, 'left')+(this.itemsPage*marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ var move = dojo.style(currentItem, 'top')+(this.itemsPage*marginBox.h);
+ _anims.push(dojo.fx.slideTo({node: currentItem, top: move, duration: this.duration}));
+ }
+ }
+
+ var previousPage = this._currentPage;
+ if (this._currentPage == 1){
+ this._currentPage = this._totalPages;
+ }else{
+ this._currentPage--;
+ }
+
+ var cnt = this.itemsPage;
+ var j=1;
+ for (var i=this._currentPage*this.itemsPage; i>(this._currentPage-1)*this.itemsPage; i--){
+ if(dojo.byId(this.id+'-item-'+i)){
+ var currentItem = dojo.byId(this.id+'-item-'+i);
+ var marginBox = dojo.marginBox(currentItem);
+
+ if (this.orientation == "horizontal") {
+ var newPos = -(j * marginBox.w) + 1;
+ dojo.style(currentItem, 'left', newPos+'px');
+ dojo.style(currentItem, 'top', '0px');
+
+ var move = ((cnt - 1) * marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+
+ var move = newPos+(this.itemsPage * marginBox.w);
+ _anims.push(dojo.fx.slideTo({node: currentItem, left: move, duration: this.duration}));
+ }else{
+ newPos = -((j * marginBox.h) + 1);
+ dojo.style(currentItem, 'top', newPos+'px');
+ dojo.style(currentItem, 'left', '0px');
+
+ var move = ((cnt - 1) * marginBox.h);
+ _anims.push(dojo.fx.slideTo({node: currentItem, top: move, duration: this.duration}));
+ }
+
+ }
+ cnt--;
+ j++;
+ }
+
+ this._anim = dojo.fx.combine(_anims);
+ var animConnect = dojo.connect(this._anim, "onEnd", dojo.hitch(this, function(){
+ delete this._anim;
+ this.onScrollEnd();
+ dojo.disconnect(animConnect);
+ }));
+ this._anim.play();
+
+ // set pager icons
+ dojo.byId(this.id + '-status-' + previousPage).src = this.iconPage;
+ dojo.byId(this.id + '-status-' + this._currentPage).src = this.iconPageActive;
+
+ },
+
+ onScrollEnd: function(){
+ // summary: Stub Function. Fired after the slide is complete. Override or connect.
+ }
+
+});
+
+dojo.declare("dojox.widget._PagerItem",
+ [dijit._Widget, dijit._Templated],
+ {
+
+ templateString: '<li class="pagerItem" dojoAttachPoint="containerNode"></li>',
+
+ resizeChildren: function(){
+ var box = dojo.marginBox(this.containerNode);
+ dojo.style(this.containerNode.firstChild, {
+ width: box.w +'px',
+ height: box.h + 'px'
+ });
+ },
+
+ parseChildren: function(){
+ dojo.parser.parse(this.containerNode);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Pager/Pager.css b/js/dojo-1.6/dojox/widget/Pager/Pager.css new file mode 100644 index 0000000..e6bb23b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/Pager.css @@ -0,0 +1,92 @@ +.pagerContainer { + position: relative; + height: 100%; + width: 100%; + overflow: hidden; + /* FIXME: need basline styles for tundra, soria, and nihilo */ + border:1px solid #ccc; + -moz-border-radius:6pt; + -webkit-border-radius:7pt; +} + +/* Horizontal classes */ + +.horizontalPagerPager { + position: absolute; + height: 12px; + width: 100%; + padding-top: 4px; + padding-bottom: 4px; +} + +.horizontalPagerStatus { + position: absolute; + height: 10px; + padding-top: 5px; + padding-bottom: 5px; + width: 100%; +} + +.horizontalPagerView { + position: absolute; + height: 100%; + width: 100%; + overflow: hidden; +} + +.horizontalPagerIcon { + cursor: pointer; +} + +/* Vertical classes */ + +.verticalPagerPager { + position: absolute; + width: 12px; + height: 100%; + padding-left: 4px; + padding-right: 4px; +} + +.verticalPagerStatus { + position: absolute; + width: 10px; + padding-left: 5px; + padding-right: 5px; + height: 100%; +} + +.verticalPagerView { + position: absolute; + height: 100%; + width: 100%; + overflow: hidden; +} + +.verticalPagerIcon { + cursor: pointer; +} + +/* Misc. */ + +.pagerIconContainer { + position: absolute; +} + +.pagerIconContainer img { + cursor: pointer; +} + +/* Items */ + +.pagerItems { + list-style: none; + padding: 0; + margin: 0; +} + +.pagerItem { + overflow: hidden; + padding: 0; + margin: 0; +}
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/Pager/Pager.html b/js/dojo-1.6/dojox/widget/Pager/Pager.html new file mode 100644 index 0000000..3a7b3c7 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/Pager.html @@ -0,0 +1,13 @@ +<div dojoAttachPoint="pagerContainer" tabIndex="0" dojoAttachEvent="onkeypress: _handleKey, onfocus: _a11yStyle, onblur:_a11yStyle" class="${orientation}PagerContainer"> + <div class="pagerContainer"> + <div dojoAttachPoint="pagerContainerStatus" class="${orientation}PagerStatus"></div> + <div dojoAttachPoint="pagerContainerView" class="${orientation}PagerView"> + <div dojoAttachPoint="pagerItemContainer"><ul dojoAttachPoint="pagerItems" class="pagerItems"></ul></div> + </div> + <div dojoAttachPoint="pagerContainerPager" class="${orientation}PagerPager"> + <div tabIndex="0" dojoAttachPoint="pagerNext" class="pagerIconContainer" dojoAttachEvent="onclick: _pagerNext"><img dojoAttachPoint="pagerIconNext" src="${iconNext}" alt="Next" /></div> + <div tabIndex="0" dojoAttachPoint="pagerPrevious" class="pagerIconContainer" dojoAttachEvent="onclick: _pagerPrevious"><img dojoAttachPoint="pagerIconPrevious" src="${iconPrevious}" alt="Previous" /></div> + </div> + </div> + <div dojoAttachPoint="containerNode" style="display:none"></div> +</div>
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/Pager/images/hNext.png b/js/dojo-1.6/dojox/widget/Pager/images/hNext.png Binary files differnew file mode 100644 index 0000000..037503f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/images/hNext.png diff --git a/js/dojo-1.6/dojox/widget/Pager/images/hPrevious.png b/js/dojo-1.6/dojox/widget/Pager/images/hPrevious.png Binary files differnew file mode 100644 index 0000000..3d4768a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/images/hPrevious.png diff --git a/js/dojo-1.6/dojox/widget/Pager/images/pageActive.png b/js/dojo-1.6/dojox/widget/Pager/images/pageActive.png Binary files differnew file mode 100644 index 0000000..087d5bc --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/images/pageActive.png diff --git a/js/dojo-1.6/dojox/widget/Pager/images/pageInactive.png b/js/dojo-1.6/dojox/widget/Pager/images/pageInactive.png Binary files differnew file mode 100644 index 0000000..66ff3f4 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/images/pageInactive.png diff --git a/js/dojo-1.6/dojox/widget/Pager/images/vNext.png b/js/dojo-1.6/dojox/widget/Pager/images/vNext.png Binary files differnew file mode 100644 index 0000000..7a373b8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/images/vNext.png diff --git a/js/dojo-1.6/dojox/widget/Pager/images/vPrevious.png b/js/dojo-1.6/dojox/widget/Pager/images/vPrevious.png Binary files differnew file mode 100644 index 0000000..8c497af --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Pager/images/vPrevious.png diff --git a/js/dojo-1.6/dojox/widget/PlaceholderMenuItem.js b/js/dojo-1.6/dojox/widget/PlaceholderMenuItem.js new file mode 100644 index 0000000..894840d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/PlaceholderMenuItem.js @@ -0,0 +1,118 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.PlaceholderMenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.PlaceholderMenuItem"] = true;
+dojo.provide("dojox.widget.PlaceholderMenuItem");
+
+dojo.experimental("dojox.widget.PlaceholderMenuItem");
+
+dojo.require("dijit.Menu");
+
+dojo.declare("dojox.widget.PlaceholderMenuItem", dijit.MenuItem, {
+ // summary:
+ // A menu item that can be used as a placeholder. Set the label
+ // of this item to a unique key and you can then use it to add new
+ // items at that location. This item is not displayed.
+
+ _replaced: false,
+ _replacedWith: null,
+ _isPlaceholder: true,
+
+ postCreate: function(){
+ this.domNode.style.display = "none";
+ this._replacedWith = [];
+ if(!this.label){
+ this.label = this.containerNode.innerHTML;
+ }
+ this.inherited(arguments);
+ },
+
+ replace: function(/*dijit.MenuItem[]*/ menuItems){
+ // summary:
+ // replaces this menu item with the given menuItems. The original
+ // menu item is not actually removed from the menu - so if you want
+ // it removed, you must do that explicitly.
+ // returns:
+ // true if the replace happened, false if not
+ if(this._replaced){ return false; }
+
+ var index = this.getIndexInParent();
+ if(index < 0){ return false; }
+
+ var p = this.getParent();
+
+ dojo.forEach(menuItems, function(item){
+ p.addChild(item, index++);
+ });
+ this._replacedWith = menuItems;
+
+ this._replaced = true;
+ return true;
+ },
+
+ unReplace: function(/*Boolean?*/ destroy){
+ // summary:
+ // Removes menu items added by calling replace(). It returns the
+ // array of items that were actually removed (in case you want to
+ // clean them up later)
+ // destroy:
+ // Also call destroy on any removed items.
+ // returns:
+ // The array of items that were actually removed
+
+ if(!this._replaced){ return []; }
+
+ var p = this.getParent();
+ if(!p){ return []; }
+
+ var r = this._replacedWith;
+ dojo.forEach(this._replacedWith, function(item){
+ p.removeChild(item);
+ if(destroy){
+ item.destroyRecursive();
+ }
+ });
+ this._replacedWith = [];
+ this._replaced = false;
+
+ return r; // dijit.MenuItem[]
+ }
+});
+
+// Se need to extend dijit.Menu so that we have a getPlaceholders function.
+dojo.extend(dijit.Menu, {
+ getPlaceholders: function(/*String?*/ label){
+ // summary:
+ // Returns an array of placeholders with the given label. There
+ // can be multiples.
+ // label:
+ // Label to search for - if not specified, then all placeholders
+ // are returned
+ // returns:
+ // An array of placeholders that match the given label
+ var r = [];
+
+ var children = this.getChildren();
+ dojo.forEach(children, function(child){
+ if(child._isPlaceholder && (!label || child.label == label)){
+ r.push(child);
+ }else if(child._started && child.popup && child.popup.getPlaceholders){
+ r = r.concat(child.popup.getPlaceholders(label));
+ }else if(!child._started && child.dropDownContainer){
+ var node = dojo.query("[widgetId]", child.dropDownContainer)[0];
+ var menu = dijit.byNode(node);
+ if(menu.getPlaceholders){
+ r = r.concat(menu.getPlaceholders(label));
+ }
+ }
+ }, this);
+ return r; // dojox.widget.PlaceholderMenuItem[]
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/PlaceholderMenuItem.xd.js b/js/dojo-1.6/dojox/widget/PlaceholderMenuItem.xd.js new file mode 100644 index 0000000..3bd48cf --- /dev/null +++ b/js/dojo-1.6/dojox/widget/PlaceholderMenuItem.xd.js @@ -0,0 +1,123 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.PlaceholderMenuItem"],
+["require", "dijit.Menu"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.PlaceholderMenuItem"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.PlaceholderMenuItem"] = true;
+dojo.provide("dojox.widget.PlaceholderMenuItem");
+
+dojo.experimental("dojox.widget.PlaceholderMenuItem");
+
+dojo.require("dijit.Menu");
+
+dojo.declare("dojox.widget.PlaceholderMenuItem", dijit.MenuItem, {
+ // summary:
+ // A menu item that can be used as a placeholder. Set the label
+ // of this item to a unique key and you can then use it to add new
+ // items at that location. This item is not displayed.
+
+ _replaced: false,
+ _replacedWith: null,
+ _isPlaceholder: true,
+
+ postCreate: function(){
+ this.domNode.style.display = "none";
+ this._replacedWith = [];
+ if(!this.label){
+ this.label = this.containerNode.innerHTML;
+ }
+ this.inherited(arguments);
+ },
+
+ replace: function(/*dijit.MenuItem[]*/ menuItems){
+ // summary:
+ // replaces this menu item with the given menuItems. The original
+ // menu item is not actually removed from the menu - so if you want
+ // it removed, you must do that explicitly.
+ // returns:
+ // true if the replace happened, false if not
+ if(this._replaced){ return false; }
+
+ var index = this.getIndexInParent();
+ if(index < 0){ return false; }
+
+ var p = this.getParent();
+
+ dojo.forEach(menuItems, function(item){
+ p.addChild(item, index++);
+ });
+ this._replacedWith = menuItems;
+
+ this._replaced = true;
+ return true;
+ },
+
+ unReplace: function(/*Boolean?*/ destroy){
+ // summary:
+ // Removes menu items added by calling replace(). It returns the
+ // array of items that were actually removed (in case you want to
+ // clean them up later)
+ // destroy:
+ // Also call destroy on any removed items.
+ // returns:
+ // The array of items that were actually removed
+
+ if(!this._replaced){ return []; }
+
+ var p = this.getParent();
+ if(!p){ return []; }
+
+ var r = this._replacedWith;
+ dojo.forEach(this._replacedWith, function(item){
+ p.removeChild(item);
+ if(destroy){
+ item.destroyRecursive();
+ }
+ });
+ this._replacedWith = [];
+ this._replaced = false;
+
+ return r; // dijit.MenuItem[]
+ }
+});
+
+// Se need to extend dijit.Menu so that we have a getPlaceholders function.
+dojo.extend(dijit.Menu, {
+ getPlaceholders: function(/*String?*/ label){
+ // summary:
+ // Returns an array of placeholders with the given label. There
+ // can be multiples.
+ // label:
+ // Label to search for - if not specified, then all placeholders
+ // are returned
+ // returns:
+ // An array of placeholders that match the given label
+ var r = [];
+
+ var children = this.getChildren();
+ dojo.forEach(children, function(child){
+ if(child._isPlaceholder && (!label || child.label == label)){
+ r.push(child);
+ }else if(child._started && child.popup && child.popup.getPlaceholders){
+ r = r.concat(child.popup.getPlaceholders(label));
+ }else if(!child._started && child.dropDownContainer){
+ var node = dojo.query("[widgetId]", child.dropDownContainer)[0];
+ var menu = dijit.byNode(node);
+ if(menu.getPlaceholders){
+ r = r.concat(menu.getPlaceholders(label));
+ }
+ }
+ }, this);
+ return r; // dojox.widget.PlaceholderMenuItem[]
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Portlet.js b/js/dojo-1.6/dojox/widget/Portlet.js new file mode 100644 index 0000000..f40030b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Portlet.js @@ -0,0 +1,441 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Portlet"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Portlet"] = true;
+dojo.experimental("dojox.widget.Portlet");
+dojo.provide("dojox.widget.Portlet");
+dojo.require("dijit.TitlePane");
+dojo.require("dojo.fx");
+
+dojo.declare("dojox.widget.Portlet", [dijit.TitlePane, dijit._Container],{
+ // summary: A container widget that is designed to be contained
+ // in a dojox.layout.GridContainer. Child widgets can insert
+ // an icon into the title bar of the Portlet, which when
+ // clicked, executes the "toggle" method of the child widget.
+ // A child widget must specify the attribute
+ // "portletIconClass", and the optional class
+ // "portletIconHoverClass", as well as the
+ // "toggle" function.
+
+ // resizeChildren: Boolean
+ // If true, when the Portlet is resized, any child widgets
+ // with a 'resize' method have that method called.
+ resizeChildren: true,
+
+ // closable: Boolean
+ // If true, a close button is placed in the title bar,
+ // and the Portlet can be hidden. If false, the Portlet
+ // cannot be closed.
+ closable: true,
+
+ // _parents: Array
+ // An array of all the StackContainer widgets that this Portlet
+ // is contained in. These are used to determine if the portlet
+ // is visible or not.
+ _parents: null,
+
+ // _size: Object
+ // Cache of the previous size of the portlet, used to determine
+ // if the size has changed and if the child widgets should be
+ // resized.
+ _size: null,
+
+ // dragRestriction: Boolean
+ // To remove the drag capability.
+ dragRestriction : false,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+
+ // Hide the portlet until it is fully constructed.
+ dojo.style(this.domNode, "visibility", "hidden");
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ // Add the portlet classes
+ dojo.addClass(this.domNode, "dojoxPortlet");
+ dojo.removeClass(this.arrowNode, "dijitArrowNode");
+ dojo.addClass(this.arrowNode, "dojoxPortletIcon dojoxArrowDown");
+ dojo.addClass(this.titleBarNode, "dojoxPortletTitle");
+ dojo.addClass(this.hideNode, "dojoxPortletContentOuter");
+
+ // Choose the class to add depending on if the portlet is draggable or not.
+ dojo.addClass(this.domNode, "dojoxPortlet-" + (!this.dragRestriction ? "movable" : "nonmovable"));
+
+ var _this = this;
+ if(this.resizeChildren){
+ // If children should be resized when the portlet size changes,
+ // listen for items being dropped, when the window is resized,
+ // or when another portlet's size changes.
+
+ this.subscribe("/dnd/drop", function(){_this._updateSize();});
+
+ this.subscribe("/Portlet/sizechange", function(widget){_this.onSizeChange(widget);});
+ this.connect(window, "onresize", function(){_this._updateSize();});
+
+ // Subscribe to all possible child-selection events that could affect this
+ // portlet
+ var doSelectSubscribe = dojo.hitch(this, function(id, lastId){
+ var widget = dijit.byId(id);
+ if(widget.selectChild){
+ var s = this.subscribe(id + "-selectChild", function(child){
+ var n = _this.domNode.parentNode;
+
+ while(n){
+ if(n == child.domNode){
+
+ // Only fire this once, as the widget is now visible
+ // at least once, so child measurements should be accurate.
+ _this.unsubscribe(s);
+ _this._updateSize();
+ break;
+ }
+ n = n.parentNode;
+ }
+ });
+
+ // Record the StackContainer and child widget that this portlet
+ // is in, so it can figure out whether or not it is visible.
+ // If it is not visible, it will not update it's size dynamically.
+ var child = dijit.byId(lastId);
+ if(widget && child){
+ _this._parents.push({parent: widget, child: child});
+ }
+ }
+ });
+ var lastId;
+ this._parents = [];
+
+ // Find all parent widgets, and if they are StackContainers,
+ // subscribe to their selectChild method calls.
+ for(var p = this.domNode.parentNode; p != null; p = p.parentNode){
+ var id = p.getAttribute ? p.getAttribute("widgetId") : null;
+ if(id){
+ doSelectSubscribe(id, lastId);
+ lastId = id;
+ }
+ }
+ }
+
+ // Prevent clicks on icons from causing a drag to start.
+ this.connect(this.titleBarNode, "onmousedown", function(evt){
+ if (dojo.hasClass(evt.target, "dojoxPortletIcon")) {
+ dojo.stopEvent(evt);
+ return false;
+ }
+ return true;
+ });
+
+ // Inform all portlets that the size of this one has changed,
+ // and therefore perhaps they have too
+ this.connect(this._wipeOut, "onEnd", function(){_this._publish();});
+ this.connect(this._wipeIn, "onEnd", function(){_this._publish();});
+
+ if(this.closable){
+ this.closeIcon = this._createIcon("dojoxCloseNode", "dojoxCloseNodeHover", dojo.hitch(this, "onClose"));
+ dojo.style(this.closeIcon, "display", "");
+ }
+ },
+
+ startup: function(){
+ if(this._started){return;}
+
+ var children = this.getChildren();
+ this._placeSettingsWidgets();
+
+ // Start up the children
+ dojo.forEach(children, function(child){
+ try{
+ if(!child.started && !child._started){
+ child.startup()
+ }
+ }
+ catch(e){
+ console.log(this.id + ":" + this.declaredClass, e);
+ }
+ });
+
+ this.inherited(arguments);
+
+ //this._updateSize();
+ dojo.style(this.domNode, "visibility", "visible");
+ },
+
+ _placeSettingsWidgets: function(){
+ // summary: Checks all the children to see if they are instances
+ // of dojox.widget.PortletSettings. If they are,
+ // create an icon for them in the title bar which when clicked,
+ // calls their toggle() method.
+
+ dojo.forEach(this.getChildren(), dojo.hitch(this, function(child){
+ if(child.portletIconClass && child.toggle && !child.attr("portlet")){
+ this._createIcon(child.portletIconClass, child.portletIconHoverClass, dojo.hitch(child, "toggle"));
+ dojo.place(child.domNode, this.containerNode, "before");
+ child.attr("portlet", this);
+ this._settingsWidget = child;
+ }
+ }));
+ },
+
+ _createIcon: function(clazz, hoverClazz, fn){
+ // summary:
+ // creates an icon in the title bar.
+
+ var icon = dojo.create("div",{
+ "class": "dojoxPortletIcon " + clazz,
+ "waiRole": "presentation"
+ });
+ dojo.place(icon, this.arrowNode, "before");
+
+ this.connect(icon, "onclick", fn);
+
+ if(hoverClazz){
+ this.connect(icon, "onmouseover", function(){
+ dojo.addClass(icon, hoverClazz);
+ });
+ this.connect(icon, "onmouseout", function(){
+ dojo.removeClass(icon, hoverClazz);
+ });
+ }
+ return icon;
+ },
+
+ onClose: function(evt){
+ // summary:
+ // Hides the portlet. Note that it does not
+ // persist this, so it is up to the client to
+ // listen to this method and persist the closed state
+ // in their own way.
+ dojo.style(this.domNode, "display", "none");
+ },
+
+ onSizeChange: function(widget){
+ // summary:
+ // Updates the Portlet size if any other Portlet
+ // changes its size.
+ if(widget == this){
+ return;
+ }
+ this._updateSize();
+ },
+
+ _updateSize: function(){
+ // summary:
+ // Updates the size of all child widgets.
+ if(!this.open || !this._started || !this.resizeChildren){
+ return;
+ }
+
+ if(this._timer){
+ clearTimeout(this._timer);
+ }
+ // Delay applying the size change in case the size
+ // changes very frequently, for performance reasons.
+ this._timer = setTimeout(dojo.hitch(this, function(){
+ var size ={
+ w: dojo.style(this.domNode, "width"),
+ h: dojo.style(this.domNode, "height")
+ };
+
+ // If the Portlet is in a StackWidget, and it is not
+ // visible, do not update the size, as it could
+ // make child widgets miscalculate.
+ for(var i = 0; i < this._parents.length; i++){
+ var p = this._parents[i];
+ var sel = p.parent.selectedChildWidget
+ if(sel && sel != p.child){
+ return;
+ }
+ }
+
+ if(this._size){
+ // If the size of the portlet hasn't changed, don't
+ // resize the children, as this can be expensive
+ if(this._size.w == size.w && this._size.h == size.h){
+ return;
+ }
+ }
+ this._size = size;
+
+ var fns = ["resize", "layout"];
+ this._timer = null;
+ var kids = this.getChildren();
+
+ dojo.forEach(kids, function(child){
+ for(var i = 0; i < fns.length; i++){
+ if(dojo.isFunction(child[fns[i]])){
+ try{
+ child[fns[i]]();
+ } catch(e){
+ console.log(e);
+ }
+ break;
+ }
+ }
+ });
+ this.onUpdateSize();
+ }), 100);
+ },
+
+ onUpdateSize: function(){
+ // summary:
+ // Stub function called when the size is changed.
+ },
+
+ _publish: function(){
+ // summary: Publishes an event that all other portlets listen to.
+ // This causes them to update their child widgets if their
+ // size has changed.
+ dojo.publish("/Portlet/sizechange",[this]);
+ },
+
+ _onTitleClick: function(evt){
+ if(evt.target == this.arrowNode){
+ this.inherited(arguments);
+ }
+ },
+
+ addChild: function(child){
+ // summary:
+ // Adds a child widget to the portlet.
+ this._size = null;
+ this.inherited(arguments);
+
+ if(this._started){
+ this._placeSettingsWidgets();
+ this._updateSize();
+ }
+ if(this._started && !child.started && !child._started){
+ child.startup();
+ }
+ },
+
+ destroyDescendants: function(/*Boolean*/ preserveDom){
+ this.inherited(arguments);
+ if(this._settingsWidget){
+ this._settingsWidget.destroyRecursive(preserveDom);
+ }
+ },
+
+ destroy: function(){
+ if(this._timer){
+ clearTimeout(this._timer);
+ }
+ this.inherited(arguments);
+ },
+
+ _setCss: function(){
+ this.inherited(arguments);
+ dojo.style(this.arrowNode, "display", this.toggleable ? "":"none");
+ }
+});
+
+dojo.declare("dojox.widget.PortletSettings", [dijit._Container, dijit.layout.ContentPane],{
+ // summary:
+ // A settings widget to be used with a dojox.widget.Portlet.
+ // description:
+ // This widget should be placed inside a dojox.widget.Portlet widget.
+ // It is used to set some preferences for that Portlet. It is essentially
+ // a ContentPane, and should contain other widgets and DOM nodes that
+ // do the real work of setting preferences for the portlet.
+
+ // portletIconClass: String
+ // The CSS class to apply to the icon in the Portlet title bar that is used
+ // to toggle the visibility of this widget.
+ portletIconClass: "dojoxPortletSettingsIcon",
+
+ // portletIconHoverClass: String
+ // The CSS class to apply to the icon in the Portlet title bar that is used
+ // to toggle the visibility of this widget when the mouse hovers over it.
+ portletIconHoverClass: "dojoxPortletSettingsIconHover",
+
+ postCreate: function(){
+ // summary:
+ // Sets the require CSS classes on the widget.
+
+ // Start the PortletSettings widget hidden, always.
+ dojo.style(this.domNode, "display", "none");
+ dojo.addClass(this.domNode, "dojoxPortletSettingsContainer");
+
+ // Remove the unwanted content pane class.
+ dojo.removeClass(this.domNode, "dijitContentPane");
+ },
+
+ _setPortletAttr: function(portlet){
+ // summary:
+ // Sets the portlet that encloses this widget.
+ this.portlet = portlet;
+ },
+
+ toggle: function(){
+ // summary:
+ // Toggles the visibility of this widget.
+ var n = this.domNode;
+ if(dojo.style(n, "display") == "none"){
+ dojo.style(n,{
+ "display": "block",
+ "height": "1px",
+ "width": "auto"
+ });
+ dojo.fx.wipeIn({
+ node: n
+ }).play();
+ }else{
+ dojo.fx.wipeOut({
+ node: n,
+ onEnd: dojo.hitch(this, function(){
+ dojo.style(n,{"display": "none", "height": "", "width":""});
+ }
+ )}).play();
+ }
+ }
+});
+
+dojo.declare("dojox.widget.PortletDialogSettings",
+ dojox.widget.PortletSettings,{
+ // summary:
+ // A settings widget to be used with a dojox.widget.Portlet, which displays
+ // the contents of this widget in a dijit.Dialog box.
+
+ // dimensions: Array
+ // The size of the dialog to display. This defaults to [300, 300]
+ dimensions: null,
+
+ constructor: function(props, node){
+ this.dimensions = props.dimensions || [300, 100];
+ },
+
+ toggle: function(){
+ // summary:
+ // Shows and hides the Dialog box.
+ if(!this.dialog){
+ dojo["require"]("dijit.Dialog");
+ this.dialog = new dijit.Dialog({title: this.title});
+
+ dojo.body().appendChild(this.dialog.domNode);
+
+ // Move this widget inside the dialog
+ this.dialog.containerNode.appendChild(this.domNode);
+
+ dojo.style(this.dialog.domNode,{
+ "width" : this.dimensions[0] + "px",
+ "height" : this.dimensions[1] + "px"
+ });
+ dojo.style(this.domNode, "display", "");
+ }
+ if(this.dialog.open){
+ this.dialog.hide();
+ }else{
+ this.dialog.show(this.domNode);
+ }
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Portlet.xd.js b/js/dojo-1.6/dojox/widget/Portlet.xd.js new file mode 100644 index 0000000..1be62cd --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Portlet.xd.js @@ -0,0 +1,447 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Portlet"],
+["require", "dijit.TitlePane"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Portlet"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Portlet"] = true;
+dojo.experimental("dojox.widget.Portlet");
+dojo.provide("dojox.widget.Portlet");
+dojo.require("dijit.TitlePane");
+dojo.require("dojo.fx");
+
+dojo.declare("dojox.widget.Portlet", [dijit.TitlePane, dijit._Container],{
+ // summary: A container widget that is designed to be contained
+ // in a dojox.layout.GridContainer. Child widgets can insert
+ // an icon into the title bar of the Portlet, which when
+ // clicked, executes the "toggle" method of the child widget.
+ // A child widget must specify the attribute
+ // "portletIconClass", and the optional class
+ // "portletIconHoverClass", as well as the
+ // "toggle" function.
+
+ // resizeChildren: Boolean
+ // If true, when the Portlet is resized, any child widgets
+ // with a 'resize' method have that method called.
+ resizeChildren: true,
+
+ // closable: Boolean
+ // If true, a close button is placed in the title bar,
+ // and the Portlet can be hidden. If false, the Portlet
+ // cannot be closed.
+ closable: true,
+
+ // _parents: Array
+ // An array of all the StackContainer widgets that this Portlet
+ // is contained in. These are used to determine if the portlet
+ // is visible or not.
+ _parents: null,
+
+ // _size: Object
+ // Cache of the previous size of the portlet, used to determine
+ // if the size has changed and if the child widgets should be
+ // resized.
+ _size: null,
+
+ // dragRestriction: Boolean
+ // To remove the drag capability.
+ dragRestriction : false,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+
+ // Hide the portlet until it is fully constructed.
+ dojo.style(this.domNode, "visibility", "hidden");
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ // Add the portlet classes
+ dojo.addClass(this.domNode, "dojoxPortlet");
+ dojo.removeClass(this.arrowNode, "dijitArrowNode");
+ dojo.addClass(this.arrowNode, "dojoxPortletIcon dojoxArrowDown");
+ dojo.addClass(this.titleBarNode, "dojoxPortletTitle");
+ dojo.addClass(this.hideNode, "dojoxPortletContentOuter");
+
+ // Choose the class to add depending on if the portlet is draggable or not.
+ dojo.addClass(this.domNode, "dojoxPortlet-" + (!this.dragRestriction ? "movable" : "nonmovable"));
+
+ var _this = this;
+ if(this.resizeChildren){
+ // If children should be resized when the portlet size changes,
+ // listen for items being dropped, when the window is resized,
+ // or when another portlet's size changes.
+
+ this.subscribe("/dnd/drop", function(){_this._updateSize();});
+
+ this.subscribe("/Portlet/sizechange", function(widget){_this.onSizeChange(widget);});
+ this.connect(window, "onresize", function(){_this._updateSize();});
+
+ // Subscribe to all possible child-selection events that could affect this
+ // portlet
+ var doSelectSubscribe = dojo.hitch(this, function(id, lastId){
+ var widget = dijit.byId(id);
+ if(widget.selectChild){
+ var s = this.subscribe(id + "-selectChild", function(child){
+ var n = _this.domNode.parentNode;
+
+ while(n){
+ if(n == child.domNode){
+
+ // Only fire this once, as the widget is now visible
+ // at least once, so child measurements should be accurate.
+ _this.unsubscribe(s);
+ _this._updateSize();
+ break;
+ }
+ n = n.parentNode;
+ }
+ });
+
+ // Record the StackContainer and child widget that this portlet
+ // is in, so it can figure out whether or not it is visible.
+ // If it is not visible, it will not update it's size dynamically.
+ var child = dijit.byId(lastId);
+ if(widget && child){
+ _this._parents.push({parent: widget, child: child});
+ }
+ }
+ });
+ var lastId;
+ this._parents = [];
+
+ // Find all parent widgets, and if they are StackContainers,
+ // subscribe to their selectChild method calls.
+ for(var p = this.domNode.parentNode; p != null; p = p.parentNode){
+ var id = p.getAttribute ? p.getAttribute("widgetId") : null;
+ if(id){
+ doSelectSubscribe(id, lastId);
+ lastId = id;
+ }
+ }
+ }
+
+ // Prevent clicks on icons from causing a drag to start.
+ this.connect(this.titleBarNode, "onmousedown", function(evt){
+ if (dojo.hasClass(evt.target, "dojoxPortletIcon")) {
+ dojo.stopEvent(evt);
+ return false;
+ }
+ return true;
+ });
+
+ // Inform all portlets that the size of this one has changed,
+ // and therefore perhaps they have too
+ this.connect(this._wipeOut, "onEnd", function(){_this._publish();});
+ this.connect(this._wipeIn, "onEnd", function(){_this._publish();});
+
+ if(this.closable){
+ this.closeIcon = this._createIcon("dojoxCloseNode", "dojoxCloseNodeHover", dojo.hitch(this, "onClose"));
+ dojo.style(this.closeIcon, "display", "");
+ }
+ },
+
+ startup: function(){
+ if(this._started){return;}
+
+ var children = this.getChildren();
+ this._placeSettingsWidgets();
+
+ // Start up the children
+ dojo.forEach(children, function(child){
+ try{
+ if(!child.started && !child._started){
+ child.startup()
+ }
+ }
+ catch(e){
+ console.log(this.id + ":" + this.declaredClass, e);
+ }
+ });
+
+ this.inherited(arguments);
+
+ //this._updateSize();
+ dojo.style(this.domNode, "visibility", "visible");
+ },
+
+ _placeSettingsWidgets: function(){
+ // summary: Checks all the children to see if they are instances
+ // of dojox.widget.PortletSettings. If they are,
+ // create an icon for them in the title bar which when clicked,
+ // calls their toggle() method.
+
+ dojo.forEach(this.getChildren(), dojo.hitch(this, function(child){
+ if(child.portletIconClass && child.toggle && !child.attr("portlet")){
+ this._createIcon(child.portletIconClass, child.portletIconHoverClass, dojo.hitch(child, "toggle"));
+ dojo.place(child.domNode, this.containerNode, "before");
+ child.attr("portlet", this);
+ this._settingsWidget = child;
+ }
+ }));
+ },
+
+ _createIcon: function(clazz, hoverClazz, fn){
+ // summary:
+ // creates an icon in the title bar.
+
+ var icon = dojo.create("div",{
+ "class": "dojoxPortletIcon " + clazz,
+ "waiRole": "presentation"
+ });
+ dojo.place(icon, this.arrowNode, "before");
+
+ this.connect(icon, "onclick", fn);
+
+ if(hoverClazz){
+ this.connect(icon, "onmouseover", function(){
+ dojo.addClass(icon, hoverClazz);
+ });
+ this.connect(icon, "onmouseout", function(){
+ dojo.removeClass(icon, hoverClazz);
+ });
+ }
+ return icon;
+ },
+
+ onClose: function(evt){
+ // summary:
+ // Hides the portlet. Note that it does not
+ // persist this, so it is up to the client to
+ // listen to this method and persist the closed state
+ // in their own way.
+ dojo.style(this.domNode, "display", "none");
+ },
+
+ onSizeChange: function(widget){
+ // summary:
+ // Updates the Portlet size if any other Portlet
+ // changes its size.
+ if(widget == this){
+ return;
+ }
+ this._updateSize();
+ },
+
+ _updateSize: function(){
+ // summary:
+ // Updates the size of all child widgets.
+ if(!this.open || !this._started || !this.resizeChildren){
+ return;
+ }
+
+ if(this._timer){
+ clearTimeout(this._timer);
+ }
+ // Delay applying the size change in case the size
+ // changes very frequently, for performance reasons.
+ this._timer = setTimeout(dojo.hitch(this, function(){
+ var size ={
+ w: dojo.style(this.domNode, "width"),
+ h: dojo.style(this.domNode, "height")
+ };
+
+ // If the Portlet is in a StackWidget, and it is not
+ // visible, do not update the size, as it could
+ // make child widgets miscalculate.
+ for(var i = 0; i < this._parents.length; i++){
+ var p = this._parents[i];
+ var sel = p.parent.selectedChildWidget
+ if(sel && sel != p.child){
+ return;
+ }
+ }
+
+ if(this._size){
+ // If the size of the portlet hasn't changed, don't
+ // resize the children, as this can be expensive
+ if(this._size.w == size.w && this._size.h == size.h){
+ return;
+ }
+ }
+ this._size = size;
+
+ var fns = ["resize", "layout"];
+ this._timer = null;
+ var kids = this.getChildren();
+
+ dojo.forEach(kids, function(child){
+ for(var i = 0; i < fns.length; i++){
+ if(dojo.isFunction(child[fns[i]])){
+ try{
+ child[fns[i]]();
+ } catch(e){
+ console.log(e);
+ }
+ break;
+ }
+ }
+ });
+ this.onUpdateSize();
+ }), 100);
+ },
+
+ onUpdateSize: function(){
+ // summary:
+ // Stub function called when the size is changed.
+ },
+
+ _publish: function(){
+ // summary: Publishes an event that all other portlets listen to.
+ // This causes them to update their child widgets if their
+ // size has changed.
+ dojo.publish("/Portlet/sizechange",[this]);
+ },
+
+ _onTitleClick: function(evt){
+ if(evt.target == this.arrowNode){
+ this.inherited(arguments);
+ }
+ },
+
+ addChild: function(child){
+ // summary:
+ // Adds a child widget to the portlet.
+ this._size = null;
+ this.inherited(arguments);
+
+ if(this._started){
+ this._placeSettingsWidgets();
+ this._updateSize();
+ }
+ if(this._started && !child.started && !child._started){
+ child.startup();
+ }
+ },
+
+ destroyDescendants: function(/*Boolean*/ preserveDom){
+ this.inherited(arguments);
+ if(this._settingsWidget){
+ this._settingsWidget.destroyRecursive(preserveDom);
+ }
+ },
+
+ destroy: function(){
+ if(this._timer){
+ clearTimeout(this._timer);
+ }
+ this.inherited(arguments);
+ },
+
+ _setCss: function(){
+ this.inherited(arguments);
+ dojo.style(this.arrowNode, "display", this.toggleable ? "":"none");
+ }
+});
+
+dojo.declare("dojox.widget.PortletSettings", [dijit._Container, dijit.layout.ContentPane],{
+ // summary:
+ // A settings widget to be used with a dojox.widget.Portlet.
+ // description:
+ // This widget should be placed inside a dojox.widget.Portlet widget.
+ // It is used to set some preferences for that Portlet. It is essentially
+ // a ContentPane, and should contain other widgets and DOM nodes that
+ // do the real work of setting preferences for the portlet.
+
+ // portletIconClass: String
+ // The CSS class to apply to the icon in the Portlet title bar that is used
+ // to toggle the visibility of this widget.
+ portletIconClass: "dojoxPortletSettingsIcon",
+
+ // portletIconHoverClass: String
+ // The CSS class to apply to the icon in the Portlet title bar that is used
+ // to toggle the visibility of this widget when the mouse hovers over it.
+ portletIconHoverClass: "dojoxPortletSettingsIconHover",
+
+ postCreate: function(){
+ // summary:
+ // Sets the require CSS classes on the widget.
+
+ // Start the PortletSettings widget hidden, always.
+ dojo.style(this.domNode, "display", "none");
+ dojo.addClass(this.domNode, "dojoxPortletSettingsContainer");
+
+ // Remove the unwanted content pane class.
+ dojo.removeClass(this.domNode, "dijitContentPane");
+ },
+
+ _setPortletAttr: function(portlet){
+ // summary:
+ // Sets the portlet that encloses this widget.
+ this.portlet = portlet;
+ },
+
+ toggle: function(){
+ // summary:
+ // Toggles the visibility of this widget.
+ var n = this.domNode;
+ if(dojo.style(n, "display") == "none"){
+ dojo.style(n,{
+ "display": "block",
+ "height": "1px",
+ "width": "auto"
+ });
+ dojo.fx.wipeIn({
+ node: n
+ }).play();
+ }else{
+ dojo.fx.wipeOut({
+ node: n,
+ onEnd: dojo.hitch(this, function(){
+ dojo.style(n,{"display": "none", "height": "", "width":""});
+ }
+ )}).play();
+ }
+ }
+});
+
+dojo.declare("dojox.widget.PortletDialogSettings",
+ dojox.widget.PortletSettings,{
+ // summary:
+ // A settings widget to be used with a dojox.widget.Portlet, which displays
+ // the contents of this widget in a dijit.Dialog box.
+
+ // dimensions: Array
+ // The size of the dialog to display. This defaults to [300, 300]
+ dimensions: null,
+
+ constructor: function(props, node){
+ this.dimensions = props.dimensions || [300, 100];
+ },
+
+ toggle: function(){
+ // summary:
+ // Shows and hides the Dialog box.
+ if(!this.dialog){
+ dojo["require"]("dijit.Dialog");
+ this.dialog = new dijit.Dialog({title: this.title});
+
+ dojo.body().appendChild(this.dialog.domNode);
+
+ // Move this widget inside the dialog
+ this.dialog.containerNode.appendChild(this.domNode);
+
+ dojo.style(this.dialog.domNode,{
+ "width" : this.dimensions[0] + "px",
+ "height" : this.dimensions[1] + "px"
+ });
+ dojo.style(this.domNode, "display", "");
+ }
+ if(this.dialog.open){
+ this.dialog.hide();
+ }else{
+ this.dialog.show(this.domNode);
+ }
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Portlet/Portlet.css b/js/dojo-1.6/dojox/widget/Portlet/Portlet.css new file mode 100644 index 0000000..d249355 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Portlet/Portlet.css @@ -0,0 +1,161 @@ +.dojoxPortlet { + margin-bottom: 5px; +} + +.dojoxPortlet .dijitTitlePaneTitle .dojoxPortletIcon { + width: 15px; + height: 15px; + float: right; + cursor: pointer; + background-repeat: no-repeat; +} +.tundra .dojoxPortlet-movable .dijitTitlePaneTitle, +.soria .dojoxPortlet-movable .dijitTitlePaneTitle, +.nihilo .dojoxPortlet-movable .dijitTitlePaneTitle { + cursor: move; +} +.dojoxPortlet .dijitTitlePaneTitle { + font-weight: bold; + font-size: 0.9em; +} + +.soria .dojoxPortlet .dijitTitlePaneTitle { + color: #243C5F; +} +.tundra .dojoxPortlet .dijitTitlePaneTitle, +.nihilo .dojoxPortlet .dijitTitlePaneTitle { + color: #333; +} +.dojoxPortlet-nonmovable .dijitTitlePaneTitle { + cursor: default; +} + +.tundra .dojoxPortlet .dojoxPortletIcon { + background-image: url("../../../dijit/themes/tundra/images/spriteRoundedIconsSmall.gif"); +} +.soria .dojoxPortlet .dojoxPortletIcon { + background-image: url("../../../dijit/themes/soria/images/spriteRoundedIconsSmall.gif"); +} +.nihilo .dojoxPortlet .dojoxPortletIcon { + background-image: url("../../../dijit/themes/nihilo/images/spriteRoundedIconsSmall.gif"); +} +.claro .dojoxPortlet .dojoxPortletIcon { + background-image: url("../../../dijit/themes/tundra/images/spriteRoundedIconsSmall.gif"); +} +.dojoxPortlet .dojoxCloseNode { + background-position: right 0px; +} +.dojoxPortlet .dojoxCloseNodeHover { + background-position: right -15px; +} + +.tundra .dojoxPortlet .dijitOpen .dojoxArrowDown, +.soria .dojoxPortlet .dijitOpen .dojoxArrowDown, +.nihilo .dojoxPortlet .dijitOpen .dojoxArrowDown, +.claro .dojoxPortlet .dijitOpen .dojoxArrowDown{ + background-position: -15px top; +} +.tundra .dojoxPortlet .dijitClosed .dojoxArrowDown, +.soria .dojoxPortlet .dijitClosed .dojoxArrowDown, +.nihilo .dojoxPortlet .dijitClosed .dojoxArrowDown, +.claro .dojoxPortlet .dijitClosed .dojoxArrowDown { + background-position: 0 top; +} + +.tundra .dojoxPortlet .dojoxPortletSettingsIcon, +.soria .dojoxPortlet .dojoxPortletSettingsIcon, +.nihilo .dojoxPortlet .dojoxPortletSettingsIcon, +.claro .dojoxPortlet .dojoxPortletSettingsIcon { + background-image: url(images/icons.png); + background-position: 0 1px; +} +.tundra .dojoxPortletSettingsContainer, +.soria .dojoxPortletSettingsContainer, +.nihilo .dojoxPortletSettingsContainer, +.claro .dojoxPortletSettingsContainer { + border-bottom: 1px solid #BFBFBF; + padding: 4px; +} +.tundra .dijitDialogPaneContent .dojoxPortletSettingsContainer, +.soria .dijitDialogPaneContent .dojoxPortletSettingsContainer, +.nihilo .dijitDialogPaneContent .dojoxPortletSettingsContainer, +.claro .dijitDialogPaneContent .dojoxPortletSettingsContainer { + border-bottom: none; +} + +.tundra .dijitDialogPaneContent .dojoxPortletSettingsContainer, +.soria .dijitDialogPaneContent .dojoxPortletSettingsContainer, +.nihilo .dijitDialogPaneContent .dojoxPortletSettingsContainer { + border-bottom: none; +} + + +.soria .dojoDndItemOver .dojoxPortletTitle { + border-top: 1px solid #8D8D8D; + border-left: 1px solid #8D8D8D; + border-right: 1px solid #8D8D8D; +} +.soria .dojoDndItemOver .dojoxPortletContentOuter { + border-bottom: 1px solid #9D9D9D; + border-left: 1px solid #9D9D9D; + border-right: 1px solid #9D9D9D; +} + +.dojoxPortlet div.dojoxPortletContentOuter { + background: #fff url(../../../dijit/themes/tundra/images/validationInputBg.gif) repeat-x top left; +} + +.dojoxFeedPortletList { + padding-left: 25px; + margin: 0px; +} +.dojoxFeedPortletExpandableList { + padding-left: 0px; + margin: 0px; +} +.dojoxFeedPortletExpandableList li { + margin-bottom: 5px; +} +.dojoxFeedPortletList li { + padding-top: 4px; +} +.dojoxFeedPortletPreview { + max-height: 300px; + max-width: 400px; + overflow: hidden; +} +.dojoxFeedPortletPreview * { + max-height: 295px; + max-width: 395px; +} +.dojoxPortletFeedSettings { + padding: 5px; + border-bottom: 1px solid #9D9D9D; +} +.dojoxFeedPortletExpandableList { + list-style: none; +} +.dojoxPortletToggleIcon { + margin-right: 6px; + cursor: pointer; +} +.dojoxPortletToggleIcon img { + width: 15px; + height: 14px; +} +.dojoxPortletItemCollapsed .dojoxPortletToggleIcon { + background: url(../../../dijit/themes/tundra/images/plusButton.gif) no-repeat 0 0; +} +.dojoxPortletItemOpen .dojoxPortletToggleIcon { + background: url(../../../dijit/themes/tundra/images/minusButton.gif) no-repeat 0 0; +} +.dojoxPortletItemSummary { + margin-left: 20px; +} +.dojoxPortletItemCollapsed .dojoxPortletItemSummary { + display: none; +} +.dojoxPortletItemOpen .dojoxPortletItemSummary { + display: block; +} + diff --git a/js/dojo-1.6/dojox/widget/Portlet/images/icons.gif b/js/dojo-1.6/dojox/widget/Portlet/images/icons.gif Binary files differnew file mode 100644 index 0000000..cafca8d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Portlet/images/icons.gif diff --git a/js/dojo-1.6/dojox/widget/Portlet/images/icons.png b/js/dojo-1.6/dojox/widget/Portlet/images/icons.png Binary files differnew file mode 100644 index 0000000..d5cbcf5 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Portlet/images/icons.png diff --git a/js/dojo-1.6/dojox/widget/README b/js/dojo-1.6/dojox/widget/README new file mode 100644 index 0000000..d211a8e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/README @@ -0,0 +1,186 @@ +------------------------------------------------------------------------------- +dojox.widget Collection +------------------------------------------------------------------------------- +Version 1.0 +Release date: 10/31/2007 +------------------------------------------------------------------------------- +Project state: + +[Calendar] experimental +[CalendarFx] experimental +[ColorPicker] beta +[Dialog] experimental +[DialogSimple] beta +[FeedPortlet] experimental +[FilePicker] experimental +[FisheyeList] experimental +[FisheyeLite] beta +[Iterator] experimental +[Loader] experimental +[Pager] experimental +[Portlet] experimental +[PlaceholderMenuItem] experimental +[Roller] experimental +[RollingList] experimental +[SortList] experimental +[TitleGroup] beta +[Toaster] experimental +[Wizard] experimental +[AnalogGauge] experimental +[BarGauge] experimental +[Standby] experimental + +------------------------------------------------------------------------------- +Credits: + +[Calendar] Shane O'Sullivan +[CalendarFx] Shane O'Sullivan +[ColorPicker] Peter Higgins (dante) +[Dialog] Peter Higgins (dante) +[DialogSimple] Peter Higgins (dante) +[FeedPortlet] Shane O'Sullivan +[FilePicker] Nathan Toone (toonetown) +[FisheyeList] Karl Tiedt (kteidt) +[FisheyeLite] Peter Higgins (dante) +[Iterator] Alex Russell (slightlyoff) +[Loader] Peter Higgins (dante) +[Pager] Nikolai Onken (nonken), Peter Higgins (dante); +[PlaceholderMenuItem] Nathan Toone (toonetown) +[Portlet] Shane O'Sullivan +[Roller] Peter Higgins (dante) +[RollingList] Nathan Toone (toonetown) +[SortList] Peter Higgins (dante) +[TitleGroup] Peter Higgins (dante) +[Toaster] Adam Peller (peller) +[Wizard] Peter Higgins (dante) +[AnalogGauge] Benjamin Schell (bmschell) CCLA +[BarGauge] Benjamin Schell (bmschell) CCLA +[Standby] Jared Jurkiewicz (jaredj) CCLA +[UpgradeBar] Mike Wilcox (mwilcox), Revin Guillen + +------------------------------------------------------------------------------- +Project description + + This is a collection of standalone widgets for use in + your website. Each individual widget is independent + of the others. + +------------------------------------------------------------------------------- +Dependencies: + + Each widget has it's own requirements and dependencies. + Most inherit from dijit base-classes such as dijit._Widget, + dijit._Templated, etc ... So we will assume the availablility + of dojo (core), and dijit packages. + + Each individual component stores resources in a folder that shares + a name with the Widget. For instance: + + the Dialog lives in + dojox/widget/Dialog.js ... + + and the folder: + dojox/widget/Dialog/ contains a 'Dialog.css', the required + styles for that particular widget. All required templates and + images reside in the folder. + + This differs slightly from the rest of DojoX in that each other + project uses a shared resources/ folder in the project folder, + though uses the same naming convention for stylesheets and templates. + + eg: + dojox/layout/resources/ExpandoPane.css + dojox.layout.ExpandoPane + +------------------------------------------------------------------------------- +Documentation + + Please refer to the API-tool, or in-line documentation. All of these + widgets are of varying use, quality, and documentation completion. + +------------------------------------------------------------------------------- +Installation instructions + + These are standalone Widgets, so putting the [widget].js file + in your dojox/widget folder, and copying any files in the + /dojox/widget/[widget]/ folder as supplements/templates/etc + should be all you need to do. + + eg: FisheyeList: + /dojox/widget/FisheyeList.js + /dojox/widget/FisheyeList/FisheyeList.css + + should be all you need to use the Fisheye widget. + + you can safely import the whole widget project into your + dojox/ root directory from the following SVN url: + + http://svn.dojotoolkit.org/src/dojox/trunk/widget + +------------------------------------------------------------------------------- +Other Notes (Brief widget list): + + * ColorPicker - An HSV ColorPicker intended to be a drop down + + * Calendar - An extension on the dijit._Calendar providing a different UI + * CalendarFx - additional mixable FX for transitions in dojox.widget.Calendar + + * Dialog - An extended version of dijit.Dialog with man options and transition. + + * DialogSimple - A simple Dijit Dialog providing `dojox.layout.ContentPane` integration + + * FilePicker - a widget for browsing server-side file systems (can use + dojox.data.FileStore as backend store) + + * FisheyeList - the classic FishEye Picker (abandoned) + + * FisheyeLite - A partial replacement for the FisheyeList - serious performance + gains, and entirely more extensible in that it simply animates defined + properties, relying on the natural styling as a foundation. + + * Iterator - Basic array and data store iterator class + + * Loader - an experimental Class that listens to XHR + connections in the background, and displays + a loading indicator. Loader will be removed in 1.3, and is (abandoned). + + * PlaceholderMenuItem - a menu item that can be used to inject other menu + items at a given location. Extends dijit.Menu directly. + + * Roller - A component to show many lines of text in a single area, rotating + through the options available. Also provides RollerSlide, an extension + to the stock fading roller to add a slide animation to the transition. + + * RollingList - A component of the FilePicker widget + + * SortList - a degradable UL with a fixed header, scrolling, + and sorting. Can be the direct descendant of a + LayoutContainer and will size to fit. + + * TitleGroup - A container offering variable height TitlePane access, though + behaves like an AccordionContainer + + * Toaster - a messaging system to display unobtrusive + alerts on screen. + + * Wizard - a StackContainer with built-in navigation to + ease in the creation of 'step-based' content. + Requires dojo >= 1.1 + + * AnalogGauge - an analog style customizable gauge for displaying values in an + animated fashion and with multiple indicators. Supports easings for + indicator animations, transparent overlays, etc. Very flexible. + Requires dojo >= 1.3 + + * BarGauge - a bar style gauge for displaying values in an animated fashion + and with multiple indicators. Supports easings for indicator animations, + etc. Very flexible. + Requires dojo >= 1.3 + + * Standby - a 'blocker' style widget to overlay a translucent div + image over a DOM node/widget + to indicate busy. Overlay color, image, and alt text can all be customized. + Requires dojo >= 1.3 + + * UpgradeBar - Displays the "yellow bar" at the top of a page to indicate the user + needs to upgrade their browser or a plugin + Requires dojo >= 1.3 diff --git a/js/dojo-1.6/dojox/widget/Roller.js b/js/dojo-1.6/dojox/widget/Roller.js new file mode 100644 index 0000000..1a4552f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Roller.js @@ -0,0 +1,239 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Roller"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Roller"] = true;
+dojo.provide("dojox.widget.Roller");
+dojo.require("dijit._Widget");
+
+dojo.declare("dojox.widget.Roller", dijit._Widget, {
+ // summary: A simple widget to take an unordered-list of Text and roll through them
+ //
+ // description:
+ // The Roller widget takes an unordered-list of items, and converts
+ // them to a single-area (the size of one list-item, however you so choose
+ // to style it) and loops continually, fading between items.
+ //
+ // In it's current state, it requires it be created from an unordered (or ordered)
+ // list, though can contain complex markup.
+ //
+ // You can manipulate the `items` array at any point during the cycle with
+ // standard array manipulation techniques.
+ //
+ // The class "dojoxRoller" is added to the UL element for styling purposes.
+ //
+ // example:
+ // | // create a scroller from a unordered list with id="lister"
+ // | var thinger = new dojox.widget.Roller.Roller({},"lister");
+ //
+ // example:
+ // | // create a scroller from a fixed array, and place in the DOM:
+ // | new dojox.widget.Roller({ items:["one","two","three"] }).placeAt(dojo.body());
+ //
+ // example:
+ // | // add an item:
+ // | dijit.byId("roller").items.push("I am a new Label");
+ //
+ // example:
+ // | // stop a roller from rolling:
+ // | dijit.byId("roller").stop();
+ //
+ // delay: Integer
+ // Interval between rolls
+ delay: 2000,
+
+ // autoStart: Boolean
+ // Toggle to control starup behavior. Call .start() manually
+ // if set to `false`
+ autoStart: true,
+
+ // itemSelector: String
+ // A CSS selector to be used by `dojo.query` to find the children
+ // items in this widget. Defaults to "> li", finding only first-children
+ // list-items in the list, allowing for embedded lists to occur.
+ itemSelector: "> li",
+
+ // durationIn: Integer
+ // Speed (in ms) to apply to the "in" animation (show the node)
+ durationIn: 400,
+
+ // durationOut: Integer
+ // Speed (in ms) to apply to the "out" animation (hide the showing node)
+ durationOut: 275,
+/*=====
+ // items: Array
+ // If populated prior to instantiation, is used as the Items over the children
+ items: [],
+=====*/
+
+ // _idx: Integer
+ // Index of the the currently visible item in the list of items[]
+ _idx: -1,
+
+ postCreate: function(){
+
+ // add some instance vars:
+ if(!this["items"]){
+ this.items = [];
+ }
+
+ dojo.addClass(this.domNode,"dojoxRoller");
+
+ // find all the items in this list, and popuplate
+ dojo.query(this.itemSelector, this.domNode).forEach(function(item, i){
+ this.items.push(item.innerHTML);
+ // reuse the first match, destroy the rest
+ if(i == 0){
+ this._roller = item;
+ this._idx = 0;
+ }else{ dojo.destroy(item); }
+ }, this);
+
+ // handle the case where items[] were passed, and no srcNodeRef exists
+ if(!this._roller){
+ this._roller = dojo.create('li', null, this.domNode);
+ }
+ // stub out animation creation (for overloading maybe later)
+ this.makeAnims();
+
+ // and start, if true:
+ if(this.autoStart){ this.start(); }
+
+ },
+
+ makeAnims: function(){
+ // summary: Animation creator function. Need to create an 'in' and 'out'
+ // Animation stored in _anim Object, which the rest of the widget
+ // will reuse.
+ var n = this.domNode;
+ dojo.mixin(this, {
+ _anim: {
+ "in": dojo.fadeIn({ node:n, duration: this.durationIn }),
+ "out": dojo.fadeOut({ node:n, duration: this.durationOut })
+ }
+ });
+ this._setupConnects();
+
+ },
+
+ _setupConnects: function(){
+ // summary: setup the loop connection logic
+ var anim = this._anim;
+
+ this.connect(anim["out"], "onEnd", function(){
+ // onEnd of the `out` animation, select the next items and play `in` animation
+ this._setIndex(this._idx + 1);
+ anim["in"].play(15);
+ });
+
+ this.connect(anim["in"], "onEnd", function(){
+ // onEnd of the `in` animation, call `start` again after some delay:
+ this._timeout = setTimeout(dojo.hitch(this, "_run"), this.delay);
+ });
+ },
+
+ start: function(){
+ // summary: Starts to Roller looping
+ if(!this.rolling){
+ this.rolling = true;
+ this._run();
+ }
+ },
+
+ _run: function(){
+ this._anim["out"].gotoPercent(0, true);
+ },
+
+ stop: function(){
+ // summary: Stops the Roller from looping anymore.
+ this.rolling = false;
+
+ var m = this._anim,
+ t = this._timeout;
+
+ if(t){ clearTimeout(t); }
+ m["in"].stop();
+ m["out"].stop();
+ },
+
+ _setIndex: function(i){
+ // summary: Set the Roller to some passed index. If beyond range, go to first.
+ var l = this.items.length - 1;
+ if(i < 0){ i = l; }
+ if(i > l){ i = 0; }
+ this._roller.innerHTML = this.items[i] || "error!";
+ this._idx = i;
+ }
+
+});
+
+dojo.declare("dojox.widget.RollerSlide", dojox.widget.Roller, {
+ // summary: An add-on to the Roller to modify animations. This produces
+ // a slide-from-bottom like effect. See `dojox.widget.Roller` for
+ // full API information.
+
+ durationOut: 175, // slightly faster than default
+
+ makeAnims: function(){
+ // summary: Animation creator function. Need to create an 'in' and 'out'
+ // Animation stored in _anim Object, which the rest of the widget
+ // will reuse.
+
+ var n = this.domNode, pos = "position",
+ props = {
+ top: { end: 0, start: 25 },
+ opacity: 1
+ }
+ ;
+
+ dojo.style(n, pos, "relative");
+ dojo.style(this._roller, pos, "absolute");
+
+ dojo.mixin(this, {
+ _anim: {
+
+ "in": dojo.animateProperty({
+ node: n,
+ duration: this.durationIn,
+ properties: props
+ }),
+
+ "out": dojo.fadeOut({ node: n, duration: this.durationOut })
+ }
+ });
+ // don't forget to do this in the class. override if necessary.
+ this._setupConnects();
+ }
+
+});
+
+dojo.declare("dojox.widget._RollerHover", null, {
+ // summary: A mixin class to provide a way to automate the "stop on hover" functionality.
+ //
+ // description:
+ // A mixin class used to provide a way to automate a "stop on hover" behavior,
+ // while still allowing for ambigious subclassing for custom animations.
+ // Simply mix this class into a `dojox.widget.Roller` variant, and instantiate
+ // as you would. The hover connection is done automatically.
+ //
+ // The "hover" functionality is as such: Stop rotation while the mouse is over the
+ // instance, and resume again once leaving. Even if autoStart is disabled, the widget
+ // will start if a mouse enters and leaves the node in this case.
+ //
+ // example:
+ // | dojo.declare("my.Roller", [dojox.widget.RollerSlide, dojox.widget._RollerHover], {});
+ // | new my.Roller({}, "myList");
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.connect(this.domNode, "onmouseenter", "stop");
+ this.connect(this.domNode, "onmouseleave", "start");
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Roller.xd.js b/js/dojo-1.6/dojox/widget/Roller.xd.js new file mode 100644 index 0000000..63d4460 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Roller.xd.js @@ -0,0 +1,244 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Roller"],
+["require", "dijit._Widget"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Roller"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Roller"] = true;
+dojo.provide("dojox.widget.Roller");
+dojo.require("dijit._Widget");
+
+dojo.declare("dojox.widget.Roller", dijit._Widget, {
+ // summary: A simple widget to take an unordered-list of Text and roll through them
+ //
+ // description:
+ // The Roller widget takes an unordered-list of items, and converts
+ // them to a single-area (the size of one list-item, however you so choose
+ // to style it) and loops continually, fading between items.
+ //
+ // In it's current state, it requires it be created from an unordered (or ordered)
+ // list, though can contain complex markup.
+ //
+ // You can manipulate the `items` array at any point during the cycle with
+ // standard array manipulation techniques.
+ //
+ // The class "dojoxRoller" is added to the UL element for styling purposes.
+ //
+ // example:
+ // | // create a scroller from a unordered list with id="lister"
+ // | var thinger = new dojox.widget.Roller.Roller({},"lister");
+ //
+ // example:
+ // | // create a scroller from a fixed array, and place in the DOM:
+ // | new dojox.widget.Roller({ items:["one","two","three"] }).placeAt(dojo.body());
+ //
+ // example:
+ // | // add an item:
+ // | dijit.byId("roller").items.push("I am a new Label");
+ //
+ // example:
+ // | // stop a roller from rolling:
+ // | dijit.byId("roller").stop();
+ //
+ // delay: Integer
+ // Interval between rolls
+ delay: 2000,
+
+ // autoStart: Boolean
+ // Toggle to control starup behavior. Call .start() manually
+ // if set to `false`
+ autoStart: true,
+
+ // itemSelector: String
+ // A CSS selector to be used by `dojo.query` to find the children
+ // items in this widget. Defaults to "> li", finding only first-children
+ // list-items in the list, allowing for embedded lists to occur.
+ itemSelector: "> li",
+
+ // durationIn: Integer
+ // Speed (in ms) to apply to the "in" animation (show the node)
+ durationIn: 400,
+
+ // durationOut: Integer
+ // Speed (in ms) to apply to the "out" animation (hide the showing node)
+ durationOut: 275,
+/*=====
+ // items: Array
+ // If populated prior to instantiation, is used as the Items over the children
+ items: [],
+=====*/
+
+ // _idx: Integer
+ // Index of the the currently visible item in the list of items[]
+ _idx: -1,
+
+ postCreate: function(){
+
+ // add some instance vars:
+ if(!this["items"]){
+ this.items = [];
+ }
+
+ dojo.addClass(this.domNode,"dojoxRoller");
+
+ // find all the items in this list, and popuplate
+ dojo.query(this.itemSelector, this.domNode).forEach(function(item, i){
+ this.items.push(item.innerHTML);
+ // reuse the first match, destroy the rest
+ if(i == 0){
+ this._roller = item;
+ this._idx = 0;
+ }else{ dojo.destroy(item); }
+ }, this);
+
+ // handle the case where items[] were passed, and no srcNodeRef exists
+ if(!this._roller){
+ this._roller = dojo.create('li', null, this.domNode);
+ }
+ // stub out animation creation (for overloading maybe later)
+ this.makeAnims();
+
+ // and start, if true:
+ if(this.autoStart){ this.start(); }
+
+ },
+
+ makeAnims: function(){
+ // summary: Animation creator function. Need to create an 'in' and 'out'
+ // Animation stored in _anim Object, which the rest of the widget
+ // will reuse.
+ var n = this.domNode;
+ dojo.mixin(this, {
+ _anim: {
+ "in": dojo.fadeIn({ node:n, duration: this.durationIn }),
+ "out": dojo.fadeOut({ node:n, duration: this.durationOut })
+ }
+ });
+ this._setupConnects();
+
+ },
+
+ _setupConnects: function(){
+ // summary: setup the loop connection logic
+ var anim = this._anim;
+
+ this.connect(anim["out"], "onEnd", function(){
+ // onEnd of the `out` animation, select the next items and play `in` animation
+ this._setIndex(this._idx + 1);
+ anim["in"].play(15);
+ });
+
+ this.connect(anim["in"], "onEnd", function(){
+ // onEnd of the `in` animation, call `start` again after some delay:
+ this._timeout = setTimeout(dojo.hitch(this, "_run"), this.delay);
+ });
+ },
+
+ start: function(){
+ // summary: Starts to Roller looping
+ if(!this.rolling){
+ this.rolling = true;
+ this._run();
+ }
+ },
+
+ _run: function(){
+ this._anim["out"].gotoPercent(0, true);
+ },
+
+ stop: function(){
+ // summary: Stops the Roller from looping anymore.
+ this.rolling = false;
+
+ var m = this._anim,
+ t = this._timeout;
+
+ if(t){ clearTimeout(t); }
+ m["in"].stop();
+ m["out"].stop();
+ },
+
+ _setIndex: function(i){
+ // summary: Set the Roller to some passed index. If beyond range, go to first.
+ var l = this.items.length - 1;
+ if(i < 0){ i = l; }
+ if(i > l){ i = 0; }
+ this._roller.innerHTML = this.items[i] || "error!";
+ this._idx = i;
+ }
+
+});
+
+dojo.declare("dojox.widget.RollerSlide", dojox.widget.Roller, {
+ // summary: An add-on to the Roller to modify animations. This produces
+ // a slide-from-bottom like effect. See `dojox.widget.Roller` for
+ // full API information.
+
+ durationOut: 175, // slightly faster than default
+
+ makeAnims: function(){
+ // summary: Animation creator function. Need to create an 'in' and 'out'
+ // Animation stored in _anim Object, which the rest of the widget
+ // will reuse.
+
+ var n = this.domNode, pos = "position",
+ props = {
+ top: { end: 0, start: 25 },
+ opacity: 1
+ }
+ ;
+
+ dojo.style(n, pos, "relative");
+ dojo.style(this._roller, pos, "absolute");
+
+ dojo.mixin(this, {
+ _anim: {
+
+ "in": dojo.animateProperty({
+ node: n,
+ duration: this.durationIn,
+ properties: props
+ }),
+
+ "out": dojo.fadeOut({ node: n, duration: this.durationOut })
+ }
+ });
+ // don't forget to do this in the class. override if necessary.
+ this._setupConnects();
+ }
+
+});
+
+dojo.declare("dojox.widget._RollerHover", null, {
+ // summary: A mixin class to provide a way to automate the "stop on hover" functionality.
+ //
+ // description:
+ // A mixin class used to provide a way to automate a "stop on hover" behavior,
+ // while still allowing for ambigious subclassing for custom animations.
+ // Simply mix this class into a `dojox.widget.Roller` variant, and instantiate
+ // as you would. The hover connection is done automatically.
+ //
+ // The "hover" functionality is as such: Stop rotation while the mouse is over the
+ // instance, and resume again once leaving. Even if autoStart is disabled, the widget
+ // will start if a mouse enters and leaves the node in this case.
+ //
+ // example:
+ // | dojo.declare("my.Roller", [dojox.widget.RollerSlide, dojox.widget._RollerHover], {});
+ // | new my.Roller({}, "myList");
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.connect(this.domNode, "onmouseenter", "stop");
+ this.connect(this.domNode, "onmouseleave", "start");
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/RollingList.js b/js/dojo-1.6/dojox/widget/RollingList.js new file mode 100644 index 0000000..a27a538 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/RollingList.js @@ -0,0 +1,1214 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.RollingList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.RollingList"] = true;
+dojo.provide("dojox.widget.RollingList");
+dojo.experimental("dojox.widget.RollingList");
+
+dojo.require("dojo.window");
+
+dojo.require("dijit.layout.ContentPane");
+dojo.require("dijit._Templated");
+dojo.require("dijit._Contained");
+dojo.require("dijit.layout._LayoutWidget");
+dojo.require("dijit.Menu");
+dojo.require("dijit.form.Button");
+
+dojo.require("dojox.html.metrics");
+
+dojo.require("dojo.i18n");
+dojo.requireLocalization("dijit", "common", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
+
+dojo.declare("dojox.widget._RollingListPane",
+ [dijit.layout.ContentPane, dijit._Templated, dijit._Contained], {
+ // summary: a core pane that can be attached to a RollingList. All panes
+ // should extend this one
+
+ // templateString: string
+ // our template
+ templateString: '<div class="dojoxRollingListPane"><table><tbody><tr><td dojoAttachPoint="containerNode"></td></tr></tbody></div>',
+
+ // parentWidget: dojox.widget.RollingList
+ // Our rolling list widget
+ parentWidget: null,
+
+ // parentPane: dojox.widget._RollingListPane
+ // The pane that immediately precedes ours
+ parentPane: null,
+
+ // store: store
+ // the store we must use
+ store: null,
+
+ // items: item[]
+ // an array of (possibly not-yet-loaded) items to display in this.
+ // If this array is null, then the query and query options are used to
+ // get the top-level items to use. This array is also used to watch and
+ // see if the pane needs to be reloaded (store notifications are handled)
+ // by the pane
+ items: null,
+
+ // query: object
+ // a query to pass to the datastore. This is only used if items are null
+ query: null,
+
+ // queryOptions: object
+ // query options to be passed to the datastore
+ queryOptions: null,
+
+ // focusByNode: boolean
+ // set to false if the subclass will handle its own node focusing
+ _focusByNode: true,
+
+ // minWidth: integer
+ // the width (in px) for this pane
+ minWidth: 0,
+
+ _setContentAndScroll: function(/*String|DomNode|Nodelist*/cont, /*Boolean?*/isFakeContent){
+ // summary: sets the value of the content and scrolls it into view
+ this._setContent(cont, isFakeContent);
+ this.parentWidget.scrollIntoView(this);
+ },
+
+ _updateNodeWidth: function(n, min){
+ // summary: updates the min width of the pane to be minPaneWidth
+ n.style.width = "";
+ var nWidth = dojo.marginBox(n).w;
+ if(nWidth < min){
+ dojo.marginBox(n, {w: min});
+ }
+ },
+
+ _onMinWidthChange: function(v){
+ // Called when the min width of a pane has changed
+ this._updateNodeWidth(this.domNode, v);
+ },
+
+ _setMinWidthAttr: function(v){
+ if(v !== this.minWidth){
+ this.minWidth = v;
+ this._onMinWidthChange(v);
+ }
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ if(this.store && this.store.getFeatures()["dojo.data.api.Notification"]){
+ window.setTimeout(dojo.hitch(this, function(){
+ // Set connections after a slight timeout to avoid getting in the
+ // condition where we are setting them while events are still
+ // being fired
+ this.connect(this.store, "onSet", "_onSetItem");
+ this.connect(this.store, "onNew", "_onNewItem");
+ this.connect(this.store, "onDelete", "_onDeleteItem");
+ }), 1);
+ }
+ this.connect(this.focusNode||this.domNode, "onkeypress", "_focusKey");
+ this.parentWidget._updateClass(this.domNode, "Pane");
+ this.inherited(arguments);
+ this._onMinWidthChange(this.minWidth);
+ },
+
+ _focusKey: function(/*Event*/e){
+ // summary: called when a keypress happens on the widget
+ if(e.charOrCode == dojo.keys.BACKSPACE){
+ dojo.stopEvent(e);
+ return;
+ }else if(e.charOrCode == dojo.keys.LEFT_ARROW && this.parentPane){
+ this.parentPane.focus();
+ this.parentWidget.scrollIntoView(this.parentPane);
+ }else if(e.charOrCode == dojo.keys.ENTER){
+ this.parentWidget._onExecute();
+ }
+ },
+
+ focus: function(/*boolean*/force){
+ // summary: sets the focus to this current widget
+ if(this.parentWidget._focusedPane != this){
+ this.parentWidget._focusedPane = this;
+ this.parentWidget.scrollIntoView(this);
+ if(this._focusByNode && (!this.parentWidget._savedFocus || force)){
+ try{(this.focusNode||this.domNode).focus();}catch(e){}
+ }
+ }
+ },
+
+ _onShow: function(){
+ // summary: checks that the store is loaded
+ if((this.store || this.items) && ((this.refreshOnShow && this.domNode) || (!this.isLoaded && this.domNode))){
+ this.refresh();
+ }
+ },
+
+ _load: function(){
+ // summary: sets the "loading" message and then kicks off a query asyncronously
+ this.isLoaded = false;
+ if(this.items){
+ this._setContentAndScroll(this.onLoadStart(), true);
+ window.setTimeout(dojo.hitch(this, "_doQuery"), 1);
+ }else{
+ this._doQuery();
+ }
+ },
+
+ _doLoadItems: function(/*item[]*/items, /*function*/callback){
+ // summary: loads the given items, and then calls the callback when they
+ // are finished.
+ var _waitCount = 0, store = this.store;
+ dojo.forEach(items, function(item){
+ if(!store.isItemLoaded(item)){ _waitCount++; }
+ });
+ if(_waitCount === 0){
+ callback();
+ }else{
+ var onItem = function(item){
+ _waitCount--;
+ if((_waitCount) === 0){
+ callback();
+ }
+ };
+ dojo.forEach(items, function(item){
+ if(!store.isItemLoaded(item)){
+ store.loadItem({item: item, onItem: onItem});
+ }
+ });
+ }
+ },
+
+ _doQuery: function(){
+ // summary: either runs the query or loads potentially not-yet-loaded items.
+ if(!this.domNode){return;}
+ var preload = this.parentWidget.preloadItems;
+ preload = (preload === true || (this.items && this.items.length <= Number(preload)));
+ if(this.items && preload){
+ this._doLoadItems(this.items, dojo.hitch(this, "onItems"));
+ }else if(this.items){
+ this.onItems();
+ }else{
+ this._setContentAndScroll(this.onFetchStart(), true);
+ this.store.fetch({query: this.query,
+ onComplete: function(items){
+ this.items = items;
+ this.onItems();
+ },
+ onError: function(e){
+ this._onError("Fetch", e);
+ },
+ scope: this});
+ }
+ },
+
+ _hasItem: function(/* item */ item){
+ // summary: returns whether or not the given item is handled by this
+ // pane
+ var items = this.items || [];
+ for(var i = 0, myItem; (myItem = items[i]); i++){
+ if(this.parentWidget._itemsMatch(myItem, item)){
+ return true;
+ }
+ }
+ return false;
+ },
+
+ _onSetItem: function(/* item */ item,
+ /* attribute-name-string */ attribute,
+ /* object | array */ oldValue,
+ /* object | array */ newValue){
+ // Summary: called when an item in the store has changed
+ if(this._hasItem(item)){
+ this.refresh();
+ }
+ },
+
+ _onNewItem: function(/* item */ newItem, /*object?*/ parentInfo){
+ // Summary: called when an item is added to the store
+ var sel;
+ if((!parentInfo && !this.parentPane) ||
+ (parentInfo && this.parentPane && this.parentPane._hasItem(parentInfo.item) &&
+ (sel = this.parentPane._getSelected()) && this.parentWidget._itemsMatch(sel.item, parentInfo.item))){
+ this.items.push(newItem);
+ this.refresh();
+ }else if(parentInfo && this.parentPane && this._hasItem(parentInfo.item)){
+ this.refresh();
+ }
+ },
+
+ _onDeleteItem: function(/* item */ deletedItem){
+ // Summary: called when an item is removed from the store
+ if(this._hasItem(deletedItem)){
+ this.items = dojo.filter(this.items, function(i){
+ return (i != deletedItem);
+ });
+ this.refresh();
+ }
+ },
+
+ onFetchStart: function(){
+ // summary:
+ // called before a fetch starts
+ return this.loadingMessage;
+ },
+
+ onFetchError: function(/*Error*/ error){
+ // summary:
+ // called when a fetch error occurs.
+ return this.errorMessage;
+ },
+
+ onLoadStart: function(){
+ // summary:
+ // called before a load starts
+ return this.loadingMessage;
+ },
+
+ onLoadError: function(/*Error*/ error){
+ // summary:
+ // called when a load error occurs.
+ return this.errorMessage;
+ },
+
+ onItems: function(){
+ // summary:
+ // called after a fetch or load - at this point, this.items should be
+ // set and loaded. Override this function to "do your stuff"
+ if(!this.onLoadDeferred){
+ this.cancel();
+ this.onLoadDeferred = new dojo.Deferred(dojo.hitch(this, "cancel"));
+ }
+ this._onLoadHandler();
+ }
+
+});
+
+dojo.declare("dojox.widget._RollingListGroupPane",
+ [dojox.widget._RollingListPane], {
+ // summary: a pane that will handle groups (treats them as menu items)
+
+ // templateString: string
+ // our template
+ templateString: '<div><div dojoAttachPoint="containerNode"></div>' +
+ '<div dojoAttachPoint="menuContainer">' +
+ '<div dojoAttachPoint="menuNode"></div>' +
+ '</div></div>',
+
+ // _menu: dijit.Menu
+ // The menu that we will call addChild() on for adding items
+ _menu: null,
+
+ _setContent: function(/*String|DomNode|Nodelist*/cont){
+ if(!this._menu){
+ // Only set the content if we don't already have a menu
+ this.inherited(arguments);
+ }
+ },
+
+ _onMinWidthChange: function(v){
+ // override and resize the menu instead
+ if(!this._menu){ return; }
+ var dWidth = dojo.marginBox(this.domNode).w;
+ var mWidth = dojo.marginBox(this._menu.domNode).w;
+ this._updateNodeWidth(this._menu.domNode, v - (dWidth - mWidth));
+ },
+
+ onItems: function(){
+ // summary:
+ // called after a fetch or load
+ var selectItem, hadChildren = false;
+ if(this._menu){
+ selectItem = this._getSelected();
+ this._menu.destroyRecursive();
+ }
+ this._menu = this._getMenu();
+ var child, selectMenuItem;
+ if(this.items.length){
+ dojo.forEach(this.items, function(item){
+ child = this.parentWidget._getMenuItemForItem(item, this);
+ if(child){
+ if(selectItem && this.parentWidget._itemsMatch(child.item, selectItem.item)){
+ selectMenuItem = child;
+ }
+ this._menu.addChild(child);
+ }
+ }, this);
+ }else{
+ child = this.parentWidget._getMenuItemForItem(null, this);
+ if(child){
+ this._menu.addChild(child);
+ }
+ }
+ if(selectMenuItem){
+ this._setSelected(selectMenuItem);
+ if((selectItem && !selectItem.children && selectMenuItem.children) ||
+ (selectItem && selectItem.children && !selectMenuItem.children)){
+ var itemPane = this.parentWidget._getPaneForItem(selectMenuItem.item, this, selectMenuItem.children);
+ if(itemPane){
+ this.parentWidget.addChild(itemPane, this.getIndexInParent() + 1);
+ }else{
+ this.parentWidget._removeAfter(this);
+ this.parentWidget._onItemClick(null, this, selectMenuItem.item, selectMenuItem.children);
+ }
+ }
+ }else if(selectItem){
+ this.parentWidget._removeAfter(this);
+ }
+ this.containerNode.innerHTML = "";
+ this.containerNode.appendChild(this._menu.domNode);
+ this.parentWidget.scrollIntoView(this);
+ this._checkScrollConnection(true);
+ this.inherited(arguments);
+ this._onMinWidthChange(this.minWidth);
+ },
+
+ _checkScrollConnection: function(doLoad){
+ // summary: checks whether or not we need to connect to our onscroll
+ // function
+ var store = this.store
+ if(this._scrollConn){
+ this.disconnect(this._scrollConn);
+ }
+ delete this._scrollConn;
+ if(!dojo.every(this.items, function(i){return store.isItemLoaded(i);})){
+ if(doLoad){
+ this._loadVisibleItems();
+ }
+ this._scrollConn = this.connect(this.domNode, "onscroll", "_onScrollPane");
+ }
+ },
+
+ startup: function(){
+ this.inherited(arguments);
+ this.parentWidget._updateClass(this.domNode, "GroupPane");
+ },
+
+ focus: function(/*boolean*/force){
+ // summary: sets the focus to this current widget
+ if(this._menu){
+ if(this._pendingFocus){
+ this.disconnect(this._pendingFocus);
+ }
+ delete this._pendingFocus;
+
+ // We focus the right widget - either the focusedChild, the
+ // selected node, the first menu item, or the menu itself
+ var focusWidget = this._menu.focusedChild;
+ if(!focusWidget){
+ var focusNode = dojo.query(".dojoxRollingListItemSelected", this.domNode)[0];
+ if(focusNode){
+ focusWidget = dijit.byNode(focusNode);
+ }
+ }
+ if(!focusWidget){
+ focusWidget = this._menu.getChildren()[0] || this._menu;
+ }
+ this._focusByNode = false;
+ if(focusWidget.focusNode){
+ if(!this.parentWidget._savedFocus || force){
+ try{focusWidget.focusNode.focus();}catch(e){}
+ }
+ window.setTimeout(function(){
+ try{
+ dojo.window.scrollIntoView(focusWidget.focusNode);
+ }catch(e){}
+ }, 1);
+ }else if(focusWidget.focus){
+ if(!this.parentWidget._savedFocus || force){
+ focusWidget.focus();
+ }
+ }else{
+ this._focusByNode = true;
+ }
+ this.inherited(arguments);
+ }else if(!this._pendingFocus){
+ this._pendingFocus = this.connect(this, "onItems", "focus");
+ }
+ },
+
+ _getMenu: function(){
+ // summary: returns a widget to be used for the container widget.
+ var self = this;
+ var menu = new dijit.Menu({
+ parentMenu: this.parentPane ? this.parentPane._menu : null,
+ onCancel: function(/*Boolean*/ closeAll){
+ if(self.parentPane){
+ self.parentPane.focus(true);
+ }
+ },
+ _moveToPopup: function(/*Event*/ evt){
+ if(this.focusedChild && !this.focusedChild.disabled){
+ this.focusedChild._onClick(evt);
+ }
+ }
+ }, this.menuNode);
+ this.connect(menu, "onItemClick", function(/*dijit.MenuItem*/ item, /*Event*/ evt){
+ if(item.disabled){ return; }
+ evt.alreadySelected = dojo.hasClass(item.domNode, "dojoxRollingListItemSelected");
+ if(evt.alreadySelected &&
+ ((evt.type == "keypress" && evt.charOrCode != dojo.keys.ENTER) ||
+ (evt.type == "internal"))){
+ var p = this.parentWidget.getChildren()[this.getIndexInParent() + 1];
+ if(p){
+ p.focus(true);
+ this.parentWidget.scrollIntoView(p);
+ }
+ }else{
+ this._setSelected(item, menu);
+ this.parentWidget._onItemClick(evt, this, item.item, item.children);
+ if(evt.type == "keypress" && evt.charOrCode == dojo.keys.ENTER){
+ this.parentWidget._onExecute();
+ }
+ }
+ });
+ if(!menu._started){
+ menu.startup();
+ }
+ return menu;
+ },
+
+ _onScrollPane: function(){
+ // summary: called when the pane has been scrolled - it sets a timeout
+ // so that we don't try and load our visible items too often during
+ // a scroll
+ if(this._visibleLoadPending){
+ window.clearTimeout(this._visibleLoadPending);
+ }
+ this._visibleLoadPending = window.setTimeout(dojo.hitch(this, "_loadVisibleItems"), 500);
+ },
+
+ _loadVisibleItems: function(){
+ // summary: loads the items that are currently visible in the pane
+ delete this._visibleLoadPending
+ var menu = this._menu;
+ if(!menu){ return; }
+ var children = menu.getChildren();
+ if(!children || !children.length){ return; }
+ var gpbme = function(n, m, pb){
+ var s = dojo.getComputedStyle(n);
+ var r = 0;
+ if(m){ r += dojo._getMarginExtents(n, s).t; }
+ if(pb){ r += dojo._getPadBorderExtents(n, s).t; }
+ return r;
+ };
+ var topOffset = gpbme(this.domNode, false, true) +
+ gpbme(this.containerNode, true, true) +
+ gpbme(menu.domNode, true, true) +
+ gpbme(children[0].domNode, true, false);
+ var h = dojo.contentBox(this.domNode).h;
+ var minOffset = this.domNode.scrollTop - topOffset - (h/2);
+ var maxOffset = minOffset + (3*h/2);
+ var menuItemsToLoad = dojo.filter(children, function(c){
+ var cnt = c.domNode.offsetTop;
+ var s = c.store;
+ var i = c.item;
+ return (cnt >= minOffset && cnt <= maxOffset && !s.isItemLoaded(i));
+ })
+ var itemsToLoad = dojo.map(menuItemsToLoad, function(c){
+ return c.item;
+ });
+ var onItems = dojo.hitch(this, function(){
+ var selectItem = this._getSelected();
+ var selectMenuItem;
+ dojo.forEach(itemsToLoad, function(item, idx){
+ var newItem = this.parentWidget._getMenuItemForItem(item, this);
+ var oItem = menuItemsToLoad[idx];
+ var oIdx = oItem.getIndexInParent();
+ menu.removeChild(oItem);
+ if(newItem){
+ if(selectItem && this.parentWidget._itemsMatch(newItem.item, selectItem.item)){
+ selectMenuItem = newItem;
+ }
+ menu.addChild(newItem, oIdx);
+ if(menu.focusedChild == oItem){
+ menu.focusChild(newItem);
+ }
+ }
+ oItem.destroy();
+ }, this);
+ this._checkScrollConnection(false);
+ });
+ this._doLoadItems(itemsToLoad, onItems);
+ },
+
+ _getSelected: function(/*dijit.Menu?*/ menu){
+ // summary:
+ // returns the selected menu item - or null if none are selected
+ if(!menu){ menu = this._menu; }
+ if(menu){
+ var children = this._menu.getChildren();
+ for(var i = 0, item; (item = children[i]); i++){
+ if(dojo.hasClass(item.domNode, "dojoxRollingListItemSelected")){
+ return item;
+ }
+ }
+ }
+ return null;
+ },
+
+ _setSelected: function(/*dijit.MenuItem?*/ item, /*dijit.Menu?*/ menu){
+ // summary:
+ // selectes the given item in the given menu (defaults to pane's menu)
+ if(!menu){ menu = this._menu;}
+ if(menu){
+ dojo.forEach(menu.getChildren(), function(i){
+ this.parentWidget._updateClass(i.domNode, "Item", {"Selected": (item && (i == item && !i.disabled))});
+ }, this);
+ }
+ }
+});
+
+dojo.declare("dojox.widget.RollingList",
+ [dijit._Widget, dijit._Templated, dijit._Container], {
+ // summary: a rolling list that can be tied to a data store with children
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "RollingList/RollingList.html", "<div class=\"dojoxRollingList ${className}\"\r\n\t><div class=\"dojoxRollingListContainer\" dojoAttachPoint=\"containerNode\" dojoAttachEvent=\"onkeypress:_onKey\"\r\n\t></div\r\n\t><div class=\"dojoxRollingListButtons\" dojoAttachPoint=\"buttonsNode\"\r\n ><button dojoType=\"dijit.form.Button\" dojoAttachPoint=\"okButton\"\r\n\t\t\t\tdojoAttachEvent=\"onClick:_onExecute\">${okButtonLabel}</button\r\n ><button dojoType=\"dijit.form.Button\" dojoAttachPoint=\"cancelButton\"\r\n\t\t\t\tdojoAttachEvent=\"onClick:_onCancel\">${cancelButtonLabel}</button\r\n\t></div\r\n></div>\r\n"),
+ widgetsInTemplate: true,
+
+ // className: string
+ // an additional class (or space-separated classes) to add for our widget
+ className: "",
+
+ // store: store
+ // the store we must use
+ store: null,
+
+ // query: object
+ // a query to pass to the datastore. This is only used if items are null
+ query: null,
+
+ // queryOptions: object
+ // query options to be passed to the datastore
+ queryOptions: null,
+
+ // childrenAttrs: String[]
+ // one ore more attributes that holds children of a node
+ childrenAttrs: ["children"],
+
+ // parentAttr: string
+ // the attribute to read for finding our parent item (if any)
+ parentAttr: "",
+
+ // value: item
+ // The value that has been selected
+ value: null,
+
+ // executeOnDblClick: boolean
+ // Set to true if you want to call onExecute when an item is
+ // double-clicked, false if you want to call onExecute yourself. (mainly
+ // used for popups to control how they want to be handled)
+ executeOnDblClick: true,
+
+ // preloadItems: boolean or int
+ // if set to true, then onItems will be called only *after* all items have
+ // been loaded (ie store.isLoaded will return true for all of them). If
+ // false, then no preloading will occur. If set to an integer, preloading
+ // will occur if the number of items is less than or equal to the value
+ // of the integer. The onItems function will need to be aware of handling
+ // items that may not be loaded
+ preloadItems: false,
+
+ // showButtons: boolean
+ // if set to true, then buttons for "OK" and "Cancel" will be provided
+ showButtons: false,
+
+ // okButtonLabel: string
+ // The string to use for the OK button - will use dijit's common "OK" string
+ // if not set
+ okButtonLabel: "",
+
+ // cancelButtonLabel: string
+ // The string to use for the Cancel button - will use dijit's common
+ // "Cancel" string if not set
+ cancelButtonLabel: "",
+
+ // minPaneWidth: integer
+ // the minimum pane width (in px) for all child panes. If they are narrower,
+ // the width will be increased to this value.
+ minPaneWidth: 0,
+
+ postMixInProperties: function(){
+ // summary: Mix in our labels, if they are not set
+ this.inherited(arguments);
+ var loc = dojo.i18n.getLocalization("dijit", "common");
+ this.okButtonLabel = this.okButtonLabel || loc.buttonOk;
+ this.cancelButtonLabel = this.cancelButtonLabel || loc.buttonCancel;
+ },
+
+ _setShowButtonsAttr: function(doShow){
+ // summary: Sets the visibility of the buttons for the widget
+ var needsLayout = false;
+ if((this.showButtons != doShow && this._started) ||
+ (this.showButtons == doShow && !this.started)){
+ needsLayout = true;
+ }
+ dojo.toggleClass(this.domNode, "dojoxRollingListButtonsHidden", !doShow);
+ this.showButtons = doShow;
+ if(needsLayout){
+ if(this._started){
+ this.layout();
+ }else{
+ window.setTimeout(dojo.hitch(this, "layout"), 0);
+ }
+ }
+ },
+
+ _itemsMatch: function(/*item*/ item1, /*item*/ item2){
+ // Summary: returns whether or not the two items match - checks ID if
+ // they aren't the exact same object
+ if(!item1 && !item2){
+ return true;
+ }else if(!item1 || !item2){
+ return false;
+ }
+ return (item1 == item2 ||
+ (this._isIdentity && this.store.getIdentity(item1) == this.store.getIdentity(item2)));
+ },
+
+ _removeAfter: function(/*Widget or int*/ idx){
+ // summary: removes all widgets after the given widget (or index)
+ if(typeof idx != "number"){
+ idx = this.getIndexOfChild(idx);
+ }
+ if(idx >= 0){
+ dojo.forEach(this.getChildren(), function(c, i){
+ if(i > idx){
+ this.removeChild(c);
+ c.destroyRecursive();
+ }
+ }, this);
+ }
+ var children = this.getChildren(), child = children[children.length - 1];
+ var selItem = null;
+ while(child && !selItem){
+ var val = child._getSelected ? child._getSelected() : null;
+ if(val){
+ selItem = val.item;
+ }
+ child = child.parentPane;
+ }
+ if(!this._setInProgress){
+ this._setValue(selItem);
+ }
+ },
+
+ addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
+ // summary: adds a child to this rolling list - if passed an insertIndex,
+ // then all children from that index on will be removed and destroyed
+ // before adding the child.
+ if(insertIndex > 0){
+ this._removeAfter(insertIndex - 1);
+ }
+ this.inherited(arguments);
+ if(!widget._started){
+ widget.startup();
+ }
+ widget.attr("minWidth", this.minPaneWidth);
+ this.layout();
+ if(!this._savedFocus){
+ widget.focus();
+ }
+ },
+
+ _setMinPaneWidthAttr: function(value){
+ // summary:
+ // Sets the min pane width of all children
+ if(value !== this.minPaneWidth){
+ this.minPaneWidth = value;
+ dojo.forEach(this.getChildren(), function(c){
+ c.attr("minWidth", value);
+ });
+ }
+ },
+
+ _updateClass: function(/* Node */ node, /* String */ type, /* Object? */ options){
+ // summary:
+ // sets the state of the given node with the given type and options
+ // options:
+ // an object with key-value-pairs. The values are boolean, if true,
+ // the key is added as a class, if false, it is removed.
+ if(!this._declaredClasses){
+ this._declaredClasses = ("dojoxRollingList " + this.className).split(" ");
+ }
+ dojo.forEach(this._declaredClasses, function(c){
+ if(c){
+ dojo.addClass(node, c + type);
+ for(var k in options||{}){
+ dojo.toggleClass(node, c + type + k, options[k]);
+ }
+ dojo.toggleClass(node, c + type + "FocusSelected",
+ (dojo.hasClass(node, c + type + "Focus") && dojo.hasClass(node, c + type + "Selected")));
+ dojo.toggleClass(node, c + type + "HoverSelected",
+ (dojo.hasClass(node, c + type + "Hover") && dojo.hasClass(node, c + type + "Selected")));
+ }
+ });
+ },
+
+ scrollIntoView: function(/*dijit._Widget*/ childWidget){
+ // summary: scrolls the given widget into view
+ if(this._scrollingTimeout){
+ window.clearTimeout(this._scrollingTimeout);
+ }
+ delete this._scrollingTimeout;
+ this._scrollingTimeout = window.setTimeout(dojo.hitch(this, function(){
+ if(childWidget.domNode){
+ dojo.window.scrollIntoView(childWidget.domNode);
+ }
+ delete this._scrollingTimeout;
+ return;
+ }), 1);
+ },
+
+ resize: function(args){
+ dijit.layout._LayoutWidget.prototype.resize.call(this, args);
+ },
+
+ layout: function(){
+ var children = this.getChildren();
+ if(this._contentBox){
+ var bn = this.buttonsNode;
+ var height = this._contentBox.h - dojo.marginBox(bn).h -
+ dojox.html.metrics.getScrollbar().h;
+ dojo.forEach(children, function(c){
+ dojo.marginBox(c.domNode, {h: height});
+ });
+ }
+ if(this._focusedPane){
+ var foc = this._focusedPane;
+ delete this._focusedPane;
+ if(!this._savedFocus){
+ foc.focus();
+ }
+ }else if(children && children.length){
+ if(!this._savedFocus){
+ children[0].focus();
+ }
+ }
+ },
+
+ _onChange: function(/*item*/ value){
+ this.onChange(value);
+ },
+
+ _setValue: function(/* item */ value){
+ // summary: internally sets the value and fires onchange
+ delete this._setInProgress;
+ if(!this._itemsMatch(this.value, value)){
+ this.value = value;
+ this._onChange(value);
+ }
+ },
+
+ _setValueAttr: function(/* item */ value){
+ // summary: sets the value of this widget to the given store item
+ if(this._itemsMatch(this.value, value) && !value){ return; }
+ if(this._setInProgress && this._setInProgress === value){ return; }
+ this._setInProgress = value;
+ if(!value || !this.store.isItem(value)){
+ var pane = this.getChildren()[0];
+ pane._setSelected(null);
+ this._onItemClick(null, pane, null, null);
+ return;
+ }
+
+ var fetchParentItems = dojo.hitch(this, function(/*item*/ item, /*function*/callback){
+ // Summary: Fetchs the parent items for the given item
+ var store = this.store, id;
+ if(this.parentAttr && store.getFeatures()["dojo.data.api.Identity"] &&
+ ((id = this.store.getValue(item, this.parentAttr)) || id === "")){
+ // Fetch by parent attribute
+ var cb = function(i){
+ if(store.getIdentity(i) == store.getIdentity(item)){
+ callback(null);
+ }else{
+ callback([i]);
+ }
+ };
+ if(id === ""){
+ callback(null);
+ }else if(typeof id == "string"){
+ store.fetchItemByIdentity({identity: id, onItem: cb});
+ }else if(store.isItem(id)){
+ cb(id);
+ }
+ }else{
+ // Fetch by finding children
+ var numCheck = this.childrenAttrs.length;
+ var parents = [];
+ dojo.forEach(this.childrenAttrs, function(attr){
+ var q = {};
+ q[attr] = item;
+ store.fetch({query: q, scope: this,
+ onComplete: function(items){
+ if(this._setInProgress !== value){
+ return;
+ }
+ parents = parents.concat(items);
+ numCheck--;
+ if(numCheck === 0){
+ callback(parents);
+ }
+ }
+ });
+ }, this);
+ }
+ });
+
+ var setFromChain = dojo.hitch(this, function(/*item[]*/itemChain, /*integer*/idx){
+ // Summary: Sets the value of the widget at the given index in the chain - onchanges are not
+ // fired here
+ var set = itemChain[idx];
+ var child = this.getChildren()[idx];
+ var conn;
+ if(set && child){
+ var fx = dojo.hitch(this, function(){
+ if(conn){
+ this.disconnect(conn);
+ }
+ delete conn;
+ if(this._setInProgress !== value){
+ return;
+ }
+ var selOpt = dojo.filter(child._menu.getChildren(), function(i){
+ return this._itemsMatch(i.item, set);
+ }, this)[0];
+ if(selOpt){
+ idx++;
+ child._menu.onItemClick(selOpt, {type: "internal",
+ stopPropagation: function(){},
+ preventDefault: function(){}});
+ if(itemChain[idx]){
+ setFromChain(itemChain, idx);
+ }else{
+ this._setValue(set);
+ this.onItemClick(set, child, this.getChildItems(set));
+ }
+ }
+ });
+ if(!child.isLoaded){
+ conn = this.connect(child, "onLoad", fx);
+ }else{
+ fx();
+ }
+ }else if(idx === 0){
+ this.set("value", null);
+ }
+ });
+
+ var parentChain = [];
+ var onParents = dojo.hitch(this, function(/*item[]*/ parents){
+ // Summary: recursively grabs the parents - only the first one is followed
+ if(parents && parents.length){
+ parentChain.push(parents[0]);
+ fetchParentItems(parents[0], onParents);
+ }else{
+ if(!parents){
+ parentChain.pop();
+ }
+ parentChain.reverse();
+ setFromChain(parentChain, 0);
+ }
+ });
+
+ // Only set the value in display if we are shown - if we are in a dropdown,
+ // and are hidden, don't actually do the scrolling in the display (it can
+ // mess up layouts)
+ var ns = this.domNode.style;
+ if(ns.display == "none" || ns.visibility == "hidden"){
+ this._setValue(value);
+ }else if(!this._itemsMatch(value, this._visibleItem)){
+ onParents([value]);
+ }
+ },
+
+ _onItemClick: function(/* Event */ evt, /* dijit._Contained */ pane, /* item */ item, /* item[]? */ children){
+ // summary: internally called when a widget should pop up its child
+
+ if(evt){
+ var itemPane = this._getPaneForItem(item, pane, children);
+ var alreadySelected = (evt.type == "click" && evt.alreadySelected);
+
+ if(alreadySelected && itemPane){
+ this._removeAfter(pane.getIndexInParent() + 1);
+ var next = pane.getNextSibling();
+ if(next && next._setSelected){
+ next._setSelected(null);
+ }
+ this.scrollIntoView(next);
+ }else if(itemPane){
+ this.addChild(itemPane, pane.getIndexInParent() + 1);
+ if(this._savedFocus){
+ itemPane.focus(true);
+ }
+ }else{
+ this._removeAfter(pane);
+ this.scrollIntoView(pane);
+ }
+ }else if(pane){
+ this._removeAfter(pane);
+ this.scrollIntoView(pane);
+ }
+ if(!evt || evt.type != "internal"){
+ this._setValue(item);
+ this.onItemClick(item, pane, children);
+ }
+ this._visibleItem = item;
+ },
+
+ _getPaneForItem: function(/* item? */ item, /* dijit._Contained? */ parentPane, /* item[]? */ children){ // summary: gets the pane for the given item, and mixes in our needed parts
+ // Returns the pane for the given item (null if the root pane) - after mixing in
+ // its stuff.
+ var ret = this.getPaneForItem(item, parentPane, children);
+ ret.store = this.store;
+ ret.parentWidget = this;
+ ret.parentPane = parentPane||null;
+ if(!item){
+ ret.query = this.query;
+ ret.queryOptions = this.queryOptions;
+ }else if(children){
+ ret.items = children;
+ }else{
+ ret.items = [item];
+ }
+ return ret;
+ },
+
+ _getMenuItemForItem: function(/*item*/ item, /* dijit._Contained */ parentPane){
+ // summary: returns a widget for the given store item. The returned
+ // item will be added to this widget's container widget. null will
+ // be passed in for an "empty" item.
+ var store = this.store;
+ if(!item || !store || !store.isItem(item)){
+ var i = new dijit.MenuItem({
+ label: "---",
+ disabled: true,
+ iconClass: "dojoxEmpty",
+ focus: function(){
+ // Do nothing on focus of this guy...
+ }
+ });
+ this._updateClass(i.domNode, "Item");
+ return i;
+ }else{
+ var itemLoaded = store.isItemLoaded(item);
+ var childItems = itemLoaded ? this.getChildItems(item) : undefined;
+ var widgetItem;
+ if(childItems){
+ widgetItem = this.getMenuItemForItem(item, parentPane, childItems);
+ widgetItem.children = childItems;
+ this._updateClass(widgetItem.domNode, "Item", {"Expanding": true});
+ if(!widgetItem._started){
+ var c = widgetItem.connect(widgetItem, "startup", function(){
+ this.disconnect(c);
+ dojo.style(this.arrowWrapper, "display", "");
+ });
+ }else{
+ dojo.style(widgetItem.arrowWrapper, "display", "");
+ }
+ }else{
+ widgetItem = this.getMenuItemForItem(item, parentPane, null);
+ if(itemLoaded){
+ this._updateClass(widgetItem.domNode, "Item", {"Single": true});
+ }else{
+ this._updateClass(widgetItem.domNode, "Item", {"Unloaded": true});
+ widgetItem.attr("disabled", true);
+ }
+ }
+ widgetItem.store = this.store;
+ widgetItem.item = item;
+ if(!widgetItem.label){
+ widgetItem.attr("label", this.store.getLabel(item).replace(/</,"<"));
+ }
+ if(widgetItem.focusNode){
+ var self = this;
+ widgetItem.focus = function(){
+ // Don't set our class
+ if(!this.disabled){try{this.focusNode.focus();}catch(e){}}
+ };
+ widgetItem.connect(widgetItem.focusNode, "onmouseenter", function(){
+ if(!this.disabled){
+ self._updateClass(this.domNode, "Item", {"Hover": true});
+ }
+ });
+ widgetItem.connect(widgetItem.focusNode, "onmouseleave", function(){
+ if(!this.disabled){
+ self._updateClass(this.domNode, "Item", {"Hover": false});
+ }
+ });
+ widgetItem.connect(widgetItem.focusNode, "blur", function(){
+ self._updateClass(this.domNode, "Item", {"Focus": false, "Hover": false});
+ });
+ widgetItem.connect(widgetItem.focusNode, "focus", function(){
+ self._updateClass(this.domNode, "Item", {"Focus": true});
+ self._focusedPane = parentPane;
+ });
+ if(this.executeOnDblClick){
+ widgetItem.connect(widgetItem.focusNode, "ondblclick", function(){
+ self._onExecute();
+ });
+ }
+ }
+ return widgetItem;
+ }
+ },
+
+ _setStore: function(/* dojo.data.api.Read */ store){
+ // summary: sets the store for this widget */
+ if(store === this.store && this._started){ return; }
+ this.store = store;
+ this._isIdentity = store.getFeatures()["dojo.data.api.Identity"];
+ var rootPane = this._getPaneForItem();
+ this.addChild(rootPane, 0);
+ },
+
+ _onKey: function(/*Event*/ e){
+ // summary: called when a keypress event happens on this widget
+ if(e.charOrCode == dojo.keys.BACKSPACE){
+ dojo.stopEvent(e);
+ return;
+ }else if(e.charOrCode == dojo.keys.ESCAPE && this._savedFocus){
+ try{dijit.focus(this._savedFocus);}catch(e){}
+ dojo.stopEvent(e);
+ return;
+ }else if(e.charOrCode == dojo.keys.LEFT_ARROW ||
+ e.charOrCode == dojo.keys.RIGHT_ARROW){
+ dojo.stopEvent(e);
+ return;
+ }
+ },
+
+ _resetValue: function(){
+ // Summary: function called when the value is reset.
+ this.set("value", this._lastExecutedValue);
+ },
+
+ _onCancel: function(){
+ // Summary: function called when the cancel button is clicked. It
+ // resets its value to whatever was last executed and then cancels
+ this._resetValue();
+ this.onCancel();
+ },
+
+ _onExecute: function(){
+ // Summary: function called when the OK button is clicked or when an
+ // item is selected (double-clicked or "enter" pressed on it)
+ this._lastExecutedValue = this.get("value");
+ this.onExecute();
+ },
+
+ focus: function(){
+ // summary: sets the focus state of this widget
+ var wasSaved = this._savedFocus;
+ this._savedFocus = dijit.getFocus(this);
+ if(!this._savedFocus.node){
+ delete this._savedFocus;
+ }
+ if(!this._focusedPane){
+ var child = this.getChildren()[0];
+ if(child && !wasSaved){
+ child.focus(true);
+ }
+ }else{
+ this._savedFocus = dijit.getFocus(this);
+ var foc = this._focusedPane;
+ delete this._focusedPane;
+ if(!wasSaved){
+ foc.focus(true);
+ }
+ }
+ },
+
+ handleKey:function(/*Event*/e){
+ // summary: handle the key for the given event - called by dropdown
+ // widgets
+ if(e.charOrCode == dojo.keys.DOWN_ARROW){
+ delete this._savedFocus;
+ this.focus();
+ return false;
+ }else if(e.charOrCode == dojo.keys.ESCAPE){
+ this._onCancel();
+ return false;
+ }
+ return true;
+ },
+
+ _updateChildClasses: function(){
+ // summary: Called when a child is added or removed - so that we can
+ // update the classes for styling the "current" one differently than
+ // the others
+ var children = this.getChildren();
+ var length = children.length;
+ dojo.forEach(children, function(c, idx){
+ dojo.toggleClass(c.domNode, "dojoxRollingListPaneCurrentChild", (idx == (length - 1)));
+ dojo.toggleClass(c.domNode, "dojoxRollingListPaneCurrentSelected", (idx == (length - 2)));
+ });
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ if(!this.getParent || !this.getParent()){
+ this.resize();
+ this.connect(dojo.global, "onresize", "resize");
+ }
+ this.connect(this, "addChild", "_updateChildClasses");
+ this.connect(this, "removeChild", "_updateChildClasses");
+ this._setStore(this.store);
+ this.set("showButtons", this.showButtons);
+ this.inherited(arguments);
+ this._lastExecutedValue = this.get("value");
+ },
+
+ getChildItems: function(/*item*/ item){
+ // summary: Returns the child items for the given store item
+ var childItems, store = this.store;
+ dojo.forEach(this.childrenAttrs, function(attr){
+ var vals = store.getValues(item, attr);
+ if(vals && vals.length){
+ childItems = (childItems||[]).concat(vals);
+ }
+ });
+ return childItems;
+ },
+
+ getMenuItemForItem: function(/*item*/ item, /* dijit._Contained */ parentPane, /* item[]? */ children){
+ // summary: user overridable function to return a widget for the given item
+ // and its children.
+ return new dijit.MenuItem({});
+ },
+
+ getPaneForItem: function(/* item? */ item, /* dijit._Contained? */ parentPane, /* item[]? */ children){
+ // summary: user-overridable function to return a pane that corresponds
+ // to the given item in the store. It can return null to not add a new pane
+ // (ie, you are planning on doing something else with it in onItemClick)
+ //
+ // Item is undefined for the root pane, children is undefined for non-group panes
+ if(!item || children){
+ return new dojox.widget._RollingListGroupPane({});
+ }else{
+ return null;
+ }
+ },
+
+ onItemClick: function(/* item */ item, /* dijit._Contained */ pane, /* item[]? */ children){
+ // summary: called when an item is clicked - it receives the store item
+ },
+
+ onExecute: function(){
+ // summary: exists so that popups don't disappear too soon
+ },
+
+ onCancel: function(){
+ // summary: exists so that we can close ourselves if we wish
+ },
+
+ onChange: function(/* item */ value){
+ // summary: called when the value of this widget has changed
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/RollingList.xd.js b/js/dojo-1.6/dojox/widget/RollingList.xd.js new file mode 100644 index 0000000..c6f6bdd --- /dev/null +++ b/js/dojo-1.6/dojox/widget/RollingList.xd.js @@ -0,0 +1,1228 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.RollingList"],
+["require", "dojo.window"],
+["require", "dijit.layout.ContentPane"],
+["require", "dijit._Templated"],
+["require", "dijit._Contained"],
+["require", "dijit.layout._LayoutWidget"],
+["require", "dijit.Menu"],
+["require", "dijit.form.Button"],
+["require", "dojox.html.metrics"],
+["require", "dojo.i18n"],
+["requireLocalization", "dijit", "common", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw", "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.RollingList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.RollingList"] = true;
+dojo.provide("dojox.widget.RollingList");
+dojo.experimental("dojox.widget.RollingList");
+
+dojo.require("dojo.window");
+
+dojo.require("dijit.layout.ContentPane");
+dojo.require("dijit._Templated");
+dojo.require("dijit._Contained");
+dojo.require("dijit.layout._LayoutWidget");
+dojo.require("dijit.Menu");
+dojo.require("dijit.form.Button");
+
+dojo.require("dojox.html.metrics");
+
+dojo.require("dojo.i18n");
+;
+
+dojo.declare("dojox.widget._RollingListPane",
+ [dijit.layout.ContentPane, dijit._Templated, dijit._Contained], {
+ // summary: a core pane that can be attached to a RollingList. All panes
+ // should extend this one
+
+ // templateString: string
+ // our template
+ templateString: '<div class="dojoxRollingListPane"><table><tbody><tr><td dojoAttachPoint="containerNode"></td></tr></tbody></div>',
+
+ // parentWidget: dojox.widget.RollingList
+ // Our rolling list widget
+ parentWidget: null,
+
+ // parentPane: dojox.widget._RollingListPane
+ // The pane that immediately precedes ours
+ parentPane: null,
+
+ // store: store
+ // the store we must use
+ store: null,
+
+ // items: item[]
+ // an array of (possibly not-yet-loaded) items to display in this.
+ // If this array is null, then the query and query options are used to
+ // get the top-level items to use. This array is also used to watch and
+ // see if the pane needs to be reloaded (store notifications are handled)
+ // by the pane
+ items: null,
+
+ // query: object
+ // a query to pass to the datastore. This is only used if items are null
+ query: null,
+
+ // queryOptions: object
+ // query options to be passed to the datastore
+ queryOptions: null,
+
+ // focusByNode: boolean
+ // set to false if the subclass will handle its own node focusing
+ _focusByNode: true,
+
+ // minWidth: integer
+ // the width (in px) for this pane
+ minWidth: 0,
+
+ _setContentAndScroll: function(/*String|DomNode|Nodelist*/cont, /*Boolean?*/isFakeContent){
+ // summary: sets the value of the content and scrolls it into view
+ this._setContent(cont, isFakeContent);
+ this.parentWidget.scrollIntoView(this);
+ },
+
+ _updateNodeWidth: function(n, min){
+ // summary: updates the min width of the pane to be minPaneWidth
+ n.style.width = "";
+ var nWidth = dojo.marginBox(n).w;
+ if(nWidth < min){
+ dojo.marginBox(n, {w: min});
+ }
+ },
+
+ _onMinWidthChange: function(v){
+ // Called when the min width of a pane has changed
+ this._updateNodeWidth(this.domNode, v);
+ },
+
+ _setMinWidthAttr: function(v){
+ if(v !== this.minWidth){
+ this.minWidth = v;
+ this._onMinWidthChange(v);
+ }
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ if(this.store && this.store.getFeatures()["dojo.data.api.Notification"]){
+ window.setTimeout(dojo.hitch(this, function(){
+ // Set connections after a slight timeout to avoid getting in the
+ // condition where we are setting them while events are still
+ // being fired
+ this.connect(this.store, "onSet", "_onSetItem");
+ this.connect(this.store, "onNew", "_onNewItem");
+ this.connect(this.store, "onDelete", "_onDeleteItem");
+ }), 1);
+ }
+ this.connect(this.focusNode||this.domNode, "onkeypress", "_focusKey");
+ this.parentWidget._updateClass(this.domNode, "Pane");
+ this.inherited(arguments);
+ this._onMinWidthChange(this.minWidth);
+ },
+
+ _focusKey: function(/*Event*/e){
+ // summary: called when a keypress happens on the widget
+ if(e.charOrCode == dojo.keys.BACKSPACE){
+ dojo.stopEvent(e);
+ return;
+ }else if(e.charOrCode == dojo.keys.LEFT_ARROW && this.parentPane){
+ this.parentPane.focus();
+ this.parentWidget.scrollIntoView(this.parentPane);
+ }else if(e.charOrCode == dojo.keys.ENTER){
+ this.parentWidget._onExecute();
+ }
+ },
+
+ focus: function(/*boolean*/force){
+ // summary: sets the focus to this current widget
+ if(this.parentWidget._focusedPane != this){
+ this.parentWidget._focusedPane = this;
+ this.parentWidget.scrollIntoView(this);
+ if(this._focusByNode && (!this.parentWidget._savedFocus || force)){
+ try{(this.focusNode||this.domNode).focus();}catch(e){}
+ }
+ }
+ },
+
+ _onShow: function(){
+ // summary: checks that the store is loaded
+ if((this.store || this.items) && ((this.refreshOnShow && this.domNode) || (!this.isLoaded && this.domNode))){
+ this.refresh();
+ }
+ },
+
+ _load: function(){
+ // summary: sets the "loading" message and then kicks off a query asyncronously
+ this.isLoaded = false;
+ if(this.items){
+ this._setContentAndScroll(this.onLoadStart(), true);
+ window.setTimeout(dojo.hitch(this, "_doQuery"), 1);
+ }else{
+ this._doQuery();
+ }
+ },
+
+ _doLoadItems: function(/*item[]*/items, /*function*/callback){
+ // summary: loads the given items, and then calls the callback when they
+ // are finished.
+ var _waitCount = 0, store = this.store;
+ dojo.forEach(items, function(item){
+ if(!store.isItemLoaded(item)){ _waitCount++; }
+ });
+ if(_waitCount === 0){
+ callback();
+ }else{
+ var onItem = function(item){
+ _waitCount--;
+ if((_waitCount) === 0){
+ callback();
+ }
+ };
+ dojo.forEach(items, function(item){
+ if(!store.isItemLoaded(item)){
+ store.loadItem({item: item, onItem: onItem});
+ }
+ });
+ }
+ },
+
+ _doQuery: function(){
+ // summary: either runs the query or loads potentially not-yet-loaded items.
+ if(!this.domNode){return;}
+ var preload = this.parentWidget.preloadItems;
+ preload = (preload === true || (this.items && this.items.length <= Number(preload)));
+ if(this.items && preload){
+ this._doLoadItems(this.items, dojo.hitch(this, "onItems"));
+ }else if(this.items){
+ this.onItems();
+ }else{
+ this._setContentAndScroll(this.onFetchStart(), true);
+ this.store.fetch({query: this.query,
+ onComplete: function(items){
+ this.items = items;
+ this.onItems();
+ },
+ onError: function(e){
+ this._onError("Fetch", e);
+ },
+ scope: this});
+ }
+ },
+
+ _hasItem: function(/* item */ item){
+ // summary: returns whether or not the given item is handled by this
+ // pane
+ var items = this.items || [];
+ for(var i = 0, myItem; (myItem = items[i]); i++){
+ if(this.parentWidget._itemsMatch(myItem, item)){
+ return true;
+ }
+ }
+ return false;
+ },
+
+ _onSetItem: function(/* item */ item,
+ /* attribute-name-string */ attribute,
+ /* object | array */ oldValue,
+ /* object | array */ newValue){
+ // Summary: called when an item in the store has changed
+ if(this._hasItem(item)){
+ this.refresh();
+ }
+ },
+
+ _onNewItem: function(/* item */ newItem, /*object?*/ parentInfo){
+ // Summary: called when an item is added to the store
+ var sel;
+ if((!parentInfo && !this.parentPane) ||
+ (parentInfo && this.parentPane && this.parentPane._hasItem(parentInfo.item) &&
+ (sel = this.parentPane._getSelected()) && this.parentWidget._itemsMatch(sel.item, parentInfo.item))){
+ this.items.push(newItem);
+ this.refresh();
+ }else if(parentInfo && this.parentPane && this._hasItem(parentInfo.item)){
+ this.refresh();
+ }
+ },
+
+ _onDeleteItem: function(/* item */ deletedItem){
+ // Summary: called when an item is removed from the store
+ if(this._hasItem(deletedItem)){
+ this.items = dojo.filter(this.items, function(i){
+ return (i != deletedItem);
+ });
+ this.refresh();
+ }
+ },
+
+ onFetchStart: function(){
+ // summary:
+ // called before a fetch starts
+ return this.loadingMessage;
+ },
+
+ onFetchError: function(/*Error*/ error){
+ // summary:
+ // called when a fetch error occurs.
+ return this.errorMessage;
+ },
+
+ onLoadStart: function(){
+ // summary:
+ // called before a load starts
+ return this.loadingMessage;
+ },
+
+ onLoadError: function(/*Error*/ error){
+ // summary:
+ // called when a load error occurs.
+ return this.errorMessage;
+ },
+
+ onItems: function(){
+ // summary:
+ // called after a fetch or load - at this point, this.items should be
+ // set and loaded. Override this function to "do your stuff"
+ if(!this.onLoadDeferred){
+ this.cancel();
+ this.onLoadDeferred = new dojo.Deferred(dojo.hitch(this, "cancel"));
+ }
+ this._onLoadHandler();
+ }
+
+});
+
+dojo.declare("dojox.widget._RollingListGroupPane",
+ [dojox.widget._RollingListPane], {
+ // summary: a pane that will handle groups (treats them as menu items)
+
+ // templateString: string
+ // our template
+ templateString: '<div><div dojoAttachPoint="containerNode"></div>' +
+ '<div dojoAttachPoint="menuContainer">' +
+ '<div dojoAttachPoint="menuNode"></div>' +
+ '</div></div>',
+
+ // _menu: dijit.Menu
+ // The menu that we will call addChild() on for adding items
+ _menu: null,
+
+ _setContent: function(/*String|DomNode|Nodelist*/cont){
+ if(!this._menu){
+ // Only set the content if we don't already have a menu
+ this.inherited(arguments);
+ }
+ },
+
+ _onMinWidthChange: function(v){
+ // override and resize the menu instead
+ if(!this._menu){ return; }
+ var dWidth = dojo.marginBox(this.domNode).w;
+ var mWidth = dojo.marginBox(this._menu.domNode).w;
+ this._updateNodeWidth(this._menu.domNode, v - (dWidth - mWidth));
+ },
+
+ onItems: function(){
+ // summary:
+ // called after a fetch or load
+ var selectItem, hadChildren = false;
+ if(this._menu){
+ selectItem = this._getSelected();
+ this._menu.destroyRecursive();
+ }
+ this._menu = this._getMenu();
+ var child, selectMenuItem;
+ if(this.items.length){
+ dojo.forEach(this.items, function(item){
+ child = this.parentWidget._getMenuItemForItem(item, this);
+ if(child){
+ if(selectItem && this.parentWidget._itemsMatch(child.item, selectItem.item)){
+ selectMenuItem = child;
+ }
+ this._menu.addChild(child);
+ }
+ }, this);
+ }else{
+ child = this.parentWidget._getMenuItemForItem(null, this);
+ if(child){
+ this._menu.addChild(child);
+ }
+ }
+ if(selectMenuItem){
+ this._setSelected(selectMenuItem);
+ if((selectItem && !selectItem.children && selectMenuItem.children) ||
+ (selectItem && selectItem.children && !selectMenuItem.children)){
+ var itemPane = this.parentWidget._getPaneForItem(selectMenuItem.item, this, selectMenuItem.children);
+ if(itemPane){
+ this.parentWidget.addChild(itemPane, this.getIndexInParent() + 1);
+ }else{
+ this.parentWidget._removeAfter(this);
+ this.parentWidget._onItemClick(null, this, selectMenuItem.item, selectMenuItem.children);
+ }
+ }
+ }else if(selectItem){
+ this.parentWidget._removeAfter(this);
+ }
+ this.containerNode.innerHTML = "";
+ this.containerNode.appendChild(this._menu.domNode);
+ this.parentWidget.scrollIntoView(this);
+ this._checkScrollConnection(true);
+ this.inherited(arguments);
+ this._onMinWidthChange(this.minWidth);
+ },
+
+ _checkScrollConnection: function(doLoad){
+ // summary: checks whether or not we need to connect to our onscroll
+ // function
+ var store = this.store
+ if(this._scrollConn){
+ this.disconnect(this._scrollConn);
+ }
+ delete this._scrollConn;
+ if(!dojo.every(this.items, function(i){return store.isItemLoaded(i);})){
+ if(doLoad){
+ this._loadVisibleItems();
+ }
+ this._scrollConn = this.connect(this.domNode, "onscroll", "_onScrollPane");
+ }
+ },
+
+ startup: function(){
+ this.inherited(arguments);
+ this.parentWidget._updateClass(this.domNode, "GroupPane");
+ },
+
+ focus: function(/*boolean*/force){
+ // summary: sets the focus to this current widget
+ if(this._menu){
+ if(this._pendingFocus){
+ this.disconnect(this._pendingFocus);
+ }
+ delete this._pendingFocus;
+
+ // We focus the right widget - either the focusedChild, the
+ // selected node, the first menu item, or the menu itself
+ var focusWidget = this._menu.focusedChild;
+ if(!focusWidget){
+ var focusNode = dojo.query(".dojoxRollingListItemSelected", this.domNode)[0];
+ if(focusNode){
+ focusWidget = dijit.byNode(focusNode);
+ }
+ }
+ if(!focusWidget){
+ focusWidget = this._menu.getChildren()[0] || this._menu;
+ }
+ this._focusByNode = false;
+ if(focusWidget.focusNode){
+ if(!this.parentWidget._savedFocus || force){
+ try{focusWidget.focusNode.focus();}catch(e){}
+ }
+ window.setTimeout(function(){
+ try{
+ dojo.window.scrollIntoView(focusWidget.focusNode);
+ }catch(e){}
+ }, 1);
+ }else if(focusWidget.focus){
+ if(!this.parentWidget._savedFocus || force){
+ focusWidget.focus();
+ }
+ }else{
+ this._focusByNode = true;
+ }
+ this.inherited(arguments);
+ }else if(!this._pendingFocus){
+ this._pendingFocus = this.connect(this, "onItems", "focus");
+ }
+ },
+
+ _getMenu: function(){
+ // summary: returns a widget to be used for the container widget.
+ var self = this;
+ var menu = new dijit.Menu({
+ parentMenu: this.parentPane ? this.parentPane._menu : null,
+ onCancel: function(/*Boolean*/ closeAll){
+ if(self.parentPane){
+ self.parentPane.focus(true);
+ }
+ },
+ _moveToPopup: function(/*Event*/ evt){
+ if(this.focusedChild && !this.focusedChild.disabled){
+ this.focusedChild._onClick(evt);
+ }
+ }
+ }, this.menuNode);
+ this.connect(menu, "onItemClick", function(/*dijit.MenuItem*/ item, /*Event*/ evt){
+ if(item.disabled){ return; }
+ evt.alreadySelected = dojo.hasClass(item.domNode, "dojoxRollingListItemSelected");
+ if(evt.alreadySelected &&
+ ((evt.type == "keypress" && evt.charOrCode != dojo.keys.ENTER) ||
+ (evt.type == "internal"))){
+ var p = this.parentWidget.getChildren()[this.getIndexInParent() + 1];
+ if(p){
+ p.focus(true);
+ this.parentWidget.scrollIntoView(p);
+ }
+ }else{
+ this._setSelected(item, menu);
+ this.parentWidget._onItemClick(evt, this, item.item, item.children);
+ if(evt.type == "keypress" && evt.charOrCode == dojo.keys.ENTER){
+ this.parentWidget._onExecute();
+ }
+ }
+ });
+ if(!menu._started){
+ menu.startup();
+ }
+ return menu;
+ },
+
+ _onScrollPane: function(){
+ // summary: called when the pane has been scrolled - it sets a timeout
+ // so that we don't try and load our visible items too often during
+ // a scroll
+ if(this._visibleLoadPending){
+ window.clearTimeout(this._visibleLoadPending);
+ }
+ this._visibleLoadPending = window.setTimeout(dojo.hitch(this, "_loadVisibleItems"), 500);
+ },
+
+ _loadVisibleItems: function(){
+ // summary: loads the items that are currently visible in the pane
+ delete this._visibleLoadPending
+ var menu = this._menu;
+ if(!menu){ return; }
+ var children = menu.getChildren();
+ if(!children || !children.length){ return; }
+ var gpbme = function(n, m, pb){
+ var s = dojo.getComputedStyle(n);
+ var r = 0;
+ if(m){ r += dojo._getMarginExtents(n, s).t; }
+ if(pb){ r += dojo._getPadBorderExtents(n, s).t; }
+ return r;
+ };
+ var topOffset = gpbme(this.domNode, false, true) +
+ gpbme(this.containerNode, true, true) +
+ gpbme(menu.domNode, true, true) +
+ gpbme(children[0].domNode, true, false);
+ var h = dojo.contentBox(this.domNode).h;
+ var minOffset = this.domNode.scrollTop - topOffset - (h/2);
+ var maxOffset = minOffset + (3*h/2);
+ var menuItemsToLoad = dojo.filter(children, function(c){
+ var cnt = c.domNode.offsetTop;
+ var s = c.store;
+ var i = c.item;
+ return (cnt >= minOffset && cnt <= maxOffset && !s.isItemLoaded(i));
+ })
+ var itemsToLoad = dojo.map(menuItemsToLoad, function(c){
+ return c.item;
+ });
+ var onItems = dojo.hitch(this, function(){
+ var selectItem = this._getSelected();
+ var selectMenuItem;
+ dojo.forEach(itemsToLoad, function(item, idx){
+ var newItem = this.parentWidget._getMenuItemForItem(item, this);
+ var oItem = menuItemsToLoad[idx];
+ var oIdx = oItem.getIndexInParent();
+ menu.removeChild(oItem);
+ if(newItem){
+ if(selectItem && this.parentWidget._itemsMatch(newItem.item, selectItem.item)){
+ selectMenuItem = newItem;
+ }
+ menu.addChild(newItem, oIdx);
+ if(menu.focusedChild == oItem){
+ menu.focusChild(newItem);
+ }
+ }
+ oItem.destroy();
+ }, this);
+ this._checkScrollConnection(false);
+ });
+ this._doLoadItems(itemsToLoad, onItems);
+ },
+
+ _getSelected: function(/*dijit.Menu?*/ menu){
+ // summary:
+ // returns the selected menu item - or null if none are selected
+ if(!menu){ menu = this._menu; }
+ if(menu){
+ var children = this._menu.getChildren();
+ for(var i = 0, item; (item = children[i]); i++){
+ if(dojo.hasClass(item.domNode, "dojoxRollingListItemSelected")){
+ return item;
+ }
+ }
+ }
+ return null;
+ },
+
+ _setSelected: function(/*dijit.MenuItem?*/ item, /*dijit.Menu?*/ menu){
+ // summary:
+ // selectes the given item in the given menu (defaults to pane's menu)
+ if(!menu){ menu = this._menu;}
+ if(menu){
+ dojo.forEach(menu.getChildren(), function(i){
+ this.parentWidget._updateClass(i.domNode, "Item", {"Selected": (item && (i == item && !i.disabled))});
+ }, this);
+ }
+ }
+});
+
+dojo.declare("dojox.widget.RollingList",
+ [dijit._Widget, dijit._Templated, dijit._Container], {
+ // summary: a rolling list that can be tied to a data store with children
+
+ // templateString: String
+ // The template to be used to construct the widget.
+ templateString: dojo.cache("dojox.widget", "RollingList/RollingList.html", "<div class=\"dojoxRollingList ${className}\"\r\n\t><div class=\"dojoxRollingListContainer\" dojoAttachPoint=\"containerNode\" dojoAttachEvent=\"onkeypress:_onKey\"\r\n\t></div\r\n\t><div class=\"dojoxRollingListButtons\" dojoAttachPoint=\"buttonsNode\"\r\n ><button dojoType=\"dijit.form.Button\" dojoAttachPoint=\"okButton\"\r\n\t\t\t\tdojoAttachEvent=\"onClick:_onExecute\">${okButtonLabel}</button\r\n ><button dojoType=\"dijit.form.Button\" dojoAttachPoint=\"cancelButton\"\r\n\t\t\t\tdojoAttachEvent=\"onClick:_onCancel\">${cancelButtonLabel}</button\r\n\t></div\r\n></div>\r\n"),
+ widgetsInTemplate: true,
+
+ // className: string
+ // an additional class (or space-separated classes) to add for our widget
+ className: "",
+
+ // store: store
+ // the store we must use
+ store: null,
+
+ // query: object
+ // a query to pass to the datastore. This is only used if items are null
+ query: null,
+
+ // queryOptions: object
+ // query options to be passed to the datastore
+ queryOptions: null,
+
+ // childrenAttrs: String[]
+ // one ore more attributes that holds children of a node
+ childrenAttrs: ["children"],
+
+ // parentAttr: string
+ // the attribute to read for finding our parent item (if any)
+ parentAttr: "",
+
+ // value: item
+ // The value that has been selected
+ value: null,
+
+ // executeOnDblClick: boolean
+ // Set to true if you want to call onExecute when an item is
+ // double-clicked, false if you want to call onExecute yourself. (mainly
+ // used for popups to control how they want to be handled)
+ executeOnDblClick: true,
+
+ // preloadItems: boolean or int
+ // if set to true, then onItems will be called only *after* all items have
+ // been loaded (ie store.isLoaded will return true for all of them). If
+ // false, then no preloading will occur. If set to an integer, preloading
+ // will occur if the number of items is less than or equal to the value
+ // of the integer. The onItems function will need to be aware of handling
+ // items that may not be loaded
+ preloadItems: false,
+
+ // showButtons: boolean
+ // if set to true, then buttons for "OK" and "Cancel" will be provided
+ showButtons: false,
+
+ // okButtonLabel: string
+ // The string to use for the OK button - will use dijit's common "OK" string
+ // if not set
+ okButtonLabel: "",
+
+ // cancelButtonLabel: string
+ // The string to use for the Cancel button - will use dijit's common
+ // "Cancel" string if not set
+ cancelButtonLabel: "",
+
+ // minPaneWidth: integer
+ // the minimum pane width (in px) for all child panes. If they are narrower,
+ // the width will be increased to this value.
+ minPaneWidth: 0,
+
+ postMixInProperties: function(){
+ // summary: Mix in our labels, if they are not set
+ this.inherited(arguments);
+ var loc = dojo.i18n.getLocalization("dijit", "common");
+ this.okButtonLabel = this.okButtonLabel || loc.buttonOk;
+ this.cancelButtonLabel = this.cancelButtonLabel || loc.buttonCancel;
+ },
+
+ _setShowButtonsAttr: function(doShow){
+ // summary: Sets the visibility of the buttons for the widget
+ var needsLayout = false;
+ if((this.showButtons != doShow && this._started) ||
+ (this.showButtons == doShow && !this.started)){
+ needsLayout = true;
+ }
+ dojo.toggleClass(this.domNode, "dojoxRollingListButtonsHidden", !doShow);
+ this.showButtons = doShow;
+ if(needsLayout){
+ if(this._started){
+ this.layout();
+ }else{
+ window.setTimeout(dojo.hitch(this, "layout"), 0);
+ }
+ }
+ },
+
+ _itemsMatch: function(/*item*/ item1, /*item*/ item2){
+ // Summary: returns whether or not the two items match - checks ID if
+ // they aren't the exact same object
+ if(!item1 && !item2){
+ return true;
+ }else if(!item1 || !item2){
+ return false;
+ }
+ return (item1 == item2 ||
+ (this._isIdentity && this.store.getIdentity(item1) == this.store.getIdentity(item2)));
+ },
+
+ _removeAfter: function(/*Widget or int*/ idx){
+ // summary: removes all widgets after the given widget (or index)
+ if(typeof idx != "number"){
+ idx = this.getIndexOfChild(idx);
+ }
+ if(idx >= 0){
+ dojo.forEach(this.getChildren(), function(c, i){
+ if(i > idx){
+ this.removeChild(c);
+ c.destroyRecursive();
+ }
+ }, this);
+ }
+ var children = this.getChildren(), child = children[children.length - 1];
+ var selItem = null;
+ while(child && !selItem){
+ var val = child._getSelected ? child._getSelected() : null;
+ if(val){
+ selItem = val.item;
+ }
+ child = child.parentPane;
+ }
+ if(!this._setInProgress){
+ this._setValue(selItem);
+ }
+ },
+
+ addChild: function(/*dijit._Widget*/ widget, /*int?*/ insertIndex){
+ // summary: adds a child to this rolling list - if passed an insertIndex,
+ // then all children from that index on will be removed and destroyed
+ // before adding the child.
+ if(insertIndex > 0){
+ this._removeAfter(insertIndex - 1);
+ }
+ this.inherited(arguments);
+ if(!widget._started){
+ widget.startup();
+ }
+ widget.attr("minWidth", this.minPaneWidth);
+ this.layout();
+ if(!this._savedFocus){
+ widget.focus();
+ }
+ },
+
+ _setMinPaneWidthAttr: function(value){
+ // summary:
+ // Sets the min pane width of all children
+ if(value !== this.minPaneWidth){
+ this.minPaneWidth = value;
+ dojo.forEach(this.getChildren(), function(c){
+ c.attr("minWidth", value);
+ });
+ }
+ },
+
+ _updateClass: function(/* Node */ node, /* String */ type, /* Object? */ options){
+ // summary:
+ // sets the state of the given node with the given type and options
+ // options:
+ // an object with key-value-pairs. The values are boolean, if true,
+ // the key is added as a class, if false, it is removed.
+ if(!this._declaredClasses){
+ this._declaredClasses = ("dojoxRollingList " + this.className).split(" ");
+ }
+ dojo.forEach(this._declaredClasses, function(c){
+ if(c){
+ dojo.addClass(node, c + type);
+ for(var k in options||{}){
+ dojo.toggleClass(node, c + type + k, options[k]);
+ }
+ dojo.toggleClass(node, c + type + "FocusSelected",
+ (dojo.hasClass(node, c + type + "Focus") && dojo.hasClass(node, c + type + "Selected")));
+ dojo.toggleClass(node, c + type + "HoverSelected",
+ (dojo.hasClass(node, c + type + "Hover") && dojo.hasClass(node, c + type + "Selected")));
+ }
+ });
+ },
+
+ scrollIntoView: function(/*dijit._Widget*/ childWidget){
+ // summary: scrolls the given widget into view
+ if(this._scrollingTimeout){
+ window.clearTimeout(this._scrollingTimeout);
+ }
+ delete this._scrollingTimeout;
+ this._scrollingTimeout = window.setTimeout(dojo.hitch(this, function(){
+ if(childWidget.domNode){
+ dojo.window.scrollIntoView(childWidget.domNode);
+ }
+ delete this._scrollingTimeout;
+ return;
+ }), 1);
+ },
+
+ resize: function(args){
+ dijit.layout._LayoutWidget.prototype.resize.call(this, args);
+ },
+
+ layout: function(){
+ var children = this.getChildren();
+ if(this._contentBox){
+ var bn = this.buttonsNode;
+ var height = this._contentBox.h - dojo.marginBox(bn).h -
+ dojox.html.metrics.getScrollbar().h;
+ dojo.forEach(children, function(c){
+ dojo.marginBox(c.domNode, {h: height});
+ });
+ }
+ if(this._focusedPane){
+ var foc = this._focusedPane;
+ delete this._focusedPane;
+ if(!this._savedFocus){
+ foc.focus();
+ }
+ }else if(children && children.length){
+ if(!this._savedFocus){
+ children[0].focus();
+ }
+ }
+ },
+
+ _onChange: function(/*item*/ value){
+ this.onChange(value);
+ },
+
+ _setValue: function(/* item */ value){
+ // summary: internally sets the value and fires onchange
+ delete this._setInProgress;
+ if(!this._itemsMatch(this.value, value)){
+ this.value = value;
+ this._onChange(value);
+ }
+ },
+
+ _setValueAttr: function(/* item */ value){
+ // summary: sets the value of this widget to the given store item
+ if(this._itemsMatch(this.value, value) && !value){ return; }
+ if(this._setInProgress && this._setInProgress === value){ return; }
+ this._setInProgress = value;
+ if(!value || !this.store.isItem(value)){
+ var pane = this.getChildren()[0];
+ pane._setSelected(null);
+ this._onItemClick(null, pane, null, null);
+ return;
+ }
+
+ var fetchParentItems = dojo.hitch(this, function(/*item*/ item, /*function*/callback){
+ // Summary: Fetchs the parent items for the given item
+ var store = this.store, id;
+ if(this.parentAttr && store.getFeatures()["dojo.data.api.Identity"] &&
+ ((id = this.store.getValue(item, this.parentAttr)) || id === "")){
+ // Fetch by parent attribute
+ var cb = function(i){
+ if(store.getIdentity(i) == store.getIdentity(item)){
+ callback(null);
+ }else{
+ callback([i]);
+ }
+ };
+ if(id === ""){
+ callback(null);
+ }else if(typeof id == "string"){
+ store.fetchItemByIdentity({identity: id, onItem: cb});
+ }else if(store.isItem(id)){
+ cb(id);
+ }
+ }else{
+ // Fetch by finding children
+ var numCheck = this.childrenAttrs.length;
+ var parents = [];
+ dojo.forEach(this.childrenAttrs, function(attr){
+ var q = {};
+ q[attr] = item;
+ store.fetch({query: q, scope: this,
+ onComplete: function(items){
+ if(this._setInProgress !== value){
+ return;
+ }
+ parents = parents.concat(items);
+ numCheck--;
+ if(numCheck === 0){
+ callback(parents);
+ }
+ }
+ });
+ }, this);
+ }
+ });
+
+ var setFromChain = dojo.hitch(this, function(/*item[]*/itemChain, /*integer*/idx){
+ // Summary: Sets the value of the widget at the given index in the chain - onchanges are not
+ // fired here
+ var set = itemChain[idx];
+ var child = this.getChildren()[idx];
+ var conn;
+ if(set && child){
+ var fx = dojo.hitch(this, function(){
+ if(conn){
+ this.disconnect(conn);
+ }
+ delete conn;
+ if(this._setInProgress !== value){
+ return;
+ }
+ var selOpt = dojo.filter(child._menu.getChildren(), function(i){
+ return this._itemsMatch(i.item, set);
+ }, this)[0];
+ if(selOpt){
+ idx++;
+ child._menu.onItemClick(selOpt, {type: "internal",
+ stopPropagation: function(){},
+ preventDefault: function(){}});
+ if(itemChain[idx]){
+ setFromChain(itemChain, idx);
+ }else{
+ this._setValue(set);
+ this.onItemClick(set, child, this.getChildItems(set));
+ }
+ }
+ });
+ if(!child.isLoaded){
+ conn = this.connect(child, "onLoad", fx);
+ }else{
+ fx();
+ }
+ }else if(idx === 0){
+ this.set("value", null);
+ }
+ });
+
+ var parentChain = [];
+ var onParents = dojo.hitch(this, function(/*item[]*/ parents){
+ // Summary: recursively grabs the parents - only the first one is followed
+ if(parents && parents.length){
+ parentChain.push(parents[0]);
+ fetchParentItems(parents[0], onParents);
+ }else{
+ if(!parents){
+ parentChain.pop();
+ }
+ parentChain.reverse();
+ setFromChain(parentChain, 0);
+ }
+ });
+
+ // Only set the value in display if we are shown - if we are in a dropdown,
+ // and are hidden, don't actually do the scrolling in the display (it can
+ // mess up layouts)
+ var ns = this.domNode.style;
+ if(ns.display == "none" || ns.visibility == "hidden"){
+ this._setValue(value);
+ }else if(!this._itemsMatch(value, this._visibleItem)){
+ onParents([value]);
+ }
+ },
+
+ _onItemClick: function(/* Event */ evt, /* dijit._Contained */ pane, /* item */ item, /* item[]? */ children){
+ // summary: internally called when a widget should pop up its child
+
+ if(evt){
+ var itemPane = this._getPaneForItem(item, pane, children);
+ var alreadySelected = (evt.type == "click" && evt.alreadySelected);
+
+ if(alreadySelected && itemPane){
+ this._removeAfter(pane.getIndexInParent() + 1);
+ var next = pane.getNextSibling();
+ if(next && next._setSelected){
+ next._setSelected(null);
+ }
+ this.scrollIntoView(next);
+ }else if(itemPane){
+ this.addChild(itemPane, pane.getIndexInParent() + 1);
+ if(this._savedFocus){
+ itemPane.focus(true);
+ }
+ }else{
+ this._removeAfter(pane);
+ this.scrollIntoView(pane);
+ }
+ }else if(pane){
+ this._removeAfter(pane);
+ this.scrollIntoView(pane);
+ }
+ if(!evt || evt.type != "internal"){
+ this._setValue(item);
+ this.onItemClick(item, pane, children);
+ }
+ this._visibleItem = item;
+ },
+
+ _getPaneForItem: function(/* item? */ item, /* dijit._Contained? */ parentPane, /* item[]? */ children){ // summary: gets the pane for the given item, and mixes in our needed parts
+ // Returns the pane for the given item (null if the root pane) - after mixing in
+ // its stuff.
+ var ret = this.getPaneForItem(item, parentPane, children);
+ ret.store = this.store;
+ ret.parentWidget = this;
+ ret.parentPane = parentPane||null;
+ if(!item){
+ ret.query = this.query;
+ ret.queryOptions = this.queryOptions;
+ }else if(children){
+ ret.items = children;
+ }else{
+ ret.items = [item];
+ }
+ return ret;
+ },
+
+ _getMenuItemForItem: function(/*item*/ item, /* dijit._Contained */ parentPane){
+ // summary: returns a widget for the given store item. The returned
+ // item will be added to this widget's container widget. null will
+ // be passed in for an "empty" item.
+ var store = this.store;
+ if(!item || !store || !store.isItem(item)){
+ var i = new dijit.MenuItem({
+ label: "---",
+ disabled: true,
+ iconClass: "dojoxEmpty",
+ focus: function(){
+ // Do nothing on focus of this guy...
+ }
+ });
+ this._updateClass(i.domNode, "Item");
+ return i;
+ }else{
+ var itemLoaded = store.isItemLoaded(item);
+ var childItems = itemLoaded ? this.getChildItems(item) : undefined;
+ var widgetItem;
+ if(childItems){
+ widgetItem = this.getMenuItemForItem(item, parentPane, childItems);
+ widgetItem.children = childItems;
+ this._updateClass(widgetItem.domNode, "Item", {"Expanding": true});
+ if(!widgetItem._started){
+ var c = widgetItem.connect(widgetItem, "startup", function(){
+ this.disconnect(c);
+ dojo.style(this.arrowWrapper, "display", "");
+ });
+ }else{
+ dojo.style(widgetItem.arrowWrapper, "display", "");
+ }
+ }else{
+ widgetItem = this.getMenuItemForItem(item, parentPane, null);
+ if(itemLoaded){
+ this._updateClass(widgetItem.domNode, "Item", {"Single": true});
+ }else{
+ this._updateClass(widgetItem.domNode, "Item", {"Unloaded": true});
+ widgetItem.attr("disabled", true);
+ }
+ }
+ widgetItem.store = this.store;
+ widgetItem.item = item;
+ if(!widgetItem.label){
+ widgetItem.attr("label", this.store.getLabel(item).replace(/</,"<"));
+ }
+ if(widgetItem.focusNode){
+ var self = this;
+ widgetItem.focus = function(){
+ // Don't set our class
+ if(!this.disabled){try{this.focusNode.focus();}catch(e){}}
+ };
+ widgetItem.connect(widgetItem.focusNode, "onmouseenter", function(){
+ if(!this.disabled){
+ self._updateClass(this.domNode, "Item", {"Hover": true});
+ }
+ });
+ widgetItem.connect(widgetItem.focusNode, "onmouseleave", function(){
+ if(!this.disabled){
+ self._updateClass(this.domNode, "Item", {"Hover": false});
+ }
+ });
+ widgetItem.connect(widgetItem.focusNode, "blur", function(){
+ self._updateClass(this.domNode, "Item", {"Focus": false, "Hover": false});
+ });
+ widgetItem.connect(widgetItem.focusNode, "focus", function(){
+ self._updateClass(this.domNode, "Item", {"Focus": true});
+ self._focusedPane = parentPane;
+ });
+ if(this.executeOnDblClick){
+ widgetItem.connect(widgetItem.focusNode, "ondblclick", function(){
+ self._onExecute();
+ });
+ }
+ }
+ return widgetItem;
+ }
+ },
+
+ _setStore: function(/* dojo.data.api.Read */ store){
+ // summary: sets the store for this widget */
+ if(store === this.store && this._started){ return; }
+ this.store = store;
+ this._isIdentity = store.getFeatures()["dojo.data.api.Identity"];
+ var rootPane = this._getPaneForItem();
+ this.addChild(rootPane, 0);
+ },
+
+ _onKey: function(/*Event*/ e){
+ // summary: called when a keypress event happens on this widget
+ if(e.charOrCode == dojo.keys.BACKSPACE){
+ dojo.stopEvent(e);
+ return;
+ }else if(e.charOrCode == dojo.keys.ESCAPE && this._savedFocus){
+ try{dijit.focus(this._savedFocus);}catch(e){}
+ dojo.stopEvent(e);
+ return;
+ }else if(e.charOrCode == dojo.keys.LEFT_ARROW ||
+ e.charOrCode == dojo.keys.RIGHT_ARROW){
+ dojo.stopEvent(e);
+ return;
+ }
+ },
+
+ _resetValue: function(){
+ // Summary: function called when the value is reset.
+ this.set("value", this._lastExecutedValue);
+ },
+
+ _onCancel: function(){
+ // Summary: function called when the cancel button is clicked. It
+ // resets its value to whatever was last executed and then cancels
+ this._resetValue();
+ this.onCancel();
+ },
+
+ _onExecute: function(){
+ // Summary: function called when the OK button is clicked or when an
+ // item is selected (double-clicked or "enter" pressed on it)
+ this._lastExecutedValue = this.get("value");
+ this.onExecute();
+ },
+
+ focus: function(){
+ // summary: sets the focus state of this widget
+ var wasSaved = this._savedFocus;
+ this._savedFocus = dijit.getFocus(this);
+ if(!this._savedFocus.node){
+ delete this._savedFocus;
+ }
+ if(!this._focusedPane){
+ var child = this.getChildren()[0];
+ if(child && !wasSaved){
+ child.focus(true);
+ }
+ }else{
+ this._savedFocus = dijit.getFocus(this);
+ var foc = this._focusedPane;
+ delete this._focusedPane;
+ if(!wasSaved){
+ foc.focus(true);
+ }
+ }
+ },
+
+ handleKey:function(/*Event*/e){
+ // summary: handle the key for the given event - called by dropdown
+ // widgets
+ if(e.charOrCode == dojo.keys.DOWN_ARROW){
+ delete this._savedFocus;
+ this.focus();
+ return false;
+ }else if(e.charOrCode == dojo.keys.ESCAPE){
+ this._onCancel();
+ return false;
+ }
+ return true;
+ },
+
+ _updateChildClasses: function(){
+ // summary: Called when a child is added or removed - so that we can
+ // update the classes for styling the "current" one differently than
+ // the others
+ var children = this.getChildren();
+ var length = children.length;
+ dojo.forEach(children, function(c, idx){
+ dojo.toggleClass(c.domNode, "dojoxRollingListPaneCurrentChild", (idx == (length - 1)));
+ dojo.toggleClass(c.domNode, "dojoxRollingListPaneCurrentSelected", (idx == (length - 2)));
+ });
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ if(!this.getParent || !this.getParent()){
+ this.resize();
+ this.connect(dojo.global, "onresize", "resize");
+ }
+ this.connect(this, "addChild", "_updateChildClasses");
+ this.connect(this, "removeChild", "_updateChildClasses");
+ this._setStore(this.store);
+ this.set("showButtons", this.showButtons);
+ this.inherited(arguments);
+ this._lastExecutedValue = this.get("value");
+ },
+
+ getChildItems: function(/*item*/ item){
+ // summary: Returns the child items for the given store item
+ var childItems, store = this.store;
+ dojo.forEach(this.childrenAttrs, function(attr){
+ var vals = store.getValues(item, attr);
+ if(vals && vals.length){
+ childItems = (childItems||[]).concat(vals);
+ }
+ });
+ return childItems;
+ },
+
+ getMenuItemForItem: function(/*item*/ item, /* dijit._Contained */ parentPane, /* item[]? */ children){
+ // summary: user overridable function to return a widget for the given item
+ // and its children.
+ return new dijit.MenuItem({});
+ },
+
+ getPaneForItem: function(/* item? */ item, /* dijit._Contained? */ parentPane, /* item[]? */ children){
+ // summary: user-overridable function to return a pane that corresponds
+ // to the given item in the store. It can return null to not add a new pane
+ // (ie, you are planning on doing something else with it in onItemClick)
+ //
+ // Item is undefined for the root pane, children is undefined for non-group panes
+ if(!item || children){
+ return new dojox.widget._RollingListGroupPane({});
+ }else{
+ return null;
+ }
+ },
+
+ onItemClick: function(/* item */ item, /* dijit._Contained */ pane, /* item[]? */ children){
+ // summary: called when an item is clicked - it receives the store item
+ },
+
+ onExecute: function(){
+ // summary: exists so that popups don't disappear too soon
+ },
+
+ onCancel: function(){
+ // summary: exists so that we can close ourselves if we wish
+ },
+
+ onChange: function(/* item */ value){
+ // summary: called when the value of this widget has changed
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/RollingList/RollingList.css b/js/dojo-1.6/dojox/widget/RollingList/RollingList.css new file mode 100644 index 0000000..31649e7 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/RollingList/RollingList.css @@ -0,0 +1,156 @@ +.dojoxRollingList { + border: 1px solid #000; + height: 20em; + background-color: #FFF; + position: relative; +} + +.dijitPopup .dojoxRollingList { + position: static; +} + +.dojoxRollingListContainer { + overflow: scroll; + overflow-y: hidden; + overflow-x: scroll; + white-space: nowrap; +} + +.dojoxRollingListButtons { + position: absolute; + right: 5px; + padding: 5px 0px; +} + +.dojoxRollingListButtonsHidden .dojoxRollingListButtons { + display: none; +} + +.dojoxRollingListPane { + overflow: scroll; + overflow-x: hidden; + overflow-y: scroll; + display:-moz-inline-box; /* FF2 */ + display:inline-block; /* webkit and FF3 */ + #zoom: 1; /* set hasLayout:true to mimic inline-block */ + #display:inline; /* don't use .dj_ie since that increases the priority */ + border:0; + padding:0; + vertical-align:middle; + #vertical-align: auto; /* makes TextBox,Button line up w/native counterparts on IE6 */ +} + +.dojoxRollingListPane .dijitMenuItem td { + width: 1px; +} +.dojoxRollingListPane .dijitMenuItem td.dijitMenuItemLabel { + width: auto; +} + +.dojoxRollingListPane .dijitMenuItemLabel, +.dojoxRollingListPane .dijitMenuItemIcon { + position: static !important; +} + +.dj_webkit .dojoxRollingListPane, +.dj_ie .dojoxRollingListPane { + padding-right: 15px; /* Account for scroll bar */ +} + +.dojoxRollingListPane .dijitMenu { + border: none !important; +} + +.dojoxRollingListItem { + cursor: default; +} + +/* Background colors to match menus */ +.tundra .dojoxRollingList { + border-color: #b3b3b3; +} +.tundra .dijitPopup .dojoxRollingList { + border-color: #406b9b; +} +.tundra .dojoxRollingListPane { + background-color: #f7f7f7; +} +.tundra .dojoxRollingListPane .dojoxRollingListItemHover, +.tundra .dojoxRollingListPane .dojoxRollingListItemFocus { + background-color: #e3e3e3; +} +.tundra .dojoxRollingListPane .dojoxRollingListItemSelected { + color: #fff; + background-color: #999; + font-weight: bold; +} +.tundra .dojoxRollingListPaneCurrentSelected .dojoxRollingListItemSelected { + background-color: #3559ac; +} +.tundra .dojoxRollingListPane .dojoxRollingListItemHoverSelected, +.tundra .dojoxRollingListPane .dojoxRollingListItemFocusSelected { + background-color: #9aacd6; +} +.tundra .dojoxRollingListItem { + font-family: inherit; +} + +.soria .dojoxRollingList { + border-color: #8ba0bd; +} +.soria .dijitPopup .dojoxRollingList { + border-color: #406b9b; +} +.soria .dojoxRollingListPane { + background-color: #fff; +} +.soria .dojoxRollingListPane .dojoxRollingListItemHover, +.soria .dojoxRollingListPane .dojoxRollingListItemFocus { + background-color: #e3e3e3; +} +.soria .dojoxRollingListPane .dojoxRollingListItemSelected { + color: #243C5F; + background-color: #ccc; + font-weight: bold; +} +.soria .dojoxRollingListPaneCurrentSelected .dojoxRollingListItemSelected { + background-color: #d9e6f9; +} +.soria .dojoxRollingListPane .dojoxRollingListItemHoverSelected, +.soria .dojoxRollingListPane .dojoxRollingListItemFocusSelected { + background-color: #ecf3fc; +} +.soria .dojoxRollingListItem { + font-family: inherit; +} + + +.nihilo .dojoxRollingList { + border-color: #d3d3d3; +} +.nihilo .dijitPopup .dojoxRollingList { + border-color: #b3b3b3; +} +.nihilo .dojoxRollingListPane { + background-color: #fff; +} +.nihilo .dojoxRollingListPane .dojoxRollingListItemHover, +.nihilo .dojoxRollingListPane .dojoxRollingListItemFocus { + background-color: #e3e3e3; +} +.nihilo .dojoxRollingListPane .dojoxRollingListItemSelected { + color: #243C5F; + background-color: #ccc; + font-weight: bold; +} +.nihilo .dojoxRollingListPaneCurrentSelected .dojoxRollingListItemSelected { + background-color: #ffe284; +} +.nihilo .dojoxRollingListPane .dojoxRollingListItemHoverSelected, +.nihilo .dojoxRollingListPane .dojoxRollingListItemFocusSelected { + background-color: #fff1c2; +} +.nihilo .dojoxRollingListItem { + font-family: inherit; +} + diff --git a/js/dojo-1.6/dojox/widget/RollingList/RollingList.html b/js/dojo-1.6/dojox/widget/RollingList/RollingList.html new file mode 100644 index 0000000..ec26ebb --- /dev/null +++ b/js/dojo-1.6/dojox/widget/RollingList/RollingList.html @@ -0,0 +1,10 @@ +<div class="dojoxRollingList ${className}" + ><div class="dojoxRollingListContainer" dojoAttachPoint="containerNode" dojoAttachEvent="onkeypress:_onKey" + ></div + ><div class="dojoxRollingListButtons" dojoAttachPoint="buttonsNode" + ><button dojoType="dijit.form.Button" dojoAttachPoint="okButton" + dojoAttachEvent="onClick:_onExecute">${okButtonLabel}</button + ><button dojoType="dijit.form.Button" dojoAttachPoint="cancelButton" + dojoAttachEvent="onClick:_onCancel">${cancelButtonLabel}</button + ></div +></div> diff --git a/js/dojo-1.6/dojox/widget/Rotator.js b/js/dojo-1.6/dojox/widget/Rotator.js new file mode 100644 index 0000000..e4a41db --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Rotator.js @@ -0,0 +1,375 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Rotator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Rotator"] = true;
+dojo.provide("dojox.widget.Rotator");
+dojo.require("dojo.parser");
+
+(function(d){
+
+ // build friendly strings
+ var _defaultTransition = "dojox.widget.rotator.swap", // please do NOT change
+ _defaultTransitionDuration = 500,
+ _displayStr = "display",
+ _noneStr = "none",
+ _zIndex = "zIndex";
+
+ d.declare("dojox.widget.Rotator", null, {
+ // summary:
+ // A widget for rotating through child nodes using transitions.
+ //
+ // description:
+ // A small, fast, extensible, awesome rotator that cycles, with transitions,
+ // through panes (child nodes) displaying only one at a time and ties into
+ // controllers used to change state.
+ //
+ // The Rotator does not rely on dijit. It is designed to be as lightweight
+ // as possible. Controllers and transitions have been externalized
+ // so builds can be as optimized with only the components you want to use.
+ //
+ // For best results, each rotator pane should be the same height and width as
+ // the Rotator container node and consider setting overflow to hidden.
+ // While the Rotator will accept any DOM node for a rotator pane, a block
+ // element or element with display:block is recommended.
+ //
+ // Note: When the Rotator begins, it does not transition the first pane.
+ //
+ // subscribed topics:
+ // [id]/rotator/control - Controls the Rotator
+ // Parameters:
+ // /*string*/ action - The name of a method of the Rotator to run
+ // /*anything?*/ args - One or more arguments to pass to the action
+ //
+ // published topics:
+ // [id]/rotator/update - Notifies controllers that a pane or state has changed.
+ // Parameters:
+ // /*string*/ type - the type of notification
+ // /*dojox.widget.Rotator*/ rotator
+ // - the rotator instance
+ // /*object?*/ params - params
+ //
+ // declarative dojo/method events (per pane):
+ // onBeforeIn - Fired before the transition in starts.
+ // onAfterIn - Fired after the transition in ends.
+ // onBeforeOut - Fired before the transition out starts.
+ // onAfterOut - Fired after the transition out ends.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.Rotator">
+ // | <div>Pane 1!</div>
+ // | <div>Pane 2!</div>
+ // | </div>
+ //
+ // example:
+ // | <script type="text/javascript">
+ // | dojo.require("dojox.widget.rotator.Fade");
+ // | </script>
+ // | <div dojoType="dojox.widget.Rotator" transition="dojox.widget.rotator.crossFade">
+ // | <div>Pane 1!</div>
+ // | <div>Pane 2!</div>
+ // | </div>
+
+ // transition: string
+ // The name of a function that is passed two panes nodes and a duration,
+ // then returns a dojo.Animation object. The default value is
+ // "dojox.widget.rotator.swap".
+ transition: _defaultTransition,
+
+ // transitionParams: string
+ // Parameters for the transition. The string is read in and eval'd as an
+ // object. If the duration is absent, the default value will be used.
+ transitionParams: "duration:" + _defaultTransitionDuration,
+
+ // panes: array
+ // Array of panes to be created in the Rotator. Each array element
+ // will be passed as attributes to a dojo.create() call.
+ panes: null,
+
+ constructor: function(/*Object*/params, /*DomNode|string*/node){
+ // summary:
+ // Initializes the panes and events.
+ d.mixin(this, params);
+
+ var _t = this,
+ t = _t.transition,
+ tt = _t._transitions = {},
+ idm = _t._idMap = {},
+ tp = _t.transitionParams = eval("({ " + _t.transitionParams + " })"),
+ node = _t._domNode = dojo.byId(node),
+ cb = _t._domNodeContentBox = d.contentBox(node), // we are going to assume the rotator will not be changing size
+
+ // default styles to apply to all the container node and rotator's panes
+ p = {
+ left: 0,
+ top: 0
+ },
+
+ warn = function(bt, dt){
+ console.warn(_t.declaredClass, ' - Unable to find transition "', bt, '", defaulting to "', dt, '".');
+ };
+
+ // if we don't have an id, then generate one
+ _t.id = node.id || (new Date()).getTime();
+
+ // force the rotator DOM node to a relative position and attach the container node to it
+ if(d.style(node, "position") == "static"){
+ d.style(node, "position", "relative");
+ }
+
+ // create our object for caching transition objects
+ tt[t] = d.getObject(t);
+ if(!tt[t]){
+ warn(t, _defaultTransition);
+ tt[_t.transition = _defaultTransition] = d.getObject(_defaultTransition);
+ }
+
+ // clean up the transition params
+ if(!tp.duration){
+ tp.duration = _defaultTransitionDuration;
+ }
+
+ // if there are any panes being passed in, add them to this node
+ d.forEach(_t.panes, function(p){
+ d.create("div", p, node);
+ });
+
+ // zero out our panes array to store the real pane instance
+ var pp = _t.panes = [];
+
+ // find and initialize the panes
+ d.query(">", node).forEach(function(n, i){
+ var q = { node: n, idx: i, params: d.mixin({}, tp, eval("({ " + (d.attr(n, "transitionParams") || "") + " })")) },
+ r = q.trans = d.attr(n, "transition") || _t.transition;
+
+ // cache each pane's title, duration, and waitForEvent attributes
+ d.forEach(["id", "title", "duration", "waitForEvent"], function(a){
+ q[a] = d.attr(n, a);
+ });
+
+ if(q.id){
+ idm[q.id] = i;
+ }
+
+ // cache the transition function
+ if(!tt[r] && !(tt[r] = d.getObject(r))){
+ warn(r, q.trans = _t.transition);
+ }
+
+ p.position = "absolute";
+ p.display = _noneStr;
+
+ // find the selected pane and initialize styles
+ if(_t.idx == null || d.attr(n, "selected")){
+ if(_t.idx != null){
+ d.style(pp[_t.idx].node, _displayStr, _noneStr);
+ }
+ _t.idx = i;
+ p.display = "";
+ }
+ d.style(n, p);
+
+ // check for any declarative script blocks
+ d.query("> script[type^='dojo/method']", n).orphan().forEach(function(s){
+ var e = d.attr(s, "event");
+ if(e){
+ q[e] = d.parser._functionFromScript(s);
+ }
+ });
+
+ // add this pane to the array of panes
+ pp.push(q);
+ });
+
+ _t._controlSub = d.subscribe(_t.id + "/rotator/control", _t, "control");
+ },
+
+ destroy: function(){
+ // summary:
+ // Destroys the Rotator and its DOM node.
+ d.forEach([this._controlSub, this.wfe], d.unsubscribe);
+ d.destroy(this._domNode);
+ },
+
+ next: function(){
+ // summary:
+ // Transitions the Rotator to the next pane.
+ return this.go(this.idx + 1);
+ },
+
+ prev: function(){
+ // summary:
+ // Transitions the Rotator to the previous pane.
+ return this.go(this.idx - 1);
+ },
+
+ go: function(/*int|string?*/p){
+ // summary:
+ // Transitions the Rotator to the specified pane index.
+ var _t = this,
+ i = _t.idx,
+ pp = _t.panes,
+ len = pp.length,
+ idm = _t._idMap[p];
+
+ // we gotta move on, so if the current pane is waiting for an event, just
+ // ignore it and clean up
+ _t._resetWaitForEvent();
+
+ // determine the next index and set it to idx for the next go to
+ p = idm != null ? idm : (p || 0);
+ p = p < len ? (p < 0 ? len-1 : p) : 0;
+
+ // if we're already on the requested pane or still transitioning, then return
+ if(p == i || _t.anim){
+ return null;
+ }
+
+ // get the current and next panes
+ var current = pp[i],
+ next = pp[p];
+
+ // adjust the zIndexes so our animations look good... this must be done before
+ // the animation is created so the animation could override it if necessary
+ d.style(current.node, _zIndex, 2);
+ d.style(next.node, _zIndex, 1);
+
+ // info object passed to animations and onIn/Out events
+ var info = {
+ current: current,
+ next: next,
+ rotator: _t
+ },
+
+ // get the transition
+ anim = _t.anim = _t._transitions[next.trans](d.mixin({
+ rotatorBox: _t._domNodeContentBox
+ }, info, next.params));
+
+ if(anim){
+ // create the deferred that we'll be returning
+ var def = new d.Deferred(),
+ ev = next.waitForEvent,
+
+ h = d.connect(anim, "onEnd", function(){
+ // reset the node styles
+ d.style(current.node, {
+ display: _noneStr,
+ left: 0,
+ opacity: 1,
+ top: 0,
+ zIndex: 0
+ });
+
+ d.disconnect(h);
+ _t.anim = null;
+ _t.idx = p;
+
+ // fire end events
+ if(current.onAfterOut){ current.onAfterOut(info); }
+ if(next.onAfterIn){ next.onAfterIn(info); }
+
+ _t.onUpdate("onAfterTransition");
+
+ if(!ev){
+ // if there is a previous waitForEvent, then we need to make
+ // sure it gets unsubscribed
+ _t._resetWaitForEvent();
+
+ // animation is all done, fire the deferred callback.
+ def.callback();
+ }
+ });
+
+ // if we're waiting for an event, subscribe to it so we know when to continue
+ _t.wfe = ev ? d.subscribe(ev, function(){
+ _t._resetWaitForEvent();
+ def.callback(true);
+ }) : null;
+
+ _t.onUpdate("onBeforeTransition");
+
+ // fire start events
+ if(current.onBeforeOut){ current.onBeforeOut(info); }
+ if(next.onBeforeIn){ next.onBeforeIn(info); }
+
+ // play the animation
+ anim.play();
+
+ // return the deferred
+ return def; /*Deferred*/
+ }
+ },
+
+ onUpdate: function(/*string*/type, /*object?*/params){
+ // summary:
+ // Send a notification to all controllers with the state of the rotator.
+ d.publish(this.id + "/rotator/update", [type, this, params || {}]);
+ },
+
+ _resetWaitForEvent: function(){
+ // summary:
+ // If there is a waitForEvent pending, kill it.
+ if(this.wfe){
+ d.unsubscribe(this.wfe);
+ this.wfe = null;
+ }
+ },
+
+ control: function(/*string*/action){
+ // summary:
+ // Dispatches an action, first to this engine, then to the Rotator.
+ var args = d._toArray(arguments),
+ _t = this;
+ args.shift();
+
+ _t._resetWaitForEvent();
+
+ if(_t[action]){
+ // action exists, so call it and fire deferred if applicable
+ var def = _t[action].apply(_t, args);
+ if(def){
+ def.addCallback(function(){
+ _t.onUpdate(action);
+ });
+ }
+
+ // since this action was triggered by a controller, we assume this was a
+ // manual action, so check if we should pause
+ _t.onManualChange(action);
+ }else{
+ console.warn(_t.declaredClass, ' - Unsupported action "', action, '".');
+ }
+ },
+
+ resize: function(/*int*/width, /*int*/height){
+ var b = this._domNodeContentBox = { w: width, h: height };
+ d.contentBox(this._domNode, b);
+ d.forEach(this.panes, function(p){ d.contentBox(p.node, b); });
+ },
+
+ onManualChange: function(){
+ // summary:
+ // Stub function that can be overriden or connected to.
+ }
+ });
+
+ d.setObject(_defaultTransition, function(/*Object*/args){
+ // summary:
+ // The default rotator transition which swaps two panes.
+ return new d._Animation({ // dojo.Animation
+ play: function(){
+ d.style(args.current.node, _displayStr, _noneStr);
+ d.style(args.next.node, _displayStr, "");
+ this._fire("onEnd");
+ }
+ });
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Rotator.xd.js b/js/dojo-1.6/dojox/widget/Rotator.xd.js new file mode 100644 index 0000000..8d270fe --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Rotator.xd.js @@ -0,0 +1,380 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Rotator"],
+["require", "dojo.parser"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Rotator"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Rotator"] = true;
+dojo.provide("dojox.widget.Rotator");
+dojo.require("dojo.parser");
+
+(function(d){
+
+ // build friendly strings
+ var _defaultTransition = "dojox.widget.rotator.swap", // please do NOT change
+ _defaultTransitionDuration = 500,
+ _displayStr = "display",
+ _noneStr = "none",
+ _zIndex = "zIndex";
+
+ d.declare("dojox.widget.Rotator", null, {
+ // summary:
+ // A widget for rotating through child nodes using transitions.
+ //
+ // description:
+ // A small, fast, extensible, awesome rotator that cycles, with transitions,
+ // through panes (child nodes) displaying only one at a time and ties into
+ // controllers used to change state.
+ //
+ // The Rotator does not rely on dijit. It is designed to be as lightweight
+ // as possible. Controllers and transitions have been externalized
+ // so builds can be as optimized with only the components you want to use.
+ //
+ // For best results, each rotator pane should be the same height and width as
+ // the Rotator container node and consider setting overflow to hidden.
+ // While the Rotator will accept any DOM node for a rotator pane, a block
+ // element or element with display:block is recommended.
+ //
+ // Note: When the Rotator begins, it does not transition the first pane.
+ //
+ // subscribed topics:
+ // [id]/rotator/control - Controls the Rotator
+ // Parameters:
+ // /*string*/ action - The name of a method of the Rotator to run
+ // /*anything?*/ args - One or more arguments to pass to the action
+ //
+ // published topics:
+ // [id]/rotator/update - Notifies controllers that a pane or state has changed.
+ // Parameters:
+ // /*string*/ type - the type of notification
+ // /*dojox.widget.Rotator*/ rotator
+ // - the rotator instance
+ // /*object?*/ params - params
+ //
+ // declarative dojo/method events (per pane):
+ // onBeforeIn - Fired before the transition in starts.
+ // onAfterIn - Fired after the transition in ends.
+ // onBeforeOut - Fired before the transition out starts.
+ // onAfterOut - Fired after the transition out ends.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.Rotator">
+ // | <div>Pane 1!</div>
+ // | <div>Pane 2!</div>
+ // | </div>
+ //
+ // example:
+ // | <script type="text/javascript">
+ // | dojo.require("dojox.widget.rotator.Fade");
+ // | </script>
+ // | <div dojoType="dojox.widget.Rotator" transition="dojox.widget.rotator.crossFade">
+ // | <div>Pane 1!</div>
+ // | <div>Pane 2!</div>
+ // | </div>
+
+ // transition: string
+ // The name of a function that is passed two panes nodes and a duration,
+ // then returns a dojo.Animation object. The default value is
+ // "dojox.widget.rotator.swap".
+ transition: _defaultTransition,
+
+ // transitionParams: string
+ // Parameters for the transition. The string is read in and eval'd as an
+ // object. If the duration is absent, the default value will be used.
+ transitionParams: "duration:" + _defaultTransitionDuration,
+
+ // panes: array
+ // Array of panes to be created in the Rotator. Each array element
+ // will be passed as attributes to a dojo.create() call.
+ panes: null,
+
+ constructor: function(/*Object*/params, /*DomNode|string*/node){
+ // summary:
+ // Initializes the panes and events.
+ d.mixin(this, params);
+
+ var _t = this,
+ t = _t.transition,
+ tt = _t._transitions = {},
+ idm = _t._idMap = {},
+ tp = _t.transitionParams = eval("({ " + _t.transitionParams + " })"),
+ node = _t._domNode = dojo.byId(node),
+ cb = _t._domNodeContentBox = d.contentBox(node), // we are going to assume the rotator will not be changing size
+
+ // default styles to apply to all the container node and rotator's panes
+ p = {
+ left: 0,
+ top: 0
+ },
+
+ warn = function(bt, dt){
+ console.warn(_t.declaredClass, ' - Unable to find transition "', bt, '", defaulting to "', dt, '".');
+ };
+
+ // if we don't have an id, then generate one
+ _t.id = node.id || (new Date()).getTime();
+
+ // force the rotator DOM node to a relative position and attach the container node to it
+ if(d.style(node, "position") == "static"){
+ d.style(node, "position", "relative");
+ }
+
+ // create our object for caching transition objects
+ tt[t] = d.getObject(t);
+ if(!tt[t]){
+ warn(t, _defaultTransition);
+ tt[_t.transition = _defaultTransition] = d.getObject(_defaultTransition);
+ }
+
+ // clean up the transition params
+ if(!tp.duration){
+ tp.duration = _defaultTransitionDuration;
+ }
+
+ // if there are any panes being passed in, add them to this node
+ d.forEach(_t.panes, function(p){
+ d.create("div", p, node);
+ });
+
+ // zero out our panes array to store the real pane instance
+ var pp = _t.panes = [];
+
+ // find and initialize the panes
+ d.query(">", node).forEach(function(n, i){
+ var q = { node: n, idx: i, params: d.mixin({}, tp, eval("({ " + (d.attr(n, "transitionParams") || "") + " })")) },
+ r = q.trans = d.attr(n, "transition") || _t.transition;
+
+ // cache each pane's title, duration, and waitForEvent attributes
+ d.forEach(["id", "title", "duration", "waitForEvent"], function(a){
+ q[a] = d.attr(n, a);
+ });
+
+ if(q.id){
+ idm[q.id] = i;
+ }
+
+ // cache the transition function
+ if(!tt[r] && !(tt[r] = d.getObject(r))){
+ warn(r, q.trans = _t.transition);
+ }
+
+ p.position = "absolute";
+ p.display = _noneStr;
+
+ // find the selected pane and initialize styles
+ if(_t.idx == null || d.attr(n, "selected")){
+ if(_t.idx != null){
+ d.style(pp[_t.idx].node, _displayStr, _noneStr);
+ }
+ _t.idx = i;
+ p.display = "";
+ }
+ d.style(n, p);
+
+ // check for any declarative script blocks
+ d.query("> script[type^='dojo/method']", n).orphan().forEach(function(s){
+ var e = d.attr(s, "event");
+ if(e){
+ q[e] = d.parser._functionFromScript(s);
+ }
+ });
+
+ // add this pane to the array of panes
+ pp.push(q);
+ });
+
+ _t._controlSub = d.subscribe(_t.id + "/rotator/control", _t, "control");
+ },
+
+ destroy: function(){
+ // summary:
+ // Destroys the Rotator and its DOM node.
+ d.forEach([this._controlSub, this.wfe], d.unsubscribe);
+ d.destroy(this._domNode);
+ },
+
+ next: function(){
+ // summary:
+ // Transitions the Rotator to the next pane.
+ return this.go(this.idx + 1);
+ },
+
+ prev: function(){
+ // summary:
+ // Transitions the Rotator to the previous pane.
+ return this.go(this.idx - 1);
+ },
+
+ go: function(/*int|string?*/p){
+ // summary:
+ // Transitions the Rotator to the specified pane index.
+ var _t = this,
+ i = _t.idx,
+ pp = _t.panes,
+ len = pp.length,
+ idm = _t._idMap[p];
+
+ // we gotta move on, so if the current pane is waiting for an event, just
+ // ignore it and clean up
+ _t._resetWaitForEvent();
+
+ // determine the next index and set it to idx for the next go to
+ p = idm != null ? idm : (p || 0);
+ p = p < len ? (p < 0 ? len-1 : p) : 0;
+
+ // if we're already on the requested pane or still transitioning, then return
+ if(p == i || _t.anim){
+ return null;
+ }
+
+ // get the current and next panes
+ var current = pp[i],
+ next = pp[p];
+
+ // adjust the zIndexes so our animations look good... this must be done before
+ // the animation is created so the animation could override it if necessary
+ d.style(current.node, _zIndex, 2);
+ d.style(next.node, _zIndex, 1);
+
+ // info object passed to animations and onIn/Out events
+ var info = {
+ current: current,
+ next: next,
+ rotator: _t
+ },
+
+ // get the transition
+ anim = _t.anim = _t._transitions[next.trans](d.mixin({
+ rotatorBox: _t._domNodeContentBox
+ }, info, next.params));
+
+ if(anim){
+ // create the deferred that we'll be returning
+ var def = new d.Deferred(),
+ ev = next.waitForEvent,
+
+ h = d.connect(anim, "onEnd", function(){
+ // reset the node styles
+ d.style(current.node, {
+ display: _noneStr,
+ left: 0,
+ opacity: 1,
+ top: 0,
+ zIndex: 0
+ });
+
+ d.disconnect(h);
+ _t.anim = null;
+ _t.idx = p;
+
+ // fire end events
+ if(current.onAfterOut){ current.onAfterOut(info); }
+ if(next.onAfterIn){ next.onAfterIn(info); }
+
+ _t.onUpdate("onAfterTransition");
+
+ if(!ev){
+ // if there is a previous waitForEvent, then we need to make
+ // sure it gets unsubscribed
+ _t._resetWaitForEvent();
+
+ // animation is all done, fire the deferred callback.
+ def.callback();
+ }
+ });
+
+ // if we're waiting for an event, subscribe to it so we know when to continue
+ _t.wfe = ev ? d.subscribe(ev, function(){
+ _t._resetWaitForEvent();
+ def.callback(true);
+ }) : null;
+
+ _t.onUpdate("onBeforeTransition");
+
+ // fire start events
+ if(current.onBeforeOut){ current.onBeforeOut(info); }
+ if(next.onBeforeIn){ next.onBeforeIn(info); }
+
+ // play the animation
+ anim.play();
+
+ // return the deferred
+ return def; /*Deferred*/
+ }
+ },
+
+ onUpdate: function(/*string*/type, /*object?*/params){
+ // summary:
+ // Send a notification to all controllers with the state of the rotator.
+ d.publish(this.id + "/rotator/update", [type, this, params || {}]);
+ },
+
+ _resetWaitForEvent: function(){
+ // summary:
+ // If there is a waitForEvent pending, kill it.
+ if(this.wfe){
+ d.unsubscribe(this.wfe);
+ this.wfe = null;
+ }
+ },
+
+ control: function(/*string*/action){
+ // summary:
+ // Dispatches an action, first to this engine, then to the Rotator.
+ var args = d._toArray(arguments),
+ _t = this;
+ args.shift();
+
+ _t._resetWaitForEvent();
+
+ if(_t[action]){
+ // action exists, so call it and fire deferred if applicable
+ var def = _t[action].apply(_t, args);
+ if(def){
+ def.addCallback(function(){
+ _t.onUpdate(action);
+ });
+ }
+
+ // since this action was triggered by a controller, we assume this was a
+ // manual action, so check if we should pause
+ _t.onManualChange(action);
+ }else{
+ console.warn(_t.declaredClass, ' - Unsupported action "', action, '".');
+ }
+ },
+
+ resize: function(/*int*/width, /*int*/height){
+ var b = this._domNodeContentBox = { w: width, h: height };
+ d.contentBox(this._domNode, b);
+ d.forEach(this.panes, function(p){ d.contentBox(p.node, b); });
+ },
+
+ onManualChange: function(){
+ // summary:
+ // Stub function that can be overriden or connected to.
+ }
+ });
+
+ d.setObject(_defaultTransition, function(/*Object*/args){
+ // summary:
+ // The default rotator transition which swaps two panes.
+ return new d._Animation({ // dojo.Animation
+ play: function(){
+ d.style(args.current.node, _displayStr, _noneStr);
+ d.style(args.next.node, _displayStr, "");
+ this._fire("onEnd");
+ }
+ });
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/SortList.js b/js/dojo-1.6/dojox/widget/SortList.js new file mode 100644 index 0000000..c6122fd --- /dev/null +++ b/js/dojo-1.6/dojox/widget/SortList.js @@ -0,0 +1,161 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.SortList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.SortList"] = true;
+dojo.provide("dojox.widget.SortList");
+dojo.experimental("dojox.widget.SortList"); // level: prototype, designed for dijit.chat.demo
+
+dojo.require("dijit.layout._LayoutWidget");
+dojo.require("dijit._Templated");
+
+dojo.declare("dojox.widget.SortList",
+ [dijit.layout._LayoutWidget, dijit._Templated],
+ {
+ // summary: A sortable unordered-list with a fixed header for use in dijit.demos.chat
+ // for demonstration purposes only for now. feel free to make API suggestions
+ // or fixes.
+ //
+ // title: String
+ // The title in the header
+ title: "",
+
+ // heading: String
+ // In the event a parent container is expecting a title="" attribute, set it for the parent
+ // via title, and the title of this widget via heading="" ... assuming you want different
+ // titles for each. eg: TabContainer, AccordionContainer, etc.
+ heading: "",
+
+ // descending: Boolean
+ // Toggle sort order based on this value.
+ descending: true,
+
+ // selected: Array
+ // A list of the selected <li> nodes at any given time.
+ selected: null,
+
+ // sortable: Boolean
+ // toggle to enable/disable sorting
+ sortable: true,
+
+ // FIXME: this is really simple store support
+ store: "",
+ key: "name",
+
+ baseClass: "dojoxSortList",
+
+ templateString: dojo.cache("dojox.widget", "SortList/SortList.html", "<div class=\"sortList\" id=\"${id}\">\r\n\t\t<div class=\"sortListTitle\" dojoAttachPoint=\"titleNode\">\r\n\t\t<div class=\"dijitInline sortListIcon\"> </div>\r\n\t\t<span dojoAttachPoint=\"focusNode\">${title}</span>\r\n\t\t</div>\r\n\t\t<div class=\"sortListBodyWrapper\" dojoAttachEvent=\"onmouseover: _set, onmouseout: _unset, onclick:_handleClick\" dojoAttachPoint=\"bodyWrapper\">\r\n\t\t<ul dojoAttachPoint=\"containerNode\" class=\"sortListBody\"></ul>\r\n\t</div>\r\n</div>\r\n"),
+
+ _addItem: function(item){
+ dojo.create("li", {
+ innerHTML: this.store.getValue(item, this.key).replace(/</g, "<")
+ }, this.containerNode);
+ },
+
+ postCreate: function(){
+ if(this.store){
+ this.store = dojo.getObject(this.store);
+ var props = {
+ onItem: dojo.hitch(this, "_addItem"),
+ onComplete: dojo.hitch(this, "onSort")
+ };
+ this.store.fetch(props);
+ }else{ this.onSort(); }
+ this.inherited(arguments);
+ },
+
+ startup: function(){
+ this.inherited(arguments);
+ if(this.heading){
+ this.setTitle(this.heading);
+ this.title = this.heading;
+ }
+ // we cheat, and give the browser just enough time so we know our height
+ setTimeout(dojo.hitch(this,"resize"), 5);
+ if(this.sortable){ this.connect(this.titleNode,"onclick", "onSort"); }
+ },
+
+ resize: function(){
+ // summary: do our additional calculations when resize() is called by or in a parent
+ this.inherited(arguments);
+ // FIXME:
+ // the 10 comes from the difference between the contentBox and calculated height
+ // because of badding and border extents. this shouldn't be done this way, a theme change will
+ // break it: but we also don't want to run getComputedStyle or dojo.coords() every time resize()
+ // is fired.
+ var offset = ((this._contentBox.h) - (dojo.style(this.titleNode,"height")))-10;
+ this.bodyWrapper.style.height = Math.abs(offset) + "px";
+ },
+
+ onSort: function(/* Event */e){
+ // summary: sort the data, and style the nodes.
+
+ var arr = dojo.query("li",this.domNode);
+ if (this.sortable){
+ this.descending = !this.descending;
+ dojo.addClass(this.titleNode,((this.descending)?"sortListDesc":"sortListAsc"));
+ dojo.removeClass(this.titleNode,((this.descending)?"sortListAsc":"sortListDesc"));
+ arr.sort(this._sorter);
+ if(this.descending){ arr.reverse(); }
+ }
+ var i=0;
+ dojo.forEach(arr,function(item){
+ dojo[(i++) % 2 === 0 ? "addClass" : "removeClass"](item,"sortListItemOdd");
+ this.containerNode.appendChild(item);
+ },this);
+ },
+
+ _set: function(/* Event */e){
+ // summary: set hover state
+ if(e.target !== this.bodyWrapper){
+ dojo.addClass(e.target,"sortListItemHover");
+ }
+ },
+
+ _unset: function(/* Event */e){
+ // summary: remove hover state (FIXME: combine with _set?)
+ dojo.removeClass(e.target,"sortListItemHover");
+ },
+
+ _handleClick: function(/* Event */e){
+ // summary: click listener for data portion of widget. toggle selected state
+ // of node, and update this.selected array accordingly
+ dojo.toggleClass(e.target,"sortListItemSelected");
+ e.target.focus();
+ this._updateValues(e.target.innerHTML);
+ },
+
+ _updateValues: function(){
+ this._selected = dojo.query("li.sortListItemSelected", this.containerNode);
+ this.selected = [];
+ dojo.forEach(this._selected, function(node){
+ this.selected.push(node.innerHTML);
+ }, this);
+ this.onChanged(arguments);
+ },
+
+ _sorter: function(a,b){
+ // summary: a basic sort function, use query sort, or keep this?
+ var aStr = a.innerHTML;
+ var bStr = b.innerHTML;
+ if(aStr>bStr){ return 1; }
+ if(aStr<bStr){ return -1; }
+ return 0;
+ },
+
+ setTitle: function(/* String */title){
+ // summary: Sets the widget title to a String
+ this.focusNode.innerHTML = this.title = title;
+ },
+
+ onChanged: function(){
+ // summary: stub function, passes the last changed item, and is fired after current state
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/SortList.xd.js b/js/dojo-1.6/dojox/widget/SortList.xd.js new file mode 100644 index 0000000..575d773 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/SortList.xd.js @@ -0,0 +1,167 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.SortList"],
+["require", "dijit.layout._LayoutWidget"],
+["require", "dijit._Templated"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.SortList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.SortList"] = true;
+dojo.provide("dojox.widget.SortList");
+dojo.experimental("dojox.widget.SortList"); // level: prototype, designed for dijit.chat.demo
+
+dojo.require("dijit.layout._LayoutWidget");
+dojo.require("dijit._Templated");
+
+dojo.declare("dojox.widget.SortList",
+ [dijit.layout._LayoutWidget, dijit._Templated],
+ {
+ // summary: A sortable unordered-list with a fixed header for use in dijit.demos.chat
+ // for demonstration purposes only for now. feel free to make API suggestions
+ // or fixes.
+ //
+ // title: String
+ // The title in the header
+ title: "",
+
+ // heading: String
+ // In the event a parent container is expecting a title="" attribute, set it for the parent
+ // via title, and the title of this widget via heading="" ... assuming you want different
+ // titles for each. eg: TabContainer, AccordionContainer, etc.
+ heading: "",
+
+ // descending: Boolean
+ // Toggle sort order based on this value.
+ descending: true,
+
+ // selected: Array
+ // A list of the selected <li> nodes at any given time.
+ selected: null,
+
+ // sortable: Boolean
+ // toggle to enable/disable sorting
+ sortable: true,
+
+ // FIXME: this is really simple store support
+ store: "",
+ key: "name",
+
+ baseClass: "dojoxSortList",
+
+ templateString: dojo.cache("dojox.widget", "SortList/SortList.html", "<div class=\"sortList\" id=\"${id}\">\r\n\t\t<div class=\"sortListTitle\" dojoAttachPoint=\"titleNode\">\r\n\t\t<div class=\"dijitInline sortListIcon\"> </div>\r\n\t\t<span dojoAttachPoint=\"focusNode\">${title}</span>\r\n\t\t</div>\r\n\t\t<div class=\"sortListBodyWrapper\" dojoAttachEvent=\"onmouseover: _set, onmouseout: _unset, onclick:_handleClick\" dojoAttachPoint=\"bodyWrapper\">\r\n\t\t<ul dojoAttachPoint=\"containerNode\" class=\"sortListBody\"></ul>\r\n\t</div>\r\n</div>\r\n"),
+
+ _addItem: function(item){
+ dojo.create("li", {
+ innerHTML: this.store.getValue(item, this.key).replace(/</g, "<")
+ }, this.containerNode);
+ },
+
+ postCreate: function(){
+ if(this.store){
+ this.store = dojo.getObject(this.store);
+ var props = {
+ onItem: dojo.hitch(this, "_addItem"),
+ onComplete: dojo.hitch(this, "onSort")
+ };
+ this.store.fetch(props);
+ }else{ this.onSort(); }
+ this.inherited(arguments);
+ },
+
+ startup: function(){
+ this.inherited(arguments);
+ if(this.heading){
+ this.setTitle(this.heading);
+ this.title = this.heading;
+ }
+ // we cheat, and give the browser just enough time so we know our height
+ setTimeout(dojo.hitch(this,"resize"), 5);
+ if(this.sortable){ this.connect(this.titleNode,"onclick", "onSort"); }
+ },
+
+ resize: function(){
+ // summary: do our additional calculations when resize() is called by or in a parent
+ this.inherited(arguments);
+ // FIXME:
+ // the 10 comes from the difference between the contentBox and calculated height
+ // because of badding and border extents. this shouldn't be done this way, a theme change will
+ // break it: but we also don't want to run getComputedStyle or dojo.coords() every time resize()
+ // is fired.
+ var offset = ((this._contentBox.h) - (dojo.style(this.titleNode,"height")))-10;
+ this.bodyWrapper.style.height = Math.abs(offset) + "px";
+ },
+
+ onSort: function(/* Event */e){
+ // summary: sort the data, and style the nodes.
+
+ var arr = dojo.query("li",this.domNode);
+ if (this.sortable){
+ this.descending = !this.descending;
+ dojo.addClass(this.titleNode,((this.descending)?"sortListDesc":"sortListAsc"));
+ dojo.removeClass(this.titleNode,((this.descending)?"sortListAsc":"sortListDesc"));
+ arr.sort(this._sorter);
+ if(this.descending){ arr.reverse(); }
+ }
+ var i=0;
+ dojo.forEach(arr,function(item){
+ dojo[(i++) % 2 === 0 ? "addClass" : "removeClass"](item,"sortListItemOdd");
+ this.containerNode.appendChild(item);
+ },this);
+ },
+
+ _set: function(/* Event */e){
+ // summary: set hover state
+ if(e.target !== this.bodyWrapper){
+ dojo.addClass(e.target,"sortListItemHover");
+ }
+ },
+
+ _unset: function(/* Event */e){
+ // summary: remove hover state (FIXME: combine with _set?)
+ dojo.removeClass(e.target,"sortListItemHover");
+ },
+
+ _handleClick: function(/* Event */e){
+ // summary: click listener for data portion of widget. toggle selected state
+ // of node, and update this.selected array accordingly
+ dojo.toggleClass(e.target,"sortListItemSelected");
+ e.target.focus();
+ this._updateValues(e.target.innerHTML);
+ },
+
+ _updateValues: function(){
+ this._selected = dojo.query("li.sortListItemSelected", this.containerNode);
+ this.selected = [];
+ dojo.forEach(this._selected, function(node){
+ this.selected.push(node.innerHTML);
+ }, this);
+ this.onChanged(arguments);
+ },
+
+ _sorter: function(a,b){
+ // summary: a basic sort function, use query sort, or keep this?
+ var aStr = a.innerHTML;
+ var bStr = b.innerHTML;
+ if(aStr>bStr){ return 1; }
+ if(aStr<bStr){ return -1; }
+ return 0;
+ },
+
+ setTitle: function(/* String */title){
+ // summary: Sets the widget title to a String
+ this.focusNode.innerHTML = this.title = title;
+ },
+
+ onChanged: function(){
+ // summary: stub function, passes the last changed item, and is fired after current state
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/SortList/SortList.css b/js/dojo-1.6/dojox/widget/SortList/SortList.css new file mode 100644 index 0000000..a3eb54e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/SortList/SortList.css @@ -0,0 +1,68 @@ +.sortListBody { margin:0; padding:0; background:#fff; } + +.soria .sortListBody li, +.tundra .sortListBody li { + border-bottom:1px solid #b7b7b7; + padding:2px 2px 2px 5px; +} +.sortListTitle { + cursor:pointer; + padding:4px 4px 3px 4px; +} + +.sortList { height:100%; width:100%; } + +/* for nested layout elements */ +.dijitBorderContainer .dojoxSortList { width: auto; height: auto;} + +.sortListBodyWrapper { + border:1px solid #b7b7b7; + overflow:auto; + height:100%; + cursor:pointer; +} + +.soria .sortListBodyWrapper { + border:1px solid #333; +} + +.soria .sortListItemOdd, +.tundra .sortListItemOdd { background:#f2f5f9; } +.tundra .sortListTitle { + background:#fafafa url('../../../dijit/themes/tundra/images/titleBarBg.gif') repeat-x top left; + border:1px solid #bfbfbf; + border-bottom:0; +} +.soria .sortListTitle { + background:#4f8ce5 url('../../../dijit/themes/soria/images/titleBar.png') repeat-x top left; + background-position:0px -1px; + border:1px solid #333; + border-bottom:0; + font-weight:bold; + color:#fff; +} + +.sortListItemSelected { background:#b7cdee !important; } +.sortListItemHover { background:#ff6 !important; } + +.soria .sortListIcon, +.tundra .sortListIcon { + float:right; + background:url('../../../dijit/themes/tundra/images/spriteArrows.png') no-repeat; + width: 7px; +} +.tundra .sortListDesc .sortListIcon { + background-position: 0px center; +} +.tundra .sortListAsc .sortListIcon { + background-position: -21px center; +} + +.soria .sortListDesc .sortListIcon, +.soria .sortListAsc .sortListIcon { + background:url('../../../dijit/themes/soria/images/spriteRoundedIconsSmall.png') no-repeat -15px top; +} + +.soria .sortListDesc .sortListIcon { + background-position:-45px 0px; +} diff --git a/js/dojo-1.6/dojox/widget/SortList/SortList.html b/js/dojo-1.6/dojox/widget/SortList/SortList.html new file mode 100644 index 0000000..2cc16eb --- /dev/null +++ b/js/dojo-1.6/dojox/widget/SortList/SortList.html @@ -0,0 +1,9 @@ +<div class="sortList" id="${id}"> + <div class="sortListTitle" dojoAttachPoint="titleNode"> + <div class="dijitInline sortListIcon"> </div> + <span dojoAttachPoint="focusNode">${title}</span> + </div> + <div class="sortListBodyWrapper" dojoAttachEvent="onmouseover: _set, onmouseout: _unset, onclick:_handleClick" dojoAttachPoint="bodyWrapper"> + <ul dojoAttachPoint="containerNode" class="sortListBody"></ul> + </div> +</div>
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/Standby.js b/js/dojo-1.6/dojox/widget/Standby.js new file mode 100644 index 0000000..4f85e59 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Standby.js @@ -0,0 +1,761 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Standby"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Standby"] = true;
+dojo.provide("dojox.widget.Standby");
+dojo.require("dojo.window");
+dojo.require("dojo.fx");
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+
+
+dojo.experimental("dojox.widget.Standby");
+
+dojo.declare("dojox.widget.Standby",[dijit._Widget, dijit._Templated],{
+ // summary:
+ // A widget designed to act as a Standby/Busy/Disable/Blocking widget to indicate a
+ // particular DOM node is processing and cannot be clicked on at this time.
+ // This widget uses absolute positioning to apply the overlay and image.
+ //
+ // image:
+ // A URL to an image to center within the blocking overlay.
+ // The default is a basic spinner.
+ //
+ // imageText:
+ // Text to set on the ALT tag of the image.
+ // The default is 'Please wait...'
+ //
+ // text:
+ // Text to display in the center instead of an image.
+ // Defaults to 'Please Wait...'
+ //
+ // centerIndicator:
+ // Which to use as the center info, the text or the image.
+ // Defaults to image.
+ //
+ // color:
+ // The color to use for the translucent overlay.
+ // Text string such as: darkblue, #FE02FD, etc.
+ //
+ // duration:
+ // How long the fade in and out effects should run in milliseconds.
+ // Default is 500ms
+ //
+ // zIndex:
+ // Control that lets you specify if the zIndex for the overlay
+ // should be auto-computed based off parent zIndex, or should be set
+ // to a particular value. This is useful when you want to overlay
+ // things in digit.Dialogs, you can specify a base zIndex to append from.
+ // Default is 'auto'.
+
+ // templateString: [protected] String
+ // The template string defining out the basics of the widget. No need for an external
+ // file.
+ templateString:
+ "<div>" +
+ "<div style=\"display: none; opacity: 0; z-index: 9999; " +
+ "position: absolute; cursor:wait;\" dojoAttachPoint=\"_underlayNode\"></div>" +
+ "<img src=\"${image}\" style=\"opacity: 0; display: none; z-index: -10000; " +
+ "position: absolute; top: 0px; left: 0px; cursor:wait;\" "+
+ "dojoAttachPoint=\"_imageNode\">" +
+ "<div style=\"opacity: 0; display: none; z-index: -10000; position: absolute; " +
+ "top: 0px;\" dojoAttachPoint=\"_textNode\"></div>" +
+ "</div>",
+
+ // _underlayNode: [private] DOMNode
+ // The node that is the translucent underlay for the
+ // image that blocks access to the target.
+ _underlayNode: null,
+
+ // _imageNode: [private] DOMNode
+ // The image node where we attach and define the image to display.
+ _imageNode: null,
+
+ // _textNode: [private] DOMNode
+ // The div to attach text/HTML in the overlay center item.
+ _textNode: null,
+
+ // _centerNode: [private] DOMNode
+ // Which node to use as the center node, the image or the text node.
+ _centerNode: null,
+
+ // image: String
+ // The URL to the image to center in the overlay.
+ image: dojo.moduleUrl("dojox", "widget/Standby/images/loading.gif").toString(),
+
+ // imageText: String
+ // Text for the ALT tag.
+ imageText: "Please Wait...",
+
+ // text: String
+ // Text/HTML to display in the center of the overlay
+ // This is used if image center is disabled.
+ text: "Please wait...",
+
+ // centerIndicator: String
+ // Property to define if the image and its alt text should be used, or
+ // a simple Text/HTML node should be used. Allowable values are 'image'
+ // and 'text'.
+ // Default is 'image'.
+ centerIndicator: "image",
+
+ // _displayed: [private] Boolean
+ // Flag to indicate if the overlay is displayed or not.
+ _displayed: false,
+
+ // _resizeCheck: [private] Object
+ // Handle to interval function that checks the target for changes.
+ _resizeCheck: null,
+
+ // target: DOMNode||DOMID(String)||WidgetID(String)
+ // The target to overlay when active. Can be a widget id, a
+ // dom id, or a direct node reference.
+ target: "",
+
+ // color: String
+ // The color to set the overlay. Should be in #XXXXXX form.
+ // Default color for the translucent overlay is light gray.
+ color: "#C0C0C0",
+
+ // duration: integer
+ // Integer defining how long the show and hide effects should take.
+ duration: 500,
+
+ // _started: [private] Boolean
+ // Trap flag to ensure startup only processes once.
+ _started: false,
+
+ // _parent: [private] DOMNode
+ // Wrapping div for the widget, also used for IE 7 in dealing with the
+ // zoom issue.
+ _parent: null,
+
+ // zIndex: String
+ // Control that lets you specify if the zIndex for the overlay
+ // should be auto-computed based off parent zIndex, or should be set
+ // to a particular value. This is useful when you want to overlay
+ // things in digit.Dialogs, you can specify a base zIndex to append from.
+ zIndex: "auto",
+
+ startup: function(args){
+ // summary:
+ // Over-ride of the basic widget startup function.
+ // Configures the target node and sets the image to use.
+ if(!this._started){
+ if(typeof this.target === "string"){
+ var w = dijit.byId(this.target);
+ if(w){
+ this.target = w.domNode;
+ }else{
+ this.target = dojo.byId(this.target);
+ }
+ }
+
+ if(this.text){
+ this._textNode.innerHTML = this.text;
+ }
+ if(this.centerIndicator === "image"){
+ this._centerNode = this._imageNode;
+ dojo.attr(this._imageNode, "src", this.image);
+ dojo.attr(this._imageNode, "alt", this.imageText);
+ }else{
+ this._centerNode = this._textNode;
+ }
+ dojo.style(this._underlayNode, {
+ display: "none",
+ backgroundColor: this.color
+ });
+ dojo.style(this._centerNode, "display", "none");
+ this.connect(this._underlayNode, "onclick", "_ignore");
+
+ //Last thing to do is move the widgets parent, if any, to the current document body.
+ //Avoids having to deal with parent relative/absolute mess. Otherwise positioning
+ //tends to go goofy.
+ if(this.domNode.parentNode && this.domNode.parentNode != dojo.body()){
+ dojo.body().appendChild(this.domNode);
+ }
+
+ //IE 7 has a horrible bug with zoom, so we have to create this node
+ //to cross-check later. Sigh.
+ if(dojo.isIE == 7){
+ this._ieFixNode = dojo.doc.createElement("div");
+ dojo.style(this._ieFixNode, {
+ opacity: "0",
+ zIndex: "-1000",
+ position: "absolute",
+ top: "-1000px"
+ });
+ dojo.body().appendChild(this._ieFixNode);
+ }
+ }
+ },
+
+ show: function(){
+ // summary:
+ // Function to display the blocking overlay and busy/status icon or text.
+ if(!this._displayed){
+ if(this._anim){
+ this._anim.stop();
+ delete this._anim;
+ }
+ this._displayed = true;
+ this._size();
+ this._disableOverflow();
+ this._fadeIn();
+ }
+ },
+
+ hide: function(){
+ // summary:
+ // Function to hide the blocking overlay and status icon or text.
+ if(this._displayed){
+ if(this._anim){
+ this._anim.stop();
+ delete this._anim;
+ }
+ this._size();
+ this._fadeOut();
+ this._displayed = false;
+ if(this._resizeCheck !== null){
+ clearInterval(this._resizeCheck);
+ this._resizeCheck = null;
+ }
+ }
+ },
+
+ isVisible: function(){
+ // summary:
+ // Helper function so you can test if the widget is already visible or not.
+ // returns:
+ // boolean indicating if the widget is in 'show' state or not.
+ return this._displayed; // boolean
+ },
+
+ onShow: function(){
+ // summary:
+ // Event that fires when the display of the Standby completes.
+ },
+
+ onHide: function(){
+ // summary:
+ // Event that fires when the display of the Standby completes.
+ },
+
+ uninitialize: function(){
+ // summary:
+ // Over-ride to hide the widget, which clears intervals, before cleanup.
+ this._displayed = false;
+ if(this._resizeCheck){
+ clearInterval(this._resizeCheck);
+ }
+ dojo.style(this._centerNode, "display", "none");
+ dojo.style(this._underlayNode, "display", "none");
+ if(dojo.isIE == 7){
+ dojo.body().removeChild(this._ieFixNode);
+ delete this._ieFixNode;
+ }
+ if(this._anim){
+ this._anim.stop();
+ delete this._anim;
+ }
+ this.target = null;
+ this._imageNode = null;
+ this._textNode = null;
+ this._centerNode = null;
+ this.inherited(arguments);
+ },
+
+ _size: function(){
+ // summary:
+ // Internal function that handles resizing the overlay and
+ // centering of the image on window resizing.
+ // tags:
+ // private
+ if(this._displayed){
+ var dir = dojo.attr(dojo.body(), "dir");
+ if(dir){dir = dir.toLowerCase();}
+ var _ie7zoom;
+ var scrollers = this._scrollerWidths();
+
+ var target = this.target;
+
+ //Show the image and make sure the zIndex is set high.
+ var curStyle = dojo.style(this._centerNode, "display");
+ dojo.style(this._centerNode, "display", "block");
+ var box = dojo.position(target, true);
+ if(target === dojo.body() || target === dojo.doc){
+ // Target is the whole doc, so scale to viewport.
+ box = dojo.window.getBox();
+ box.x = box.l;
+ box.y = box.t;
+ }
+
+ var cntrIndicator = dojo.marginBox(this._centerNode);
+ dojo.style(this._centerNode, "display", curStyle);
+
+ //IE has a horrible zoom bug. So, we have to try and account for
+ //it and fix up the scaling.
+ if(this._ieFixNode){
+ _ie7zoom = -this._ieFixNode.offsetTop / 1000;
+ box.x = Math.floor((box.x + 0.9) / _ie7zoom);
+ box.y = Math.floor((box.y + 0.9) / _ie7zoom);
+ box.w = Math.floor((box.w + 0.9) / _ie7zoom);
+ box.h = Math.floor((box.h + 0.9) / _ie7zoom);
+ }
+
+ //Figure out how to zIndex this thing over the target.
+ var zi = dojo.style(target, "zIndex");
+ var ziUl = zi;
+ var ziIn = zi;
+
+ if(this.zIndex === "auto"){
+ if(zi != "auto"){
+ ziUl = parseInt(ziUl, 10) + 1;
+ ziIn = parseInt(ziIn, 10) + 2;
+ }else{
+ //We need to search up the chain to see if there
+ //are any parent zIndexs to overlay.
+ var cNode = target.parentNode;
+ var oldZi = -100000;
+ while(cNode && cNode !== dojo.body()){
+ zi = dojo.style(cNode, "zIndex");
+ if(!zi || zi === "auto"){
+ cNode = cNode.parentNode;
+ }else{
+ var newZi = parseInt(zi, 10);
+ if(oldZi < newZi){
+ oldZi = newZi;
+ ziUl = newZi + 1;
+ ziIn = newZi + 2;
+ }
+ // Keep looking until we run out, we want the highest zIndex.
+ cNode = cNode.parentNode;
+ }
+ }
+ }
+ }else{
+ ziUl = parseInt(this.zIndex, 10) + 1;
+ ziIn = parseInt(this.zIndex, 10) + 2;
+ }
+
+ dojo.style(this._centerNode, "zIndex", ziIn);
+ dojo.style(this._underlayNode, "zIndex", ziUl);
+
+
+ var pn = target.parentNode;
+ if(pn && pn !== dojo.body() &&
+ target !== dojo.body() &&
+ target !== dojo.doc){
+
+ // If the parent is the body tag itself,
+ // we can avoid all this, the body takes
+ // care of overflow for me. Besides, browser
+ // weirdness with height and width on body causes
+ // problems with this sort of intersect testing
+ // anyway.
+ var obh = box.h;
+ var obw = box.w;
+ var pnBox = dojo.position(pn, true);
+
+ //More IE zoom corrections. Grr.
+ if(this._ieFixNode){
+ _ie7zoom = -this._ieFixNode.offsetTop / 1000;
+ pnBox.x = Math.floor((pnBox.x + 0.9) / _ie7zoom);
+ pnBox.y = Math.floor((pnBox.y + 0.9) / _ie7zoom);
+ pnBox.w = Math.floor((pnBox.w + 0.9) / _ie7zoom);
+ pnBox.h = Math.floor((pnBox.h + 0.9) / _ie7zoom);
+ }
+
+ //Shift the parent width/height a bit if scollers are present.
+ pnBox.w -= pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ pnBox.h -= pn.scrollWidth > pn.clientWidth &&
+ pn.clientWidth > 0 ? scrollers.h: 0;
+
+ //RTL requires a bit of massaging in some cases
+ //(and differently depending on browser, ugh!)
+ //WebKit and others still need work.
+ if(dir === "rtl"){
+ if(dojo.isOpera){
+ box.x += pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ pnBox.x += pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ }else if(dojo.isIE){
+ pnBox.x += pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ }else if(dojo.isWebKit){
+ //TODO: FIX THIS!
+ }
+ }
+
+ //Figure out if we need to adjust the overlay to fit a viewable
+ //area, then resize it, we saved the original height/width above.
+ //This is causing issues on IE. Argh!
+ if(pnBox.w < box.w){
+ //Scale down the width if necessary.
+ box.w = box.w - pnBox.w;
+ }
+ if(pnBox.h < box.h){
+ //Scale down the width if necessary.
+ box.h = box.h - pnBox.h;
+ }
+
+ //Look at the y positions and see if we intersect with the
+ //viewport borders. Will have to do computations off it.
+ var vpTop = pnBox.y;
+ var vpBottom = pnBox.y + pnBox.h;
+ var bTop = box.y;
+ var bBottom = box.y + obh;
+ var vpLeft = pnBox.x;
+ var vpRight = pnBox.x + pnBox.w;
+ var bLeft = box.x;
+ var bRight = box.x + obw;
+ var delta;
+ //Adjust the height now
+ if(bBottom > vpTop &&
+ bTop < vpTop){
+ box.y = pnBox.y;
+ //intersecting top, need to do some shifting.
+ delta = vpTop - bTop;
+ var visHeight = obh - delta;
+ //If the visible height < viewport height,
+ //We need to shift it.
+ if(visHeight < pnBox.h){
+ box.h = visHeight;
+ }else{
+ //Deal with horizontal scrollbars if necessary.
+ box.h -= 2*(pn.scrollWidth > pn.clientWidth &&
+ pn.clientWidth > 0? scrollers.h: 0);
+ }
+ }else if(bTop < vpBottom && bBottom > vpBottom){
+ //Intersecting bottom, just figure out how much
+ //overlay to show.
+ box.h = vpBottom - bTop;
+ }else if(bBottom <= vpTop || bTop >= vpBottom){
+ //Outside view, hide it.
+ box.h = 0;
+ }
+
+ //adjust width
+ if(bRight > vpLeft && bLeft < vpLeft){
+ box.x = pnBox.x;
+ //intersecting left, need to do some shifting.
+ delta = vpLeft - bLeft;
+ var visWidth = obw - delta;
+ //If the visible width < viewport width,
+ //We need to shift it.
+ if(visWidth < pnBox.w){
+ box.w = visWidth;
+ }else{
+ //Deal with horizontal scrollbars if necessary.
+ box.w -= 2*(pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0? scrollers.w:0);
+ }
+ }else if(bLeft < vpRight && bRight > vpRight){
+ //Intersecting right, just figure out how much
+ //overlay to show.
+ box.w = vpRight - bLeft;
+ }else if(bRight <= vpLeft || bLeft >= vpRight){
+ //Outside view, hide it.
+ box.w = 0;
+ }
+ }
+
+ if(box.h > 0 && box.w > 0){
+ //Set position and size of the blocking div overlay.
+ dojo.style(this._underlayNode, {
+ display: "block",
+ width: box.w + "px",
+ height: box.h + "px",
+ top: box.y + "px",
+ left: box.x + "px"
+ });
+
+ var styles = ["borderRadius", "borderTopLeftRadius",
+ "borderTopRightRadius","borderBottomLeftRadius",
+ "borderBottomRightRadius"];
+ this._cloneStyles(styles);
+ if(!dojo.isIE){
+ //Browser specific styles to try and clone if non-IE.
+ styles = ["MozBorderRadius", "MozBorderRadiusTopleft",
+ "MozBorderRadiusTopright","MozBorderRadiusBottomleft",
+ "MozBorderRadiusBottomright","WebkitBorderRadius",
+ "WebkitBorderTopLeftRadius", "WebkitBorderTopRightRadius",
+ "WebkitBorderBottomLeftRadius","WebkitBorderBottomRightRadius"
+ ];
+ this._cloneStyles(styles, this);
+ }
+ var cntrIndicatorTop = (box.h/2) - (cntrIndicator.h/2);
+ var cntrIndicatorLeft = (box.w/2) - (cntrIndicator.w/2);
+ //Only show the image if there is height and width room.
+ if(box.h >= cntrIndicator.h && box.w >= cntrIndicator.w){
+ dojo.style(this._centerNode, {
+ top: (cntrIndicatorTop + box.y) + "px",
+ left: (cntrIndicatorLeft + box.x) + "px",
+ display: "block"
+ });
+ }else{
+ dojo.style(this._centerNode, "display", "none");
+ }
+ }else{
+ //Target has no size, display nothing on it!
+ dojo.style(this._underlayNode, "display", "none");
+ dojo.style(this._centerNode, "display", "none");
+ }
+ if(this._resizeCheck === null){
+ //Set an interval timer that checks the target size and scales as needed.
+ //Checking every 10th of a second seems to generate a fairly smooth update.
+ var self = this;
+ this._resizeCheck = setInterval(function(){self._size();}, 100);
+ }
+ }
+ },
+
+ _cloneStyles: function(list){
+ // summary:
+ // Internal function to clone a set of styles from the target to
+ // the underlay.
+ // list: Array
+ // An array of style names to clone.
+ //
+ // tags:
+ // private
+ dojo.forEach(list, function(style){
+ dojo.style(this._underlayNode,style,dojo.style(this.target,style));
+ }, this);
+ },
+
+ _fadeIn: function(){
+ // summary:
+ // Internal function that does the opacity style fade in animation.
+ // tags:
+ // private
+ var self = this;
+ var underlayNodeAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._underlayNode,
+ properties: {opacity: {start: 0, end: 0.75}}
+ });
+ var imageAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._centerNode,
+ properties: {opacity: {start: 0, end: 1}},
+ onEnd: function(){
+ self.onShow();
+ delete self._anim;
+ }
+ });
+ this._anim = dojo.fx.combine([underlayNodeAnim,imageAnim]);
+ this._anim.play();
+ },
+
+ _fadeOut: function(){
+ // summary:
+ // Internal function that does the opacity style fade out animation.
+ // tags:
+ // private
+ var self = this;
+ var underlayNodeAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._underlayNode,
+ properties: {opacity: {start: 0.75, end: 0}},
+ onEnd: function(){
+ dojo.style(this.node,{"display":"none", "zIndex": "-1000"});
+ }
+ });
+ var imageAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._centerNode,
+ properties: {opacity: {start: 1, end: 0}},
+ onEnd: function(){
+ dojo.style(this.node,{"display":"none", "zIndex": "-1000"});
+ self.onHide();
+ self._enableOverflow();
+ delete self._anim;
+ }
+ });
+ this._anim = dojo.fx.combine([underlayNodeAnim,imageAnim]);
+ this._anim.play();
+ },
+
+ _ignore: function(event){
+ // summary:
+ // Function to ignore events that occur on the overlay.
+ // event: Event
+ // The event to halt
+ // tags:
+ // private
+ if(event){
+ dojo.stopEvent(event);
+ }
+ },
+
+ _scrollerWidths: function(){
+ // summary:
+ // This function will calculate the size of the vertical and
+ // horizontaol scrollbars.
+ // returns:
+ // Object of form: {v: Number, h: Number} where v is vertical scrollbar width
+ // and h is horizontal scrollbar width.
+ // tags:
+ // private
+ var div = dojo.doc.createElement("div");
+ dojo.style(div, {
+ position: "absolute",
+ opacity: 0,
+ overflow: "hidden",
+ width: "50px",
+ height: "50px",
+ zIndex: "-100",
+ top: "-200px",
+ left: "-200px",
+ padding: "0px",
+ margin: "0px"
+ });
+ var iDiv = dojo.doc.createElement("div");
+ dojo.style(iDiv, {
+ width: "200px",
+ height: "10px"
+ });
+ div.appendChild(iDiv);
+ dojo.body().appendChild(div);
+
+ //Figure out content size before and after
+ //scrollbars are there, then just subtract to
+ //get width.
+ var b = dojo.contentBox(div);
+ dojo.style(div, "overflow", "scroll");
+ var a = dojo.contentBox(div);
+ dojo.body().removeChild(div);
+ return { v: b.w - a.w, h: b.h - a.h };
+ },
+
+ /* The following are functions that tie into _Widget.attr() */
+
+ _setTextAttr: function(text){
+ // summary:
+ // Function to allow widget.attr to set the text displayed in center
+ // if using text display.
+ // text: String
+ // The text to set.
+ this._textNode.innerHTML = text;
+ this.text = text;
+ },
+
+ _setColorAttr: function(c){
+ // summary:
+ // Function to allow widget.attr to set the color used for the translucent
+ // div overlay.
+ // c: String
+ // The color to set the background underlay to in #XXXXXX format..
+ dojo.style(this._underlayNode, "backgroundColor", c);
+ this.color = c;
+ },
+
+ _setImageTextAttr: function(text){
+ // summary:
+ // Function to allow widget.attr to set the ALT text text displayed for
+ // the image (if using image center display).
+ // text: String
+ // The text to set.
+ dojo.attr(this._imageNode, "alt", text);
+ this.imageText = text;
+ },
+
+ _setImageAttr: function(url){
+ // summary:
+ // Function to allow widget.attr to set the url source for the center image
+ // text: String
+ // The url to set for the image.
+ dojo.attr(this._imageNode, "src", url);
+ this.image = url;
+ },
+
+ _setCenterIndicatorAttr: function(indicator){
+ // summary:
+ // Function to allow widget.attr to set the node used for the center indicator,
+ // either the image or the text.
+ // indicator: String
+ // The indicator to use, either 'image' or 'text'.
+ this.centerIndicator = indicator;
+ if(indicator === "image"){
+ this._centerNode = this._imageNode;
+ dojo.style(this._textNode, "display", "none");
+ }else{
+ this._centerNode = this._textNode;
+ dojo.style(this._imageNode, "display", "none");
+ }
+ },
+
+ _disableOverflow: function(){
+ // summary:
+ // Function to disable scrollbars on the body. Only used if the overlay
+ // targets the body or the document.
+ if(this.target === dojo.body() || this.target === dojo.doc){
+ // Store the overflow state we have to restore later.
+ // IE had issues, so have to check that it's defined. Ugh.
+ this._overflowDisabled = true;
+ var body = dojo.body();
+ if(body.style && body.style.overflow){
+ this._oldOverflow = dojo.style(body, "overflow");
+ }else{
+ this._oldOverflow = "";
+ }
+ if(dojo.isIE && !dojo.isQuirks){
+ // IE will put scrollbars in anyway, html (parent of body)
+ // also controls them in standards mode, so we have to
+ // remove them, argh.
+ if(body.parentNode &&
+ body.parentNode.style &&
+ body.parentNode.style.overflow){
+ this._oldBodyParentOverflow = body.parentNode.style.overflow;
+ }else{
+ try{
+ this._oldBodyParentOverflow = dojo.style(body.parentNode, "overflow");
+ }catch(e){
+ this._oldBodyParentOverflow = "scroll";
+ }
+ }
+ dojo.style(body.parentNode, "overflow", "hidden");
+ }
+ dojo.style(body, "overflow", "hidden");
+ }
+ },
+
+ _enableOverflow: function(){
+ // summary:
+ // Function to restore scrollbars on the body. Only used if the overlay
+ // targets the body or the document.
+ if(this._overflowDisabled){
+ delete this._overflowDisabled;
+ var body = dojo.body();
+ // Restore all the overflow.
+ if(dojo.isIE && !dojo.isQuirks){
+ body.parentNode.style.overflow = this._oldBodyParentOverflow;
+ delete this._oldBodyParentOverflow;
+ }
+ dojo.style(body, "overflow", this._oldOverflow);
+ if(dojo.isWebKit){
+ //Gotta poke WebKit, or scrollers don't come back. :-(
+ var div = dojo.create("div", { style: {
+ height: "2px"
+ }
+ });
+ body.appendChild(div);
+ setTimeout(function(){
+ body.removeChild(div);
+ }, 0);
+ }
+ delete this._oldOverflow;
+ }
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Standby.xd.js b/js/dojo-1.6/dojox/widget/Standby.xd.js new file mode 100644 index 0000000..f6477e6 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Standby.xd.js @@ -0,0 +1,769 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Standby"],
+["require", "dojo.window"],
+["require", "dojo.fx"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Standby"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Standby"] = true;
+dojo.provide("dojox.widget.Standby");
+dojo.require("dojo.window");
+dojo.require("dojo.fx");
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+
+
+dojo.experimental("dojox.widget.Standby");
+
+dojo.declare("dojox.widget.Standby",[dijit._Widget, dijit._Templated],{
+ // summary:
+ // A widget designed to act as a Standby/Busy/Disable/Blocking widget to indicate a
+ // particular DOM node is processing and cannot be clicked on at this time.
+ // This widget uses absolute positioning to apply the overlay and image.
+ //
+ // image:
+ // A URL to an image to center within the blocking overlay.
+ // The default is a basic spinner.
+ //
+ // imageText:
+ // Text to set on the ALT tag of the image.
+ // The default is 'Please wait...'
+ //
+ // text:
+ // Text to display in the center instead of an image.
+ // Defaults to 'Please Wait...'
+ //
+ // centerIndicator:
+ // Which to use as the center info, the text or the image.
+ // Defaults to image.
+ //
+ // color:
+ // The color to use for the translucent overlay.
+ // Text string such as: darkblue, #FE02FD, etc.
+ //
+ // duration:
+ // How long the fade in and out effects should run in milliseconds.
+ // Default is 500ms
+ //
+ // zIndex:
+ // Control that lets you specify if the zIndex for the overlay
+ // should be auto-computed based off parent zIndex, or should be set
+ // to a particular value. This is useful when you want to overlay
+ // things in digit.Dialogs, you can specify a base zIndex to append from.
+ // Default is 'auto'.
+
+ // templateString: [protected] String
+ // The template string defining out the basics of the widget. No need for an external
+ // file.
+ templateString:
+ "<div>" +
+ "<div style=\"display: none; opacity: 0; z-index: 9999; " +
+ "position: absolute; cursor:wait;\" dojoAttachPoint=\"_underlayNode\"></div>" +
+ "<img src=\"${image}\" style=\"opacity: 0; display: none; z-index: -10000; " +
+ "position: absolute; top: 0px; left: 0px; cursor:wait;\" "+
+ "dojoAttachPoint=\"_imageNode\">" +
+ "<div style=\"opacity: 0; display: none; z-index: -10000; position: absolute; " +
+ "top: 0px;\" dojoAttachPoint=\"_textNode\"></div>" +
+ "</div>",
+
+ // _underlayNode: [private] DOMNode
+ // The node that is the translucent underlay for the
+ // image that blocks access to the target.
+ _underlayNode: null,
+
+ // _imageNode: [private] DOMNode
+ // The image node where we attach and define the image to display.
+ _imageNode: null,
+
+ // _textNode: [private] DOMNode
+ // The div to attach text/HTML in the overlay center item.
+ _textNode: null,
+
+ // _centerNode: [private] DOMNode
+ // Which node to use as the center node, the image or the text node.
+ _centerNode: null,
+
+ // image: String
+ // The URL to the image to center in the overlay.
+ image: dojo.moduleUrl("dojox", "widget/Standby/images/loading.gif").toString(),
+
+ // imageText: String
+ // Text for the ALT tag.
+ imageText: "Please Wait...",
+
+ // text: String
+ // Text/HTML to display in the center of the overlay
+ // This is used if image center is disabled.
+ text: "Please wait...",
+
+ // centerIndicator: String
+ // Property to define if the image and its alt text should be used, or
+ // a simple Text/HTML node should be used. Allowable values are 'image'
+ // and 'text'.
+ // Default is 'image'.
+ centerIndicator: "image",
+
+ // _displayed: [private] Boolean
+ // Flag to indicate if the overlay is displayed or not.
+ _displayed: false,
+
+ // _resizeCheck: [private] Object
+ // Handle to interval function that checks the target for changes.
+ _resizeCheck: null,
+
+ // target: DOMNode||DOMID(String)||WidgetID(String)
+ // The target to overlay when active. Can be a widget id, a
+ // dom id, or a direct node reference.
+ target: "",
+
+ // color: String
+ // The color to set the overlay. Should be in #XXXXXX form.
+ // Default color for the translucent overlay is light gray.
+ color: "#C0C0C0",
+
+ // duration: integer
+ // Integer defining how long the show and hide effects should take.
+ duration: 500,
+
+ // _started: [private] Boolean
+ // Trap flag to ensure startup only processes once.
+ _started: false,
+
+ // _parent: [private] DOMNode
+ // Wrapping div for the widget, also used for IE 7 in dealing with the
+ // zoom issue.
+ _parent: null,
+
+ // zIndex: String
+ // Control that lets you specify if the zIndex for the overlay
+ // should be auto-computed based off parent zIndex, or should be set
+ // to a particular value. This is useful when you want to overlay
+ // things in digit.Dialogs, you can specify a base zIndex to append from.
+ zIndex: "auto",
+
+ startup: function(args){
+ // summary:
+ // Over-ride of the basic widget startup function.
+ // Configures the target node and sets the image to use.
+ if(!this._started){
+ if(typeof this.target === "string"){
+ var w = dijit.byId(this.target);
+ if(w){
+ this.target = w.domNode;
+ }else{
+ this.target = dojo.byId(this.target);
+ }
+ }
+
+ if(this.text){
+ this._textNode.innerHTML = this.text;
+ }
+ if(this.centerIndicator === "image"){
+ this._centerNode = this._imageNode;
+ dojo.attr(this._imageNode, "src", this.image);
+ dojo.attr(this._imageNode, "alt", this.imageText);
+ }else{
+ this._centerNode = this._textNode;
+ }
+ dojo.style(this._underlayNode, {
+ display: "none",
+ backgroundColor: this.color
+ });
+ dojo.style(this._centerNode, "display", "none");
+ this.connect(this._underlayNode, "onclick", "_ignore");
+
+ //Last thing to do is move the widgets parent, if any, to the current document body.
+ //Avoids having to deal with parent relative/absolute mess. Otherwise positioning
+ //tends to go goofy.
+ if(this.domNode.parentNode && this.domNode.parentNode != dojo.body()){
+ dojo.body().appendChild(this.domNode);
+ }
+
+ //IE 7 has a horrible bug with zoom, so we have to create this node
+ //to cross-check later. Sigh.
+ if(dojo.isIE == 7){
+ this._ieFixNode = dojo.doc.createElement("div");
+ dojo.style(this._ieFixNode, {
+ opacity: "0",
+ zIndex: "-1000",
+ position: "absolute",
+ top: "-1000px"
+ });
+ dojo.body().appendChild(this._ieFixNode);
+ }
+ }
+ },
+
+ show: function(){
+ // summary:
+ // Function to display the blocking overlay and busy/status icon or text.
+ if(!this._displayed){
+ if(this._anim){
+ this._anim.stop();
+ delete this._anim;
+ }
+ this._displayed = true;
+ this._size();
+ this._disableOverflow();
+ this._fadeIn();
+ }
+ },
+
+ hide: function(){
+ // summary:
+ // Function to hide the blocking overlay and status icon or text.
+ if(this._displayed){
+ if(this._anim){
+ this._anim.stop();
+ delete this._anim;
+ }
+ this._size();
+ this._fadeOut();
+ this._displayed = false;
+ if(this._resizeCheck !== null){
+ clearInterval(this._resizeCheck);
+ this._resizeCheck = null;
+ }
+ }
+ },
+
+ isVisible: function(){
+ // summary:
+ // Helper function so you can test if the widget is already visible or not.
+ // returns:
+ // boolean indicating if the widget is in 'show' state or not.
+ return this._displayed; // boolean
+ },
+
+ onShow: function(){
+ // summary:
+ // Event that fires when the display of the Standby completes.
+ },
+
+ onHide: function(){
+ // summary:
+ // Event that fires when the display of the Standby completes.
+ },
+
+ uninitialize: function(){
+ // summary:
+ // Over-ride to hide the widget, which clears intervals, before cleanup.
+ this._displayed = false;
+ if(this._resizeCheck){
+ clearInterval(this._resizeCheck);
+ }
+ dojo.style(this._centerNode, "display", "none");
+ dojo.style(this._underlayNode, "display", "none");
+ if(dojo.isIE == 7){
+ dojo.body().removeChild(this._ieFixNode);
+ delete this._ieFixNode;
+ }
+ if(this._anim){
+ this._anim.stop();
+ delete this._anim;
+ }
+ this.target = null;
+ this._imageNode = null;
+ this._textNode = null;
+ this._centerNode = null;
+ this.inherited(arguments);
+ },
+
+ _size: function(){
+ // summary:
+ // Internal function that handles resizing the overlay and
+ // centering of the image on window resizing.
+ // tags:
+ // private
+ if(this._displayed){
+ var dir = dojo.attr(dojo.body(), "dir");
+ if(dir){dir = dir.toLowerCase();}
+ var _ie7zoom;
+ var scrollers = this._scrollerWidths();
+
+ var target = this.target;
+
+ //Show the image and make sure the zIndex is set high.
+ var curStyle = dojo.style(this._centerNode, "display");
+ dojo.style(this._centerNode, "display", "block");
+ var box = dojo.position(target, true);
+ if(target === dojo.body() || target === dojo.doc){
+ // Target is the whole doc, so scale to viewport.
+ box = dojo.window.getBox();
+ box.x = box.l;
+ box.y = box.t;
+ }
+
+ var cntrIndicator = dojo.marginBox(this._centerNode);
+ dojo.style(this._centerNode, "display", curStyle);
+
+ //IE has a horrible zoom bug. So, we have to try and account for
+ //it and fix up the scaling.
+ if(this._ieFixNode){
+ _ie7zoom = -this._ieFixNode.offsetTop / 1000;
+ box.x = Math.floor((box.x + 0.9) / _ie7zoom);
+ box.y = Math.floor((box.y + 0.9) / _ie7zoom);
+ box.w = Math.floor((box.w + 0.9) / _ie7zoom);
+ box.h = Math.floor((box.h + 0.9) / _ie7zoom);
+ }
+
+ //Figure out how to zIndex this thing over the target.
+ var zi = dojo.style(target, "zIndex");
+ var ziUl = zi;
+ var ziIn = zi;
+
+ if(this.zIndex === "auto"){
+ if(zi != "auto"){
+ ziUl = parseInt(ziUl, 10) + 1;
+ ziIn = parseInt(ziIn, 10) + 2;
+ }else{
+ //We need to search up the chain to see if there
+ //are any parent zIndexs to overlay.
+ var cNode = target.parentNode;
+ var oldZi = -100000;
+ while(cNode && cNode !== dojo.body()){
+ zi = dojo.style(cNode, "zIndex");
+ if(!zi || zi === "auto"){
+ cNode = cNode.parentNode;
+ }else{
+ var newZi = parseInt(zi, 10);
+ if(oldZi < newZi){
+ oldZi = newZi;
+ ziUl = newZi + 1;
+ ziIn = newZi + 2;
+ }
+ // Keep looking until we run out, we want the highest zIndex.
+ cNode = cNode.parentNode;
+ }
+ }
+ }
+ }else{
+ ziUl = parseInt(this.zIndex, 10) + 1;
+ ziIn = parseInt(this.zIndex, 10) + 2;
+ }
+
+ dojo.style(this._centerNode, "zIndex", ziIn);
+ dojo.style(this._underlayNode, "zIndex", ziUl);
+
+
+ var pn = target.parentNode;
+ if(pn && pn !== dojo.body() &&
+ target !== dojo.body() &&
+ target !== dojo.doc){
+
+ // If the parent is the body tag itself,
+ // we can avoid all this, the body takes
+ // care of overflow for me. Besides, browser
+ // weirdness with height and width on body causes
+ // problems with this sort of intersect testing
+ // anyway.
+ var obh = box.h;
+ var obw = box.w;
+ var pnBox = dojo.position(pn, true);
+
+ //More IE zoom corrections. Grr.
+ if(this._ieFixNode){
+ _ie7zoom = -this._ieFixNode.offsetTop / 1000;
+ pnBox.x = Math.floor((pnBox.x + 0.9) / _ie7zoom);
+ pnBox.y = Math.floor((pnBox.y + 0.9) / _ie7zoom);
+ pnBox.w = Math.floor((pnBox.w + 0.9) / _ie7zoom);
+ pnBox.h = Math.floor((pnBox.h + 0.9) / _ie7zoom);
+ }
+
+ //Shift the parent width/height a bit if scollers are present.
+ pnBox.w -= pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ pnBox.h -= pn.scrollWidth > pn.clientWidth &&
+ pn.clientWidth > 0 ? scrollers.h: 0;
+
+ //RTL requires a bit of massaging in some cases
+ //(and differently depending on browser, ugh!)
+ //WebKit and others still need work.
+ if(dir === "rtl"){
+ if(dojo.isOpera){
+ box.x += pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ pnBox.x += pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ }else if(dojo.isIE){
+ pnBox.x += pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0 ? scrollers.v: 0;
+ }else if(dojo.isWebKit){
+ //TODO: FIX THIS!
+ }
+ }
+
+ //Figure out if we need to adjust the overlay to fit a viewable
+ //area, then resize it, we saved the original height/width above.
+ //This is causing issues on IE. Argh!
+ if(pnBox.w < box.w){
+ //Scale down the width if necessary.
+ box.w = box.w - pnBox.w;
+ }
+ if(pnBox.h < box.h){
+ //Scale down the width if necessary.
+ box.h = box.h - pnBox.h;
+ }
+
+ //Look at the y positions and see if we intersect with the
+ //viewport borders. Will have to do computations off it.
+ var vpTop = pnBox.y;
+ var vpBottom = pnBox.y + pnBox.h;
+ var bTop = box.y;
+ var bBottom = box.y + obh;
+ var vpLeft = pnBox.x;
+ var vpRight = pnBox.x + pnBox.w;
+ var bLeft = box.x;
+ var bRight = box.x + obw;
+ var delta;
+ //Adjust the height now
+ if(bBottom > vpTop &&
+ bTop < vpTop){
+ box.y = pnBox.y;
+ //intersecting top, need to do some shifting.
+ delta = vpTop - bTop;
+ var visHeight = obh - delta;
+ //If the visible height < viewport height,
+ //We need to shift it.
+ if(visHeight < pnBox.h){
+ box.h = visHeight;
+ }else{
+ //Deal with horizontal scrollbars if necessary.
+ box.h -= 2*(pn.scrollWidth > pn.clientWidth &&
+ pn.clientWidth > 0? scrollers.h: 0);
+ }
+ }else if(bTop < vpBottom && bBottom > vpBottom){
+ //Intersecting bottom, just figure out how much
+ //overlay to show.
+ box.h = vpBottom - bTop;
+ }else if(bBottom <= vpTop || bTop >= vpBottom){
+ //Outside view, hide it.
+ box.h = 0;
+ }
+
+ //adjust width
+ if(bRight > vpLeft && bLeft < vpLeft){
+ box.x = pnBox.x;
+ //intersecting left, need to do some shifting.
+ delta = vpLeft - bLeft;
+ var visWidth = obw - delta;
+ //If the visible width < viewport width,
+ //We need to shift it.
+ if(visWidth < pnBox.w){
+ box.w = visWidth;
+ }else{
+ //Deal with horizontal scrollbars if necessary.
+ box.w -= 2*(pn.scrollHeight > pn.clientHeight &&
+ pn.clientHeight > 0? scrollers.w:0);
+ }
+ }else if(bLeft < vpRight && bRight > vpRight){
+ //Intersecting right, just figure out how much
+ //overlay to show.
+ box.w = vpRight - bLeft;
+ }else if(bRight <= vpLeft || bLeft >= vpRight){
+ //Outside view, hide it.
+ box.w = 0;
+ }
+ }
+
+ if(box.h > 0 && box.w > 0){
+ //Set position and size of the blocking div overlay.
+ dojo.style(this._underlayNode, {
+ display: "block",
+ width: box.w + "px",
+ height: box.h + "px",
+ top: box.y + "px",
+ left: box.x + "px"
+ });
+
+ var styles = ["borderRadius", "borderTopLeftRadius",
+ "borderTopRightRadius","borderBottomLeftRadius",
+ "borderBottomRightRadius"];
+ this._cloneStyles(styles);
+ if(!dojo.isIE){
+ //Browser specific styles to try and clone if non-IE.
+ styles = ["MozBorderRadius", "MozBorderRadiusTopleft",
+ "MozBorderRadiusTopright","MozBorderRadiusBottomleft",
+ "MozBorderRadiusBottomright","WebkitBorderRadius",
+ "WebkitBorderTopLeftRadius", "WebkitBorderTopRightRadius",
+ "WebkitBorderBottomLeftRadius","WebkitBorderBottomRightRadius"
+ ];
+ this._cloneStyles(styles, this);
+ }
+ var cntrIndicatorTop = (box.h/2) - (cntrIndicator.h/2);
+ var cntrIndicatorLeft = (box.w/2) - (cntrIndicator.w/2);
+ //Only show the image if there is height and width room.
+ if(box.h >= cntrIndicator.h && box.w >= cntrIndicator.w){
+ dojo.style(this._centerNode, {
+ top: (cntrIndicatorTop + box.y) + "px",
+ left: (cntrIndicatorLeft + box.x) + "px",
+ display: "block"
+ });
+ }else{
+ dojo.style(this._centerNode, "display", "none");
+ }
+ }else{
+ //Target has no size, display nothing on it!
+ dojo.style(this._underlayNode, "display", "none");
+ dojo.style(this._centerNode, "display", "none");
+ }
+ if(this._resizeCheck === null){
+ //Set an interval timer that checks the target size and scales as needed.
+ //Checking every 10th of a second seems to generate a fairly smooth update.
+ var self = this;
+ this._resizeCheck = setInterval(function(){self._size();}, 100);
+ }
+ }
+ },
+
+ _cloneStyles: function(list){
+ // summary:
+ // Internal function to clone a set of styles from the target to
+ // the underlay.
+ // list: Array
+ // An array of style names to clone.
+ //
+ // tags:
+ // private
+ dojo.forEach(list, function(style){
+ dojo.style(this._underlayNode,style,dojo.style(this.target,style));
+ }, this);
+ },
+
+ _fadeIn: function(){
+ // summary:
+ // Internal function that does the opacity style fade in animation.
+ // tags:
+ // private
+ var self = this;
+ var underlayNodeAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._underlayNode,
+ properties: {opacity: {start: 0, end: 0.75}}
+ });
+ var imageAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._centerNode,
+ properties: {opacity: {start: 0, end: 1}},
+ onEnd: function(){
+ self.onShow();
+ delete self._anim;
+ }
+ });
+ this._anim = dojo.fx.combine([underlayNodeAnim,imageAnim]);
+ this._anim.play();
+ },
+
+ _fadeOut: function(){
+ // summary:
+ // Internal function that does the opacity style fade out animation.
+ // tags:
+ // private
+ var self = this;
+ var underlayNodeAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._underlayNode,
+ properties: {opacity: {start: 0.75, end: 0}},
+ onEnd: function(){
+ dojo.style(this.node,{"display":"none", "zIndex": "-1000"});
+ }
+ });
+ var imageAnim = dojo.animateProperty({
+ duration: self.duration,
+ node: self._centerNode,
+ properties: {opacity: {start: 1, end: 0}},
+ onEnd: function(){
+ dojo.style(this.node,{"display":"none", "zIndex": "-1000"});
+ self.onHide();
+ self._enableOverflow();
+ delete self._anim;
+ }
+ });
+ this._anim = dojo.fx.combine([underlayNodeAnim,imageAnim]);
+ this._anim.play();
+ },
+
+ _ignore: function(event){
+ // summary:
+ // Function to ignore events that occur on the overlay.
+ // event: Event
+ // The event to halt
+ // tags:
+ // private
+ if(event){
+ dojo.stopEvent(event);
+ }
+ },
+
+ _scrollerWidths: function(){
+ // summary:
+ // This function will calculate the size of the vertical and
+ // horizontaol scrollbars.
+ // returns:
+ // Object of form: {v: Number, h: Number} where v is vertical scrollbar width
+ // and h is horizontal scrollbar width.
+ // tags:
+ // private
+ var div = dojo.doc.createElement("div");
+ dojo.style(div, {
+ position: "absolute",
+ opacity: 0,
+ overflow: "hidden",
+ width: "50px",
+ height: "50px",
+ zIndex: "-100",
+ top: "-200px",
+ left: "-200px",
+ padding: "0px",
+ margin: "0px"
+ });
+ var iDiv = dojo.doc.createElement("div");
+ dojo.style(iDiv, {
+ width: "200px",
+ height: "10px"
+ });
+ div.appendChild(iDiv);
+ dojo.body().appendChild(div);
+
+ //Figure out content size before and after
+ //scrollbars are there, then just subtract to
+ //get width.
+ var b = dojo.contentBox(div);
+ dojo.style(div, "overflow", "scroll");
+ var a = dojo.contentBox(div);
+ dojo.body().removeChild(div);
+ return { v: b.w - a.w, h: b.h - a.h };
+ },
+
+ /* The following are functions that tie into _Widget.attr() */
+
+ _setTextAttr: function(text){
+ // summary:
+ // Function to allow widget.attr to set the text displayed in center
+ // if using text display.
+ // text: String
+ // The text to set.
+ this._textNode.innerHTML = text;
+ this.text = text;
+ },
+
+ _setColorAttr: function(c){
+ // summary:
+ // Function to allow widget.attr to set the color used for the translucent
+ // div overlay.
+ // c: String
+ // The color to set the background underlay to in #XXXXXX format..
+ dojo.style(this._underlayNode, "backgroundColor", c);
+ this.color = c;
+ },
+
+ _setImageTextAttr: function(text){
+ // summary:
+ // Function to allow widget.attr to set the ALT text text displayed for
+ // the image (if using image center display).
+ // text: String
+ // The text to set.
+ dojo.attr(this._imageNode, "alt", text);
+ this.imageText = text;
+ },
+
+ _setImageAttr: function(url){
+ // summary:
+ // Function to allow widget.attr to set the url source for the center image
+ // text: String
+ // The url to set for the image.
+ dojo.attr(this._imageNode, "src", url);
+ this.image = url;
+ },
+
+ _setCenterIndicatorAttr: function(indicator){
+ // summary:
+ // Function to allow widget.attr to set the node used for the center indicator,
+ // either the image or the text.
+ // indicator: String
+ // The indicator to use, either 'image' or 'text'.
+ this.centerIndicator = indicator;
+ if(indicator === "image"){
+ this._centerNode = this._imageNode;
+ dojo.style(this._textNode, "display", "none");
+ }else{
+ this._centerNode = this._textNode;
+ dojo.style(this._imageNode, "display", "none");
+ }
+ },
+
+ _disableOverflow: function(){
+ // summary:
+ // Function to disable scrollbars on the body. Only used if the overlay
+ // targets the body or the document.
+ if(this.target === dojo.body() || this.target === dojo.doc){
+ // Store the overflow state we have to restore later.
+ // IE had issues, so have to check that it's defined. Ugh.
+ this._overflowDisabled = true;
+ var body = dojo.body();
+ if(body.style && body.style.overflow){
+ this._oldOverflow = dojo.style(body, "overflow");
+ }else{
+ this._oldOverflow = "";
+ }
+ if(dojo.isIE && !dojo.isQuirks){
+ // IE will put scrollbars in anyway, html (parent of body)
+ // also controls them in standards mode, so we have to
+ // remove them, argh.
+ if(body.parentNode &&
+ body.parentNode.style &&
+ body.parentNode.style.overflow){
+ this._oldBodyParentOverflow = body.parentNode.style.overflow;
+ }else{
+ try{
+ this._oldBodyParentOverflow = dojo.style(body.parentNode, "overflow");
+ }catch(e){
+ this._oldBodyParentOverflow = "scroll";
+ }
+ }
+ dojo.style(body.parentNode, "overflow", "hidden");
+ }
+ dojo.style(body, "overflow", "hidden");
+ }
+ },
+
+ _enableOverflow: function(){
+ // summary:
+ // Function to restore scrollbars on the body. Only used if the overlay
+ // targets the body or the document.
+ if(this._overflowDisabled){
+ delete this._overflowDisabled;
+ var body = dojo.body();
+ // Restore all the overflow.
+ if(dojo.isIE && !dojo.isQuirks){
+ body.parentNode.style.overflow = this._oldBodyParentOverflow;
+ delete this._oldBodyParentOverflow;
+ }
+ dojo.style(body, "overflow", this._oldOverflow);
+ if(dojo.isWebKit){
+ //Gotta poke WebKit, or scrollers don't come back. :-(
+ var div = dojo.create("div", { style: {
+ height: "2px"
+ }
+ });
+ body.appendChild(div);
+ setTimeout(function(){
+ body.removeChild(div);
+ }, 0);
+ }
+ delete this._oldOverflow;
+ }
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Standby/images/loading.gif b/js/dojo-1.6/dojox/widget/Standby/images/loading.gif Binary files differnew file mode 100644 index 0000000..e4ab783 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Standby/images/loading.gif diff --git a/js/dojo-1.6/dojox/widget/TitleGroup.js b/js/dojo-1.6/dojox/widget/TitleGroup.js new file mode 100644 index 0000000..197a902 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/TitleGroup.js @@ -0,0 +1,98 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.TitleGroup"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.TitleGroup"] = true;
+dojo.provide("dojox.widget.TitleGroup");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit.TitlePane");
+
+(function(d){
+
+ var tp = dijit.TitlePane.prototype,
+ lookup = function(){
+ // generic handler function for click and keypress
+ var parent = this._dxfindParent && this._dxfindParent();
+ parent && parent.selectChild(this);
+ }
+ ;
+
+ // this might hide this uberprivate function from the docparser.
+ tp._dxfindParent = function(){
+ // summary: TitlePane's MUST be first-children of a TitleGroup. only used by
+ // `dojox.widget.TitleGroup`. Find a possible parent TitleGroup of a TitlePane
+ var n = this.domNode.parentNode;
+ if(n){
+ n = dijit.getEnclosingWidget(n);
+ return n && n instanceof dojox.widget.TitleGroup && n;
+ }
+ return n;
+ };
+
+ // if we click our own title, hide everyone
+ d.connect(tp, "_onTitleClick", lookup);
+ d.connect(tp, "_onTitleKey", function(e){
+ // if we're tabbing through the items in a group, don't do toggles.
+ // if we hit enter, let it happen.
+ if(!(e && e.type && e.type == "keypress" && e.charOrCode == d.keys.TAB)){
+ lookup.apply(this, arguments);
+ }
+ });
+
+ d.declare("dojox.widget.TitleGroup", dijit._Widget, {
+ // summary: A container which controls a series of `dijit.TitlePane`s,
+ // allowing one to be visible and hiding siblings
+ //
+ // description:
+ // A container which controls a series of `dijit.TitlePane`s,
+ // allowing one to be visible and hiding siblings. Behaves similarly
+ // to a `dijit.layout.AccordionContainer` in that the children
+ // are all stacked, though merges the TitlePane behavior of
+ // variable height
+ //
+ // example:
+ // | var group = new dojox.widget.TitleGroup().placeAt(dojo.body());
+ // | new dijit.TitlePane({ title:"One" }, "fromsource").placeAt(group);
+ // | new dijit.TitlePane({ title:"Remote", href:"foo.html" }).placeAt(group);
+
+ "class":"dojoxTitleGroup",
+
+ addChild: function(widget, position){
+ // summary: Add a passed widget reference to this container at an optional
+ // position index.
+ //
+ // widget: dijit.TitlePane
+ // A widget reference to add
+ // position: String?|Int?
+ // An optional index or position to pass. defaults to "last"
+ return widget.placeAt(this.domNode, position); // dijit.TitlePane
+ },
+
+ removeChild: function(widget){
+ // summary: Remove the passed widget from this container. Does not destroy
+ // child.
+
+ this.domNode.removeChild(widget.domNode);
+ return widget;
+ },
+
+ selectChild: function(widget){
+ // summary: close all found titlePanes within this group, excluding
+ // the one the we pass to select
+ widget && dojo.query("> .dijitTitlePane", this.domNode).forEach(function(n){
+ var tp = dijit.getEnclosingWidget(n);
+ tp && tp !== widget && tp.open && tp.set("open", false);
+ });
+ return widget; // dijit.TitlePane
+ }
+
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/TitleGroup.xd.js b/js/dojo-1.6/dojox/widget/TitleGroup.xd.js new file mode 100644 index 0000000..02f7ed6 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/TitleGroup.xd.js @@ -0,0 +1,104 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.TitleGroup"],
+["require", "dijit._Widget"],
+["require", "dijit.TitlePane"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.TitleGroup"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.TitleGroup"] = true;
+dojo.provide("dojox.widget.TitleGroup");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit.TitlePane");
+
+(function(d){
+
+ var tp = dijit.TitlePane.prototype,
+ lookup = function(){
+ // generic handler function for click and keypress
+ var parent = this._dxfindParent && this._dxfindParent();
+ parent && parent.selectChild(this);
+ }
+ ;
+
+ // this might hide this uberprivate function from the docparser.
+ tp._dxfindParent = function(){
+ // summary: TitlePane's MUST be first-children of a TitleGroup. only used by
+ // `dojox.widget.TitleGroup`. Find a possible parent TitleGroup of a TitlePane
+ var n = this.domNode.parentNode;
+ if(n){
+ n = dijit.getEnclosingWidget(n);
+ return n && n instanceof dojox.widget.TitleGroup && n;
+ }
+ return n;
+ };
+
+ // if we click our own title, hide everyone
+ d.connect(tp, "_onTitleClick", lookup);
+ d.connect(tp, "_onTitleKey", function(e){
+ // if we're tabbing through the items in a group, don't do toggles.
+ // if we hit enter, let it happen.
+ if(!(e && e.type && e.type == "keypress" && e.charOrCode == d.keys.TAB)){
+ lookup.apply(this, arguments);
+ }
+ });
+
+ d.declare("dojox.widget.TitleGroup", dijit._Widget, {
+ // summary: A container which controls a series of `dijit.TitlePane`s,
+ // allowing one to be visible and hiding siblings
+ //
+ // description:
+ // A container which controls a series of `dijit.TitlePane`s,
+ // allowing one to be visible and hiding siblings. Behaves similarly
+ // to a `dijit.layout.AccordionContainer` in that the children
+ // are all stacked, though merges the TitlePane behavior of
+ // variable height
+ //
+ // example:
+ // | var group = new dojox.widget.TitleGroup().placeAt(dojo.body());
+ // | new dijit.TitlePane({ title:"One" }, "fromsource").placeAt(group);
+ // | new dijit.TitlePane({ title:"Remote", href:"foo.html" }).placeAt(group);
+
+ "class":"dojoxTitleGroup",
+
+ addChild: function(widget, position){
+ // summary: Add a passed widget reference to this container at an optional
+ // position index.
+ //
+ // widget: dijit.TitlePane
+ // A widget reference to add
+ // position: String?|Int?
+ // An optional index or position to pass. defaults to "last"
+ return widget.placeAt(this.domNode, position); // dijit.TitlePane
+ },
+
+ removeChild: function(widget){
+ // summary: Remove the passed widget from this container. Does not destroy
+ // child.
+
+ this.domNode.removeChild(widget.domNode);
+ return widget;
+ },
+
+ selectChild: function(widget){
+ // summary: close all found titlePanes within this group, excluding
+ // the one the we pass to select
+ widget && dojo.query("> .dijitTitlePane", this.domNode).forEach(function(n){
+ var tp = dijit.getEnclosingWidget(n);
+ tp && tp !== widget && tp.open && tp.set("open", false);
+ });
+ return widget; // dijit.TitlePane
+ }
+
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/TitleGroup/TitleGroup.css b/js/dojo-1.6/dojox/widget/TitleGroup/TitleGroup.css new file mode 100644 index 0000000..e8c3fb3 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/TitleGroup/TitleGroup.css @@ -0,0 +1,28 @@ +/* tundra doesn't appear to need any special css rules */ + +.claro .dojoxTitleGroup .dijitTitlePaneContentOuter { + border-bottom:none; +} + +.claro .dojoxTitleGroup .dijitTitlePaneContentOuter .dijitTitlePaneContentOuter, +.claro .dojoxTitleGroup { + border-bottom:1px solid #B5BCC7; +} + +.soria .dojoxTitleGroup .dijitTitlePaneContentOuter { + border-bottom:none; +} + +.soria .dojoxTitleGroup .dijitTitlePaneContentOuter .dijitTitlePaneContentOuter, +.soria .dojoxTitleGroup { + border-bottom:1px solid #BFBFBF; +} + +.nihilo .dojoxTitleGroup .dijitTitlePaneContentOuter { + border-bottom:none; +} + +.nihilo .dojoxTitleGroup .dijitTitlePaneContentOuter .dijitTitlePaneContentOuter, +.nihilo .dojoxTitleGroup { + border-bottom:1px solid #BFBFBF; +} diff --git a/js/dojo-1.6/dojox/widget/Toaster.js b/js/dojo-1.6/dojox/widget/Toaster.js new file mode 100644 index 0000000..9e39f0f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Toaster.js @@ -0,0 +1,287 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Toaster"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Toaster"] = true;
+dojo.provide("dojox.widget.Toaster");
+
+dojo.require("dojo.fx");
+dojo.require("dojo.window");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+dojo.declare("dojox.widget.Toaster", [dijit._Widget, dijit._Templated], {
+ // summary:
+ // Message that slides in from the corner of the screen, used for notifications
+ // like "new email".
+
+ templateString: '<div class="dijitToasterClip" dojoAttachPoint="clipNode"><div class="dijitToasterContainer" dojoAttachPoint="containerNode" dojoAttachEvent="onclick:onSelect"><div class="dijitToasterContent" dojoAttachPoint="contentNode"></div></div></div>',
+
+ // messageTopic: String
+ // Name of topic; anything published to this topic will be displayed as a message.
+ // Message format is either String or an object like
+ // {message: "hello word", type: "error", duration: 500}
+ messageTopic: "",
+
+ // messageTypes: Enumeration
+ // Possible message types.
+ messageTypes: {
+ MESSAGE: "message",
+ WARNING: "warning",
+ ERROR: "error",
+ FATAL: "fatal"
+ },
+
+ // defaultType: String
+ // If message type isn't specified (see "messageTopic" parameter),
+ // then display message as this type.
+ // Possible values in messageTypes enumeration ("message", "warning", "error", "fatal")
+ defaultType: "message",
+
+ // positionDirection: String
+ // Position from which message slides into screen, one of
+ // ["br-up", "br-left", "bl-up", "bl-right", "tr-down", "tr-left", "tl-down", "tl-right"]
+ positionDirection: "br-up",
+
+ // positionDirectionTypes: Array
+ // Possible values for positionDirection parameter
+ positionDirectionTypes: ["br-up", "br-left", "bl-up", "bl-right", "tr-down", "tr-left", "tl-down", "tl-right"],
+
+ // duration: Integer
+ // Number of milliseconds to show message
+ duration: 2000,
+
+ // slideDuration: Integer
+ // Number of milliseconds for the slide animation, increasing will cause the Toaster
+ // to slide in more slowly.
+ slideDuration: 500,
+
+ //separator: String
+ // String used to separate messages if consecutive calls are made to setContent before previous messages go away
+ separator: "<hr></hr>",
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.hide();
+
+ // place node as a child of body for positioning
+ dojo.body().appendChild(this.domNode);
+
+ if(this.messageTopic){
+ dojo.subscribe(this.messageTopic, this, "_handleMessage");
+ }
+ },
+
+ _handleMessage: function(/*String|Object*/message){
+ if(dojo.isString(message)){
+ this.setContent(message);
+ }else{
+ this.setContent(message.message, message.type, message.duration);
+ }
+ },
+
+ _capitalize: function(/* String */w){
+ return w.substring(0,1).toUpperCase() + w.substring(1);
+ },
+
+ setContent: function(/*String|Function*/message, /*String*/messageType, /*int?*/duration){
+ // summary:
+ // sets and displays the given message and show duration
+ // message:
+ // the message. If this is a function, it will be called with this toaster widget as the only argument.
+ // messageType:
+ // type of message; possible values in messageTypes enumeration ("message", "warning", "error", "fatal")
+ // duration:
+ // duration in milliseconds to display message before removing it. Widget has default value.
+ duration = duration||this.duration;
+ // sync animations so there are no ghosted fades and such
+ if(this.slideAnim){
+ if(this.slideAnim.status() != "playing"){
+ this.slideAnim.stop();
+ }
+ if(this.slideAnim.status() == "playing" || (this.fadeAnim && this.fadeAnim.status() == "playing")){
+ setTimeout(dojo.hitch(this, function(){
+ this.setContent(message, messageType, duration);
+ }), 50);
+ return;
+ }
+ }
+
+ // determine type of content and apply appropriately
+ for(var type in this.messageTypes){
+ dojo.removeClass(this.containerNode, "dijitToaster" + this._capitalize(this.messageTypes[type]));
+ }
+
+ dojo.style(this.containerNode, "opacity", 1);
+
+ this._setContent(message);
+
+ dojo.addClass(this.containerNode, "dijitToaster" + this._capitalize(messageType || this.defaultType));
+
+ // now do funky animation of widget appearing from
+ // bottom right of page and up
+ this.show();
+ var nodeSize = dojo.marginBox(this.containerNode);
+ this._cancelHideTimer();
+ if(this.isVisible){
+ this._placeClip();
+ //update hide timer if no sticky message in stack
+ if(!this._stickyMessage) {
+ this._setHideTimer(duration);
+ }
+ }else{
+ var style = this.containerNode.style;
+ var pd = this.positionDirection;
+ // sets up initial position of container node and slide-out direction
+ if(pd.indexOf("-up") >= 0){
+ style.left=0+"px";
+ style.top=nodeSize.h + 10 + "px";
+ }else if(pd.indexOf("-left") >= 0){
+ style.left=nodeSize.w + 10 +"px";
+ style.top=0+"px";
+ }else if(pd.indexOf("-right") >= 0){
+ style.left = 0 - nodeSize.w - 10 + "px";
+ style.top = 0+"px";
+ }else if(pd.indexOf("-down") >= 0){
+ style.left = 0+"px";
+ style.top = 0 - nodeSize.h - 10 + "px";
+ }else{
+ throw new Error(this.id + ".positionDirection is invalid: " + pd);
+ }
+ this.slideAnim = dojo.fx.slideTo({
+ node: this.containerNode,
+ top: 0, left: 0,
+ duration: this.slideDuration});
+ this.connect(this.slideAnim, "onEnd", function(nodes, anim){
+ //we build the fadeAnim here so we dont have to duplicate it later
+ // can't do a fadeHide because we're fading the
+ // inner node rather than the clipping node
+ this.fadeAnim = dojo.fadeOut({
+ node: this.containerNode,
+ duration: 1000});
+ this.connect(this.fadeAnim, "onEnd", function(evt){
+ this.isVisible = false;
+ this.hide();
+ });
+ this._setHideTimer(duration);
+ this.connect(this, 'onSelect', function(evt){
+ this._cancelHideTimer();
+ //force clear sticky message
+ this._stickyMessage=false;
+ this.fadeAnim.play();
+ });
+
+ this.isVisible = true;
+ });
+ this.slideAnim.play();
+ }
+ },
+
+ _setContent: function(message){
+ if(dojo.isFunction(message)){
+ message(this);
+ return;
+ }
+ if(message && this.isVisible){
+ message = this.contentNode.innerHTML + this.separator + message;
+ }
+ this.contentNode.innerHTML = message;
+ },
+ _cancelHideTimer:function(){
+ if (this._hideTimer){
+ clearTimeout(this._hideTimer);
+ this._hideTimer=null;
+ }
+ },
+
+ _setHideTimer:function(duration){
+ this._cancelHideTimer();
+ //if duration == 0 we keep the message displayed until clicked
+ if(duration>0){
+ this._cancelHideTimer();
+ this._hideTimer=setTimeout(dojo.hitch(this, function(evt){
+ // we must hide the iframe in order to fade
+ // TODO: figure out how to fade with a BackgroundIframe
+ if(this.bgIframe && this.bgIframe.iframe){
+ this.bgIframe.iframe.style.display="none";
+ }
+ this._hideTimer=null;
+ //force clear sticky message
+ this._stickyMessage=false;
+ this.fadeAnim.play();
+ }), duration);
+ }
+ else
+ this._stickyMessage=true;
+ },
+
+ _placeClip: function(){
+ var view = dojo.window.getBox();
+
+ var nodeSize = dojo.marginBox(this.containerNode);
+
+ var style = this.clipNode.style;
+ // sets up the size of the clipping node
+ style.height = nodeSize.h+"px";
+ style.width = nodeSize.w+"px";
+
+ // sets up the position of the clipping node
+ var pd = this.positionDirection;
+ if(pd.match(/^t/)){
+ style.top = view.t+"px";
+ }else if(pd.match(/^b/)){
+ style.top = (view.h - nodeSize.h - 2 + view.t)+"px";
+ }
+ if(pd.match(/^[tb]r-/)){
+ style.left = (view.w - nodeSize.w - 1 - view.l)+"px";
+ }else if(pd.match(/^[tb]l-/)){
+ style.left = 0 + "px";
+ }
+
+ style.clip = "rect(0px, " + nodeSize.w + "px, " + nodeSize.h + "px, 0px)";
+ if(dojo.isIE){
+ if(!this.bgIframe){
+ this.clipNode.id = dijit.getUniqueId("dojox_widget_Toaster_clipNode");
+ this.bgIframe = new dijit.BackgroundIframe(this.clipNode);
+ }
+ var iframe = this.bgIframe.iframe;
+ if(iframe){ iframe.style.display="block"; }
+ }
+ },
+
+ onSelect: function(/*Event*/e){
+ // summary: callback for when user clicks the message
+ },
+
+ show: function(){
+ // summary: show the Toaster
+ dojo.style(this.domNode, 'display', 'block');
+
+ this._placeClip();
+
+ if(!this._scrollConnected){
+ this._scrollConnected = dojo.connect(window, "onscroll", this, this._placeClip);
+ }
+ },
+
+ hide: function(){
+ // summary: hide the Toaster
+
+ dojo.style(this.domNode, 'display', 'none');
+
+ if(this._scrollConnected){
+ dojo.disconnect(this._scrollConnected);
+ this._scrollConnected = false;
+ }
+
+ dojo.style(this.containerNode, "opacity", 1);
+ }
+ }
+);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Toaster.xd.js b/js/dojo-1.6/dojox/widget/Toaster.xd.js new file mode 100644 index 0000000..09ad471 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Toaster.xd.js @@ -0,0 +1,295 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Toaster"],
+["require", "dojo.fx"],
+["require", "dojo.window"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Toaster"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Toaster"] = true;
+dojo.provide("dojox.widget.Toaster");
+
+dojo.require("dojo.fx");
+dojo.require("dojo.window");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+dojo.declare("dojox.widget.Toaster", [dijit._Widget, dijit._Templated], {
+ // summary:
+ // Message that slides in from the corner of the screen, used for notifications
+ // like "new email".
+
+ templateString: '<div class="dijitToasterClip" dojoAttachPoint="clipNode"><div class="dijitToasterContainer" dojoAttachPoint="containerNode" dojoAttachEvent="onclick:onSelect"><div class="dijitToasterContent" dojoAttachPoint="contentNode"></div></div></div>',
+
+ // messageTopic: String
+ // Name of topic; anything published to this topic will be displayed as a message.
+ // Message format is either String or an object like
+ // {message: "hello word", type: "error", duration: 500}
+ messageTopic: "",
+
+ // messageTypes: Enumeration
+ // Possible message types.
+ messageTypes: {
+ MESSAGE: "message",
+ WARNING: "warning",
+ ERROR: "error",
+ FATAL: "fatal"
+ },
+
+ // defaultType: String
+ // If message type isn't specified (see "messageTopic" parameter),
+ // then display message as this type.
+ // Possible values in messageTypes enumeration ("message", "warning", "error", "fatal")
+ defaultType: "message",
+
+ // positionDirection: String
+ // Position from which message slides into screen, one of
+ // ["br-up", "br-left", "bl-up", "bl-right", "tr-down", "tr-left", "tl-down", "tl-right"]
+ positionDirection: "br-up",
+
+ // positionDirectionTypes: Array
+ // Possible values for positionDirection parameter
+ positionDirectionTypes: ["br-up", "br-left", "bl-up", "bl-right", "tr-down", "tr-left", "tl-down", "tl-right"],
+
+ // duration: Integer
+ // Number of milliseconds to show message
+ duration: 2000,
+
+ // slideDuration: Integer
+ // Number of milliseconds for the slide animation, increasing will cause the Toaster
+ // to slide in more slowly.
+ slideDuration: 500,
+
+ //separator: String
+ // String used to separate messages if consecutive calls are made to setContent before previous messages go away
+ separator: "<hr></hr>",
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.hide();
+
+ // place node as a child of body for positioning
+ dojo.body().appendChild(this.domNode);
+
+ if(this.messageTopic){
+ dojo.subscribe(this.messageTopic, this, "_handleMessage");
+ }
+ },
+
+ _handleMessage: function(/*String|Object*/message){
+ if(dojo.isString(message)){
+ this.setContent(message);
+ }else{
+ this.setContent(message.message, message.type, message.duration);
+ }
+ },
+
+ _capitalize: function(/* String */w){
+ return w.substring(0,1).toUpperCase() + w.substring(1);
+ },
+
+ setContent: function(/*String|Function*/message, /*String*/messageType, /*int?*/duration){
+ // summary:
+ // sets and displays the given message and show duration
+ // message:
+ // the message. If this is a function, it will be called with this toaster widget as the only argument.
+ // messageType:
+ // type of message; possible values in messageTypes enumeration ("message", "warning", "error", "fatal")
+ // duration:
+ // duration in milliseconds to display message before removing it. Widget has default value.
+ duration = duration||this.duration;
+ // sync animations so there are no ghosted fades and such
+ if(this.slideAnim){
+ if(this.slideAnim.status() != "playing"){
+ this.slideAnim.stop();
+ }
+ if(this.slideAnim.status() == "playing" || (this.fadeAnim && this.fadeAnim.status() == "playing")){
+ setTimeout(dojo.hitch(this, function(){
+ this.setContent(message, messageType, duration);
+ }), 50);
+ return;
+ }
+ }
+
+ // determine type of content and apply appropriately
+ for(var type in this.messageTypes){
+ dojo.removeClass(this.containerNode, "dijitToaster" + this._capitalize(this.messageTypes[type]));
+ }
+
+ dojo.style(this.containerNode, "opacity", 1);
+
+ this._setContent(message);
+
+ dojo.addClass(this.containerNode, "dijitToaster" + this._capitalize(messageType || this.defaultType));
+
+ // now do funky animation of widget appearing from
+ // bottom right of page and up
+ this.show();
+ var nodeSize = dojo.marginBox(this.containerNode);
+ this._cancelHideTimer();
+ if(this.isVisible){
+ this._placeClip();
+ //update hide timer if no sticky message in stack
+ if(!this._stickyMessage) {
+ this._setHideTimer(duration);
+ }
+ }else{
+ var style = this.containerNode.style;
+ var pd = this.positionDirection;
+ // sets up initial position of container node and slide-out direction
+ if(pd.indexOf("-up") >= 0){
+ style.left=0+"px";
+ style.top=nodeSize.h + 10 + "px";
+ }else if(pd.indexOf("-left") >= 0){
+ style.left=nodeSize.w + 10 +"px";
+ style.top=0+"px";
+ }else if(pd.indexOf("-right") >= 0){
+ style.left = 0 - nodeSize.w - 10 + "px";
+ style.top = 0+"px";
+ }else if(pd.indexOf("-down") >= 0){
+ style.left = 0+"px";
+ style.top = 0 - nodeSize.h - 10 + "px";
+ }else{
+ throw new Error(this.id + ".positionDirection is invalid: " + pd);
+ }
+ this.slideAnim = dojo.fx.slideTo({
+ node: this.containerNode,
+ top: 0, left: 0,
+ duration: this.slideDuration});
+ this.connect(this.slideAnim, "onEnd", function(nodes, anim){
+ //we build the fadeAnim here so we dont have to duplicate it later
+ // can't do a fadeHide because we're fading the
+ // inner node rather than the clipping node
+ this.fadeAnim = dojo.fadeOut({
+ node: this.containerNode,
+ duration: 1000});
+ this.connect(this.fadeAnim, "onEnd", function(evt){
+ this.isVisible = false;
+ this.hide();
+ });
+ this._setHideTimer(duration);
+ this.connect(this, 'onSelect', function(evt){
+ this._cancelHideTimer();
+ //force clear sticky message
+ this._stickyMessage=false;
+ this.fadeAnim.play();
+ });
+
+ this.isVisible = true;
+ });
+ this.slideAnim.play();
+ }
+ },
+
+ _setContent: function(message){
+ if(dojo.isFunction(message)){
+ message(this);
+ return;
+ }
+ if(message && this.isVisible){
+ message = this.contentNode.innerHTML + this.separator + message;
+ }
+ this.contentNode.innerHTML = message;
+ },
+ _cancelHideTimer:function(){
+ if (this._hideTimer){
+ clearTimeout(this._hideTimer);
+ this._hideTimer=null;
+ }
+ },
+
+ _setHideTimer:function(duration){
+ this._cancelHideTimer();
+ //if duration == 0 we keep the message displayed until clicked
+ if(duration>0){
+ this._cancelHideTimer();
+ this._hideTimer=setTimeout(dojo.hitch(this, function(evt){
+ // we must hide the iframe in order to fade
+ // TODO: figure out how to fade with a BackgroundIframe
+ if(this.bgIframe && this.bgIframe.iframe){
+ this.bgIframe.iframe.style.display="none";
+ }
+ this._hideTimer=null;
+ //force clear sticky message
+ this._stickyMessage=false;
+ this.fadeAnim.play();
+ }), duration);
+ }
+ else
+ this._stickyMessage=true;
+ },
+
+ _placeClip: function(){
+ var view = dojo.window.getBox();
+
+ var nodeSize = dojo.marginBox(this.containerNode);
+
+ var style = this.clipNode.style;
+ // sets up the size of the clipping node
+ style.height = nodeSize.h+"px";
+ style.width = nodeSize.w+"px";
+
+ // sets up the position of the clipping node
+ var pd = this.positionDirection;
+ if(pd.match(/^t/)){
+ style.top = view.t+"px";
+ }else if(pd.match(/^b/)){
+ style.top = (view.h - nodeSize.h - 2 + view.t)+"px";
+ }
+ if(pd.match(/^[tb]r-/)){
+ style.left = (view.w - nodeSize.w - 1 - view.l)+"px";
+ }else if(pd.match(/^[tb]l-/)){
+ style.left = 0 + "px";
+ }
+
+ style.clip = "rect(0px, " + nodeSize.w + "px, " + nodeSize.h + "px, 0px)";
+ if(dojo.isIE){
+ if(!this.bgIframe){
+ this.clipNode.id = dijit.getUniqueId("dojox_widget_Toaster_clipNode");
+ this.bgIframe = new dijit.BackgroundIframe(this.clipNode);
+ }
+ var iframe = this.bgIframe.iframe;
+ if(iframe){ iframe.style.display="block"; }
+ }
+ },
+
+ onSelect: function(/*Event*/e){
+ // summary: callback for when user clicks the message
+ },
+
+ show: function(){
+ // summary: show the Toaster
+ dojo.style(this.domNode, 'display', 'block');
+
+ this._placeClip();
+
+ if(!this._scrollConnected){
+ this._scrollConnected = dojo.connect(window, "onscroll", this, this._placeClip);
+ }
+ },
+
+ hide: function(){
+ // summary: hide the Toaster
+
+ dojo.style(this.domNode, 'display', 'none');
+
+ if(this._scrollConnected){
+ dojo.disconnect(this._scrollConnected);
+ this._scrollConnected = false;
+ }
+
+ dojo.style(this.containerNode, "opacity", 1);
+ }
+ }
+);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Toaster/Toaster.css b/js/dojo-1.6/dojox/widget/Toaster/Toaster.css new file mode 100644 index 0000000..b933063 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Toaster/Toaster.css @@ -0,0 +1,47 @@ +/* main classes for dojox.widget.Toaster */ + +.dijitToasterContent { + padding:1em; + padding-top:0.25em; + background:#73c74a; +} + +.dijitToasterMessage{ + color:#fff; +} + +.dijitToasterWarning{ } +.dijitToasterError, +.dijitToasterFatal{ + font-weight:bold; + color:#fff; +} + +.dijitToasterWarning .dijitToasterContent{ + padding:1em; + padding-top:0.25em; + background:#d4d943; +} + +.dijitToasterError .dijitToasterContent{ + padding:1em; + padding-top:0.25em; + background:#c46600; +} + +/* imported from dijit.css */ + +.dijitToasterClip { + position: absolute; + z-index: 5000; + overflow: hidden; +} + +.dijitToasterContainer { + display: block; + position: absolute; + width: 17.5em; + margin: 0px; + font:0.75em Tahoma, Helvetica, Verdana, Arial; +} + diff --git a/js/dojo-1.6/dojox/widget/UpgradeBar.js b/js/dojo-1.6/dojox/widget/UpgradeBar.js new file mode 100644 index 0000000..054ec7c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/UpgradeBar.js @@ -0,0 +1,234 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.UpgradeBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.UpgradeBar"] = true;
+dojo.provide("dojox.widget.UpgradeBar");
+
+dojo.require("dojo.window");
+dojo.require("dojo.fx");
+dojo.require("dojo.cookie");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+dojo.experimental("dojox.widget.UpgradeBar");
+
+
+dojo.declare("dojox.widget.UpgradeBar", [dijit._Widget, dijit._Templated], {
+ // summary:
+ // Shows a bar at the top of the screen when the user is to
+ // be notified that they should upgrade their browser or a
+ // plugin.
+ //
+ // description:
+ // You can insert custom validations to trigger the UpgradeBar
+ // to display. An evaluation of 'true' shows the bar (as this
+ // version *is* less than it should be). Multiple validations
+ // may be checked, although only the first in the list will be
+ // displayed.
+ // Markup and programmatic are supported. Markup is a little
+ // cleaner, since a majority of the parameters are the HTML
+ // snippets to be displayed. In markup, the validate code should
+ // be an expression that will evaluate to true or false. This
+ // expression is wrapped in a try/catch, so if it blows up, it
+ // is assumed to be true and trigger the bar.
+ // In programmtic, a function should be used that returns true
+ // or false. You would need to use your own try/catch in that.
+ //
+ // example: See tests for examples.
+ //
+ // notifications: Array
+ // An array of objects that hold the criteria for upgrades.
+ // message: String
+ // The message to display in the bar. Can be HTML.
+ // validate:Function
+ // The expression to evaluate to determine if the
+ // bar should show or not. Should be a simple expression
+ // if used in HTML:
+ // | <div validate="!google.gears">
+ // | <div validate="dojo.isIE<8">
+ notifications:[],
+ //
+ // buttonCancel:String
+ // The HTML tip show when hovering over the close button.
+ buttonCancel:"Close for now",
+ //
+ // noRemindButton:String
+ // The text link shown that when clicked, permanently dismisses
+ // the message (sets a cookie). If this string is blank, this
+ // link is not displayed.
+ noRemindButton:"Don't Remind Me Again",
+
+ templateString: dojo.cache("dojox.widget", "UpgradeBar/UpgradeBar.html", "<div class=\"dojoxUpgradeBar\">\r\n\t<div class=\"dojoxUpgradeBarMessage\" dojoAttachPoint=\"messageNode\">message</div>\r\n\t<div class=\"dojoxUpgradeBarReminderButton\" dojoAttachPoint=\"dontRemindButtonNode\" dojoAttachEvent=\"onclick:_onDontRemindClick\">${noRemindButton}</div>\r\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dojoxUpgradeBarCloseIcon\" dojoAttachEvent=\"onclick: hide, onmouseenter: _onCloseEnter, onmouseleave: _onCloseLeave\" title=\"${buttonCancel}\"></span>\r\n</div>\r\n"),
+
+ constructor: function(props, node){
+
+ if(!props.notifications && node){
+ // From markup. Create the notifications Array from the
+ // srcRefNode children.
+ dojo.forEach(node.childNodes, function(n){
+ if(n.nodeType==1){
+ var val = dojo.attr(n, "validate");
+ this.notifications.push({
+ message:n.innerHTML,
+ validate:function(){
+ // the function that fires to determine if the
+ // bar shows or not.
+ var evals = true;
+ try{
+ evals = dojo.eval(val);
+ }catch(e){ /* squelch. it's true.*/ }
+ return evals;
+ }
+ });
+ }
+ }, this);
+ }
+
+ },
+
+ checkNotifications: function(){
+ // summary:
+ // Internal. Go through the notifications Array
+ // and check for any that evaluate to true.
+ // tags:
+ // private
+ //
+ if(!this.notifications.length){
+ // odd. why use the bar but not set any notifications?
+ return;
+ }
+
+ for(var i=0;i<this.notifications.length;i++){
+ var evals = this.notifications[i].validate();
+ if(evals){
+ this.notify(this.notifications[i].message);
+ // Validation resulted in true, meaning a feature is missing
+ // Don't check any other messages. One at a time.
+ break;
+ }
+ }
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ if(this.domNode.parentNode){
+ dojo.style(this.domNode, "display", "none");
+ }
+ dojo.mixin(this.attributeMap, {
+ message:{ node:"messageNode", type:"innerHTML" }
+ });
+ if(!this.noRemindButton){
+ dojo.destroy(this.dontRemindButtonNode)
+ }
+ if(dojo.isIE==6){
+ // IE6 is challenged when it comes to 100% width.
+ // It thinks the body has more padding and more
+ // margin than it really does. It would work to
+ // set the body pad and margin to 0, but we can't
+ // set that and disturb a potential layout.
+ //
+ var self = this;
+ var setWidth = function(){
+ var v = dojo.window.getBox();
+ dojo.style(self.domNode, "width", v.w+"px");
+ }
+ this.connect(window, "resize", function(){
+ setWidth();
+ });
+
+ setWidth();
+ }
+ dojo.addOnLoad(this, "checkNotifications");
+ //this.checkNotifications();
+ },
+
+ notify: function(msg){
+ // summary:
+ // Triggers the bar to display. An internal function,
+ // but could ne called externally for fun.
+ // tags:
+ // protected
+ //
+ if(dojo.cookie("disableUpgradeReminders")){
+ return;
+ }
+ if(!this.domNode.parentNode || !this.domNode.parentNode.innerHTML){
+ document.body.appendChild(this.domNode);
+ }
+ dojo.style(this.domNode, "display", "");
+ if(msg){
+ this.set("message", msg);
+ }
+
+ },
+
+ show: function(){
+ // summary:
+ // Internal. Shows the bar. Do not call directly.
+ // Use notify();
+ // tags:
+ // private
+ //
+ this._bodyMarginTop = dojo.style(dojo.body(), "marginTop");
+ this._size = dojo.contentBox(this.domNode).h;
+ dojo.style(this.domNode, { display:"block", height:0, opacity:0 });
+
+ if(!this._showAnim){
+ this._showAnim = dojo.fx.combine([
+ dojo.animateProperty({ node:dojo.body(), duration:500, properties:{ marginTop:this._bodyMarginTop+this._size } }),
+ dojo.animateProperty({ node:this.domNode, duration:500, properties:{ height:this._size, opacity:1 } })
+ ]);
+ }
+ this._showAnim.play();
+ },
+
+ hide: function(){
+ // summary:
+ // Hides the bar. May be called externally.
+ //
+ if(!this._hideAnim){
+ this._hideAnim = dojo.fx.combine([
+ dojo.animateProperty({ node:dojo.body(), duration:500, properties:{ marginTop:this._bodyMarginTop } }),
+ dojo.animateProperty({ node:this.domNode, duration:500, properties:{ height:0, opacity:0 } })
+ ]);
+ dojo.connect(this._hideAnim, "onEnd", this, function(){
+ dojo.style(this.domNode, "display", "none");
+ });
+ }
+ this._hideAnim.play();
+ },
+
+ _onDontRemindClick: function(){
+ // summary:
+ // Called when user clicks the "do not remind" link.
+ // tags:
+ // private
+ dojo.cookie("disableUpgradeReminders", true, { expires:3650 });
+ this.hide();
+ },
+
+ _onCloseEnter: function(){
+ // summary:
+ // Called when user hovers over close icon
+ // tags:
+ // private
+ dojo.addClass(this.closeButtonNode, "dojoxUpgradeBarCloseIcon-hover");
+ },
+
+ _onCloseLeave: function(){
+ // summary:
+ // Called when user stops hovering over close icon
+ // tags:
+ // private
+ dojo.removeClass(this.closeButtonNode, "dojoxUpgradeBarCloseIcon-hover");
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/UpgradeBar.xd.js b/js/dojo-1.6/dojox/widget/UpgradeBar.xd.js new file mode 100644 index 0000000..3f3666f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/UpgradeBar.xd.js @@ -0,0 +1,243 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.UpgradeBar"],
+["require", "dojo.window"],
+["require", "dojo.fx"],
+["require", "dojo.cookie"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.UpgradeBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.UpgradeBar"] = true;
+dojo.provide("dojox.widget.UpgradeBar");
+
+dojo.require("dojo.window");
+dojo.require("dojo.fx");
+dojo.require("dojo.cookie");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+
+dojo.experimental("dojox.widget.UpgradeBar");
+
+
+dojo.declare("dojox.widget.UpgradeBar", [dijit._Widget, dijit._Templated], {
+ // summary:
+ // Shows a bar at the top of the screen when the user is to
+ // be notified that they should upgrade their browser or a
+ // plugin.
+ //
+ // description:
+ // You can insert custom validations to trigger the UpgradeBar
+ // to display. An evaluation of 'true' shows the bar (as this
+ // version *is* less than it should be). Multiple validations
+ // may be checked, although only the first in the list will be
+ // displayed.
+ // Markup and programmatic are supported. Markup is a little
+ // cleaner, since a majority of the parameters are the HTML
+ // snippets to be displayed. In markup, the validate code should
+ // be an expression that will evaluate to true or false. This
+ // expression is wrapped in a try/catch, so if it blows up, it
+ // is assumed to be true and trigger the bar.
+ // In programmtic, a function should be used that returns true
+ // or false. You would need to use your own try/catch in that.
+ //
+ // example: See tests for examples.
+ //
+ // notifications: Array
+ // An array of objects that hold the criteria for upgrades.
+ // message: String
+ // The message to display in the bar. Can be HTML.
+ // validate:Function
+ // The expression to evaluate to determine if the
+ // bar should show or not. Should be a simple expression
+ // if used in HTML:
+ // | <div validate="!google.gears">
+ // | <div validate="dojo.isIE<8">
+ notifications:[],
+ //
+ // buttonCancel:String
+ // The HTML tip show when hovering over the close button.
+ buttonCancel:"Close for now",
+ //
+ // noRemindButton:String
+ // The text link shown that when clicked, permanently dismisses
+ // the message (sets a cookie). If this string is blank, this
+ // link is not displayed.
+ noRemindButton:"Don't Remind Me Again",
+
+ templateString: dojo.cache("dojox.widget", "UpgradeBar/UpgradeBar.html", "<div class=\"dojoxUpgradeBar\">\r\n\t<div class=\"dojoxUpgradeBarMessage\" dojoAttachPoint=\"messageNode\">message</div>\r\n\t<div class=\"dojoxUpgradeBarReminderButton\" dojoAttachPoint=\"dontRemindButtonNode\" dojoAttachEvent=\"onclick:_onDontRemindClick\">${noRemindButton}</div>\r\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dojoxUpgradeBarCloseIcon\" dojoAttachEvent=\"onclick: hide, onmouseenter: _onCloseEnter, onmouseleave: _onCloseLeave\" title=\"${buttonCancel}\"></span>\r\n</div>\r\n"),
+
+ constructor: function(props, node){
+
+ if(!props.notifications && node){
+ // From markup. Create the notifications Array from the
+ // srcRefNode children.
+ dojo.forEach(node.childNodes, function(n){
+ if(n.nodeType==1){
+ var val = dojo.attr(n, "validate");
+ this.notifications.push({
+ message:n.innerHTML,
+ validate:function(){
+ // the function that fires to determine if the
+ // bar shows or not.
+ var evals = true;
+ try{
+ evals = dojo.eval(val);
+ }catch(e){ /* squelch. it's true.*/ }
+ return evals;
+ }
+ });
+ }
+ }, this);
+ }
+
+ },
+
+ checkNotifications: function(){
+ // summary:
+ // Internal. Go through the notifications Array
+ // and check for any that evaluate to true.
+ // tags:
+ // private
+ //
+ if(!this.notifications.length){
+ // odd. why use the bar but not set any notifications?
+ return;
+ }
+
+ for(var i=0;i<this.notifications.length;i++){
+ var evals = this.notifications[i].validate();
+ if(evals){
+ this.notify(this.notifications[i].message);
+ // Validation resulted in true, meaning a feature is missing
+ // Don't check any other messages. One at a time.
+ break;
+ }
+ }
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ if(this.domNode.parentNode){
+ dojo.style(this.domNode, "display", "none");
+ }
+ dojo.mixin(this.attributeMap, {
+ message:{ node:"messageNode", type:"innerHTML" }
+ });
+ if(!this.noRemindButton){
+ dojo.destroy(this.dontRemindButtonNode)
+ }
+ if(dojo.isIE==6){
+ // IE6 is challenged when it comes to 100% width.
+ // It thinks the body has more padding and more
+ // margin than it really does. It would work to
+ // set the body pad and margin to 0, but we can't
+ // set that and disturb a potential layout.
+ //
+ var self = this;
+ var setWidth = function(){
+ var v = dojo.window.getBox();
+ dojo.style(self.domNode, "width", v.w+"px");
+ }
+ this.connect(window, "resize", function(){
+ setWidth();
+ });
+
+ setWidth();
+ }
+ dojo.addOnLoad(this, "checkNotifications");
+ //this.checkNotifications();
+ },
+
+ notify: function(msg){
+ // summary:
+ // Triggers the bar to display. An internal function,
+ // but could ne called externally for fun.
+ // tags:
+ // protected
+ //
+ if(dojo.cookie("disableUpgradeReminders")){
+ return;
+ }
+ if(!this.domNode.parentNode || !this.domNode.parentNode.innerHTML){
+ document.body.appendChild(this.domNode);
+ }
+ dojo.style(this.domNode, "display", "");
+ if(msg){
+ this.set("message", msg);
+ }
+
+ },
+
+ show: function(){
+ // summary:
+ // Internal. Shows the bar. Do not call directly.
+ // Use notify();
+ // tags:
+ // private
+ //
+ this._bodyMarginTop = dojo.style(dojo.body(), "marginTop");
+ this._size = dojo.contentBox(this.domNode).h;
+ dojo.style(this.domNode, { display:"block", height:0, opacity:0 });
+
+ if(!this._showAnim){
+ this._showAnim = dojo.fx.combine([
+ dojo.animateProperty({ node:dojo.body(), duration:500, properties:{ marginTop:this._bodyMarginTop+this._size } }),
+ dojo.animateProperty({ node:this.domNode, duration:500, properties:{ height:this._size, opacity:1 } })
+ ]);
+ }
+ this._showAnim.play();
+ },
+
+ hide: function(){
+ // summary:
+ // Hides the bar. May be called externally.
+ //
+ if(!this._hideAnim){
+ this._hideAnim = dojo.fx.combine([
+ dojo.animateProperty({ node:dojo.body(), duration:500, properties:{ marginTop:this._bodyMarginTop } }),
+ dojo.animateProperty({ node:this.domNode, duration:500, properties:{ height:0, opacity:0 } })
+ ]);
+ dojo.connect(this._hideAnim, "onEnd", this, function(){
+ dojo.style(this.domNode, "display", "none");
+ });
+ }
+ this._hideAnim.play();
+ },
+
+ _onDontRemindClick: function(){
+ // summary:
+ // Called when user clicks the "do not remind" link.
+ // tags:
+ // private
+ dojo.cookie("disableUpgradeReminders", true, { expires:3650 });
+ this.hide();
+ },
+
+ _onCloseEnter: function(){
+ // summary:
+ // Called when user hovers over close icon
+ // tags:
+ // private
+ dojo.addClass(this.closeButtonNode, "dojoxUpgradeBarCloseIcon-hover");
+ },
+
+ _onCloseLeave: function(){
+ // summary:
+ // Called when user stops hovering over close icon
+ // tags:
+ // private
+ dojo.removeClass(this.closeButtonNode, "dojoxUpgradeBarCloseIcon-hover");
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/UpgradeBar/UpgradeBar.css b/js/dojo-1.6/dojox/widget/UpgradeBar/UpgradeBar.css new file mode 100644 index 0000000..dea4e7f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/UpgradeBar/UpgradeBar.css @@ -0,0 +1,73 @@ + +.dojoxUpgradeBar { + position:absolute; + left:0; + top:0; + width:100%; + height:32px; + overflow:hidden; + z-index:100; + background:#f3f2af; + box-shadow:0 2px 6px #444; + -webkit-box-shadow:0 1px 6px #444; + -moz-box-shadow:0 1px 6px #444; + font-size:.8em; +} + +.dj_ie .dojoxUpgradeBar { + border-bottom:#665F48 2px solid; +} +.dojoxUpgradeBarMessage { + position:absolute; + padding-left:10px; + top:50%; + margin-top:-.75em; + left:5px; + width:100%; +} +.dojoxUpgradeBarMessage a{ + margin-left:10px; +} +/* +.dojoxUpgradeBarControls { + position:absolute; + right:35px; + top:0; + bottom:0; + width:140px; + text-align:right; +} +*/ +.dojoxUpgradeBarReminderButton { + position:absolute; + top:25%; + margin-right:50px; + font-size:11px; + text-decoration:underline; + text-align:right; + cursor:pointer; + right:-20px; +} +.dj_ie6 .dojoxUpgradeBarReminderButton { + margin-top:2px; +} + +.dojoxUpgradeBarCloseIcon { + background: url("../../../dijit/themes/tundra/images/tabClose.png") no-repeat right top; + position: absolute; + vertical-align: middle; + right: 5px; + top: 30%; + height: 15px; + width: 15px; + cursor: pointer; +} +.dj_ie6 .dojoxUpgradeBarCloseIcon { + background : url("../../../dijit/themes/tundra/images/tabClose.gif") no-repeat right top; +} +.dojoxUpgradeBarCloseIcon-hover { + background: url("../../../dijit/themes/tundra/images/tabCloseHover.png") no-repeat right top; +} +.dj_ie6 .dojoxUpgradeBarCloseIcon-hover { + background : url("../../../dijit/themes/tundra/images/tabCloseHover.gif") no-repeat right top; +} diff --git a/js/dojo-1.6/dojox/widget/UpgradeBar/UpgradeBar.html b/js/dojo-1.6/dojox/widget/UpgradeBar/UpgradeBar.html new file mode 100644 index 0000000..70c1aee --- /dev/null +++ b/js/dojo-1.6/dojox/widget/UpgradeBar/UpgradeBar.html @@ -0,0 +1,5 @@ +<div class="dojoxUpgradeBar"> + <div class="dojoxUpgradeBarMessage" dojoAttachPoint="messageNode">message</div> + <div class="dojoxUpgradeBarReminderButton" dojoAttachPoint="dontRemindButtonNode" dojoAttachEvent="onclick:_onDontRemindClick">${noRemindButton}</div> + <span dojoAttachPoint="closeButtonNode" class="dojoxUpgradeBarCloseIcon" dojoAttachEvent="onclick: hide, onmouseenter: _onCloseEnter, onmouseleave: _onCloseLeave" title="${buttonCancel}"></span> +</div>
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/Wizard.js b/js/dojo-1.6/dojox/widget/Wizard.js new file mode 100644 index 0000000..2375480 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Wizard.js @@ -0,0 +1,210 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.Wizard"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Wizard"] = true;
+dojo.provide("dojox.widget.Wizard");
+
+dojo.require("dijit.layout.StackContainer");
+dojo.require("dijit.layout.ContentPane");
+dojo.require("dijit.form.Button");
+
+dojo.require("dojo.i18n");
+dojo.requireLocalization("dijit", "common", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
+dojo.requireLocalization("dojox.widget", "Wizard", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw");
+
+dojo.declare("dojox.widget.Wizard", [dijit.layout.StackContainer, dijit._Templated], {
+ // summary:
+ // A set of panels that display sequentially, typically notating a step-by-step
+ // procedure like an install
+ //
+
+ widgetsInTemplate: true,
+ templateString: dojo.cache("dojox.widget", "Wizard/Wizard.html", "<div class=\"dojoxWizard\" dojoAttachPoint=\"wizardNode\">\r\n <div class=\"dojoxWizardContainer\" dojoAttachPoint=\"containerNode\"></div>\r\n <div class=\"dojoxWizardButtons\" dojoAttachPoint=\"wizardNav\">\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"previousButton\">${previousButtonLabel}</button>\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"nextButton\">${nextButtonLabel}</button>\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"doneButton\" style=\"display:none\">${doneButtonLabel}</button>\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"cancelButton\">${cancelButtonLabel}</button>\r\n </div>\r\n</div>\r\n"),
+
+ // nextButtonLabel: String
+ // Label override for the "Next" button.
+ nextButtonLabel: "",
+
+ // previousButtonLabel: String
+ // Label override for the "Previous" button.
+ previousButtonLabel: "",
+
+ // cancelButtonLabel: String
+ // Label override for the "Cancel" button.
+ cancelButtonLabel: "",
+
+ // doneButtonLabel: String
+ // Label override for the "Done" button.
+ doneButtonLabel: "",
+
+ // cancelFunction: Function|String
+ // Name of function to call if user presses cancel button.
+ // Cancel button is not displayed if function is not specified.
+ cancelFunction: null,
+
+ // hideDisabled: Boolean
+ // If true, disabled buttons are hidden; otherwise, they are assigned the
+ // "WizardButtonDisabled" CSS class
+ hideDisabled: false,
+
+ postMixInProperties: function(){
+ this.inherited(arguments);
+ var labels = dojo.mixin({cancel: dojo.i18n.getLocalization("dijit", "common", this.lang).buttonCancel},
+ dojo.i18n.getLocalization("dojox.widget", "Wizard", this.lang));
+ var prop;
+ for(prop in labels){
+ if(!this[prop + "ButtonLabel"]){
+ this[prop + "ButtonLabel"] = labels[prop];
+ }
+ }
+ },
+
+ startup: function(){
+ if(this._started){
+ //console.log('started');
+ return;
+ }
+ this.inherited(arguments);
+
+ this.connect(this.nextButton, "onClick", "_forward");
+ this.connect(this.previousButton, "onClick", "back");
+
+ if(this.cancelFunction){
+ if(dojo.isString(this.cancelFunction)){
+ this.cancelFunction = dojo.getObject(this.cancelFunction);
+ }
+ this.connect(this.cancelButton, "onClick", this.cancelFunction);
+ }else{
+ this.cancelButton.domNode.style.display = "none";
+ }
+ this.connect(this.doneButton, "onClick", "done");
+
+ this._subscription = dojo.subscribe(this.id + "-selectChild", dojo.hitch(this,"_checkButtons"));
+ this._started = true;
+
+ },
+
+ resize: function(){
+ this.inherited(arguments);
+ this._checkButtons();
+ },
+
+ _checkButtons: function(){
+
+ var sw = this.selectedChildWidget;
+
+ var lastStep = sw.isLastChild;
+ this.nextButton.set("disabled", lastStep);
+ this._setButtonClass(this.nextButton);
+ if(sw.doneFunction){
+ //console.log(sw.doneFunction);
+ this.doneButton.domNode.style.display = "";
+ if(lastStep){
+ this.nextButton.domNode.style.display = "none";
+ }
+ }else{
+ // #1438 issue here.
+ this.doneButton.domNode.style.display = "none";
+ }
+ this.previousButton.set("disabled", !this.selectedChildWidget.canGoBack);
+ this._setButtonClass(this.previousButton);
+ },
+
+ _setButtonClass: function(button){
+ button.domNode.style.display = (this.hideDisabled && button.disabled) ? "none" : "";
+ },
+
+ _forward: function(){
+ // summary: callback when next button is clicked
+ if(this.selectedChildWidget._checkPass()){
+ this.forward();
+ }
+ },
+
+ done: function(){
+ // summary: Finish the wizard's operation
+ this.selectedChildWidget.done();
+ },
+
+ destroy: function(){
+ dojo.unsubscribe(this._subscription);
+ this.inherited(arguments);
+ }
+
+});
+
+dojo.declare("dojox.widget.WizardPane", dijit.layout.ContentPane, {
+ // summary: A panel in a `dojox.widget.Wizard`
+ //
+ // description:
+ // An extended ContentPane with additional hooks for passing named
+ // functions to prevent the pane from going either forward or
+ // backwards.
+ //
+ // canGoBack: Boolean
+ // If true, then can move back to a previous panel (by clicking the "Previous" button)
+ canGoBack: true,
+
+ // passFunction: String
+ // Name of function that checks if it's OK to advance to the next panel.
+ // If it's not OK (for example, mandatory field hasn't been entered), then
+ // returns an error message (String) explaining the reason. Can return null (pass)
+ // or a Boolean (true == pass)
+ passFunction: null,
+
+ // doneFunction: String
+ // Name of function that is run if you press the "Done" button from this panel
+ doneFunction: null,
+
+ startup: function(){
+ this.inherited(arguments);
+ if(this.isFirstChild){ this.canGoBack = false; }
+ if(dojo.isString(this.passFunction)){
+ this.passFunction = dojo.getObject(this.passFunction);
+ }
+ if(dojo.isString(this.doneFunction) && this.doneFunction){
+ this.doneFunction = dojo.getObject(this.doneFunction);
+ }
+ },
+
+ _onShow: function(){
+ if(this.isFirstChild){ this.canGoBack = false; }
+ this.inherited(arguments);
+ },
+
+ _checkPass: function(){
+ // summary:
+ // Called when the user presses the "next" button.
+ // Calls passFunction to see if it's OK to advance to next panel, and
+ // if it isn't, then display error.
+ // Returns true to advance, false to not advance. If passFunction
+ // returns a string, it is assumed to be a custom error message, and
+ // is alert()'ed
+ var r = true;
+ if(this.passFunction && dojo.isFunction(this.passFunction)){
+ var failMessage = this.passFunction();
+ switch(typeof failMessage){
+ case "boolean":
+ r = failMessage;
+ break;
+ case "string":
+ alert(failMessage);
+ r = false;
+ break;
+ }
+ }
+ return r; // Boolean
+ },
+
+ done: function(){
+ if(this.doneFunction && dojo.isFunction(this.doneFunction)){ this.doneFunction(); }
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/Wizard.xd.js b/js/dojo-1.6/dojox/widget/Wizard.xd.js new file mode 100644 index 0000000..236e822 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Wizard.xd.js @@ -0,0 +1,220 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.Wizard"],
+["require", "dijit.layout.StackContainer"],
+["require", "dijit.layout.ContentPane"],
+["require", "dijit.form.Button"],
+["require", "dojo.i18n"],
+["requireLocalization", "dijit", "common", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw", "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"],
+["requireLocalization", "dojox.widget", "Wizard", null, "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw", "ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.Wizard"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.Wizard"] = true;
+dojo.provide("dojox.widget.Wizard");
+
+dojo.require("dijit.layout.StackContainer");
+dojo.require("dijit.layout.ContentPane");
+dojo.require("dijit.form.Button");
+
+dojo.require("dojo.i18n");
+;
+;
+
+dojo.declare("dojox.widget.Wizard", [dijit.layout.StackContainer, dijit._Templated], {
+ // summary:
+ // A set of panels that display sequentially, typically notating a step-by-step
+ // procedure like an install
+ //
+
+ widgetsInTemplate: true,
+ templateString: dojo.cache("dojox.widget", "Wizard/Wizard.html", "<div class=\"dojoxWizard\" dojoAttachPoint=\"wizardNode\">\r\n <div class=\"dojoxWizardContainer\" dojoAttachPoint=\"containerNode\"></div>\r\n <div class=\"dojoxWizardButtons\" dojoAttachPoint=\"wizardNav\">\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"previousButton\">${previousButtonLabel}</button>\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"nextButton\">${nextButtonLabel}</button>\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"doneButton\" style=\"display:none\">${doneButtonLabel}</button>\r\n <button dojoType=\"dijit.form.Button\" type=\"button\" dojoAttachPoint=\"cancelButton\">${cancelButtonLabel}</button>\r\n </div>\r\n</div>\r\n"),
+
+ // nextButtonLabel: String
+ // Label override for the "Next" button.
+ nextButtonLabel: "",
+
+ // previousButtonLabel: String
+ // Label override for the "Previous" button.
+ previousButtonLabel: "",
+
+ // cancelButtonLabel: String
+ // Label override for the "Cancel" button.
+ cancelButtonLabel: "",
+
+ // doneButtonLabel: String
+ // Label override for the "Done" button.
+ doneButtonLabel: "",
+
+ // cancelFunction: Function|String
+ // Name of function to call if user presses cancel button.
+ // Cancel button is not displayed if function is not specified.
+ cancelFunction: null,
+
+ // hideDisabled: Boolean
+ // If true, disabled buttons are hidden; otherwise, they are assigned the
+ // "WizardButtonDisabled" CSS class
+ hideDisabled: false,
+
+ postMixInProperties: function(){
+ this.inherited(arguments);
+ var labels = dojo.mixin({cancel: dojo.i18n.getLocalization("dijit", "common", this.lang).buttonCancel},
+ dojo.i18n.getLocalization("dojox.widget", "Wizard", this.lang));
+ var prop;
+ for(prop in labels){
+ if(!this[prop + "ButtonLabel"]){
+ this[prop + "ButtonLabel"] = labels[prop];
+ }
+ }
+ },
+
+ startup: function(){
+ if(this._started){
+ //console.log('started');
+ return;
+ }
+ this.inherited(arguments);
+
+ this.connect(this.nextButton, "onClick", "_forward");
+ this.connect(this.previousButton, "onClick", "back");
+
+ if(this.cancelFunction){
+ if(dojo.isString(this.cancelFunction)){
+ this.cancelFunction = dojo.getObject(this.cancelFunction);
+ }
+ this.connect(this.cancelButton, "onClick", this.cancelFunction);
+ }else{
+ this.cancelButton.domNode.style.display = "none";
+ }
+ this.connect(this.doneButton, "onClick", "done");
+
+ this._subscription = dojo.subscribe(this.id + "-selectChild", dojo.hitch(this,"_checkButtons"));
+ this._started = true;
+
+ },
+
+ resize: function(){
+ this.inherited(arguments);
+ this._checkButtons();
+ },
+
+ _checkButtons: function(){
+
+ var sw = this.selectedChildWidget;
+
+ var lastStep = sw.isLastChild;
+ this.nextButton.set("disabled", lastStep);
+ this._setButtonClass(this.nextButton);
+ if(sw.doneFunction){
+ //console.log(sw.doneFunction);
+ this.doneButton.domNode.style.display = "";
+ if(lastStep){
+ this.nextButton.domNode.style.display = "none";
+ }
+ }else{
+ // #1438 issue here.
+ this.doneButton.domNode.style.display = "none";
+ }
+ this.previousButton.set("disabled", !this.selectedChildWidget.canGoBack);
+ this._setButtonClass(this.previousButton);
+ },
+
+ _setButtonClass: function(button){
+ button.domNode.style.display = (this.hideDisabled && button.disabled) ? "none" : "";
+ },
+
+ _forward: function(){
+ // summary: callback when next button is clicked
+ if(this.selectedChildWidget._checkPass()){
+ this.forward();
+ }
+ },
+
+ done: function(){
+ // summary: Finish the wizard's operation
+ this.selectedChildWidget.done();
+ },
+
+ destroy: function(){
+ dojo.unsubscribe(this._subscription);
+ this.inherited(arguments);
+ }
+
+});
+
+dojo.declare("dojox.widget.WizardPane", dijit.layout.ContentPane, {
+ // summary: A panel in a `dojox.widget.Wizard`
+ //
+ // description:
+ // An extended ContentPane with additional hooks for passing named
+ // functions to prevent the pane from going either forward or
+ // backwards.
+ //
+ // canGoBack: Boolean
+ // If true, then can move back to a previous panel (by clicking the "Previous" button)
+ canGoBack: true,
+
+ // passFunction: String
+ // Name of function that checks if it's OK to advance to the next panel.
+ // If it's not OK (for example, mandatory field hasn't been entered), then
+ // returns an error message (String) explaining the reason. Can return null (pass)
+ // or a Boolean (true == pass)
+ passFunction: null,
+
+ // doneFunction: String
+ // Name of function that is run if you press the "Done" button from this panel
+ doneFunction: null,
+
+ startup: function(){
+ this.inherited(arguments);
+ if(this.isFirstChild){ this.canGoBack = false; }
+ if(dojo.isString(this.passFunction)){
+ this.passFunction = dojo.getObject(this.passFunction);
+ }
+ if(dojo.isString(this.doneFunction) && this.doneFunction){
+ this.doneFunction = dojo.getObject(this.doneFunction);
+ }
+ },
+
+ _onShow: function(){
+ if(this.isFirstChild){ this.canGoBack = false; }
+ this.inherited(arguments);
+ },
+
+ _checkPass: function(){
+ // summary:
+ // Called when the user presses the "next" button.
+ // Calls passFunction to see if it's OK to advance to next panel, and
+ // if it isn't, then display error.
+ // Returns true to advance, false to not advance. If passFunction
+ // returns a string, it is assumed to be a custom error message, and
+ // is alert()'ed
+ var r = true;
+ if(this.passFunction && dojo.isFunction(this.passFunction)){
+ var failMessage = this.passFunction();
+ switch(typeof failMessage){
+ case "boolean":
+ r = failMessage;
+ break;
+ case "string":
+ alert(failMessage);
+ r = false;
+ break;
+ }
+ }
+ return r; // Boolean
+ },
+
+ done: function(){
+ if(this.doneFunction && dojo.isFunction(this.doneFunction)){ this.doneFunction(); }
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/Wizard/Wizard.css b/js/dojo-1.6/dojox/widget/Wizard/Wizard.css new file mode 100644 index 0000000..cf354a7 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Wizard/Wizard.css @@ -0,0 +1,57 @@ +.dojoxWizard { + position:relative; +} + +.dojoxWizardButtons { + position:absolute; + bottom:5px; + right:5px; +} + +/* allot room for the buttons. never let a child overlap */ +.dojoxWizardContainer > * { + margin-bottom:39px; +} + +.tundra .dojoxWizard { + background: #eeeeee; + border: #b7b7b7 1px solid; + padding: 2px; + border-radius:3pt; + -moz-border-radius:3pt; + -webkit-border-radius:4pt; + -o-border-radius:4pt; + -ms-border-radius:4pt; +} + +.soria .dojoxWizard { + border:1px solid #b7b7b7; + padding:2px; + border-radius:3pt; + -moz-border-radius:3pt; + -webkit-border-radius:4pt; + -o-border-radius:4pt; + -ms-border-radius:4pt; +} + +.claro .dojoxWizard { + border:1px solid #b5bcc7; + padding:2px; + border-radius:3pt; + -moz-border-radius:3pt; + -webkit-border-radius:4pt; + -o-border-radius:4pt; + -ms-border-radius:4pt; +} + +/* remove the border and padding when we're in a dialog, it wraps us */ +.tundra .dijitDialogSingleChild .dojoxWizard, +.soria .dijitDialogSingleChild .dojoxWizard, +.claro .dijitDialogSingleChild .dojoxWizard { + border:none; + padding:0; +} + +.claro .dijitDialogSingleChild .dojoxWizardButtons { + bottom:1px; +}
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/Wizard/Wizard.html b/js/dojo-1.6/dojox/widget/Wizard/Wizard.html new file mode 100644 index 0000000..a91e677 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/Wizard/Wizard.html @@ -0,0 +1,9 @@ +<div class="dojoxWizard" dojoAttachPoint="wizardNode"> + <div class="dojoxWizardContainer" dojoAttachPoint="containerNode"></div> + <div class="dojoxWizardButtons" dojoAttachPoint="wizardNav"> + <button dojoType="dijit.form.Button" type="button" dojoAttachPoint="previousButton">${previousButtonLabel}</button> + <button dojoType="dijit.form.Button" type="button" dojoAttachPoint="nextButton">${nextButtonLabel}</button> + <button dojoType="dijit.form.Button" type="button" dojoAttachPoint="doneButton" style="display:none">${doneButtonLabel}</button> + <button dojoType="dijit.form.Button" type="button" dojoAttachPoint="cancelButton">${cancelButtonLabel}</button> + </div> +</div> diff --git a/js/dojo-1.6/dojox/widget/gauge/AnalogArcIndicator.js b/js/dojo-1.6/dojox/widget/gauge/AnalogArcIndicator.js new file mode 100644 index 0000000..d811d1f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/AnalogArcIndicator.js @@ -0,0 +1,77 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource['dojox.widget.gauge.AnalogArcIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.AnalogArcIndicator'] = true;
+dojo.provide('dojox.widget.gauge.AnalogArcIndicator');
+dojo.require('dojox.widget.AnalogGauge');
+
+dojo.experimental("dojox.widget.gauge.AnalogArcIndicator");
+
+dojo.declare("dojox.widget.gauge.AnalogArcIndicator",[dojox.widget.gauge.AnalogLineIndicator],{
+ _createArc: function(val){
+ // Creating the Arc Path string manually. This is instead of creating new dojox.gfx.Path object
+ // each time since we really just need the Path string (to use with setShape) and we don't want to
+ // have to redo the connects, etc.
+ if(this.shapes[0]){
+ var a = this._gauge._getRadians(this._gauge._getAngle(val));
+ var cosa = Math.cos(a);
+ var sina = Math.sin(a);
+ var sa = this._gauge._getRadians(this._gauge.startAngle);
+ var cossa = Math.cos(sa);
+ var sinsa = Math.sin(sa);
+ var off = this.offset + this.width;
+ var p = ['M'];
+ p.push(this._gauge.cx+this.offset*sinsa);
+ p.push(this._gauge.cy-this.offset*cossa);
+ p.push('A', this.offset, this.offset, 0, ((a-sa)>Math.PI)?1:0, 1);
+ p.push(this._gauge.cx+this.offset*sina);
+ p.push(this._gauge.cy-this.offset*cosa);
+ p.push('L');
+ p.push(this._gauge.cx+off*sina);
+ p.push(this._gauge.cy-off*cosa);
+ p.push('A', off, off, 0, ((a-sa)>Math.PI)?1:0, 0);
+ p.push(this._gauge.cx+off*sinsa);
+ p.push(this._gauge.cy-off*cossa);
+ this.shapes[0].setShape(p.join(' '));
+ this.currentValue = val;
+ }
+ },
+ draw: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget._Indicator.draw
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ if(this.shapes){
+ if(dontAnimate){
+ this._createArc(v);
+ }else{
+ var anim = new dojo.Animation({curve: [this.currentValue, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, this._createArc));
+ anim.play();
+ }
+ }else{
+ var stroke = {color: this.color, width: 1};
+ if(this.color.type){
+ stroke.color = this.color.colors[0].color;
+ }
+ this.shapes = [this._gauge.surface.createPath()
+ .setStroke(stroke).setFill(this.color)];
+ this._createArc(v);
+ if(this.hover){
+ this.shapes[0].getEventSource().setAttribute('hover',this.hover);
+ }
+ if(this.onDragMove && !this.noChange){
+ this._gauge.connect(this.shapes[0].getEventSource(), 'onmousedown', this._gauge.handleMouseDown);
+ this.shapes[0].getEventSource().style.cursor = 'pointer';
+ }
+ }
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/gauge/AnalogArcIndicator.xd.js b/js/dojo-1.6/dojox/widget/gauge/AnalogArcIndicator.xd.js new file mode 100644 index 0000000..93e3672 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/AnalogArcIndicator.xd.js @@ -0,0 +1,82 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", 'dojox.widget.gauge.AnalogArcIndicator'],
+["require", 'dojox.widget.AnalogGauge']],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource['dojox.widget.gauge.AnalogArcIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.AnalogArcIndicator'] = true;
+dojo.provide('dojox.widget.gauge.AnalogArcIndicator');
+dojo.require('dojox.widget.AnalogGauge');
+
+dojo.experimental("dojox.widget.gauge.AnalogArcIndicator");
+
+dojo.declare("dojox.widget.gauge.AnalogArcIndicator",[dojox.widget.gauge.AnalogLineIndicator],{
+ _createArc: function(val){
+ // Creating the Arc Path string manually. This is instead of creating new dojox.gfx.Path object
+ // each time since we really just need the Path string (to use with setShape) and we don't want to
+ // have to redo the connects, etc.
+ if(this.shapes[0]){
+ var a = this._gauge._getRadians(this._gauge._getAngle(val));
+ var cosa = Math.cos(a);
+ var sina = Math.sin(a);
+ var sa = this._gauge._getRadians(this._gauge.startAngle);
+ var cossa = Math.cos(sa);
+ var sinsa = Math.sin(sa);
+ var off = this.offset + this.width;
+ var p = ['M'];
+ p.push(this._gauge.cx+this.offset*sinsa);
+ p.push(this._gauge.cy-this.offset*cossa);
+ p.push('A', this.offset, this.offset, 0, ((a-sa)>Math.PI)?1:0, 1);
+ p.push(this._gauge.cx+this.offset*sina);
+ p.push(this._gauge.cy-this.offset*cosa);
+ p.push('L');
+ p.push(this._gauge.cx+off*sina);
+ p.push(this._gauge.cy-off*cosa);
+ p.push('A', off, off, 0, ((a-sa)>Math.PI)?1:0, 0);
+ p.push(this._gauge.cx+off*sinsa);
+ p.push(this._gauge.cy-off*cossa);
+ this.shapes[0].setShape(p.join(' '));
+ this.currentValue = val;
+ }
+ },
+ draw: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget._Indicator.draw
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ if(this.shapes){
+ if(dontAnimate){
+ this._createArc(v);
+ }else{
+ var anim = new dojo.Animation({curve: [this.currentValue, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, this._createArc));
+ anim.play();
+ }
+ }else{
+ var stroke = {color: this.color, width: 1};
+ if(this.color.type){
+ stroke.color = this.color.colors[0].color;
+ }
+ this.shapes = [this._gauge.surface.createPath()
+ .setStroke(stroke).setFill(this.color)];
+ this._createArc(v);
+ if(this.hover){
+ this.shapes[0].getEventSource().setAttribute('hover',this.hover);
+ }
+ if(this.onDragMove && !this.noChange){
+ this._gauge.connect(this.shapes[0].getEventSource(), 'onmousedown', this._gauge.handleMouseDown);
+ this.shapes[0].getEventSource().style.cursor = 'pointer';
+ }
+ }
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/gauge/AnalogArrowIndicator.js b/js/dojo-1.6/dojox/widget/gauge/AnalogArrowIndicator.js new file mode 100644 index 0000000..ebb8172 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/AnalogArrowIndicator.js @@ -0,0 +1,48 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource['dojox.widget.gauge.AnalogArrowIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.AnalogArrowIndicator'] = true;
+dojo.provide('dojox.widget.gauge.AnalogArrowIndicator');
+dojo.require('dojox.widget.AnalogGauge');
+
+dojo.experimental("dojox.widget.gauge.AnalogArrowIndicator");
+
+dojo.declare("dojox.widget.gauge.AnalogArrowIndicator",[dojox.widget.gauge.AnalogLineIndicator],{
+ _getShapes: function(){
+ // summary:
+ // Override of dojox.widget.AnalogLineIndicator._getShapes
+ if(!this._gauge){
+ return null;
+ }
+ var x = Math.floor(this.width/2);
+ var head = this.width * 5;
+ var odd = (this.width & 1);
+ var shapes = [];
+ var points = [{x:-x, y:0},
+ {x:-x, y:-this.length+head},
+ {x:-2*x, y:-this.length+head},
+ {x:0, y:-this.length},
+ {x:2*x+odd,y:-this.length+head},
+ {x:x+odd, y:-this.length+head},
+ {x:x+odd, y:0},
+ {x:-x, y:0}];
+ shapes[0] = this._gauge.surface.createPolyline(points)
+ .setStroke({color: this.color})
+ .setFill(this.color);
+ shapes[1] = this._gauge.surface.createLine({ x1:-x, y1: 0, x2: -x, y2:-this.length+head })
+ .setStroke({color: this.highlight});
+ shapes[2] = this._gauge.surface.createLine({ x1:-x-3, y1: -this.length+head, x2: 0, y2:-this.length })
+ .setStroke({color: this.highlight});
+ shapes[3] = this._gauge.surface.createCircle({cx: 0, cy: 0, r: this.width})
+ .setStroke({color: this.color})
+ .setFill(this.color);
+ return shapes;
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/gauge/AnalogArrowIndicator.xd.js b/js/dojo-1.6/dojox/widget/gauge/AnalogArrowIndicator.xd.js new file mode 100644 index 0000000..fee7656 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/AnalogArrowIndicator.xd.js @@ -0,0 +1,53 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", 'dojox.widget.gauge.AnalogArrowIndicator'],
+["require", 'dojox.widget.AnalogGauge']],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource['dojox.widget.gauge.AnalogArrowIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.AnalogArrowIndicator'] = true;
+dojo.provide('dojox.widget.gauge.AnalogArrowIndicator');
+dojo.require('dojox.widget.AnalogGauge');
+
+dojo.experimental("dojox.widget.gauge.AnalogArrowIndicator");
+
+dojo.declare("dojox.widget.gauge.AnalogArrowIndicator",[dojox.widget.gauge.AnalogLineIndicator],{
+ _getShapes: function(){
+ // summary:
+ // Override of dojox.widget.AnalogLineIndicator._getShapes
+ if(!this._gauge){
+ return null;
+ }
+ var x = Math.floor(this.width/2);
+ var head = this.width * 5;
+ var odd = (this.width & 1);
+ var shapes = [];
+ var points = [{x:-x, y:0},
+ {x:-x, y:-this.length+head},
+ {x:-2*x, y:-this.length+head},
+ {x:0, y:-this.length},
+ {x:2*x+odd,y:-this.length+head},
+ {x:x+odd, y:-this.length+head},
+ {x:x+odd, y:0},
+ {x:-x, y:0}];
+ shapes[0] = this._gauge.surface.createPolyline(points)
+ .setStroke({color: this.color})
+ .setFill(this.color);
+ shapes[1] = this._gauge.surface.createLine({ x1:-x, y1: 0, x2: -x, y2:-this.length+head })
+ .setStroke({color: this.highlight});
+ shapes[2] = this._gauge.surface.createLine({ x1:-x-3, y1: -this.length+head, x2: 0, y2:-this.length })
+ .setStroke({color: this.highlight});
+ shapes[3] = this._gauge.surface.createCircle({cx: 0, cy: 0, r: this.width})
+ .setStroke({color: this.color})
+ .setFill(this.color);
+ return shapes;
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/gauge/AnalogNeedleIndicator.js b/js/dojo-1.6/dojox/widget/gauge/AnalogNeedleIndicator.js new file mode 100644 index 0000000..7e4828b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/AnalogNeedleIndicator.js @@ -0,0 +1,42 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource['dojox.widget.gauge.AnalogNeedleIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.AnalogNeedleIndicator'] = true;
+dojo.provide('dojox.widget.gauge.AnalogNeedleIndicator');
+dojo.require('dojox.widget.AnalogGauge');
+
+dojo.experimental("dojox.widget.gauge.AnalogNeedleIndicator");
+
+dojo.declare("dojox.widget.gauge.AnalogNeedleIndicator",[dojox.widget.gauge.AnalogLineIndicator],{
+ _getShapes: function(){
+ // summary:
+ // Override of dojox.widget.AnalogLineIndicator._getShapes
+ if(!this._gauge){
+ return null;
+ }
+ var x = Math.floor(this.width/2);
+ var head = this.width * 5;
+ var odd = (this.width & 1);
+ var shapes = [];
+ var stroke = {color: this.color, width: 1};
+ if(this.color.type){
+ stroke.color = this.color.colors[0].color;
+ }
+ var xy = (Math.sqrt(2) * (x));
+ shapes[0] = this._gauge.surface.createPath()
+ .setStroke(stroke).setFill(this.color)
+ .moveTo(xy, -xy).arcTo((2*x), (2*x), 0, 0, 0, -xy, -xy)
+ .lineTo(0, -this.length).closePath();
+ shapes[1] = this._gauge.surface.createCircle({cx: 0, cy: 0, r: this.width})
+ .setStroke({color: this.color})
+ .setFill(this.color);
+ return shapes;
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/gauge/AnalogNeedleIndicator.xd.js b/js/dojo-1.6/dojox/widget/gauge/AnalogNeedleIndicator.xd.js new file mode 100644 index 0000000..f180a1f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/AnalogNeedleIndicator.xd.js @@ -0,0 +1,47 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", 'dojox.widget.gauge.AnalogNeedleIndicator'],
+["require", 'dojox.widget.AnalogGauge']],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource['dojox.widget.gauge.AnalogNeedleIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.AnalogNeedleIndicator'] = true;
+dojo.provide('dojox.widget.gauge.AnalogNeedleIndicator');
+dojo.require('dojox.widget.AnalogGauge');
+
+dojo.experimental("dojox.widget.gauge.AnalogNeedleIndicator");
+
+dojo.declare("dojox.widget.gauge.AnalogNeedleIndicator",[dojox.widget.gauge.AnalogLineIndicator],{
+ _getShapes: function(){
+ // summary:
+ // Override of dojox.widget.AnalogLineIndicator._getShapes
+ if(!this._gauge){
+ return null;
+ }
+ var x = Math.floor(this.width/2);
+ var head = this.width * 5;
+ var odd = (this.width & 1);
+ var shapes = [];
+ var stroke = {color: this.color, width: 1};
+ if(this.color.type){
+ stroke.color = this.color.colors[0].color;
+ }
+ var xy = (Math.sqrt(2) * (x));
+ shapes[0] = this._gauge.surface.createPath()
+ .setStroke(stroke).setFill(this.color)
+ .moveTo(xy, -xy).arcTo((2*x), (2*x), 0, 0, 0, -xy, -xy)
+ .lineTo(0, -this.length).closePath();
+ shapes[1] = this._gauge.surface.createCircle({cx: 0, cy: 0, r: this.width})
+ .setStroke({color: this.color})
+ .setFill(this.color);
+ return shapes;
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/gauge/BarIndicator.js b/js/dojo-1.6/dojox/widget/gauge/BarIndicator.js new file mode 100644 index 0000000..de72b02 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/BarIndicator.js @@ -0,0 +1,83 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource['dojox.widget.gauge.BarIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.BarIndicator'] = true;
+dojo.provide('dojox.widget.gauge.BarIndicator');
+dojo.require('dojox.widget.BarGauge');
+
+dojo.experimental("dojox.widget.gauge.BarIndicator");
+
+dojo.declare("dojox.widget.gauge.BarIndicator",[dojox.widget.gauge.BarLineIndicator],{
+ _getShapes: function(){
+ // summary:
+ // Override of dojox.widget.BarLineIndicator._getShapes
+ if(!this._gauge){
+ return null;
+ }
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ var pos = this._gauge._getPosition(v);
+ if(pos == this.dataX){pos = this.dataX+1;}
+ var y = this._gauge.dataY + Math.floor((this._gauge.dataHeight - this.width)/2) + this.offset;
+
+ var shapes = [];
+ shapes[0] = this._gauge.surface.createRect({x:this._gauge.dataX, y:y, width:pos - this._gauge.dataX, height:this.width});
+ shapes[0].setStroke({color: this.color});
+ shapes[0].setFill(this.color);
+ shapes[1] = this._gauge.surface.createLine({ x1:this._gauge.dataX, y1:y, x2:pos, y2:y });
+ shapes[1].setStroke({color: this.highlight});
+ if(this.highlight2){
+ y--;
+ shapes[2] = this._gauge.surface.createLine({ x1:this._gauge.dataX, y1:y, x2:pos, y2:y });
+ shapes[2].setStroke({color: this.highlight2});
+ }
+
+ return shapes;
+ },
+ _createShapes: function(val){
+ // summary:
+ // Creates a shallow copy of the current shapes while adjusting for the new value
+ for(var i in this.shapes){
+ i = this.shapes[i];
+ var newShape = {};
+ for(var j in i){
+ newShape[j] = i[j];
+ }
+ if(i.shape.type == "line"){
+ newShape.shape.x2 = val+newShape.shape.x1;
+ }else if(i.shape.type == "rect"){
+ newShape.width = val;
+ }
+ i.setShape(newShape);
+ }
+ },
+ _move: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget.BarLineIndicator._move to resize the bar (rather than moving it)
+ var changed = false;
+ var c;
+ var v = this.value ;
+ if(v < this.min){v = this.min;}
+ if(v > this.max){v = this.max;}
+ c = this._gauge._getPosition(this.currentValue);
+ this.currentValue = v;
+ v = this._gauge._getPosition(v)-this._gauge.dataX;
+ if(dontAnimate){
+ this._createShapes(v);
+ }else{
+ if(c!=v){
+ var anim = new dojo.Animation({curve: [c, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, this._createShapes));
+ anim.play();
+ }
+ }
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/gauge/BarIndicator.xd.js b/js/dojo-1.6/dojox/widget/gauge/BarIndicator.xd.js new file mode 100644 index 0000000..af4edf3 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/BarIndicator.xd.js @@ -0,0 +1,88 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", 'dojox.widget.gauge.BarIndicator'],
+["require", 'dojox.widget.BarGauge']],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource['dojox.widget.gauge.BarIndicator']){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource['dojox.widget.gauge.BarIndicator'] = true;
+dojo.provide('dojox.widget.gauge.BarIndicator');
+dojo.require('dojox.widget.BarGauge');
+
+dojo.experimental("dojox.widget.gauge.BarIndicator");
+
+dojo.declare("dojox.widget.gauge.BarIndicator",[dojox.widget.gauge.BarLineIndicator],{
+ _getShapes: function(){
+ // summary:
+ // Override of dojox.widget.BarLineIndicator._getShapes
+ if(!this._gauge){
+ return null;
+ }
+ var v = this.value;
+ if(v < this._gauge.min){v = this._gauge.min;}
+ if(v > this._gauge.max){v = this._gauge.max;}
+ var pos = this._gauge._getPosition(v);
+ if(pos == this.dataX){pos = this.dataX+1;}
+ var y = this._gauge.dataY + Math.floor((this._gauge.dataHeight - this.width)/2) + this.offset;
+
+ var shapes = [];
+ shapes[0] = this._gauge.surface.createRect({x:this._gauge.dataX, y:y, width:pos - this._gauge.dataX, height:this.width});
+ shapes[0].setStroke({color: this.color});
+ shapes[0].setFill(this.color);
+ shapes[1] = this._gauge.surface.createLine({ x1:this._gauge.dataX, y1:y, x2:pos, y2:y });
+ shapes[1].setStroke({color: this.highlight});
+ if(this.highlight2){
+ y--;
+ shapes[2] = this._gauge.surface.createLine({ x1:this._gauge.dataX, y1:y, x2:pos, y2:y });
+ shapes[2].setStroke({color: this.highlight2});
+ }
+
+ return shapes;
+ },
+ _createShapes: function(val){
+ // summary:
+ // Creates a shallow copy of the current shapes while adjusting for the new value
+ for(var i in this.shapes){
+ i = this.shapes[i];
+ var newShape = {};
+ for(var j in i){
+ newShape[j] = i[j];
+ }
+ if(i.shape.type == "line"){
+ newShape.shape.x2 = val+newShape.shape.x1;
+ }else if(i.shape.type == "rect"){
+ newShape.width = val;
+ }
+ i.setShape(newShape);
+ }
+ },
+ _move: function(/*Boolean?*/ dontAnimate){
+ // summary:
+ // Override of dojox.widget.BarLineIndicator._move to resize the bar (rather than moving it)
+ var changed = false;
+ var c;
+ var v = this.value ;
+ if(v < this.min){v = this.min;}
+ if(v > this.max){v = this.max;}
+ c = this._gauge._getPosition(this.currentValue);
+ this.currentValue = v;
+ v = this._gauge._getPosition(v)-this._gauge.dataX;
+ if(dontAnimate){
+ this._createShapes(v);
+ }else{
+ if(c!=v){
+ var anim = new dojo.Animation({curve: [c, v], duration: this.duration, easing: this.easing});
+ dojo.connect(anim, "onAnimate", dojo.hitch(this, this._createShapes));
+ anim.play();
+ }
+ }
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/gauge/_Gauge.css b/js/dojo-1.6/dojox/widget/gauge/_Gauge.css new file mode 100644 index 0000000..7eaa756 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/_Gauge.css @@ -0,0 +1,63 @@ +@CHARSET "ISO-8859-1"; + +.dojoxGaugeContent { + font-family: Verdana; + border-width: 1px; + border-style: solid; + border-color: #CCCCCC; +} + +.dojoxGaugeRange1 { + fill: #606060 ; + stroke: #606060 ; +} + +.dojoxGaugeRange2 { + fill: #707070 ; + stroke: #707070 ; +} + +.dojoxGaugeRange3 { + fill: #808080 ; + stroke: #808080 ; +} + +.dojoxGaugeRange4 { + fill: #909090 ; + stroke: #909090 ; +} + +.dojoxGaugeRange5 { + fill: #A0A0A0; + stroke: #A0A0A0; +} + +.dojoxGaugeRange6 { + fill: #B0B0B0; + stroke: #B0B0B0; +} + +.dojoxGaugeRange7 { + fill: #C0C0C0; + stroke: #C0C0C0; +} + +.dojoxGaugeRange8 { + fill: #D0D0D0; + stroke: #D0D0D0; +} + +.dojoxGaugeRange9 { + fill: #E0E0E0; + stroke: #E0E0E0; +} + +.dojoxGaugeRange10 { + fill: #F0F0F0; + stroke: #F0F0F0; +} + +.testing { + fill: blue; + stroke: blue; +}
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/gauge/_Gauge.html b/js/dojo-1.6/dojox/widget/gauge/_Gauge.html new file mode 100644 index 0000000..3c4bdf9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/_Gauge.html @@ -0,0 +1,5 @@ +<div> + <div class="dojoxGaugeContent" dojoAttachPoint="gaugeContent"></div> + <div dojoAttachPoint="containerNode"></div> + <div dojoAttachPoint="mouseNode"></div> +</div>
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/gauge/_Gauge.js b/js/dojo-1.6/dojox/widget/gauge/_Gauge.js new file mode 100644 index 0000000..775d74b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/_Gauge.js @@ -0,0 +1,767 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.gauge._Gauge"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.gauge._Gauge"] = true;
+dojo.provide("dojox.widget.gauge._Gauge");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dijit._Container");
+dojo.require("dijit._Contained");
+dojo.require("dijit.Tooltip");
+dojo.require("dojo.fx.easing");
+dojo.require("dojox.gfx");
+
+dojo.experimental("dojox.widget.gauge._Gauge");
+
+dojo.declare("dojox.widget.gauge._Gauge",[dijit._Widget, dijit._Templated, dijit._Container],{
+ // summary:
+ // a gauge built using the dojox.gfx package.
+ //
+ // description:
+ // using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
+ // builds a gauge component, used to display numerical data in a familiar format
+ //
+ // usage:
+ // this widget is not to be used alone. it is meant to be subclassed, such as
+ // dojox.widget.BarGauge or dojox.widget.AnalogGauge
+
+ // width: Number
+ // the width of the gauge (default is 300)
+ width: 0,
+
+ // height: Number
+ // the height of the gauge (default is 200)
+ height: 0,
+
+ // background: Object
+ // the color of the background. This must be an object of one of two forms:
+ // {'color': 'color-name'}
+ // OR
+ // (for a gradient:)
+ // {'type': 'linear', 'x1': 0, 'x2': 0, 'y1': 0, 'y2': 200, 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] }
+ background: null,
+
+ // min: Number
+ // minimum value displayed by gauge (default is lowest range value)
+ min: 0,
+
+ // max: Number
+ // maximum value displayed by gauge (default is largest range value)
+ max: 0,
+
+ // image: String
+ // background image for gauge (default is no image)
+ image: null,
+
+ // useRangeStyles: Number
+ // indicates whether to use given css classes (dojoxGaugeRangeXX)
+ // to determine the color (and other style attributes?) of the ranges
+ // this value should be the number of dojoxGaugeRange classes that are
+ // defined, starting at dojoxGaugeRange1 (0 indicates falling to default
+ // hardcoded colors)
+ useRangeStyles: 0,
+
+ // useTooltip: Boolean
+ // indicates whether tooltips should be displayed for ranges, indicators, etc.
+ useTooltip: true,
+
+ // majorTicks: Object
+ // An object representing the tick marks that should be added to the gauge. Major tick marks have a text label
+ // indicating the value. The object can have the following attributes (required are marked with a *):
+ // offset: the distance from the 'center' of the gauge. Used differently for Analog vs. Bar
+ // width: The width of the mark
+ // length: The length of the mark
+ // interval: The interval the ticks should be added on
+ // color: The color of the mark and text
+ // font: an object with any/all of the following parameters:
+ // {family: "Helvetica", style: "italic", variant: 'small-caps', weight: 'bold', size: "18pt"}
+ majorTicks: null,
+
+ // minorTicks: Object
+ // An object of the same format as majorTicks, indicating where the minor (label-less) marks should be placed
+ // The font parameter is ignored if provided since minor tick marks have no text label.
+ minorTicks: null,
+
+ // _defaultIndicator: Objection
+ // Should be overridden by any extending classes and used to indicate what the 'default' indicator is.
+ // This object is used as the indicator when creating tick marks or when an anonmyous object is passed into
+ // addIndicator.
+ _defaultIndicator: null,
+
+ // defaultColors: Array
+ // Set of default colors to color ranges with.
+ defaultColors: [[0x00,0x54,0xAA,1],
+ [0x44,0x77,0xBB,1],
+ [0x66,0x99,0xCC,1],
+ [0x99,0xBB,0xEE,1],
+ [0x99,0xCC,0xFF,1],
+ [0xCC,0xEE,0xFF,1],
+ [0xDD,0xEE,0xFF,1]],
+
+ // min: Number
+ // The minimum value of the gauge. Normally not set explicitly, as it will be determined by
+ // the ranges that are added.
+ min: null,
+
+ // max: Number
+ // The maximum value of the gauge. Normally not set explicitly, as it will be determined by
+ // the ranges that are added.
+ max: null,
+
+ // surface: Object
+ // The SVG/VML surface that the shapes are drawn on. Can be accessed/used by indicators to draw themselves
+ surface: null,
+
+ // hideValues: Boolean
+ // indicates whether the text boxes showing the value of the indicator (as text
+ // content) should be hidden or shown. Default is not hidden, aka shown.
+ hideValues: false,
+
+ // internal data
+ gaugeContent: undefined,
+ templateString: dojo.cache("dojox.widget.gauge", "_Gauge.html", "<div>\r\n\t<div class=\"dojoxGaugeContent\" dojoAttachPoint=\"gaugeContent\"></div>\r\n\t<div dojoAttachPoint=\"containerNode\"></div>\r\n\t<div dojoAttachPoint=\"mouseNode\"></div>\r\n</div>\r\n"),
+ _backgroundDefault: {color: '#E0E0E0'},
+ _rangeData: null,
+ _indicatorData: null,
+ _drag: null,
+ _img: null,
+ _overOverlay: false,
+ _lastHover: '',
+
+ startup: function(){
+ // handle settings from HTML by making sure all the options are
+ // converted correctly to numbers and that we calculate defaults
+ // for cx, cy and radius
+ if(this.image === null){
+ this.image={};
+ }
+
+ this.connect(this.gaugeContent, 'onmousemove', this.handleMouseMove);
+ this.connect(this.gaugeContent, 'onmouseover', this.handleMouseOver);
+ this.connect(this.gaugeContent, 'onmouseout', this.handleMouseOut);
+ this.connect(this.gaugeContent, 'onmouseup', this.handleMouseUp);
+
+ if(!dojo.isArray(this.ranges)){ this.ranges = []; }
+ if(!dojo.isArray(this.indicators)){ this.indicators = []; }
+ var ranges = [], indicators = [];
+ var i;
+ if(this.hasChildren()){
+ var children = this.getChildren();
+ for(i=0; i<children.length; i++){
+ if(/dojox\.widget\..*Indicator/.test(children[i].declaredClass)){
+ indicators.push(children[i]);
+ //this.addIndicator(children[i]);
+ continue;
+ }
+ switch(children[i].declaredClass){
+ case "dojox.widget.gauge.Range":
+ ranges.push(children[i]);
+ break;
+ }
+ }
+ this.ranges = this.ranges.concat(ranges);
+ this.indicators = this.indicators.concat(indicators);
+ }
+ if(!this.background){ this.background = this._backgroundDefault; }
+ this.background = this.background.color || this.background;
+ if(!this.surface){ this.createSurface(); }
+
+ this.addRanges(this.ranges);
+ if(this.minorTicks && this.minorTicks.interval){
+ this.setMinorTicks(this.minorTicks);
+ }
+ if(this.majorTicks && this.majorTicks.interval){
+ this.setMajorTicks(this.majorTicks);
+ }
+ for(i=0; i<this.indicators.length; i++){
+ this.addIndicator(this.indicators[i]);
+ }
+ },
+
+ _setTicks: function(/*Object*/ oldTicks, /*Object*/ newTicks, /*Boolean*/ label){
+ // summary:
+ // internal method used to clear existing tick marks, then add new ones
+ var i;
+ if(oldTicks && dojo.isArray(oldTicks._ticks)){
+ for(i=0; i<oldTicks._ticks.length; i++){
+ this.removeIndicator(oldTicks._ticks[i]);
+ }
+ }
+ var t = {length: newTicks.length,
+ offset: newTicks.offset,
+ noChange: true};
+ if(newTicks.color){ t.color = newTicks.color; }
+ if(newTicks.font){ t.font = newTicks.font; }
+ newTicks._ticks = [];
+ for(i=this.min; i<=this.max; i+=newTicks.interval){
+ t.value = i;
+ if(label){t.label = ''+i;}
+ newTicks._ticks.push(this.addIndicator(t));
+ }
+ return newTicks;
+ },
+
+ setMinorTicks: function(/*Object*/ ticks){
+ // summary:
+ // Creates and draws the minor tick marks based on the passed object (expecting the same format
+ // as the minorTicks object documented above)
+ this.minorTicks = this._setTicks(this.minorTicks, ticks, false);
+ },
+
+ setMajorTicks: function(/*Object*/ ticks){
+ // summary:
+ // Creates and draws the major tick marks based on the passed object (expecting the same format
+ // as the majorTicks object documented above)
+ this.majorTicks = this._setTicks(this.majorTicks, ticks, true);
+ },
+
+ postCreate: function(){
+ if(this.hideValues){
+ dojo.style(this.containerNode, "display", "none");
+ }
+ dojo.style(this.mouseNode, 'width', '0');
+ dojo.style(this.mouseNode, 'height', '0');
+ dojo.style(this.mouseNode, 'position', 'absolute');
+ dojo.style(this.mouseNode, 'z-index', '100');
+ if(this.useTooltip){
+ dijit.showTooltip('test',this.mouseNode, !this.isLeftToRight());
+ dijit.hideTooltip(this.mouseNode);
+ }
+ },
+
+ createSurface: function(){
+ // summary:
+ // internal method used by the gauge to create the graphics surface area
+ this.gaugeContent.style.width = this.width + 'px';
+ this.gaugeContent.style.height = this.height + 'px';
+ this.surface = dojox.gfx.createSurface(this.gaugeContent, this.width, this.height);
+ this._background = this.surface.createRect({x: 0, y: 0, width: this.width, height: this.height });
+ this._background.setFill(this.background);
+
+ if(this.image.url){
+ this._img = this.surface.createImage({width: this.image.width || this.width, height: this.image.height || this.height, src: this.image.url});
+ if(this.image.overlay){
+ this._img.getEventSource().setAttribute('overlay',true);
+ }
+ if(this.image.x || this.image.y){
+ this._img.setTransform({dx: this.image.x || 0, dy: this.image.y || 0});
+ }
+ }
+ },
+
+ setBackground: function(background){
+ // summary:
+ // This method is used to set the background of the gauge after it is created.
+ // description:
+ // Sets the background using the given object. Must be the same 'type' of object
+ // as the original background argument.
+ // background:
+ // An object in one of the two forms:
+ // {'color': 'color-name'}
+ // OR
+ // (for a gradient:)
+ // {'type': 'linear', 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] }
+ // If background is null or undefined, this will set the fill to this._backgroundDefault
+ if(!background){ background = this._backgroundDefault; }
+ this.background = background.color || background;
+ this._background.setFill(this.background);
+ },
+
+ addRange: function(/*Object*/range){
+ // summary:
+ // This method is used to add a range to the gauge.
+ // description:
+ // Creates a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is either a dojox.widget.gauge.Range object, or a object
+ // with similar parameters (low, high, hover, etc.).
+ this.addRanges([range]);
+ },
+
+ addRanges: function(/*Array*/ranges){
+ // summary:
+ // This method is used to add ranges to the gauge.
+ // description:
+ // Creates a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is either a dojox.widget.gauge.Range object, or a object
+ // with similar parameters (low, high, hover, etc.).
+ if(!this._rangeData){
+ this._rangeData = [];
+ }
+ var range;
+ for(var i=0; i<ranges.length; i++){
+ range = ranges[i];
+ if((this.min === null) || (range.low < this.min)){this.min = range.low;}
+ if((this.max === null) || (range.high > this.max)){this.max = range.high;}
+
+ if(!range.color){
+ var colorIndex = this._rangeData.length % this.defaultColors.length;
+ if(dojox.gfx.svg && this.useRangeStyles > 0){
+ colorIndex = (this._rangeData.length % this.useRangeStyles)+1;
+ range.color = {style: "dojoxGaugeRange"+colorIndex};
+ }else{
+ colorIndex = this._rangeData.length % this.defaultColors.length;
+ range.color = this.defaultColors[colorIndex];
+ }
+ }
+ this._rangeData[this._rangeData.length] = range;
+ }
+ this.draw();
+ },
+
+ addIndicator: function(/*Object*/indicator){
+ // summary:
+ // This method is used to add an indicator to the bar graph.
+ // description:
+ // This method adds an indicator, such as a tick mark or needle,
+ // to the bar graph.
+ // indicator:
+ // A dojox.widget.gauge._Indicator or an object with similar parameters
+ // (value, color, offset, etc.).
+
+ indicator._gauge = this;
+ if(!indicator.declaredClass){// !== 'dojox.widget.gauge.Indicator'){
+ // We were passed a plain object, need to make an indicator out of it.
+ indicator = new this._defaultIndicator(indicator);
+ }
+ if(!indicator.hideValue){
+ this.containerNode.appendChild(indicator.domNode);
+ }
+ if(!this._indicatorData){this._indicatorData = [];}
+ this._indicatorData[this._indicatorData.length] = indicator;
+ indicator.draw();
+ return indicator;
+ },
+
+ removeIndicator: function(/*Object*/indicator){
+ // summary:
+ // Removes the given indicator from the gauge by calling it's remove function
+ // and removing it from the local cache.
+ for(var i=0; i<this._indicatorData.length; i++){
+ if(this._indicatorData[i] === indicator){
+ this._indicatorData.splice(i, 1);
+ indicator.remove();
+ break;
+ }
+ }
+ },
+
+ moveIndicatorToFront: function(/*Object*/indicator){
+ // summary:
+ // This function is used to move an indicator the the front (top)
+ // of the gauge
+ // indicator:
+ // A dojox.widget.gauge._Indicator or an object with similar parameters
+ // (value, color, offset, etc.).
+ if(indicator.shapes){
+ for(var i=0; i<indicator.shapes.length; i++){
+ indicator.shapes[i].moveToFront();
+ }
+ }
+ },
+
+ drawText: function(/*String*/txt, /*Number*/x, /*Number*/y, /*String?*/align, /*String?*/vAlign, /*String?*/color, /*Object?*/font){
+ // summary:
+ // This function is used draw text onto the gauge. The text object
+ // is also returned by the function so that may be removed later
+ // by calling removeText
+ // txt: String
+ // The text to be drawn
+ // x: Number
+ // The x coordinate at which to place the text
+ // y: Number
+ // The y coordinate at which to place the text
+ // align?: String
+ // Indicates how to align the text
+ // Valid value is 'right', otherwise text is left-aligned
+ // vAlign?: String
+ // Indicates how to align the text vertically.
+ // Valid value is 'top', otherwise text is bottom-aligned
+ // color?: String
+ // Indicates the color of the text
+ // font?: Object
+ // A font object, generally of the following format:
+ // {family: "Helvetica", style: "italic", variant: 'small-caps', weight: 'bold', size: "18pt"}
+
+ var t = this.surface.createText({x: x, y: y, text: txt, align: align});
+ t.setFill(color);
+ t.setFont(font);
+ return t;
+ },
+
+ removeText:function(/*String*/t){
+ // summary:
+ // Removes a text element from the gauge.
+ // t: String
+ // The text to remove.
+ this.surface.rawNode.removeChild(t);
+ },
+
+ updateTooltip: function(/*String*/txt, /*Event*/ e){
+ // summary:
+ // Updates the tooltip for the gauge to display the given text.
+ // txt: String
+ // The text to put in the tooltip.
+ if(this._lastHover != txt){
+ if(txt !== ''){
+ dijit.hideTooltip(this.mouseNode);
+ dijit.showTooltip(txt,this.mouseNode, !this.isLeftToRight());
+ }else{
+ dijit.hideTooltip(this.mouseNode);
+ }
+ this._lastHover = txt;
+ }
+ },
+
+ handleMouseOver: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support
+ // hover text
+ // event: Object
+ // The event object
+ var hover = event.target.getAttribute('hover');
+ if(event.target.getAttribute('overlay')){
+ this._overOverlay = true;
+ var r = this.getRangeUnderMouse(event);
+ if(r && r.hover){
+ hover = r.hover;
+ }
+ }
+ if(this.useTooltip && !this._drag){
+ if(hover){
+ this.updateTooltip(hover, event);
+ }else{
+ this.updateTooltip('', event);
+ }
+ }
+ },
+
+ handleMouseOut: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support
+ // hover text
+ // event: Object
+ // The event object
+ if(event.target.getAttribute('overlay')){
+ this._overOverlay = false;
+ }
+ if(this.useTooltip && this.mouseNode){
+ dijit.hideTooltip(this.mouseNode);
+ }
+ },
+
+ handleMouseDown: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support using
+ // the mouse to drag an indicator to modify it's value
+ // event: Object
+ // The event object
+
+ // find the indicator being dragged
+ for(var i=0; i<this._indicatorData.length; i++){
+ var shapes = this._indicatorData[i].shapes;
+ for(var s=0; s<shapes.length; s++){
+ if(shapes[s].getEventSource() == event.target){
+ this._drag = this._indicatorData[i];
+ s = shapes.length;
+ i = this._indicatorData.length;
+ }
+ }
+ }
+ dojo.stopEvent(event);
+ },
+
+ handleMouseUp: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support using
+ // the mouse to drag an indicator to modify it's value
+ // event: Object
+ // The event object
+ this._drag = null;
+ dojo.stopEvent(event);
+ },
+
+ handleMouseMove: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support using
+ // the mouse to drag an indicator to modify it's value
+ // event: Object
+ // The event object
+ if(event){
+ dojo.style(this.mouseNode, 'left', event.pageX+1+'px');
+ dojo.style(this.mouseNode, 'top', event.pageY+1+'px');
+ }
+ if(this._drag){
+ this._dragIndicator(this, event);
+ }else{
+ if(this.useTooltip && this._overOverlay){
+ var r = this.getRangeUnderMouse(event);
+ if(r && r.hover){
+ this.updateTooltip(r.hover, event);
+ }else{
+ this.updateTooltip('', event);
+ }
+ }
+ }
+ }
+});
+
+dojo.declare("dojox.widget.gauge.Range",[dijit._Widget, dijit._Contained],{
+ // summary:
+ // a range to be used in a _Gauge
+ //
+ // description:
+ // a range widget, which has given properties. drawn by a _Gauge.
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.AnalogGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.AnalogGauge"
+ // id="testGauge"
+ // width="300"
+ // height="200"
+ // cx=150
+ // cy=175
+ // radius=125
+ // image="gaugeOverlay.png"
+ // imageOverlay="false"
+ // imageWidth="280"
+ // imageHeight="155"
+ // imageX="12"
+ // imageY="38">
+ // <div dojoType="dojox.widget.gauge.Range"
+ // low=5
+ // high=10
+ // hover="5 - 10"
+ // ></div>
+ // <div dojoType="dojox.widget.gauge.Range"
+ // low=10
+ // high=20
+ // hover="10 - 20"
+ // ></div>
+ // </div>
+
+ // low: Number
+ // the low value of the range
+ low: 0,
+
+ // high: Numbe
+ // the high value of the range
+ high: 0,
+
+ // hover: String
+ // the text to put in the tooltip for the gauge
+ hover: '',
+
+ // color: Object
+ // the color of the range. This must be an object of one of two forms:
+ // {'color': 'color-name'}
+ // OR
+ // (for a gradient:)
+ // {'type': 'linear', 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] }
+ color: null,
+
+ // size: Number
+ // for a circular gauge (such as an AnalogGauge), this dictates the size of the arc
+ size: 0,
+
+ startup: function(){
+ this.color = this.color.color || this.color;
+ }
+});
+
+dojo.declare("dojox.widget.gauge._Indicator",[dijit._Widget, dijit._Contained, dijit._Templated],{
+ // summary:
+ // a indicator to be used in a gauge
+ //
+ // description:
+ // an indicator widget, which has given properties. drawn by a gauge.
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.AnalogGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.AnalogGauge"
+ // id="testGauge"
+ // width="300"
+ // height="200"
+ // cx=150
+ // cy=175
+ // radius=125
+ // image="gaugeOverlay.png"
+ // imageOverlay="false"
+ // imageWidth="280"
+ // imageHeight="155"
+ // imageX="12"
+ // imageY="38">
+ // <div dojoType="dojox.widget.gauge.Indicator"
+ // value=17
+ // type="arrow"
+ // length=135
+ // width=3
+ // hover="Value: 17"
+ // onDragMove="handleDragMove">
+ // </div>
+ // </div>
+
+ // value: Number
+ // The value (on the gauge) that this indicator should be placed at
+ value: 0,
+
+ // type: String
+ // The type of indicator to draw. Varies by gauge type. Some examples include
+ // "line", "arrow", and "bar"
+ type: '',
+
+ // color: String
+ // The color of the indicator.
+ color: 'black',
+
+ // label: String
+ // The text label for the indicator.
+ label: '',
+
+ // font: Object
+ // Generally in a format similar to:
+ // {family: "Helvetica", weight: "bold", style: "italic", size: "18pt", rotated: true}
+ font: {family: "sans-serif", size: "12px"},
+
+ // length: Number
+ // The length of the indicator. In the above example, the radius of the AnalogGauge
+ // is 125, but the length of the indicator is 135, meaning it would project beyond
+ // the edge of the AnalogGauge
+ length: 0,
+
+ // width: Number
+ // The width of the indicator.
+ width: 0,
+
+ // offset: Number
+ // The offset of the indicator
+ offset: 0,
+
+ // hover: String
+ // The string to put in the tooltip when this indicator is hovered over.
+ hover: '',
+
+ // front: boolean
+ // Keep this indicator at the front
+ front: false,
+
+ // onDragMove: String
+ // The function to call when this indicator is moved by dragging.
+ //onDragMove: '',
+
+ // easing: String|Object
+ // indicates the easing function to be used when animating the of an indicator.
+ easing: dojo._defaultEasing,
+
+ // duration: Number
+ // indicates how long an animation of the indicator should take
+ duration: 1000,
+
+ // hideValues: Boolean
+ // indicates whether the text boxes showing the value of the indicator (as text
+ // content) should be hidden or shown. Default is not hidden, aka shown.
+ hideValue: false,
+
+ // noChange: Boolean
+ // indicates whether the indicator's value can be changed. Useful for
+ // a static target indicator. Default is false (that the value can be changed).
+ noChange: false,
+
+ _gauge: null,
+
+ // title: String
+ // The title of the indicator, to be displayed next to it's input box for the text-representation.
+ title: "",
+
+ templateString: dojo.cache("dojox.widget.gauge", "_Indicator.html", "<div class=\"dojoxGaugeIndicatorDiv\">\r\n\t<label class=\"dojoxGaugeIndicatorLabel\" for=\"${title}\">${title}:</label>\r\n\t<input class=\"dojoxGaugeIndicatorInput\" name=\"${title}\" size=\"5\" value=\"${value}\" dojoAttachPoint=\"valueNode\" dojoAttachEvent=\"onchange:_update\"></input>\r\n</div>\r\n"),
+
+ startup: function(){
+ if(this.onDragMove){
+ this.onDragMove = dojo.hitch(this.onDragMove);
+ }
+ },
+
+ postCreate: function(){
+ if(this.title === ""){
+ dojo.style(this.domNode, "display", "none");
+ }
+ if(dojo.isString(this.easing)){
+ this.easing = dojo.getObject(this.easing);
+ }
+ },
+
+ _update: function(event){
+ // summary:
+ // A private function, handling the updating of the gauge
+ var value = this.valueNode.value;
+ if(value === ''){
+ this.value = null;
+ }else{
+ this.value = Number(value);
+ this.hover = this.title+': '+value;
+ }
+ if(this._gauge){
+ this.draw();
+ this.valueNode.value = this.value;
+ if((this.title == 'Target' || this.front) && this._gauge.moveIndicator){
+ // if re-drawing value, make sure target is still on top
+ this._gauge.moveIndicatorToFront(this);
+ }
+ }
+ },
+
+ update: function(value){
+ // summary:
+ // Updates the value of the indicator, including moving/re-drawing at it's new location and
+ // updating the text box
+ if(!this.noChange){
+ this.valueNode.value = value;
+ this._update();
+ }
+ },
+
+ onDragMove: function(){
+ // summary:
+ // Handles updating the text box and the hover text while dragging an indicator
+ this.value = Math.floor(this.value);
+ this.valueNode.value = this.value;
+ this.hover = this.title+': '+this.value;
+ },
+
+ draw: function(/* Boolean? */ dontAnimate){
+ // summary:
+ // Performs the initial drawing of the indicator.
+ // dontAnimate:
+ // Indicates if the drawing should not be animated (rather than teh default, to animate)
+ },
+
+ remove: function(){
+ // summary:
+ // Removes the indicator's shapes from the gauge surface.
+ for(var i=0; i<this.shapes.length; i++){
+ this._gauge.surface.remove(this.shapes[i]);
+ }
+ if(this.text){
+ this._gauge.surface.remove(this.text);
+ }
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/widget/gauge/_Gauge.xd.js b/js/dojo-1.6/dojox/widget/gauge/_Gauge.xd.js new file mode 100644 index 0000000..d4c0237 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/_Gauge.xd.js @@ -0,0 +1,778 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.gauge._Gauge"],
+["require", "dijit._Widget"],
+["require", "dijit._Templated"],
+["require", "dijit._Container"],
+["require", "dijit._Contained"],
+["require", "dijit.Tooltip"],
+["require", "dojo.fx.easing"],
+["require", "dojox.gfx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.gauge._Gauge"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.gauge._Gauge"] = true;
+dojo.provide("dojox.widget.gauge._Gauge");
+
+dojo.require("dijit._Widget");
+dojo.require("dijit._Templated");
+dojo.require("dijit._Container");
+dojo.require("dijit._Contained");
+dojo.require("dijit.Tooltip");
+dojo.require("dojo.fx.easing");
+dojo.require("dojox.gfx");
+
+dojo.experimental("dojox.widget.gauge._Gauge");
+
+dojo.declare("dojox.widget.gauge._Gauge",[dijit._Widget, dijit._Templated, dijit._Container],{
+ // summary:
+ // a gauge built using the dojox.gfx package.
+ //
+ // description:
+ // using dojo.gfx (and thus either SVG or VML based on what is supported), this widget
+ // builds a gauge component, used to display numerical data in a familiar format
+ //
+ // usage:
+ // this widget is not to be used alone. it is meant to be subclassed, such as
+ // dojox.widget.BarGauge or dojox.widget.AnalogGauge
+
+ // width: Number
+ // the width of the gauge (default is 300)
+ width: 0,
+
+ // height: Number
+ // the height of the gauge (default is 200)
+ height: 0,
+
+ // background: Object
+ // the color of the background. This must be an object of one of two forms:
+ // {'color': 'color-name'}
+ // OR
+ // (for a gradient:)
+ // {'type': 'linear', 'x1': 0, 'x2': 0, 'y1': 0, 'y2': 200, 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] }
+ background: null,
+
+ // min: Number
+ // minimum value displayed by gauge (default is lowest range value)
+ min: 0,
+
+ // max: Number
+ // maximum value displayed by gauge (default is largest range value)
+ max: 0,
+
+ // image: String
+ // background image for gauge (default is no image)
+ image: null,
+
+ // useRangeStyles: Number
+ // indicates whether to use given css classes (dojoxGaugeRangeXX)
+ // to determine the color (and other style attributes?) of the ranges
+ // this value should be the number of dojoxGaugeRange classes that are
+ // defined, starting at dojoxGaugeRange1 (0 indicates falling to default
+ // hardcoded colors)
+ useRangeStyles: 0,
+
+ // useTooltip: Boolean
+ // indicates whether tooltips should be displayed for ranges, indicators, etc.
+ useTooltip: true,
+
+ // majorTicks: Object
+ // An object representing the tick marks that should be added to the gauge. Major tick marks have a text label
+ // indicating the value. The object can have the following attributes (required are marked with a *):
+ // offset: the distance from the 'center' of the gauge. Used differently for Analog vs. Bar
+ // width: The width of the mark
+ // length: The length of the mark
+ // interval: The interval the ticks should be added on
+ // color: The color of the mark and text
+ // font: an object with any/all of the following parameters:
+ // {family: "Helvetica", style: "italic", variant: 'small-caps', weight: 'bold', size: "18pt"}
+ majorTicks: null,
+
+ // minorTicks: Object
+ // An object of the same format as majorTicks, indicating where the minor (label-less) marks should be placed
+ // The font parameter is ignored if provided since minor tick marks have no text label.
+ minorTicks: null,
+
+ // _defaultIndicator: Objection
+ // Should be overridden by any extending classes and used to indicate what the 'default' indicator is.
+ // This object is used as the indicator when creating tick marks or when an anonmyous object is passed into
+ // addIndicator.
+ _defaultIndicator: null,
+
+ // defaultColors: Array
+ // Set of default colors to color ranges with.
+ defaultColors: [[0x00,0x54,0xAA,1],
+ [0x44,0x77,0xBB,1],
+ [0x66,0x99,0xCC,1],
+ [0x99,0xBB,0xEE,1],
+ [0x99,0xCC,0xFF,1],
+ [0xCC,0xEE,0xFF,1],
+ [0xDD,0xEE,0xFF,1]],
+
+ // min: Number
+ // The minimum value of the gauge. Normally not set explicitly, as it will be determined by
+ // the ranges that are added.
+ min: null,
+
+ // max: Number
+ // The maximum value of the gauge. Normally not set explicitly, as it will be determined by
+ // the ranges that are added.
+ max: null,
+
+ // surface: Object
+ // The SVG/VML surface that the shapes are drawn on. Can be accessed/used by indicators to draw themselves
+ surface: null,
+
+ // hideValues: Boolean
+ // indicates whether the text boxes showing the value of the indicator (as text
+ // content) should be hidden or shown. Default is not hidden, aka shown.
+ hideValues: false,
+
+ // internal data
+ gaugeContent: undefined,
+ templateString: dojo.cache("dojox.widget.gauge", "_Gauge.html", "<div>\r\n\t<div class=\"dojoxGaugeContent\" dojoAttachPoint=\"gaugeContent\"></div>\r\n\t<div dojoAttachPoint=\"containerNode\"></div>\r\n\t<div dojoAttachPoint=\"mouseNode\"></div>\r\n</div>\r\n"),
+ _backgroundDefault: {color: '#E0E0E0'},
+ _rangeData: null,
+ _indicatorData: null,
+ _drag: null,
+ _img: null,
+ _overOverlay: false,
+ _lastHover: '',
+
+ startup: function(){
+ // handle settings from HTML by making sure all the options are
+ // converted correctly to numbers and that we calculate defaults
+ // for cx, cy and radius
+ if(this.image === null){
+ this.image={};
+ }
+
+ this.connect(this.gaugeContent, 'onmousemove', this.handleMouseMove);
+ this.connect(this.gaugeContent, 'onmouseover', this.handleMouseOver);
+ this.connect(this.gaugeContent, 'onmouseout', this.handleMouseOut);
+ this.connect(this.gaugeContent, 'onmouseup', this.handleMouseUp);
+
+ if(!dojo.isArray(this.ranges)){ this.ranges = []; }
+ if(!dojo.isArray(this.indicators)){ this.indicators = []; }
+ var ranges = [], indicators = [];
+ var i;
+ if(this.hasChildren()){
+ var children = this.getChildren();
+ for(i=0; i<children.length; i++){
+ if(/dojox\.widget\..*Indicator/.test(children[i].declaredClass)){
+ indicators.push(children[i]);
+ //this.addIndicator(children[i]);
+ continue;
+ }
+ switch(children[i].declaredClass){
+ case "dojox.widget.gauge.Range":
+ ranges.push(children[i]);
+ break;
+ }
+ }
+ this.ranges = this.ranges.concat(ranges);
+ this.indicators = this.indicators.concat(indicators);
+ }
+ if(!this.background){ this.background = this._backgroundDefault; }
+ this.background = this.background.color || this.background;
+ if(!this.surface){ this.createSurface(); }
+
+ this.addRanges(this.ranges);
+ if(this.minorTicks && this.minorTicks.interval){
+ this.setMinorTicks(this.minorTicks);
+ }
+ if(this.majorTicks && this.majorTicks.interval){
+ this.setMajorTicks(this.majorTicks);
+ }
+ for(i=0; i<this.indicators.length; i++){
+ this.addIndicator(this.indicators[i]);
+ }
+ },
+
+ _setTicks: function(/*Object*/ oldTicks, /*Object*/ newTicks, /*Boolean*/ label){
+ // summary:
+ // internal method used to clear existing tick marks, then add new ones
+ var i;
+ if(oldTicks && dojo.isArray(oldTicks._ticks)){
+ for(i=0; i<oldTicks._ticks.length; i++){
+ this.removeIndicator(oldTicks._ticks[i]);
+ }
+ }
+ var t = {length: newTicks.length,
+ offset: newTicks.offset,
+ noChange: true};
+ if(newTicks.color){ t.color = newTicks.color; }
+ if(newTicks.font){ t.font = newTicks.font; }
+ newTicks._ticks = [];
+ for(i=this.min; i<=this.max; i+=newTicks.interval){
+ t.value = i;
+ if(label){t.label = ''+i;}
+ newTicks._ticks.push(this.addIndicator(t));
+ }
+ return newTicks;
+ },
+
+ setMinorTicks: function(/*Object*/ ticks){
+ // summary:
+ // Creates and draws the minor tick marks based on the passed object (expecting the same format
+ // as the minorTicks object documented above)
+ this.minorTicks = this._setTicks(this.minorTicks, ticks, false);
+ },
+
+ setMajorTicks: function(/*Object*/ ticks){
+ // summary:
+ // Creates and draws the major tick marks based on the passed object (expecting the same format
+ // as the majorTicks object documented above)
+ this.majorTicks = this._setTicks(this.majorTicks, ticks, true);
+ },
+
+ postCreate: function(){
+ if(this.hideValues){
+ dojo.style(this.containerNode, "display", "none");
+ }
+ dojo.style(this.mouseNode, 'width', '0');
+ dojo.style(this.mouseNode, 'height', '0');
+ dojo.style(this.mouseNode, 'position', 'absolute');
+ dojo.style(this.mouseNode, 'z-index', '100');
+ if(this.useTooltip){
+ dijit.showTooltip('test',this.mouseNode, !this.isLeftToRight());
+ dijit.hideTooltip(this.mouseNode);
+ }
+ },
+
+ createSurface: function(){
+ // summary:
+ // internal method used by the gauge to create the graphics surface area
+ this.gaugeContent.style.width = this.width + 'px';
+ this.gaugeContent.style.height = this.height + 'px';
+ this.surface = dojox.gfx.createSurface(this.gaugeContent, this.width, this.height);
+ this._background = this.surface.createRect({x: 0, y: 0, width: this.width, height: this.height });
+ this._background.setFill(this.background);
+
+ if(this.image.url){
+ this._img = this.surface.createImage({width: this.image.width || this.width, height: this.image.height || this.height, src: this.image.url});
+ if(this.image.overlay){
+ this._img.getEventSource().setAttribute('overlay',true);
+ }
+ if(this.image.x || this.image.y){
+ this._img.setTransform({dx: this.image.x || 0, dy: this.image.y || 0});
+ }
+ }
+ },
+
+ setBackground: function(background){
+ // summary:
+ // This method is used to set the background of the gauge after it is created.
+ // description:
+ // Sets the background using the given object. Must be the same 'type' of object
+ // as the original background argument.
+ // background:
+ // An object in one of the two forms:
+ // {'color': 'color-name'}
+ // OR
+ // (for a gradient:)
+ // {'type': 'linear', 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] }
+ // If background is null or undefined, this will set the fill to this._backgroundDefault
+ if(!background){ background = this._backgroundDefault; }
+ this.background = background.color || background;
+ this._background.setFill(this.background);
+ },
+
+ addRange: function(/*Object*/range){
+ // summary:
+ // This method is used to add a range to the gauge.
+ // description:
+ // Creates a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is either a dojox.widget.gauge.Range object, or a object
+ // with similar parameters (low, high, hover, etc.).
+ this.addRanges([range]);
+ },
+
+ addRanges: function(/*Array*/ranges){
+ // summary:
+ // This method is used to add ranges to the gauge.
+ // description:
+ // Creates a range (colored area on the background of the gauge)
+ // based on the given arguments.
+ // range:
+ // A range is either a dojox.widget.gauge.Range object, or a object
+ // with similar parameters (low, high, hover, etc.).
+ if(!this._rangeData){
+ this._rangeData = [];
+ }
+ var range;
+ for(var i=0; i<ranges.length; i++){
+ range = ranges[i];
+ if((this.min === null) || (range.low < this.min)){this.min = range.low;}
+ if((this.max === null) || (range.high > this.max)){this.max = range.high;}
+
+ if(!range.color){
+ var colorIndex = this._rangeData.length % this.defaultColors.length;
+ if(dojox.gfx.svg && this.useRangeStyles > 0){
+ colorIndex = (this._rangeData.length % this.useRangeStyles)+1;
+ range.color = {style: "dojoxGaugeRange"+colorIndex};
+ }else{
+ colorIndex = this._rangeData.length % this.defaultColors.length;
+ range.color = this.defaultColors[colorIndex];
+ }
+ }
+ this._rangeData[this._rangeData.length] = range;
+ }
+ this.draw();
+ },
+
+ addIndicator: function(/*Object*/indicator){
+ // summary:
+ // This method is used to add an indicator to the bar graph.
+ // description:
+ // This method adds an indicator, such as a tick mark or needle,
+ // to the bar graph.
+ // indicator:
+ // A dojox.widget.gauge._Indicator or an object with similar parameters
+ // (value, color, offset, etc.).
+
+ indicator._gauge = this;
+ if(!indicator.declaredClass){// !== 'dojox.widget.gauge.Indicator'){
+ // We were passed a plain object, need to make an indicator out of it.
+ indicator = new this._defaultIndicator(indicator);
+ }
+ if(!indicator.hideValue){
+ this.containerNode.appendChild(indicator.domNode);
+ }
+ if(!this._indicatorData){this._indicatorData = [];}
+ this._indicatorData[this._indicatorData.length] = indicator;
+ indicator.draw();
+ return indicator;
+ },
+
+ removeIndicator: function(/*Object*/indicator){
+ // summary:
+ // Removes the given indicator from the gauge by calling it's remove function
+ // and removing it from the local cache.
+ for(var i=0; i<this._indicatorData.length; i++){
+ if(this._indicatorData[i] === indicator){
+ this._indicatorData.splice(i, 1);
+ indicator.remove();
+ break;
+ }
+ }
+ },
+
+ moveIndicatorToFront: function(/*Object*/indicator){
+ // summary:
+ // This function is used to move an indicator the the front (top)
+ // of the gauge
+ // indicator:
+ // A dojox.widget.gauge._Indicator or an object with similar parameters
+ // (value, color, offset, etc.).
+ if(indicator.shapes){
+ for(var i=0; i<indicator.shapes.length; i++){
+ indicator.shapes[i].moveToFront();
+ }
+ }
+ },
+
+ drawText: function(/*String*/txt, /*Number*/x, /*Number*/y, /*String?*/align, /*String?*/vAlign, /*String?*/color, /*Object?*/font){
+ // summary:
+ // This function is used draw text onto the gauge. The text object
+ // is also returned by the function so that may be removed later
+ // by calling removeText
+ // txt: String
+ // The text to be drawn
+ // x: Number
+ // The x coordinate at which to place the text
+ // y: Number
+ // The y coordinate at which to place the text
+ // align?: String
+ // Indicates how to align the text
+ // Valid value is 'right', otherwise text is left-aligned
+ // vAlign?: String
+ // Indicates how to align the text vertically.
+ // Valid value is 'top', otherwise text is bottom-aligned
+ // color?: String
+ // Indicates the color of the text
+ // font?: Object
+ // A font object, generally of the following format:
+ // {family: "Helvetica", style: "italic", variant: 'small-caps', weight: 'bold', size: "18pt"}
+
+ var t = this.surface.createText({x: x, y: y, text: txt, align: align});
+ t.setFill(color);
+ t.setFont(font);
+ return t;
+ },
+
+ removeText:function(/*String*/t){
+ // summary:
+ // Removes a text element from the gauge.
+ // t: String
+ // The text to remove.
+ this.surface.rawNode.removeChild(t);
+ },
+
+ updateTooltip: function(/*String*/txt, /*Event*/ e){
+ // summary:
+ // Updates the tooltip for the gauge to display the given text.
+ // txt: String
+ // The text to put in the tooltip.
+ if(this._lastHover != txt){
+ if(txt !== ''){
+ dijit.hideTooltip(this.mouseNode);
+ dijit.showTooltip(txt,this.mouseNode, !this.isLeftToRight());
+ }else{
+ dijit.hideTooltip(this.mouseNode);
+ }
+ this._lastHover = txt;
+ }
+ },
+
+ handleMouseOver: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support
+ // hover text
+ // event: Object
+ // The event object
+ var hover = event.target.getAttribute('hover');
+ if(event.target.getAttribute('overlay')){
+ this._overOverlay = true;
+ var r = this.getRangeUnderMouse(event);
+ if(r && r.hover){
+ hover = r.hover;
+ }
+ }
+ if(this.useTooltip && !this._drag){
+ if(hover){
+ this.updateTooltip(hover, event);
+ }else{
+ this.updateTooltip('', event);
+ }
+ }
+ },
+
+ handleMouseOut: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support
+ // hover text
+ // event: Object
+ // The event object
+ if(event.target.getAttribute('overlay')){
+ this._overOverlay = false;
+ }
+ if(this.useTooltip && this.mouseNode){
+ dijit.hideTooltip(this.mouseNode);
+ }
+ },
+
+ handleMouseDown: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support using
+ // the mouse to drag an indicator to modify it's value
+ // event: Object
+ // The event object
+
+ // find the indicator being dragged
+ for(var i=0; i<this._indicatorData.length; i++){
+ var shapes = this._indicatorData[i].shapes;
+ for(var s=0; s<shapes.length; s++){
+ if(shapes[s].getEventSource() == event.target){
+ this._drag = this._indicatorData[i];
+ s = shapes.length;
+ i = this._indicatorData.length;
+ }
+ }
+ }
+ dojo.stopEvent(event);
+ },
+
+ handleMouseUp: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support using
+ // the mouse to drag an indicator to modify it's value
+ // event: Object
+ // The event object
+ this._drag = null;
+ dojo.stopEvent(event);
+ },
+
+ handleMouseMove: function(/*Object*/event){
+ // summary:
+ // This is an internal handler used by the gauge to support using
+ // the mouse to drag an indicator to modify it's value
+ // event: Object
+ // The event object
+ if(event){
+ dojo.style(this.mouseNode, 'left', event.pageX+1+'px');
+ dojo.style(this.mouseNode, 'top', event.pageY+1+'px');
+ }
+ if(this._drag){
+ this._dragIndicator(this, event);
+ }else{
+ if(this.useTooltip && this._overOverlay){
+ var r = this.getRangeUnderMouse(event);
+ if(r && r.hover){
+ this.updateTooltip(r.hover, event);
+ }else{
+ this.updateTooltip('', event);
+ }
+ }
+ }
+ }
+});
+
+dojo.declare("dojox.widget.gauge.Range",[dijit._Widget, dijit._Contained],{
+ // summary:
+ // a range to be used in a _Gauge
+ //
+ // description:
+ // a range widget, which has given properties. drawn by a _Gauge.
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.AnalogGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.AnalogGauge"
+ // id="testGauge"
+ // width="300"
+ // height="200"
+ // cx=150
+ // cy=175
+ // radius=125
+ // image="gaugeOverlay.png"
+ // imageOverlay="false"
+ // imageWidth="280"
+ // imageHeight="155"
+ // imageX="12"
+ // imageY="38">
+ // <div dojoType="dojox.widget.gauge.Range"
+ // low=5
+ // high=10
+ // hover="5 - 10"
+ // ></div>
+ // <div dojoType="dojox.widget.gauge.Range"
+ // low=10
+ // high=20
+ // hover="10 - 20"
+ // ></div>
+ // </div>
+
+ // low: Number
+ // the low value of the range
+ low: 0,
+
+ // high: Numbe
+ // the high value of the range
+ high: 0,
+
+ // hover: String
+ // the text to put in the tooltip for the gauge
+ hover: '',
+
+ // color: Object
+ // the color of the range. This must be an object of one of two forms:
+ // {'color': 'color-name'}
+ // OR
+ // (for a gradient:)
+ // {'type': 'linear', 'colors': [{offset: 0, color:'#C0C0C0'}, {offset: 1, color: '#E0E0E0'}] }
+ color: null,
+
+ // size: Number
+ // for a circular gauge (such as an AnalogGauge), this dictates the size of the arc
+ size: 0,
+
+ startup: function(){
+ this.color = this.color.color || this.color;
+ }
+});
+
+dojo.declare("dojox.widget.gauge._Indicator",[dijit._Widget, dijit._Contained, dijit._Templated],{
+ // summary:
+ // a indicator to be used in a gauge
+ //
+ // description:
+ // an indicator widget, which has given properties. drawn by a gauge.
+ //
+ // usage:
+ // <script type="text/javascript">
+ // dojo.require("dojox.widget.AnalogGauge");
+ // dojo.require("dijit.util.parser");
+ // </script>
+ // ...
+ // <div dojoType="dojox.widget.AnalogGauge"
+ // id="testGauge"
+ // width="300"
+ // height="200"
+ // cx=150
+ // cy=175
+ // radius=125
+ // image="gaugeOverlay.png"
+ // imageOverlay="false"
+ // imageWidth="280"
+ // imageHeight="155"
+ // imageX="12"
+ // imageY="38">
+ // <div dojoType="dojox.widget.gauge.Indicator"
+ // value=17
+ // type="arrow"
+ // length=135
+ // width=3
+ // hover="Value: 17"
+ // onDragMove="handleDragMove">
+ // </div>
+ // </div>
+
+ // value: Number
+ // The value (on the gauge) that this indicator should be placed at
+ value: 0,
+
+ // type: String
+ // The type of indicator to draw. Varies by gauge type. Some examples include
+ // "line", "arrow", and "bar"
+ type: '',
+
+ // color: String
+ // The color of the indicator.
+ color: 'black',
+
+ // label: String
+ // The text label for the indicator.
+ label: '',
+
+ // font: Object
+ // Generally in a format similar to:
+ // {family: "Helvetica", weight: "bold", style: "italic", size: "18pt", rotated: true}
+ font: {family: "sans-serif", size: "12px"},
+
+ // length: Number
+ // The length of the indicator. In the above example, the radius of the AnalogGauge
+ // is 125, but the length of the indicator is 135, meaning it would project beyond
+ // the edge of the AnalogGauge
+ length: 0,
+
+ // width: Number
+ // The width of the indicator.
+ width: 0,
+
+ // offset: Number
+ // The offset of the indicator
+ offset: 0,
+
+ // hover: String
+ // The string to put in the tooltip when this indicator is hovered over.
+ hover: '',
+
+ // front: boolean
+ // Keep this indicator at the front
+ front: false,
+
+ // onDragMove: String
+ // The function to call when this indicator is moved by dragging.
+ //onDragMove: '',
+
+ // easing: String|Object
+ // indicates the easing function to be used when animating the of an indicator.
+ easing: dojo._defaultEasing,
+
+ // duration: Number
+ // indicates how long an animation of the indicator should take
+ duration: 1000,
+
+ // hideValues: Boolean
+ // indicates whether the text boxes showing the value of the indicator (as text
+ // content) should be hidden or shown. Default is not hidden, aka shown.
+ hideValue: false,
+
+ // noChange: Boolean
+ // indicates whether the indicator's value can be changed. Useful for
+ // a static target indicator. Default is false (that the value can be changed).
+ noChange: false,
+
+ _gauge: null,
+
+ // title: String
+ // The title of the indicator, to be displayed next to it's input box for the text-representation.
+ title: "",
+
+ templateString: dojo.cache("dojox.widget.gauge", "_Indicator.html", "<div class=\"dojoxGaugeIndicatorDiv\">\r\n\t<label class=\"dojoxGaugeIndicatorLabel\" for=\"${title}\">${title}:</label>\r\n\t<input class=\"dojoxGaugeIndicatorInput\" name=\"${title}\" size=\"5\" value=\"${value}\" dojoAttachPoint=\"valueNode\" dojoAttachEvent=\"onchange:_update\"></input>\r\n</div>\r\n"),
+
+ startup: function(){
+ if(this.onDragMove){
+ this.onDragMove = dojo.hitch(this.onDragMove);
+ }
+ },
+
+ postCreate: function(){
+ if(this.title === ""){
+ dojo.style(this.domNode, "display", "none");
+ }
+ if(dojo.isString(this.easing)){
+ this.easing = dojo.getObject(this.easing);
+ }
+ },
+
+ _update: function(event){
+ // summary:
+ // A private function, handling the updating of the gauge
+ var value = this.valueNode.value;
+ if(value === ''){
+ this.value = null;
+ }else{
+ this.value = Number(value);
+ this.hover = this.title+': '+value;
+ }
+ if(this._gauge){
+ this.draw();
+ this.valueNode.value = this.value;
+ if((this.title == 'Target' || this.front) && this._gauge.moveIndicator){
+ // if re-drawing value, make sure target is still on top
+ this._gauge.moveIndicatorToFront(this);
+ }
+ }
+ },
+
+ update: function(value){
+ // summary:
+ // Updates the value of the indicator, including moving/re-drawing at it's new location and
+ // updating the text box
+ if(!this.noChange){
+ this.valueNode.value = value;
+ this._update();
+ }
+ },
+
+ onDragMove: function(){
+ // summary:
+ // Handles updating the text box and the hover text while dragging an indicator
+ this.value = Math.floor(this.value);
+ this.valueNode.value = this.value;
+ this.hover = this.title+': '+this.value;
+ },
+
+ draw: function(/* Boolean? */ dontAnimate){
+ // summary:
+ // Performs the initial drawing of the indicator.
+ // dontAnimate:
+ // Indicates if the drawing should not be animated (rather than teh default, to animate)
+ },
+
+ remove: function(){
+ // summary:
+ // Removes the indicator's shapes from the gauge surface.
+ for(var i=0; i<this.shapes.length; i++){
+ this._gauge.surface.remove(this.shapes[i]);
+ }
+ if(this.text){
+ this._gauge.surface.remove(this.text);
+ }
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/gauge/_Indicator.html b/js/dojo-1.6/dojox/widget/gauge/_Indicator.html new file mode 100644 index 0000000..2942996 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/gauge/_Indicator.html @@ -0,0 +1,4 @@ +<div class="dojoxGaugeIndicatorDiv"> + <label class="dojoxGaugeIndicatorLabel" for="${title}">${title}:</label> + <input class="dojoxGaugeIndicatorInput" name="${title}" size="5" value="${value}" dojoAttachPoint="valueNode" dojoAttachEvent="onchange:_update"></input> +</div>
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/ColorPicker.js new file mode 100644 index 0000000..71d9b93 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Saturation Selector","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","huePickerTitle":"Hue Selector","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ColorPicker.xd.js new file mode 100644 index 0000000..4556a7b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "", ({"saturationPickerTitle":"Saturation Selector","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","huePickerTitle":"Hue Selector","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/FilePicker.js new file mode 100644 index 0000000..542f043 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/FilePicker.js @@ -0,0 +1 @@ +({"name":"Name","size":"Size (in bytes)","path":"Path"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/FilePicker.xd.js new file mode 100644 index 0000000..33edadf --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "", ({"name":"Name","size":"Size (in bytes)","path":"Path"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/Wizard.js b/js/dojo-1.6/dojox/widget/nls/Wizard.js new file mode 100644 index 0000000..ec10f3f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/Wizard.js @@ -0,0 +1 @@ +({"next":"Next","done":"Done","previous":"Previous"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/Wizard.xd.js new file mode 100644 index 0000000..4265525 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "", ({"next":"Next","done":"Done","previous":"Previous"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ar/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/ar/ColorPicker.js new file mode 100644 index 0000000..19fc1d3 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ar/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"محدد درجة التشبع","huePickerTitle":"محدد تدرج اللون","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ar/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ar/ColorPicker.xd.js new file mode 100644 index 0000000..4a5e9a1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ar/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ar.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ar.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "ar", ({"saturationPickerTitle":"محدد درجة التشبع","huePickerTitle":"محدد تدرج اللون","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ar/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/ar/FilePicker.js new file mode 100644 index 0000000..c62ea22 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ar/FilePicker.js @@ -0,0 +1 @@ +({"name":"الاسم","size":"الحجم (بالبايت)","path":"المسار"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ar/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ar/FilePicker.xd.js new file mode 100644 index 0000000..5f7c7f2 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ar/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ar.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ar.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "ar", ({"name":"الاسم","size":"الحجم (بالبايت)","path":"المسار"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ar/Wizard.js b/js/dojo-1.6/dojox/widget/nls/ar/Wizard.js new file mode 100644 index 0000000..c8acda0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ar/Wizard.js @@ -0,0 +1 @@ +({"next":"تالي","done":"اتمام","previous":"سابق"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ar/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/ar/Wizard.xd.js new file mode 100644 index 0000000..2c71b82 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ar/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ar.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ar.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "ar", ({"next":"تالي","done":"اتمام","previous":"سابق"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ca/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/ca/ColorPicker.js new file mode 100644 index 0000000..9c1fb39 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ca/ColorPicker.js @@ -0,0 +1 @@ +({"redLabel":"v","hueLabel":"m","saturationPickerTitle":"Selector de saturació","huePickerTitle":"Selector de matís","greenLabel":"e","valueLabel":"v","blueLabel":"b","saturationLabel":"s","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ca/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ca/ColorPicker.xd.js new file mode 100644 index 0000000..bd20b51 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ca/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ca.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ca.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "ca", ({"redLabel":"v","hueLabel":"m","saturationPickerTitle":"Selector de saturació","huePickerTitle":"Selector de matís","greenLabel":"e","valueLabel":"v","blueLabel":"b","saturationLabel":"s","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ca/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/ca/FilePicker.js new file mode 100644 index 0000000..5902820 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ca/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nom","size":"Mida (en bytes)","path":"Camí d'accés"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ca/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ca/FilePicker.xd.js new file mode 100644 index 0000000..11ed820 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ca/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ca.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ca.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "ca", ({"name":"Nom","size":"Mida (en bytes)","path":"Camí d'accés"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ca/Wizard.js b/js/dojo-1.6/dojox/widget/nls/ca/Wizard.js new file mode 100644 index 0000000..da85941 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ca/Wizard.js @@ -0,0 +1 @@ +({"next":"Següent","done":"Fet","previous":"Anterior"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ca/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/ca/Wizard.xd.js new file mode 100644 index 0000000..0ed779d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ca/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ca.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ca.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "ca", ({"next":"Següent","done":"Fet","previous":"Anterior"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/cs/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/cs/ColorPicker.js new file mode 100644 index 0000000..257eac0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/cs/ColorPicker.js @@ -0,0 +1 @@ +({"redLabel":"č","valueLabel":"j","hueLabel":"o","saturationLabel":"n","saturationPickerTitle":"Selektor sytosti","huePickerTitle":"Selektor odstínu","greenLabel":"z","blueLabel":"m","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/cs/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/cs/ColorPicker.xd.js new file mode 100644 index 0000000..9e890f0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/cs/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.cs.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.cs.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "cs", ({"redLabel":"č","valueLabel":"j","hueLabel":"o","saturationLabel":"n","saturationPickerTitle":"Selektor sytosti","huePickerTitle":"Selektor odstínu","greenLabel":"z","blueLabel":"m","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/cs/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/cs/FilePicker.js new file mode 100644 index 0000000..54f7366 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/cs/FilePicker.js @@ -0,0 +1 @@ +({"name":"Název","size":"Velikost (v bajtech)","path":"Cesta"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/cs/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/cs/FilePicker.xd.js new file mode 100644 index 0000000..7af3a3d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/cs/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.cs.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.cs.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "cs", ({"name":"Název","size":"Velikost (v bajtech)","path":"Cesta"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/cs/Wizard.js b/js/dojo-1.6/dojox/widget/nls/cs/Wizard.js new file mode 100644 index 0000000..4075772 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/cs/Wizard.js @@ -0,0 +1 @@ +({"next":"Další","done":"Hotovo","previous":"Předchozí"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/cs/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/cs/Wizard.xd.js new file mode 100644 index 0000000..7ed9684 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/cs/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.cs.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.cs.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "cs", ({"next":"Další","done":"Hotovo","previous":"Předchozí"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/da/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/da/ColorPicker.js new file mode 100644 index 0000000..3f7da9d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/da/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Vælg mætning","huePickerTitle":"Vælg nuance","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/da/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/da/ColorPicker.xd.js new file mode 100644 index 0000000..13dc545 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/da/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.da.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.da.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "da", ({"saturationPickerTitle":"Vælg mætning","huePickerTitle":"Vælg nuance","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/da/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/da/FilePicker.js new file mode 100644 index 0000000..35cc924 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/da/FilePicker.js @@ -0,0 +1 @@ +({"name":"Navn","size":"Størrelse (i byte)","path":"Sti"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/da/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/da/FilePicker.xd.js new file mode 100644 index 0000000..28d43d1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/da/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.da.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.da.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "da", ({"name":"Navn","size":"Størrelse (i byte)","path":"Sti"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/da/Wizard.js b/js/dojo-1.6/dojox/widget/nls/da/Wizard.js new file mode 100644 index 0000000..e447f70 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/da/Wizard.js @@ -0,0 +1 @@ +({"next":"Næste","done":"Udført","previous":"Forrige"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/da/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/da/Wizard.xd.js new file mode 100644 index 0000000..c71d785 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/da/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.da.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.da.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "da", ({"next":"Næste","done":"Udført","previous":"Forrige"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/de/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/de/ColorPicker.js new file mode 100644 index 0000000..4e5ff1f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/de/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Sättigungsauswahl","huePickerTitle":"Farbtonauswahl","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/de/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/de/ColorPicker.xd.js new file mode 100644 index 0000000..7dba28f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/de/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.de.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.de.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "de", ({"saturationPickerTitle":"Sättigungsauswahl","huePickerTitle":"Farbtonauswahl","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/de/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/de/FilePicker.js new file mode 100644 index 0000000..b33ec5d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/de/FilePicker.js @@ -0,0 +1 @@ +({"name":"Name","size":"Größe (in Byte)","path":"Pfad"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/de/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/de/FilePicker.xd.js new file mode 100644 index 0000000..5b826d2 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/de/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.de.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.de.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "de", ({"name":"Name","size":"Größe (in Byte)","path":"Pfad"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/de/Wizard.js b/js/dojo-1.6/dojox/widget/nls/de/Wizard.js new file mode 100644 index 0000000..a7f2164 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/de/Wizard.js @@ -0,0 +1 @@ +({"next":"Weiter","done":"Fertig","previous":"Zurück"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/de/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/de/Wizard.xd.js new file mode 100644 index 0000000..a93309b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/de/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.de.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.de.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "de", ({"next":"Weiter","done":"Fertig","previous":"Zurück"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/el/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/el/ColorPicker.js new file mode 100644 index 0000000..74c45e9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/el/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Επιλογή κορεσμού","valueLabel":"τ","blueLabel":"μ","saturationLabel":"κ","greenLabel":"π","redLabel":"κ","hueLabel":"α","hexLabel":"16-αδικό","huePickerTitle":"Επιλογή απόχρωσης","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/el/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/el/ColorPicker.xd.js new file mode 100644 index 0000000..a47c771 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/el/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.el.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.el.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "el", ({"saturationPickerTitle":"Επιλογή κορεσμού","valueLabel":"τ","blueLabel":"μ","saturationLabel":"κ","greenLabel":"π","redLabel":"κ","hueLabel":"α","hexLabel":"16-αδικό","huePickerTitle":"Επιλογή απόχρωσης","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/el/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/el/FilePicker.js new file mode 100644 index 0000000..e6d8b24 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/el/FilePicker.js @@ -0,0 +1 @@ +({"name":"Όνομα","size":"Μέγεθος (σε bytes)","path":"Διαδρομή"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/el/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/el/FilePicker.xd.js new file mode 100644 index 0000000..4cb0b61 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/el/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.el.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.el.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "el", ({"name":"Όνομα","size":"Μέγεθος (σε bytes)","path":"Διαδρομή"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/el/Wizard.js b/js/dojo-1.6/dojox/widget/nls/el/Wizard.js new file mode 100644 index 0000000..6a25346 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/el/Wizard.js @@ -0,0 +1 @@ +({"next":"Επόμενο","done":"Ολοκλήρωση","previous":"Προηγούμενο"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/el/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/el/Wizard.xd.js new file mode 100644 index 0000000..69e4f89 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/el/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.el.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.el.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "el", ({"next":"Επόμενο","done":"Ολοκλήρωση","previous":"Προηγούμενο"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/es/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/es/ColorPicker.js new file mode 100644 index 0000000..b0fddde --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/es/ColorPicker.js @@ -0,0 +1 @@ +({"hueLabel":"m","saturationPickerTitle":"Selector de saturación","huePickerTitle":"Selector de tono","greenLabel":"v","blueLabel":"a","valueLabel":"v","saturationLabel":"s","redLabel":"r","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/es/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/es/ColorPicker.xd.js new file mode 100644 index 0000000..9290c06 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/es/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.es.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.es.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "es", ({"hueLabel":"m","saturationPickerTitle":"Selector de saturación","huePickerTitle":"Selector de tono","greenLabel":"v","blueLabel":"a","valueLabel":"v","saturationLabel":"s","redLabel":"r","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/es/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/es/FilePicker.js new file mode 100644 index 0000000..b926640 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/es/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nombre","size":"Tamaño (en bytes)","path":"Vía de acceso"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/es/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/es/FilePicker.xd.js new file mode 100644 index 0000000..347e480 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/es/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.es.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.es.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "es", ({"name":"Nombre","size":"Tamaño (en bytes)","path":"Vía de acceso"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/es/Wizard.js b/js/dojo-1.6/dojox/widget/nls/es/Wizard.js new file mode 100644 index 0000000..aab5661 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/es/Wizard.js @@ -0,0 +1 @@ +({"next":"Siguiente","done":"Terminado","previous":"Anterior"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/es/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/es/Wizard.xd.js new file mode 100644 index 0000000..166869c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/es/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.es.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.es.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "es", ({"next":"Siguiente","done":"Terminado","previous":"Anterior"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fi/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/fi/ColorPicker.js new file mode 100644 index 0000000..307fbf1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fi/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Kylläisyyden valitsin","huePickerTitle":"Sävyn valitsin","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fi/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/fi/ColorPicker.xd.js new file mode 100644 index 0000000..f388bed --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fi/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.fi.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.fi.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "fi", ({"saturationPickerTitle":"Kylläisyyden valitsin","huePickerTitle":"Sävyn valitsin","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fi/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/fi/FilePicker.js new file mode 100644 index 0000000..df2efcf --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fi/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nimi","size":"Koko (tavuina)","path":"Polku"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fi/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/fi/FilePicker.xd.js new file mode 100644 index 0000000..367dc5f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fi/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.fi.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.fi.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "fi", ({"name":"Nimi","size":"Koko (tavuina)","path":"Polku"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fi/Wizard.js b/js/dojo-1.6/dojox/widget/nls/fi/Wizard.js new file mode 100644 index 0000000..ea6a9db --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fi/Wizard.js @@ -0,0 +1 @@ +({"next":"Seuraava","done":"Valmis","previous":"Edellinen"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fi/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/fi/Wizard.xd.js new file mode 100644 index 0000000..f0f74bc --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fi/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.fi.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.fi.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "fi", ({"next":"Seuraava","done":"Valmis","previous":"Edellinen"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fr/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/fr/ColorPicker.js new file mode 100644 index 0000000..d34db42 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fr/ColorPicker.js @@ -0,0 +1 @@ +({"hueLabel":"t","saturationPickerTitle":"Sélecteur de saturation","huePickerTitle":"Sélecteur de teinte","greenLabel":"v","valueLabel":"v","blueLabel":"b","saturationLabel":"s","redLabel":"r","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fr/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/fr/ColorPicker.xd.js new file mode 100644 index 0000000..908e7e5 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fr/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.fr.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.fr.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "fr", ({"hueLabel":"t","saturationPickerTitle":"Sélecteur de saturation","huePickerTitle":"Sélecteur de teinte","greenLabel":"v","valueLabel":"v","blueLabel":"b","saturationLabel":"s","redLabel":"r","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fr/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/fr/FilePicker.js new file mode 100644 index 0000000..8b1045f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fr/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nom","size":"Taille (en octets)","path":"Chemin"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fr/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/fr/FilePicker.xd.js new file mode 100644 index 0000000..ba4088a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fr/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.fr.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.fr.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "fr", ({"name":"Nom","size":"Taille (en octets)","path":"Chemin"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fr/Wizard.js b/js/dojo-1.6/dojox/widget/nls/fr/Wizard.js new file mode 100644 index 0000000..779919e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fr/Wizard.js @@ -0,0 +1 @@ +({"next":"Suivant","done":"Terminé","previous":"Précédent"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/fr/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/fr/Wizard.xd.js new file mode 100644 index 0000000..97a9da9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/fr/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.fr.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.fr.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "fr", ({"next":"Suivant","done":"Terminé","previous":"Précédent"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/he/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/he/ColorPicker.js new file mode 100644 index 0000000..36bea9e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/he/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"בורר רוויה","valueLabel":"ע","blueLabel":"כ","saturationLabel":"ר","greenLabel":"י","redLabel":"א","hueLabel":"ג","hexLabel":"הקס","huePickerTitle":"בורר גוון","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/he/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/he/ColorPicker.xd.js new file mode 100644 index 0000000..6229cd0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/he/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.he.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.he.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "he", ({"saturationPickerTitle":"בורר רוויה","valueLabel":"ע","blueLabel":"כ","saturationLabel":"ר","greenLabel":"י","redLabel":"א","hueLabel":"ג","hexLabel":"הקס","huePickerTitle":"בורר גוון","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/he/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/he/FilePicker.js new file mode 100644 index 0000000..7b4e52a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/he/FilePicker.js @@ -0,0 +1 @@ +({"name":"שם","size":"גודל (בבתים)","path":"נתיב"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/he/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/he/FilePicker.xd.js new file mode 100644 index 0000000..c80e1b6 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/he/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.he.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.he.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "he", ({"name":"שם","size":"גודל (בבתים)","path":"נתיב"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/he/Wizard.js b/js/dojo-1.6/dojox/widget/nls/he/Wizard.js new file mode 100644 index 0000000..e5ee2ee --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/he/Wizard.js @@ -0,0 +1 @@ +({"next":"הבא","done":"סיום","previous":"הקודם"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/he/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/he/Wizard.xd.js new file mode 100644 index 0000000..8405f2f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/he/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.he.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.he.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "he", ({"next":"הבא","done":"סיום","previous":"הקודם"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/hu/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/hu/ColorPicker.js new file mode 100644 index 0000000..52d3d4a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/hu/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Telítettség kiválasztó","huePickerTitle":"Árnyalat kiválasztó","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/hu/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/hu/ColorPicker.xd.js new file mode 100644 index 0000000..f4ca75a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/hu/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.hu.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.hu.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "hu", ({"saturationPickerTitle":"Telítettség kiválasztó","huePickerTitle":"Árnyalat kiválasztó","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/hu/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/hu/FilePicker.js new file mode 100644 index 0000000..8323b89 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/hu/FilePicker.js @@ -0,0 +1 @@ +({"name":"Név","size":"Méret (byte)","path":"Elérési út"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/hu/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/hu/FilePicker.xd.js new file mode 100644 index 0000000..890103f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/hu/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.hu.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.hu.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "hu", ({"name":"Név","size":"Méret (byte)","path":"Elérési út"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/hu/Wizard.js b/js/dojo-1.6/dojox/widget/nls/hu/Wizard.js new file mode 100644 index 0000000..6ad86c7 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/hu/Wizard.js @@ -0,0 +1 @@ +({"next":"Következő","done":"Kész","previous":"Előző"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/hu/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/hu/Wizard.xd.js new file mode 100644 index 0000000..aa200f0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/hu/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.hu.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.hu.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "hu", ({"next":"Következő","done":"Kész","previous":"Előző"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/it/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/it/ColorPicker.js new file mode 100644 index 0000000..f61e4da --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/it/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Selettore saturazione","huePickerTitle":"Selettore tonalità","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/it/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/it/ColorPicker.xd.js new file mode 100644 index 0000000..d92e443 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/it/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.it.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.it.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "it", ({"saturationPickerTitle":"Selettore saturazione","huePickerTitle":"Selettore tonalità","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/it/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/it/FilePicker.js new file mode 100644 index 0000000..77801d2 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/it/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nome","size":"Dimensione (in byte)","path":"Percorso"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/it/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/it/FilePicker.xd.js new file mode 100644 index 0000000..c268f2c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/it/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.it.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.it.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "it", ({"name":"Nome","size":"Dimensione (in byte)","path":"Percorso"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/it/Wizard.js b/js/dojo-1.6/dojox/widget/nls/it/Wizard.js new file mode 100644 index 0000000..78ea64b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/it/Wizard.js @@ -0,0 +1 @@ +({"next":"Successivo","done":"Eseguito","previous":"Precedente"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/it/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/it/Wizard.xd.js new file mode 100644 index 0000000..da23a55 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/it/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.it.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.it.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "it", ({"next":"Successivo","done":"Eseguito","previous":"Precedente"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ja/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/ja/ColorPicker.js new file mode 100644 index 0000000..06b3af8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ja/ColorPicker.js @@ -0,0 +1 @@ +({"hexLabel":"16 進","saturationPickerTitle":"彩度セレクター","huePickerTitle":"色調セレクター","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ja/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ja/ColorPicker.xd.js new file mode 100644 index 0000000..be1d090 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ja/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ja.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ja.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "ja", ({"hexLabel":"16 進","saturationPickerTitle":"彩度セレクター","huePickerTitle":"色調セレクター","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ja/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/ja/FilePicker.js new file mode 100644 index 0000000..61068a9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ja/FilePicker.js @@ -0,0 +1 @@ +({"name":"名前","size":"サイズ (バイト単位)","path":"パス"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ja/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ja/FilePicker.xd.js new file mode 100644 index 0000000..81704e9 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ja/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ja.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ja.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "ja", ({"name":"名前","size":"サイズ (バイト単位)","path":"パス"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ja/Wizard.js b/js/dojo-1.6/dojox/widget/nls/ja/Wizard.js new file mode 100644 index 0000000..6394cb3 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ja/Wizard.js @@ -0,0 +1 @@ +({"next":"次へ","done":"完了","previous":"前へ"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ja/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/ja/Wizard.xd.js new file mode 100644 index 0000000..d9a8dbf --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ja/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ja.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ja.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "ja", ({"next":"次へ","done":"完了","previous":"前へ"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/kk/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/kk/ColorPicker.js new file mode 100644 index 0000000..a70f54b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/kk/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Қанықтықты іріктеу","valueLabel":"п","blueLabel":"ә","saturationLabel":"ң","greenLabel":"д","redLabel":"r","hueLabel":"е","hexLabel":"алтылық","huePickerTitle":"Реңкті іріктеу","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/kk/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/kk/ColorPicker.xd.js new file mode 100644 index 0000000..95ec241 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/kk/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.kk.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.kk.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "kk", ({"saturationPickerTitle":"Қанықтықты іріктеу","valueLabel":"п","blueLabel":"ә","saturationLabel":"ң","greenLabel":"д","redLabel":"r","hueLabel":"е","hexLabel":"алтылық","huePickerTitle":"Реңкті іріктеу","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/kk/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/kk/FilePicker.js new file mode 100644 index 0000000..62c0e83 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/kk/FilePicker.js @@ -0,0 +1 @@ +({"name":"Атауы","size":"Өлшемі (байт)","path":"Жол"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/kk/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/kk/FilePicker.xd.js new file mode 100644 index 0000000..b96d824 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/kk/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.kk.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.kk.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "kk", ({"name":"Атауы","size":"Өлшемі (байт)","path":"Жол"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/kk/Wizard.js b/js/dojo-1.6/dojox/widget/nls/kk/Wizard.js new file mode 100644 index 0000000..4b53b96 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/kk/Wizard.js @@ -0,0 +1 @@ +({"next":"Келесі","done":"Орындалған","previous":"Алдыңғы"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/kk/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/kk/Wizard.xd.js new file mode 100644 index 0000000..ee8f4f0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/kk/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.kk.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.kk.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "kk", ({"next":"Келесі","done":"Орындалған","previous":"Алдыңғы"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ko/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/ko/ColorPicker.js new file mode 100644 index 0000000..85eb56e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ko/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"채도 선택자","valueLabel":"V","blueLabel":"B","saturationLabel":"S","greenLabel":"G","redLabel":"R","hueLabel":"H","hexLabel":"16진","huePickerTitle":"색상 선택자","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ko/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ko/ColorPicker.xd.js new file mode 100644 index 0000000..0d58e35 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ko/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ko.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ko.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "ko", ({"saturationPickerTitle":"채도 선택자","valueLabel":"V","blueLabel":"B","saturationLabel":"S","greenLabel":"G","redLabel":"R","hueLabel":"H","hexLabel":"16진","huePickerTitle":"색상 선택자","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ko/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/ko/FilePicker.js new file mode 100644 index 0000000..fd59903 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ko/FilePicker.js @@ -0,0 +1 @@ +({"name":"이름","size":"크기(바이트)","path":"경로"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ko/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ko/FilePicker.xd.js new file mode 100644 index 0000000..7644d64 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ko/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ko.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ko.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "ko", ({"name":"이름","size":"크기(바이트)","path":"경로"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ko/Wizard.js b/js/dojo-1.6/dojox/widget/nls/ko/Wizard.js new file mode 100644 index 0000000..dec3546 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ko/Wizard.js @@ -0,0 +1 @@ +({"next":"다음","done":"완료","previous":"이전"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ko/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/ko/Wizard.xd.js new file mode 100644 index 0000000..d195058 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ko/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ko.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ko.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "ko", ({"next":"다음","done":"완료","previous":"이전"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nb/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/nb/ColorPicker.js new file mode 100644 index 0000000..6441323 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nb/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Metningsvelger","huePickerTitle":"Nyansevelger","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nb/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/nb/ColorPicker.xd.js new file mode 100644 index 0000000..f0cd3be --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nb/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.nb.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.nb.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "nb", ({"saturationPickerTitle":"Metningsvelger","huePickerTitle":"Nyansevelger","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nb/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/nb/FilePicker.js new file mode 100644 index 0000000..ef78320 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nb/FilePicker.js @@ -0,0 +1 @@ +({"name":"Navn","size":"Størrelse (i byte)","path":"Bane"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nb/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/nb/FilePicker.xd.js new file mode 100644 index 0000000..bd89832 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nb/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.nb.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.nb.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "nb", ({"name":"Navn","size":"Størrelse (i byte)","path":"Bane"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nb/Wizard.js b/js/dojo-1.6/dojox/widget/nls/nb/Wizard.js new file mode 100644 index 0000000..0cbe813 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nb/Wizard.js @@ -0,0 +1 @@ +({"next":"Neste","done":"Ferdig","previous":"Forrige"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nb/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/nb/Wizard.xd.js new file mode 100644 index 0000000..91a0509 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nb/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.nb.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.nb.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "nb", ({"next":"Neste","done":"Ferdig","previous":"Forrige"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nl/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/nl/ColorPicker.js new file mode 100644 index 0000000..4070a43 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nl/ColorPicker.js @@ -0,0 +1 @@ +({"valueLabel":"h","hueLabel":"t","saturationLabel":"i","saturationPickerTitle":"Intensiteit selecteren","huePickerTitle":"Tint selecteren","blueLabel":"b","greenLabel":"g","redLabel":"r","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nl/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/nl/ColorPicker.xd.js new file mode 100644 index 0000000..c361365 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nl/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.nl.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.nl.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "nl", ({"valueLabel":"h","hueLabel":"t","saturationLabel":"i","saturationPickerTitle":"Intensiteit selecteren","huePickerTitle":"Tint selecteren","blueLabel":"b","greenLabel":"g","redLabel":"r","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nl/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/nl/FilePicker.js new file mode 100644 index 0000000..a841a1d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nl/FilePicker.js @@ -0,0 +1 @@ +({"name":"Naam","size":"Grootte (in bytes)","path":"Pad"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nl/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/nl/FilePicker.xd.js new file mode 100644 index 0000000..23fdb91 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nl/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.nl.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.nl.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "nl", ({"name":"Naam","size":"Grootte (in bytes)","path":"Pad"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nl/Wizard.js b/js/dojo-1.6/dojox/widget/nls/nl/Wizard.js new file mode 100644 index 0000000..d5e680f --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nl/Wizard.js @@ -0,0 +1 @@ +({"next":"Volgende","done":"Klaar","previous":"Vorige"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/nl/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/nl/Wizard.xd.js new file mode 100644 index 0000000..e0a96c7 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/nl/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.nl.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.nl.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "nl", ({"next":"Volgende","done":"Klaar","previous":"Vorige"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pl/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/pl/ColorPicker.js new file mode 100644 index 0000000..db0311a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pl/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Selektor nasycenia","valueLabel":"jas.","blueLabel":"n","saturationLabel":"nas.","greenLabel":"z","redLabel":"c","hueLabel":"barwa","hexLabel":"szesnastkowe","huePickerTitle":"Selektor barwy","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pl/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/pl/ColorPicker.xd.js new file mode 100644 index 0000000..b57539b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pl/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pl.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pl.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "pl", ({"saturationPickerTitle":"Selektor nasycenia","valueLabel":"jas.","blueLabel":"n","saturationLabel":"nas.","greenLabel":"z","redLabel":"c","hueLabel":"barwa","hexLabel":"szesnastkowe","huePickerTitle":"Selektor barwy","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pl/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/pl/FilePicker.js new file mode 100644 index 0000000..5afd4b7 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pl/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nazwa","size":"Wielkość (w bajtach)","path":"Ścieżka"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pl/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/pl/FilePicker.xd.js new file mode 100644 index 0000000..75f7bc1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pl/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pl.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pl.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "pl", ({"name":"Nazwa","size":"Wielkość (w bajtach)","path":"Ścieżka"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pl/Wizard.js b/js/dojo-1.6/dojox/widget/nls/pl/Wizard.js new file mode 100644 index 0000000..c7dc6a1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pl/Wizard.js @@ -0,0 +1 @@ +({"next":"Dalej","done":"Gotowe","previous":"Wstecz"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pl/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/pl/Wizard.xd.js new file mode 100644 index 0000000..a8b2b0c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pl/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pl.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pl.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "pl", ({"next":"Dalej","done":"Gotowe","previous":"Wstecz"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt-pt/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/pt-pt/ColorPicker.js new file mode 100644 index 0000000..2aae696 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt-pt/ColorPicker.js @@ -0,0 +1 @@ +({"redLabel":"e","valueLabel":"val","hueLabel":"t","saturationPickerTitle":"Selector de saturação","huePickerTitle":"Selector de tonalidade","greenLabel":"v","blueLabel":"a","saturationLabel":"s","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt-pt/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/pt-pt/ColorPicker.xd.js new file mode 100644 index 0000000..3359124 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt-pt/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pt-pt.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pt-pt.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "pt-pt", ({"redLabel":"e","valueLabel":"val","hueLabel":"t","saturationPickerTitle":"Selector de saturação","huePickerTitle":"Selector de tonalidade","greenLabel":"v","blueLabel":"a","saturationLabel":"s","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt-pt/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/pt-pt/FilePicker.js new file mode 100644 index 0000000..22e342e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt-pt/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nome","size":"Tamanho (em bytes)","path":"Caminho"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt-pt/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/pt-pt/FilePicker.xd.js new file mode 100644 index 0000000..699aafa --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt-pt/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pt-pt.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pt-pt.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "pt-pt", ({"name":"Nome","size":"Tamanho (em bytes)","path":"Caminho"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt-pt/Wizard.js b/js/dojo-1.6/dojox/widget/nls/pt-pt/Wizard.js new file mode 100644 index 0000000..2b6bb1e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt-pt/Wizard.js @@ -0,0 +1 @@ +({"next":"Seguinte","done":"Concluído","previous":"Anterior"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt-pt/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/pt-pt/Wizard.xd.js new file mode 100644 index 0000000..7ddd922 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt-pt/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pt-pt.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pt-pt.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "pt-pt", ({"next":"Seguinte","done":"Concluído","previous":"Anterior"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/pt/ColorPicker.js new file mode 100644 index 0000000..b6eb36c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Seletor de Saturação","huePickerTitle":"Seletor de Matiz","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/pt/ColorPicker.xd.js new file mode 100644 index 0000000..c48c702 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pt.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pt.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "pt", ({"saturationPickerTitle":"Seletor de Saturação","huePickerTitle":"Seletor de Matiz","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/pt/FilePicker.js new file mode 100644 index 0000000..22e342e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nome","size":"Tamanho (em bytes)","path":"Caminho"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/pt/FilePicker.xd.js new file mode 100644 index 0000000..5f8af54 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pt.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pt.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "pt", ({"name":"Nome","size":"Tamanho (em bytes)","path":"Caminho"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt/Wizard.js b/js/dojo-1.6/dojox/widget/nls/pt/Wizard.js new file mode 100644 index 0000000..8f7aa7c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt/Wizard.js @@ -0,0 +1 @@ +({"next":"Próximo","done":"Concluído","previous":"Anterior"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/pt/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/pt/Wizard.xd.js new file mode 100644 index 0000000..702680c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/pt/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.pt.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.pt.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "pt", ({"next":"Próximo","done":"Concluído","previous":"Anterior"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ro/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/ro/ColorPicker.js new file mode 100644 index 0000000..fd8d20c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ro/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Selector saturaţie","huePickerTitle":"Selector nuanţă","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ro/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ro/ColorPicker.xd.js new file mode 100644 index 0000000..938fc12 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ro/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ro.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ro.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "ro", ({"saturationPickerTitle":"Selector saturaţie","huePickerTitle":"Selector nuanţă","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ro/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/ro/FilePicker.js new file mode 100644 index 0000000..9a5d6fd --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ro/FilePicker.js @@ -0,0 +1 @@ +({"name":"Nume","size":"Dimensiune (în octeţi)","path":"Cale "})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ro/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ro/FilePicker.xd.js new file mode 100644 index 0000000..3aef3bd --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ro/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ro.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ro.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "ro", ({"name":"Nume","size":"Dimensiune (în octeţi)","path":"Cale "})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ro/Wizard.js b/js/dojo-1.6/dojox/widget/nls/ro/Wizard.js new file mode 100644 index 0000000..b2cd9e1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ro/Wizard.js @@ -0,0 +1 @@ +({"next":"Următor","done":"Gata","previous":"Anterior"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ro/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/ro/Wizard.xd.js new file mode 100644 index 0000000..dca1730 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ro/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ro.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ro.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "ro", ({"next":"Următor","done":"Gata","previous":"Anterior"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ru/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/ru/ColorPicker.js new file mode 100644 index 0000000..cdffdd2 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ru/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Выбор насыщенности","valueLabel":"з","blueLabel":"с","saturationLabel":"н","greenLabel":"з","redLabel":"к","hueLabel":"о","hexLabel":"шест","huePickerTitle":"Выбор оттенка","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ru/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ru/ColorPicker.xd.js new file mode 100644 index 0000000..d0f02a8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ru/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ru.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ru.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "ru", ({"saturationPickerTitle":"Выбор насыщенности","valueLabel":"з","blueLabel":"с","saturationLabel":"н","greenLabel":"з","redLabel":"к","hueLabel":"о","hexLabel":"шест","huePickerTitle":"Выбор оттенка","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ru/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/ru/FilePicker.js new file mode 100644 index 0000000..af2d596 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ru/FilePicker.js @@ -0,0 +1 @@ +({"name":"Имя","size":"Размер (байт)","path":"Путь"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ru/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/ru/FilePicker.xd.js new file mode 100644 index 0000000..d15b42b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ru/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ru.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ru.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "ru", ({"name":"Имя","size":"Размер (байт)","path":"Путь"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ru/Wizard.js b/js/dojo-1.6/dojox/widget/nls/ru/Wizard.js new file mode 100644 index 0000000..bbc1b51 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ru/Wizard.js @@ -0,0 +1 @@ +({"next":"Далее","done":"Готово","previous":"Назад"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/ru/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/ru/Wizard.xd.js new file mode 100644 index 0000000..02e688a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/ru/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.ru.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.ru.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "ru", ({"next":"Далее","done":"Готово","previous":"Назад"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sk/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/sk/ColorPicker.js new file mode 100644 index 0000000..71d9b93 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sk/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Saturation Selector","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","huePickerTitle":"Hue Selector","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sk/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/sk/ColorPicker.xd.js new file mode 100644 index 0000000..bc4c037 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sk/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sk.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sk.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "sk", ({"saturationPickerTitle":"Saturation Selector","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","huePickerTitle":"Hue Selector","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sk/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/sk/FilePicker.js new file mode 100644 index 0000000..c165416 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sk/FilePicker.js @@ -0,0 +1 @@ +({"name":"Názov","size":"Veľkosť (v bajtoch)","path":"Cesta"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sk/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/sk/FilePicker.xd.js new file mode 100644 index 0000000..7450eb4 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sk/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sk.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sk.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "sk", ({"name":"Názov","size":"Veľkosť (v bajtoch)","path":"Cesta"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sk/Wizard.js b/js/dojo-1.6/dojox/widget/nls/sk/Wizard.js new file mode 100644 index 0000000..d740aa4 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sk/Wizard.js @@ -0,0 +1 @@ +({"next":"Ďalej","done":"Hotovo","previous":"Späť"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sk/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/sk/Wizard.xd.js new file mode 100644 index 0000000..4228488 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sk/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sk.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sk.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "sk", ({"next":"Ďalej","done":"Hotovo","previous":"Späť"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sl/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/sl/ColorPicker.js new file mode 100644 index 0000000..d5bfd05 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sl/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Izbirnik nasičenosti","huePickerTitle":"Izbirnik odtenka ","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sl/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/sl/ColorPicker.xd.js new file mode 100644 index 0000000..5313b57 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sl/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sl.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sl.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "sl", ({"saturationPickerTitle":"Izbirnik nasičenosti","huePickerTitle":"Izbirnik odtenka ","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sl/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/sl/FilePicker.js new file mode 100644 index 0000000..f977154 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sl/FilePicker.js @@ -0,0 +1 @@ +({"name":"Ime","size":"Velikost (v bajtih)","path":"Pot"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sl/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/sl/FilePicker.xd.js new file mode 100644 index 0000000..95ebd39 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sl/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sl.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sl.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "sl", ({"name":"Ime","size":"Velikost (v bajtih)","path":"Pot"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sl/Wizard.js b/js/dojo-1.6/dojox/widget/nls/sl/Wizard.js new file mode 100644 index 0000000..a89a23c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sl/Wizard.js @@ -0,0 +1 @@ +({"next":"Naprej","done":"Opravljeno","previous":"Nazaj"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sl/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/sl/Wizard.xd.js new file mode 100644 index 0000000..8e0f208 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sl/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sl.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sl.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "sl", ({"next":"Naprej","done":"Opravljeno","previous":"Nazaj"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sv/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/sv/ColorPicker.js new file mode 100644 index 0000000..cfdb948 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sv/ColorPicker.js @@ -0,0 +1 @@ +({"valueLabel":"l","hueLabel":"n","saturationLabel":"m","saturationPickerTitle":"Välj mättnad","huePickerTitle":"Välj färgton","blueLabel":"b","greenLabel":"g","redLabel":"r","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sv/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/sv/ColorPicker.xd.js new file mode 100644 index 0000000..3c4dd7c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sv/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sv.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sv.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "sv", ({"valueLabel":"l","hueLabel":"n","saturationLabel":"m","saturationPickerTitle":"Välj mättnad","huePickerTitle":"Välj färgton","blueLabel":"b","greenLabel":"g","redLabel":"r","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sv/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/sv/FilePicker.js new file mode 100644 index 0000000..1c66552 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sv/FilePicker.js @@ -0,0 +1 @@ +({"name":"Namn","size":"Storlek (byte)","path":"Sökväg"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sv/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/sv/FilePicker.xd.js new file mode 100644 index 0000000..fe40b75 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sv/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sv.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sv.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "sv", ({"name":"Namn","size":"Storlek (byte)","path":"Sökväg"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sv/Wizard.js b/js/dojo-1.6/dojox/widget/nls/sv/Wizard.js new file mode 100644 index 0000000..ae75b03 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sv/Wizard.js @@ -0,0 +1 @@ +({"next":"Nästa","done":"Stäng","previous":"Föregående"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/sv/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/sv/Wizard.xd.js new file mode 100644 index 0000000..ae470ba --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/sv/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.sv.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.sv.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "sv", ({"next":"Nästa","done":"Stäng","previous":"Föregående"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/th/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/th/ColorPicker.js new file mode 100644 index 0000000..559e28b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/th/ColorPicker.js @@ -0,0 +1 @@ +({"redLabel":"อาร์","valueLabel":"วี","hueLabel":"เอช","saturationLabel":"เอส","saturationPickerTitle":"ตัวเลือกความอิ่มของสี","huePickerTitle":"ตัวเลือกสี","greenLabel":"จี","blueLabel":"บี","hexLabel":"hex","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/th/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/th/ColorPicker.xd.js new file mode 100644 index 0000000..c86d8b5 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/th/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.th.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.th.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "th", ({"redLabel":"อาร์","valueLabel":"วี","hueLabel":"เอช","saturationLabel":"เอส","saturationPickerTitle":"ตัวเลือกความอิ่มของสี","huePickerTitle":"ตัวเลือกสี","greenLabel":"จี","blueLabel":"บี","hexLabel":"hex","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/th/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/th/FilePicker.js new file mode 100644 index 0000000..362f1c1 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/th/FilePicker.js @@ -0,0 +1 @@ +({"name":"ชื่อ","size":"ขนาด (ไบต์)","path":"พาธ"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/th/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/th/FilePicker.xd.js new file mode 100644 index 0000000..9c1a249 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/th/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.th.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.th.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "th", ({"name":"ชื่อ","size":"ขนาด (ไบต์)","path":"พาธ"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/th/Wizard.js b/js/dojo-1.6/dojox/widget/nls/th/Wizard.js new file mode 100644 index 0000000..d9b793a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/th/Wizard.js @@ -0,0 +1 @@ +({"next":"ถัดไป","done":"เสร็จสิ้น","previous":"ก่อนหน้า"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/th/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/th/Wizard.xd.js new file mode 100644 index 0000000..9d682fd --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/th/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.th.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.th.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "th", ({"next":"ถัดไป","done":"เสร็จสิ้น","previous":"ก่อนหน้า"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/tr/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/tr/ColorPicker.js new file mode 100644 index 0000000..95e88f3 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/tr/ColorPicker.js @@ -0,0 +1 @@ +({"saturationPickerTitle":"Doygunluk Seçici","valueLabel":"d","blueLabel":"m","saturationLabel":"d","greenLabel":"y","redLabel":"k","hueLabel":"t","hexLabel":"onaltılı","huePickerTitle":"Ton Seçici","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/tr/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/tr/ColorPicker.xd.js new file mode 100644 index 0000000..4e1324b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/tr/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.tr.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.tr.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "tr", ({"saturationPickerTitle":"Doygunluk Seçici","valueLabel":"d","blueLabel":"m","saturationLabel":"d","greenLabel":"y","redLabel":"k","hueLabel":"t","hexLabel":"onaltılı","huePickerTitle":"Ton Seçici","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/tr/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/tr/FilePicker.js new file mode 100644 index 0000000..2c0d44c --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/tr/FilePicker.js @@ -0,0 +1 @@ +({"name":"Ad","size":"Boyut (bayt cinsinden)","path":"Yol"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/tr/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/tr/FilePicker.xd.js new file mode 100644 index 0000000..ee61774 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/tr/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.tr.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.tr.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "tr", ({"name":"Ad","size":"Boyut (bayt cinsinden)","path":"Yol"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/tr/Wizard.js b/js/dojo-1.6/dojox/widget/nls/tr/Wizard.js new file mode 100644 index 0000000..752b8ac --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/tr/Wizard.js @@ -0,0 +1 @@ +({"next":"İleri","done":"Bitti","previous":"Geri"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/tr/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/tr/Wizard.xd.js new file mode 100644 index 0000000..ee02767 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/tr/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.tr.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.tr.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "tr", ({"next":"İleri","done":"Bitti","previous":"Geri"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh-tw/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/zh-tw/ColorPicker.js new file mode 100644 index 0000000..8b65a2d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh-tw/ColorPicker.js @@ -0,0 +1 @@ +({"hexLabel":"十六進位","saturationPickerTitle":"飽和度選取元","huePickerTitle":"色調選取元","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh-tw/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/zh-tw/ColorPicker.xd.js new file mode 100644 index 0000000..d69960b --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh-tw/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.zh-tw.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.zh-tw.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "zh-tw", ({"hexLabel":"十六進位","saturationPickerTitle":"飽和度選取元","huePickerTitle":"色調選取元","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh-tw/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/zh-tw/FilePicker.js new file mode 100644 index 0000000..9053ece --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh-tw/FilePicker.js @@ -0,0 +1 @@ +({"name":"名稱","size":"大小 (以位元組為單位)","path":"路徑"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh-tw/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/zh-tw/FilePicker.xd.js new file mode 100644 index 0000000..8f0582e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh-tw/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.zh-tw.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.zh-tw.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "zh-tw", ({"name":"名稱","size":"大小 (以位元組為單位)","path":"路徑"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh-tw/Wizard.js b/js/dojo-1.6/dojox/widget/nls/zh-tw/Wizard.js new file mode 100644 index 0000000..fe45203 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh-tw/Wizard.js @@ -0,0 +1 @@ +({"next":"下一步","done":"完成","previous":"上一步"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh-tw/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/zh-tw/Wizard.xd.js new file mode 100644 index 0000000..cb64210 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh-tw/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.zh-tw.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.zh-tw.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "zh-tw", ({"next":"下一步","done":"完成","previous":"上一步"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh/ColorPicker.js b/js/dojo-1.6/dojox/widget/nls/zh/ColorPicker.js new file mode 100644 index 0000000..f3e2191 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh/ColorPicker.js @@ -0,0 +1 @@ +({"hexLabel":"十六进制","saturationPickerTitle":"饱和度选择器","huePickerTitle":"色彩选择器","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","degLabel":"°"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh/ColorPicker.xd.js b/js/dojo-1.6/dojox/widget/nls/zh/ColorPicker.xd.js new file mode 100644 index 0000000..b0bf37d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh/ColorPicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.zh.ColorPicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.zh.ColorPicker");dojo._xdLoadFlattenedBundle("dojox.widget", "ColorPicker", "zh", ({"hexLabel":"十六进制","saturationPickerTitle":"饱和度选择器","huePickerTitle":"色彩选择器","valueLabel":"v","blueLabel":"b","saturationLabel":"s","greenLabel":"g","redLabel":"r","hueLabel":"h","degLabel":"°"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh/FilePicker.js b/js/dojo-1.6/dojox/widget/nls/zh/FilePicker.js new file mode 100644 index 0000000..0fef8ca --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh/FilePicker.js @@ -0,0 +1 @@ +({"name":"名称","size":"大小(字节)","path":"路径"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh/FilePicker.xd.js b/js/dojo-1.6/dojox/widget/nls/zh/FilePicker.xd.js new file mode 100644 index 0000000..a9249ee --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh/FilePicker.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.zh.FilePicker"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.zh.FilePicker");dojo._xdLoadFlattenedBundle("dojox.widget", "FilePicker", "zh", ({"name":"名称","size":"大小(字节)","path":"路径"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh/Wizard.js b/js/dojo-1.6/dojox/widget/nls/zh/Wizard.js new file mode 100644 index 0000000..fe45203 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh/Wizard.js @@ -0,0 +1 @@ +({"next":"下一步","done":"完成","previous":"上一步"})
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/nls/zh/Wizard.xd.js b/js/dojo-1.6/dojox/widget/nls/zh/Wizard.xd.js new file mode 100644 index 0000000..cee2b7e --- /dev/null +++ b/js/dojo-1.6/dojox/widget/nls/zh/Wizard.xd.js @@ -0,0 +1,5 @@ +dojo._xdResourceLoaded(function(dojo, dijit, dojox){ +return {depends: [["provide", "dojox.widget.nls.zh.Wizard"]], +defineResource: function(dojo, dijit, dojox){dojo.provide("dojox.widget.nls.zh.Wizard");dojo._xdLoadFlattenedBundle("dojox.widget", "Wizard", "zh", ({"next":"下一步","done":"完成","previous":"上一步"})
+); +}};});
\ No newline at end of file diff --git a/js/dojo-1.6/dojox/widget/rotator/Controller.js b/js/dojo-1.6/dojox/widget/rotator/Controller.js new file mode 100644 index 0000000..f1ed09a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Controller.js @@ -0,0 +1,203 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.rotator.Controller"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Controller"] = true;
+dojo.provide("dojox.widget.rotator.Controller");
+
+(function(d){
+
+ var _dojoxRotator = "dojoxRotator",
+ _play = _dojoxRotator + "Play",
+ _pause = _dojoxRotator + "Pause",
+ _number = _dojoxRotator + "Number",
+ _tab = _dojoxRotator + "Tab",
+ _selected = _dojoxRotator + "Selected";
+
+ d.declare("dojox.widget.rotator.Controller", null, {
+ // summary:
+ // A controller that manipulates a Rotator or AutoRotator.
+ //
+ // description:
+ // Displays a series of controls that send actions to a Rotator or
+ // AutoRotator. The Controller supports the following controls:
+ //
+ // * Next pane
+ // * Previous pane
+ // * Play/Pause toggler
+ // * Numbered tabs
+ // * Titled tabs
+ // * Information
+ //
+ // You may specify any of these controls in any order. You may also
+ // have multiple Controllers tied to a single Rotator instance.
+ //
+ // The Controller's DOM node may also be styled for positioning or
+ // other styled preferences.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.rotator.Controller"
+ // | rotator="myRotator"
+ // | ></div>
+ //
+ // example:
+ // | <div dojoType="dojox.widget.rotator.Controller"
+ // | rotator="myRotator"
+ // | controls="prev,#,next"
+ // | class="myCtrl"
+ // | ></div>
+ //
+ // example:
+ // | <div dojoType="dojox.widget.rotator.Controller"
+ // | rotator="myRotator"
+ // | controls="titles"
+ // | class="myCtrl"
+ // | ></div>s
+
+ // rotator: dojox.widget.Rotator
+ // An instance of a Rotator widget.
+ rotator: null,
+
+ // commands: string
+ // A comma-separated list of commands. Valid commands are:
+ // prev An icon button to go to the previous pane.
+ // next An icon button to go to the next pane.
+ // play/pause A play and pause toggle icon button.
+ // info Displays the current and total panes. (ie "1 / 4")
+ // # Displays a number button for each pane. (ie "1 2 3 4")
+ // titles Displays each pane's title as a tab. (ie "Home Services Contact Blog")
+ commands: "prev,play/pause,info,next",
+
+ constructor: function(/*Object*/params, /*DomNode|string*/node){
+ // summary:
+ // Initializes the pager and connect to the rotator.
+
+ d.mixin(this, params);
+
+ // check if we have a valid rotator
+ var r = this.rotator;
+ if(r){
+ // remove all of the controller's child nodes just in case
+ while(node.firstChild){
+ node.removeChild(node.firstChild);
+ }
+
+ var ul = this._domNode = d.create("ul", null, node),
+ icon = " " + _dojoxRotator + "Icon",
+
+ // helper function for creating a button
+ cb = function(/*string*/label, /*string*/css, /*array*/action){
+ d.create("li", {
+ className: css,
+ innerHTML: '<a href="#"><span>' + label + '</span></a>',
+ onclick: function(/*event*/e){
+ d.stopEvent(e);
+ if(r){
+ r.control.apply(r, action);
+ }
+ }
+ }, ul);
+ };
+
+ // build out the commands
+ d.forEach(this.commands.split(','), function(b, i){
+ switch(b){
+ case "prev":
+ cb("Prev", _dojoxRotator + "Prev" + icon, ["prev"]);
+ break;
+ case "play/pause":
+ cb("Play", _play + icon, ["play"]);
+ cb("Pause", _pause + icon, ["pause"]);
+ break;
+ case "info":
+ this._info = d.create("li", {
+ className: _dojoxRotator + "Info",
+ innerHTML: this._buildInfo(r)
+ }, ul);
+ break;
+ case "next":
+ cb("Next", _dojoxRotator + "Next" + icon, ["next"]);
+ break;
+ case "#":
+ case "titles":
+ for(var j=0; j<r.panes.length; j++){
+ cb(
+ /*label*/ b == '#' ? j+1 : r.panes[j].title || "Tab " + (j+1),
+ /*css*/ (b == '#' ? _number : _tab) + ' ' + (j == r.idx ? _selected : "") + ' ' + _dojoxRotator + "Pane" + j,
+ /*action*/ ["go", j]
+ );
+ }
+ break;
+ }
+ }, this);
+
+ // add the first/last classes for styling
+ d.query("li:first-child", ul).addClass(_dojoxRotator + "First");
+ d.query("li:last-child", ul).addClass(_dojoxRotator + "Last");
+
+ // set the initial state of the play/pause toggle button
+ this._togglePlay();
+
+ this._con = d.connect(r, "onUpdate", this, "_onUpdate");
+ }
+ },
+
+ destroy: function(){
+ // summary:
+ // Disconnect from the rotator.
+ d.disconnect(this._con);
+ d.destroy(this._domNode);
+ },
+
+ _togglePlay: function(/*boolean*/playing){
+ // summary:
+ // Toggles the play/pause button, if it exists.
+
+ var p = this.rotator.playing;
+ d.query('.'+_play, this._domNode).style("display", p ? "none" : "");
+ d.query('.'+_pause, this._domNode).style("display", p ? "" : "none");
+ },
+
+ _buildInfo: function(/*dojox.widget.Rotator*/r){
+ // summary:
+ // Return a string containing the current pane number and the total number of panes.
+ return '<span>' + (r.idx+1) + ' / ' + r.panes.length + '</span>'; /*string*/
+ },
+
+ _onUpdate: function(/*string*/type){
+ // summary:
+ // Updates various pager controls when the rotator updates.
+
+ var r = this.rotator; // no need to test if this is null since _onUpdate is only fired by the rotator
+
+ switch(type){
+ case "play":
+ case "pause":
+ this._togglePlay();
+ break;
+ case "onAfterTransition":
+ if(this._info){
+ this._info.innerHTML = this._buildInfo(r);
+ }
+
+ // helper function for selecting the current tab
+ var s = function(/*NodeList*/n){
+ if(r.idx < n.length){
+ d.addClass(n[r.idx], _selected);
+ }
+ };
+
+ s(d.query('.' + _number, this._domNode).removeClass(_selected));
+ s(d.query('.' + _tab, this._domNode).removeClass(_selected));
+ break;
+ }
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/rotator/Controller.xd.js b/js/dojo-1.6/dojox/widget/rotator/Controller.xd.js new file mode 100644 index 0000000..2bf98ea --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Controller.xd.js @@ -0,0 +1,207 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.rotator.Controller"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.rotator.Controller"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Controller"] = true;
+dojo.provide("dojox.widget.rotator.Controller");
+
+(function(d){
+
+ var _dojoxRotator = "dojoxRotator",
+ _play = _dojoxRotator + "Play",
+ _pause = _dojoxRotator + "Pause",
+ _number = _dojoxRotator + "Number",
+ _tab = _dojoxRotator + "Tab",
+ _selected = _dojoxRotator + "Selected";
+
+ d.declare("dojox.widget.rotator.Controller", null, {
+ // summary:
+ // A controller that manipulates a Rotator or AutoRotator.
+ //
+ // description:
+ // Displays a series of controls that send actions to a Rotator or
+ // AutoRotator. The Controller supports the following controls:
+ //
+ // * Next pane
+ // * Previous pane
+ // * Play/Pause toggler
+ // * Numbered tabs
+ // * Titled tabs
+ // * Information
+ //
+ // You may specify any of these controls in any order. You may also
+ // have multiple Controllers tied to a single Rotator instance.
+ //
+ // The Controller's DOM node may also be styled for positioning or
+ // other styled preferences.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.rotator.Controller"
+ // | rotator="myRotator"
+ // | ></div>
+ //
+ // example:
+ // | <div dojoType="dojox.widget.rotator.Controller"
+ // | rotator="myRotator"
+ // | controls="prev,#,next"
+ // | class="myCtrl"
+ // | ></div>
+ //
+ // example:
+ // | <div dojoType="dojox.widget.rotator.Controller"
+ // | rotator="myRotator"
+ // | controls="titles"
+ // | class="myCtrl"
+ // | ></div>s
+
+ // rotator: dojox.widget.Rotator
+ // An instance of a Rotator widget.
+ rotator: null,
+
+ // commands: string
+ // A comma-separated list of commands. Valid commands are:
+ // prev An icon button to go to the previous pane.
+ // next An icon button to go to the next pane.
+ // play/pause A play and pause toggle icon button.
+ // info Displays the current and total panes. (ie "1 / 4")
+ // # Displays a number button for each pane. (ie "1 2 3 4")
+ // titles Displays each pane's title as a tab. (ie "Home Services Contact Blog")
+ commands: "prev,play/pause,info,next",
+
+ constructor: function(/*Object*/params, /*DomNode|string*/node){
+ // summary:
+ // Initializes the pager and connect to the rotator.
+
+ d.mixin(this, params);
+
+ // check if we have a valid rotator
+ var r = this.rotator;
+ if(r){
+ // remove all of the controller's child nodes just in case
+ while(node.firstChild){
+ node.removeChild(node.firstChild);
+ }
+
+ var ul = this._domNode = d.create("ul", null, node),
+ icon = " " + _dojoxRotator + "Icon",
+
+ // helper function for creating a button
+ cb = function(/*string*/label, /*string*/css, /*array*/action){
+ d.create("li", {
+ className: css,
+ innerHTML: '<a href="#"><span>' + label + '</span></a>',
+ onclick: function(/*event*/e){
+ d.stopEvent(e);
+ if(r){
+ r.control.apply(r, action);
+ }
+ }
+ }, ul);
+ };
+
+ // build out the commands
+ d.forEach(this.commands.split(','), function(b, i){
+ switch(b){
+ case "prev":
+ cb("Prev", _dojoxRotator + "Prev" + icon, ["prev"]);
+ break;
+ case "play/pause":
+ cb("Play", _play + icon, ["play"]);
+ cb("Pause", _pause + icon, ["pause"]);
+ break;
+ case "info":
+ this._info = d.create("li", {
+ className: _dojoxRotator + "Info",
+ innerHTML: this._buildInfo(r)
+ }, ul);
+ break;
+ case "next":
+ cb("Next", _dojoxRotator + "Next" + icon, ["next"]);
+ break;
+ case "#":
+ case "titles":
+ for(var j=0; j<r.panes.length; j++){
+ cb(
+ /*label*/ b == '#' ? j+1 : r.panes[j].title || "Tab " + (j+1),
+ /*css*/ (b == '#' ? _number : _tab) + ' ' + (j == r.idx ? _selected : "") + ' ' + _dojoxRotator + "Pane" + j,
+ /*action*/ ["go", j]
+ );
+ }
+ break;
+ }
+ }, this);
+
+ // add the first/last classes for styling
+ d.query("li:first-child", ul).addClass(_dojoxRotator + "First");
+ d.query("li:last-child", ul).addClass(_dojoxRotator + "Last");
+
+ // set the initial state of the play/pause toggle button
+ this._togglePlay();
+
+ this._con = d.connect(r, "onUpdate", this, "_onUpdate");
+ }
+ },
+
+ destroy: function(){
+ // summary:
+ // Disconnect from the rotator.
+ d.disconnect(this._con);
+ d.destroy(this._domNode);
+ },
+
+ _togglePlay: function(/*boolean*/playing){
+ // summary:
+ // Toggles the play/pause button, if it exists.
+
+ var p = this.rotator.playing;
+ d.query('.'+_play, this._domNode).style("display", p ? "none" : "");
+ d.query('.'+_pause, this._domNode).style("display", p ? "" : "none");
+ },
+
+ _buildInfo: function(/*dojox.widget.Rotator*/r){
+ // summary:
+ // Return a string containing the current pane number and the total number of panes.
+ return '<span>' + (r.idx+1) + ' / ' + r.panes.length + '</span>'; /*string*/
+ },
+
+ _onUpdate: function(/*string*/type){
+ // summary:
+ // Updates various pager controls when the rotator updates.
+
+ var r = this.rotator; // no need to test if this is null since _onUpdate is only fired by the rotator
+
+ switch(type){
+ case "play":
+ case "pause":
+ this._togglePlay();
+ break;
+ case "onAfterTransition":
+ if(this._info){
+ this._info.innerHTML = this._buildInfo(r);
+ }
+
+ // helper function for selecting the current tab
+ var s = function(/*NodeList*/n){
+ if(r.idx < n.length){
+ d.addClass(n[r.idx], _selected);
+ }
+ };
+
+ s(d.query('.' + _number, this._domNode).removeClass(_selected));
+ s(d.query('.' + _tab, this._domNode).removeClass(_selected));
+ break;
+ }
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/rotator/Fade.js b/js/dojo-1.6/dojox/widget/rotator/Fade.js new file mode 100644 index 0000000..38cb957 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Fade.js @@ -0,0 +1,51 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.rotator.Fade"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Fade"] = true;
+dojo.provide("dojox.widget.rotator.Fade");
+dojo.require("dojo.fx");
+
+(function(d){
+
+ function _fade(/*Object*/args, /*string*/action){
+ // summary:
+ // Returns an animation of a fade out and fade in of the current and next
+ // panes. It will either chain (fade) or combine (crossFade) the fade
+ // animations.
+ var n = args.next.node;
+ d.style(n, {
+ display: "",
+ opacity: 0
+ });
+
+ args.node = args.current.node;
+
+ return d.fx[action]([ /*dojo.Animation*/
+ d.fadeOut(args),
+ d.fadeIn(d.mixin(args, { node: n }))
+ ]);
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ fade: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that fades out the current pane, then fades in
+ // the next pane.
+ return _fade(args, "chain"); /*dojo.Animation*/
+ },
+
+ crossFade: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that cross fades two rotator panes.
+ return _fade(args, "combine"); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/rotator/Fade.xd.js b/js/dojo-1.6/dojox/widget/rotator/Fade.xd.js new file mode 100644 index 0000000..6dba9a8 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Fade.xd.js @@ -0,0 +1,56 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.rotator.Fade"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.rotator.Fade"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Fade"] = true;
+dojo.provide("dojox.widget.rotator.Fade");
+dojo.require("dojo.fx");
+
+(function(d){
+
+ function _fade(/*Object*/args, /*string*/action){
+ // summary:
+ // Returns an animation of a fade out and fade in of the current and next
+ // panes. It will either chain (fade) or combine (crossFade) the fade
+ // animations.
+ var n = args.next.node;
+ d.style(n, {
+ display: "",
+ opacity: 0
+ });
+
+ args.node = args.current.node;
+
+ return d.fx[action]([ /*dojo.Animation*/
+ d.fadeOut(args),
+ d.fadeIn(d.mixin(args, { node: n }))
+ ]);
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ fade: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that fades out the current pane, then fades in
+ // the next pane.
+ return _fade(args, "chain"); /*dojo.Animation*/
+ },
+
+ crossFade: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that cross fades two rotator panes.
+ return _fade(args, "combine"); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/rotator/Pan.js b/js/dojo-1.6/dojox/widget/rotator/Pan.js new file mode 100644 index 0000000..af5039a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Pan.js @@ -0,0 +1,218 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.rotator.Pan"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Pan"] = true;
+dojo.provide("dojox.widget.rotator.Pan");
+dojo.require("dojo.fx");
+
+(function(d){
+
+ // Constants used to identify which edge the pane pans in from.
+ var DOWN = 0,
+ RIGHT = 1,
+ UP = 2,
+ LEFT = 3;
+
+ function _pan(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var n = args.next.node,
+ r = args.rotatorBox,
+ m = type % 2,
+ a = m ? "left" : "top",
+ s = (m ? r.w : r.h) * (type < 2 ? -1 : 1),
+ p = {},
+ q = {};
+
+ d.style(n, "display", "");
+
+ p[a] = {
+ start: 0,
+ end: -s
+ };
+
+ q[a] = {
+ start: s,
+ end: 0
+ };
+
+ return d.fx.combine([ /*dojo.Animation*/
+ d.animateProperty({
+ node: args.current.node,
+ duration: args.duration,
+ properties: p,
+ easing: args.easing
+ }),
+ d.animateProperty({
+ node: n,
+ duration: args.duration,
+ properties: q,
+ easing: args.easing
+ })
+ ]);
+ }
+
+ function _setZindex(/*DomNode*/n, /*int*/z){
+ // summary:
+ // Helper function for continuously panning.
+ d.style(n, "zIndex", z);
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ pan: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that either pans left or right to the next pane.
+ // The actual direction depends on the order of the panes.
+ //
+ // If panning forward from index 1 to 3, it will perform a pan left. If panning
+ // backwards from 5 to 1, then it will perform a pan right.
+ //
+ // If the parameter "continuous" is set to true, it will return an animation
+ // chain of several pan animations of each intermediate pane panning. For
+ // example, if you pan forward from 1 to 3, it will return an animation panning
+ // left from 1 to 2 and then 2 to 3.
+ //
+ // If an easing is specified, it will be applied to each pan transition. For
+ // example, if you are panning from pane 1 to pane 5 and you set the easing to
+ // "dojo.fx.easing.elasticInOut", then it will "wobble" 5 times, once for each
+ // pan transition.
+ //
+ // If the parameter "wrap" is set to true, it will pan to the next pane using
+ // the shortest distance in the array of panes. For example, if there are 6
+ // panes, then panning from 5 to 1 will pan forward (left) from pane 5 to 6 and
+ // 6 to 1. If the distance is the same either going forward or backwards, then
+ // it will always pan forward (left).
+ //
+ // A continuous pan will use the target pane's duration to pan all intermediate
+ // panes. To use the target's pane duration for each intermediate pane, then
+ // set the "quick" parameter to "false".
+
+ var w = args.wrap,
+ p = args.rotator.panes,
+ len = p.length,
+ z = len,
+ j = args.current.idx,
+ k = args.next.idx,
+ nw = Math.abs(k - j),
+ ww = Math.abs((len - Math.max(j, k)) + Math.min(j, k)) % len,
+ _forward = j < k,
+ _dir = LEFT,
+ _pans = [],
+ _nodes = [],
+ _duration = args.duration;
+
+ // default to pan left, but check if we should pan right.
+ // need to take into account wrapping.
+ if((!w && !_forward) || (w && (_forward && nw > ww || !_forward && nw < ww))){
+ _dir = RIGHT;
+ }
+
+ if(args.continuous){
+ // if continuous pans are quick, then divide the duration by the number of panes
+ if(args.quick){
+ _duration = Math.round(_duration / (w ? Math.min(ww, nw) : nw));
+ }
+
+ // set the current pane's z-index
+ _setZindex(p[j].node, z--);
+
+ var f = (_dir == LEFT);
+
+ // loop and set z-indexes and get all pan animations
+ while(1){
+ // set the current pane
+ var i = j;
+
+ // increment/decrement the next pane's index
+ if(f){
+ if(++j >= len){
+ j = 0;
+ }
+ }else{
+ if(--j < 0){
+ j = len - 1;
+ }
+ }
+
+ var x = p[i],
+ y = p[j];
+
+ // set next pane's z-index
+ _setZindex(y.node, z--);
+
+ // build the pan animation
+ _pans.push(_pan(_dir, d.mixin({
+ easing: function(m){ return m; } // continuous gets a linear easing by default
+ }, args, {
+ current: x,
+ next: y,
+ duration: _duration
+ })));
+
+ // if we're done, then break out of the loop
+ if((f && j == k) || (!f && j == k)){
+ break;
+ }
+
+ // this must come after the break... we don't want the last pane to get it's
+ // styles reset.
+ _nodes.push(y.node);
+ }
+
+ // build the chained animation of all pan animations
+ var _anim = d.fx.chain(_pans),
+
+ // clean up styles when the chained animation finishes
+ h = d.connect(_anim, "onEnd", function(){
+ d.disconnect(h);
+ d.forEach(_nodes, function(q){
+ d.style(q, {
+ display: "none",
+ left: 0,
+ opacity: 1,
+ top: 0,
+ zIndex: 0
+ });
+ });
+ });
+
+ return _anim;
+ }
+
+ // we're not continuous, so just return a normal pan animation
+ return _pan(_dir, args); /*dojo.Animation*/
+ },
+
+ panDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the top.
+ return _pan(DOWN, args); /*dojo.Animation*/
+ },
+
+ panRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the right.
+ return _pan(RIGHT, args); /*dojo.Animation*/
+ },
+
+ panUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the bottom.
+ return _pan(UP, args); /*dojo.Animation*/
+ },
+
+ panLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the left.
+ return _pan(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/rotator/Pan.xd.js b/js/dojo-1.6/dojox/widget/rotator/Pan.xd.js new file mode 100644 index 0000000..493c05a --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Pan.xd.js @@ -0,0 +1,223 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.rotator.Pan"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.rotator.Pan"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Pan"] = true;
+dojo.provide("dojox.widget.rotator.Pan");
+dojo.require("dojo.fx");
+
+(function(d){
+
+ // Constants used to identify which edge the pane pans in from.
+ var DOWN = 0,
+ RIGHT = 1,
+ UP = 2,
+ LEFT = 3;
+
+ function _pan(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var n = args.next.node,
+ r = args.rotatorBox,
+ m = type % 2,
+ a = m ? "left" : "top",
+ s = (m ? r.w : r.h) * (type < 2 ? -1 : 1),
+ p = {},
+ q = {};
+
+ d.style(n, "display", "");
+
+ p[a] = {
+ start: 0,
+ end: -s
+ };
+
+ q[a] = {
+ start: s,
+ end: 0
+ };
+
+ return d.fx.combine([ /*dojo.Animation*/
+ d.animateProperty({
+ node: args.current.node,
+ duration: args.duration,
+ properties: p,
+ easing: args.easing
+ }),
+ d.animateProperty({
+ node: n,
+ duration: args.duration,
+ properties: q,
+ easing: args.easing
+ })
+ ]);
+ }
+
+ function _setZindex(/*DomNode*/n, /*int*/z){
+ // summary:
+ // Helper function for continuously panning.
+ d.style(n, "zIndex", z);
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ pan: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that either pans left or right to the next pane.
+ // The actual direction depends on the order of the panes.
+ //
+ // If panning forward from index 1 to 3, it will perform a pan left. If panning
+ // backwards from 5 to 1, then it will perform a pan right.
+ //
+ // If the parameter "continuous" is set to true, it will return an animation
+ // chain of several pan animations of each intermediate pane panning. For
+ // example, if you pan forward from 1 to 3, it will return an animation panning
+ // left from 1 to 2 and then 2 to 3.
+ //
+ // If an easing is specified, it will be applied to each pan transition. For
+ // example, if you are panning from pane 1 to pane 5 and you set the easing to
+ // "dojo.fx.easing.elasticInOut", then it will "wobble" 5 times, once for each
+ // pan transition.
+ //
+ // If the parameter "wrap" is set to true, it will pan to the next pane using
+ // the shortest distance in the array of panes. For example, if there are 6
+ // panes, then panning from 5 to 1 will pan forward (left) from pane 5 to 6 and
+ // 6 to 1. If the distance is the same either going forward or backwards, then
+ // it will always pan forward (left).
+ //
+ // A continuous pan will use the target pane's duration to pan all intermediate
+ // panes. To use the target's pane duration for each intermediate pane, then
+ // set the "quick" parameter to "false".
+
+ var w = args.wrap,
+ p = args.rotator.panes,
+ len = p.length,
+ z = len,
+ j = args.current.idx,
+ k = args.next.idx,
+ nw = Math.abs(k - j),
+ ww = Math.abs((len - Math.max(j, k)) + Math.min(j, k)) % len,
+ _forward = j < k,
+ _dir = LEFT,
+ _pans = [],
+ _nodes = [],
+ _duration = args.duration;
+
+ // default to pan left, but check if we should pan right.
+ // need to take into account wrapping.
+ if((!w && !_forward) || (w && (_forward && nw > ww || !_forward && nw < ww))){
+ _dir = RIGHT;
+ }
+
+ if(args.continuous){
+ // if continuous pans are quick, then divide the duration by the number of panes
+ if(args.quick){
+ _duration = Math.round(_duration / (w ? Math.min(ww, nw) : nw));
+ }
+
+ // set the current pane's z-index
+ _setZindex(p[j].node, z--);
+
+ var f = (_dir == LEFT);
+
+ // loop and set z-indexes and get all pan animations
+ while(1){
+ // set the current pane
+ var i = j;
+
+ // increment/decrement the next pane's index
+ if(f){
+ if(++j >= len){
+ j = 0;
+ }
+ }else{
+ if(--j < 0){
+ j = len - 1;
+ }
+ }
+
+ var x = p[i],
+ y = p[j];
+
+ // set next pane's z-index
+ _setZindex(y.node, z--);
+
+ // build the pan animation
+ _pans.push(_pan(_dir, d.mixin({
+ easing: function(m){ return m; } // continuous gets a linear easing by default
+ }, args, {
+ current: x,
+ next: y,
+ duration: _duration
+ })));
+
+ // if we're done, then break out of the loop
+ if((f && j == k) || (!f && j == k)){
+ break;
+ }
+
+ // this must come after the break... we don't want the last pane to get it's
+ // styles reset.
+ _nodes.push(y.node);
+ }
+
+ // build the chained animation of all pan animations
+ var _anim = d.fx.chain(_pans),
+
+ // clean up styles when the chained animation finishes
+ h = d.connect(_anim, "onEnd", function(){
+ d.disconnect(h);
+ d.forEach(_nodes, function(q){
+ d.style(q, {
+ display: "none",
+ left: 0,
+ opacity: 1,
+ top: 0,
+ zIndex: 0
+ });
+ });
+ });
+
+ return _anim;
+ }
+
+ // we're not continuous, so just return a normal pan animation
+ return _pan(_dir, args); /*dojo.Animation*/
+ },
+
+ panDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the top.
+ return _pan(DOWN, args); /*dojo.Animation*/
+ },
+
+ panRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the right.
+ return _pan(RIGHT, args); /*dojo.Animation*/
+ },
+
+ panUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the bottom.
+ return _pan(UP, args); /*dojo.Animation*/
+ },
+
+ panLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the left.
+ return _pan(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/rotator/PanFade.js b/js/dojo-1.6/dojox/widget/rotator/PanFade.js new file mode 100644 index 0000000..6a8e82d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/PanFade.js @@ -0,0 +1,222 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.rotator.PanFade"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.PanFade"] = true;
+dojo.provide("dojox.widget.rotator.PanFade");
+dojo.require("dojo.fx");
+
+(function(d){
+
+ // Constants used to identify which edge the pane pans in from.
+ var DOWN = 0,
+ RIGHT = 1,
+ UP = 2,
+ LEFT = 3;
+
+ function _pan(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var j = {
+ node: args.current.node,
+ duration: args.duration,
+ easing: args.easing
+ },
+ k = {
+ node: args.next.node,
+ duration: args.duration,
+ easing: args.easing
+ },
+ r = args.rotatorBox,
+ m = type % 2,
+ a = m ? "left" : "top",
+ s = (m ? r.w : r.h) * (type < 2 ? -1 : 1),
+ p = {},
+ q = {};
+
+ d.style(k.node, {
+ display: "",
+ opacity: 0
+ });
+
+ p[a] = {
+ start: 0,
+ end: -s
+ };
+
+ q[a] = {
+ start: s,
+ end: 0
+ };
+
+ return d.fx.combine([ /*dojo.Animation*/
+ d.animateProperty(d.mixin({ properties: p }, j)),
+ d.fadeOut(j),
+ d.animateProperty(d.mixin({ properties: q }, k)),
+ d.fadeIn(k)
+ ]);
+ }
+
+ function _setZindex(/*DomNode*/n, /*int*/z){
+ // summary:
+ // Helper function for continuously panning.
+ d.style(n, "zIndex", z);
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ panFade: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that either pans left or right to the next pane.
+ // The actual direction depends on the order of the panes.
+ //
+ // If panning forward from index 1 to 3, it will perform a pan left. If panning
+ // backwards from 5 to 1, then it will perform a pan right.
+ //
+ // If the parameter "continuous" is set to true, it will return an animation
+ // chain of several pan animations of each intermediate pane panning. For
+ // example, if you pan forward from 1 to 3, it will return an animation panning
+ // left from 1 to 2 and then 2 to 3.
+ //
+ // If an easing is specified, it will be applied to each pan transition. For
+ // example, if you are panning from pane 1 to pane 5 and you set the easing to
+ // "dojo.fx.easing.elasticInOut", then it will "wobble" 5 times, once for each
+ // pan transition.
+ //
+ // If the parameter "wrap" is set to true, it will pan to the next pane using
+ // the shortest distance in the array of panes. For example, if there are 6
+ // panes, then panning from 5 to 1 will pan forward (left) from pane 5 to 6 and
+ // 6 to 1. If the distance is the same either going forward or backwards, then
+ // it will always pan forward (left).
+ //
+ // A continuous pan will use the target pane's duration to pan all intermediate
+ // panes. To use the target's pane duration for each intermediate pane, then
+ // set the "quick" parameter to "false".
+
+ var w = args.wrap,
+ p = args.rotator.panes,
+ len = p.length,
+ z = len,
+ j = args.current.idx,
+ k = args.next.idx,
+ nw = Math.abs(k - j),
+ ww = Math.abs((len - Math.max(j, k)) + Math.min(j, k)) % len,
+ _forward = j < k,
+ _dir = LEFT,
+ _pans = [],
+ _nodes = [],
+ _duration = args.duration;
+
+ // default to pan left, but check if we should pan right.
+ // need to take into account wrapping.
+ if((!w && !_forward) || (w && (_forward && nw > ww || !_forward && nw < ww))){
+ _dir = RIGHT;
+ }
+
+ if(args.continuous){
+ // if continuous pans are quick, then divide the duration by the number of panes
+ if(args.quick){
+ _duration = Math.round(_duration / (w ? Math.min(ww, nw) : nw));
+ }
+
+ // set the current pane's z-index
+ _setZindex(p[j].node, z--);
+
+ var f = (_dir == LEFT);
+
+ // loop and set z-indexes and get all pan animations
+ while(1){
+ // set the current pane
+ var i = j;
+
+ // increment/decrement the next pane's index
+ if(f){
+ if(++j >= len){
+ j = 0;
+ }
+ }else{
+ if(--j < 0){
+ j = len - 1;
+ }
+ }
+
+ var x = p[i],
+ y = p[j];
+
+ // set next pane's z-index
+ _setZindex(y.node, z--);
+
+ // build the pan animation
+ _pans.push(_pan(_dir, d.mixin({
+ easing: function(m){ return m; } // continuous gets a linear easing by default
+ }, args, {
+ current: x,
+ next: y,
+ duration: _duration
+ })));
+
+ // if we're done, then break out of the loop
+ if((f && j == k) || (!f && j == k)){
+ break;
+ }
+
+ // this must come after the break... we don't want the last pane to get it's
+ // styles reset.
+ _nodes.push(y.node);
+ }
+
+ // build the chained animation of all pan animations
+ var _anim = d.fx.chain(_pans),
+
+ // clean up styles when the chained animation finishes
+ h = d.connect(_anim, "onEnd", function(){
+ d.disconnect(h);
+ d.forEach(_nodes, function(q){
+ d.style(q, {
+ display: "none",
+ left: 0,
+ opacity: 1,
+ top: 0,
+ zIndex: 0
+ });
+ });
+ });
+
+ return _anim;
+ }
+
+ // we're not continuous, so just return a normal pan animation
+ return _pan(_dir, args); /*dojo.Animation*/
+ },
+
+ panFadeDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the top.
+ return _pan(DOWN, args); /*dojo.Animation*/
+ },
+
+ panFadeRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the right.
+ return _pan(RIGHT, args); /*dojo.Animation*/
+ },
+
+ panFadeUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the bottom.
+ return _pan(UP, args); /*dojo.Animation*/
+ },
+
+ panFadeLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the left.
+ return _pan(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/rotator/PanFade.xd.js b/js/dojo-1.6/dojox/widget/rotator/PanFade.xd.js new file mode 100644 index 0000000..b1ebcce --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/PanFade.xd.js @@ -0,0 +1,227 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.rotator.PanFade"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.rotator.PanFade"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.PanFade"] = true;
+dojo.provide("dojox.widget.rotator.PanFade");
+dojo.require("dojo.fx");
+
+(function(d){
+
+ // Constants used to identify which edge the pane pans in from.
+ var DOWN = 0,
+ RIGHT = 1,
+ UP = 2,
+ LEFT = 3;
+
+ function _pan(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var j = {
+ node: args.current.node,
+ duration: args.duration,
+ easing: args.easing
+ },
+ k = {
+ node: args.next.node,
+ duration: args.duration,
+ easing: args.easing
+ },
+ r = args.rotatorBox,
+ m = type % 2,
+ a = m ? "left" : "top",
+ s = (m ? r.w : r.h) * (type < 2 ? -1 : 1),
+ p = {},
+ q = {};
+
+ d.style(k.node, {
+ display: "",
+ opacity: 0
+ });
+
+ p[a] = {
+ start: 0,
+ end: -s
+ };
+
+ q[a] = {
+ start: s,
+ end: 0
+ };
+
+ return d.fx.combine([ /*dojo.Animation*/
+ d.animateProperty(d.mixin({ properties: p }, j)),
+ d.fadeOut(j),
+ d.animateProperty(d.mixin({ properties: q }, k)),
+ d.fadeIn(k)
+ ]);
+ }
+
+ function _setZindex(/*DomNode*/n, /*int*/z){
+ // summary:
+ // Helper function for continuously panning.
+ d.style(n, "zIndex", z);
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ panFade: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that either pans left or right to the next pane.
+ // The actual direction depends on the order of the panes.
+ //
+ // If panning forward from index 1 to 3, it will perform a pan left. If panning
+ // backwards from 5 to 1, then it will perform a pan right.
+ //
+ // If the parameter "continuous" is set to true, it will return an animation
+ // chain of several pan animations of each intermediate pane panning. For
+ // example, if you pan forward from 1 to 3, it will return an animation panning
+ // left from 1 to 2 and then 2 to 3.
+ //
+ // If an easing is specified, it will be applied to each pan transition. For
+ // example, if you are panning from pane 1 to pane 5 and you set the easing to
+ // "dojo.fx.easing.elasticInOut", then it will "wobble" 5 times, once for each
+ // pan transition.
+ //
+ // If the parameter "wrap" is set to true, it will pan to the next pane using
+ // the shortest distance in the array of panes. For example, if there are 6
+ // panes, then panning from 5 to 1 will pan forward (left) from pane 5 to 6 and
+ // 6 to 1. If the distance is the same either going forward or backwards, then
+ // it will always pan forward (left).
+ //
+ // A continuous pan will use the target pane's duration to pan all intermediate
+ // panes. To use the target's pane duration for each intermediate pane, then
+ // set the "quick" parameter to "false".
+
+ var w = args.wrap,
+ p = args.rotator.panes,
+ len = p.length,
+ z = len,
+ j = args.current.idx,
+ k = args.next.idx,
+ nw = Math.abs(k - j),
+ ww = Math.abs((len - Math.max(j, k)) + Math.min(j, k)) % len,
+ _forward = j < k,
+ _dir = LEFT,
+ _pans = [],
+ _nodes = [],
+ _duration = args.duration;
+
+ // default to pan left, but check if we should pan right.
+ // need to take into account wrapping.
+ if((!w && !_forward) || (w && (_forward && nw > ww || !_forward && nw < ww))){
+ _dir = RIGHT;
+ }
+
+ if(args.continuous){
+ // if continuous pans are quick, then divide the duration by the number of panes
+ if(args.quick){
+ _duration = Math.round(_duration / (w ? Math.min(ww, nw) : nw));
+ }
+
+ // set the current pane's z-index
+ _setZindex(p[j].node, z--);
+
+ var f = (_dir == LEFT);
+
+ // loop and set z-indexes and get all pan animations
+ while(1){
+ // set the current pane
+ var i = j;
+
+ // increment/decrement the next pane's index
+ if(f){
+ if(++j >= len){
+ j = 0;
+ }
+ }else{
+ if(--j < 0){
+ j = len - 1;
+ }
+ }
+
+ var x = p[i],
+ y = p[j];
+
+ // set next pane's z-index
+ _setZindex(y.node, z--);
+
+ // build the pan animation
+ _pans.push(_pan(_dir, d.mixin({
+ easing: function(m){ return m; } // continuous gets a linear easing by default
+ }, args, {
+ current: x,
+ next: y,
+ duration: _duration
+ })));
+
+ // if we're done, then break out of the loop
+ if((f && j == k) || (!f && j == k)){
+ break;
+ }
+
+ // this must come after the break... we don't want the last pane to get it's
+ // styles reset.
+ _nodes.push(y.node);
+ }
+
+ // build the chained animation of all pan animations
+ var _anim = d.fx.chain(_pans),
+
+ // clean up styles when the chained animation finishes
+ h = d.connect(_anim, "onEnd", function(){
+ d.disconnect(h);
+ d.forEach(_nodes, function(q){
+ d.style(q, {
+ display: "none",
+ left: 0,
+ opacity: 1,
+ top: 0,
+ zIndex: 0
+ });
+ });
+ });
+
+ return _anim;
+ }
+
+ // we're not continuous, so just return a normal pan animation
+ return _pan(_dir, args); /*dojo.Animation*/
+ },
+
+ panFadeDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the top.
+ return _pan(DOWN, args); /*dojo.Animation*/
+ },
+
+ panFadeRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the right.
+ return _pan(RIGHT, args); /*dojo.Animation*/
+ },
+
+ panFadeUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the bottom.
+ return _pan(UP, args); /*dojo.Animation*/
+ },
+
+ panFadeLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that pans in the next rotator pane from the left.
+ return _pan(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/rotator/Slide.js b/js/dojo-1.6/dojox/widget/rotator/Slide.js new file mode 100644 index 0000000..5208017 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Slide.js @@ -0,0 +1,72 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.rotator.Slide"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Slide"] = true;
+dojo.provide("dojox.widget.rotator.Slide");
+
+(function(d){
+
+ // Constants used to identify which edge the pane slides in from.
+ var DOWN = 0,
+ RIGHT = 1,
+ UP = 2,
+ LEFT = 3;
+
+ function _slide(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var node = args.node = args.next.node,
+ r = args.rotatorBox,
+ m = type % 2,
+ s = (m ? r.w : r.h) * (type < 2 ? -1 : 1);
+
+ d.style(node, {
+ display: "",
+ zIndex: (d.style(args.current.node, "zIndex") || 1) + 1
+ });
+
+ if(!args.properties){
+ args.properties = {};
+ }
+ args.properties[m ? "left" : "top"] = {
+ start: s,
+ end: 0
+ };
+
+ return d.animateProperty(args); /*dojo.Animation*/
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ slideDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the top.
+ return _slide(DOWN, args); /*dojo.Animation*/
+ },
+
+ slideRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the right.
+ return _slide(RIGHT, args); /*dojo.Animation*/
+ },
+
+ slideUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the bottom.
+ return _slide(UP, args); /*dojo.Animation*/
+ },
+
+ slideLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the left.
+ return _slide(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/rotator/Slide.xd.js b/js/dojo-1.6/dojox/widget/rotator/Slide.xd.js new file mode 100644 index 0000000..306184d --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Slide.xd.js @@ -0,0 +1,76 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.rotator.Slide"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.rotator.Slide"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Slide"] = true;
+dojo.provide("dojox.widget.rotator.Slide");
+
+(function(d){
+
+ // Constants used to identify which edge the pane slides in from.
+ var DOWN = 0,
+ RIGHT = 1,
+ UP = 2,
+ LEFT = 3;
+
+ function _slide(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var node = args.node = args.next.node,
+ r = args.rotatorBox,
+ m = type % 2,
+ s = (m ? r.w : r.h) * (type < 2 ? -1 : 1);
+
+ d.style(node, {
+ display: "",
+ zIndex: (d.style(args.current.node, "zIndex") || 1) + 1
+ });
+
+ if(!args.properties){
+ args.properties = {};
+ }
+ args.properties[m ? "left" : "top"] = {
+ start: s,
+ end: 0
+ };
+
+ return d.animateProperty(args); /*dojo.Animation*/
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ slideDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the top.
+ return _slide(DOWN, args); /*dojo.Animation*/
+ },
+
+ slideRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the right.
+ return _slide(RIGHT, args); /*dojo.Animation*/
+ },
+
+ slideUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the bottom.
+ return _slide(UP, args); /*dojo.Animation*/
+ },
+
+ slideLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that slides in the next rotator pane from the left.
+ return _slide(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/rotator/ThumbnailController.js b/js/dojo-1.6/dojox/widget/rotator/ThumbnailController.js new file mode 100644 index 0000000..22282d0 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/ThumbnailController.js @@ -0,0 +1,107 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.rotator.ThumbnailController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.ThumbnailController"] = true;
+dojo.provide("dojox.widget.rotator.ThumbnailController");
+
+(function(d){
+
+ var _css = "dojoxRotatorThumb",
+ _selected = _css + "Selected";
+
+ d.declare("dojox.widget.rotator.ThumbnailController", null, {
+ // summary:
+ // A rotator controller that displays thumbnails of each rotator pane.
+ //
+ // description:
+ // The ThumbnailController will look at each of the rotator's panes and
+ // only if the node is an <img> tag, then it will create an thumbnail of
+ // the pane's image using the <img> tag's "thumbsrc" or "src" attribute.
+ //
+ // The size of the thumbnails and the style of the selected thumbnail is
+ // controlled using CSS.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.Rotator" jsId="myRotator">
+ // | <img src="/path/to/image1.jpg" thumbsrc="/path/to/thumb1.jpg" alt="Image 1"/>
+ // | <img src="/path/to/image2.jpg" thumbsrc="/path/to/thumb2.jpg" alt="Image 2"/>
+ // | </div>
+ // | <div dojoType="dojox.widget.rotator.ThumbnailController" rotator="myRotator"></div>
+
+ // rotator: dojox.widget.Rotator
+ // An instance of a Rotator widget.
+ rotator: null,
+
+ constructor: function(/*Object*/params, /*DomNode|string*/node){
+ // summary:
+ // Initializes the thumbnails and connect to the rotator.
+
+ d.mixin(this, params);
+
+ this._domNode = node;
+
+ // check if we have a valid rotator
+ var r = this.rotator;
+ if(r){
+ // remove all of the controller's child nodes just in case
+ while(node.firstChild){
+ node.removeChild(node.firstChild);
+ }
+
+ for(var i=0; i<r.panes.length; i++){
+ var n = r.panes[i].node,
+ s = d.attr(n, "thumbsrc") || d.attr(n, "src"),
+ t = d.attr(n, "alt") || "";
+
+ if(/img/i.test(n.tagName)){
+ (function(j){
+ d.create("a", {
+ classname: _css + ' ' + _css + j + ' ' + (j == r.idx ? _selected : ""),
+ href: s,
+ onclick: function(e){
+ d.stopEvent(e);
+ if(r){
+ r.control.apply(r, ["go", j]);
+ }
+ },
+ title: t,
+ innerHTML: '<img src="' + s + '" alt="' + t + '"/>'
+ }, node);
+ })(i);
+ }
+ }
+
+ this._con = d.connect(r, "onUpdate", this, "_onUpdate");
+ }
+ },
+
+ destroy: function(){
+ // summary:
+ // Disconnect from the rotator.
+
+ d.disconnect(this._con);
+ d.destroy(this._domNode);
+ },
+
+ _onUpdate: function(/*string*/type){
+ // summary:
+ // Updates various pager controls when the rotator updates.
+
+ var r = this.rotator; // no need to test if this is null since _onUpdate is only fired by the rotator
+ if(type == "onAfterTransition"){
+ var n = d.query('.' + _css, this._domNode).removeClass(_selected);
+ if(r.idx < n.length){
+ d.addClass(n[r.idx], _selected);
+ }
+ }
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/rotator/ThumbnailController.xd.js b/js/dojo-1.6/dojox/widget/rotator/ThumbnailController.xd.js new file mode 100644 index 0000000..5d251b4 --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/ThumbnailController.xd.js @@ -0,0 +1,111 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.rotator.ThumbnailController"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.rotator.ThumbnailController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.ThumbnailController"] = true;
+dojo.provide("dojox.widget.rotator.ThumbnailController");
+
+(function(d){
+
+ var _css = "dojoxRotatorThumb",
+ _selected = _css + "Selected";
+
+ d.declare("dojox.widget.rotator.ThumbnailController", null, {
+ // summary:
+ // A rotator controller that displays thumbnails of each rotator pane.
+ //
+ // description:
+ // The ThumbnailController will look at each of the rotator's panes and
+ // only if the node is an <img> tag, then it will create an thumbnail of
+ // the pane's image using the <img> tag's "thumbsrc" or "src" attribute.
+ //
+ // The size of the thumbnails and the style of the selected thumbnail is
+ // controlled using CSS.
+ //
+ // example:
+ // | <div dojoType="dojox.widget.Rotator" jsId="myRotator">
+ // | <img src="/path/to/image1.jpg" thumbsrc="/path/to/thumb1.jpg" alt="Image 1"/>
+ // | <img src="/path/to/image2.jpg" thumbsrc="/path/to/thumb2.jpg" alt="Image 2"/>
+ // | </div>
+ // | <div dojoType="dojox.widget.rotator.ThumbnailController" rotator="myRotator"></div>
+
+ // rotator: dojox.widget.Rotator
+ // An instance of a Rotator widget.
+ rotator: null,
+
+ constructor: function(/*Object*/params, /*DomNode|string*/node){
+ // summary:
+ // Initializes the thumbnails and connect to the rotator.
+
+ d.mixin(this, params);
+
+ this._domNode = node;
+
+ // check if we have a valid rotator
+ var r = this.rotator;
+ if(r){
+ // remove all of the controller's child nodes just in case
+ while(node.firstChild){
+ node.removeChild(node.firstChild);
+ }
+
+ for(var i=0; i<r.panes.length; i++){
+ var n = r.panes[i].node,
+ s = d.attr(n, "thumbsrc") || d.attr(n, "src"),
+ t = d.attr(n, "alt") || "";
+
+ if(/img/i.test(n.tagName)){
+ (function(j){
+ d.create("a", {
+ classname: _css + ' ' + _css + j + ' ' + (j == r.idx ? _selected : ""),
+ href: s,
+ onclick: function(e){
+ d.stopEvent(e);
+ if(r){
+ r.control.apply(r, ["go", j]);
+ }
+ },
+ title: t,
+ innerHTML: '<img src="' + s + '" alt="' + t + '"/>'
+ }, node);
+ })(i);
+ }
+ }
+
+ this._con = d.connect(r, "onUpdate", this, "_onUpdate");
+ }
+ },
+
+ destroy: function(){
+ // summary:
+ // Disconnect from the rotator.
+
+ d.disconnect(this._con);
+ d.destroy(this._domNode);
+ },
+
+ _onUpdate: function(/*string*/type){
+ // summary:
+ // Updates various pager controls when the rotator updates.
+
+ var r = this.rotator; // no need to test if this is null since _onUpdate is only fired by the rotator
+ if(type == "onAfterTransition"){
+ var n = d.query('.' + _css, this._domNode).removeClass(_selected);
+ if(r.idx < n.length){
+ d.addClass(n[r.idx], _selected);
+ }
+ }
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/widget/rotator/Wipe.js b/js/dojo-1.6/dojox/widget/rotator/Wipe.js new file mode 100644 index 0000000..11271fc --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Wipe.js @@ -0,0 +1,98 @@ +/*
+ 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
+*/
+
+
+if(!dojo._hasResource["dojox.widget.rotator.Wipe"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Wipe"] = true;
+dojo.provide("dojox.widget.rotator.Wipe");
+
+(function(d){
+
+ // Constants used to identify which clip edge is being wiped. The values are
+ // the index of the clip array that is changed during the animation.
+ var DOWN = 2,
+ RIGHT = 3,
+ UP = 0,
+ LEFT = 1;
+
+ function _clipArray(/*int*/type, /*int*/w, /*int*/h, /*number*/x){
+ // summary:
+ // Returns an array containing the down, right, up, and
+ // left clip region based on the type. If "x" is specified,
+ // then it is applied to the appropriate clipping edge.
+ var a = [0, w, 0, 0]; // default to the top edge
+ if(type == RIGHT){
+ a = [0, w, h, w];
+ }else if(type == UP){
+ a = [h, w, h, 0];
+ }else if(type == LEFT){
+ a = [0, 0, h, 0];
+ }
+ if(x != null){
+ a[type] = type == DOWN || type == LEFT ? x : (type % 2 ? w : h) - x;
+ }
+ return a; /*Array*/
+ }
+
+ function _setClip(/*DomNode*/n, /*int*/type, /*int*/w, /*int*/h, /*number*/x){
+ // summary:
+ // Sets the clip region of the node. If a type is passed in then we
+ // return a rect(), otherwise return "auto".
+ d.style(n, "clip", type == null ? "auto" : "rect(" + _clipArray(type, w, h, x).join("px,") + "px)");
+ }
+
+ function _wipe(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var node = args.next.node,
+ w = args.rotatorBox.w,
+ h = args.rotatorBox.h;
+
+ d.style(node, {
+ display: "",
+ zIndex: (d.style(args.current.node, "zIndex") || 1) + 1
+ });
+
+ _setClip(node, type, w, h);
+
+ return new d.Animation(d.mixin({ /*dojo.Animation*/
+ node: node,
+ curve: [0, type % 2 ? w : h],
+ onAnimate: function(x){
+ _setClip(node, type, w, h, parseInt(x));
+ }
+ }, args));
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ wipeDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the top.
+ return _wipe(DOWN, args); /*dojo.Animation*/
+ },
+
+ wipeRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the right.
+ return _wipe(RIGHT, args); /*dojo.Animation*/
+ },
+
+ wipeUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the bottom.
+ return _wipe(UP, args); /*dojo.Animation*/
+ },
+
+ wipeLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the left.
+ return _wipe(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/widget/rotator/Wipe.xd.js b/js/dojo-1.6/dojox/widget/rotator/Wipe.xd.js new file mode 100644 index 0000000..18cd4fc --- /dev/null +++ b/js/dojo-1.6/dojox/widget/rotator/Wipe.xd.js @@ -0,0 +1,102 @@ +/*
+ 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
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.widget.rotator.Wipe"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.widget.rotator.Wipe"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.widget.rotator.Wipe"] = true;
+dojo.provide("dojox.widget.rotator.Wipe");
+
+(function(d){
+
+ // Constants used to identify which clip edge is being wiped. The values are
+ // the index of the clip array that is changed during the animation.
+ var DOWN = 2,
+ RIGHT = 3,
+ UP = 0,
+ LEFT = 1;
+
+ function _clipArray(/*int*/type, /*int*/w, /*int*/h, /*number*/x){
+ // summary:
+ // Returns an array containing the down, right, up, and
+ // left clip region based on the type. If "x" is specified,
+ // then it is applied to the appropriate clipping edge.
+ var a = [0, w, 0, 0]; // default to the top edge
+ if(type == RIGHT){
+ a = [0, w, h, w];
+ }else if(type == UP){
+ a = [h, w, h, 0];
+ }else if(type == LEFT){
+ a = [0, 0, h, 0];
+ }
+ if(x != null){
+ a[type] = type == DOWN || type == LEFT ? x : (type % 2 ? w : h) - x;
+ }
+ return a; /*Array*/
+ }
+
+ function _setClip(/*DomNode*/n, /*int*/type, /*int*/w, /*int*/h, /*number*/x){
+ // summary:
+ // Sets the clip region of the node. If a type is passed in then we
+ // return a rect(), otherwise return "auto".
+ d.style(n, "clip", type == null ? "auto" : "rect(" + _clipArray(type, w, h, x).join("px,") + "px)");
+ }
+
+ function _wipe(/*int*/type, /*Object*/args){
+ // summary:
+ // Handles the preparation of the dom node and creates the dojo.Animation object.
+ var node = args.next.node,
+ w = args.rotatorBox.w,
+ h = args.rotatorBox.h;
+
+ d.style(node, {
+ display: "",
+ zIndex: (d.style(args.current.node, "zIndex") || 1) + 1
+ });
+
+ _setClip(node, type, w, h);
+
+ return new d.Animation(d.mixin({ /*dojo.Animation*/
+ node: node,
+ curve: [0, type % 2 ? w : h],
+ onAnimate: function(x){
+ _setClip(node, type, w, h, parseInt(x));
+ }
+ }, args));
+ }
+
+ d.mixin(dojox.widget.rotator, {
+ wipeDown: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the top.
+ return _wipe(DOWN, args); /*dojo.Animation*/
+ },
+
+ wipeRight: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the right.
+ return _wipe(RIGHT, args); /*dojo.Animation*/
+ },
+
+ wipeUp: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the bottom.
+ return _wipe(UP, args); /*dojo.Animation*/
+ },
+
+ wipeLeft: function(/*Object*/args){
+ // summary:
+ // Returns a dojo.Animation that wipes in the next rotator pane from the left.
+ return _wipe(LEFT, args); /*dojo.Animation*/
+ }
+ });
+
+})(dojo);
+
+}
+
+}};});
|
