require({cache:{ 'url:dojox/form/resources/VerticalRangeSlider.html':"
+
-
\n", 'dijit/form/HorizontalRule':function(){ define("dijit/form/HorizontalRule", [ "dojo/_base/declare", // declare "../_Widget", "../_TemplatedMixin" ], function(declare, _Widget, _TemplatedMixin){ /*===== var _Widget = dijit._Widget; var _TemplatedMixin = dijit._TemplatedMixin; =====*/ // module: // dijit/form/HorizontalRule // summary: // Hash marks for `dijit.form.HorizontalSlider` return declare("dijit.form.HorizontalRule", [_Widget, _TemplatedMixin], { // summary: // Hash marks for `dijit.form.HorizontalSlider` templateString: '
', // count: Integer // Number of hash marks to generate count: 3, // container: String // For HorizontalSlider, this is either "topDecoration" or "bottomDecoration", // and indicates whether this rule goes above or below the slider. container: "containerNode", // ruleStyle: String // CSS style to apply to individual hash marks ruleStyle: "", _positionPrefix: '
', _genHTML: function(pos){ return this._positionPrefix + pos + this._positionSuffix + this.ruleStyle + this._suffix; }, // _isHorizontal: [protected extension] Boolean // VerticalRule will override this... _isHorizontal: true, buildRendering: function(){ this.inherited(arguments); var innerHTML; if(this.count == 1){ innerHTML = this._genHTML(50, 0); }else{ var i; var interval = 100 / (this.count-1); if(!this._isHorizontal || this.isLeftToRight()){ innerHTML = this._genHTML(0, 0); for(i=1; i < this.count-1; i++){ innerHTML += this._genHTML(interval*i, i); } innerHTML += this._genHTML(100, this.count-1); }else{ innerHTML = this._genHTML(100, 0); for(i=1; i < this.count-1; i++){ innerHTML += this._genHTML(100-interval*i, i); } innerHTML += this._genHTML(0, this.count-1); } } this.domNode.innerHTML = innerHTML; } }); }); }, 'url:dojox/form/resources/HorizontalRangeSlider.html':"
-
+
\n", 'dijit/form/VerticalSlider':function(){ require({cache:{ 'url:dijit/form/templates/VerticalSlider.html':"
+
-
\n"}}); define("dijit/form/VerticalSlider", [ "dojo/_base/declare", // declare "./HorizontalSlider", "dojo/text!./templates/VerticalSlider.html" ], function(declare, HorizontalSlider, template){ /*===== var HorizontalSlider = dijit.form.HorizontalSlider; =====*/ // module: // dijit/form/VerticalSlider // summary: // A form widget that allows one to select a value with a vertically draggable handle return declare("dijit.form.VerticalSlider", HorizontalSlider, { // summary: // A form widget that allows one to select a value with a vertically draggable handle templateString: template, _mousePixelCoord: "pageY", _pixelCount: "h", _startingPixelCoord: "y", _handleOffsetCoord: "top", _progressPixelSize: "height", // _descending: Boolean // Specifies if the slider values go from high-on-top (true), or low-on-top (false) // TODO: expose this in 1.2 - the css progress/remaining bar classes need to be reversed _descending: true, _isReversed: function(){ // summary: // Overrides HorizontalSlider._isReversed. // Indicates if values are high on top (with low numbers on the bottom). return this._descending; } }); }); }, 'dojox/form/RangeSlider':function(){ require({cache:{ 'url:dojox/form/resources/HorizontalRangeSlider.html':"
-
+
\n", 'url:dojox/form/resources/VerticalRangeSlider.html':"
+
-
\n"}}); define("dojox/form/RangeSlider", [ "dojo/_base/declare", "dojo/_base/lang", "dojo/_base/array", "dojo/_base/fx", "dojo/_base/event", "dojo/_base/sniff", "dojo/dom-style", "dojo/dom-geometry", "dojo/keys", "dijit", "dojo/dnd/Mover", "dojo/dnd/Moveable", "dojo/text!./resources/HorizontalRangeSlider.html", "dojo/text!./resources/VerticalRangeSlider.html", "dijit/form/HorizontalSlider", "dijit/form/VerticalSlider", "dijit/form/_FormValueWidget", "dijit/focus", "dojo/fx", "dojox/fx" // unused? ], function(declare, lang, array, fx, event, has, domStyle, domGeometry, keys, dijit, Mover, Moveable, hTemplate, vTemplate, HorizontalSlider, VerticalSlider, FormValueWidget, FocusManager, fxUtils){ // make these functions once: var sortReversed = function(a, b){ return b - a; }, sortForward = function(a, b){ return a - b; } ; lang.getObject("form", true, dojox); /*===== hTemplate = dijit.form.HorizontalSlider; vTemplate = dijit.form.VerticalSlider; =====*/ var RangeSliderMixin = declare("dojox.form._RangeSliderMixin", null, { value: [0,100], postMixInProperties: function(){ this.inherited(arguments); this.value = array.map(this.value, function(i){ return parseInt(i, 10); }); }, postCreate: function(){ this.inherited(arguments); // we sort the values! // TODO: re-think, how to set the value this.value.sort(this._isReversed() ? sortReversed : sortForward); // define a custom constructor for a SliderMoverMax that points back to me var _self = this; var mover = declare(SliderMoverMax, { constructor: function(){ this.widget = _self; } }); this._movableMax = new Moveable(this.sliderHandleMax,{ mover: mover }); this.focusNodeMax.setAttribute("aria-valuemin", this.minimum); this.focusNodeMax.setAttribute("aria-valuemax", this.maximum); // a dnd for the bar! var barMover = declare(SliderBarMover, { constructor: function(){ this.widget = _self; } }); this._movableBar = new Moveable(this.progressBar,{ mover: barMover }); }, destroy: function(){ this.inherited(arguments); this._movableMax.destroy(); this._movableBar.destroy(); }, _onKeyPress: function(/*Event*/ e){ if(this.disabled || this.readOnly || e.altKey || e.ctrlKey){ return; } var useMaxValue = e.target === this.sliderHandleMax; var barFocus = e.target === this.progressBar; var k = lang.delegate(keys, this.isLeftToRight() ? {PREV_ARROW: keys.LEFT_ARROW, NEXT_ARROW: keys.RIGHT_ARROW} : {PREV_ARROW: keys.RIGHT_ARROW, NEXT_ARROW: keys.LEFT_ARROW}); var delta = 0; var down = false; switch(e.keyCode){ case k.HOME : this._setValueAttr(this.minimum, true, useMaxValue);event.stop(e);return; case k.END : this._setValueAttr(this.maximum, true, useMaxValue);event.stop(e);return; case k.PREV_ARROW : case k.DOWN_ARROW : down = true; case k.NEXT_ARROW : case k.UP_ARROW : delta = 1; break; case k.PAGE_DOWN : down = true; case k.PAGE_UP : delta = this.pageIncrement; break; default : this.inherited(arguments);return; } if(down){delta = -delta;} if(delta){ if(barFocus){ this._bumpValue([ { change: delta, useMaxValue: false }, { change: delta, useMaxValue: true } ]); }else{ this._bumpValue(delta, useMaxValue); } event.stop(e); } }, _onHandleClickMax: function(e){ if(this.disabled || this.readOnly){ return; } if(!has("ie")){ // make sure you get focus when dragging the handle // (but don't do on IE because it causes a flicker on mouse up (due to blur then focus) FocusManager.focus(this.sliderHandleMax); } event.stop(e); }, _onClkIncBumper: function(){ this._setValueAttr(this._descending === false ? this.minimum : this.maximum, true, true); }, _bumpValue: function(signedChange, useMaxValue){ // we pass an array to _setValueAttr when signedChange is an array var value = lang.isArray(signedChange) ? [ this._getBumpValue(signedChange[0].change, signedChange[0].useMaxValue), this._getBumpValue(signedChange[1].change, signedChange[1].useMaxValue) ] : this._getBumpValue(signedChange, useMaxValue) this._setValueAttr(value, true, useMaxValue); }, _getBumpValue: function(signedChange, useMaxValue){ var idx = useMaxValue ? 1 : 0; if(this._isReversed()){ idx = 1 - idx; } var s = domStyle.getComputedStyle(this.sliderBarContainer), c = domGeometry.getContentBox(this.sliderBarContainer, s), count = this.discreteValues, myValue = this.value[idx] ; if(count <= 1 || count == Infinity){ count = c[this._pixelCount]; } count--; var value = (myValue - this.minimum) * count / (this.maximum - this.minimum) + signedChange; if(value < 0){ value = 0; } if(value > count){ value = count; } return value * (this.maximum - this.minimum) / count + this.minimum; }, _onBarClick: function(e){ if(this.disabled || this.readOnly){ return; } if(!has("ie")){ // make sure you get focus when dragging the handle // (but don't do on IE because it causes a flicker on mouse up (due to blur then focus) FocusManager.focus(this.progressBar); } event.stop(e); }, _onRemainingBarClick: function(e){ if(this.disabled || this.readOnly){ return; } if(!has("ie")){ // make sure you get focus when dragging the handle // (but don't do on IE because it causes a flicker on mouse up (due to blur then focus) FocusManager.focus(this.progressBar); } // now we set the min/max-value of the slider! var abspos = domGeometry.position(this.sliderBarContainer, true), bar = domGeometry.position(this.progressBar, true), mousePos = e[this._mousePixelCoord], leftPos = bar[this._startingPixelCoord], rightPos = leftPos + bar[this._pixelCount], isMaxVal = this._isReversed() ? mousePos <= leftPos : mousePos >= rightPos, p = this._isReversed() ? (abspos[this._pixelCount] - mousePos + abspos[this._startingPixelCoord]) : (mousePos - abspos[this._startingPixelCoord]) ; this._setPixelValue(p, abspos[this._pixelCount], true, isMaxVal); event.stop(e); }, _setPixelValue: function(/*Number*/ pixelValue, /*Number*/ maxPixels, /*Boolean*/ priorityChange, /*Boolean*/ isMaxVal){ if(this.disabled || this.readOnly){ return; } var myValue = this._getValueByPixelValue(pixelValue, maxPixels); this._setValueAttr(myValue, priorityChange, isMaxVal); }, _getValueByPixelValue: function(/*Number*/ pixelValue, /*Number*/ maxPixels){ pixelValue = pixelValue < 0 ? 0 : maxPixels < pixelValue ? maxPixels : pixelValue; var count = this.discreteValues; if(count <= 1 || count == Infinity){ count = maxPixels; } count--; var pixelsPerValue = maxPixels / count; var wholeIncrements = Math.round(pixelValue / pixelsPerValue); return (this.maximum-this.minimum)*wholeIncrements/count + this.minimum; }, _setValueAttr: function(/*Array or Number*/ value, /*Boolean, optional*/ priorityChange, /*Boolean, optional*/ isMaxVal){ // we pass an array, when we move the slider with the bar var actValue = this.value; if(!lang.isArray(value)){ if(isMaxVal){ if(this._isReversed()){ actValue[0] = value; }else{ actValue[1] = value; } }else{ if(this._isReversed()){ actValue[1] = value; }else{ actValue[0] = value; } } }else{ actValue = value; } // we have to reset this values. don't know the reason for that this._lastValueReported = ""; this.valueNode.value = this.value = value = actValue; this.focusNode.setAttribute("aria-valuenow", actValue[0]); this.focusNodeMax.setAttribute("aria-valuenow", actValue[1]); this.value.sort(this._isReversed() ? sortReversed : sortForward); // not calling the _setValueAttr-function of Slider, but the super-super-class (needed for the onchange-event!) FormValueWidget.prototype._setValueAttr.apply(this, arguments); this._printSliderBar(priorityChange, isMaxVal); }, _printSliderBar: function(priorityChange, isMaxVal){ var percentMin = (this.value[0] - this.minimum) / (this.maximum - this.minimum); var percentMax = (this.value[1] - this.minimum) / (this.maximum - this.minimum); var percentMinSave = percentMin; if(percentMin > percentMax){ percentMin = percentMax; percentMax = percentMinSave; } var sliderHandleVal = this._isReversed() ? ((1-percentMin)*100) : (percentMin * 100); var sliderHandleMaxVal = this._isReversed() ? ((1-percentMax)*100) : (percentMax * 100); var progressBarVal = this._isReversed() ? ((1-percentMax)*100) : (percentMin * 100); if(priorityChange && this.slideDuration > 0 && this.progressBar.style[this._progressPixelSize]){ // animate the slider var percent = isMaxVal ? percentMax : percentMin; var _this = this; var props = {}; var start = parseFloat(this.progressBar.style[this._handleOffsetCoord]); var duration = this.slideDuration / 10; // * (percent-start/100); if(duration === 0){ return; } if(duration < 0){ duration = 0 - duration; } var propsHandle = {}; var propsHandleMax = {}; var propsBar = {}; // hui, a lot of animations :-) propsHandle[this._handleOffsetCoord] = { start: this.sliderHandle.style[this._handleOffsetCoord], end: sliderHandleVal, units:"%"}; propsHandleMax[this._handleOffsetCoord] = { start: this.sliderHandleMax.style[this._handleOffsetCoord], end: sliderHandleMaxVal, units:"%"}; propsBar[this._handleOffsetCoord] = { start: this.progressBar.style[this._handleOffsetCoord], end: progressBarVal, units:"%"}; propsBar[this._progressPixelSize] = { start: this.progressBar.style[this._progressPixelSize], end: (percentMax - percentMin) * 100, units:"%"}; var animHandle = fx.animateProperty({node: this.sliderHandle,duration: duration, properties: propsHandle}); var animHandleMax = fx.animateProperty({node: this.sliderHandleMax,duration: duration, properties: propsHandleMax}); var animBar = fx.animateProperty({node: this.progressBar,duration: duration, properties: propsBar}); var animCombine = fxUtils.combine([animHandle, animHandleMax, animBar]); animCombine.play(); }else{ this.sliderHandle.style[this._handleOffsetCoord] = sliderHandleVal + "%"; this.sliderHandleMax.style[this._handleOffsetCoord] = sliderHandleMaxVal + "%"; this.progressBar.style[this._handleOffsetCoord] = progressBarVal + "%"; this.progressBar.style[this._progressPixelSize] = ((percentMax - percentMin) * 100) + "%"; } } }); var SliderMoverMax = declare("dijit.form._SliderMoverMax", dijit.form._SliderMover, { onMouseMove: function(e){ var widget = this.widget; var abspos = widget._abspos; if(!abspos){ abspos = widget._abspos = domGeometry.position(widget.sliderBarContainer, true); widget._setPixelValue_ = lang.hitch(widget, "_setPixelValue"); widget._isReversed_ = widget._isReversed(); } var pixelValue = e[widget._mousePixelCoord] - abspos[widget._startingPixelCoord]; widget._setPixelValue_(widget._isReversed_ ? (abspos[widget._pixelCount]-pixelValue) : pixelValue, abspos[widget._pixelCount], false, true); }, destroy: function(e){ Mover.prototype.destroy.apply(this, arguments); var widget = this.widget; widget._abspos = null; widget._setValueAttr(widget.value, true); } }); var SliderBarMover = declare("dijit.form._SliderBarMover", Mover, { onMouseMove: function(e){ var widget = this.widget; if(widget.disabled || widget.readOnly){ return; } var abspos = widget._abspos; var bar = widget._bar; var mouseOffset = widget._mouseOffset; if(!abspos){ abspos = widget._abspos = domGeometry.position(widget.sliderBarContainer, true); widget._setPixelValue_ = lang.hitch(widget, "_setPixelValue"); widget._getValueByPixelValue_ = lang.hitch(widget, "_getValueByPixelValue"); widget._isReversed_ = widget._isReversed(); } if(!bar){ bar = widget._bar = domGeometry.position(widget.progressBar, true); } if(!mouseOffset){ mouseOffset = widget._mouseOffset = e[widget._mousePixelCoord] - bar[widget._startingPixelCoord]; } var pixelValueMin = e[widget._mousePixelCoord] - abspos[widget._startingPixelCoord] - mouseOffset, pixelValueMax = pixelValueMin + bar[widget._pixelCount]; // we don't narrow the slider when it reaches the bumper! // maybe there is a simpler way pixelValues = [pixelValueMin, pixelValueMax] ; pixelValues.sort(sortForward); if(pixelValues[0] <= 0){ pixelValues[0] = 0; pixelValues[1] = bar[widget._pixelCount]; } if(pixelValues[1] >= abspos[widget._pixelCount]){ pixelValues[1] = abspos[widget._pixelCount]; pixelValues[0] = abspos[widget._pixelCount] - bar[widget._pixelCount]; } // getting the real values by pixel var myValues = [ widget._getValueByPixelValue(widget._isReversed_ ? (abspos[widget._pixelCount] - pixelValues[0]) : pixelValues[0], abspos[widget._pixelCount]), widget._getValueByPixelValue(widget._isReversed_ ? (abspos[widget._pixelCount] - pixelValues[1]) : pixelValues[1], abspos[widget._pixelCount]) ]; // and setting the value of the widget widget._setValueAttr(myValues, false, false); }, destroy: function(){ Mover.prototype.destroy.apply(this, arguments); var widget = this.widget; widget._abspos = null; widget._bar = null; widget._mouseOffset = null; widget._setValueAttr(widget.value, true); } }); declare("dojox.form.HorizontalRangeSlider", [HorizontalSlider, RangeSliderMixin], { // summary: // A form widget that allows one to select a range with two horizontally draggable images templateString: hTemplate }); declare("dojox.form.VerticalRangeSlider", [VerticalSlider, RangeSliderMixin], { // summary: // A form widget that allows one to select a range with two vertically draggable images templateString: vTemplate }); return RangeSliderMixin; }); }, 'url:dijit/form/templates/VerticalSlider.html':"
+
-
\n", 'dijit/form/HorizontalRuleLabels':function(){ define("dijit/form/HorizontalRuleLabels", [ "dojo/_base/declare", // declare "dojo/number", // number.format "dojo/query", // query "./HorizontalRule" ], function(declare, number, query, HorizontalRule){ /*===== var HorizontalRule = dijit.form.HorizontalRule; =====*/ // module: // dijit/form/HorizontalRuleLabels // summary: // Labels for `dijit.form.HorizontalSlider` return declare("dijit.form.HorizontalRuleLabels", HorizontalRule, { // summary: // Labels for `dijit.form.HorizontalSlider` templateString: '
', // labelStyle: String // CSS style to apply to individual text labels labelStyle: "", // labels: String[]? // Array of text labels to render - evenly spaced from left-to-right or bottom-to-top. // Alternately, minimum and maximum can be specified, to get numeric labels. labels: [], // numericMargin: Integer // Number of generated numeric labels that should be rendered as '' on the ends when labels[] are not specified numericMargin: 0, // numericMinimum: Integer // Leftmost label value for generated numeric labels when labels[] are not specified minimum: 0, // numericMaximum: Integer // Rightmost label value for generated numeric labels when labels[] are not specified maximum: 1, // constraints: Object // pattern, places, lang, et al (see dojo.number) for generated numeric labels when labels[] are not specified constraints: {pattern:"#%"}, _positionPrefix: '
', _suffix: '
', _calcPosition: function(pos){ // summary: // Returns the value to be used in HTML for the label as part of the left: attribute // tags: // protected extension return pos; }, _genHTML: function(pos, ndx){ return this._positionPrefix + this._calcPosition(pos) + this._positionSuffix + this.labelStyle + this._labelPrefix + this.labels[ndx] + this._suffix; }, getLabels: function(){ // summary: // Overridable function to return array of labels to use for this slider. // Can specify a getLabels() method instead of a labels[] array, or min/max attributes. // tags: // protected extension // if the labels array was not specified directly, then see if
  • children were var labels = this.labels; if(!labels.length){ // for markup creation, labels are specified as child elements labels = query("> li", this.srcNodeRef).map(function(node){ return String(node.innerHTML); }); } this.srcNodeRef.innerHTML = ''; // if the labels were not specified directly and not as
  • children, then calculate numeric labels if(!labels.length && this.count > 1){ var start = this.minimum; var inc = (this.maximum - start) / (this.count-1); for(var i=0; i < this.count; i++){ labels.push((i < this.numericMargin || i >= (this.count-this.numericMargin)) ? '' : number.format(start, this.constraints)); start += inc; } } return labels; }, postMixInProperties: function(){ this.inherited(arguments); this.labels = this.getLabels(); this.count = this.labels.length; } }); }); }, 'dijit/dijit':function(){ define("dijit/dijit", [ ".", "./_base", "dojo/parser", "./_Widget", "./_TemplatedMixin", "./_Container", "./layout/_LayoutWidget", "./form/_FormWidget", "./form/_FormValueWidget" ], function(dijit){ // module: // dijit/dijit // summary: // A roll-up for common dijit methods // All the stuff in _base (these are the function that are guaranteed available without an explicit dojo.require) // And some other stuff that we tend to pull in all the time anyway return dijit; }); }, 'dijit/form/HorizontalSlider':function(){ require({cache:{ 'url:dijit/form/templates/HorizontalSlider.html':"
    -
    +
    \n"}}); define("dijit/form/HorizontalSlider", [ "dojo/_base/array", // array.forEach "dojo/_base/declare", // declare "dojo/dnd/move", "dojo/_base/event", // event.stop "dojo/_base/fx", // fx.animateProperty "dojo/dom-geometry", // domGeometry.position "dojo/dom-style", // domStyle.getComputedStyle "dojo/keys", // keys.DOWN_ARROW keys.END keys.HOME keys.LEFT_ARROW keys.PAGE_DOWN keys.PAGE_UP keys.RIGHT_ARROW keys.UP_ARROW "dojo/_base/lang", // lang.hitch "dojo/_base/sniff", // has("ie") has("mozilla") "dojo/dnd/Moveable", // Moveable "dojo/dnd/Mover", // Mover Mover.prototype.destroy.apply "dojo/query", // query "../registry", // registry.findWidgets "../focus", // focus.focus() "../typematic", "./Button", "./_FormValueWidget", "../_Container", "dojo/text!./templates/HorizontalSlider.html" ], function(array, declare, move, event, fx, domGeometry, domStyle, keys, lang, has, Moveable, Mover, query, registry, focus, typematic, Button, _FormValueWidget, _Container, template){ /*===== var Button = dijit.form.Button; var _FormValueWidget = dijit.form._FormValueWidget; var _Container = dijit._Container; =====*/ // module: // dijit/form/HorizontalSlider // summary: // A form widget that allows one to select a value with a horizontally draggable handle var _SliderMover = declare("dijit.form._SliderMover", Mover, { onMouseMove: function(e){ var widget = this.widget; var abspos = widget._abspos; if(!abspos){ abspos = widget._abspos = domGeometry.position(widget.sliderBarContainer, true); widget._setPixelValue_ = lang.hitch(widget, "_setPixelValue"); widget._isReversed_ = widget._isReversed(); } var pixelValue = e[widget._mousePixelCoord] - abspos[widget._startingPixelCoord]; widget._setPixelValue_(widget._isReversed_ ? (abspos[widget._pixelCount]-pixelValue) : pixelValue, abspos[widget._pixelCount], false); }, destroy: function(e){ Mover.prototype.destroy.apply(this, arguments); var widget = this.widget; widget._abspos = null; widget._setValueAttr(widget.value, true); } }); var HorizontalSlider = declare("dijit.form.HorizontalSlider", [_FormValueWidget, _Container], { // summary: // A form widget that allows one to select a value with a horizontally draggable handle templateString: template, // Overrides FormValueWidget.value to indicate numeric value value: 0, // showButtons: [const] Boolean // Show increment/decrement buttons at the ends of the slider? showButtons: true, // minimum:: [const] Integer // The minimum value the slider can be set to. minimum: 0, // maximum: [const] Integer // The maximum value the slider can be set to. maximum: 100, // discreteValues: Integer // If specified, indicates that the slider handle has only 'discreteValues' possible positions, // and that after dragging the handle, it will snap to the nearest possible position. // Thus, the slider has only 'discreteValues' possible values. // // For example, if minimum=10, maxiumum=30, and discreteValues=3, then the slider handle has // three possible positions, representing values 10, 20, or 30. // // If discreteValues is not specified or if it's value is higher than the number of pixels // in the slider bar, then the slider handle can be moved freely, and the slider's value will be // computed/reported based on pixel position (in this case it will likely be fractional, // such as 123.456789). discreteValues: Infinity, // pageIncrement: Integer // If discreteValues is also specified, this indicates the amount of clicks (ie, snap positions) // that the slider handle is moved via pageup/pagedown keys. // If discreteValues is not specified, it indicates the number of pixels. pageIncrement: 2, // clickSelect: Boolean // If clicking the slider bar changes the value or not clickSelect: true, // slideDuration: Number // The time in ms to take to animate the slider handle from 0% to 100%, // when clicking the slider bar to make the handle move. slideDuration: registry.defaultDuration, // Map widget attributes to DOMNode attributes. _setIdAttr: "", // Override _FormWidget which sends id to focusNode baseClass: "dijitSlider", // Apply CSS classes to up/down arrows and handle per mouse state cssStateNodes: { incrementButton: "dijitSliderIncrementButton", decrementButton: "dijitSliderDecrementButton", focusNode: "dijitSliderThumb" }, _mousePixelCoord: "pageX", _pixelCount: "w", _startingPixelCoord: "x", _handleOffsetCoord: "left", _progressPixelSize: "width", _onKeyUp: function(/*Event*/ e){ if(this.disabled || this.readOnly || e.altKey || e.ctrlKey || e.metaKey){ return; } this._setValueAttr(this.value, true); }, _onKeyPress: function(/*Event*/ e){ if(this.disabled || this.readOnly || e.altKey || e.ctrlKey || e.metaKey){ return; } switch(e.charOrCode){ case keys.HOME: this._setValueAttr(this.minimum, false); break; case keys.END: this._setValueAttr(this.maximum, false); break; // this._descending === false: if ascending vertical (min on top) // (this._descending || this.isLeftToRight()): if left-to-right horizontal or descending vertical case ((this._descending || this.isLeftToRight()) ? keys.RIGHT_ARROW : keys.LEFT_ARROW): case (this._descending === false ? keys.DOWN_ARROW : keys.UP_ARROW): case (this._descending === false ? keys.PAGE_DOWN : keys.PAGE_UP): this.increment(e); break; case ((this._descending || this.isLeftToRight()) ? keys.LEFT_ARROW : keys.RIGHT_ARROW): case (this._descending === false ? keys.UP_ARROW : keys.DOWN_ARROW): case (this._descending === false ? keys.PAGE_UP : keys.PAGE_DOWN): this.decrement(e); break; default: return; } event.stop(e); }, _onHandleClick: function(e){ if(this.disabled || this.readOnly){ return; } if(!has("ie")){ // make sure you get focus when dragging the handle // (but don't do on IE because it causes a flicker on mouse up (due to blur then focus) focus.focus(this.sliderHandle); } event.stop(e); }, _isReversed: function(){ // summary: // Returns true if direction is from right to left // tags: // protected extension return !this.isLeftToRight(); }, _onBarClick: function(e){ if(this.disabled || this.readOnly || !this.clickSelect){ return; } focus.focus(this.sliderHandle); event.stop(e); var abspos = domGeometry.position(this.sliderBarContainer, true); var pixelValue = e[this._mousePixelCoord] - abspos[this._startingPixelCoord]; this._setPixelValue(this._isReversed() ? (abspos[this._pixelCount] - pixelValue) : pixelValue, abspos[this._pixelCount], true); this._movable.onMouseDown(e); }, _setPixelValue: function(/*Number*/ pixelValue, /*Number*/ maxPixels, /*Boolean?*/ priorityChange){ if(this.disabled || this.readOnly){ return; } var count = this.discreteValues; if(count <= 1 || count == Infinity){ count = maxPixels; } count--; var pixelsPerValue = maxPixels / count; var wholeIncrements = Math.round(pixelValue / pixelsPerValue); this._setValueAttr(Math.max(Math.min((this.maximum-this.minimum)*wholeIncrements/count + this.minimum, this.maximum), this.minimum), priorityChange); }, _setValueAttr: function(/*Number*/ value, /*Boolean?*/ priorityChange){ // summary: // Hook so set('value', value) works. this._set("value", value); this.valueNode.value = value; this.focusNode.setAttribute("aria-valuenow", value); this.inherited(arguments); var percent = (value - this.minimum) / (this.maximum - this.minimum); var progressBar = (this._descending === false) ? this.remainingBar : this.progressBar; var remainingBar = (this._descending === false) ? this.progressBar : this.remainingBar; if(this._inProgressAnim && this._inProgressAnim.status != "stopped"){ this._inProgressAnim.stop(true); } if(priorityChange && this.slideDuration > 0 && progressBar.style[this._progressPixelSize]){ // animate the slider var _this = this; var props = {}; var start = parseFloat(progressBar.style[this._progressPixelSize]); var duration = this.slideDuration * (percent-start/100); if(duration == 0){ return; } if(duration < 0){ duration = 0 - duration; } props[this._progressPixelSize] = { start: start, end: percent*100, units:"%" }; this._inProgressAnim = fx.animateProperty({ node: progressBar, duration: duration, onAnimate: function(v){ remainingBar.style[_this._progressPixelSize] = (100 - parseFloat(v[_this._progressPixelSize])) + "%"; }, onEnd: function(){ delete _this._inProgressAnim; }, properties: props }); this._inProgressAnim.play(); }else{ progressBar.style[this._progressPixelSize] = (percent*100) + "%"; remainingBar.style[this._progressPixelSize] = ((1-percent)*100) + "%"; } }, _bumpValue: function(signedChange, /*Boolean?*/ priorityChange){ if(this.disabled || this.readOnly){ return; } var s = domStyle.getComputedStyle(this.sliderBarContainer); var c = domGeometry.getContentBox(this.sliderBarContainer, s); var count = this.discreteValues; if(count <= 1 || count == Infinity){ count = c[this._pixelCount]; } count--; var value = (this.value - this.minimum) * count / (this.maximum - this.minimum) + signedChange; if(value < 0){ value = 0; } if(value > count){ value = count; } value = value * (this.maximum - this.minimum) / count + this.minimum; this._setValueAttr(value, priorityChange); }, _onClkBumper: function(val){ if(this.disabled || this.readOnly || !this.clickSelect){ return; } this._setValueAttr(val, true); }, _onClkIncBumper: function(){ this._onClkBumper(this._descending === false ? this.minimum : this.maximum); }, _onClkDecBumper: function(){ this._onClkBumper(this._descending === false ? this.maximum : this.minimum); }, decrement: function(/*Event*/ e){ // summary: // Decrement slider // tags: // private this._bumpValue(e.charOrCode == keys.PAGE_DOWN ? -this.pageIncrement : -1); }, increment: function(/*Event*/ e){ // summary: // Increment slider // tags: // private this._bumpValue(e.charOrCode == keys.PAGE_UP ? this.pageIncrement : 1); }, _mouseWheeled: function(/*Event*/ evt){ // summary: // Event handler for mousewheel where supported event.stop(evt); var janky = !has("mozilla"); var scroll = evt[(janky ? "wheelDelta" : "detail")] * (janky ? 1 : -1); this._bumpValue(scroll < 0 ? -1 : 1, true); // negative scroll acts like a decrement }, startup: function(){ if(this._started){ return; } array.forEach(this.getChildren(), function(child){ if(this[child.container] != this.containerNode){ this[child.container].appendChild(child.domNode); } }, this); this.inherited(arguments); }, _typematicCallback: function(/*Number*/ count, /*Object*/ button, /*Event*/ e){ if(count == -1){ this._setValueAttr(this.value, true); }else{ this[(button == (this._descending? this.incrementButton : this.decrementButton)) ? "decrement" : "increment"](e); } }, buildRendering: function(){ this.inherited(arguments); if(this.showButtons){ this.incrementButton.style.display=""; this.decrementButton.style.display=""; } // find any associated label element and add to slider focusnode. var label = query('label[for="'+this.id+'"]'); if(label.length){ label[0].id = (this.id+"_label"); this.focusNode.setAttribute("aria-labelledby", label[0].id); } this.focusNode.setAttribute("aria-valuemin", this.minimum); this.focusNode.setAttribute("aria-valuemax", this.maximum); }, postCreate: function(){ this.inherited(arguments); if(this.showButtons){ this._connects.push(typematic.addMouseListener( this.decrementButton, this, "_typematicCallback", 25, 500)); this._connects.push(typematic.addMouseListener( this.incrementButton, this, "_typematicCallback", 25, 500)); } this.connect(this.domNode, !has("mozilla") ? "onmousewheel" : "DOMMouseScroll", "_mouseWheeled"); // define a custom constructor for a SliderMover that points back to me var mover = declare(_SliderMover, { widget: this }); this._movable = new Moveable(this.sliderHandle, {mover: mover}); this._layoutHackIE7(); }, destroy: function(){ this._movable.destroy(); if(this._inProgressAnim && this._inProgressAnim.status != "stopped"){ this._inProgressAnim.stop(true); } this._supportingWidgets = registry.findWidgets(this.domNode); // tells destroy about pseudo-child widgets (ruler/labels) this.inherited(arguments); } }); HorizontalSlider._Mover = _SliderMover; // for monkey patching return HorizontalSlider; }); }, 'url:dijit/form/templates/HorizontalSlider.html':"
    -
    +
    \n"}}); define("dojo/buxFilter", [], 1);