[vhffs-dev] [1355] Huge dojo cleanup |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1355
Author: beuss
Date: 2009-03-09 13:28:36 +0100 (Mon, 09 Mar 2009)
Log Message:
-----------
Huge dojo cleanup
Modified Paths:
--------------
branches/vhffs-design/vhffs-panel/Makefile.am
Removed Paths:
-------------
branches/vhffs-design/vhffs-panel/js/dijit/ColorPalette.js
branches/vhffs-design/vhffs-panel/js/dijit/Declaration.js
branches/vhffs-design/vhffs-panel/js/dijit/Dialog.js
branches/vhffs-design/vhffs-panel/js/dijit/Editor.js
branches/vhffs-design/vhffs-panel/js/dijit/InlineEditBox.js
branches/vhffs-design/vhffs-panel/js/dijit/Menu.js
branches/vhffs-design/vhffs-panel/js/dijit/ProgressBar.js
branches/vhffs-design/vhffs-panel/js/dijit/TitlePane.js
branches/vhffs-design/vhffs-panel/js/dijit/Toolbar.js
branches/vhffs-design/vhffs-panel/js/dijit/Tooltip.js
branches/vhffs-design/vhffs-panel/js/dijit/Tree.js
branches/vhffs-design/vhffs-panel/js/dijit/_Calendar.js
branches/vhffs-design/vhffs-panel/js/dijit/_Container.js
branches/vhffs-design/vhffs-panel/js/dijit/_Templated.js
branches/vhffs-design/vhffs-panel/js/dijit/_TimePicker.js
branches/vhffs-design/vhffs-panel/js/dijit/_Widget.js
branches/vhffs-design/vhffs-panel/js/dijit/_base/
branches/vhffs-design/vhffs-panel/js/dijit/_base.js
branches/vhffs-design/vhffs-panel/js/dijit/_editor/
branches/vhffs-design/vhffs-panel/js/dijit/_tree/
branches/vhffs-design/vhffs-panel/js/dijit/bench/
branches/vhffs-design/vhffs-panel/js/dijit/changes.txt
branches/vhffs-design/vhffs-panel/js/dijit/demos/
branches/vhffs-design/vhffs-panel/js/dijit/form/
branches/vhffs-design/vhffs-panel/js/dijit/layout/
branches/vhffs-design/vhffs-panel/js/dijit/nls/
branches/vhffs-design/vhffs-panel/js/dijit/resources/
branches/vhffs-design/vhffs-panel/js/dijit/templates/
branches/vhffs-design/vhffs-panel/js/dijit/themes/
branches/vhffs-design/vhffs-panel/js/dojo/AdapterRegistry.js
branches/vhffs-design/vhffs-panel/js/dojo/DeferredList.js
branches/vhffs-design/vhffs-panel/js/dojo/NodeList-fx.js
branches/vhffs-design/vhffs-panel/js/dojo/OpenAjax.js
branches/vhffs-design/vhffs-panel/js/dojo/_base/
branches/vhffs-design/vhffs-panel/js/dojo/_base.js
branches/vhffs-design/vhffs-panel/js/dojo/_firebug/
branches/vhffs-design/vhffs-panel/js/dojo/back.js
branches/vhffs-design/vhffs-panel/js/dojo/behavior.js
branches/vhffs-design/vhffs-panel/js/dojo/build.txt
branches/vhffs-design/vhffs-panel/js/dojo/cldr/
branches/vhffs-design/vhffs-panel/js/dojo/colors.js
branches/vhffs-design/vhffs-panel/js/dojo/cookie.js
branches/vhffs-design/vhffs-panel/js/dojo/currency.js
branches/vhffs-design/vhffs-panel/js/dojo/data/
branches/vhffs-design/vhffs-panel/js/dojo/date/
branches/vhffs-design/vhffs-panel/js/dojo/date.js
branches/vhffs-design/vhffs-panel/js/dojo/dnd/
branches/vhffs-design/vhffs-panel/js/dojo/fx.js
branches/vhffs-design/vhffs-panel/js/dojo/i18n.js
branches/vhffs-design/vhffs-panel/js/dojo/io/
branches/vhffs-design/vhffs-panel/js/dojo/jaxer.js
branches/vhffs-design/vhffs-panel/js/dojo/nls/
branches/vhffs-design/vhffs-panel/js/dojo/number.js
branches/vhffs-design/vhffs-panel/js/dojo/parser.js
branches/vhffs-design/vhffs-panel/js/dojo/regexp.js
branches/vhffs-design/vhffs-panel/js/dojo/resources/
branches/vhffs-design/vhffs-panel/js/dojo/rpc/
branches/vhffs-design/vhffs-panel/js/dojo/string.js
branches/vhffs-design/vhffs-panel/js/dojo/tests.js
branches/vhffs-design/vhffs-panel/js/dojox/
branches/vhffs-design/vhffs-panel/js/util/
Modified: branches/vhffs-design/vhffs-panel/Makefile.am
===================================================================
--- branches/vhffs-design/vhffs-panel/Makefile.am 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/Makefile.am 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,179 +1,7 @@
javascripts = js/prototype.js \
js/commons.js \
- js/dijit/dijit-all.js \
- js/dojo/dnd/Moveable.js \
- js/dojo/dnd/Manager.js \
- js/dojo/dnd/Selector.js \
- js/dojo/dnd/move.js \
- js/dojo/dnd/common.js \
- js/dojo/dnd/Container.js \
- js/dojo/dnd/autoscroll.js \
- js/dojo/dnd/Source.js \
- js/dojo/dnd/Avatar.js \
- js/dojo/dnd/TimedMoveable.js \
- js/dojo/dnd/Mover.js \
- js/dojo/tests.js \
- js/dojo/back.js \
- js/dojo/colors.js \
- js/dojo/_base/Deferred.js \
- js/dojo/_base/Color.js \
- js/dojo/_base/html.js \
- js/dojo/_base/_loader/hostenv_spidermonkey.js \
- js/dojo/_base/_loader/hostenv_rhino.js \
- js/dojo/_base/_loader/bootstrap.js \
- js/dojo/_base/_loader/loader.js \
- js/dojo/_base/_loader/loader_xd.js \
- js/dojo/_base/_loader/loader_debug.js \
- js/dojo/_base/_loader/hostenv_browser.js \
- js/dojo/_base/browser.js \
- js/dojo/_base/query.js \
- js/dojo/_base/connect.js \
- js/dojo/_base/NodeList.js \
- js/dojo/_base/json.js \
- js/dojo/_base/lang.js \
- js/dojo/_base/window.js \
- js/dojo/_base/declare.js \
- js/dojo/_base/xhr.js \
- js/dojo/_base/fx.js \
- js/dojo/_base/array.js \
- js/dojo/_base/event.js \
- js/dojo/parser.js \
- js/dojo/i18n.js \
- js/dojo/dojo.js.uncompressed.js \
- js/dojo/date.js \
- js/dojo/AdapterRegistry.js \
- js/dojo/data/ItemFileWriteStore.js \
- js/dojo/data/api/Identity.js \
- js/dojo/data/api/Write.js \
- js/dojo/data/api/Read.js \
- js/dojo/data/api/Request.js \
- js/dojo/data/api/Notification.js \
- js/dojo/data/ItemFileReadStore.js \
- js/dojo/data/util/sorter.js \
- js/dojo/data/util/filter.js \
- js/dojo/data/util/simpleFetch.js \
- js/dojo/jaxer.js \
- js/dojo/currency.js \
- js/dojo/behavior.js \
- js/dojo/_base.js \
- js/dojo/string.js \
+ js/dijit/dijit.js \
js/dojo/dojo.js \
- js/dojo/rpc/RpcService.js \
- js/dojo/rpc/JsonService.js \
- js/dojo/rpc/JsonpService.js \
- js/dojo/nls/sv/colors.js \
- js/dojo/nls/de/colors.js \
- js/dojo/nls/nb/colors.js \
- js/dojo/nls/fi/colors.js \
- js/dojo/nls/colors.js \
- js/dojo/nls/fr/colors.js \
- js/dojo/nls/tr/colors.js \
- js/dojo/nls/zh-tw/colors.js \
- js/dojo/nls/pt-pt/colors.js \
- js/dojo/nls/pt/colors.js \
- js/dojo/nls/hu/colors.js \
- js/dojo/nls/zh/colors.js \
- js/dojo/nls/it/colors.js \
- js/dojo/nls/cs/colors.js \
- js/dojo/nls/ko/colors.js \
- js/dojo/nls/pl/colors.js \
- js/dojo/nls/ja/colors.js \
- js/dojo/nls/he/colors.js \
- js/dojo/nls/el/colors.js \
- js/dojo/nls/nl/colors.js \
- js/dojo/nls/ar/colors.js \
- js/dojo/nls/es/colors.js \
- js/dojo/nls/da/colors.js \
- js/dojo/nls/ru/colors.js \
- js/dojo/resources/dnd.css.commented.css \
- js/dojo/resources/dnd.css \
- js/dojo/resources/_modules.js \
- js/dojo/resources/dojo.css \
- js/dojo/resources/blank.gif \
- js/dojo/resources/images/dndCopy.png \
- js/dojo/resources/images/dndNoMove.png \
- js/dojo/resources/images/dndNoCopy.png \
- js/dojo/resources/images/dndMove.png \
- js/dojo/resources/dojo.css.commented.css \
- js/dojo/resources/blank.html \
- js/dojo/resources/LICENSE \
- js/dojo/resources/iframe_history.html \
- js/dojo/_firebug/firebug.css \
- js/dojo/_firebug/warningIcon.png \
- js/dojo/_firebug/firebug.js \
- js/dojo/_firebug/errorIcon.png \
- js/dojo/_firebug/infoIcon.png \
- js/dojo/_firebug/firebug.css.commented.css \
- js/dojo/_firebug/LICENSE \
- js/dojo/NodeList-fx.js \
- js/dojo/regexp.js \
- js/dojo/fx.js \
- js/dojo/number.js \
- js/dojo/io/script.js \
- js/dojo/io/iframe.js \
- js/dojo/build.txt \
- js/dojo/DeferredList.js \
- js/dojo/cookie.js \
- js/dojo/LICENSE \
- js/dojo/date/stamp.js \
- js/dojo/date/locale.js \
- js/dojo/OpenAjax.js \
- js/dojo/cldr/README \
- js/dojo/cldr/supplemental.js \
- js/dojo/cldr/monetary.js \
- js/dojo/cldr/nls/it-it/gregorian.js \
- js/dojo/cldr/nls/es-es/number.js \
- js/dojo/cldr/nls/es-es/gregorian.js \
- js/dojo/cldr/nls/de/currency.js \
- js/dojo/cldr/nls/de/number.js \
- js/dojo/cldr/nls/de/gregorian.js \
- js/dojo/cldr/nls/en/currency.js \
- js/dojo/cldr/nls/en/number.js \
- js/dojo/cldr/nls/en/gregorian.js \
- js/dojo/cldr/nls/fr/currency.js \
- js/dojo/cldr/nls/fr/number.js \
- js/dojo/cldr/nls/fr/gregorian.js \
- js/dojo/cldr/nls/zh-tw/currency.js \
- js/dojo/cldr/nls/zh-tw/number.js \
- js/dojo/cldr/nls/zh-tw/gregorian.js \
- js/dojo/cldr/nls/ja-jp/number.js \
- js/dojo/cldr/nls/en-us/currency.js \
- js/dojo/cldr/nls/en-us/number.js \
- js/dojo/cldr/nls/pt/currency.js \
- js/dojo/cldr/nls/pt/number.js \
- js/dojo/cldr/nls/pt/gregorian.js \
- js/dojo/cldr/nls/currency.js \
- js/dojo/cldr/nls/en-ca/currency.js \
- js/dojo/cldr/nls/en-ca/gregorian.js \
- js/dojo/cldr/nls/zh/currency.js \
- js/dojo/cldr/nls/zh/number.js \
- js/dojo/cldr/nls/zh/gregorian.js \
- js/dojo/cldr/nls/it/currency.js \
- js/dojo/cldr/nls/it/number.js \
- js/dojo/cldr/nls/it/gregorian.js \
- js/dojo/cldr/nls/ko/currency.js \
- js/dojo/cldr/nls/ko/number.js \
- js/dojo/cldr/nls/ko/gregorian.js \
- js/dojo/cldr/nls/ja/currency.js \
- js/dojo/cldr/nls/ja/number.js \
- js/dojo/cldr/nls/ja/gregorian.js \
- js/dojo/cldr/nls/en-au/currency.js \
- js/dojo/cldr/nls/en-au/number.js \
- js/dojo/cldr/nls/en-au/gregorian.js \
- js/dojo/cldr/nls/number.js \
- js/dojo/cldr/nls/ko-kr/number.js \
- js/dojo/cldr/nls/ko-kr/gregorian.js \
- js/dojo/cldr/nls/gregorian.js \
- js/dojo/cldr/nls/pt-br/gregorian.js \
- js/dojo/cldr/nls/es/currency.js \
- js/dojo/cldr/nls/es/number.js \
- js/dojo/cldr/nls/es/gregorian.js \
- js/dojo/cldr/nls/en-gb/number.js \
- js/dojo/cldr/nls/en-gb/gregorian.js \
- js/dojo/cldr/nls/de-de/number.js \
- js/dojo/cldr/nls/zh-cn/number.js \
- js/dojo/cldr/nls/zh-cn/gregorian.js \
- js/dojo/cldr/LICENSE \
js/public.js \
js/tooltip.js \
js/vhffs/Common.js \
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/ColorPalette.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/ColorPalette.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/ColorPalette.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,292 +0,0 @@
-if(!dojo._hasResource["dijit.ColorPalette"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.ColorPalette"] = true;
-dojo.provide("dijit.ColorPalette");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Templated");
-dojo.require("dojo.colors");
-dojo.require("dojo.i18n");
-dojo.requireLocalization("dojo", "colors", null, "zh,pt,da,tr,ru,de,sv,ja,he,fi,nb,el,ar,pt-pt,cs,fr,es,nl,ko,zh-tw,pl,it,hu,ROOT");
-
-dojo.declare("dijit.ColorPalette",
- [dijit._Widget, dijit._Templated],
- {
- // summary: A keyboard accessible color-picking widget
- // description:
- // Grid showing various colors, so the user can pick a certain color
- // Can be used standalone, or as a popup.
- //
- // example:
- // | <div dojoType="dijit.ColorPalette"></div>
- //
- // example:
- // | var picker = new dijit.ColorPalette({ },srcNode);
- // | picker.startup();
- //
- // defaultTimeout: Number
- // number of milliseconds before a held key or button becomes typematic
- defaultTimeout: 500,
-
- // timeoutChangeRate: Number
- // fraction of time used to change the typematic timer between events
- // 1.0 means that each typematic event fires at defaultTimeout intervals
- // < 1.0 means that each typematic event fires at an increasing faster rate
- timeoutChangeRate: 0.90,
-
- // palette: String
- // Size of grid, either "7x10" or "3x4".
- palette: "7x10",
-
- //_value: String
- // The value of the selected color.
- value: null,
-
- //_currentFocus: Integer
- // Index of the currently focused color.
- _currentFocus: 0,
-
- // _xDim: Integer
- // This is the number of colors horizontally across.
- _xDim: null,
-
- // _yDim: Integer
- /// This is the number of colors vertically down.
- _yDim: null,
-
- // _palettes: Map
- // This represents the value of the colors.
- // The first level is a hashmap of the different arrays available
- // The next two dimensions represent the columns and rows of colors.
- _palettes: {
-
- "7x10": [["white", "seashell", "cornsilk", "lemonchiffon","lightyellow", "palegreen", "paleturquoise", "lightcyan", "lavender", "plum"],
- ["lightgray", "pink", "bisque", "moccasin", "khaki", "lightgreen", "lightseagreen", "lightskyblue", "cornflowerblue", "violet"],
- ["silver", "lightcoral", "sandybrown", "orange", "palegoldenrod", "chartreuse", "mediumturquoise", "skyblue", "mediumslateblue","orchid"],
- ["gray", "red", "orangered", "darkorange", "yellow", "limegreen", "darkseagreen", "royalblue", "slateblue", "mediumorchid"],
- ["dimgray", "crimson", "chocolate", "coral", "gold", "forestgreen", "seagreen", "blue", "blueviolet", "darkorchid"],
- ["darkslategray","firebrick","saddlebrown", "sienna", "olive", "green", "darkcyan", "mediumblue","darkslateblue", "darkmagenta" ],
- ["black", "darkred", "maroon", "brown", "darkolivegreen", "darkgreen", "midnightblue", "navy", "indigo", "purple"]],
-
- "3x4": [["white", "lime", "green", "blue"],
- ["silver", "yellow", "fuchsia", "navy"],
- ["gray", "red", "purple", "black"]]
-
- },
-
- // _imagePaths: Map
- // This is stores the path to the palette images
- _imagePaths: {
- "7x10": dojo.moduleUrl("dijit", "templates/colors7x10.png"),
- "3x4": dojo.moduleUrl("dijit", "templates/colors3x4.png")
- },
-
- // _paletteCoords: Map
- // This is a map that is used to calculate the coordinates of the
- // images that make up the palette.
- _paletteCoords: {
- "leftOffset": 3, "topOffset": 3,
- "cWidth": 20, "cHeight": 20
-
- },
-
- // templatePath: String
- // Path to the template of this widget.
- templateString:"<div class=\"dijitInline dijitColorPalette\">\n\t<div class=\"dijitColorPaletteInner\" dojoAttachPoint=\"divNode\" waiRole=\"grid\" tabIndex=\"${tabIndex}\">\n\t\t<img class=\"dijitColorPaletteUnder\" dojoAttachPoint=\"imageNode\" waiRole=\"presentation\">\n\t</div>\t\n</div>\n",
-
- // _paletteDims: Object
- // Size of the supported palettes for alignment purposes.
- _paletteDims: {
- "7x10": {"width": "206px", "height": "145px"},
- "3x4": {"width": "86px", "height": "64px"}
- },
-
- // tabIndex: String
- // Widget tabindex.
- tabIndex: "0",
-
- postCreate: function(){
- // A name has to be given to the colorMap, this needs to be unique per Palette.
- dojo.mixin(this.divNode.style, this._paletteDims[this.palette]);
- this.imageNode.setAttribute("src", this._imagePaths[this.palette]);
- var choices = this._palettes[this.palette];
- this.domNode.style.position = "relative";
- this._cellNodes = [];
- this.colorNames = dojo.i18n.getLocalization("dojo", "colors", this.lang);
- var url = dojo.moduleUrl("dojo", "resources/blank.gif"),
- colorObject = new dojo.Color(),
- coords = this._paletteCoords;
- for(var row=0; row < choices.length; row++){
- for(var col=0; col < choices[row].length; col++) {
- var imgNode = dojo.doc.createElement("img");
- imgNode.src = url;
- dojo.addClass(imgNode, "dijitPaletteImg");
- var color = choices[row][col],
- colorValue = colorObject.setColor(dojo.Color.named[color]);
- imgNode.alt = this.colorNames[color];
- imgNode.color = colorValue.toHex();
- var imgStyle = imgNode.style;
- imgStyle.color = imgStyle.backgroundColor = imgNode.color;
- var cellNode = dojo.doc.createElement("span");
- cellNode.appendChild(imgNode);
- dojo.forEach(["Dijitclick", "MouseEnter", "Focus", "Blur"], function(handler) {
- this.connect(cellNode, "on" + handler.toLowerCase(), "_onCell" + handler);
- }, this);
- this.divNode.appendChild(cellNode);
- var cellStyle = cellNode.style;
- cellStyle.top = coords.topOffset + (row * coords.cHeight) + "px";
- cellStyle.left = coords.leftOffset + (col * coords.cWidth) + "px";
- dojo.attr(cellNode, "tabindex", "-1");
- cellNode.title = this.colorNames[color];
- dojo.addClass(cellNode, "dijitPaletteCell");
- dijit.setWaiRole(cellNode, "gridcell");
- cellNode.index = this._cellNodes.length;
- this._cellNodes.push(cellNode);
- }
- }
- this._xDim = choices[0].length;
- this._yDim = choices.length;
- this.connect(this.divNode, "onfocus", "_onDivNodeFocus");
-
- // Now set all events
- // The palette itself is navigated to with the tab key on the keyboard
- // Keyboard navigation within the Palette is with the arrow keys
- // Spacebar selects the color.
- // For the up key the index is changed by negative the x dimension.
-
- var keyIncrementMap = {
- UP_ARROW: -this._xDim,
- // The down key the index is increase by the x dimension.
- DOWN_ARROW: this._xDim,
- // Right and left move the index by 1.
- RIGHT_ARROW: 1,
- LEFT_ARROW: -1
- };
- for(var key in keyIncrementMap){
- this._connects.push(dijit.typematic.addKeyListener(this.domNode,
- {keyCode:dojo.keys[key], ctrlKey:false, altKey:false, shiftKey:false},
- this,
- function(){
- var increment = keyIncrementMap[key];
- return function(count){ this._navigateByKey(increment, count); };
- }(),
- this.timeoutChangeRate, this.defaultTimeout));
- }
- },
-
- focus: function(){
- // summary:
- // Focus this ColorPalette. Puts focus on the first swatch.
- this._focusFirst();
- },
-
- onChange: function(color){
- // summary:
- // Callback when a color is selected.
- // color: String
- // Hex value corresponding to color.
-// console.debug("Color selected is: "+color);
- },
-
- _focusFirst: function(){
- this._currentFocus = 0;
- var cellNode = this._cellNodes[this._currentFocus];
- window.setTimeout(function(){dijit.focus(cellNode)}, 0);
- },
-
- _onDivNodeFocus: function(evt){
- // focus bubbles on Firefox 2, so just make sure that focus has really
- // gone to the container
- if(evt.target === this.divNode){
- this._focusFirst();
- }
- },
-
- _onFocus: function(){
- // while focus is on the palette, set its tabindex to -1 so that on a
- // shift-tab from a cell, the container is not in the tab order
- dojo.attr(this.divNode, "tabindex", "-1");
- },
-
- _onBlur: function(){
- this._removeCellHighlight(this._currentFocus);
- // when focus leaves the palette, restore its tabindex, since it was
- // modified by _onFocus().
- dojo.attr(this.divNode, "tabindex", this.tabIndex);
- },
-
- _onCellDijitclick: function(/*Event*/ evt){
- // summary:
- // Handler for click, enter key & space key. Selects the color.
- // evt:
- // The event.
- var target = evt.currentTarget;
- if (this._currentFocus != target.index){
- this._currentFocus = target.index;
- window.setTimeout(function(){dijit.focus(target)}, 0);
- }
- this._selectColor(target);
- dojo.stopEvent(evt);
- },
-
- _onCellMouseEnter: function(/*Event*/ evt){
- // summary:
- // Handler for onMouseOver. Put focus on the color under the mouse.
- // evt:
- // The mouse event.
- var target = evt.currentTarget;
- window.setTimeout(function(){dijit.focus(target)}, 0);
- },
-
- _onCellFocus: function(/*Event*/ evt){
- // summary:
- // Handler for onFocus. Removes highlight of
- // the color that just lost focus, and highlights
- // the new color.
- // evt:
- // The focus event.
- this._removeCellHighlight(this._currentFocus);
- this._currentFocus = evt.currentTarget.index;
- dojo.addClass(evt.currentTarget, "dijitPaletteCellHighlight");
- },
-
- _onCellBlur: function(/*Event*/ evt){
- // summary:
- // needed for Firefox 2 on Mac OS X
- this._removeCellHighlight(this._currentFocus);
- },
-
- _removeCellHighlight: function(index){
- dojo.removeClass(this._cellNodes[index], "dijitPaletteCellHighlight");
- },
-
- _selectColor: function(selectNode){
- // summary:
- // This selects a color. It triggers the onChange event
- // area:
- // The area node that covers the color being selected.
- var img = selectNode.getElementsByTagName("img")[0];
- this.onChange(this.value = img.color);
- },
-
- _navigateByKey: function(increment, typeCount){
- // summary:
- // This is the callback for typematic.
- // It changes the focus and the highlighed color.
- // increment:
- // How much the key is navigated.
- // typeCount:
- // How many times typematic has fired.
-
- // typecount == -1 means the key is released.
- if(typeCount == -1){ return; }
-
- var newFocusIndex = this._currentFocus + increment;
- if(newFocusIndex < this._cellNodes.length && newFocusIndex > -1)
- {
- var focusNode = this._cellNodes[newFocusIndex];
- focusNode.focus();
- }
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/Declaration.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/Declaration.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/Declaration.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,76 +0,0 @@
-if(!dojo._hasResource["dijit.Declaration"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.Declaration"] = true;
-dojo.provide("dijit.Declaration");
-dojo.require("dijit._Widget");
-dojo.require("dijit._Templated");
-
-dojo.declare(
- "dijit.Declaration",
- dijit._Widget,
- {
- // summary:
- // The Declaration widget allows a user to declare new widget
- // classes directly from a snippet of markup.
-
- _noScript: true,
- widgetClass: "",
- replaceVars: true,
- defaults: null,
- mixins: [],
- buildRendering: function(){
- var src = this.srcNodeRef.parentNode.removeChild(this.srcNodeRef);
- var preambles = dojo.query("> script[type='dojo/method'][event='preamble']", src).orphan();
- var scripts = dojo.query("> script[type^='dojo/']", src).orphan();
- var srcType = src.nodeName;
-
- var propList = this.defaults||{};
-
- // map array of strings like [ "dijit.form.Button" ] to array of mixin objects
- // (note that dojo.map(this.mixins, dojo.getObject) doesn't work because it passes
- // a bogus third argument to getObject(), confusing it)
- this.mixins = this.mixins.length ?
- dojo.map(this.mixins, function(name){ return dojo.getObject(name); } ) :
- [ dijit._Widget, dijit._Templated ];
-
- if(preambles.length){
- // we only support one preamble. So be it.
- propList.preamble = dojo.parser._functionFromScript(preambles[0]);
- }
-
- var parsedScripts = dojo.map(scripts, function(s){
- var evt = s.getAttribute("event")||"postscript";
- return {
- event: evt,
- func: dojo.parser._functionFromScript(s)
- };
- });
-
- // do the connects for each <script type="dojo/connect" event="foo"> block and make
- // all <script type="dojo/method"> tags execute right after construction
- this.mixins.push(function(){
- dojo.forEach(parsedScripts, function(s){
- dojo.connect(this, s.event, this, s.func);
- }, this);
- });
-
- propList.widgetsInTemplate = true;
- propList._skipNodeCache = true;
- propList.templateString = "<"+srcType+" class='"+src.className+"' dojoAttachPoint='"+(src.getAttribute("dojoAttachPoint")||'')+"' dojoAttachEvent='"+(src.getAttribute("dojoAttachEvent")||'')+"' >"+src.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+srcType+">";
- // console.debug(propList.templateString);
-
- // strip things so we don't create stuff under us in the initial setup phase
- dojo.query("[dojoType]", src).forEach(function(node){
- node.removeAttribute("dojoType");
- });
-
- // create the new widget class
- dojo.declare(
- this.widgetClass,
- this.mixins,
- propList
- );
- }
- }
-);
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/Dialog.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/Dialog.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/Dialog.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,480 +0,0 @@
-if(!dojo._hasResource["dijit.Dialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.Dialog"] = true;
-dojo.provide("dijit.Dialog");
-
-dojo.require("dojo.dnd.TimedMoveable");
-dojo.require("dojo.fx");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Templated");
-dojo.require("dijit.layout.ContentPane");
-dojo.require("dijit.form.Form");
-dojo.requireLocalization("dijit", "common", null, "zh,pt,da,tr,ru,de,sv,ja,he,fi,nb,el,ar,ROOT,pt-pt,cs,fr,es,ko,nl,zh-tw,pl,it,hu");
-
-dojo.declare(
- "dijit.DialogUnderlay",
- [dijit._Widget, dijit._Templated],
- {
- // summary: The component that grays out the screen behind the dialog
-
- // Template has two divs; outer div is used for fade-in/fade-out, and also to hold background iframe.
- // Inner div has opacity specified in CSS file.
- templateString: "<div class='dijitDialogUnderlayWrapper' id='${id}_wrapper'><div class='dijitDialogUnderlay ${class}' id='${id}' dojoAttachPoint='node'></div></div>",
-
- attributeMap: {},
-
- postCreate: function(){
- // summary: Append the underlay to the body
- dojo.body().appendChild(this.domNode);
- this.bgIframe = new dijit.BackgroundIframe(this.domNode);
- },
-
- layout: function(){
- // summary: Sets the background to the size of the viewport
- //
- // description:
- // Sets the background to the size of the viewport (rather than the size
- // of the document) since we need to cover the whole browser window, even
- // if the document is only a few lines long.
-
- var viewport = dijit.getViewport();
- var is = this.node.style,
- os = this.domNode.style;
-
- os.top = viewport.t + "px";
- os.left = viewport.l + "px";
- is.width = viewport.w + "px";
- is.height = viewport.h + "px";
-
- // process twice since the scroll bar may have been removed
- // by the previous resizing
- var viewport2 = dijit.getViewport();
- if(viewport.w != viewport2.w){ is.width = viewport2.w + "px"; }
- if(viewport.h != viewport2.h){ is.height = viewport2.h + "px"; }
- },
-
- show: function(){
- // summary: Show the dialog underlay
- this.domNode.style.display = "block";
- this.layout();
- if(this.bgIframe.iframe){
- this.bgIframe.iframe.style.display = "block";
- }
- this._resizeHandler = this.connect(window, "onresize", "layout");
- },
-
- hide: function(){
- // summary: hides the dialog underlay
- this.domNode.style.display = "none";
- if(this.bgIframe.iframe){
- this.bgIframe.iframe.style.display = "none";
- }
- this.disconnect(this._resizeHandler);
- },
-
- uninitialize: function(){
- if(this.bgIframe){
- this.bgIframe.destroy();
- }
- }
- }
-);
-
-
-dojo.declare("dijit._DialogMixin", null,
- {
- attributeMap: dijit._Widget.prototype.attributeMap,
-
- // execute: Function
- // User defined function to do stuff when the user hits the submit button
- execute: function(/*Object*/ formContents){},
-
- // onCancel: Function
- // Callback when user has canceled dialog, to notify container
- // (user shouldn't override)
- onCancel: function(){},
-
- // onExecute: Function
- // Callback when user is about to execute dialog, to notify container
- // (user shouldn't override)
- onExecute: function(){},
-
- _onSubmit: function(){
- // summary: callback when user hits submit button
- this.onExecute(); // notify container that we are about to execute
- this.execute(this.getValues());
- },
-
- _getFocusItems: function(/*Node*/ dialogNode){
- // find focusable Items each time a dialog is opened
- var focusItem = dijit.getFirstInTabbingOrder(dialogNode);
- this._firstFocusItem = focusItem ? focusItem : dialogNode;
- focusItem = dijit.getLastInTabbingOrder(dialogNode);
- this._lastFocusItem = focusItem ? focusItem : this._firstFocusItem;
- if(dojo.isMoz && this._firstFocusItem.tagName.toLowerCase() == "input" && dojo.attr(this._firstFocusItem, "type").toLowerCase() == "file"){
- //FF doesn't behave well when first element is input type=file, set first focusable to dialog container
- dojo.attr(dialogNode, "tabindex", "0");
- this._firstFocusItem = dialogNode;
- }
- }
- }
-);
-
-dojo.declare(
- "dijit.Dialog",
- [dijit.layout.ContentPane, dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin],
- {
- // summary: A modal dialog Widget
- //
- // description:
- // Pops up a modal dialog window, blocking access to the screen
- // and also graying out the screen Dialog is extended from
- // ContentPane so it supports all the same parameters (href, etc.)
- //
- // example:
- // | <div dojoType="dijit.Dialog" href="test.html"></div>
- //
- // example:
- // | <div id="test">test content</div>
- // | ...
- // | var foo = new dijit.Dialog({ title: "test dialog" },dojo.byId("test"));
- // | foo.startup();
-
- templateString: null,
- templateString:"<div class=\"dijitDialog\" tabindex=\"-1\" waiRole=\"dialog\" waiState=\"labelledby-${id}_title\">\n\t<div dojoAttachPoint=\"titleBar\" class=\"dijitDialogTitleBar\">\n\t<span dojoAttachPoint=\"titleNode\" class=\"dijitDialogTitle\" id=\"${id}_title\">${title}</span>\n\t<span dojoAttachPoint=\"closeButtonNode\" class=\"dijitDialogCloseIcon\" dojoAttachEvent=\"onclick: onCancel\">\n\t\t<span dojoAttachPoint=\"closeText\" class=\"closeText\">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint=\"containerNode\" class=\"dijitDialogPaneContent\"></div>\n</div>\n",
-
- // open: Boolean
- // is True or False depending on state of dialog
- open: false,
-
- // duration: Integer
- // The time in milliseconds it takes the dialog to fade in and out
- duration: 400,
-
- // refocus: Boolean
- // A Toggle to modify the default focus behavior of a Dialog, which
- // is to re-focus the element which had focus before being opened.
- // False will disable refocusing. Default: true
- refocus: true,
-
- // _firstFocusItem: DomNode
- // The pointer to the first focusable node in the dialog
- _firstFocusItem:null,
-
- // _lastFocusItem: DomNode
- // The pointer to which node has focus prior to our dialog
- _lastFocusItem:null,
-
- // doLayout: Boolean
- // Don't change this parameter from the default value.
- // This ContentPane parameter doesn't make sense for Dialog, since Dialog
- // is never a child of a layout container, nor can you specify the size of
- // Dialog in order to control the size of an inner widget.
- doLayout: false,
-
- attributeMap: dojo.mixin(dojo.clone(dijit._Widget.prototype.attributeMap),
- {title: "titleBar"}),
-
- postCreate: function(){
- dojo.body().appendChild(this.domNode);
- this.inherited(arguments);
- var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
- if(this.closeButtonNode){
- this.closeButtonNode.setAttribute("title", _nlsResources.buttonCancel);
- }
- if(this.closeText){
- this.closeText.setAttribute("title", _nlsResources.buttonCancel);
- }
- var s = this.domNode.style;
- s.visibility = "hidden";
- s.position = "absolute";
- s.display = "";
- s.top = "-9999px";
-
- this.connect(this, "onExecute", "hide");
- this.connect(this, "onCancel", "hide");
- this._modalconnects = [];
- },
-
- onLoad: function(){
- // summary: when href is specified we need to reposition the dialog after the data is loaded
- this._position();
- this.inherited(arguments);
- },
-
- _setup: function(){
- // summary:
- // stuff we need to do before showing the Dialog for the first
- // time (but we defer it until right beforehand, for
- // performance reasons)
-
- if(this.titleBar){
- this._moveable = new dojo.dnd.TimedMoveable(this.domNode, { handle: this.titleBar, timeout: 0 });
- }
-
- this._underlay = new dijit.DialogUnderlay({
- id: this.id+"_underlay",
- "class": dojo.map(this["class"].split(/\s/), function(s){ return s+"_underlay"; }).join(" ")
- });
-
- var node = this.domNode;
- this._fadeIn = dojo.fx.combine(
- [dojo.fadeIn({
- node: node,
- duration: this.duration
- }),
- dojo.fadeIn({
- node: this._underlay.domNode,
- duration: this.duration,
- onBegin: dojo.hitch(this._underlay, "show")
- })
- ]
- );
-
- this._fadeOut = dojo.fx.combine(
- [dojo.fadeOut({
- node: node,
- duration: this.duration,
- onEnd: function(){
- node.style.visibility="hidden";
- node.style.top = "-9999px";
- }
- }),
- dojo.fadeOut({
- node: this._underlay.domNode,
- duration: this.duration,
- onEnd: dojo.hitch(this._underlay, "hide")
- })
- ]
- );
- },
-
- uninitialize: function(){
- if(this._fadeIn && this._fadeIn.status() == "playing"){
- this._fadeIn.stop();
- }
- if(this._fadeOut && this._fadeOut.status() == "playing"){
- this._fadeOut.stop();
- }
- if(this._underlay){
- this._underlay.destroy();
- }
- },
-
- _position: function(){
- // summary: position modal dialog in center of screen
-
- if(dojo.hasClass(dojo.body(),"dojoMove")){ return; }
- var viewport = dijit.getViewport();
- var mb = dojo.marginBox(this.domNode);
-
- var style = this.domNode.style;
- style.left = Math.floor((viewport.l + (viewport.w - mb.w)/2)) + "px";
- style.top = Math.floor((viewport.t + (viewport.h - mb.h)/2)) + "px";
- },
-
- _onKey: function(/*Event*/ evt){
- // summary: handles the keyboard events for accessibility reasons
- if(evt.keyCode){
- var node = evt.target;
- if (evt.keyCode == dojo.keys.TAB){
- this._getFocusItems(this.domNode);
- }
- var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
- // see if we are shift-tabbing from first focusable item on dialog
- if(node == this._firstFocusItem && evt.shiftKey && evt.keyCode == dojo.keys.TAB){
- if(!singleFocusItem){
- dijit.focus(this._lastFocusItem); // send focus to last item in dialog
- }
- dojo.stopEvent(evt);
- }else if(node == this._lastFocusItem && evt.keyCode == dojo.keys.TAB && !evt.shiftKey){
- if (!singleFocusItem){
- dijit.focus(this._firstFocusItem); // send focus to first item in dialog
- }
- dojo.stopEvent(evt);
- }else{
- // see if the key is for the dialog
- while(node){
- if(node == this.domNode){
- if(evt.keyCode == dojo.keys.ESCAPE){
- this.hide();
- }else{
- return; // just let it go
- }
- }
- node = node.parentNode;
- }
- // this key is for the disabled document window
- if(evt.keyCode != dojo.keys.TAB){ // allow tabbing into the dialog for a11y
- dojo.stopEvent(evt);
- // opera won't tab to a div
- }else if(!dojo.isOpera){
- try{
- this._firstFocusItem.focus();
- }catch(e){ /*squelch*/ }
- }
- }
- }
- },
-
- show: function(){
- // summary: display the dialog
-
- if(this.open){ return; }
-
- // first time we show the dialog, there's some initialization stuff to do
- if(!this._alreadyInitialized){
- this._setup();
- this._alreadyInitialized=true;
- }
-
- if(this._fadeOut.status() == "playing"){
- this._fadeOut.stop();
- }
-
- this._modalconnects.push(dojo.connect(window, "onscroll", this, "layout"));
- this._modalconnects.push(dojo.connect(dojo.doc.documentElement, "onkeypress", this, "_onKey"));
-
- dojo.style(this.domNode, "opacity", 0);
- this.domNode.style.visibility="";
- this.open = true;
- this._loadCheck(); // lazy load trigger
-
- this._position();
-
- this._fadeIn.play();
-
- this._savedFocus = dijit.getFocus(this);
-
- // find focusable Items each time dialog is shown since if dialog contains a widget the
- // first focusable items can change
- this._getFocusItems(this.domNode);
-
- // set timeout to allow the browser to render dialog
- setTimeout(dojo.hitch(this, function(){
- dijit.focus(this._firstFocusItem);
- }), 50);
- },
-
- 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;
- }
-
- if(this._fadeIn.status() == "playing"){
- this._fadeIn.stop();
- }
- this._fadeOut.play();
-
- 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));
- }
- this.open = false;
- },
-
- layout: function() {
- // summary: position the Dialog and the underlay
- if(this.domNode.style.visibility != "hidden"){
- this._underlay.layout();
- this._position();
- }
- },
-
- destroy: function(){
- dojo.forEach(this._modalconnects, dojo.disconnect);
- if(this.refocus && this.open){
- var fo = this._savedFocus;
- setTimeout(dojo.hitch(dijit,"focus",fo),25);
- }
- this.inherited(arguments);
- }
- }
-);
-
-dojo.declare(
- "dijit.TooltipDialog",
- [dijit.layout.ContentPane, dijit._Templated, dijit.form._FormMixin, dijit._DialogMixin],
- {
- // summary:
- // Pops up a dialog that appears like a Tooltip
- //
- // title: String
- // Description of tooltip dialog (required for a11Y)
- title: "",
-
- // doLayout: Boolean
- // Don't change this parameter from the default value.
- // This ContentPane parameter doesn't make sense for TooltipDialog, since TooltipDialog
- // is never a child of a layout container, nor can you specify the size of
- // TooltipDialog in order to control the size of an inner widget.
- doLayout: false,
-
- // _firstFocusItem: DomNode
- // The pointer to the first focusable node in the dialog
- _firstFocusItem:null,
-
- // _lastFocusItem: DomNode
- // The domNode that had focus before we took it.
- _lastFocusItem: null,
-
- templateString: null,
- templateString:"<div class=\"dijitTooltipDialog\" waiRole=\"presentation\">\n\t<div class=\"dijitTooltipContainer\" waiRole=\"presentation\">\n\t\t<div class =\"dijitTooltipContents dijitTooltipFocusNode\" dojoAttachPoint=\"containerNode\" tabindex=\"-1\" waiRole=\"dialog\"></div>\n\t</div>\n\t<div class=\"dijitTooltipConnector\" waiRole=\"presenation\"></div>\n</div>\n",
-
- postCreate: function(){
- this.inherited(arguments);
- this.connect(this.containerNode, "onkeypress", "_onKey");
- this.containerNode.title = this.title;
- },
-
- orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ corner){
- // summary: configure widget to be displayed in given position relative to the button
- this.domNode.className="dijitTooltipDialog " +" dijitTooltipAB"+(corner.charAt(1)=='L'?"Left":"Right")+" dijitTooltip"+(corner.charAt(0)=='T' ? "Below" : "Above");
- },
-
- onOpen: function(/*Object*/ pos){
- // summary: called when dialog is displayed
-
- this._getFocusItems(this.containerNode);
- this.orient(this.domNode,pos.aroundCorner, pos.corner);
- this._loadCheck(); // lazy load trigger
- dijit.focus(this._firstFocusItem);
- },
-
- _onKey: function(/*Event*/ evt){
- // summary: keep keyboard focus in dialog; close dialog on escape key
- var node = evt.target;
- if (evt.keyCode == dojo.keys.TAB){
- this._getFocusItems(this.containerNode);
- }
- var singleFocusItem = (this._firstFocusItem == this._lastFocusItem);
- if(evt.keyCode == dojo.keys.ESCAPE){
- this.onCancel();
- }else if(node == this._firstFocusItem && evt.shiftKey && evt.keyCode == dojo.keys.TAB){
- if(!singleFocusItem){
- dijit.focus(this._lastFocusItem); // send focus to last item in dialog
- }
- dojo.stopEvent(evt);
- }else if(node == this._lastFocusItem && evt.keyCode == dojo.keys.TAB && !evt.shiftKey){
- if(!singleFocusItem){
- dijit.focus(this._firstFocusItem); // send focus to first item in dialog
- }
- dojo.stopEvent(evt);
- }else if(evt.keyCode == dojo.keys.TAB){
- // we want the browser's default tab handling to move focus
- // but we don't want the tab to propagate upwards
- evt.stopPropagation();
- }
- }
- }
-);
-
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/Editor.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/Editor.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/Editor.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,373 +0,0 @@
-if(!dojo._hasResource["dijit.Editor"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.Editor"] = true;
-dojo.provide("dijit.Editor");
-dojo.require("dijit._editor.RichText");
-dojo.require("dijit.Toolbar");
-dojo.require("dijit._editor._Plugin");
-dojo.require("dijit._Container");
-dojo.require("dojo.i18n");
-dojo.requireLocalization("dijit._editor", "commands", null, "zh,pt,da,tr,ru,de,sv,ja,he,fi,nb,el,ar,pt-pt,cs,fr,es,ko,nl,zh-tw,pl,it,hu,ROOT");
-
-dojo.declare(
- "dijit.Editor",
- dijit._editor.RichText,
- {
- // summary: A rich-text Editing widget
-
- // plugins: Array
- // a list of plugin names (as strings) or instances (as objects)
- // for this widget.
- plugins: null,
-
- // extraPlugins: Array
- // a list of extra plugin names which will be appended to plugins array
- extraPlugins: null,
-
- constructor: function(){
- if(!dojo.isArray(this.plugins)){
- this.plugins=["undo","redo","|","cut","copy","paste","|","bold","italic","underline","strikethrough","|",
- "insertOrderedList","insertUnorderedList","indent","outdent","|","justifyLeft","justifyRight","justifyCenter","justifyFull"/*"createLink"*/];
- }
-
- this._plugins=[];
- this._editInterval = this.editActionInterval * 1000;
- },
-
- postCreate: function(){
- //for custom undo/redo
- if(this.customUndo){
- dojo['require']("dijit._editor.range");
- this._steps=this._steps.slice(0);
- this._undoedSteps=this._undoedSteps.slice(0);
-// this.addKeyHandler('z',this.KEY_CTRL,this.undo);
-// this.addKeyHandler('y',this.KEY_CTRL,this.redo);
- }
- if(dojo.isArray(this.extraPlugins)){
- this.plugins=this.plugins.concat(this.extraPlugins);
- }
-
-// try{
- this.inherited(arguments);
-// dijit.Editor.superclass.postCreate.apply(this, arguments);
-
- this.commands = dojo.i18n.getLocalization("dijit._editor", "commands", this.lang);
-
- if(!this.toolbar){
- // if we haven't been assigned a toolbar, create one
- this.toolbar = new dijit.Toolbar({});
- dojo.place(this.toolbar.domNode, this.editingArea, "before");
- }
-
- dojo.forEach(this.plugins, this.addPlugin, this);
- this.onNormalizedDisplayChanged(); //update toolbar button status
-// }catch(e){ console.debug(e); }
- },
- destroy: function(){
- dojo.forEach(this._plugins, function(p){
- if(p && p.destroy){
- p.destroy();
- }
- });
- this._plugins=[];
- this.toolbar.destroy(); delete this.toolbar;
- this.inherited(arguments);
- },
- addPlugin: function(/*String||Object*/plugin, /*Integer?*/index){
- // summary:
- // takes a plugin name as a string or a plugin instance and
- // adds it to the toolbar and associates it with this editor
- // instance. The resulting plugin is added to the Editor's
- // plugins array. If index is passed, it's placed in the plugins
- // array at that index. No big magic, but a nice helper for
- // passing in plugin names via markup.
- // plugin: String, args object or plugin instance. Required.
- // args: This object will be passed to the plugin constructor.
- // index:
- // Integer, optional. Used when creating an instance from
- // something already in this.plugins. Ensures that the new
- // instance is assigned to this.plugins at that index.
- var args=dojo.isString(plugin)?{name:plugin}:plugin;
- if(!args.setEditor){
- var o={"args":args,"plugin":null,"editor":this};
- dojo.publish(dijit._scopeName + ".Editor.getPlugin",[o]);
- if(!o.plugin){
- var pc = dojo.getObject(args.name);
- if(pc){
- o.plugin=new pc(args);
- }
- }
- if(!o.plugin){
- console.warn('Cannot find plugin',plugin);
- return;
- }
- plugin=o.plugin;
- }
- if(arguments.length > 1){
- this._plugins[index] = plugin;
- }else{
- this._plugins.push(plugin);
- }
- plugin.setEditor(this);
- if(dojo.isFunction(plugin.setToolbar)){
- plugin.setToolbar(this.toolbar);
- }
- },
- /* beginning of custom undo/redo support */
-
- // customUndo: Boolean
- // Whether we shall use custom undo/redo support instead of the native
- // browser support. By default, we only enable customUndo for IE, as it
- // has broken native undo/redo support. Note: the implementation does
- // support other browsers which have W3C DOM2 Range API.
- customUndo: dojo.isIE,
-
- // editActionInterval: Integer
- // When using customUndo, not every keystroke will be saved as a step.
- // Instead typing (including delete) will be grouped together: after
- // a user stop typing for editActionInterval seconds, a step will be
- // saved; if a user resume typing within editActionInterval seconds,
- // the timeout will be restarted. By default, editActionInterval is 3
- // seconds.
- editActionInterval: 3,
- beginEditing: function(cmd){
- if(!this._inEditing){
- this._inEditing=true;
- this._beginEditing(cmd);
- }
- if(this.editActionInterval>0){
- if(this._editTimer){
- clearTimeout(this._editTimer);
- }
- this._editTimer = setTimeout(dojo.hitch(this, this.endEditing), this._editInterval);
- }
- },
- _steps:[],
- _undoedSteps:[],
- execCommand: function(cmd){
- if(this.customUndo && (cmd=='undo' || cmd=='redo')){
- return this[cmd]();
- }else{
- try{
- if(this.customUndo){
- this.endEditing();
- this._beginEditing();
- }
- var r = this.inherited('execCommand',arguments);
- if(this.customUndo){
- this._endEditing();
- }
- return r;
- }catch(e){
- if(dojo.isMoz && /copy|cut|paste/.test(cmd)){
- // Warn user of platform limitation. Cannot programmatically access keyboard. See ticket #4136
- var sub = dojo.string.substitute,
- accel = {cut:'X', copy:'C', paste:'V'},
- isMac = navigator.userAgent.indexOf("Macintosh") != -1;
- alert(sub(this.commands.systemShortcutFF,
- [this.commands[cmd], sub(this.commands[isMac ? 'appleKey' : 'ctrlKey'], [accel[cmd]])]));
- }
- return false;
- }
- }
- },
- queryCommandEnabled: function(cmd){
- if(this.customUndo && (cmd=='undo' || cmd=='redo')){
- return cmd=='undo'?(this._steps.length>1):(this._undoedSteps.length>0);
- }else{
- return this.inherited('queryCommandEnabled',arguments);
- }
- },
- _moveToBookmark: function(b){
- var bookmark=b;
- if(dojo.isIE){
- if(dojo.isArray(b)){//IE CONTROL
- bookmark=[];
- dojo.forEach(b,function(n){
- bookmark.push(dijit.range.getNode(n,this.editNode));
- },this);
- }
- }else{//w3c range
- var r=dijit.range.create();
- r.setStart(dijit.range.getNode(b.startContainer,this.editNode),b.startOffset);
- r.setEnd(dijit.range.getNode(b.endContainer,this.editNode),b.endOffset);
- bookmark=r;
- }
- dojo.withGlobal(this.window,'moveToBookmark',dijit,[bookmark]);
- },
- _changeToStep: function(from,to){
- this.setValue(to.text);
- var b=to.bookmark;
- if(!b){ return; }
- this._moveToBookmark(b);
- },
- undo: function(){
-// console.log('undo');
- this.endEditing(true);
- var s=this._steps.pop();
- if(this._steps.length>0){
- this.focus();
- this._changeToStep(s,this._steps[this._steps.length-1]);
- this._undoedSteps.push(s);
- this.onDisplayChanged();
- return true;
- }
- return false;
- },
- redo: function(){
-// console.log('redo');
- this.endEditing(true);
- var s=this._undoedSteps.pop();
- if(s && this._steps.length>0){
- this.focus();
- this._changeToStep(this._steps[this._steps.length-1],s);
- this._steps.push(s);
- this.onDisplayChanged();
- return true;
- }
- return false;
- },
- endEditing: function(ignore_caret){
- if(this._editTimer){
- clearTimeout(this._editTimer);
- }
- if(this._inEditing){
- this._endEditing(ignore_caret);
- this._inEditing=false;
- }
- },
- _getBookmark: function(){
- var b=dojo.withGlobal(this.window,dijit.getBookmark);
- var tmp=[];
- if(dojo.isIE){
- if(dojo.isArray(b)){//CONTROL
- dojo.forEach(b,function(n){
- tmp.push(dijit.range.getIndex(n,this.editNode).o);
- },this);
- b=tmp;
- }
- }else{//w3c range
- tmp=dijit.range.getIndex(b.startContainer,this.editNode).o;
- b={startContainer:tmp,
- startOffset:b.startOffset,
- endContainer:b.endContainer===b.startContainer?tmp:dijit.range.getIndex(b.endContainer,this.editNode).o,
- endOffset:b.endOffset};
- }
- return b;
- },
- _beginEditing: function(cmd){
- if(this._steps.length===0){
- this._steps.push({'text':this.savedContent,'bookmark':this._getBookmark()});
- }
- },
- _endEditing: function(ignore_caret){
- var v=this.getValue(true);
-
- this._undoedSteps=[];//clear undoed steps
- this._steps.push({text: v, bookmark: this._getBookmark()});
- },
- onKeyDown: function(e){
- if(!this.customUndo){
- this.inherited('onKeyDown',arguments);
- return;
- }
- var k = e.keyCode, ks = dojo.keys;
- if(e.ctrlKey && !e.altKey){//undo and redo only if the special right Alt + z/y are not pressed #5892
- if(k == 90 || k == 122){ //z
- dojo.stopEvent(e);
- this.undo();
- return;
- }else if(k == 89 || k == 121){ //y
- dojo.stopEvent(e);
- this.redo();
- return;
- }
- }
- this.inherited('onKeyDown',arguments);
-
- switch(k){
- case ks.ENTER:
- case ks.BACKSPACE:
- case ks.DELETE:
- this.beginEditing();
- break;
- case 88: //x
- case 86: //v
- if(e.ctrlKey && !e.altKey && !e.metaKey){
- this.endEditing();//end current typing step if any
- if(e.keyCode == 88){
- this.beginEditing('cut');
- //use timeout to trigger after the cut is complete
- setTimeout(dojo.hitch(this, this.endEditing), 1);
- }else{
- this.beginEditing('paste');
- //use timeout to trigger after the paste is complete
- setTimeout(dojo.hitch(this, this.endEditing), 1);
- }
- break;
- }
- //pass through
- default:
- if(!e.ctrlKey && !e.altKey && !e.metaKey && (e.keyCode<dojo.keys.F1 || e.keyCode>dojo.keys.F15)){
- this.beginEditing();
- break;
- }
- //pass through
- case ks.ALT:
- this.endEditing();
- break;
- case ks.UP_ARROW:
- case ks.DOWN_ARROW:
- case ks.LEFT_ARROW:
- case ks.RIGHT_ARROW:
- case ks.HOME:
- case ks.END:
- case ks.PAGE_UP:
- case ks.PAGE_DOWN:
- this.endEditing(true);
- break;
- //maybe ctrl+backspace/delete, so don't endEditing when ctrl is pressed
- case ks.CTRL:
- case ks.SHIFT:
- case ks.TAB:
- break;
- }
- },
- _onBlur: function(){
- this.inherited('_onBlur',arguments);
- this.endEditing(true);
- },
- onClick: function(){
- this.endEditing(true);
- this.inherited('onClick',arguments);
- }
- /* end of custom undo/redo support */
- }
-);
-
-/* the following code is to registered a handler to get default plugins */
-dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
- if(o.plugin){ return; }
- var args = o.args, p;
- var _p = dijit._editor._Plugin;
- var name = args.name;
- switch(name){
- case "undo": case "redo": case "cut": case "copy": case "paste": case "insertOrderedList":
- case "insertUnorderedList": case "indent": case "outdent": case "justifyCenter":
- case "justifyFull": case "justifyLeft": case "justifyRight": case "delete":
- case "selectAll": case "removeFormat":
- case "insertHorizontalRule":
- p = new _p({ command: name });
- break;
-
- case "bold": case "italic": case "underline": case "strikethrough":
- case "subscript": case "superscript":
- p = new _p({ buttonClass: dijit.form.ToggleButton, command: name });
- break;
- case "|":
- p = new _p({ button: new dijit.ToolbarSeparator() });
- }
-// console.log('name',name,p);
- o.plugin=p;
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/InlineEditBox.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/InlineEditBox.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/InlineEditBox.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,422 +0,0 @@
-if(!dojo._hasResource["dijit.InlineEditBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.InlineEditBox"] = true;
-dojo.provide("dijit.InlineEditBox");
-
-dojo.require("dojo.i18n");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Container");
-dojo.require("dijit.form.Button");
-dojo.require("dijit.form.TextBox");
-
-dojo.requireLocalization("dijit", "common", null, "zh,pt,da,tr,ru,de,sv,ja,he,fi,nb,el,ar,ROOT,pt-pt,cs,fr,es,ko,nl,zh-tw,pl,it,hu");
-
-dojo.declare("dijit.InlineEditBox",
- dijit._Widget,
- {
- // summary: An element with in-line edit capabilitites
- //
- // description:
- // Behavior for an existing node (`<p>`, `<div>`, `<span>`, etc.) so that
- // when you click it, an editor shows up in place of the original
- // text. Optionally, Save and Cancel button are displayed below the edit widget.
- // When Save is clicked, the text is pulled from the edit
- // widget and redisplayed and the edit widget is again hidden.
- // By default a plain Textarea widget is used as the editor (or for
- // inline values a TextBox), but you can specify an editor such as
- // dijit.Editor (for editing HTML) or a Slider (for adjusting a number).
- // An edit widget must support the following API to be used:
- // String getDisplayedValue() OR String getValue()
- // void setDisplayedValue(String) OR void setValue(String)
- // void focus()
- //
- // editing: Boolean
- // Is the node currently in edit mode?
- editing: false,
-
- // autoSave: Boolean
- // Changing the value automatically saves it; don't have to push save button
- // (and save button isn't even displayed)
- autoSave: true,
-
- // buttonSave: String
- // Save button label
- buttonSave: "",
-
- // buttonCancel: String
- // Cancel button label
- buttonCancel: "",
-
- // renderAsHtml: Boolean
- // Set this to true if the specified Editor's value should be interpreted as HTML
- // rather than plain text (ie, dijit.Editor)
- renderAsHtml: false,
-
- // editor: String
- // Class name for Editor widget
- editor: "dijit.form.TextBox",
-
- // editorParams: Object
- // Set of parameters for editor, like {required: true}
- editorParams: {},
-
- onChange: function(value){
- // summary: User should set this handler to be notified of changes to value
- },
-
- // width: String
- // Width of editor. By default it's width=100% (ie, block mode)
- width: "100%",
-
- // value: String
- // The display value of the widget in read-only mode
- value: "",
-
- // noValueIndicator: String
- // The text that gets displayed when there is no value (so that the user has a place to click to edit)
- noValueIndicator: "<span style='font-family: wingdings; text-decoration: underline;'> ✍ </span>",
-
- postMixInProperties: function(){
- this.inherited('postMixInProperties', arguments);
-
- // save pointer to original source node, since Widget nulls-out srcNodeRef
- this.displayNode = this.srcNodeRef;
-
- // connect handlers to the display node
- var events = {
- ondijitclick: "_onClick",
- onmouseover: "_onMouseOver",
- onmouseout: "_onMouseOut",
- onfocus: "_onMouseOver",
- onblur: "_onMouseOut"
- };
- for(var name in events){
- this.connect(this.displayNode, name, events[name]);
- }
- dijit.setWaiRole(this.displayNode, "button");
- if(!this.displayNode.getAttribute("tabIndex")){
- this.displayNode.setAttribute("tabIndex", 0);
- }
-
- this.setValue(this.value || this.displayNode.innerHTML);
- },
-
- setDisabled: function(/*Boolean*/ disabled){
- // summary:
- // Set disabled state of widget.
-
- this.disabled = disabled;
- dijit.setWaiState(this.focusNode || this.domNode, "disabled", disabled);
- },
-
- _onMouseOver: function(){
- dojo.addClass(this.displayNode, this.disabled ? "dijitDisabledClickableRegion" : "dijitClickableRegion");
- },
-
- _onMouseOut: function(){
- dojo.removeClass(this.displayNode, this.disabled ? "dijitDisabledClickableRegion" : "dijitClickableRegion");
- },
-
- _onClick: function(/*Event*/ e){
- if(this.disabled){ return; }
- if(e){ dojo.stopEvent(e); }
- this._onMouseOut();
-
- // Since FF gets upset if you move a node while in an event handler for that node...
- setTimeout(dojo.hitch(this, "_edit"), 0);
- },
-
- _edit: function(){
- // summary: display the editor widget in place of the original (read only) markup
-
- this.editing = true;
-
- var editValue =
- (this.renderAsHtml ?
- this.value :
- this.value.replace(/\s*\r?\n\s*/g,"").replace(/<br\/?>/gi, "\n").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&"));
-
- // Placeholder for edit widget
- // Put place holder (and eventually editWidget) before the display node so that it's positioned correctly
- // when Calendar dropdown appears, which happens automatically on focus.
- var placeholder = dojo.doc.createElement("span");
- dojo.place(placeholder, this.domNode, "before");
-
- var ew = this.editWidget = new dijit._InlineEditor({
- value: dojo.trim(editValue),
- autoSave: this.autoSave,
- buttonSave: this.buttonSave,
- buttonCancel: this.buttonCancel,
- renderAsHtml: this.renderAsHtml,
- editor: this.editor,
- editorParams: this.editorParams,
- style: dojo.getComputedStyle(this.displayNode),
- save: dojo.hitch(this, "save"),
- cancel: dojo.hitch(this, "cancel"),
- width: this.width
- }, placeholder);
-
- // to avoid screen jitter, we first create the editor with position:absolute, visibility:hidden,
- // and then when it's finished rendering, we switch from display mode to editor
- var ews = ew.domNode.style;
- this.displayNode.style.display="none";
- ews.position = "static";
- ews.visibility = "visible";
-
- // Replace the display widget with edit widget, leaving them both displayed for a brief time so that
- // focus can be shifted without incident. (browser may needs some time to render the editor.)
- this.domNode = ew.domNode;
- setTimeout(function(){
- ew.focus();
- }, 100);
- },
-
- _showText: function(/*Boolean*/ focus){
- // summary: revert to display mode, and optionally focus on display node
-
- // display the read-only text and then quickly hide the editor (to avoid screen jitter)
- this.displayNode.style.display="";
- var ew = this.editWidget;
- var ews = ew.domNode.style;
- ews.position="absolute";
- ews.visibility="hidden";
-
- this.domNode = this.displayNode;
-
- if(focus){
- dijit.focus(this.displayNode);
- }
- ews.display = "none";
- // give the browser some time to render the display node and then shift focus to it
- // and hide the edit widget before garbage collecting the edit widget
- setTimeout(function(){
- ew.destroy();
- delete ew;
- if(dojo.isIE){
- // messing with the DOM tab order can cause IE to focus the body - so restore
- dijit.focus(dijit.getFocus());
- }
- }, 1000); // no hurry - wait for things to quiesce
- },
-
- save: function(/*Boolean*/ focus){
- // summary:
- // Save the contents of the editor and revert to display mode.
- // focus: Boolean
- // Focus on the display mode text
- this.editing = false;
-
- var value = this.editWidget.getValue() + "";
- if(!this.renderAsHtml){
- value = value.replace(/&/gm, "&").replace(/</gm, "<").replace(/>/gm, ">").replace(/"/gm, """)
- .replace(/\n/g, "<br>");
- }
- this.setValue(value);
-
- // tell the world that we have changed
- this.onChange(value);
-
- this._showText(focus);
- },
-
- setValue: function(/*String*/ val){
- // summary: inserts specified HTML value into this node, or an "input needed" character if node is blank
- this.value = val;
- this.displayNode.innerHTML = dojo.trim(val) || this.noValueIndicator;
- },
-
- getValue: function(){
- return this.value;
- },
-
- cancel: function(/*Boolean*/ focus){
- // summary:
- // Revert to display mode, discarding any changes made in the editor
- this.editing = false;
- this._showText(focus);
- }
-});
-
-dojo.declare(
- "dijit._InlineEditor",
- [dijit._Widget, dijit._Templated],
-{
- // summary:
- // internal widget used by InlineEditBox, displayed when in editing mode
- // to display the editor and maybe save/cancel buttons. Calling code should
- // connect to save/cancel methods to detect when editing is finished
- //
- // Has mainly the same parameters as InlineEditBox, plus these values:
- //
- // style: Object
- // Set of CSS attributes of display node, to replicate in editor
- //
- // value: String
- // Value as an HTML string or plain text string, depending on renderAsHTML flag
-
- templateString:"<fieldset dojoAttachPoint=\"editNode\" waiRole=\"presentation\" style=\"position: absolute; visibility:hidden\" class=\"dijitReset dijitInline\"\n\tdojoAttachEvent=\"onkeypress: _onKeyPress\" \n\t><input dojoAttachPoint=\"editorPlaceholder\"\n\t/><span dojoAttachPoint=\"buttonContainer\"\n\t\t><button class='saveButton' dojoAttachPoint=\"saveButton\" dojoType=\"dijit.form.Button\" dojoAttachEvent=\"onClick:save\" disabled=\"true\">${buttonSave}</button\n\t\t><button class='cancelButton' dojoAttachPoint=\"cancelButton\" dojoType=\"dijit.form.Button\" dojoAttachEvent=\"onClick:cancel\">${buttonCancel}</button\n\t></span\n></fieldset>\n",
- widgetsInTemplate: true,
-
- postMixInProperties: function(){
- this.inherited('postMixInProperties', arguments);
- this.messages = dojo.i18n.getLocalization("dijit", "common", this.lang);
- dojo.forEach(["buttonSave", "buttonCancel"], function(prop){
- if(!this[prop]){ this[prop] = this.messages[prop]; }
- }, this);
- },
-
- postCreate: function(){
- // Create edit widget in place in the template
- var cls = dojo.getObject(this.editor);
- var ew = this.editWidget = new cls(this.editorParams, this.editorPlaceholder);
-
- // Copy the style from the source
- // Don't copy ALL properties though, just the necessary/applicable ones
- var srcStyle = this.style;
- dojo.forEach(["fontWeight","fontFamily","fontSize","fontStyle"], function(prop){
- ew.focusNode.style[prop]=srcStyle[prop];
- }, this);
- dojo.forEach(["marginTop","marginBottom","marginLeft", "marginRight"], function(prop){
- this.domNode.style[prop]=srcStyle[prop];
- }, this);
- if(this.width=="100%"){
- // block mode
- ew.domNode.style.width = "100%"; // because display: block doesn't work for table widgets
- this.domNode.style.display="block";
- }else{
- // inline-block mode
- ew.domNode.style.width = this.width + (Number(this.width)==this.width ? "px" : "");
- }
-
- this.connect(ew, "onChange", "_onChange");
-
- // Monitor keypress on the edit widget. Note that edit widgets do a stopEvent() on ESC key (to
- // prevent Dialog from closing when the user just wants to revert the value in the edit widget),
- // so this is the only way we can see the key press event.
- this.connect(ew.focusNode || ew.domNode, "onkeypress", "_onKeyPress");
-
- // priorityChange=false will prevent bogus onChange event
- (this.editWidget.setDisplayedValue||this.editWidget.setValue).call(this.editWidget, this.value, false);
-
- this._initialText = this.getValue();
-
- if(this.autoSave){
- this.buttonContainer.style.display="none";
- }
- },
-
- destroy: function(){
- this.editWidget.destroy();
- this.inherited(arguments);
- },
-
- getValue: function(){
- var ew = this.editWidget;
- return ew.getDisplayedValue ? ew.getDisplayedValue() : ew.getValue();
- },
-
- _onKeyPress: function(e){
- // summary: Callback when keypress in the edit box (see template).
- // description:
- // For autoSave widgets, if Esc/Enter, call cancel/save.
- // For non-autoSave widgets, enable save button if the text value is
- // different than the original value.
- if(this._exitInProgress){
- return;
- }
- if(this.autoSave){
- if(e.altKey || e.ctrlKey){ return; }
- // If Enter/Esc pressed, treat as save/cancel.
- if(e.keyCode == dojo.keys.ESCAPE){
- dojo.stopEvent(e);
- this._exitInProgress = true;
- this.cancel(true);
- }else if(e.keyCode == dojo.keys.ENTER){
- dojo.stopEvent(e);
- this._exitInProgress = true;
- this.save(true);
- }else if(e.keyCode == dojo.keys.TAB){
- this._exitInProgress = true;
- // allow the TAB to change focus before we mess with the DOM: #6227
- // Expounding by request:
- // The current focus is on the edit widget input field.
- // save() will hide and destroy this widget.
- // We want the focus to jump from the currently hidden
- // displayNode, but since it's hidden, it's impossible to
- // unhide it, focus it, and then have the browser focus
- // away from it to the next focusable element since each
- // of these events is asynchronous and the focus-to-next-element
- // is already queued.
- // So we allow the browser time to unqueue the move-focus event
- // before we do all the hide/show stuff.
- setTimeout(dojo.hitch(this, "save", false), 0);
- }
- }else{
- var _this = this;
- // Delay before calling getValue().
- // The delay gives the browser a chance to update the Textarea.
- setTimeout(
- function(){
- _this.saveButton.setAttribute("disabled", _this.getValue() == _this._initialText);
- }, 100);
- }
- },
-
- _onBlur: function(){
- // summary:
- // Called when focus moves outside the editor
- this.inherited(arguments);
- if(this._exitInProgress){
- // when user clicks the "save" button, focus is shifted back to display text, causing this
- // function to be called, but in that case don't do anything
- return;
- }
- if(this.autoSave){
- this._exitInProgress = true;
- if(this.getValue() == this._initialText){
- this.cancel(false);
- }else{
- this.save(false);
- }
- }
- },
-
- enableSave: function(){
- // summary: User replacable function returning a Boolean to indicate
- // if the Save button should be enabled or not - usually due to invalid conditions
- return this.editWidget.isValid ? this.editWidget.isValid() : true; // Boolean
- },
-
- _onChange: function(){
- // summary:
- // Called when the underlying widget fires an onChange event,
- // which means that the user has finished entering the value
- if(this._exitInProgress){
- // TODO: the onChange event might happen after the return key for an async widget
- // like FilteringSelect. Shouldn't be deleting the edit widget on end-of-edit
- return;
- }
- if(this.autoSave){
- this._exitInProgress = true;
- this.save(true);
- }else{
- // in case the keypress event didn't get through (old problem with Textarea that has been fixed
- // in theory) or if the keypress event comes too quickly and the value inside the Textarea hasn't
- // been updated yet)
- this.saveButton.setAttribute("disabled", (this.getValue() == this._initialText) || !this.enableSave());
- }
- },
-
- enableSave: function(){
- // summary: User replacable function returning a Boolean to indicate
- // if the Save button should be enabled or not - usually due to invalid conditions
- return this.editWidget.isValid ? this.editWidget.isValid() : true;
- },
-
- focus: function(){
- this.editWidget.focus();
- dijit.selectInputText(this.editWidget.focusNode);
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/Menu.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/Menu.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/Menu.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,487 +0,0 @@
-if(!dojo._hasResource["dijit.Menu"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.Menu"] = true;
-dojo.provide("dijit.Menu");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Container");
-dojo.require("dijit._Templated");
-
-dojo.declare("dijit.Menu",
- [dijit._Widget, dijit._Templated, dijit._KeyNavContainer],
- {
- // summary
- // A context menu you can assign to multiple elements
-
- constructor: function(){
- this._bindings = [];
- },
-
- templateString:
- '<table class="dijit dijitMenu dijitReset dijitMenuTable" waiRole="menu" dojoAttachEvent="onkeypress:_onKeyPress">' +
- '<tbody class="dijitReset" dojoAttachPoint="containerNode"></tbody>'+
- '</table>',
-
- // targetNodeIds: String[]
- // Array of dom node ids of nodes to attach to.
- // Fill this with nodeIds upon widget creation and it becomes context menu for those nodes.
- targetNodeIds: [],
-
- // contextMenuForWindow: Boolean
- // if true, right clicking anywhere on the window will cause this context menu to open;
- // if false, must specify targetNodeIds
- contextMenuForWindow: false,
-
- // leftClickToOpen: Boolean
- // If true, menu will open on left click instead of right click, similiar to a file menu.
- leftClickToOpen: false,
-
- // parentMenu: Widget
- // pointer to menu that displayed me
- parentMenu: null,
-
- // popupDelay: Integer
- // number of milliseconds before hovering (without clicking) causes the popup to automatically open
- popupDelay: 500,
-
- // _contextMenuWithMouse: Boolean
- // used to record mouse and keyboard events to determine if a context
- // menu is being opened with the keyboard or the mouse
- _contextMenuWithMouse: false,
-
- postCreate: function(){
- if(this.contextMenuForWindow){
- this.bindDomNode(dojo.body());
- }else{
- dojo.forEach(this.targetNodeIds, this.bindDomNode, this);
- }
- this.connectKeyNavHandlers([dojo.keys.UP_ARROW], [dojo.keys.DOWN_ARROW]);
- },
-
- startup: function(){
- if(this._started){ return; }
-
- dojo.forEach(this.getChildren(), function(child){ child.startup(); });
- this.startupKeyNavChildren();
-
- this.inherited(arguments);
- },
-
- onExecute: function(){
- // summary: attach point for notification about when a menu item has been executed
- },
-
- onCancel: function(/*Boolean*/ closeAll){
- // summary: attach point for notification about when the user cancels the current menu
- },
-
- _moveToPopup: function(/*Event*/ evt){
- if(this.focusedChild && this.focusedChild.popup && !this.focusedChild.disabled){
- this.focusedChild._onClick(evt);
- }
- },
-
- _onKeyPress: function(/*Event*/ evt){
- // summary: Handle keyboard based menu navigation.
- if(evt.ctrlKey || evt.altKey){ return; }
-
- switch(evt.keyCode){
- case dojo.keys.RIGHT_ARROW:
- this._moveToPopup(evt);
- dojo.stopEvent(evt);
- break;
- case dojo.keys.LEFT_ARROW:
- if(this.parentMenu){
- this.onCancel(false);
- }else{
- dojo.stopEvent(evt);
- }
- break;
- }
- },
-
- onItemHover: function(/*MenuItem*/ item){
- // summary: Called when cursor is over a MenuItem
- this.focusChild(item);
-
- if(this.focusedChild.popup && !this.focusedChild.disabled && !this.hover_timer){
- this.hover_timer = setTimeout(dojo.hitch(this, "_openPopup"), this.popupDelay);
- }
- },
-
- _onChildBlur: function(item){
- // summary: Close all popups that are open and descendants of this menu
- dijit.popup.close(item.popup);
- item._blur();
- this._stopPopupTimer();
- },
-
- onItemUnhover: function(/*MenuItem*/ item){
- // summary: Callback fires when mouse exits a MenuItem
- },
-
- _stopPopupTimer: function(){
- if(this.hover_timer){
- clearTimeout(this.hover_timer);
- this.hover_timer = null;
- }
- },
-
- _getTopMenu: function(){
- for(var top=this; top.parentMenu; top=top.parentMenu);
- return top;
- },
-
- onItemClick: function(/*Widget*/ item, /*Event*/ evt){
- // summary: user defined function to handle clicks on an item
- if(item.disabled){ return false; }
-
- if(item.popup){
- if(!this.is_open){
- this._openPopup();
- }
- }else{
- // before calling user defined handler, close hierarchy of menus
- // and restore focus to place it was when menu was opened
- this.onExecute();
-
- // user defined handler for click
- item.onClick(evt);
- }
- },
-
- // thanks burstlib!
- _iframeContentWindow: function(/* HTMLIFrameElement */iframe_el){
- // summary:
- // Returns the window reference of the passed iframe
- var win = dijit.getDocumentWindow(dijit.Menu._iframeContentDocument(iframe_el)) ||
- // Moz. TODO: is this available when defaultView isn't?
- dijit.Menu._iframeContentDocument(iframe_el)['__parent__'] ||
- (iframe_el.name && dojo.doc.frames[iframe_el.name]) || null;
- return win; // Window
- },
-
- _iframeContentDocument: function(/* HTMLIFrameElement */iframe_el){
- // summary:
- // Returns a reference to the document object inside iframe_el
- var doc = iframe_el.contentDocument // W3
- || (iframe_el.contentWindow && iframe_el.contentWindow.document) // IE
- || (iframe_el.name && dojo.doc.frames[iframe_el.name] && dojo.doc.frames[iframe_el.name].document)
- || null;
- return doc; // HTMLDocument
- },
-
- bindDomNode: function(/*String|DomNode*/ node){
- // summary: attach menu to given node
- node = dojo.byId(node);
-
- //TODO: this is to support context popups in Editor. Maybe this shouldn't be in dijit.Menu
- var win = dijit.getDocumentWindow(node.ownerDocument);
- if(node.tagName.toLowerCase()=="iframe"){
- win = this._iframeContentWindow(node);
- node = dojo.withGlobal(win, dojo.body);
- }
-
- // to capture these events at the top level,
- // attach to document, not body
- var cn = (node == dojo.body() ? dojo.doc : node);
-
- node[this.id] = this._bindings.push([
- dojo.connect(cn, (this.leftClickToOpen)?"onclick":"oncontextmenu", this, "_openMyself"),
- dojo.connect(cn, "onkeydown", this, "_contextKey"),
- dojo.connect(cn, "onmousedown", this, "_contextMouse")
- ]);
- },
-
- unBindDomNode: function(/*String|DomNode*/ nodeName){
- // summary: detach menu from given node
- var node = dojo.byId(nodeName);
- if(node){
- var bid = node[this.id]-1, b = this._bindings[bid];
- dojo.forEach(b, dojo.disconnect);
- delete this._bindings[bid];
- }
- },
-
- _contextKey: function(e){
- this._contextMenuWithMouse = false;
- if(e.keyCode == dojo.keys.F10){
- dojo.stopEvent(e);
- if(e.shiftKey && e.type=="keydown"){
- // FF: copying the wrong property from e will cause the system
- // context menu to appear in spite of stopEvent. Don't know
- // exactly which properties cause this effect.
- var _e = { target: e.target, pageX: e.pageX, pageY: e.pageY };
- _e.preventDefault = _e.stopPropagation = function(){};
- // IE: without the delay, focus work in "open" causes the system
- // context menu to appear in spite of stopEvent.
- window.setTimeout(dojo.hitch(this, function(){ this._openMyself(_e); }), 1);
- }
- }
- },
-
- _contextMouse: function(e){
- this._contextMenuWithMouse = true;
- },
-
- _openMyself: function(/*Event*/ e){
- // summary:
- // Internal function for opening myself when the user
- // does a right-click or something similar
-
- if(this.leftClickToOpen&&e.button>0){
- return;
- }
- dojo.stopEvent(e);
-
- // Get coordinates.
- // if we are opening the menu with the mouse or on safari open
- // the menu at the mouse cursor
- // (Safari does not have a keyboard command to open the context menu
- // and we don't currently have a reliable way to determine
- // _contextMenuWithMouse on Safari)
- var x,y;
- if(dojo.isSafari || this._contextMenuWithMouse){
- x=e.pageX;
- y=e.pageY;
- }else{
- // otherwise open near e.target
- var coords = dojo.coords(e.target, true);
- x = coords.x + 10;
- y = coords.y + 10;
- }
-
- var self=this;
- var savedFocus = dijit.getFocus(this);
- function closeAndRestoreFocus(){
- // user has clicked on a menu or popup
- dijit.focus(savedFocus);
- dijit.popup.close(self);
- }
- dijit.popup.open({
- popup: this,
- x: x,
- y: y,
- onExecute: closeAndRestoreFocus,
- onCancel: closeAndRestoreFocus,
- orient: this.isLeftToRight() ? 'L' : 'R'
- });
- this.focus();
-
- this._onBlur = function(){
- this.inherited('_onBlur', arguments);
- // Usually the parent closes the child widget but if this is a context
- // menu then there is no parent
- dijit.popup.close(this);
- // don't try to restore focus; user has clicked another part of the screen
- // and set focus there
- }
- },
-
- onOpen: function(/*Event*/ e){
- // summary: Open menu relative to the mouse
- this.isShowingNow = true;
- },
-
- onClose: function(){
- // summary: callback when this menu is closed
- this._stopPopupTimer();
- this.parentMenu = null;
- this.isShowingNow = false;
- this.currentPopup = null;
- if(this.focusedChild){
- this._onChildBlur(this.focusedChild);
- this.focusedChild = null;
- }
- },
-
- _openPopup: function(){
- // summary: open the popup to the side of the current menu item
- this._stopPopupTimer();
- var from_item = this.focusedChild;
- var popup = from_item.popup;
-
- if(popup.isShowingNow){ return; }
- popup.parentMenu = this;
- var self = this;
- dijit.popup.open({
- parent: this,
- popup: popup,
- around: from_item.arrowCell,
- orient: this.isLeftToRight() ? {'TR': 'TL', 'TL': 'TR'} : {'TL': 'TR', 'TR': 'TL'},
- onCancel: function(){
- // called when the child menu is canceled
- dijit.popup.close(popup);
- from_item.focus(); // put focus back on my node
- self.currentPopup = null;
- }
- });
-
- this.currentPopup = popup;
-
- if(popup.focus){
- popup.focus();
- }
- },
-
- uninitialize: function(){
- dojo.forEach(this.targetNodeIds, this.unBindDomNode, this);
- this.inherited(arguments);
- }
-}
-);
-
-dojo.declare("dijit.MenuItem",
- [dijit._Widget, dijit._Templated, dijit._Contained],
- {
- // summary: A line item in a Menu Widget
-
- // Make 3 columns
- // icon, label, and expand arrow (BiDi-dependent) indicating sub-menu
- templateString:
- '<tr class="dijitReset dijitMenuItem" '
- +'dojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">'
- +'<td class="dijitReset"><div class="dijitMenuItemIcon ${iconClass}" dojoAttachPoint="iconNode"></div></td>'
- +'<td tabIndex="-1" class="dijitReset dijitMenuItemLabel" dojoAttachPoint="containerNode,focusNode" waiRole="menuitem"></td>'
- +'<td class="dijitReset" dojoAttachPoint="arrowCell">'
- +'<div class="dijitMenuExpand" dojoAttachPoint="expand" style="display:none">'
- +'<span class="dijitInline dijitArrowNode dijitMenuExpandInner">+</span>'
- +'</div>'
- +'</td>'
- +'</tr>',
-
- // label: String
- // menu text
- label: '',
-
- // iconClass: String
- // class to apply to div in button to make it display an icon
- iconClass: "",
-
- // disabled: Boolean
- // if true, the menu item is disabled
- // if false, the menu item is enabled
- disabled: false,
-
- postCreate: function(){
- dojo.setSelectable(this.domNode, false);
- this.setDisabled(this.disabled);
- if(this.label){
- this.setLabel(this.label);
- }
- },
-
- _onHover: function(){
- // summary: callback when mouse is moved onto menu item
- this.getParent().onItemHover(this);
- },
-
- _onUnhover: function(){
- // summary: callback when mouse is moved off of menu item
-
- // if we are unhovering the currently selected item
- // then unselect it
- this.getParent().onItemUnhover(this);
- },
-
- _onClick: function(evt){
- this.getParent().onItemClick(this, evt);
- dojo.stopEvent(evt);
- },
-
- onClick: function(/*Event*/ evt){
- // summary: User defined function to handle clicks
- },
-
- focus: function(){
- dojo.addClass(this.domNode, 'dijitMenuItemHover');
- try{
- dijit.focus(this.containerNode);
- }catch(e){
- // this throws on IE (at least) in some scenarios
- }
- },
-
- _blur: function(){
- dojo.removeClass(this.domNode, 'dijitMenuItemHover');
- },
-
- setLabel: function(/*String*/ value){
- this.containerNode.innerHTML=this.label=value;
- },
-
- setDisabled: function(/*Boolean*/ value){
- // summary: enable or disable this menu item
- this.disabled = value;
- dojo[value ? "addClass" : "removeClass"](this.domNode, 'dijitMenuItemDisabled');
- dijit.setWaiState(this.containerNode, 'disabled', value ? 'true' : 'false');
- }
-});
-
-dojo.declare("dijit.PopupMenuItem",
- dijit.MenuItem,
- {
- _fillContent: function(){
- // summary: The innerHTML contains both the menu item text and a popup widget
- // description: the first part holds the menu item text and the second part is the popup
- // example:
- // | <div dojoType="dijit.PopupMenuItem">
- // | <span>pick me</span>
- // | <popup> ... </popup>
- // | </div>
- if(this.srcNodeRef){
- var nodes = dojo.query("*", this.srcNodeRef);
- dijit.PopupMenuItem.superclass._fillContent.call(this, nodes[0]);
-
- // save pointer to srcNode so we can grab the drop down widget after it's instantiated
- this.dropDownContainer = this.srcNodeRef;
- }
- },
-
- startup: function(){
- if(this._started){ return; }
- this.inherited(arguments);
-
- // we didn't copy the dropdown widget from the this.srcNodeRef, so it's in no-man's
- // land now. move it to dojo.doc.body.
- if(!this.popup){
- var node = dojo.query("[widgetId]", this.dropDownContainer)[0];
- this.popup = dijit.byNode(node);
- }
- dojo.body().appendChild(this.popup.domNode);
-
- this.popup.domNode.style.display="none";
- dojo.addClass(this.expand, "dijitMenuExpandEnabled");
- dojo.style(this.expand, "display", "");
- dijit.setWaiState(this.containerNode, "haspopup", "true");
- },
-
- destroyDescendants: function(){
- if(this.popup){
- this.popup.destroyRecursive();
- delete this.popup;
- }
- this.inherited(arguments);
- }
-});
-
-dojo.declare("dijit.MenuSeparator",
- [dijit._Widget, dijit._Templated, dijit._Contained],
- {
- // summary: A line between two menu items
-
- templateString: '<tr class="dijitMenuSeparator"><td colspan=3>'
- +'<div class="dijitMenuSeparatorTop"></div>'
- +'<div class="dijitMenuSeparatorBottom"></div>'
- +'</td></tr>',
-
- postCreate: function(){
- dojo.setSelectable(this.domNode, false);
- },
-
- isFocusable: function(){
- // summary: over ride to always return false
- return false; // Boolean
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/ProgressBar.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/ProgressBar.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/ProgressBar.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,95 +0,0 @@
-if(!dojo._hasResource["dijit.ProgressBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.ProgressBar"] = true;
-dojo.provide("dijit.ProgressBar");
-
-dojo.require("dojo.fx");
-dojo.require("dojo.number");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Templated");
-
-dojo.declare("dijit.ProgressBar", [dijit._Widget, dijit._Templated], {
- // summary: A progress indication widget
- //
- // example:
- // | <div dojoType="ProgressBar"
- // | places="0"
- // | progress="..." maximum="...">
- // | </div>
- //
- // progress: String (Percentage or Number)
- // initial progress value.
- // with "%": percentage value, 0% <= progress <= 100%
- // or without "%": absolute value, 0 <= progress <= maximum
- progress: "0",
-
- // maximum: Float
- // max sample number
- maximum: 100,
-
- // places: Number
- // number of places to show in values; 0 by default
- places: 0,
-
- // indeterminate: Boolean
- // If false: show progress.
- // If true: show that a process is underway but that the progress is unknown
- indeterminate: false,
-
- templateString:"<div class=\"dijitProgressBar dijitProgressBarEmpty\"\n\t><div waiRole=\"progressbar\" tabindex=\"0\" dojoAttachPoint=\"internalProgress\" class=\"dijitProgressBarFull\"\n\t\t><div class=\"dijitProgressBarTile\"></div\n\t\t><span style=\"visibility:hidden\"> </span\n\t></div\n\t><div dojoAttachPoint=\"label\" class=\"dijitProgressBarLabel\" id=\"${id}_label\"> </div\n\t><img dojoAttachPoint=\"inteterminateHighContrastImage\" class=\"dijitProgressBarIndeterminateHighContrastImage\"\n\t></img\n></div>\n",
-
- _indeterminateHighContrastImagePath:
- dojo.moduleUrl("dijit", "themes/a11y/indeterminate_progress.gif"),
-
- // public functions
- postCreate: function(){
- this.inherited("postCreate",arguments);
- this.inteterminateHighContrastImage.setAttribute("src",
- this._indeterminateHighContrastImagePath);
- this.update();
- },
-
- update: function(/*Object?*/attributes){
- // summary: update progress information
- //
- // attributes: may provide progress and/or maximum properties on this parameter,
- // see attribute specs for details.
- dojo.mixin(this, attributes||{});
- var percent = 1, classFunc;
- if(this.indeterminate){
- classFunc = "addClass";
- dijit.removeWaiState(this.internalProgress, "valuenow");
- dijit.removeWaiState(this.internalProgress, "valuemin");
- dijit.removeWaiState(this.internalProgress, "valuemax");
- }else{
- classFunc = "removeClass";
- if(String(this.progress).indexOf("%") != -1){
- percent = Math.min(parseFloat(this.progress)/100, 1);
- this.progress = percent * this.maximum;
- }else{
- this.progress = Math.min(this.progress, this.maximum);
- percent = this.progress / this.maximum;
- }
- var text = this.report(percent);
- this.label.firstChild.nodeValue = text;
- dijit.setWaiState(this.internalProgress, "describedby", this.label.id);
- dijit.setWaiState(this.internalProgress, "valuenow", this.progress);
- dijit.setWaiState(this.internalProgress, "valuemin", 0);
- dijit.setWaiState(this.internalProgress, "valuemax", this.maximum);
- }
- dojo[classFunc](this.domNode, "dijitProgressBarIndeterminate");
- this.internalProgress.style.width = (percent * 100) + "%";
- this.onChange();
- },
-
- report: function(/*float*/percent){
- // Generates message to show; may be overridden by user
- return dojo.number.format(percent, {type: "percent", places: this.places, locale: this.lang});
- },
-
- onChange: function(){
- // summary: User definable function fired when progress updates.
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/TitlePane.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/TitlePane.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/TitlePane.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,157 +0,0 @@
-if(!dojo._hasResource["dijit.TitlePane"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.TitlePane"] = true;
-dojo.provide("dijit.TitlePane");
-
-dojo.require("dojo.fx");
-
-dojo.require("dijit._Templated");
-dojo.require("dijit.layout.ContentPane");
-
-dojo.declare(
- "dijit.TitlePane",
- [dijit.layout.ContentPane, dijit._Templated],
-{
- // summary: A pane with a title on top, that can be opened or collapsed.
- //
- // description: An accessible container with a Title Heading, and a content
- // section that slides open and closed. TitlePane is an extension to
- // ContentPane, providing all the usesful content-control aspects from.
- //
- // example:
- // | // load a TitlePane from remote file:
- // | var foo = new dijit.TitlePane({ href: "foobar.html", title:"Title" });
- // | foo.startup();
- //
- // example:
- // | <!-- markup href example: -->
- // | <div dojoType="dijit.TitlePane" href="foobar.html" title="Title"></div>
- //
- // example:
- // | <!-- markup with inline data -->
- // | <div dojoType="dijit.TitlePane" title="Title">
- // | <p>I am content</p>
- // | </div>
- //
- // title: String
- // Title of the pane
- title: "",
-
- // open: Boolean
- // Whether pane is opened or closed.
- open: true,
-
- // duration: Integer
- // Time in milliseconds to fade in/fade out
- duration: 250,
-
- // baseClass: String
- // The root className to use for the various states of this widget
- baseClass: "dijitTitlePane",
-
- templateString:"<div class=\"${baseClass}\">\n\t<div dojoAttachEvent=\"onclick:toggle,onkeypress: _onTitleKey,onfocus:_handleFocus,onblur:_handleFocus\" tabindex=\"0\"\n\t\t\twaiRole=\"button\" class=\"dijitTitlePaneTitle\" dojoAttachPoint=\"titleBarNode,focusNode\">\n\t\t<div dojoAttachPoint=\"arrowNode\" class=\"dijitInline dijitArrowNode\"><span dojoAttachPoint=\"arrowNodeInner\" class=\"dijitArrowNodeInner\"></span></div>\n\t\t<div dojoAttachPoint=\"titleNode\" class=\"dijitTitlePaneTextNode\"></div>\n\t</div>\n\t<div class=\"dijitTitlePaneContentOuter\" dojoAttachPoint=\"hideNode\">\n\t\t<div class=\"dijitReset\" dojoAttachPoint=\"wipeNode\">\n\t\t\t<div class=\"dijitTitlePaneContentInner\" dojoAttachPoint=\"containerNode\" waiRole=\"region\" tabindex=\"-1\">\n\t\t\t\t<!-- nested divs because wipeIn()/wipeOut() doesn't work right on node w/padding etc. Put padding on inner div. -->\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n",
-
- postCreate: function(){
- this.setTitle(this.title);
- if(!this.open){
- this.hideNode.style.display = this.wipeNode.style.display = "none";
- }
- this._setCss();
- dojo.setSelectable(this.titleNode, false);
- this.inherited(arguments);
- dijit.setWaiState(this.containerNode, "labelledby", this.titleNode.id);
- dijit.setWaiState(this.focusNode, "haspopup", "true");
-
- // setup open/close animations
- var hideNode = this.hideNode, wipeNode = this.wipeNode;
- this._wipeIn = dojo.fx.wipeIn({
- node: this.wipeNode,
- duration: this.duration,
- beforeBegin: function(){
- hideNode.style.display="";
- }
- });
- this._wipeOut = dojo.fx.wipeOut({
- node: this.wipeNode,
- duration: this.duration,
- onEnd: function(){
- hideNode.style.display="none";
- }
- });
- },
-
- setContent: function(content){
- // summary:
- // Typically called when an href is loaded. Our job is to make the animation smooth
- if(!this.open || this._wipeOut.status() == "playing"){
- // we are currently *closing* the pane (or the pane is closed), so just let that continue
- this.inherited(arguments);
- }else{
- if(this._wipeIn.status() == "playing"){
- this._wipeIn.stop();
- }
-
- // freeze container at current height so that adding new content doesn't make it jump
- dojo.marginBox(this.wipeNode, { h: dojo.marginBox(this.wipeNode).h });
-
- // add the new content (erasing the old content, if any)
- this.inherited(arguments);
-
- // call _wipeIn.play() to animate from current height to new height
- this._wipeIn.play();
- }
- },
-
- toggle: function(){
- // summary: switches between opened and closed state
- dojo.forEach([this._wipeIn, this._wipeOut], function(animation){
- if(animation.status() == "playing"){
- animation.stop();
- }
- });
-
- this[this.open ? "_wipeOut" : "_wipeIn"].play();
- this.open =! this.open;
-
- // load content (if this is the first time we are opening the TitlePane
- // and content is specified as an href, or we have setHref when hidden)
- this._loadCheck();
-
- this._setCss();
- },
-
- _setCss: function(){
- // summary: set the open/close css state for the TitlePane
- var classes = ["dijitClosed", "dijitOpen"];
- var boolIndex = this.open;
- var node = this.titleBarNode || this.focusNode
- dojo.removeClass(node, classes[!boolIndex+0]);
- node.className += " " + classes[boolIndex+0];
-
- // provide a character based indicator for images-off mode
- this.arrowNodeInner.innerHTML = this.open ? "-" : "+";
- },
-
- _onTitleKey: function(/*Event*/ e){
- // summary: callback when user hits a key
- if(e.keyCode == dojo.keys.ENTER || e.charCode == dojo.keys.SPACE){
- this.toggle();
- }else if(e.keyCode == dojo.keys.DOWN_ARROW && this.open){
- this.containerNode.focus();
- e.preventDefault();
- }
- },
-
- _handleFocus: function(/*Event*/ e){
- // summary: handle blur and focus for this widget
-
- // add/removeClass is safe to call without hasClass in this case
- dojo[(e.type == "focus" ? "addClass" : "removeClass")](this.focusNode, this.baseClass + "Focused");
- },
-
- setTitle: function(/*String*/ title){
- // summary: sets the text of the title
- this.titleNode.innerHTML = title;
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/Toolbar.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/Toolbar.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/Toolbar.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,54 +0,0 @@
-if(!dojo._hasResource["dijit.Toolbar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.Toolbar"] = true;
-dojo.provide("dijit.Toolbar");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Container");
-dojo.require("dijit._Templated");
-
-dojo.declare("dijit.Toolbar",
- [dijit._Widget, dijit._Templated, dijit._KeyNavContainer],
- {
- // summary: A Toolbar widget, used to hold things like dijit.Editor buttons
-
- templateString:
- '<div class="dijit dijitToolbar" waiRole="toolbar" tabIndex="${tabIndex}" dojoAttachPoint="containerNode">' +
- // '<table style="table-layout: fixed" class="dijitReset dijitToolbarTable">' + // factor out style
- // '<tr class="dijitReset" dojoAttachPoint="containerNode"></tr>'+
- // '</table>' +
- '</div>',
-
- tabIndex: "0",
-
- postCreate: function(){
- this.connectKeyNavHandlers(
- this.isLeftToRight() ? [dojo.keys.LEFT_ARROW] : [dojo.keys.RIGHT_ARROW],
- this.isLeftToRight() ? [dojo.keys.RIGHT_ARROW] : [dojo.keys.LEFT_ARROW]
- );
- },
-
- startup: function(){
- if(this._started){ return; }
-
- this.startupKeyNavChildren();
-
- this.inherited(arguments);
- }
-}
-);
-
-// Combine with dijit.MenuSeparator??
-dojo.declare("dijit.ToolbarSeparator",
- [ dijit._Widget, dijit._Templated ],
- {
- // summary: A spacer between two Toolbar items
- templateString: '<div class="dijitToolbarSeparator dijitInline"></div>',
- postCreate: function(){ dojo.setSelectable(this.domNode, false); },
- isFocusable: function(){
- // summary: This widget isn't focusable, so pass along that fact.
- return false;
- }
-
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/Tooltip.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/Tooltip.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/Tooltip.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,292 +0,0 @@
-if(!dojo._hasResource["dijit.Tooltip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.Tooltip"] = true;
-dojo.provide("dijit.Tooltip");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Templated");
-
-dojo.declare(
- "dijit._MasterTooltip",
- [dijit._Widget, dijit._Templated],
- {
- // summary
- // Internal widget that holds the actual tooltip markup,
- // which occurs once per page.
- // Called by Tooltip widgets which are just containers to hold
- // the markup
-
- // duration: Integer
- // Milliseconds to fade in/fade out
- duration: 200,
-
- templateString:"<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\">\n\t<div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" waiRole='alert'></div>\n\t<div class=\"dijitTooltipConnector\"></div>\n</div>\n",
-
- postCreate: function(){
- dojo.body().appendChild(this.domNode);
-
- this.bgIframe = new dijit.BackgroundIframe(this.domNode);
-
- // Setup fade-in and fade-out functions.
- this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
- this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
-
- },
-
- show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position){
- // summary:
- // Display tooltip w/specified contents to right specified node
- // (To left if there's no space on the right, or if LTR==right)
-
- if(this.aroundNode && this.aroundNode === aroundNode){
- return;
- }
-
- if(this.fadeOut.status() == "playing"){
- // previous tooltip is being hidden; wait until the hide completes then show new one
- this._onDeck=arguments;
- return;
- }
- this.containerNode.innerHTML=innerHTML;
-
- // Firefox bug. when innerHTML changes to be shorter than previous
- // one, the node size will not be updated until it moves.
- this.domNode.style.top = (this.domNode.offsetTop + 1) + "px";
-
- // position the element and change CSS according to position[] (a list of positions to try)
- var align = {};
- var ltr = this.isLeftToRight();
- dojo.forEach( (position && position.length) ? position : dijit.Tooltip.defaultPosition, function(pos){
- switch(pos){
- case "after":
- align[ltr ? "BR" : "BL"] = ltr ? "BL" : "BR";
- break;
- case "before":
- align[ltr ? "BL" : "BR"] = ltr ? "BR" : "BL";
- break;
- case "below":
- // first try to align left borders, next try to align right borders (or reverse for RTL mode)
- align[ltr ? "BL" : "BR"] = ltr ? "TL" : "TR";
- align[ltr ? "BR" : "BL"] = ltr ? "TR" : "TL";
- break;
- case "above":
- default:
- // first try to align left borders, next try to align right borders (or reverse for RTL mode)
- align[ltr ? "TL" : "TR"] = ltr ? "BL" : "BR";
- align[ltr ? "TR" : "TL"] = ltr ? "BR" : "BL";
- break;
- }
- });
- var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, align, dojo.hitch(this, "orient"));
-
- // show it
- dojo.style(this.domNode, "opacity", 0);
- this.fadeIn.play();
- this.isShowingNow = true;
- this.aroundNode = aroundNode;
- },
-
- orient: function(/* DomNode */ node, /* String */ aroundCorner, /* String */ tooltipCorner){
- // summary: private function to set CSS for tooltip node based on which position it's in
- node.className = "dijitTooltip " +
- {
- "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
- "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
- "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
- "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
- "BR-BL": "dijitTooltipRight",
- "BL-BR": "dijitTooltipLeft"
- }[aroundCorner + "-" + tooltipCorner];
- },
-
- _onShow: function(){
- if(dojo.isIE){
- // the arrow won't show up on a node w/an opacity filter
- this.domNode.style.filter="";
- }
- },
-
- hide: function(aroundNode){
- // summary: hide the tooltip
- if(!this.aroundNode || this.aroundNode !== aroundNode){
- return;
- }
- if(this._onDeck){
- // this hide request is for a show() that hasn't even started yet;
- // just cancel the pending show()
- this._onDeck=null;
- return;
- }
- this.fadeIn.stop();
- this.isShowingNow = false;
- this.aroundNode = null;
- this.fadeOut.play();
- },
-
- _onHide: function(){
- this.domNode.style.cssText=""; // to position offscreen again
- if(this._onDeck){
- // a show request has been queued up; do it now
- this.show.apply(this, this._onDeck);
- this._onDeck=null;
- }
- }
-
- }
-);
-
-dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position){
- // summary:
- // Display tooltip w/specified contents in specified position.
- // See description of dijit.Tooltip.defaultPosition for details on position parameter.
- // If position is not specified then dijit.Tooltip.defaultPosition is used.
- if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
- return dijit._masterTT.show(innerHTML, aroundNode, position);
-};
-
-dijit.hideTooltip = function(aroundNode){
- // summary: hide the tooltip
- if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
- return dijit._masterTT.hide(aroundNode);
-};
-
-dojo.declare(
- "dijit.Tooltip",
- dijit._Widget,
- {
- // summary
- // Pops up a tooltip (a help message) when you hover over a node.
-
- // label: String
- // Text to display in the tooltip.
- // Specified as innerHTML when creating the widget from markup.
- label: "",
-
- // showDelay: Integer
- // Number of milliseconds to wait after hovering over/focusing on the object, before
- // the tooltip is displayed.
- showDelay: 400,
-
- // connectId: String[]
- // Id(s) of domNodes to attach the tooltip to.
- // When user hovers over any of the specified dom nodes, the tooltip will appear.
- connectId: [],
-
- // position: String[]
- // See description of dijit.Tooltip.defaultPosition for details on position parameter.
- position: [],
-
- postCreate: function(){
- if(this.srcNodeRef){
- this.srcNodeRef.style.display = "none";
- }
-
- this._connectNodes = [];
-
- dojo.forEach(this.connectId, function(id) {
- var node = dojo.byId(id);
- if (node) {
- this._connectNodes.push(node);
- dojo.forEach(["onMouseOver", "onMouseOut", "onFocus", "onBlur", "onHover", "onUnHover"], function(event){
- this.connect(node, event.toLowerCase(), "_"+event);
- }, this);
- if(dojo.isIE){
- // BiDi workaround
- node.style.zoom = 1;
- }
- }
- }, this);
- },
-
- _onMouseOver: function(/*Event*/ e){
- this._onHover(e);
- },
-
- _onMouseOut: function(/*Event*/ e){
- if(dojo.isDescendant(e.relatedTarget, e.target)){
- // false event; just moved from target to target child; ignore.
- return;
- }
- this._onUnHover(e);
- },
-
- _onFocus: function(/*Event*/ e){
- this._focus = true;
- this._onHover(e);
- this.inherited(arguments);
- },
-
- _onBlur: function(/*Event*/ e){
- this._focus = false;
- this._onUnHover(e);
- this.inherited(arguments);
- },
-
- _onHover: function(/*Event*/ e){
- if(!this._showTimer){
- var target = e.target;
- this._showTimer = setTimeout(dojo.hitch(this, function(){this.open(target)}), this.showDelay);
- }
- },
-
- _onUnHover: function(/*Event*/ e){
- // keep a tooltip open if the associated element has focus
- if(this._focus){ return; }
- if(this._showTimer){
- clearTimeout(this._showTimer);
- delete this._showTimer;
- }
- this.close();
- },
-
- open: function(/*DomNode*/ target){
- // summary: display the tooltip; usually not called directly.
- target = target || this._connectNodes[0];
- if(!target){ return; }
-
- if(this._showTimer){
- clearTimeout(this._showTimer);
- delete this._showTimer;
- }
- dijit.showTooltip(this.label || this.domNode.innerHTML, target, this.position);
-
- this._connectNode = target;
- },
-
- close: function(){
- // summary: hide the tooltip; usually not called directly.
- dijit.hideTooltip(this._connectNode);
- delete this._connectNode;
- if(this._showTimer){
- clearTimeout(this._showTimer);
- delete this._showTimer;
- }
- },
-
- uninitialize: function(){
- this.close();
- }
- }
-);
-
-// dijit.Tooltip.defaultPosition: String[]
-// This variable controls the position of tooltips, if the position is not specified to
-// the Tooltip widget or *TextBox widget itself. It's an array of strings with the following values:
-//
-// * before: places tooltip to the left of the target node/widget, or to the right in
-// the case of RTL scripts like Hebrew and Arabic
-// * after: places tooltip to the right of the target node/widget, or to the left in
-// the case of RTL scripts like Hebrew and Arabic
-// * above: tooltip goes above target node
-// * below: tooltip goes below target node
-//
-// The list is positions is tried, in order, until a position is found where the tooltip fits
-// within the viewport.
-//
-// Be careful setting this parameter. A value of "above" may work fine until the user scrolls
-// the screen so that there's no room above the target node. Nodes with drop downs, like
-// DropDownButton or FilteringSelect, are especially problematic, in that you need to be sure
-// that the drop down and tooltip don't overlap, even when the viewport is scrolled so that there
-// is only room below (or above) the target node, but not both.
-dijit.Tooltip.defaultPosition = ["after", "before"];
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/Tree.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/Tree.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/Tree.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,1336 +0,0 @@
-if(!dojo._hasResource["dijit.Tree"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit.Tree"] = true;
-dojo.provide("dijit.Tree");
-
-dojo.require("dojo.fx");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Templated");
-dojo.require("dijit._Container");
-dojo.require("dojo.cookie");
-
-dojo.declare(
- "dijit._TreeNode",
- [dijit._Widget, dijit._Templated, dijit._Container, dijit._Contained],
-{
- // summary
- // Single node within a tree
-
- // item: dojo.data.Item
- // the dojo.data entry this tree represents
- item: null,
-
- isTreeNode: true,
-
- // label: String
- // Text of this tree node
- label: "",
-
- isExpandable: null, // show expando node
-
- isExpanded: false,
-
- // state: String
- // dynamic loading-related stuff.
- // When an empty folder node appears, it is "UNCHECKED" first,
- // then after dojo.data query it becomes "LOADING" and, finally "LOADED"
- state: "UNCHECKED",
-
- templateString:"<div class=\"dijitTreeNode\" waiRole=\"presentation\"\n\t><div dojoAttachPoint=\"rowNode\" waiRole=\"presentation\"\n\t\t><span dojoAttachPoint=\"expandoNode\" class=\"dijitTreeExpando\" waiRole=\"presentation\"\n\t\t></span\n\t\t><span dojoAttachPoint=\"expandoNodeText\" class=\"dijitExpandoText\" waiRole=\"presentation\"\n\t\t></span\n\t\t><div dojoAttachPoint=\"contentNode\" class=\"dijitTreeContent\" waiRole=\"presentation\">\n\t\t\t<div dojoAttachPoint=\"iconNode\" class=\"dijitInline dijitTreeIcon\" waiRole=\"presentation\"></div>\n\t\t\t<span dojoAttachPoint=\"labelNode\" class=\"dijitTreeLabel\" wairole=\"treeitem\" tabindex=\"-1\" waiState=\"selected-false\" dojoAttachEvent=\"onfocus:_onNodeFocus\"></span>\n\t\t</div\n\t></div>\n</div>\n",
-
- postCreate: function(){
- // set label, escaping special characters
- this.setLabelNode(this.label);
-
- // set expand icon for leaf
- this._setExpando();
-
- // set icon and label class based on item
- this._updateItemClasses(this.item);
-
- if(this.isExpandable){
- dijit.setWaiState(this.labelNode, "expanded", this.isExpanded);
- }
- },
-
- markProcessing: function(){
- // summary: visually denote that tree is loading data, etc.
- this.state = "LOADING";
- this._setExpando(true);
- },
-
- unmarkProcessing: function(){
- // summary: clear markup from markProcessing() call
- this._setExpando(false);
- },
-
- _updateItemClasses: function(item){
- // summary: set appropriate CSS classes for icon and label dom node (used to allow for item updates to change respective CSS)
- var tree = this.tree, model = tree.model;
- if(tree._v10Compat && item === model.root){
- // For back-compat with 1.0, need to use null to specify root item (TODO: remove in 2.0)
- item = null;
- }
- this.iconNode.className = "dijitInline dijitTreeIcon " + tree.getIconClass(item, this.isExpanded);
- this.labelNode.className = "dijitTreeLabel " + tree.getLabelClass(item, this.isExpanded);
- },
-
- _updateLayout: function(){
- // summary: set appropriate CSS classes for this.domNode
- var parent = this.getParent();
- if(!parent || parent.rowNode.style.display == "none"){
- /* if we are hiding the root node then make every first level child look like a root node */
- dojo.addClass(this.domNode, "dijitTreeIsRoot");
- }else{
- dojo.toggleClass(this.domNode, "dijitTreeIsLast", !this.getNextSibling());
- }
- },
-
- _setExpando: function(/*Boolean*/ processing){
- // summary: set the right image for the expando node
-
- // apply the appropriate class to the expando node
- var styles = ["dijitTreeExpandoLoading", "dijitTreeExpandoOpened",
- "dijitTreeExpandoClosed", "dijitTreeExpandoLeaf"];
- var idx = processing ? 0 : (this.isExpandable ? (this.isExpanded ? 1 : 2) : 3);
- dojo.forEach(styles,
- function(s){
- dojo.removeClass(this.expandoNode, s);
- }, this
- );
- dojo.addClass(this.expandoNode, styles[idx]);
-
- // provide a non-image based indicator for images-off mode
- this.expandoNodeText.innerHTML =
- processing ? "*" :
- (this.isExpandable ?
- (this.isExpanded ? "-" : "+") : "*");
- },
-
- expand: function(){
- // summary: show my children
- if(this.isExpanded){ return; }
- // cancel in progress collapse operation
- if(this._wipeOut.status() == "playing"){
- this._wipeOut.stop();
- }
-
- this.isExpanded = true;
- dijit.setWaiState(this.labelNode, "expanded", "true");
- dijit.setWaiRole(this.containerNode, "group");
- this.contentNode.className = "dijitTreeContent dijitTreeContentExpanded";
- this._setExpando();
- this._updateItemClasses(this.item);
-
- this._wipeIn.play();
- },
-
- collapse: function(){
- if(!this.isExpanded){ return; }
-
- // cancel in progress expand operation
- if(this._wipeIn.status() == "playing"){
- this._wipeIn.stop();
- }
-
- this.isExpanded = false;
- dijit.setWaiState(this.labelNode, "expanded", "false");
- this.contentNode.className = "dijitTreeContent";
- this._setExpando();
- this._updateItemClasses(this.item);
-
- this._wipeOut.play();
- },
-
- setLabelNode: function(label){
- this.labelNode.innerHTML="";
- this.labelNode.appendChild(dojo.doc.createTextNode(label));
- },
-
- setChildItems: function(/* Object[] */ items){
- // summary:
- // Sets the child items of this node, removing/adding nodes
- // from current children to match specified items[] array.
-
- var tree = this.tree,
- model = tree.model;
-
- // Orphan all my existing children.
- // If items contains some of the same items as before then we will reattach them.
- // Don't call this.removeChild() because that will collapse the tree etc.
- this.getChildren().forEach(function(child){
- dijit._Container.prototype.removeChild.call(this, child);
- }, this);
-
- this.state = "LOADED";
-
- if(items && items.length > 0){
- this.isExpandable = true;
- if(!this.containerNode){ // maybe this node was unfolderized and still has container
- this.containerNode = this.tree.containerNodeTemplate.cloneNode(true);
- this.domNode.appendChild(this.containerNode);
- }
-
- // Create _TreeNode widget for each specified tree node, unless one already
- // exists and isn't being used (presumably it's from a DnD move and was recently
- // released
- dojo.forEach(items, function(item){
- var id = model.getIdentity(item),
- existingNode = tree._itemNodeMap[id],
- node =
- ( existingNode && !existingNode.getParent() ) ?
- existingNode :
- new dijit._TreeNode({
- item: item,
- tree: tree,
- isExpandable: model.mayHaveChildren(item),
- label: tree.getLabel(item)
- });
- this.addChild(node);
- // note: this won't work if there are two nodes for one item (multi-parented items); will be fixed later
- tree._itemNodeMap[id] = node;
- if(this.tree.persist){
- if(tree._openedItemIds[id]){
- tree._expandNode(node);
- }
- }
- }, this);
-
- // note that updateLayout() needs to be called on each child after
- // _all_ the children exist
- dojo.forEach(this.getChildren(), function(child, idx){
- child._updateLayout();
- });
- }else{
- this.isExpandable=false;
- }
-
- if(this._setExpando){
- // change expando to/from dot or + icon, as appropriate
- this._setExpando(false);
- }
-
- // On initial tree show, put focus on either the root node of the tree,
- // or the first child, if the root node is hidden
- if(!this.parent){
- var fc = this.tree.showRoot ? this : this.getChildren()[0],
- tabnode = fc ? fc.labelNode : this.domNode;
- tabnode.setAttribute("tabIndex", "0");
- }
-
- // create animations for showing/hiding the children (if children exist)
- if(this.containerNode && !this._wipeIn){
- this._wipeIn = dojo.fx.wipeIn({node: this.containerNode, duration: 150});
- this._wipeOut = dojo.fx.wipeOut({node: this.containerNode, duration: 150});
- }
- },
-
- removeChild: function(/* treeNode */ node){
- this.inherited(arguments);
-
- var children = this.getChildren();
- if(children.length == 0){
- this.isExpandable = false;
- this.collapse();
- }
-
- dojo.forEach(children, function(child){
- child._updateLayout();
- });
- },
-
- makeExpandable: function(){
- //summary
- // if this node wasn't already showing the expando node,
- // turn it into one and call _setExpando()
- this.isExpandable = true;
- this._setExpando(false);
- },
-
- _onNodeFocus: function(evt){
- var node = dijit.getEnclosingWidget(evt.target);
- this.tree._onTreeFocus(node);
- }
-});
-
-dojo.declare(
- "dijit.Tree",
- [dijit._Widget, dijit._Templated],
-{
- // summary
- // This widget displays hierarchical data from a store. A query is specified
- // to get the "top level children" from a data store, and then those items are
- // queried for their children and so on (but lazily, as the user clicks the expand node).
- //
- // Thus in the default mode of operation this widget is technically a forest, not a tree,
- // in that there can be multiple "top level children". However, if you specify label,
- // then a special top level node (not corresponding to any item in the datastore) is
- // created, to father all the top level children.
-
- // store: String||dojo.data.Store
- // The store to get data to display in the tree.
- // May remove for 2.0 in favor of "model".
- store: null,
-
- // model: dijit.Tree.model
- // Alternate interface from store to access data (and changes to data) in the tree
- model: null,
-
- // query: anything
- // Specifies datastore query to return the root item for the tree.
- //
- // Deprecated functionality: if the query returns multiple items, the tree is given
- // a fake root node (not corresponding to any item in the data store),
- // whose children are the items that match this query.
- //
- // The root node is shown or hidden based on whether a label is specified.
- //
- // Having a query return multiple items is deprecated.
- // If your store doesn't have a root item, wrap the store with
- // dijit.tree.ForestStoreModel, and specify model=myModel
- //
- // example:
- // {type:'continent'}
- query: null,
-
- // label: String
- // Deprecated. Use dijit.tree.ForestStoreModel directly instead.
- // Used in conjunction with query parameter.
- // If a query is specified (rather than a root node id), and a label is also specified,
- // then a fake root node is created and displayed, with this label.
- label: "",
-
- // showRoot: Boolean
- // Should the root node be displayed, or hidden?
- showRoot: true,
-
- // childrenAttr: String[]
- // one ore more attributes that holds children of a tree node
- childrenAttr: ["children"],
-
- // openOnClick: Boolean
- // If true, clicking a folder node's label will open it, rather than calling onClick()
- openOnClick: false,
-
- templateString:"<div class=\"dijitTreeContainer\" waiRole=\"tree\"\n\tdojoAttachEvent=\"onclick:_onClick,onkeypress:_onKeyPress\">\n</div>\n",
-
- isExpandable: true,
-
- isTree: true,
-
- // persist: Boolean
- // enables/disables use of cookies for state saving.
- persist: true,
-
- // dndController: String
- // class name to use as as the dnd controller
- dndController: null,
-
- //parameters to pull off of the tree and pass on to the dndController as its params
- dndParams: ["onDndDrop","itemCreator","onDndCancel","checkAcceptance", "checkItemAcceptance"],
-
- //declare the above items so they can be pulled from the tree's markup
- onDndDrop:null,
- itemCreator:null,
- onDndCancel:null,
- checkAcceptance:null,
- checkItemAcceptance:null,
-
- _publish: function(/*String*/ topicName, /*Object*/ message){
- // summary:
- // Publish a message for this widget/topic
- dojo.publish(this.id, [dojo.mixin({tree: this, event: topicName}, message||{})]);
- },
-
- postMixInProperties: function(){
- this.tree = this;
-
- this._itemNodeMap={};
-
- if(!this.cookieName){
- this.cookieName = this.id + "SaveStateCookie";
- }
- },
-
- postCreate: function(){
- // load in which nodes should be opened automatically
- if(this.persist){
- var cookie = dojo.cookie(this.cookieName);
- this._openedItemIds = {};
- if(cookie){
- dojo.forEach(cookie.split(','), function(item){
- this._openedItemIds[item] = true;
- }, this);
- }
- }
-
- // make template for container node (we will clone this and insert it into
- // any nodes that have children)
- var div = dojo.doc.createElement('div');
- div.style.display = 'none';
- div.className = "dijitTreeContainer";
- dijit.setWaiRole(div, "presentation");
- this.containerNodeTemplate = div;
-
- // Create glue between store and Tree, if not specified directly by user
- if(!this.model){
- this._store2model();
- }
-
- // monitor changes to items
- this.connect(this.model, "onChange", "_onItemChange");
- this.connect(this.model, "onChildrenChange", "_onItemChildrenChange");
- // TODO: monitor item deletes so we don't end up w/orphaned nodes?
-
- this._load();
-
- this.inherited("postCreate", arguments);
-
- if(this.dndController){
- if(dojo.isString(this.dndController)){
- this.dndController= dojo.getObject(this.dndController);
- }
- var params={};
- for (var i=0; i<this.dndParams.length;i++){
- if(this[this.dndParams[i]]){
- params[this.dndParams[i]]=this[this.dndParams[i]];
- }
- }
- this.dndController= new this.dndController(this, params);
- }
- },
-
- _store2model: function(){
- // summary: user specified a store&query rather than model, so create model from store/query
- this._v10Compat = true;
- dojo.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");
-
- var modelParams = {
- id: this.id + "_ForestStoreModel",
- store: this.store,
- query: this.query,
- childrenAttrs: this.childrenAttr
- };
-
- // Only override the model's mayHaveChildren() method if the user has specified an override
- if(this.params.mayHaveChildren){
- modelParams.mayHaveChildren = dojo.hitch(this, "mayHaveChildren");
- }
-
- if(this.params.getItemChildren){
- modelParams.getChildren = dojo.hitch(this, function(item, onComplete, onError){
- this.getItemChildren((this._v10Compat && item === this.model.root) ? null : item, onComplete, onError);
- });
- }
- this.model = new dijit.tree.ForestStoreModel(modelParams);
-
- // For backwards compatibility, the visibility of the root node is controlled by
- // whether or not the user has specified a label
- this.showRoot = Boolean(this.label);
- },
-
- _load: function(){
- // summary: initial load of the tree
- // load root node (possibly hidden) and it's children
- this.model.getRoot(
- dojo.hitch(this, function(item){
- var rn = this.rootNode = new dijit._TreeNode({
- item: item,
- tree: this,
- isExpandable: true,
- label: this.label || this.getLabel(item)
- });
- if(!this.showRoot){
- rn.rowNode.style.display="none";
- }
- this.domNode.appendChild(rn.domNode);
- this._itemNodeMap[this.model.getIdentity(item)] = rn;
-
- rn._updateLayout(); // sets "dijitTreeIsRoot" CSS classname
-
- // load top level children
- this._expandNode(rn);
- }),
- function(err){
- console.error(this, ": error loading root: ", err);
- }
- );
- },
-
- ////////////// Data store related functions //////////////////////
- // These just get passed to the model; they are here for back-compat
-
- mayHaveChildren: function(/*dojo.data.Item*/ item){
- // summary
- // User overridable function to tell if an item has or may have children.
- // Controls whether or not +/- expando icon is shown.
- // (For efficiency reasons we may not want to check if an element actually
- // has children until user clicks the expando node)
- },
-
- getItemChildren: function(/*dojo.data.Item*/ parentItem, /*function(items)*/ onComplete){
- // summary
- // User overridable function that return array of child items of given parent item,
- // or if parentItem==null then return top items in tree
- },
-
- ///////////////////////////////////////////////////////
- // Functions for converting an item to a TreeNode
- getLabel: function(/*dojo.data.Item*/ item){
- // summary: user overridable function to get the label for a tree node (given the item)
- return this.model.getLabel(item); // String
- },
-
- getIconClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
- // summary: user overridable function to return CSS class name to display icon
- return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "dijitLeaf"
- },
-
- getLabelClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened){
- // summary: user overridable function to return CSS class name to display label
- },
-
- /////////// Keyboard and Mouse handlers ////////////////////
-
- _onKeyPress: function(/*Event*/ e){
- // summary: translates keypress events into commands for the controller
- if(e.altKey){ return; }
- var treeNode = dijit.getEnclosingWidget(e.target);
- if(!treeNode){ return; }
-
- // Note: On IE e.keyCode is not 0 for printables so check e.charCode.
- // In dojo charCode is universally 0 for non-printables.
- if(e.charCode){ // handle printables (letter navigation)
- // Check for key navigation.
- var navKey = e.charCode;
- if(!e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey){
- navKey = (String.fromCharCode(navKey)).toLowerCase();
- this._onLetterKeyNav( { node: treeNode, key: navKey } );
- dojo.stopEvent(e);
- }
- }else{ // handle non-printables (arrow keys)
- var map = this._keyHandlerMap;
- if(!map){
- // setup table mapping keys to events
- map = {};
- map[dojo.keys.ENTER]="_onEnterKey";
- map[this.isLeftToRight() ? dojo.keys.LEFT_ARROW : dojo.keys.RIGHT_ARROW]="_onLeftArrow";
- map[this.isLeftToRight() ? dojo.keys.RIGHT_ARROW : dojo.keys.LEFT_ARROW]="_onRightArrow";
- map[dojo.keys.UP_ARROW]="_onUpArrow";
- map[dojo.keys.DOWN_ARROW]="_onDownArrow";
- map[dojo.keys.HOME]="_onHomeKey";
- map[dojo.keys.END]="_onEndKey";
- this._keyHandlerMap = map;
- }
- if(this._keyHandlerMap[e.keyCode]){
- this[this._keyHandlerMap[e.keyCode]]( { node: treeNode, item: treeNode.item } );
- dojo.stopEvent(e);
- }
- }
- },
-
- _onEnterKey: function(/*Object*/ message){
- this._publish("execute", { item: message.item, node: message.node} );
- this.onClick(message.item, message.node);
- },
-
- _onDownArrow: function(/*Object*/ message){
- // summary: down arrow pressed; get next visible node, set focus there
- var node = this._getNextNode(message.node);
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- },
-
- _onUpArrow: function(/*Object*/ message){
- // summary: up arrow pressed; move to previous visible node
-
- var node = message.node;
-
- // if younger siblings
- var previousSibling = node.getPreviousSibling();
- if(previousSibling){
- node = previousSibling;
- // if the previous node is expanded, dive in deep
- while(node.isExpandable && node.isExpanded && node.hasChildren()){
- // move to the last child
- var children = node.getChildren();
- node = children[children.length-1];
- }
- }else{
- // if this is the first child, return the parent
- // unless the parent is the root of a tree with a hidden root
- var parent = node.getParent();
- if(!(!this.showRoot && parent === this.rootNode)){
- node = parent;
- }
- }
-
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- },
-
- _onRightArrow: function(/*Object*/ message){
- // summary: right arrow pressed; go to child node
- var node = message.node;
-
- // if not expanded, expand, else move to 1st child
- if(node.isExpandable && !node.isExpanded){
- this._expandNode(node);
- }else if(node.hasChildren()){
- node = node.getChildren()[0];
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- }
- },
-
- _onLeftArrow: function(/*Object*/ message){
- // summary:
- // Left arrow pressed.
- // If not collapsed, collapse, else move to parent.
-
- var node = message.node;
-
- if(node.isExpandable && node.isExpanded){
- this._collapseNode(node);
- }else{
- node = node.getParent();
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- }
- },
-
- _onHomeKey: function(){
- // summary: home pressed; get first visible node, set focus there
- var node = this._getRootOrFirstNode();
- if(node){
- this.focusNode(node);
- }
- },
-
- _onEndKey: function(/*Object*/ message){
- // summary: end pressed; go to last visible node
-
- var node = this;
- while(node.isExpanded){
- var c = node.getChildren();
- node = c[c.length - 1];
- }
-
- if(node && node.isTreeNode){
- this.focusNode(node);
- }
- },
-
- _onLetterKeyNav: function(message){
- // summary: letter key pressed; search for node starting with first char = key
- var node = startNode = message.node,
- key = message.key;
- do{
- node = this._getNextNode(node);
- //check for last node, jump to first node if necessary
- if(!node){
- node = this._getRootOrFirstNode();
- }
- }while(node !== startNode && (node.label.charAt(0).toLowerCase() != key));
- if(node && node.isTreeNode){
- // no need to set focus if back where we started
- if(node !== startNode){
- this.focusNode(node);
- }
- }
- },
-
- _onClick: function(/*Event*/ e){
- // summary: translates click events into commands for the controller to process
- var domElement = e.target;
-
- // find node
- var nodeWidget = dijit.getEnclosingWidget(domElement);
- if(!nodeWidget || !nodeWidget.isTreeNode){
- return;
- }
-
- if( (this.openOnClick && nodeWidget.isExpandable) ||
- (domElement == nodeWidget.expandoNode || domElement == nodeWidget.expandoNodeText) ){
- // expando node was clicked, or label of a folder node was clicked; open it
- if(nodeWidget.isExpandable){
- this._onExpandoClick({node:nodeWidget});
- }
- }else{
- this._publish("execute", { item: nodeWidget.item, node: nodeWidget} );
- this.onClick(nodeWidget.item, nodeWidget);
- this.focusNode(nodeWidget);
- }
- dojo.stopEvent(e);
- },
-
- _onExpandoClick: function(/*Object*/ message){
- // summary: user clicked the +/- icon; expand or collapse my children.
- var node = message.node;
-
- // If we are collapsing, we might be hiding the currently focused node.
- // Also, clicking the expando node might have erased focus from the current node.
- // For simplicity's sake just focus on the node with the expando.
- this.focusNode(node);
-
- if(node.isExpanded){
- this._collapseNode(node);
- }else{
- this._expandNode(node);
- }
- },
-
- onClick: function(/* dojo.data */ item, /*TreeNode*/ node){
- // summary: user overridable function for executing a tree item
- },
-
- _getNextNode: function(node){
- // summary: get next visible node
-
- if(node.isExpandable && node.isExpanded && node.hasChildren()){
- // if this is an expanded node, get the first child
- return node.getChildren()[0]; // _TreeNode
- }else{
- // find a parent node with a sibling
- while(node && node.isTreeNode){
- var returnNode = node.getNextSibling();
- if(returnNode){
- return returnNode; // _TreeNode
- }
- node = node.getParent();
- }
- return null;
- }
- },
-
- _getRootOrFirstNode: function(){
- // summary: get first visible node
- return this.showRoot ? this.rootNode : this.rootNode.getChildren()[0];
- },
-
- _collapseNode: function(/*_TreeNode*/ node){
- // summary: called when the user has requested to collapse the node
-
- if(node.isExpandable){
- if(node.state == "LOADING"){
- // ignore clicks while we are in the process of loading data
- return;
- }
-
- node.collapse();
- if(this.persist && node.item){
- delete this._openedItemIds[this.model.getIdentity(node.item)];
- this._saveState();
- }
- }
- },
-
- _expandNode: function(/*_TreeNode*/ node){
- // summary: called when the user has requested to expand the node
-
- if(!node.isExpandable){
- return;
- }
-
- var model = this.model,
- item = node.item;
-
- switch(node.state){
- case "LOADING":
- // ignore clicks while we are in the process of loading data
- return;
-
- case "UNCHECKED":
- // need to load all the children, and then expand
- node.markProcessing();
- var _this = this;
- model.getChildren(item, function(items){
- node.unmarkProcessing();
- node.setChildItems(items);
- _this._expandNode(node);
- },
- function(err){
- console.error(_this, ": error loading root children: ", err);
- });
- break;
-
- default:
- // data is already loaded; just proceed
- node.expand();
- if(this.persist && item){
- this._openedItemIds[model.getIdentity(item)] = true;
- this._saveState();
- }
- }
- },
-
- ////////////////// Miscellaneous functions ////////////////
-
- blurNode: function(){
- // summary
- // Removes focus from the currently focused node (which must be visible).
- // Usually not called directly (just call focusNode() on another node instead)
- var node = this.lastFocused;
- if(!node){ return; }
- var labelNode = node.labelNode;
- dojo.removeClass(labelNode, "dijitTreeLabelFocused");
- labelNode.setAttribute("tabIndex", "-1");
- dijit.setWaiState(labelNode, "selected", false);
- this.lastFocused = null;
- },
-
- focusNode: function(/* _tree.Node */ node){
- // summary
- // Focus on the specified node (which must be visible)
-
- // set focus so that the label will be voiced using screen readers
- node.labelNode.focus();
- },
-
- _onBlur: function(){
- // summary:
- // We've moved away from the whole tree. The currently "focused" node
- // (see focusNode above) should remain as the lastFocused node so we can
- // tab back into the tree. Just change CSS to get rid of the dotted border
- // until that time
-
- this.inherited(arguments);
- if(this.lastFocused){
- var labelNode = this.lastFocused.labelNode;
- dojo.removeClass(labelNode, "dijitTreeLabelFocused");
- }
- },
-
- _onTreeFocus: function(/*Widget*/ node){
- // summary:
- // called from onFocus handler of treeitem labelNode to set styles, wai state and tabindex
- // for currently focused treeitem.
-
- if (node){
- if(node != this.lastFocused){
- this.blurNode();
- }
- var labelNode = node.labelNode;
- // set tabIndex so that the tab key can find this node
- labelNode.setAttribute("tabIndex", "0");
- dijit.setWaiState(labelNode, "selected", true);
- dojo.addClass(labelNode, "dijitTreeLabelFocused");
- this.lastFocused = node;
- }
- },
-
- //////////////// Events from the model //////////////////////////
-
- _onItemDelete: function(/*Object*/ item){
- //summary: delete event from the store
- // TODO: currently this isn't called, and technically doesn't need to be,
- // but it would help with garbage collection
-
- var identity = this.model.getIdentity(item);
- var node = this._itemNodeMap[identity];
-
- if(node){
- var parent = node.getParent();
- if(parent){
- // if node has not already been orphaned from a _onSetItem(parent, "children", ..) call...
- parent.removeChild(node);
- }
- delete this._itemNodeMap[identity];
- node.destroyRecursive();
- }
- },
-
- _onItemChange: function(/*Item*/ item){
- //summary: set data event on an item in the store
- var model = this.model,
- identity = model.getIdentity(item),
- node = this._itemNodeMap[identity];
-
- if(node){
- node.setLabelNode(this.getLabel(item));
- node._updateItemClasses(item);
- }
- },
-
- _onItemChildrenChange: function(/*dojo.data.Item*/ parent, /*dojo.data.Item[]*/ newChildrenList){
- //summary: set data event on an item in the store
- var model = this.model,
- identity = model.getIdentity(parent),
- parentNode = this._itemNodeMap[identity];
-
- if(parentNode){
- parentNode.setChildItems(newChildrenList);
- }
- },
-
- /////////////// Miscellaneous funcs
-
- _saveState: function(){
- //summary: create and save a cookie with the currently expanded nodes identifiers
- if(!this.persist){
- return;
- }
- var ary = [];
- for(var id in this._openedItemIds){
- ary.push(id);
- }
- dojo.cookie(this.cookieName, ary.join(","));
- },
-
- destroy: function(){
- if(this.rootNode){
- this.rootNode.destroyRecursive();
- }
- this.rootNode = null;
- this.inherited(arguments);
- },
-
- destroyRecursive: function(){
- // A tree is treated as a leaf, not as a node with children (like a grid),
- // but defining destroyRecursive for back-compat.
- this.destroy();
- }
-});
-
-
-dojo.declare(
- "dijit.tree.TreeStoreModel",
- null,
-{
- // summary
- // Implements dijit.Tree.model connecting to a store with a single
- // root item. Any methods passed into the constructor will override
- // the ones defined here.
-
- // store: dojo.data.Store
- // Underlying store
- store: null,
-
- // childrenAttrs: String[]
- // one ore more attributes that holds children of a tree node
- childrenAttrs: ["children"],
-
- // root: dojo.data.Item
- // Pointer to the root item (read only, not a parameter)
- root: null,
-
- // query: anything
- // Specifies datastore query to return the root item for the tree.
- // Must only return a single item. Alternately can just pass in pointer
- // to root item.
- // example:
- // {id:'ROOT'}
- query: null,
-
- constructor: function(/* Object */ args){
- // summary: passed the arguments listed above (store, etc)
- dojo.mixin(this, args);
-
- this.connects = [];
-
- var store = this.store;
- if(!store.getFeatures()['dojo.data.api.Identity']){
- throw new Error("dijit.Tree: store must support dojo.data.Identity");
- }
-
- // if the store supports Notification, subscribe to the notification events
- if(store.getFeatures()['dojo.data.api.Notification']){
- this.connects = this.connects.concat([
- dojo.connect(store, "onNew", this, "_onNewItem"),
- dojo.connect(store, "onDelete", this, "_onDeleteItem"),
- dojo.connect(store, "onSet", this, "_onSetItem")
- ]);
- }
- },
-
- destroy: function(){
- dojo.forEach(this.connects, dojo.disconnect);
- },
-
- // =======================================================================
- // Methods for traversing hierarchy
-
- getRoot: function(onItem, onError){
- // summary:
- // Calls onItem with the root item for the tree, possibly a fabricated item.
- // Calls onError on error.
- if(this.root){
- onItem(this.root);
- }else{
- this.store.fetch({
- query: this.query,
- onComplete: dojo.hitch(this, function(items){
- if(items.length != 1){
- throw new Error(this.declaredClass + ": query " + query + " returned " + items.length +
- " items, but must return exactly one item");
- }
- this.root = items[0];
- onItem(this.root);
- }),
- onError: onError
- });
- }
- },
-
- mayHaveChildren: function(/*dojo.data.Item*/ item){
- // summary
- // Tells if an item has or may have children. Implementing logic here
- // avoids showing +/- expando icon for nodes that we know don't have children.
- // (For efficiency reasons we may not want to check if an element actually
- // has children until user clicks the expando node)
- return dojo.some(this.childrenAttrs, function(attr){
- return this.store.hasAttribute(item, attr);
- }, this);
- },
-
- getChildren: function(/*dojo.data.Item*/ parentItem, /*function(items)*/ onComplete, /*function*/ onError){
- // summary
- // Calls onComplete() with array of child items of given parent item, all loaded.
-
- var store = this.store;
-
- // get children of specified item
- var childItems = [];
- for (var i=0; i<this.childrenAttrs.length; i++){
- var vals = store.getValues(parentItem, this.childrenAttrs[i]);
- childItems = childItems.concat(vals);
- }
-
- // count how many items need to be loaded
- var _waitCount = 0;
- dojo.forEach(childItems, function(item){ if(!store.isItemLoaded(item)){ _waitCount++; } });
-
- if(_waitCount == 0){
- // all items are already loaded. proceed...
- onComplete(childItems);
- }else{
- // still waiting for some or all of the items to load
- var onItem = function onItem(item){
- if(--_waitCount == 0){
- // all nodes have been loaded, send them to the tree
- onComplete(childItems);
- }
- }
- dojo.forEach(childItems, function(item){
- if(!store.isItemLoaded(item)){
- store.loadItem({
- item: item,
- onItem: onItem,
- onError: onError
- });
- }
- });
- }
- },
-
- // =======================================================================
- // Inspecting items
-
- getIdentity: function(/* item */ item){
- return this.store.getIdentity(item); // Object
- },
-
- getLabel: function(/*dojo.data.Item*/ item){
- // summary: get the label for an item
- return this.store.getLabel(item); // String
- },
-
- // =======================================================================
- // Write interface
-
- newItem: function(/* Object? */ args, /*Item*/ parent){
- // summary
- // Creates a new item. See dojo.data.api.Write for details on args.
- // Used in drag & drop when item from external source dropped onto tree.
- var pInfo = {parent: parent, attribute: this.childrenAttrs[0]};
- return this.store.newItem(args, pInfo);
- },
-
- pasteItem: function(/*Item*/ childItem, /*Item*/ oldParentItem, /*Item*/ newParentItem, /*Boolean*/ bCopy){
- // summary
- // Move or copy an item from one parent item to another.
- // Used in drag & drop
- var store = this.store,
- parentAttr = this.childrenAttrs[0]; // name of "children" attr in parent item
-
- // remove child from source item, and record the attributee that child occurred in
- if(oldParentItem){
- dojo.forEach(this.childrenAttrs, function(attr){
- if(store.containsValue(oldParentItem, attr, childItem)){
- if(!bCopy){
- var values = dojo.filter(store.getValues(oldParentItem, attr), function(x){
- return x != childItem;
- });
- store.setValues(oldParentItem, attr, values);
- }
- parentAttr = attr;
- }
- });
- }
-
- // modify target item's children attribute to include this item
- if(newParentItem){
- store.setValues(newParentItem, parentAttr,
- store.getValues(newParentItem, parentAttr).concat(childItem));
- }
- },
-
- // =======================================================================
- // Callbacks
-
- onChange: function(/*dojo.data.Item*/ item){
- // summary
- // Callback whenever an item has changed, so that Tree
- // can update the label, icon, etc. Note that changes
- // to an item's children or parent(s) will trigger an
- // onChildrenChange() so you can ignore those changes here.
- },
-
- onChildrenChange: function(/*dojo.data.Item*/ parent, /*dojo.data.Item[]*/ newChildrenList){
- // summary
- // Callback to do notifications about new, updated, or deleted items.
- },
-
- // =======================================================================
- ///Events from data store
-
- _onNewItem: function(/* dojo.data.Item */ item, /* Object */ parentInfo){
- // summary: handler for when new items appear in the store.
-
- // In this case there's no correspond onSet() call on the parent of this
- // item, so need to get the new children list of the parent manually somehow.
- if(!parentInfo){
- return;
- }
- this.getChildren(parentInfo.item, dojo.hitch(this, function(children){
- // NOTE: maybe can be optimized since parentInfo contains the new and old attribute value
- this.onChildrenChange(parentInfo.item, children);
- }));
- },
-
- _onDeleteItem: function(/*Object*/ item){
- // summary: handler for delete notifications from underlying store
- },
-
- _onSetItem: function(/* item */ item,
- /* attribute-name-string */ attribute,
- /* object | array */ oldValue,
- /* object | array */ newValue){
- //summary: set data event on an item in the store
-
- if(dojo.indexOf(this.childrenAttrs, attribute) != -1){
- // item's children list changed
- this.getChildren(item, dojo.hitch(this, function(children){
- // NOTE: maybe can be optimized since parentInfo contains the new and old attribute value
- this.onChildrenChange(item, children);
- }));
- }else{
- // item's label/icon/etc. changed.
- this.onChange(item);
- }
- }
-});
-
-dojo.declare("dijit.tree.ForestStoreModel", dijit.tree.TreeStoreModel, {
- // summary
- // Interface between Tree and a dojo.store that doesn't have a root item, ie,
- // has multiple "top level" items.
- //
- // description
- // Use this class to wrap a dojo.store, making all the items matching the specified query
- // appear as children of a fabricated "root item". If no query is specified then all the
- // items returned by fetch() on the underlying store become children of the root item.
- // It allows dijit.Tree to assume a single root item, even if the store doesn't have one.
-
- // Parameters to constructor
-
- // rootId: String
- // ID of fabricated root item
- rootId: "$root$",
-
- // rootLabel: String
- // Label of fabricated root item
- rootLabel: "ROOT",
-
- // query: String
- // Specifies the set of children of the root item.
- // example:
- // {type:'continent'}
- query: null,
-
- // End of parameters to constructor
-
- constructor: function(params){
- // Make dummy root item
- this.root = {
- store: this,
- root: true,
- id: params.rootId,
- label: params.rootLabel,
- children: params.rootChildren // optional param
- };
- },
-
- // =======================================================================
- // Methods for traversing hierarchy
-
- mayHaveChildren: function(/*dojo.data.Item*/ item){
- // summary
- // Tells if an item has or may have children. Implementing logic here
- // avoids showing +/- expando icon for nodes that we know don't have children.
- // (For efficiency reasons we may not want to check if an element actually
- // has children until user clicks the expando node)
- return item === this.root || this.inherited(arguments);
- },
-
- getChildren: function(/*dojo.data.Item*/ parentItem, /*function(items)*/ callback, /*function*/ onError){
- // summary
- // Calls onComplete() with array of child items of given parent item, all loaded.
- if(parentItem === this.root){
- if(this.root.children){
- // already loaded, just return
- callback(this.root.children);
- }else{
- this.store.fetch({
- query: this.query,
- onComplete: dojo.hitch(this, function(items){
- this.root.children = items;
- callback(items);
- }),
- onError: onError
- });
- }
- }else{
- this.inherited(arguments);
- }
- },
-
- // =======================================================================
- // Inspecting items
-
- getIdentity: function(/* item */ item){
- return (item === this.root) ? this.root.id : this.inherited(arguments);
- },
-
- getLabel: function(/* item */ item){
- return (item === this.root) ? this.root.label : this.inherited(arguments);
- },
-
- // =======================================================================
- // Write interface
-
- newItem: function(/* Object? */ args, /*Item*/ parent){
- // summary
- // Creates a new item. See dojo.data.api.Write for details on args.
- // Used in drag & drop when item from external source dropped onto tree.
- if(parent===this.root){
- this.onNewRootItem(args);
- return this.store.newItem(args);
- }else{
- return this.inherited(arguments);
- }
- },
-
- onNewRootItem: function(args){
- // summary:
- // User can override this method to modify a new element that's being
- // added to the root of the tree, for example to add a flag like root=true
- },
-
- pasteItem: function(/*Item*/ childItem, /*Item*/ oldParentItem, /*Item*/ newParentItem, /*Boolean*/ bCopy){
- // summary
- // Move or copy an item from one parent item to another.
- // Used in drag & drop
- if(oldParentItem === this.root){
- if(!bCopy){
- // It's onLeaveRoot()'s responsibility to modify the item so it no longer matches
- // this.query... thus triggering an onChildrenChange() event to notify the Tree
- // that this element is no longer a child of the root node
- this.onLeaveRoot(childItem);
- }
- }
- dijit.tree.TreeStoreModel.prototype.pasteItem.call(this, childItem,
- oldParentItem === this.root ? null : oldParentItem,
- newParentItem === this.root ? null : newParentItem
- );
- if(newParentItem === this.root){
- // It's onAddToRoot()'s responsibility to modify the item so it matches
- // this.query... thus triggering an onChildrenChange() event to notify the Tree
- // that this element is now a child of the root node
- this.onAddToRoot(childItem);
- }
- },
-
- // =======================================================================
- // Callbacks
-
- onAddToRoot: function(/* item */ item){
- // summary
- // Called when item added to root of tree; user must override
- // to modify the item so that it matches the query for top level items
- // example
- // | store.setValue(item, "root", true);
- console.log(this, ": item ", item, " added to root");
- },
-
- onLeaveRoot: function(/* item */ item){
- // summary
- // Called when item removed from root of tree; user must override
- // to modify the item so it doesn't match the query for top level items
- // example
- // | store.unsetAttribute(item, "root");
- console.log(this, ": item ", item, " removed from root");
- },
-
- // =======================================================================
- // Events from data store
-
- _requeryTop: function(){
- // reruns the query for the children of the root node,
- // sending out an onSet notification if those children have changed
- var _this = this,
- oldChildren = this.root.children;
- this.store.fetch({
- query: this.query,
- onComplete: function(newChildren){
- _this.root.children = newChildren;
-
- // If the list of children or the order of children has changed...
- if(oldChildren.length != newChildren.length ||
- dojo.some(oldChildren, function(item, idx){ return newChildren[idx] != item;})){
- _this.onChildrenChange(_this.root, newChildren);
- }
- }
- });
- },
-
- _onNewItem: function(/* dojo.data.Item */ item, /* Object */ parentInfo){
- // summary: handler for when new items appear in the store.
-
- // In theory, any new item could be a top level item.
- // Do the safe but inefficient thing by requerying the top
- // level items. User can override this function to do something
- // more efficient.
- this._requeryTop();
-
- this.inherited(arguments);
- },
-
- _onDeleteItem: function(/*Object*/ item){
- // summary: handler for delete notifications from underlying store
-
- // check if this was a child of root, and if so send notification that root's children
- // have changed
- if(dojo.indexOf(this.root.children, item) != -1){
- this._requeryTop();
- }
-
- this.inherited(arguments);
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/_Calendar.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/_Calendar.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/_Calendar.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,239 +0,0 @@
-if(!dojo._hasResource["dijit._Calendar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit._Calendar"] = true;
-dojo.provide("dijit._Calendar");
-
-dojo.require("dojo.cldr.supplemental");
-dojo.require("dojo.date");
-dojo.require("dojo.date.locale");
-
-dojo.require("dijit._Widget");
-dojo.require("dijit._Templated");
-
-dojo.declare(
- "dijit._Calendar",
- [dijit._Widget, dijit._Templated],
- {
- //
- // summary:
- // A simple GUI for choosing a date in the context of a monthly calendar.
- //
- // description:
- // A simple GUI for choosing a date in the context of a monthly calendar.
- // This widget is used internally by other widgets and is not accessible
- // as a standalone widget.
- // This widget can't be used in a form because it doesn't serialize the date to an
- // `<input>` field. For a form element, use dijit.form.DateTextBox instead.
- //
- // Note that the parser takes all dates attributes passed in the
- // [RFC 3339 format](http://www.faqs.org/rfcs/rfc3339.html), e.g. `2005-06-30T08:05:00-07:00`
- // so that they are serializable and locale-independent.
- //
- // example:
- // | var calendar = new dijit._Calendar({}, dojo.byId("calendarNode"));
- //
- // example:
- // | <div dojoType="dijit._Calendar"></div>
- //
- templateString:"<table cellspacing=\"0\" cellpadding=\"0\" class=\"dijitCalendarContainer\">\n\t<thead>\n\t\t<tr class=\"dijitReset dijitCalendarMonthContainer\" valign=\"top\">\n\t\t\t<th class='dijitReset' dojoAttachPoint=\"decrementMonth\">\n\t\t\t\t<div class=\"dijitInline dijitCalendarIncrementControl dijitCalendarDecrease\"><span dojoAttachPoint=\"decreaseArrowNode\" class=\"dijitA11ySideArrow dijitCalendarIncrementControl dijitCalendarDecreaseInner\">-</span></div>\n\t\t\t</th>\n\t\t\t<th class='dijitReset' colspan=\"5\">\n\t\t\t\t<div dojoAttachPoint=\"monthLabelSpacer\" class=\"dijitCalendarMonthLabelSpacer\"></div>\n\t\t\t\t<div dojoAttachPoint=\"monthLabelNode\" class=\"dijitCalendarMonthLabel\"></div>\n\t\t\t</th>\n\t\t\t<th class='dijitReset' dojoAttachPoint=\"incrementMonth\">\n\t\t\t\t<div class=\"dijitInline dijitCalendarIncrementControl dijitCalendarIncrease\"><span dojoAttachPoint=\"increaseArrowNode\" class=\"dijitA11ySideArrow dijitCalendarIncrementControl dijitCalendarIncreaseInner\">+</span></div>\n\t\t\t</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th class=\"dijitReset dijitCalendarDayLabelTemplate\"><span class=\"dijitCalendarDayLabel\"></span></th>\n\t\t</tr>\n\t</thead>\n\t<tbody dojoAttachEvent=\"onclick: _onDayClick\" class=\"dijitReset dijitCalendarBodyContainer\">\n\t\t<tr class=\"dijitReset dijitCalendarWeekTemplate\">\n\t\t\t<td class=\"dijitReset dijitCalendarDateTemplate\"><span class=\"dijitCalendarDateLabel\"></span></td>\n\t\t</tr>\n\t</tbody>\n\t<tfoot class=\"dijitReset dijitCalendarYearContainer\">\n\t\t<tr>\n\t\t\t<td class='dijitReset' valign=\"top\" colspan=\"7\">\n\t\t\t\t<h3 class=\"dijitCalendarYearLabel\">\n\t\t\t\t\t<span dojoAttachPoint=\"previousYearLabelNode\" class=\"dijitInline dijitCalendarPreviousYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"currentYearLabelNode\" class=\"dijitInline dijitCalendarSelectedYear\"></span>\n\t\t\t\t\t<span dojoAttachPoint=\"nextYearLabelNode\" class=\"dijitInline dijitCalendarNextYear\"></span>\n\t\t\t\t</h3>\n\t\t\t</td>\n\t\t</tr>\n\t</tfoot>\n</table>\t\n",
-
- // value: Date
- // the currently selected Date
- value: new Date(),
-
- // dayWidth: String
- // How to represent the days of the week in the calendar header. See dojo.date.locale
- dayWidth: "narrow",
-
- setValue: 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(!this.value || dojo.date.compare(value, this.value)){
- value = new Date(value);
- this.displayMonth = new Date(value);
- if(!this.isDisabledDate(value, this.lang)){
- this.value = value;
- this.value.setHours(0,0,0,0);
- this.onChange(this.value);
- }
- this._populateGrid();
- }
- },
-
- _setText: function(node, text){
- while(node.firstChild){
- node.removeChild(node.firstChild);
- }
- node.appendChild(dojo.doc.createTextNode(text));
- },
-
- _populateGrid: function(){
- var month = this.displayMonth;
- month.setDate(1);
- var firstDay = month.getDay();
- var daysInMonth = dojo.date.getDaysInMonth(month);
- var daysInPreviousMonth = dojo.date.getDaysInMonth(dojo.date.add(month, "month", -1));
- var today = new Date();
- var selected = this.value;
-
- var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
- if(dayOffset > firstDay){ dayOffset -= 7; }
-
- // Iterate through dates in the calendar and fill in date numbers and style info
- dojo.query(".dijitCalendarDateTemplate", this.domNode).forEach(function(template, i){
- i += dayOffset;
- var date = new Date(month);
- 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(!dojo.date.compare(date, today, "date")){
- clazz = "dijitCalendarCurrentDate " + clazz;
- }
-
- if(!dojo.date.compare(date, selected, "date")){
- clazz = "dijitCalendarSelectedDate " + clazz;
- }
-
- if(this.isDisabledDate(date, this.lang)){
- clazz = "dijitCalendarDisabledDate " + clazz;
- }
-
- var clazz2 = this.getClassForDate(date, this.lang);
- 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());
- }, this);
-
- // Fill in localized month name
- var monthNames = dojo.date.locale.getNames('months', 'wide', 'standAlone', this.lang);
- this._setText(this.monthLabelNode, monthNames[month.getMonth()]);
-
- // Fill in localized prev/current/next years
- var y = month.getFullYear() - 1;
- var d = new Date();
- dojo.forEach(["previous", "current", "next"], function(name){
- d.setFullYear(y++);
- this._setText(this[name+"YearLabelNode"],
- dojo.date.locale.format(d, {selector:'year', locale:this.lang}));
- }, this);
-
- // Set up repeating mouse behavior
- 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);
- typematic("nextYearLabelNode", "year", 1);
- typematic("previousYearLabelNode", "year", -1);
- },
-
- goToToday: function(){
- this.setValue(new Date());
- },
-
- postCreate: function(){
- this.inherited(arguments);
-
- var cloneClass = dojo.hitch(this, function(clazz, n){
- var template = dojo.query(clazz, this.domNode)[0];
- for(var i=0; i<n; i++){
- template.parentNode.appendChild(template.cloneNode(true));
- }
- });
-
- // clone the day label and calendar day templates 6 times to make 7 columns
- cloneClass(".dijitCalendarDayLabelTemplate", 6);
- cloneClass(".dijitCalendarDateTemplate", 6);
-
- // now make 6 week rows
- cloneClass(".dijitCalendarWeekTemplate", 5);
-
- // insert localized day names in the header
- var dayNames = dojo.date.locale.getNames('days', this.dayWidth, 'standAlone', this.lang);
- var dayOffset = dojo.cldr.supplemental.getFirstDayOfWeek(this.lang);
- dojo.query(".dijitCalendarDayLabel", this.domNode).forEach(function(label, i){
- this._setText(label, dayNames[(i + dayOffset) % 7]);
- }, this);
-
- // Fill in spacer element with all the month names (invisible) so that the maximum width will affect layout
- var monthNames = dojo.date.locale.getNames('months', 'wide', 'standAlone', this.lang);
- dojo.forEach(monthNames, function(name){
- var monthSpacer = dojo.doc.createElement("div");
- this._setText(monthSpacer, name);
- this.monthLabelSpacer.appendChild(monthSpacer);
- }, this);
-
- this.value = null;
- this.setValue(new Date());
- },
-
- _adjustDisplay: function(/*String*/part, /*int*/amount){
- this.displayMonth = dojo.date.add(this.displayMonth, part, amount);
- this._populateGrid();
- },
-
- _onDayClick: function(/*Event*/evt){
- var node = evt.target;
- dojo.stopEvent(evt);
- while(!node.dijitDateValue){
- node = node.parentNode;
- }
- if(!dojo.hasClass(node, "dijitCalendarDisabledDate")){
- this.setValue(node.dijitDateValue);
- this.onValueSelected(this.value);
- }
- },
-
- onValueSelected: function(/*Date*/date){
- // summary: a date cell was selected. It may be the same as the previous value.
- },
-
- onChange: function(/*Date*/date){
- // summary: called only when the selected date has changed
- },
-
- isDisabledDate: function(/*Date*/dateObject, /*String?*/locale){
- // summary:
- // May be overridden to disable certain dates in the calendar e.g. `isDisabledDate=dojo.date.locale.isWeekend`
-/*=====
- return false; // Boolean
-=====*/
- },
-
- 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
-=====*/
- }
- }
-);
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/_Container.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/_Container.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/_Container.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,346 +0,0 @@
-if(!dojo._hasResource["dijit._Container"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit._Container"] = true;
-dojo.provide("dijit._Container");
-
-dojo.declare("dijit._Contained",
- null,
- {
- // summary
- // Mixin for widgets that are children of a container widget
- //
- // example:
- // | // make a basic custom widget that knows about it's parents
- // | dojo.declare("my.customClass",[dijit._Widget,dijit._Contained],{});
- //
- getParent: function(){
- // summary:
- // Returns the parent widget of this widget, assuming the parent
- // implements dijit._Container
- for(var p=this.domNode.parentNode; p; p=p.parentNode){
- var id = p.getAttribute && p.getAttribute("widgetId");
- if(id){
- var parent = dijit.byId(id);
- return parent.isContainer ? parent : null;
- }
- }
- return null;
- },
-
- _getSibling: function(which){
- var node = this.domNode;
- do{
- node = node[which+"Sibling"];
- }while(node && node.nodeType != 1);
- if(!node){ return null; } // null
- var id = node.getAttribute("widgetId");
- return dijit.byId(id);
- },
-
- getPreviousSibling: function(){
- // summary:
- // Returns null if this is the first child of the parent,
- // otherwise returns the next element sibling to the "left".
-
- return this._getSibling("previous"); // Mixed
- },
-
- getNextSibling: function(){
- // summary:
- // Returns null if this is the last child of the parent,
- // otherwise returns the next element sibling to the "right".
-
- return this._getSibling("next"); // Mixed
- }
- }
-);
-
-dojo.declare("dijit._Container",
- null,
- {
- // summary:
- // Mixin for widgets that contain a list of children.
- // description:
- // Use this mixin when the widget needs to know about and
- // keep track of it's widget children. Widgets like SplitContainer
- // and TabContainer.
-
- isContainer: true,
-
- addChild: function(/*Widget*/ widget, /*int?*/ insertIndex){
- // summary:
- // Process the given child widget, inserting it's dom node as
- // a child of our dom node
-
- if(insertIndex === undefined){
- insertIndex = "last";
- }
- var refNode = this.containerNode || this.domNode;
- if(insertIndex && typeof insertIndex == "number"){
- var children = dojo.query("> [widgetid]", refNode);
- if(children && children.length >= insertIndex){
- refNode = children[insertIndex-1]; insertIndex = "after";
- }
- }
- dojo.place(widget.domNode, refNode, insertIndex);
-
- // If I've been started but the child widget hasn't been started,
- // start it now. Make sure to do this after widget has been
- // inserted into the DOM tree, so it can see that it's being controlled by me,
- // so it doesn't try to size itself.
- if(this._started && !widget._started){
- widget.startup();
- }
- },
-
- removeChild: function(/*Widget*/ widget){
- // summary:
- // Removes the passed widget instance from this widget but does
- // not destroy it
- var node = widget.domNode;
- node.parentNode.removeChild(node); // detach but don't destroy
- },
-
- _nextElement: function(node){
- do{
- node = node.nextSibling;
- }while(node && node.nodeType != 1);
- return node;
- },
-
- _firstElement: function(node){
- node = node.firstChild;
- if(node && node.nodeType != 1){
- node = this._nextElement(node);
- }
- return node;
- },
-
- getChildren: function(){
- // summary:
- // Returns array of children widgets
- return dojo.query("> [widgetId]", this.containerNode || this.domNode).map(dijit.byNode); // Array
- },
-
- hasChildren: function(){
- // summary:
- // Returns true if widget has children
- var cn = this.containerNode || this.domNode;
- return !!this._firstElement(cn); // Boolean
- },
-
- _getSiblingOfChild: function(/*Widget*/ child, /*int*/ dir){
- // summary:
- // Get the next or previous widget sibling of child
- // dir:
- // if 1, get the next sibling
- // if -1, get the previous sibling
- var node = child.domNode;
- var which = (dir>0 ? "nextSibling" : "previousSibling");
- do{
- node = node[which];
- }while(node && (node.nodeType != 1 || !dijit.byNode(node)));
- return node ? dijit.byNode(node) : null;
- }
- }
-);
-
-dojo.declare("dijit._KeyNavContainer",
- [dijit._Container],
- {
-
- // summary: A _Container with keyboard navigation of its children.
- // decscription:
- // To use this mixin, call connectKeyNavHandlers() in
- // postCreate() and call startupKeyNavChildren() in startup().
- // It provides normalized keyboard and focusing code for Container
- // widgets.
-/*=====
- // focusedChild: Widget
- // The currently focused child widget, or null if there isn't one
- focusedChild: null,
-=====*/
-
- _keyNavCodes: {},
-
- connectKeyNavHandlers: function(/*Array*/ prevKeyCodes, /*Array*/ nextKeyCodes){
- // summary:
- // Call in postCreate() to attach the keyboard handlers
- // to the container.
- // preKeyCodes: Array
- // Key codes for navigating to the previous child.
- // nextKeyCodes: Array
- // Key codes for navigating to the next child.
-
- var keyCodes = this._keyNavCodes = {};
- var prev = dojo.hitch(this, this.focusPrev);
- var next = dojo.hitch(this, this.focusNext);
- dojo.forEach(prevKeyCodes, function(code){ keyCodes[code] = prev });
- dojo.forEach(nextKeyCodes, function(code){ keyCodes[code] = next });
- this.connect(this.domNode, "onkeypress", "_onContainerKeypress");
- this.connect(this.domNode, "onfocus", "_onContainerFocus");
- },
-
- startupKeyNavChildren: function(){
- // summary:
- // Call in startup() to set child tabindexes to -1
- dojo.forEach(this.getChildren(), dojo.hitch(this, "_startupChild"));
- },
-
- addChild: function(/*Widget*/ widget, /*int?*/ insertIndex){
- // summary: Add a child to our _Container
- dijit._KeyNavContainer.superclass.addChild.apply(this, arguments);
- this._startupChild(widget);
- },
-
- focus: function(){
- // summary: Default focus() implementation: focus the first child.
- this.focusFirstChild();
- },
-
- focusFirstChild: function(){
- // summary: Focus the first focusable child in the container.
- this.focusChild(this._getFirstFocusableChild());
- },
-
- focusNext: function(){
- // summary: Focus the next widget or focal node (for widgets
- // with multiple focal nodes) within this container.
- if(this.focusedChild && this.focusedChild.hasNextFocalNode
- && this.focusedChild.hasNextFocalNode()){
- this.focusedChild.focusNext();
- return;
- }
- var child = this._getNextFocusableChild(this.focusedChild, 1);
- if(child.getFocalNodes){
- this.focusChild(child, child.getFocalNodes()[0]);
- }else{
- this.focusChild(child);
- }
- },
-
- focusPrev: function(){
- // summary: Focus the previous widget or focal node (for widgets
- // with multiple focal nodes) within this container.
- if(this.focusedChild && this.focusedChild.hasPrevFocalNode
- && this.focusedChild.hasPrevFocalNode()){
- this.focusedChild.focusPrev();
- return;
- }
- var child = this._getNextFocusableChild(this.focusedChild, -1);
- if(child.getFocalNodes){
- var nodes = child.getFocalNodes();
- this.focusChild(child, nodes[nodes.length-1]);
- }else{
- this.focusChild(child);
- }
- },
-
- focusChild: function(/*Widget*/ widget, /*Node?*/ node){
- // summary: Focus widget. Optionally focus 'node' within widget.
- if(widget){
- if(this.focusedChild && widget !== this.focusedChild){
- this._onChildBlur(this.focusedChild);
- }
- this.focusedChild = widget;
- if(node && widget.focusFocalNode){
- widget.focusFocalNode(node);
- }else{
- widget.focus();
- }
- }
- },
-
- _startupChild: function(/*Widget*/ widget){
- // summary:
- // Set tabindex="-1" on focusable widgets so that we
- // can focus them programmatically and by clicking.
- // Connect focus and blur handlers.
- if(widget.getFocalNodes){
- dojo.forEach(widget.getFocalNodes(), function(node){
- dojo.attr(node, "tabindex", -1);
- this._connectNode(node);
- }, this);
- }else{
- var node = widget.focusNode || widget.domNode;
- if(widget.isFocusable()){
- dojo.attr(node, "tabindex", -1);
- }
- this._connectNode(node);
- }
- },
-
- _connectNode: function(/*Element*/ node){
- this.connect(node, "onfocus", "_onNodeFocus");
- this.connect(node, "onblur", "_onNodeBlur");
- },
-
- _onContainerFocus: function(evt){
- // focus bubbles on Firefox,
- // so just make sure that focus has really gone to the container
- if(evt.target === this.domNode){
- this.focusFirstChild();
- }
- },
-
- _onContainerKeypress: function(evt){
- if(evt.ctrlKey || evt.altKey){ return; }
- var func = this._keyNavCodes[evt.keyCode];
- if(func){
- func();
- dojo.stopEvent(evt);
- }
- },
-
- _onNodeFocus: function(evt){
- // while focus is on a child,
- // take the container out of the tab order so that
- // we can shift-tab to the element before the container
- dojo.attr(this.domNode, "tabindex", -1);
- // record the child that has been focused
- var widget = dijit.getEnclosingWidget(evt.target);
- if(widget && widget.isFocusable()){
- this.focusedChild = widget;
- }
- dojo.stopEvent(evt);
- },
-
- _onNodeBlur: function(evt){
- // when focus leaves a child,
- // reinstate the container's tabindex
- if(this.tabIndex){
- dojo.attr(this.domNode, "tabindex", this.tabIndex);
- }
- dojo.stopEvent(evt);
- },
-
- _onChildBlur: function(/*Widget*/ widget){
- // summary:
- // Called when focus leaves a child widget to go
- // to a sibling widget.
- },
-
- _getFirstFocusableChild: function(){
- return this._getNextFocusableChild(null, 1);
- },
-
- _getNextFocusableChild: function(child, dir){
- if(child){
- child = this._getSiblingOfChild(child, dir);
- }
- var children = this.getChildren();
- for(var i=0; i < children.length; i++){
- if(!child){
- child = children[(dir>0) ? 0 : (children.length-1)];
- }
- if(child.isFocusable()){
- return child;
- }
- child = this._getSiblingOfChild(child, dir);
- }
- // no focusable child found
- return null;
- }
- }
-);
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/_Templated.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/_Templated.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/_Templated.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,329 +0,0 @@
-if(!dojo._hasResource["dijit._Templated"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit._Templated"] = true;
-dojo.provide("dijit._Templated");
-
-dojo.require("dijit._Widget");
-dojo.require("dojo.string");
-dojo.require("dojo.parser");
-
-dojo.declare("dijit._Templated",
- null,
- {
- // summary:
- // Mixin for widgets that are instantiated from a template
- //
- // templateNode: DomNode
- // a node that represents the widget template. Pre-empts both templateString and templatePath.
- templateNode: null,
-
- // templateString: String
- // a string that represents the widget template. Pre-empts the
- // templatePath. In builds that have their strings "interned", the
- // templatePath is converted to an inline templateString, thereby
- // preventing a synchronous network call.
- templateString: null,
-
- // templatePath: String
- // Path to template (HTML file) for this widget relative to dojo.baseUrl
- templatePath: null,
-
- // widgetsInTemplate: Boolean
- // should we parse the template to find widgets that might be
- // declared in markup inside it? false by default.
- widgetsInTemplate: false,
-
- // containerNode: DomNode
- // holds child elements. "containerNode" is generally set via a
- // dojoAttachPoint assignment and it designates where children of
- // the src dom node will be placed
- containerNode: null,
-
- // skipNodeCache: Boolean
- // if using a cached widget template node poses issues for a
- // particular widget class, it can set this property to ensure
- // that its template is always re-built from a string
- _skipNodeCache: false,
-
- _stringRepl: function(tmpl){
- var className = this.declaredClass, _this = this;
- // Cache contains a string because we need to do property replacement
- // do the property replacement
- return dojo.string.substitute(tmpl, this, function(value, key){
- if(key.charAt(0) == '!'){ value = _this[key.substr(1)]; }
- if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide
- if(!value){ return ""; }
-
- // Substitution keys beginning with ! will skip the transform step,
- // in case a user wishes to insert unescaped markup, e.g. ${!foo}
- return key.charAt(0) == "!" ? value :
- // Safer substitution, see heading "Attribute values" in
- // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
- value.toString().replace(/"/g,"""); //TODO: add &? use encodeXML method?
- }, this);
- },
-
- // method over-ride
- buildRendering: function(){
- // summary:
- // Construct the UI for this widget from a template, setting this.domNode.
-
- // Lookup cached version of template, and download to cache if it
- // isn't there already. Returns either a DomNode or a string, depending on
- // whether or not the template contains ${foo} replacement parameters.
- var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache);
-
- var node;
- if(dojo.isString(cached)){
- node = dijit._Templated._createNodesFromText(this._stringRepl(cached))[0];
- }else{
- // if it's a node, all we have to do is clone it
- node = cached.cloneNode(true);
- }
-
- // recurse through the node, looking for, and attaching to, our
- // attachment points which should be defined on the template node.
- this._attachTemplateNodes(node);
-
- var source = this.srcNodeRef;
- if(source && source.parentNode){
- source.parentNode.replaceChild(node, source);
- }
-
- this.domNode = node;
- if(this.widgetsInTemplate){
- var cw = this._supportingWidgets = dojo.parser.parse(node);
- this._attachTemplateNodes(cw, function(n,p){
- return n[p];
- });
- }
-
- this._fillContent(source);
- },
-
- _fillContent: function(/*DomNode*/ source){
- // summary:
- // relocate source contents to templated container node
- // this.containerNode must be able to receive children, or exceptions will be thrown
- var dest = this.containerNode;
- if(source && dest){
- while(source.hasChildNodes()){
- dest.appendChild(source.firstChild);
- }
- }
- },
-
- _attachTemplateNodes: function(rootNode, getAttrFunc){
- // summary: Iterate through the template and attach functions and nodes accordingly.
- // description:
- // Map widget properties and functions to the handlers specified in
- // the dom node and it's descendants. This function iterates over all
- // nodes and looks for these properties:
- // * dojoAttachPoint
- // * dojoAttachEvent
- // * waiRole
- // * waiState
- // rootNode: DomNode|Array[Widgets]
- // the node to search for properties. All children will be searched.
- // getAttrFunc: function?
- // a function which will be used to obtain property for a given
- // DomNode/Widget
-
- getAttrFunc = getAttrFunc || function(n,p){ return n.getAttribute(p); };
-
- var nodes = dojo.isArray(rootNode) ? rootNode : (rootNode.all || rootNode.getElementsByTagName("*"));
- var x=dojo.isArray(rootNode)?0:-1;
- for(; x<nodes.length; x++){
- var baseNode = (x == -1) ? rootNode : nodes[x];
- if(this.widgetsInTemplate && getAttrFunc(baseNode,'dojoType')){
- continue;
- }
- // Process dojoAttachPoint
- var attachPoint = getAttrFunc(baseNode, "dojoAttachPoint");
- if(attachPoint){
- var point, points = attachPoint.split(/\s*,\s*/);
- while((point = points.shift())){
- if(dojo.isArray(this[point])){
- this[point].push(baseNode);
- }else{
- this[point]=baseNode;
- }
- }
- }
-
- // Process dojoAttachEvent
- var attachEvent = getAttrFunc(baseNode, "dojoAttachEvent");
- if(attachEvent){
- // NOTE: we want to support attributes that have the form
- // "domEvent: nativeEvent; ..."
- var event, events = attachEvent.split(/\s*,\s*/);
- var trim = dojo.trim;
- while((event = events.shift())){
- if(event){
- var thisFunc = null;
- if(event.indexOf(":") != -1){
- // oh, if only JS had tuple assignment
- var funcNameArr = event.split(":");
- event = trim(funcNameArr[0]);
- thisFunc = trim(funcNameArr[1]);
- }else{
- event = trim(event);
- }
- if(!thisFunc){
- thisFunc = event;
- }
- this.connect(baseNode, event, thisFunc);
- }
- }
- }
-
- // waiRole, waiState
- var role = getAttrFunc(baseNode, "waiRole");
- if(role){
- dijit.setWaiRole(baseNode, role);
- }
- var values = getAttrFunc(baseNode, "waiState");
- if(values){
- dojo.forEach(values.split(/\s*,\s*/), function(stateValue){
- if(stateValue.indexOf('-') != -1){
- var pair = stateValue.split('-');
- dijit.setWaiState(baseNode, pair[0], pair[1]);
- }
- });
- }
-
- }
- }
- }
-);
-
-// key is either templatePath or templateString; object is either string or DOM tree
-dijit._Templated._templateCache = {};
-
-dijit._Templated.getCachedTemplate = function(templatePath, templateString, alwaysUseString){
- // summary:
- // Static method to get a template based on the templatePath or
- // templateString key
- // templatePath: String
- // The URL to get the template from. dojo.uri.Uri is often passed as well.
- // templateString: String?
- // a string to use in lieu of fetching the template from a URL. Takes precedence
- // over templatePath
- // Returns: Mixed
- // Either string (if there are ${} variables that need to be replaced) or just
- // a DOM tree (if the node can be cloned directly)
-
- // is it already cached?
- var tmplts = dijit._Templated._templateCache;
- var key = templateString || templatePath;
- var cached = tmplts[key];
- if(cached){
- return cached;
- }
-
- // If necessary, load template string from template path
- if(!templateString){
- templateString = dijit._Templated._sanitizeTemplateString(dojo._getText(templatePath));
- }
-
- templateString = dojo.string.trim(templateString);
-
- if(alwaysUseString || templateString.match(/\$\{([^\}]+)\}/g)){
- // there are variables in the template so all we can do is cache the string
- return (tmplts[key] = templateString); //String
- }else{
- // there are no variables in the template so we can cache the DOM tree
- return (tmplts[key] = dijit._Templated._createNodesFromText(templateString)[0]); //Node
- }
-};
-
-dijit._Templated._sanitizeTemplateString = function(/*String*/tString){
- // summary:
- // Strips <?xml ...?> declarations so that external SVG and XML
- // documents can be added to a document without worry. Also, if the string
- // is an HTML document, only the part inside the body tag is returned.
- if(tString){
- tString = tString.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
- var matches = tString.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
- if(matches){
- tString = matches[1];
- }
- }else{
- tString = "";
- }
- return tString; //String
-};
-
-
-if(dojo.isIE){
- dojo.addOnUnload(function(){
- var cache = dijit._Templated._templateCache;
- for(var key in cache){
- var value = cache[key];
- if(!isNaN(value.nodeType)){ // isNode equivalent
- dojo._destroyElement(value);
- }
- delete cache[key];
- }
- });
-}
-
-(function(){
- var tagMap = {
- cell: {re: /^<t[dh][\s\r\n>]/i, pre: "<table><tbody><tr>", post: "</tr></tbody></table>"},
- row: {re: /^<tr[\s\r\n>]/i, pre: "<table><tbody>", post: "</tbody></table>"},
- section: {re: /^<(thead|tbody|tfoot)[\s\r\n>]/i, pre: "<table>", post: "</table>"}
- };
-
- // dummy container node used temporarily to hold nodes being created
- var tn;
-
- dijit._Templated._createNodesFromText = function(/*String*/text){
- // summary:
- // Attempts to create a set of nodes based on the structure of the passed text.
-
- if(!tn){
- tn = dojo.doc.createElement("div");
- tn.style.display="none";
- dojo.body().appendChild(tn);
- }
- var tableType = "none";
- var rtext = text.replace(/^\s+/, "");
- for(var type in tagMap){
- var map = tagMap[type];
- if(map.re.test(rtext)){
- tableType = type;
- text = map.pre + text + map.post;
- break;
- }
- }
-
- tn.innerHTML = text;
- if(tn.normalize){
- tn.normalize();
- }
-
- var tag = { cell: "tr", row: "tbody", section: "table" }[tableType];
- var _parent = (typeof tag != "undefined") ?
- tn.getElementsByTagName(tag)[0] :
- tn;
-
- var nodes = [];
- while(_parent.firstChild){
- nodes.push(_parent.removeChild(_parent.firstChild));
- }
- tn.innerHTML="";
- return nodes; // Array
- }
-})();
-
-// These arguments can be specified for widgets which are used in templates.
-// Since any widget can be specified as sub widgets in template, mix it
-// into the base widget class. (This is a hack, but it's effective.)
-dojo.extend(dijit._Widget,{
- dojoAttachEvent: "",
- dojoAttachPoint: "",
- waiRole: "",
- waiState:""
-})
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/_TimePicker.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/_TimePicker.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/_TimePicker.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,249 +0,0 @@
-if(!dojo._hasResource["dijit._TimePicker"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit._TimePicker"] = true;
-dojo.provide("dijit._TimePicker");
-
-dojo.require("dijit.form._FormWidget");
-dojo.require("dojo.date.locale");
-
-/*=====
-dojo.declare(
- "dijit._TimePicker.__Constraints",
- [dojo.date.locale.__FormatOptions],
- {
- // clickableIncrement: String
- // see dijit._TimePicker.clickableIncrement
- clickableIncrement: "T00:15:00",
-
- // visibleIncrement: String
- // see dijit._TimePicker.visibleIncrement
- visibleIncrement: "T01:00:00",
-
- // visibleRange: String
- // see dijit._TimePicker.visibleRange
- visibleRange: "T05:00:00"
- }
-);
-=====*/
-
-dojo.declare("dijit._TimePicker",
- [dijit._Widget, dijit._Templated],
- {
- // summary:
- // A graphical time picker.
- // This widget is used internally by other widgets and is not accessible
- // as a standalone widget.
-
- templateString:"<div id=\"widget_${id}\" class=\"dijitMenu\"\n ><div dojoAttachPoint=\"upArrow\" class=\"dijitButtonNode\"><span class=\"dijitTimePickerA11yText\">▲</span></div\n ><div dojoAttachPoint=\"timeMenu,focusNode\" dojoAttachEvent=\"onclick:_onOptionSelected,onmouseover,onmouseout\"></div\n ><div dojoAttachPoint=\"downArrow\" class=\"dijitButtonNode\"><span class=\"dijitTimePickerA11yText\">▼</span></div\n></div>\n",
- baseClass: "dijitTimePicker",
-
- // clickableIncrement: String
- // ISO-8601 string representing the amount by which
- // every clickable element in the time picker increases.
- // Set in local time, without a time zone.
- // Example: `T00:15:00` creates 15 minute increments
- // Must divide dijit._TimePicker.visibleIncrement evenly
- clickableIncrement: "T00:15:00",
-
- // visibleIncrement: String
- // ISO-8601 string representing the amount by which
- // every element with a visible time in the time picker increases.
- // Set in local time, without a time zone.
- // Example: `T01:00:00` creates text in every 1 hour increment
- visibleIncrement: "T01:00:00",
-
- // visibleRange: String
- // ISO-8601 string representing the range of this TimePicker.
- // The TimePicker will only display times in this range.
- // Example: `T05:00:00` displays 5 hours of options
- visibleRange: "T05:00:00",
-
- // value: String
- // Date to display.
- // Defaults to current time and date.
- // Can be a Date object or an ISO-8601 string.
- // If you specify the GMT time zone (`-01:00`),
- // the time will be converted to the local time in the local time zone.
- // Otherwise, the time is considered to be in the local time zone.
- // If you specify the date and isDate is true, the date is used.
- // Example: if your local time zone is `GMT -05:00`,
- // `T10:00:00` becomes `T10:00:00-05:00` (considered to be local time),
- // `T10:00:00-01:00` becomes `T06:00:00-05:00` (4 hour difference),
- // `T10:00:00Z` becomes `T05:00:00-05:00` (5 hour difference between Zulu and local time)
- // `yyyy-mm-ddThh:mm:ss` is the format to set the date and time
- // Example: `2007-06-01T09:00:00`
- value: new Date(),
-
- _visibleIncrement:2,
- _clickableIncrement:1,
- _totalIncrements:10,
-
- // constraints: dijit._TimePicker.__Constraints
- constraints:{},
-
- serialize: dojo.date.stamp.toISOString,
-
-//TODOC: what is priority?
- setValue:function(/*Date*/ date, /*Boolean*/ priority){
- // summary:
- // Set the value of the TimePicker
- // Redraws the TimePicker around the new date
-
- //dijit._TimePicker.superclass.setValue.apply(this, arguments);
- this.value=date;
- this._showText();
- },
-
- isDisabledDate: function(/*Date*/dateObject, /*String?*/locale){
- // summary:
- // May be overridden to disable certain dates in the TimePicker e.g. `isDisabledDate=dojo.date.locale.isWeekend`
- return false; // Boolean
- },
-
- _showText:function(){
- this.timeMenu.innerHTML = "";
- var fromIso = dojo.date.stamp.fromISOString;
- this._clickableIncrementDate=fromIso(this.clickableIncrement);
- this._visibleIncrementDate=fromIso(this.visibleIncrement);
- this._visibleRangeDate=fromIso(this.visibleRange);
- // get the value of the increments and the range in seconds (since 00:00:00) to find out how many divs to create
- var sinceMidnight = function(/*Date*/ date){
- return date.getHours() * 60 * 60 + date.getMinutes() * 60 + date.getSeconds();
- };
-
- var clickableIncrementSeconds = sinceMidnight(this._clickableIncrementDate);
- var visibleIncrementSeconds = sinceMidnight(this._visibleIncrementDate);
- var visibleRangeSeconds = sinceMidnight(this._visibleRangeDate);
-
- // round reference date to previous visible increment
- var time = this.value.getTime();
- this._refDate = new Date(time - time % (visibleIncrementSeconds*1000));
- this._refDate.setFullYear(1970,0,1); // match parse defaults
-
- // assume clickable increment is the smallest unit
- this._clickableIncrement = 1;
- // divide the visible range by the clickable increment to get the number of divs to create
- // example: 10:00:00/00:15:00 -> display 40 divs
- this._totalIncrements = visibleRangeSeconds / clickableIncrementSeconds;
- // divide the visible increments by the clickable increments to get how often to display the time inline
- // example: 01:00:00/00:15:00 -> display the time every 4 divs
- this._visibleIncrement = visibleIncrementSeconds / clickableIncrementSeconds;
- for(var i = -(this._totalIncrements >> 1); i < (this._totalIncrements >> 1); i += this._clickableIncrement){
- this.timeMenu.appendChild(this._createOption(i));
- }
-
- // TODO:
- // I commented this out because it
- // causes problems for a TimeTextBox in a Dialog, or as the editor of an InlineEditBox,
- // because the timeMenu node isn't visible yet. -- Bill (Bug #????)
- // dijit.focus(this.timeMenu);
- },
-
- postCreate:function(){
- // instantiate constraints
- if(this.constraints===dijit._TimePicker.prototype.constraints){
- this.constraints={};
- }
-
- // brings in visibleRange, increments, etc.
- dojo.mixin(this, this.constraints);
-
- // dojo.date.locale needs the lang in the constraints as locale
- if(!this.constraints.locale){
- this.constraints.locale=this.lang;
- }
-
- // assign typematic mouse listeners to the arrow buttons
- this.connect(this.timeMenu, dojo.isIE ? "onmousewheel" : 'DOMMouseScroll', "_mouseWheeled");
- var typematic = dijit.typematic.addMouseListener;
- typematic(this.upArrow,this,this._onArrowUp, 0.8, 500);
- typematic(this.downArrow,this,this._onArrowDown, 0.8, 500);
- //dijit.typematic.addListener(this.upArrow,this.timeMenu, {keyCode:dojo.keys.UP_ARROW,ctrlKey:false,altKey:false,shiftKey:false}, this, "_onArrowUp", 0.8, 500);
- //dijit.typematic.addListener(this.downArrow, this.timeMenu, {keyCode:dojo.keys.DOWN_ARROW,ctrlKey:false,altKey:false,shiftKey:false}, this, "_onArrowDown", 0.8,500);
-
- this.inherited(arguments);
- this.setValue(this.value);
- },
-
- _createOption:function(/*Number*/ index){
- // summary: creates a clickable time option
- var div = dojo.doc.createElement("div");
- var date = (div.date = new Date(this._refDate));
- div.index = index;
- var incrementDate = this._clickableIncrementDate;
- date.setHours(date.getHours() + incrementDate.getHours() * index,
- date.getMinutes() + incrementDate.getMinutes() * index,
- date.getSeconds() + incrementDate.getSeconds() * index);
-
- var innerDiv = dojo.doc.createElement('div');
- dojo.addClass(div,this.baseClass+"Item");
- dojo.addClass(innerDiv,this.baseClass+"ItemInner");
- innerDiv.innerHTML = dojo.date.locale.format(date, this.constraints);
- div.appendChild(innerDiv);
-
- if(index%this._visibleIncrement<1 && index%this._visibleIncrement>-1){
- dojo.addClass(div, this.baseClass+"Marker");
- }else if(!(index%this._clickableIncrement)){
- dojo.addClass(div, this.baseClass+"Tick");
- }
-
- if(this.isDisabledDate(date)){
- // set disabled
- dojo.addClass(div, this.baseClass+"ItemDisabled");
- }
- if(!dojo.date.compare(this.value, date, this.constraints.selector)){
- div.selected = true;
- dojo.addClass(div, this.baseClass+"ItemSelected");
- }
- return div;
- },
-
- _onOptionSelected:function(/*Object*/ tgt){
- var tdate = tgt.target.date || tgt.target.parentNode.date;
- if(!tdate || this.isDisabledDate(tdate)){ return; }
- this.setValue(tdate);
- this.onValueSelected(tdate);
- },
-
- onValueSelected:function(value){
- },
-
- onmouseover:function(/*Event*/ e){
- var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode;
- this._highlighted_option=tgr;
- dojo.addClass(tgr, this.baseClass+"ItemHover");
- },
-
- onmouseout:function(/*Event*/ e){
- var tgr = (e.target.parentNode === this.timeMenu) ? e.target : e.target.parentNode;
- if(this._highlighted_option===tgr){
- dojo.removeClass(tgr, this.baseClass+"ItemHover");
- }
- },
-
- _mouseWheeled:function(/*Event*/e){
- // summary: handle the mouse wheel listener
- dojo.stopEvent(e);
- // we're not _measuring_ the scroll amount, just direction
- var scrollAmount = (dojo.isIE ? e.wheelDelta : -e.detail);
- this[(scrollAmount>0 ? "_onArrowUp" : "_onArrowDown")](); // yes, we're making a new dom node every time you mousewheel, or click
- },
-
- _onArrowUp:function(){
- // summary: remove the bottom time and add one to the top
- var index = this.timeMenu.childNodes[0].index - 1;
- var div = this._createOption(index);
- this.timeMenu.removeChild(this.timeMenu.childNodes[this.timeMenu.childNodes.length - 1]);
- this.timeMenu.insertBefore(div, this.timeMenu.childNodes[0]);
- },
-
- _onArrowDown:function(){
- // summary: remove the top time and add one to the bottom
- var index = this.timeMenu.childNodes[this.timeMenu.childNodes.length - 1].index + 1;
- var div = this._createOption(index);
- this.timeMenu.removeChild(this.timeMenu.childNodes[0]);
- this.timeMenu.appendChild(div);
- }
- }
-);
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/_Widget.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/_Widget.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/_Widget.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,407 +0,0 @@
-if(!dojo._hasResource["dijit._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit._Widget"] = true;
-dojo.provide("dijit._Widget");
-
-dojo.require( "dijit._base" );
-
-dojo.declare("dijit._Widget", null, {
- // summary:
- // The foundation of dijit widgets.
- //
- // id: String
- // a unique, opaque ID string that can be assigned by users or by the
- // system. If the developer passes an ID which is known not to be
- // unique, the specified ID is ignored and the system-generated ID is
- // used instead.
- id: "",
-
- // lang: String
- // Rarely used. Overrides the default Dojo locale used to render this widget,
- // as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
- // Value must be among the list of locales specified during by the Dojo bootstrap,
- // formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
- lang: "",
-
- // dir: String
- // Unsupported by Dijit, but here for completeness. Dijit only supports setting text direction on the
- // entire document.
- // Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
- // attribute. Either left-to-right "ltr" or right-to-left "rtl".
- dir: "",
-
- // class: String
- // HTML class attribute
- "class": "",
-
- // style: String
- // HTML style attribute
- style: "",
-
- // title: String
- // HTML title attribute
- title: "",
-
- // srcNodeRef: DomNode
- // pointer to original dom node
- srcNodeRef: null,
-
- // domNode: DomNode
- // this is our visible representation of the widget! Other DOM
- // Nodes may by assigned to other properties, usually through the
- // template system's dojoAttachPonit syntax, but the domNode
- // property is the canonical "top level" node in widget UI.
- domNode: null,
-
- // attributeMap: Object
- // A map of attributes and attachpoints -- typically standard HTML attributes -- to set
- // on the widget's dom, at the "domNode" attach point, by default.
- // Other node references can be specified as properties of 'this'
- attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""}, // TODO: add on* handlers?
-
- //////////// INITIALIZATION METHODS ///////////////////////////////////////
-//TODOC: params and srcNodeRef need docs. Is srcNodeRef optional?
-//TODOC: summary needed for postscript
- postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
- this.create(params, srcNodeRef);
- },
-
- create: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
- // summary:
- // Kick off the life-cycle of a widget
- // description:
- // To understand the process by which widgets are instantiated, it
- // is critical to understand what other methods create calls and
- // which of them you'll want to override. Of course, adventurous
- // developers could override create entirely, but this should
- // only be done as a last resort.
- //
- // Below is a list of the methods that are called, in the order
- // they are fired, along with notes about what they do and if/when
- // you should over-ride them in your widget:
- //
- // * postMixInProperties:
- // | * a stub function that you can over-ride to modify
- // variables that may have been naively assigned by
- // mixInProperties
- // * widget is added to manager object here
- // * buildRendering:
- // | * Subclasses use this method to handle all UI initialization
- // Sets this.domNode. Templated widgets do this automatically
- // and otherwise it just uses the source dom node.
- // * postCreate:
- // | * a stub function that you can over-ride to modify take
- // actions once the widget has been placed in the UI
-
- // store pointer to original dom tree
- this.srcNodeRef = dojo.byId(srcNodeRef);
-
- // For garbage collection. An array of handles returned by Widget.connect()
- // Each handle returned from Widget.connect() is an array of handles from dojo.connect()
- this._connects=[];
-
- // _attaches: String[]
- // names of all our dojoAttachPoint variables
- this._attaches=[];
-
- //mixin our passed parameters
- if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; }
- if(params){
- this.params = params;
- dojo.mixin(this,params);
- }
- this.postMixInProperties();
-
- // generate an id for the widget if one wasn't specified
- // (be sure to do this before buildRendering() because that function might
- // expect the id to be there.
- if(!this.id){
- this.id=dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
- }
- dijit.registry.add(this);
-
- this.buildRendering();
-
- // Copy attributes listed in attributeMap into the [newly created] DOM for the widget.
- // The placement of these attributes is according to the property mapping in attributeMap.
- // Note special handling for 'style' and 'class' attributes which are lists and can
- // have elements from both old and new structures, and some attributes like "type"
- // cannot be processed this way as they are not mutable.
- if(this.domNode){
- for(var attr in this.attributeMap){
- var value = this[attr];
- if(typeof value != "object" && ((value !== "" && value !== false) || (params && params[attr]))){
- this.setAttribute(attr, value);
- }
- }
- }
-
- if(this.domNode){
- this.domNode.setAttribute("widgetId", this.id);
- }
- this.postCreate();
-
- // If srcNodeRef has been processed and removed from the DOM (e.g. TemplatedWidget) then delete it to allow GC.
- if(this.srcNodeRef && !this.srcNodeRef.parentNode){
- delete this.srcNodeRef;
- }
- },
-
- postMixInProperties: function(){
- // summary
- // Called after the parameters to the widget have been read-in,
- // but before the widget template is instantiated.
- // Especially useful to set properties that are referenced in the widget template.
- },
-
- buildRendering: function(){
- // summary:
- // Construct the UI for this widget, setting this.domNode.
- // Most widgets will mixin TemplatedWidget, which overrides this method.
- this.domNode = this.srcNodeRef || dojo.doc.createElement('div');
- },
-
- postCreate: function(){
- // summary:
- // Called after a widget's dom has been setup
- },
-
- startup: function(){
- // summary:
- // Called after a widget's children, and other widgets on the page, have been created.
- // Provides an opportunity to manipulate any children before they are displayed.
- // This is useful for composite widgets that need to control or layout sub-widgets.
- // Many layout widgets can use this as a wiring phase.
- this._started = true;
- },
-
- //////////// DESTROY FUNCTIONS ////////////////////////////////
-
- destroyRecursive: function(/*Boolean*/ finalize){
- // summary:
- // Destroy this widget and it's descendants. This is the generic
- // "destructor" function that all widget users should call to
- // cleanly discard with a widget. Once a widget is destroyed, it's
- // removed from the manager object.
- // finalize: Boolean
- // is this function being called part of global environment
- // tear-down?
-
- this.destroyDescendants();
- this.destroy();
- },
-
- destroy: function(/*Boolean*/ finalize){
- // summary:
- // Destroy this widget, but not its descendants
- // finalize: Boolean
- // is this function being called part of global environment
- // tear-down?
-
- this.uninitialize();
- dojo.forEach(this._connects, function(array){
- dojo.forEach(array, dojo.disconnect);
- });
-
- // destroy widgets created as part of template, etc.
- dojo.forEach(this._supportingWidgets || [], function(w){ w.destroy(); });
-
- this.destroyRendering(finalize);
- dijit.registry.remove(this.id);
- },
-
- destroyRendering: function(/*Boolean*/ finalize){
- // summary:
- // Destroys the DOM nodes associated with this widget
- // finalize: Boolean
- // is this function being called part of global environment
- // tear-down?
-
- if(this.bgIframe){
- this.bgIframe.destroy();
- delete this.bgIframe;
- }
-
- if(this.domNode){
- dojo._destroyElement(this.domNode);
- delete this.domNode;
- }
-
- if(this.srcNodeRef){
- dojo._destroyElement(this.srcNodeRef);
- delete this.srcNodeRef;
- }
- },
-
- destroyDescendants: function(){
- // summary:
- // Recursively destroy the children of this widget and their
- // descendants.
-
- // TODO: should I destroy in the reverse order, to go bottom up?
- dojo.forEach(this.getDescendants(), function(widget){ widget.destroy(); });
- },
-
- uninitialize: function(){
- // summary:
- // stub function. Override to implement custom widget tear-down
- // behavior.
- return false;
- },
-
- ////////////////// MISCELLANEOUS METHODS ///////////////////
-
- onFocus: function(){
- // summary:
- // stub function. Override or connect to this method to receive
- // notifications for when the widget moves into focus.
- },
-
- onBlur: function(){
- // summary:
- // stub function. Override or connect to this method to receive
- // notifications for when the widget moves out of focus.
- },
-
- _onFocus: function(e){
- this.onFocus();
- },
-
- _onBlur: function(){
- this.onBlur();
- },
-
- setAttribute: function(/*String*/ attr, /*anything*/ value){
- // summary
- // Set native HTML attributes reflected in the widget,
- // such as readOnly, disabled, and maxLength in TextBox widgets.
- // description
- // In general, a widget's "value" is controlled via setValue()/getValue(),
- // rather than this method. The exception is for widgets where the
- // end user can't adjust the value, such as Button and CheckBox;
- // in the unusual case that you want to change the value attribute of
- // those widgets, use setAttribute().
- var mapNode = this[this.attributeMap[attr]||'domNode'];
- this[attr] = value;
- switch(attr){
- case "class":
- dojo.addClass(mapNode, value);
- break;
- case "style":
- if(mapNode.style.cssText){
- mapNode.style.cssText += "; " + value;// FIXME: Opera
- }else{
- mapNode.style.cssText = value;
- }
- break;
- default:
- if(/^on[A-Z]/.test(attr)){ // eg. onSubmit needs to be onsubmit
- attr = attr.toLowerCase();
- }
- if(typeof value == "function"){ // functions execute in the context of the widget
- value = dojo.hitch(this, value);
- }
- dojo.attr(mapNode, attr, value);
- }
- },
-
- toString: function(){
- // summary:
- // returns a string that represents the widget. When a widget is
- // cast to a string, this method will be used to generate the
- // output. Currently, it does not implement any sort of reversable
- // serialization.
- return '[Widget ' + this.declaredClass + ', ' + (this.id || 'NO ID') + ']'; // String
- },
-
- getDescendants: function(){
- // summary:
- // Returns all the widgets that contained by this, i.e., all widgets underneath this.containerNode.
- if(this.containerNode){
- var list= dojo.query('[widgetId]', this.containerNode);
- return list.map(dijit.byNode); // Array
- }else{
- return [];
- }
- },
-
-//TODOC
- nodesWithKeyClick: ["input", "button"],
-
- connect: function(
- /*Object|null*/ obj,
- /*String*/ event,
- /*String|Function*/ method){
- // summary:
- // Connects specified obj/event to specified method of this object
- // and registers for disconnect() on widget destroy.
- // Special event: "ondijitclick" triggers on a click or enter-down or space-up
- // Similar to dojo.connect() but takes three arguments rather than four.
- var handles =[];
- if(event == "ondijitclick"){
- // add key based click activation for unsupported nodes.
- if(!this.nodesWithKeyClick[obj.nodeName]){
- handles.push(dojo.connect(obj, "onkeydown", this,
- function(e){
- if(e.keyCode == dojo.keys.ENTER){
- return (dojo.isString(method))?
- this[method](e) : method.call(this, e);
- }else if(e.keyCode == dojo.keys.SPACE){
- // stop space down as it causes IE to scroll
- // the browser window
- dojo.stopEvent(e);
- }
- }));
- handles.push(dojo.connect(obj, "onkeyup", this,
- function(e){
- if(e.keyCode == dojo.keys.SPACE){
- return dojo.isString(method) ?
- this[method](e) : method.call(this, e);
- }
- }));
- }
- event = "onclick";
- }
- handles.push(dojo.connect(obj, event, this, method));
-
- // return handles for FormElement and ComboBox
- this._connects.push(handles);
- return handles;
- },
-
- disconnect: function(/*Object*/ handles){
- // summary:
- // Disconnects handle created by this.connect.
- // Also removes handle from this widget's list of connects
- for(var i=0; i<this._connects.length; i++){
- if(this._connects[i]==handles){
- dojo.forEach(handles, dojo.disconnect);
- this._connects.splice(i, 1);
- return;
- }
- }
- },
-
- isLeftToRight: function(){
- // summary:
- // Checks the DOM to for the text direction for bi-directional support
- // description:
- // This method cannot be used during widget construction because the widget
- // must first be connected to the DOM tree. Parent nodes are searched for the
- // 'dir' attribute until one is found, otherwise left to right mode is assumed.
- // See HTML spec, DIR attribute for more information.
-
- if(!("_ltr" in this)){
- this._ltr = dojo.getComputedStyle(this.domNode).direction != "rtl";
- }
- return this._ltr; //Boolean
- },
-
- isFocusable: function(){
- // summary:
- // Return true if this widget can currently be focused
- // and false if not
- return this.focus && (dojo.style(this.domNode, "display") != "none");
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/_base.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/_base.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/_base.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,27 +0,0 @@
-if(!dojo._hasResource["dijit._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dijit._base"] = true;
-dojo.provide("dijit._base");
-
-dojo.require("dijit._base.focus");
-dojo.require("dijit._base.manager");
-dojo.require("dijit._base.place");
-dojo.require("dijit._base.popup");
-dojo.require("dijit._base.scroll");
-dojo.require("dijit._base.sniff");
-dojo.require("dijit._base.bidi");
-dojo.require("dijit._base.typematic");
-dojo.require("dijit._base.wai");
-dojo.require("dijit._base.window");
-
-// FIXME: Find a better way of solving this bug!
-if(dojo.isSafari){
- // Ugly-ass hack to solve bug #5626 for 1.1; basically force Safari to re-layout.
- // Note that we can't reliably use dojo.addOnLoad here because this bug is basically
- // a timing / race condition; so instead we use window.onload.
- dojo.connect(window, "load", function(){
- window.resizeBy(1,0);
- setTimeout(function(){ window.resizeBy(-1,0); }, 10);
- });
-}
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dijit/changes.txt
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dijit/changes.txt 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dijit/changes.txt 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,93 +0,0 @@
-Changes from Dojo 0.4 dojo.widgets to new dijit project
-=======================================================
-
-The widgets and widget infrastructure have been separated into separate project,
-vastly streamlined and with a new directory structure. There are many other changes.
-
-Markup
-------
-
-dojoType="button" replaced by dojoType="dijit.Button" Must use fully qualified class name,
-and it's case-sensitive.
-
-Need to manually dojo.require("dojo.parser") to get parsing
-
-Widget namespaces and widget auto-loading are desupported.
-
-onClick="foo" now overrides (ie, replaces) the default onClick() function rather than attaching to it,
-so widget designers should make empty onClick() functions (when appropriate).
-
-Programmatic creation
----------------------
-Create widgets via
-
- new dijit.Button(params, srcNodeRef)
-
-createWidget() call removed since multiple renderers are no longer supported (see next section).
-
-At least for the dijit widgets, all widgets are guaranteed to work programmatically, which in
-effect means that all widgets must have templates, unless the default <div> works.
-
-Renderers
----------
-Removed support for multiple renderers (svg & vml & a11y) for a single widget.
-If a widget wants to render differently on different platforms, there must be
-branching code inside the widget, or it needs to call a library that branches
-based on the browser type (like dojo.gfx or dojo.charting).
-
-
-Templates
----------
-"this." is no longer used within ${} substitution notation. See ticket #2905.
-dojoRoot,buildScriptBase,dojoModuleUrl are no longer supported, but
-any JavaScript properties on the widget's 'this' may be referenced with dotted notation.
-The attributes dojoOn* are desupported (including dojoOnBuild);
-also can't use id attribute to affect a dojoAttachPoint.
-
-dojoAttachEvent is case sensitive, so capitalization matters. You will probably have
-to change
-
-dojoAttachEvent="onClick"
-
-to
-
-dojoAttachEvent="onclick: onClick"
-
-(given that the event name is lowercase, and assuming that the method name is camel case)
-
-lists within dojoAttachPoint, dojoAttachEvent, waiRole, and waiState are now comma-separated
-(not separated by semi-colons)
-
-Standard HTML attributes like 'id', 'name', 'lang', etc. are carried over programmatically
-by the _Widget constructor and do not need to be declared in the template (see _Widget.attributeMap)
-
-Parent/Child relationships
---------------------------
-By default widgets exist as islands, not knowing about their parent widget or children widgets.
-The exception is the destroy() function which will also delete all descendant widgets.
-Some widgets like Tree and SplitContainer will know about their children, but those widgets
-will use the special mixins in Container.js / Layout.js.
-
-Widget.js base class
---------------------
-
- - Widget.js, Domwidget.js, HtmlWidget.js combined into dijit.base.Widget, with TemplatedWidget mixin
-for widgets with templates
-
- - on widget creation, postMixInProperties(), buildRendering() and postCreate() is called.
- fillInTemplate() is no longer called. In addition, those functions call signatures have changed.
- No arguments are passed. To get the source dom Node, just reference this.srcDomNode.
-When postCreate() is called the widget children don't yet exist.
-
- - The TemplatedWidget mixin defines buildRendering(). widgetsInTemplate not ported yet.
-
- - onResized() removed
-
- - the whole parent/child relationship thing is gone
-
- - extraArgs[] is gone
-
- - postCreate() called but child widgets don't exist yet
-
- - templateCssPath ignored. User must manually include tundra.css file
-
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/AdapterRegistry.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/AdapterRegistry.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/AdapterRegistry.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,99 +0,0 @@
-if(!dojo._hasResource["dojo.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.AdapterRegistry"] = true;
-dojo.provide("dojo.AdapterRegistry");
-
-dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
- // summary:
- // A registry to make contextual calling/searching easier.
- // description:
- // Objects of this class keep list of arrays in the form [name, check,
- // wrap, directReturn] that are used to determine what the contextual
- // result of a set of checked arguments is. All check/wrap functions
- // in this registry should be of the same arity.
- // example:
- // | // create a new registry
- // | var reg = new dojo.AdapterRegistry();
- // | reg.register("handleString",
- // | dojo.isString,
- // | function(str){
- // | // do something with the string here
- // | }
- // | );
- // | reg.register("handleArr",
- // | dojo.isArray,
- // | function(arr){
- // | // do something with the array here
- // | }
- // | );
- // |
- // | // now we can pass reg.match() *either* an array or a string and
- // | // the value we pass will get handled by the right function
- // | reg.match("someValue"); // will call the first function
- // | reg.match(["someValue"]); // will call the second
-
- this.pairs = [];
- this.returnWrappers = returnWrappers || false; // Boolean
-}
-
-dojo.extend(dojo.AdapterRegistry, {
- register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
- // summary:
- // register a check function to determine if the wrap function or
- // object gets selected
- // name:
- // a way to identify this matcher.
- // check:
- // a function that arguments are passed to from the adapter's
- // match() function. The check function should return true if the
- // given arguments are appropriate for the wrap function.
- // directReturn:
- // If directReturn is true, the value passed in for wrap will be
- // returned instead of being called. Alternately, the
- // AdapterRegistry can be set globally to "return not call" using
- // the returnWrappers property. Either way, this behavior allows
- // the registry to act as a "search" function instead of a
- // function interception library.
- // override:
- // If override is given and true, the check function will be given
- // highest priority. Otherwise, it will be the lowest priority
- // adapter.
- this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
- },
-
- match: function(/* ... */){
- // summary:
- // Find an adapter for the given arguments. If no suitable adapter
- // is found, throws an exception. match() accepts any number of
- // arguments, all of which are passed to all matching functions
- // from the registered pairs.
- for(var i = 0; i < this.pairs.length; i++){
- var pair = this.pairs[i];
- if(pair[1].apply(this, arguments)){
- if((pair[3])||(this.returnWrappers)){
- return pair[2];
- }else{
- return pair[2].apply(this, arguments);
- }
- }
- }
- throw new Error("No match found");
- },
-
- unregister: function(name){
- // summary: Remove a named adapter from the registry
-
- // FIXME: this is kind of a dumb way to handle this. On a large
- // registry this will be slow-ish and we can use the name as a lookup
- // should we choose to trade memory for speed.
- for(var i = 0; i < this.pairs.length; i++){
- var pair = this.pairs[i];
- if(pair[0] == name){
- this.pairs.splice(i, 1);
- return true;
- }
- }
- return false;
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/DeferredList.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/DeferredList.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/DeferredList.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,88 +0,0 @@
-if(!dojo._hasResource["dojo.DeferredList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.DeferredList"] = true;
-dojo.provide("dojo.DeferredList");
-dojo.declare("dojo.DeferredList", dojo.Deferred, {
- constructor: function(/*Array*/ list, /*Boolean?*/ fireOnOneCallback, /*Boolean?*/ fireOnOneErrback, /*Boolean?*/ consumeErrors, /*Function?*/ canceller){
- // summary:
- // Provides event handling for a group of Deferred objects.
- // description:
- // DeferredList takes an array of existing deferreds and returns a new deferred of its own
- // this new deferred will typically have its callback fired when all of the deferreds in
- // the given list have fired their own deferreds. The parameters `fireOnOneCallback` and
- // fireOnOneErrback, will fire before all the deferreds as appropriate
- //
- // list:
- // The list of deferreds to be synchronizied with this DeferredList
- // fireOnOneCallback:
- // Will cause the DeferredLists callback to be fired as soon as any
- // of the deferreds in its list have been fired instead of waiting until
- // the entire list has finished
- // fireonOneErrback:
- // Will cause the errback to fire upon any of the deferreds errback
- // canceller:
- // A deferred canceller function, see dojo.Deferred
- this.list = list;
- this.resultList = new Array(this.list.length);
-
- // Deferred init
- this.chain = [];
- this.id = this._nextId();
- this.fired = -1;
- this.paused = 0;
- this.results = [null, null];
- this.canceller = canceller;
- this.silentlyCancelled = false;
-
- if(this.list.length === 0 && !fireOnOneCallback){
- this.callback(this.resultList);
- }
-
- this.finishedCount = 0;
- this.fireOnOneCallback = fireOnOneCallback;
- this.fireOnOneErrback = fireOnOneErrback;
- this.consumeErrors = consumeErrors;
-
- dojo.forEach(this.list, function(d, index){
- d.addCallback(this, function(r){ this._cbDeferred(index, true, r); return r; });
- d.addErrback(this, function(r){ this._cbDeferred(index, false, r); return r; });
- }, this);
- },
-
- _cbDeferred: function(index, succeeded, result){
- // summary:
- // The DeferredLists' callback handler
-
- this.resultList[index] = [succeeded, result]; this.finishedCount += 1;
- if(this.fired !== 0){
- if(succeeded && this.fireOnOneCallback){
- this.callback([index, result]);
- }else if(!succeeded && this.fireOnOneErrback){
- this.errback(result);
- }else if(this.finishedCount == this.list.length){
- this.callback(this.resultList);
- }
- }
- if(!succeeded && this.consumeErrors){
- result = null;
- }
- return result;
- },
-
- gatherResults: function(deferredList){
- // summary:
- // Gathers the results of the deferreds for packaging
- // as the parameters to the Deferred Lists' callback
-
- var d = new dojo.DeferredList(deferredList, false, true, false);
- d.addCallback(function(results){
- var ret = [];
- dojo.forEach(results, function(result){
- ret.push(result[1]);
- });
- return ret;
- });
- return d;
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/NodeList-fx.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/NodeList-fx.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/NodeList-fx.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,137 +0,0 @@
-if(!dojo._hasResource["dojo.NodeList-fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.NodeList-fx"] = true;
-dojo.provide("dojo.NodeList-fx");
-dojo.require("dojo.fx");
-
-/*=====
-dojo["NodeList-fx"] = {
- // summary: Adds dojo.fx animation support to dojo.query()
-};
-=====*/
-
-dojo.extend(dojo.NodeList, {
- _anim: function(obj, method, args){
- args = args||{};
- return dojo.fx.combine(
- this.map(function(item){
- var tmpArgs = { node: item };
- dojo.mixin(tmpArgs, args);
- return obj[method](tmpArgs);
- })
- ); // dojo._Animation
- },
-
- wipeIn: function(args){
- // summary:
- // wipe in all elements of this NodeList. Returns an instance of dojo._Animation
- // example:
- // Fade in all tables with class "blah":
- // | dojo.query("table.blah").wipeIn().play();
- return this._anim(dojo.fx, "wipeIn", args); // dojo._Animation
- },
-
- wipeOut: function(args){
- // summary:
- // wipe out all elements of this NodeList. Returns an instance of dojo._Animation
- // example:
- // Wipe out all tables with class "blah":
- // | dojo.query("table.blah").wipeOut().play();
- return this._anim(dojo.fx, "wipeOut", args); // dojo._Animation
- },
-
- slideTo: function(args){
- // summary:
- // slide all elements of the node list to the specified place.
- // Returns an instance of dojo._Animation
- // example:
- // | Move all tables with class "blah" to 300/300:
- // | dojo.query("table.blah").slideTo({
- // | left: 40,
- // | top: 50
- // | }).play();
- return this._anim(dojo.fx, "slideTo", args); // dojo._Animation
- },
-
-
- fadeIn: function(args){
- // summary:
- // fade in all elements of this NodeList. Returns an instance of dojo._Animation
- // example:
- // Fade in all tables with class "blah":
- // | dojo.query("table.blah").fadeIn().play();
- return this._anim(dojo, "fadeIn", args); // dojo._Animation
- },
-
- fadeOut: function(args){
- // summary:
- // fade out all elements of this NodeList. Returns an instance of dojo._Animation
- // example:
- // Fade out all elements with class "zork":
- // | dojo.query(".zork").fadeOut().play();
- // example:
- // Fade them on a delay and do something at the end:
- // | var fo = dojo.query(".zork").fadeOut();
- // | dojo.connect(fo, "onEnd", function(){ /*...*/ });
- // | fo.play();
- return this._anim(dojo, "fadeOut", args); // dojo._Animation
- },
-
- animateProperty: function(args){
- // summary:
- // see dojo.animateProperty(). Animate all elements of this
- // NodeList across the properties specified.
- // example:
- // | dojo.query(".zork").animateProperty({
- // | duration: 500,
- // | properties: {
- // | color: { start: "black", end: "white" },
- // | left: { end: 300 }
- // | }
- // | }).play();
- return this._anim(dojo, "animateProperty", args); // dojo._Animation
- },
-
- anim: function( /*Object*/ properties,
- /*Integer?*/ duration,
- /*Function?*/ easing,
- /*Function?*/ onEnd,
- /*Integer?*/ delay){
- // summary:
- // Animate one or more CSS properties for all nodes in this list.
- // The returned animation object will already be playing when it
- // is returned. See the docs for `dojo.anim` for full details.
- // properties: Object
- // the properties to animate
- // duration: Integer?
- // Optional. The time to run the animations for
- // easing: Function?
- // Optional. The easing function to use.
- // onEnd: Function?
- // A function to be called when the animation ends
- // delay:
- // how long to delay playing the returned animation
- // example:
- // Another way to fade out:
- // | dojo.query(".thinger").anim({ opacity: 0 });
- // example:
- // animate all elements with the "thigner" class to a width of 500
- // pixels over half a second
- // | dojo.query(".thinger").anim({ width: 500 }, 700);
- var canim = dojo.fx.combine(
- this.map(function(item){
- return dojo.animateProperty({
- node: item,
- properties: properties,
- duration: duration||350,
- easing: easing
- });
- })
- );
- if(onEnd){
- dojo.connect(canim, "onEnd", onEnd);
- }
- return canim.play(delay||0); // dojo._Animation
- }
-});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/OpenAjax.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/OpenAjax.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/OpenAjax.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * OpenAjax.js
- *
- * Reference implementation of the OpenAjax Hub, as specified by OpenAjax Alliance.
- * Specification is under development at:
- *
- * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
- *
- * Copyright 2006-2007 OpenAjax Alliance
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at http://www.apache.org/licenses/LICENSE-2.0 . Unless
- * required by applicable law or agreed to in writing, software distributed
- * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- *
- ******************************************************************************/
-
-// prevent re-definition of the OpenAjax object
-if(!window["OpenAjax"]){
- OpenAjax = new function(){
- // summary: the OpenAjax hub
- // description: see http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
-
- var t = true;
- var f = false;
- var g = window;
- var libs;
- var ooh = "org.openajax.hub.";
-
- var h = {};
- this.hub = h;
- h.implementer = "http://openajax.org";
- h.implVersion = "0.6";
- h.specVersion = "0.6";
- h.implExtraData = {};
- var libs = {};
- h.libraries = libs;
-
- h.registerLibrary = function(prefix, nsURL, version, extra){
- libs[prefix] = {
- prefix: prefix,
- namespaceURI: nsURL,
- version: version,
- extraData: extra
- };
- this.publish(ooh+"registerLibrary", libs[prefix]);
- }
- h.unregisterLibrary = function(prefix){
- this.publish(ooh+"unregisterLibrary", libs[prefix]);
- delete libs[prefix];
- }
-
- h._subscriptions = { c:{}, s:[] };
- h._cleanup = [];
- h._subIndex = 0;
- h._pubDepth = 0;
-
- h.subscribe = function(name, callback, scope, subscriberData, filter){
- if(!scope){
- scope = window;
- }
- var handle = name + "." + this._subIndex;
- var sub = { scope: scope, cb: callback, fcb: filter, data: subscriberData, sid: this._subIndex++, hdl: handle };
- var path = name.split(".");
- this._subscribe(this._subscriptions, path, 0, sub);
- return handle;
- }
-
- h.publish = function(name, message){
- var path = name.split(".");
- this._pubDepth++;
- this._publish(this._subscriptions, path, 0, name, message);
- this._pubDepth--;
- if((this._cleanup.length > 0) && (this._pubDepth == 0)){
- for(var i = 0; i < this._cleanup.length; i++){
- this.unsubscribe(this._cleanup[i].hdl);
- }
- delete(this._cleanup);
- this._cleanup = [];
- }
- }
-
- h.unsubscribe = function(sub){
- var path = sub.split(".");
- var sid = path.pop();
- this._unsubscribe(this._subscriptions, path, 0, sid);
- }
-
- h._subscribe = function(tree, path, index, sub){
- var token = path[index];
- if(index == path.length){
- tree.s.push(sub);
- }else{
- if(typeof tree.c == "undefined"){
- tree.c = {};
- }
- if(typeof tree.c[token] == "undefined"){
- tree.c[token] = { c: {}, s: [] };
- this._subscribe(tree.c[token], path, index + 1, sub);
- }else{
- this._subscribe( tree.c[token], path, index + 1, sub);
- }
- }
- }
-
- h._publish = function(tree, path, index, name, msg){
- if(typeof tree != "undefined"){
- var node;
- if(index == path.length) {
- node = tree;
- }else{
- this._publish(tree.c[path[index]], path, index + 1, name, msg);
- this._publish(tree.c["*"], path, index + 1, name, msg);
- node = tree.c["**"];
- }
- if(typeof node != "undefined"){
- var callbacks = node.s;
- var max = callbacks.length;
- for(var i = 0; i < max; i++){
- if(callbacks[i].cb){
- var sc = callbacks[i].scope;
- var cb = callbacks[i].cb;
- var fcb = callbacks[i].fcb;
- var d = callbacks[i].data;
- if(typeof cb == "string"){
- // get a function object
- cb = sc[cb];
- }
- if(typeof fcb == "string"){
- // get a function object
- fcb = sc[fcb];
- }
- if((!fcb) ||
- (fcb.call(sc, name, msg, d))) {
- cb.call(sc, name, msg, d);
- }
- }
- }
- }
- }
- }
-
- h._unsubscribe = function(tree, path, index, sid) {
- if(typeof tree != "undefined") {
- if(index < path.length) {
- var childNode = tree.c[path[index]];
- this._unsubscribe(childNode, path, index + 1, sid);
- if(childNode.s.length == 0) {
- for(var x in childNode.c)
- return;
- delete tree.c[path[index]];
- }
- return;
- }
- else {
- var callbacks = tree.s;
- var max = callbacks.length;
- for(var i = 0; i < max; i++)
- if(sid == callbacks[i].sid) {
- if(this._pubDepth > 0) {
- callbacks[i].cb = null;
- this._cleanup.push(callbacks[i]);
- }
- else
- callbacks.splice(i, 1);
- return;
- }
- }
- }
- }
- // The following function is provided for automatic testing purposes.
- // It is not expected to be deployed in run-time OpenAjax Hub implementations.
- h.reinit = function()
- {
- for (var lib in OpenAjax.hub.libraries) {
- delete OpenAjax.hub.libraries[lib];
- }
- OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "0.6", {});
-
- delete OpenAjax._subscriptions;
- OpenAjax._subscriptions = {c:{},s:[]};
- delete OpenAjax._cleanup;
- OpenAjax._cleanup = [];
- OpenAjax._subIndex = 0;
- OpenAjax._pubDepth = 0;
- }
- };
- // Register the OpenAjax Hub itself as a library.
- OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "0.6", {});
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/_base.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/_base.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/_base.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,13 +0,0 @@
-if(!dojo._hasResource["dojo._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo._base"] = true;
-dojo.provide("dojo._base");
-dojo.require("dojo._base.lang");
-dojo.require("dojo._base.declare");
-dojo.require("dojo._base.connect");
-dojo.require("dojo._base.Deferred");
-dojo.require("dojo._base.json");
-dojo.require("dojo._base.array");
-dojo.require("dojo._base.Color");
-dojo.requireIf(dojo.isBrowser, "dojo._base.browser");
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/back.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/back.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/back.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,394 +0,0 @@
-if(!dojo._hasResource["dojo.back"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.back"] = true;
-dojo.provide("dojo.back");
-
-/*=====
-dojo.back = {
- // summary: Browser history management resources
-}
-=====*/
-
-
-(function(){
- var back = dojo.back;
-
- // everyone deals with encoding the hash slightly differently
-
- function getHash(){
- var h = window.location.hash;
- if(h.charAt(0) == "#"){ h = h.substring(1); }
- return dojo.isMozilla ? h : decodeURIComponent(h);
- }
-
- function setHash(h){
- if(!h){ h = ""; }
- window.location.hash = encodeURIComponent(h);
- historyCounter = history.length;
- }
-
- // if we're in the test for these methods, expose them on dojo.back. ok'd with alex.
- if(dojo.exists("tests.back-hash")){
- back.getHash = getHash;
- back.setHash = setHash;
- }
-
- var initialHref = (typeof(window) !== "undefined") ? window.location.href : "";
- var initialHash = (typeof(window) !== "undefined") ? getHash() : "";
- var initialState = null;
-
- var locationTimer = null;
- var bookmarkAnchor = null;
- var historyIframe = null;
- var forwardStack = [];
- var historyStack = [];
- var moveForward = false;
- var changingUrl = false;
- var historyCounter;
-
- function handleBackButton(){
- //summary: private method. Do not call this directly.
-
- //The "current" page is always at the top of the history stack.
- //console.debug("handlingBackButton");
- var current = historyStack.pop();
- if(!current){ return; }
- var last = historyStack[historyStack.length-1];
- if(!last && historyStack.length == 0){
- last = initialState;
- }
- if(last){
- if(last.kwArgs["back"]){
- last.kwArgs["back"]();
- }else if(last.kwArgs["backButton"]){
- last.kwArgs["backButton"]();
- }else if(last.kwArgs["handle"]){
- last.kwArgs.handle("back");
- }
- }
- forwardStack.push(current);
- //console.debug("done handling back");
- }
-
- back.goBack = handleBackButton;
-
- function handleForwardButton(){
- //summary: private method. Do not call this directly.
- //console.debug("handling forward");
- var last = forwardStack.pop();
- if(!last){ return; }
- if(last.kwArgs["forward"]){
- last.kwArgs.forward();
- }else if(last.kwArgs["forwardButton"]){
- last.kwArgs.forwardButton();
- }else if(last.kwArgs["handle"]){
- last.kwArgs.handle("forward");
- }
- historyStack.push(last);
- //console.debug("done handling forward");
- }
-
- back.goForward = handleForwardButton;
-
- function createState(url, args, hash){
- //summary: private method. Do not call this directly.
- return {"url": url, "kwArgs": args, "urlHash": hash}; //Object
- }
-
- function getUrlQuery(url){
- //summary: private method. Do not call this directly.
- var segments = url.split("?");
- if(segments.length < 2){
- return null; //null
- }
- else{
- return segments[1]; //String
- }
- }
-
- function loadIframeHistory(){
- //summary: private method. Do not call this directly.
- var url = (dojo.config["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html")) + "?" + (new Date()).getTime();
- moveForward = true;
- if(historyIframe){
- dojo.isSafari ? historyIframe.location = url : window.frames[historyIframe.name].location = url;
- }else{
- //console.warn("dojo.back: Not initialised. You need to call dojo.back.init() from a <script> block that lives inside the <body> tag.");
- }
- return url; //String
- }
-
- function checkLocation(){
- //console.debug("checking url");
- if(!changingUrl){
- var hsl = historyStack.length;
-
- var hash = getHash();
-
- if((hash === initialHash||window.location.href == initialHref)&&(hsl == 1)){
- // FIXME: could this ever be a forward button?
- // we can't clear it because we still need to check for forwards. Ugg.
- // clearInterval(this.locationTimer);
- handleBackButton();
- return;
- }
-
- // first check to see if we could have gone forward. We always halt on
- // a no-hash item.
- if(forwardStack.length > 0){
- if(forwardStack[forwardStack.length-1].urlHash === hash){
- handleForwardButton();
- return;
- }
- }
-
- // ok, that didn't work, try someplace back in the history stack
- if((hsl >= 2)&&(historyStack[hsl-2])){
- if(historyStack[hsl-2].urlHash === hash){
- handleBackButton();
- return;
- }
- }
-
- if(dojo.isSafari && dojo.isSafari < 3){
- var hisLen = history.length;
- if(hisLen > historyCounter) handleForwardButton();
- else if(hisLen < historyCounter) handleBackButton();
- historyCounter = hisLen;
- }
- }
- //console.debug("done checking");
- };
-
- back.init = function(){
- //summary: Initializes the undo stack. This must be called from a <script>
- // block that lives inside the <body> tag to prevent bugs on IE.
- if(dojo.byId("dj_history")){ return; } // prevent reinit
- var src = dojo.config["dojoIframeHistoryUrl"] || dojo.moduleUrl("dojo", "resources/iframe_history.html");
- document.write('<iframe style="border:0;width:1px;height:1px;position:absolute;visibility:hidden;bottom:0;right:0;" name="dj_history" id="dj_history" src="' + src + '"></iframe>');
- };
-
- back.setInitialState = function(/*Object*/args){
- //summary:
- // Sets the state object and back callback for the very first page
- // that is loaded.
- //description:
- // It is recommended that you call this method as part of an event
- // listener that is registered via dojo.addOnLoad().
- //args: Object
- // See the addToHistory() function for the list of valid args properties.
- initialState = createState(initialHref, args, initialHash);
- };
-
- //FIXME: Make these doc comments not be awful. At least they're not wrong.
- //FIXME: Would like to support arbitrary back/forward jumps. Have to rework iframeLoaded among other things.
- //FIXME: is there a slight race condition in moz using change URL with the timer check and when
- // the hash gets set? I think I have seen a back/forward call in quick succession, but not consistent.
-
-
- /*=====
- dojo.__backArgs = function(kwArgs){
- // back: Function?
- // A function to be called when this state is reached via the user
- // clicking the back button.
- // forward: Function?
- // Upon return to this state from the "back, forward" combination
- // of navigation steps, this function will be called. Somewhat
- // analgous to the semantic of an "onRedo" event handler.
- // changeUrl: Boolean?|String?
- // Boolean indicating whether or not to create a unique hash for
- // this state. If a string is passed instead, it is used as the
- // hash.
- }
- =====*/
-
- back.addToHistory = function(/*dojo.__backArgs*/ args){
- // summary:
- // adds a state object (args) to the history list.
- // description:
- // To support getting back button notifications, the object
- // argument should implement a function called either "back",
- // "backButton", or "handle". The string "back" will be passed as
- // the first and only argument to this callback.
- //
- // To support getting forward button notifications, the object
- // argument should implement a function called either "forward",
- // "forwardButton", or "handle". The string "forward" will be
- // passed as the first and only argument to this callback.
- //
- // If you want the browser location string to change, define "changeUrl" on the object. If the
- // value of "changeUrl" is true, then a unique number will be appended to the URL as a fragment
- // identifier (http://some.domain.com/path#uniquenumber). If it is any other value that does
- // not evaluate to false, that value will be used as the fragment identifier. For example,
- // if changeUrl: 'page1', then the URL will look like: http://some.domain.com/path#page1
- //
- // example:
- // | dojo.back.addToHistory({
- // | back: function(){ console.debug('back pressed'); },
- // | forward: function(){ console.debug('forward pressed'); },
- // | changeUrl: true
- // | });
-
- // BROWSER NOTES:
- // Safari 1.2:
- // back button "works" fine, however it's not possible to actually
- // DETECT that you've moved backwards by inspecting window.location.
- // Unless there is some other means of locating.
- // FIXME: perhaps we can poll on history.length?
- // Safari 2.0.3+ (and probably 1.3.2+):
- // works fine, except when changeUrl is used. When changeUrl is used,
- // Safari jumps all the way back to whatever page was shown before
- // the page that uses dojo.undo.browser support.
- // IE 5.5 SP2:
- // back button behavior is macro. It does not move back to the
- // previous hash value, but to the last full page load. This suggests
- // that the iframe is the correct way to capture the back button in
- // these cases.
- // Don't test this page using local disk for MSIE. MSIE will not create
- // a history list for iframe_history.html if served from a file: URL.
- // The XML served back from the XHR tests will also not be properly
- // created if served from local disk. Serve the test pages from a web
- // server to test in that browser.
- // IE 6.0:
- // same behavior as IE 5.5 SP2
- // Firefox 1.0+:
- // the back button will return us to the previous hash on the same
- // page, thereby not requiring an iframe hack, although we do then
- // need to run a timer to detect inter-page movement.
-
- //If addToHistory is called, then that means we prune the
- //forward stack -- the user went back, then wanted to
- //start a new forward path.
- forwardStack = [];
-
- var hash = null;
- var url = null;
- if(!historyIframe){
- if(dojo.config["useXDomain"] && !dojo.config["dojoIframeHistoryUrl"]){
- console.debug("dojo.back: When using cross-domain Dojo builds,"
- + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
- + " to the path on your domain to iframe_history.html");
- }
- historyIframe = window.frames["dj_history"];
- }
- if(!bookmarkAnchor){
- bookmarkAnchor = document.createElement("a");
- dojo.body().appendChild(bookmarkAnchor);
- bookmarkAnchor.style.display = "none";
- }
- if(args["changeUrl"]){
- hash = ""+ ((args["changeUrl"]!==true) ? args["changeUrl"] : (new Date()).getTime());
-
- //If the current hash matches the new one, just replace the history object with
- //this new one. It doesn't make sense to track different state objects for the same
- //logical URL. This matches the browser behavior of only putting in one history
- //item no matter how many times you click on the same #hash link, at least in Firefox
- //and Safari, and there is no reliable way in those browsers to know if a #hash link
- //has been clicked on multiple times. So making this the standard behavior in all browsers
- //so that dojo.back's behavior is the same in all browsers.
- if(historyStack.length == 0 && initialState.urlHash == hash){
- initialState = createState(url, args, hash);
- return;
- }else if(historyStack.length > 0 && historyStack[historyStack.length - 1].urlHash == hash){
- historyStack[historyStack.length - 1] = createState(url, args, hash);
- return;
- }
-
- changingUrl = true;
- setTimeout(function() {
- setHash(hash);
- changingUrl = false;
- }, 1);
- bookmarkAnchor.href = hash;
-
- if(dojo.isIE){
- url = loadIframeHistory();
-
- var oldCB = args["back"]||args["backButton"]||args["handle"];
-
- //The function takes handleName as a parameter, in case the
- //callback we are overriding was "handle". In that case,
- //we will need to pass the handle name to handle.
- var tcb = function(handleName){
- if(getHash() != ""){
- setTimeout(function() { setHash(hash); }, 1);
- }
- //Use apply to set "this" to args, and to try to avoid memory leaks.
- oldCB.apply(this, [handleName]);
- };
-
- //Set interceptor function in the right place.
- if(args["back"]){
- args.back = tcb;
- }else if(args["backButton"]){
- args.backButton = tcb;
- }else if(args["handle"]){
- args.handle = tcb;
- }
-
- var oldFW = args["forward"]||args["forwardButton"]||args["handle"];
-
- //The function takes handleName as a parameter, in case the
- //callback we are overriding was "handle". In that case,
- //we will need to pass the handle name to handle.
- var tfw = function(handleName){
- if(getHash() != ""){
- setHash(hash);
- }
- if(oldFW){ // we might not actually have one
- //Use apply to set "this" to args, and to try to avoid memory leaks.
- oldFW.apply(this, [handleName]);
- }
- };
-
- //Set interceptor function in the right place.
- if(args["forward"]){
- args.forward = tfw;
- }else if(args["forwardButton"]){
- args.forwardButton = tfw;
- }else if(args["handle"]){
- args.handle = tfw;
- }
-
- }else if(!dojo.isIE){
- // start the timer
- if(!locationTimer){
- locationTimer = setInterval(checkLocation, 200);
- }
-
- }
- }else{
- url = loadIframeHistory();
- }
-
- historyStack.push(createState(url, args, hash));
- };
-
- back._iframeLoaded = function(evt, ifrLoc){
- //summary:
- // private method. Do not call this directly.
- var query = getUrlQuery(ifrLoc.href);
- if(query == null){
- // alert("iframeLoaded");
- // we hit the end of the history, so we should go back
- if(historyStack.length == 1){
- handleBackButton();
- }
- return;
- }
- if(moveForward){
- // we were expecting it, so it's not either a forward or backward movement
- moveForward = false;
- return;
- }
-
- //Check the back stack first, since it is more likely.
- //Note that only one step back or forward is supported.
- if(historyStack.length >= 2 && query == getUrlQuery(historyStack[historyStack.length-2].url)){
- handleBackButton();
- }else if(forwardStack.length > 0 && query == getUrlQuery(forwardStack[forwardStack.length-1].url)){
- handleForwardButton();
- }
- };
- })();
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/behavior.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/behavior.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/behavior.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,185 +0,0 @@
-if(!dojo._hasResource["dojo.behavior"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.behavior"] = true;
-dojo.provide("dojo.behavior");
-
-dojo.behavior = new function(){
- function arrIn(obj, name){
- if(!obj[name]){ obj[name] = []; }
- return obj[name];
- }
-
- var _inc = 0;
-
- function forIn(obj, scope, func){
- var tmpObj = {};
- for(var x in obj){
- if(typeof tmpObj[x] == "undefined"){
- if(!func){
- scope(obj[x], x);
- }else{
- func.call(scope, obj[x], x);
- }
- }
- }
- }
-
- // FIXME: need a better test so we don't exclude nightly Safari's!
- this._behaviors = {};
- this.add = function(behaviorObj){
- // summary:
- // add the specified behavior to the list of behaviors which will
- // be applied the next time apply() is called. Calls to add() for
- // an already existing behavior do not replace the previous rules,
- // but are instead additive. New nodes which match the rule will
- // have all add()-ed behaviors applied to them when matched.
- //
- // description:
- // behavior objects are specified in the following format(s):
- //
- // {
- // "#id": {
- // "found": function(element){
- // // ...
- // },
- //
- // "onblah": {targetObj: foo, targetFunc: "bar"},
- //
- // "onblarg": "/foo/bar/baz/blarg",
- //
- // "onevent": function(evt){
- // },
- //
- // "onotherevent: function(evt){
- // // ...
- // }
- // },
- //
- // "#id2": {
- // // ...
- // },
- //
- // "#id3": function(element){
- // // ...
- // },
- //
- // // publish the match on a topic
- // "#id4": "/found/topic/name",
- //
- // // match all direct descendants
- // "#id4 > *": function(element){
- // // ...
- // },
- //
- // // match the first child node that's an element
- // "#id4 > :first-child": { ... },
- //
- // // match the last child node that's an element
- // "#id4 > :last-child": { ... },
- //
- // // all elements of type tagname
- // "tagname": {
- // // ...
- // },
- //
- // "tagname1 tagname2 tagname3": {
- // // ...
- // },
- //
- // ".classname": {
- // // ...
- // },
- //
- // "tagname.classname": {
- // // ...
- // },
- // }
- //
- // The "found" method is a generalized handler that's called as soon
- // as the node matches the selector. Rules for values that follow also
- // apply to the "found" key.
- //
- // The "on*" handlers are attached with dojo.connect().
- //
- // If the value corresponding to the ID key is a function and not a
- // list, it's treated as though it was the value of "found".
-
- var tmpObj = {};
- forIn(behaviorObj, this, function(behavior, name){
- var tBehavior = arrIn(this._behaviors, name);
- if(typeof tBehavior["id"] != "number"){
- tBehavior.id = _inc++;
- }
- var cversion = [];
- tBehavior.push(cversion);
- if((dojo.isString(behavior))||(dojo.isFunction(behavior))){
- behavior = { found: behavior };
- }
- forIn(behavior, function(rule, ruleName){
- arrIn(cversion, ruleName).push(rule);
- });
- });
- }
-
- var _applyToNode = function(node, action, ruleSetName){
- if(dojo.isString(action)){
- if(ruleSetName == "found"){
- dojo.publish(action, [ node ]);
- }else{
- dojo.connect(node, ruleSetName, function(){
- dojo.publish(action, arguments);
- });
- }
- }else if(dojo.isFunction(action)){
- if(ruleSetName == "found"){
- action(node);
- }else{
- dojo.connect(node, ruleSetName, action);
- }
- }
- }
-
- this.apply = function(){
- // summary:
- // applies all currently registered behaviors to the document,
- // taking care to ensure that only incremental updates are made
- // since the last time add() or apply() were called. If new
- // matching nodes have been added, all rules in a behavior will be
- // applied to that node. For previously matched nodes, only
- // behaviors which have been added since the last call to apply()
- // will be added to the nodes.
- forIn(this._behaviors, function(tBehavior, id){
- dojo.query(id).forEach(
- function(elem){
- var runFrom = 0;
- var bid = "_dj_behavior_"+tBehavior.id;
- if(typeof elem[bid] == "number"){
- runFrom = elem[bid];
- // console.debug(bid, runFrom);
- if(runFrom == (tBehavior.length)){
- return;
- }
- }
- // run through the versions, applying newer rules at each step
-
- for(var x=runFrom, tver; tver = tBehavior[x]; x++){
- // console.debug(tver);
- forIn(tver, function(ruleSet, ruleSetName){
- if(dojo.isArray(ruleSet)){
- dojo.forEach(ruleSet, function(action){
- _applyToNode(elem, action, ruleSetName);
- });
- }
- });
- }
-
- // ensure that re-application only adds new rules to the node
- elem[bid] = tBehavior.length;
- }
- );
- });
- }
-}
-
-dojo.addOnLoad(dojo.behavior, "apply");
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/build.txt
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/build.txt 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/build.txt 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,126 +0,0 @@
-Files baked into this build:
-
-dojo.js:
-./jslib/dojoGuardStart.jsfrag
-./../../dojo/_base/_loader/bootstrap.js
-./../../dojo/_base/_loader/loader.js
-./../../dojo/_base/_loader/hostenv_browser.js
-./../../release/dojo-release-1.1.1/dojo/_base/lang.js
-./../../release/dojo-release-1.1.1/dojo/_base/declare.js
-./../../release/dojo-release-1.1.1/dojo/_base/connect.js
-./../../release/dojo-release-1.1.1/dojo/_base/Deferred.js
-./../../release/dojo-release-1.1.1/dojo/_base/json.js
-./../../release/dojo-release-1.1.1/dojo/_base/array.js
-./../../release/dojo-release-1.1.1/dojo/_base/Color.js
-./../../release/dojo-release-1.1.1/dojo/_base.js
-./../../release/dojo-release-1.1.1/dojo/_base/window.js
-./../../release/dojo-release-1.1.1/dojo/_base/event.js
-./../../release/dojo-release-1.1.1/dojo/_base/html.js
-./../../release/dojo-release-1.1.1/dojo/_base/NodeList.js
-./../../release/dojo-release-1.1.1/dojo/_base/query.js
-./../../release/dojo-release-1.1.1/dojo/_base/xhr.js
-./../../release/dojo-release-1.1.1/dojo/_base/fx.js
-./../../release/dojo-release-1.1.1/dojo/_base/browser.js
-./jslib/dojoGuardEnd.jsfrag
-
-../dijit/dijit.js:
-./../../release/dojo-release-1.1.1/dijit/_base/focus.js
-./../../release/dojo-release-1.1.1/dijit/_base/manager.js
-./../../release/dojo-release-1.1.1/dijit/_base/place.js
-./../../release/dojo-release-1.1.1/dijit/_base/window.js
-./../../release/dojo-release-1.1.1/dijit/_base/popup.js
-./../../release/dojo-release-1.1.1/dijit/_base/scroll.js
-./../../release/dojo-release-1.1.1/dijit/_base/sniff.js
-./../../release/dojo-release-1.1.1/dijit/_base/bidi.js
-./../../release/dojo-release-1.1.1/dijit/_base/typematic.js
-./../../release/dojo-release-1.1.1/dijit/_base/wai.js
-./../../release/dojo-release-1.1.1/dijit/_base.js
-./../../release/dojo-release-1.1.1/dojo/date/stamp.js
-./../../release/dojo-release-1.1.1/dojo/parser.js
-./../../release/dojo-release-1.1.1/dijit/_Widget.js
-./../../release/dojo-release-1.1.1/dojo/string.js
-./../../release/dojo-release-1.1.1/dijit/_Templated.js
-./../../release/dojo-release-1.1.1/dijit/_Container.js
-./../../release/dojo-release-1.1.1/dijit/layout/_LayoutWidget.js
-./../../release/dojo-release-1.1.1/dijit/form/_FormWidget.js
-./../../release/dojo-release-1.1.1/dijit/dijit.js
-
-../dijit/dijit-all.js:
-./../../release/dojo-release-1.1.1/dojo/colors.js
-./../../release/dojo-release-1.1.1/dojo/i18n.js
-./../../release/dojo-release-1.1.1/dijit/ColorPalette.js
-./../../release/dojo-release-1.1.1/dijit/Declaration.js
-./../../release/dojo-release-1.1.1/dojo/dnd/common.js
-./../../release/dojo-release-1.1.1/dojo/dnd/autoscroll.js
-./../../release/dojo-release-1.1.1/dojo/dnd/Mover.js
-./../../release/dojo-release-1.1.1/dojo/dnd/Moveable.js
-./../../release/dojo-release-1.1.1/dojo/dnd/TimedMoveable.js
-./../../release/dojo-release-1.1.1/dojo/fx.js
-./../../release/dojo-release-1.1.1/dijit/layout/ContentPane.js
-./../../release/dojo-release-1.1.1/dijit/form/Form.js
-./../../release/dojo-release-1.1.1/dijit/Dialog.js
-./../../release/dojo-release-1.1.1/dijit/_editor/selection.js
-./../../release/dojo-release-1.1.1/dijit/_editor/html.js
-./../../release/dojo-release-1.1.1/dijit/_editor/RichText.js
-./../../release/dojo-release-1.1.1/dijit/Toolbar.js
-./../../release/dojo-release-1.1.1/dijit/form/Button.js
-./../../release/dojo-release-1.1.1/dijit/_editor/_Plugin.js
-./../../release/dojo-release-1.1.1/dijit/Editor.js
-./../../release/dojo-release-1.1.1/dijit/Menu.js
-./../../release/dojo-release-1.1.1/dojo/regexp.js
-./../../release/dojo-release-1.1.1/dojo/number.js
-./../../release/dojo-release-1.1.1/dijit/ProgressBar.js
-./../../release/dojo-release-1.1.1/dijit/TitlePane.js
-./../../release/dojo-release-1.1.1/dijit/Tooltip.js
-./../../release/dojo-release-1.1.1/dojo/cookie.js
-./../../release/dojo-release-1.1.1/dijit/Tree.js
-./../../release/dojo-release-1.1.1/dijit/form/TextBox.js
-./../../release/dojo-release-1.1.1/dijit/InlineEditBox.js
-./../../release/dojo-release-1.1.1/dijit/form/CheckBox.js
-./../../release/dojo-release-1.1.1/dijit/form/ValidationTextBox.js
-./../../release/dojo-release-1.1.1/dijit/form/ComboBox.js
-./../../release/dojo-release-1.1.1/dojo/cldr/monetary.js
-./../../release/dojo-release-1.1.1/dojo/currency.js
-./../../release/dojo-release-1.1.1/dijit/form/NumberTextBox.js
-./../../release/dojo-release-1.1.1/dijit/form/CurrencyTextBox.js
-./../../release/dojo-release-1.1.1/dojo/cldr/supplemental.js
-./../../release/dojo-release-1.1.1/dojo/date.js
-./../../release/dojo-release-1.1.1/dojo/date/locale.js
-./../../release/dojo-release-1.1.1/dijit/_Calendar.js
-./../../release/dojo-release-1.1.1/dijit/form/_DateTimeTextBox.js
-./../../release/dojo-release-1.1.1/dijit/form/DateTextBox.js
-./../../release/dojo-release-1.1.1/dijit/form/FilteringSelect.js
-./../../release/dojo-release-1.1.1/dijit/form/_Spinner.js
-./../../release/dojo-release-1.1.1/dijit/form/NumberSpinner.js
-./../../release/dojo-release-1.1.1/dojo/dnd/move.js
-./../../release/dojo-release-1.1.1/dijit/form/Slider.js
-./../../release/dojo-release-1.1.1/dijit/form/Textarea.js
-./../../release/dojo-release-1.1.1/dijit/layout/StackContainer.js
-./../../release/dojo-release-1.1.1/dijit/layout/AccordionContainer.js
-./../../release/dojo-release-1.1.1/dijit/layout/BorderContainer.js
-./../../release/dojo-release-1.1.1/dijit/layout/LayoutContainer.js
-./../../release/dojo-release-1.1.1/dijit/layout/LinkPane.js
-./../../release/dojo-release-1.1.1/dijit/layout/SplitContainer.js
-./../../release/dojo-release-1.1.1/dijit/layout/TabContainer.js
-./../../release/dojo-release-1.1.1/dijit/dijit-all.js
-
-../dojox/off/offline.js:
-./../../release/dojo-release-1.1.1/dojox/storage/Provider.js
-./../../release/dojo-release-1.1.1/dojox/storage/manager.js
-./../../release/dojo-release-1.1.1/dojox/_sql/_crypto.js
-./../../release/dojo-release-1.1.1/dojox/_sql/common.js
-./../../release/dojo-release-1.1.1/dojox/sql.js
-./../../release/dojo-release-1.1.1/dojox/storage/GearsStorageProvider.js
-./../../release/dojo-release-1.1.1/dojox/storage/WhatWGStorageProvider.js
-./../../release/dojo-release-1.1.1/dijit/_base/place.js
-./../../release/dojo-release-1.1.1/dojox/flash/_base.js
-./../../release/dojo-release-1.1.1/dojox/flash.js
-./../../release/dojo-release-1.1.1/dojox/storage/FlashStorageProvider.js
-./../../release/dojo-release-1.1.1/dojox/storage/_common.js
-./../../release/dojo-release-1.1.1/dojox/storage.js
-./../../release/dojo-release-1.1.1/dojox/off/files.js
-./../../release/dojo-release-1.1.1/dojox/off/sync.js
-./../../release/dojo-release-1.1.1/dojox/off/_common.js
-./../../release/dojo-release-1.1.1/dojox/off.js
-./../../release/dojo-release-1.1.1/dojox/off/ui.js
-./../../release/dojo-release-1.1.1/dojox/off/offline.js
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/colors.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/colors.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/colors.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,225 +0,0 @@
-if(!dojo._hasResource["dojo.colors"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.colors"] = true;
-dojo.provide("dojo.colors");
-
-//TODO: this module appears to break naming conventions
-
-/*=====
-dojo.colors = {
- // summary: Color utilities
-}
-=====*/
-
-(function(){
- // this is a standard conversion prescribed by the CSS3 Color Module
- var hue2rgb = function(m1, m2, h){
- if(h < 0){ ++h; }
- if(h > 1){ --h; }
- var h6 = 6 * h;
- if(h6 < 1){ return m1 + (m2 - m1) * h6; }
- if(2 * h < 1){ return m2; }
- if(3 * h < 2){ return m1 + (m2 - m1) * (2 / 3 - h) * 6; }
- return m1;
- };
-
- dojo.colorFromRgb = function(/*String*/ color, /*dojo.Color?*/ obj){
- // summary:
- // get rgb(a) array from css-style color declarations
- // description:
- // this function can handle all 4 CSS3 Color Module formats: rgb,
- // rgba, hsl, hsla, including rgb(a) with percentage values.
- var m = color.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);
- if(m){
- var c = m[2].split(/\s*,\s*/), l = c.length, t = m[1];
- if((t == "rgb" && l == 3) || (t == "rgba" && l == 4)){
- var r = c[0];
- if(r.charAt(r.length - 1) == "%"){
- // 3 rgb percentage values
- var a = dojo.map(c, function(x){
- return parseFloat(x) * 2.56;
- });
- if(l == 4){ a[3] = c[3]; }
- return dojo.colorFromArray(a, obj); // dojo.Color
- }
- return dojo.colorFromArray(c, obj); // dojo.Color
- }
- if((t == "hsl" && l == 3) || (t == "hsla" && l == 4)){
- // normalize hsl values
- var H = ((parseFloat(c[0]) % 360) + 360) % 360 / 360,
- S = parseFloat(c[1]) / 100,
- L = parseFloat(c[2]) / 100,
- // calculate rgb according to the algorithm
- // recommended by the CSS3 Color Module
- m2 = L <= 0.5 ? L * (S + 1) : L + S - L * S,
- m1 = 2 * L - m2,
- a = [hue2rgb(m1, m2, H + 1 / 3) * 256,
- hue2rgb(m1, m2, H) * 256, hue2rgb(m1, m2, H - 1 / 3) * 256, 1];
- if(l == 4){ a[3] = c[3]; }
- return dojo.colorFromArray(a, obj); // dojo.Color
- }
- }
- return null; // dojo.Color
- };
-
- var confine = function(c, low, high){
- // summary:
- // sanitize a color component by making sure it is a number,
- // and clamping it to valid values
- c = Number(c);
- return isNaN(c) ? high : c < low ? low : c > high ? high : c; // Number
- };
-
- dojo.Color.prototype.sanitize = function(){
- // summary: makes sure that the object has correct attributes
- var t = this;
- t.r = Math.round(confine(t.r, 0, 255));
- t.g = Math.round(confine(t.g, 0, 255));
- t.b = Math.round(confine(t.b, 0, 255));
- t.a = confine(t.a, 0, 1);
- return this; // dojo.Color
- };
-})();
-
-
-dojo.colors.makeGrey = function(/*Number*/ g, /*Number?*/ a){
- // summary: creates a greyscale color with an optional alpha
- return dojo.colorFromArray([g, g, g, a]);
-};
-
-// mixin all CSS3 named colors not already in _base, along with SVG 1.0 variant spellings
-dojo.Color.named = dojo.mixin({
- aliceblue: [240,248,255],
- antiquewhite: [250,235,215],
- aquamarine: [127,255,212],
- azure: [240,255,255],
- beige: [245,245,220],
- bisque: [255,228,196],
- blanchedalmond: [255,235,205],
- blueviolet: [138,43,226],
- brown: [165,42,42],
- burlywood: [222,184,135],
- cadetblue: [95,158,160],
- chartreuse: [127,255,0],
- chocolate: [210,105,30],
- coral: [255,127,80],
- cornflowerblue: [100,149,237],
- cornsilk: [255,248,220],
- crimson: [220,20,60],
- cyan: [0,255,255],
- darkblue: [0,0,139],
- darkcyan: [0,139,139],
- darkgoldenrod: [184,134,11],
- darkgray: [169,169,169],
- darkgreen: [0,100,0],
- darkgrey: [169,169,169],
- darkkhaki: [189,183,107],
- darkmagenta: [139,0,139],
- darkolivegreen: [85,107,47],
- darkorange: [255,140,0],
- darkorchid: [153,50,204],
- darkred: [139,0,0],
- darksalmon: [233,150,122],
- darkseagreen: [143,188,143],
- darkslateblue: [72,61,139],
- darkslategray: [47,79,79],
- darkslategrey: [47,79,79],
- darkturquoise: [0,206,209],
- darkviolet: [148,0,211],
- deeppink: [255,20,147],
- deepskyblue: [0,191,255],
- dimgray: [105,105,105],
- dimgrey: [105,105,105],
- dodgerblue: [30,144,255],
- firebrick: [178,34,34],
- floralwhite: [255,250,240],
- forestgreen: [34,139,34],
- gainsboro: [220,220,220],
- ghostwhite: [248,248,255],
- gold: [255,215,0],
- goldenrod: [218,165,32],
- greenyellow: [173,255,47],
- grey: [128,128,128],
- honeydew: [240,255,240],
- hotpink: [255,105,180],
- indianred: [205,92,92],
- indigo: [75,0,130],
- ivory: [255,255,240],
- khaki: [240,230,140],
- lavender: [230,230,250],
- lavenderblush: [255,240,245],
- lawngreen: [124,252,0],
- lemonchiffon: [255,250,205],
- lightblue: [173,216,230],
- lightcoral: [240,128,128],
- lightcyan: [224,255,255],
- lightgoldenrodyellow: [250,250,210],
- lightgray: [211,211,211],
- lightgreen: [144,238,144],
- lightgrey: [211,211,211],
- lightpink: [255,182,193],
- lightsalmon: [255,160,122],
- lightseagreen: [32,178,170],
- lightskyblue: [135,206,250],
- lightslategray: [119,136,153],
- lightslategrey: [119,136,153],
- lightsteelblue: [176,196,222],
- lightyellow: [255,255,224],
- limegreen: [50,205,50],
- linen: [250,240,230],
- magenta: [255,0,255],
- mediumaquamarine: [102,205,170],
- mediumblue: [0,0,205],
- mediumorchid: [186,85,211],
- mediumpurple: [147,112,219],
- mediumseagreen: [60,179,113],
- mediumslateblue: [123,104,238],
- mediumspringgreen: [0,250,154],
- mediumturquoise: [72,209,204],
- mediumvioletred: [199,21,133],
- midnightblue: [25,25,112],
- mintcream: [245,255,250],
- mistyrose: [255,228,225],
- moccasin: [255,228,181],
- navajowhite: [255,222,173],
- oldlace: [253,245,230],
- olivedrab: [107,142,35],
- orange: [255,165,0],
- orangered: [255,69,0],
- orchid: [218,112,214],
- palegoldenrod: [238,232,170],
- palegreen: [152,251,152],
- paleturquoise: [175,238,238],
- palevioletred: [219,112,147],
- papayawhip: [255,239,213],
- peachpuff: [255,218,185],
- peru: [205,133,63],
- pink: [255,192,203],
- plum: [221,160,221],
- powderblue: [176,224,230],
- rosybrown: [188,143,143],
- royalblue: [65,105,225],
- saddlebrown: [139,69,19],
- salmon: [250,128,114],
- sandybrown: [244,164,96],
- seagreen: [46,139,87],
- seashell: [255,245,238],
- sienna: [160,82,45],
- skyblue: [135,206,235],
- slateblue: [106,90,205],
- slategray: [112,128,144],
- slategrey: [112,128,144],
- snow: [255,250,250],
- springgreen: [0,255,127],
- steelblue: [70,130,180],
- tan: [210,180,140],
- thistle: [216,191,216],
- tomato: [255,99,71],
- transparent: [0, 0, 0, 0],
- turquoise: [64,224,208],
- violet: [238,130,238],
- wheat: [245,222,179],
- whitesmoke: [245,245,245],
- yellowgreen: [154,205,50]
-}, dojo.Color.named);
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/cookie.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/cookie.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/cookie.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,95 +0,0 @@
-if(!dojo._hasResource["dojo.cookie"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.cookie"] = true;
-dojo.provide("dojo.cookie");
-
-dojo.require("dojo.regexp");
-
-/*=====
-dojo.__cookieProps = function(){
- // expires: Date|String|Number?
- // If a number, the number of days from today at which the cookie
- // will expire. If a date, the date past which the cookie will expire.
- // If expires is in the past, the cookie will be deleted.
- // If expires is omitted or is 0, the cookie will expire when the browser closes. << FIXME: 0 seems to disappear right away? FF3.
- // path: String?
- // The path to use for the cookie.
- // domain: String?
- // The domain to use for the cookie.
- // secure: Boolean?
- // Whether to only send the cookie on secure connections
- this.expires = expires;
- this.path = path;
- this.domain = domain;
- this.secure = secure;
-}
-=====*/
-
-
-dojo.cookie = function(/*String*/name, /*String?*/value, /*dojo.__cookieProps?*/props){
- // summary:
- // Get or set a cookie.
- // description:
- // If one argument is passed, returns the value of the cookie
- // For two or more arguments, acts as a setter.
- // name:
- // Name of the cookie
- // value:
- // Value for the cookie
- // props:
- // Properties for the cookie
- // example:
- // set a cookie with the JSON-serialized contents of an object which
- // will expire 5 days from now:
- // | dojo.cookie("configObj", dojo.toJson(config), { expires: 5 });
- //
- // example:
- // de-serialize a cookie back into a JavaScript object:
- // | var config = dojo.fromJson(dojo.cookie("configObj"));
- //
- // example:
- // delete a cookie:
- // | dojo.cookie("configObj", null, {expires: -1});
- var c = document.cookie;
- if(arguments.length == 1){
- var matches = c.match(new RegExp("(?:^|; )" + dojo.regexp.escapeString(name) + "=([^;]*)"));
- return matches ? decodeURIComponent(matches[1]) : undefined; // String or undefined
- }else{
- props = props || {};
-// FIXME: expires=0 seems to disappear right away, not on close? (FF3) Change docs?
- var exp = props.expires;
- if(typeof exp == "number"){
- var d = new Date();
- d.setTime(d.getTime() + exp*24*60*60*1000);
- exp = props.expires = d;
- }
- if(exp && exp.toUTCString){ props.expires = exp.toUTCString(); }
-
- value = encodeURIComponent(value);
- var updatedCookie = name + "=" + value;
- for(propName in props){
- updatedCookie += "; " + propName;
- var propValue = props[propName];
- if(propValue !== true){ updatedCookie += "=" + propValue; }
- }
- document.cookie = updatedCookie;
- }
-};
-
-dojo.cookie.isSupported = function(){
- // summary:
- // Use to determine if the current browser supports cookies or not.
- //
- // Returns true if user allows cookies.
- // Returns false if user doesn't allow cookies.
-
- if(!("cookieEnabled" in navigator)){
- this("__djCookieTest__", "CookiesAllowed");
- navigator.cookieEnabled = this("__djCookieTest__") == "CookiesAllowed";
- if(navigator.cookieEnabled){
- this("__djCookieTest__", "", {expires: -1});
- }
- }
- return navigator.cookieEnabled;
-};
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/currency.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/currency.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/currency.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,97 +0,0 @@
-if(!dojo._hasResource["dojo.currency"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.currency"] = true;
-dojo.provide("dojo.currency");
-
-dojo.require("dojo.number");
-dojo.require("dojo.i18n");
-dojo.requireLocalization("dojo.cldr", "currency", null, "zh,en-ca,pt,en-us,de,ja,en,en-au,ROOT,fr,es,ko,zh-tw,it");
-dojo.require("dojo.cldr.monetary");
-
-/*=====
-dojo.currency = {
- // summary: localized formatting and parsing routines for currencies
-}
-=====*/
-
-dojo.currency._mixInDefaults = function(options){
- options = options || {};
- options.type = "currency";
-
- // Get locale-depenent currency data, like the symbol
- var bundle = dojo.i18n.getLocalization("dojo.cldr", "currency", options.locale) || {};
-
- // Mixin locale-independent currency data, like # of places
- var iso = options.currency;
- var data = dojo.cldr.monetary.getData(iso);
-
- dojo.forEach(["displayName","symbol","group","decimal"], function(prop){
- data[prop] = bundle[iso+"_"+prop];
- });
-
- data.fractional = [true, false];
-
- // Mixin with provided options
- return dojo.mixin(data, options);
-}
-
-dojo.currency.format = function(/*Number*/value, /*dojo.number.__FormatOptions?*/options){
-// summary:
-// Format a Number as a currency, using locale-specific settings
-//
-// description:
-// Create a string from a Number using a known, localized pattern.
-// [Formatting patterns](http://www.unicode.org/reports/tr35/#Number_Elements) appropriate to the locale are chosen from the [CLDR](http://unicode.org/cldr)
-// as well as the appropriate symbols and delimiters.
-//
-// value:
-// the number to be formatted.
-
- return dojo.number.format(value, dojo.currency._mixInDefaults(options));
-}
-
-dojo.currency.regexp = function(/*dojo.number.__RegexpOptions?*/options){
-//
-// summary:
-// Builds the regular needed to parse a currency value
-//
-// description:
-// Returns regular expression with positive and negative match, group and decimal separators
-// Note: the options.places default, the number of decimal places to accept, is defined by the currency type.
- return dojo.number.regexp(dojo.currency._mixInDefaults(options)); // String
-}
-
-/*=====
-dojo.declare("dojo.currency.__ParseOptions", [dojo.number.__ParseOptions], {
- // type: String?
- // currency, set by default.
- // symbol: String?
- // override currency symbol. Normally, will be looked up in table of supported currencies,
- // and ISO currency code will be used if not found. See dojo.i18n.cldr.nls->currency.js
- // places: Number?
- // number of decimal places to accept. Default is defined by currency.
- // fractional: Boolean?|Array?
- // where places are implied by pattern or explicit 'places' parameter, whether to include the fractional portion.
- // By default for currencies, it the fractional portion is optional.
- type: "",
- symbol: "",
- places: "",
- fractional: ""
-});
-=====*/
-
-dojo.currency.parse = function(/*String*/expression, /*dojo.currency.__ParseOptions?*/options){
- //
- // summary:
- // Convert a properly formatted currency string to a primitive Number,
- // using locale-specific settings.
- //
- // description:
- // Create a Number from a string using a known, localized pattern.
- // [Formatting patterns](http://www.unicode.org/reports/tr35/#Number_Format_Patterns) are chosen appropriate to the locale.
- //
- // expression: A string representation of a Number
-
- return dojo.number.parse(expression, dojo.currency._mixInDefaults(options));
-}
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/date.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/date.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/date.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,343 +0,0 @@
-if(!dojo._hasResource["dojo.date"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.date"] = true;
-dojo.provide("dojo.date");
-
-/*=====
-dojo.date = {
- // summary: Date manipulation utilities
-}
-=====*/
-
-dojo.date.getDaysInMonth = function(/*Date*/dateObject){
- // summary:
- // Returns the number of days in the month used by dateObject
- var month = dateObject.getMonth();
- var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- if(month == 1 && dojo.date.isLeapYear(dateObject)){ return 29; } // Number
- return days[month]; // Number
-}
-
-dojo.date.isLeapYear = function(/*Date*/dateObject){
- // summary:
- // Determines if the year of the dateObject is a leap year
- // description:
- // Leap years are years with an additional day YYYY-02-29, where the
- // year number is a multiple of four with the following exception: If
- // a year is a multiple of 100, then it is only a leap year if it is
- // also a multiple of 400. For example, 1900 was not a leap year, but
- // 2000 is one.
-
- var year = dateObject.getFullYear();
- return !(year%400) || (!(year%4) && !!(year%100)); // Boolean
-}
-
-// FIXME: This is not localized
-dojo.date.getTimezoneName = function(/*Date*/dateObject){
- // summary:
- // Get the user's time zone as provided by the browser
- // dateObject:
- // Needed because the timezone may vary with time (daylight savings)
- // description:
- // Try to get time zone info from toString or toLocaleString method of
- // the Date object -- UTC offset is not a time zone. See
- // http://www.twinsun.com/tz/tz-link.htm Note: results may be
- // inconsistent across browsers.
-
- var str = dateObject.toString(); // Start looking in toString
- var tz = ''; // The result -- return empty string if nothing found
- var match;
-
- // First look for something in parentheses -- fast lookup, no regex
- var pos = str.indexOf('(');
- if(pos > -1){
- tz = str.substring(++pos, str.indexOf(')'));
- }else{
- // If at first you don't succeed ...
- // If IE knows about the TZ, it appears before the year
- // Capital letters or slash before a 4-digit year
- // at the end of string
- var pat = /([A-Z\/]+) \d{4}$/;
- if((match = str.match(pat))){
- tz = match[1];
- }else{
- // Some browsers (e.g. Safari) glue the TZ on the end
- // of toLocaleString instead of putting it in toString
- str = dateObject.toLocaleString();
- // Capital letters or slash -- end of string,
- // after space
- pat = / ([A-Z\/]+)$/;
- if((match = str.match(pat))){
- tz = match[1];
- }
- }
- }
-
- // Make sure it doesn't somehow end up return AM or PM
- return (tz == 'AM' || tz == 'PM') ? '' : tz; // String
-}
-
-// Utility methods to do arithmetic calculations with Dates
-
-dojo.date.compare = function(/*Date*/date1, /*Date?*/date2, /*String?*/portion){
- // summary:
- // Compare two date objects by date, time, or both.
- // description:
- // Returns 0 if equal, positive if a > b, else negative.
- // date1:
- // Date object
- // date2:
- // Date object. If not specified, the current Date is used.
- // portion:
- // A string indicating the "date" or "time" portion of a Date object.
- // Compares both "date" and "time" by default. One of the following:
- // "date", "time", "datetime"
-
- // Extra step required in copy for IE - see #3112
- date1 = new Date(Number(date1));
- date2 = new Date(Number(date2 || new Date()));
-
- if(portion !== "undefined"){
- if(portion == "date"){
- // Ignore times and compare dates.
- date1.setHours(0, 0, 0, 0);
- date2.setHours(0, 0, 0, 0);
- }else if(portion == "time"){
- // Ignore dates and compare times.
- date1.setFullYear(0, 0, 0);
- date2.setFullYear(0, 0, 0);
- }
- }
-
- if(date1 > date2){ return 1; } // int
- if(date1 < date2){ return -1; } // int
- return 0; // int
-};
-
-dojo.date.add = function(/*Date*/date, /*String*/interval, /*int*/amount){
- // summary:
- // Add to a Date in intervals of different size, from milliseconds to years
- // date: Date
- // Date object to start with
- // interval:
- // A string representing the interval. One of the following:
- // "year", "month", "day", "hour", "minute", "second",
- // "millisecond", "quarter", "week", "weekday"
- // amount:
- // How much to add to the date.
-
- var sum = new Date(Number(date)); // convert to Number before copying to accomodate IE (#3112)
- var fixOvershoot = false;
- var property = "Date";
-
- switch(interval){
- case "day":
- break;
- case "weekday":
- //i18n FIXME: assumes Saturday/Sunday weekend, but this is not always true. see dojo.cldr.supplemental
-
- // Divide the increment time span into weekspans plus leftover days
- // e.g., 8 days is one 5-day weekspan / and two leftover days
- // Can't have zero leftover days, so numbers divisible by 5 get
- // a days value of 5, and the remaining days make up the number of weeks
- var days, weeks;
- var mod = amount % 5;
- if(!mod){
- days = (amount > 0) ? 5 : -5;
- weeks = (amount > 0) ? ((amount-5)/5) : ((amount+5)/5);
- }else{
- days = mod;
- weeks = parseInt(amount/5);
- }
- // Get weekday value for orig date param
- var strt = date.getDay();
- // Orig date is Sat / positive incrementer
- // Jump over Sun
- var adj = 0;
- if(strt == 6 && amount > 0){
- adj = 1;
- }else if(strt == 0 && amount < 0){
- // Orig date is Sun / negative incrementer
- // Jump back over Sat
- adj = -1;
- }
- // Get weekday val for the new date
- var trgt = strt + days;
- // New date is on Sat or Sun
- if(trgt == 0 || trgt == 6){
- adj = (amount > 0) ? 2 : -2;
- }
- // Increment by number of weeks plus leftover days plus
- // weekend adjustments
- amount = (7 * weeks) + days + adj;
- break;
- case "year":
- property = "FullYear";
- // Keep increment/decrement from 2/29 out of March
- fixOvershoot = true;
- break;
- case "week":
- amount *= 7;
- break;
- case "quarter":
- // Naive quarter is just three months
- amount *= 3;
- // fallthrough...
- case "month":
- // Reset to last day of month if you overshoot
- fixOvershoot = true;
- property = "Month";
- break;
- case "hour":
- case "minute":
- case "second":
- case "millisecond":
- property = "UTC"+interval.charAt(0).toUpperCase() + interval.substring(1) + "s";
- }
-
- if(property){
- sum["set"+property](sum["get"+property]()+amount);
- }
-
- if(fixOvershoot && (sum.getDate() < date.getDate())){
- sum.setDate(0);
- }
-
- return sum; // Date
-};
-
-dojo.date.difference = function(/*Date*/date1, /*Date?*/date2, /*String?*/interval){
- // summary:
- // Get the difference in a specific unit of time (e.g., number of
- // months, weeks, days, etc.) between two dates, rounded to the
- // nearest integer.
- // date1:
- // Date object
- // date2:
- // Date object. If not specified, the current Date is used.
- // interval:
- // A string representing the interval. One of the following:
- // "year", "month", "day", "hour", "minute", "second",
- // "millisecond", "quarter", "week", "weekday"
- // Defaults to "day".
-
- date2 = date2 || new Date();
- interval = interval || "day";
- var yearDiff = date2.getFullYear() - date1.getFullYear();
- var delta = 1; // Integer return value
-
- switch(interval){
- case "quarter":
- var m1 = date1.getMonth();
- var m2 = date2.getMonth();
- // Figure out which quarter the months are in
- var q1 = Math.floor(m1/3) + 1;
- var q2 = Math.floor(m2/3) + 1;
- // Add quarters for any year difference between the dates
- q2 += (yearDiff * 4);
- delta = q2 - q1;
- break;
- case "weekday":
- var days = Math.round(dojo.date.difference(date1, date2, "day"));
- var weeks = parseInt(dojo.date.difference(date1, date2, "week"));
- var mod = days % 7;
-
- // Even number of weeks
- if(mod == 0){
- days = weeks*5;
- }else{
- // Weeks plus spare change (< 7 days)
- var adj = 0;
- var aDay = date1.getDay();
- var bDay = date2.getDay();
-
- weeks = parseInt(days/7);
- mod = days % 7;
- // Mark the date advanced by the number of
- // round weeks (may be zero)
- var dtMark = new Date(date1);
- dtMark.setDate(dtMark.getDate()+(weeks*7));
- var dayMark = dtMark.getDay();
-
- // Spare change days -- 6 or less
- if(days > 0){
- switch(true){
- // Range starts on Sat
- case aDay == 6:
- adj = -1;
- break;
- // Range starts on Sun
- case aDay == 0:
- adj = 0;
- break;
- // Range ends on Sat
- case bDay == 6:
- adj = -1;
- break;
- // Range ends on Sun
- case bDay == 0:
- adj = -2;
- break;
- // Range contains weekend
- case (dayMark + mod) > 5:
- adj = -2;
- }
- }else if(days < 0){
- switch(true){
- // Range starts on Sat
- case aDay == 6:
- adj = 0;
- break;
- // Range starts on Sun
- case aDay == 0:
- adj = 1;
- break;
- // Range ends on Sat
- case bDay == 6:
- adj = 2;
- break;
- // Range ends on Sun
- case bDay == 0:
- adj = 1;
- break;
- // Range contains weekend
- case (dayMark + mod) < 0:
- adj = 2;
- }
- }
- days += adj;
- days -= (weeks*2);
- }
- delta = days;
- break;
- case "year":
- delta = yearDiff;
- break;
- case "month":
- delta = (date2.getMonth() - date1.getMonth()) + (yearDiff * 12);
- break;
- case "week":
- // Truncate instead of rounding
- // Don't use Math.floor -- value may be negative
- delta = parseInt(dojo.date.difference(date1, date2, "day")/7);
- break;
- case "day":
- delta /= 24;
- // fallthrough
- case "hour":
- delta /= 60;
- // fallthrough
- case "minute":
- delta /= 60;
- // fallthrough
- case "second":
- delta /= 1000;
- // fallthrough
- case "millisecond":
- delta *= date2.getTime() - date1.getTime();
- }
-
- // Round for fractional values and DST leaps
- return Math.round(delta); // Number (integer)
-};
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/fx.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/fx.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/fx.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,415 +0,0 @@
-if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.fx"] = true;
-dojo.provide("dojo.fx");
-dojo.provide("dojo.fx.Toggler");
-
-/*=====
-dojo.fx = {
- // summary: Effects library on top of Base animations
-};
-=====*/
-
-(function(){
- var _baseObj = {
- _fire: function(evt, args){
- if(this[evt]){
- this[evt].apply(this, args||[]);
- }
- return this;
- }
- };
-
- var _chain = function(animations){
- this._index = -1;
- this._animations = animations||[];
- this._current = this._onAnimateCtx = this._onEndCtx = null;
-
- this.duration = 0;
- dojo.forEach(this._animations, function(a){
- this.duration += a.duration;
- if(a.delay){ this.duration += a.delay; }
- }, this);
- };
- dojo.extend(_chain, {
- _onAnimate: function(){
- this._fire("onAnimate", arguments);
- },
- _onEnd: function(){
- dojo.disconnect(this._onAnimateCtx);
- dojo.disconnect(this._onEndCtx);
- this._onAnimateCtx = this._onEndCtx = null;
- if(this._index + 1 == this._animations.length){
- this._fire("onEnd");
- }else{
- // switch animations
- this._current = this._animations[++this._index];
- this._onAnimateCtx = dojo.connect(this._current, "onAnimate", this, "_onAnimate");
- this._onEndCtx = dojo.connect(this._current, "onEnd", this, "_onEnd");
- this._current.play(0, true);
- }
- },
- play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
- if(!this._current){ this._current = this._animations[this._index = 0]; }
- if(!gotoStart && this._current.status() == "playing"){ return this; }
- var beforeBegin = dojo.connect(this._current, "beforeBegin", this, function(){
- this._fire("beforeBegin");
- }),
- onBegin = dojo.connect(this._current, "onBegin", this, function(arg){
- this._fire("onBegin", arguments);
- }),
- onPlay = dojo.connect(this._current, "onPlay", this, function(arg){
- this._fire("onPlay", arguments);
- dojo.disconnect(beforeBegin);
- dojo.disconnect(onBegin);
- dojo.disconnect(onPlay);
- });
- if(this._onAnimateCtx){
- dojo.disconnect(this._onAnimateCtx);
- }
- this._onAnimateCtx = dojo.connect(this._current, "onAnimate", this, "_onAnimate");
- if(this._onEndCtx){
- dojo.disconnect(this._onEndCtx);
- }
- this._onEndCtx = dojo.connect(this._current, "onEnd", this, "_onEnd");
- this._current.play.apply(this._current, arguments);
- return this;
- },
- pause: function(){
- if(this._current){
- var e = dojo.connect(this._current, "onPause", this, function(arg){
- this._fire("onPause", arguments);
- dojo.disconnect(e);
- });
- this._current.pause();
- }
- return this;
- },
- gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
- this.pause();
- var offset = this.duration * percent;
- this._current = null;
- dojo.some(this._animations, function(a){
- if(a.duration <= offset){
- this._current = a;
- return true;
- }
- offset -= a.duration;
- return false;
- });
- if(this._current){
- this._current.gotoPercent(offset / _current.duration, andPlay);
- }
- return this;
- },
- stop: function(/*boolean?*/ gotoEnd){
- if(this._current){
- if(gotoEnd){
- for(; this._index + 1 < this._animations.length; ++this._index){
- this._animations[this._index].stop(true);
- }
- this._current = this._animations[this._index];
- }
- var e = dojo.connect(this._current, "onStop", this, function(arg){
- this._fire("onStop", arguments);
- dojo.disconnect(e);
- });
- this._current.stop();
- }
- return this;
- },
- status: function(){
- return this._current ? this._current.status() : "stopped";
- },
- destroy: function(){
- if(this._onAnimateCtx){ dojo.disconnect(this._onAnimateCtx); }
- if(this._onEndCtx){ dojo.disconnect(this._onEndCtx); }
- }
- });
- dojo.extend(_chain, _baseObj);
-
- dojo.fx.chain = function(/*dojo._Animation[]*/ animations){
- // summary: Chain a list of dojo._Animation s to run in sequence
- // example:
- // | dojo.fx.chain([
- // | dojo.fadeIn({ node:node }),
- // | dojo.fadeOut({ node:otherNode })
- // | ]).play();
- //
- return new _chain(animations) // dojo._Animation
- };
-
- var _combine = function(animations){
- this._animations = animations||[];
- this._connects = [];
- this._finished = 0;
-
- this.duration = 0;
- dojo.forEach(animations, function(a){
- var duration = a.duration;
- if(a.delay){ duration += a.delay; }
- if(this.duration < duration){ this.duration = duration; }
- this._connects.push(dojo.connect(a, "onEnd", this, "_onEnd"));
- }, this);
-
- this._pseudoAnimation = new dojo._Animation({curve: [0, 1], duration: this.duration});
- dojo.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop"],
- function(evt){
- this._connects.push(dojo.connect(this._pseudoAnimation, evt, dojo.hitch(this, "_fire", evt)));
- },
- this
- );
- };
- dojo.extend(_combine, {
- _doAction: function(action, args){
- dojo.forEach(this._animations, function(a){
- a[action].apply(a, args);
- });
- return this;
- },
- _onEnd: function(){
- if(++this._finished == this._animations.length){
- this._fire("onEnd");
- }
- },
- _call: function(action, args){
- var t = this._pseudoAnimation;
- t[action].apply(t, args);
- },
- play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
- this._finished = 0;
- this._doAction("play", arguments);
- this._call("play", arguments);
- return this;
- },
- pause: function(){
- this._doAction("pause", arguments);
- this._call("pause", arguments);
- return this;
- },
- gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
- var ms = this.duration * percent;
- dojo.forEach(this._animations, function(a){
- a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
- });
- this._call("gotoProcent", arguments);
- return this;
- },
- stop: function(/*boolean?*/ gotoEnd){
- this._doAction("stop", arguments);
- this._call("stop", arguments);
- return this;
- },
- status: function(){
- return this._pseudoAnimation.status();
- },
- destroy: function(){
- dojo.forEach(this._connects, dojo.disconnect);
- }
- });
- dojo.extend(_combine, _baseObj);
-
- dojo.fx.combine = function(/*dojo._Animation[]*/ animations){
- // summary: Combine a list of dojo._Animation s to run in parallel
- // example:
- // | dojo.fx.combine([
- // | dojo.fadeIn({ node:node }),
- // | dojo.fadeOut({ node:otherNode })
- // | ]).play();
- return new _combine(animations); // dojo._Animation
- };
-})();
-
-dojo.declare("dojo.fx.Toggler", null, {
- // summary:
- // class constructor for an animation toggler. It accepts a packed
- // set of arguments about what type of animation to use in each
- // direction, duration, etc.
- //
- // example:
- // | var t = new dojo.fx.Toggler({
- // | node: "nodeId",
- // | showDuration: 500,
- // | // hideDuration will default to "200"
- // | showFunc: dojo.wipeIn,
- // | // hideFunc will default to "fadeOut"
- // | });
- // | t.show(100); // delay showing for 100ms
- // | // ...time passes...
- // | t.hide();
-
- // FIXME: need a policy for where the toggler should "be" the next
- // time show/hide are called if we're stopped somewhere in the
- // middle.
-
- constructor: function(args){
- var _t = this;
-
- dojo.mixin(_t, args);
- _t.node = args.node;
- _t._showArgs = dojo.mixin({}, args);
- _t._showArgs.node = _t.node;
- _t._showArgs.duration = _t.showDuration;
- _t.showAnim = _t.showFunc(_t._showArgs);
-
- _t._hideArgs = dojo.mixin({}, args);
- _t._hideArgs.node = _t.node;
- _t._hideArgs.duration = _t.hideDuration;
- _t.hideAnim = _t.hideFunc(_t._hideArgs);
-
- dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
- dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
- },
-
- // node: DomNode
- // the node to toggle
- node: null,
-
- // showFunc: Function
- // The function that returns the dojo._Animation to show the node
- showFunc: dojo.fadeIn,
-
- // hideFunc: Function
- // The function that returns the dojo._Animation to hide the node
- hideFunc: dojo.fadeOut,
-
- // showDuration:
- // Time in milliseconds to run the show Animation
- showDuration: 200,
-
- // hideDuration:
- // Time in milliseconds to run the hide Animation
- hideDuration: 200,
-
- /*=====
- _showArgs: null,
- _showAnim: null,
-
- _hideArgs: null,
- _hideAnim: null,
-
- _isShowing: false,
- _isHiding: false,
- =====*/
-
- show: function(delay){
- // summary: Toggle the node to showing
- return this.showAnim.play(delay || 0);
- },
-
- hide: function(delay){
- // summary: Toggle the node to hidden
- return this.hideAnim.play(delay || 0);
- }
-});
-
-dojo.fx.wipeIn = function(/*Object*/ args){
- // summary
- // Returns an animation that will expand the
- // node defined in 'args' object from it's current height to
- // it's natural height (with no scrollbar).
- // Node must have no margin/border/padding.
- args.node = dojo.byId(args.node);
- var node = args.node, s = node.style;
-
- var anim = dojo.animateProperty(dojo.mixin({
- properties: {
- height: {
- // wrapped in functions so we wait till the last second to query (in case value has changed)
- start: function(){
- // start at current [computed] height, but use 1px rather than 0
- // because 0 causes IE to display the whole panel
- s.overflow="hidden";
- if(s.visibility=="hidden"||s.display=="none"){
- s.height="1px";
- s.display="";
- s.visibility="";
- return 1;
- }else{
- var height = dojo.style(node, "height");
- return Math.max(height, 1);
- }
- },
- end: function(){
- return node.scrollHeight;
- }
- }
- }
- }, args));
-
- dojo.connect(anim, "onEnd", function(){
- s.height = "auto";
- });
-
- return anim; // dojo._Animation
-}
-
-dojo.fx.wipeOut = function(/*Object*/ args){
- // summary
- // Returns an animation that will shrink node defined in "args"
- // from it's current height to 1px, and then hide it.
- var node = args.node = dojo.byId(args.node);
- var s = node.style;
-
- var anim = dojo.animateProperty(dojo.mixin({
- properties: {
- height: {
- end: 1 // 0 causes IE to display the whole panel
- }
- }
- }, args));
-
- dojo.connect(anim, "beforeBegin", function(){
- s.overflow = "hidden";
- s.display = "";
- });
- dojo.connect(anim, "onEnd", function(){
- s.height = "auto";
- s.display = "none";
- });
-
- return anim; // dojo._Animation
-}
-
-dojo.fx.slideTo = function(/*Object?*/ args){
- // summary
- // Returns an animation that will slide "node"
- // defined in args Object from its current position to
- // the position defined by (args.left, args.top).
- // example:
- // | dojo.fx.slideTo({ node: node, left:"40", top:"50", unit:"px" }).play()
-
- var node = (args.node = dojo.byId(args.node));
-
- var top = null;
- var left = null;
-
- var init = (function(n){
- return function(){
- var cs = dojo.getComputedStyle(n);
- var pos = cs.position;
- top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
- left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
- if(pos != 'absolute' && pos != 'relative'){
- var ret = dojo.coords(n, true);
- top = ret.y;
- left = ret.x;
- n.style.position="absolute";
- n.style.top=top+"px";
- n.style.left=left+"px";
- }
- };
- })(node);
- init();
-
- var anim = dojo.animateProperty(dojo.mixin({
- properties: {
- top: { end: args.top||0 },
- left: { end: args.left||0 }
- }
- }, args));
- dojo.connect(anim, "beforeBegin", anim, init);
-
- return anim; // dojo._Animation
-}
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/i18n.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/i18n.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/i18n.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,249 +0,0 @@
-if(!dojo._hasResource["dojo.i18n"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.i18n"] = true;
-dojo.provide("dojo.i18n");
-
-/*=====
-dojo.i18n = {
- // summary: Utility classes to enable loading of resources for internationalization (i18n)
-};
-=====*/
-
-dojo.i18n.getLocalization = function(/*String*/packageName, /*String*/bundleName, /*String?*/locale){
- // summary:
- // Returns an Object containing the localization for a given resource
- // bundle in a package, matching the specified locale.
- // description:
- // Returns a hash containing name/value pairs in its prototypesuch
- // that values can be easily overridden. Throws an exception if the
- // bundle is not found. Bundle must have already been loaded by
- // `dojo.requireLocalization()` or by a build optimization step. NOTE:
- // try not to call this method as part of an object property
- // definition (`var foo = { bar: dojo.i18n.getLocalization() }`). In
- // some loading situations, the bundle may not be available in time
- // for the object definition. Instead, call this method inside a
- // function that is run after all modules load or the page loads (like
- // in `dojo.addOnLoad()`), or in a widget lifecycle method.
- // packageName:
- // package which is associated with this resource
- // bundleName:
- // the base filename of the resource bundle (without the ".js" suffix)
- // locale:
- // the variant to load (optional). By default, the locale defined by
- // the host environment: dojo.locale
-
- locale = dojo.i18n.normalizeLocale(locale);
-
- // look for nearest locale match
- var elements = locale.split('-');
- var module = [packageName,"nls",bundleName].join('.');
- var bundle = dojo._loadedModules[module];
- if(bundle){
- var localization;
- for(var i = elements.length; i > 0; i--){
- var loc = elements.slice(0, i).join('_');
- if(bundle[loc]){
- localization = bundle[loc];
- break;
- }
- }
- if(!localization){
- localization = bundle.ROOT;
- }
-
- // make a singleton prototype so that the caller won't accidentally change the values globally
- if(localization){
- var clazz = function(){};
- clazz.prototype = localization;
- return new clazz(); // Object
- }
- }
-
- throw new Error("Bundle not found: " + bundleName + " in " + packageName+" , locale=" + locale);
-};
-
-dojo.i18n.normalizeLocale = function(/*String?*/locale){
- // summary:
- // Returns canonical form of locale, as used by Dojo.
- //
- // description:
- // All variants are case-insensitive and are separated by '-' as specified in [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
- // If no locale is specified, the dojo.locale is returned. dojo.locale is defined by
- // the user agent's locale unless overridden by djConfig.
-
- var result = locale ? locale.toLowerCase() : dojo.locale;
- if(result == "root"){
- result = "ROOT";
- }
- return result; // String
-};
-
-dojo.i18n._requireLocalization = function(/*String*/moduleName, /*String*/bundleName, /*String?*/locale, /*String?*/availableFlatLocales){
- // summary:
- // See dojo.requireLocalization()
- // description:
- // Called by the bootstrap, but factored out so that it is only
- // included in the build when needed.
-
- var targetLocale = dojo.i18n.normalizeLocale(locale);
- var bundlePackage = [moduleName, "nls", bundleName].join(".");
- // NOTE:
- // When loading these resources, the packaging does not match what is
- // on disk. This is an implementation detail, as this is just a
- // private data structure to hold the loaded resources. e.g.
- // `tests/hello/nls/en-us/salutations.js` is loaded as the object
- // `tests.hello.nls.salutations.en_us={...}` The structure on disk is
- // intended to be most convenient for developers and translators, but
- // in memory it is more logical and efficient to store in a different
- // order. Locales cannot use dashes, since the resulting path will
- // not evaluate as valid JS, so we translate them to underscores.
-
- //Find the best-match locale to load if we have available flat locales.
- var bestLocale = "";
- if(availableFlatLocales){
- var flatLocales = availableFlatLocales.split(",");
- for(var i = 0; i < flatLocales.length; i++){
- //Locale must match from start of string.
- if(targetLocale.indexOf(flatLocales[i]) == 0){
- if(flatLocales[i].length > bestLocale.length){
- bestLocale = flatLocales[i];
- }
- }
- }
- if(!bestLocale){
- bestLocale = "ROOT";
- }
- }
-
- //See if the desired locale is already loaded.
- var tempLocale = availableFlatLocales ? bestLocale : targetLocale;
- var bundle = dojo._loadedModules[bundlePackage];
- var localizedBundle = null;
- if(bundle){
- if(dojo.config.localizationComplete && bundle._built){return;}
- var jsLoc = tempLocale.replace(/-/g, '_');
- var translationPackage = bundlePackage+"."+jsLoc;
- localizedBundle = dojo._loadedModules[translationPackage];
- }
-
- if(!localizedBundle){
- bundle = dojo["provide"](bundlePackage);
- var syms = dojo._getModuleSymbols(moduleName);
- var modpath = syms.concat("nls").join("/");
- var parent;
-
- dojo.i18n._searchLocalePath(tempLocale, availableFlatLocales, function(loc){
- var jsLoc = loc.replace(/-/g, '_');
- var translationPackage = bundlePackage + "." + jsLoc;
- var loaded = false;
- if(!dojo._loadedModules[translationPackage]){
- // Mark loaded whether it's found or not, so that further load attempts will not be made
- dojo["provide"](translationPackage);
- var module = [modpath];
- if(loc != "ROOT"){module.push(loc);}
- module.push(bundleName);
- var filespec = module.join("/") + '.js';
- loaded = dojo._loadPath(filespec, null, function(hash){
- // Use singleton with prototype to point to parent bundle, then mix-in result from loadPath
- var clazz = function(){};
- clazz.prototype = parent;
- bundle[jsLoc] = new clazz();
- for(var j in hash){ bundle[jsLoc][j] = hash[j]; }
- });
- }else{
- loaded = true;
- }
- if(loaded && bundle[jsLoc]){
- parent = bundle[jsLoc];
- }else{
- bundle[jsLoc] = parent;
- }
-
- if(availableFlatLocales){
- //Stop the locale path searching if we know the availableFlatLocales, since
- //the first call to this function will load the only bundle that is needed.
- return true;
- }
- });
- }
-
- //Save the best locale bundle as the target locale bundle when we know the
- //the available bundles.
- if(availableFlatLocales && targetLocale != bestLocale){
- bundle[targetLocale.replace(/-/g, '_')] = bundle[bestLocale.replace(/-/g, '_')];
- }
-};
-
-(function(){
- // If other locales are used, dojo.requireLocalization should load them as
- // well, by default.
- //
- // Override dojo.requireLocalization to do load the default bundle, then
- // iterate through the extraLocale list and load those translations as
- // well, unless a particular locale was requested.
-
- var extra = dojo.config.extraLocale;
- if(extra){
- if(!extra instanceof Array){
- extra = [extra];
- }
-
- var req = dojo.i18n._requireLocalization;
- dojo.i18n._requireLocalization = function(m, b, locale, availableFlatLocales){
- req(m,b,locale, availableFlatLocales);
- if(locale){return;}
- for(var i=0; i<extra.length; i++){
- req(m,b,extra[i], availableFlatLocales);
- }
- };
- }
-})();
-
-dojo.i18n._searchLocalePath = function(/*String*/locale, /*Boolean*/down, /*Function*/searchFunc){
- // summary:
- // A helper method to assist in searching for locale-based resources.
- // Will iterate through the variants of a particular locale, either up
- // or down, executing a callback function. For example, "en-us" and
- // true will try "en-us" followed by "en" and finally "ROOT".
-
- locale = dojo.i18n.normalizeLocale(locale);
-
- var elements = locale.split('-');
- var searchlist = [];
- for(var i = elements.length; i > 0; i--){
- searchlist.push(elements.slice(0, i).join('-'));
- }
- searchlist.push(false);
- if(down){searchlist.reverse();}
-
- for(var j = searchlist.length - 1; j >= 0; j--){
- var loc = searchlist[j] || "ROOT";
- var stop = searchFunc(loc);
- if(stop){ break; }
- }
-};
-
-dojo.i18n._preloadLocalizations = function(/*String*/bundlePrefix, /*Array*/localesGenerated){
- // summary:
- // Load built, flattened resource bundles, if available for all
- // locales used in the page. Only called by built layer files.
-
- function preload(locale){
- locale = dojo.i18n.normalizeLocale(locale);
- dojo.i18n._searchLocalePath(locale, true, function(loc){
- for(var i=0; i<localesGenerated.length;i++){
- if(localesGenerated[i] == loc){
- dojo["require"](bundlePrefix+"_"+loc);
- return true; // Boolean
- }
- }
- return false; // Boolean
- });
- }
- preload();
- var extra = dojo.config.extraLocale||[];
- for(var i=0; i<extra.length; i++){
- preload(extra[i]);
- }
-};
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/jaxer.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/jaxer.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/jaxer.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,15 +0,0 @@
-if(!dojo._hasResource["dojo.jaxer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.jaxer"] = true;
-dojo.provide("dojo.jaxer");
-
-if(typeof print == "function"){
- console.debug = Jaxer.Log.debug;
- console.warn = Jaxer.Log.warn;
- console.error = Jaxer.Log.error;
- console.info = Jaxer.Log.info;
- console.log = Jaxer.Log.warn;
-}
-
-onserverload = dojo._loadInit;
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/number.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/number.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/number.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,551 +0,0 @@
-if(!dojo._hasResource["dojo.number"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.number"] = true;
-dojo.provide("dojo.number");
-
-dojo.require("dojo.i18n");
-dojo.requireLocalization("dojo.cldr", "number", null, "zh-cn,zh,ko-kr,pt,en-us,en-gb,de,ja,ja-jp,en,ROOT,en-au,fr,es,ko,zh-tw,it,es-es,de-de");
-dojo.require("dojo.string");
-dojo.require("dojo.regexp");
-
-
-/*=====
-dojo.number = {
- // summary: localized formatting and parsing routines for Number
-}
-
-dojo.number.__FormatOptions = function(){
- // pattern: String?
- // override [formatting pattern](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
- // with this string
- // type: String?
- // choose a format type based on the locale from the following:
- // decimal, scientific, percent, currency. decimal by default.
- // places: Number?
- // fixed number of decimal places to show. This overrides any
- // information in the provided pattern.
- // round: Number?
- // 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
- // means don't round.
- // currency: String?
- // an [ISO4217](http://en.wikipedia.org/wiki/ISO_4217) currency code, a three letter sequence like "USD"
- // symbol: String?
- // localized currency symbol
- // locale: String?
- // override the locale used to determine formatting rules
- this.pattern = pattern;
- this.type = type;
- this.places = places;
- this.round = round;
- this.currency = currency;
- this.symbol = symbol;
- this.locale = locale;
-}
-=====*/
-
-dojo.number.format = function(/*Number*/value, /*dojo.number.__FormatOptions?*/options){
- // summary:
- // Format a Number as a String, using locale-specific settings
- // description:
- // Create a string from a Number using a known localized pattern.
- // Formatting patterns appropriate to the locale are chosen from the
- // [CLDR](http://unicode.org/cldr) as well as the appropriate symbols and
- // delimiters. See <http://www.unicode.org/reports/tr35/#Number_Elements>
- // value:
- // the number to be formatted. If not a valid JavaScript number,
- // return null.
-
- options = dojo.mixin({}, options || {});
- var locale = dojo.i18n.normalizeLocale(options.locale);
- var bundle = dojo.i18n.getLocalization("dojo.cldr", "number", locale);
- options.customs = bundle;
- var pattern = options.pattern || bundle[(options.type || "decimal") + "Format"];
- if(isNaN(value)){ return null; } // null
- return dojo.number._applyPattern(value, pattern, options); // String
-};
-
-//dojo.number._numberPatternRE = /(?:[#0]*,?)*[#0](?:\.0*#*)?/; // not precise, but good enough
-dojo.number._numberPatternRE = /[#0,]*[#0](?:\.0*#*)?/; // not precise, but good enough
-
-dojo.number._applyPattern = function(/*Number*/value, /*String*/pattern, /*dojo.number.__FormatOptions?*/options){
- // summary:
- // Apply pattern to format value as a string using options. Gives no
- // consideration to local customs.
- // value:
- // the number to be formatted.
- // pattern:
- // a pattern string as described by
- // [unicode.org TR35](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
- // options: dojo.number.__FormatOptions?
- // _applyPattern is usually called via `dojo.number.format()` which
- // populates an extra property in the options parameter, "customs".
- // The customs object specifies group and decimal parameters if set.
-
- //TODO: support escapes
- options = options || {};
- var group = options.customs.group;
- var decimal = options.customs.decimal;
-
- var patternList = pattern.split(';');
- var positivePattern = patternList[0];
- pattern = patternList[(value < 0) ? 1 : 0] || ("-" + positivePattern);
-
- //TODO: only test against unescaped
- if(pattern.indexOf('%') != -1){
- value *= 100;
- }else if(pattern.indexOf('\u2030') != -1){
- value *= 1000; // per mille
- }else if(pattern.indexOf('\u00a4') != -1){
- group = options.customs.currencyGroup || group;//mixins instead?
- decimal = options.customs.currencyDecimal || decimal;// Should these be mixins instead?
- pattern = pattern.replace(/\u00a4{1,3}/, function(match){
- var prop = ["symbol", "currency", "displayName"][match.length-1];
- return options[prop] || options.currency || "";
- });
- }else if(pattern.indexOf('E') != -1){
- throw new Error("exponential notation not supported");
- }
-
- //TODO: support @ sig figs?
- var numberPatternRE = dojo.number._numberPatternRE;
- var numberPattern = positivePattern.match(numberPatternRE);
- if(!numberPattern){
- throw new Error("unable to find a number expression in pattern: "+pattern);
- }
- return pattern.replace(numberPatternRE,
- dojo.number._formatAbsolute(value, numberPattern[0], {decimal: decimal, group: group, places: options.places}));
-}
-
-dojo.number.round = function(/*Number*/value, /*Number*/places, /*Number?*/multiple){
- // summary:
- // Rounds the number at the given number of places
- // value:
- // the number to round
- // places:
- // the number of decimal places where rounding takes place
- // multiple:
- // rounds next place to nearest multiple
-
- var pieces = String(value).split(".");
- var length = (pieces[1] && pieces[1].length) || 0;
- if(length > places){
- var factor = Math.pow(10, places);
- if(multiple > 0){factor *= 10/multiple;places++;} //FIXME
- value = Math.round(value * factor)/factor;
-
- // truncate to remove any residual floating point values
- pieces = String(value).split(".");
- length = (pieces[1] && pieces[1].length) || 0;
- if(length > places){
- pieces[1] = pieces[1].substr(0, places);
- value = Number(pieces.join("."));
- }
- }
- return value; //Number
-}
-
-/*=====
-dojo.number.__FormatAbsoluteOptions = function(){
- // decimal: String?
- // the decimal separator
- // group: String?
- // the group separator
- // places: Integer?
- // number of decimal places
- // round: Number?
- // 5 rounds to nearest .5; 0 rounds to nearest whole (default). -1
- // means don't round.
- this.decimal = decimal;
- this.group = group;
- this.places = places;
- this.round = round;
-}
-=====*/
-
-dojo.number._formatAbsolute = function(/*Number*/value, /*String*/pattern, /*dojo.number.__FormatAbsoluteOptions?*/options){
- // summary:
- // Apply numeric pattern to absolute value using options. Gives no
- // consideration to local customs.
- // value:
- // the number to be formatted, ignores sign
- // pattern:
- // the number portion of a pattern (e.g. `#,##0.00`)
- options = options || {};
- if(options.places === true){options.places=0;}
- if(options.places === Infinity){options.places=6;} // avoid a loop; pick a limit
-
- var patternParts = pattern.split(".");
- var maxPlaces = (options.places >= 0) ? options.places : (patternParts[1] && patternParts[1].length) || 0;
- if(!(options.round < 0)){
- value = dojo.number.round(value, maxPlaces, options.round);
- }
-
- var valueParts = String(Math.abs(value)).split(".");
- var fractional = valueParts[1] || "";
- if(options.places){
- valueParts[1] = dojo.string.pad(fractional.substr(0, options.places), options.places, '0', true);
- }else if(patternParts[1] && options.places !== 0){
- // Pad fractional with trailing zeros
- var pad = patternParts[1].lastIndexOf("0") + 1;
- if(pad > fractional.length){
- valueParts[1] = dojo.string.pad(fractional, pad, '0', true);
- }
-
- // Truncate fractional
- var places = patternParts[1].length;
- if(places < fractional.length){
- valueParts[1] = fractional.substr(0, places);
- }
- }else{
- if(valueParts[1]){ valueParts.pop(); }
- }
-
- // Pad whole with leading zeros
- var patternDigits = patternParts[0].replace(',', '');
- pad = patternDigits.indexOf("0");
- if(pad != -1){
- pad = patternDigits.length - pad;
- if(pad > valueParts[0].length){
- valueParts[0] = dojo.string.pad(valueParts[0], pad);
- }
-
- // Truncate whole
- if(patternDigits.indexOf("#") == -1){
- valueParts[0] = valueParts[0].substr(valueParts[0].length - pad);
- }
- }
-
- // Add group separators
- var index = patternParts[0].lastIndexOf(',');
- var groupSize, groupSize2;
- if(index != -1){
- groupSize = patternParts[0].length - index - 1;
- var remainder = patternParts[0].substr(0, index);
- index = remainder.lastIndexOf(',');
- if(index != -1){
- groupSize2 = remainder.length - index - 1;
- }
- }
- var pieces = [];
- for(var whole = valueParts[0]; whole;){
- var off = whole.length - groupSize;
- pieces.push((off > 0) ? whole.substr(off) : whole);
- whole = (off > 0) ? whole.slice(0, off) : "";
- if(groupSize2){
- groupSize = groupSize2;
- delete groupSize2;
- }
- }
- valueParts[0] = pieces.reverse().join(options.group || ",");
-
- return valueParts.join(options.decimal || ".");
-};
-
-/*=====
-dojo.number.__RegexpOptions = function(){
- // pattern: String?
- // override pattern with this string. Default is provided based on
- // locale.
- // type: String?
- // choose a format type based on the locale from the following:
- // decimal, scientific, percent, currency. decimal by default.
- // locale: String?
- // override the locale used to determine formatting rules
- // strict: Boolean?
- // strict parsing, false by default
- // places: Number|String?
- // number of decimal places to accept: Infinity, a positive number, or
- // a range "n,m". By default, defined by pattern.
- this.pattern = pattern;
- this.type = type;
- this.locale = locale;
- this.strict = strict;
- this.places = places;
-}
-=====*/
-dojo.number.regexp = function(/*dojo.number.__RegexpOptions?*/options){
- // summary:
- // Builds the regular needed to parse a number
- // description:
- // Returns regular expression with positive and negative match, group
- // and decimal separators
- return dojo.number._parseInfo(options).regexp; // String
-}
-
-dojo.number._parseInfo = function(/*Object?*/options){
- options = options || {};
- var locale = dojo.i18n.normalizeLocale(options.locale);
- var bundle = dojo.i18n.getLocalization("dojo.cldr", "number", locale);
- var pattern = options.pattern || bundle[(options.type || "decimal") + "Format"];
-//TODO: memoize?
- var group = bundle.group;
- var decimal = bundle.decimal;
- var factor = 1;
-
- if(pattern.indexOf('%') != -1){
- factor /= 100;
- }else if(pattern.indexOf('\u2030') != -1){
- factor /= 1000; // per mille
- }else{
- var isCurrency = pattern.indexOf('\u00a4') != -1;
- if(isCurrency){
- group = bundle.currencyGroup || group;
- decimal = bundle.currencyDecimal || decimal;
- }
- }
-
- //TODO: handle quoted escapes
- var patternList = pattern.split(';');
- if(patternList.length == 1){
- patternList.push("-" + patternList[0]);
- }
-
- var re = dojo.regexp.buildGroupRE(patternList, function(pattern){
- pattern = "(?:"+dojo.regexp.escapeString(pattern, '.')+")";
- return pattern.replace(dojo.number._numberPatternRE, function(format){
- var flags = {
- signed: false,
- separator: options.strict ? group : [group,""],
- fractional: options.fractional,
- decimal: decimal,
- exponent: false};
- var parts = format.split('.');
- var places = options.places;
- if(parts.length == 1 || places === 0){flags.fractional = false;}
- else{
- if(places === undefined){ places = parts[1].lastIndexOf('0')+1; }
- if(places && options.fractional == undefined){flags.fractional = true;} // required fractional, unless otherwise specified
- if(!options.places && (places < parts[1].length)){ places += "," + parts[1].length; }
- flags.places = places;
- }
- var groups = parts[0].split(',');
- if(groups.length>1){
- flags.groupSize = groups.pop().length;
- if(groups.length>1){
- flags.groupSize2 = groups.pop().length;
- }
- }
- return "("+dojo.number._realNumberRegexp(flags)+")";
- });
- }, true);
-
- if(isCurrency){
- // substitute the currency symbol for the placeholder in the pattern
- re = re.replace(/(\s*)(\u00a4{1,3})(\s*)/g, function(match, before, target, after){
- var prop = ["symbol", "currency", "displayName"][target.length-1];
- var symbol = dojo.regexp.escapeString(options[prop] || options.currency || "");
- before = before ? "\\s" : "";
- after = after ? "\\s" : "";
- if(!options.strict){
- if(before){before += "*";}
- if(after){after += "*";}
- return "(?:"+before+symbol+after+")?";
- }
- return before+symbol+after;
- });
- }
-
-//TODO: substitute localized sign/percent/permille/etc.?
-
- // normalize whitespace and return
- return {regexp: re.replace(/[\xa0 ]/g, "[\\s\\xa0]"), group: group, decimal: decimal, factor: factor}; // Object
-}
-
-/*=====
-dojo.number.__ParseOptions = function(){
- // pattern: String
- // override pattern with this string. Default is provided based on
- // locale.
- // type: String?
- // choose a format type based on the locale from the following:
- // decimal, scientific, percent, currency. decimal by default.
- // locale: String
- // override the locale used to determine formatting rules
- // strict: Boolean?
- // strict parsing, false by default
- // currency: Object
- // object with currency information
- this.pattern = pattern;
- this.type = type;
- this.locale = locale;
- this.strict = strict;
- this.currency = currency;
-}
-=====*/
-dojo.number.parse = function(/*String*/expression, /*dojo.number.__ParseOptions?*/options){
- // summary:
- // Convert a properly formatted string to a primitive Number, using
- // locale-specific settings.
- // description:
- // Create a Number from a string using a known localized pattern.
- // Formatting patterns are chosen appropriate to the locale
- // and follow the syntax described by
- // [unicode.org TR35](http://www.unicode.org/reports/tr35/#Number_Format_Patterns)
- // expression:
- // A string representation of a Number
- var info = dojo.number._parseInfo(options);
- var results = (new RegExp("^"+info.regexp+"$")).exec(expression);
- if(!results){
- return NaN; //NaN
- }
- var absoluteMatch = results[1]; // match for the positive expression
- if(!results[1]){
- if(!results[2]){
- return NaN; //NaN
- }
- // matched the negative pattern
- absoluteMatch =results[2];
- info.factor *= -1;
- }
-
- // Transform it to something Javascript can parse as a number. Normalize
- // decimal point and strip out group separators or alternate forms of whitespace
- absoluteMatch = absoluteMatch.
- replace(new RegExp("["+info.group + "\\s\\xa0"+"]", "g"), "").
- replace(info.decimal, ".");
- // Adjust for negative sign, percent, etc. as necessary
- return Number(absoluteMatch) * info.factor; //Number
-};
-
-/*=====
-dojo.number.__RealNumberRegexpFlags = function(){
- // places: Number?
- // The integer number of decimal places or a range given as "n,m". If
- // not given, the decimal part is optional and the number of places is
- // unlimited.
- // decimal: String?
- // A string for the character used as the decimal point. Default
- // is ".".
- // fractional: Boolean|Array?
- // Whether decimal places are allowed. Can be true, false, or [true,
- // false]. Default is [true, false]
- // exponent: Boolean|Array?
- // Express in exponential notation. Can be true, false, or [true,
- // false]. Default is [true, false], (i.e. will match if the
- // exponential part is present are not).
- // eSigned: Boolean|Array?
- // The leading plus-or-minus sign on the exponent. Can be true,
- // false, or [true, false]. Default is [true, false], (i.e. will
- // match if it is signed or unsigned). flags in regexp.integer can be
- // applied.
- this.places = places;
- this.decimal = decimal;
- this.fractional = fractional;
- this.exponent = exponent;
- this.eSigned = eSigned;
-}
-=====*/
-
-dojo.number._realNumberRegexp = function(/*dojo.number.__RealNumberRegexpFlags?*/flags){
- // summary:
- // Builds a regular expression to match a real number in exponential
- // notation
-
- // assign default values to missing paramters
- flags = flags || {};
- //TODO: use mixin instead?
- if(!("places" in flags)){ flags.places = Infinity; }
- if(typeof flags.decimal != "string"){ flags.decimal = "."; }
- if(!("fractional" in flags) || /^0/.test(flags.places)){ flags.fractional = [true, false]; }
- if(!("exponent" in flags)){ flags.exponent = [true, false]; }
- if(!("eSigned" in flags)){ flags.eSigned = [true, false]; }
-
- // integer RE
- var integerRE = dojo.number._integerRegexp(flags);
-
- // decimal RE
- var decimalRE = dojo.regexp.buildGroupRE(flags.fractional,
- function(q){
- var re = "";
- if(q && (flags.places!==0)){
- re = "\\" + flags.decimal;
- if(flags.places == Infinity){
- re = "(?:" + re + "\\d+)?";
- }else{
- re += "\\d{" + flags.places + "}";
- }
- }
- return re;
- },
- true
- );
-
- // exponent RE
- var exponentRE = dojo.regexp.buildGroupRE(flags.exponent,
- function(q){
- if(q){ return "([eE]" + dojo.number._integerRegexp({ signed: flags.eSigned}) + ")"; }
- return "";
- }
- );
-
- // real number RE
- var realRE = integerRE + decimalRE;
- // allow for decimals without integers, e.g. .25
- if(decimalRE){realRE = "(?:(?:"+ realRE + ")|(?:" + decimalRE + "))";}
- return realRE + exponentRE; // String
-};
-
-/*=====
-dojo.number.__IntegerRegexpFlags = function(){
- // signed: Boolean?
- // The leading plus-or-minus sign. Can be true, false, or `[true,false]`.
- // Default is `[true, false]`, (i.e. will match if it is signed
- // or unsigned).
- // separator: String?
- // The character used as the thousands separator. Default is no
- // separator. For more than one symbol use an array, e.g. `[",", ""]`,
- // makes ',' optional.
- // groupSize: Number?
- // group size between separators
- // groupSize2: Number?
- // second grouping, where separators 2..n have a different interval than the first separator (for India)
- this.signed = signed;
- this.separator = separator;
- this.groupSize = groupSize;
- this.groupSize2 = groupSize2;
-}
-=====*/
-
-dojo.number._integerRegexp = function(/*dojo.number.__IntegerRegexpFlags?*/flags){
- // summary:
- // Builds a regular expression that matches an integer
-
- // assign default values to missing paramters
- flags = flags || {};
- if(!("signed" in flags)){ flags.signed = [true, false]; }
- if(!("separator" in flags)){
- flags.separator = "";
- }else if(!("groupSize" in flags)){
- flags.groupSize = 3;
- }
- // build sign RE
- var signRE = dojo.regexp.buildGroupRE(flags.signed,
- function(q) { return q ? "[-+]" : ""; },
- true
- );
-
- // number RE
- var numberRE = dojo.regexp.buildGroupRE(flags.separator,
- function(sep){
- if(!sep){
- return "(?:0|[1-9]\\d*)";
- }
-
- sep = dojo.regexp.escapeString(sep);
- if(sep == " "){ sep = "\\s"; }
- else if(sep == "\xa0"){ sep = "\\s\\xa0"; }
-
- var grp = flags.groupSize, grp2 = flags.groupSize2;
- if(grp2){
- var grp2RE = "(?:0|[1-9]\\d{0," + (grp2-1) + "}(?:[" + sep + "]\\d{" + grp2 + "})*[" + sep + "]\\d{" + grp + "})";
- return ((grp-grp2) > 0) ? "(?:" + grp2RE + "|(?:0|[1-9]\\d{0," + (grp-1) + "}))" : grp2RE;
- }
- return "(?:0|[1-9]\\d{0," + (grp-1) + "}(?:[" + sep + "]\\d{" + grp + "})*)";
- },
- true
- );
-
- // integer RE
- return signRE + numberRE; // String
-}
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/parser.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/parser.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/parser.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,277 +0,0 @@
-if(!dojo._hasResource["dojo.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.parser"] = true;
-dojo.provide("dojo.parser");
-dojo.require("dojo.date.stamp");
-
-dojo.parser = new function(){
- // summary: The Dom/Widget parsing package
-
- var d = dojo;
- var dtName = d._scopeName + "Type";
- var qry = "[" + dtName + "]";
-
- function val2type(/*Object*/ value){
- // summary:
- // Returns name of type of given value.
-
- if(d.isString(value)){ return "string"; }
- if(typeof value == "number"){ return "number"; }
- if(typeof value == "boolean"){ return "boolean"; }
- if(d.isFunction(value)){ return "function"; }
- if(d.isArray(value)){ return "array"; } // typeof [] == "object"
- if(value instanceof Date) { return "date"; } // assume timestamp
- if(value instanceof d._Url){ return "url"; }
- return "object";
- }
-
- function str2obj(/*String*/ value, /*String*/ type){
- // summary:
- // Convert given string value to given type
- switch(type){
- case "string":
- return value;
- case "number":
- return value.length ? Number(value) : NaN;
- case "boolean":
- // for checked/disabled value might be "" or "checked". interpret as true.
- return typeof value == "boolean" ? value : !(value.toLowerCase()=="false");
- case "function":
- if(d.isFunction(value)){
- // IE gives us a function, even when we say something like onClick="foo"
- // (in which case it gives us an invalid function "function(){ foo }").
- // Therefore, convert to string
- value=value.toString();
- value=d.trim(value.substring(value.indexOf('{')+1, value.length-1));
- }
- try{
- if(value.search(/[^\w\.]+/i) != -1){
- // TODO: "this" here won't work
- value = d.parser._nameAnonFunc(new Function(value), this);
- }
- return d.getObject(value, false);
- }catch(e){ return new Function(); }
- case "array":
- return value.split(/\s*,\s*/);
- case "date":
- switch(value){
- case "": return new Date(""); // the NaN of dates
- case "now": return new Date(); // current date
- default: return d.date.stamp.fromISOString(value);
- }
- case "url":
- return d.baseUrl + value;
- default:
- return d.fromJson(value);
- }
- }
-
- var instanceClasses = {
- // map from fully qualified name (like "dijit.Button") to structure like
- // { cls: dijit.Button, params: {label: "string", disabled: "boolean"} }
- };
-
- function getClassInfo(/*String*/ className){
- // className:
- // fully qualified name (like "dijit.Button")
- // returns:
- // structure like
- // {
- // cls: dijit.Button,
- // params: { label: "string", disabled: "boolean"}
- // }
-
- if(!instanceClasses[className]){
- // get pointer to widget class
- var cls = d.getObject(className);
- if(!d.isFunction(cls)){
- throw new Error("Could not load class '" + className +
- "'. Did you spell the name correctly and use a full path, like 'dijit.form.Button'?");
- }
- var proto = cls.prototype;
-
- // get table of parameter names & types
- var params={};
- for(var name in proto){
- if(name.charAt(0)=="_"){ continue; } // skip internal properties
- var defVal = proto[name];
- params[name]=val2type(defVal);
- }
-
- instanceClasses[className] = { cls: cls, params: params };
- }
- return instanceClasses[className];
- }
-
- this._functionFromScript = function(script){
- var preamble = "";
- var suffix = "";
- var argsStr = script.getAttribute("args");
- if(argsStr){
- d.forEach(argsStr.split(/\s*,\s*/), function(part, idx){
- preamble += "var "+part+" = arguments["+idx+"]; ";
- });
- }
- var withStr = script.getAttribute("with");
- if(withStr && withStr.length){
- d.forEach(withStr.split(/\s*,\s*/), function(part){
- preamble += "with("+part+"){";
- suffix += "}";
- });
- }
- return new Function(preamble+script.innerHTML+suffix);
- }
-
- this.instantiate = function(/* Array */nodes){
- // summary:
- // Takes array of nodes, and turns them into class instances and
- // potentially calls a layout method to allow them to connect with
- // any children
- var thelist = [];
- d.forEach(nodes, function(node){
- if(!node){ return; }
- var type = node.getAttribute(dtName);
- if((!type)||(!type.length)){ return; }
- var clsInfo = getClassInfo(type);
- var clazz = clsInfo.cls;
- var ps = clazz._noScript||clazz.prototype._noScript;
-
- // read parameters (ie, attributes).
- // clsInfo.params lists expected params like {"checked": "boolean", "n": "number"}
- var params = {};
- var attributes = node.attributes;
- for(var name in clsInfo.params){
- var item = attributes.getNamedItem(name);
- if(!item || (!item.specified && (!dojo.isIE || name.toLowerCase()!="value"))){ continue; }
- var value = item.value;
- // Deal with IE quirks for 'class' and 'style'
- switch(name){
- case "class":
- value = node.className;
- break;
- case "style":
- value = node.style && node.style.cssText; // FIXME: Opera?
- }
- var _type = clsInfo.params[name];
- params[name] = str2obj(value, _type);
- }
-
- // Process <script type="dojo/*"> script tags
- // <script type="dojo/method" event="foo"> tags are added to params, and passed to
- // the widget on instantiation.
- // <script type="dojo/method"> tags (with no event) are executed after instantiation
- // <script type="dojo/connect" event="foo"> tags are dojo.connected after instantiation
- // note: dojo/* script tags cannot exist in self closing widgets, like <input />
- if(!ps){
- var connects = [], // functions to connect after instantiation
- calls = []; // functions to call after instantiation
-
- d.query("> script[type^='dojo/']", node).orphan().forEach(function(script){
- var event = script.getAttribute("event"),
- type = script.getAttribute("type"),
- nf = d.parser._functionFromScript(script);
- if(event){
- if(type == "dojo/connect"){
- connects.push({event: event, func: nf});
- }else{
- params[event] = nf;
- }
- }else{
- calls.push(nf);
- }
- });
- }
-
- var markupFactory = clazz["markupFactory"];
- if(!markupFactory && clazz["prototype"]){
- markupFactory = clazz.prototype["markupFactory"];
- }
- // create the instance
- var instance = markupFactory ? markupFactory(params, node, clazz) : new clazz(params, node);
- thelist.push(instance);
-
- // map it to the JS namespace if that makes sense
- var jsname = node.getAttribute("jsId");
- if(jsname){
- d.setObject(jsname, instance);
- }
-
- // process connections and startup functions
- if(!ps){
- d.forEach(connects, function(connect){
- d.connect(instance, connect.event, null, connect.func);
- });
- d.forEach(calls, function(func){
- func.call(instance);
- });
- }
- });
-
- // Call startup on each top level instance if it makes sense (as for
- // widgets). Parent widgets will recursively call startup on their
- // (non-top level) children
- d.forEach(thelist, function(instance){
- if( instance &&
- instance.startup &&
- !instance._started &&
- (!instance.getParent || !instance.getParent())
- ){
- instance.startup();
- }
- });
- return thelist;
- };
-
- this.parse = function(/*DomNode?*/ rootNode){
- // summary:
- // Search specified node (or root node) recursively for class instances,
- // and instantiate them Searches for
- // dojoType="qualified.class.name"
- var list = d.query(qry, rootNode);
- // go build the object instances
- var instances = this.instantiate(list);
- return instances;
- };
-}();
-
-//Register the parser callback. It should be the first callback
-//after the a11y test.
-
-(function(){
- var parseRunner = function(){
- if(dojo.config["parseOnLoad"] == true){
- dojo.parser.parse();
- }
- };
-
- // FIXME: need to clobber cross-dependency!!
- if(dojo.exists("dijit.wai.onload") && (dijit.wai.onload === dojo._loaders[0])){
- dojo._loaders.splice(1, 0, parseRunner);
- }else{
- dojo._loaders.unshift(parseRunner);
- }
-})();
-
-//TODO: ported from 0.4.x Dojo. Can we reduce this?
-dojo.parser._anonCtr = 0;
-dojo.parser._anon = {}; // why is this property required?
-dojo.parser._nameAnonFunc = function(/*Function*/anonFuncPtr, /*Object*/thisObj){
- // summary:
- // Creates a reference to anonFuncPtr in thisObj with a completely
- // unique name. The new name is returned as a String.
- var jpn = "$joinpoint";
- var nso = (thisObj|| dojo.parser._anon);
- if(dojo.isIE){
- var cn = anonFuncPtr["__dojoNameCache"];
- if(cn && nso[cn] === anonFuncPtr){
- return anonFuncPtr["__dojoNameCache"];
- }
- }
- var ret = "__"+dojo.parser._anonCtr++;
- while(typeof nso[ret] != "undefined"){
- ret = "__"+dojo.parser._anonCtr++;
- }
- nso[ret] = anonFuncPtr;
- return ret; // String
-}
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/regexp.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/regexp.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/regexp.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,69 +0,0 @@
-if(!dojo._hasResource["dojo.regexp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.regexp"] = true;
-dojo.provide("dojo.regexp");
-
-/*=====
-dojo.regexp = {
- // summary: Regular expressions and Builder resources
-};
-=====*/
-
-dojo.regexp.escapeString = function(/*String*/str, /*String?*/except){
- // summary:
- // Adds escape sequences for special characters in regular expressions
- // except:
- // a String with special characters to be left unescaped
-
-// return str.replace(/([\f\b\n\t\r[\^$|?*+(){}])/gm, "\\$1"); // string
- return str.replace(/([\.$?*!=:|{}\(\)\[\]\\\/^])/g, function(ch){
- if(except && except.indexOf(ch) != -1){
- return ch;
- }
- return "\\" + ch;
- }); // String
-}
-
-dojo.regexp.buildGroupRE = function(/*Object|Array*/arr, /*Function*/re, /*Boolean?*/nonCapture){
- // summary:
- // Builds a regular expression that groups subexpressions
- // description:
- // A utility function used by some of the RE generators. The
- // subexpressions are constructed by the function, re, in the second
- // parameter. re builds one subexpression for each elem in the array
- // a, in the first parameter. Returns a string for a regular
- // expression that groups all the subexpressions.
- // arr:
- // A single value or an array of values.
- // re:
- // A function. Takes one parameter and converts it to a regular
- // expression.
- // nonCapture:
- // If true, uses non-capturing match, otherwise matches are retained
- // by regular expression. Defaults to false
-
- // case 1: a is a single value.
- if(!(arr instanceof Array)){
- return re(arr); // String
- }
-
- // case 2: a is an array
- var b = [];
- for(var i = 0; i < arr.length; i++){
- // convert each elem to a RE
- b.push(re(arr[i]));
- }
-
- // join the REs as alternatives in a RE group.
- return dojo.regexp.group(b.join("|"), nonCapture); // String
-}
-
-dojo.regexp.group = function(/*String*/expression, /*Boolean?*/nonCapture){
- // summary:
- // adds group match to expression
- // nonCapture:
- // If true, uses non-capturing match, otherwise matches are retained
- // by regular expression.
- return "(" + (nonCapture ? "?:":"") + expression + ")"; // String
-}
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/string.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/string.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/string.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,84 +0,0 @@
-if(!dojo._hasResource["dojo.string"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojo.string"] = true;
-dojo.provide("dojo.string");
-
-/*=====
-dojo.string = {
- // summary: String utilities for Dojo
-};
-=====*/
-
-dojo.string.pad = function(/*String*/text, /*int*/size, /*String?*/ch, /*boolean?*/end){
- // summary:
- // Pad a string to guarantee that it is at least `size` length by
- // filling with the character `ch` at either the start or end of the
- // string. Pads at the start, by default.
- // text: the string to pad
- // size: length to provide padding
- // ch: character to pad, defaults to '0'
- // end: adds padding at the end if true, otherwise pads at start
-
- var out = String(text);
- if(!ch){
- ch = '0';
- }
- while(out.length < size){
- if(end){
- out += ch;
- }else{
- out = ch + out;
- }
- }
- return out; // String
-};
-
-dojo.string.substitute = function( /*String*/template,
- /*Object|Array*/map,
- /*Function?*/transform,
- /*Object?*/thisObject){
- // summary:
- // Performs parameterized substitutions on a string. Throws an
- // exception if any parameter is unmatched.
- // description:
- // For example,
- // | dojo.string.substitute("File '${0}' is not found in directory '${1}'.",["foo.html","/temp"]);
- // | dojo.string.substitute("File '${name}' is not found in directory '${info.dir}'.",
- // | {name: "foo.html", info: {dir: "/temp"}});
- // both return
- // | "File 'foo.html' is not found in directory '/temp'."
- // template:
- // a string with expressions in the form `${key}` to be replaced or
- // `${key:format}` which specifies a format function.
- // map: hash to search for substitutions
- // transform:
- // a function to process all parameters before substitution takes
- // place, e.g. dojo.string.encodeXML
- // thisObject:
- // where to look for optional format function; default to the global
- // namespace
-
- return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g, function(match, key, format){
- var value = dojo.getObject(key,false,map);
- if(format){ value = dojo.getObject(format,false,thisObject)(value);}
- if(transform){ value = transform(value, key); }
- return value.toString();
- }); // string
-};
-
-dojo.string.trim = function(/*String*/ str){
- // summary: trims whitespaces from both sides of the string
- // description:
- // This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript).
- // The short yet performant version of this function is
- // dojo.trim(), which is part of Dojo base.
- str = str.replace(/^\s+/, '');
- for(var i = str.length - 1; i > 0; i--){
- if(/\S/.test(str.charAt(i))){
- str = str.substring(0, i + 1);
- break;
- }
- }
- return str; // String
-};
-
-}
Deleted: branches/vhffs-design/vhffs-panel/js/dojo/tests.js
===================================================================
--- branches/vhffs-design/vhffs-panel/js/dojo/tests.js 2009-03-09 12:09:29 UTC (rev 1354)
+++ branches/vhffs-design/vhffs-panel/js/dojo/tests.js 2009-03-09 12:28:36 UTC (rev 1355)
@@ -1,12 +0,0 @@
-//This file is the command-line entry point for running the tests in
-//Rhino and Spidermonkey.
-
-/*=====
-dojo.tests = {
- // summary: D.O.H. Test files for Dojo unit testing.
-};
-=====*/
-
-load("dojo.js");
-load("tests/runner.js");
-tests.run();